@piwitests/server 0.16.0 → 0.18.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/{Dz55UR7w.js → 36cXPVrY.js} +1 -1
- package/.output/public/_nuxt/{IFqRT_xJ.js → 87SGk1nu.js} +1 -1
- package/.output/public/_nuxt/{bAfTAihV.js → AjuKBlzz.js} +1 -1
- package/.output/public/_nuxt/{1AB111xL.js → B1CB30tg.js} +1 -1
- package/.output/public/_nuxt/{Br2K9yi_.js → B6IHiVa1.js} +1 -1
- package/.output/public/_nuxt/{iwD5atI2.js → B6rt3IcG.js} +1 -1
- package/.output/public/_nuxt/{Bvfmwzgw.js → BAaSmp8J.js} +1 -1
- package/.output/public/_nuxt/{DRtTLQri.js → BAkJhSAW.js} +1 -1
- package/.output/public/_nuxt/{DuBBqqbF.js → BCArQk0c.js} +1 -1
- package/.output/public/_nuxt/{BV83yObd.js → BEB2Mv6B.js} +1 -1
- package/.output/public/_nuxt/BFjmLXYo.js +8 -0
- package/.output/public/_nuxt/BJltXwHg.js +1 -0
- package/.output/public/_nuxt/{CuYYdFBL.js → BKaU95es.js} +1 -1
- package/.output/public/_nuxt/{2xvsvjLO.js → BReNbog6.js} +1 -1
- package/.output/public/_nuxt/{DJS3Bf50.js → BTYiG93l.js} +1 -1
- package/.output/public/_nuxt/{k-z_VVTK.js → BUMZHDRC.js} +1 -1
- package/.output/public/_nuxt/BVDBIVAQ.js +1 -0
- package/.output/public/_nuxt/{JCFZINev.js → B_aSGB8S.js} +1 -1
- package/.output/public/_nuxt/{e1zUTrBb.js → BaDv5D7A.js} +1 -1
- package/.output/public/_nuxt/{DjZKuUMz.js → BdHdHyop.js} +1 -1
- package/.output/public/_nuxt/{CJFqA_QW.js → BfoG8R5a.js} +1 -1
- package/.output/public/_nuxt/{CgoAUz76.js → Bi3i470l.js} +1 -1
- package/.output/public/_nuxt/Bi9DO8jm.js +1 -0
- package/.output/public/_nuxt/{BS0gKVuF.js → BiX7c2qU.js} +1 -1
- package/.output/public/_nuxt/{-KQO1A4C.js → BoC6qaRF.js} +4 -4
- package/.output/public/_nuxt/{CSYJwpXG.js → BsDB_eCd.js} +1 -1
- package/.output/public/_nuxt/{B43OGXzV.js → BuuvTH9e.js} +1 -1
- package/.output/public/_nuxt/{BRKa6EQR.js → C11lmBd4.js} +1 -1
- package/.output/public/_nuxt/C4AfzZER.js +47 -0
- package/.output/public/_nuxt/{BBdfPriC.js → C7ZVzS0K.js} +1 -1
- package/.output/public/_nuxt/{CQeMb57w.js → C8cz5feG.js} +1 -1
- package/.output/public/_nuxt/{Dzz9_Z0u.js → C9EpbPNU.js} +1 -1
- package/.output/public/_nuxt/{qzAP_nm7.js → C9ahP7km.js} +1 -1
- package/.output/public/_nuxt/{N3pCB6-m.js → CBEM3L1q.js} +1 -1
- package/.output/public/_nuxt/{C1K3r_fc.js → CCsl9MOZ.js} +1 -1
- package/.output/public/_nuxt/{BpceIssd.js → CCw3Tx4S.js} +1 -1
- package/.output/public/_nuxt/{B3NbDoBP.js → CGq9qR-0.js} +1 -1
- package/.output/public/_nuxt/{BoRFLTAO.js → CLdGRzLL.js} +1 -1
- package/.output/public/_nuxt/{BZekCf_x.js → CP0vUzbd.js} +1 -1
- package/.output/public/_nuxt/CPZ5wygb.js +1 -0
- package/.output/public/_nuxt/{CTdvGdc2.js → CRcjGmf7.js} +1 -1
- package/.output/public/_nuxt/{B2lYFco4.js → CRpbGS75.js} +1 -1
- package/.output/public/_nuxt/CTgM5Fke.js +2 -0
- package/.output/public/_nuxt/{DcCNnjKl.js → CU3W9YrI.js} +1 -1
- package/.output/public/_nuxt/{BIksQZfR.js → CUDeMcEK.js} +1 -1
- package/.output/public/_nuxt/{BpNqHxg2.js → CYIR2GbL.js} +1 -1
- package/.output/public/_nuxt/{ze9-Ill2.js → Ccit_CX1.js} +1 -1
- package/.output/public/_nuxt/CiPH-swI.js +1 -0
- package/.output/public/_nuxt/{BkDfdHFm.js → ClIKZ4qY.js} +1 -1
- package/.output/public/_nuxt/{BVW5qIDP.js → ClVRQpP_.js} +1 -1
- package/.output/public/_nuxt/CmbjAoQu.js +1 -0
- package/.output/public/_nuxt/Cx65B3c3.js +1 -0
- package/.output/public/_nuxt/{B3sNtVnf.js → D1ttGJfs.js} +1 -1
- package/.output/public/_nuxt/{DuMv-ugy.js → D3MWm6JP.js} +1 -1
- package/.output/public/_nuxt/{BPKwYP2Q.js → D3SYPlEB.js} +28 -28
- package/.output/public/_nuxt/{BGYbnqA7.js → D4SFgXAf.js} +1 -1
- package/.output/public/_nuxt/D51_cB9D.js +1 -0
- package/.output/public/_nuxt/{DbeHHTk-.js → D8YZvjas.js} +1 -1
- package/.output/public/_nuxt/{DgYM3eyi.js → DB3ljns7.js} +1 -1
- package/.output/public/_nuxt/{Bzl2H_vl.js → DC51KKt4.js} +1 -1
- package/.output/public/_nuxt/{BR9H8k-L.js → DCMFuzDI.js} +1 -1
- package/.output/public/_nuxt/{mfzslNx_.js → DIA_NAIv.js} +1 -1
- package/.output/public/_nuxt/{CKB_doYB.js → DM_YaJgJ.js} +1 -1
- package/.output/public/_nuxt/{BuZOa2M3.js → DOr_4nln.js} +2 -2
- package/.output/public/_nuxt/{oNq5pd3r.js → DRE6Aqqp.js} +1 -1
- package/.output/public/_nuxt/{CMYQpoOI.js → DVgMaBxD.js} +1 -1
- package/.output/public/_nuxt/{C3r_Sv1p.js → DaewB_zT.js} +1 -1
- package/.output/public/_nuxt/{DdbrJwT-.js → Db_-yjYg.js} +1 -1
- package/.output/public/_nuxt/{CpO-ABDW.js → Dbg8z684.js} +1 -1
- package/.output/public/_nuxt/{DOuoR2Pk.js → DcfRfTaA.js} +1 -1
- package/.output/public/_nuxt/{BpIsBP5g.js → Dm1_3W9g.js} +1 -1
- package/.output/public/_nuxt/{ABGJk0pu.js → DnThe2U0.js} +1 -1
- package/.output/public/_nuxt/{C38aZbFJ.js → Do6zIWQf.js} +1 -1
- package/.output/public/_nuxt/{B7yG1G_l.js → DoFSKAvY.js} +1 -1
- package/.output/public/_nuxt/{C8RBRg7I.js → DoYgYLOd.js} +1 -1
- package/.output/public/_nuxt/{BIf1R_fu.js → Doul3p1_.js} +1 -1
- package/.output/public/_nuxt/{BQrSEuzu.js → DraETso1.js} +1 -1
- package/.output/public/_nuxt/{DszOHBMG.js → Dwp3GkV-.js} +1 -1
- package/.output/public/_nuxt/{DqnyWaSQ.js → Dy4TloG3.js} +1 -1
- package/.output/public/_nuxt/{DfcAIbcX.js → EltzgiyS.js} +1 -1
- package/.output/public/_nuxt/{D2jhe9JK.js → HTQtMbWb.js} +1 -1
- package/.output/public/_nuxt/{xUrLy-Zn.js → KYucVFu7.js} +1 -1
- package/.output/public/_nuxt/TBDx0s9p.js +3 -0
- package/.output/public/_nuxt/{BdFEUAlx.js → Tt5LX5Y-.js} +1 -1
- package/.output/public/_nuxt/{d5ZB3uxF.js → Vnfkr1pJ.js} +1 -1
- package/.output/public/_nuxt/{DIkLLyR6.js → WAaPPk0g.js} +2 -2
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/ed1db2e5-9865-4231-9605-4edd5272e164.json +1 -0
- package/.output/public/_nuxt/{DhA17dqR.js → empGC_x-.js} +1 -1
- package/.output/public/_nuxt/entry.ChQMshd4.css +1 -0
- package/.output/public/_nuxt/{nCjfWTGm.js → l0QnzFNM.js} +1 -1
- package/.output/public/_nuxt/{l0gdGdar.js → lowCGL2S.js} +1 -1
- package/.output/public/_nuxt/{DL20rwkA.js → mlAADjK3.js} +1 -1
- package/.output/public/_nuxt/{D33On6AX.js → n-QWmQgc.js} +1 -1
- package/.output/public/_nuxt/{CoHGrO41.js → oFIS9u6t.js} +2 -2
- package/.output/public/_nuxt/{BY4oA2IH.js → oWY3I9uX.js} +1 -1
- package/.output/public/_nuxt/{D4VpoHDP.js → q0DPzLKN.js} +1 -1
- package/.output/public/_nuxt/{uKeO2H7F.js → quV6tp4n.js} +1 -1
- package/.output/public/_nuxt/{B33X4zrC.js → riEUDnED.js} +1 -1
- package/.output/public/_nuxt/{mGJLLqyN.js → rm7OkgDG.js} +1 -1
- package/.output/public/_nuxt/uaqMzXqE.js +5 -0
- package/.output/public/_nuxt/{DAWn6Z7h.js → va1mwSm9.js} +1 -1
- package/.output/public/_nuxt/{DCpmQ47_.js → wGpfdK6o.js} +1 -1
- package/.output/public/_nuxt/{Bb64FEFL.js → wQZj69OY.js} +1 -1
- package/.output/public/_nuxt/wgcgHmRR.js +1 -0
- 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/{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-CoJjvUwM.mjs +733 -0
- package/.output/server/chunks/build/about-CoJjvUwM.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-BN_x1OW3.mjs} +53 -8
- package/.output/server/chunks/build/{docs-DtNcJCyb.mjs.map → docs-BN_x1OW3.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-_o6cMS6m.mjs} +347 -158
- package/.output/server/chunks/build/mcp-_o6cMS6m.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/useTauri-lRT8zkLv.mjs +7 -0
- package/.output/server/chunks/build/useTauri-lRT8zkLv.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 +664 -649
- 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/CCRRqXez.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/Kc7La4sL.js +0 -5
- 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,2 +0,0 @@
|
|
|
1
|
-
import{d as ve,o as k,f as L,g as T,T as N,U as Y,k as l,V as na,a0 as Le,a1 as Ee,b2 as at,a4 as je,a$ as Ua,a2 as Ke,a3 as $e,c as V,j as E,_ as xe,bB as sa,aa as At,i as X,p as K,F as he,y as _e,bC as ia,q as z,Z as Te,$ as Ie,h as O,bD as nt,b3 as De,bw as Be,a6 as Me,bE as la,L as Va,ao as oa,O as ra,K as Ne,at as Tt,H as Wa,r as U,bn as Ga,W as Ja,Y as Ya,B as re,G as It,as as Qa,C as Dt,ad as Xa,ab as Za,a5 as st,br as en,bu as tn,bF as an,bG as nn,m as me,t as ce,ae as sn,bH as ln,bI as ua,al as ca,z as ze,u as Bt,aN as on,A as it,az as rn,a9 as ge,bJ as un,bK as cn,aO as da,aI as fa,b0 as dn,aF as pe,b1 as fn,v as Ae,aG as pn,bt as hn,D as pa,Q as mn,bL as vn,bM as gn,aK as yn,a7 as ha,bN as bn,l as Pe,a as ma,w as va,bO as wn,b as kn,aZ as Sn,bP as _n}from"./BPKwYP2Q.js";import{a as ga,b as xn,_ as $n,c as Cn,p as An}from"./iwD5atI2.js";import{_ as Tn}from"./BpceIssd.js";import{u as In,_ as Dn}from"./BP_SWi7S.js";import{u as ya,I as Ht,V as Ut,J as Bn}from"./Bb64FEFL.js";import{_ as Ln}from"./B3NbDoBP.js";import{D as En,a as Mn,b as On,c as Rn,d as Fn,e as ut,f as ct,g as Pn,_ as Lt}from"./nCjfWTGm.js";import{h as jn,d as zn,e as qn,c as Kn,a as Nn,f as Hn,b as Un,L as Vn,g as Wn}from"./CpO-ABDW.js";import{a as Gn,_ as Jn}from"./CQeMb57w.js";import{_ as Yn}from"./C1K3r_fc.js";import{_ as Qn}from"./DdbrJwT-.js";import{_ as Xn}from"./D33On6AX.js";import{_ as Zn}from"./DgYM3eyi.js";import{_ as es}from"./Br2K9yi_.js";import{u as ba}from"./BIf1R_fu.js";import{u as wa,s as ts}from"./C8RBRg7I.js";import{u as as}from"./B43OGXzV.js";import{u as ns}from"./CSYJwpXG.js";import"./DAWn6Z7h.js";import"./Bf62wdzp.js";import"./r3SBLxtE.js";import"./jIF87ALb.js";import"./mGJLLqyN.js";import"./d5ZB3uxF.js";import"./DuMv-ugy.js";import"./DRtTLQri.js";import"./C219JuBV.js";var ss=ve({__name:"ListboxGroupLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,n=jn({id:""});return(s,i)=>(k(),L(l(na),Y(t,{id:l(n).id}),{default:T(()=>[N(s.$slots,"default")]),_:3},16,["id"]))}}),is=ss;const ls={slots:{base:"",label:"",trailing:"hidden lg:flex items-center gap-0.5 ms-auto"},variants:{collapsed:{true:{label:"hidden",trailing:"lg:hidden"}}}},os=Object.assign({inheritAttrs:!1},{__name:"UDashboardSearchButton",props:{icon:{type:[String,Boolean],required:!1,skipCheck:!0},label:{type:String,required:!1},color:{type:null,required:!1,default:"neutral"},variant:{type:null,required:!1},collapsed:{type:Boolean,required:!1,default:!1},tooltip:{type:[Boolean,Object],required:!1,default:!1},kbds:{type:Array,required:!1,default:()=>["meta","k"]},ui:{type:Object,required:!1},class:{type:null,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},setup(e){const t=e,n=Le(),s=Ee("dashboardSearchButton",t),[i,a]=at(),o=()=>nt(n,["trailing"]),u=je(Ua(s,"icon","label","variant","collapsed","tooltip","kbds","class","ui")),r=De(()=>Be(typeof s.tooltip=="boolean"?{}:s.tooltip,{delayDuration:0,content:{side:"right"}})),{t:v}=Ke(),h=$e(),{toggleSearch:m}=ga({toggleSearch:()=>{}}),f=O(()=>Me({extend:ls,...h.ui?.dashboardSearchButton||{}})({collapsed:s.collapsed}));return(c,p)=>(k(),V(he,null,[E(l(i),null,{default:T(()=>[E(xe,Y({icon:l(s).icon===!1?void 0:l(s).icon??l(h).ui.icons.search,label:l(s).label||l(v)("dashboardSearchButton.label"),variant:l(s).variant||(l(s).collapsed?"ghost":"outline")},{...l(u),...l(s).collapsed?{square:!0,"aria-label":l(s).label||l(v)("dashboardSearchButton.label")}:{},...c.$attrs},{class:f.value.base({class:[l(s).ui?.base,l(s).class]}),ui:l(sa)(f.value,l(s).ui),onClick:l(m)}),At({trailing:T(({ui:y})=>[X("span",{"data-slot":"trailing",class:K(f.value.trailing({class:l(s).ui?.trailing}))},[N(c.$slots,"trailing",{ui:y},()=>[l(s).kbds?.length?(k(!0),V(he,{key:0},_e(l(s).kbds,(I,j)=>(k(),L(ia,Y({key:j,variant:"subtle"},{ref_for:!0},typeof I=="string"?{value:I}:I),null,16))),128)):z("",!0)])],2)]),_:2},[_e(o(),(y,I)=>({name:I,fn:T(j=>[N(c.$slots,I,Te(Ie(j)))])}))]),1040,["icon","label","variant","class","ui","onClick"])]),_:3}),l(s).collapsed&&l(s).tooltip?(k(),L(Tn,Y({key:0,text:l(s).label||l(v)("dashboardSearchButton.label")},r.value),{default:T(()=>[E(l(a))]),_:1},16,["text"])):(k(),L(l(a),{key:1}))],64))}}),rs={class:"inline-flex items-center justify-center shrink-0 size-5"},us=ve({__name:"UserMenu",props:{collapsed:{type:Boolean}},setup(e){const t=la(),n=$e(),s=Ne(),{authState:i,logout:a}=Va(),o=In(),{openSettings:u}=ya(),r=["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],v=["slate","gray","zinc","neutral","stone"],h=O(()=>{if(s.public.authEnabled&&i.value.authenticated&&i.value.user){const f=i.value.user.avatarUrl;return{name:i.value.user.name||i.value.user.username,icon:f?void 0:"i-lucide-user",avatar:f?{src:f}:void 0,role:i.value.user.role}}return{name:"Configuration",icon:"i-lucide-cog"}}),m=O(()=>{const f=[];(!s.public.authEnabled||i.value.authenticated&&i.value.user?.role==="administrator")&&f.push(...o.value);const c=[f,[{label:"Theme",icon:"i-lucide-palette",children:[{label:"Primary",slot:"chip",chip:n.ui.colors.primary,content:{align:"center",collisionPadding:16},children:r.map(p=>({label:p,chip:p,slot:"chip",checked:n.ui.colors.primary===p,type:"checkbox",onSelect:y=>{y.preventDefault(),n.ui.colors.primary=p}}))},{label:"Neutral",slot:"chip",chip:n.ui.colors.neutral==="neutral"?"old-neutral":n.ui.colors.neutral,content:{align:"end",collisionPadding:16},children:v.map(p=>({label:p,chip:p==="neutral"?"old-neutral":p,slot:"chip",type:"checkbox",checked:n.ui.colors.neutral===p,onSelect:y=>{y.preventDefault(),n.ui.colors.neutral=p}}))}]},{label:"Appearance",icon:"i-lucide-sun-moon",children:[{label:"Light",icon:"i-lucide-sun",type:"checkbox",checked:t.value==="light",onSelect(p){p.preventDefault(),t.preference="light"}},{label:"Dark",icon:"i-lucide-moon",type:"checkbox",checked:t.value==="dark",onUpdateChecked(p){p&&(t.preference="dark")},onSelect(p){p.preventDefault()}}]},{label:"Open in IDE…",icon:"i-lucide-external-link",onSelect:p=>{p.preventDefault(),u()}}],[{label:"GitHub repository",icon:"i-lucide-github",to:"https://github.com/piwitests/platform",target:"_blank"}]];return s.public.authEnabled&&i.value.authenticated&&!s.public.demoMode&&c.push([{label:"Logout",icon:"i-lucide-log-out",onSelect:async p=>{p.preventDefault(),await a()}}]),c});return(f,c)=>{const p=xe,y=oa;return k(),L(y,{items:l(m),content:{align:"center",collisionPadding:12},ui:{content:e.collapsed?"w-48":"w-(--reka-dropdown-menu-trigger-width)"}},{"chip-leading":T(({item:I})=>[X("div",rs,[X("span",{class:"rounded-full ring ring-bg bg-(--chip-light) dark:bg-(--chip-dark) size-2",style:ra({"--chip-light":`var(--color-${I.chip}-500)`,"--chip-dark":`var(--color-${I.chip}-400)`})},null,4)])]),default:T(()=>[E(p,Y({...l(h),label:e.collapsed?void 0:l(h)?.name,trailingIcon:e.collapsed?void 0:"i-lucide-chevrons-up-down"},{color:"neutral",variant:"ghost",block:"",square:e.collapsed,class:"data-[state=open]:bg-elevated",ui:{trailingIcon:"text-dimmed"}}),null,16,["square"])]),_:1},8,["items","ui"])}}}),cs=Object.assign(us,{__name:"UserMenu"});(function(){var e;try{if(typeof document<"u"){var t=document.createElement("style");t.nonce=(e=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:e.content,t.appendChild(document.createTextNode('[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1);animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform, 100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform, 100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true]):after{content:"";position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:hover,[data-vaul-handle]:active{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover: hover) and (pointer: fine){[data-vaul-drawer]{-webkit-user-select:none;user-select:none}}@media (pointer: fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{0%{transform:translate3d(0,var(--initial-transform, 100%),0)}to{transform:translateZ(0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform, 100%),0)}}@keyframes slideFromTop{0%{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}to{transform:translateZ(0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}}@keyframes slideFromLeft{0%{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}to{transform:translateZ(0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}}@keyframes slideFromRight{0%{transform:translate3d(var(--initial-transform, 100%),0,0)}to{transform:translateZ(0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform, 100%),0,0)}}')),document.head.appendChild(t)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();const ds=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fs=e=>typeof e<"u";function ps(e){return JSON.parse(JSON.stringify(e))}function Vt(e,t,n,s={}){var i,a,o;const{clone:u=!1,passive:r=!1,eventName:v,deep:h=!1,defaultValue:m,shouldEmit:f}=s,c=Qa(),p=n||c?.emit||((i=c?.$emit)==null?void 0:i.bind(c))||((o=(a=c?.proxy)==null?void 0:a.$emit)==null?void 0:o.bind(c?.proxy));let y=v;t||(t="modelValue"),y=y||`update:${t.toString()}`;const I=S=>u?typeof u=="function"?u(S):ps(S):S,j=()=>fs(e[t])?I(e[t]):m,C=S=>{f?f(S)&&p(y,S):p(y,S)};if(r){const S=j(),g=U(S);let _=!1;return re(()=>e[t],x=>{_||(_=!0,g.value=I(x),It(()=>_=!1))}),re(g,x=>{!_&&(x!==e[t]||h)&&C(x)},{deep:h}),g}else return O({get(){return j()},set(S){C(S)}})}const[He,hs]=Ya("DrawerRoot"),ka=new WeakMap;function ne(e,t,n=!1){if(!e||!(e instanceof HTMLElement)||!t)return;const s={};Object.entries(t).forEach(([i,a])=>{if(i.startsWith("--")){e.style.setProperty(i,a);return}s[i]=e.style[i],e.style[i]=a}),!n&&ka.set(e,s)}function ms(e,t){if(!e||!(e instanceof HTMLElement))return;const n=ka.get(e);n&&Object.entries(n).forEach(([s,i])=>{e.style[s]=i})}function Je(e,t){const n=window.getComputedStyle(e),s=n.transform||n.webkitTransform||n.mozTransform;let i=s.match(/^matrix3d\((.+)\)$/);return i?Number.parseFloat(i[1].split(", ")[ee(t)?13:12]):(i=s.match(/^matrix\((.+)\)$/),i?Number.parseFloat(i[1].split(", ")[ee(t)?5:4]):null)}function vs(e){return 8*(Math.log(e+1)-2)}function ee(e){switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}}function dt(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function gs(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Q={DURATION:.5,EASE:[.32,.72,0,1]},Sa=.4,ys=.25,bs=100,_a=8,Ye=16,xa=26,Wt="vaul-dragging";function ws({activeSnapPoint:e,snapPoints:t,drawerRef:n,overlayRef:s,fadeFromIndex:i,onSnapPointChange:a,direction:o}){const u=U(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);function r(){u.value={innerWidth:window.innerWidth,innerHeight:window.innerHeight}}Dt(()=>{typeof window<"u"&&window.addEventListener("resize",r)}),Xa(()=>{typeof window<"u"&&window.removeEventListener("resize",r)});const v=O(()=>(t.value&&e.value===t.value[t.value.length-1])??null),h=O(()=>t.value&&t.value.length>0&&(i?.value||i?.value===0)&&!Number.isNaN(i?.value)&&t.value[i?.value??-1]===e.value||!t.value),m=O(()=>{var C;return((C=t.value)==null?void 0:C.findIndex(S=>S===e.value))??null}),f=O(()=>{var C;return((C=t.value)==null?void 0:C.map(S=>{const g=typeof S=="string";let _=0;if(g&&(_=Number.parseInt(S,10)),ee(o.value)){const w=g?_:u.value?S*u.value.innerHeight:0;return u.value?o.value==="bottom"?u.value.innerHeight-w:-u.value.innerHeight+w:w}const x=g?_:u.value?S*u.value.innerWidth:0;return u.value?o.value==="right"?u.value.innerWidth-x:-u.value.innerWidth+x:x}))??[]}),c=O(()=>{var C;return m.value!==null?(C=f.value)==null?void 0:C[m.value]:null}),p=C=>{var S,g,_,x;const w=((S=f.value)==null?void 0:S.findIndex(B=>B===C))??null;It(()=>{var B;a(w,f.value),ne((B=n.value)==null?void 0:B.$el,{transition:`transform ${Q.DURATION}s cubic-bezier(${Q.EASE.join(",")})`,transform:ee(o.value)?`translate3d(0, ${C}px, 0)`:`translate3d(${C}px, 0, 0)`})}),f.value&&w!==f.value.length-1&&w!==i?.value?ne((g=s.value)==null?void 0:g.$el,{transition:`opacity ${Q.DURATION}s cubic-bezier(${Q.EASE.join(",")})`,opacity:"0"}):ne((_=s.value)==null?void 0:_.$el,{transition:`opacity ${Q.DURATION}s cubic-bezier(${Q.EASE.join(",")})`,opacity:"1"}),e.value=w!==null?((x=t.value)==null?void 0:x[w])??null:null};re([e,f,t],()=>{var C;if(e.value){const S=((C=t.value)==null?void 0:C.findIndex(g=>g===e.value))??-1;f.value&&S!==-1&&typeof f.value[S]=="number"&&p(f.value[S])}},{immediate:!0});function y({draggedDistance:C,closeDrawer:S,velocity:g,dismissible:_}){var x,w,B;if(i.value===void 0)return;const b=o.value==="bottom"||o.value==="right"?(c.value??0)-C:(c.value??0)+C,A=m.value===i.value-1,R=m.value===0,W=C>0;if(A&&ne((x=s.value)==null?void 0:x.$el,{transition:`opacity ${Q.DURATION}s cubic-bezier(${Q.EASE.join(",")})`}),g>2&&!W){_?S():p(f.value[0]);return}if(g>2&&W&&f&&t.value){p(f.value[t.value.length-1]);return}const H=(w=f.value)==null?void 0:w.reduce((F,d)=>typeof F!="number"||typeof d!="number"?F:Math.abs(d-b)<Math.abs(F-b)?d:F),$=ee(o.value)?window.innerHeight:window.innerWidth;if(g>Sa&&Math.abs(C)<$*.4){const F=W?1:-1;if(F>0&&v){p(f.value[(((B=t.value)==null?void 0:B.length)??0)-1]);return}if(R&&F<0&&_&&S(),m.value===null)return;p(f.value[m.value+F]);return}p(H)}function I({draggedDistance:C}){var S;if(c.value===null)return;const g=o.value==="bottom"||o.value==="right"?c.value-C:c.value+C;(o.value==="bottom"||o.value==="right")&&g<f.value[f.value.length-1]||(o.value==="top"||o.value==="left")&&g>f.value[f.value.length-1]||ne((S=n.value)==null?void 0:S.$el,{transform:ee(o.value)?`translate3d(0, ${g}px, 0)`:`translate3d(${g}px, 0, 0)`})}function j(C,S){if(!t.value||typeof m.value!="number"||!f.value||i.value===void 0)return null;const g=m.value===i.value-1;if(m.value>=i.value&&S)return 0;if(g&&!S)return 1;if(!h.value&&!g)return null;const _=g?m.value+1:m.value-1,x=g?f.value[_]-f.value[_-1]:f.value[_+1]-f.value[_],w=C/Math.abs(x);return g?1-w:w}return{isLastSnapPoint:v,shouldFade:h,getPercentageDragged:j,activeSnapPointIndex:m,onRelease:y,onDrag:I,snapPointsOffset:f}}function Gt(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}let Re=null;function ks(e){const{isOpen:t,modal:n,nested:s,hasBeenOpened:i,preventScrollRestoration:a,noBodyStyles:o}=e,u=U(typeof window<"u"?window.location.href:""),r=U(0);function v(){if(Gt()&&Re===null&&t.value&&!o.value){Re={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height};const{scrollX:m,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-r.value}px`,left:`${-m}px`,right:"0px",height:"auto"}),setTimeout(()=>{requestAnimationFrame(()=>{const c=f-window.innerHeight;c&&r.value>=f&&(document.body.style.top=`-${r.value+c}px`)})},300)}}function h(){if(Gt()&&Re!==null&&!o.value){const m=-Number.parseInt(document.body.style.top,10),f=-Number.parseInt(document.body.style.left,10);Object.assign(document.body.style,Re),window.requestAnimationFrame(()=>{if(a.value&&u.value!==window.location.href){u.value=window.location.href;return}window.scrollTo(f,m)}),Re=null}}return Dt(()=>{function m(){r.value=window.scrollY}m(),window.addEventListener("scroll",m),Za(()=>{window.removeEventListener("scroll",m)})}),re([t,i,u],()=>{s.value||!i.value||(t.value?(window.matchMedia("(display-mode: standalone)").matches||v(),n.value||setTimeout(()=>{h()},500)):h())}),{restorePositionSetting:h}}function Ss(e,t){return e&&e.value?e:t}function _s(e){const{emitDrag:t,emitRelease:n,emitClose:s,emitOpenChange:i,open:a,dismissible:o,nested:u,modal:r,shouldScaleBackground:v,setBackgroundColorOnScale:h,scrollLockTimeout:m,closeThreshold:f,activeSnapPoint:c,fadeFromIndex:p,direction:y,noBodyStyles:I,handleOnly:j,preventScrollRestoration:C}=e,S=U(a.value??!1),g=U(!1),_=U(!1),x=U(!1),w=U(null),B=U(null),b=U(null),A=U(null),R=U(null),W=U(!1),H=U(null),$=U(0),F=U(!1),d=U(null),q=O(()=>{var P;return((P=d.value)==null?void 0:P.$el.getBoundingClientRect().height)||0}),D=Ss(e.snapPoints,U(void 0)),G=O(()=>{var P;return D&&(((P=D.value)==null?void 0:P.length)??0)>0}),ie=U(null),{activeSnapPointIndex:te,onRelease:ye,snapPointsOffset:fe,onDrag:Oa,shouldFade:Ft,getPercentageDragged:Ra}=ws({snapPoints:D,activeSnapPoint:c,drawerRef:d,fadeFromIndex:p,overlayRef:w,onSnapPointChange:Fa,direction:y});function Fa(P,Z){D.value&&P===Z.length-1&&(B.value=new Date)}ks({isOpen:S,modal:r,nested:u,hasBeenOpened:g,noBodyStyles:I,preventScrollRestoration:C});function Ue(){return(window.innerWidth-xa)/window.innerWidth}function Pt(P,Z){var ae;if(!P)return!1;let J=P;const se=(ae=window.getSelection())==null?void 0:ae.toString(),oe=d.value?Je(d.value.$el,y.value):null,de=new Date;if(J.hasAttribute("data-vaul-no-drag")||J.closest("[data-vaul-no-drag]"))return!1;if(y.value==="right"||y.value==="left")return!0;if(B.value&&de.getTime()-B.value.getTime()<500)return!1;if(oe!==null&&(y.value==="bottom"?oe>0:oe<0))return!0;if(se&&se.length>0)return!1;if(R.value&&de.getTime()-R.value.getTime()<m.value&&oe===0||Z)return R.value=de,!1;for(;J;){if(J.scrollHeight>J.clientHeight){if(J.scrollTop!==0)return R.value=new Date,!1;if(J.getAttribute("role")==="dialog")return!0}J=J.parentNode}return!0}function Pa(P){!o.value&&!D.value||d.value&&!d.value.$el.contains(P.target)||(_.value=!0,b.value=new Date,P.target.setPointerCapture(P.pointerId),$.value=ee(y.value)?P.clientY:P.clientX)}function ja(P){var Z,ae,J,se,oe,de;if(d.value&&_.value){const Ce=y.value==="bottom"||y.value==="right"?1:-1,Ve=($.value-(ee(y.value)?P.clientY:P.clientX))*Ce,We=Ve>0,zt=D.value&&!o.value&&!We;if(zt&&te.value===0)return;const rt=Math.abs(Ve),qt=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");let ke=rt/q.value;const Kt=Ra(rt,We);if(Kt!==null&&(ke=Kt),zt&&ke>=1||!W.value&&!Pt(P.target,We))return;if((Z=d?.value)==null||Z.$el.classList.add(Wt),W.value=!0,ne((ae=d.value)==null?void 0:ae.$el,{transition:"none"}),ne((J=w.value)==null?void 0:J.$el,{transition:"none"}),D.value&&Oa({draggedDistance:Ve}),We&&!D.value){const Se=vs(Ve),Ge=Math.min(Se*-1,0)*Ce;ne((se=d.value)==null?void 0:se.$el,{transform:ee(y.value)?`translate3d(0, ${Ge}px, 0)`:`translate3d(${Ge}px, 0, 0)`});return}const Ha=1-ke;if((Ft.value||p.value&&te.value===p.value-1)&&(t(ke),ne((oe=w.value)==null?void 0:oe.$el,{opacity:`${Ha}`,transition:"none"},!0)),qt&&w.value&&v.value){const Se=Math.min(Ue()+ke*(1-Ue()),1),Ge=8-ke*8,Nt=Math.max(0,14-ke*14);ne(qt,{borderRadius:`${Ge}px`,transform:ee(y.value)?`scale(${Se}) translate3d(0, ${Nt}px, 0)`:`scale(${Se}) translate3d(${Nt}px, 0, 0)`,transition:"none"},!0)}if(!D.value){const Se=rt*Ce;ne((de=d.value)==null?void 0:de.$el,{transform:ee(y.value)?`translate3d(0, ${Se}px, 0)`:`translate3d(${Se}px, 0, 0)`})}}}function jt(){var P;if(!d.value)return;const Z=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]"),ae=Je(d.value.$el,y.value);ne(d.value.$el,{transform:"translate3d(0, 0, 0)",transition:`transform ${Q.DURATION}s cubic-bezier(${Q.EASE.join(",")})`}),ne((P=w.value)==null?void 0:P.$el,{transition:`opacity ${Q.DURATION}s cubic-bezier(${Q.EASE.join(",")})`,opacity:"1"}),v.value&&ae&&ae>0&&S.value&&ne(Z,{borderRadius:`${_a}px`,overflow:"hidden",...ee(y.value)?{transform:`scale(${Ue()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ue()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Q.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Q.EASE.join(",")})`},!0)}function Oe(P){d.value&&(s(),P||(S.value=!1),window.setTimeout(()=>{D.value&&(c.value=D.value[0])},Q.DURATION*1e3))}Tt(()=>{if(!S.value&&v.value&&ds){const P=setTimeout(()=>{ms(document.body)},200);return()=>clearTimeout(P)}}),re(a,()=>{S.value=a.value,a.value||Oe()});function za(P){if(!_.value||!d.value)return;d.value.$el.classList.remove(Wt),W.value=!1,_.value=!1,A.value=new Date;const Z=Je(d.value.$el,y.value);if(!Pt(P.target,!1)||!Z||Number.isNaN(Z)||b.value===null)return;const ae=A.value.getTime()-b.value.getTime(),J=$.value-(ee(y.value)?P.clientY:P.clientX),se=Math.abs(J)/ae;if(se>.05&&(x.value=!0,window.setTimeout(()=>{x.value=!1},200)),D.value){const de=y.value==="bottom"||y.value==="right"?1:-1;ye({draggedDistance:J*de,closeDrawer:Oe,velocity:se,dismissible:o.value}),n(!0);return}if(y.value==="bottom"||y.value==="right"?J>0:J<0){jt(),n(!0);return}if(se>Sa){Oe(),n(!1);return}const oe=Math.min(d.value.$el.getBoundingClientRect().height??0,window.innerHeight);if(Z>=oe*f.value){Oe(),n(!1);return}n(!0),jt()}re(S,P=>{P&&(B.value=new Date),i(P)},{immediate:!0});function qa(P){var Z,ae;const J=P?(window.innerWidth-Ye)/window.innerWidth:1,se=P?-16:0;H.value&&window.clearTimeout(H.value),ne((Z=d.value)==null?void 0:Z.$el,{transition:`transform ${Q.DURATION}s cubic-bezier(${Q.EASE.join(",")})`,transform:`scale(${J}) translate3d(0, ${se}px, 0)`}),!P&&(ae=d.value)!=null&&ae.$el&&(H.value=window.setTimeout(()=>{var oe,de;const Ce=Je((oe=d.value)==null?void 0:oe.$el,y.value);ne((de=d.value)==null?void 0:de.$el,{transition:"none",transform:ee(y.value)?`translate3d(0, ${Ce}px, 0)`:`translate3d(${Ce}px, 0, 0)`})},500))}function Ka(P){var Z;if(P<0)return;const ae=ee(y.value)?window.innerHeight:window.innerWidth,J=(ae-Ye)/ae,se=J+P*(1-J),oe=-16+P*Ye;ne((Z=d.value)==null?void 0:Z.$el,{transform:ee(y.value)?`scale(${se}) translate3d(0, ${oe}px, 0)`:`scale(${se}) translate3d(${oe}px, 0, 0)`,transition:"none"})}function Na(P){var Z;const ae=ee(y.value)?window.innerHeight:window.innerWidth,J=P?(ae-Ye)/ae:1,se=P?-16:0;P&&ne((Z=d.value)==null?void 0:Z.$el,{transition:`transform ${Q.DURATION}s cubic-bezier(${Q.EASE.join(",")})`,transform:ee(y.value)?`scale(${J}) translate3d(0, ${se}px, 0)`:`scale(${J}) translate3d(${se}px, 0, 0)`})}return{open:a,isOpen:S,modal:r,keyboardIsOpen:F,hasBeenOpened:g,drawerRef:d,drawerHeightRef:q,overlayRef:w,handleRef:ie,isDragging:_,dragStartTime:b,isAllowedToDrag:W,snapPoints:D,activeSnapPoint:c,hasSnapPoints:G,pointerStart:$,dismissible:o,snapPointsOffset:fe,direction:y,shouldFade:Ft,fadeFromIndex:p,shouldScaleBackground:v,setBackgroundColorOnScale:h,onPress:Pa,onDrag:ja,onRelease:za,closeDrawer:Oe,onNestedDrag:Ka,onNestedRelease:Na,onNestedOpenChange:qa,emitClose:s,emitDrag:t,emitRelease:n,emitOpenChange:i,nested:u,handleOnly:j,noBodyStyles:I}}const $a=ve({__name:"DrawerRoot",props:{activeSnapPoint:{default:void 0},closeThreshold:{default:ys},shouldScaleBackground:{type:Boolean,default:void 0},setBackgroundColorOnScale:{type:Boolean,default:!0},scrollLockTimeout:{default:bs},fixed:{type:Boolean,default:void 0},dismissible:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},nested:{type:Boolean,default:!1},direction:{default:"bottom"},noBodyStyles:{type:Boolean},handleOnly:{type:Boolean,default:!1},preventScrollRestoration:{type:Boolean},snapPoints:{default:void 0},fadeFromIndex:{default:void 0}},emits:["drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(e,{expose:t,emit:n}){const s=e,i=n;Le();const a=O(()=>s.fadeFromIndex??(s.snapPoints&&s.snapPoints.length-1)),o=Vt(s,"open",i,{defaultValue:s.defaultOpen,passive:s.open===void 0}),u=Vt(s,"activeSnapPoint",i,{passive:s.activeSnapPoint===void 0}),r={emitDrag:p=>i("drag",p),emitRelease:p=>i("release",p),emitClose:()=>i("close"),emitOpenChange:p=>{i("update:open",p),setTimeout(()=>{i("animationEnd",p)},Q.DURATION*1e3)}},{closeDrawer:v,hasBeenOpened:h,modal:m,isOpen:f}=hs(_s({...r,...Ja(s),activeSnapPoint:u,fadeFromIndex:a,open:o}));function c(p){if(o.value!==void 0){r.emitOpenChange(p);return}f.value=p,p?h.value=!0:v()}return t({open:f}),(p,y)=>(k(),L(l(On),{open:l(f),modal:l(m),"onUpdate:open":c},{default:T(()=>[N(p.$slots,"default",{open:l(f)})]),_:3},8,["open","modal"]))}}),xs=ve({__name:"DrawerRootNested",props:{activeSnapPoint:{},closeThreshold:{},shouldScaleBackground:{type:Boolean},setBackgroundColorOnScale:{type:Boolean},scrollLockTimeout:{},fixed:{type:Boolean},dismissible:{type:Boolean},modal:{type:Boolean},open:{type:Boolean},defaultOpen:{type:Boolean},nested:{type:Boolean},direction:{},noBodyStyles:{type:Boolean},handleOnly:{type:Boolean},preventScrollRestoration:{type:Boolean},snapPoints:{},fadeFromIndex:{}},emits:["drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(e,{emit:t}){const n=e,s=t,{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:o}=He();function u(){a(!1)}function r(m){i(m)}function v(m){m&&a(m),s("update:open",m)}const h=Ga(n,s);return(m,f)=>(k(),L($a,Y(l(h),{nested:"",onClose:u,onDrag:r,onRelease:l(o),"onUpdate:open":v}),{default:T(()=>[N(m.$slots,"default")]),_:3},16,["onRelease"]))}}),$s=ve({__name:"DrawerOverlay",setup(e){const{overlayRef:t,hasSnapPoints:n,isOpen:s,shouldFade:i}=He();return(a,o)=>(k(),L(l(En),{ref_key:"overlayRef",ref:t,"data-vaul-overlay":"","data-vaul-snap-points":l(s)&&l(n)?"true":"false","data-vaul-snap-points-overlay":l(s)&&l(i)?"true":"false"},null,8,["data-vaul-snap-points","data-vaul-snap-points-overlay"]))}}),Cs=()=>()=>{};function As(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:s,noBodyStyles:i}=He(),a=U(null),o=U(document.body.style.backgroundColor);function u(){return(window.innerWidth-xa)/window.innerWidth}Tt(r=>{if(t.value&&n.value){a.value&&clearTimeout(a.value);const v=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!v)return;gs(s.value&&!i.value?dt(document.body,{background:"black"}):Cs,dt(v,{transformOrigin:ee(e.value)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Q.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Q.EASE.join(",")})`}));const h=dt(v,{borderRadius:`${_a}px`,overflow:"hidden",...ee(e.value)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});r(()=>{h(),a.value=window.setTimeout(()=>{o.value?document.body.style.background=o.value:document.body.style.removeProperty("background")},Q.DURATION*1e3)})}},{flush:"pre"})}const Ts=ve({__name:"DrawerContent",setup(e){const{open:t,isOpen:n,snapPointsOffset:s,hasSnapPoints:i,drawerRef:a,onPress:o,onDrag:u,onRelease:r,modal:v,emitOpenChange:h,dismissible:m,keyboardIsOpen:f,closeDrawer:c,direction:p,handleOnly:y}=He();As();const I=U(!1),j=O(()=>s.value&&s.value.length>0?`${s.value[0]}px`:"0");function C(_){if(!v.value||_.defaultPrevented){_.preventDefault();return}f.value&&(f.value=!1),m.value?h(!1):_.preventDefault()}function S(_){y.value||o(_)}function g(_){y.value||u(_)}return Tt(()=>{i.value&&window.requestAnimationFrame(()=>{I.value=!0})}),(_,x)=>(k(),L(l(Mn),{ref_key:"drawerRef",ref:a,"data-vaul-drawer":"","data-vaul-drawer-direction":l(p),"data-vaul-delayed-snap-points":I.value?"true":"false","data-vaul-snap-points":l(n)&&l(i)?"true":"false",style:ra({"--snap-point-height":j.value}),onPointerdown:S,onPointermove:g,onPointerup:l(r),onPointerDownOutside:C,onOpenAutoFocus:x[0]||(x[0]=Wa(()=>{},["prevent"])),onEscapeKeyDown:x[1]||(x[1]=w=>{l(m)||w.preventDefault()})},{default:T(()=>[N(_.$slots,"default")]),_:3},8,["data-vaul-drawer-direction","data-vaul-delayed-snap-points","data-vaul-snap-points","style","onPointerup"]))}}),Is=["data-vaul-drawer-visible"],Ds={"data-vaul-handle-hitarea":"","aria-hidden":"true"},Bs=250,Ls=120,Es=ve({__name:"DrawerHandle",props:{preventCycle:{type:Boolean,default:!1}},setup(e){const t=e,{onPress:n,onDrag:s,handleRef:i,handleOnly:a,isOpen:o,snapPoints:u,activeSnapPoint:r,isDragging:v,dismissible:h,closeDrawer:m}=He(),f=U(null),c=U(!1);function p(){if(c.value){j();return}window.setTimeout(()=>{y()},Ls)}function y(){if(v.value||t.preventCycle||c.value){j();return}if(j(),!u.value||u.value.length===0){h.value||m();return}const g=r.value===u.value[u.value.length-1];if(g&&h.value){m();return}const _=u.value.findIndex(w=>w===r.value);if(_===-1)return;const x=g?0:_+1;r.value=u.value[x]}function I(){f.value=window.setTimeout(()=>{c.value=!0},Bs)}function j(){f.value&&window.clearTimeout(f.value),c.value=!1}function C(g){a.value&&n(g),I()}function S(g){a.value&&s(g)}return(g,_)=>(k(),V("div",{ref_key:"handleRef",ref:i,"data-vaul-drawer-visible":l(o)?"true":"false","data-vaul-handle":"","aria-hidden":"true",onClick:p,onPointercancel:j,onPointerdown:C,onPointermove:S},[X("span",Ds,[N(g.$slots,"default")])],40,Is))}}),Ms={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default ring ring-default flex focus:outline-none",handle:["shrink-0 !bg-accented","transition-opacity"],container:"w-full flex flex-col gap-4 p-4 overflow-y-auto",header:"flex items-center gap-1.5 min-h-8",wrapper:"min-w-0 flex-1",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",actions:"flex items-center gap-1.5 shrink-0 ms-auto",body:"flex-1",footer:"flex flex-col gap-1.5",close:""},variants:{direction:{top:{content:"mb-24 flex-col-reverse",handle:"mb-4"},right:{content:"flex-row rtl:flex-row-reverse",handle:"!ml-4"},bottom:{content:"mt-24 flex-col",handle:"mt-4"},left:{content:"flex-row-reverse rtl:flex-row",handle:"!mr-4"}},inset:{true:{content:"rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]"}},snapPoints:{true:""}},compoundVariants:[{direction:["top","bottom"],class:{content:"h-auto max-h-[96%]",handle:"!w-12 !h-1.5 mx-auto"}},{direction:["top","bottom"],snapPoints:!0,class:{content:"h-full"}},{direction:["right","left"],class:{content:"w-auto max-w-[calc(100%-2rem)]",handle:"!h-12 !w-1.5 mt-auto mb-auto"}},{direction:["right","left"],snapPoints:!0,class:{content:"w-full"}},{direction:"top",inset:!0,class:{content:"inset-x-4 top-4"}},{direction:"top",inset:!1,class:{content:"inset-x-0 top-0 rounded-b-lg"}},{direction:"bottom",inset:!0,class:{content:"inset-x-4 bottom-4"}},{direction:"bottom",inset:!1,class:{content:"inset-x-0 bottom-0 rounded-t-lg"}},{direction:"left",inset:!0,class:{content:"inset-y-4 left-4"}},{direction:"left",inset:!1,class:{content:"inset-y-0 left-0 rounded-r-lg"}},{direction:"right",inset:!0,class:{content:"inset-y-4 right-4"}},{direction:"right",inset:!1,class:{content:"inset-y-0 right-0 rounded-l-lg"}}]},Os={__name:"UDrawer",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},inset:{type:Boolean,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},handle:{type:Boolean,required:!1,default:!0},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},nested:{type:Boolean,required:!1},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},activeSnapPoint:{type:[Number,String,null],required:!1},closeThreshold:{type:Number,required:!1},shouldScaleBackground:{type:Boolean,required:!1},setBackgroundColorOnScale:{type:Boolean,required:!1},scrollLockTimeout:{type:Number,required:!1},fixed:{type:Boolean,required:!1},dismissible:{type:Boolean,required:!1,default:!0},modal:{type:Boolean,required:!1,default:!0},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},direction:{type:String,required:!1,default:"bottom"},noBodyStyles:{type:Boolean,required:!1},handleOnly:{type:Boolean,required:!1},preventScrollRestoration:{type:Boolean,required:!1},snapPoints:{type:Array,required:!1}},emits:["close:prevent","drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(e,{emit:t}){const n=e,s=t,i=Le(),a=Ee("drawer",n),{t:o}=Ke(),u=$e(),r=je(st(a,"activeSnapPoint","closeThreshold","shouldScaleBackground","setBackgroundColorOnScale","scrollLockTimeout","fixed","dismissible","modal","open","defaultOpen","nested","direction","noBodyStyles","handleOnly","preventScrollRestoration","snapPoints"),s),v=en(De(()=>a.portal)),h=De(()=>a.content),m=O(()=>a.dismissible?{pointerDownOutside:ln}:["interactOutside","escapeKeyDown"].reduce((p,y)=>(p[y]=I=>{I.preventDefault(),s("close:prevent")},p),{})),f=O(()=>Me({extend:Ms,...u.ui?.drawer||{}})({direction:a.direction,inset:a.inset,snapPoints:a.snapPoints&&a.snapPoints.length>0}));return(c,p)=>(k(),L(sn(l(a).nested?l(xs):l($a)),Te(Ie(l(r))),{default:T(()=>[i.default?(k(),L(l(Rn),{key:0,"as-child":"",class:K(l(a).class)},{default:T(()=>[N(c.$slots,"default")]),_:3},8,["class"])):z("",!0),E(l(Fn),Te(Ie(l(v))),{default:T(()=>[E(l(tn),null,{default:T(()=>[l(a).overlay?(k(),L(l($s),{key:0,"data-slot":"overlay",class:K(f.value.overlay({class:l(a).ui?.overlay}))},null,8,["class"])):z("",!0),E(l(Ts),Y({"data-slot":"content",class:f.value.content({class:[!i.default&&l(a).class,l(a).ui?.content]})},h.value,an(m.value)),{default:T(()=>[l(a).handle?(k(),L(l(Es),{key:0,"data-slot":"handle",class:K(f.value.handle({class:l(a).ui?.handle}))},null,8,["class"])):z("",!0),!l(a).title&&!i.title||!l(a).description&&!i.description||i.content?(k(),L(l(nn),{key:1},{default:T(()=>[!l(a).title&&!i.title?(k(),L(l(ut),{key:0})):i.content?(k(),L(l(ut),{key:1},{default:T(()=>[N(c.$slots,"title",{},()=>[me(ce(l(a).title),1)])]),_:3})):z("",!0),!l(a).description&&!i.description?(k(),L(l(ct),{key:2})):i.content?(k(),L(l(ct),{key:3},{default:T(()=>[N(c.$slots,"description",{},()=>[me(ce(l(a).description),1)])]),_:3})):z("",!0)]),_:3})):z("",!0),N(c.$slots,"content",{},()=>[X("div",{"data-slot":"container",class:K(f.value.container({class:l(a).ui?.container}))},[i.header||l(a).title||i.title||l(a).description||i.description||l(a).close||i.close||i.actions?(k(),V("div",{key:0,"data-slot":"header",class:K(f.value.header({class:l(a).ui?.header}))},[N(c.$slots,"header",{},()=>[l(a).title||i.title||l(a).description||i.description?(k(),V("div",{key:0,"data-slot":"wrapper",class:K(f.value.wrapper({class:l(a).ui?.wrapper}))},[l(a).title||i.title?(k(),L(l(ut),{key:0,"data-slot":"title",class:K(f.value.title({class:l(a).ui?.title}))},{default:T(()=>[N(c.$slots,"title",{},()=>[me(ce(l(a).title),1)])]),_:3},8,["class"])):z("",!0),l(a).description||i.description?(k(),L(l(ct),{key:1,"data-slot":"description",class:K(f.value.description({class:l(a).ui?.description}))},{default:T(()=>[N(c.$slots,"description",{},()=>[me(ce(l(a).description),1)])]),_:3},8,["class"])):z("",!0)],2)):z("",!0),i.actions||l(a).close||i.close?(k(),V("div",{key:1,"data-slot":"actions",class:K(f.value.actions({class:l(a).ui?.actions}))},[N(c.$slots,"actions"),l(a).close||i.close?(k(),L(l(Pn),{key:0,"as-child":""},{default:T(()=>[N(c.$slots,"close",{ui:f.value},()=>[l(a).close?(k(),L(xe,Y({key:0,icon:l(a).closeIcon||l(u).ui.icons.close,color:"neutral",variant:"ghost","aria-label":l(o)("drawer.close")},typeof l(a).close=="object"?l(a).close:{},{"data-slot":"close",class:f.value.close({class:l(a).ui?.close})}),null,16,["icon","aria-label","class"])):z("",!0)])]),_:3})):z("",!0)],2)):z("",!0)])],2)):z("",!0),i.body?(k(),V("div",{key:1,"data-slot":"body",class:K(f.value.body({class:l(a).ui?.body}))},[N(c.$slots,"body")],2)):z("",!0),i.footer?(k(),V("div",{key:2,"data-slot":"footer",class:K(f.value.footer({class:l(a).ui?.footer}))},[N(c.$slots,"footer")],2)):z("",!0)],2)])]),_:3},16,["class"])]),_:3})]),_:3},16)]),_:3},16))}},Rs={slots:{root:"relative hidden lg:flex flex-col min-h-svh min-w-16 w-(--width) shrink-0",header:"h-(--ui-header-height) shrink-0 flex items-center gap-1.5 px-4",body:"flex flex-col gap-4 flex-1 overflow-y-auto px-4 py-2",footer:"shrink-0 flex items-center gap-1.5 px-4 py-2",toggle:"",handle:"",content:"lg:hidden",overlay:"lg:hidden"},variants:{menu:{true:{header:"sm:px-6",body:"sm:px-6",footer:"sm:px-6"}},side:{left:{root:"border-e border-default"},right:{root:""}},toggleSide:{left:{toggle:""},right:{toggle:"ms-auto"}}}};function gt(e,t){const s=ua().hook(e,t);ca(s)}const Fs=["data-collapsed","data-dragging"],Ps=Object.assign({inheritAttrs:!1},{__name:"UDashboardSidebar",props:it({mode:{type:null,required:!1,default:"slideover"},menu:{type:null,required:!1},toggle:{type:[Boolean,Object],required:!1,default:!0},toggleSide:{type:String,required:!1,default:"left"},autoClose:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},id:{type:String,required:!1},side:{type:String,required:!1,default:"left"},minSize:{type:Number,required:!1,default:10},maxSize:{type:Number,required:!1,default:20},defaultSize:{type:Number,required:!1,default:15},resizable:{type:Boolean,required:!1,default:!1},collapsible:{type:Boolean,required:!1,default:!1},collapsedSize:{type:Number,required:!1,default:0}},{open:{type:Boolean,default:!1},openModifiers:{},collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:["update:open","update:collapsed"],setup(e){const t=e,n=Le(),s=Ee("dashboardSidebar",t),i=ze(e,"open",{type:Boolean,default:!1}),a=ze(e,"collapsed",{type:Boolean,default:!1}),o=Bt(),{t:u}=Ke(),r=$e(),v=ga({storageKey:"dashboard",unit:"%",sidebarOpen:U(!1),sidebarCollapsed:U(!1)}),h=`${v.storageKey}-sidebar-${s.id||on()}`,{el:m,size:f,collapse:c,isCollapsed:p,isDragging:y,onMouseDown:I,onTouchStart:j,onDoubleClick:C}=xn(h,De(()=>({...v,...s})),{collapsed:a}),[S,g]=at(),[_,x]=at();gt("dashboard:sidebar:toggle",()=>{i.value=!i.value}),gt("dashboard:sidebar:collapse",R=>{p.value=R}),re(i,()=>v.sidebarOpen.value=i.value,{immediate:!0}),re(p,()=>v.sidebarCollapsed.value=p.value,{immediate:!0}),re(()=>o.fullPath,()=>{s.autoClose&&(i.value=!1)});const w=O(()=>Me({extend:Rs,...r.ui?.dashboardSidebar||{}})({side:s.side})),B=O(()=>({slideover:Ln,modal:Lt,drawer:Os})[s.mode]),b=De(()=>Be(s.menu,{},s.mode==="modal"?{fullscreen:!0,transition:!1}:s.mode==="slideover"?{side:"left"}:{}));function A(){i.value=!i.value}return(R,W)=>(k(),V(he,null,[E(l(S),null,{default:T(()=>[N(R.$slots,"toggle",{open:i.value,toggle:A,ui:w.value},()=>[l(s).toggle?(k(),L($n,Y({key:0},typeof l(s).toggle=="object"?l(s).toggle:{},{side:l(s).toggleSide,"data-slot":"toggle",class:w.value.toggle({class:l(s).ui?.toggle,toggleSide:l(s).toggleSide})}),null,16,["side","class"])):z("",!0)])]),_:3}),E(l(_),null,{default:T(()=>[N(R.$slots,"resize-handle",{onMouseDown:l(I),onTouchStart:l(j),onDoubleClick:l(C),ui:w.value},()=>[l(s).resizable?(k(),L(Cn,{key:0,"aria-controls":h,"data-slot":"handle",class:K(w.value.handle({class:l(s).ui?.handle})),onMousedown:l(I),onTouchstart:l(j),onDblclick:l(C)},null,8,["class","onMousedown","onTouchstart","onDblclick"])):z("",!0)])]),_:3}),l(s).side==="right"?(k(),L(l(x),{key:0})):z("",!0),X("div",Y({id:h,ref_key:"el",ref:m,"data-slot":"root"},R.$attrs,{"data-collapsed":l(p),"data-dragging":l(y),class:w.value.root({class:[l(s).ui?.root,l(s).class]}),style:{"--width":`${l(f)||0}${l(v).unit}`}}),[n.header?(k(),V("div",{key:0,"data-slot":"header",class:K(w.value.header({class:l(s).ui?.header}))},[N(R.$slots,"header",{collapsed:l(p),collapse:l(c)})],2)):z("",!0),X("div",{"data-slot":"body",class:K(w.value.body({class:l(s).ui?.body}))},[N(R.$slots,"default",{collapsed:l(p),collapse:l(c)})],2),n.footer?(k(),V("div",{key:1,"data-slot":"footer",class:K(w.value.footer({class:l(s).ui?.footer}))},[N(R.$slots,"footer",{collapsed:l(p),collapse:l(c)})],2)):z("",!0)],16,Fs),l(s).side==="left"?(k(),L(l(x),{key:1})):z("",!0),E(l(B),Y({open:i.value,"onUpdate:open":W[0]||(W[0]=H=>i.value=H),title:l(u)("dashboardSidebar.title"),description:l(u)("dashboardSidebar.description")},b.value,{ui:{overlay:w.value.overlay({class:l(s).ui?.overlay}),content:w.value.content({class:l(s).ui?.content})}}),{content:T(H=>[N(R.$slots,"content",Te(Ie(H)),()=>[n.header||l(s).mode!=="drawer"?(k(),V("div",{key:0,"data-slot":"header",class:K(w.value.header({class:l(s).ui?.header,menu:!0}))},[l(s).mode!=="drawer"&&l(s).toggleSide==="left"?(k(),L(l(g),{key:0})):z("",!0),N(R.$slots,"header",{collapsed:!1,collapse:()=>{}}),l(s).mode!=="drawer"&&l(s).toggleSide==="right"?(k(),L(l(g),{key:1})):z("",!0)],2)):z("",!0),X("div",{"data-slot":"body",class:K(w.value.body({class:l(s).ui?.body,menu:!0}))},[N(R.$slots,"default",{collapsed:!1,collapse:()=>{}})],2),n.footer?(k(),V("div",{key:1,"data-slot":"footer",class:K(w.value.footer({class:l(s).ui?.footer,menu:!0}))},[N(R.$slots,"footer",{collapsed:!1,collapse:()=>{}})],2)):z("",!0)])]),_:3},16,["open","title","description","ui"])],64))}});function be(e){return Array.isArray?Array.isArray(e):Aa(e)==="[object Array]"}function js(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function yt(e){return e==null?"":js(e)}function le(e){return typeof e=="string"}function Ze(e){return typeof e=="number"}function zs(e){return e===!0||e===!1||qs(e)&&Aa(e)=="[object Boolean]"}function Ca(e){return typeof e=="object"}function qs(e){return Ca(e)&&e!==null}function ue(e){return e!=null}function Qe(e){return!e.trim().length}function Aa(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Ks="Incorrect 'index' type",bt="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Ns=e=>`Invalid value for key ${e}`,Hs=e=>`Pattern length exceeds max of ${e}.`,Us=e=>`Missing ${e} property in key`,Vs=e=>`Property 'weight' in key '${e}' must be a positive integer`,Ws="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",Jt=Object.prototype.hasOwnProperty;var Gs=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const s=Ta(n);this._keys.push(s),this._keyMap[s.id]=s,t+=s.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Ta(e){let t=null,n=null,s=null,i=1,a=null;if(le(e)||be(e))s=e,t=Yt(e),n=et(e);else{if(!Jt.call(e,"name"))throw new Error(Us("name"));const o=e.name;if(s=o,Jt.call(e,"weight")&&e.weight!==void 0&&(i=e.weight,i<=0))throw new Error(Vs(et(o)));t=Yt(o),n=et(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:s,getFn:a}}function Yt(e){return be(e)?e:e.split(".")}function et(e){return be(e)?e.join("."):e}function Js(e,t){const n=[];let s=!1;const i=(a,o,u,r)=>{if(ue(a))if(!o[u])n.push(r!==void 0?{v:a,i:r}:a);else{const v=a[o[u]];if(!ue(v))return;if(u===o.length-1&&(le(v)||Ze(v)||zs(v)||typeof v=="bigint"))n.push(r!==void 0?{v:yt(v),i:r}:yt(v));else if(be(v)){s=!0;for(let h=0,m=v.length;h<m;h+=1)i(v[h],o,u+1,h)}else o.length&&i(v,o,u+1,r)}};return i(e,le(t)?t.split("."):t,0),s?n:n[0]}const Ys={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Qs={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Xs={location:0,threshold:.6,distance:100},Zs={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Js,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},M=Object.freeze({...Qs,...Ys,...Xs,...Zs});function ei(e){return e>=9&&e<=13||e===32||e===160}function ti(e=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(i){let a=0,o=!1;for(let r=0;r<i.length;r++)ei(i.charCodeAt(r))?o=!1:o||(a++,o=!0);if(a===0&&(a=1),n.has(a))return n.get(a);const u=Math.round(s/Math.pow(a,.5*e))/s;return n.set(a,u),u},clear(){n.clear()}}}var Et=class{constructor({getFn:e=M.getFn,fieldNormWeight:t=M.fieldNormWeight}={}){this.norm=ti(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(le(this.docs[0]))for(let n=0;n<e;n++){const s=this._createStringRecord(this.docs[n],n);s&&(this.records[t++]=s)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(bt);if(le(e)){const s=this._createStringRecord(e,t);return s&&this.records.push(s),s}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(bt);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const s of e)Number.isInteger(s)&&s>=0&&t.add(s);if(t.size===0)return;this.records=this.records.filter(s=>!t.has(s.i));const n=Array.from(t).sort((s,i)=>s-i);for(const s of this.records){let i=0,a=n.length;for(;i<a;){const o=i+a>>>1;n[o]<s.i?i=o+1:a=o}s.i-=i}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!ue(e)||Qe(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let s=0,i=this.keys.length;s<i;s++){const a=this.keys[s],o=a.getFn?a.getFn(e):this.getFn(e,a.path);if(ue(o)){if(be(o)){const u=[];for(let r=0,v=o.length;r<v;r+=1){const h=o[r];if(ue(h)){if(le(h)){if(!Qe(h)){const m={v:h,i:r,n:this.norm.get(h)};u.push(m)}}else if(ue(h.v)){const m=le(h.v)?h.v:yt(h.v);if(!Qe(m)){const f={v:m,i:h.i,n:this.norm.get(m)};u.push(f)}}}}n.$[s]=u}else if(le(o)&&!Qe(o)){const u={v:o,n:this.norm.get(o)};n.$[s]=u}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function Ia(e,t,{getFn:n=M.getFn,fieldNormWeight:s=M.fieldNormWeight}={}){const i=new Et({getFn:n,fieldNormWeight:s});return i.setKeys(e.map(Ta)),i.setSources(t),i.create(),i}function ai(e,{getFn:t=M.getFn,fieldNormWeight:n=M.fieldNormWeight}={}){const{keys:s,records:i}=e,a=new Et({getFn:t,fieldNormWeight:n});return a.setKeys(s),a.setIndexRecords(i),a}function ni(e=[],t=M.minMatchCharLength){const n=[];let s=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){const u=e[a];u&&s===-1?s=a:!u&&s!==-1&&(i=a-1,i-s+1>=t&&n.push([s,i]),s=-1)}return e[a-1]&&a-s>=t&&n.push([s,a-1]),n}function si(e,t,n,{location:s=M.location,distance:i=M.distance,threshold:a=M.threshold,findAllMatches:o=M.findAllMatches,minMatchCharLength:u=M.minMatchCharLength,includeMatches:r=M.includeMatches,ignoreLocation:v=M.ignoreLocation}={}){if(t.length>32)throw new Error(Hs(32));const h=t.length,m=e.length,f=Math.max(0,Math.min(s,m));let c=a,p=f;const y=(b,A)=>{const R=b/h;if(v)return R;const W=Math.abs(f-A);return i?R+W/i:W?1:R},I=u>1||r,j=I?Array(m):[];let C;for(;(C=e.indexOf(t,p))>-1;){const b=y(0,C);if(c=Math.min(b,c),p=C+h,I){let A=0;for(;A<h;)j[C+A]=1,A+=1}}p=-1;let S=[],g=1,_=0,x=h+m;const w=1<<h-1;for(let b=0;b<h;b+=1){let A=0,R=x;for(;A<R;)y(b,f+R)<=c?A=R:x=R,R=Math.floor((x-A)/2+A);x=R;let W=Math.max(1,f-R+1);const H=o?m:Math.min(f+R,m)+h,$=Array(H+2);$[H+1]=(1<<b)-1;for(let F=H;F>=W;F-=1){const d=F-1,q=n[e[d]];if($[F]=($[F+1]<<1|1)&q,b&&($[F]|=(S[F+1]|S[F])<<1|1|S[F+1]),$[F]&w&&(g=y(b,d),g<=c)){if(c=g,p=d,_=b,p<=f)break;W=Math.max(1,2*f-p)}}if(y(b+1,f)>c)break;S=$}if(I&&p>=0){const b=Math.min(m-1,p+h-1+_);for(let A=p;A<=b;A+=1)n[e[A]]&&(j[A]=1)}const B={isMatch:p>=0,score:Math.max(.001,g)};if(I){const b=ni(j,u);b.length?r&&(B.indices=b):B.isMatch=!1}return B}function ii(e){const t={};for(let n=0,s=e.length;n<s;n+=1){const i=e.charAt(n);t[i]=(t[i]||0)|1<<s-n-1}return t}function Mt(e){if(e.length<=1)return e;e.sort((n,s)=>n[0]-s[0]||n[1]-s[1]);const t=[e[0]];for(let n=1,s=e.length;n<s;n+=1){const i=t[t.length-1],a=e[n];a[0]<=i[1]+1?i[1]=Math.max(i[1],a[1]):t.push(a)}return t}const Da={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},li=new RegExp("["+Object.keys(Da).join("")+"]","g"),qe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(li,t=>Da[t]):e=>e;var Ot=class{constructor(e,{location:t=M.location,threshold:n=M.threshold,distance:s=M.distance,includeMatches:i=M.includeMatches,findAllMatches:a=M.findAllMatches,minMatchCharLength:o=M.minMatchCharLength,isCaseSensitive:u=M.isCaseSensitive,ignoreDiacritics:r=M.ignoreDiacritics,ignoreLocation:v=M.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:s,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:u,ignoreDiacritics:r,ignoreLocation:v},e=u?e:e.toLowerCase(),e=r?qe(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const h=(f,c)=>{this.chunks.push({pattern:f,alphabet:ii(f),startIndex:c})},m=this.pattern.length;if(m>32){let f=0;const c=m%32,p=m-c;for(;f<p;)h(this.pattern.substr(f,32),f),f+=32;if(c){const y=m-32;h(this.pattern.substr(y),y)}}else h(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:s}=this.options;if(e=t?e:e.toLowerCase(),e=n?qe(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const p={isMatch:!0,score:0};return s&&(p.indices=[[0,e.length-1]]),p}const{location:i,distance:a,threshold:o,findAllMatches:u,minMatchCharLength:r,ignoreLocation:v}=this.options,h=[];let m=0,f=!1;this.chunks.forEach(({pattern:p,alphabet:y,startIndex:I})=>{const{isMatch:j,score:C,indices:S}=si(e,p,y,{location:i+I,distance:a,threshold:o,findAllMatches:u,minMatchCharLength:r,includeMatches:s,ignoreLocation:v});j&&(f=!0),m+=C,j&&S&&h.push(...S)});const c={isMatch:f,score:f?m/this.chunks.length:1};return f&&s&&(c.indices=Mt(h)),c}};const oi=new Set(["fuzzy","include"]);function ri(e){return e.startsWith("inverse")}const wt=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,s;const i=[],a=e.length;for(;(s=t.indexOf(e,n))>-1;)n=s+a,i.push([s,n-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new Ot(e,{location:t.location??M.location,threshold:t.threshold??M.threshold,distance:t.distance??M.distance,includeMatches:t.includeMatches??M.includeMatches,findAllMatches:t.findAllMatches??M.findAllMatches,minMatchCharLength:t.minMatchCharLength??M.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??M.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??M.ignoreDiacritics,ignoreLocation:t.ignoreLocation??M.ignoreLocation});return{type:"fuzzy",search(s){return n.searchIn(s)}}}}],Qt=wt.length,ui="\0",ci="|";function di(e){const t=[],n=e.length;let s=0;for(;s<n;){for(;s<n&&e[s]===" ";)s++;if(s>=n)break;let i=s;for(;i<n&&e[i]!==" "&&e[i]!=='"';)i++;if(i<n&&e[i]==='"'){for(i++;i<n;){if(e[i]==='"'){const a=i+1;if(a>=n||e[a]===" "){i++;break}if(e[a]==="$"&&(a+1>=n||e[a+1]===" ")){i+=2;break}}i++}t.push(e.substring(s,i)),s=i}else{for(;i<n&&e[i]!==" ";)i++;t.push(e.substring(s,i)),s=i}}return t}function Xt(e,t){const n=e.match(t);return n?n[1]:null}function fi(e,t={}){return e.replace(/\\\|/g,ui).split(ci).map(n=>{const s=di(n.replace(/\u0000/g,"|").trim()).filter(a=>a&&!!a.trim()),i=[];for(let a=0,o=s.length;a<o;a+=1){const u=s[a];let r=!1,v=-1;for(;!r&&++v<Qt;){const h=wt[v],m=Xt(u,h.multiRegex);m&&(i.push(h.create(m,t)),r=!0)}if(!r)for(v=-1;++v<Qt;){const h=wt[v],m=Xt(u,h.singleRegex);if(m){i.push(h.create(m,t));break}}}return i})}var pi=class{constructor(e,{isCaseSensitive:t=M.isCaseSensitive,ignoreDiacritics:n=M.ignoreDiacritics,includeMatches:s=M.includeMatches,minMatchCharLength:i=M.minMatchCharLength,ignoreLocation:a=M.ignoreLocation,findAllMatches:o=M.findAllMatches,location:u=M.location,threshold:r=M.threshold,distance:v=M.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:u,threshold:r,distance:v},e=t?e:e.toLowerCase(),e=n?qe(e):e,this.pattern=e,this.query=fi(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:i}=this.options;e=s?e:e.toLowerCase(),e=i?qe(e):e;let a=0;const o=[];let u=0,r=!1;for(let v=0,h=t.length;v<h;v+=1){const m=t[v];o.length=0,a=0,r=!1;for(let f=0,c=m.length;f<c;f+=1){const p=m[f],{isMatch:y,indices:I,score:j}=p.search(e);if(y)a+=1,u+=j,ri(p.type)&&(r=!0),n&&(oi.has(p.type)?o.push(...I):o.push(I));else{u=0,a=0,o.length=0,r=!1;break}}if(a){const f={isMatch:!0,score:u/a};return r&&(f.hasInverse=!0),n&&(f.indices=Mt(o)),f}}return{isMatch:!1,score:1}}};const kt=[];function Rt(...e){kt.push(...e)}function lt(e,t){for(let n=0,s=kt.length;n<s;n+=1){const i=kt[n];if(i.condition(e,t))return new i(e,t)}return new Ot(e,t)}const ot={AND:"$and",OR:"$or"},St={PATH:"$path",PATTERN:"$val"},_t=e=>!!(e[ot.AND]||e[ot.OR]),hi=e=>!!e[St.PATH],mi=e=>!be(e)&&Ca(e)&&!_t(e),Zt=e=>({[ot.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ba(e,t,{auto:n=!0}={}){const s=i=>{if(le(i)){const r={keyId:null,pattern:i};return n&&(r.searcher=lt(i,t)),r}const a=Object.keys(i),o=hi(i);if(!o&&a.length>1&&!_t(i))return s(Zt(i));if(mi(i)){const r=o?i[St.PATH]:a[0],v=o?i[St.PATTERN]:i[r];if(!le(v))throw new Error(Ns(r));const h={keyId:et(r),pattern:v};return n&&(h.searcher=lt(v,t)),h}const u={children:[],operator:a[0]};return a.forEach(r=>{const v=i[r];be(v)&&v.forEach(h=>{u.children.push(s(h))})}),u};return _t(e)||(e=Zt(e)),s(e)}function xt(e,{ignoreFieldNorm:t=M.ignoreFieldNorm}){let n=1;return e.forEach(({key:s,norm:i,score:a})=>{const o=s?s.weight:null;n*=Math.pow(a===0&&o?Number.EPSILON:a,(o||1)*(t?1:i))}),n}function vi(e,{ignoreFieldNorm:t=M.ignoreFieldNorm}){e.forEach(n=>{n.score=xt(n.matches,{ignoreFieldNorm:t})})}var gi=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const s=t[e];t[e]=t[n],t[n]=s,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let s=e;do{e=s;const i=2*e+1,a=2*e+2;if(i<n&&this.comparator(t[i],t[s])>0&&(s=i),a<n&&this.comparator(t[a],t[s])>0&&(s=a),s!==e){const o=t[e];t[e]=t[s],t[s]=o}}while(s!==e)}};function yi(e){const t=[];return e.matches.forEach(n=>{if(!ue(n.indices)||!n.indices.length)return;const s={indices:n.indices,value:n.value};n.key&&(s.key=n.key.id),n.idx>-1&&(s.refIndex=n.idx),t.push(s)}),t}function bi(e,t,{includeMatches:n=M.includeMatches,includeScore:s=M.includeScore}={}){return e.map(i=>{const{idx:a}=i,o={item:t[a],refIndex:a};return n&&(o.matches=yi(i)),s&&(o.score=i.score),o})}const wi=/[\p{L}\p{M}\p{N}_]+/gu,ea=new WeakSet;function ki(e){ea.has(e)||(ea.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Si(e){if(typeof e=="function"){let t=!1;return n=>{const s=e(n);if(!t&&(t=!0,!Array.isArray(s)||s.some(i=>typeof i!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(s)?"array containing non-strings":typeof s}.`);return s}}return e instanceof RegExp?(e.global||ki(e),t=>t.match(e)||[]):t=>t.match(wi)||[]}function $t({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const s=Si(n);return{tokenize(i){return e||(i=i.toLowerCase()),t&&(i=qe(i)),s(i)}}}var _i=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=$t({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:s,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const a of n){this.termSearchers.push(new Ot(a,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const o=s.get(a)||0,u=Math.log(1+(i-o+.5)/(o+.5));this.idfWeights.push(u)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,s=0,i=0,a=0;const o=this.combineAll&&!this.useMask?new Set:null;for(let v=0;v<this.termSearchers.length;v++){const h=this.termSearchers[v].searchIn(e),m=this.idfWeights[v];s+=m,h.isMatch&&(i++,n+=m*(1-h.score),h.indices&&t.push(...h.indices),this.combineAll&&(this.useMask?a|=1<<v:o.add(v)))}if(i===0)return{isMatch:!1,score:1};const u=s>0?1-n/s:0,r={isMatch:!0,score:Math.max(.001,u)};return this.options.includeMatches&&t.length&&(r.indices=Mt(t)),this.combineAll&&(this.useMask?r.matchedMask=a:r.matchedTerms=o,r.termCount=this.numTerms),r}};function ft(e,t,n,s){const i=s.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const a=new Set(i);let o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(const u of a)o.set(u,(o.get(u)||0)+1),e.df.set(u,(e.df.get(u)||0)+1)}function La(e,t,n,s){const{i,v:a,$:o}=t;if(a!==void 0){ft(e,a,i,s);return}if(o)for(let u=0;u<n;u++){const r=o[u];if(r)if(Array.isArray(r))for(const v of r)ft(e,v.v,i,s);else ft(e,r.v,i,s)}}function xi(e,t,n){const s={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const i of e)La(s,i,t,n);return s}function $i(e,t,n,s){La(e,t,n,s)}function Ci(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const s=e.docTermFieldHits.get(t);if(s){for(const[i,a]of s){const o=(e.df.get(i)||0)-a;o<=0?e.df.delete(i):e.df.set(i,o)}e.docTermFieldHits.delete(t)}}function ta(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((u,r)=>u-r);for(const u of n)Ci(e,u);const s=u=>{let r=0,v=n.length;for(;r<v;){const h=r+v>>>1;n[h]<u?r=h+1:v=h}return u-r},i=n[0],a=new Map;for(const[u,r]of e.docFieldCount)a.set(u>i?s(u):u,r);e.docFieldCount=a;const o=new Map;for(const[u,r]of e.docTermFieldHits)o.set(u>i?s(u):u,r);e.docTermFieldHits=o}var we=class{constructor(e,t,n){this.options={...M,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Gs(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=lt(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Et))throw new Error(Ks);if(this._myIndex=t||Ia(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=$t({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=xi(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!ue(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=$t({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});$i(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let s=0,i=this._docs.length;s<i;s+=1)e(this._docs[s],s)&&(t.push(this._docs[s]),n.push(s));if(n.length){this._invertedIndex&&ta(this._invertedIndex,n);const s=new Set(n);this._docs=this._docs.filter((i,a)=>!s.has(a)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(bt);this._invertedIndex&&ta(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:s,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:u}=this.options;if(le(e)&&!e.trim()){let f=this._docs.map((c,p)=>({item:c,refIndex:p}));return Ze(n)&&n>-1&&(f=f.slice(0,n)),f}const r=a&&Ze(n)&&n>0&&le(e),v=o,h=(f,c)=>v(f,c)||f.idx-c.idx;let m;if(r){const f=new gi(n,h);le(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:u}),m=f.extractSorted()}else m=le(e)?le(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),vi(m,{ignoreFieldNorm:u}),a&&m.sort(le(e)?h:v),Ze(n)&&n>-1&&(m=m.slice(0,n));return bi(m,this._docs,{includeMatches:s,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const s=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:u,i:r,n:v})=>{if(!ue(u))return;const h=s.searchIn(u);if(h.isMatch){const m={score:h.score,value:u,norm:v,indices:h.indices};i&&(m.matchedMask=h.matchedMask,m.matchedTerms=h.matchedTerms,m.termCount=h.termCount);const f=[m];if(!i||this._coversAllTokens(f)){const c={item:u,idx:r,matches:f};t?(c.score=xt(c.matches,{ignoreFieldNorm:n}),t.insert(c)):o.push(c)}}}),o}_searchLogical(e){const t=Ba(e,this.options),n=this._normalizedKeys(),s=(u,r,v)=>{if(!("children"in u)){const{keyId:c,searcher:p}=u;let y;return c===null?(y=[],n.forEach((I,j)=>{y.push(...this._findMatches({key:I,value:r[j],searcher:p}))})):y=this._findMatches({key:this._keyStore.get(c),value:this._myIndex.getValueForItemAtKeyId(r,c),searcher:p}),y&&y.length?[{idx:v,item:r,matches:y}]:[]}const{children:h,operator:m}=u,f=[];for(let c=0,p=h.length;c<p;c+=1){const y=h[c],I=s(y,r,v);if(I.length)f.push(...I);else if(m===ot.AND)return[]}return f},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:u,i:r})=>{if(ue(u)){const v=s(t,u,r);v.length&&(a.has(r)||(a.set(r,{idx:r,item:u,matches:[]}),o.push(a.get(r))),v.forEach(({matches:h})=>{a.get(r).matches.push(...h)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const s=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:a}=this._myIndex,o=this._normalizedKeys(),u=t?null:[];return a.forEach(({$:r,i:v})=>{if(!ue(r))return;const h=[];let m=!1,f=!1;if(o.forEach((c,p)=>{const y=this._findMatches({key:c,value:r[p],searcher:s});y.length?(h.push(...y),y[0].hasInverse&&(f=!0)):m=!0}),!(f&&m)&&h.length&&(!i||this._coversAllTokens(h))){const c={idx:v,item:r,matches:h};t?(c.score=xt(c.matches,{ignoreFieldNorm:n}),t.insert(c)):u.push(c)}}),u}_findMatches({key:e,value:t,searcher:n}){if(!ue(t))return[];const s=[];if(be(t))t.forEach(({v:i,i:a,n:o})=>{if(!ue(i))return;const u=n.searchIn(i);if(u.isMatch){const r={score:u.score,key:e,value:i,idx:a,norm:o,indices:u.indices,hasInverse:u.hasInverse};u.termCount!==void 0&&(r.matchedMask=u.matchedMask,r.matchedTerms=u.matchedTerms,r.termCount=u.termCount),s.push(r)}});else{const{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){const u={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(u.matchedMask=o.matchedMask,u.matchedTerms=o.matchedTerms,u.termCount=o.termCount),s.push(u)}}return s}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let s=0;for(let i=0;i<e.length;i++)s|=e[i].matchedMask||0;return s===2**t-1}const n=new Set;for(let s=0;s<e.length;s++){const i=e[s].matchedTerms;if(i)for(const a of i)n.add(a)}return n.size===t}};we.version="7.5.0";we.createIndex=Ia;we.parseIndex=ai;we.config=M;we.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(Ws);return lt(e,{...M,...n}).searchIn(t)};we.parseQuery=Ba;Rt(pi);Rt(_i);we.use=function(...e){e.forEach(t=>Rt(t))};var Ai=we;function Ti(e,t,n){const s=()=>{var a,o;return new Ai((a=ge(t))!==null&&a!==void 0?a:[],(o=ge(n))===null||o===void 0?void 0:o.fuseOptions)},i=rn(s());return re(()=>{var a;return(a=ge(n))===null||a===void 0?void 0:a.fuseOptions},()=>{i.value=s()},{deep:!0}),re(()=>ge(t),a=>{i.value.setCollection(a)},{deep:!0}),{fuse:i,results:O(()=>{const a=ge(n);if(a?.matchAllWhenSearchEmpty&&!ge(e))return ge(t).map((u,r)=>({item:u,refIndex:r}));const o=a?.resultLimit;return i.value.search(ge(e),o?{limit:o}:void 0)})}}const Ii={"&":"&","<":"<",">":">",'"':""","'":"'"};function Di(e){return e.replace(/[&<>"']/g,t=>Ii[t])}function Bi(e){return/&(?:amp|lt|gt|quot|#39);/.test(e)}function pt(e){return Bi(e)?e:Di(e)}function Li(e,t){let n="",s=0,i=!1;for(let a=e.length-1;a>=0;a--){if(e[a]===">")i=!0;else if(e[a]==="<"){i=!1,n=e[a]+n;continue}if(i||s++,s<=t)n=e[a]+n;else{n="..."+n;break}}return n}function ht(e,t,n,s,i){const a=i?t.match(/[\p{L}\p{M}\p{N}_]+/gu)||[]:[],o=a.length>0?Math.min(...a.map(r=>r.length)):t.length;function u(r,v=[]){r=r||"";let h="",m=0;v.forEach(c=>{if(c.length===2&&c[0]===c[1])return;const p=c[1]+1,y=p-c[0]>=o;h+=[pt(r.substring(m,c[0])),y&&"<mark>",pt(r.substring(c[0],p)),y&&"</mark>"].filter(Boolean).join(""),m=p}),h+=pt(r.substring(m));const f=h.indexOf("<mark>");return f!==-1&&(h=Li(h,h.length-f)),h}if(e.matches?.length){for(const r of e.matches)if(!(n&&r.key!==n)&&!s?.includes(r.key))return u(r.value,r.indices)}}const Ei={slots:{root:"flex flex-col min-h-0 min-w-0 divide-y divide-default",input:"",close:"",back:"p-0",content:"relative overflow-hidden flex flex-col",footer:"p-1",viewport:"relative scroll-py-1 overflow-y-auto flex-1 focus:outline-none",group:"p-1 isolate",empty:"text-center text-muted",label:"font-semibold text-highlighted",item:"group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75",itemLeadingIcon:"shrink-0",itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"",itemLeadingChip:"shrink-0",itemLeadingChipSize:"",itemTrailing:"ms-auto inline-flex items-center",itemTrailingIcon:"shrink-0",itemTrailingHighlightedIcon:"shrink-0 text-dimmed hidden group-data-highlighted:inline-flex",itemTrailingKbds:"hidden lg:inline-flex items-center shrink-0",itemTrailingKbdsSize:"",itemWrapper:"flex-1 flex flex-col text-start min-w-0",itemLabel:"truncate space-x-1 text-dimmed",itemLabelBase:"text-highlighted [&>mark]:text-primary [&>mark]:bg-primary/15",itemLabelPrefix:"text-default",itemLabelSuffix:"text-dimmed [&>mark]:text-primary [&>mark]:bg-primary/15",itemDescription:"truncate text-muted [&>mark]:text-primary [&>mark]:bg-primary/15"},variants:{virtualize:{true:{viewport:"p-1 isolate"},false:{viewport:"divide-y divide-default"}},size:{xs:{input:"[&>input]:h-10",empty:"py-3 text-xs",label:"p-1 text-[10px]/3 gap-1",item:"p-1 text-xs gap-1",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailing:"gap-1",itemTrailingIcon:"size-4",itemTrailingHighlightedIcon:"size-4",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"sm"},sm:{input:"[&>input]:h-11",empty:"py-4 text-xs",label:"p-1.5 text-[10px]/3 gap-1.5",item:"p-1.5 text-xs gap-1.5",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailing:"gap-1.5",itemTrailingIcon:"size-4",itemTrailingHighlightedIcon:"size-4",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"sm"},md:{input:"[&>input]:h-12",empty:"py-6 text-sm",label:"p-1.5 text-xs gap-1.5",item:"p-1.5 text-sm gap-1.5",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailing:"gap-1.5",itemTrailingIcon:"size-5",itemTrailingHighlightedIcon:"size-5",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"md"},lg:{input:"[&>input]:h-13",empty:"py-7 text-sm",label:"p-2 text-xs gap-2",item:"p-2 text-sm gap-2",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailing:"gap-2",itemTrailingIcon:"size-5",itemTrailingHighlightedIcon:"size-5",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"md"},xl:{input:"[&>input]:h-14",empty:"py-8 text-base",label:"p-2 text-sm gap-2",item:"p-2 text-base gap-2",itemLeadingIcon:"size-6",itemLeadingAvatarSize:"xs",itemLeadingChip:"size-6",itemLeadingChipSize:"lg",itemTrailing:"gap-2",itemTrailingIcon:"size-6",itemTrailingHighlightedIcon:"size-6",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"lg"}},active:{true:{item:"text-highlighted before:bg-elevated",itemLeadingIcon:"text-default"},false:{item:["text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"]}},loading:{true:{itemLeadingIcon:"animate-spin"}}},defaultVariants:{size:"md"}},Mi=["innerHTML"],Oi=["innerHTML"],Ri=["innerHTML"],Fi=Object.assign({inheritAttrs:!1},{__name:"UCommandPalette",props:it({as:{type:null,required:!1},size:{type:null,required:!1},icon:{type:[String,Boolean],required:!1,skipCheck:!0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},childrenIcon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1,default:!0},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},back:{type:[Boolean,Object],required:!1,default:!0},backIcon:{type:null,required:!1},input:{type:[Boolean,Object],required:!1,default:!0},groups:{type:Array,required:!1},fuse:{type:Object,required:!1},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},preserveGroupOrder:{type:Boolean,required:!1,default:!1},searchDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:Object,required:!1},multiple:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},selectionBehavior:{type:String,required:!1},by:{type:[String,Function],required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:it(["update:modelValue","highlight","entryFocus","leave","update:open"],["update:searchTerm"]),setup(e,{emit:t}){const n=e,s=t,i=Le(),a=Ee("commandPalette",n),o=ze(e,"searchTerm",{type:String,default:""}),{t:u}=Ke(),r=$e(),v=je(st(a,"as","disabled","multiple","modelValue","defaultValue","highlightOnHover","by"),s),h=De(()=>a.virtualize?Be(typeof a.virtualize=="boolean"?{}:a.virtualize,{estimateSize:Wn(B.value,"md",a.descriptionKey,!!i["item-description"])}):!1),[m,f]=at({props:{item:{type:Object,required:!0},group:{type:Object,required:!1},index:{type:Number,required:!1}}}),c=O(()=>Me({extend:Ei,...r.ui?.commandPalette||{}})({size:a.size,virtualize:!!a.virtualize})),p=O(()=>Be({},a.fuse,{fuseOptions:{ignoreLocation:!0,threshold:.1,keys:[a.labelKey,a.descriptionKey,"suffix"]},resultLimit:12,matchAllWhenSearchEmpty:!0})),y=U([]),I=O(()=>y.value[y.value.length-1]?.placeholder||a.placeholder||u("commandPalette.placeholder")),j=O(()=>y.value?.length?[y.value[y.value.length-1]]:a.groups),C=O(()=>j.value?.filter($=>$.id?!$.ignoreFilter:(console.warn("[@nuxt/ui] CommandPalette group is missing an `id` property"),!1))?.flatMap($=>$.items?.map(F=>({...F,group:$.id}))||[])||[]),S=un(o,()=>a.searchDelay),{results:g}=Ti(S,C,p),_=cn(g,16,!0);function x($,F){let d=F;return $?.postFilter&&typeof $.postFilter=="function"&&(d=$.postFilter(S.value,d)),{...$,items:d.slice(0,p.value.resultLimit).map(q=>({...q,labelHtml:q.labelHtml??ht(q,S.value,a.labelKey,void 0,p.value.fuseOptions?.useTokenSearch),suffixHtml:q.suffixHtml??ht(q,S.value,"suffix",[a.labelKey],p.value.fuseOptions?.useTokenSearch),descriptionHtml:q.descriptionHtml??ht(q,S.value,a.descriptionKey,[a.labelKey,"suffix"],p.value.fuseOptions?.useTokenSearch)}))}}const w=O(()=>{const $=j.value,F=_.value.reduce((D,G)=>{const{item:ie,matches:te}=G;return ie.group&&(D[ie.group]||=[],D[ie.group]?.push({...ie,matches:te})),D},{});if(a.preserveGroupOrder){const D=[];for(const G of $||[]){if(!G.items?.length)continue;const ie=G.ignoreFilter?G.items:F[G.id];if(!ie?.length)continue;const te=x(G,ie);te.items?.length&&D.push(te)}return D}const q=[...Object.entries(F).map(([D,G])=>{const ie=$?.find(ye=>ye.id===D);if(!ie)return;const te=x(ie,G);return te.items?.length?te:void 0}).filter(D=>!!D)];for(const D of $||[]){if(!D.ignoreFilter||!D.items?.length)continue;const G=x(D,D.items);if(!G.items?.length)continue;const ie=$.indexOf(D),te=new Set;for(let fe=0;fe<ie;fe++)te.add($[fe].id);let ye=-1;for(let fe=0;fe<q.length;fe++)te.has(q[fe].id)&&(ye=fe);q.splice(ye+1,0,G)}return q}),B=O(()=>w.value.flatMap($=>$.items||[])),b=da("rootRef");re(w,()=>{It(()=>{const $=b.value;$?.$el?.contains(document.activeElement)?$?.highlightFirstItem():$?.highlightSelected(void 0,!1)})});function A($){$.children?.length&&(y.value.push({id:`history-${y.value.length}`,label:$.label,slot:$.slot,placeholder:$.placeholder,items:$.children}),o.value="",b.value?.highlightFirstItem())}function R(){y.value.length&&(y.value.pop(),o.value="",b.value?.highlightFirstItem())}function W(){o.value||R()}function H($,F){F.children?.length?($.preventDefault(),A(F)):F.onSelect?.($)}return($,F)=>(k(),V(he,null,[E(l(m),null,{default:T(({item:d,index:q,group:D})=>[E(fa,Y(l(dn)(d),{custom:""}),{default:T(({active:G,...ie})=>[E(l(zn),{value:l(a).valueKey?l(pe)(d,l(a).valueKey):l(nt)(d,["matches","group","onSelect","labelHtml","suffixHtml","descriptionHtml","children"]),disabled:d.disabled,"as-child":"",onSelect:te=>H(te,d)},{default:T(()=>[E(fn,Y(ie,{"data-slot":"item",class:c.value.item({class:[l(a).ui?.item,d.ui?.item,d.class],active:G||d.active})}),{default:T(()=>[N($.$slots,d.slot||D?.slot||"item",{item:d,index:q,ui:c.value},()=>[N($.$slots,d.slot?`${d.slot}-leading`:D?.slot?`${D.slot}-leading`:"item-leading",{item:d,index:q,ui:c.value},()=>[d.loading?(k(),L(Ae,{key:0,name:l(a).loadingIcon||l(r).ui.icons.loading,"data-slot":"itemLeadingIcon",class:K(c.value.itemLeadingIcon({class:[l(a).ui?.itemLeadingIcon,d.ui?.itemLeadingIcon],loading:!0}))},null,8,["name","class"])):d.icon?(k(),L(Ae,{key:1,name:d.icon,"data-slot":"itemLeadingIcon",class:K(c.value.itemLeadingIcon({class:[l(a).ui?.itemLeadingIcon,d.ui?.itemLeadingIcon],active:G||d.active}))},null,8,["name","class"])):d.avatar?(k(),L(pn,Y({key:2,size:d.ui?.itemLeadingAvatarSize||l(a).ui?.itemLeadingAvatarSize||c.value.itemLeadingAvatarSize()},d.avatar,{"data-slot":"itemLeadingAvatar",class:c.value.itemLeadingAvatar({class:[l(a).ui?.itemLeadingAvatar,d.ui?.itemLeadingAvatar],active:G||d.active})}),null,16,["size","class"])):d.chip?(k(),L(hn,Y({key:3,size:d.ui?.itemLeadingChipSize||l(a).ui?.itemLeadingChipSize||c.value.itemLeadingChipSize(),inset:"",standalone:""},d.chip,{"data-slot":"itemLeadingChip",class:c.value.itemLeadingChip({class:[l(a).ui?.itemLeadingChip,d.ui?.itemLeadingChip],active:G||d.active})}),null,16,["size","class"])):z("",!0)]),d.prefix||d.labelHtml||l(pe)(d,l(a).labelKey)||d.suffixHtml||d.suffix||i[d.slot?`${d.slot}-label`:D?.slot?`${D.slot}-label`:"item-label"]||l(pe)(d,l(a).descriptionKey)||i[d.slot?`${d.slot}-description`:D?.slot?`${D.slot}-description`:"item-description"]?(k(),V("span",{key:0,"data-slot":"itemWrapper",class:K(c.value.itemWrapper({class:[l(a).ui?.itemWrapper,d.ui?.itemWrapper]}))},[X("span",{"data-slot":"itemLabel",class:K(c.value.itemLabel({class:[l(a).ui?.itemLabel,d.ui?.itemLabel],active:G||d.active}))},[N($.$slots,d.slot?`${d.slot}-label`:D?.slot?`${D.slot}-label`:"item-label",{item:d,index:q,ui:c.value},()=>[d.prefix?(k(),V("span",{key:0,"data-slot":"itemLabelPrefix",class:K(c.value.itemLabelPrefix({class:[l(a).ui?.itemLabelPrefix,d.ui?.itemLabelPrefix]}))},ce(d.prefix),3)):z("",!0),d.labelHtml?(k(),V("span",{key:1,"data-slot":"itemLabelBase",class:K(c.value.itemLabelBase({class:[l(a).ui?.itemLabelBase,d.ui?.itemLabelBase],active:G||d.active})),innerHTML:d.labelHtml},null,10,Mi)):(k(),V("span",{key:2,"data-slot":"itemLabelBase",class:K(c.value.itemLabelBase({class:[l(a).ui?.itemLabelBase,d.ui?.itemLabelBase],active:G||d.active}))},ce(l(pe)(d,l(a).labelKey)),3)),d.suffixHtml?(k(),V("span",{key:3,"data-slot":"itemLabelSuffix",class:K(c.value.itemLabelSuffix({class:[l(a).ui?.itemLabelSuffix,d.ui?.itemLabelSuffix],active:G||d.active})),innerHTML:d.suffixHtml},null,10,Oi)):d.suffix?(k(),V("span",{key:4,"data-slot":"itemLabelSuffix",class:K(c.value.itemLabelSuffix({class:[l(a).ui?.itemLabelSuffix,d.ui?.itemLabelSuffix],active:G||d.active}))},ce(d.suffix),3)):z("",!0)])],2),d.descriptionHtml?(k(),V("span",{key:0,"data-slot":"itemDescription",class:K(c.value.itemDescription({class:[l(a).ui?.itemDescription,d.ui?.itemDescription]})),innerHTML:d.descriptionHtml},null,10,Ri)):l(pe)(d,l(a).descriptionKey)||i[d.slot?`${d.slot}-description`:D?.slot?`${D.slot}-description`:"item-description"]?(k(),V("span",{key:1,"data-slot":"itemDescription",class:K(c.value.itemDescription({class:[l(a).ui?.itemDescription,d.ui?.itemDescription]}))},[N($.$slots,d.slot?`${d.slot}-description`:D?.slot?`${D.slot}-description`:"item-description",{item:d,index:q,ui:c.value},()=>[me(ce(l(pe)(d,l(a).descriptionKey)),1)])],2)):z("",!0)],2)):z("",!0),X("span",{"data-slot":"itemTrailing",class:K(c.value.itemTrailing({class:[l(a).ui?.itemTrailing,d.ui?.itemTrailing]}))},[N($.$slots,d.slot?`${d.slot}-trailing`:D?.slot?`${D.slot}-trailing`:"item-trailing",{item:d,index:q,ui:c.value},()=>[d.children&&d.children.length>0?(k(),L(Ae,{key:0,name:l(a).childrenIcon||l(r).ui.icons.chevronRight,"data-slot":"itemTrailingIcon",class:K(c.value.itemTrailingIcon({class:[l(a).ui?.itemTrailingIcon,d.ui?.itemTrailingIcon]}))},null,8,["name","class"])):d.kbds?.length?(k(),V("span",{key:1,"data-slot":"itemTrailingKbds",class:K(c.value.itemTrailingKbds({class:[l(a).ui?.itemTrailingKbds,d.ui?.itemTrailingKbds]}))},[(k(!0),V(he,null,_e(d.kbds,(te,ye)=>(k(),L(ia,Y({key:ye,size:d.ui?.itemTrailingKbdsSize||l(a).ui?.itemTrailingKbdsSize||c.value.itemTrailingKbdsSize()},{ref_for:!0},typeof te=="string"?{value:te}:te),null,16,["size"]))),128))],2)):D?.highlightedIcon?(k(),L(Ae,{key:2,name:D.highlightedIcon,"data-slot":"itemTrailingHighlightedIcon",class:K(c.value.itemTrailingHighlightedIcon({class:[l(a).ui?.itemTrailingHighlightedIcon,d.ui?.itemTrailingHighlightedIcon]}))},null,8,["name","class"])):z("",!0)]),d.children?.length?z("",!0):(k(),L(l(qn),{key:0,"as-child":""},{default:T(()=>[E(Ae,{name:l(a).selectedIcon||l(r).ui.icons.check,"data-slot":"itemTrailingIcon",class:K(c.value.itemTrailingIcon({class:[l(a).ui?.itemTrailingIcon,d.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024))],2)])]),_:2},1040,["class"])]),_:2},1032,["value","disabled","onSelect"])]),_:2},1040)]),_:3}),E(l(Vn),Y({ref_key:"rootRef",ref:b,"data-slot":"root"},{...l(v),...$.$attrs},{"selection-behavior":l(a).selectionBehavior,class:c.value.root({class:[l(a).ui?.root,l(a).class]})}),{default:T(()=>[l(a).input?(k(),L(l(Kn),{key:0,modelValue:o.value,"onUpdate:modelValue":F[1]||(F[1]=d=>o.value=d),"as-child":""},{default:T(()=>[E(pa,Y({variant:"none",size:l(a).size,placeholder:I.value,autofocus:l(a).autofocus,loading:l(a).loading,"loading-icon":l(a).loadingIcon,"trailing-icon":l(a).trailingIcon,icon:l(a).icon===!1?void 0:l(a).icon??l(r).ui.icons.search},typeof l(a).input=="object"?l(a).input:{},{"data-slot":"input",class:c.value.input({class:l(a).ui?.input}),onKeydown:mn(W,["backspace"])}),At({_:2},[y.value?.length&&(l(a).back||i.back)?{name:"leading",fn:T(()=>[N($.$slots,"back",{ui:c.value},()=>[E(xe,Y({size:l(a).size,icon:l(a).backIcon||l(r).ui.icons.arrowLeft,color:"neutral",variant:"link","aria-label":l(u)("commandPalette.back")},typeof l(a).back=="object"?l(a).back:{},{"data-slot":"back",class:c.value.back({class:l(a).ui?.back}),onClick:R}),null,16,["size","icon","aria-label","class"])])]),key:"0"}:void 0,l(a).close||i.close?{name:"trailing",fn:T(()=>[N($.$slots,"close",{ui:c.value},()=>[l(a).close?(k(),L(xe,Y({key:0,size:l(a).size,icon:l(a).closeIcon||l(r).ui.icons.close,color:"neutral",variant:"ghost","aria-label":l(u)("commandPalette.close")},typeof l(a).close=="object"?l(a).close:{},{"data-slot":"close",class:c.value.close({class:l(a).ui?.close}),onClick:F[0]||(F[0]=d=>s("update:open",!1))}),null,16,["size","icon","aria-label","class"])):z("",!0)])]),key:"1"}:void 0]),1040,["size","placeholder","autofocus","loading","loading-icon","trailing-icon","icon","class"])]),_:3},8,["modelValue"])):z("",!0),E(l(Nn),{"data-slot":"content",class:K(c.value.content({class:l(a).ui?.content}))},{default:T(()=>[w.value?.length?(k(),V("div",{key:0,role:"presentation","data-slot":"viewport",class:K(c.value.viewport({class:l(a).ui?.viewport}))},[l(a).virtualize?(k(),L(l(Hn),Y({key:0,options:B.value,"text-content":d=>l(pe)(d,l(a).labelKey)},h.value),{default:T(({option:d,virtualItem:q})=>[E(l(f),{item:d,index:q.index},null,8,["item","index"])]),_:1},16,["options","text-content"])):(k(!0),V(he,{key:1},_e(w.value,d=>(k(),L(l(Un),{key:`group-${d.id}`,"data-slot":"group",class:K(c.value.group({class:l(a).ui?.group}))},{default:T(()=>[l(pe)(d,l(a).labelKey)||i[d.slot?`${d.slot}-group-label`:"group-label"]?(k(),L(l(is),{key:0,"data-slot":"label",class:K(c.value.label({class:l(a).ui?.label}))},{default:T(()=>[N($.$slots,d.slot?`${d.slot}-group-label`:"group-label",{group:d,label:l(pe)(d,l(a).labelKey),ui:c.value},()=>[me(ce(l(pe)(d,l(a).labelKey)),1)])]),_:2},1032,["class"])):z("",!0),(k(!0),V(he,null,_e(d.items,(q,D)=>(k(),L(l(f),{key:`group-${d.id}-${D}`,item:q,index:D,group:d},null,8,["item","index","group"]))),128))]),_:2},1032,["class"]))),128))],2)):(k(),V("div",{key:1,"data-slot":"empty",class:K(c.value.empty({class:l(a).ui?.empty}))},[N($.$slots,"empty",{searchTerm:o.value},()=>[me(ce(o.value?l(u)("commandPalette.noMatch",{searchTerm:o.value}):l(u)("commandPalette.noData")),1)])],2))]),_:3},8,["class"]),i.footer?(k(),V("div",{key:1,"data-slot":"footer",class:K(c.value.footer({class:l(a).ui?.footer}))},[N($.$slots,"footer",{ui:c.value})],2)):z("",!0)]),_:3},16,["selection-behavior","class"])],64))}}),Pi={slots:{modal:"",input:""},variants:{fullscreen:{false:{modal:"sm:max-w-3xl h-full sm:h-[28rem]"}},size:{xs:{},sm:{},md:{},lg:{},xl:{}}},defaultVariants:{size:"md"}},ji=/^[^-]+.*-.*[^-]+$/,zi=/^[^_]+.*_.*[^_]+$/,aa=["arrowleft","arrowright","arrowup","arrowdown","tab","escape","enter","backspace"];function Xe(e){return/^[a-z]$/i.test(e)?`Key${e.toUpperCase()}`:/^\d$/.test(e)?`Digit${e}`:/^f\d+$/i.test(e)?e.toUpperCase():{space:"Space",enter:"Enter",escape:"Escape",tab:"Tab",backspace:"Backspace",delete:"Delete",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight"}[e.toLowerCase()]||e}function Ea(e,t={}){const n=t.chainDelay??800,s=U([]),i=()=>{s.value.splice(0,s.value.length)},a=ha(i,n);let o;const u=()=>{o=void 0,v.stop()},r=()=>{const g=o;if(u(),!g)return;const _=C.value.find(x=>x.key===g.shortcut.key&&!x.metaKey&&!x.ctrlKey&&!x.altKey&&!x.shiftKey);_?.enabled&&_.handler(g.event)},v=vn(()=>{r(),i()},n,{immediate:!1}),{macOS:h}=gn(),m=bn(),f=t.layoutIndependent??!1,c=aa.map(g=>Xe(g)),p=g=>{if(!g.key)return;const _=f||g.altKey,x=_?/^Key[A-Z]$/i.test(g.code):/^[a-z]{1}$/i.test(g.key),w=_?c.includes(g.code):aa.includes(g.key.toLowerCase());let B;if(s.value.push(f?g.code:g.key),s.value.length>=2){B=s.value.slice(-2).join("-");for(const b of j.value)if(b.key===B){b.enabled?(u(),g.preventDefault(),b.handler(g)):r(),i();return}}r();for(const b of C.value){if(f){if(g.code!==b.key)continue}else if(b.altKey&&g.altKey){if(g.code!==Xe(b.key))continue}else if(g.key.toLowerCase()!==b.key)continue;if(g.metaKey!==b.metaKey||g.ctrlKey!==b.ctrlKey||g.altKey!==b.altKey||(x||w||b.shiftKey||g.shiftKey&&(g.metaKey||g.ctrlKey))&&g.shiftKey!==b.shiftKey)continue;if(!b.metaKey&&!b.ctrlKey&&!b.altKey&&!b.shiftKey&&S.value.has(b.key)){b.enabled&&g.preventDefault(),o={shortcut:b,event:g},v.start();return}b.enabled&&(g.preventDefault(),b.handler(g)),i();return}a()},y=O(()=>{const g=m.value?.tagName,_=m.value?.contentEditable;return g==="INPUT"||g==="TEXTAREA"||_==="true"||_==="plaintext-only"?m.value?.name||!0:!1}),I=O(()=>Object.entries(ge(e)).map(([g,_])=>{if(!_)return null;let x;g.includes("-")&&g!=="-"&&!g.includes("_")&&!g.match(ji)?.length&&console.trace(`[Shortcut] Invalid key: "${g}"`),g.includes("_")&&g!=="_"&&!g.match(zi)?.length&&console.trace(`[Shortcut] Invalid key: "${g}"`);const w=g.includes("-")&&g!=="-"&&!g.includes("_");if(w)f?x={key:g.split("-").map(A=>Xe(A)).join("-"),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1}:x={key:g.toLowerCase(),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1};else{const b=g.toLowerCase().split("_").map(R=>R);let A=b.filter(R=>!["meta","command","ctrl","shift","alt","option"].includes(R)).join("_");f&&(A=Xe(A)),x={key:A,metaKey:b.includes("meta")||b.includes("command"),ctrlKey:b.includes("ctrl"),shiftKey:b.includes("shift"),altKey:b.includes("alt")||b.includes("option")}}if(x.chained=w,!h.value&&x.metaKey&&!x.ctrlKey&&(x.metaKey=!1,x.ctrlKey=!0),typeof _=="function"?x.handler=_:typeof _=="object"&&(x={...x,handler:_.handler}),!x.handler)return console.trace("[Shortcut] Invalid value"),null;let B=!0;return _.usingInput?typeof _.usingInput=="string"&&(B=y.value===_.usingInput):B=!y.value,x.enabled=B,x}).filter(Boolean)),j=O(()=>I.value.filter(g=>g.chained)),C=O(()=>I.value.filter(g=>!g.chained)),S=O(()=>new Set(j.value.map(g=>g.key.split("-")[0])));return yn("keydown",p)}const qi={__name:"UDashboardSearch",props:it({size:{type:null,required:!1},close:{type:[Boolean,Object],required:!1,default:!0},input:{type:[Boolean,Object],required:!1},shortcut:{type:String,required:!1,default:"meta_k"},fuse:{type:Object,required:!1},searchDelay:{type:Number,required:!1,default:100},colorMode:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},overlay:{type:Boolean,required:!1},transition:{type:Boolean,required:!1},content:{type:Object,required:!1},dismissible:{type:Boolean,required:!1},fullscreen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0},unmountOnHide:{type:Boolean,required:!1},icon:{type:[String,Boolean],required:!1,skipCheck:!0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},childrenIcon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},closeIcon:{type:null,required:!1},back:{type:[Boolean,Object],required:!1},backIcon:{type:null,required:!1},disabled:{type:Boolean,required:!1},highlightOnHover:{type:Boolean,required:!1},labelKey:{type:null,required:!1},descriptionKey:{type:null,required:!1},preserveGroupOrder:{type:Boolean,required:!1},virtualize:{type:[Boolean,Object],required:!1},groups:{type:Array,required:!1}},{open:{type:Boolean,default:!1},openModifiers:{},searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:["update:open","update:searchTerm"],setup(e,{expose:t}){const n=e,s=Le(),i=Ee("dashboardSearch",n),a=ze(e,"open",{type:Boolean,default:!1}),o=ze(e,"searchTerm",{type:String,default:""});gt("dashboard:search:toggle",()=>{a.value=!a.value});const{t:u}=Ke(),r=la(),v=$e(),h=je(st(i,"size","icon","trailingIcon","selectedIcon","childrenIcon","placeholder","autofocus","loading","loadingIcon","close","closeIcon","back","backIcon","disabled","highlightOnHover","labelKey","descriptionKey","preserveGroupOrder","virtualize","searchDelay")),m=je(st(i,"overlay","transition","content","dismissible","fullscreen","modal","portal","unmountOnHide")),f=O(()=>i.input===!1?!1:Be(typeof i.input=="object"?i.input:{},{fixed:!0})),c=()=>nt(s,["content"]),p=O(()=>Be({},i.fuse,{fuseOptions:{useTokenSearch:!0}})),y=O(()=>Me({extend:Pi,...v.ui?.dashboardSearch||{}})({size:i.size,fullscreen:i.fullscreen})),I=O(()=>{const S=[];return S.push(...i.groups||[]),i.colorMode&&!r?.forced&&S.push({id:"theme",label:u("dashboardSearch.theme"),items:[{label:u("colorMode.system"),icon:v.ui.icons.system,active:r.preference==="system",onSelect:()=>{r.preference="system"}},{label:u("colorMode.light"),icon:v.ui.icons.light,active:r.preference==="light",onSelect:()=>{r.preference="light"}},{label:u("colorMode.dark"),icon:v.ui.icons.dark,active:r.preference==="dark",onSelect:()=>{r.preference="dark"}}]}),S}),j=da("commandPaletteRef");function C(S){S.disabled||(a.value=!1,o.value="")}return Ea({[i.shortcut]:{usingInput:!0,handler:()=>a.value=!a.value}}),t({commandPaletteRef:j}),(S,g)=>(k(),L(Lt,Y({open:a.value,"onUpdate:open":g[2]||(g[2]=_=>a.value=_),title:l(i).title||l(u)("dashboardSearch.title"),description:l(i).description||l(u)("dashboardSearch.description")},l(m),{"data-slot":"modal",class:y.value.modal({class:[l(i).ui?.modal,l(i).class]})}),{content:T(_=>[N(S.$slots,"content",Te(Ie(_)),()=>[E(Fi,Y({ref_key:"commandPaletteRef",ref:j,"search-term":o.value,"onUpdate:searchTerm":g[0]||(g[0]=x=>o.value=x)},l(h),{groups:I.value,fuse:p.value,input:f.value,ui:l(sa)(l(nt)(y.value,["modal"]),l(i).ui),"onUpdate:modelValue":C,"onUpdate:open":g[1]||(g[1]=x=>a.value=x)}),At({_:2},[_e(c(),(x,w)=>({name:w,fn:T(B=>[N(S.$slots,w,Te(Ie(B)))])}))]),1040,["search-term","groups","fuse","input","ui"])])]),_:3},16,["open","title","description","class"]))}},Ki={class:"flex items-center gap-2"},Ni={class:"space-y-4"},Hi={class:"grid grid-cols-2 gap-3"},Ui={id:"jb-products"},Vi=["value"],Wi={class:"flex items-center gap-2"},Gi={class:"text-xs font-medium text-muted uppercase tracking-wider"},Ji={class:"flex items-center justify-between pt-1"},Yi=ve({__name:"OpenInIdeSettingsModal",setup(e){const{prefs:t,settingsOpen:n,settingsContext:s}=ya(),i=Object.keys(Ht).map(c=>({label:Ht[c],value:c})),a=Object.keys(Ut).map(c=>({label:Ut[c],value:c})),o=O(()=>t.value.method==="auto"||t.value.method==="vscode"),u=O(()=>t.value.method!=="vscode"),r=O(()=>s.value.projectKey??null),v=O(()=>s.value.projectName||(r.value?`project ${r.value}`:""));function h(c){return O({get:()=>r.value?t.value[c][r.value]??"":"",set:p=>{const y=r.value;if(!y)return;const I={...t.value[c]};p.trim()?I[y]=p:delete I[y],t.value[c]=I}})}const m=h("projectRoots"),f=h("jetbrainsProjectNames");return(c,p)=>{const y=Ae,I=Jn,j=Yn,C=Qn,S=pa,g=Xn,_=Zn,x=es,w=Gn,B=xe,b=Lt;return k(),L(b,{open:l(n),"onUpdate:open":p[9]||(p[9]=A=>Pe(n)?n.value=A:null),ui:{content:"max-w-lg"}},{header:T(()=>[X("div",Ki,[E(y,{name:"i-lucide-external-link",class:"size-5 text-primary"}),p[10]||(p[10]=X("h2",{class:"text-base font-semibold"},"Open in IDE",-1)),E(I,{topic:"ide.open"})])]),body:T(()=>[X("div",Ni,[p[14]||(p[14]=X("p",{class:"text-sm text-muted"}," Click a source path anywhere in the dashboard to open it in your editor. These preferences are stored in this browser only. ",-1)),E(C,{label:"Method",name:"method",description:"Auto probes the JetBrains local server first, then falls back to a URL launch."},{default:T(()=>[E(j,{modelValue:l(t).method,"onUpdate:modelValue":p[0]||(p[0]=A=>l(t).method=A),items:l(i),class:"w-full"},null,8,["modelValue","items"])]),_:1}),E(C,{label:"Workspace root",name:"defaultRoot",description:"Absolute path to your local checkout — repo-relative paths are joined onto it (VS Code needs this)."},{default:T(()=>[E(S,{modelValue:l(t).defaultRoot,"onUpdate:modelValue":p[1]||(p[1]=A=>l(t).defaultRoot=A),placeholder:"/home/me/my-repo",class:"w-full"},null,8,["modelValue"])]),_:1}),l(o)?(k(),L(C,{key:0,label:"VS Code flavor",name:"vscodeScheme"},{default:T(()=>[E(j,{modelValue:l(t).vscodeScheme,"onUpdate:modelValue":p[2]||(p[2]=A=>l(t).vscodeScheme=A),items:l(a),class:"w-full"},null,8,["modelValue","items"])]),_:1})):z("",!0),l(u)?(k(),V(he,{key:1},[X("div",Hi,[E(C,{label:"JetBrains product",name:"jetbrainsProduct",description:"e.g. idea, webstorm, pycharm."},{default:T(()=>[E(S,{modelValue:l(t).jetbrainsProduct,"onUpdate:modelValue":p[3]||(p[3]=A=>l(t).jetbrainsProduct=A),placeholder:"idea",list:"jb-products",class:"w-full"},null,8,["modelValue"]),X("datalist",Ui,[(k(!0),V(he,null,_e(l(Bn),A=>(k(),V("option",{key:A,value:A},null,8,Vi))),128))])]),_:1}),E(C,{label:"Local server port",name:"jetbrainsPort",description:"Remote Control plugin."},{default:T(()=>[E(S,{modelValue:l(t).jetbrainsPort,"onUpdate:modelValue":p[4]||(p[4]=A=>l(t).jetbrainsPort=A),modelModifiers:{number:!0},type:"number",class:"w-full"},null,8,["modelValue"])]),_:1})]),E(C,{name:"jetbrainsHttpUsesRelativePath"},{default:T(()=>[X("div",Wi,[E(g,{modelValue:l(t).jetbrainsHttpUsesRelativePath,"onUpdate:modelValue":p[5]||(p[5]=A=>l(t).jetbrainsHttpUsesRelativePath=A)},null,8,["modelValue"]),p[11]||(p[11]=X("span",{class:"text-sm"},"Send a content-root-relative path to the local server",-1))])]),_:1})],64)):z("",!0),l(r)?(k(),V(he,{key:2},[E(_),X("p",Gi,"Override for "+ce(l(v)),1),E(C,{label:"Workspace root override",name:"projectRoot",description:"Use a different local folder for this project (monorepos, multiple checkouts)."},{default:T(()=>[E(S,{modelValue:l(m),"onUpdate:modelValue":p[6]||(p[6]=A=>Pe(m)?m.value=A:null),placeholder:l(t).defaultRoot||"/home/me/this-project",class:"w-full"},null,8,["modelValue","placeholder"])]),_:1}),l(u)?(k(),L(C,{key:0,label:"JetBrains project name",name:"projectJbName",description:"The open IDE project name for the jetbrains:// link."},{default:T(()=>[E(S,{modelValue:l(f),"onUpdate:modelValue":p[7]||(p[7]=A=>Pe(f)?f.value=A:null),placeholder:l(v),class:"w-full"},null,8,["modelValue","placeholder"])]),_:1})):z("",!0)],64)):z("",!0),l(u)?(k(),L(x,{key:3,color:"neutral",variant:"soft",icon:"i-lucide-info",title:"JetBrains prerequisites",description:"The jetbrains:// link needs JetBrains Toolbox. The local server needs the IDE Remote Control plugin with 'Allow unsigned requests', and browsers block it when this dashboard is served over HTTPS."})):z("",!0),X("div",Ji,[E(w,{to:"ide-integration"},{default:T(()=>[...p[12]||(p[12]=[me("Learn more",-1)])]),_:1}),E(B,{color:"neutral",onClick:p[8]||(p[8]=A=>n.value=!1)},{default:T(()=>[...p[13]||(p[13]=[me("Done",-1)])]),_:1})])])]),_:1},8,["open"])}}}),Qi=Object.assign(Yi,{__name:"OpenInIdeSettingsModal"}),Xi={base:"fixed inset-0 flex overflow-hidden"},Zi={__name:"UDashboardGroup",props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},storage:{type:String,required:!1,default:"cookie"},storageKey:{type:String,required:!1,default:"dashboard"},storageOptions:{type:Object,required:!1},persistent:{type:Boolean,required:!1,default:!0},unit:{type:String,required:!1,default:"%"}},setup(e){const n=Ee("dashboardGroup",e),s=ua(),i=$e(),a=O(()=>Me({extend:Xi,...i.ui?.dashboardGroup||{}})),o=U(!1),u=U(!1);return An({storage:n.storage,storageKey:n.storageKey,storageOptions:n.storageOptions,persistent:n.persistent,unit:n.unit,sidebarOpen:o,toggleSidebar:()=>{s.hooks.callHook("dashboard:sidebar:toggle")},sidebarCollapsed:u,collapseSidebar:r=>{s.hooks.callHook("dashboard:sidebar:collapse",r)},toggleSearch:()=>{s.hooks.callHook("dashboard:search:toggle")}}),(r,v)=>(k(),L(l(na),{as:l(n).as,class:K(a.value({class:[l(n).ui?.base,l(n).class]}))},{default:T(()=>[N(r.$slots,"default")]),_:3},8,["as","class"]))}},el=ve({__name:"ProjectsMenu",props:{collapsed:{type:Boolean}},async setup(e){let t,n;const s=Bt(),i=ma(),{data:a,refresh:o}=([t,n]=va(()=>ba("/api/projects/menu","$J9hspuqfo0")),t=await t,n(),t);wa(o);const u=O(()=>{const h=s.params.id;return h?parseInt(h):null}),r=O(()=>{if(!u.value||!a.value)return{label:"All projects",icon:"i-lucide-folder-open"};const h=a.value.find(m=>m.id===u.value);return h?{label:h.label||h.name,icon:"i-lucide-folder"}:{label:"All projects",icon:"i-lucide-folder-open"}}),v=O(()=>{const h=[{label:"All projects",icon:"i-lucide-folder-open",onSelect(){i.push("/projects")}}];return a.value&&a.value.length>0&&h.push(...a.value.map(m=>({label:m.label||m.name,icon:"i-lucide-folder",onSelect(){i.push(`/projects/${m.id}`)}}))),[h]});return(h,m)=>{const f=xe,c=oa;return k(),L(c,{items:l(v),content:{align:"center",collisionPadding:12},ui:{content:e.collapsed?"w-40":"w-(--reka-dropdown-menu-trigger-width)"}},{default:T(()=>[E(f,Y({...l(r),label:e.collapsed?void 0:l(r)?.label,trailingIcon:e.collapsed?void 0:"i-lucide-chevrons-up-down"},{color:"neutral",variant:"ghost",block:"",square:e.collapsed,class:["data-[state=open]:bg-elevated",[!e.collapsed&&"py-2"]],ui:{trailingIcon:"text-dimmed"}}),null,16,["square","class"])]),_:1},8,["items","ui"])}}}),tl=Object.assign(el,{__name:"ProjectsMenu"});let mt=null,vt=!1,tt=!0;window.addEventListener("focus",()=>{tt=!0}),window.addEventListener("blur",()=>{tt=!1}),tt=document.hasFocus();let Fe=null;function al(e){const t=[];switch(e.type){case"run.finished":case"run.failed":case"run.failed.default_branch":case"flakiness.spike":case"perf.regression":{const n=e.projectName??`Project #${e.projectId}`,s=e.branch&&e.type!=="perf.regression"?` on ${e.branch}`:"";if(e.type==="run.finished"?t.push(`${n}${s}: ${e.status??"finished"}`):e.type==="run.failed"?t.push(`${n}${s}: ${e.failedTests??0}/${e.totalTests??0} tests failed`):e.type==="run.failed.default_branch"?t.push(`${n}: ${e.failedTests??0} failures on default branch`):e.type==="flakiness.spike"?t.push(`${n}: flakiness spike detected`):e.type==="perf.regression"&&t.push(`${n}: performance regression detected`),e.failedTests&&t.push(`${e.failedTests} failed, ${e.totalTests} total`),e.topFailures?.length){const[i,...a]=e.topFailures;t.push(a.length?`${i.title} +${a.length} more`:i.title)}break}case"cluster.new":t.push(`${e.projectName??`Project #${e.projectId}`}: new failure cluster`),e.signature&&t.push(e.signature);break;case"diagnosis.completed":case"diagnosis-completed":t.push(e.summary||e.rootCause||""),e.category&&t.push(`Category: ${e.category}`),e.confidence&&t.push(`Confidence: ${e.confidence}`);break}return t.filter(Boolean).join(`
|
|
2
|
-
`)}function nl(e){return e.clusterId?`/failure-clusters/${e.clusterId}`:e.runId&&e.projectId?`/test-runs/${e.runId}`:null}let Ct=null;function Ma(e){if(!("Notification"in window)||Notification.permission!=="granted"||document.visibilityState==="visible"&&tt||(e.type==="diagnosis.completed"||e.type==="diagnosis-completed")&&Ct&&!Ct.value)return;if(Fe&&e.projectId!=null){const o=Fe.isEventSubscribed(e.projectId,e.type);if(console.log("[notify-stream] GATE: cookie filter",{projectId:e.projectId,type:e.type,subscribed:o,cookieProjects:Object.keys(Fe.stored.value.projects),matchingEvents:Fe.stored.value.projects[e.projectId]?.events??[]}),!o)return}const t=al(e);if(!t)return;const n=e.clusterId??e.runId??e.signature??e.type,s=`piwi-${e.type}-${n}`,i=new Notification("Piwi Dashboard",{body:t,tag:s,icon:"/logo.svg"});console.log("[notify-stream] notification fired",{type:e.type,projectId:e.projectId});const a=nl(e);a?i.onclick=()=>{window.focus(),window.location.href=a,i.close()}:i.onclick=()=>{window.focus(),i.close()}}async function sl(){if(Ne().public.demoMode)return!0;if(!("Notification"in window)||Notification.permission!=="granted")return!1;try{return(await $fetch("/api/channels")).channels.some(t=>t.type==="browser")}catch{return!1}}async function il(){const e=Ne();return e.public.demoMode?!0:e.public.authEnabled?sl():!0}function ll(){ts(e=>{e.scope==="notification"&&Ma(e.event)})}function ol(){mt=new EventSource("/api/notifications/stream"),mt.onmessage=e=>{try{const t=JSON.parse(e.data);Ma(t)}catch{}},mt.onerror=()=>{}}function rl(){if(vt)return;vt=!0,vt=!0;const{active:e}=as();Ct=e;const t=Ne();t.public.authEnabled||(Fe=ns()),il().then(n=>{n&&(t.public.demoMode?ll():ol())}),ca(()=>{})}const ul=()=>{const e=ma();return Ea({"g-h":()=>e.push("/"),"g-p":()=>e.push("/projects"),"g-a":()=>e.push("/analytics"),"g-s":()=>e.push("/settings")}),{}},cl=wn(ul),dl={class:"flex flex-col gap-1 w-full"},fl=10,zl=ve({__name:"default",async setup(e){let t,n;const s=Bt(),i=kn(),a=Ne(),o=U(!1),u=U(""),r=U(null),v=ha(async w=>{if(w.trim().length<2){r.value=null;return}try{r.value=await $fetch("/api/search",{query:{q:w.trim()}})}catch{r.value=null}},250);re(u,v),re(()=>o.value,w=>{w||(u.value="",r.value=null)});const{data:h,refresh:m}=([t,n]=va(()=>ba("/api/projects",{key:"projects",lazy:!0,default:()=>[]},"$mSkRqWqjLe")),t=await t,n(),t);wa(m),rl(),cl();const f=O(()=>{const w=s.path.match(/^\/projects\/(\d+)/);return w?.[1]?parseInt(w[1],10):null}),c=O(()=>{if(!h.value||h.value.length===0)return[];const w=Date.now()-fl*24*60*60*1e3,B=[...h.value].sort((H,$)=>{const F=(H.label||H.name).toLowerCase(),d=($.label||$.name).toLowerCase();return F.localeCompare(d)}),b=B.filter(H=>H.latestRun&&new Date(H.latestRun.startTime).getTime()>w),A=B.filter(H=>!H.latestRun||new Date(H.latestRun.startTime).getTime()<=w);function R(H){const $=f.value!==null&&f.value===H.id,F=H.latestRun?.status==="running"||H.latestRun?.status==="initialising",d=H.latestRun?.status||"unknown",q=d==="passed"?"i-lucide-circle-check-big":d==="failed"?"i-lucide-circle-x":"i-lucide-circle",D=d==="passed"?"success":d==="failed"?"error":F?"info":"neutral";return{label:H.label||H.name,icon:F?"i-lucide-loader-circle":"i-lucide-circle",ui:F?{linkLeadingIcon:"animate-spin"}:void 0,badge:{icon:q,color:D},value:`project-${H.id}`,type:"link",to:`/projects/${H.id}`,active:$}}const W=[];return b.length>0&&(W.push({label:`Active (${b.length})`,type:"label"}),W.push(...b.map(R))),A.length>0&&(W.push({label:`Others (${A.length})`,type:"label"}),W.push(...A.map(R))),W}),p=O(()=>{const w=[{label:"GitHub",icon:"i-lucide-github",to:"https://github.com/piwitests/platform",target:"_blank"}];return w.unshift({label:"MCP server",icon:"i-lucide-bot",to:"/mcp",onSelect:()=>{o.value=!1}}),w.unshift({label:"API Docs",icon:"i-lucide-book-open",to:"/docs",onSelect:()=>{o.value=!1}}),[[{label:"Home",icon:"i-lucide-house",to:"/",onSelect:()=>{o.value=!1}},{label:"Analytics",icon:"i-lucide-chart-line",to:"/analytics",onSelect:()=>{o.value=!1}},{label:"Projects",icon:"i-lucide-folder",to:"/projects",onSelect:()=>{o.value=!1}},...c.value],w]}),y=w=>({label:typeof w.label=="string"?w.label:void 0,icon:w.icon,to:w.to,target:w.target,active:w.active,disabled:w.disabled,suffix:typeof w.badge=="string"?w.badge:void 0,children:w.children?.map(B=>y(B)),onSelect:w.onSelect}),I=O(()=>{const w="https://github.com/piwitests/platform/blob/main/application/app/pages",B="https://github.com/piwitests/platform/tree/main/application/app/pages",b=s.matched[s.matched.length-1]?.path??s.path;return b.includes(":")?B:`${w}${b==="/"?"/index":b}.vue`});function j(w){return w==="passed"?"i-lucide-circle-check-big":w==="failed"?"i-lucide-circle-x":w==="running"||w==="initialising"?"i-lucide-loader-circle":"i-lucide-circle"}const C=O(()=>{const w=[{id:"links",label:"Go to",items:p.value.flat().map(b=>y(b))},{id:"code",label:"Code",items:[{id:"source",label:"View page source",icon:"i-lucide-github",to:I.value,target:"_blank"}]}];if(f.value){const b=f.value,A=[["test-runs","Test runs","i-lucide-play"],["failure-clusters","Failure clusters","i-lucide-layers"],["flaky-tests","Flaky tests","i-lucide-shuffle"],["performance","Performance","i-lucide-trending-up"],["test-cases","Test cases","i-lucide-flask-conical"],["compare","Compare","i-lucide-git-compare-arrows"],["spec-health","Spec health","i-lucide-table-2"],["timeline","Timeline","i-lucide-git-commit-horizontal"]];w.unshift({id:"project-tabs",label:"This project",items:A.map(([R,W,H])=>({id:`project-tab-${R}`,label:W,icon:H,to:`/projects/${b}?tab=${R}`,onSelect:()=>{o.value=!1}}))})}if(!r.value)return w;const B=[];return r.value.projects.length>0&&B.push({id:"search-projects",label:"Projects",ignoreFilter:!0,items:r.value.projects.map(b=>({id:`project-${b.id}`,label:b.label||b.name,description:b.label&&b.label!==b.name?b.name:void 0,icon:"i-lucide-folder",to:`/projects/${b.id}`}))}),r.value.runs.length>0&&B.push({id:"search-runs",label:"Test runs",ignoreFilter:!0,items:r.value.runs.map(b=>({id:`run-${b.id}`,label:b.label?`Run #${b.id} — ${b.label}`:`Run #${b.id}`,description:b.projectLabel||b.projectName,suffix:b.status,icon:j(b.status),to:`/test-runs/${b.id}`}))}),r.value.cases.length>0&&B.push({id:"search-cases",label:"Test cases",ignoreFilter:!0,items:r.value.cases.map(b=>({id:`case-${b.id}`,label:b.title,description:`${b.projectLabel||b.projectName} · ${b.filePath}`,icon:"i-lucide-flask-conical",to:`/test-cases/${b.id}`}))}),[...B,...w]}),S=a.public.demoMode,g=a.public.demoDataVersion,_=a.public.appVersion,{resetDemo:x}=Sn();return Dt(async()=>{if(S&&g){const w=await _n();w!==null&&w!==g&&i.add({title:"New demo data available",description:'The demo seed data has been updated since your last visit. Click "Refresh" to reload with the latest data.',duration:0,color:"warning",actions:[{label:"Refresh",color:"warning",onClick:()=>{x()}},{label:"Dismiss",color:"neutral",variant:"ghost"}]})}}),(w,B)=>{const b=os,A=Dn,R=cs,W=fa,H=Ps,$=qi,F=Qi,d=Zi;return k(),L(d,{unit:"rem",style:{top:"var(--demo-banner-height, 0px)",height:"calc(100dvh - var(--demo-banner-height, 0px))"}},{default:T(()=>[B[2]||(B[2]=X("a",{href:"#main-content",class:"sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[100] focus:rounded-md focus:bg-primary focus:px-3 focus:py-2 focus:text-sm focus:font-medium focus:text-inverted focus:shadow-lg focus:outline-2 focus:outline-primary"}," Skip to main content ",-1)),E(H,{id:"default",open:l(o),"onUpdate:open":B[0]||(B[0]=q=>Pe(o)?o.value=q:null),collapsible:"",resizable:"",width:"20",class:"bg-elevated/25",ui:{root:"min-h-full",footer:"lg:border-t lg:border-default"}},{header:T(({collapsed:q})=>[E(tl,{collapsed:q},null,8,["collapsed"])]),default:T(({collapsed:q})=>[E(b,{collapsed:q,class:"bg-transparent ring-default"},null,8,["collapsed"]),(k(),L(A,{key:l(f)??void 0,collapsed:q,items:l(p)[0],orientation:"vertical",tooltip:"",popover:""},null,8,["collapsed","items"])),E(A,{collapsed:q,items:l(p)[1],orientation:"vertical",tooltip:"",class:"mt-auto"},null,8,["collapsed","items"])]),footer:T(({collapsed:q})=>[X("div",dl,[E(R,{collapsed:q},null,8,["collapsed"]),q?z("",!0):(k(),L(W,{key:0,to:"/settings/about",class:"text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 text-center",title:"View version and build info"},{default:T(()=>[me(" v"+ce(l(_)),1)]),_:1}))])]),_:1},8,["open"]),E($,{"search-term":l(u),"onUpdate:searchTerm":B[1]||(B[1]=q=>Pe(u)?u.value=q:null),groups:l(C),"preserve-group-order":!!l(r)},null,8,["search-term","groups","preserve-group-order"]),B[3]||(B[3]=X("span",{id:"main-content",tabindex:"-1",class:"sr-only"},"Main content",-1)),N(w.$slots,"default"),E(F)]),_:3})}}});export{zl as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{d as j,b as A,w as F,c as _,i as e,j as o,g as r,k as s,f as N,q as k,F as h,P as O,o as u,t as n,_ as W,m as p,v as q,y as K,l as X,h as Y,r as C}from"./BPKwYP2Q.js";import{_ as G}from"./DhA17dqR.js";import{_ as Z}from"./bAfTAihV.js";import{_ as H}from"./C1K3r_fc.js";import{_ as J}from"./DdbrJwT-.js";import{_ as Q}from"./nCjfWTGm.js";import{k as P}from"./k-z_VVTK.js";import{e as tt,g as et}from"./CQeMb57w.js";import{u as st}from"./DuMv-ugy.js";import{u as D}from"./BIf1R_fu.js";import"./B7yG1G_l.js";import"./BpceIssd.js";import"./jIF87ALb.js";import"./DRtTLQri.js";import"./r3SBLxtE.js";const ot={class:"space-y-6"},at={key:0,class:"space-y-4 text-sm"},lt={class:"space-y-1"},nt={class:"flex items-start gap-2"},it={class:"text-xs break-all flex-1"},rt={class:"space-y-1"},dt={class:"flex items-start gap-2"},ct={class:"text-xs break-all flex-1"},pt={class:"space-y-3 text-sm"},ut={class:"space-y-1"},mt={class:"flex items-start gap-2"},_t={class:"text-xs break-all flex-1"},ft={class:"space-y-1"},vt={class:"relative"},gt={class:"text-xs bg-gray-50 dark:bg-gray-900 rounded-md p-3 overflow-x-auto"},xt={class:"space-y-3"},yt={class:"flex items-center gap-2 text-sm text-muted"},bt={class:"grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"},kt={class:"text-muted"},ht={class:"flex items-center gap-2 font-mono"},Ct={class:"text-xs"},wt={key:0,class:"flex items-center gap-2 py-4 text-muted"},$t={key:1,class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},St={class:"space-y-1"},Bt={class:"text-2xl font-semibold"},Tt={class:"space-y-1"},Ft={class:"text-2xl font-semibold"},Pt={class:"space-y-1"},Dt={class:"text-2xl font-semibold"},Et={class:"space-y-1"},Vt={class:"text-2xl font-semibold"},zt={class:"space-y-1"},It={class:"text-2xl font-semibold"},Ut={class:"space-y-1"},Lt={class:"text-2xl font-semibold"},Mt={class:"space-y-1"},Rt={class:"text-2xl font-semibold"},jt={class:"flex flex-col sm:flex-row items-start sm:items-center gap-4"},oe=j({__name:"storage",async setup(At){let d,g;const w=A(),{copy:x}=st(),{data:i,refresh:$,pending:S}=([d,g]=F(()=>D("/api/admin/stats","$-MAlPFSlMr")),d=await d,g(),d),{data:y}=([d,g]=F(()=>D("/api/desktop/reporter-config",{default:()=>null},"$w9XS1YZFXM")),d=await d,g(),d),B=Y(()=>{const a=y.value;return a?`reporter: [
|
|
2
|
-
['@piwitests/reporter', {
|
|
3
|
-
serverUrl: '${a.url}',
|
|
4
|
-
projectName: 'my-project',
|
|
5
|
-
apiKey: '${a.token}',
|
|
6
|
-
}],
|
|
7
|
-
],`:""}),E=tt("storage").map(a=>({name:a,...et(a)})),V=[{label:"7 days",value:7},{label:"14 days",value:14},{label:"30 days",value:30},{label:"60 days",value:60},{label:"90 days",value:90},{label:"180 days",value:180},{label:"1 year",value:365}],m=C(30),f=C(!1),b=C(!1);async function z(){f.value=!1,b.value=!0;try{const a=await $fetch("/api/admin/cleanup",{method:"DELETE",body:{olderThanDays:m.value}});w.add({title:"Cleanup complete",description:`Deleted ${a.deletedRuns} test run(s) older than ${m.value} days.`,color:"success"}),await $()}catch(a){const t=a&&typeof a=="object"&&"data"in a?a.data?.message:void 0;w.add({title:"Cleanup failed",description:t||"An error occurred",color:"error"})}finally{b.value=!1}}return(a,t)=>{const c=W,v=G,T=q,I=Z,U=H,L=J,M=Q,R=O;return u(),_(h,null,[e("div",ot,[o(v,{icon:"i-lucide-folder-open",title:"Data location"},{subtitle:r(()=>[...t[9]||(t[9]=[p(" Where this instance keeps its database and files on disk. ",-1)])]),default:r(()=>[s(i)?(u(),_("div",at,[e("div",lt,[t[10]||(t[10]=e("div",{class:"text-muted"},"Database",-1)),e("div",nt,[e("code",it,n(s(i).databaseLocation),1),o(c,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy database location",onClick:t[0]||(t[0]=l=>s(x)(s(i).databaseLocation,{toast:!0}))})])]),e("div",rt,[t[11]||(t[11]=e("div",{class:"text-muted"},"File storage",-1)),e("div",dt,[e("code",ct,n(s(i).storageLocation),1),o(c,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy storage location",onClick:t[1]||(t[1]=l=>s(x)(s(i).storageLocation,{toast:!0}))})])])])):k("",!0)]),_:1}),s(y)?(u(),N(v,{key:0,icon:"i-lucide-upload",title:"Send results to this app"},{subtitle:r(()=>[...t[12]||(t[12]=[p(" Point the Playwright reporter at this desktop app. The access token is a local secret — prefer setting it via the ",-1),e("code",null,"PIWI_API_KEY",-1),p(" env var over committing it. ",-1)])]),default:r(()=>[e("div",pt,[e("div",ut,[t[13]||(t[13]=e("div",{class:"text-muted"},"Access token",-1)),e("div",mt,[e("code",_t,n(s(y).token),1),o(c,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy access token",onClick:t[2]||(t[2]=l=>s(x)(s(y).token,{toast:!0}))})])]),e("div",ft,[t[14]||(t[14]=e("div",{class:"text-muted"},"playwright.config.ts",-1)),e("div",vt,[e("pre",gt,[e("code",null,n(s(B)),1)]),o(c,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs",class:"absolute top-2 right-2","aria-label":"Copy config snippet",onClick:t[3]||(t[3]=l=>s(x)(s(B),{toast:!0}))})])])])]),_:1})):k("",!0),o(v,{icon:"i-lucide-server",title:"Storage backend",help:"settings.storage-backend"},{subtitle:r(()=>[...t[15]||(t[15]=[p(" Configured through environment variables. The active backend is shown read-only. ",-1)])]),default:r(()=>[e("div",xt,[e("div",yt,[o(T,{name:"i-lucide-info",class:"size-4"}),t[16]||(t[16]=p(" Storage backend selection (local disk or S3) and its credentials are set via the environment. Each variable below is shown read-only — hover the lock to see what it controls. ",-1))]),e("div",bt,[(u(!0),_(h,null,K(s(E),l=>(u(),_(h,{key:l.name},[e("div",kt,n(l.name.replace("PIWI_S3_","S3 ").replace("PIWI_STORAGE_","Storage ")),1),e("div",ht,[e("code",Ct,n(l.name),1),o(I,{"env-vars":[l.name]},null,8,["env-vars"])])],64))),128))])])]),_:1}),o(v,{icon:"i-lucide-database",title:"Storage statistics",help:"settings.storage-stats"},{footer:r(()=>[o(c,{icon:"i-lucide-refresh-cw",variant:"outline",size:"sm",loading:s(S),label:"Refresh",onClick:t[4]||(t[4]=l=>s($)())},null,8,["loading"])]),default:r(()=>[s(S)?(u(),_("div",wt,[o(T,{name:"i-lucide-loader-2",class:"animate-spin"}),t[17]||(t[17]=p(" Loading… ",-1))])):s(i)?(u(),_("div",$t,[e("div",St,[t[18]||(t[18]=e("p",{class:"text-sm text-muted"},"Projects",-1)),e("p",Bt,n(s(i).totalProjects),1)]),e("div",Tt,[t[19]||(t[19]=e("p",{class:"text-sm text-muted"},"Test runs",-1)),e("p",Ft,n(s(i).totalRuns),1)]),e("div",Pt,[t[20]||(t[20]=e("p",{class:"text-sm text-muted"},"Test cases (unique)",-1)),e("p",Dt,n(s(i).totalTestCases),1)]),e("div",Et,[t[21]||(t[21]=e("p",{class:"text-sm text-muted"},"Test results",-1)),e("p",Vt,n(s(i).totalRunsCases),1)]),e("div",zt,[t[22]||(t[22]=e("p",{class:"text-sm text-muted"},"Stored files",-1)),e("p",It,n(s(i).totalFiles),1)]),e("div",Ut,[t[23]||(t[23]=e("p",{class:"text-sm text-muted"},"File size (DB)",-1)),e("p",Lt,n(("formatBytes"in a?a.formatBytes:s(P))(s(i).totalFileSize)),1)]),e("div",Mt,[t[24]||(t[24]=e("p",{class:"text-sm text-muted"},"Storage on disk",-1)),e("p",Rt,n(("formatBytes"in a?a.formatBytes:s(P))(s(i).storageSizeOnDisk)),1)])])):k("",!0)]),_:1}),o(v,{icon:"i-lucide-trash-2",title:"Cleanup old test runs",help:"settings.cleanup"},{default:r(()=>[e("div",jt,[o(L,{label:"Delete runs older than",name:"period"},{default:r(()=>[o(U,{modelValue:s(m),"onUpdate:modelValue":t[5]||(t[5]=l=>X(m)?m.value=l:null),items:V},null,8,["modelValue"])]),_:1}),o(c,{icon:"i-lucide-trash-2",color:"error",variant:"soft",loading:s(b),label:"Run cleanup",class:"mt-4 sm:mt-5",onClick:t[6]||(t[6]=l=>f.value=!0)},null,8,["loading"])])]),_:1})]),o(R,null,{default:r(()=>[o(M,{open:s(f),title:"Confirm cleanup","onUpdate:open":t[8]||(t[8]=l=>f.value=l)},{body:r(()=>[e("p",null,[t[25]||(t[25]=p(" This will permanently delete all test runs older than ",-1)),e("strong",null,n(s(m))+" days",1),t[26]||(t[26]=p(", along with their associated reports, traces, and test results. This action cannot be undone. ",-1))])]),footer:r(()=>[o(c,{color:"neutral",variant:"ghost",label:"Cancel",onClick:t[7]||(t[7]=l=>f.value=!1)}),o(c,{color:"error",label:"Delete",icon:"i-lucide-trash-2",loading:s(b),onClick:z},null,8,["loading"])]),_:1},8,["open"])]),_:1})],64)}}});export{oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as y,a as C}from"./B2lYFco4.js";import{_ as I}from"./DhA17dqR.js";import{a as L}from"./CQeMb57w.js";import{d as N,w as R,c as A,j as e,g as l,K as D,o as c,k as t,f as b,q as v,i as E,m,aI as $,v as q,h}from"./BPKwYP2Q.js";import{f as G}from"./k-z_VVTK.js";import{u as j}from"./BIf1R_fu.js";import"./B7yG1G_l.js";import"./r3SBLxtE.js";import"./DuMv-ugy.js";const F={class:"space-y-6"},P={class:"flex flex-wrap items-center gap-x-6 gap-y-3 text-sm"},X=N({__name:"about",async setup(Q){let s,p;const i=D(),{data:k}=([s,p]=R(()=>j("/api/version","$mIoGdvWYhF")),s=await s,p(),s),x=i.public.appVersion,r=i.public.buildSha,u=i.public.buildTime,g=i.public.nodeVersion,V=i.public.authEnabled,_=h(()=>r?r.slice(0,7):null),B=h(()=>{const n=k.value?.dbBackend;return n==="postgresql"?"PostgreSQL":n==="sqlite"?"SQLite":n??null});return(n,o)=>{const a=C,S=y,d=I,f=L,T=q,w=$;return c(),A("div",F,[e(d,{icon:"i-lucide-info",title:"Application"},{default:l(()=>[e(S,null,{default:l(()=>[e(a,{label:"Version",value:`v${t(x)}`},null,8,["value"]),t(_)?(c(),b(a,{key:0,label:"Build",value:t(_),hint:t(r)},null,8,["value","hint"])):v("",!0),t(u)?(c(),b(a,{key:1,label:"Built",value:("formatRelativeTime"in n?n.formatRelativeTime:t(G))(t(u)),hint:t(u)},null,8,["value","hint"])):v("",!0),e(a,{label:"Node.js",value:t(g)},null,8,["value"]),e(a,{label:"Database",value:t(B)},null,8,["value"]),e(a,{label:"Authentication",value:t(V)?"Enabled":"Disabled"},null,8,["value"])]),_:1})]),_:1}),e(d,{icon:"i-lucide-book-open",title:"Resources"},{default:l(()=>[E("div",P,[e(f,{to:""},{default:l(()=>[...o[0]||(o[0]=[m("Documentation",-1)])]),_:1}),e(f,{to:"api"},{default:l(()=>[...o[1]||(o[1]=[m("API reference",-1)])]),_:1}),e(w,{to:"https://github.com/piwitests/platform",target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-1 text-primary hover:underline"},{default:l(()=>[o[2]||(o[2]=m(" GitHub ",-1)),e(T,{name:"i-lucide-external-link",class:"w-3.5 h-3.5 shrink-0"})]),_:1})])]),_:1})])}}});export{X as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{_ as ue,a as me}from"./Bvfmwzgw.js";import{_ as de,a as pe}from"./IFqRT_xJ.js";import{_ as fe}from"./CgoAUz76.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"./BPKwYP2Q.js";import{_ as ye}from"./CKB_doYB.js";import{_ as ge}from"./Br2K9yi_.js";import{_ as be}from"./C1K3r_fc.js";import{_ as ve}from"./ABGJk0pu.js";import{_ as ke}from"./CoHGrO41.js";import{e as $e}from"./k-z_VVTK.js";import{_ as we}from"./xUrLy-Zn.js";import{u as Ae}from"./DuMv-ugy.js";import{u as je}from"./BIf1R_fu.js";import"./iwD5atI2.js";import"./jIF87ALb.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
|
-
${l.join(`
|
|
3
|
-
`)}
|
|
4
|
-
});
|
|
5
|
-
const data = await res.json();`}const Xe={class:"rounded-lg border border-default bg-default/50 p-3 space-y-3"},Ze={class:"flex items-center justify-between gap-2"},Ye={key:0,class:"space-y-1"},et={key:1,class:"space-y-1.5"},tt=["title"],st={key:2,class:"space-y-1.5"},nt=["title"],ot={key:3,class:"space-y-1"},at={key:4,class:"text-xs text-dimmed"},rt={key:5,class:"space-y-1.5"},it={class:"flex items-center gap-2 text-xs"},lt={class:"text-dimmed"},ct={class:"max-h-80 overflow-auto"},ut={key:6,class:"text-xs text-error"},mt={class:"space-y-1.5"},dt={class:"flex gap-1"},pt=H({__name:"ApiTryIt",props:{item:{},spec:{}},setup(e){const t=e,r=ae(),o=r.public.demoMode,l=(r.app?.baseURL??"/").replace(/\/$/,""),{token:m}=De(),$=f(()=>re(t.item.operation,t.spec)),p=f(()=>t.item.parameters.filter(O=>O.in==="path")),g=f(()=>t.item.parameters.filter(O=>O.in==="query")),b=se(Object.fromEntries(p.value.map(O=>[O.name,""]))),u=se(Object.fromEntries(g.value.map(O=>[O.name,""]))),_=f(()=>Qe(t.item.operation)),S=f(()=>!!t.item.operation.requestBody?.content?.["multipart/form-data"]&&!_.value),q=z(Fe(t.item.operation,t.spec)??""),d=f(()=>_.value&&q.value.trim()?q.value:void 0),v=f(()=>l+He(t.item.path,b)+We(u)),C=f(()=>{const O={};return d.value&&(O["Content-Type"]="application/json"),$.value&&m.value&&(O.Authorization=`Bearer ${m.value}`),O}),T=f(()=>window.location.origin+v.value),j=f(()=>Ge({method:t.item.method,url:T.value,headers:C.value,body:d.value})),N=f(()=>Ke({method:t.item.method,url:T.value,headers:C.value,body:d.value})),x=z("curl"),A=z(!1),E=z(null),L=z(null);async function le(){A.value=!0,E.value=null,L.value=null;const O=performance.now();try{const y={...C.value};o&&(y["x-demo-user-id"]=localStorage.getItem("piwi-demo-user-id")||"1");const J=await fetch(v.value,{method:t.item.method.toUpperCase(),headers:y,body:d.value,credentials:"same-origin"}),M=Math.round(performance.now()-O),W=await J.text();let F=W;try{F=JSON.stringify(JSON.parse(W),null,2)}catch{}L.value={status:J.status,statusText:J.statusText,ok:J.ok,timeMs:M,body:F}}catch(y){E.value=$e(y)}finally{A.value=!1}}return(O,y)=>{const J=Y,M=oe,W=be,F=ve,ce=ee,G=ke;return n(),a("div",Xe,[i("div",Ze,[y[4]||(y[4]=i("h4",{class:"text-xs font-semibold uppercase tracking-wide text-dimmed"},"Try it out",-1)),w(J,{size:"xs",color:"primary",icon:"i-lucide-play",loading:s(A),label:"Send",onClick:le},null,8,["loading"])]),s($)?(n(),a("div",Ye,[y[5]||(y[5]=i("label",{class:"text-xs text-dimmed"},"Authorization — Bearer token",-1)),w(M,{modelValue:s(m),"onUpdate:modelValue":y[0]||(y[0]=k=>X(m)?m.value=k:null),type:"password",placeholder:"pd_…",size:"sm",class:"w-full",ui:{base:"font-mono"}},null,8,["modelValue"])])):h("",!0),s(p).length?(n(),a("div",et,[y[6]||(y[6]=i("label",{class:"text-xs text-dimmed"},"Path parameters",-1)),(n(!0),a(B,null,P(s(p),k=>(n(),a("div",{key:k.name,class:"flex items-center gap-2"},[i("code",{class:"text-xs font-mono text-primary w-28 shrink-0 truncate",title:k.name},c(k.name),9,tt),w(M,{modelValue:s(b)[k.name],"onUpdate:modelValue":D=>s(b)[k.name]=D,placeholder:k.name,size:"sm",class:"flex-1",ui:{base:"font-mono"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])]))),128))])):h("",!0),s(g).length?(n(),a("div",st,[y[7]||(y[7]=i("label",{class:"text-xs text-dimmed"},"Query parameters",-1)),(n(!0),a(B,null,P(s(g),k=>(n(),a("div",{key:k.name,class:"flex items-center gap-2"},[i("code",{class:"text-xs font-mono text-primary w-28 shrink-0 truncate",title:k.name},c(k.name),9,nt),k.schema?.enum?.length?(n(),U(W,{key:0,modelValue:s(u)[k.name],"onUpdate:modelValue":D=>s(u)[k.name]=D,items:["",...k.schema.enum.map(String)],size:"sm",class:"flex-1"},null,8,["modelValue","onUpdate:modelValue","items"])):(n(),U(M,{key:1,modelValue:s(u)[k.name],"onUpdate:modelValue":D=>s(u)[k.name]=D,placeholder:k.name,size:"sm",class:"flex-1",ui:{base:"font-mono"}},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]))),128))])):h("",!0),s(_)?(n(),a("div",ot,[y[8]||(y[8]=i("label",{class:"text-xs text-dimmed"},"Request body — application/json",-1)),w(F,{modelValue:s(q),"onUpdate:modelValue":y[1]||(y[1]=k=>X(q)?q.value=k:null),rows:6,class:"w-full",ui:{base:"font-mono text-xs"}},null,8,["modelValue"])])):s(S)?(n(),a("p",at,[...y[9]||(y[9]=[R(" This endpoint expects ",-1),i("code",{class:"font-mono"},"multipart/form-data",-1),R(" (file upload) — use the cURL sample below as a starting point. ",-1)])])):h("",!0),s(L)?(n(),a("div",rt,[i("div",it,[w(ce,{color:s(L).ok?"success":"error",variant:"subtle",class:"font-mono"},{default:V(()=>[R(c(s(L).status)+" "+c(s(L).statusText),1)]),_:1},8,["color"]),i("span",lt,c(s(L).timeMs)+" ms",1)]),i("div",ct,[w(G,{code:s(L).body,lang:"json"},null,8,["code"])])])):s(E)?(n(),a("p",ut,"Request failed: "+c(s(E)),1)):h("",!0),i("div",mt,[i("div",dt,[i("button",{type:"button",class:Q(["text-xs px-2 py-0.5 rounded-md transition-colors",s(x)==="curl"?"bg-elevated text-highlighted":"text-muted hover:text-highlighted"]),onClick:y[2]||(y[2]=k=>x.value="curl")}," cURL ",2),i("button",{type:"button",class:Q(["text-xs px-2 py-0.5 rounded-md transition-colors",s(x)==="fetch"?"bg-elevated text-highlighted":"text-muted hover:text-highlighted"]),onClick:y[3]||(y[3]=k=>x.value="fetch")}," JavaScript ",2)]),s(x)==="curl"?(n(),U(G,{key:0,code:s(j),lang:"bash"},null,8,["code"])):(n(),U(G,{key:1,code:s(N),lang:"javascript"},null,8,["code"]))])])}}}),ft=Object.assign(pt,{__name:"ApiTryIt"}),ht=["id"],_t=["aria-expanded"],xt={class:"font-mono text-sm text-highlighted break-all"},yt={class:"text-sm text-muted truncate hidden sm:inline flex-1"},gt={key:0,class:"px-3 pb-3 pt-1 space-y-4 border-t border-default"},bt={key:0,class:"text-sm font-medium text-highlighted sm:hidden"},vt={key:1,class:"text-sm text-muted"},kt={key:2,class:"flex items-center gap-1.5 text-xs"},$t={class:"text-muted font-medium"},wt={key:0,class:"space-y-1.5"},At={class:"text-xs font-semibold uppercase tracking-wide text-dimmed"},jt={class:"space-y-2"},Ut={class:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5"},Ot={class:"font-mono text-primary"},St={class:"text-xs text-muted font-mono"},qt={key:0,class:"text-xs font-medium text-error"},Ct={key:0,class:"text-muted mt-0.5"},Bt={key:1,class:"text-xs text-dimmed mt-0.5"},Rt={class:"font-mono"},Tt={key:3,class:"space-y-1.5"},Pt={class:"text-xs text-dimmed font-mono"},Vt={key:4,class:"space-y-1.5"},Lt={class:"flex items-baseline gap-2"},zt={class:"text-muted"},It={class:"text-xs text-dimmed font-mono"},Nt=H({__name:"ApiOperation",props:{item:{},spec:{}},setup(e){const t=e,r=z(!1),o=f(()=>re(t.item.operation,t.spec)),l=f(()=>Ce(t.item.operation)),m=f(()=>Re(t.item.operation)),$=f(()=>l.value?"Public — no authentication required":m.value?m.value.label:o.value?"Requires authentication":null),p=f(()=>t.item.parameters.filter(d=>d.in==="path")),g=f(()=>t.item.parameters.filter(d=>d.in==="query")),b=f(()=>t.item.parameters.filter(d=>d.in==="header")),u=f(()=>Object.entries(t.item.operation.requestBody?.content??{}).map(([d,v])=>({contentType:d,schema:I(v.schema,t.spec)}))),_=f(()=>Object.entries(t.item.operation.responses??{}).map(([d,v])=>({status:d,description:v.description,entries:Object.entries(v.content??{}).map(([C,T])=>({contentType:C,schema:I(T.schema,t.spec)}))}))),S=f(()=>t.item.path.split(/(\{[^}]+\})/g).map(d=>({text:d,isParam:d.startsWith("{")})));function q(d){return d.startsWith("2")?"text-success":d.startsWith("3")?"text-info":d.startsWith("4")?"text-warning":d.startsWith("5")?"text-error":"text-muted"}return(d,v)=>{const C=ee,T=_e,j=ie,N=ft;return n(),a("div",{id:e.item.anchor,class:"border border-default rounded-lg bg-elevated/20 scroll-mt-20"},[i("button",{type:"button",class:"w-full flex items-center gap-3 px-3 py-2.5 text-left cursor-pointer","aria-expanded":s(r),onClick:v[0]||(v[0]=x=>r.value=!s(r))},[w(C,{color:("methodBadgeColor"in d?d.methodBadgeColor:s(Oe))(e.item.method),variant:"subtle",class:"font-mono uppercase shrink-0 w-16 justify-center"},{default:V(()=>[R(c(e.item.method),1)]),_:1},8,["color"]),i("code",xt,[(n(!0),a(B,null,P(s(S),(x,A)=>(n(),a("span",{key:A,class:Q(x.isParam?"text-warning":"")},c(x.text),3))),128))]),i("span",yt,c(e.item.operation.summary),1),s(m)?.elevated?(n(),U(C,{key:0,color:"warning",variant:"subtle",size:"sm",icon:"i-lucide-shield",class:"shrink-0 ml-auto sm:ml-0",title:`Requires role: ${s(m).label}`},{default:V(()=>[R(c(s(m).shortLabel),1)]),_:1},8,["title"])):s(l)?(n(),U(C,{key:1,color:"neutral",variant:"subtle",size:"sm",class:"shrink-0 ml-auto sm:ml-0"},{default:V(()=>[...v[1]||(v[1]=[R(" Public ",-1)])]),_:1})):s(o)?(n(),U(T,{key:2,name:"i-lucide-lock",class:"size-3.5 text-dimmed shrink-0 ml-auto sm:ml-0",title:"Requires authentication"})):h("",!0),w(T,{name:s(r)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-4 text-dimmed shrink-0"},null,8,["name"])],8,_t),s(r)?(n(),a("div",gt,[e.item.operation.summary?(n(),a("p",bt,c(e.item.operation.summary),1)):h("",!0),e.item.operation.description?(n(),a("p",vt,c(e.item.operation.description),1)):h("",!0),s($)?(n(),a("div",kt,[w(T,{name:s(m)?.elevated?"i-lucide-shield":"i-lucide-users",class:"size-3.5 text-dimmed shrink-0"},null,8,["name"]),v[2]||(v[2]=i("span",{class:"text-dimmed"},"Access",-1)),i("span",$t,c(s($)),1)])):h("",!0),(n(!0),a(B,null,P([{label:"Path parameters",params:s(p)},{label:"Query parameters",params:s(g)},{label:"Header parameters",params:s(b)}],x=>(n(),a(B,{key:x.label},[x.params.length?(n(),a("div",wt,[i("h4",At,c(x.label),1),i("div",jt,[(n(!0),a(B,null,P(x.params,A=>(n(),a("div",{key:A.name,class:"text-sm"},[i("div",Ut,[i("code",Ot,c(A.name),1),i("span",St,c(("schemaTypeLabel"in d?d.schemaTypeLabel:s(te))(A.schema)),1),A.required?(n(),a("span",qt,"required")):h("",!0)]),A.description?(n(),a("p",Ct,c(A.description),1)):h("",!0),A.schema?.enum?.length?(n(),a("p",Bt,[v[3]||(v[3]=R(" Allowed values: ",-1)),i("span",Rt,c(A.schema.enum.map(E=>JSON.stringify(E)).join(", ")),1)])):h("",!0)]))),128))])])):h("",!0)],64))),128)),s(u).length?(n(),a("div",Tt,[v[4]||(v[4]=i("h4",{class:"text-xs font-semibold uppercase tracking-wide text-dimmed"},"Request body",-1)),(n(!0),a(B,null,P(s(u),x=>(n(),a("div",{key:x.contentType,class:"space-y-1.5"},[i("code",Pt,c(x.contentType),1),x.schema?(n(),U(j,{key:0,schema:x.schema,spec:e.spec},null,8,["schema","spec"])):h("",!0)]))),128))])):h("",!0),s(_).length?(n(),a("div",Vt,[v[5]||(v[5]=i("h4",{class:"text-xs font-semibold uppercase tracking-wide text-dimmed"},"Responses",-1)),(n(!0),a(B,null,P(s(_),x=>(n(),a("div",{key:x.status,class:"text-sm"},[i("div",Lt,[i("code",{class:Q(["font-mono font-semibold",q(x.status)])},c(x.status),3),i("span",zt,c(x.description),1)]),(n(!0),a(B,null,P(x.entries,A=>(n(),a("div",{key:A.contentType,class:"mt-1 pl-3 border-l border-default"},[i("code",It,c(A.contentType),1),A.schema?(n(),U(j,{key:0,schema:A.schema,spec:e.spec,class:"mt-1"},null,8,["schema","spec"])):h("",!0)]))),128))]))),128))])):h("",!0),w(N,{item:e.item,spec:e.spec},null,8,["item","spec"])])):h("",!0)],8,ht)}}}),Et=Object.assign(Nt,{__name:"ApiOperation"}),Jt={class:"max-w-4xl mx-auto px-4 sm:px-6 py-6 space-y-6"},Mt={class:"space-y-3"},Dt={class:"flex flex-wrap items-center gap-2"},Ht={class:"text-xl font-semibold text-highlighted"},Wt={key:0,class:"text-sm text-muted"},Ft={key:1,class:"flex items-center gap-2 text-sm"},Qt={class:"flex flex-wrap items-center gap-2"},Gt={class:"text-xs text-dimmed"},Kt={key:0,class:"flex flex-wrap gap-1.5"},Xt=["href"],Zt={class:"text-dimmed"},Yt={key:1,class:"space-y-8"},es=["id"],ts={class:"text-sm font-semibold uppercase tracking-wide text-dimmed"},ss={class:"text-dimmed/60"},ns=H({__name:"ApiReference",props:{spec:{},specUrl:{}},setup(e){const t=e,{copy:r,copied:o}=Ae(),l=z(""),m=f(()=>qe(t.spec)),$=f(()=>m.value.reduce((u,_)=>u+_.operations.length,0)),p=f(()=>{const u=l.value.trim().toLowerCase();return u?m.value.map(_=>({tag:_.tag,operations:_.operations.filter(S=>`${S.method} ${S.path} ${S.operation.summary??""} ${S.operation.description??""} ${S.tag}`.toLowerCase().includes(u))})).filter(_=>_.operations.length>0):m.value}),g=f(()=>t.spec.servers?.[0]?.url??"");function b(u){return`tag-${u.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}`}return(u,_)=>{const S=ee,q=Y,d=ge,v=oe,C=Et,T=we;return n(),a("div",Jt,[i("header",Mt,[i("div",Dt,[i("h1",Ht,c(e.spec.info?.title??"API Reference"),1),e.spec.info?.version?(n(),U(S,{key:0,color:"neutral",variant:"subtle",class:"font-mono"},{default:V(()=>[R(" v"+c(e.spec.info.version),1)]),_:1})):h("",!0)]),e.spec.info?.description?(n(),a("p",Wt,c(e.spec.info.description),1)):h("",!0),s(g)?(n(),a("div",Ft,[_[2]||(_[2]=i("span",{class:"text-dimmed"},"Base URL",-1)),w(q,{label:s(g),color:"neutral",variant:"subtle",size:"xs",icon:s(o)?"i-lucide-check":"i-lucide-copy",class:"font-mono",onClick:_[0]||(_[0]=j=>s(r)(s(g),{toast:!0}))},null,8,["label","icon"])])):h("",!0),i("div",Qt,[w(q,{to:e.specUrl,target:"_blank",external:"",color:"neutral",variant:"outline",size:"xs",icon:"i-lucide-file-json",label:"Raw OpenAPI spec"},null,8,["to"]),i("span",Gt,c(s($))+" endpoints",1)]),w(d,{color:"info",variant:"subtle",icon:"i-lucide-terminal",title:"Windows users",description:"curl examples below use Unix syntax — run them in Git Bash / WSL, or use PowerShell's Invoke-RestMethod instead."})]),w(v,{modelValue:s(l),"onUpdate:modelValue":_[1]||(_[1]=j=>X(l)?l.value=j:null),icon:"i-lucide-search",placeholder:"Filter endpoints by path, method, or description…",size:"md",class:"w-full",ui:{root:"sticky top-0 z-10"}},null,8,["modelValue"]),!s(l)&&s(m).length>1?(n(),a("div",Kt,[(n(!0),a(B,null,P(s(m),j=>(n(),a("a",{key:j.tag,href:`#${b(j.tag)}`,class:"text-xs px-2 py-1 rounded-md bg-elevated text-muted hover:text-highlighted hover:bg-accented transition-colors"},[R(c(j.tag)+" ",1),i("span",Zt,c(j.operations.length),1)],8,Xt))),128))])):h("",!0),s(p).length?(n(),a("div",Yt,[(n(!0),a(B,null,P(s(p),j=>(n(),a("section",{key:j.tag,id:b(j.tag),class:"space-y-2 scroll-mt-4"},[i("h2",ts,[R(c(j.tag)+" ",1),i("span",ss,"("+c(j.operations.length)+")",1)]),(n(!0),a(B,null,P(j.operations,N=>(n(),U(C,{key:N.anchor,item:N,spec:e.spec},null,8,["item","spec"]))),128))],8,es))),128))])):(n(),U(T,{key:2,icon:"i-lucide-search-x",text:"No endpoints match your filter."}))])}}}),os=Object.assign(ns,{__name:"ApiReference"}),as={key:1,class:"p-6"},rs={class:"flex flex-wrap justify-center gap-2 mt-1"},ks=H({__name:"docs",setup(e){const r=ae().public.demoMode,o=r?"/demo/_openapi.json":"/_openapi.json";xe({title:"API Reference — Piwi Dashboard"});const{data:l,status:m,error:$,refresh:p}=je(o,{key:"openapi-spec",lazy:!0,server:!r},"$jVU__ibpQM");return(g,b)=>{const u=ue,_=me,S=pe,q=fe,d=Y,v=ye,C=os,T=de;return n(),U(T,{id:"docs"},{header:V(()=>[w(S,null,{leading:V(()=>[w(u),w(_,{items:[{label:"API Reference",icon:"i-lucide-book-open"}]})]),_:1})]),body:V(()=>[s(m)==="pending"||!s(l)&&!s($)?(n(),U(q,{key:0,text:"Loading API reference…"})):s($)||!s(l)?(n(),a("div",as,[w(v,{text:"Couldn't load the API reference UI."},{action:V(()=>[b[3]||(b[3]=i("p",{class:"text-sm text-muted max-w-sm"},"The raw OpenAPI spec is still available directly.",-1)),i("div",rs,[w(d,{size:"sm",color:"neutral",variant:"outline",icon:"i-lucide-refresh-cw",onClick:b[0]||(b[0]=()=>s(p)())},{default:V(()=>[...b[1]||(b[1]=[R(" Retry ",-1)])]),_:1}),w(d,{to:s(o),target:"_blank",external:"",size:"sm",variant:"outline",icon:"i-lucide-file-json"},{default:V(()=>[...b[2]||(b[2]=[R(" Raw OpenAPI spec ",-1)])]),_:1},8,["to"])])]),_:1})])):(n(),U(C,{key:2,spec:s(l),"spec-url":s(o)},null,8,["spec","spec-url"]))]),_:1})}}});export{ks as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{_ as U,a as O}from"./IFqRT_xJ.js";import{_ as z}from"./Br2K9yi_.js";import{d as L,e as M,f,g as i,K as E,o as d,i as e,k as o,q as B,j as r,c as y,F as N,y as G,v as Y,t as l,m as s,_ as F,h as a}from"./BPKwYP2Q.js";import{_ as H}from"./DhA17dqR.js";import{_ as K}from"./CoHGrO41.js";import{_ as W}from"./DszOHBMG.js";import"./iwD5atI2.js";import"./CQeMb57w.js";import"./r3SBLxtE.js";import"./DuMv-ugy.js";import"./B7yG1G_l.js";import"./k-z_VVTK.js";import"./C38aZbFJ.js";const $=[{name:"list_projects",description:"List all projects with stats: total runs, test cases, latest run status and branch. Use this first to discover available projects and their IDs.",inputSchema:{type:"object",properties:{}}},{name:"get_project",description:"Get project details and its recent test runs with pass/fail counts. Results are paginated — use pageSize and cursor for the runs list.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Project ID from list_projects"},pageSize:{type:"number",description:"Runs per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of runs"}},required:["id"]}},{name:"list_runs",description:"List test runs for a project with filters.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["passed","failed","running","initialising","aborted"],description:"Filter by status"},branch:{type:"string",description:"Filter by branch name (exact match against SCM metadata)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_run",description:"Get a test run summary plus its test cases (paginated), with status, truncated error text, and failure cluster IDs. Filter by status and page with pageSize/cursor.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"},status_filter:{type:"string",enum:["failed","flaky","all"],description:'Which test cases to include (default: "failed" — only failed+timedOut; "flaky" — only flaky; "all" — every case)'},pageSize:{type:"number",description:"Cases per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response for the next page of cases"}},required:["id"]}},{name:"list_failed_cases",description:"List failed and timed-out test cases across recent runs for a project.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"},runId:{type:"number",description:"Optional: restrict to a specific run"}},required:["projectId"]}},{name:"list_flaky_tests",description:"List flaky tests for a project with flakiness scores.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Number of recent runs to analyze (default 50, max 200)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response. Cursor is the flakyScore value (descending)."}},required:["projectId"]}},{name:"get_test_case",description:"Get test case details including aggregated pass/fail stats, flakiness metrics, and recent executions (paginated). Use testCaseId (stable identity), not the per-run caseId.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (testCaseId from list_failed_cases or list_flaky_tests)"},pageSize:{type:"number",description:"Executions per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of executions"}},required:["id"]}},{name:"list_clusters",description:"List failure clusters for a project. Each cluster groups similar failures by error fingerprint.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"Filter by triage status (default: all statuses)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_cluster",description:"Get full details for a failure cluster including all affected test cases, a compact diagnosis summary, and locator healing suggestions for up to 5 affected cases. Each healing entry includes the failing locator, the recommended fix, and the number of alternatives available. Use get_cluster_diagnosis for the full diagnosis text, or get_cluster_context for the raw AI evidence.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID from list_clusters"}},required:["id"]}},{name:"get_cluster_diagnosis",description:"Get the stored AI diagnosis for a failure cluster. Returns category, confidence, root cause, evidence, and suggested fix. Returns null if no diagnosis has been run yet.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"}},required:["id"]}},{name:"get_test_case_context",description:"Get the AI evidence context for a specific test-run-case (execution scope). Use this when debugging a single test failure — it provides the execution-scoped evidence including steps, console, network, and SCM diff.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID"}},required:["id"]}},{name:"get_case_screenshots",description:"Get screenshots for a test-run-case. By default returns metadata only (name, type, size). Set content=true to include base64-encoded image data (max 3, capped at ~100 KB each). Call metadata-only first to discover what exists, then request content for the ones you need.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID"},content:{type:"boolean",description:"Include base64 image data (default false — metadata only)"}},required:["testRunsCaseId"]}},{name:"get_cluster_context",description:"Get the full AI evidence context for a failure cluster — the same data sent to the diagnosis AI. Includes error samples, stack traces, test steps, console logs, network failures, ARIA snapshots, SCM diff (changed files since last green run), and a per-section breakdown with char counts and truncation flags. This is the richest available evidence for debugging a failure.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},baseCommit:{type:"string",description:"Optional: override the baseline commit SHA for SCM diff comparison"},selectedCommitShas:{type:"array",items:{type:"string"},description:"Optional: specific commit SHAs to include in the diff context (max 10)"}},required:["id"]}},{name:"search_test_cases",description:"Search test cases by title or file path within a project. Accepts a free-text query and returns matching test cases with basic stats. Use this to find a test case when you don't know its ID.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},q:{type:"string",description:"Search query — matched against title and file path (case-insensitive)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId","q"]}},{name:"get_test_run_case",description:"Get a single test-run-case execution record with full (untruncated) error text plus steps, console logs, web vitals, and ARIA snapshot. Use include to fetch only the blobs you need. The ID is the executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID (executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases)"},include:{type:"array",items:{type:"string",enum:["steps","console","webVitals","aria","source"]},description:"Optional: which heavy blobs to include (default: all). The error, status, and summary are always returned."}},required:["id"]}},{name:"list_recent_activity",description:"List the most recent test runs across all projects. No projectId required — returns a cross-project view of recent CI activity. Paginated by startTime descending.",inputSchema:{type:"object",properties:{pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_repo_commits",description:"List recent commits for a project's repository. Requires SCM token configuration (per-project or global). Returns commit details (SHA, message, author, date).",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},branch:{type:"string",description:"Branch name (default: repository default branch)"},limit:{type:"number",description:"Max commits (default 20, max 100)"}},required:["projectId"]}},{name:"get_repo_diff",description:"Get the diff (changed files with patches) for a single commit in a project's repository. Requires SCM token configuration (per-project or global). Useful for inspecting what code changed in a specific commit suspected of causing a failure.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},sha:{type:"string",description:"Full commit SHA"}},required:["projectId","sha"]}},{name:"get_run_insights",description:'Compare a run to its last green baseline: pass-rate delta, new regressions, recurrences, recovered tests, new flaky tests, biggest perf improvements/regressions, worker imbalance, and newly opened clusters. Use this to answer "what changed?" and "did my fix work?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_spec_health",description:"Per-spec-file health for a project: pass rate, flaky rate, failure count, test count, and average duration grouped by spec-file prefix over the last N days. Use to find which areas of the suite are unhealthy.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},days:{type:"number",description:"Lookback window in days (default 30, max 90)"}},required:["projectId"]}},{name:"get_slow_tests",description:"Slowest test cases in a project by average duration, with max/min and trend direction across recent runs. Use to target performance work.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Recent runs to analyze (default 50, max 100)"}},required:["projectId"]}},{name:"get_performance_trend",description:'Time series of run duration, average test duration, and p90 test duration for a project. Use to answer "is the suite getting slower?".',inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},limit:{type:"number",description:"Number of recent runs (default 30, max 100)"}},required:["projectId"]}},{name:"get_test_stability_trend",description:'Time-series stability for a single test case: flaky rate, pass rate, and average duration bucketed over its recent execution history. Use to answer "is this test getting flakier?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (stable testCaseId)"},buckets:{type:"number",description:"Number of time buckets (default 20, 5–50)"}},required:["id"]}},{name:"get_network_requests",description:"A run's network requests aggregated by method + normalized route, sorted by average duration, with status codes and captured backend server logs. Use to pin a UI failure on a slow or failing endpoint.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_failure_groups",description:"One run's failures grouped by failure cluster, with per-group affected cases and worker correlation. Run-scoped counterpart to list_clusters.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_locator_healing",description:"Ranked alternative locators for a failing test-run-case: the failing locator, the recommended durable fix, and the full alternative lists (from prior success, element match, and ARIA snapshot). Use when fixing a broken selector.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"search",description:"Global search across all in-scope projects, runs (by label or numeric id), and test cases (by title). Use to find a run by its label or locate an entity across projects.",inputSchema:{type:"object",properties:{q:{type:"string",description:"Search query (min 2 chars)"}},required:["q"]}},{name:"list_case_traces",description:"List Playwright trace files for a test-run-case, with a download path for each. Fetch the bytes via GET /api/files/<path>.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"list_links",description:"List external entity links (Jira, GitHub PR/issue, etc.) attached to a run, test-run-case, or test case, with provider and unfurled status.",inputSchema:{type:"object",properties:{entityType:{type:"string",enum:["test_run","test_runs_case","test_case"],description:"Which entity the links are attached to"},id:{type:"number",description:"The entity ID matching entityType"}},required:["entityType","id"]}},{name:"list_tags",description:"List the project tag catalog (id, text, color).",inputSchema:{type:"object",properties:{}}},{name:"get_project_test_catalog",description:"The full test-case catalog for a project with aggregated pass/fail/flaky counts, average duration, and last status per test. Offset-paginated bulk companion to get_test_case.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},offset:{type:"number",description:"Row offset for paging (default 0)"},query:{type:"string",description:"Optional case-insensitive substring filter on title or file path"}},required:["projectId"]}},{name:"list_open_clusters",description:"Open failure clusters across all in-scope projects, ranked by occurrences — a cross-project triage queue. Filter by status; paginate with pageSize/cursor.",inputSchema:{type:"object",properties:{status:{type:"string",enum:["open","resolved","ignored"],description:"Triage status (default: open)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_instance_stats",description:"Instance-wide counts (projects, runs, test cases, executions, files) and total storage size. Admin only.",inputSchema:{type:"object",properties:{}}},{name:"explain_failure",description:"One-call evidence bundle for a single failing execution: error, steps, console, ARIA snapshot, the recommended locator fix, a screenshot count, and the AI diagnosis context. Prefer this over chaining get_test_run_case + get_locator_healing + get_test_case_context.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"set_cluster_status",description:"Triage a failure cluster: set its status to open, resolved, or ignored with an optional note. Requires reporter or admin access. Use after fixing the underlying issue.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"New triage status"},triageNote:{type:"string",description:"Optional note explaining the status change"}},required:["id","status"]}},{name:"set_cluster_base_commit",description:'Pin the baseline commit SHA a cluster uses for its SCM-diff diagnosis context, so "what changed since green" is accurate. Requires reporter or admin access.',inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},commit:{type:"string",description:"Baseline commit SHA (empty to clear)"}},required:["id","commit"]}},{name:"submit_diagnosis_feedback",description:"Record thumbs up/down feedback on a stored diagnosis, with an optional note. Requires reporter or admin access.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Diagnosis ID"},feedback:{type:"string",enum:["up","down"],description:"Rating (omit to clear)"},feedbackNote:{type:"string",description:"Optional note"}},required:["id"]}},{name:"run_cluster_diagnosis",description:"Trigger an AI diagnosis for a failure cluster and return the result (category, confidence, root cause, suggested fix). Returns the existing completed diagnosis unless force is set. Requires reporter or admin access and a configured AI provider.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},force:{type:"boolean",description:"Re-run even if a completed diagnosis exists (default false)"},baseCommit:{type:"string",description:"Optional baseline commit SHA for SCM-diff context"}},required:["id"]}}];function V(h){return new URL(globalThis.location.href)}const J={class:"max-w-3xl mx-auto p-6 space-y-6"},Q={class:"flex flex-col gap-1.5"},X={class:"min-w-0"},Z={class:"text-sm font-mono font-semibold text-foreground"},ee={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},te={class:"space-y-3"},se={class:"space-y-3"},re={class:"space-y-3"},ie={class:"space-y-3"},oe={class:"space-y-3"},ne={class:"space-y-3"},ae={class:"space-y-2"},ce={class:"flex items-center gap-2"},pe={class:"flex-1 px-3 py-2 bg-muted rounded-md text-sm font-mono break-all"},ve=L({__name:"mcp",setup(h){const m=E(),g=m.public.demoMode,b=V(),n=a(()=>`${m.public.siteUrl||b.origin}/mcp`);M({title:"MCP server — Piwi Dashboard"});const _=$,x=[{label:"Claude Code",slot:"claude-code"},{label:"Cursor",slot:"cursor"},{label:"VS Code",slot:"vscode"},{label:"Claude Desktop",slot:"claude-desktop"},{label:"Gemini CLI",slot:"gemini"},{label:"Windsurf / Continue",slot:"windsurf"}],I=a(()=>`claude mcp add --transport http piwi ${n.value} \\
|
|
2
|
-
--header "Authorization: Bearer pd_YOUR_API_KEY"`),j=a(()=>JSON.stringify({mcpServers:{piwi:{url:n.value,headers:{Authorization:"Bearer pd_YOUR_API_KEY"}}}},null,2)),v=a(()=>JSON.stringify({servers:{piwi:{type:"http",url:n.value,headers:{Authorization:"Bearer pd_YOUR_API_KEY"}}}},null,2)),w=a(()=>JSON.stringify({mcpServers:{piwi:{type:"http",url:n.value,headers:{Authorization:"Bearer pd_YOUR_API_KEY"}}}},null,2)),S=a(()=>`gemini mcp add --transport http piwi ${n.value} \\
|
|
3
|
-
--header "Authorization: Bearer pd_YOUR_API_KEY"`),k=a(()=>JSON.stringify({mcpServers:{piwi:{serverUrl:n.value,headers:{Authorization:"Bearer pd_YOUR_API_KEY"}}}},null,2));return(C,t)=>{const q=O,R=z,A=Y,p=H,c=K,P=W,D=F,T=U;return d(),f(T,null,{header:i(()=>[r(q,{title:"MCP server"})]),body:i(()=>[e("div",J,[o(g)?(d(),f(R,{key:0,color:"info",icon:"i-lucide-bot",title:"Feature preview",description:"The MCP endpoint is not active in this demo — it requires a real Piwi backend. The tools and client setup shown below reflect what your own deployment exposes."})):B("",!0),r(p,{icon:"i-lucide-bot",title:"What it provides",help:"mcp.tools"},{default:i(()=>[e("div",Q,[(d(!0),y(N,null,G(o(_),u=>(d(),y("div",{key:u.name,class:"flex items-start gap-3 px-3 py-2.5 rounded-md bg-elevated/50 border border-default hover:bg-elevated transition-colors"},[r(A,{name:"i-lucide-wrench",class:"size-4 mt-0.5 shrink-0 text-primary"}),e("div",X,[e("p",Z,l(u.name),1),e("p",ee,l(u.description),1)])]))),128))])]),_:1}),r(p,{icon:"i-lucide-key",title:"Authentication",help:"mcp.auth"},{default:i(()=>[...t[0]||(t[0]=[e("div",{class:"space-y-3 text-sm text-gray-600 dark:text-gray-400"},[e("p",null,[s(" MCP requests are authenticated with the same API keys used by the REST API. API keys start with "),e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_"),s(". ")]),e("p",null,[s(" Generate a key in "),e("strong",null,"Settings → Users → [your account] → API keys"),s(", then replace "),e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_YOUR_API_KEY"),s(" in the snippets below. ")]),e("p",{class:"text-xs text-gray-400"},[s(" When authentication is disabled ("),e("code",{class:"font-mono"},"PIWI_AUTH_ENABLED"),s(" not set), any request is accepted without a key. ")])],-1)])]),_:1}),r(p,{icon:"i-lucide-settings-2",title:"Client setup",help:"mcp.client-setup"},{default:i(()=>[t[13]||(t[13]=e("p",{class:"text-sm text-gray-500 dark:text-gray-400 mb-4"},[s(" Replace "),e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_YOUR_API_KEY"),s(" with your actual API key. The MCP URL shown below is auto-detected from your current browser origin. ")],-1)),r(P,{items:x,ui:{list:"mb-4"}},{"claude-code":i(()=>[e("div",te,[t[1]||(t[1]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"}," Run once in any terminal. Claude Code stores the server in your global MCP config. ",-1)),r(c,{code:o(I),lang:"sh"},null,8,["code"]),t[2]||(t[2]=e("p",{class:"text-xs text-gray-400"},[s(" After adding, restart Claude Code and use "),e("code",{class:"font-mono"},"/mcp"),s(" to verify "),e("strong",null,"piwi"),s(" is connected. Claude will call the tools automatically when you ask about test results or failures. ")],-1))])]),cursor:i(()=>[e("div",se,[t[3]||(t[3]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to "),e("code",{class:"font-mono text-xs"},"~/.cursor/mcp.json"),s(" (global) or "),e("code",{class:"font-mono text-xs"},".cursor/mcp.json"),s(" in your project root: ")],-1)),r(c,{code:o(j),lang:"json"},null,8,["code"]),t[4]||(t[4]=e("p",{class:"text-xs text-gray-400"}," Restart Cursor, then enable the MCP server in Cursor Settings → MCP. ",-1))])]),vscode:i(()=>[e("div",re,[t[5]||(t[5]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to "),e("code",{class:"font-mono text-xs"},".vscode/mcp.json"),s(" in your workspace (VS Code Copilot agent mode, version 1.99+): ")],-1)),r(c,{code:o(v),lang:"json"},null,8,["code"]),t[6]||(t[6]=e("p",{class:"text-xs text-gray-400"}," The server appears in the Copilot chat agent drop-down once the file is saved. ",-1))])]),"claude-desktop":i(()=>[e("div",ie,[t[7]||(t[7]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},"Add to your Claude Desktop config file:",-1)),t[8]||(t[8]=e("ul",{class:"text-xs text-gray-400 space-y-0.5 mb-2"},[e("li",null,[e("strong",null,"macOS:"),e("code",{class:"font-mono"},"~/Library/Application Support/Claude/claude_desktop_config.json")]),e("li",null,[e("strong",null,"Windows:"),e("code",{class:"font-mono"},"%APPDATA%\\Claude\\claude_desktop_config.json")])],-1)),r(c,{code:o(w),lang:"json"},null,8,["code"]),t[9]||(t[9]=e("p",{class:"text-xs text-gray-400"}," Requires Claude Desktop with remote MCP support (released early 2025). Restart the app after saving. ",-1))])]),gemini:i(()=>[e("div",oe,[t[10]||(t[10]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},"Run once to register the server with Gemini CLI:",-1)),r(c,{code:o(S),lang:"sh"},null,8,["code"]),t[11]||(t[11]=e("p",{class:"text-xs text-gray-400"}," Gemini CLI fetches the tool list on startup and makes them available in agent mode. ",-1))])]),windsurf:i(()=>[e("div",ne,[t[12]||(t[12]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to your Windsurf or Continue MCP config. For Windsurf: "),e("code",{class:"font-mono text-xs"},"~/.codeium/windsurf/mcp_config.json"),s(". For Continue: "),e("code",{class:"font-mono text-xs"},"~/.continue/config.json"),s(" under "),e("code",{class:"font-mono text-xs"},"mcpServers"),s(". ")],-1)),r(c,{code:o(k),lang:"json"},null,8,["code"])])]),_:1})]),_:1}),r(p,{icon:"i-lucide-link",title:"Server URL"},{default:i(()=>[e("div",ae,[e("div",ce,[e("code",pe,l(o(n)),1),r(D,{icon:"i-lucide-external-link",size:"sm",color:"neutral",variant:"outline",title:"Open API docs",to:"/docs",external:!o(g)},{default:i(()=>[...t[14]||(t[14]=[s(" REST API docs ",-1)])]),_:1},8,["external"])]),t[15]||(t[15]=e("p",{class:"text-xs text-gray-400"},[s(" This is your Piwi instance's MCP endpoint. It is also the server URL to paste into client configs above. The server requires a valid Bearer token (or no auth if "),e("code",{class:"font-mono"},"PIWI_AUTH_ENABLED"),s(" is not set). ")],-1))])]),_:1})])]),_:1})}}});export{ve as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"5182c9fb-56a6-4df2-9685-4020a08ce7a5","timestamp":1784747904034,"prerendered":[]}
|