@xenon-device-management/xenon 1.7.0 → 1.7.1
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-BSN8crwz.js → ApiKeyGate-DBl_AZ8N.js} +1 -1
- package/lib/public/assets/{BugReportButton-DNja1wQ1.js → BugReportButton-Cz4aeGCX.js} +1 -1
- package/lib/public/assets/{DeviceMosaicView-DVk1IpIR.js → DeviceMosaicView-DP4AanNV.js} +1 -1
- package/lib/public/assets/{EmptyState-CqQ21n-H.js → EmptyState-BwaAbjZt.js} +1 -1
- package/lib/public/assets/{FieldGroup-DE3u01Nu.js → FieldGroup-CGdoHDQ3.js} +1 -1
- package/lib/public/assets/{Modal-BJcFdiBP.js → Modal-OY-an2g6.js} +1 -1
- package/lib/public/assets/{SegmentedControl-CSHjmrvy.js → SegmentedControl-C_gsCi2P.js} +1 -1
- package/lib/public/assets/{SettingCard-M-lFn_Wm.js → SettingCard-CRlStb6_.js} +1 -1
- package/lib/public/assets/{Table-B3EUgBi6.js → Table-CbmGiPJe.js} +1 -1
- package/lib/public/assets/{activity-DK3R5GAb.js → activity-BhRPBZ3G.js} +1 -1
- package/lib/public/assets/{ai-settings-AKMDh8pd.js → ai-settings-DteGlf4r.js} +1 -1
- package/lib/public/assets/{api-keys-B5Q1EkGN.js → api-keys-BmikiaSF.js} +1 -1
- package/lib/public/assets/{apps-CWWrkTZW.js → apps-BfEC5qsb.js} +1 -1
- package/lib/public/assets/apps-DS59NYjg.css +1 -0
- package/lib/public/assets/{arrow-left-9933DNlF.js → arrow-left-y_SSjJz-.js} +1 -1
- package/lib/public/assets/{arrow-up-right-B7q_1mXs.js → arrow-up-right-NQ8ZGfd3.js} +1 -1
- package/lib/public/assets/{builds-page-DgWXOgh5.js → builds-page-DkLt4J8-.js} +2 -2
- package/lib/public/assets/{button-lkxVyarW.js → button-wz7ra9cW.js} +1 -1
- package/lib/public/assets/{check-BkT38An9.js → check-CV94AcJF.js} +1 -1
- package/lib/public/assets/{chevron-right-WELZ1Z8v.js → chevron-right-_iIkyWqd.js} +1 -1
- package/lib/public/assets/{circle-check--2DSsfaI.js → circle-check-0COJnxUq.js} +1 -1
- package/lib/public/assets/{circle-x-x7R8vTBo.js → circle-x-DGNoObyH.js} +1 -1
- package/lib/public/assets/{clock-DIpGd4Pn.js → clock-DwtXByAH.js} +1 -1
- package/lib/public/assets/{copy-CEcFYYHm.js → copy-DL_iD5Dh.js} +1 -1
- package/lib/public/assets/device-explorer-CKcXaWmZ.css +1 -0
- package/lib/public/assets/device-explorer-CpC-MZNT.js +210 -0
- package/lib/public/assets/{download-CaKkGvKw.js → download-aeG6Qqs8.js} +1 -1
- package/lib/public/assets/{forgot-password-CsAF11d2.js → forgot-password-Cu05XOKH.js} +1 -1
- package/lib/public/assets/{funnel-D2rLIKlM.js → funnel-ChogDM6h.js} +1 -1
- package/lib/public/assets/{index-BrVV0Kla.js → index-CkwQBzCl.js} +2 -2
- package/lib/public/assets/index-gXUPv-oo.css +1 -0
- package/lib/public/assets/{layers-DZwF8z_0.js → layers-a5nj78PI.js} +1 -1
- package/lib/public/assets/{lock-CVUUnm1V.js → lock-CqQvL12G.js} +1 -1
- package/lib/public/assets/{login-BavGkTli.js → login-DoaCgEPu.js} +1 -1
- package/lib/public/assets/{maintenance-settings-Vr_u8hoR.js → maintenance-settings-CBnV_5Rl.js} +1 -1
- package/lib/public/assets/{mouse-pointer-2-n4xUMxHJ.js → mouse-pointer-2-De_oynWc.js} +1 -1
- package/lib/public/assets/{overview-DVgoOoYF.js → overview-DvyGTzku.js} +1 -1
- package/lib/public/assets/{page-header-C0pnt4xz.js → page-header-BeUDGs-O.js} +1 -1
- package/lib/public/assets/{plus-BObE-_z6.js → plus-BM5UAzcK.js} +1 -1
- package/lib/public/assets/{profile-page-DNKD4MS2.js → profile-page-Cner_Muq.js} +1 -1
- package/lib/public/assets/{reset-password-C2gSMy8a.js → reset-password-BKWBemnU.js} +1 -1
- package/lib/public/assets/{runbook-page-BRxjWJVQ.js → runbook-page-CXZdhAjc.js} +1 -1
- package/lib/public/assets/{selector-detail-page-DcV8jQuX.js → selector-detail-page-C6yA7Lwl.js} +1 -1
- package/lib/public/assets/{selector-health-DraY2a4b.js → selector-health-BWOVdnlp.js} +1 -1
- package/lib/public/assets/{selector-health-page-tb5e3CXy.js → selector-health-page-CrR7bh4f.js} +2 -2
- package/lib/public/assets/{session-detail-page-CEtQr37W.js → session-detail-page-DzW5PcxL.js} +1 -1
- package/lib/public/assets/{settings-Cr-YjLbX.js → settings-COrR3YcC.js} +1 -1
- package/lib/public/assets/{shield-BBc4qisQ.js → shield-CAA9vrIs.js} +1 -1
- package/lib/public/assets/{shield-alert-BfoPJ8q_.js → shield-alert-Dm3Oz4Kc.js} +1 -1
- package/lib/public/assets/{status-pill-outline-Cc4PF7Mg.js → status-pill-outline-3FA5raqd.js} +1 -1
- package/lib/public/assets/{tablet-CaOqzQv_.js → tablet-CWU6hxZF.js} +1 -1
- package/lib/public/assets/{teams-B3Tt_9i2.js → teams-xa_B0pyz.js} +1 -1
- package/lib/public/assets/{trash-2-CE5TRHb2.js → trash-2-DUWA0N9n.js} +1 -1
- package/lib/public/assets/{useSocket-Bkt5i-U6.js → useSocket-lsg6f_Dn.js} +1 -1
- package/lib/public/assets/{users-BIvjvjM6.js → users-DJDpKaGy.js} +1 -1
- package/lib/public/assets/{webhook-settings-dAp8wwEB.js → webhook-settings-BPf_iC_h.js} +1 -1
- package/lib/public/assets/{zap-BzdRuL9F.js → zap-D8JQHaNH.js} +1 -1
- package/lib/public/index.html +2 -2
- package/lib/src/app/routers/auth.js +19 -2
- package/lib/src/scripts/run-migrations.js +14 -3
- package/lib/test/unit/auth-me-auth-disabled.test.js +77 -0
- package/lib/test/unit/run-migrations-fail-fast.test.js +87 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/public/assets/apps-Dt5dUIag.css +0 -1
- package/lib/public/assets/device-explorer-3H1hf8ld.css +0 -1
- package/lib/public/assets/device-explorer-nV6L3w7x.js +0 -210
- package/lib/public/assets/index-Dz1K6OJU.css +0 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import{g as B,j as t,r as m,h as Dn,R as $n,i as Tn,k as ke,C as Ns,U as Mn,X as z,m as Xs,n as Ln,u as hs,b as In,o as rs,p as Cs,q as Ks,s as Ss,c as Ys,t as Tt,S as ks,v as As}from"./index-CkwQBzCl.js";import{P as _n}from"./page-header-BeUDGs-O.js";import{T as as,B as it,P as On,U as Pn}from"./button-wz7ra9cW.js";import{P as bt,B as zn}from"./BugReportButton-Cz4aeGCX.js";import{P as Nt,u as Ft,a as wt,b as Gs,c as fs,d as Fn,D as Bn,e as Rs,f as Hn,g as rt,h as Wn,M as Zs}from"./Modal-OY-an2g6.js";import{F as Ot}from"./FieldGroup-CGdoHDQ3.js";import{C as Js}from"./clock-DwtXByAH.js";import{P as Un}from"./plus-BM5UAzcK.js";import{C as yt}from"./copy-DL_iD5Dh.js";import{M as Vn,F as qn}from"./mouse-pointer-2-De_oynWc.js";import{L as Xn,C as Gt}from"./layers-a5nj78PI.js";import{C as Pt}from"./check-CV94AcJF.js";import{Z as Qs}from"./zap-D8JQHaNH.js";import{C as en}from"./chevron-right-_iIkyWqd.js";import{S as Zt}from"./shield-alert-Dm3Oz4Kc.js";import{A as gt,I as Jt}from"./keycodes-bIEJfQzr.js";import{L as Kn}from"./lock-CqQvL12G.js";import{T as Mt}from"./trash-2-DUWA0N9n.js";import{D as Yn}from"./download-aeG6Qqs8.js";import{S as Gn}from"./SegmentedControl-C_gsCi2P.js";import{u as Zn}from"./useSocket-lsg6f_Dn.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 Jn=[["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"}]],Qn=B("battery-low",Jn);/**
|
|
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 ei=[["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"}]],ti=B("battery-warning",ei);/**
|
|
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 si=[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],ni=B("battery",si);/**
|
|
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 ii=[["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"}]],ri=B("box",ii);/**
|
|
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 ai=[["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"}]],oi=B("calendar-plus",ai);/**
|
|
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 ci=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],xt=B("camera",ci);/**
|
|
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 li=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],di=B("chevron-up",li);/**
|
|
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 ui=[["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"}]],mi=B("circle-question-mark",ui);/**
|
|
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 hi=[["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"}]],fi=B("clipboard",hi);/**
|
|
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 pi=[["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"}]],Es=B("code-xml",pi);/**
|
|
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 gi=[["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"}]],xi=B("crosshair",gi);/**
|
|
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 yi=[["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"}]],vi=B("ellipsis",yi);/**
|
|
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 bi=[["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"}]],wi=B("grid-3x3",bi);/**
|
|
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 ji=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Ni=B("house",ji);/**
|
|
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 Ci=[["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"}]],Si=B("lightbulb",Ci);/**
|
|
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 ki=[["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"}]],Ai=B("lock-open",ki);/**
|
|
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 Ri=[["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"}]],Ei=B("map-pin",Ri);/**
|
|
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 Di=[["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"}]],$i=B("message-square",Di);/**
|
|
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 Ti=[["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"}]],Mi=B("move",Ti);/**
|
|
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 Li=[["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"}]],Ii=B("panels-top-left",Li);/**
|
|
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 _i=[["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=B("rotate-cw",_i);/**
|
|
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 Oi=[["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"}]],Pi=B("scroll-text",Oi);/**
|
|
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 zi=[["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"}]],os=B("sparkles",zi);/**
|
|
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 Fi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Bi=B("square",Fi);/**
|
|
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 Hi=[["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"}]],Wi=B("tag",Hi);/**
|
|
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 Ui=[["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"}]],Qt=B("target",Ui);/**
|
|
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 Vi=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],qi=B("thermometer",Vi);/**
|
|
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 Xi=[["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"}]],Ki=B("touchpad",Xi);/**
|
|
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 Yi=[["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"}]],Gi=B("volume-1",Yi);/**
|
|
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 Zi=[["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"}]],Ji=B("volume-2",Zi);/**
|
|
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 Qi=[["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"}]],er=B("wifi",Qi);function tr(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 sr=(e,s)=>s===1?e:`${e}s`,nr=1e-7;function Ds(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=(r,l)=>{const d=Math.floor(r*10**l+nr);return(Math.round(d)/10**l).toFixed(l)},a=(r,l,d,u)=>{if((n.length===0||!s.colonNotation)&&r===0&&!(s.colonNotation&&d==="m"))return;u=(u||r||"0").toString();let c,h;if(s.colonNotation){c=n.length>0?":":"",h="";const x=u.includes(".")?u.split(".")[0].length:u.length,g=n.length>0?2:1;u="0".repeat(Math.max(0,g-x))+u}else c="",h=s.verbose?" "+sr(l,r):d;n.push(c+u+h)},o=tr(e);if(a(Math.trunc(o.days/365),"year","y"),a(o.days%365,"day","d"),a(o.hours,"hour","h"),a(o.minutes,"minute","m"),s.separateMilliseconds||s.formatSubMilliseconds||!s.colonNotation&&e<1e3)if(a(o.seconds,"second","s"),s.formatSubMilliseconds)a(o.milliseconds,"millisecond","ms"),a(o.microseconds,"microsecond","µs"),a(o.nanoseconds,"nanosecond","ns");else{const r=o.milliseconds+o.microseconds/1e3+o.nanoseconds/1e6,l=typeof s.millisecondsDecimalDigits=="number"?s.millisecondsDecimalDigits:0,d=r>=1?Math.round(r):Math.ceil(r),u=l?r.toFixed(l):d;a(Number.parseFloat(u),"millisecond","ms",u)}else{const r=e/1e3%60,l=typeof s.secondsDecimalDigits=="number"?s.secondsDecimalDigits:1,d=i(r,l),u=s.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");a(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 r=s.colonNotation?"":" ";return n.slice(0,Math.max(s.unitCount,1)).join(r)}return s.colonNotation?n.join(""):n.join(" ")}const ir=({kind:e,size:s=6,className:n})=>t.jsx("span",{className:`status-dot status-dot-${e}${n?" "+n:""}`,style:{width:s,height:s},"aria-hidden":!0}),rr=({kind:e,showDot:s,children:n})=>t.jsxs("span",{className:`status-code status-code-${e}`,children:[s&&t.jsx(ir,{kind:e}),t.jsx("span",{className:"status-code-label",children:String(n).toUpperCase()})]}),$s=({label:e,value:s,mono:n,valueClassName:i})=>t.jsxs("div",{className:"kv-row",children:[t.jsx("span",{className:"kv-label",children:e}),t.jsx("span",{className:`kv-value${n?" kv-value-mono":""}${i?" "+i:""}`,children:s})]}),ar=["top","right","bottom","left"],Fe=Math.min,he=Math.max,Bt=Math.round,Lt=Math.floor,Re=e=>({x:e,y:e}),or={left:"right",right:"left",bottom:"top",top:"bottom"};function cs(e,s,n){return he(e,Fe(s,n))}function Le(e,s){return typeof e=="function"?e(s):e}function Ie(e){return e.split("-")[0]}function lt(e){return e.split("-")[1]}function ps(e){return e==="x"?"y":"x"}function gs(e){return e==="y"?"height":"width"}function Ae(e){const s=e[0];return s==="t"||s==="b"?"y":"x"}function xs(e){return ps(Ae(e))}function cr(e,s,n){n===void 0&&(n=!1);const i=lt(e),a=xs(e),o=gs(a);let r=a==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return s.reference[o]>s.floating[o]&&(r=Ht(r)),[r,Ht(r)]}function lr(e){const s=Ht(e);return[ls(e),s,ls(s)]}function ls(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ts=["left","right"],Ms=["right","left"],dr=["top","bottom"],ur=["bottom","top"];function mr(e,s,n){switch(e){case"top":case"bottom":return n?s?Ms:Ts:s?Ts:Ms;case"left":case"right":return s?dr:ur;default:return[]}}function hr(e,s,n,i){const a=lt(e);let o=mr(Ie(e),n==="start",i);return a&&(o=o.map(r=>r+"-"+a),s&&(o=o.concat(o.map(ls)))),o}function Ht(e){const s=Ie(e);return or[s]+e.slice(s.length)}function fr(e){return{top:0,right:0,bottom:0,left:0,...e}}function tn(e){return typeof e!="number"?fr(e):{top:e,right:e,bottom:e,left:e}}function Wt(e){const{x:s,y:n,width:i,height:a}=e;return{width:i,height:a,top:n,left:s,right:s+i,bottom:n+a,x:s,y:n}}function Ls(e,s,n){let{reference:i,floating:a}=e;const o=Ae(s),r=xs(s),l=gs(r),d=Ie(s),u=o==="y",c=i.x+i.width/2-a.width/2,h=i.y+i.height/2-a.height/2,x=i[l]/2-a[l]/2;let g;switch(d){case"top":g={x:c,y:i.y-a.height};break;case"bottom":g={x:c,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:h};break;case"left":g={x:i.x-a.width,y:h};break;default:g={x:i.x,y:i.y}}switch(lt(s)){case"start":g[r]-=x*(n&&u?-1:1);break;case"end":g[r]+=x*(n&&u?-1:1);break}return g}async function pr(e,s){var n;s===void 0&&(s={});const{x:i,y:a,platform:o,rects:r,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:x=!1,padding:g=0}=Le(s,e),b=tn(g),p=l[x?h==="floating"?"reference":"floating":h],S=Wt(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(p)))==null||n?p:p.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:d})),j=h==="floating"?{x:i,y:a,width:r.floating.width,height:r.floating.height}:r.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),v=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Wt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:j,offsetParent:w,strategy:d}):j);return{top:(S.top-E.top+b.top)/v.y,bottom:(E.bottom-S.bottom+b.bottom)/v.y,left:(S.left-E.left+b.left)/v.x,right:(E.right-S.right+b.right)/v.x}}const gr=50,xr=async(e,s,n)=>{const{placement:i="bottom",strategy:a="absolute",middleware:o=[],platform:r}=n,l=r.detectOverflow?r:{...r,detectOverflow:pr},d=await(r.isRTL==null?void 0:r.isRTL(s));let u=await r.getElementRects({reference:e,floating:s,strategy:a}),{x:c,y:h}=Ls(u,i,d),x=i,g=0;const b={};for(let y=0;y<o.length;y++){const p=o[y];if(!p)continue;const{name:S,fn:j}=p,{x:w,y:v,data:E,reset:R}=await j({x:c,y:h,initialPlacement:i,placement:x,strategy:a,middlewareData:b,rects:u,platform:l,elements:{reference:e,floating:s}});c=w??c,h=v??h,b[S]={...b[S],...E},R&&g<gr&&(g++,typeof R=="object"&&(R.placement&&(x=R.placement),R.rects&&(u=R.rects===!0?await r.getElementRects({reference:e,floating:s,strategy:a}):R.rects),{x:c,y:h}=Ls(u,x,d)),y=-1)}return{x:c,y:h,placement:x,strategy:a,middlewareData:b}},yr=e=>({name:"arrow",options:e,async fn(s){const{x:n,y:i,placement:a,rects:o,platform:r,elements:l,middlewareData:d}=s,{element:u,padding:c=0}=Le(e,s)||{};if(u==null)return{};const h=tn(c),x={x:n,y:i},g=xs(a),b=gs(g),y=await r.getDimensions(u),p=g==="y",S=p?"top":"left",j=p?"bottom":"right",w=p?"clientHeight":"clientWidth",v=o.reference[b]+o.reference[g]-x[g]-o.floating[b],E=x[g]-o.reference[g],R=await(r.getOffsetParent==null?void 0:r.getOffsetParent(u));let T=R?R[w]:0;(!T||!await(r.isElement==null?void 0:r.isElement(R)))&&(T=l.floating[w]||o.floating[b]);const M=v/2-E/2,V=T/2-y[b]/2-1,I=Fe(h[S],V),K=Fe(h[j],V),Y=I,G=T-y[b]-K,N=T/2-y[b]/2+M,se=cs(Y,N,G),O=!d.arrow&<(a)!=null&&N!==se&&o.reference[b]/2-(N<Y?I:K)-y[b]/2<0,J=O?N<Y?N-Y:N-G:0;return{[g]:x[g]+J,data:{[g]:se,centerOffset:N-se-J,...O&&{alignmentOffset:J}},reset:O}}}),vr=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(s){var n,i;const{placement:a,middlewareData:o,rects:r,initialPlacement:l,platform:d,elements:u}=s,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...p}=Le(e,s);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Ie(a),j=Ae(l),w=Ie(l)===l,v=await(d.isRTL==null?void 0:d.isRTL(u.floating)),E=x||(w||!y?[Ht(l)]:lr(l)),R=b!=="none";!x&&R&&E.push(...hr(l,y,b,v));const T=[l,...E],M=await d.detectOverflow(s,p),V=[];let I=((i=o.flip)==null?void 0:i.overflows)||[];if(c&&V.push(M[S]),h){const N=cr(a,r,v);V.push(M[N[0]],M[N[1]])}if(I=[...I,{placement:a,overflows:V}],!V.every(N=>N<=0)){var K,Y;const N=(((K=o.flip)==null?void 0:K.index)||0)+1,se=T[N];if(se&&(!(h==="alignment"?j!==Ae(se):!1)||I.every(_=>Ae(_.placement)===j?_.overflows[0]>0:!0)))return{data:{index:N,overflows:I},reset:{placement:se}};let O=(Y=I.filter(J=>J.overflows[0]<=0).sort((J,_)=>J.overflows[1]-_.overflows[1])[0])==null?void 0:Y.placement;if(!O)switch(g){case"bestFit":{var G;const J=(G=I.filter(_=>{if(R){const Q=Ae(_.placement);return Q===j||Q==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(Q=>Q>0).reduce((Q,re)=>Q+re,0)]).sort((_,Q)=>_[1]-Q[1])[0])==null?void 0:G[0];J&&(O=J);break}case"initialPlacement":O=l;break}if(a!==O)return{reset:{placement:O}}}return{}}}};function Is(e,s){return{top:e.top-s.height,right:e.right-s.width,bottom:e.bottom-s.height,left:e.left-s.width}}function _s(e){return ar.some(s=>e[s]>=0)}const br=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(s){const{rects:n,platform:i}=s,{strategy:a="referenceHidden",...o}=Le(e,s);switch(a){case"referenceHidden":{const r=await i.detectOverflow(s,{...o,elementContext:"reference"}),l=Is(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:_s(l)}}}case"escaped":{const r=await i.detectOverflow(s,{...o,altBoundary:!0}),l=Is(r,n.floating);return{data:{escapedOffsets:l,escaped:_s(l)}}}default:return{}}}}},sn=new Set(["left","top"]);async function wr(e,s){const{placement:n,platform:i,elements:a}=e,o=await(i.isRTL==null?void 0:i.isRTL(a.floating)),r=Ie(n),l=lt(n),d=Ae(n)==="y",u=sn.has(r)?-1:1,c=o&&d?-1:1,h=Le(s,e);let{mainAxis:x,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),d?{x:g*c,y:x*u}:{x:x*u,y:g*c}}const jr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(s){var n,i;const{x:a,y:o,placement:r,middlewareData:l}=s,d=await wr(s,e);return r===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:a+d.x,y:o+d.y,data:{...d,placement:r}}}}},Nr=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(s){const{x:n,y:i,placement:a,platform:o}=s,{mainAxis:r=!0,crossAxis:l=!1,limiter:d={fn:S=>{let{x:j,y:w}=S;return{x:j,y:w}}},...u}=Le(e,s),c={x:n,y:i},h=await o.detectOverflow(s,u),x=Ae(Ie(a)),g=ps(x);let b=c[g],y=c[x];if(r){const S=g==="y"?"top":"left",j=g==="y"?"bottom":"right",w=b+h[S],v=b-h[j];b=cs(w,b,v)}if(l){const S=x==="y"?"top":"left",j=x==="y"?"bottom":"right",w=y+h[S],v=y-h[j];y=cs(w,y,v)}const p=d.fn({...s,[g]:b,[x]:y});return{...p,data:{x:p.x-n,y:p.y-i,enabled:{[g]:r,[x]:l}}}}}},Cr=function(e){return e===void 0&&(e={}),{options:e,fn(s){const{x:n,y:i,placement:a,rects:o,middlewareData:r}=s,{offset:l=0,mainAxis:d=!0,crossAxis:u=!0}=Le(e,s),c={x:n,y:i},h=Ae(a),x=ps(h);let g=c[x],b=c[h];const y=Le(l,s),p=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(d){const w=x==="y"?"height":"width",v=o.reference[x]-o.floating[w]+p.mainAxis,E=o.reference[x]+o.reference[w]-p.mainAxis;g<v?g=v:g>E&&(g=E)}if(u){var S,j;const w=x==="y"?"width":"height",v=sn.has(Ie(a)),E=o.reference[h]-o.floating[w]+(v&&((S=r.offset)==null?void 0:S[h])||0)+(v?0:p.crossAxis),R=o.reference[h]+o.reference[w]+(v?0:((j=r.offset)==null?void 0:j[h])||0)-(v?p.crossAxis:0);b<E?b=E:b>R&&(b=R)}return{[x]:g,[h]:b}}}},Sr=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(s){var n,i;const{placement:a,rects:o,platform:r,elements:l}=s,{apply:d=()=>{},...u}=Le(e,s),c=await r.detectOverflow(s,u),h=Ie(a),x=lt(a),g=Ae(a)==="y",{width:b,height:y}=o.floating;let p,S;h==="top"||h==="bottom"?(p=h,S=x===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(S=h,p=x==="end"?"top":"bottom");const j=y-c.top-c.bottom,w=b-c.left-c.right,v=Fe(y-c[p],j),E=Fe(b-c[S],w),R=!s.middlewareData.shift;let T=v,M=E;if((n=s.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(i=s.middlewareData.shift)!=null&&i.enabled.y&&(T=j),R&&!x){const I=he(c.left,0),K=he(c.right,0),Y=he(c.top,0),G=he(c.bottom,0);g?M=b-2*(I!==0||K!==0?I+K:he(c.left,c.right)):T=y-2*(Y!==0||G!==0?Y+G:he(c.top,c.bottom))}await d({...s,availableWidth:M,availableHeight:T});const V=await r.getDimensions(l.floating);return b!==V.width||y!==V.height?{reset:{rects:!0}}:{}}}};function qt(){return typeof window<"u"}function dt(e){return nn(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var s;return(e==null||(s=e.ownerDocument)==null?void 0:s.defaultView)||window}function Ee(e){var s;return(s=(nn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:s.documentElement}function nn(e){return qt()?e instanceof Node||e instanceof fe(e).Node:!1}function je(e){return qt()?e instanceof Element||e instanceof fe(e).Element:!1}function Oe(e){return qt()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function Os(e){return!qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}function Ct(e){const{overflow:s,overflowX:n,overflowY:i,display:a}=Ne(e);return/auto|scroll|overlay|hidden|clip/.test(s+i+n)&&a!=="inline"&&a!=="contents"}function kr(e){return/^(table|td|th)$/.test(dt(e))}function Xt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Ar=/transform|translate|scale|rotate|perspective|filter/,Rr=/paint|layout|strict|content/,Ke=e=>!!e&&e!=="none";let es;function ys(e){const s=je(e)?Ne(e):e;return Ke(s.transform)||Ke(s.translate)||Ke(s.scale)||Ke(s.rotate)||Ke(s.perspective)||!vs()&&(Ke(s.backdropFilter)||Ke(s.filter))||Ar.test(s.willChange||"")||Rr.test(s.contain||"")}function Er(e){let s=Be(e);for(;Oe(s)&&!ot(s);){if(ys(s))return s;if(Xt(s))return null;s=Be(s)}return null}function vs(){return es==null&&(es=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),es}function ot(e){return/^(html|body|#document)$/.test(dt(e))}function Ne(e){return fe(e).getComputedStyle(e)}function Kt(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Be(e){if(dt(e)==="html")return e;const s=e.assignedSlot||e.parentNode||Os(e)&&e.host||Ee(e);return Os(s)?s.host:s}function rn(e){const s=Be(e);return ot(s)?e.ownerDocument?e.ownerDocument.body:e.body:Oe(s)&&Ct(s)?s:rn(s)}function jt(e,s,n){var i;s===void 0&&(s=[]),n===void 0&&(n=!0);const a=rn(e),o=a===((i=e.ownerDocument)==null?void 0:i.body),r=fe(a);if(o){const l=ds(r);return s.concat(r,r.visualViewport||[],Ct(a)?a:[],l&&n?jt(l):[])}else return s.concat(a,jt(a,[],n))}function ds(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function an(e){const s=Ne(e);let n=parseFloat(s.width)||0,i=parseFloat(s.height)||0;const a=Oe(e),o=a?e.offsetWidth:n,r=a?e.offsetHeight:i,l=Bt(n)!==o||Bt(i)!==r;return l&&(n=o,i=r),{width:n,height:i,$:l}}function bs(e){return je(e)?e:e.contextElement}function at(e){const s=bs(e);if(!Oe(s))return Re(1);const n=s.getBoundingClientRect(),{width:i,height:a,$:o}=an(s);let r=(o?Bt(n.width):n.width)/i,l=(o?Bt(n.height):n.height)/a;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Dr=Re(0);function on(e){const s=fe(e);return!vs()||!s.visualViewport?Dr:{x:s.visualViewport.offsetLeft,y:s.visualViewport.offsetTop}}function $r(e,s,n){return s===void 0&&(s=!1),!n||s&&n!==fe(e)?!1:s}function Ye(e,s,n,i){s===void 0&&(s=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=bs(e);let r=Re(1);s&&(i?je(i)&&(r=at(i)):r=at(e));const l=$r(o,n,i)?on(o):Re(0);let d=(a.left+l.x)/r.x,u=(a.top+l.y)/r.y,c=a.width/r.x,h=a.height/r.y;if(o){const x=fe(o),g=i&&je(i)?fe(i):i;let b=x,y=ds(b);for(;y&&i&&g!==b;){const p=at(y),S=y.getBoundingClientRect(),j=Ne(y),w=S.left+(y.clientLeft+parseFloat(j.paddingLeft))*p.x,v=S.top+(y.clientTop+parseFloat(j.paddingTop))*p.y;d*=p.x,u*=p.y,c*=p.x,h*=p.y,d+=w,u+=v,b=fe(y),y=ds(b)}}return Wt({width:c,height:h,x:d,y:u})}function Yt(e,s){const n=Kt(e).scrollLeft;return s?s.left+n:Ye(Ee(e)).left+n}function cn(e,s){const n=e.getBoundingClientRect(),i=n.left+s.scrollLeft-Yt(e,n),a=n.top+s.scrollTop;return{x:i,y:a}}function Tr(e){let{elements:s,rect:n,offsetParent:i,strategy:a}=e;const o=a==="fixed",r=Ee(i),l=s?Xt(s.floating):!1;if(i===r||l&&o)return n;let d={scrollLeft:0,scrollTop:0},u=Re(1);const c=Re(0),h=Oe(i);if((h||!h&&!o)&&((dt(i)!=="body"||Ct(r))&&(d=Kt(i)),h)){const g=Ye(i);u=at(i),c.x=g.x+i.clientLeft,c.y=g.y+i.clientTop}const x=r&&!h&&!o?cn(r,d):Re(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+c.x+x.x,y:n.y*u.y-d.scrollTop*u.y+c.y+x.y}}function Mr(e){return Array.from(e.getClientRects())}function Lr(e){const s=Ee(e),n=Kt(e),i=e.ownerDocument.body,a=he(s.scrollWidth,s.clientWidth,i.scrollWidth,i.clientWidth),o=he(s.scrollHeight,s.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+Yt(e);const l=-n.scrollTop;return Ne(i).direction==="rtl"&&(r+=he(s.clientWidth,i.clientWidth)-a),{width:a,height:o,x:r,y:l}}const Ps=25;function Ir(e,s){const n=fe(e),i=Ee(e),a=n.visualViewport;let o=i.clientWidth,r=i.clientHeight,l=0,d=0;if(a){o=a.width,r=a.height;const c=vs();(!c||c&&s==="fixed")&&(l=a.offsetLeft,d=a.offsetTop)}const u=Yt(i);if(u<=0){const c=i.ownerDocument,h=c.body,x=getComputedStyle(h),g=c.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,b=Math.abs(i.clientWidth-h.clientWidth-g);b<=Ps&&(o-=b)}else u<=Ps&&(o+=u);return{width:o,height:r,x:l,y:d}}function _r(e,s){const n=Ye(e,!0,s==="fixed"),i=n.top+e.clientTop,a=n.left+e.clientLeft,o=Oe(e)?at(e):Re(1),r=e.clientWidth*o.x,l=e.clientHeight*o.y,d=a*o.x,u=i*o.y;return{width:r,height:l,x:d,y:u}}function zs(e,s,n){let i;if(s==="viewport")i=Ir(e,n);else if(s==="document")i=Lr(Ee(e));else if(je(s))i=_r(s,n);else{const a=on(e);i={x:s.x-a.x,y:s.y-a.y,width:s.width,height:s.height}}return Wt(i)}function ln(e,s){const n=Be(e);return n===s||!je(n)||ot(n)?!1:Ne(n).position==="fixed"||ln(n,s)}function Or(e,s){const n=s.get(e);if(n)return n;let i=jt(e,[],!1).filter(l=>je(l)&&dt(l)!=="body"),a=null;const o=Ne(e).position==="fixed";let r=o?Be(e):e;for(;je(r)&&!ot(r);){const l=Ne(r),d=ys(r);!d&&l.position==="fixed"&&(a=null),(o?!d&&!a:!d&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Ct(r)&&!d&&ln(e,r))?i=i.filter(c=>c!==r):a=l,r=Be(r)}return s.set(e,i),i}function Pr(e){let{element:s,boundary:n,rootBoundary:i,strategy:a}=e;const r=[...n==="clippingAncestors"?Xt(s)?[]:Or(s,this._c):[].concat(n),i],l=zs(s,r[0],a);let d=l.top,u=l.right,c=l.bottom,h=l.left;for(let x=1;x<r.length;x++){const g=zs(s,r[x],a);d=he(g.top,d),u=Fe(g.right,u),c=Fe(g.bottom,c),h=he(g.left,h)}return{width:u-h,height:c-d,x:h,y:d}}function zr(e){const{width:s,height:n}=an(e);return{width:s,height:n}}function Fr(e,s,n){const i=Oe(s),a=Ee(s),o=n==="fixed",r=Ye(e,!0,o,s);let l={scrollLeft:0,scrollTop:0};const d=Re(0);function u(){d.x=Yt(a)}if(i||!i&&!o)if((dt(s)!=="body"||Ct(a))&&(l=Kt(s)),i){const g=Ye(s,!0,o,s);d.x=g.x+s.clientLeft,d.y=g.y+s.clientTop}else a&&u();o&&!i&&a&&u();const c=a&&!i&&!o?cn(a,l):Re(0),h=r.left+l.scrollLeft-d.x-c.x,x=r.top+l.scrollTop-d.y-c.y;return{x:h,y:x,width:r.width,height:r.height}}function ts(e){return Ne(e).position==="static"}function Fs(e,s){if(!Oe(e)||Ne(e).position==="fixed")return null;if(s)return s(e);let n=e.offsetParent;return Ee(e)===n&&(n=n.ownerDocument.body),n}function dn(e,s){const n=fe(e);if(Xt(e))return n;if(!Oe(e)){let a=Be(e);for(;a&&!ot(a);){if(je(a)&&!ts(a))return a;a=Be(a)}return n}let i=Fs(e,s);for(;i&&kr(i)&&ts(i);)i=Fs(i,s);return i&&ot(i)&&ts(i)&&!ys(i)?n:i||Er(e)||n}const Br=async function(e){const s=this.getOffsetParent||dn,n=this.getDimensions,i=await n(e.floating);return{reference:Fr(e.reference,await s(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Hr(e){return Ne(e).direction==="rtl"}const Wr={convertOffsetParentRelativeRectToViewportRelativeRect:Tr,getDocumentElement:Ee,getClippingRect:Pr,getOffsetParent:dn,getElementRects:Br,getClientRects:Mr,getDimensions:zr,getScale:at,isElement:je,isRTL:Hr};function un(e,s){return e.x===s.x&&e.y===s.y&&e.width===s.width&&e.height===s.height}function Ur(e,s){let n=null,i;const a=Ee(e);function o(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function r(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),o();const u=e.getBoundingClientRect(),{left:c,top:h,width:x,height:g}=u;if(l||s(),!x||!g)return;const b=Lt(h),y=Lt(a.clientWidth-(c+x)),p=Lt(a.clientHeight-(h+g)),S=Lt(c),w={rootMargin:-b+"px "+-y+"px "+-p+"px "+-S+"px",threshold:he(0,Fe(1,d))||1};let v=!0;function E(R){const T=R[0].intersectionRatio;if(T!==d){if(!v)return r();T?r(!1,T):i=setTimeout(()=>{r(!1,1e-7)},1e3)}T===1&&!un(u,e.getBoundingClientRect())&&r(),v=!1}try{n=new IntersectionObserver(E,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return r(!0),o}function Vr(e,s,n,i){i===void 0&&(i={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=i,u=bs(e),c=a||o?[...u?jt(u):[],...s?jt(s):[]]:[];c.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const h=u&&l?Ur(u,n):null;let x=-1,g=null;r&&(g=new ResizeObserver(S=>{let[j]=S;j&&j.target===u&&g&&s&&(g.unobserve(s),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(s)})),n()}),u&&!d&&g.observe(u),s&&g.observe(s));let b,y=d?Ye(e):null;d&&p();function p(){const S=Ye(e);y&&!un(y,S)&&n(),y=S,b=requestAnimationFrame(p)}return n(),()=>{var S;c.forEach(j=>{a&&j.removeEventListener("scroll",n),o&&j.removeEventListener("resize",n)}),h==null||h(),(S=g)==null||S.disconnect(),g=null,d&&cancelAnimationFrame(b)}}const qr=jr,Xr=Nr,Kr=vr,Yr=Sr,Gr=br,Bs=yr,Zr=Cr,Jr=(e,s,n)=>{const i=new Map,a={platform:Wr,...n},o={...a.platform,_c:i};return xr(e,s,{...a,platform:o})};var Qr=typeof document<"u",ea=function(){},zt=Qr?m.useLayoutEffect:ea;function Ut(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,a;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(!Ut(e[i],s[i]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(s).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(s,a[i]))return!1;for(i=n;i--!==0;){const o=a[i];if(!(o==="_owner"&&e.$$typeof)&&!Ut(e[o],s[o]))return!1}return!0}return e!==e&&s!==s}function mn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hs(e,s){const n=mn(e);return Math.round(s*n)/n}function ss(e){const s=m.useRef(e);return zt(()=>{s.current=e}),s}function ta(e){e===void 0&&(e={});const{placement:s="bottom",strategy:n="absolute",middleware:i=[],platform:a,elements:{reference:o,floating:r}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[c,h]=m.useState({x:0,y:0,strategy:n,placement:s,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(i);Ut(x,i)||g(i);const[b,y]=m.useState(null),[p,S]=m.useState(null),j=m.useCallback(_=>{_!==R.current&&(R.current=_,y(_))},[]),w=m.useCallback(_=>{_!==T.current&&(T.current=_,S(_))},[]),v=o||b,E=r||p,R=m.useRef(null),T=m.useRef(null),M=m.useRef(c),V=d!=null,I=ss(d),K=ss(a),Y=ss(u),G=m.useCallback(()=>{if(!R.current||!T.current)return;const _={placement:s,strategy:n,middleware:x};K.current&&(_.platform=K.current),Jr(R.current,T.current,_).then(Q=>{const re={...Q,isPositioned:Y.current!==!1};N.current&&!Ut(M.current,re)&&(M.current=re,Dn.flushSync(()=>{h(re)}))})},[x,s,n,K,Y]);zt(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(_=>({..._,isPositioned:!1})))},[u]);const N=m.useRef(!1);zt(()=>(N.current=!0,()=>{N.current=!1}),[]),zt(()=>{if(v&&(R.current=v),E&&(T.current=E),v&&E){if(I.current)return I.current(v,E,G);G()}},[v,E,G,I,V]);const se=m.useMemo(()=>({reference:R,floating:T,setReference:j,setFloating:w}),[j,w]),O=m.useMemo(()=>({reference:v,floating:E}),[v,E]),J=m.useMemo(()=>{const _={position:n,left:0,top:0};if(!O.floating)return _;const Q=Hs(O.floating,c.x),re=Hs(O.floating,c.y);return l?{..._,transform:"translate("+Q+"px, "+re+"px)",...mn(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:re}},[n,l,O.floating,c.x,c.y]);return m.useMemo(()=>({...c,update:G,refs:se,elements:O,floatingStyles:J}),[c,G,se,O,J])}const sa=e=>{function s(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:a}=typeof e=="function"?e(n):e;return i&&s(i)?i.current!=null?Bs({element:i.current,padding:a}).fn(n):{}:i?Bs({element:i,padding:a}).fn(n):{}}}},na=(e,s)=>{const n=qr(e);return{name:n.name,fn:n.fn,options:[e,s]}},ia=(e,s)=>{const n=Xr(e);return{name:n.name,fn:n.fn,options:[e,s]}},ra=(e,s)=>({fn:Zr(e).fn,options:[e,s]}),aa=(e,s)=>{const n=Kr(e);return{name:n.name,fn:n.fn,options:[e,s]}},oa=(e,s)=>{const n=Yr(e);return{name:n.name,fn:n.fn,options:[e,s]}},ca=(e,s)=>{const n=Gr(e);return{name:n.name,fn:n.fn,options:[e,s]}},la=(e,s)=>{const n=sa(e);return{name:n.name,fn:n.fn,options:[e,s]}};var da="Arrow",hn=m.forwardRef((e,s)=>{const{children:n,width:i=10,height:a=5,...o}=e;return t.jsx(Nt.svg,{...o,ref:s,width:i,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});hn.displayName=da;var ua=hn;function ma(e){const[s,n]=m.useState(void 0);return Ft(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let r,l;if("borderBoxSize"in o){const d=o.borderBoxSize,u=Array.isArray(d)?d[0]:d;r=u.inlineSize,l=u.blockSize}else r=e.offsetWidth,l=e.offsetHeight;n({width:r,height:l})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),s}var ws="Popper",[fn]=fs(ws),[ha,pn]=fn(ws),gn=e=>{const{__scopePopper:s,children:n}=e,[i,a]=m.useState(null);return t.jsx(ha,{scope:s,anchor:i,onAnchorChange:a,children:n})};gn.displayName=ws;var xn="PopperAnchor",yn=m.forwardRef((e,s)=>{const{__scopePopper:n,virtualRef:i,...a}=e,o=pn(xn,n),r=m.useRef(null),l=wt(s,r),d=m.useRef(null);return m.useEffect(()=>{const u=d.current;d.current=(i==null?void 0:i.current)||r.current,u!==d.current&&o.onAnchorChange(d.current)}),i?null:t.jsx(Nt.div,{...a,ref:l})});yn.displayName=xn;var js="PopperContent",[fa,pa]=fn(js),vn=m.forwardRef((e,s)=>{var Ze,pe,Je,Pe,$e,ze;const{__scopePopper:n,side:i="bottom",sideOffset:a=0,align:o="center",alignOffset:r=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:h="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:b,...y}=e,p=pn(js,n),[S,j]=m.useState(null),w=wt(s,me=>j(me)),[v,E]=m.useState(null),R=ma(v),T=(R==null?void 0:R.width)??0,M=(R==null?void 0:R.height)??0,V=i+(o!=="center"?"-"+o:""),I=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},K=Array.isArray(u)?u:[u],Y=K.length>0,G={padding:I,boundary:K.filter(ya),altBoundary:Y},{refs:N,floatingStyles:se,placement:O,isPositioned:J,middlewareData:_}=ta({strategy:"fixed",placement:V,whileElementsMounted:(...me)=>Vr(...me,{animationFrame:g==="always"}),elements:{reference:p.anchor},middleware:[na({mainAxis:a+M,alignmentAxis:r}),d&&ia({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?ra():void 0,...G}),d&&aa({...G}),oa({...G,apply:({elements:me,rects:He,availableWidth:Qe,availableHeight:et})=>{const{width:tt,height:We}=He.reference,ge=me.floating.style;ge.setProperty("--radix-popper-available-width",`${Qe}px`),ge.setProperty("--radix-popper-available-height",`${et}px`),ge.setProperty("--radix-popper-anchor-width",`${tt}px`),ge.setProperty("--radix-popper-anchor-height",`${We}px`)}}),v&&la({element:v,padding:l}),va({arrowWidth:T,arrowHeight:M}),x&&ca({strategy:"referenceHidden",...G})]}),[Q,re]=wn(O),Ce=Gs(b);Ft(()=>{J&&(Ce==null||Ce())},[J,Ce]);const ye=(Ze=_.arrow)==null?void 0:Ze.x,Ge=(pe=_.arrow)==null?void 0:pe.y,ve=((Je=_.arrow)==null?void 0:Je.centerOffset)!==0,[De,de]=m.useState();return Ft(()=>{S&&de(window.getComputedStyle(S).zIndex)},[S]),t.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:J?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:De,"--radix-popper-transform-origin":[(Pe=_.transformOrigin)==null?void 0:Pe.x,($e=_.transformOrigin)==null?void 0:$e.y].join(" "),...((ze=_.hide)==null?void 0:ze.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(fa,{scope:n,placedSide:Q,onArrowChange:E,arrowX:ye,arrowY:Ge,shouldHideArrow:ve,children:t.jsx(Nt.div,{"data-side":Q,"data-align":re,...y,ref:w,style:{...y.style,animation:J?void 0:"none"}})})})});vn.displayName=js;var bn="PopperArrow",ga={top:"bottom",right:"left",bottom:"top",left:"right"},xa=m.forwardRef(function(s,n){const{__scopePopper:i,...a}=s,o=pa(bn,i),r=ga[o.placedSide];return t.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[r]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:t.jsx(ua,{...a,ref:n,style:{...a.style,display:"block"}})})});xa.displayName=bn;function ya(e){return e!==null}var va=e=>({name:"transformOrigin",options:e,fn(s){var p,S,j;const{placement:n,rects:i,middlewareData:a}=s,r=((p=a.arrow)==null?void 0:p.centerOffset)!==0,l=r?0:e.arrowWidth,d=r?0:e.arrowHeight,[u,c]=wn(n),h={start:"0%",center:"50%",end:"100%"}[c],x=(((S=a.arrow)==null?void 0:S.x)??0)+l/2,g=(((j=a.arrow)==null?void 0:j.y)??0)+d/2;let b="",y="";return u==="bottom"?(b=r?h:`${x}px`,y=`${-d}px`):u==="top"?(b=r?h:`${x}px`,y=`${i.floating.height+d}px`):u==="right"?(b=`${-d}px`,y=r?h:`${g}px`):u==="left"&&(b=`${i.floating.width+d}px`,y=r?h:`${g}px`),{data:{x:b,y}}}});function wn(e){const[s,n="center"]=e.split("-");return[s,n]}var ba=gn,wa=yn,ja=vn,Na=Symbol.for("react.lazy"),Vt=$n[" use ".trim().toString()];function Ca(e){return typeof e=="object"&&e!==null&&"then"in e}function jn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Na&&"_payload"in e&&Ca(e._payload)}function Sa(e){const s=ka(e),n=m.forwardRef((i,a)=>{let{children:o,...r}=i;jn(o)&&typeof Vt=="function"&&(o=Vt(o._payload));const l=m.Children.toArray(o),d=l.find(Ra);if(d){const u=d.props.children,c=l.map(h=>h===d?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:h);return t.jsx(s,{...r,ref:a,children:m.isValidElement(u)?m.cloneElement(u,void 0,c):null})}return t.jsx(s,{...r,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function ka(e){const s=m.forwardRef((n,i)=>{let{children:a,...o}=n;if(jn(a)&&typeof Vt=="function"&&(a=Vt(a._payload)),m.isValidElement(a)){const r=Da(a),l=Ea(o,a.props);return a.type!==m.Fragment&&(l.ref=i?Fn(i,r):r),m.cloneElement(a,l)}return m.Children.count(a)>1?m.Children.only(null):null});return s.displayName=`${e}.SlotClone`,s}var Aa=Symbol("radix.slottable");function Ra(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Aa}function Ea(e,s){const n={...s};for(const i in s){const a=e[i],o=s[i];/^on[A-Z]/.test(i)?a&&o?n[i]=(...l)=>{const d=o(...l);return a(...l),d}:a&&(n[i]=a):i==="style"?n[i]={...a,...o}:i==="className"&&(n[i]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Da(e){var i,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=s&&"isReactWarning"in s&&s.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=$a.reduce((e,s)=>{const n=Sa(`Primitive.${s}`),i=m.forwardRef((a,o)=>{const{asChild:r,...l}=a,d=r?n:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(d,{...l,ref:o})});return i.displayName=`Primitive.${s}`,{...e,[s]:i}},{}),Ma="Portal",Nn=m.forwardRef((e,s)=>{var l;const{container:n,...i}=e,[a,o]=m.useState(!1);Ft(()=>o(!0),[]);const r=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return r?Tn.createPortal(t.jsx(Ta.div,{...i,ref:s}),r):null});Nn.displayName=Ma;const La=({open:e,onClose:s,anchorRef:n,placement:i="bottom-end",children:a})=>{const o=m.useRef(null);if(m.useEffect(()=>{if(!e)return;const u=c=>{var h,x;e&&((h=o.current)!=null&&h.contains(c.target)||(x=n.current)!=null&&x.contains(c.target)||s())};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[e,s,n]),!e)return null;const r=i.startsWith("top")?"top":"bottom",l=i.endsWith("end")?"end":"start",d=i.startsWith("top")?8:4;return t.jsxs(ba,{children:[t.jsx(wa,{virtualRef:n}),t.jsx(Nn,{children:t.jsx(Bn,{onEscapeKeyDown:u=>{u.preventDefault(),s()},onPointerDownOutside:u=>{var c;if((c=n.current)!=null&&c.contains(u.target)){u.preventDefault();return}s()},children:t.jsx(ja,{ref:o,side:r,align:l,sideOffset:d,className:`popover popover-${i}`,role:"dialog",children:a})})})]})};function Ia(e){const s=e+"CollectionProvider",[n,i]=fs(s),[a,o]=n(s,{collectionRef:{current:null},itemMap:new Map}),r=y=>{const{scope:p,children:S}=y,j=ke.useRef(null),w=ke.useRef(new Map).current;return t.jsx(a,{scope:p,itemMap:w,collectionRef:j,children:S})};r.displayName=s;const l=e+"CollectionSlot",d=Rs(l),u=ke.forwardRef((y,p)=>{const{scope:S,children:j}=y,w=o(l,S),v=wt(p,w.collectionRef);return t.jsx(d,{ref:v,children:j})});u.displayName=l;const c=e+"CollectionItemSlot",h="data-radix-collection-item",x=Rs(c),g=ke.forwardRef((y,p)=>{const{scope:S,children:j,...w}=y,v=ke.useRef(null),E=wt(p,v),R=o(c,S);return ke.useEffect(()=>(R.itemMap.set(v,{ref:v,...w}),()=>void R.itemMap.delete(v))),t.jsx(x,{[h]:"",ref:E,children:j})});g.displayName=c;function b(y){const p=o(e+"CollectionConsumer",y);return ke.useCallback(()=>{const j=p.collectionRef.current;if(!j)return[];const w=Array.from(j.querySelectorAll(`[${h}]`));return Array.from(p.itemMap.values()).sort((R,T)=>w.indexOf(R.ref.current)-w.indexOf(T.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:r,Slot:u,ItemSlot:g},b,i]}var _a=m.createContext(void 0);function Oa(e){const s=m.useContext(_a);return e||s||"ltr"}var ns="rovingFocusGroup.onEntryFocus",Pa={bubbles:!1,cancelable:!0},St="RovingFocusGroup",[us,Cn,za]=Ia(St),[Fa]=fs(St,[za]),[Ba,Ha]=Fa(St),Sn=m.forwardRef((e,s)=>t.jsx(us.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(us.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Wa,{...e,ref:s})})}));Sn.displayName=St;var Wa=m.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:r,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...h}=e,x=m.useRef(null),g=wt(s,x),b=Oa(o),[y,p]=Wn({prop:r,defaultProp:l??null,onChange:d,caller:St}),[S,j]=m.useState(!1),w=Gs(u),v=Cn(n),E=m.useRef(!1),[R,T]=m.useState(0);return m.useEffect(()=>{const M=x.current;if(M)return M.addEventListener(ns,w),()=>M.removeEventListener(ns,w)},[w]),t.jsx(Ba,{scope:n,orientation:i,dir:b,loop:a,currentTabStopId:y,onItemFocus:m.useCallback(M=>p(M),[p]),onItemShiftTab:m.useCallback(()=>j(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:m.useCallback(()=>T(M=>M-1),[]),children:t.jsx(Nt.div,{tabIndex:S||R===0?-1:0,"data-orientation":i,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:rt(e.onMouseDown,()=>{E.current=!0}),onFocus:rt(e.onFocus,M=>{const V=!E.current;if(M.target===M.currentTarget&&V&&!S){const I=new CustomEvent(ns,Pa);if(M.currentTarget.dispatchEvent(I),!I.defaultPrevented){const K=v().filter(O=>O.focusable),Y=K.find(O=>O.active),G=K.find(O=>O.id===y),se=[Y,G,...K].filter(Boolean).map(O=>O.ref.current);Rn(se,c)}}E.current=!1}),onBlur:rt(e.onBlur,()=>j(!1))})})}),kn="RovingFocusGroupItem",An=m.forwardRef((e,s)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:a=!1,tabStopId:o,children:r,...l}=e,d=Hn(),u=o||d,c=Ha(kn,n),h=c.currentTabStopId===u,x=Cn(n),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:y}=c;return m.useEffect(()=>{if(i)return g(),()=>b()},[i,g,b]),t.jsx(us.ItemSlot,{scope:n,id:u,focusable:i,active:a,children:t.jsx(Nt.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...l,ref:s,onMouseDown:rt(e.onMouseDown,p=>{i?c.onItemFocus(u):p.preventDefault()}),onFocus:rt(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:rt(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const S=qa(p,c.orientation,c.dir);if(S!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let w=x().filter(v=>v.focusable).map(v=>v.ref.current);if(S==="last")w.reverse();else if(S==="prev"||S==="next"){S==="prev"&&w.reverse();const v=w.indexOf(p.currentTarget);w=c.loop?Xa(w,v+1):w.slice(v+1)}setTimeout(()=>Rn(w))}}),children:typeof r=="function"?r({isCurrentTabStop:h,hasTabStop:y!=null}):r})})});An.displayName=kn;var Ua={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Va(e,s){return s!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function qa(e,s,n){const i=Va(e.key,n);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Ua[i]}function Rn(e,s=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:s}),document.activeElement!==n))return}function Xa(e,s){return e.map((n,i)=>e[(s+i)%e.length])}var Ka=Sn,Ya=An;const It=({icon:e,children:s,onClick:n,danger:i,disabled:a})=>t.jsx(Ya,{asChild:!0,focusable:!a,active:!1,children:t.jsxs("button",{type:"button",role:"menuitem",className:`menu-item${i?" menu-item-danger":""}`,onClick:n,disabled:a,children:[e&&t.jsx("span",{className:"menu-item-icon",children:e}),t.jsx("span",{className:"menu-item-label",children:s})]})}),Ga=()=>t.jsx("div",{className:"menu-divider",role:"separator"}),Za=({children:e})=>t.jsx(Ka,{asChild:!0,orientation:"vertical",loop:!0,children:t.jsx("div",{className:"menu",role:"menu",children:e})}),Ja=[{label:"1 Hour",value:"1h"},{label:"2 Hours",value:"2h"},{label:"4 Hours",value:"4h"},{label:"8 Hours",value:"8h"}],Qa=({device:e,onClose:s,onReserved:n})=>{const[i,a]=m.useState(""),[o,r]=m.useState("1h"),[l,d]=m.useState(""),[u,c]=m.useState(!1),[h,x]=m.useState(null),[g,b]=m.useState(null),y=async()=>{if(!i.trim()){x("Please enter your name/ID");return}c(!0),x(null),b(null);try{const p=await z.reserveDevice(e.udid,e.host,i,o,l);p.success?(n(),s()):b(p.error||"Failed to reserve device")}catch(p){b(p.message||"An unexpected error occurred")}finally{c(!1)}};return t.jsx(Zs,{open:!0,onClose:s,width:520,title:t.jsxs(t.Fragment,{children:[t.jsx(oi,{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:y,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(Ot,{label:t.jsxs(t.Fragment,{children:[t.jsx(Mn,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--green)"}}),"Reserved By"]}),htmlFor:"reservation-reserved-by",error:h?t.jsxs(t.Fragment,{children:[t.jsx(Ns,{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:p=>{a(p.target.value),h&&x(null)},disabled:u})}),t.jsx(Ot,{label:t.jsxs(t.Fragment,{children:[t.jsx(Js,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--green)"}}),"Duration"]}),children:t.jsx("div",{className:"duration-selector",children:Ja.map(p=>t.jsx("div",{className:`duration-option ${o===p.value?"active":""}`,onClick:()=>r(p.value),children:p.label},p.value))})}),t.jsx(Ot,{label:t.jsxs(t.Fragment,{children:[t.jsx($i,{size:14,style:{marginRight:6,verticalAlign:"middle",color:"var(--green)"}}),"Reason (Optional)"]}),htmlFor:"reservation-reason",error:g?t.jsxs(t.Fragment,{children:[t.jsx(Ns,{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:p=>d(p.target.value),disabled:u})})]})})},eo=({device:e,onClose:s,onUpdated:n})=>{const{toast:i}=Xs(),[a,o]=m.useState(e.tags||[]),[r,l]=m.useState(""),[d,u]=m.useState(!1),c=m.useRef(null);m.useEffect(()=>{c.current&&c.current.focus()},[]);const h=()=>{const y=r.trim();y&&!a.includes(y)&&(o([...a,y]),l(""))},x=y=>{o(a.filter(p=>p!==y))},g=y=>{y.key==="Enter"&&h()},b=async()=>{u(!0);try{await z.updateDeviceTags(e.udid,e.host,a),n(),s()}catch(y){console.error("Failed to update tags",y),i("Error saving tags. Please try again.","error")}finally{u(!1)}};return t.jsx(Zs,{open:!0,onClose:s,width:520,title:t.jsxs(t.Fragment,{children:[t.jsx(Wi,{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:d,children:d?"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(Ot,{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:c,id:"tag-input",type:"text",placeholder:"e.g. stable, team-a, ios-17",value:r,onChange:y=>l(y.target.value),onKeyDown:g}),t.jsx("button",{className:"add-inline-btn",onClick:h,disabled:!r.trim(),children:t.jsx(Un,{size:16})})]})}),t.jsxs("div",{className:"tags-display-section",children:[t.jsx("label",{children:"Current Tags"}),t.jsx("div",{className:"tags-list",children:a.length>0?a.map(y=>t.jsxs("div",{className:"tag-pill-editable",children:[y,t.jsx("button",{className:"remove-tag",onClick:()=>x(y),children:t.jsx(Ln,{size:12})})]},y)):t.jsx("div",{className:"empty-tags",children:"No tags assigned to this device."})})]})]})})};function to(e){return e>=50?"ready":e>=20?"reserved":"error"}function so(e){return e>=50?t.jsx(ni,{size:10}):e>=20?t.jsx(Qn,{size:10}):t.jsx(ti,{size:10})}function no(e){return e==="Normal"?"ready":e==="Critical"?"error":"reserved"}const io=({device:e})=>{const s=typeof e.batteryLevel=="number",n=typeof e.thermalStatus=="string"&&e.thermalStatus.length>0&&e.thermalStatus!=="Unknown";return!s&&!n?null:t.jsxs("div",{className:"dc2-health",children:[s&&t.jsxs(bt,{tone:to(e.batteryLevel),title:`Battery ${e.batteryLevel}%`,children:[so(e.batteryLevel),e.batteryLevel,"%"]}),n&&t.jsxs(bt,{tone:no(e.thermalStatus),title:`Thermal: ${e.thermalStatus}`,children:[t.jsx(qi,{size:10}),e.thermalStatus]})]})},ro=({udid:e,currentTeamId:s,teams:n,canEdit:i,onChanged:a})=>{const[o,r]=m.useState(!1),[l,d]=m.useState(!1),u=s?n.get(s)??`Team ${s.slice(0,6)}`:"Unassigned";async function c(h){d(!0);try{await z.setDeviceTeam(e,h),a(),r(!1)}catch(x){alert((x==null?void 0:x.message)||"Failed to update team")}finally{d(!1)}}return i?o?t.jsxs("select",{autoFocus:!0,disabled:l,defaultValue:s??"",onBlur:()=>r(!1),onChange:h=>c(h.target.value||null),className:"dc2-team-select",children:[t.jsx("option",{value:"",children:"(Unassigned)"}),Array.from(n.entries()).map(([h,x])=>t.jsx("option",{value:h,children:x},h))]}):t.jsx("button",{type:"button",onClick:()=>r(!0),className:"dc2-team-pill",title:"Click to change team",children:u}):s?t.jsx(bt,{tone:"accent",title:`Team: ${u}`,children:u}):null};function ao(e){return e.offline?"offline":e.userBlocked?"error":e.busy?"busy":e.reservedUntil&&Date.now()<e.reservedUntil?"reserved":"ready"}function oo(e,s=10,n=4){return!e||e.length<=s+n+1?e:`${e.slice(0,s)}…${e.slice(-n)}`}const co=({device:e,reloadDevices:s,navigate:n,teams:i})=>{var v,E,R;const[a,o]=m.useState(!1),[r,l]=m.useState(!1),[d,u]=m.useState(!1),c=m.useRef(null),{me:h}=In(),x=(h==null?void 0:h.role)==="ADMIN"||(h==null?void 0:h.role)==="SUPER_ADMIN",g=ao(e),b=g==="reserved",y=!!(e.busy&&e.session_id&&!String(e.session_id).startsWith("manual_")),p=()=>{var T;return(T=navigator.clipboard)==null?void 0:T.writeText(e.udid)},S=async()=>{await z.releaseReservation(e.udid,e.host),s()},j=async()=>{await z.blockDevice(e.udid,e.host),s()},w=async()=>{await z.unblockDevice(e.udid,e.host),s()};return t.jsxs("div",{className:`dc2 dc2-${g}`,children:[t.jsx("div",{className:"dc2-stripe"}),t.jsxs("div",{className:"dc2-header",children:[t.jsxs("span",{className:"dc2-platform",children:[e.platform.toUpperCase()," · ",e.sdk]}),t.jsx(rr,{kind:g,showDot:!0,children:g})]}),t.jsx("div",{className:"dc2-name",title:e.name,children:e.name}),t.jsx("div",{className:"dc2-udid",title:e.udid,children:oo(e.udid)}),t.jsx(io,{device:e}),(e.teamId||x||e.tags&&e.tags.length>0)&&t.jsxs("div",{className:"dc2-tags",children:[(e.teamId||x)&&t.jsx(ro,{udid:e.udid,currentTeamId:e.teamId??null,teams:i??new Map,canEdit:x,onChanged:s}),(v=e.tags)==null?void 0:v.slice(0,3).map(T=>t.jsx(bt,{tone:"neutral",title:T,children:T},T)),(((E=e.tags)==null?void 0:E.length)||0)>3&&t.jsxs(bt,{tone:"neutral",children:["+",(((R=e.tags)==null?void 0:R.length)||0)-3]})]}),t.jsxs("div",{className:"dc2-metrics",children:[b?t.jsxs("div",{className:"dc2-banner dc2-banner-reserved",children:[t.jsx(Js,{size:12}),t.jsxs("span",{children:["RES · ",e.reservedBy||"anon",e.reservedUntil?` (${Ds(e.reservedUntil-Date.now(),{compact:!0})})`:""]})]}):e.session_id?t.jsxs("div",{className:"dc2-banner dc2-banner-session",children:[t.jsx(as,{size:12}),t.jsxs("span",{children:["SID · ",String(e.session_id).slice(0,10)]})]}):t.jsx($s,{label:"Utilization",value:Ds(e.totalUtilizationTimeMilliSec||0,{compact:!0})}),t.jsx($s,{label:"Host",value:e.ip||e.host,mono:!0})]}),t.jsxs("div",{className:"dc2-actions",children:[t.jsx(it,{variant:"primary",size:"sm",disabled:y,onClick:()=>{y||n(`/devices/${e.udid}/control`)},title:y?"Locked: Appium session running":"Take control",className:"dc2-primary",children:"Control"}),b?t.jsx(it,{variant:"secondary",size:"sm",onClick:S,children:"Release"}):!e.userBlocked&&!e.busy?t.jsx(it,{variant:"secondary",size:"sm",onClick:()=>o(!0),children:"Reserve"}):null,t.jsx("button",{ref:c,type:"button",className:"dc2-more",onClick:()=>u(T=>!T),"aria-label":"More actions",children:t.jsx(vi,{size:14})}),t.jsx(La,{open:d,onClose:()=>u(!1),anchorRef:c,children:t.jsxs(Za,{children:[t.jsx(It,{onClick:()=>{u(!1),l(!0)},children:"Manage tags…"}),e.userBlocked?t.jsx(It,{onClick:()=>{u(!1),w()},children:"Exit maintenance"}):t.jsx(It,{onClick:()=>{u(!1),j()},children:"Enter maintenance"}),t.jsx(Ga,{}),t.jsx(It,{icon:t.jsx(yt,{size:12}),onClick:()=>{u(!1),p()},children:"Copy UDID"})]})})]}),a&&t.jsx(Qa,{device:e,onClose:()=>o(!1),onReserved:()=>s()}),r&&t.jsx(eo,{device:e,onClose:()=>l(!1),onUpdated:()=>s()})]})};function lo(e){const s=hs();return t.jsx(co,{device:e.device,reloadDevices:e.reloadDevices,navigate:s,teams:e.teams})}class uo extends ke.Component{constructor(){super(...arguments),this.state={teamsMap:new Map}}componentDidMount(){z.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:ke.Children.toArray(this.props.devices.map(s=>t.jsx(lo,{device:s,reloadDevices:this.props.reloadDevices,teams:this.state.teamsMap})))})}}var _t,mo=new Uint8Array(16);function ho(){if(!_t&&(_t=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!_t))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _t(mo)}const fo=/^(?:[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 po(e){return typeof e=="string"&&fo.test(e)}var oe=[];for(var is=0;is<256;++is)oe.push((is+256).toString(16).substr(1));function go(e){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(oe[e[s+0]]+oe[e[s+1]]+oe[e[s+2]]+oe[e[s+3]]+"-"+oe[e[s+4]]+oe[e[s+5]]+"-"+oe[e[s+6]]+oe[e[s+7]]+"-"+oe[e[s+8]]+oe[e[s+9]]+"-"+oe[e[s+10]]+oe[e[s+11]]+oe[e[s+12]]+oe[e[s+13]]+oe[e[s+14]]+oe[e[s+15]]).toLowerCase();if(!po(n))throw TypeError("Stringified UUID is invalid");return n}function xo(e,s,n){e=e||{};var i=e.random||(e.rng||ho)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,go(i)}const yo=({onCommand:e,prompt:s="$",welcomeMessage:n="Interactive Shell (Restricted Mode)",platform:i})=>{const[a,o]=m.useState([{type:"system",content:n,timestamp:Date.now()},{type:"system",content:'Type "help" for allowed commands.',timestamp:Date.now()}]),[r,l]=m.useState(""),[d,u]=m.useState([]),[c,h]=m.useState(-1),[x,g]=m.useState(!1),b=m.useRef(null),y=m.useRef(null);m.useEffect(()=>{b.current&&(b.current.scrollTop=b.current.scrollHeight)},[a]);const p=j=>{const w=j.trim();if((w.startsWith("{")||w.startsWith("["))&&(w.endsWith("}")||w.endsWith("]")))try{const v=JSON.parse(w);return JSON.stringify(v,null,2)}catch{}return j},S=async j=>{if(j.key==="Enter"&&!x){const w=r.trim();if(!w)return;if(l(""),o(v=>[...v,{type:"command",content:`${s} ${w}`,timestamp:Date.now()}]),u(v=>[...v,w]),h(-1),g(!0),w==="clear"){o([]),g(!1);return}if(w==="help"){let v="";i==="android"?v=`
|
|
157
|
+
Android Allowed Commands:
|
|
158
|
+
• System Info: getprop, ip addr, date, uptime, cat /proc/meminfo, cat /proc/cpuinfo
|
|
159
|
+
• Process Mgmt: ps, top
|
|
160
|
+
• File System: ls
|
|
161
|
+
• Diagnostics: dumpsys [battery|wifi|power]
|
|
162
|
+
• Packages: pm list packages
|
|
163
|
+
`:(i==="ios"||i==="tvos")&&(v=`
|
|
164
|
+
iOS Allowed Commands:
|
|
165
|
+
• Real Device (go-ios):
|
|
166
|
+
apps, info, list, syslog, deviceinfo, diagnostics
|
|
167
|
+
• Simulator (xcrun simctl):
|
|
168
|
+
listapps, get_app_container, list, getenv
|
|
169
|
+
• Simulator System:
|
|
170
|
+
ls, ps, top, date, uptime, whoami
|
|
171
|
+
`),o(E=>[...E,{type:"output",content:v.trim(),timestamp:Date.now()}]),g(!1);return}try{const v=await e(w),E=p(v||"(No output)");o(R=>[...R,{type:"output",content:E,timestamp:Date.now()}])}catch(v){o(E=>[...E,{type:"error",content:v.message||"Unknown error",timestamp:Date.now()}])}finally{g(!1),setTimeout(()=>{var v;return(v=y.current)==null?void 0:v.focus()},10)}}else if(j.key==="ArrowUp"){if(j.preventDefault(),d.length>0){const w=c===-1?d.length-1:Math.max(0,c-1);h(w),l(d[w])}}else if(j.key==="ArrowDown"&&(j.preventDefault(),c!==-1)){const w=c+1;w>=d.length?(h(-1),l("")):(h(w),l(d[w]))}};return t.jsxs("div",{className:"terminal-container",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:[i.toUpperCase()," INTERNAL SHELL"]}),t.jsx("div",{className:"terminal-actions",children:t.jsx("button",{className:"terminal-action-btn",onClick:()=>o([]),title:"Clear Terminal",children:"CLEAR"})})]}),t.jsxs("div",{className:"terminal-history",ref:b,onClick:()=>{var j;return(j=y.current)==null?void 0:j.focus()},children:[a.map((j,w)=>t.jsx("div",{className:`terminal-line ${j.type}`,children:j.content},w)),x&&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:y,className:"terminal-input",value:r,onChange:j=>l(j.target.value),onKeyDown:S,disabled:x,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"Type a command..."})]})]})};function _e(e,s){var n;s(e),(n=e.children)==null||n.forEach(i=>_e(i,s))}function Me(e,...s){var n;for(const i of s){const a=(n=e.attributes)==null?void 0:n[i];if(a!=null&&a!=="")return String(a)}}function ct(e){var s;return((s=e.type)==null?void 0:s.split(".").pop())||e.type||""}function vo(e,s){const n=[];return _e(e,i=>{Me(i,"content-desc","contentDescription","accessibilityId","name","label")===s&&n.push(i)}),n}function bo(e,s){const n=[];return _e(e,i=>{Me(i,"resource-id","resourceId","identifier")===s&&n.push(i)}),n}function ms(e,s){const n=[];return _e(e,i=>{(i.type===s||ct(i)===s)&&n.push(i)}),n}function wo(e,s){const n=[];return _e(e,i=>{Me(i,"name")===s&&n.push(i)}),n}function jo(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 No(e,s){const n=s.split("/").filter(Boolean);if(n.length===0)return null;const i=[];for(const o of n){const r=/^([A-Za-z_][\w.-]*)\[(\d+)\]$/.exec(o);if(!r)return null;i.push({type:r[1],index:parseInt(r[2],10)})}if(i[0].type!==e.type&&i[0].type!==ct(e)||i[0].index!==1)return null;let a=e;for(let o=1;o<i.length&&a;o++){const{type:r,index:l}=i[o];let d=0,u;for(const c of a.children||[])if((c.type===r||ct(c)===r)&&(d+=1,d===l)){u=c;break}a=u}return a?[a]:[]}function Co(e,s){const n=No(e,s);if(n!==null)return{kind:"matched",nodes:n};const i=jo(s);if(i){const a=[];return _e(e,o=>{if(i.tag&&o.type!==i.tag&&ct(o)!==i.tag)return;Me(o,i.attrKey)===i.attrValue&&a.push(o)}),{kind:"matched",nodes:a}}return{kind:"unsupported",nodes:[],reason:"Complex XPath (axes, multiple predicates, functions) — use a real driver to verify"}}function So(e,s){const n=s.trim(),i=/^\*\*\/([A-Za-z_]\w*)\[`(\w+)\s*==\s*"([^"]*)"`\]$/.exec(n);if(i){const[,r,l,d]=i,u=[];return _e(e,c=>{if(c.type!==r&&ct(c)!==r)return;Me(c,l)===d&&u.push(c)}),{kind:"matched",nodes:u}}const a=/^\*\*\/([A-Za-z_]\w*)\[(\d+)\]$/.exec(n);if(a){const[,r,l]=a,d=parseInt(l,10),u=[];return _e(e,c=>{(c.type===r||ct(c)===r)&&u.push(c)}),{kind:"matched",nodes:u[d-1]?[u[d-1]]:[]}}const o=/^\*\*\/([A-Za-z_]\w*)$/.exec(n);return o?ms(e,o[1]).length>0?{kind:"matched",nodes:ms(e,o[1])}:{kind:"matched",nodes:[]}:{kind:"unsupported",nodes:[],reason:"Multi-segment class chain — use a real driver to verify"}}function ko(e,s){const i=s.trim().split(/\s+AND\s+/i).map(r=>r.trim()),a=[];for(const r of i){const l=/^(\w+)\s*==\s*"([^"]*)"$/.exec(r);if(!l)return{kind:"unsupported",nodes:[],reason:"Predicate uses unsupported operator (only ==, AND) — use a real driver"};a.push({key:l[1],value:l[2]})}const o=[];return _e(e,r=>{for(const l of a){let d;if(l.key==="type"?d=r.type:l.key==="label"?d=Me(r,"label")??r.label:l.key==="name"?d=Me(r,"name")??r.name:l.key==="value"?d=Me(r,"value")??r.value:d=Me(r,l.key),d!==l.value)return}o.push(r)}),{kind:"matched",nodes:o}}function Ao(e,s,n){const i=s.toLowerCase();if(!n)return{kind:"matched",nodes:[]};switch(i){case"accessibility id":return{kind:"matched",nodes:vo(e,n)};case"id":return{kind:"matched",nodes:bo(e,n)};case"class name":return{kind:"matched",nodes:ms(e,n)};case"name":return{kind:"matched",nodes:wo(e,n)};case"xpath":return Co(e,n);case"-ios class chain":return So(e,n);case"-ios predicate string":return ko(e,n);default:return{kind:"unsupported",nodes:[],reason:`Strategy "${s}" not yet supported by snapshot matcher`}}}function Ws(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 Us(e,s,n,i){var j,w,v,E,R,T,M;const{strategy:a,value:o}=i,r=(e.text||e.name||((j=e.type)==null?void 0:j.split(".").pop())||"element").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/,"").slice(0,24)||"element",l=r.charAt(0).toLowerCase()+r.slice(1),d=((w=e.type)==null?void 0:w.toLowerCase().includes("edit"))||((v=e.type)==null?void 0:v.toLowerCase().includes("input"))||((E=e.type)==null?void 0:E.toLowerCase().includes("field"))||((R=e.type)==null?void 0:R.toLowerCase().includes("textfield")),u=((T=e.attributes)==null?void 0:T.scrollable)==="true"||((M=e.attributes)==null?void 0:M.scrollable)===!0,c=a.toLowerCase().startsWith("-ios")&&s!=="ios"?`// ⚠️ -ios predicate/class chain ONLY work with XCUITest (iOS)
|
|
172
|
+
`:a.toLowerCase().startsWith("-android")&&s!=="android"?`// ⚠️ -android uiautomator ONLY works with UIAutomator2 (Android)
|
|
173
|
+
`:"",h={"accessibility id":`~${o}`,id:s==="ios"?`-ios predicate string:label == "${o}"`:`android=new UiSelector().resourceId("${o}")`,xpath:`${o}`,"-ios predicate string":`-ios predicate string:${o}`,"-ios class chain":`-ios class chain:${o}`,"-android uiautomator":`android=${o}`},x={"accessibility id":`AppiumBy.accessibilityId("${o}")`,id:`AppiumBy.id("${o}")`,xpath:`AppiumBy.xpath("${o}")`,"-ios predicate string":`AppiumBy.iOSNsPredicateString("${o}")`,"-ios class chain":`AppiumBy.iOSClassChain("${o}")`,"-android uiautomator":`AppiumBy.androidUIAutomator("${o}")`,"class name":`AppiumBy.className("${o}")`},g={"accessibility id":`AppiumBy.ACCESSIBILITY_ID, "${o}"`,id:`AppiumBy.ID, "${o}"`,xpath:`AppiumBy.XPATH, "${o}"`,"-ios predicate string":`AppiumBy.IOS_PREDICATE, "${o}"`,"-ios class chain":`AppiumBy.IOS_CLASS_CHAIN, "${o}"`,"-android uiautomator":`AppiumBy.ANDROID_UIAUTOMATOR, '${o}'`,"class name":`AppiumBy.CLASS_NAME, "${o}"`},b=x[a.toLowerCase()],y=g[a.toLowerCase()],p=h[a.toLowerCase()];return n==="java"?b?`${c}// Appium Java Client 9.x + Selenium 4 + TestNG
|
|
174
|
+
import io.appium.java_client.AppiumBy;
|
|
175
|
+
import io.appium.java_client.${s==="android"?"AndroidDriver":s==="ios"?"IOSDriver":"AppiumDriver"};
|
|
176
|
+
import org.openqa.selenium.WebElement;
|
|
177
|
+
import org.testng.annotations.Test;
|
|
178
|
+
|
|
179
|
+
@Test
|
|
180
|
+
public void test_${l}() {
|
|
181
|
+
WebElement element = driver.findElement(${b});
|
|
182
|
+
${u?'((Scrollable) element).scrollTo("target text");':d?`element.clear();
|
|
183
|
+
element.sendKeys("your text here");`:"element.click();"}
|
|
184
|
+
// Add assertions here via TestNG Assert or Hamcrest
|
|
185
|
+
}`:`// Strategy "${a}" not supported in Appium Java Client`:n==="python"?y?`${c}# Appium Python Client 4.x + pytest
|
|
186
|
+
from appium.webdriver.common.appiumby import AppiumBy
|
|
187
|
+
import pytest
|
|
188
|
+
|
|
189
|
+
def test_${l}(self):
|
|
190
|
+
element = self.driver.find_element(${y})
|
|
191
|
+
${d?`element.clear()
|
|
192
|
+
element.send_keys("your text here")`:"element.click()"}
|
|
193
|
+
# Add assertions here via assert or pytest.assert`:`# Strategy "${a}" not supported in Appium Python Client`:n==="javascript"?p?`${c}// WebdriverIO 9.x + @wdio/appium-service
|
|
194
|
+
describe('${l} test', () => {
|
|
195
|
+
it('should interact with ${l}', async () => {
|
|
196
|
+
const element = await $('${p}');
|
|
197
|
+
await element.waitForDisplayed({ timeout: 5000 });
|
|
198
|
+
${d?`await element.clearValue();
|
|
199
|
+
await element.addValue("your text here");`:"await element.click();"}
|
|
200
|
+
// Add assertions here via expect(element)
|
|
201
|
+
});
|
|
202
|
+
});`:`// Strategy "${a}" not supported in WebdriverIO mobile`:p?`${c}// WebdriverIO 9.x standalone
|
|
203
|
+
const element = await driver.$('${p}');
|
|
204
|
+
await element.waitForExist({ timeout: 5000 });
|
|
205
|
+
${d?`await driver.$('target').clearValue();
|
|
206
|
+
await element.addValue("your text here");`:"await element.click();"}
|
|
207
|
+
// Assert with expect(element).toBeDisplayed()`:`// Strategy "${a}" not supported in WebdriverIO mobile`}function Vs(e){var g,b,y,p,S,j,w,v,E,R,T;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=((y=e.attributes)==null?void 0:y.enabled)!=="false"&&((p=e.attributes)==null?void 0:p.enabled)!==!1,a=((S=e.attributes)==null?void 0:S.scrollable)==="true"||((j=e.attributes)==null?void 0:j.scrollable)===!0,o=e.text||e.label||e.value||"",r=((w=e.children)==null?void 0:w.length)||0;let l="Element",d="📦";s.includes("button")||s.includes("btn")||n&&r===0?(l="Button",d="🔘"):s.includes("edit")||s.includes("input")||s.includes("field")?(l="Text Input",d="✏️"):s.includes("image")||s.includes("img")||s.includes("imageview")?(l="Image",d="🖼️"):s.includes("scroll")||s.includes("recyclerview")||s.includes("listview")||a?(l="Scrollable List",d="📜"):s.includes("text")||s.includes("label")?(l="Text Label",d="📝"):s.includes("switch")||s.includes("toggle")||s.includes("checkbox")?(l="Toggle / Checkbox",d="☑️"):s.includes("nav")||s.includes("toolbar")||s.includes("tabbar")?(l="Navigation Bar",d="🧭"):r>0&&(l=`Container (${r} children)`,d="🗂️");const u=((v=e.suggestedLocators)==null?void 0:v.find(M=>M.strategy==="accessibility id"||M.strategy==="id"))||((E=e.suggestedLocators)==null?void 0:E[0]),c=i?((R=e.rect)==null?void 0:R.width)===0||((T=e.rect)==null?void 0:T.height)===0?"⚠️ Zero-size element — may not be interactable":void 0:"⚠️ Element is disabled",h=o?` with text "${o.slice(0,30)}"`:"",x=`This is a ${l.toLowerCase()}${h}. ${n?"It can be tapped/clicked.":a?"It supports scrolling.":"It is a visual container."}${r>0?` Contains ${r} child element${r>1?"s":""}.`:""}`;return{role:l,description:x,interactable:n||i,bestLocator:u,warning:c,emoji:d}}function qs(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"]},a=(e.type||"").toLowerCase(),o=(e.text||e.label||e.value||"").toLowerCase(),r=(e.name||"").toLowerCase(),l=Object.values(e.attributes||{}).join(" ").toLowerCase();for(const[d,u]of Object.entries(i))if(n.includes(d)&&u.some(c=>a.includes(c)))return!0;return a.includes(n)||o.includes(n)||r.includes(n)||l.includes(n)}const Ro=({sessionId:e,udid:s,streamUrl:n,embedded:i=!1})=>{var qe,ht,At,ft,Xe,pt,Rt,Et,Dt;const[a,o]=m.useState(!0),[r,l]=m.useState(null),[d,u]=m.useState(null),[c,h]=m.useState(null),[x,g]=m.useState(null),[b,y]=m.useState(new Set(["/"])),[p,S]=m.useState(""),[j,w]=m.useState(null),[v,E]=m.useState("info"),[R,T]=m.useState("java"),[M,V]=m.useState(null),[I,K]=m.useState({width:0,height:0}),[Y,G]=m.useState({width:0,height:0}),[N,se]=m.useState(!1),[O,J]=m.useState("inspect"),[_,Q]=m.useState({}),[re,Ce]=m.useState(null),ye=m.useRef(null),Ge=m.useRef(null),ve=m.useRef(null),De=m.useRef(null),de=m.useCallback(()=>{var X,ue,xe;if(!ye.current)return;const f=ye.current.getBoundingClientRect(),k=f.width,D=f.height,$=(X=r==null?void 0:r.hierarchy)==null?void 0:X.rect;let F=((ue=r==null?void 0:r.metadata)==null?void 0:ue.screenWidth)||I.width||1,H=((xe=r==null?void 0:r.metadata)==null?void 0:xe.screenHeight)||I.height||1;$&&$.width>0&&$.height>0&&(F=$.width,H=$.height);const W=F/H;let Z,U;k/D>W?(U=D,Z=U*W):(Z=k,U=Z/W),G({width:Z,height:U})},[r,I]);m.useEffect(()=>(de(),window.addEventListener("resize",de),()=>window.removeEventListener("resize",de)),[de]),m.useEffect(()=>{s&&pe()},[s]),m.useEffect(()=>{var f;if((f=c==null?void 0:c.suggestedLocators)!=null&&f.length){const k=c.suggestedLocators.find(D=>D.strategy==="accessibility id"||D.strategy==="id")||c.suggestedLocators[0];V(k)}else V(null);Q({}),Ce(null)},[c]);const Ze=m.useCallback((f,k)=>{if(!(r!=null&&r.hierarchy))return;const D=Ao(r.hierarchy,f,k);Q($=>({...$,[f]:D})),Ce(f)},[r]),pe=async()=>{if(s){o(!0),u(null);try{const f=await z.getInspectorSnapshot(s);l(f);const k=new Set(["/"]),D=($,F)=>{var H;F<2&&(k.add($.xpath),(H=$.children)==null||H.forEach(W=>D(W,F+1)))};f.hierarchy&&D(f.hierarchy,0),y(k)}catch(f){u(f.message||"Failed to capture snapshot")}finally{o(!1)}}},Je=f=>{const{naturalWidth:k,naturalHeight:D}=f.currentTarget;K({width:k,height:D})},Pe=()=>se(!0),$e=f=>{se(!1);const{naturalWidth:k,naturalHeight:D}=f.currentTarget;k>0&&D>0&&K({width:k,height:D})},ze=n&&!N,me=f=>{if(O!=="interact"||!s)return;const k=f.currentTarget.getBoundingClientRect();De.current={x:f.clientX-k.left,y:f.clientY-k.top,time:Date.now()}},He=async f=>{var ce,C,A;if(O!=="interact"||!s||!De.current)return;const k=De.current,D=f.currentTarget.getBoundingClientRect(),$=f.clientX-D.left,F=f.clientY-D.top,H=Date.now()-k.time,W=Y.width,Z=Y.height,U=(ce=r==null?void 0:r.hierarchy)==null?void 0:ce.rect;let X=((C=r==null?void 0:r.metadata)==null?void 0:C.screenWidth)||I.width,ue=((A=r==null?void 0:r.metadata)==null?void 0:A.screenHeight)||I.height;if(U&&U.width>0&&U.height>0&&(X=U.width,ue=U.height),!X||!ue||W===0||Z===0)return;const xe=(L,P)=>({x:Math.round(L/W*X),y:Math.round(P/Z*ue),px:L/W,py:P/Z}),te=xe(k.x,k.y),Se=xe($,F),we=Math.sqrt(Math.pow($-k.x,2)+Math.pow(F-k.y,2));if(!(te.px<0||te.px>1||te.py<0||te.py>1)){try{H<500&&we<10?await z.tap(s,te.x,te.y):H>=500&&we<10?await z.touchAndHold(s,te.x,te.y,H):we>=10&&await z.swipe(s,te.x,te.y,Se.x,Se.y)}catch(L){console.error("Interaction failed:",L)}De.current=null}},Qe=f=>{const k=new Set(b);k.has(f)?k.delete(f):k.add(f),y(k)},et=()=>{const f=new Set,k=D=>{var $;f.add(D.xpath),($=D.children)==null||$.forEach(k)};r!=null&&r.hierarchy&&k(r.hierarchy),y(f)},tt=()=>y(new Set(["/"])),We=(f,k)=>{navigator.clipboard.writeText(f),w(k),setTimeout(()=>w(null),2e3)},ge=f=>{var D;let k=1;return(D=f.children)==null||D.forEach($=>k+=ge($)),k},be=f=>{if(!f)return[];const k={},D=$=>{var W;const F=Vs($),H=F.role.replace(/\s*\(.*?\)\s*/,"");k[H]||(k[H]={emoji:F.emoji,count:0}),k[H].count+=1,(W=$.children)==null||W.forEach(D)};return D(f),Object.entries(k).map(([$,F])=>({role:$,emoji:F.emoji,count:F.count})).sort(($,F)=>F.count-$.count)},ut=f=>f.xpath.split("/").filter(Boolean).slice(-3),mt=(f,k=0)=>{var xe,te,Se,we;if(!f)return null;const D=b.has(f.xpath),$=((xe=f.children)==null?void 0:xe.length)>0,F=(c==null?void 0:c.xpath)===f.xpath,H=(x==null?void 0:x.xpath)===f.xpath,W=((te=f.type)==null?void 0:te.split(".").pop())||"Element",Z=f.label||((Se=f.attributes)==null?void 0:Se["content-desc"])||((we=f.attributes)==null?void 0:we["resource-id"])||f.name,U=typeof Z=="string"&&Z&&Z!==W&&Z!==f.type?Z:null,X=U||W,ue=!p||qs(f,p);if(!ue&&!$)return null;if(p&&!ue){const ce=C=>{var A;return qs(C,p)?!0:((A=C.children)==null?void 0:A.some(ce))||!1};if(!ce(f))return null}return t.jsxs("div",{className:"tree-node",children:[t.jsxs("div",{className:`tree-item ${F?"selected":""} ${H&&!F?"hovered":""}`,onClick:()=>{h(f),E("info")},onMouseEnter:()=>g(f),onMouseLeave:()=>g(null),children:[t.jsx("div",{className:"tree-item-indent",style:{width:`${k*14}px`}}),$?t.jsx("button",{onClick:ce=>{ce.stopPropagation(),Qe(f.xpath)},className:"tree-toggle",children:D?t.jsx(Ks,{size:11}):t.jsx(en,{size:11})}):t.jsx("span",{className:"tree-toggle-spacer"}),t.jsx(ri,{size:11,className:"tree-icon"}),t.jsx("span",{className:"tree-label",title:`${W}${U?` — ${U}`:""}`,children:X}),U&&t.jsx("span",{className:"tree-type-tag",title:W,children:W}),f.text&&t.jsxs("span",{className:"tree-text-preview",children:['"',f.text.slice(0,20),'"']}),$&&t.jsx("span",{className:"tree-badge",children:f.children.length})]}),D&&$&&t.jsx("div",{className:"tree-children",children:f.children.map(ce=>mt(ce,k+1))})]},f.xpath)},kt=f=>{var W,Z,U;if(!I.width)return[];const k=[],D=(W=r==null?void 0:r.hierarchy)==null?void 0:W.rect;let $=((Z=r==null?void 0:r.metadata)==null?void 0:Z.screenWidth)||I.width,F=((U=r==null?void 0:r.metadata)==null?void 0:U.screenHeight)||I.height;D&&D.width>0&&D.height>0&&($=D.width,F=D.height);const H=(X,ue)=>{var te,Se,we;const xe=!X.children||X.children.length===0;((te=X.rect)==null?void 0:te.width)>0&&((Se=X.rect)==null?void 0:Se.height)>0&&xe&&k.push(t.jsx("div",{className:"omni-hit-area",style:{left:`${X.rect.x/$*100}%`,top:`${X.rect.y/F*100}%`,width:`${X.rect.width/$*100}%`,height:`${X.rect.height/F*100}%`,zIndex:ue},onClick:ce=>{ce.stopPropagation(),h(X),E("info")},onMouseEnter:()=>g(X),onMouseLeave:()=>g(null)},X.xpath)),(we=X.children)==null||we.forEach(ce=>H(ce,ue+1))};return r!=null&&r.hierarchy&&H(r.hierarchy,1),k},Ue=()=>{var H,W,Z;if(!re||!I.width)return[];const f=_[re];if(!f||f.kind!=="matched"||f.nodes.length===0)return[];const k=(H=r==null?void 0:r.hierarchy)==null?void 0:H.rect;let D=((W=r==null?void 0:r.metadata)==null?void 0:W.screenWidth)||I.width,$=((Z=r==null?void 0:r.metadata)==null?void 0:Z.screenHeight)||I.height;k&&k.width>0&&k.height>0&&(D=k.width,$=k.height);const F=f.nodes.length===1?"omni-frame-match unique":"omni-frame-match multi";return f.nodes.filter(U=>U.rect&&U.rect.width>0&&U.rect.height>0).map((U,X)=>t.jsx("div",{className:F,style:{left:`${U.rect.x/D*100}%`,top:`${U.rect.y/$*100}%`,width:`${U.rect.width/D*100}%`,height:`${U.rect.height/$*100}%`}},`match-${re}-${X}`))},Ve=(f,k)=>{var H,W,Z;if(!(f!=null&&f.rect)||!I.width)return null;const D=(H=r==null?void 0:r.hierarchy)==null?void 0:H.rect;let $=((W=r==null?void 0:r.metadata)==null?void 0:W.screenWidth)||I.width,F=((Z=r==null?void 0:r.metadata)==null?void 0:Z.screenHeight)||I.height;return D&&D.width>0&&D.height>0&&($=D.width,F=D.height),t.jsx("div",{className:`omni-frame-${k}`,style:{left:`${f.rect.x/$*100}%`,top:`${f.rect.y/F*100}%`,width:`${f.rect.width/$*100}%`,height:`${f.rect.height/F*100}%`}})},st=r!=null&&r.hierarchy?ge(r.hierarchy):0,ne=c?Vs(c):null,Te={stable:{icon:t.jsx(Ss,{size:10}),cls:"stable"},moderate:{icon:t.jsx(Cs,{size:10}),cls:"moderate"},fragile:{icon:t.jsx(Zt,{size:10}),cls:"fragile"},"very-fragile":{icon:t.jsx(Zt,{size:10}),cls:"very-fragile"}},nt=i&&(r!=null&&r.hierarchy)?be(r.hierarchy):[];return t.jsx("div",{className:`omni-inspector-container ${i?"omni-embedded":""}`,children: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 ${O==="inspect"?"active":""}`,onClick:()=>J("inspect"),title:"Inspection Mode (Highlight Elements)",children:[t.jsx(Vn,{size:12}),t.jsx("span",{children:"Inspect"})]}),t.jsxs("button",{className:`omni-mode-btn ${O==="interact"?"active":""}`,onClick:()=>J("interact"),title:"Interaction Mode (Direct Control)",children:[t.jsx(Ki,{size:12}),t.jsx("span",{children:"Interact"})]})]})]}),t.jsxs("button",{className:"omni-refresh-btn",onClick:pe,disabled:a,children:[t.jsx(vt,{size:12,className:a?"animate-spin":""}),a?"Capturing...":"Refresh"]})]}),t.jsxs("div",{className:"omni-screenshot-container",ref:ye,children:[a&&!ze&&t.jsxs("div",{className:"omni-loading-overlay",children:[t.jsx("div",{className:"omni-spinner"}),t.jsx("span",{children:"Capturing screen..."})]}),!r&&!a&&!ze&&t.jsxs("div",{className:"omni-empty-state",children:[t.jsx(Qt,{size:40}),t.jsx("span",{children:"Click Refresh to capture"})]}),ze&&t.jsxs("div",{className:`omni-screenshot-wrapper ${O==="interact"?"interactable":""}`,onMouseDown:me,onMouseUp:He,children:[t.jsx("img",{ref:ve,src:n,onLoad:$e,onError:Pe,className:"omni-screenshot-img",style:O==="interact"?{pointerEvents:"none"}:{},draggable:!1,alt:"Live Device Stream"}),(r==null?void 0:r.hierarchy)&&O==="inspect"&&t.jsxs("div",{className:"omni-overlay",children:[kt(r.hierarchy),Ue(),Ve(x,"hover"),Ve(c,"select")]})]}),!ze&&(r==null?void 0:r.screenshot)&&t.jsxs("div",{className:`omni-screenshot-wrapper ${O==="interact"?"interactable":""}`,onMouseDown:me,onMouseUp:He,children:[t.jsx("img",{ref:Ge,src:`data:image/png;base64,${r.screenshot}`,onLoad:Je,className:"omni-screenshot-img",style:O==="interact"?{pointerEvents:"none"}:{},draggable:!1}),O==="inspect"&&t.jsxs("div",{className:"omni-overlay",children:[kt(r.hierarchy),Ue(),Ve(x,"hover"),Ve(c,"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(Xn,{size:14}),t.jsx("span",{children:"Source"}),st>0&&t.jsxs("span",{className:"omni-count-badge",children:[st," elements"]})]}),t.jsxs("div",{className:"omni-tree-actions",children:[t.jsx("button",{onClick:et,className:"omni-action-btn",title:"Expand All",children:t.jsx(wi,{size:12})}),t.jsx("button",{onClick:tt,className:"omni-action-btn",title:"Collapse All",children:t.jsx(Ii,{size:12})}),i&&t.jsx("button",{onClick:pe,className:"omni-action-btn",title:a?"Capturing…":"Refresh snapshot",disabled:a,children:t.jsx(vt,{size:12,className:a?"animate-spin":""})})]})]}),t.jsxs("div",{className:"omni-tree-search",children:[t.jsx(rs,{size:14}),t.jsx("input",{type:"text",placeholder:"Search elements... (try 'login button' or 'text field')",value:p,onChange:f=>S(f.target.value)}),p&&t.jsx("button",{onClick:()=>S(""),className:"omni-clear-btn",children:"×"})]}),p&&t.jsxs("div",{className:"omni-search-hint",children:[t.jsx(os,{size:10}),' Smart search active — try "button", "input", "image"']}),t.jsx("div",{className:"omni-tree-content",children:r!=null&&r.hierarchy?mt(r.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",children:[t.jsxs("button",{className:`omni-details-tab ${v==="info"?"active":""}`,onClick:()=>E("info"),children:[t.jsx(Ei,{size:12})," Info"]}),t.jsxs("button",{className:`omni-details-tab ${v==="insight"?"active":""}`,onClick:()=>E("insight"),disabled:!c,title:"AI Element Analysis",children:[t.jsx(Si,{size:12})," AI Insight"]}),t.jsxs("button",{className:`omni-details-tab ${v==="code"?"active":""}`,onClick:()=>E("code"),disabled:!c,title:"Generate Test Code",children:[t.jsx(Es,{size:12})," Code Gen"]})]}),t.jsx("div",{className:"omni-details-content",children:c?t.jsxs(t.Fragment,{children:[v==="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:c.type})]}),c.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:c.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(c).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:c.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.jsx("div",{className:"omni-locators-list",children:(At=c.suggestedLocators)==null?void 0:At.map(f=>{const k=Ws(f.strategy,f.value),D=Te[k.level],$=_[f.strategy];let F=null;return $&&($.kind==="unsupported"?F=t.jsxs("span",{className:"omni-match-badge unsupported",title:$.reason||"Cannot evaluate without a real driver",children:[t.jsx(mi,{size:10})," preview unavailable"]}):$.nodes.length===0?F=t.jsxs("span",{className:"omni-match-badge zero",title:"No element matches this selector in the current snapshot",children:[t.jsx(Zt,{size:10})," 0 matches"]}):$.nodes.length===1?F=t.jsxs("span",{className:"omni-match-badge unique",title:"Selector is unique in the current snapshot",children:[t.jsx(Ss,{size:10})," unique"]}):F=t.jsxs("span",{className:"omni-match-badge multi",title:`${$.nodes.length} elements match — selector is not unique`,children:[t.jsx(Cs,{size:10})," ",$.nodes.length," matches"]})),t.jsxs("div",{className:`omni-locator-row ${(M==null?void 0:M.strategy)===f.strategy?"selected-for-code":""}`,onClick:()=>V(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 ${D.cls}`,title:k.reason,children:[D.icon,k.level]}),F]}),t.jsx("code",{className:"omni-locator-value",children:f.value}),t.jsx("span",{className:"omni-stability-reason",children:k.reason})]}),t.jsxs("div",{className:"omni-locator-actions",children:[t.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),Ze(f.strategy,f.value)},className:`omni-test-btn ${re===f.strategy?"active":""}`,title:"Test this locator against the current snapshot",children:t.jsx(xi,{size:12})}),t.jsx("button",{onClick:H=>{H.stopPropagation(),We(f.value,f.strategy)},className:`omni-copy-btn ${j===f.strategy?"copied":""}`,children:j===f.strategy?t.jsx(Pt,{size:12}):t.jsx(yt,{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(c.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))})]})]}),v==="insight"&&ne&&t.jsxs("div",{className:"omni-insight-panel",children:[t.jsxs("div",{className:"omni-insight-role",children:[t.jsx("span",{className:"omni-insight-emoji",children:ne.emoji}),t.jsxs("div",{children:[t.jsx("div",{className:"omni-insight-role-name",children:ne.role}),t.jsx("div",{className:"omni-insight-interactable",children:ne.interactable?t.jsxs("span",{className:"omni-badge-green",children:[t.jsx(Qs,{size:10})," Interactable"]}):t.jsx("span",{className:"omni-badge-gray",children:"Visual Only"})})]})]}),ne.warning&&t.jsx("div",{className:"omni-insight-warning",children:ne.warning}),t.jsxs("div",{className:"omni-insight-description",children:[t.jsx(os,{size:12,className:"omni-insight-icon"}),t.jsx("p",{children:ne.description})]}),ne.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:ne.bestLocator.strategy}),t.jsx("code",{className:"omni-locator-value",children:ne.bestLocator.value})]}),t.jsx("button",{onClick:()=>We(ne.bestLocator.value,"best"),className:`omni-copy-btn ${j==="best"?"copied":""}`,children:j==="best"?t.jsx(Pt,{size:12}):t.jsx(yt,{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:(ft=c.attributes)==null?void 0:ft.clickable},{label:"Enabled",value:(Xe=c.attributes)==null?void 0:Xe.enabled},{label:"Scrollable",value:(pt=c.attributes)==null?void 0:pt.scrollable},{label:"Focusable",value:(Rt=c.attributes)==null?void 0:Rt.focusable},{label:"Children",value:((Et=c.children)==null?void 0:Et.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))})]})]}),v==="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 ${R===f?"active":""}`,onClick:()=>T(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("select",{value:M.strategy,onChange:f=>{var D;const k=(D=c.suggestedLocators)==null?void 0:D.find($=>$.strategy===f.target.value);k&&V(k)},className:"omni-fw-select",children:(Dt=c.suggestedLocators)==null?void 0:Dt.map(f=>t.jsxs("option",{value:f.strategy,children:[f.strategy," — ",Ws(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:R==="java"?"Java / TestNG":R==="python"?"Python / unittest":R==="javascript"?"JavaScript / Mocha":"WebdriverIO"}),t.jsx("button",{className:"omni-copy-btn",onClick:()=>We(Us(c,(r==null?void 0:r.platform)==="android"?"android":(r==null?void 0:r.platform)==="ios"?"ios":"unknown",R,M),"code"),children:j==="code"?t.jsx(Pt,{size:12}):t.jsx(yt,{size:12})})]}),t.jsx("pre",{className:"omni-codegen-pre",children:t.jsx("code",{children:Us(c,(r==null?void 0:r.platform)==="android"?"android":(r==null?void 0:r.platform)==="ios"?"ios":"unknown",R,M)})})]})]}):t.jsxs("div",{className:"omni-empty-state small",children:[t.jsx(Es,{size:24}),t.jsx("span",{children:"No locators available for this element"})]})]})]}):r!=null&&r.hierarchy?t.jsxs("div",{className:"omni-summary-panel",children:[t.jsxs("div",{className:"omni-summary-hero",children:[t.jsx(Qt,{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:st})]}),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:((qe=r.metadata)==null?void 0:qe.screenWidth)??I.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:((ht=r.metadata)==null?void 0:ht.screenHeight)??I.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:r.platform||"—"})]})]})]}),nt.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:nt.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(Qt,{size:32}),t.jsx("span",{children:a?"Capturing snapshot…":"Select an element from the tree or screenshot"})]})})]})]})})};function Eo({device:e,onClose:s}){var ce;const{toast:n,removeToast:i}=Xs(),a=hs(),{tab:o}=Ys(),r=m.useRef(null),l=m.useRef(null),[d,u]=m.useState({width:0,height:0}),[c,h]=m.useState(o||"actions"),[x,g]=m.useState(""),[b,y]=m.useState(""),[p,S]=m.useState(""),[j,w]=m.useState(!0),[v,E]=m.useState([]),[R,T]=m.useState(null),[M,V]=m.useState(!1),[I,K]=m.useState(!1),[Y,G]=m.useState(0),[N,se]=m.useState(e),[O,J]=m.useState([]),[_,Q]=m.useState(!1),[re,Ce]=m.useState(!1),[ye,Ge]=m.useState(null),[ve,De]=m.useState([]),[de,Ze]=m.useState(!0),[pe,Je]=m.useState(""),[Pe,$e]=m.useState(!1),[ze,me]=m.useState(0),[He,Qe]=m.useState(!1),[et,tt]=m.useState(!1),We=()=>{navigator.clipboard.writeText(N.udid).catch(()=>{}),tt(!0),setTimeout(()=>tt(!1),1500)},ge=m.useRef(""),be=m.useRef(null),[ut,mt]=m.useState(!1);m.useEffect(()=>{c&&(!o||o!==c)&&a(`/devices/${e.udid}/control/${c}`,{replace:!0})},[c,o,e.udid,a]),m.useEffect(()=>{let C;if(c==="logs"){$e(!1),me(0);const A=async()=>{try{const L=await z.getLogs(N.udid);if(me(P=>P+1),L&&L.logs&&L.logs.trim().length>0){$e(!0);const P=L.logs.replace(/\\u[0-9a-fA-F]{4}/g,q=>JSON.parse(`"${q}"`)).replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"").split(`
|
|
208
|
+
`).filter(q=>q.trim().length>0);P.length>0&&De(q=>[...q,...P].slice(-1e3))}else me(P=>(P>=3&&$e(!0),P))}catch(L){console.error("Failed to fetch logs:",L),me(P=>(P>=3&&$e(!0),P))}};A(),C=setInterval(A,3e3)}return()=>clearInterval(C)},[c,N.udid]);const kt=()=>{if(ve.length===0)return t.jsx("div",{className:"log-empty-state",children:Pe?t.jsxs(t.Fragment,{children:[t.jsx(as,{size:28,style:{color:"var(--text-muted)",marginBottom:12,opacity:.4}}),t.jsx("p",{className:"log-empty-title",children:"No log output yet"}),t.jsx("p",{className:"log-empty-subtitle",children:"The log stream is active but the device is quiet. Interact with the device to generate logs."})]}):t.jsxs(t.Fragment,{children:[t.jsx(Tt,{size:28,className:"animate-spin",style:{color:"var(--green)",marginBottom:12}}),t.jsx("p",{className:"log-empty-title",children:"Connecting to device syslog..."}),t.jsxs("p",{className:"log-empty-subtitle",children:["Initializing persistent log stream for ",N.name]})]})});const C=ve.filter(A=>!pe||A.toLowerCase().includes(pe.toLowerCase()));return C.length===0&&pe?t.jsxs("div",{className:"log-empty-state",children:[t.jsx(rs,{size:28,style:{color:"var(--text-muted)",marginBottom:12,opacity:.4}}),t.jsxs("p",{className:"log-empty-title",children:['No matches for "',pe,'"']}),t.jsxs("p",{className:"log-empty-subtitle",children:[ve.length," lines in buffer. Try a different search term."]})]}):C.map((A,L)=>{let P="log-debug";const q=A.toLowerCase();return q.includes("error")||q.includes("fail")?P="log-error":q.includes("warning")||q.includes("warn")?P="log-warn":(q.includes("notice")||q.includes("info"))&&(P="log-notice"),t.jsxs("div",{className:`log-line ${P}`,children:[t.jsx("span",{className:"log-index",children:L+1}),t.jsx("span",{className:"log-content",children:A})]},`${L}-${A.substring(0,10)}`)})};m.useEffect(()=>{c==="logs"&&de&&l.current&&(l.current.scrollTop=l.current.scrollHeight)},[ve,c,de]),m.useEffect(()=>((async()=>{try{K(!0),await z.startStream(N.udid);const L=(await z.getDevices()).find(P=>P.udid===N.udid);L&&se(L)}catch(A){console.error("Auto-start stream failed:",A)}finally{K(!1)}})(),()=>{z.stopStream(N.udid).catch(()=>{})}),[e.udid]);const Ue=m.useCallback(async()=>{try{Q(!0);const C=await z.listApps(N.udid);Array.isArray(C)&&J(C)}catch(C){console.error("Failed to load apps:",C)}finally{Q(!1)}},[N.udid]);m.useEffect(()=>{c==="actions"&&Ue()},[c,Ue]);const Ve=parseInt(N.screenWidth||"1080",10),st=parseInt(N.screenHeight||"1920",10),ne=Math.min(Ve,st),Te=Math.max(Ve,st),nt=ne/Te,qe=m.useCallback(()=>{const C=!j,A=C?window.innerHeight*.55:window.innerHeight*.7,L=620,q=window.innerWidth>900;let ee;C?ee=q?Math.min(window.innerWidth*.8,window.innerWidth-L):window.innerWidth*.8:ee=window.innerWidth*.45;const le=j?nt:1/nt;let ie,ae;j?(ie=A,ae=ie*le,ae>ee&&(ae=ee,ie=ae/le)):(ae=ee,ie=ae/le,ie>A&&(ie=A,ae=ie*le)),u({width:ae,height:ie})},[nt,j]);m.useEffect(()=>(qe(),window.addEventListener("resize",qe),()=>window.removeEventListener("resize",qe)),[qe]),m.useEffect(()=>{const C=async()=>{if(ge.current.length>0){const L=ge.current;ge.current="";try{await z.typeText(N.udid,L)}catch(P){console.error("Keyboard buffering flush failed:",P)}}},A=L=>{const P=document.activeElement;if(P&&(P.tagName==="INPUT"||P.tagName==="TEXTAREA"||P.isContentEditable)||!ut&&c!=="terminal")return;const ee=L.key;ee==="Enter"?(be.current&&clearTimeout(be.current),C(),z.pressKey(N.udid,N.platform==="android"?66:"enter")):ee==="Backspace"?(be.current&&clearTimeout(be.current),C(),z.pressKey(N.udid,N.platform==="android"?67:"backspace")):ee.length===1&&(ge.current+=ee,be.current&&clearTimeout(be.current),be.current=setTimeout(()=>{C()},50))};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A),be.current&&clearTimeout(be.current)}},[N.udid,N.platform,ut,c]);const[ht,At]=m.useState(Date.now()),ft=()=>{const C=Y>0?`r=${Y}&`:"";return N.session_id&&!String(N.session_id).startsWith("manual_")?`/xenon/api/session/${N.session_id}/live_video?${C}t=${ht}`:`/xenon/api/control/${N.udid}/stream?${C}t=${ht}`};m.useEffect(()=>{Y>0&&At(Date.now())},[Y]);const Xe=m.useRef(null),pt=C=>{const A=C.currentTarget.getBoundingClientRect();return{x:C.clientX-A.left,y:C.clientY-A.top}},Rt=C=>{const A=pt(C);Xe.current={x:A.x,y:A.y,time:Date.now()}},Et=async C=>{if(!Xe.current)return;const A=Xe.current,L=pt(C),P=Date.now()-A.time;let q,ee,le,ie;j?(q=A.x/d.width*ne,ee=A.y/d.height*Te,le=L.x/d.width*ne,ie=L.y/d.height*Te):(q=A.x/d.width*Te,ee=A.y/d.height*ne,le=L.x/d.width*Te,ie=L.y/d.height*ne);const ae=Math.abs(le-q),$t=Math.abs(ie-ee);try{P<500&&ae<10&&$t<10?await z.tap(N.udid,Math.round(q),Math.round(ee)):P>=500&&ae<10&&$t<10?await z.touchAndHold(N.udid,Math.round(q),Math.round(ee),P):await z.swipe(N.udid,Math.round(q),Math.round(ee),Math.round(le),Math.round(ie))}catch(En){console.error("Action failed:",En)}Xe.current=null},Dt=()=>z.pressKey(N.udid,N.platform==="android"?gt.HOME:Jt.HOME),f=()=>z.pressKey(N.udid,gt.BACK),k=()=>z.pressKey(N.udid,gt.APP_SWITCH),D=()=>z.pressKey(N.udid,N.platform==="android"?gt.VOLUME_UP:Jt.VOLUME_UP),$=()=>z.pressKey(N.udid,N.platform==="android"?gt.VOLUME_DOWN:Jt.VOLUME_DOWN),F=()=>z.lock(N.udid),H=()=>z.unlock(N.udid),W=async()=>{x.trim()&&(await z.typeText(N.udid,x),g(""))},Z=async()=>{try{y("Fetching...");const C=await z.getClipboard(N.udid);C&&C.content!==void 0?y(C.content||"(Clipboard is empty)"):y("No content received")}catch{y("Error: Check Appium Settings app")}},U=async()=>{V(!0);try{const C=await z.getScreenshot(N.udid);if(C!=null&&C.screenshot){const A={id:xo(),base64:C.screenshot,timestamp:Date.now()};E(L=>[A,...L]),T(0)}}catch(C){console.error("Failed to take screenshot:",C)}finally{V(!1)}},X=C=>{E(A=>{const L=A.filter(P=>P.id!==C);return L.length===0?T(null):R!==null&&R>=L.length&&T(0),L})},ue=()=>{E([]),T(null),n("Cleared all captured evidence.","success")},xe=C=>{const A=document.createElement("a");A.href=`data:image/png;base64,${C}`,A.download=`screenshot-${N.udid}-${Date.now()}.png`,A.click()},te=async C=>{const A=ne/2,L=Te/2,P=ne*.4,q=Te*.4;let ee,le,ie,ae;switch(C){case"left":ee=A+P,le=L,ie=A-P,ae=L;break;case"right":ee=A-P,le=L,ie=A+P,ae=L;break;case"up":ee=A,le=L+q,ie=A,ae=L-q;break;case"down":ee=A,le=L-q,ie=A,ae=L+q;break}try{await z.swipe(N.udid,Math.round(ee),Math.round(le),Math.round(ie),Math.round(ae))}catch($t){console.error(`Quick swipe ${C} failed:`,$t)}},Se=async()=>{if(p.trim()){const C=n(`Uninstalling ${p}...`,"loading",0);try{Q(!0),await z.uninstallApp(N.udid,p),S(""),n(`Request sent for ${p}`,"success"),setTimeout(Ue,3e3)}catch{n("Uninstall failed. Check logs.","error")}finally{Q(!1),i(C)}}},we=async()=>{if(!ye)return;let C;try{Ce(!0),C=n(`Installing app to ${N.udid}...`,"loading",0);const A=await z.uploadAndInstallApp(N.udid,ye);A.success?(n(A.message||"App installed successfully","success"),Ge(null),setTimeout(Ue,5e3)):n("Installation failed: "+(A.error||"Unknown error"),"error")}catch(A){n("Installation failed: "+A.message,"error")}finally{C&&i(C),Ce(!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(Gt,{size:18})," DEVICES"]}),t.jsxs("div",{className:"device-info-mini",children:[t.jsx("span",{className:`device-pill platform-pill ${N.platform}`,children:N.platform==="ios"?"Apple":"Android"}),t.jsxs("span",{className:"device-pill version-pill",children:["v",N.sdk]}),N.reservedUntil&&Date.now()<N.reservedUntil&&t.jsxs("span",{className:"device-pill reserved-pill",title:`Reserved by ${N.reservedBy}${N.reservationReason?`: ${N.reservationReason}`:""}`,children:["RESERVED BY ",((ce=N.reservedBy)==null?void 0:ce.toUpperCase())||"ANONYMOUS"]}),t.jsx("h2",{className:"device-name-text",children:N.name}),t.jsxs("span",{className:"udid-chip",title:N.udid,children:[t.jsx("span",{className:"udid-chip__value",children:N.udid}),t.jsx("button",{type:"button",className:"udid-chip__copy",onClick:We,"aria-label":"Copy UDID",title:et?"Copied!":"Copy UDID",children:et?t.jsx(Pt,{size:12}):t.jsx(yt,{size:12})})]})]})]}),t.jsxs("div",{className:`control-view-main ${j?"":"is-landscape"} ${c==="omni"?"omni-mode":""}`,children:[t.jsxs("div",{className:"device-preview-column",children:[t.jsx("div",{className:"device-screen-wrapper",children:t.jsxs("div",{ref:r,className:`device-stream-canvas ${j?"":"landscape"} ${ut?"focused":""}`,style:{width:d.width,height:d.height,background:"#000"},tabIndex:0,onFocus:()=>mt(!0),onBlur:()=>mt(!1),onMouseDown:Rt,onMouseUp:Et,children:[(I||!He)&&t.jsxs("div",{className:"device-stream-placeholder",style:{position:"absolute",zIndex:10},children:[t.jsx(vt,{size:40,className:"animate-spin",color:"var(--green)"}),t.jsx("p",{style:{marginTop:16},children:I?"ESTABLISHING TRACE...":"Waiting for stream…"})]}),t.jsx("img",{src:ft(),alt:"Device Stream",className:"device-stream-image",style:{width:"100%",height:"100%",objectFit:"contain"},onLoad:()=>Qe(!0),onError:()=>{console.warn("Stream failed to load, retrying..."),Qe(!1),setTimeout(()=>G(C=>C+1),2e3)}})]})}),t.jsxs("aside",{className:"device-footer-actions",children:[t.jsxs("button",{className:`footer-action-btn ${j?"active":""}`,onClick:()=>w(!0),children:[t.jsx(vt,{size:14,style:{transform:j?"none":"rotate(-90deg)"}})," ","PORTRAIT"]}),t.jsxs("button",{className:`footer-action-btn ${j?"":"active"}`,onClick:()=>w(!1),children:[t.jsx(vt,{size:14,style:{transform:"rotate(90deg)"}})," LANDSCAPE"]}),t.jsx("div",{className:"footer-divider"}),t.jsxs("button",{className:"footer-action-btn",onClick:Dt,children:[t.jsx(Ni,{size:20})," HOME"]}),N.platform==="android"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"footer-action-btn",onClick:f,title:"Back",children:[t.jsx(Gt,{size:20})," BACK"]}),t.jsxs("button",{className:"footer-action-btn",onClick:k,title:"App Switcher",children:[t.jsx(Bi,{size:20})," APPS"]})]}),t.jsx("div",{className:"footer-divider"}),t.jsxs("button",{className:"footer-action-btn",onClick:D,title:"Volume Up",children:[t.jsx(Ji,{size:20})," VOL+"]}),t.jsxs("button",{className:"footer-action-btn",onClick:$,title:"Volume Down",children:[t.jsx(Gi,{size:20})," VOL−"]}),t.jsx("button",{className:"footer-action-btn",onClick:F,title:"Lock Device",children:t.jsx(Kn,{size:20})}),t.jsx("button",{className:"footer-action-btn",onClick:H,title:"Unlock Device",children:t.jsx(Ai,{size:20})})]})]}),t.jsxs("div",{className:"device-interactions-column",children:[t.jsxs("div",{className:"interaction-tabs",children:[t.jsxs("button",{className:`tab-btn ${c==="actions"?"active":""}`,onClick:()=>h("actions"),children:[t.jsx(Qs,{size:13}),t.jsx("span",{children:"Actions"})]}),t.jsxs("button",{className:`tab-btn ${c==="screenshot"?"active":""}`,onClick:()=>h("screenshot"),children:[t.jsx(xt,{size:13}),t.jsx("span",{children:"Screenshot"})]}),t.jsxs("button",{className:`tab-btn ${c==="logs"?"active":""}`,onClick:()=>h("logs"),children:[t.jsx(Pi,{size:13}),t.jsx("span",{children:"Debug Logs"})]}),t.jsxs("button",{className:`tab-btn ${c==="terminal"?"active":""}`,onClick:()=>h("terminal"),children:[t.jsx(as,{size:13}),t.jsx("span",{children:"Shell"})]}),t.jsxs("button",{className:`tab-btn ${c==="omni"?"active":""}`,onClick:()=>h("omni"),children:[t.jsx(os,{size:13}),t.jsx("span",{children:"Omni-Vision"})]})]}),t.jsx("div",{className:`interactions-scroll-area ${c==="terminal"?"terminal-mode":""} ${c==="screenshot"||c==="logs"?"screenshot-mode":""}`,children:t.jsxs("div",{className:"tab-content",children:[c==="omni"&&t.jsx("div",{className:"omni-inspector-tab-wrapper animate-fade-in",children:t.jsx(Ro,{sessionId:N.session_id?String(N.session_id):null,udid:N.udid,streamUrl:ft(),embedded:!0})}),c==="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(qn,{size:18,color:"var(--green)"})," 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:x,onChange:C=>g(C.target.value),onKeyDown:C=>C.key==="Enter"&&W()})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(On,{size:18,color:"var(--green)"})," 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 (.apk, .ipa, .app)"}),t.jsxs("div",{className:"upload-box-row",children:[t.jsxs("label",{className:"file-upload-launcher",children:[t.jsx(Pn,{size:14}),t.jsx("span",{children:ye?ye.name:"Select File"}),t.jsx("input",{type:"file",accept:".apk,.ipa,.app",onChange:C=>{var A;return Ge(((A=C.target.files)==null?void 0:A[0])||null)},hidden:!0})]}),t.jsx("button",{className:"btn-premium btn-sm",disabled:!ye||re,onClick:we,children:re?t.jsx(Tt,{className:"animate-spin",size:14}):"INSTALL"})]})]}),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("select",{className:"app-select-dropdown compact",value:p,onChange:C=>S(C.target.value),disabled:_,children:[t.jsx("option",{value:"",children:_?"Loading apps...":"-- Select App to Remove --"}),O.map(C=>t.jsx("option",{value:C,children:C},C))]}),_&&t.jsx(Tt,{className:"animate-spin select-loader",size:12})]}),t.jsxs("button",{className:"btn-destructive btn-sm",onClick:Se,disabled:!p||_,children:[t.jsx(Mt,{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:p,onChange:C=>S(C.target.value)})]})]})]})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(fi,{size:18,color:"var(--green)"})," Clipboard"]}),t.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"flex-start"},children:[t.jsx("button",{className:"btn-premium btn-sm",style:{width:"140px",flexShrink:0},onClick:Z,children:"FETCH VALUE"}),t.jsx("div",{className:"clipboard-display compact",style:{marginTop:0,flex:1},children:b})]})]}),t.jsxs("div",{className:"action-card full-width",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(Mi,{size:18,color:"var(--green)"})," 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:()=>te("up"),children:t.jsx(di,{size:24})}),t.jsx("div",{}),t.jsx("button",{className:"dpad-btn",onClick:()=>te("left"),children:t.jsx(Gt,{size:24})}),t.jsx("div",{className:"dpad-center"}),t.jsx("button",{className:"dpad-btn",onClick:()=>te("right"),children:t.jsx(en,{size:24})}),t.jsx("div",{}),t.jsx("button",{className:"dpad-btn",onClick:()=>te("down"),children:t.jsx(Ks,{size:24})}),t.jsx("div",{})]}),t.jsx("p",{className:"compact-label",style:{opacity:.5},children:"Quick swipe in a direction"})]})]})]}),c==="screenshot"&&t.jsxs("div",{className:"action-card screenshot-card",children:[t.jsxs("header",{className:"action-card-header",children:[t.jsxs("div",{className:"title-group",children:[t.jsxs("h4",{className:"action-card-title",children:[t.jsx(xt,{size:20,color:"var(--green)"})," Captured Evidence"]}),t.jsx("p",{className:"hint-text",children:"Relay screenshots from device to host."})]}),v.length>0&&t.jsx("button",{className:"btn-text-only",onClick:ue,children:"CLEAR ALL"})]}),t.jsxs("div",{className:"screenshot-workspace",children:[t.jsxs("div",{className:"screenshot-gallery-sidebar",children:[t.jsxs("button",{className:"btn-premium take-screenshot-btn",onClick:U,disabled:M,children:[M?t.jsx(Tt,{className:"animate-spin",size:16}):t.jsx(xt,{size:16}),t.jsx("span",{children:M?"CAPTURING...":"NEW CAPTURE"})]}),t.jsxs("div",{className:"screenshot-thumbnails-list",children:[v.length===0&&!M&&t.jsxs("div",{className:"empty-gallery-state",children:[t.jsx(xt,{size:20,className:"empty-gallery-icon"}),t.jsx("p",{className:"empty-gallery-title",children:"No captures yet"}),t.jsxs("p",{className:"empty-gallery-hint",children:["Click ",t.jsx("strong",{children:"New Capture"})," above to grab a screenshot."]})]}),v.map((C,A)=>t.jsxs("div",{className:`screenshot-thumb-item ${R===A?"active":""}`,onClick:()=>T(A),children:[t.jsx("img",{src:`data:image/png;base64,${C.base64}`,alt:"Thumb"}),t.jsx("span",{className:"thumb-time",children:new Date(C.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),t.jsx("button",{className:"thumb-delete-btn",onClick:L=>{L.stopPropagation(),X(C.id)},children:t.jsx(Mt,{size:12})})]},C.id))]})]}),t.jsx("div",{className:"screenshot-main-preview",children:R!==null&&v[R]?t.jsxs("div",{className:"preview-container",children:[t.jsx("div",{className:"preview-image-wrapper",children:t.jsx("img",{src:`data:image/png;base64,${v[R].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:v[R].id.substring(0,8)}),t.jsx("span",{className:"meta-divider",children:"|"}),t.jsx("span",{className:"meta-value",children:new Date(v[R].timestamp).toLocaleString()})]}),t.jsxs("div",{className:"preview-actions",children:[t.jsx("button",{className:"btn-premium btn-sm",onClick:()=>xe(v[R].base64),children:"DOWNLOAD PNG"}),t.jsxs("button",{className:"btn-destructive btn-sm",onClick:()=>X(v[R].id),children:[t.jsx(Mt,{size:14})," DELETE"]})]})]})]}):t.jsxs("div",{className:"preview-empty-placeholder",children:[t.jsx(xt,{size:48,style:{opacity:.1,marginBottom:16}}),t.jsx("p",{children:"Capture a screenshot to begin analysis"})]})})]})]}),c==="logs"&&t.jsxs("div",{className:"action-card screenshot-card",style:{padding:0,gap:0},children:[t.jsxs("div",{className:"log-toolbar",children:[t.jsxs("div",{className:"log-filter-group",children:[t.jsxs("div",{className:"log-stat-pill",children:[t.jsx("span",{className:`log-live-dot ${Pe?"active":""}`}),Pe?"LIVE":"CONNECTING"]}),t.jsxs("div",{className:"log-stat-pill",style:{opacity:.6},children:[ve.length," LINES"]}),t.jsxs("div",{className:"log-search-box",children:[t.jsx(rs,{size:14,className:"search-icon-inline"}),t.jsx("input",{type:"text",className:"type-input-field tiny",placeholder:"Filter trace...",value:pe,onChange:C=>Je(C.target.value)})]})]}),t.jsxs("div",{className:"log-actions-group",children:[t.jsxs("button",{className:`btn-secondary btn-sm ${de?"active":""}`,onClick:()=>Ze(!de),title:de?"Freeze Logs":"Follow Logs",children:[t.jsx(er,{size:14,className:de?"animate-pulse":""}),de?"FREEZE":"FOLLOW"]}),t.jsxs("button",{className:"btn-premium btn-sm",onClick:()=>{const C=new Blob([ve.join(`
|
|
209
|
+
`)],{type:"text/plain"}),A=URL.createObjectURL(C),L=document.createElement("a");L.href=A,L.download=`logs-${N.udid}-${Date.now()}.txt`,L.click(),URL.revokeObjectURL(A)},disabled:ve.length===0,children:[t.jsx(Yn,{size:14}),"EXPORT"]}),t.jsxs("button",{className:"btn-secondary btn-sm",onClick:()=>De([]),title:"Clear Logs",children:[t.jsx(Mt,{size:14}),"CLEAR"]})]})]}),t.jsx("div",{className:"log-display-area",ref:l,style:{flex:1},children:kt()})]}),c==="terminal"&&t.jsx("div",{className:"action-card full-height",children:t.jsx(yo,{platform:(N.platform||"").toLowerCase(),prompt:`${(N.platform||"").toLowerCase()==="ios"?"ios":"adb"} $`,welcomeMessage:`Connected to ${N.name} (${N.udid}).
|
|
210
|
+
Internal Shell Environment.`,onCommand:async C=>{const A=await z.executeShell(N.udid,C);if(A.error)throw new Error(A.error);return A.output}})})]})})]})]}),N.session_id&&!String(N.session_id).startsWith("manual_")&&t.jsx(zn,{sessionId:String(N.session_id),mode:"slice",windowSec:60,variant:"floating"})]})}class Do extends ke.Component{constructor(s){super(s),this.socketCleanups=[],this.refreshTimeout=null,this.state={devices:[],activeSessionsCount:0,pendingSessionsCount:0,queueSummary:null,statusFilter:"all",search:""}}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)}componentWillUnmount(){this.devicePolling&&(clearInterval(this.devicePolling),this.devicePolling=void 0),this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null),this.socketCleanups.forEach(s=>s())}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 z.getDevices(),n=this.getBusyDevicesCount(s),i=await z.getPendingSessionsCount(),a=await z.getQueueSummary();this.setState({devices:s,activeSessionsCount:n,pendingSessionsCount:i,queueSummary:a})}catch(s){console.log(s)}}getFiltered(){const s=Date.now(),n=a=>!!(a.reservedUntil&&s<a.reservedUntil),i=this.state.search.trim().toLowerCase();return this.state.devices.filter(a=>{if(i&&!`${a.name} ${a.udid}`.toLowerCase().includes(i))return!1;switch(this.state.statusFilter){case"all":return!0;case"offline":return a.offline;case"busy":return a.busy&&!a.offline;case"reserved":return n(a)&&!a.busy&&!a.offline;case"ready":return!a.offline&&!a.busy&&!n(a)&&!a.userBlocked;default:return!0}})}statusCount(s){const n=Date.now(),i=a=>!!(a.reservedUntil&&n<a.reservedUntil);switch(s){case"all":return this.state.devices.length;case"offline":return this.state.devices.filter(a=>a.offline).length;case"busy":return this.state.devices.filter(a=>a.busy&&!a.offline).length;case"reserved":return this.state.devices.filter(a=>i(a)&&!a.busy&&!a.offline).length;case"ready":return this.state.devices.filter(a=>!a.offline&&!a.busy&&!i(a)&&!a.userBlocked).length}}render(){const s=this.getFiltered(),{udid:n}=this.props.params,i=n?this.state.devices.find(a=>a.udid===n):null;return t.jsxs("div",{className:"device-explorer-container",children:[t.jsxs("div",{className:"de2-sticky-group",children:[t.jsx(_n,{icon:ks,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(Gn,{size:"sm",value:this.state.statusFilter,onChange:a=>this.setState({statusFilter:a}),segments:[{value:"all",label:"All",count:this.statusCount("all")},{value:"ready",label:"Ready",count:this.statusCount("ready")},{value:"busy",label:"Busy",count:this.statusCount("busy")},{value:"reserved",label:"Reserved",count:this.statusCount("reserved")},{value:"offline",label:"Offline",count:this.statusCount("offline")}]}),t.jsx("input",{type:"text",className:"de2-search",placeholder:"Search by name or UDID…",value:this.state.search,onChange:a=>this.setState({search:a.target.value})}),t.jsxs(it,{variant:"secondary",size:"sm",onClick:()=>this.fetchDevices(),children:[t.jsx(As,{size:12})," Refresh"]})]})]}),s.length>0?t.jsx(uo,{devices:s,reloadDevices:()=>this.fetchDevices()}):t.jsxs("div",{className:"device-explorer-empty stagger-1",children:[t.jsx("div",{className:"device-explorer-empty-icon",children:t.jsx(ks,{size:32})}),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(it,{variant:"primary",onClick:()=>this.fetchDevices(),children:[t.jsx(As,{size:14}),"Manual Sync"]})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"No Devices Found"}),t.jsx("p",{children:"Deployment configuration mismatch. Adjust your platform or state filters to find the appropriate testing target."}),t.jsx(it,{variant:"secondary",onClick:()=>this.setState({statusFilter:"all",search:""}),children:"Reset filters"})]})]}),i&&t.jsx("div",{className:"device-control-modal-overlay",children:t.jsx("div",{className:"device-control-modal",children:t.jsx(Eo,{device:i,onClose:()=>this.props.navigate("/devices")})})})]})}}function Jo(){const e=Ys(),s=hs(),{on:n}=Zn();return t.jsx(Do,{params:e,navigate:s,onSocketEvent:n})}export{Do as DeviceExplorer,Jo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as e,L as c,f as b}from"./index-
|
|
1
|
+
import{r as t,j as e,L as c,f as b}from"./index-CkwQBzCl.js";function h(){const[s,o]=t.useState(""),[a,l]=t.useState(!1),[m,u]=t.useState(!1),[i,n]=t.useState(null);async function d(r){r.preventDefault(),l(!0),n(null);try{await b(s),u(!0)}catch(x){n(x.message||"Request failed")}finally{l(!1)}}return e.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-[var(--bg)] text-[var(--text)]",children:e.jsxs("form",{onSubmit:d,className:"w-full max-w-sm px-6",children:[e.jsx("h1",{className:"text-2xl font-semibold mb-1",children:"Forgot password?"}),e.jsx("p",{className:"text-sm text-[var(--text-dim)] mb-6",children:"Enter your email and we'll send you a reset link if your account exists."}),m?e.jsx("div",{className:"text-sm text-[var(--text)] mb-6",children:"If your email is registered, you'll receive a reset link shortly. Check your spam folder if you don't see it within a minute."}):e.jsxs(e.Fragment,{children:[e.jsx("label",{className:"block text-xs text-[var(--text-dim)] mb-1",children:"Email"}),e.jsx("input",{type:"email",value:s,onChange:r=>o(r.target.value),autoFocus:!0,required:!0,className:"w-full mb-4 h-10 px-3 rounded-md bg-[var(--surface)] border border-[var(--border)] text-sm focus:border-[var(--green)] outline-none"}),i&&e.jsx("div",{className:"text-xs text-[var(--red)] mb-3",children:i}),e.jsx("button",{type:"submit",disabled:a||!s,className:"w-full h-10 rounded-md bg-[var(--green)] text-black font-medium text-sm disabled:opacity-50",children:a?"Sending…":"Send reset link"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(c,{to:"/login",className:"text-xs text-[var(--text-dim)] hover:text-[var(--text)]",children:"Back to sign in"})})]})})}export{h as default};
|