@xenon-device-management/xenon 1.26.0 → 1.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/package.json +1 -1
- package/lib/public/assets/{ApiKeyGate-DJ7e-uHp.js → ApiKeyGate-vELAdQLu.js} +1 -1
- package/lib/public/assets/{BugReportButton-CRByOTXm.js → BugReportButton-ySiZDywe.js} +1 -1
- package/lib/public/assets/{DeviceMosaicView-DUlCwfkZ.js → DeviceMosaicView-Chtp0wAI.js} +1 -1
- package/lib/public/assets/{EmptyState-CXb-ftNt.js → EmptyState-CYQYScPo.js} +1 -1
- package/lib/public/assets/{FieldGroup-CkgSdVnT.js → FieldGroup-Dea68RfI.js} +1 -1
- package/lib/public/assets/{Modal-jpvRi2Hs.js → Modal-BgzTzImP.js} +1 -1
- package/lib/public/assets/{SegmentedControl-C7gZCiLf.js → SegmentedControl-DyRq9blY.js} +1 -1
- package/lib/public/assets/{SettingCard-DXSl62Or.js → SettingCard-CardwBu3.js} +1 -1
- package/lib/public/assets/{Table-CX97HoR-.js → Table-BczCxsDm.js} +1 -1
- package/lib/public/assets/{activity-Boj_HvMZ.js → activity-CS-Op-T6.js} +1 -1
- package/lib/public/assets/{ai-settings-BB83UY7K.js → ai-settings-CIvB7rNM.js} +1 -1
- package/lib/public/assets/{api-keys-Dlm8YMn6.js → api-keys-peJzllzQ.js} +1 -1
- package/lib/public/assets/{apps-CMZ_W17Z.js → apps-__WvcJaP.js} +1 -1
- package/lib/public/assets/{arrow-left-D6gOwAGu.js → arrow-left-Dx-cXFLT.js} +1 -1
- package/lib/public/assets/{arrow-right-CbBu0GWO.js → arrow-right-Ax_FfBMv.js} +1 -1
- package/lib/public/assets/{arrow-up-right-R45CSoO8.js → arrow-up-right-B6uJmGeA.js} +1 -1
- package/lib/public/assets/{auth-shell-BL9cMUwX.js → auth-shell-BQqcjjC9.js} +2 -2
- package/lib/public/assets/{builds-page-Dhmu7Vbv.js → builds-page-BA-_iEjx.js} +1 -1
- package/lib/public/assets/{button-CYDb9Orf.js → button-DcbnByKB.js} +1 -1
- package/lib/public/assets/{calendar-BIs8_hZW.js → calendar-C3pYg1V7.js} +1 -1
- package/lib/public/assets/{check-CBqCzXqq.js → check-DKdLfzhJ.js} +1 -1
- package/lib/public/assets/{chevron-left-B39R3gLJ.js → chevron-left-Bb9PBLG5.js} +1 -1
- package/lib/public/assets/{chevron-right-9Hw6sbXB.js → chevron-right-DJcpeY_o.js} +1 -1
- package/lib/public/assets/{circle-check-C1JIxWz-.js → circle-check-DY6ntqp3.js} +1 -1
- package/lib/public/assets/{circle-x-CtpnRhl0.js → circle-x-DgK9drRH.js} +1 -1
- package/lib/public/assets/{clock-CDLlRyIO.js → clock-I9zEVPan.js} +1 -1
- package/lib/public/assets/{copy-BTs3mIiX.js → copy-Dy3oRuWT.js} +1 -1
- package/lib/public/assets/device-explorer-BPyGYs0c.js +246 -0
- package/lib/public/assets/device-explorer-C9qg30Jn.css +1 -0
- package/lib/public/assets/{download-B6dN3V7k.js → download-BotTmDty.js} +1 -1
- package/lib/public/assets/{forgot-password-BObOfKOb.js → forgot-password-BaWiD2U2.js} +1 -1
- package/lib/public/assets/{funnel-D0Vl2mj-.js → funnel-D2Qw4nTX.js} +1 -1
- package/lib/public/assets/{index-CsOuZa5J.js → index-CI9Nz3HY.js} +2 -2
- package/lib/public/assets/{input-BCvn04w7.js → input-cBBGau4X.js} +1 -1
- package/lib/public/assets/{keycodes-C2eSDBF4.js → keycodes-CY4uwulo.js} +1 -1
- package/lib/public/assets/{layers-YHoIbeXC.js → layers-MHwJM2Ll.js} +1 -1
- package/lib/public/assets/{lock-BkSWvHaq.js → lock-Bpc8rJFu.js} +1 -1
- package/lib/public/assets/{login-DmwN3Oiq.js → login-BmcyszP5.js} +1 -1
- package/lib/public/assets/{maintenance-settings-DNxjSZN3.js → maintenance-settings-DMFVuToe.js} +1 -1
- package/lib/public/assets/{monitor-1B8G-Qsg.js → monitor-irjK6PRV.js} +1 -1
- package/lib/public/assets/{mouse-pointer-2-D_nJmn_S.js → mouse-pointer-2-CYkC-Dyq.js} +1 -1
- package/lib/public/assets/{network-C1TkeEVT.js → network-CVZ32MhH.js} +1 -1
- package/lib/public/assets/{overview-zyv8wW9T.js → overview-DRRSIpnD.js} +1 -1
- package/lib/public/assets/{page-header-wb7FvdLY.js → page-header-Bl7uTiQF.js} +1 -1
- package/lib/public/assets/{plus-BkguZ6lZ.js → plus-C3lvaMcL.js} +1 -1
- package/lib/public/assets/{profile-page-C9dWe1GN.js → profile-page-B3wsnR1n.js} +1 -1
- package/lib/public/assets/{reset-password-C6lIfkUv.js → reset-password-BIGj_ULj.js} +1 -1
- package/lib/public/assets/{runbook-page-BbPNTinH.js → runbook-page-DEznNZhc.js} +1 -1
- package/lib/public/assets/{select-4puNl_of.js → select-BpuZWZuE.js} +1 -1
- package/lib/public/assets/{selector-detail-page-C6fXdhpS.js → selector-detail-page-ZCvmtQ5Y.js} +1 -1
- package/lib/public/assets/{selector-health-Dtp0mM2V.js → selector-health-D-hvfY2E.js} +1 -1
- package/lib/public/assets/{selector-health-page-DKEGj-Kl.js → selector-health-page-C0ZqZ_VT.js} +1 -1
- package/lib/public/assets/{session-detail-page-CqFOmHdS.js → session-detail-page-Bv7IwFTQ.js} +1 -1
- package/lib/public/assets/{settings-CaIJEsSM.js → settings-DCR9vnQ5.js} +1 -1
- package/lib/public/assets/{status-pill-outline-_zOEXXFr.js → status-pill-outline-B5dWsaer.js} +1 -1
- package/lib/public/assets/{tablet-BDyvY8gn.js → tablet-DxwkBlhd.js} +1 -1
- package/lib/public/assets/{teams-y4sxVHc3.js → teams-D3s8GhkG.js} +1 -1
- package/lib/public/assets/{trash-2-CmEXtFhj.js → trash-2-Dyf4Jcyk.js} +1 -1
- package/lib/public/assets/{upload-wYEKh77e.js → upload-B6ZJ1_f1.js} +1 -1
- package/lib/public/assets/{use-password-reset-mode-pSi7-_eA.js → use-password-reset-mode-B-oOrt1d.js} +1 -1
- package/lib/public/assets/{users-tYsVZwy2.js → users-BfvPE2wX.js} +1 -1
- package/lib/public/assets/{users-UlMfevNJ.js → users-QfiFclLn.js} +1 -1
- package/lib/public/assets/{video-off-BNnAtI1a.js → video-off-C2quR4KF.js} +1 -1
- package/lib/public/assets/{webhook-settings-BQHWKlf0.js → webhook-settings-BjbGi-Pi.js} +1 -1
- package/lib/public/assets/{zap-yoeNa_1n.js → zap-C2lxP7TK.js} +1 -1
- package/lib/public/index.html +1 -1
- package/package.json +1 -1
- package/lib/public/assets/device-explorer-CibdPgEj.js +0 -246
- package/lib/public/assets/device-explorer-DGm8XH4R.css +0 -1
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import{c as K,r as d,t as jn,j as t,R as hi,v as pi,w as ye,C as qs,U as gi,X as H,x as Zt,y as $s,u as Ts,a as Ds,b as xi,T as yi,q as bs,z as wn,A as it,S as Ot,B as Nn,i as Cn,f as rs,D as vi,p as bi,E as as}from"./index-CsOuZa5J.js";import{P as ji}from"./page-header-wb7FvdLY.js";import{B as Ke}from"./button-CYDb9Orf.js";import{S as Jt}from"./select-4puNl_of.js";import{P as Ft,B as wi}from"./BugReportButton-CRByOTXm.js";import{P as wt,u as Vt,a as bt,b as Sn,c as Is,d as Ni,D as Ci,e as Xs,f as Si,g as rt,h as ki,M as kn}from"./Modal-jpvRi2Hs.js";import{C as yt}from"./check-CBqCzXqq.js";import{F as Bt}from"./FieldGroup-CkgSdVnT.js";import{C as Ai}from"./clock-CDLlRyIO.js";import{P as An}from"./plus-BkguZ6lZ.js";import{A as Ri}from"./activity-Boj_HvMZ.js";import{p as Ms}from"./labels-C21SA4JG.js";import{C as Be}from"./copy-BTs3mIiX.js";import{T as Ei}from"./tablet-BDyvY8gn.js";import{f as $i}from"./time-B8FIgwPE.js";import{M as Ks,F as Ti}from"./mouse-pointer-2-D_nJmn_S.js";import{L as Di}from"./layers-YHoIbeXC.js";import{Z as js}from"./zap-yoeNa_1n.js";import{C as Rn}from"./chevron-right-9Hw6sbXB.js";import{S as En,C as Ii,H as Mi,a as os,A as xt,I as cs}from"./keycodes-C2eSDBF4.js";import{D as Li}from"./download-B6dN3V7k.js";import{T as Ut}from"./trash-2-CmEXtFhj.js";import{C as ls}from"./chevron-left-B39R3gLJ.js";import{L as _i}from"./lock-BkSWvHaq.js";import{T as Oi,U as Pi}from"./upload-wYEKh77e.js";import{S as zi}from"./SegmentedControl-C7gZCiLf.js";import"./utils-CDN07tui.js";/**
|
|
2
|
-
* @license lucide-react v0.555.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Fi=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Bi=K("arrow-down",Fi);/**
|
|
7
|
-
* @license lucide-react v0.555.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Ui=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Wi=K("arrow-up",Ui);/**
|
|
12
|
-
* @license lucide-react v0.555.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Hi=[["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 14v-4",key:"14a6bd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],Vi=K("battery-low",Hi);/**
|
|
17
|
-
* @license lucide-react v0.555.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const qi=[["path",{d:"M10 17h.01",key:"nbq80n"}],["path",{d:"M10 7v6",key:"nne03l"}],["path",{d:"M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2",key:"1m83kb"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"h8lgfh"}]],Xi=K("battery-warning",qi);/**
|
|
22
|
-
* @license lucide-react v0.555.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const Ki=[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],Gi=K("battery",Ki);/**
|
|
27
|
-
* @license lucide-react v0.555.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const Yi=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Zi=K("box",Yi);/**
|
|
32
|
-
* @license lucide-react v0.555.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const Ji=[["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5",key:"1glfrc"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}]],Qi=K("calendar-plus",Ji);/**
|
|
37
|
-
* @license lucide-react v0.555.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const er=[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]],tr=K("case-sensitive",er);/**
|
|
42
|
-
* @license lucide-react v0.555.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const sr=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],nr=K("chevron-up",sr);/**
|
|
47
|
-
* @license lucide-react v0.555.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const ir=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],rr=K("circle-question-mark",ir);/**
|
|
52
|
-
* @license lucide-react v0.555.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const ar=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],or=K("clipboard",ar);/**
|
|
57
|
-
* @license lucide-react v0.555.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const cr=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Gs=K("code-xml",cr);/**
|
|
62
|
-
* @license lucide-react v0.555.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const lr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],dr=K("crosshair",lr);/**
|
|
67
|
-
* @license lucide-react v0.555.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const ur=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],mr=K("ellipsis",ur);/**
|
|
72
|
-
* @license lucide-react v0.555.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const fr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],hr=K("grid-3x3",fr);/**
|
|
77
|
-
* @license lucide-react v0.555.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const pr=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],gr=K("lightbulb",pr);/**
|
|
82
|
-
* @license lucide-react v0.555.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const xr=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],yr=K("lock-open",xr);/**
|
|
87
|
-
* @license lucide-react v0.555.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const vr=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],br=K("map-pin",vr);/**
|
|
92
|
-
* @license lucide-react v0.555.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const jr=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],wr=K("message-square",jr);/**
|
|
97
|
-
* @license lucide-react v0.555.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const Nr=[["path",{d:"M18 5h4",key:"1lhgn2"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Cr=K("moon-star",Nr);/**
|
|
102
|
-
* @license lucide-react v0.555.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const Sr=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]],kr=K("move",Sr);/**
|
|
107
|
-
* @license lucide-react v0.555.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const Ar=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Rr=K("package",Ar);/**
|
|
112
|
-
* @license lucide-react v0.555.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const Er=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],$r=K("panels-top-left",Er);/**
|
|
117
|
-
* @license lucide-react v0.555.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const Tr=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],Dr=K("rectangle-horizontal",Tr);/**
|
|
122
|
-
* @license lucide-react v0.555.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const Ir=[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}]],Mr=K("rectangle-vertical",Ir);/**
|
|
127
|
-
* @license lucide-react v0.555.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const Lr=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],vt=K("rotate-cw",Lr);/**
|
|
132
|
-
* @license lucide-react v0.555.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const _r=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Or=K("scroll-text",_r);/**
|
|
137
|
-
* @license lucide-react v0.555.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const Pr=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],nt=K("shield-alert",Pr);/**
|
|
142
|
-
* @license lucide-react v0.555.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const zr=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ws=K("sparkles",zr);/**
|
|
147
|
-
* @license lucide-react v0.555.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const Fr=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Br=K("tag",Fr);/**
|
|
152
|
-
* @license lucide-react v0.555.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const Ur=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],ds=K("target",Ur);/**
|
|
157
|
-
* @license lucide-react v0.555.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const Wr=[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],Hr=K("text-wrap",Wr);/**
|
|
162
|
-
* @license lucide-react v0.555.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const Vr=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],qr=K("thermometer",Vr);/**
|
|
167
|
-
* @license lucide-react v0.555.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const Xr=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"M2 14h20",key:"myj16y"}],["path",{d:"M12 20v-6",key:"1rm09r"}]],Ys=K("touchpad",Xr);/**
|
|
172
|
-
* @license lucide-react v0.555.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const Kr=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]],Gr=K("volume-1",Kr);/**
|
|
177
|
-
* @license lucide-react v0.555.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const Yr=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Zr=K("volume-2",Yr);/**
|
|
182
|
-
* @license lucide-react v0.555.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const Jr=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Qr=K("wifi",Jr),ea=["top","right","bottom","left"],Ue=Math.min,le=Math.max,qt=Math.round,Pt=Math.floor,Ne=e=>({x:e,y:e}),ta={left:"right",right:"left",bottom:"top",top:"bottom"};function Ns(e,s,n){return le(e,Ue(s,n))}function De(e,s){return typeof e=="function"?e(s):e}function Ie(e){return e.split("-")[0]}function lt(e){return e.split("-")[1]}function Ls(e){return e==="x"?"y":"x"}function _s(e){return e==="y"?"height":"width"}function we(e){const s=e[0];return s==="t"||s==="b"?"y":"x"}function Os(e){return Ls(we(e))}function sa(e,s,n){n===void 0&&(n=!1);const i=lt(e),r=Os(e),a=_s(r);let c=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return s.reference[a]>s.floating[a]&&(c=Xt(c)),[c,Xt(c)]}function na(e){const s=Xt(e);return[Cs(e),s,Cs(s)]}function Cs(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Zs=["left","right"],Js=["right","left"],ia=["top","bottom"],ra=["bottom","top"];function aa(e,s,n){switch(e){case"top":case"bottom":return n?s?Js:Zs:s?Zs:Js;case"left":case"right":return s?ia:ra;default:return[]}}function oa(e,s,n,i){const r=lt(e);let a=aa(Ie(e),n==="start",i);return r&&(a=a.map(c=>c+"-"+r),s&&(a=a.concat(a.map(Cs)))),a}function Xt(e){const s=Ie(e);return ta[s]+e.slice(s.length)}function ca(e){return{top:0,right:0,bottom:0,left:0,...e}}function $n(e){return typeof e!="number"?ca(e):{top:e,right:e,bottom:e,left:e}}function Kt(e){const{x:s,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:s,right:s+i,bottom:n+r,x:s,y:n}}function Qs(e,s,n){let{reference:i,floating:r}=e;const a=we(s),c=Os(s),l=_s(c),o=Ie(s),u=a==="y",m=i.x+i.width/2-r.width/2,h=i.y+i.height/2-r.height/2,p=i[l]/2-r[l]/2;let g;switch(o){case"top":g={x:m,y:i.y-r.height};break;case"bottom":g={x:m,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:h};break;case"left":g={x:i.x-r.width,y:h};break;default:g={x:i.x,y:i.y}}switch(lt(s)){case"start":g[c]-=p*(n&&u?-1:1);break;case"end":g[c]+=p*(n&&u?-1:1);break}return g}async function la(e,s){var n;s===void 0&&(s={});const{x:i,y:r,platform:a,rects:c,elements:l,strategy:o}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=De(s,e),b=$n(g),y=l[p?h==="floating"?"reference":"floating":h],S=Kt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:m,strategy:o})),C=h==="floating"?{x:i,y:r,width:c.floating.width,height:c.floating.height}:c.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),j=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},T=Kt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:w,strategy:o}):C);return{top:(S.top-T.top+b.top)/j.y,bottom:(T.bottom-S.bottom+b.bottom)/j.y,left:(S.left-T.left+b.left)/j.x,right:(T.right-S.right+b.right)/j.x}}const da=50,ua=async(e,s,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:c}=n,l=c.detectOverflow?c:{...c,detectOverflow:la},o=await(c.isRTL==null?void 0:c.isRTL(s));let u=await c.getElementRects({reference:e,floating:s,strategy:r}),{x:m,y:h}=Qs(u,i,o),p=i,g=0;const b={};for(let x=0;x<a.length;x++){const y=a[x];if(!y)continue;const{name:S,fn:C}=y,{x:w,y:j,data:T,reset:E}=await C({x:m,y:h,initialPlacement:i,placement:p,strategy:r,middlewareData:b,rects:u,platform:l,elements:{reference:e,floating:s}});m=w??m,h=j??h,b[S]={...b[S],...T},E&&g<da&&(g++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(u=E.rects===!0?await c.getElementRects({reference:e,floating:s,strategy:r}):E.rects),{x:m,y:h}=Qs(u,p,o)),x=-1)}return{x:m,y:h,placement:p,strategy:r,middlewareData:b}},ma=e=>({name:"arrow",options:e,async fn(s){const{x:n,y:i,placement:r,rects:a,platform:c,elements:l,middlewareData:o}=s,{element:u,padding:m=0}=De(e,s)||{};if(u==null)return{};const h=$n(m),p={x:n,y:i},g=Os(r),b=_s(g),x=await c.getDimensions(u),y=g==="y",S=y?"top":"left",C=y?"bottom":"right",w=y?"clientHeight":"clientWidth",j=a.reference[b]+a.reference[g]-p[g]-a.floating[b],T=p[g]-a.reference[g],E=await(c.getOffsetParent==null?void 0:c.getOffsetParent(u));let L=E?E[w]:0;(!L||!await(c.isElement==null?void 0:c.isElement(E)))&&(L=l.floating[w]||a.floating[b]);const $=j/2-T/2,X=L/2-x[b]/2-1,M=Ue(h[S],X),F=Ue(h[C],X),P=M,G=L-x[b]-F,V=L/2-x[b]/2+$,ee=Ns(P,V,G),B=!o.arrow&<(r)!=null&&V!==ee&&a.reference[b]/2-(V<P?M:F)-x[b]/2<0,O=B?V<P?V-P:V-G:0;return{[g]:p[g]+O,data:{[g]:ee,centerOffset:V-ee-O,...B&&{alignmentOffset:O}},reset:B}}}),fa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(s){var n,i;const{placement:r,middlewareData:a,rects:c,initialPlacement:l,platform:o,elements:u}=s,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...y}=De(e,s);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const S=Ie(r),C=we(l),w=Ie(l)===l,j=await(o.isRTL==null?void 0:o.isRTL(u.floating)),T=p||(w||!x?[Xt(l)]:na(l)),E=b!=="none";!p&&E&&T.push(...oa(l,x,b,j));const L=[l,...T],$=await o.detectOverflow(s,y),X=[];let M=((i=a.flip)==null?void 0:i.overflows)||[];if(m&&X.push($[S]),h){const V=sa(r,c,j);X.push($[V[0]],$[V[1]])}if(M=[...M,{placement:r,overflows:X}],!X.every(V=>V<=0)){var F,P;const V=(((F=a.flip)==null?void 0:F.index)||0)+1,ee=L[V];if(ee&&(!(h==="alignment"?C!==we(ee):!1)||M.every(A=>we(A.placement)===C?A.overflows[0]>0:!0)))return{data:{index:V,overflows:M},reset:{placement:ee}};let B=(P=M.filter(O=>O.overflows[0]<=0).sort((O,A)=>O.overflows[1]-A.overflows[1])[0])==null?void 0:P.placement;if(!B)switch(g){case"bestFit":{var G;const O=(G=M.filter(A=>{if(E){const J=we(A.placement);return J===C||J==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(J=>J>0).reduce((J,R)=>J+R,0)]).sort((A,J)=>A[1]-J[1])[0])==null?void 0:G[0];O&&(B=O);break}case"initialPlacement":B=l;break}if(r!==B)return{reset:{placement:B}}}return{}}}};function en(e,s){return{top:e.top-s.height,right:e.right-s.width,bottom:e.bottom-s.height,left:e.left-s.width}}function tn(e){return ea.some(s=>e[s]>=0)}const ha=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(s){const{rects:n,platform:i}=s,{strategy:r="referenceHidden",...a}=De(e,s);switch(r){case"referenceHidden":{const c=await i.detectOverflow(s,{...a,elementContext:"reference"}),l=en(c,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:tn(l)}}}case"escaped":{const c=await i.detectOverflow(s,{...a,altBoundary:!0}),l=en(c,n.floating);return{data:{escapedOffsets:l,escaped:tn(l)}}}default:return{}}}}},Tn=new Set(["left","top"]);async function pa(e,s){const{placement:n,platform:i,elements:r}=e,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),c=Ie(n),l=lt(n),o=we(n)==="y",u=Tn.has(c)?-1:1,m=a&&o?-1:1,h=De(s,e);let{mainAxis:p,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),o?{x:g*m,y:p*u}:{x:p*u,y:g*m}}const ga=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(s){var n,i;const{x:r,y:a,placement:c,middlewareData:l}=s,o=await pa(s,e);return c===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+o.x,y:a+o.y,data:{...o,placement:c}}}}},xa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(s){const{x:n,y:i,placement:r,platform:a}=s,{mainAxis:c=!0,crossAxis:l=!1,limiter:o={fn:S=>{let{x:C,y:w}=S;return{x:C,y:w}}},...u}=De(e,s),m={x:n,y:i},h=await a.detectOverflow(s,u),p=we(Ie(r)),g=Ls(p);let b=m[g],x=m[p];if(c){const S=g==="y"?"top":"left",C=g==="y"?"bottom":"right",w=b+h[S],j=b-h[C];b=Ns(w,b,j)}if(l){const S=p==="y"?"top":"left",C=p==="y"?"bottom":"right",w=x+h[S],j=x-h[C];x=Ns(w,x,j)}const y=o.fn({...s,[g]:b,[p]:x});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[g]:c,[p]:l}}}}}},ya=function(e){return e===void 0&&(e={}),{options:e,fn(s){const{x:n,y:i,placement:r,rects:a,middlewareData:c}=s,{offset:l=0,mainAxis:o=!0,crossAxis:u=!0}=De(e,s),m={x:n,y:i},h=we(r),p=Ls(h);let g=m[p],b=m[h];const x=De(l,s),y=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(o){const w=p==="y"?"height":"width",j=a.reference[p]-a.floating[w]+y.mainAxis,T=a.reference[p]+a.reference[w]-y.mainAxis;g<j?g=j:g>T&&(g=T)}if(u){var S,C;const w=p==="y"?"width":"height",j=Tn.has(Ie(r)),T=a.reference[h]-a.floating[w]+(j&&((S=c.offset)==null?void 0:S[h])||0)+(j?0:y.crossAxis),E=a.reference[h]+a.reference[w]+(j?0:((C=c.offset)==null?void 0:C[h])||0)-(j?y.crossAxis:0);b<T?b=T:b>E&&(b=E)}return{[p]:g,[h]:b}}}},va=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(s){var n,i;const{placement:r,rects:a,platform:c,elements:l}=s,{apply:o=()=>{},...u}=De(e,s),m=await c.detectOverflow(s,u),h=Ie(r),p=lt(r),g=we(r)==="y",{width:b,height:x}=a.floating;let y,S;h==="top"||h==="bottom"?(y=h,S=p===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(S=h,y=p==="end"?"top":"bottom");const C=x-m.top-m.bottom,w=b-m.left-m.right,j=Ue(x-m[y],C),T=Ue(b-m[S],w),E=!s.middlewareData.shift;let L=j,$=T;if((n=s.middlewareData.shift)!=null&&n.enabled.x&&($=w),(i=s.middlewareData.shift)!=null&&i.enabled.y&&(L=C),E&&!p){const M=le(m.left,0),F=le(m.right,0),P=le(m.top,0),G=le(m.bottom,0);g?$=b-2*(M!==0||F!==0?M+F:le(m.left,m.right)):L=x-2*(P!==0||G!==0?P+G:le(m.top,m.bottom))}await o({...s,availableWidth:$,availableHeight:L});const X=await c.getDimensions(l.floating);return b!==X.width||x!==X.height?{reset:{rects:!0}}:{}}}};function Qt(){return typeof window<"u"}function dt(e){return Dn(e)?(e.nodeName||"").toLowerCase():"#document"}function de(e){var s;return(e==null||(s=e.ownerDocument)==null?void 0:s.defaultView)||window}function Ce(e){var s;return(s=(Dn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:s.documentElement}function Dn(e){return Qt()?e instanceof Node||e instanceof de(e).Node:!1}function ve(e){return Qt()?e instanceof Element||e instanceof de(e).Element:!1}function Le(e){return Qt()?e instanceof HTMLElement||e instanceof de(e).HTMLElement:!1}function sn(e){return!Qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof de(e).ShadowRoot}function Nt(e){const{overflow:s,overflowX:n,overflowY:i,display:r}=be(e);return/auto|scroll|overlay|hidden|clip/.test(s+i+n)&&r!=="inline"&&r!=="contents"}function ba(e){return/^(table|td|th)$/.test(dt(e))}function es(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ja=/transform|translate|scale|rotate|perspective|filter/,wa=/paint|layout|strict|content/,Xe=e=>!!e&&e!=="none";let us;function Ps(e){const s=ve(e)?be(e):e;return Xe(s.transform)||Xe(s.translate)||Xe(s.scale)||Xe(s.rotate)||Xe(s.perspective)||!zs()&&(Xe(s.backdropFilter)||Xe(s.filter))||ja.test(s.willChange||"")||wa.test(s.contain||"")}function Na(e){let s=We(e);for(;Le(s)&&!ot(s);){if(Ps(s))return s;if(es(s))return null;s=We(s)}return null}function zs(){return us==null&&(us=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),us}function ot(e){return/^(html|body|#document)$/.test(dt(e))}function be(e){return de(e).getComputedStyle(e)}function ts(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function We(e){if(dt(e)==="html")return e;const s=e.assignedSlot||e.parentNode||sn(e)&&e.host||Ce(e);return sn(s)?s.host:s}function In(e){const s=We(e);return ot(s)?e.ownerDocument?e.ownerDocument.body:e.body:Le(s)&&Nt(s)?s:In(s)}function jt(e,s,n){var i;s===void 0&&(s=[]),n===void 0&&(n=!0);const r=In(e),a=r===((i=e.ownerDocument)==null?void 0:i.body),c=de(r);if(a){const l=Ss(c);return s.concat(c,c.visualViewport||[],Nt(r)?r:[],l&&n?jt(l):[])}else return s.concat(r,jt(r,[],n))}function Ss(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mn(e){const s=be(e);let n=parseFloat(s.width)||0,i=parseFloat(s.height)||0;const r=Le(e),a=r?e.offsetWidth:n,c=r?e.offsetHeight:i,l=qt(n)!==a||qt(i)!==c;return l&&(n=a,i=c),{width:n,height:i,$:l}}function Fs(e){return ve(e)?e:e.contextElement}function at(e){const s=Fs(e);if(!Le(s))return Ne(1);const n=s.getBoundingClientRect(),{width:i,height:r,$:a}=Mn(s);let c=(a?qt(n.width):n.width)/i,l=(a?qt(n.height):n.height)/r;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}const Ca=Ne(0);function Ln(e){const s=de(e);return!zs()||!s.visualViewport?Ca:{x:s.visualViewport.offsetLeft,y:s.visualViewport.offsetTop}}function Sa(e,s,n){return s===void 0&&(s=!1),!n||s&&n!==de(e)?!1:s}function Ge(e,s,n,i){s===void 0&&(s=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=Fs(e);let c=Ne(1);s&&(i?ve(i)&&(c=at(i)):c=at(e));const l=Sa(a,n,i)?Ln(a):Ne(0);let o=(r.left+l.x)/c.x,u=(r.top+l.y)/c.y,m=r.width/c.x,h=r.height/c.y;if(a){const p=de(a),g=i&&ve(i)?de(i):i;let b=p,x=Ss(b);for(;x&&i&&g!==b;){const y=at(x),S=x.getBoundingClientRect(),C=be(x),w=S.left+(x.clientLeft+parseFloat(C.paddingLeft))*y.x,j=S.top+(x.clientTop+parseFloat(C.paddingTop))*y.y;o*=y.x,u*=y.y,m*=y.x,h*=y.y,o+=w,u+=j,b=de(x),x=Ss(b)}}return Kt({width:m,height:h,x:o,y:u})}function ss(e,s){const n=ts(e).scrollLeft;return s?s.left+n:Ge(Ce(e)).left+n}function _n(e,s){const n=e.getBoundingClientRect(),i=n.left+s.scrollLeft-ss(e,n),r=n.top+s.scrollTop;return{x:i,y:r}}function ka(e){let{elements:s,rect:n,offsetParent:i,strategy:r}=e;const a=r==="fixed",c=Ce(i),l=s?es(s.floating):!1;if(i===c||l&&a)return n;let o={scrollLeft:0,scrollTop:0},u=Ne(1);const m=Ne(0),h=Le(i);if((h||!h&&!a)&&((dt(i)!=="body"||Nt(c))&&(o=ts(i)),h)){const g=Ge(i);u=at(i),m.x=g.x+i.clientLeft,m.y=g.y+i.clientTop}const p=c&&!h&&!a?_n(c,o):Ne(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-o.scrollLeft*u.x+m.x+p.x,y:n.y*u.y-o.scrollTop*u.y+m.y+p.y}}function Aa(e){return Array.from(e.getClientRects())}function Ra(e){const s=Ce(e),n=ts(e),i=e.ownerDocument.body,r=le(s.scrollWidth,s.clientWidth,i.scrollWidth,i.clientWidth),a=le(s.scrollHeight,s.clientHeight,i.scrollHeight,i.clientHeight);let c=-n.scrollLeft+ss(e);const l=-n.scrollTop;return be(i).direction==="rtl"&&(c+=le(s.clientWidth,i.clientWidth)-r),{width:r,height:a,x:c,y:l}}const nn=25;function Ea(e,s){const n=de(e),i=Ce(e),r=n.visualViewport;let a=i.clientWidth,c=i.clientHeight,l=0,o=0;if(r){a=r.width,c=r.height;const m=zs();(!m||m&&s==="fixed")&&(l=r.offsetLeft,o=r.offsetTop)}const u=ss(i);if(u<=0){const m=i.ownerDocument,h=m.body,p=getComputedStyle(h),g=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(i.clientWidth-h.clientWidth-g);b<=nn&&(a-=b)}else u<=nn&&(a+=u);return{width:a,height:c,x:l,y:o}}function $a(e,s){const n=Ge(e,!0,s==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,a=Le(e)?at(e):Ne(1),c=e.clientWidth*a.x,l=e.clientHeight*a.y,o=r*a.x,u=i*a.y;return{width:c,height:l,x:o,y:u}}function rn(e,s,n){let i;if(s==="viewport")i=Ea(e,n);else if(s==="document")i=Ra(Ce(e));else if(ve(s))i=$a(s,n);else{const r=Ln(e);i={x:s.x-r.x,y:s.y-r.y,width:s.width,height:s.height}}return Kt(i)}function On(e,s){const n=We(e);return n===s||!ve(n)||ot(n)?!1:be(n).position==="fixed"||On(n,s)}function Ta(e,s){const n=s.get(e);if(n)return n;let i=jt(e,[],!1).filter(l=>ve(l)&&dt(l)!=="body"),r=null;const a=be(e).position==="fixed";let c=a?We(e):e;for(;ve(c)&&!ot(c);){const l=be(c),o=Ps(c);!o&&l.position==="fixed"&&(r=null),(a?!o&&!r:!o&&l.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Nt(c)&&!o&&On(e,c))?i=i.filter(m=>m!==c):r=l,c=We(c)}return s.set(e,i),i}function Da(e){let{element:s,boundary:n,rootBoundary:i,strategy:r}=e;const c=[...n==="clippingAncestors"?es(s)?[]:Ta(s,this._c):[].concat(n),i],l=rn(s,c[0],r);let o=l.top,u=l.right,m=l.bottom,h=l.left;for(let p=1;p<c.length;p++){const g=rn(s,c[p],r);o=le(g.top,o),u=Ue(g.right,u),m=Ue(g.bottom,m),h=le(g.left,h)}return{width:u-h,height:m-o,x:h,y:o}}function Ia(e){const{width:s,height:n}=Mn(e);return{width:s,height:n}}function Ma(e,s,n){const i=Le(s),r=Ce(s),a=n==="fixed",c=Ge(e,!0,a,s);let l={scrollLeft:0,scrollTop:0};const o=Ne(0);function u(){o.x=ss(r)}if(i||!i&&!a)if((dt(s)!=="body"||Nt(r))&&(l=ts(s)),i){const g=Ge(s,!0,a,s);o.x=g.x+s.clientLeft,o.y=g.y+s.clientTop}else r&&u();a&&!i&&r&&u();const m=r&&!i&&!a?_n(r,l):Ne(0),h=c.left+l.scrollLeft-o.x-m.x,p=c.top+l.scrollTop-o.y-m.y;return{x:h,y:p,width:c.width,height:c.height}}function ms(e){return be(e).position==="static"}function an(e,s){if(!Le(e)||be(e).position==="fixed")return null;if(s)return s(e);let n=e.offsetParent;return Ce(e)===n&&(n=n.ownerDocument.body),n}function Pn(e,s){const n=de(e);if(es(e))return n;if(!Le(e)){let r=We(e);for(;r&&!ot(r);){if(ve(r)&&!ms(r))return r;r=We(r)}return n}let i=an(e,s);for(;i&&ba(i)&&ms(i);)i=an(i,s);return i&&ot(i)&&ms(i)&&!Ps(i)?n:i||Na(e)||n}const La=async function(e){const s=this.getOffsetParent||Pn,n=this.getDimensions,i=await n(e.floating);return{reference:Ma(e.reference,await s(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function _a(e){return be(e).direction==="rtl"}const Oa={convertOffsetParentRelativeRectToViewportRelativeRect:ka,getDocumentElement:Ce,getClippingRect:Da,getOffsetParent:Pn,getElementRects:La,getClientRects:Aa,getDimensions:Ia,getScale:at,isElement:ve,isRTL:_a};function zn(e,s){return e.x===s.x&&e.y===s.y&&e.width===s.width&&e.height===s.height}function Pa(e,s){let n=null,i;const r=Ce(e);function a(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function c(l,o){l===void 0&&(l=!1),o===void 0&&(o=1),a();const u=e.getBoundingClientRect(),{left:m,top:h,width:p,height:g}=u;if(l||s(),!p||!g)return;const b=Pt(h),x=Pt(r.clientWidth-(m+p)),y=Pt(r.clientHeight-(h+g)),S=Pt(m),w={rootMargin:-b+"px "+-x+"px "+-y+"px "+-S+"px",threshold:le(0,Ue(1,o))||1};let j=!0;function T(E){const L=E[0].intersectionRatio;if(L!==o){if(!j)return c();L?c(!1,L):i=setTimeout(()=>{c(!1,1e-7)},1e3)}L===1&&!zn(u,e.getBoundingClientRect())&&c(),j=!1}try{n=new IntersectionObserver(T,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(T,w)}n.observe(e)}return c(!0),a}function za(e,s,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:o=!1}=i,u=Fs(e),m=r||a?[...u?jt(u):[],...s?jt(s):[]]:[];m.forEach(S=>{r&&S.addEventListener("scroll",n,{passive:!0}),a&&S.addEventListener("resize",n)});const h=u&&l?Pa(u,n):null;let p=-1,g=null;c&&(g=new ResizeObserver(S=>{let[C]=S;C&&C.target===u&&g&&s&&(g.unobserve(s),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(s)})),n()}),u&&!o&&g.observe(u),s&&g.observe(s));let b,x=o?Ge(e):null;o&&y();function y(){const S=Ge(e);x&&!zn(x,S)&&n(),x=S,b=requestAnimationFrame(y)}return n(),()=>{var S;m.forEach(C=>{r&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),h==null||h(),(S=g)==null||S.disconnect(),g=null,o&&cancelAnimationFrame(b)}}const Fa=ga,Ba=xa,Ua=fa,Wa=va,Ha=ha,on=ma,Va=ya,qa=(e,s,n)=>{const i=new Map,r={platform:Oa,...n},a={...r.platform,_c:i};return ua(e,s,{...r,platform:a})};var Xa=typeof document<"u",Ka=function(){},Wt=Xa?d.useLayoutEffect:Ka;function Gt(e,s){if(e===s)return!0;if(typeof e!=typeof s)return!1;if(typeof e=="function"&&e.toString()===s.toString())return!0;let n,i,r;if(e&&s&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==s.length)return!1;for(i=n;i--!==0;)if(!Gt(e[i],s[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(s).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(s,r[i]))return!1;for(i=n;i--!==0;){const a=r[i];if(!(a==="_owner"&&e.$$typeof)&&!Gt(e[a],s[a]))return!1}return!0}return e!==e&&s!==s}function Fn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cn(e,s){const n=Fn(e);return Math.round(s*n)/n}function fs(e){const s=d.useRef(e);return Wt(()=>{s.current=e}),s}function Ga(e){e===void 0&&(e={});const{placement:s="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:a,floating:c}={},transform:l=!0,whileElementsMounted:o,open:u}=e,[m,h]=d.useState({x:0,y:0,strategy:n,placement:s,middlewareData:{},isPositioned:!1}),[p,g]=d.useState(i);Gt(p,i)||g(i);const[b,x]=d.useState(null),[y,S]=d.useState(null),C=d.useCallback(A=>{A!==E.current&&(E.current=A,x(A))},[]),w=d.useCallback(A=>{A!==L.current&&(L.current=A,S(A))},[]),j=a||b,T=c||y,E=d.useRef(null),L=d.useRef(null),$=d.useRef(m),X=o!=null,M=fs(o),F=fs(r),P=fs(u),G=d.useCallback(()=>{if(!E.current||!L.current)return;const A={placement:s,strategy:n,middleware:p};F.current&&(A.platform=F.current),qa(E.current,L.current,A).then(J=>{const R={...J,isPositioned:P.current!==!1};V.current&&!Gt($.current,R)&&($.current=R,jn.flushSync(()=>{h(R)}))})},[p,s,n,F,P]);Wt(()=>{u===!1&&$.current.isPositioned&&($.current.isPositioned=!1,h(A=>({...A,isPositioned:!1})))},[u]);const V=d.useRef(!1);Wt(()=>(V.current=!0,()=>{V.current=!1}),[]),Wt(()=>{if(j&&(E.current=j),T&&(L.current=T),j&&T){if(M.current)return M.current(j,T,G);G()}},[j,T,G,M,X]);const ee=d.useMemo(()=>({reference:E,floating:L,setReference:C,setFloating:w}),[C,w]),B=d.useMemo(()=>({reference:j,floating:T}),[j,T]),O=d.useMemo(()=>{const A={position:n,left:0,top:0};if(!B.floating)return A;const J=cn(B.floating,m.x),R=cn(B.floating,m.y);return l?{...A,transform:"translate("+J+"px, "+R+"px)",...Fn(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:R}},[n,l,B.floating,m.x,m.y]);return d.useMemo(()=>({...m,update:G,refs:ee,elements:B,floatingStyles:O}),[m,G,ee,B,O])}const Ya=e=>{function s(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&s(i)?i.current!=null?on({element:i.current,padding:r}).fn(n):{}:i?on({element:i,padding:r}).fn(n):{}}}},Za=(e,s)=>{const n=Fa(e);return{name:n.name,fn:n.fn,options:[e,s]}},Ja=(e,s)=>{const n=Ba(e);return{name:n.name,fn:n.fn,options:[e,s]}},Qa=(e,s)=>({fn:Va(e).fn,options:[e,s]}),eo=(e,s)=>{const n=Ua(e);return{name:n.name,fn:n.fn,options:[e,s]}},to=(e,s)=>{const n=Wa(e);return{name:n.name,fn:n.fn,options:[e,s]}},so=(e,s)=>{const n=Ha(e);return{name:n.name,fn:n.fn,options:[e,s]}},no=(e,s)=>{const n=Ya(e);return{name:n.name,fn:n.fn,options:[e,s]}};var io="Arrow",Bn=d.forwardRef((e,s)=>{const{children:n,width:i=10,height:r=5,...a}=e;return t.jsx(wt.svg,{...a,ref:s,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});Bn.displayName=io;var ro=Bn;function ao(e){const[s,n]=d.useState(void 0);return Vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let c,l;if("borderBoxSize"in a){const o=a.borderBoxSize,u=Array.isArray(o)?o[0]:o;c=u.inlineSize,l=u.blockSize}else c=e.offsetWidth,l=e.offsetHeight;n({width:c,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),s}var Bs="Popper",[Un]=Is(Bs),[oo,Wn]=Un(Bs),Hn=e=>{const{__scopePopper:s,children:n}=e,[i,r]=d.useState(null);return t.jsx(oo,{scope:s,anchor:i,onAnchorChange:r,children:n})};Hn.displayName=Bs;var Vn="PopperAnchor",qn=d.forwardRef((e,s)=>{const{__scopePopper:n,virtualRef:i,...r}=e,a=Wn(Vn,n),c=d.useRef(null),l=bt(s,c),o=d.useRef(null);return d.useEffect(()=>{const u=o.current;o.current=(i==null?void 0:i.current)||c.current,u!==o.current&&a.onAnchorChange(o.current)}),i?null:t.jsx(wt.div,{...r,ref:l})});qn.displayName=Vn;var Us="PopperContent",[co,lo]=Un(Us),Xn=d.forwardRef((e,s)=>{var z,Z,ne,ie,_e,ge;const{__scopePopper:n,side:i="bottom",sideOffset:r=0,align:a="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:o=!0,collisionBoundary:u=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:b,...x}=e,y=Wn(Us,n),[S,C]=d.useState(null),w=bt(s,ae=>C(ae)),[j,T]=d.useState(null),E=ao(j),L=(E==null?void 0:E.width)??0,$=(E==null?void 0:E.height)??0,X=i+(a!=="center"?"-"+a:""),M=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},F=Array.isArray(u)?u:[u],P=F.length>0,G={padding:M,boundary:F.filter(fo),altBoundary:P},{refs:V,floatingStyles:ee,placement:B,isPositioned:O,middlewareData:A}=Ga({strategy:"fixed",placement:X,whileElementsMounted:(...ae)=>za(...ae,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[Za({mainAxis:r+$,alignmentAxis:c}),o&&Ja({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Qa():void 0,...G}),o&&eo({...G}),to({...G,apply:({elements:ae,rects:ke,availableWidth:Ve,availableHeight:Ye})=>{const{width:Ae,height:Ze}=ke.reference,Oe=ae.floating.style;Oe.setProperty("--radix-popper-available-width",`${Ve}px`),Oe.setProperty("--radix-popper-available-height",`${Ye}px`),Oe.setProperty("--radix-popper-anchor-width",`${Ae}px`),Oe.setProperty("--radix-popper-anchor-height",`${Ze}px`)}}),j&&no({element:j,padding:l}),ho({arrowWidth:L,arrowHeight:$}),p&&so({strategy:"referenceHidden",...G})]}),[J,R]=Gn(B),oe=Sn(b);Vt(()=>{O&&(oe==null||oe())},[O,oe]);const He=(z=A.arrow)==null?void 0:z.x,Se=(Z=A.arrow)==null?void 0:Z.y,ue=((ne=A.arrow)==null?void 0:ne.centerOffset)!==0,[pe,se]=d.useState();return Vt(()=>{S&&se(window.getComputedStyle(S).zIndex)},[S]),t.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:O?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(ie=A.transformOrigin)==null?void 0:ie.x,(_e=A.transformOrigin)==null?void 0:_e.y].join(" "),...((ge=A.hide)==null?void 0:ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(co,{scope:n,placedSide:J,onArrowChange:T,arrowX:He,arrowY:Se,shouldHideArrow:ue,children:t.jsx(wt.div,{"data-side":J,"data-align":R,...x,ref:w,style:{...x.style,animation:O?void 0:"none"}})})})});Xn.displayName=Us;var Kn="PopperArrow",uo={top:"bottom",right:"left",bottom:"top",left:"right"},mo=d.forwardRef(function(s,n){const{__scopePopper:i,...r}=s,a=lo(Kn,i),c=uo[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(ro,{...r,ref:n,style:{...r.style,display:"block"}})})});mo.displayName=Kn;function fo(e){return e!==null}var ho=e=>({name:"transformOrigin",options:e,fn(s){var y,S,C;const{placement:n,rects:i,middlewareData:r}=s,c=((y=r.arrow)==null?void 0:y.centerOffset)!==0,l=c?0:e.arrowWidth,o=c?0:e.arrowHeight,[u,m]=Gn(n),h={start:"0%",center:"50%",end:"100%"}[m],p=(((S=r.arrow)==null?void 0:S.x)??0)+l/2,g=(((C=r.arrow)==null?void 0:C.y)??0)+o/2;let b="",x="";return u==="bottom"?(b=c?h:`${p}px`,x=`${-o}px`):u==="top"?(b=c?h:`${p}px`,x=`${i.floating.height+o}px`):u==="right"?(b=`${-o}px`,x=c?h:`${g}px`):u==="left"&&(b=`${i.floating.width+o}px`,x=c?h:`${g}px`),{data:{x:b,y:x}}}});function Gn(e){const[s,n="center"]=e.split("-");return[s,n]}var po=Hn,go=qn,xo=Xn,yo=Symbol.for("react.lazy"),Yt=hi[" use ".trim().toString()];function vo(e){return typeof e=="object"&&e!==null&&"then"in e}function Yn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===yo&&"_payload"in e&&vo(e._payload)}function bo(e){const s=jo(e),n=d.forwardRef((i,r)=>{let{children:a,...c}=i;Yn(a)&&typeof Yt=="function"&&(a=Yt(a._payload));const l=d.Children.toArray(a),o=l.find(No);if(o){const u=o.props.children,m=l.map(h=>h===o?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return t.jsx(s,{...c,ref:r,children:d.isValidElement(u)?d.cloneElement(u,void 0,m):null})}return t.jsx(s,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function jo(e){const s=d.forwardRef((n,i)=>{let{children:r,...a}=n;if(Yn(r)&&typeof Yt=="function"&&(r=Yt(r._payload)),d.isValidElement(r)){const c=So(r),l=Co(a,r.props);return r.type!==d.Fragment&&(l.ref=i?Ni(i,c):c),d.cloneElement(r,l)}return d.Children.count(r)>1?d.Children.only(null):null});return s.displayName=`${e}.SlotClone`,s}var wo=Symbol("radix.slottable");function No(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wo}function Co(e,s){const n={...s};for(const i in s){const r=e[i],a=s[i];/^on[A-Z]/.test(i)?r&&a?n[i]=(...l)=>{const o=a(...l);return r(...l),o}:r&&(n[i]=r):i==="style"?n[i]={...r,...a}:i==="className"&&(n[i]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function So(e){var i,r;let s=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=s&&"isReactWarning"in s&&s.isReactWarning;return n?e.ref:(s=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=s&&"isReactWarning"in s&&s.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ko=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ao=ko.reduce((e,s)=>{const n=bo(`Primitive.${s}`),i=d.forwardRef((r,a)=>{const{asChild:c,...l}=r,o=c?n:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(o,{...l,ref:a})});return i.displayName=`Primitive.${s}`,{...e,[s]:i}},{}),Ro="Portal",Zn=d.forwardRef((e,s)=>{var l;const{container:n,...i}=e,[r,a]=d.useState(!1);Vt(()=>a(!0),[]);const c=n||r&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return c?pi.createPortal(t.jsx(Ao.div,{...i,ref:s}),c):null});Zn.displayName=Ro;const Jn=({open:e,onClose:s,anchorRef:n,placement:i="bottom-end",children:r})=>{const a=d.useRef(null);if(d.useEffect(()=>{if(!e)return;const u=m=>{var h,p;e&&((h=a.current)!=null&&h.contains(m.target)||(p=n.current)!=null&&p.contains(m.target)||s())};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[e,s,n]),!e)return null;const c=i.startsWith("top")?"top":"bottom",l=i.endsWith("end")?"end":"start",o=i.startsWith("top")?8:4;return t.jsxs(po,{children:[t.jsx(go,{virtualRef:n}),t.jsx(Zn,{children:t.jsx(Ci,{onEscapeKeyDown:u=>{u.preventDefault(),s()},onPointerDownOutside:u=>{var m;if((m=n.current)!=null&&m.contains(u.target)){u.preventDefault();return}s()},children:t.jsx(xo,{ref:a,side:c,align:l,sideOffset:o,className:`popover popover-${i}`,role:"dialog",children:r})})})]})};function Eo(e){const s=e+"CollectionProvider",[n,i]=Is(s),[r,a]=n(s,{collectionRef:{current:null},itemMap:new Map}),c=x=>{const{scope:y,children:S}=x,C=ye.useRef(null),w=ye.useRef(new Map).current;return t.jsx(r,{scope:y,itemMap:w,collectionRef:C,children:S})};c.displayName=s;const l=e+"CollectionSlot",o=Xs(l),u=ye.forwardRef((x,y)=>{const{scope:S,children:C}=x,w=a(l,S),j=bt(y,w.collectionRef);return t.jsx(o,{ref:j,children:C})});u.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",p=Xs(m),g=ye.forwardRef((x,y)=>{const{scope:S,children:C,...w}=x,j=ye.useRef(null),T=bt(y,j),E=a(m,S);return ye.useEffect(()=>(E.itemMap.set(j,{ref:j,...w}),()=>void E.itemMap.delete(j))),t.jsx(p,{[h]:"",ref:T,children:C})});g.displayName=m;function b(x){const y=a(e+"CollectionConsumer",x);return ye.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const w=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((E,L)=>w.indexOf(E.ref.current)-w.indexOf(L.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:c,Slot:u,ItemSlot:g},b,i]}var $o=d.createContext(void 0);function To(e){const s=d.useContext($o);return e||s||"ltr"}var hs="rovingFocusGroup.onEntryFocus",Do={bubbles:!1,cancelable:!0},Ct="RovingFocusGroup",[ks,Qn,Io]=Eo(Ct),[Mo]=Is(Ct,[Io]),[Lo,_o]=Mo(Ct),ei=d.forwardRef((e,s)=>t.jsx(ks.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(ks.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Oo,{...e,ref:s})})}));ei.displayName=Ct;var Oo=d.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:n,orientation:i,loop:r=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:o,onEntryFocus:u,preventScrollOnEntryFocus:m=!1,...h}=e,p=d.useRef(null),g=bt(s,p),b=To(a),[x,y]=ki({prop:c,defaultProp:l??null,onChange:o,caller:Ct}),[S,C]=d.useState(!1),w=Sn(u),j=Qn(n),T=d.useRef(!1),[E,L]=d.useState(0);return d.useEffect(()=>{const $=p.current;if($)return $.addEventListener(hs,w),()=>$.removeEventListener(hs,w)},[w]),t.jsx(Lo,{scope:n,orientation:i,dir:b,loop:r,currentTabStopId:x,onItemFocus:d.useCallback($=>y($),[y]),onItemShiftTab:d.useCallback(()=>C(!0),[]),onFocusableItemAdd:d.useCallback(()=>L($=>$+1),[]),onFocusableItemRemove:d.useCallback(()=>L($=>$-1),[]),children:t.jsx(wt.div,{tabIndex:S||E===0?-1:0,"data-orientation":i,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:rt(e.onMouseDown,()=>{T.current=!0}),onFocus:rt(e.onFocus,$=>{const X=!T.current;if($.target===$.currentTarget&&X&&!S){const M=new CustomEvent(hs,Do);if($.currentTarget.dispatchEvent(M),!M.defaultPrevented){const F=j().filter(B=>B.focusable),P=F.find(B=>B.active),G=F.find(B=>B.id===x),ee=[P,G,...F].filter(Boolean).map(B=>B.ref.current);ni(ee,m)}}T.current=!1}),onBlur:rt(e.onBlur,()=>C(!1))})})}),ti="RovingFocusGroupItem",si=d.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:r=!1,tabStopId:a,children:c,...l}=e,o=Si(),u=a||o,m=_o(ti,n),h=m.currentTabStopId===u,p=Qn(n),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:x}=m;return d.useEffect(()=>{if(i)return g(),()=>b()},[i,g,b]),t.jsx(ks.ItemSlot,{scope:n,id:u,focusable:i,active:r,children:t.jsx(wt.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...l,ref:s,onMouseDown:rt(e.onMouseDown,y=>{i?m.onItemFocus(u):y.preventDefault()}),onFocus:rt(e.onFocus,()=>m.onItemFocus(u)),onKeyDown:rt(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){m.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=Fo(y,m.orientation,m.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=p().filter(j=>j.focusable).map(j=>j.ref.current);if(S==="last")w.reverse();else if(S==="prev"||S==="next"){S==="prev"&&w.reverse();const j=w.indexOf(y.currentTarget);w=m.loop?Bo(w,j+1):w.slice(j+1)}setTimeout(()=>ni(w))}}),children:typeof c=="function"?c({isCurrentTabStop:h,hasTabStop:x!=null}):c})})});si.displayName=ti;var Po={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zo(e,s){return s!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Fo(e,s,n){const i=zo(e.key,n);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Po[i]}function ni(e,s=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:s}),document.activeElement!==n))return}function Bo(e,s){return e.map((n,i)=>e[(s+i)%e.length])}var Uo=ei,Wo=si;const Fe=({icon:e,children:s,onClick:n,danger:i,disabled:r,checked:a,note:c,trailing:l})=>t.jsx(Wo,{asChild:!0,focusable:!r,active:!1,children:t.jsxs("button",{type:"button",role:a===void 0?"menuitem":"menuitemradio","aria-checked":a,className:`menu-item${i?" menu-item-danger":""}`,onClick:n,disabled:r,children:[a!==void 0&&t.jsx("span",{className:"menu-item-check","aria-hidden":"true",children:a&&t.jsx(yt,{size:12})}),e&&t.jsx("span",{className:"menu-item-icon",children:e}),t.jsxs("span",{className:"menu-item-label",children:[s,c&&t.jsx("span",{className:"menu-item-note",children:c})]}),l!==void 0&&t.jsx("span",{className:"menu-item-trailing",children:l})]})}),Ho=()=>t.jsx("div",{className:"menu-divider",role:"separator"}),ii=({children:e})=>t.jsx(Uo,{asChild:!0,orientation:"vertical",loop:!0,children:t.jsx("div",{className:"menu",role:"menu",children:e})}),Vo=[{label:"1 Hour",value:"1h"},{label:"2 Hours",value:"2h"},{label:"4 Hours",value:"4h"},{label:"8 Hours",value:"8h"}],qo=({device:e,onClose:s,onReserved:n})=>{const[i,r]=d.useState(""),[a,c]=d.useState("1h"),[l,o]=d.useState(""),[u,m]=d.useState(!1),[h,p]=d.useState(null),[g,b]=d.useState(null),x=async()=>{if(!i.trim()){p("Please enter your name/ID");return}m(!0),p(null),b(null);try{const y=await H.reserveDevice(e.udid,e.host,i,a,l);y.success?(n(),s()):b(y.error||"Failed to reserve device")}catch(y){b(y.message||"An unexpected error occurred")}finally{m(!1)}};return t.jsx(kn,{open:!0,onClose:s,width:520,title:t.jsxs(t.Fragment,{children:[t.jsx(Qi,{size:16,className:"title-icon"}),"Reserve device"]}),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn-cancel",onClick:s,disabled:u,children:"Cancel"}),t.jsx("button",{className:"btn-reserve",onClick:x,disabled:u||!i.trim(),children:u?"Reserving...":"Confirm Reservation"})]}),children:t.jsxs("div",{className:"reservation-modal-body",children:[t.jsxs("div",{className:"device-id-badge",children:[t.jsx("span",{className:"label",children:"Device:"}),t.jsx("span",{className:"value",children:e.udid})]}),t.jsxs("p",{children:["Reserve ",t.jsx("strong",{children:e.name||e.udid})," for exclusive use. This will prevent CI sessions from using this device."]}),t.jsx(Bt,{label:t.jsxs(t.Fragment,{children:[t.jsx(gi,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--color-accent)"}}),"Reserved by"]}),htmlFor:"reservation-reserved-by",error:h?t.jsxs(t.Fragment,{children:[t.jsx(qs,{size:14,style:{marginRight:6,verticalAlign:"middle"}}),h]}):void 0,children:t.jsx("input",{id:"reservation-reserved-by",type:"text",className:"reservation-input",placeholder:"Enter your name or ID",value:i,onChange:y=>{r(y.target.value),h&&p(null)},disabled:u})}),t.jsx(Bt,{label:t.jsxs(t.Fragment,{children:[t.jsx(Ai,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--color-accent)"}}),"Duration"]}),children:t.jsx("div",{className:"duration-selector",children:Vo.map(y=>t.jsx("div",{className:`duration-option ${a===y.value?"active":""}`,onClick:()=>c(y.value),children:y.label},y.value))})}),t.jsx(Bt,{label:t.jsxs(t.Fragment,{children:[t.jsx(wr,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--color-accent)"}}),"Reason (optional)"]}),htmlFor:"reservation-reason",error:g?t.jsxs(t.Fragment,{children:[t.jsx(qs,{size:14,style:{marginRight:6,verticalAlign:"middle"}}),g]}):void 0,children:t.jsx("input",{id:"reservation-reason",type:"text",className:"reservation-input",placeholder:"e.g., Debugging flaky login test",value:l,onChange:y=>o(y.target.value),disabled:u})})]})})},Xo=({device:e,onClose:s,onUpdated:n})=>{const{toast:i}=Zt(),[r,a]=d.useState(e.tags||[]),[c,l]=d.useState(""),[o,u]=d.useState(!1),m=d.useRef(null);d.useEffect(()=>{m.current&&m.current.focus()},[]);const h=()=>{const x=c.trim();x&&!r.includes(x)&&(a([...r,x]),l(""))},p=x=>{a(r.filter(y=>y!==x))},g=x=>{x.key==="Enter"&&h()},b=async()=>{u(!0);try{await H.updateDeviceTags(e.udid,e.host,r),n(),s()}catch(x){console.error("Failed to update tags",x),i("Error saving tags. Please try again.","error")}finally{u(!1)}};return t.jsx(kn,{open:!0,onClose:s,width:520,title:t.jsxs(t.Fragment,{children:[t.jsx(Br,{size:16,className:"title-icon"}),"Manage device tags"]}),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn-cancel",onClick:s,children:"Cancel"}),t.jsx("button",{className:"btn-save",onClick:b,disabled:o,children:o?"Saving...":"Apply Changes"})]}),children:t.jsxs("div",{className:"tag-modal-body",children:[t.jsxs("div",{className:"device-id-badge",children:[t.jsx("span",{className:"label",children:"Device:"}),t.jsx("span",{className:"value",children:e.udid})]}),t.jsx(Bt,{label:"Add new tag",description:"Press Enter to add multiple tags",htmlFor:"tag-input",children:t.jsxs("div",{className:"input-with-button",children:[t.jsx("input",{ref:m,id:"tag-input",type:"text",placeholder:"e.g. stable, team-a, ios-17",value:c,onChange:x=>l(x.target.value),onKeyDown:g}),t.jsx("button",{className:"add-inline-btn",onClick:h,disabled:!c.trim(),children:t.jsx(An,{size:16})})]})}),t.jsxs("div",{className:"tags-display-section",children:[t.jsx("label",{children:"Current Tags"}),t.jsx("div",{className:"tags-list",children:r.length>0?r.map(x=>t.jsxs("div",{className:"tag-pill-editable",children:[x,t.jsx("button",{className:"remove-tag",onClick:()=>p(x),children:t.jsx($s,{size:12})})]},x)):t.jsx("div",{className:"empty-tags",children:"No tags assigned to this device."})})]})]})})};function Ko(e){return e>=50?"ready":e>=20?"warning":"error"}function Go(e){return e>=50?t.jsx(Gi,{size:10}):e>=20?t.jsx(Vi,{size:10}):t.jsx(Xi,{size:10})}function Yo(e){return e==="Normal"?"ready":e==="Critical"?"error":"warning"}const Zo=({device:e})=>{if(e.deviceType==="emulator"||e.deviceType==="simulator"||e.offline)return null;const n=typeof e.batteryLevel=="number",i=typeof e.thermalStatus=="string"&&e.thermalStatus.length>0&&e.thermalStatus!=="Unknown";return!n&&!i?t.jsx("div",{className:"dc2-health",children:t.jsxs(Ft,{tone:"neutral",title:"Device does not report battery or thermal data",children:[t.jsx(Ri,{size:10}),"No telemetry"]})}):t.jsxs("div",{className:"dc2-health",children:[n&&t.jsxs(Ft,{tone:Ko(e.batteryLevel),title:`Battery ${e.batteryLevel}%`,children:[Go(e.batteryLevel),e.batteryLevel,"%"]}),i&&t.jsxs(Ft,{tone:Yo(e.thermalStatus),title:`Thermal: ${e.thermalStatus}`,children:[t.jsx(qr,{size:10}),e.thermalStatus]})]})},Jo="/wd/hub";function Qo(e){return e==="android"?"UiAutomator2":"XCUITest"}function ec(e){return e==="android"?"Android":e==="tvos"?"tvOS":"iOS"}function tc(e,s=Jo){if(!e)return"—";try{const n=new URL(e.includes("://")?e:`http://${e}`),i=s.startsWith("/")?s:`/${s}`,r=n.pathname.replace(/\/$/,"");return r===i||r.endsWith(i)?`${n.protocol}//${n.host}${r}`:`${n.protocol}//${n.host}${i}`}catch{return e}}function sc(e){const s={platformName:ec(e.platform),"appium:automationName":Qo(e.platform),"appium:udid":e.udid};return e.sdk&&e.sdk!=="Unknown"&&e.sdk!=="unknown"&&(s["appium:platformVersion"]=e.sdk),e.name&&(s["appium:deviceName"]=e.name),s}function nc(e){return JSON.stringify(sc(e),null,2)}const ic=/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i,rc=/^(?:\d{1,3}\.){3}\d{1,3}$/;function ac(e){const s=e.trim();return!s||ic.test(s)||!rc.test(s)?!1:s.split(".").every(n=>{const i=Number(n);return Number.isInteger(i)&&i>=0&&i<=255})}function oc(e){return e.ip&&ac(e.ip)?e.ip.trim():null}function cc(e){if(typeof e!="number")throw new TypeError("Expected a number");const s=e>0?Math.floor:Math.ceil;return{days:s(e/864e5),hours:s(e/36e5)%24,minutes:s(e/6e4)%60,seconds:s(e/1e3)%60,milliseconds:s(e)%1e3,microseconds:s(e*1e3)%1e3,nanoseconds:s(e*1e6)%1e3}}const lc=(e,s)=>s===1?e:`${e}s`,dc=1e-7;function ri(e,s={}){if(!Number.isFinite(e))throw new TypeError("Expected a finite number");s.colonNotation&&(s.compact=!1,s.formatSubMilliseconds=!1,s.separateMilliseconds=!1,s.verbose=!1),s.compact&&(s.secondsDecimalDigits=0,s.millisecondsDecimalDigits=0);const n=[],i=(c,l)=>{const o=Math.floor(c*10**l+dc);return(Math.round(o)/10**l).toFixed(l)},r=(c,l,o,u)=>{if((n.length===0||!s.colonNotation)&&c===0&&!(s.colonNotation&&o==="m"))return;u=(u||c||"0").toString();let m,h;if(s.colonNotation){m=n.length>0?":":"",h="";const p=u.includes(".")?u.split(".")[0].length:u.length,g=n.length>0?2:1;u="0".repeat(Math.max(0,g-p))+u}else m="",h=s.verbose?" "+lc(l,c):o;n.push(m+u+h)},a=cc(e);if(r(Math.trunc(a.days/365),"year","y"),r(a.days%365,"day","d"),r(a.hours,"hour","h"),r(a.minutes,"minute","m"),s.separateMilliseconds||s.formatSubMilliseconds||!s.colonNotation&&e<1e3)if(r(a.seconds,"second","s"),s.formatSubMilliseconds)r(a.milliseconds,"millisecond","ms"),r(a.microseconds,"microsecond","µs"),r(a.nanoseconds,"nanosecond","ns");else{const c=a.milliseconds+a.microseconds/1e3+a.nanoseconds/1e6,l=typeof s.millisecondsDecimalDigits=="number"?s.millisecondsDecimalDigits:0,o=c>=1?Math.round(c):Math.ceil(c),u=l?c.toFixed(l):o;r(Number.parseFloat(u),"millisecond","ms",u)}else{const c=e/1e3%60,l=typeof s.secondsDecimalDigits=="number"?s.secondsDecimalDigits:1,o=i(c,l),u=s.keepDecimalsOnWholeSeconds?o:o.replace(/\.0+$/,"");r(Number.parseFloat(u),"second","s",u)}if(n.length===0)return"0"+(s.verbose?" milliseconds":"ms");if(s.compact)return n[0];if(typeof s.unitCount=="number"){const c=s.colonNotation?"":" ";return n.slice(0,Math.max(s.unitCount,1)).join(c)}return s.colonNotation?n.join(""):n.join(" ")}const ps=6e4;function uc(e){return!Number.isFinite(e)||e<=0?"expiring":e<ps?"under 1m":ri(Math.floor(e/ps)*ps,{unitCount:2})}const mc=["ready","busy","reserved","maintenance","offline"];function Ws(e,s){return e.offline?"offline":e.userBlocked?"maintenance":e.busy?"busy":e.reservedUntil&&s<e.reservedUntil?"reserved":"ready"}function ai(e,s){if(!e.busy||!e.session_id)return null;const n=String(e.session_id);return n.startsWith("manual_")?s!=null&&s.userId&&n===`manual_${s.userId}_${e.udid}`?"self":"other":"session"}const ln=e=>(e==null?void 0:e.role)==="ADMIN"||(e==null?void 0:e.role)==="SUPER_ADMIN";function fc(e,s,n){switch(ai(e,s)){case"session":return e.sessionStartTime&&e.sessionStartTime>0&&n>e.sessionStartTime?`Test session · ${ri(n-e.sessionStartTime,{compact:!0})}`:"Test session running";case"self":return"Live control by you";case"other":return"Live control by another user"}if(e.reservedUntil&&n<e.reservedUntil){const r=!!e.reservedBy&&(e.reservedBy===(s==null?void 0:s.email)||e.reservedBy===(s==null?void 0:s.name))?"you":e.reservedBy||"another user";return`${uc(e.reservedUntil-n)} left · by ${r}`}return null}function hc(e,s){if(e.offline)return{enabled:!1,reason:"Device is offline"};if(e.userBlocked&&!ln(s))return{enabled:!1,reason:"In maintenance"};const n=ai(e,s);return n==="session"?{enabled:!1,reason:"A test is running"}:n==="other"&&!ln(s)?{enabled:!1,reason:"Another user has control"}:{enabled:!0}}function oi(e){var s;return((s=e.marketingName)==null?void 0:s.trim())||e.name}function pc(e){const s=[Ms(e.platform),e.sdk].filter(Boolean).join(" ");if(e.deviceType==="emulator")return`Emulator · ${s}`;if(e.deviceType==="simulator")return`Simulator · ${s}`;const i=[e.manufacturer?e.manufacturer.charAt(0).toUpperCase()+e.manufacturer.slice(1):"",e.model].filter(Boolean).join(" ");return i?`${i} · ${s}`:s}function gc(e){return e.formFactor==="tablet"||e.formFactor==="tv"?e.formFactor:"phone"}const xc={ready:"Ready",busy:"Busy",reserved:"Reserved",maintenance:"Maintenance",offline:"Offline"},yc=({device:e})=>{const s={phone:bs,tablet:Ei,tv:yi}[gc(e)],n=e.deviceType==="emulator"||e.deviceType==="simulator";return t.jsx(s,{size:26,strokeWidth:1.5,strokeDasharray:n?"3 2":void 0})},vc=({udid:e,currentTeamId:s,teams:n,onDone:i})=>{const{toast:r}=Zt(),[a,c]=d.useState(!1);async function l(o){c(!0);try{await H.setDeviceTeam(e,o),r(o?"Device assigned":"Device returned to shared pool","success"),i(!0)}catch(u){r((u==null?void 0:u.message)||"Failed to update team","error")}finally{c(!1)}}return t.jsxs(Jt,{selectSize:"sm",autoFocus:!0,"aria-label":"Team",disabled:a,defaultValue:s??"",onBlur:()=>i(!1),onChange:o=>l(o.target.value||null),children:[t.jsx("option",{value:"",children:"(Shared pool)"}),Array.from(n.entries()).map(([o,u])=>t.jsx("option",{value:o,children:u},o))]})},bc=({device:e,reloadDevices:s,navigate:n,teams:i})=>{var V,ee,B;const[r,a]=d.useState(!1),[c,l]=d.useState(!1),[o,u]=d.useState(!1),[m,h]=d.useState(!1),p=d.useRef(null),{me:g}=xi(),{toast:b}=Zt(),x=(g==null?void 0:g.role)==="ADMIN"||(g==null?void 0:g.role)==="SUPER_ADMIN",y=Date.now(),S=Ws(e,y),C=S==="reserved",w=fc(e,g,y),j=hc(e,g),T=`dc2-reason-${e.udid}`,E=oi(e),L=e.teamId?(i==null?void 0:i.get(e.teamId))??e.teamName??`Team ${e.teamId.slice(0,6)}`:null,$=tc(e.host),X=oc(e),M=async(O,A)=>{var J;try{await((J=navigator.clipboard)==null?void 0:J.writeText(O)),b(A,"success")}catch{b("Failed to copy","error")}},F=async()=>{await H.releaseReservation(e.udid,e.host),s()},P=async()=>{await H.blockDevice(e.udid,e.host),s()},G=async()=>{await H.unblockDevice(e.udid,e.host),s()};return t.jsxs("div",{className:`dc2 dc2-${S}`,children:[t.jsxs("div",{className:`dc2-band dc2-band-${S}`,children:[t.jsxs("span",{className:"dc2-band-label",children:[t.jsx("span",{className:"dc2-band-dot","aria-hidden":!0}),xc[S]]}),w&&t.jsx("span",{className:"dc2-band-activity",title:w,children:w})]}),t.jsxs("div",{className:`dc2-body${S==="offline"?" dc2-dim":""}`,children:[t.jsxs("div",{className:"dc2-head",children:[t.jsx("div",{className:"dc2-icon","aria-hidden":!0,children:t.jsx(yc,{device:e})}),t.jsxs("div",{className:"dc2-id",children:[t.jsx("div",{className:"dc2-title",title:`${E}
|
|
187
|
-
${e.udid}`,children:E}),t.jsx("div",{className:"dc2-subtitle",children:pc(e)})]})]}),t.jsxs("div",{className:"dc2-meta",children:[t.jsx(Zo,{device:e}),o?t.jsx(vc,{udid:e.udid,currentTeamId:e.teamId??null,teams:i??new Map,onDone:O=>{u(!1),O&&s()}}):L&&t.jsx(Ft,{tone:"accent",title:`Team: ${L}`,children:L}),(V=e.tags)==null?void 0:V.slice(0,2).map(O=>t.jsxs("span",{className:"dc2-tag",title:O,children:["#",O]},O)),(((ee=e.tags)==null?void 0:ee.length)||0)>2&&t.jsxs("span",{className:"dc2-tag",children:["+",(((B=e.tags)==null?void 0:B.length)||0)-2]})]})]}),t.jsxs("div",{className:"dc2-foot",children:[t.jsx(Ke,{variant:"tonal",size:"sm",disabled:!j.enabled,"aria-describedby":j.enabled?void 0:T,onClick:()=>{j.enabled&&n(`/devices/${e.udid}/control`)},children:"Control"}),C?t.jsx(Ke,{variant:"secondary",size:"sm",onClick:F,children:"Release"}):S==="ready"?t.jsx(Ke,{variant:"secondary",size:"sm",onClick:()=>a(!0),children:"Reserve"}):null,!j.enabled&&t.jsx("span",{id:T,className:"dc2-unavailable",title:j.reason,children:j.reason}),t.jsx("span",{className:"dc2-spacer"}),t.jsx("button",{ref:p,type:"button",className:"dc2-more",onClick:()=>h(O=>!O),"aria-label":"More actions",children:t.jsx(mr,{size:14})}),t.jsx(Jn,{open:m,onClose:()=>h(!1),anchorRef:p,children:t.jsxs(ii,{children:[t.jsx(Fe,{icon:t.jsx(Be,{size:12}),onClick:()=>{h(!1),M(e.udid,"UDID copied")},children:"Copy UDID"}),$!=="—"&&t.jsx(Fe,{icon:t.jsx(Be,{size:12}),onClick:()=>{h(!1),M($,"Server URL copied")},children:"Copy server URL"}),X&&t.jsx(Fe,{icon:t.jsx(Be,{size:12}),onClick:()=>{h(!1),M(X,"IP address copied")},children:"Copy IP address"}),t.jsx(Fe,{icon:t.jsx(Be,{size:12}),onClick:()=>{h(!1),M(nc(e),"Session capabilities copied")},children:"Copy capabilities"}),x&&t.jsxs(t.Fragment,{children:[t.jsx(Ho,{}),t.jsx(Fe,{onClick:()=>{h(!1),l(!0)},children:"Manage tags…"}),t.jsx(Fe,{onClick:()=>{h(!1),u(!0)},children:"Assign team…"}),t.jsx(Fe,{onClick:()=>{h(!1),e.userBlocked?G():P()},children:e.userBlocked?"Exit maintenance":"Enter maintenance"})]})]})})]}),r&&t.jsx(qo,{device:e,onClose:()=>a(!1),onReserved:()=>s()}),c&&t.jsx(Xo,{device:e,onClose:()=>l(!1),onUpdated:()=>s()})]})};function jc(e){const s=Ts(),{search:n}=Ds();return t.jsx(bc,{device:e.device,reloadDevices:e.reloadDevices,navigate:i=>s(`${i}${n}`),teams:e.teams})}class wc extends ye.Component{constructor(){super(...arguments),this.state={teamsMap:new Map}}componentDidMount(){H.listTeams().then(s=>{this.setState({teamsMap:new Map(s.map(n=>[n.id,n.name]))})}).catch(()=>{})}render(){return t.jsx("div",{className:"device-explorer-card-container",children:ye.Children.toArray(this.props.devices.map(s=>t.jsx(jc,{device:s,reloadDevices:this.props.reloadDevices,teams:this.state.teamsMap})))})}}var zt,Nc=new Uint8Array(16);function Cc(){if(!zt&&(zt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!zt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return zt(Nc)}const Sc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function kc(e){return typeof e=="string"&&Sc.test(e)}var re=[];for(var gs=0;gs<256;++gs)re.push((gs+256).toString(16).substr(1));function Ac(e){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(re[e[s+0]]+re[e[s+1]]+re[e[s+2]]+re[e[s+3]]+"-"+re[e[s+4]]+re[e[s+5]]+"-"+re[e[s+6]]+re[e[s+7]]+"-"+re[e[s+8]]+re[e[s+9]]+"-"+re[e[s+10]]+re[e[s+11]]+re[e[s+12]]+re[e[s+13]]+re[e[s+14]]+re[e[s+15]]).toLowerCase();if(!kc(n))throw TypeError("Stringified UUID is invalid");return n}function Rc(e,s,n){e=e||{};var i=e.random||(e.rng||Cc)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Ac(i)}const Ec=({onCommand:e,prompt:s="$",welcomeMessage:n="Interactive Shell (Restricted Mode)",platform:i})=>{const[r,a]=d.useState([{type:"system",content:n,timestamp:Date.now()},{type:"system",content:'Type "help" for allowed commands.',timestamp:Date.now()}]),[c,l]=d.useState(""),[o,u]=d.useState([]),[m,h]=d.useState(-1),[p,g]=d.useState(!1),b=d.useRef(null),x=d.useRef(null);d.useEffect(()=>{b.current&&(b.current.scrollTop=b.current.scrollHeight)},[r]);const y=C=>{const w=C.trim();if((w.startsWith("{")||w.startsWith("["))&&(w.endsWith("}")||w.endsWith("]")))try{const j=JSON.parse(w);return JSON.stringify(j,null,2)}catch{}return C},S=async C=>{if(C.key==="Enter"&&!p){const w=c.trim();if(!w)return;if(l(""),a(j=>[...j,{type:"command",content:`${s} ${w}`,timestamp:Date.now()}]),u(j=>[...j,w]),h(-1),g(!0),w==="clear"){a([]),g(!1);return}if(w==="help"){let j="";i==="android"?j=`
|
|
188
|
-
Android Allowed Commands:
|
|
189
|
-
• System Info: getprop, ip addr, date, uptime, cat /proc/meminfo, cat /proc/cpuinfo
|
|
190
|
-
• Process Mgmt: ps, top
|
|
191
|
-
• File System: ls
|
|
192
|
-
• Diagnostics: dumpsys [battery|wifi|power]
|
|
193
|
-
• Packages: pm list packages
|
|
194
|
-
`:(i==="ios"||i==="tvos")&&(j=`
|
|
195
|
-
iOS Allowed Commands:
|
|
196
|
-
• Real Device (go-ios):
|
|
197
|
-
apps, info, list, syslog, deviceinfo, diagnostics
|
|
198
|
-
• Simulator (xcrun simctl):
|
|
199
|
-
listapps, get_app_container, list, getenv
|
|
200
|
-
• Simulator System:
|
|
201
|
-
ls, ps, top, date, uptime, whoami
|
|
202
|
-
`),a(T=>[...T,{type:"output",content:j.trim(),timestamp:Date.now()}]),g(!1);return}try{const j=await e(w),T=y(j||"(No output)");a(E=>[...E,{type:"output",content:T,timestamp:Date.now()}])}catch(j){a(T=>[...T,{type:"error",content:j.message||"Unknown error",timestamp:Date.now()}])}finally{g(!1),setTimeout(()=>{var j;return(j=x.current)==null?void 0:j.focus()},10)}}else if(C.key==="ArrowUp"){if(C.preventDefault(),o.length>0){const w=m===-1?o.length-1:Math.max(0,m-1);h(w),l(o[w])}}else if(C.key==="ArrowDown"&&(C.preventDefault(),m!==-1)){const w=m+1;w>=o.length?(h(-1),l("")):(h(w),l(o[w]))}};return t.jsxs("div",{className:"terminal-container theme-dark",children:[t.jsx("div",{className:"scanline",style:{position:"absolute",inset:0,pointerEvents:"none",opacity:.05,zIndex:1001}}),t.jsxs("header",{className:"terminal-header",children:[t.jsxs("div",{className:"terminal-controls",children:[t.jsx("div",{className:"dot red"}),t.jsx("div",{className:"dot yellow"}),t.jsx("div",{className:"dot green"})]}),t.jsxs("div",{className:"terminal-title",children:[Ms(i)," shell"]}),t.jsx("div",{className:"terminal-actions",children:t.jsx("button",{className:"terminal-action-btn",onClick:()=>a([]),title:"Clear terminal",children:"CLEAR"})})]}),t.jsxs("div",{className:"terminal-history",ref:b,onClick:()=>{var C;return(C=x.current)==null?void 0:C.focus()},children:[r.map((C,w)=>t.jsx("div",{className:`terminal-line ${C.type}`,children:C.content},w)),p&&t.jsx("div",{className:"terminal-line system animate-pulse",children:"Executing command..."})]}),t.jsxs("div",{className:"terminal-input-area",children:[t.jsx("span",{className:"terminal-prompt",children:s}),t.jsx("input",{ref:x,className:"terminal-input",value:c,onChange:C=>l(C.target.value),onKeyDown:S,disabled:p,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"Type a command..."})]})]})};function Me(e,s){var n;s(e),(n=e.children)==null||n.forEach(i=>Me(i,s))}function Te(e,...s){var n;for(const i of s){const r=(n=e.attributes)==null?void 0:n[i];if(r!=null&&r!=="")return String(r)}}function ct(e){var s;return((s=e.type)==null?void 0:s.split(".").pop())||e.type||""}function $c(e,s){const n=[];return Me(e,i=>{Te(i,"content-desc","contentDescription","accessibilityId","name","label")===s&&n.push(i)}),n}function Tc(e,s){const n=[];return Me(e,i=>{Te(i,"resource-id","resourceId","identifier")===s&&n.push(i)}),n}function As(e,s){const n=[];return Me(e,i=>{(i.type===s||ct(i)===s)&&n.push(i)}),n}function Dc(e,s){const n=[];return Me(e,i=>{Te(i,"name")===s&&n.push(i)}),n}function Ic(e){const s=/^\/\/(\*|[A-Za-z_][\w.-]*)\[@([\w-]+)=(["'])(.*?)\3\]$/.exec(e.trim());return s?{tag:s[1]==="*"?null:s[1],attrKey:s[2],attrValue:s[4]}:null}function Mc(e,s){const n=s.split("/").filter(Boolean);if(n.length===0)return null;const i=[];for(const a of n){const c=/^([A-Za-z_][\w.-]*)\[(\d+)\]$/.exec(a);if(!c)return null;i.push({type:c[1],index:parseInt(c[2],10)})}if(i[0].type!==e.type&&i[0].type!==ct(e)||i[0].index!==1)return null;let r=e;for(let a=1;a<i.length&&r;a++){const{type:c,index:l}=i[a];let o=0,u;for(const m of r.children||[])if((m.type===c||ct(m)===c)&&(o+=1,o===l)){u=m;break}r=u}return r?[r]:[]}function Lc(e,s){const n=Mc(e,s);if(n!==null)return{kind:"matched",nodes:n};const i=Ic(s);if(i){const r=[];return Me(e,a=>{if(i.tag&&a.type!==i.tag&&ct(a)!==i.tag)return;Te(a,i.attrKey)===i.attrValue&&r.push(a)}),{kind:"matched",nodes:r}}return{kind:"unsupported",nodes:[],reason:"Complex XPath (axes, multiple predicates, functions) — use a real driver to verify"}}function _c(e,s){const n=s.trim(),i=/^\*\*\/([A-Za-z_]\w*)\[`(\w+)\s*==\s*"([^"]*)"`\]$/.exec(n);if(i){const[,c,l,o]=i,u=[];return Me(e,m=>{if(m.type!==c&&ct(m)!==c)return;Te(m,l)===o&&u.push(m)}),{kind:"matched",nodes:u}}const r=/^\*\*\/([A-Za-z_]\w*)\[(\d+)\]$/.exec(n);if(r){const[,c,l]=r,o=parseInt(l,10),u=[];return Me(e,m=>{(m.type===c||ct(m)===c)&&u.push(m)}),{kind:"matched",nodes:u[o-1]?[u[o-1]]:[]}}const a=/^\*\*\/([A-Za-z_]\w*)$/.exec(n);return a?As(e,a[1]).length>0?{kind:"matched",nodes:As(e,a[1])}:{kind:"matched",nodes:[]}:{kind:"unsupported",nodes:[],reason:"Multi-segment class chain — use a real driver to verify"}}function Oc(e,s){const i=s.trim().split(/\s+AND\s+/i).map(c=>c.trim()),r=[];for(const c of i){const l=/^(\w+)\s*==\s*"([^"]*)"$/.exec(c);if(!l)return{kind:"unsupported",nodes:[],reason:"Predicate uses unsupported operator (only ==, AND) — use a real driver"};r.push({key:l[1],value:l[2]})}const a=[];return Me(e,c=>{for(const l of r){let o;if(l.key==="type"?o=c.type:l.key==="label"?o=Te(c,"label")??c.label:l.key==="name"?o=Te(c,"name")??c.name:l.key==="value"?o=Te(c,"value")??c.value:o=Te(c,l.key),o!==l.value)return}a.push(c)}),{kind:"matched",nodes:a}}function Pc(e,s,n){const i=s.toLowerCase();if(!n)return{kind:"matched",nodes:[]};switch(i){case"accessibility id":return{kind:"matched",nodes:$c(e,n)};case"id":return{kind:"matched",nodes:Tc(e,n)};case"class name":return{kind:"matched",nodes:As(e,n)};case"name":return{kind:"matched",nodes:Dc(e,n)};case"xpath":return Lc(e,n);case"-ios class chain":return _c(e,n);case"-ios predicate string":return Oc(e,n);default:return{kind:"unsupported",nodes:[],reason:`Strategy "${s}" not yet supported by snapshot matcher`}}}function dn(e,s){const n=e.toLowerCase();if(n==="accessibility id")return/[0-9a-f]{8}-[0-9a-f]{4}/i.test(s)?{level:"fragile",reason:"UUID in accessibility ID — dynamically generated, unreliable"}:{level:"stable",reason:"#1 recommended by Appium — portable across Android & iOS"};if(n==="id")return/[0-9a-f]{8}-[0-9a-f]{4}/i.test(s)?{level:"fragile",reason:"UUID in resource ID — dynamically generated"}:/\d{6,}/.test(s)&&!s.includes(":id/")?{level:"moderate",reason:"Long numeric ID without package prefix — may not be unique"}:/^[a-z][a-z0-9.]+:id\//.test(s)?{level:"stable",reason:"Android resource-id with package prefix — #2 by Appium priority"}:{level:"stable",reason:"Element ID — #2 by Appium 2.x recommended priority"};if(n==="xpath"){if(s.startsWith("/hierarchy")||s.startsWith("/")&&!s.startsWith("//"))return{level:"very-fragile",reason:"ABSOLUTE XPath — breaks on any layout change. Avoid entirely"};if(/\[\d+\]/.test(s))return{level:"very-fragile",reason:"Index-based XPath [n] — breaks when element order changes"};const i=(s.match(/\//g)||[]).length;return i>7?{level:"fragile",reason:`${i}-level deep XPath — brittle to layout changes, 10x slower on iOS`}:s.includes("@content-desc")||s.includes("@resource-id")||s.includes("@text")?{level:"moderate",reason:"XPath with semantic attribute — more stable, but still prefer ID/accessibility id"}:{level:"fragile",reason:"XPath is a LAST RESORT per Appium docs — 10x slower on iOS, breaks on UI changes"}}return n==="-ios predicate string"?{level:"stable",reason:"iOS NSPredicate — native engine, excellent performance on iOS"}:n==="-ios class chain"?{level:"stable",reason:"iOS Class Chain — native iOS, faster than XPath"}:n==="-android uiautomator"?s.includes("resourceId")||s.includes("description")?{level:"stable",reason:"UIAutomator2 with resourceId/description — Android native, very reliable"}:s.includes("textContains")||s.includes("text(")?{level:"moderate",reason:"UIAutomator2 with text matching — breaks if copy changes"}:{level:"stable",reason:"UIAutomator2 — Android native engine, preferred over XPath on Android"}:n==="class name"?{level:"fragile",reason:"Class name alone is almost never unique — use with explicit index or prefer accessibility id"}:n==="name"?{level:"fragile",reason:"⚠️ Deprecated in Appium 2.x — replace with accessibility id or id"}:n==="link text"?{level:"moderate",reason:"Text-based locator — breaks if copy/label changes"}:{level:"moderate",reason:"Verify reliability for your target platform"}}function un(e,s,n,i){var C,w,j,T,E,L,$;const{strategy:r,value:a}=i,c=(e.text||e.name||((C=e.type)==null?void 0:C.split(".").pop())||"element").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/,"").slice(0,24)||"element",l=c.charAt(0).toLowerCase()+c.slice(1),o=((w=e.type)==null?void 0:w.toLowerCase().includes("edit"))||((j=e.type)==null?void 0:j.toLowerCase().includes("input"))||((T=e.type)==null?void 0:T.toLowerCase().includes("field"))||((E=e.type)==null?void 0:E.toLowerCase().includes("textfield")),u=((L=e.attributes)==null?void 0:L.scrollable)==="true"||(($=e.attributes)==null?void 0:$.scrollable)===!0,m=r.toLowerCase().startsWith("-ios")&&s!=="ios"?`// ⚠️ -ios predicate/class chain ONLY work with XCUITest (iOS)
|
|
203
|
-
`:r.toLowerCase().startsWith("-android")&&s!=="android"?`// ⚠️ -android uiautomator ONLY works with UIAutomator2 (Android)
|
|
204
|
-
`:"",h={"accessibility id":`~${a}`,id:s==="ios"?`-ios predicate string:label == "${a}"`:`android=new UiSelector().resourceId("${a}")`,xpath:`${a}`,"-ios predicate string":`-ios predicate string:${a}`,"-ios class chain":`-ios class chain:${a}`,"-android uiautomator":`android=${a}`},p={"accessibility id":`AppiumBy.accessibilityId("${a}")`,id:`AppiumBy.id("${a}")`,xpath:`AppiumBy.xpath("${a}")`,"-ios predicate string":`AppiumBy.iOSNsPredicateString("${a}")`,"-ios class chain":`AppiumBy.iOSClassChain("${a}")`,"-android uiautomator":`AppiumBy.androidUIAutomator("${a}")`,"class name":`AppiumBy.className("${a}")`},g={"accessibility id":`AppiumBy.ACCESSIBILITY_ID, "${a}"`,id:`AppiumBy.ID, "${a}"`,xpath:`AppiumBy.XPATH, "${a}"`,"-ios predicate string":`AppiumBy.IOS_PREDICATE, "${a}"`,"-ios class chain":`AppiumBy.IOS_CLASS_CHAIN, "${a}"`,"-android uiautomator":`AppiumBy.ANDROID_UIAUTOMATOR, '${a}'`,"class name":`AppiumBy.CLASS_NAME, "${a}"`},b=p[r.toLowerCase()],x=g[r.toLowerCase()],y=h[r.toLowerCase()];return n==="java"?b?`${m}// Appium Java Client 9.x + Selenium 4 + TestNG
|
|
205
|
-
import io.appium.java_client.AppiumBy;
|
|
206
|
-
import io.appium.java_client.${s==="android"?"AndroidDriver":s==="ios"?"IOSDriver":"AppiumDriver"};
|
|
207
|
-
import org.openqa.selenium.WebElement;
|
|
208
|
-
import org.testng.annotations.Test;
|
|
209
|
-
|
|
210
|
-
@Test
|
|
211
|
-
public void test_${l}() {
|
|
212
|
-
WebElement element = driver.findElement(${b});
|
|
213
|
-
${u?'((Scrollable) element).scrollTo("target text");':o?`element.clear();
|
|
214
|
-
element.sendKeys("your text here");`:"element.click();"}
|
|
215
|
-
// Add assertions here via TestNG Assert or Hamcrest
|
|
216
|
-
}`:`// Strategy "${r}" not supported in Appium Java Client`:n==="python"?x?`${m}# Appium Python Client 4.x + pytest
|
|
217
|
-
from appium.webdriver.common.appiumby import AppiumBy
|
|
218
|
-
import pytest
|
|
219
|
-
|
|
220
|
-
def test_${l}(self):
|
|
221
|
-
element = self.driver.find_element(${x})
|
|
222
|
-
${o?`element.clear()
|
|
223
|
-
element.send_keys("your text here")`:"element.click()"}
|
|
224
|
-
# Add assertions here via assert or pytest.assert`:`# Strategy "${r}" not supported in Appium Python Client`:n==="javascript"?y?`${m}// WebdriverIO 9.x + @wdio/appium-service
|
|
225
|
-
describe('${l} test', () => {
|
|
226
|
-
it('should interact with ${l}', async () => {
|
|
227
|
-
const element = await $('${y}');
|
|
228
|
-
await element.waitForDisplayed({ timeout: 5000 });
|
|
229
|
-
${o?`await element.clearValue();
|
|
230
|
-
await element.addValue("your text here");`:"await element.click();"}
|
|
231
|
-
// Add assertions here via expect(element)
|
|
232
|
-
});
|
|
233
|
-
});`:`// Strategy "${r}" not supported in WebdriverIO mobile`:y?`${m}// WebdriverIO 9.x standalone
|
|
234
|
-
const element = await driver.$('${y}');
|
|
235
|
-
await element.waitForExist({ timeout: 5000 });
|
|
236
|
-
${o?`await driver.$('target').clearValue();
|
|
237
|
-
await element.addValue("your text here");`:"await element.click();"}
|
|
238
|
-
// Assert with expect(element).toBeDisplayed()`:`// Strategy "${r}" not supported in WebdriverIO mobile`}function mn(e){var g,b,x,y,S,C,w,j,T,E,L;const s=(e.type||"").toLowerCase(),n=((g=e.attributes)==null?void 0:g.clickable)==="true"||((b=e.attributes)==null?void 0:b.clickable)===!0,i=((x=e.attributes)==null?void 0:x.enabled)!=="false"&&((y=e.attributes)==null?void 0:y.enabled)!==!1,r=((S=e.attributes)==null?void 0:S.scrollable)==="true"||((C=e.attributes)==null?void 0:C.scrollable)===!0,a=e.text||e.label||e.value||"",c=((w=e.children)==null?void 0:w.length)||0;let l="Element",o="📦";s.includes("button")||s.includes("btn")||n&&c===0?(l="Button",o="🔘"):s.includes("edit")||s.includes("input")||s.includes("field")?(l="Text Input",o="✏️"):s.includes("image")||s.includes("img")||s.includes("imageview")?(l="Image",o="🖼️"):s.includes("scroll")||s.includes("recyclerview")||s.includes("listview")||r?(l="Scrollable List",o="📜"):s.includes("text")||s.includes("label")?(l="Text Label",o="📝"):s.includes("switch")||s.includes("toggle")||s.includes("checkbox")?(l="Toggle / Checkbox",o="☑️"):s.includes("nav")||s.includes("toolbar")||s.includes("tabbar")?(l="Navigation Bar",o="🧭"):c>0&&(l=`Container (${c} children)`,o="🗂️");const u=((j=e.suggestedLocators)==null?void 0:j.find($=>$.strategy==="accessibility id"||$.strategy==="id"))||((T=e.suggestedLocators)==null?void 0:T[0]),m=i?((E=e.rect)==null?void 0:E.width)===0||((L=e.rect)==null?void 0:L.height)===0?"⚠️ Zero-size element — may not be interactable":void 0:"⚠️ Element is disabled",h=a?` with text "${a.slice(0,30)}"`:"",p=`This is a ${l.toLowerCase()}${h}. ${n?"It can be tapped/clicked.":r?"It supports scrolling.":"It is a visual container."}${c>0?` Contains ${c} child element${c>1?"s":""}.`:""}`;return{role:l,description:p,interactable:n||i,bestLocator:u,warning:m,emoji:o}}function fn(e,s){if(!s)return!0;const n=s.toLowerCase().trim(),i={button:["button","btn","clickable","tapable"],input:["edittext","input","field","textfield","textinput","edit"],image:["image","imageview","img","picture","photo","icon"],text:["textview","label","text","statictext"],list:["listview","recyclerview","scrollview","tableview","collectionview","scroll"],toggle:["switch","checkbox","toggle","radiobutton"],nav:["toolbar","navigationbar","tabbar","actionbar","navbar"]},r=(e.type||"").toLowerCase(),a=(e.text||e.label||e.value||"").toLowerCase(),c=(e.name||"").toLowerCase(),l=Object.values(e.attributes||{}).join(" ").toLowerCase();for(const[o,u]of Object.entries(i))if(n.includes(o)&&u.some(m=>r.includes(m)))return!0;return r.includes(n)||a.includes(n)||c.includes(n)||l.includes(n)}const zc=({sessionId:e,udid:s,streamUrl:n,embedded:i=!1,overlayTarget:r=null,onModeChange:a})=>{var Et,$t,Tt,Dt,pt,It,Mt,Lt,gt,_t;const[c,l]=d.useState(!0),[o,u]=d.useState(null),[m,h]=d.useState(null),[p,g]=d.useState(null),[b,x]=d.useState(null),[y,S]=d.useState(new Set(["/"])),[C,w]=d.useState(""),[j,T]=d.useState(null),[E,L]=d.useState("info"),[$,X]=d.useState("java"),[M,F]=d.useState(null),[P,G]=d.useState({width:0,height:0}),[V,ee]=d.useState({width:0,height:0}),[B,O]=d.useState(!1),[A,J]=d.useState("inspect");d.useEffect(()=>{a==null||a(A)},[A,a]);const[R,oe]=d.useState({}),[He,Se]=d.useState({}),[ue,pe]=d.useState(null),[se,z]=d.useState(null),[Z,ne]=d.useState(null),ie=d.useRef(null),_e=d.useRef(null),ge=d.useRef(null),ae=d.useRef(null),ke=d.useCallback(()=>{var Y,te,Q;if(!ie.current)return;const f=ie.current.getBoundingClientRect(),k=f.width,_=f.height,I=(Y=o==null?void 0:o.hierarchy)==null?void 0:Y.rect;let v=((te=o==null?void 0:o.metadata)==null?void 0:te.screenWidth)||P.width||1,N=((Q=o==null?void 0:o.metadata)==null?void 0:Q.screenHeight)||P.height||1;I&&I.width>0&&I.height>0&&(v=I.width,N=I.height);const D=v/N;let U,W;k/_>D?(W=_,U=W*D):(U=k,W=U/D),ee({width:U,height:W})},[o,P]);d.useEffect(()=>(ke(),window.addEventListener("resize",ke),()=>window.removeEventListener("resize",ke)),[ke]),d.useEffect(()=>{s&&Ae()},[s]),d.useEffect(()=>{if(!s)return;let f=!1;return H.getAppiumSession(s).then(k=>{f||z({sessionId:(k==null?void 0:k.sessionId)??null,basePath:(k==null?void 0:k.basePath)??""})}).catch(()=>{f||z({sessionId:null,basePath:""})}),()=>{f=!0}},[s]);const Ve=d.useCallback(async(f,k,_)=>{if(se!=null&&se.sessionId){pe(f);try{const I=await H.verifyLocator(se.basePath,se.sessionId,{strategy:f,selector:k,action:_});Se(v=>({...v,[f]:I}))}catch(I){Se(v=>({...v,[f]:{found:!1,count:0,error:(I==null?void 0:I.message)||String(I)}}))}finally{pe(null)}}},[se]);d.useEffect(()=>{var f;if((f=p==null?void 0:p.suggestedLocators)!=null&&f.length){const k=p.suggestedLocators.find(_=>_.strategy==="accessibility id"||_.strategy==="id")||p.suggestedLocators[0];F(k)}else F(null);oe({}),Se({}),ne(null)},[p]);const Ye=d.useCallback((f,k)=>{if(!(o!=null&&o.hierarchy))return;const _=Pc(o.hierarchy,f,k);oe(I=>({...I,[f]:_})),ne(f)},[o]),Ae=async()=>{if(s){l(!0),h(null);try{const f=await H.getInspectorSnapshot(s);if(!(f!=null&&f.hierarchy)){u(null),h((f==null?void 0:f.error)||"Failed to capture snapshot");return}u(f);const k=new Set(["/"]),_=(I,v)=>{var N;v<3&&(k.add(I.xpath),(N=I.children)==null||N.forEach(D=>_(D,v+1)))};_(f.hierarchy,0),S(k)}catch(f){u(null),h(f.message||"Failed to capture snapshot")}finally{l(!1)}}},Ze=f=>{const{naturalWidth:k,naturalHeight:_}=f.currentTarget;G({width:k,height:_})},Oe=()=>O(!0),ns=f=>{O(!1);const{naturalWidth:k,naturalHeight:_}=f.currentTarget;k>0&&_>0&&G({width:k,height:_})},Re=n&&!B,me=f=>{if(A!=="interact"||!s)return;const k=f.currentTarget.getBoundingClientRect();ae.current={x:f.clientX-k.left,y:f.clientY-k.top,time:Date.now()}},Je=async f=>{var he,Pe,ze;if(A!=="interact"||!s||!ae.current)return;const k=ae.current,_=f.currentTarget.getBoundingClientRect(),I=f.clientX-_.left,v=f.clientY-_.top,N=Date.now()-k.time,D=V.width,U=V.height,W=(he=o==null?void 0:o.hierarchy)==null?void 0:he.rect;let Y=((Pe=o==null?void 0:o.metadata)==null?void 0:Pe.screenWidth)||P.width,te=((ze=o==null?void 0:o.metadata)==null?void 0:ze.screenHeight)||P.height;if(W&&W.width>0&&W.height>0&&(Y=W.width,te=W.height),!Y||!te||D===0||U===0)return;const Q=(st,Vs)=>({x:Math.round(st/D*Y),y:Math.round(Vs/U*te),px:st/D,py:Vs/U}),q=Q(k.x,k.y),fe=Q(I,v),xe=Math.sqrt(Math.pow(I-k.x,2)+Math.pow(v-k.y,2));if(!(q.px<0||q.px>1||q.py<0||q.py>1)){try{N<500&&xe<10?await H.tap(s,q.x,q.y):N>=500&&xe<10?await H.touchAndHold(s,q.x,q.y,N):xe>=10&&await H.swipe(s,q.x,q.y,fe.x,fe.y)}catch(st){console.error("Interaction failed:",st)}ae.current=null}},St=f=>{const k=new Set(y);k.has(f)?k.delete(f):k.add(f),S(k)},Qe=()=>{const f=new Set,k=_=>{var I;f.add(_.xpath),(I=_.children)==null||I.forEach(k)};o!=null&&o.hierarchy&&k(o.hierarchy),S(f)},kt=()=>S(new Set(["/"])),et=(f,k)=>{navigator.clipboard.writeText(f),T(k),setTimeout(()=>T(null),2e3)},je=f=>{var _;let k=1;return(_=f.children)==null||_.forEach(I=>k+=je(I)),k},Ee=f=>{if(!f)return[];const k={},_=I=>{var D;const v=mn(I),N=v.role.replace(/\s*\(.*?\)\s*/,"");k[N]||(k[N]={emoji:v.emoji,count:0}),k[N].count+=1,(D=I.children)==null||D.forEach(_)};return _(f),Object.entries(k).map(([I,v])=>({role:I,emoji:v.emoji,count:v.count})).sort((I,v)=>v.count-I.count)},ut=f=>f.xpath.split("/").filter(Boolean).slice(-3),qe=(f,k=0)=>{var Q,q,fe,xe;if(!f)return null;const _=y.has(f.xpath),I=((Q=f.children)==null?void 0:Q.length)>0,v=(p==null?void 0:p.xpath)===f.xpath,N=(b==null?void 0:b.xpath)===f.xpath,D=((q=f.type)==null?void 0:q.split(".").pop())||"Element",U=f.label||((fe=f.attributes)==null?void 0:fe["content-desc"])||((xe=f.attributes)==null?void 0:xe["resource-id"])||f.name,W=typeof U=="string"&&U&&U!==D&&U!==f.type?U:null,Y=W||D,te=!C||fn(f,C);if(!te&&!I)return null;if(C&&!te){const he=Pe=>{var ze;return fn(Pe,C)?!0:((ze=Pe.children)==null?void 0:ze.some(he))||!1};if(!he(f))return null}return t.jsxs("div",{className:"tree-node",children:[t.jsxs("div",{className:`tree-item ${v?"selected":""} ${N&&!v?"hovered":""}`,onClick:()=>{g(f),L("info")},onMouseEnter:()=>x(f),onMouseLeave:()=>x(null),children:[t.jsx("div",{className:"tree-item-indent",style:{width:`${k*14}px`}}),I?t.jsx("button",{onClick:he=>{he.stopPropagation(),St(f.xpath)},className:"tree-toggle",children:_?t.jsx(Nn,{size:11}):t.jsx(Rn,{size:11})}):t.jsx("span",{className:"tree-toggle-spacer"}),t.jsx(Zi,{size:11,className:"tree-icon"}),t.jsx("span",{className:"tree-label",title:`${D}${W?` — ${W}`:""}`,children:Y}),W&&t.jsx("span",{className:"tree-type-tag",title:D,children:D}),f.text&&t.jsxs("span",{className:"tree-text-preview",children:['"',f.text.slice(0,20),'"']}),I&&t.jsx("span",{className:"tree-badge",children:f.children.length})]}),_&&I&&t.jsx("div",{className:"tree-children",children:f.children.map(he=>qe(he,k+1))})]},f.xpath)},mt=()=>{var I,v,N;const f=(I=o==null?void 0:o.hierarchy)==null?void 0:I.rect;if(f&&f.width>0&&f.height>0)return{w:f.width,h:f.height};const k=((v=o==null?void 0:o.metadata)==null?void 0:v.screenWidth)||P.width,_=((N=o==null?void 0:o.metadata)==null?void 0:N.screenHeight)||P.height;return k>0&&_>0?{w:k,h:_}:null},At=f=>{const k=mt();if(!k)return[];const _=[],{w:I,h:v}=k,N=(D,U)=>{var Y,te,Q;const W=!D.children||D.children.length===0;((Y=D.rect)==null?void 0:Y.width)>0&&((te=D.rect)==null?void 0:te.height)>0&&W&&_.push(t.jsx("div",{className:"omni-hit-area",style:{left:`${D.rect.x/I*100}%`,top:`${D.rect.y/v*100}%`,width:`${D.rect.width/I*100}%`,height:`${D.rect.height/v*100}%`,zIndex:U},onClick:q=>{q.stopPropagation(),g(D),L("info")},onMouseEnter:()=>x(D),onMouseLeave:()=>x(null)},D.xpath)),(Q=D.children)==null||Q.forEach(q=>N(q,U+1))};return o!=null&&o.hierarchy&&N(o.hierarchy,1),_},ft=()=>{var N,D,U;if(!Z||!P.width)return[];const f=R[Z];if(!f||f.kind!=="matched"||f.nodes.length===0)return[];const k=(N=o==null?void 0:o.hierarchy)==null?void 0:N.rect;let _=((D=o==null?void 0:o.metadata)==null?void 0:D.screenWidth)||P.width,I=((U=o==null?void 0:o.metadata)==null?void 0:U.screenHeight)||P.height;k&&k.width>0&&k.height>0&&(_=k.width,I=k.height);const v=f.nodes.length===1?"omni-frame-match unique":"omni-frame-match multi";return f.nodes.filter(W=>W.rect&&W.rect.width>0&&W.rect.height>0).map((W,Y)=>t.jsx("div",{className:v,style:{left:`${W.rect.x/_*100}%`,top:`${W.rect.y/I*100}%`,width:`${W.rect.width/_*100}%`,height:`${W.rect.height/I*100}%`}},`match-${Z}-${Y}`))},$e=(f,k)=>{const _=mt();if(!(f!=null&&f.rect)||!_)return null;const{w:I,h:v}=_;return t.jsx("div",{className:`omni-frame-${k}`,style:{left:`${f.rect.x/I*100}%`,top:`${f.rect.y/v*100}%`,width:`${f.rect.width/I*100}%`,height:`${f.rect.height/v*100}%`}})},tt=o!=null&&o.hierarchy?je(o.hierarchy):0,ce=p?mn(p):null,ht=o!=null&&o.hierarchy&&A==="inspect"?t.jsxs("div",{className:"omni-overlay",children:[At(o.hierarchy),ft(),$e(b,"hover"),$e(p,"select")]}):null,is={stable:{icon:t.jsx(Ot,{size:10}),cls:"stable"},moderate:{icon:t.jsx(it,{size:10}),cls:"moderate"},fragile:{icon:t.jsx(nt,{size:10}),cls:"fragile"},"very-fragile":{icon:t.jsx(nt,{size:10}),cls:"very-fragile"}},Rt=i&&(o!=null&&o.hierarchy)?Ee(o.hierarchy):[];return t.jsxs("div",{className:`omni-inspector-container ${i?"omni-embedded":""}`,children:[i&&r&&ht?jn.createPortal(ht,r):null,t.jsxs("div",{className:"omni-main-content",children:[!i&&t.jsxs("div",{className:"omni-screenshot-panel",children:[t.jsxs("div",{className:"omni-screenshot-header",children:[t.jsxs("div",{className:"omni-header-left",children:[t.jsx("span",{className:"omni-screenshot-title",children:"Device Preview"}),t.jsxs("div",{className:"omni-mode-toggle",children:[t.jsxs("button",{className:`omni-mode-btn ${A==="inspect"?"active":""}`,onClick:()=>J("inspect"),title:"Inspection mode (highlight elements)",children:[t.jsx(Ks,{size:12}),t.jsx("span",{children:"Inspect"})]}),t.jsxs("button",{className:`omni-mode-btn ${A==="interact"?"active":""}`,onClick:()=>J("interact"),title:"Interaction mode (direct control)",children:[t.jsx(Ys,{size:12}),t.jsx("span",{children:"Interact"})]})]})]}),t.jsxs("button",{className:"omni-refresh-btn",onClick:Ae,disabled:c,children:[t.jsx(vt,{size:12,className:c?"animate-spin":""}),c?"Capturing...":"Refresh"]})]}),t.jsxs("div",{className:"omni-screenshot-container",ref:ie,children:[c&&!Re&&t.jsxs("div",{className:"omni-loading-overlay",children:[t.jsx("div",{className:"omni-spinner"}),t.jsx("span",{children:"Capturing screen..."})]}),!o&&!c&&!Re&&t.jsxs("div",{className:"omni-empty-state",children:[t.jsx(ds,{size:40}),t.jsx("span",{children:"Click Refresh to capture"})]}),Re&&t.jsxs("div",{className:`omni-screenshot-wrapper ${A==="interact"?"interactable":""}`,onMouseDown:me,onMouseUp:Je,children:[t.jsx("img",{ref:ge,src:n,onLoad:ns,onError:Oe,className:"omni-screenshot-img",style:A==="interact"?{pointerEvents:"none"}:{},draggable:!1,alt:"Live Device Stream"}),ht]}),!Re&&(o==null?void 0:o.screenshot)&&t.jsxs("div",{className:`omni-screenshot-wrapper ${A==="interact"?"interactable":""}`,onMouseDown:me,onMouseUp:Je,children:[t.jsx("img",{ref:_e,src:`data:image/png;base64,${o.screenshot}`,onLoad:Ze,className:"omni-screenshot-img",style:A==="interact"?{pointerEvents:"none"}:{},draggable:!1}),A==="inspect"&&t.jsxs("div",{className:"omni-overlay",children:[At(o.hierarchy),ft(),$e(b,"hover"),$e(p,"select")]})]})]})]}),t.jsxs("div",{className:"omni-tree-panel",children:[t.jsxs("div",{className:"omni-tree-header",children:[t.jsxs("div",{className:"omni-tree-title",children:[t.jsx(Di,{size:14}),t.jsx("span",{children:"Source"}),tt>0&&t.jsxs("span",{className:"omni-count-badge",children:[tt," elements"]}),(o==null?void 0:o.hierarchySource)&&t.jsx("span",{className:`omni-source-badge ${o.hierarchySource==="appium-session"?"is-session":"is-device"}`,title:o.hierarchySource==="appium-session"?`From Appium session ${o.sessionId} — the same tree the driver resolves locators against`:"Read from the device. No Appium session is driving it.",children:o.hierarchySource==="appium-session"?"Session":"Device"})]}),t.jsxs("div",{className:"omni-tree-actions",children:[t.jsx("button",{onClick:Qe,className:"omni-action-btn",title:"Expand all",children:t.jsx(hr,{size:12})}),t.jsx("button",{onClick:kt,className:"omni-action-btn",title:"Collapse all",children:t.jsx($r,{size:12})}),i&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:()=>J(A==="inspect"?"interact":"inspect"),className:`omni-action-btn ${A==="inspect"?"active":""}`,title:A==="inspect"?"Inspect mode — click the device to select an element":"Interact mode — clicks control the device","aria-pressed":A==="inspect",children:A==="inspect"?t.jsx(Ks,{size:12}):t.jsx(Ys,{size:12})}),t.jsx("button",{onClick:Ae,className:"omni-action-btn",title:c?"Capturing…":"Refresh snapshot",disabled:c,children:t.jsx(vt,{size:12,className:c?"animate-spin":""})})]})]})]}),m&&!c&&t.jsxs("div",{className:"omni-tree-error",role:"alert",children:[t.jsx(nt,{size:12}),t.jsx("span",{children:m}),t.jsx("button",{type:"button",onClick:Ae,className:"omni-tree-error-retry",children:"Retry"})]}),t.jsxs("div",{className:"omni-tree-search",children:[t.jsx(wn,{size:14}),t.jsx("input",{type:"text",placeholder:"Search elements... (try 'login button' or 'text field')",value:C,onChange:f=>w(f.target.value),"aria-label":"Search elements"}),C&&t.jsx("button",{onClick:()=>w(""),className:"omni-clear-btn",children:"×"})]}),C&&t.jsxs("div",{className:"omni-search-hint",children:[t.jsx(ws,{size:10}),' Smart search active — try "button", "input", "image"']}),t.jsx("div",{className:"omni-tree-content",children:o!=null&&o.hierarchy?qe(o.hierarchy):t.jsx("div",{className:"omni-empty-state small",children:t.jsx("span",{children:"No hierarchy loaded"})})})]}),t.jsxs("div",{className:"omni-details-panel",children:[t.jsxs("div",{className:"omni-details-tabs",role:"tablist",children:[t.jsxs("button",{className:`omni-details-tab ${E==="info"?"active":""}`,onClick:()=>L("info"),role:"tab","aria-selected":E==="info",children:[t.jsx(br,{size:12})," ",t.jsx("span",{children:"Info"})]}),t.jsxs("button",{className:`omni-details-tab ${E==="insight"?"active":""}`,onClick:()=>L("insight"),disabled:!p,title:"AI element analysis",role:"tab","aria-selected":E==="insight",children:[t.jsx(gr,{size:12})," ",t.jsx("span",{children:"AI Insight"})]}),t.jsxs("button",{className:`omni-details-tab ${E==="code"?"active":""}`,onClick:()=>L("code"),disabled:!p,title:"Generate test code",role:"tab","aria-selected":E==="code",children:[t.jsx(Gs,{size:12})," ",t.jsx("span",{children:"Code Gen"})]})]}),t.jsx("div",{className:"omni-details-content",children:p?t.jsxs(t.Fragment,{children:[E==="info"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"Element Info"}),t.jsxs("div",{className:"omni-info-table",children:[t.jsxs("div",{className:"omni-info-row",children:[t.jsx("span",{className:"omni-info-key",children:"Type"}),t.jsx("span",{className:"omni-info-value mono",children:p.type})]}),p.text&&t.jsxs("div",{className:"omni-info-row",children:[t.jsx("span",{className:"omni-info-key",children:"Text"}),t.jsx("span",{className:"omni-info-value",children:p.text})]}),t.jsxs("div",{className:"omni-info-row",children:[t.jsx("span",{className:"omni-info-key",children:"Path"}),t.jsx("span",{className:"omni-info-value mono small",children:ut(p).join(" › ")})]})]})]}),t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"Layout"}),t.jsx("div",{className:"omni-layout-grid",children:["x","y","width","height"].map(f=>t.jsxs("div",{className:"omni-layout-item",children:[t.jsx("span",{className:"omni-layout-label",children:f.toUpperCase()}),t.jsx("span",{className:"omni-layout-value",children:p.rect[f]})]},f))})]}),t.jsxs("div",{className:"omni-section",children:[t.jsxs("div",{className:"omni-section-header",children:["Locators",t.jsx("span",{className:"omni-section-badge",children:"Stability Scored"})]}),t.jsxs("div",{className:"omni-locators-list",children:[!((Tt=p.suggestedLocators)!=null&&Tt.length)&&t.jsx("div",{className:"omni-locators-empty",children:p===(o==null?void 0:o.hierarchy)?"This is the XML document root, not a UI element — no Appium locator can select it. Pick a node beneath it.":"No locator could be derived for this node."}),(Dt=p.suggestedLocators)==null?void 0:Dt.map(f=>{const k=dn(f.strategy,f.value),_=is[k.level],I=R[f.strategy];let v=null;return I&&(I.kind==="unsupported"?v=t.jsxs("span",{className:"omni-match-badge unsupported",title:I.reason||"Cannot evaluate without a real driver",children:[t.jsx(rr,{size:10})," preview unavailable"]}):I.nodes.length===0?v=t.jsxs("span",{className:"omni-match-badge zero",title:"No element matches this selector in the current snapshot",children:[t.jsx(nt,{size:10})," 0 matches"]}):I.nodes.length===1?v=t.jsxs("span",{className:"omni-match-badge unique",title:"Selector is unique in the current snapshot",children:[t.jsx(Ot,{size:10})," unique"]}):v=t.jsxs("span",{className:"omni-match-badge multi",title:`${I.nodes.length} elements match — selector is not unique`,children:[t.jsx(it,{size:10})," ",I.nodes.length," matches"]})),t.jsxs("div",{className:`omni-locator-row ${(M==null?void 0:M.strategy)===f.strategy?"selected-for-code":""}`,onClick:()=>F(f),title:"Click to use in Code Generator",children:[t.jsxs("div",{className:"omni-locator-left",children:[t.jsxs("div",{className:"omni-locator-top",children:[t.jsx("span",{className:"omni-locator-strategy",children:f.strategy}),t.jsxs("span",{className:`omni-stability-badge ${_.cls}`,title:k.reason,children:[_.icon,k.level]}),v]}),t.jsx("code",{className:"omni-locator-value",children:f.value}),t.jsx("span",{className:"omni-stability-reason",children:k.reason}),(()=>{const N=He[f.strategy];return N?N.error?t.jsxs("span",{className:"omni-verify-line is-error",children:[t.jsx(nt,{size:10})," Appium error: ",N.error]}):N.found?N.count>1?t.jsxs("span",{className:"omni-verify-line is-warn",children:[t.jsx(it,{size:10})," Ambiguous — Appium found"," ",N.count," elements",N.actionError?` · ${N.actionError}`:""]}):t.jsxs("span",{className:"omni-verify-line is-ok",children:[t.jsx(Ot,{size:10})," Appium found 1 element",N.elapsedMs!=null?` in ${N.elapsedMs}ms`:"",N.actionPerformed&&N.actionPerformed!=="none"?` · ${N.actionPerformed} ok`:"",N.actionError?` · action failed: ${N.actionError}`:""]}):t.jsxs("span",{className:"omni-verify-line is-error",children:[t.jsx(nt,{size:10})," Appium found 0 elements"]}):null})()]}),t.jsxs("div",{className:"omni-locator-actions",children:[t.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),Ye(f.strategy,f.value)},className:`omni-test-btn ${Z===f.strategy?"active":""}`,title:"Test this locator against the current snapshot",children:t.jsx(dr,{size:12})}),t.jsx("button",{type:"button",disabled:!(se!=null&&se.sessionId)||ue===f.strategy,onClick:N=>{N.stopPropagation(),Ve(f.strategy,f.value,"none")},className:"omni-test-btn",title:se!=null&&se.sessionId?"Verify with Appium — does the driver actually find this?":"Needs an active Appium session on this device",children:ue===f.strategy?t.jsx(vt,{size:12,className:"animate-spin"}):t.jsx(Ot,{size:12})}),t.jsx("button",{type:"button",disabled:!(se!=null&&se.sessionId)||ue===f.strategy,onClick:N=>{N.stopPropagation(),Ve(f.strategy,f.value,"tap")},className:"omni-test-btn",title:se!=null&&se.sessionId?"Find with Appium and tap the element it returns":"Needs an active Appium session on this device",children:t.jsx(js,{size:12})}),t.jsx("button",{onClick:N=>{N.stopPropagation(),et(f.value,f.strategy)},className:`omni-copy-btn ${j===f.strategy?"copied":""}`,children:j===f.strategy?t.jsx(yt,{size:12}):t.jsx(Be,{size:12})})]})]},f.strategy)})]})]}),t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"Attributes"}),t.jsx("div",{className:"omni-attributes-table",children:Object.entries(p.attributes||{}).filter(([f,k])=>k!=null&&k!=="").map(([f,k])=>t.jsxs("div",{className:"omni-attr-row",children:[t.jsx("span",{className:"omni-attr-key",children:f}),t.jsx("span",{className:"omni-attr-value",children:String(k)})]},f))})]})]}),E==="insight"&&ce&&t.jsxs("div",{className:"omni-insight-panel",children:[t.jsxs("div",{className:"omni-insight-role",children:[t.jsx("span",{className:"omni-insight-emoji",children:ce.emoji}),t.jsxs("div",{children:[t.jsx("div",{className:"omni-insight-role-name",children:ce.role}),t.jsx("div",{className:"omni-insight-interactable",children:ce.interactable?t.jsxs("span",{className:"omni-badge-green",children:[t.jsx(js,{size:10})," Interactable"]}):t.jsx("span",{className:"omni-badge-gray",children:"Visual Only"})})]})]}),ce.warning&&t.jsx("div",{className:"omni-insight-warning",children:ce.warning}),t.jsxs("div",{className:"omni-insight-description",children:[t.jsx(ws,{size:12,className:"omni-insight-icon"}),t.jsx("p",{children:ce.description})]}),ce.bestLocator&&t.jsxs("div",{className:"omni-insight-best-locator",children:[t.jsx("div",{className:"omni-section-header",children:"Recommended Locator"}),t.jsxs("div",{className:"omni-locator-row",children:[t.jsxs("div",{className:"omni-locator-left",children:[t.jsx("span",{className:"omni-locator-strategy",children:ce.bestLocator.strategy}),t.jsx("code",{className:"omni-locator-value",children:ce.bestLocator.value})]}),t.jsx("button",{onClick:()=>et(ce.bestLocator.value,"best"),className:`omni-copy-btn ${j==="best"?"copied":""}`,children:j==="best"?t.jsx(yt,{size:12}):t.jsx(Be,{size:12})})]})]}),t.jsxs("div",{className:"omni-insight-attributes",children:[t.jsx("div",{className:"omni-section-header",children:"Quick Facts"}),t.jsx("div",{className:"omni-quick-facts",children:[{label:"Clickable",value:(pt=p.attributes)==null?void 0:pt.clickable},{label:"Enabled",value:(It=p.attributes)==null?void 0:It.enabled},{label:"Scrollable",value:(Mt=p.attributes)==null?void 0:Mt.scrollable},{label:"Focusable",value:(Lt=p.attributes)==null?void 0:Lt.focusable},{label:"Children",value:((gt=p.children)==null?void 0:gt.length)||0}].map(({label:f,value:k})=>t.jsxs("div",{className:"omni-quick-fact-row",children:[t.jsx("span",{className:"omni-quick-fact-label",children:f}),t.jsx("span",{className:`omni-quick-fact-value ${k==="true"||k===!0?"true":""}`,children:String(k??"—")})]},f))})]})]}),E==="code"&&t.jsxs("div",{className:"omni-codegen-panel",children:[t.jsx("div",{className:"omni-codegen-frameworks",children:["java","python","javascript","wdio"].map(f=>t.jsx("button",{className:`omni-fw-btn ${$===f?"active":""}`,onClick:()=>X(f),children:f==="java"?"☕ Java":f==="python"?"🐍 Python":f==="javascript"?"🟨 JS":"🔷 WD.io"},f))}),M?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"omni-codegen-locator-selector",children:[t.jsx("span",{className:"omni-codegen-label",children:"Locator:"}),t.jsx(Jt,{selectSize:"sm",value:M.strategy,onChange:f=>{var _;const k=(_=p.suggestedLocators)==null?void 0:_.find(I=>I.strategy===f.target.value);k&&F(k)},className:"flex-1",children:(_t=p.suggestedLocators)==null?void 0:_t.map(f=>t.jsxs("option",{value:f.strategy,children:[f.strategy," — ",dn(f.strategy,f.value).level]},f.strategy))})]}),t.jsxs("div",{className:"omni-codegen-output",children:[t.jsxs("div",{className:"omni-codegen-header",children:[t.jsx("span",{className:"omni-codegen-lang",children:$==="java"?"Java / TestNG":$==="python"?"Python / unittest":$==="javascript"?"JavaScript / Mocha":"WebdriverIO"}),t.jsx("button",{className:"omni-copy-btn",onClick:()=>et(un(p,(o==null?void 0:o.platform)==="android"?"android":(o==null?void 0:o.platform)==="ios"?"ios":"unknown",$,M),"code"),children:j==="code"?t.jsx(yt,{size:12}):t.jsx(Be,{size:12})})]}),t.jsx("pre",{className:"omni-codegen-pre theme-dark",children:t.jsx("code",{children:un(p,(o==null?void 0:o.platform)==="android"?"android":(o==null?void 0:o.platform)==="ios"?"ios":"unknown",$,M)})})]})]}):t.jsxs("div",{className:"omni-empty-state small",children:[t.jsx(Gs,{size:24}),t.jsx("span",{children:"No locators available for this element"})]})]})]}):o!=null&&o.hierarchy?t.jsxs("div",{className:"omni-summary-panel",children:[t.jsxs("div",{className:"omni-summary-hero",children:[t.jsx(ds,{size:28}),t.jsxs("div",{children:[t.jsx("div",{className:"omni-summary-title",children:"No element selected"}),t.jsx("div",{className:"omni-summary-subtitle",children:"Click any node in the tree (or use Inspect mode on the device) to drill in."})]})]}),t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"Snapshot Stats"}),t.jsxs("div",{className:"omni-summary-stats",children:[t.jsxs("div",{className:"omni-summary-stat",children:[t.jsx("span",{className:"omni-summary-stat__label",children:"Elements"}),t.jsx("span",{className:"omni-summary-stat__value",children:tt})]}),t.jsxs("div",{className:"omni-summary-stat",children:[t.jsx("span",{className:"omni-summary-stat__label",children:"Width"}),t.jsx("span",{className:"omni-summary-stat__value",children:((Et=o.metadata)==null?void 0:Et.screenWidth)??P.width??"—"})]}),t.jsxs("div",{className:"omni-summary-stat",children:[t.jsx("span",{className:"omni-summary-stat__label",children:"Height"}),t.jsx("span",{className:"omni-summary-stat__value",children:(($t=o.metadata)==null?void 0:$t.screenHeight)??P.height??"—"})]}),t.jsxs("div",{className:"omni-summary-stat",children:[t.jsx("span",{className:"omni-summary-stat__label",children:"Platform"}),t.jsx("span",{className:"omni-summary-stat__value",children:o.platform||"—"})]})]})]}),Rt.length>0&&t.jsxs("div",{className:"omni-section",children:[t.jsx("div",{className:"omni-section-header",children:"By Role"}),t.jsx("div",{className:"omni-summary-roles",children:Rt.slice(0,8).map(f=>t.jsxs("div",{className:"omni-summary-role",children:[t.jsx("span",{className:"omni-summary-role__emoji",children:f.emoji}),t.jsx("span",{className:"omni-summary-role__name",children:f.role}),t.jsx("span",{className:"omni-summary-role__count",children:f.count})]},f.role))})]})]}):t.jsxs("div",{className:"omni-empty-state",children:[t.jsx(ds,{size:32}),t.jsx("span",{children:c?"Capturing snapshot…":"Select an element from the tree or screenshot"})]})})]})]})]})},hn=5e3;function Fc(e,s=!0){const[n,i]=d.useState("unknown"),r=d.useRef("unknown");return d.useEffect(()=>{if(!e||!s){i("unknown"),r.current="unknown";return}let a=!1,c;const l=m=>{a||m===r.current||(r.current=m,i(m))},o=async()=>{if(!a){if(c&&(clearTimeout(c),c=void 0),typeof document<"u"&&document.visibilityState==="hidden"){c=setTimeout(o,hn);return}try{const m=await H.getDisplayState(e);l((m==null?void 0:m.state)??"unknown")}catch{}a||(c=setTimeout(o,hn))}};o();const u=()=>{document.visibilityState==="visible"&&o()};return document.addEventListener("visibilitychange",u),()=>{a=!0,c&&clearTimeout(c),document.removeEventListener("visibilitychange",u)}},[e,s]),n}const pn=5e3,Bc=500,Uc=1e4,Wc=10,Hc=50;function Vc(e,s,n){const i=`${((n==null?void 0:n.levels)??[]).join(",")}|${(n==null?void 0:n.process)??""}`,[r,a]=d.useState([]),[c,l]=d.useState(!1),[o,u]=d.useState(null),[m,h]=d.useState(!1),p=d.useRef(null),g=d.useRef(0),b=d.useRef(void 0),x=d.useRef(()=>{}),y=d.useRef([]),S=d.useRef(void 0),C=d.useRef(0),w=d.useRef(void 0),j=d.useCallback(()=>{if(y.current.length===0)return;const $=y.current;y.current=[],a(X=>{const M=X.concat($);return M.length>pn?M.slice(-pn):M})},[]),T=d.useCallback(()=>{S.current===void 0&&(S.current=window.setTimeout(()=>{S.current=void 0,j()},Hc))},[j]),E=d.useCallback(()=>{y.current=[],a([])},[]);d.useEffect(()=>{if(!s){l(!1),u(null),h(!1);return}u(null),h(!1),g.current=0;const $={cancelled:!1},X=()=>{if($.cancelled)return;if(g.current>=Wc){h(!0);return}const F=Math.min(Bc*2**g.current,Uc);g.current+=1,b.current=window.setTimeout(M,F)},M=async()=>{if(!$.cancelled)try{const F=await fetch(`/xenon/api/control/${encodeURIComponent(e)}/stream/ticket`,{method:"POST",credentials:"include"});if($.cancelled)return;if(!F.ok){X();return}const{ticket:P}=await F.json();if($.cancelled)return;if(!P){X();return}const G=window.location.protocol==="https:"?"wss":"ws",[V,ee]=i.split("|"),B=(V?`&levels=${encodeURIComponent(V)}`:"")+(ee?`&process=${encodeURIComponent(ee)}`:""),O=new WebSocket(`${G}://${window.location.host}/xenon/api/control/${encodeURIComponent(e)}/logcat?ticket=${encodeURIComponent(P)}${B}`);p.current=O,O.onopen=()=>{g.current=0,w.current!==1012&&(y.current=[],a([])),w.current=void 0,l(!0)},O.onmessage=A=>{try{const J=JSON.parse(A.data);y.current.push({...J,seq:C.current++}),T()}catch{}},O.onclose=A=>{if(l(!1),w.current=A.code,j(),A.code===1008){$.cancelled=!0,u(A.reason||"access denied");return}if(A.code===1012){X();return}console.warn(`[logcat] WS closed unexpectedly (code ${A.code}) — retrying`),X()},O.onerror=()=>O.close()}catch{X()}};return x.current=()=>{$.cancelled=!1,g.current=0,u(null),h(!1),M()},M(),()=>{var F;$.cancelled=!0,b.current!==void 0&&window.clearTimeout(b.current),S.current!==void 0&&(window.clearTimeout(S.current),S.current=void 0),j(),(F=p.current)==null||F.close(),p.current=null}},[e,s,i,j,T]);const L=d.useCallback(()=>{x.current()},[]);return{records:r,connected:c,clear:E,deniedReason:o,exhausted:m,retry:L}}const Rs=["V","D","I","W","E","F"];function qc(e){const s=[];let n="",i=!1,r=!1;for(const a of e){if(a==='"'){i=!i,r=!0;continue}if(!i&&/\s/.test(a)){(r||n)&&s.push(n),n="",r=!1;continue}n+=a,r=!0}return(r||n)&&s.push(n),s.filter(a=>a.length>0)}function ci(e,s={}){const n=s.caseSensitive===!0,i=c=>n?c:c.toLowerCase(),r=n?{caseSensitive:!0}:{},a=[];for(const c of qc(e)){const[l,...o]=c.split(":"),u=o.join(":");u&&l.toLowerCase()==="level"?r.minLevel=u.toUpperCase():u&&l.toLowerCase()==="tag"?r.tag=i(u):u&&l.toLowerCase()==="package"?r.pkg=i(u):a.push(c)}return a.length&&(r.text=i(a.join(" "))),r}function Xc(e,s){if(e.synthetic)return!0;if(s.minLevel){const i=Rs.indexOf(s.minLevel),r=Rs.indexOf(e.level);if(i>=0&&r>=0&&r<i)return!1}const n=i=>s.caseSensitive?i:i.toLowerCase();return!(s.tag&&!n(e.tag).includes(s.tag)||s.pkg&&!n(e.pkg??"").includes(s.pkg)||s.text&&!n(e.message).includes(s.text))}function Kc(e,s){const n=e.trim().split(/\s+/).filter(Boolean).filter(i=>{const[r,...a]=i.split(":");return!(a.join(":")&&r.toLowerCase()==="level")});return s?["level:"+s.toUpperCase(),...n].join(" "):n.join(" ")}const xs=[{ios:"Debug",android:"D"},{ios:"Info",android:"I"},{ios:"Default",android:"I"},{ios:"Error",android:"E"},{ios:"Fault",android:"F"}],gn=["V","D","I","W","E","F"];function Gc(e){if(!e)return xs.filter(n=>n.ios!=="Debug").map(n=>n.ios);const s=gn.indexOf(e.toUpperCase());return s<0?xs.map(n=>n.ios):xs.filter(n=>gn.indexOf(n.android)>=s).map(n=>n.ios)}function Yc(e){const s=ci(e,{caseSensitive:!0});return{levels:Gc(s.minLevel),process:s.pkg||void 0}}const xn=["#7dd3fc","#c4b5fd","#5eead4","#f0abfc","#93c5fd","#a5b4fc","#67e8f9","#d8b4fe","#f9a8d4","#99f6e4","#bae6fd","#e9d5ff"];function Zc(e){let s=2166136261;for(let n=0;n<e.length;n++)s^=e.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s>>>0}function Jc(e){return e?xn[Zc(e)%xn.length]:"var(--text-muted)"}const Es=5e5;function li(e){return`${new Date(e.ts).toISOString()} ${e.pid} ${e.level}/${e.tag}: ${e.message}`}function Qc(e){return{lines:[],startedAt:e,dropped:0}}function el(e,s){for(const n of s){if(e.lines.length>=Es){e.dropped+=1;continue}e.lines.push(li(n))}return e}function tl(e,s,n){const i=["# Xenon logcat recording",`# device: ${n}`,`# started: ${new Date(e.startedAt).toISOString()}`,`# stopped: ${new Date(s).toISOString()}`,`# duration: ${((s-e.startedAt)/1e3).toFixed(1)}s`,`# lines: ${e.lines.length}`];e.dropped>0&&i.push(`# TRUNCATED: ${e.dropped} further line(s) were dropped after the ${Es}-line cap. This capture is INCOMPLETE.`);const r=e.lines.join(`
|
|
239
|
-
`),a=e.dropped>0?`
|
|
240
|
-
# --- TRUNCATED: ${e.dropped} line(s) not captured (cap ${Es}) ---`:"";return`${i.join(`
|
|
241
|
-
`)}
|
|
242
|
-
|
|
243
|
-
${r}${a}
|
|
244
|
-
`}function sl(e,s){const n=new Date(s).toISOString().replace(/[:.]/g,"-").replace(/Z$/,"");return`logcat-${e}-${n}.txt`}const yn=Rs.filter(e=>e!=="V").map(e=>({value:e,label:e==="F"?"F only":`${e} and above`})),nl=new Intl.DateTimeFormat([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function vn(e,s){const n=URL.createObjectURL(new Blob([e],{type:"text/plain"})),i=document.createElement("a");i.href=n,i.download=s,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(()=>URL.revokeObjectURL(n),0)}const il=d.memo(function({record:s,index:n,isHit:i,isActiveHit:r}){return t.jsxs("div",{"data-row-index":n,className:`logcat-row ${s.synthetic?"is-synthetic":""} ${i?"is-hit":""} ${r?"is-active-hit":""}`,children:[t.jsx("span",{className:"logcat-time",children:nl.format(s.ts)}),t.jsxs("span",{className:"logcat-pid",children:[s.pid,"-",s.tid]}),t.jsx("span",{className:"logcat-tag",title:s.tag,style:{color:Jc(s.tag)},children:s.tag}),t.jsx("span",{className:"logcat-pkg",title:s.pkg,children:s.pkg??""}),t.jsx("span",{className:`logcat-level lvl-${s.level}`,children:s.level}),t.jsx("span",{className:"logcat-msg",children:s.message})]})});function rl({udid:e,platform:s}){const n=(s||"").toLowerCase(),i=n==="ios",r=n==="android"||i,[a,c]=d.useState(""),l=d.useMemo(()=>i?Yc(a):void 0,[i,a]),{records:o,connected:u,clear:m,deniedReason:h,exhausted:p,retry:g}=Vc(e,r,l),[b,x]=d.useState(!0),[y,S]=d.useState(!1),[C,w]=d.useState(!0),[j,T]=d.useState(""),[E,L]=d.useState(0),$=d.useRef(null),X=d.useRef(null),M=d.useRef(null),[F,P]=d.useState(!1),[G,V]=d.useState(0),ee=d.useRef(-1),B=d.useMemo(()=>ci(a,{caseSensitive:y}),[a,y]),O=d.useMemo(()=>o.filter(z=>Xc(z,B)),[o,B]),A=d.useMemo(()=>{if(!j)return[];const z=y?j:j.toLowerCase(),Z=[];return O.forEach((ne,ie)=>{(y?`${ne.tag} ${ne.message}`:`${ne.tag} ${ne.message}`.toLowerCase()).includes(z)&&Z.push(ie)}),Z},[O,j,y]),J=A.length?Math.min(E,A.length-1):0,R=d.useMemo(()=>new Set(A),[A]),oe=d.useCallback(z=>{var ne,ie;if(!A.length)return;const Z=(J+z+A.length)%A.length;L(Z),x(!1),(ie=(ne=X.current)==null?void 0:ne.querySelector(`[data-row-index="${A[Z]}"]`))==null||ie.scrollIntoView({block:"center"})},[A,J]),He=yn.some(z=>z.value===B.minLevel)?B.minLevel:"",Se=d.useCallback(()=>{vn(O.map(li).join(`
|
|
245
|
-
`),`logcat-${e}-${Date.now()}.txt`)},[O,e]);d.useEffect(()=>{const z=M.current;if(!z||!o.length)return;const Z=o.filter(ie=>ie.seq>ee.current);if(!Z.length)return;const ne=ee.current+1;ee.current>=0&&Z[0].seq>ne&&(z.dropped+=Z[0].seq-ne),el(z,Z),ee.current=Z[Z.length-1].seq,V(z.lines.length)},[o]);const ue=d.useCallback(()=>{const z=M.current;if(!z){ee.current=o.length?o[o.length-1].seq:-1,M.current=Qc(Date.now()),V(0),P(!0);return}const Z=tl(z,Date.now(),e);M.current=null,P(!1),V(0),vn(Z,sl(e,z.startedAt))},[o,e]);if(d.useEffect(()=>{var z;b&&((z=$.current)==null||z.scrollIntoView({block:"end"}))},[O.length,b]),!r)return t.jsxs("div",{className:"log-empty-state",children:[t.jsx("p",{className:"log-empty-title",children:"Live logs are not available here"}),t.jsx("p",{className:"log-empty-subtitle",children:"Streaming is wired up for Android (logcat) and iOS (os_trace), not for this device's platform."})]});const pe=h?"Denied":p?"Offline":u?"Live":"Connecting",se=!u&&(!!h||p);return t.jsxs("div",{className:"logcat-root",children:[t.jsxs("div",{className:"log-toolbar",children:[t.jsxs("div",{className:"log-filter-group",children:[t.jsxs("div",{className:"log-stat-pill",title:h??void 0,children:[t.jsx("span",{className:`log-live-dot ${u?"active":""} ${se?"is-error":""}`}),pe]}),t.jsxs("div",{className:"log-stat-pill logcat-count",children:[O.length," / ",o.length]}),t.jsxs(Jt,{selectSize:"sm",value:He,onChange:z=>c(Kc(a,z.target.value)),"aria-label":"Minimum log level",children:[t.jsx("option",{value:"",children:"All levels"}),yn.map(z=>t.jsx("option",{value:z.value,children:z.label},z.value))]}),t.jsxs("div",{className:"logcat-input-wrap",children:[t.jsx("input",{type:"text",className:"type-input-field tiny logcat-query",placeholder:"tag:Wifi package:com.android.systemui free text",value:a,onChange:z=>c(z.target.value),"aria-label":"Filter logs"}),a&&t.jsx("button",{type:"button",className:"logcat-input-btn",onClick:()=>c(""),"aria-label":"Clear filter",title:"Clear filter",children:t.jsx($s,{size:12})})]}),t.jsxs("div",{className:"logcat-input-wrap",children:[t.jsx("input",{type:"text",className:"type-input-field tiny logcat-find",placeholder:"Find…",value:j,onChange:z=>{T(z.target.value),L(0)},onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),oe(z.shiftKey?-1:1))},"aria-label":"Find in logs"}),j&&t.jsx("span",{className:"logcat-hit-count","aria-live":"polite",children:A.length?`${J+1}/${A.length}`:"0/0"})]}),t.jsx("button",{type:"button",className:"dc-btn-secondary btn-sm logcat-icon-btn",onClick:()=>oe(-1),disabled:!A.length,"aria-label":"Previous match",title:"Previous match (Shift+Enter)",children:t.jsx(Wi,{size:14})}),t.jsx("button",{type:"button",className:"dc-btn-secondary btn-sm logcat-icon-btn",onClick:()=>oe(1),disabled:!A.length,"aria-label":"Next match",title:"Next match (Enter)",children:t.jsx(Bi,{size:14})}),t.jsx("button",{type:"button",className:`dc-btn-secondary btn-sm logcat-icon-btn ${y?"active":""}`,onClick:()=>S(!y),"aria-pressed":y,"aria-label":"Match case",title:"Match case",children:t.jsx(tr,{size:15})}),t.jsx("button",{type:"button",className:`dc-btn-secondary btn-sm logcat-icon-btn ${C?"active":""}`,onClick:()=>w(!C),"aria-pressed":C,"aria-label":"Soft wrap",title:"Soft wrap long messages",children:t.jsx(Hr,{size:14})})]}),t.jsxs("div",{className:"log-actions-group",children:[(h||p)&&t.jsxs("button",{className:"dc-btn-secondary btn-sm",onClick:g,children:[t.jsx(vt,{size:14})," RECONNECT"]}),t.jsxs("button",{className:`dc-btn-secondary btn-sm ${b?"active":""}`,onClick:()=>x(!b),children:[t.jsx(Qr,{size:14})," ",b?"FREEZE":"FOLLOW"]}),t.jsxs("button",{className:`dc-btn-secondary btn-sm ${F?"is-recording":""}`,onClick:ue,"aria-pressed":F,title:F?"Stop recording and download the capture":"Record the raw log stream to a file",children:[F?t.jsx(En,{size:12}):t.jsx(Ii,{size:12})," ",F?`STOP · ${G.toLocaleString()}`:"RECORD"]}),t.jsxs("button",{className:"btn-premium btn-sm",disabled:O.length===0,onClick:Se,children:[t.jsx(Li,{size:14})," EXPORT"]}),t.jsxs("button",{className:"dc-btn-secondary btn-sm",onClick:m,children:[t.jsx(Ut,{size:14})," CLEAR"]})]})]}),t.jsxs("div",{className:`logcat-rows theme-dark ${C?"":"no-wrap"}`,ref:X,children:[h&&t.jsxs("div",{className:"logcat-status-banner is-denied",role:"alert",children:[t.jsx(it,{size:14}),t.jsxs("span",{children:["Access denied — ",h]})]}),!h&&p&&t.jsxs("div",{className:"logcat-status-banner is-exhausted",role:"alert",children:[t.jsx(it,{size:14}),t.jsx("span",{children:"Connection lost after repeated attempts. Use Reconnect above to try again."})]}),O.map((z,Z)=>t.jsx(il,{record:z,index:Z,isHit:R.has(Z),isActiveHit:A.length>0&&A[J]===Z},z.seq)),t.jsx("div",{ref:$})]})]})}function al({device:e,onClose:s,titleId:n}){const{toast:i,removeToast:r}=Zt(),a=Ts(),{tab:c}=Cn(),l=Ds(),o=d.useRef(null),[u,m]=d.useState({width:0,height:0}),[h,p]=d.useState("inspect"),[g,b]=d.useState(null),[x,y]=d.useState(c||"actions"),S=x==="omni"&&h==="inspect",[C,w]=d.useState(""),[j,T]=d.useState(""),[E,L]=d.useState(""),[$,X]=d.useState(!0),[M,F]=d.useState([]),[P,G]=d.useState(null),[V,ee]=d.useState(!1),[B,O]=d.useState(!1),[A,J]=d.useState(0),[R,oe]=d.useState(e),[He,Se]=d.useState([]),[ue,pe]=d.useState(!1),[se,z]=d.useState(!1),[Z,ne]=d.useState(null),[ie,_e]=d.useState(!1),[ge,ae]=d.useState(!1),ke=10,[Ve,Ye]=d.useState(!1),[Ae,Ze]=d.useState(!1),Oe=Fc(R==null?void 0:R.udid,!ge),ns=()=>{navigator.clipboard.writeText(R.udid).catch(()=>{}),Ye(!0),setTimeout(()=>Ye(!1),1500)},Re=d.useRef(""),me=d.useRef(null),[Je,St]=d.useState(!1);d.useEffect(()=>{x&&(!c||c!==x)&&a(`/devices/${e.udid}/control/${x}${l.search}`,{replace:!0})},[x,c,e.udid,a,l.search]),d.useEffect(()=>((async()=>{try{O(!0),await H.startStream(R.udid);const D=(await H.getDevices()).find(U=>U.udid===R.udid);D&&oe(D)}catch(N){console.error("Auto-start stream failed:",N)}finally{O(!1)}})(),()=>{H.stopStream(R.udid).catch(()=>{})}),[e.udid]);const Qe=d.useCallback(async()=>{try{pe(!0);const v=await H.listApps(R.udid);Array.isArray(v)&&Se(v)}catch(v){console.error("Failed to load apps:",v)}finally{pe(!1)}},[R.udid]);d.useEffect(()=>{x==="actions"&&Qe()},[x,Qe]);const kt=parseInt(R.screenWidth||"1080",10),et=parseInt(R.screenHeight||"1920",10),je=Math.min(kt,et),Ee=Math.max(kt,et),ut=je/Ee,qe=d.useCallback(()=>{const v=!$,N=v?window.innerHeight*.55:window.innerHeight*.7,D=620,W=window.innerWidth>900;let Y;v?Y=W?Math.min(window.innerWidth*.8,window.innerWidth-D):window.innerWidth*.8:Y=window.innerWidth*.45;const te=$?ut:1/ut;let Q,q;$?(Q=N,q=Q*te,q>Y&&(q=Y,Q=q/te)):(q=Y,Q=q/te,Q>N&&(Q=N,q=Q*te)),m({width:q,height:Q})},[ut,$]);d.useEffect(()=>(qe(),window.addEventListener("resize",qe),()=>window.removeEventListener("resize",qe)),[qe]),d.useEffect(()=>{const v=async()=>{if(Re.current.length>0){const D=Re.current;Re.current="";try{await H.typeText(R.udid,D)}catch(U){console.error("Keyboard buffering flush failed:",U)}}},N=D=>{const U=document.activeElement;if(U&&(U.tagName==="INPUT"||U.tagName==="TEXTAREA"||U.isContentEditable)||!Je&&x!=="terminal")return;const Y=D.key;Y==="Enter"?(me.current&&clearTimeout(me.current),v(),H.pressKey(R.udid,R.platform==="android"?66:"enter")):Y==="Backspace"?(me.current&&clearTimeout(me.current),v(),H.pressKey(R.udid,R.platform==="android"?67:"backspace")):Y.length===1&&(Re.current+=Y,me.current&&clearTimeout(me.current),me.current=setTimeout(()=>{v()},50))};return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N),me.current&&clearTimeout(me.current)}},[R.udid,R.platform,Je,x]);const[mt,At]=d.useState(Date.now()),ft=()=>{const v=A>0?`r=${A}&`:"";return R.session_id&&!String(R.session_id).startsWith("manual_")?`/xenon/api/session/${R.session_id}/live_video?${v}t=${mt}`:`/xenon/api/control/${R.udid}/stream?${v}t=${mt}`};d.useEffect(()=>{A>0&&At(Date.now())},[A]),d.useEffect(()=>{if(ie||ge)return;const v=setTimeout(()=>ae(!0),3e4);return()=>clearTimeout(v)},[ie,ge,A]);const $e=d.useRef(null),tt=v=>{const N=v.currentTarget.getBoundingClientRect();return{x:v.clientX-N.left,y:v.clientY-N.top}},ce=v=>{const N=tt(v);$e.current={x:N.x,y:N.y,time:Date.now()}},ht=async v=>{var ze;if(!$e.current)return;const N=$e.current,D=tt(v),U=Date.now()-N.time,W=(ze=o.current)==null?void 0:ze.getBoundingClientRect(),Y=(W==null?void 0:W.width)||u.width,te=(W==null?void 0:W.height)||u.height;let Q,q,fe,xe;$?(Q=N.x/Y*je,q=N.y/te*Ee,fe=D.x/Y*je,xe=D.y/te*Ee):(Q=N.x/Y*Ee,q=N.y/te*je,fe=D.x/Y*Ee,xe=D.y/te*je);const he=Math.abs(fe-Q),Pe=Math.abs(xe-q);try{U<500&&he<10&&Pe<10?await H.tap(R.udid,Math.round(Q),Math.round(q)):U>=500&&he<10&&Pe<10?await H.touchAndHold(R.udid,Math.round(Q),Math.round(q),U):await H.swipe(R.udid,Math.round(Q),Math.round(q),Math.round(fe),Math.round(xe))}catch(st){console.error("Action failed:",st)}$e.current=null},is=()=>H.pressKey(R.udid,R.platform==="android"?xt.HOME:cs.HOME),Rt=()=>H.pressKey(R.udid,xt.BACK),Et=()=>H.pressKey(R.udid,xt.APP_SWITCH),$t=()=>H.pressKey(R.udid,R.platform==="android"?xt.VOLUME_UP:cs.VOLUME_UP),Tt=()=>H.pressKey(R.udid,R.platform==="android"?xt.VOLUME_DOWN:cs.VOLUME_DOWN),Dt=()=>H.lock(R.udid),pt=async()=>{Ze(!0);try{await H.unlock(R.udid)}finally{setTimeout(()=>Ze(!1),2500)}},It=async()=>{C.trim()&&(await H.typeText(R.udid,C),w(""))},Mt=async()=>{try{T("Fetching...");const v=await H.getClipboard(R.udid);v&&v.content!==void 0?T(v.content||"(Clipboard is empty)"):T("No content received")}catch{T("Error: Check Appium Settings app")}},Lt=async()=>{ee(!0);try{const v=await H.getScreenshot(R.udid);if(v!=null&&v.screenshot){const N={id:Rc(),base64:v.screenshot,timestamp:Date.now()};F(D=>[N,...D]),G(0)}}catch(v){console.error("Failed to take screenshot:",v)}finally{ee(!1)}},gt=v=>{F(N=>{const D=N.filter(U=>U.id!==v);return D.length===0?G(null):P!==null&&P>=D.length&&G(0),D})},_t=()=>{F([]),G(null),i("Cleared all captured evidence.","success")},f=v=>{const N=document.createElement("a");N.href=`data:image/png;base64,${v}`,N.download=`screenshot-${R.udid}-${Date.now()}.png`,N.click()},k=async v=>{const N=je/2,D=Ee/2,U=je*.4,W=Ee*.4;let Y,te,Q,q;switch(v){case"left":Y=N+U,te=D,Q=N-U,q=D;break;case"right":Y=N-U,te=D,Q=N+U,q=D;break;case"up":Y=N,te=D+W,Q=N,q=D-W;break;case"down":Y=N,te=D-W,Q=N,q=D+W;break}try{await H.swipe(R.udid,Math.round(Y),Math.round(te),Math.round(Q),Math.round(q))}catch(fe){console.error(`Quick swipe ${v} failed:`,fe)}},_=async()=>{if(E.trim()){const v=i(`Uninstalling ${E}...`,"loading",0);try{pe(!0),await H.uninstallApp(R.udid,E),L(""),i(`Request sent for ${E}`,"success"),setTimeout(Qe,3e3)}catch{i("Uninstall failed. Check logs.","error")}finally{pe(!1),r(v)}}},I=async()=>{if(!Z)return;let v;try{z(!0),v=i(`Installing app to ${R.udid}...`,"loading",0);const N=await H.uploadAndInstallApp(R.udid,Z);N.success?(i(N.message||"App installed successfully","success"),ne(null),setTimeout(Qe,5e3)):i("Installation failed: "+(N.error||"Unknown error"),"error")}catch(N){i("Installation failed: "+N.message,"error")}finally{v&&r(v),z(!1)}};return t.jsxs("div",{className:"device-control-view",children:[t.jsx("div",{className:"scanline",style:{position:"absolute",inset:0,pointerEvents:"none",opacity:.05,zIndex:1001}}),t.jsxs("header",{className:"control-view-top-bar",children:[t.jsxs("button",{className:"back-to-devices-btn",onClick:s,children:[t.jsx(ls,{size:18})," DEVICES"]}),t.jsxs("div",{className:"device-info-mini",children:[t.jsx("span",{className:`device-pill platform-pill ${R.platform}`,children:R.platform==="ios"?"Apple":"Android"}),t.jsxs("span",{className:"device-pill version-pill",children:["v",R.sdk]}),R.reservedUntil&&Date.now()<R.reservedUntil&&t.jsxs("span",{className:"device-pill reserved-pill",title:`Reserved by ${R.reservedBy}${R.reservationReason?`: ${R.reservationReason}`:""}`,children:["Reserved by ",R.reservedBy||"someone"]}),t.jsx("h2",{id:n,className:"device-name-text",children:R.name}),t.jsxs("span",{className:"udid-chip",title:R.udid,children:[t.jsx("span",{className:"udid-chip__value",children:R.udid}),t.jsx("button",{type:"button",className:"udid-chip__copy",onClick:ns,"aria-label":"Copy UDID",title:Ve?"Copied!":"Copy UDID",children:Ve?t.jsx(yt,{size:12}):t.jsx(Be,{size:12})})]})]})]}),t.jsxs("div",{className:`control-view-main ${$?"":"is-landscape"} ${x==="omni"?"omni-mode":""}`,children:[t.jsxs("div",{className:"device-preview-column",children:[t.jsx("div",{className:"device-screen-wrapper",children:t.jsxs("div",{ref:v=>{o.current=v,b(v)},className:`device-stream-canvas ${$?"":"landscape"} ${Je?"focused":""} ${S?"is-inspecting":""}`,style:{width:u.width,height:u.height,background:"var(--black)"},tabIndex:0,onFocus:()=>St(!0),onBlur:()=>St(!1),onMouseDown:S?void 0:ce,onMouseUp:S?void 0:ht,children:[ge?t.jsxs("div",{className:"device-stream-placeholder",style:{position:"absolute",zIndex:10},children:[t.jsx(it,{size:40,color:"var(--red, #f87171)"}),t.jsx("p",{style:{marginTop:16},children:"Stream unavailable"}),t.jsx("button",{className:"btn-premium btn-sm",style:{marginTop:12},onClick:()=>{ae(!1),J(0)},children:"Retry"})]}):(B||!ie)&&t.jsxs("div",{className:"device-stream-placeholder",style:{position:"absolute",zIndex:10},children:[t.jsx(vt,{size:40,className:"animate-spin",color:"var(--color-accent)"}),t.jsx("p",{style:{marginTop:16},children:B?"ESTABLISHING TRACE...":"Waiting for stream…"})]}),!ge&&t.jsx("img",{src:ft(),alt:"Device Stream",className:"device-stream-image",style:{width:"100%",height:"100%",objectFit:"contain"},onLoad:()=>_e(!0),onError:()=>{if(console.warn("Stream failed to load, retrying..."),_e(!1),A>=ke){ae(!0);return}setTimeout(()=>J(v=>v+1),2e3)}}),Oe==="off"&&!ge&&t.jsxs("div",{className:"device-screen-off",role:"status",children:[t.jsx(Cr,{size:32}),t.jsx("p",{children:"Display is off"}),t.jsx("span",{children:"The stream is fine — the device is asleep."}),t.jsx("button",{type:"button",className:"btn-premium btn-sm",onClick:pt,disabled:Ae,children:Ae?"Waking…":"Wake device"})]})]})}),t.jsxs("aside",{className:"device-footer-actions",role:"toolbar","aria-label":"Device controls","aria-orientation":$?"vertical":"horizontal",children:[t.jsx("button",{className:`footer-action-btn ${$?"active":""}`,onClick:()=>X(!0),title:"Portrait","aria-label":"Portrait orientation","aria-pressed":$,children:t.jsx(Mr,{size:18})}),t.jsx("button",{className:`footer-action-btn ${$?"":"active"}`,onClick:()=>X(!1),title:"Landscape","aria-label":"Landscape orientation","aria-pressed":!$,children:t.jsx(Dr,{size:18})}),t.jsx("div",{className:"footer-divider"}),t.jsx("button",{className:"footer-action-btn",onClick:is,title:"Home","aria-label":"Home",children:t.jsx(Mi,{size:18})}),R.platform==="android"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"footer-action-btn",onClick:Rt,title:"Back","aria-label":"Back",children:t.jsx(ls,{size:18})}),t.jsx("button",{className:"footer-action-btn",onClick:Et,title:"App switcher","aria-label":"App switcher",children:t.jsx(En,{size:18})})]}),t.jsx("div",{className:"footer-divider"}),t.jsx("button",{className:"footer-action-btn",onClick:$t,title:"Volume up","aria-label":"Volume up",children:t.jsx(Zr,{size:18})}),t.jsx("button",{className:"footer-action-btn",onClick:Tt,title:"Volume down","aria-label":"Volume down",children:t.jsx(Gr,{size:18})}),t.jsx("button",{className:"footer-action-btn",onClick:Dt,title:"Lock device","aria-label":"Lock device",children:t.jsx(_i,{size:18})}),t.jsx("button",{className:"footer-action-btn",onClick:pt,title:"Unlock device","aria-label":"Unlock device",children:t.jsx(yr,{size:18})})]})]}),t.jsxs("div",{className:"device-interactions-column",children:[t.jsxs("div",{className:"interaction-tabs",role:"tablist",children:[t.jsxs("button",{className:`tab-btn ${x==="actions"?"active":""}`,onClick:()=>y("actions"),role:"tab","aria-selected":x==="actions",children:[t.jsx(js,{size:13}),t.jsx("span",{children:"Actions"})]}),t.jsxs("button",{className:`tab-btn ${x==="screenshot"?"active":""}`,onClick:()=>y("screenshot"),role:"tab","aria-selected":x==="screenshot",children:[t.jsx(os,{size:13}),t.jsx("span",{children:"Screenshot"})]}),t.jsxs("button",{className:`tab-btn ${x==="logs"?"active":""}`,onClick:()=>y("logs"),role:"tab","aria-selected":x==="logs",children:[t.jsx(Or,{size:13}),t.jsx("span",{children:"Logs"})]}),t.jsxs("button",{className:`tab-btn ${x==="terminal"?"active":""}`,onClick:()=>y("terminal"),role:"tab","aria-selected":x==="terminal",children:[t.jsx(Oi,{size:13}),t.jsx("span",{children:"Shell"})]}),t.jsxs("button",{className:`tab-btn ${x==="omni"?"active":""}`,onClick:()=>y("omni"),role:"tab","aria-selected":x==="omni",children:[t.jsx(ws,{size:13}),t.jsx("span",{children:"Omni-Vision"})]})]}),t.jsx("div",{className:`interactions-scroll-area ${x==="terminal"?"terminal-mode":""} ${x==="screenshot"||x==="logs"?"screenshot-mode":""}`,children:t.jsxs("div",{className:"tab-content",children:[x==="omni"&&t.jsx("div",{className:"omni-inspector-tab-wrapper animate-fade-in",children:t.jsx(zc,{sessionId:R.session_id?String(R.session_id):null,udid:R.udid,streamUrl:ft(),embedded:!0,overlayTarget:g,onModeChange:p})}),x==="actions"&&t.jsxs("div",{className:"actions-grid",children:[t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(Ti,{size:18,color:"var(--color-accent)"})," Smart Input"]}),t.jsx("p",{className:"action-card-hint",children:"Relay keystrokes to the focused element on the device."}),t.jsx("input",{type:"text",className:"type-input-field compact",placeholder:"Type and press Enter to send…",value:C,onChange:v=>w(v.target.value),onKeyDown:v=>v.key==="Enter"&&It()})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(Rr,{size:18,color:"var(--color-accent)"})," App Management"]}),t.jsxs("div",{className:"app-mgmt-content",children:[t.jsxs("div",{className:"install-section",children:[t.jsx("p",{className:"compact-label",children:"Install Package"}),t.jsxs("div",{className:"upload-box-row",children:[t.jsxs("label",{className:"file-upload-launcher",title:Z?Z.name:"Select an .apk, .ipa or .app file",children:[t.jsx(Pi,{size:14}),t.jsx("span",{children:Z?Z.name:"Select File"}),t.jsx("input",{type:"file",accept:".apk,.ipa,.app",onChange:v=>{var N;return ne(((N=v.target.files)==null?void 0:N[0])||null)},hidden:!0})]}),t.jsx("button",{className:"btn-premium btn-sm",disabled:!Z||se,onClick:I,children:se?t.jsx(rs,{className:"animate-spin",size:14}):"INSTALL"})]}),t.jsx("p",{className:"hint-text",children:"Accepts .apk, .ipa or .app"})]}),t.jsx("div",{className:"divider-v"}),t.jsxs("div",{className:"uninstall-section",children:[t.jsx("p",{className:"compact-label",children:"Quick Uninstall"}),t.jsxs("div",{className:"uninstall-controls-row",children:[t.jsxs("div",{className:"select-wrapper",children:[t.jsxs(Jt,{selectSize:"sm",className:"w-full",value:E,onChange:v=>L(v.target.value),disabled:ue,children:[t.jsx("option",{value:"",children:ue?"Loading apps...":"-- Select App to Remove --"}),He.map(v=>t.jsx("option",{value:v,children:v},v))]}),ue&&t.jsx(rs,{className:"animate-spin select-loader",size:12})]}),t.jsxs("button",{className:"btn-destructive btn-sm",onClick:_,disabled:!E||ue,children:[t.jsx(Ut,{size:14})," UNINSTALL"]})]}),t.jsxs("div",{className:"manual-input-box",children:[t.jsx("p",{className:"hint-text",children:"Or enter manually:"}),t.jsx("input",{type:"text",className:"type-input-field tiny",placeholder:"com.example.app",value:E,onChange:v=>L(v.target.value)})]})]})]})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(or,{size:18,color:"var(--color-accent)"})," Clipboard"]}),t.jsxs("div",{className:"clipboard-row",children:[t.jsx("button",{className:"btn-premium btn-sm",onClick:Mt,children:"FETCH VALUE"}),t.jsx("div",{className:"clipboard-display compact",children:j})]})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(kr,{size:18,color:"var(--color-accent)"})," Directional Gestures"]}),t.jsxs("div",{className:"gestures-grid-container",children:[t.jsxs("div",{className:"gestures-dpad",children:[t.jsx("div",{}),t.jsx("button",{className:"dpad-btn",onClick:()=>k("up"),children:t.jsx(nr,{size:24})}),t.jsx("div",{}),t.jsx("button",{className:"dpad-btn",onClick:()=>k("left"),children:t.jsx(ls,{size:24})}),t.jsx("div",{className:"dpad-center"}),t.jsx("button",{className:"dpad-btn",onClick:()=>k("right"),children:t.jsx(Rn,{size:24})}),t.jsx("div",{}),t.jsx("button",{className:"dpad-btn",onClick:()=>k("down"),children:t.jsx(Nn,{size:24})}),t.jsx("div",{})]}),t.jsx("p",{className:"compact-label dpad-caption",children:"Quick swipe in a direction"})]})]})]}),x==="screenshot"&&t.jsxs("div",{className:"action-card screenshot-card",children:[M.length>0&&t.jsx("header",{className:"action-card-header",children:t.jsx("button",{className:"btn-text-only",onClick:_t,children:"CLEAR ALL"})}),t.jsxs("div",{className:`screenshot-workspace ${M.length===0?"is-empty":""}`,children:[t.jsxs("div",{className:"screenshot-gallery-sidebar",children:[t.jsxs("button",{className:"btn-premium take-screenshot-btn",onClick:Lt,disabled:V,children:[V?t.jsx(rs,{className:"animate-spin",size:16}):t.jsx(os,{size:16}),t.jsx("span",{children:V?"CAPTURING...":"NEW CAPTURE"})]}),t.jsxs("div",{className:"screenshot-thumbnails-list",children:[M.length===0&&!V&&t.jsxs("div",{className:"empty-gallery-state",children:[t.jsx(os,{size:20,className:"empty-gallery-icon"}),t.jsx("p",{className:"empty-gallery-title",children:"No captures yet"}),t.jsx("p",{className:"empty-gallery-hint",children:"Grab a screenshot of the device to begin analysis."})]}),M.map((v,N)=>t.jsxs("div",{className:`screenshot-thumb-item ${P===N?"active":""}`,onClick:()=>G(N),children:[t.jsx("img",{src:`data:image/png;base64,${v.base64}`,alt:"Thumb"}),t.jsx("span",{className:"thumb-time",children:new Date(v.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),t.jsx("button",{className:"thumb-delete-btn",onClick:D=>{D.stopPropagation(),gt(v.id)},children:t.jsx(Ut,{size:12})})]},v.id))]})]}),t.jsx("div",{className:"screenshot-main-preview",children:P!==null&&M[P]?t.jsxs("div",{className:"preview-container",children:[t.jsx("div",{className:"preview-image-wrapper",children:t.jsx("img",{src:`data:image/png;base64,${M[P].base64}`,alt:"Selected Evidence"})}),t.jsxs("footer",{className:"preview-footer",children:[t.jsxs("div",{className:"preview-meta",children:[t.jsx("span",{className:"meta-label",children:"ID:"}),t.jsx("span",{className:"meta-value",children:M[P].id.substring(0,8)}),t.jsx("span",{className:"meta-divider",children:"|"}),t.jsx("span",{className:"meta-value",children:$i(M[P].timestamp)})]}),t.jsxs("div",{className:"preview-actions",children:[t.jsx("button",{className:"btn-premium btn-sm",onClick:()=>f(M[P].base64),children:"DOWNLOAD PNG"}),t.jsxs("button",{className:"btn-destructive btn-sm",onClick:()=>gt(M[P].id),children:[t.jsx(Ut,{size:14})," DELETE"]})]})]})]}):null})]})]}),x==="logs"&&t.jsx("div",{className:"action-card screenshot-card",children:t.jsx(rl,{udid:R.udid,platform:R.platform})}),x==="terminal"&&t.jsx("div",{className:"action-card full-height",children:t.jsx(Ec,{platform:(R.platform||"").toLowerCase(),prompt:`${(R.platform||"").toLowerCase()==="ios"?"ios":"adb"} $`,welcomeMessage:`Connected to ${R.name} (${R.udid}).
|
|
246
|
-
Internal Shell Environment.`,onCommand:async v=>{const N=await H.executeShell(R.udid,v);if(N.error)throw new Error(N.error);return N.output}})})]})})]})]}),R.session_id&&!String(R.session_id).startsWith("manual_")&&t.jsx(wi,{sessionId:String(R.session_id),mode:"slice",windowSec:60,variant:"floating"})]})}const ol=/^(INPUT|TEXTAREA|SELECT)$/;function cl({labelledBy:e,onClose:s,children:n,style:i,...r}){const a=d.useRef(null),c=d.useRef(s);return c.current=s,d.useEffect(()=>{const l=a.current;if(!l)return;const o=document.activeElement,u=[];for(let h=l;h.parentElement&&h!==document.body;h=h.parentElement)for(const p of Array.from(h.parentElement.children))p===h||p.hasAttribute("inert")||p.matches("[aria-live], script, style, link, template")||(p.setAttribute("inert",""),u.push(p));l.contains(document.activeElement)||l.focus();const m=h=>{if(h.key!=="Escape"||h.defaultPrevented)return;const p=h.target;ol.test(p.tagName)||p.isContentEditable||(h.preventDefault(),c.current())};return l.addEventListener("keydown",m),()=>{l.removeEventListener("keydown",m),u.forEach(h=>h.removeAttribute("inert")),o&&o.isConnected&&o!==document.body&&o.focus()}},[]),t.jsx("div",{ref:a,role:"dialog","aria-modal":"true","aria-labelledby":e,tabIndex:-1,style:{outline:"none",...i},...r,children:n})}const ll={status:"all",platform:"all",type:"all",q:""},di=["all",...mc],ui=["all","android","ios","tvos"],mi=["all","real","virtual"];function ys(e,s){return s.includes(e)?e:s[0]}function dl(e){const s=e.get("q")??"";return{status:ys(e.get("status"),di),platform:ys(e.get("platform"),ui),type:ys(e.get("type"),mi),q:s.trim()?s:""}}function ul(e){const s=new URLSearchParams;return e.status!=="all"&&s.set("status",e.status),e.platform!=="all"&&s.set("platform",e.platform),e.type!=="all"&&s.set("type",e.type),e.q.trim()&&s.set("q",e.q),s}function fi(e){return e.deviceType==="simulator"||e.deviceType==="emulator"?!0:!e.deviceType&&e.realDevice===!1}function Hs(e){const s=(e.platform||"").toLowerCase();return s==="android"||s==="ios"||s==="tvos"?s:null}function ml(e){const s=e.deviceType==="emulator"?"Emulator":e.deviceType==="simulator"?"Simulator":"";return[oi(e),e.name,e.manufacturer,e.model,Ms(e.platform),e.sdk,s,e.teamName,e.udid].filter(Boolean).join(" ").toLowerCase()}function Ht(e,s,n,i){if(i!=="status"&&s.status!=="all"&&Ws(e,n)!==s.status||i!=="platform"&&s.platform!=="all"&&Hs(e)!==s.platform||i!=="type"&&s.type!=="all"&&s.type==="virtual"!==fi(e))return!1;const r=s.q.toLowerCase().split(/\s+/).filter(Boolean);if(r.length===0)return!0;const a=ml(e);return r.every(c=>a.includes(c))}const vs=e=>Object.fromEntries(e.map(s=>[s,0]));function fl(e,s,n){const i=vs(di),r=vs(ui),a=vs(mi);for(const c of e){if(Ht(c,s,n,"status")&&(i.all+=1,i[Ws(c,n)]+=1),Ht(c,s,n,"platform")){r.all+=1;const l=Hs(c);l&&(r[l]+=1)}Ht(c,s,n,"type")&&(a.all+=1,a[fi(c)?"virtual":"real"]+=1)}return{status:i,platform:r,type:a}}function hl(e){return e.some(s=>Hs(s)==="tvos")}function pl(e){return e.status!=="all"||e.platform!=="all"||e.type!=="all"||e.q.trim()!==""}function gl(e,s){const n=i=>i===1?"device":"devices";return e===s?`${s} ${n(s)}`:`${e} of ${s} ${n(s)}`}function bn({name:e,value:s,anyValue:n,options:i,onChange:r}){const[a,c]=d.useState(!1),l=d.useRef(null),o=d.useRef(null),u=s!==n,m=i.find(g=>g.value===s),h=()=>{var g;c(!1),(g=o.current)==null||g.focus()},p=d.useCallback(g=>{const b=(g==null?void 0:g.querySelector('[aria-checked="true"]'))??(g==null?void 0:g.querySelector('[role="menuitemradio"]'));b==null||b.focus()},[]);return t.jsxs("span",{ref:l,className:`fm${u?" fm-set":""}`,children:[t.jsx("button",{ref:o,type:"button",className:"fm-trigger","aria-haspopup":"menu","aria-expanded":a,onClick:()=>c(g=>!g),children:u?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"fm-name",children:[e,":"]})," ",(m==null?void 0:m.label)??s]}):t.jsxs(t.Fragment,{children:[t.jsx(An,{size:12,"aria-hidden":"true"}),e]})}),u&&t.jsx("button",{type:"button",className:"fm-clear","aria-label":`Clear ${e.toLowerCase()} filter`,onClick:()=>{r(n),h()},children:t.jsx($s,{size:12,"aria-hidden":"true"})}),t.jsx(Jn,{open:a,onClose:h,anchorRef:l,placement:"bottom-start",children:t.jsx("div",{ref:p,children:t.jsx(ii,{children:i.map(g=>t.jsx(Fe,{checked:g.value===s,note:g.note,trailing:t.jsx("span",{className:"fm-count",children:g.count}),onClick:()=>{r(g.value),h()},children:g.label},g.value))})})})]})}class xl extends ye.Component{constructor(s){super(s),this.socketCleanups=[],this.refreshTimeout=null,this.searchRef=ye.createRef(),this.onSlash=n=>{var a,c;if(n.key!=="/"||n.ctrlKey||n.altKey||n.metaKey||this.props.params.udid)return;const i=n.target;(a=i==null?void 0:i.closest)!=null&&a.call(i,'input, textarea, select, [contenteditable]:not([contenteditable="false"])')||(n.preventDefault(),(c=this.searchRef.current)==null||c.focus())},this.clearFilters=()=>{var n;this.props.onFiltersChange(ll),(n=this.searchRef.current)==null||n.focus()},this.state={devices:[],activeSessionsCount:0,pendingSessionsCount:0,queueSummary:null,loaded:!1}}componentDidMount(){this.fetchDevices(),this.devicePolling=setInterval(()=>{this.fetchDevices()},1e4);const s=this.props.onSocketEvent("device_unblocked",()=>{this.fetchDevicesDebounced()}),n=this.props.onSocketEvent("device_blocked",()=>{this.fetchDevicesDebounced()});this.socketCleanups.push(s,n),document.addEventListener("keydown",this.onSlash)}componentWillUnmount(){this.devicePolling&&(clearInterval(this.devicePolling),this.devicePolling=void 0),this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null),this.socketCleanups.forEach(s=>s()),document.removeEventListener("keydown",this.onSlash)}fetchDevicesDebounced(){this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshTimeout=setTimeout(()=>{this.refreshTimeout=null,this.fetchDevices()},500)}getBusyDevicesCount(s){return s.filter(n=>n.busy).length}async fetchDevices(){try{const s=await H.getDevices(),n=this.getBusyDevicesCount(s),i=await H.getPendingSessionsCount(),r=await H.getQueueSummary();this.setState({devices:s,activeSessionsCount:n,pendingSessionsCount:i,queueSummary:r,loaded:!0})}catch(s){console.log(s),this.setState({loaded:!0})}}setFilters(s){this.props.onFiltersChange({...this.props.filters,...s})}getFiltered(){const s=Date.now();return this.state.devices.filter(n=>Ht(n,this.props.filters,s))}render(){const s=this.getFiltered(),{udid:n}=this.props.params,i=n?this.state.devices.find(u=>u.udid===n):null,{filters:r}=this.props,a=fl(this.state.devices,r,Date.now()),c=[{value:"all",label:"Any platform",count:a.platform.all},{value:"android",label:"Android",count:a.platform.android},{value:"ios",label:"iOS",count:a.platform.ios}];(hl(this.state.devices)||r.platform==="tvos")&&c.push({value:"tvos",label:"tvOS",count:a.platform.tvos});const l=[{value:"all",label:"Any type",count:a.type.all},{value:"real",label:"Real devices",count:a.type.real},{value:"virtual",label:"Virtual",note:"Simulators and emulators",count:a.type.virtual}],o=`/devices${this.props.locationSearch}`;return t.jsxs("div",{className:"device-explorer-container",children:[t.jsxs("div",{className:"de2-sticky-group",children:[t.jsx(ji,{icon:bs,title:"Devices",subtitle:`${this.state.devices.length} device${this.state.devices.length===1?"":"s"} registered across the global pool.`}),t.jsxs("div",{className:"de2-toolbar",children:[t.jsx(zi,{size:"sm",label:"Status",value:r.status,onChange:u=>this.setFilters({status:u}),segments:[{value:"all",label:"All",count:a.status.all},{value:"ready",label:"Ready",tone:"ready",count:a.status.ready},{value:"busy",label:"Busy",tone:"busy",count:a.status.busy},{value:"reserved",label:"Reserved",tone:"reserved",count:a.status.reserved},{value:"maintenance",label:"Maintenance",tone:"maintenance",count:a.status.maintenance},{value:"offline",label:"Offline",tone:"offline",count:a.status.offline}]}),t.jsxs("div",{className:"de2-toolbar-row",children:[t.jsxs("div",{className:"de2-search-wrap",children:[t.jsx(wn,{size:13,className:"de2-search-icon","aria-hidden":"true"}),t.jsx("input",{ref:this.searchRef,type:"text",className:"de2-search","aria-label":"Search devices",placeholder:"Search name, model or UDID…",value:r.q,onChange:u=>this.setFilters({q:u.target.value})}),t.jsx("kbd",{className:"de2-key","aria-hidden":"true",children:"/"})]}),t.jsx(bn,{name:"Platform",value:r.platform,anyValue:"all",options:c,onChange:u=>this.setFilters({platform:u})}),t.jsx(bn,{name:"Type",value:r.type,anyValue:"all",options:l,onChange:u=>this.setFilters({type:u})}),pl(r)&&t.jsx(Ke,{variant:"ghost",size:"sm",onClick:this.clearFilters,children:"Clear"}),t.jsxs("div",{className:"de2-result",children:[this.state.loaded&&t.jsx("span",{"aria-live":"polite",children:gl(s.length,this.state.devices.length)}),t.jsx(Ke,{variant:"secondary",size:"icon","aria-label":"Refresh devices",title:"Refresh",onClick:()=>this.fetchDevices(),children:t.jsx(as,{size:13,"aria-hidden":"true"})})]})]})]})]}),s.length>0?t.jsx(wc,{devices:s,reloadDevices:()=>this.fetchDevices()}):t.jsxs("div",{className:"device-explorer-empty stagger-1",children:[t.jsx("div",{className:"device-explorer-empty-icon",children:this.state.loaded?t.jsx(bs,{size:32}):t.jsx(as,{size:32,className:"animate-spin"})}),this.state.loaded?this.state.devices.length===0?t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Global Device Registry Empty"}),t.jsx("p",{children:"Xenon hasn't detected any active device nodes in your infrastructure. Ensure your device farm is connected and heartbeat signals are active."}),t.jsxs(Ke,{variant:"primary",onClick:()=>this.fetchDevices(),children:[t.jsx(as,{size:14}),"Manual sync"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"No devices match these filters"}),t.jsx("p",{children:"Try another filter or search, or clear them to see every device."}),t.jsx(Ke,{variant:"secondary",onClick:this.clearFilters,children:"Clear filters"})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Loading devices…"}),t.jsx("p",{children:"Syncing the global device registry."})]})]}),i&&t.jsx(cl,{className:"device-control-modal-overlay",labelledBy:"device-control-title",onClose:()=>this.props.navigate(o),children:t.jsx("div",{className:"device-control-modal",children:t.jsx(al,{device:i,titleId:"device-control-title",onClose:()=>this.props.navigate(o)})})})]})}}function Vl(){const e=Cn(),s=Ts(),n=Ds(),[i,r]=vi(),{on:a}=bi();return t.jsx(xl,{params:e,navigate:s,onSocketEvent:a,filters:dl(i),onFiltersChange:c=>r(ul(c),{replace:!0}),locationSearch:n.search})}export{xl as DeviceExplorer,Vl as default};
|