@tapflowio/relay 0.28.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RelayServer.d.ts +75 -0
- package/dist/RelayServer.d.ts.map +1 -1
- package/dist/RelayServer.js +496 -49
- package/dist/RelayServer.js.map +1 -1
- package/dist/SessionManager.d.ts +41 -2
- package/dist/SessionManager.d.ts.map +1 -1
- package/dist/SessionManager.js +31 -1
- package/dist/SessionManager.js.map +1 -1
- package/dist/admission/HostBootGate.d.ts +181 -0
- package/dist/admission/HostBootGate.d.ts.map +1 -0
- package/dist/admission/HostBootGate.js +388 -0
- package/dist/admission/HostBootGate.js.map +1 -0
- package/dist/admission/capacity.d.ts +51 -0
- package/dist/admission/capacity.d.ts.map +1 -0
- package/dist/admission/capacity.js +49 -0
- package/dist/admission/capacity.js.map +1 -0
- package/dist/admission/classifyBoot.d.ts +17 -0
- package/dist/admission/classifyBoot.d.ts.map +1 -0
- package/dist/admission/classifyBoot.js +23 -0
- package/dist/admission/classifyBoot.js.map +1 -0
- package/dist/admission/hostKey.d.ts +10 -0
- package/dist/admission/hostKey.d.ts.map +1 -0
- package/dist/admission/hostKey.js +13 -0
- package/dist/admission/hostKey.js.map +1 -0
- package/dist/admission/leaseChoice.d.ts +38 -0
- package/dist/admission/leaseChoice.d.ts.map +1 -0
- package/dist/admission/leaseChoice.js +40 -0
- package/dist/admission/leaseChoice.js.map +1 -0
- package/dist/admission/settle.d.ts +35 -0
- package/dist/admission/settle.d.ts.map +1 -0
- package/dist/admission/settle.js +41 -0
- package/dist/admission/settle.js.map +1 -0
- package/dist/api/runs.d.ts +21 -2
- package/dist/api/runs.d.ts.map +1 -1
- package/dist/api/runs.js +181 -26
- package/dist/api/runs.js.map +1 -1
- package/dist/migrations/017_flow_run_skipped.sql +34 -0
- package/dist/migrations/018_flow_run_service_tier.sql +6 -0
- package/dist/migrations/019_flow_run_device_reset.sql +7 -0
- package/package.json +4 -4
- package/public/assets/{AISessionWatch-C2h4NZ_I.js → AISessionWatch-BSBkpTom.js} +7 -7
- package/public/assets/AISessionWatch-BSBkpTom.js.br +0 -0
- package/public/assets/AISessionWatch-BSBkpTom.js.gz +0 -0
- package/public/assets/{AppCenter-S1y-8_7l.js → AppCenter-DD_6LQx-.js} +6 -6
- package/public/assets/AppCenter-DD_6LQx-.js.br +0 -0
- package/public/assets/AppCenter-DD_6LQx-.js.gz +0 -0
- package/public/assets/{Default-C-l1O-g9.js → Default-CQ3Ae2mK.js} +1 -1
- package/public/assets/Default-CQ3Ae2mK.js.br +0 -0
- package/public/assets/Default-CQ3Ae2mK.js.gz +0 -0
- package/public/assets/{Invite-BCndVxaO.js → Invite-D1uNMm0-.js} +1 -1
- package/public/assets/Invite-D1uNMm0-.js.br +0 -0
- package/public/assets/Invite-D1uNMm0-.js.gz +0 -0
- package/public/assets/{MacResources-41cFDgE1.js → MacResources-D2UeRbKL.js} +1 -1
- package/public/assets/MacResources-D2UeRbKL.js.br +0 -0
- package/public/assets/MacResources-D2UeRbKL.js.gz +0 -0
- package/public/assets/QASession-d0eOjXXo.js +81 -0
- package/public/assets/QASession-d0eOjXXo.js.br +0 -0
- package/public/assets/QASession-d0eOjXXo.js.gz +0 -0
- package/public/assets/{ResetPassword-8rj7ASt1.js → ResetPassword-B-4Uyfwr.js} +1 -1
- package/public/assets/ResetPassword-B-4Uyfwr.js.br +0 -0
- package/public/assets/ResetPassword-B-4Uyfwr.js.gz +0 -0
- package/public/assets/RunDetail-C50RjsuM.js +16 -0
- package/public/assets/RunDetail-C50RjsuM.js.br +0 -0
- package/public/assets/RunDetail-C50RjsuM.js.gz +0 -0
- package/public/assets/Runs-A7RcDLgO.js +6 -0
- package/public/assets/Runs-A7RcDLgO.js.br +0 -0
- package/public/assets/Runs-A7RcDLgO.js.gz +0 -0
- package/public/assets/{Setup-DZrhA_7b.js → Setup-DK6TZbwh.js} +1 -1
- package/public/assets/Setup-DK6TZbwh.js.br +0 -0
- package/public/assets/Setup-DK6TZbwh.js.gz +0 -0
- package/public/assets/{Team-CJThCjd3.js → Team-VoGput2p.js} +2 -2
- package/public/assets/Team-VoGput2p.js.br +0 -0
- package/public/assets/Team-VoGput2p.js.gz +0 -0
- package/public/assets/{Tokens-DGURtHWi.js → Tokens-qkcJgunR.js} +1 -1
- package/public/assets/Tokens-qkcJgunR.js.br +0 -0
- package/public/assets/Tokens-qkcJgunR.js.gz +0 -0
- package/public/assets/{aiSession-BW09Jhqz.js → aiSession-U7UqgdSb.js} +6 -6
- package/public/assets/aiSession-U7UqgdSb.js.br +0 -0
- package/public/assets/aiSession-U7UqgdSb.js.gz +0 -0
- package/public/assets/{alert-dialog-t5vlOabq.js → alert-dialog-C0mRms8g.js} +1 -1
- package/public/assets/{alert-dialog-t5vlOabq.js.br → alert-dialog-C0mRms8g.js.br} +0 -0
- package/public/assets/alert-dialog-C0mRms8g.js.gz +0 -0
- package/public/assets/{badge-DrDCTAQQ.js → badge-BjEnOmb0.js} +1 -1
- package/public/assets/badge-BjEnOmb0.js.br +0 -0
- package/public/assets/badge-BjEnOmb0.js.gz +0 -0
- package/public/assets/{dialog-BOFZkCES.js → dialog-Cugbp1C4.js} +1 -1
- package/public/assets/dialog-Cugbp1C4.js.br +0 -0
- package/public/assets/dialog-Cugbp1C4.js.gz +0 -0
- package/public/assets/{field-hint-B9fPUgi7.js → field-hint-qmBa0qqN.js} +1 -1
- package/public/assets/field-hint-qmBa0qqN.js.br +0 -0
- package/public/assets/field-hint-qmBa0qqN.js.gz +0 -0
- package/public/assets/{index-Bixhy5MB.js → index-C_3Q51YJ.js} +39 -39
- package/public/assets/index-C_3Q51YJ.js.br +0 -0
- package/public/assets/index-C_3Q51YJ.js.gz +0 -0
- package/public/assets/{list-view-BpOY1e-d.js → list-view-CyM0QUaH.js} +1 -1
- package/public/assets/list-view-CyM0QUaH.js.br +0 -0
- package/public/assets/list-view-CyM0QUaH.js.gz +0 -0
- package/public/assets/{pencil-ZlrAsWuU.js → pencil-DUZRZB3S.js} +2 -2
- package/public/assets/pencil-DUZRZB3S.js.br +0 -0
- package/public/assets/pencil-DUZRZB3S.js.gz +0 -0
- package/public/assets/{play-4CsGZdQU.js → play-Z1L2Eb91.js} +2 -2
- package/public/assets/play-Z1L2Eb91.js.br +0 -0
- package/public/assets/play-Z1L2Eb91.js.gz +0 -0
- package/public/assets/{runs-CInQb6v1.js → runs-CFQ6M4rx.js} +1 -1
- package/public/assets/runs-CFQ6M4rx.js.br +0 -0
- package/public/assets/runs-CFQ6M4rx.js.gz +0 -0
- package/public/assets/{search-input-G_QpBvPM.js → search-input-B0s9mzRt.js} +2 -2
- package/public/assets/search-input-B0s9mzRt.js.br +0 -0
- package/public/assets/search-input-B0s9mzRt.js.gz +0 -0
- package/public/assets/{select-DDzv2YfY.js → select-CHbE6M4S.js} +3 -3
- package/public/assets/select-CHbE6M4S.js.br +0 -0
- package/public/assets/select-CHbE6M4S.js.gz +0 -0
- package/public/assets/{slider-DE7lQdK4.js → slider-tyb3JvL2.js} +1 -1
- package/public/assets/slider-tyb3JvL2.js.br +0 -0
- package/public/assets/slider-tyb3JvL2.js.gz +0 -0
- package/public/assets/{tabs-Co1N3x_X.js → tabs-Bf7ou-eS.js} +1 -1
- package/public/assets/tabs-Bf7ou-eS.js.br +0 -0
- package/public/assets/tabs-Bf7ou-eS.js.gz +0 -0
- package/public/assets/{tech-label-BMvuJmUf.js → tech-label-KAwM5qZ_.js} +1 -1
- package/public/assets/tech-label-KAwM5qZ_.js.br +0 -0
- package/public/assets/tech-label-KAwM5qZ_.js.gz +0 -0
- package/public/assets/{trash-Cwj2dbgB.js → trash-HEJmY7DQ.js} +3 -3
- package/public/assets/trash-HEJmY7DQ.js.br +0 -0
- package/public/assets/trash-HEJmY7DQ.js.gz +0 -0
- package/public/assets/{video-swsaHrfi.js → video-DdHH0Q0l.js} +2 -2
- package/public/assets/video-DdHH0Q0l.js.br +0 -0
- package/public/assets/video-DdHH0Q0l.js.gz +0 -0
- package/public/index.html +1 -1
- package/public/index.html.br +0 -0
- package/public/index.html.gz +0 -0
- package/public/assets/AISessionWatch-C2h4NZ_I.js.br +0 -0
- package/public/assets/AISessionWatch-C2h4NZ_I.js.gz +0 -0
- package/public/assets/AppCenter-S1y-8_7l.js.br +0 -0
- package/public/assets/AppCenter-S1y-8_7l.js.gz +0 -0
- package/public/assets/Default-C-l1O-g9.js.br +0 -0
- package/public/assets/Default-C-l1O-g9.js.gz +0 -0
- package/public/assets/Invite-BCndVxaO.js.br +0 -0
- package/public/assets/Invite-BCndVxaO.js.gz +0 -0
- package/public/assets/MacResources-41cFDgE1.js.br +0 -0
- package/public/assets/MacResources-41cFDgE1.js.gz +0 -0
- package/public/assets/QASession-B67RsIPm.js +0 -81
- package/public/assets/QASession-B67RsIPm.js.br +0 -0
- package/public/assets/QASession-B67RsIPm.js.gz +0 -0
- package/public/assets/ResetPassword-8rj7ASt1.js.br +0 -0
- package/public/assets/ResetPassword-8rj7ASt1.js.gz +0 -0
- package/public/assets/RunDetail-BIgq9gJ0.js +0 -16
- package/public/assets/RunDetail-BIgq9gJ0.js.br +0 -0
- package/public/assets/RunDetail-BIgq9gJ0.js.gz +0 -0
- package/public/assets/Runs-DpK5aoBr.js +0 -6
- package/public/assets/Runs-DpK5aoBr.js.br +0 -0
- package/public/assets/Runs-DpK5aoBr.js.gz +0 -0
- package/public/assets/Setup-DZrhA_7b.js.br +0 -0
- package/public/assets/Setup-DZrhA_7b.js.gz +0 -0
- package/public/assets/Team-CJThCjd3.js.br +0 -0
- package/public/assets/Team-CJThCjd3.js.gz +0 -0
- package/public/assets/Tokens-DGURtHWi.js.br +0 -0
- package/public/assets/Tokens-DGURtHWi.js.gz +0 -0
- package/public/assets/aiSession-BW09Jhqz.js.br +0 -0
- package/public/assets/aiSession-BW09Jhqz.js.gz +0 -0
- package/public/assets/alert-dialog-t5vlOabq.js.gz +0 -0
- package/public/assets/badge-DrDCTAQQ.js.br +0 -0
- package/public/assets/badge-DrDCTAQQ.js.gz +0 -0
- package/public/assets/dialog-BOFZkCES.js.br +0 -0
- package/public/assets/dialog-BOFZkCES.js.gz +0 -0
- package/public/assets/field-hint-B9fPUgi7.js.br +0 -0
- package/public/assets/field-hint-B9fPUgi7.js.gz +0 -0
- package/public/assets/index-Bixhy5MB.js.br +0 -0
- package/public/assets/index-Bixhy5MB.js.gz +0 -0
- package/public/assets/list-view-BpOY1e-d.js.br +0 -0
- package/public/assets/list-view-BpOY1e-d.js.gz +0 -0
- package/public/assets/pencil-ZlrAsWuU.js.br +0 -0
- package/public/assets/pencil-ZlrAsWuU.js.gz +0 -0
- package/public/assets/play-4CsGZdQU.js.br +0 -0
- package/public/assets/play-4CsGZdQU.js.gz +0 -0
- package/public/assets/runs-CInQb6v1.js.br +0 -0
- package/public/assets/runs-CInQb6v1.js.gz +0 -0
- package/public/assets/search-input-G_QpBvPM.js.br +0 -0
- package/public/assets/search-input-G_QpBvPM.js.gz +0 -0
- package/public/assets/select-DDzv2YfY.js.br +0 -0
- package/public/assets/select-DDzv2YfY.js.gz +0 -0
- package/public/assets/slider-DE7lQdK4.js.br +0 -0
- package/public/assets/slider-DE7lQdK4.js.gz +0 -0
- package/public/assets/tabs-Co1N3x_X.js.br +0 -0
- package/public/assets/tabs-Co1N3x_X.js.gz +0 -0
- package/public/assets/tech-label-BMvuJmUf.js.br +0 -0
- package/public/assets/tech-label-BMvuJmUf.js.gz +0 -0
- package/public/assets/trash-Cwj2dbgB.js.br +0 -0
- package/public/assets/trash-Cwj2dbgB.js.gz +0 -0
- package/public/assets/video-swsaHrfi.js.br +0 -0
- package/public/assets/video-swsaHrfi.js.gz +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import{c as de,r as a,j as r}from"./vendor-react-DTSdA8m-.js";import{G as ht,a1 as zs,a2 as Fe,K as Pt,M as At,N as Lt,B as Xe,a3 as Hn,T as ar,S as Br,H as xt,a4 as Us,a5 as Rn,a6 as kn,a7 as Ks,a8 as Fr,a9 as On,aa as Ws,ab as Vs,ac as sr,ad as jn,b as qr,c as zr,ae as Ys,q as rr,af as Xs,ag as Gs,ah as Qs,O as Zs,ai as Js,aj as eo,ak as to,L as no}from"./index-C_3Q51YJ.js";import{u as Ur,n as je}from"./useRelay-CES3I1Mt.js";import{p as ro,u as Kr,a as so,i as oo,b as lo,c as ao,t as Wr,I as io,d as co,e as uo,f as wr,r as fo,g as ho,A as po,o as mo,M as Sr,h as go,j as bo,k as xo,C as yo,H as jr,l as vo,s as Rr}from"./AndroidDeviceScreen-C55msKfh.js";import{c as Vr,a as wo}from"./vendor-router-B1pQim9Z.js";import{g as So,d as jo,A as Ro,a as ko,b as Co,e as _o,c as No,f as To}from"./alert-dialog-C0mRms8g.js";import{L as Yr,H as Xr,K as Eo,A as Io,D as Po,h as Ao}from"./aiSession-U7UqgdSb.js";import{V as Lo}from"./video-DdHH0Q0l.js";import{b as Gr,a as Do,e as Mo,c as Qr,f as $o,d as Zr}from"./dialog-Cugbp1C4.js";import{a as Oo,S as Ho}from"./search-input-B0s9mzRt.js";import{P as Jr}from"./play-Z1L2Eb91.js";import{T as kr,a as Bo,b as Cr,c as Fo}from"./tabs-Bf7ou-eS.js";import{c as qo}from"./index-D17hSi50.js";import{l as _r,j as zo}from"./publicLink-D6zKS_wu.js";import{u as Uo}from"./useShownAfter-By1Yxysz.js";import{d as Ko,S as Wo,a as Vo,b as Yo,c as es}from"./select-CHbE6M4S.js";import{B as Xo}from"./badge-BjEnOmb0.js";import{P as Go,a as Nr,S as Qo}from"./build-format-ofd2iIzf.js";import{R as Zo,g as Jo}from"./resource-health-oWJ8hy9X.js";/**
|
|
2
|
+
* @license lucide-react v1.59.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 ts={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};ts.node;const el=ht(ts);/**
|
|
7
|
+
* @license lucide-react v1.59.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 ns={name:"camera",size:24,node:[["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"}]]};ns.node;const tl=ht(ns);/**
|
|
12
|
+
* @license lucide-react v1.59.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 rs={name:"film",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]};rs.node;const nl=ht(rs);/**
|
|
17
|
+
* @license lucide-react v1.59.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 ss={name:"fold-horizontal",size:24,node:[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]]};ss.node;const rl=ht(ss);/**
|
|
22
|
+
* @license lucide-react v1.59.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 os={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};os.node;const sl=ht(os);/**
|
|
27
|
+
* @license lucide-react v1.59.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 ls={name:"message-square",size:24,node:[["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"}]]};ls.node;const ol=ht(ls);/**
|
|
32
|
+
* @license lucide-react v1.59.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 as={name:"power",size:24,node:[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]};as.node;const ll=ht(as);/**
|
|
37
|
+
* @license lucide-react v1.59.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 is={name:"radio-off",size:24,node:[["path",{d:"M13.414 13.414a2 2 0 1 1-2.828-2.828",key:"srl686"}],["path",{d:"M16.247 7.761a6 6 0 0 1 1.744 4.572",key:"1h86sp"}],["path",{d:"M19.075 4.933a10 10 0 0 1 2.234 10.72",key:"1n13k4"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}]]};is.node;const al=ht(is);/**
|
|
42
|
+
* @license lucide-react v1.59.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 cs={name:"radio",size:24,node:[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};cs.node;const or=ht(cs);/**
|
|
47
|
+
* @license lucide-react v1.59.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 ds={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};ds.node;const il=ht(ds);/**
|
|
52
|
+
* @license lucide-react v1.59.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 us={name:"rotate-cw",size:24,node:[["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"}]]};us.node;const cl=ht(us);/**
|
|
57
|
+
* @license lucide-react v1.59.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 fs={name:"scan-line",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]};fs.node;const dl=ht(fs);/**
|
|
62
|
+
* @license lucide-react v1.59.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 hs={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};hs.node;const ul=ht(hs);/**
|
|
67
|
+
* @license lucide-react v1.59.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 ps={name:"unfold-horizontal",size:24,node:[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]]};ps.node;const fl=ht(ps);/**
|
|
72
|
+
* @license lucide-react v1.59.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 ms={name:"volume-1",size:24,node:[["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"}]]};ms.node;const hl=ht(ms);/**
|
|
77
|
+
* @license lucide-react v1.59.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 gs={name:"volume-2",size:24,node:[["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"}]]};gs.node;const pl=ht(gs);function ml(n){const e=de.c(5),[t,l]=a.useState(null);let s,o;e[0]!==n?(s=()=>{n&&zs(n).then(l)},o=[n],e[0]=n,e[1]=s,e[2]=o):(s=e[1],o=e[2]),a.useEffect(s,o);let i;return e[3]!==t?(i={build:t},e[3]=t,e[4]=i):i=e[4],i}function gl(n){const e=de.c(43);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0];const[l,s]=a.useState(t),[o,i]=a.useState(null),[c,u]=a.useState(null),[d,f]=a.useState(""),[h,p]=a.useState(void 0),[m,b]=a.useState(!1),[S,k]=a.useState("");let g;e[1]!==c||e[2]!==d?(g={sessionId:c,deviceId:d},e[1]=c,e[2]=d,e[3]=g):g=e[3];const R=a.useRef(g);let N,I;e[4]!==c||e[5]!==d?(N=()=>{R.current={sessionId:c,deviceId:d}},I=[c,d],e[4]=c,e[5]=d,e[6]=N,e[7]=I):(N=e[6],I=e[7]),a.useEffect(N,I);let L;e[8]===Symbol.for("react.memo_cache_sentinel")?(L=K=>{var X;if(K.type==="agents:listed"){s(K.sessions);const{deviceId:he}=R.current,J=he?(X=K.sessions.flatMap(bl).find(O=>O.id===he))==null?void 0:X.formFactor:void 0;J&&p(J)}K.type==="session:joined"&&(b(!1),k("Connected")),K.type==="error"&&(b(!1),k(`Error: ${K.message}`))},e[8]=L):L=e[8];const _=L,{send:y,connected:x}=Ur(_);let D,w;e[9]!==x||e[10]!==y?(D=()=>{if(!x)return;y({type:"agents:list"});const K=setInterval(()=>y({type:"agents:list"}),5e3);return()=>clearInterval(K)},w=[x,y],e[9]=x,e[10]=y,e[11]=D,e[12]=w):(D=e[11],w=e[12]),a.useEffect(D,w);let E,F;e[13]!==y?(E=()=>()=>{const{sessionId:K,deviceId:X}=R.current;K&&X&&y({type:"device:shutdown",sessionId:K,payload:{deviceId:X}})},F=[y],e[13]=y,e[14]=E,e[15]=F):(E=e[14],F=e[15]),a.useLayoutEffect(E,F);let z;if(e[16]!==n||e[17]!==l){let K;e[19]!==n?(K=X=>X.devices.some(he=>he.platform===n),e[19]=n,e[20]=K):K=e[20],z=l.filter(K),e[16]=n,e[17]=l,e[18]=z}else z=e[18];const $=z;let Z;e[21]===Symbol.for("react.memo_cache_sentinel")?(Z=K=>{p(K.formFactor),f(K.id),b(!0),k("Booting…"),u(K.sessionId)},e[21]=Z):Z=e[21];const V=Z;let B;e[22]===Symbol.for("react.memo_cache_sentinel")?(B=()=>f(""),e[22]=B):B=e[22];const ne=B;let ee;e[23]!==y?(ee=()=>{const{sessionId:K,deviceId:X}=R.current;K&&X&&y({type:"device:shutdown",sessionId:K,payload:{deviceId:X}}),u(null),b(!1),k("")},e[23]=y,e[24]=ee):ee=e[24];const Y=ee;let M;e[25]!==y?(M=()=>{const{sessionId:K,deviceId:X}=R.current;K&&X&&y({type:"device:shutdown",sessionId:K,payload:{deviceId:X}}),u(null),i(null),b(!1),k(""),y({type:"agents:list"})},e[25]=y,e[26]=M):M=e[26];const re=M;let ie;e[27]!==y?(ie=()=>{u(null),i(null),b(!1),k(""),y({type:"agents:list"})},e[27]=y,e[28]=ie):ie=e[28];const be=ie;let ue;return e[29]!==h||e[30]!==c||e[31]!==$||e[32]!==m||e[33]!==x||e[34]!==d||e[35]!==Y||e[36]!==re||e[37]!==be||e[38]!==o||e[39]!==y||e[40]!==l||e[41]!==S?(ue={sessions:l,activeFormFactor:h,selectedAgent:o,setSelectedAgent:i,activeSessionId:c,deviceId:d,booting:m,status:S,send:y,connected:x,agentGroups:$,startDevice:V,resetDevice:ne,handleBack:Y,handleBackToMacs:re,handleSessionEnded:be},e[29]=h,e[30]=c,e[31]=$,e[32]=m,e[33]=x,e[34]=d,e[35]=Y,e[36]=re,e[37]=be,e[38]=o,e[39]=y,e[40]=l,e[41]=S,e[42]=ue):ue=e[42],ue}function bl(n){return n.devices}function xl(n,e){const t=de.c(24),[l,s]=a.useState(""),[o,i]=a.useState(""),[c,u]=a.useState("app-only"),[d,f]=a.useState("app-only");let h;t[0]!==(n==null?void 0:n.capabilities)?(h=(n==null?void 0:n.capabilities.includes("full-reset"))??!1,t[0]=n==null?void 0:n.capabilities,t[1]=h):h=t[1];const p=h;let m;t[2]!==p||t[3]!==c?(m=()=>{f(p?c:"app-only"),u("app-only")},t[2]=p,t[3]=c,t[4]=m):m=t[4];const b=m;let S,k,g;if(t[5]!==o||t[6]!==e||t[7]!==l||t[8]!==(n==null?void 0:n.devices)){S=(n==null?void 0:n.devices.filter(L=>L.platform===e))??[],k=[...new Set(S.map(wl).filter(Boolean))].sort(yl);let I;t[12]!==o?(I=L=>!o||L.name.toLowerCase().includes(o.toLowerCase()),t[12]=o,t[13]=I):I=t[13],g=(l?S.filter(L=>L.osVersion===l):S).filter(I),t[5]=o,t[6]=e,t[7]=l,t[8]=n==null?void 0:n.devices,t[9]=S,t[10]=k,t[11]=g}else S=t[9],k=t[10],g=t[11];const R=g;let N;return t[14]!==d||t[15]!==b||t[16]!==o||t[17]!==S||t[18]!==p||t[19]!==l||t[20]!==k||t[21]!==c||t[22]!==R?(N={filteredDevices:S,osVersions:k,osVersion:l,setOsVersion:s,deviceSearch:o,setDeviceSearch:i,versionedDevices:R,resetMode:c,setResetMode:u,appliedResetMode:d,consumeResetMode:b,fullResetSupported:p},t[14]=d,t[15]=b,t[16]=o,t[17]=S,t[18]=p,t[19]=l,t[20]=k,t[21]=c,t[22]=R,t[23]=N):N=t[23],N}function yl(n,e){const t=vl,[l,s]=[t(n),t(e)];for(let o=0;o<Math.max(l.length,s.length);o++){const i=(s[o]??0)-(l[o]??0);if(i!==0)return i}return 0}function vl(n){return n.replace(/^[^\d]*/,"").split(".").map(Number)}function wl(n){return n.osVersion}function Sl(){const n=de.c(8),[e]=Vr();let t;n[0]!==e?(t=e.get("perf"),n[0]=e,n[1]=t):t=n[1];const l=t==="1",[s,o]=a.useState(!1),[i,c]=a.useState(l);i!==l&&(c(l),l||o(!1));let u,d;n[2]!==l?(u=()=>{if(!l)return;const p=m=>{m.ctrlKey&&m.shiftKey&&m.key==="P"&&o(jl)};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},d=[l],n[2]=l,n[3]=u,n[4]=d):(u=n[3],d=n[4]),a.useEffect(u,d);const f=l&&!s;let h;return n[5]!==l||n[6]!==f?(h={perfMode:l,visible:f},n[5]=l,n[6]=f,n[7]=h):h=n[7],h}function jl(n){return!n}const Rl=["video/mp4;codecs=avc1","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function bs({sessionId:n,buildId:e,onRecordingUploaded:t}){const[l,s]=a.useState("idle"),o=a.useRef(null),i=a.useRef(t);a.useEffect(()=>{i.current=t},[t]);const c=a.useRef(!1),u=a.useRef(null),d=a.useRef([]),f=a.useRef(""),h=a.useRef(0),p=a.useRef(null),m=a.useCallback(function g(){var R;c.current&&((R=p.current)==null||R.call(p),h.current=requestAnimationFrame(g))},[]),b=a.useCallback(g=>{p.current=g},[]),S=a.useCallback(()=>{const g=o.current;if(!g)return;const R=g.getContext("2d");R&&(R.fillStyle="#000",R.fillRect(0,0,g.width,g.height));const N=Rl.find(L=>MediaRecorder.isTypeSupported(L))??"";if(!N)return;f.current=N,d.current=[];const I=new MediaRecorder(g.captureStream(30),{mimeType:N});I.ondataavailable=L=>{L.data.size>0&&d.current.push(L.data)},u.current=I,I.start(1e3),c.current=!0,h.current=requestAnimationFrame(m),s("recording")},[m]),k=a.useCallback(async()=>{var _;s("uploading"),c.current=!1,cancelAnimationFrame(h.current);const g=u.current;if(!g){s("idle");return}await new Promise(y=>{const x=setTimeout(y,5e3);g.onstop=()=>{clearTimeout(x),y()};try{g.stop()}catch{clearTimeout(x),y()}}),u.current=null;const R=f.current,N=R.includes("mp4")?".mp4":".webm",I=new Blob(d.current,{type:R});d.current=[];const L=new FormData;L.append("file",I,`tapflow-${Date.now()}${N}`);try{const y=new URLSearchParams({sessionId:n});e&&y.set("buildId",String(e));const x=await fetch(`/api/v1/recordings/upload?${y}`,{method:"POST",credentials:"include",body:L}),D=await x.json();if(x.ok&&D.url){const w=document.createElement("a");w.href=D.url,w.download="",w.click(),(_=i.current)==null||_.call(i),s("done"),setTimeout(()=>s("idle"),2e3)}else s("idle")}catch{s("idle")}},[n,e]);return a.useEffect(()=>{if(l!=="recording")return;const g=()=>{document.visibilityState==="hidden"&&k()};return document.addEventListener("visibilitychange",g),()=>{var R;document.removeEventListener("visibilitychange",g),c.current&&(c.current=!1,cancelAnimationFrame(h.current),(R=u.current)==null||R.stop(),u.current=null)}},[l,k]),{recordState:l,recordCanvasRef:o,setComposeFrame:b,startClientRecording:S,stopClientRecording:k}}function $n(n){const e=de.c(8);let t,l;e[0]!==n?({className:t,...l}=n,e[0]=n,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=Fe("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==l||e[6]!==s?(o=r.jsx("kbd",{"data-slot":"kbd",className:s,...l}),e[5]=l,e[6]=s,e[7]=o):o=e[7],o}function ir(n){const e=de.c(8);let t,l;e[0]!==n?({className:t,...l}=n,e[0]=n,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=Fe("inline-flex items-center gap-1",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==l||e[6]!==s?(o=r.jsx("kbd",{"data-slot":"kbd-group",className:s,...l}),e[5]=l,e[6]=s,e[7]=o):o=e[7],o}function Wn(n){const e=de.c(7),{label:t,keys:l}=n;let s;e[0]!==l?(s=l.map(kl),e[0]=l,e[1]=s):s=e[1];let o;e[2]!==s?(o=r.jsx(ir,{children:s}),e[2]=s,e[3]=o):o=e[3];let i;return e[4]!==t||e[5]!==o?(i=r.jsxs("span",{className:"flex items-center gap-3",children:[t,o]}),e[4]=t,e[5]=o,e[6]=i):i=e[6],i}function kl(n){return r.jsx($n,{children:n},n)}const Tr="text-muted-foreground hover:text-muted-foreground",Er="text-destructive hover:text-destructive";function Cl(n){switch(n){case"awaiting-app":return" Launch an app through tapflow so it is told too.";case"not-armed":return" Restart the device so tapflow can set it up.";case"state-unconfirmed":return" tapflow could not confirm the change — try again.";case"unsupported-device":return" The device did not change when tapflow asked — try again, or use another device.";case"filter-unavailable":return" This Mac is not set up to take devices off the network — see the network control guide.";case"enforcement-lost":return" It went back on the network on its own.";case"hooks-not-installed":return" tapflow cannot tell this app it is off the network.";default:return" tapflow cannot change it right now."}}function _l({position:n,steerable:e,reason:t}){const l=t==="awaiting-app",s=!e&&t==="state-unconfirmed"?" animate-pulse":"",o=e?"":Cl(t);switch(n){case"offline":return{Icon:al,className:(e||l?"text-amber-500 hover:text-amber-500":Er)+s,status:`Device is offline.${o}`};case"online":return{Icon:or,className:(e||l?"":Er)+s,status:`Device is on the network.${o}`};case"waiting":return{Icon:or,className:`${Tr} animate-pulse`,status:"Checking the network state."};case"unknown":return{Icon:or,className:Tr,status:e?"No network state has been reported.":"tapflow could not read the network state — try again."}}}function Nl({position:n,steerable:e,reason:t}){const l=n==="offline"?"Bring device online":n==="online"?"Take device offline":"Toggle device network",s=n==="online"||n==="offline",o=n==="unknown"&&!e&&t==="state-unconfirmed",i=t==="state-unconfirmed"||t==="unsupported-device";return e||!(s||o)||t==="awaiting-app"?l:i?`Retry: ${l.toLowerCase()}`:`${l} — unavailable`}function xs(n){var qe;const e=de.c(82),{joined:t,onScreenshot:l,onRecordToggle:s,recordState:o,onRotate:i,posture:c,onDeepLink:u,navigationSlot:d,deviceSlot:f,launchSlot:h,network:p,reboot:m}=n,b=a.useId(),S=a.useId(),k=a.useId(),g=a.useId(),[R,N]=a.useState(!1);if(!t)return null;let I;e[0]===Symbol.for("react.memo_cache_sentinel")?(I=r.jsx(Yr,{className:"h-4 w-4"}),e[0]=I):I=e[0];let L;e[1]!==u?(L=r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Open a deeplink",onClick:u,children:I})}),e[1]=u,e[2]=L):L=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_=r.jsx(Lt,{side:"left",children:r.jsx(Wn,{label:"Deeplink",keys:["⌘","K"]})}),e[3]=_):_=e[3];let y;e[4]!==L?(y=r.jsxs(Pt,{children:[L,_]}),e[4]=L,e[5]=y):y=e[5];let x;e[6]!==h||e[7]!==d||e[8]!==y?(x=r.jsxs("div",{role:"group","aria-label":"Navigation",className:"flex flex-col items-center gap-0.5",children:[h,d,y]}),e[6]=h,e[7]=d,e[8]=y,e[9]=x):x=e[9];let D;e[10]===Symbol.for("react.memo_cache_sentinel")?(D=r.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"w-4 h-px bg-border my-1"}),e[10]=D):D=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsx(cl,{className:"h-4 w-4"}),e[11]=w):w=e[11];let E;e[12]!==i?(E=r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Rotate the device",onClick:i,children:w})}),e[12]=i,e[13]=E):E=e[13];let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsx(Lt,{side:"left",children:r.jsx(Wn,{label:"Rotate",keys:["⌘","⇧","O"]})}),e[14]=F):F=e[14];let z;e[15]!==E?(z=r.jsxs(Pt,{children:[E,F]}),e[15]=E,e[16]=z):z=e[16];let $;e[17]!==c||e[18]!==k?($=c&&c.postures.length===2&&r.jsx("span",{id:k,role:"status","aria-live":"polite",className:"sr-only",children:c.pending?"Changing posture":((qe=c.postures.find(oe=>oe.id===c.currentId))==null?void 0:qe.label)??"Current posture unknown"}),e[17]=c,e[18]=k,e[19]=$):$=e[19];let Z;e[20]!==c||e[21]!==k?(Z=c&&c.postures.length===2&&(()=>{const oe=c.postures.findIndex($e=>$e.id===c.currentId),Ce=oe===-1?null:c.postures[oe],Pe=c.postures[(oe+1)%2],we=oe===0,Ge=we?fl:rl,We=we?"Unfold":"Fold",Qe=Ce?`${We}: ${Ce.label} to ${Pe.label}`:`${We}: ${Pe.label}`,Ue=$e=>r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8 aria-disabled:opacity-50","aria-label":c.pending?`${Qe} — changing`:Qe,"aria-busy":c.pending,"aria-disabled":c.pending,"aria-describedby":k,onClick:()=>{c.pending||$e==null||$e()},children:c.pending?r.jsx(Hn,{className:"h-4 w-4 animate-spin"}):r.jsx(Ge,{className:"h-4 w-4"})});return r.jsxs(Pt,{children:[r.jsx(At,{asChild:!0,children:Ue(()=>c.onSelect(Pe.id))}),r.jsx(Lt,{side:"left",children:c.pending?`${Qe} — changing`:Qe})]})})(),e[20]=c,e[21]=k,e[22]=Z):Z=e[22];let V;e[23]!==m||e[24]!==S?(V=m&&(()=>{const oe=m.pending?"Restarting the device":"Restart the device";return r.jsxs(r.Fragment,{children:[r.jsxs(Pt,{children:[r.jsx(At,{asChild:!0,children:r.jsx(Xe,{ref:m.buttonRef,variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":oe,"aria-busy":m.pending,"aria-disabled":m.pending,"aria-describedby":S,onClick:()=>{m.pending||N(!0)},children:m.pending?r.jsx(Hn,{className:"h-4 w-4 animate-spin"}):r.jsx(il,{className:"h-4 w-4"})})}),r.jsx(Lt,{side:"left",children:oe})]}),r.jsx("span",{id:S,role:"status",className:"sr-only",children:m.pending?"Restarting the device.":""})]})})(),e[23]=m,e[24]=S,e[25]=V):V=e[25];let B;e[26]!==f||e[27]!==z||e[28]!==$||e[29]!==Z||e[30]!==V?(B=r.jsxs("div",{role:"group","aria-label":"Device",className:"flex flex-col items-center gap-0.5",children:[f,z,$,Z,V]}),e[26]=f,e[27]=z,e[28]=$,e[29]=Z,e[30]=V,e[31]=B):B=e[31];let ne;e[32]===Symbol.for("react.memo_cache_sentinel")?(ne=r.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"w-4 h-px bg-border my-1"}),e[32]=ne):ne=e[32];let ee;e[33]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(tl,{className:"h-4 w-4"}),e[33]=ee):ee=e[33];let Y;e[34]!==l?(Y=r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Take a screenshot",onClick:l,children:ee})}),e[34]=l,e[35]=Y):Y=e[35];let M;e[36]===Symbol.for("react.memo_cache_sentinel")?(M=r.jsx(Lt,{side:"left",children:r.jsx(Wn,{label:"Screenshot",keys:["⌘","S"]})}),e[36]=M):M=e[36];let re;e[37]!==Y?(re=r.jsxs(Pt,{children:[Y,M]}),e[37]=Y,e[38]=re):re=e[38];const ie=o==="recording"&&"text-red-500 hover:text-red-500";let be;e[39]!==ie?(be=Fe("h-8 w-8 aria-disabled:opacity-50",ie),e[39]=ie,e[40]=be):be=e[40];const ue=o==="recording"?"Stop recording":o==="uploading"?"Processing the recording":o==="done"?"Recording saved":"Start recording",K=o==="uploading",X=o==="uploading"||o==="done";let he;e[41]!==s||e[42]!==o?(he=()=>{(o==="idle"||o==="recording")&&s()},e[41]=s,e[42]=o,e[43]=he):he=e[43];let J;e[44]!==o?(J=o==="uploading"?r.jsx(Hn,{className:"h-4 w-4 animate-spin"}):o==="recording"?r.jsx(ul,{className:"h-4 w-4 fill-current"}):r.jsx(Lo,{className:"h-4 w-4"}),e[44]=o,e[45]=J):J=e[45];let O;e[46]!==g||e[47]!==be||e[48]!==ue||e[49]!==K||e[50]!==X||e[51]!==he||e[52]!==J?(O=r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:be,"aria-label":ue,"aria-busy":K,"aria-disabled":X,"aria-describedby":g,onClick:he,children:J})}),e[46]=g,e[47]=be,e[48]=ue,e[49]=K,e[50]=X,e[51]=he,e[52]=J,e[53]=O):O=e[53];let fe;e[54]!==o?(fe=o==="idle"?r.jsx(Wn,{label:"Start recording",keys:["⌘","⇧","Y"]}):o==="recording"?r.jsx(Wn,{label:"Stop recording",keys:["⌘","⇧","Y"]}):o==="done"?"Recording saved":"Processing the recording",e[54]=o,e[55]=fe):fe=e[55];let ye;e[56]!==fe?(ye=r.jsx(Lt,{side:"left",children:fe}),e[56]=fe,e[57]=ye):ye=e[57];let ge;e[58]!==O||e[59]!==ye?(ge=r.jsxs(Pt,{children:[O,ye]}),e[58]=O,e[59]=ye,e[60]=ge):ge=e[60];const Re=o==="recording"?"Recording.":o==="uploading"?"Processing the recording.":o==="done"?"Recording saved.":"";let H;e[61]!==g||e[62]!==Re?(H=r.jsx("span",{id:g,role:"status",className:"sr-only",children:Re}),e[61]=g,e[62]=Re,e[63]=H):H=e[63];let G;e[64]!==re||e[65]!==ge||e[66]!==H?(G=r.jsxs("div",{role:"group","aria-label":"Capture",className:"flex flex-col items-center gap-0.5",children:[re,ge,H]}),e[64]=re,e[65]=ge,e[66]=H,e[67]=G):G=e[67];let ce;e[68]!==b||e[69]!==p?(ce=p&&r.jsxs(r.Fragment,{children:[r.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"w-4 h-px bg-border my-1"}),r.jsx("div",{role:"group","aria-label":"Environment",className:"flex flex-col items-center gap-0.5",children:p&&(()=>{const{Icon:oe,className:Ce,status:Pe}=_l(p),we=Nl(p),Ge=p.position==="waiting"||p.position==="unknown"||!p.steerable;return r.jsxs(Pt,{children:[r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:Fe("h-8 w-8",Ce),"aria-label":we,"aria-busy":p.pending,"aria-disabled":p.pending,"aria-describedby":b,onClick:()=>{p.pending||p.onToggle()},children:p.pending?r.jsx(Hn,{className:"h-4 w-4 animate-spin"}):r.jsx(oe,{className:"h-4 w-4"})})}),r.jsx("span",{id:b,role:"status",className:"sr-only",children:p.pending?"Changing the network state.":Pe}),r.jsx(Lt,{side:"left",children:Ge?`${we} — ${Pe}`:we})]})})()})]}),e[68]=b,e[69]=p,e[70]=ce):ce=e[70];let pe;e[71]!==B||e[72]!==G||e[73]!==ce||e[74]!==x?(pe=r.jsxs("div",{className:"flex flex-col items-center gap-0.5 rounded-2xl border bg-background/90 backdrop-blur-sm px-1.5 py-2.5 shrink-0 mt-3",children:[x,D,B,ne,G,ce]}),e[71]=B,e[72]=G,e[73]=ce,e[74]=x,e[75]=pe):pe=e[75];let ve;e[76]!==R||e[77]!==m?(ve=m&&r.jsx(So,{open:R,onOpenChange:N,children:r.jsxs(jo,{children:[r.jsxs(Ro,{children:[r.jsx(ko,{children:"Restart this device?"}),r.jsx(Co,{children:"Anything open on the device closes, and whatever you had set up on screen is gone. The app under test is reinstalled, which clears its data; other apps keep theirs. The device takes a moment to come back."})]}),r.jsxs(_o,{children:[r.jsx(No,{children:"Cancel"}),r.jsx(To,{onClick:()=>{N(!1),m.onReboot()},children:"Restart"})]})]})}),e[76]=R,e[77]=m,e[78]=ve):ve=e[78];let Ie;return e[79]!==pe||e[80]!==ve?(Ie=r.jsxs(ar,{delayDuration:400,children:[pe,ve]}),e[79]=pe,e[80]=ve,e[81]=Ie):Ie=e[81],Ie}const Tl=3e3,El=8e3;function ys(n){const e=de.c(40),{sessionId:t,send:l,supported:s,deviceReady:o,handlerRef:i,onError:c}=n,[u,d]=a.useState("waiting"),[f,h]=a.useState(!0),[p,m]=a.useState(void 0),b=a.useRef(void 0),[S,k]=a.useState(!1),g=a.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R=new Set,e[0]=R):R=e[0];const N=a.useRef(R),I=a.useRef(c);let L,_;e[1]!==c?(L=()=>{I.current=c},_=[c],e[1]=c,e[2]=L,e[3]=_):(L=e[2],_=e[3]),a.useEffect(L,_);const y=a.useRef(o);let x,D;e[4]!==o?(x=()=>{y.current=o},D=[o],e[4]=o,e[5]=x,e[6]=D):(x=e[5],D=e[6]),a.useEffect(x,D);const w=a.useRef(o),[E,F]=a.useState(t);E!==t&&(F(t),d("waiting"),h(!0),m(void 0),k(!1));let z;e[7]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{b.current=void 0,g.current=null,w.current=y.current,N.current.clear()},e[7]=z):z=e[7];let $;e[8]!==t?($=[t],e[8]=t,e[9]=$):$=e[9],a.useEffect(z,$);let Z,V;e[10]!==o?(Z=()=>{var O;if(o){w.current=!0,d("waiting");return}d(w.current?"unknown":"waiting"),h(!0),m(void 0),b.current=void 0,g.current&&((O=I.current)==null||O.call(I,"The device became unavailable before it answered. Its network state is unchanged as far as tapflow can tell."),N.current.add(g.current)),k(!1),g.current=null},V=[o],e[10]=o,e[11]=Z,e[12]=V):(Z=e[11],V=e[12]),a.useEffect(Z,V);let B,ne;e[13]!==i||e[14]!==s?(B=()=>{if(s)return i.current=O=>{var ye,ge;if(O.type==="network:error"){O.requestId===g.current&&(g.current=null,k(!1),(ye=I.current)==null||ye.call(I,O.message));return}if(O.type!=="network:state"||!y.current||O.requestId!==void 0&&N.current.has(O.requestId))return;const fe=O.payload.available?void 0:O.payload.reason;d(O.payload.offline===void 0?"unknown":O.payload.offline?"offline":"online"),h(O.payload.available),m(fe),fe==="enforcement-lost"&&b.current!=="enforcement-lost"&&((ge=I.current)==null||ge.call(I,"The device went back on the network before you took it off. Anything checked while it was offline needs checking again.")),b.current=fe,O.requestId!==void 0&&O.requestId===g.current&&(g.current=null,k(!1))},()=>{i.current=void 0}},ne=[i,s],e[13]=i,e[14]=s,e[15]=B,e[16]=ne):(B=e[15],ne=e[16]),a.useEffect(B,ne);let ee,Y;e[17]!==o||e[18]!==u||e[19]!==s?(ee=()=>{if(!s||!o||u!=="waiting")return;const O=setTimeout(()=>d(Il),Tl);return()=>clearTimeout(O)},Y=[s,o,u],e[17]=o,e[18]=u,e[19]=s,e[20]=ee,e[21]=Y):(ee=e[20],Y=e[21]),a.useEffect(ee,Y);let M;e[22]!==S||e[23]!==u||e[24]!==l||e[25]!==t||e[26]!==s?(M=()=>{if(!s||S)return;const O=je();g.current=O,k(!0),l({type:"network:set",sessionId:t,requestId:O,payload:{offline:u!=="offline"}})},e[22]=S,e[23]=u,e[24]=l,e[25]=t,e[26]=s,e[27]=M):M=e[27];const re=M,[ie,be]=a.useState(null);let ue,K;e[28]!==S?(ue=()=>{be(S?g.current:null)},K=[S],e[28]=S,e[29]=ue,e[30]=K):(ue=e[29],K=e[30]),a.useEffect(ue,K);let X,he;e[31]!==ie?(X=()=>{if(ie===null)return;const O=setTimeout(()=>{var fe;g.current===ie&&(g.current=null,k(!1),(fe=I.current)==null||fe.call(I,"The device did not answer. Its network state is unchanged as far as tapflow can tell."))},El);return()=>clearTimeout(O)},he=[ie],e[31]=ie,e[32]=X,e[33]=he):(X=e[32],he=e[33]),a.useEffect(X,he);let J;return e[34]!==S||e[35]!==u||e[36]!==p||e[37]!==f||e[38]!==re?(J={position:u,steerable:f,reason:p,pending:S,toggle:re},e[34]=S,e[35]=u,e[36]=p,e[37]=f,e[38]=re,e[39]=J):J=e[39],J}function Il(n){return n==="waiting"?"unknown":n}const Pl="https://www.tapflow.dev/operate/https#pick-a-method";function Al(n){const e=de.c(9),{open:t,onOpenChange:l}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(Gr,{children:"Streaming in Standard mode"}),e[0]=s):s=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsxs(Do,{children:[s,r.jsxs(Mo,{className:"space-y-3 pt-1",children:[r.jsx("span",{className:"block",children:"This screen is running in Standard mode. For a faster, smoother picture, switch to Smooth."}),r.jsx("span",{className:"block",children:"Smooth needs the relay served over HTTPS. If you didn't set up tapflow, ask whoever did."})]})]}),e[1]=o):o=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Xe,{variant:"outline",onClick:Ll,children:"How to enable"}),e[2]=i):i=e[2];let c;e[3]!==l?(c=r.jsxs(Qr,{className:"sm:max-w-[440px]",children:[o,r.jsxs($o,{children:[i,r.jsx(Xe,{onClick:()=>l(!1),children:"Got it"})]})]}),e[3]=l,e[4]=c):c=e[4];let u;return e[5]!==l||e[6]!==t||e[7]!==c?(u=r.jsx(Zr,{open:t,onOpenChange:l,children:c}),e[5]=l,e[6]=t,e[7]=c,e[8]=u):u=e[8],u}function Ll(){return window.open(Pl,"_blank","noopener,noreferrer")}const Ir="tapflow.perfModeNoticeDismissed";function Dl(n,e){return n==="standard"&&!e}const Ml={high:"Smooth",standard:"Standard",unsupported:null};function $l(n){const{connected:e,joined:t,bootError:l,bootWaiting:s,deviceReady:o,installing:i,installError:c,agentAway:u,decoderUnsupported:d}=n;return e?t?u?"The agent went away — waiting for it to come back…":l?`Boot failed: ${l.length>40?l.slice(0,40)+"…":l}`:!o&&s==="host-memory-critical"?"This Mac is low on memory. Yours starts when it frees up…":!o&&s?"Another device is starting on this Mac. Yours starts next…":o?i?"Installing app…":c?`Install failed: ${c}`:d?"Streaming is not supported in this environment.":null:"Starting device…":"Joining session…":"Connecting…"}function ur(n){const e=de.c(43),{joined:t,fps:l,keyboardActive:s}=n;let o;e[0]!==n?(o=$l(n),e[0]=n,e[1]=o):o=e[1];const i=o,c=l>15,u=c?"#10b981":"#94a3b8",d=c?"Active":"Idle";let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=ro(),e[2]=f):f=e[2];const h=f,p=Ml[h];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{let M=!1;try{M=localStorage.getItem(Ir)==="1"}catch{}return Dl(h,M)},e[3]=m):m=e[3];const[b,S]=a.useState(m);let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=M=>{if(S(M),!M)try{localStorage.setItem(Ir,"1")}catch{}},e[4]=k):k=e[4];const g=k,R=s?"text-emerald-500":"text-muted-foreground";let N;e[5]!==R?(N=Fe("flex items-center",R),e[5]=R,e[6]=N):N=e[6];let I,L,_,y;e[7]===Symbol.for("react.memo_cache_sentinel")?(I={gap:6},L=r.jsx(dl,{className:"h-3.5 w-3.5 shrink-0"}),_=r.jsx("span",{className:"text-[12px] font-medium",children:"Focus"}),y=r.jsx("span",{"aria-hidden":"true",className:"text-[11px] text-muted-foreground/60",children:"·"}),e[7]=I,e[8]=L,e[9]=_,e[10]=y):(I=e[7],L=e[8],_=e[9],y=e[10]);const x=s?"text-emerald-500":"text-muted-foreground/60";let D;e[11]!==x?(D=Fe("text-[11px]",x),e[11]=x,e[12]=D):D=e[12];const w=s?"On":"Off";let E;e[13]!==D||e[14]!==w?(E=r.jsx("span",{className:D,children:w}),e[13]=D,e[14]=w,e[15]=E):E=e[15];let F;e[16]!==E||e[17]!==N?(F=r.jsxs("div",{className:N,style:I,children:[L,_,y,E]}),e[16]=E,e[17]=N,e[18]=F):F=e[18];let z;e[19]!==u||e[20]!==l||e[21]!==c||e[22]!==t||e[23]!==d?(z=t&&r.jsxs("div",{className:"flex items-center gap-[12px]",children:[r.jsxs("div",{className:"flex items-center gap-[4px]",children:[r.jsx("span",{className:"h-2 w-2 rounded-full shrink-0 mr-1",style:{background:u}}),r.jsx("span",{className:"text-[12px] font-mono text-foreground/75",children:l}),r.jsx("span",{className:"text-[12px] text-muted-foreground",children:"fps"}),r.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"·"}),r.jsx("span",{className:Fe("text-[11px]",c?"text-emerald-500":"text-muted-foreground/60"),children:d})]}),p&&r.jsxs(r.Fragment,{children:[r.jsx(Br,{orientation:"vertical",className:"h-3"}),h==="standard"?r.jsx("button",{type:"button",onClick:()=>S(!0),className:"text-[11px] text-foreground/70 hover:text-foreground underline-offset-2 hover:underline",children:p}):r.jsx("span",{className:"text-[11px] text-muted-foreground",children:p})]})]}),e[19]=u,e[20]=l,e[21]=c,e[22]=t,e[23]=d,e[24]=z):z=e[24];const $=i?void 0:"sr-only";let Z;e[25]!==i?(Z=i&&r.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed break-words",children:i}),e[25]=i,e[26]=Z):Z=e[26];let V;e[27]!==$||e[28]!==Z?(V=r.jsx("div",{role:"status",className:$,children:Z}),e[27]=$,e[28]=Z,e[29]=V):V=e[29];let B;e[30]!==n.servicesOff?(B=n.servicesOff&&r.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed break-words",children:"An automated run started this device with most background services off, apart from any it asked to keep. Restart the device to turn them back on."}),e[30]=n.servicesOff,e[31]=B):B=e[31];let ne;e[32]!==n.note?(ne=n.note&&r.jsx("p",{className:"text-[12px] text-muted-foreground leading-relaxed break-words",children:n.note}),e[32]=n.note,e[33]=ne):ne=e[33];let ee;e[34]!==b?(ee=r.jsx(Al,{open:b,onOpenChange:g}),e[34]=b,e[35]=ee):ee=e[35];let Y;return e[36]!==F||e[37]!==z||e[38]!==V||e[39]!==B||e[40]!==ne||e[41]!==ee?(Y=r.jsxs("div",{className:"w-[300px] shrink-0 mt-3 rounded-xl border bg-background px-4 py-4 flex flex-col gap-3",children:[F,z,V,B,ne,ee]}),e[36]=F,e[37]=z,e[38]=V,e[39]=B,e[40]=ne,e[41]=ee,e[42]=Y):Y=e[42],Y}function vs(n){const e=de.c(11),{open:t,onOpenChange:l,openUrl:s}=n,[o,i]=a.useState(0),[c,u]=a.useState(t);c!==t&&(u(t),t&&i(Ol));let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(Gr,{className:"sr-only",children:"Open Deeplink"}),e[0]=d):d=e[0];let f;e[1]!==l?(f=()=>l(!1),e[1]=l,e[2]=f):f=e[2];let h;e[3]!==s||e[4]!==o||e[5]!==f?(h=r.jsxs(Qr,{className:"w-[500px] max-w-[500px] h-[52px] !rounded-[18px] p-[10px] border border-border bg-background shadow-lg overflow-hidden [&>button]:hidden","aria-describedby":void 0,children:[d,r.jsx(Hl,{openUrl:s,close:f},o)]}),e[3]=s,e[4]=o,e[5]=f,e[6]=h):h=e[6];let p;return e[7]!==l||e[8]!==t||e[9]!==h?(p=r.jsx(Zr,{open:t,onOpenChange:l,children:h}),e[7]=l,e[8]=t,e[9]=h,e[10]=p):p=e[10],p}function Ol(n){return n+1}function Hl(n){const e=de.c(21),{openUrl:t,close:l}=n,[s,o]=a.useState(""),i=a.useRef(null);let c,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const N=setTimeout(()=>{var I;return(I=i.current)==null?void 0:I.focus()},0);return()=>clearTimeout(N)},u=[],e[0]=c,e[1]=u):(c=e[0],u=e[1]),a.useEffect(c,u);let d;e[2]!==l||e[3]!==t||e[4]!==s?(d=()=>{s.trim()&&(t(s.trim()),l())},e[2]=l,e[3]=t,e[4]=s,e[5]=d):d=e[5];const f=d;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsx(Oo,{className:"h-4 w-4 text-muted-foreground shrink-0","aria-hidden":"true"}),e[6]=h):h=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=N=>o(N.target.value),e[7]=p):p=e[7];let m;e[8]!==f?(m=N=>{N.key==="Enter"&&f()},e[8]=f,e[9]=m):m=e[9];let b;e[10]!==m||e[11]!==s?(b=r.jsxs("div",{className:"flex-1 h-[32px] flex items-center gap-2 pl-[4px] pb-[1px]",children:[h,r.jsx("input",{ref:i,"aria-label":"Deeplink URL",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground min-w-0",placeholder:"myapp://home...",value:s,onChange:p,onKeyDown:m})]}),e[10]=m,e[11]=s,e[12]=b):b=e[12];let S;e[13]!==s?(S=s.trim(),e[13]=s,e[14]=S):S=e[14];const k=!S;let g;e[15]!==f||e[16]!==k?(g=r.jsx(Xe,{size:"sm",disabled:k,onClick:f,className:"shrink-0 rounded-xl h-8 px-4",children:"Open"}),e[15]=f,e[16]=k,e[17]=g):g=e[17];let R;return e[18]!==g||e[19]!==b?(R=r.jsx(r.Fragment,{children:r.jsxs("div",{className:"flex items-center gap-3",children:[b,g]})}),e[18]=g,e[19]=b,e[20]=R):R=e[20],R}const Bl=3e3+5*300,Fl=Bl+500,Jn=8;function ql(){var n;return window.isSecureContext&&typeof ClipboardItem<"u"&&!!((n=navigator.clipboard)!=null&&n.write)}class Vn extends Error{}function zl(n){const e=n.then(t=>new Blob([t],{type:"text/plain"}));return navigator.clipboard.write([new ClipboardItem({"text/plain":e})])}function fr(n){return!(n.metaKey||n.ctrlKey)||n.altKey?!1:n.code==="KeyV"?!0:!n.shiftKey&&(n.code==="KeyC"||n.code==="KeyX")}const Ul=1024*1024,Kl=n=>new TextEncoder().encode(n).length,Wl=n=>{var e;return!!((e=n.payload)!=null&&e.unsupported)},Vl=n=>{var e,t;return((e=n.payload)==null?void 0:e.sentinelParked)===!1||((t=n.payload)==null?void 0:t.unsupported)===!0};function Yl(){const n=window.getSelection();return!!n&&!n.isCollapsed&&n.toString().length>0}function Pr(){const n=document.activeElement;return!!n&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.isContentEditable)}function ws(n){const e=de.c(16),{sessionId:t,send:l,active:s,supported:o,handlerRef:i,sendChord:c,onError:u}=n;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=new Map,e[0]=d):d=e[0];const f=a.useRef(d),h=a.useRef(null),p=a.useRef(u);let m;e[1]!==u?(m=()=>{p.current=u},e[1]=u,e[2]=m):m=e[2],a.useLayoutEffect(m);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=_=>{var y;h.current!==_&&(h.current=_,(y=p.current)==null||y.call(p,_))},e[3]=b):b=e[3];const S=b;let k,g;e[4]!==i?(k=()=>(i.current=_=>{if(!_.requestId)return;const y=f.current.get(_.requestId);y&&(f.current.delete(_.requestId),y(_))},()=>{i.current=void 0}),g=[i],e[4]=i,e[5]=k,e[6]=g):(k=e[5],g=e[6]),a.useEffect(k,g);let R;e[7]!==l||e[8]!==t?(R=(..._)=>{const[y,x]=_,D=je();return new Promise(w=>{const E=setTimeout(()=>{f.current.delete(D),w(null)},Fl);f.current.set(D,F=>{clearTimeout(E),w(F)}),l({type:y,sessionId:t,requestId:D,payload:x})})},e[7]=l,e[8]=t,e[9]=R):R=e[9];const N=R;let I,L;e[10]!==s||e[11]!==N||e[12]!==c||e[13]!==o?(I=()=>{if(!s||!o)return;const _=async x=>{if(x.code==="KeyV"||!fr(x))return;const D=x.code==="KeyX";if(Pr()||Yl()||(x.preventDefault(),x.repeat))return;if(!ql()){c(D?"KeyX":"KeyC",Jn),S("Copied on the device. Serving the dashboard over HTTPS also brings it to your clipboard.");return}let w,E;const F=new Promise((V,B)=>{w=V,E=B});F.catch(Xl);const z=zl(F).catch(V=>{V instanceof Vn||S(V instanceof Error&&V.name==="NotAllowedError"?"Your browser blocked the clipboard write":"Could not write to your clipboard")}),$=await N("clipboard:read",{press:D?"cut":"copy"});if(!$){E(new Vn("timeout")),S("The device is taking too long — try again");return}if($.type==="clipboard:error"){E(new Vn($.message||"read failed")),S($.message||"Clipboard read failed"),Vl($)&&c(D?"KeyX":"KeyC",Jn);return}if($.type!=="clipboard:data"){E(new Vn("unexpected reply")),S("Clipboard read failed");return}const{text:Z}=$.payload;if(h.current=null,!Z){E(new Vn("empty"));return}w(Z),await z},y=x=>{var w;if(Pr())return;const D=((w=x.clipboardData)==null?void 0:w.getData("text"))??"";if(x.preventDefault(),!D){c("KeyV",Jn);return}if(Kl(D)>Ul){S("That text is too large to send to the device");return}N("clipboard:write",{text:D,pasteAfter:!0}).then(E=>{if(!E){S("The device is taking too long — try again");return}if(E.type==="clipboard:write-done"){h.current=null;return}if(E.type!=="clipboard:error"){S("Clipboard write failed");return}S(E.message||"Clipboard write failed"),Wl(E)&&c("KeyV",Jn)})};return document.addEventListener("keydown",_),document.addEventListener("paste",y),()=>{document.removeEventListener("keydown",_),document.removeEventListener("paste",y)}},L=[s,o,N,c,S],e[10]=s,e[11]=N,e[12]=c,e[13]=o,e[14]=I,e[15]=L):(I=e[14],L=e[15]),a.useEffect(I,L)}function Xl(){}const xn=13,Dn=8,Ar=16,Gl=.02;function Ql(n){const e=de.c(236),{sessionId:t,buildId:l,send:s,openUrl:o,launchApp:i,connected:c,joined:u,deviceReady:d,installing:f,installed:h,installError:p,bootError:m,bootWaiting:b,servicesOff:S,launching:k,chrome:g,formFactor:R,binaryFrameHandlerRef:N,clipboardHandlerRef:I,clipboardSupported:L,networkHandlerRef:_,networkSupported:y,onRecordingUploaded:x,swKeyboardVisible:D,swKeyboardPending:w,onKbdToggle:E,rebootPending:F,onReboot:z,restartButtonRef:$,perfHookRef:Z,onStreamSize:V}=n,{fps:B,frameCount:ne}=Kr();let ee;e[0]!==l||e[1]!==x||e[2]!==t?(ee={sessionId:t,buildId:l,onRecordingUploaded:x},e[0]=l,e[1]=x,e[2]=t,e[3]=ee):ee=e[3];const{recordState:Y,recordCanvasRef:M,setComposeFrame:re,startClientRecording:ie,stopClientRecording:be}=bs(ee),[ue,K]=a.useState(!1),[X,he]=a.useState(!1),[J,O]=a.useState(!1),[fe,ye]=a.useState(null),[ge,Re]=a.useState(null),[H,G]=a.useState(!1),[ce,pe]=a.useState(null),ve=a.useRef(ce);let Ie,qe;e[4]!==ce?(Ie=()=>{ve.current=ce},qe=[ce],e[4]=ce,e[5]=Ie,e[6]=qe):(Ie=e[5],qe=e[6]),a.useEffect(Ie,qe);const oe=a.useRef(null);let Ce;e[7]===Symbol.for("react.memo_cache_sentinel")?(Ce=new Set,e[7]=Ce):Ce=e[7];const Pe=a.useRef(Ce),we=a.useRef(null);let Ge,We;e[8]===Symbol.for("react.memo_cache_sentinel")?(Ge=()=>()=>{we.current&&clearTimeout(we.current)},We=[],e[8]=Ge,e[9]=We):(Ge=e[8],We=e[9]),a.useEffect(Ge,We);const Qe=a.useRef(null),Ue=a.useRef(!1),$e=a.useRef(!1),Oe=a.useRef(0),nt=a.useRef(null),Ze=a.useRef(null),He=a.useRef("idle"),yt=a.useRef(null),Xt=a.useRef(null),Je=a.useRef(null);let vt,rt;e[10]!==g?(vt=()=>{Je.current=g},rt=[g],e[10]=g,e[11]=vt,e[12]=rt):(vt=e[11],rt=e[12]),a.useEffect(vt,rt);let Dt,wt;e[13]!==g.framePng?(wt=()=>{const j=new Image;j.onload=()=>{Xt.current=j},j.src=`data:image/png;base64,${g.framePng}`},Dt=[g.framePng],e[13]=g.framePng,e[14]=Dt,e[15]=wt):(Dt=e[14],wt=e[15]),a.useEffect(wt,Dt);let Mt;e[16]!==V||e[17]!==M?(Mt=j=>{if(V==null||V(j),!Je.current){const C=M.current;C&&(C.width=j.width,C.height=j.height)}},e[16]=V,e[17]=M,e[18]=Mt):Mt=e[18];let st;e[19]!==N||e[20]!==g||e[21]!==B||e[22]!==ne||e[23]!==Z||e[24]!==Mt?(st={chrome:g,binaryFrameHandlerRef:N,perfHookRef:Z,fps:B,frameCount:ne,onCanvasResize:Mt},e[19]=N,e[20]=g,e[21]=B,e[22]=ne,e[23]=Z,e[24]=Mt,e[25]=st):st=e[25];const en=so(st),{canvasRef:te,containerRef:le,screenAreaRef:tn,decoderUnsupported:pt}=en;let Gt;e[26]!==le||e[27]!==M?(Gt=()=>{const j=M.current,C=le.current;j&&C&&(j.width=C.clientWidth,j.height=C.clientHeight)},e[26]=le,e[27]=M,e[28]=Gt):Gt=e[28];let $t;e[29]!==g||e[30]!==le||e[31]!==M?($t=[g,M,le],e[29]=g,e[30]=le,e[31]=M,e[32]=$t):$t=e[32],a.useEffect(Gt,$t);let _e;e[33]!==te||e[34]!==M?(_e=()=>{const j=M.current,C=te.current;if(!j||!C)return;const T=j.getContext("2d");if(!T)return;const Te=Je.current;if(T.clearRect(0,0,j.width,j.height),Te){Xt.current&&T.drawImage(Xt.current,0,0,j.width,j.height);const ze=Math.round(Te.screenCornerRadius/2*(j.height/(Te.compositeHeight/2)));T.save(),T.beginPath(),ze>0?T.roundRect(C.offsetLeft,C.offsetTop,C.clientWidth,C.clientHeight,ze):T.rect(C.offsetLeft,C.offsetTop,C.clientWidth,C.clientHeight),T.clip(),T.drawImage(C,C.offsetLeft,C.offsetTop,C.clientWidth,C.clientHeight),T.restore()}else T.drawImage(C,0,0,j.width,j.height);const at=ve.current;if(at)for(const ze of[at.f0,at.f1]){const ke=Te?C.offsetLeft+ze.x*C.clientWidth:ze.x*j.width,Me=Te?C.offsetTop+ze.y*C.clientHeight:ze.y*j.height;Ue.current?(T.beginPath(),T.arc(ke,Me,Dn,0,Math.PI*2),T.fillStyle="rgba(255,255,255,0.92)",T.fill(),T.strokeStyle="rgba(0,0,0,0.2)",T.lineWidth=1,T.stroke()):(T.beginPath(),T.arc(ke,Me,xn,0,Math.PI*2),T.strokeStyle="rgba(0,0,0,0.3)",T.lineWidth=3,T.stroke(),T.beginPath(),T.arc(ke,Me,xn,0,Math.PI*2),T.strokeStyle="rgba(255,255,255,0.65)",T.lineWidth=1.5,T.stroke())}const q=Ze.current;if(q){const ze=He.current,ke=yt.current;if(T.save(),ze==="down")T.beginPath(),T.arc(q.x,q.y,Dn,0,Math.PI*2),T.fillStyle="rgba(255,255,255,0.92)",T.fill(),T.strokeStyle="rgba(0,0,0,0.2)",T.lineWidth=1,T.stroke();else if(ze==="release"&&ke){const Me=Math.min((performance.now()-ke.startTime)/350,1);T.beginPath(),T.arc(q.x,q.y,Dn+26*Me,0,Math.PI*2),T.strokeStyle=`rgba(255,255,255,${(1-Me)*.55})`,T.lineWidth=1.5,T.stroke(),Me>=1&&(He.current="idle",yt.current=null)}else T.beginPath(),T.arc(q.x,q.y,xn,0,Math.PI*2),T.strokeStyle="rgba(0,0,0,0.3)",T.lineWidth=3,T.stroke(),T.beginPath(),T.arc(q.x,q.y,xn,0,Math.PI*2),T.strokeStyle="rgba(255,255,255,0.65)",T.lineWidth=1.5,T.stroke();T.restore()}},e[33]=te,e[34]=M,e[35]=_e):_e=e[35];const St=_e;let Ve,jt;e[36]!==St||e[37]!==re?(Ve=()=>{re(St)},jt=[St,re],e[36]=St,e[37]=re,e[38]=Ve,e[39]=jt):(Ve=e[38],jt=e[39]),a.useLayoutEffect(Ve,jt);let Ot;e[40]!==te?(Ot=()=>{const j=te.current;if(!j)return;const C=document.createElement("canvas"),T=C.getContext("2d");T&&(C.width=j.width,C.height=j.height,T.drawImage(j,0,0),C.toBlob(ea,"image/png"))},e[40]=te,e[41]=Ot):Ot=e[41];const mt=Ot;let Ht;e[42]!==te||e[43]!==le||e[44]!==M||e[45]!==Y||e[46]!==ie||e[47]!==be?(Ht=()=>{if(Y==="idle"){const j=M.current;if(!j)return;const C=le.current;if(C&&C.clientWidth>0)j.width=C.clientWidth,j.height=C.clientHeight;else{const T=te.current;if(T&&T.width>0)j.width=T.width,j.height=T.height;else return}ie()}else Y==="recording"&&be()},e[42]=te,e[43]=le,e[44]=M,e[45]=Y,e[46]=ie,e[47]=be,e[48]=Ht):Ht=e[48];const ot=Ht,nn=a.useRef(!1);let Qt;e[49]!==s||e[50]!==t?(Qt=()=>{const j=!nn.current;nn.current=j,he(j),s({type:"input:rotate",sessionId:t,payload:{orientation:j?"landscape":"portrait"}})},e[49]=s,e[50]=t,e[51]=Qt):Qt=e[51];const et=Qt,Rt=a.useRef(null);let kt,Bt;e[52]!==s||e[53]!==t?(kt=()=>{Rt.current=()=>{nn.current&&s({type:"input:rotate",sessionId:t,payload:{orientation:"portrait"}})}},Bt=[s,t],e[52]=s,e[53]=t,e[54]=kt,e[55]=Bt):(kt=e[54],Bt=e[55]),a.useEffect(kt,Bt);let Ct,Ft;e[56]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>()=>{var j;(j=Rt.current)==null||j.call(Rt)},Ft=[],e[56]=Ct,e[57]=Ft):(Ct=e[56],Ft=e[57]),a.useEffect(Ct,Ft);let qt;e[58]!==s||e[59]!==t?(qt=(j,C)=>{s({type:"input:key",sessionId:t,requestId:je(),payload:{code:j,modifiers:C}})},e[58]=s,e[59]=t,e[60]=qt):qt=e[60];const Zt=qt;let _t;e[61]!==I||e[62]!==L||e[63]!==J||e[64]!==s||e[65]!==Zt||e[66]!==t?(_t={sessionId:t,send:s,active:J,supported:L,handlerRef:I,sendChord:Zt,onError:Jl},e[61]=I,e[62]=L,e[63]=J,e[64]=s,e[65]=Zt,e[66]=t,e[67]=_t):_t=e[67],ws(_t);let Nt;e[68]!==d||e[69]!==_||e[70]!==y||e[71]!==s||e[72]!==t?(Nt={sessionId:t,send:s,supported:y,deviceReady:d,handlerRef:_,onError:Zl},e[68]=d,e[69]=_,e[70]=y,e[71]=s,e[72]=t,e[73]=Nt):Nt=e[73];const Ke=ys(Nt);let it,ct;e[74]!==L||e[75]!==ot||e[76]!==et||e[77]!==mt||e[78]!==J||e[79]!==E||e[80]!==s||e[81]!==t||e[82]!==w?(it=()=>{const j=new Set(["ShiftLeft","ShiftRight","ControlLeft","ControlRight","MetaLeft","MetaRight"]),C=q=>{if(q.code==="AltLeft"||q.code==="AltRight"){$e.current=!0;return}if(q.metaKey){const ke=document.activeElement;if(!ke||ke.tagName!=="INPUT"&&ke.tagName!=="TEXTAREA"){if(!q.shiftKey&&q.code==="KeyK"){q.preventDefault(),K(!0);return}if(!q.shiftKey&&q.code==="KeyS"){q.preventDefault(),mt();return}if(q.shiftKey&&q.code==="KeyY"){q.preventDefault(),ot();return}if(q.shiftKey&&q.code==="KeyO"){q.preventDefault(),q.repeat||et();return}if(q.shiftKey&&q.code==="KeyU"){q.preventDefault(),s({type:"input:button",sessionId:t,requestId:je(),payload:{name:"home"}});return}if(q.shiftKey&&q.code==="KeyK"){q.preventDefault(),w||E();return}}}if(!J||j.has(q.code)||L&&fr(q))return;q.preventDefault();const ze=(q.shiftKey?2:0)|(q.ctrlKey?1:0)|(q.metaKey?8:0);s({type:"input:key",sessionId:t,requestId:je(),payload:{code:q.code,modifiers:ze}})},T=()=>{Ue.current&&(Ue.current=!1,G(!1),s({type:"input:pinch:end",sessionId:t,requestId:je()})),$e.current=!1,pe(null)},Te=q=>{(q.code==="AltLeft"||q.code==="AltRight")&&T()},at=()=>{$e.current&&T()};return window.addEventListener("keydown",C),window.addEventListener("keyup",Te),window.addEventListener("blur",at),()=>{window.removeEventListener("keydown",C),window.removeEventListener("keyup",Te),window.removeEventListener("blur",at)}},ct=[J,L,s,t,mt,ot,et,E,w],e[74]=L,e[75]=ot,e[76]=et,e[77]=mt,e[78]=J,e[79]=E,e[80]=s,e[81]=t,e[82]=w,e[83]=it,e[84]=ct):(it=e[83],ct=e[84]),a.useEffect(it,ct);let Tt,dt;e[85]!==te||e[86]!==le||e[87]!==J?(Tt=()=>{if(!J)return;const j=C=>{const T=le.current??te.current;T&&!T.contains(C.target)&&O(!1)};return document.addEventListener("pointerdown",j),()=>document.removeEventListener("pointerdown",j)},dt=[J,le,te],e[85]=te,e[86]=le,e[87]=J,e[88]=Tt,e[89]=dt):(Tt=e[88],dt=e[89]),a.useEffect(Tt,dt);let Jt;e[90]!==g.compositeHeight||e[91]!==g.compositeWidth||e[92]!==g.screenRect||e[93]!==le||e[94]!==X||e[95]!==tn?(Jt=j=>{const C=(X?tn.current:null)??le.current;if(!C)return null;const T=C.getBoundingClientRect(),Te=g.compositeWidth/2,at=g.compositeHeight/2,q=g.screenRect.x/2,ze=g.screenRect.y/2,ke=g.screenRect.width/2,Me=g.screenRect.height/2;return ao({x:j.clientX,y:j.clientY},T,Te,at,{x:q,y:ze,width:ke,height:Me},X)},e[90]=g.compositeHeight,e[91]=g.compositeWidth,e[92]=g.screenRect,e[93]=le,e[94]=X,e[95]=tn,e[96]=Jt):Jt=e[96];const xe=Jt;let ut;e[97]!==xe?(ut=j=>{const C=xe(j);return C?Wr(C):null},e[97]=xe,e[98]=ut):ut=e[98];const Be=ut;let Et;e[99]!==te||e[100]!==M?(Et=j=>{const C=te.current,T=M.current;return C&&C.clientWidth>0?{x:C.offsetLeft+j.x*C.clientWidth,y:C.offsetTop+j.y*C.clientHeight}:{x:j.x*((T==null?void 0:T.width)??1),y:j.y*((T==null?void 0:T.height)??1)}},e[99]=te,e[100]=M,e[101]=Et):Et=e[101];const v=Et;let Q;e[102]!==v||e[103]!==s||e[104]!==t||e[105]!==xe||e[106]!==Be?(Q=j=>{if(O(!0),$e.current){const at=Be(j);if(!at)return;Ue.current=!0,G(!0),j.target.setPointerCapture(j.pointerId),pe(at),s({type:"input:pinch:start",sessionId:t,payload:at});return}const C=xe(j);if(!C)return;Qe.current=C,j.target.setPointerCapture(j.pointerId),Ze.current=v(C),He.current="down",yt.current=null;const T=j.currentTarget.getBoundingClientRect(),Te=nt.current;Te&&(Te.style.display="block",Te.style.left=`${j.clientX-T.left}px`,Te.style.top=`${j.clientY-T.top}px`,Te.style.width=`${Dn*2}px`,Te.style.height=`${Dn*2}px`,Te.style.background="rgba(255,255,255,0.92)",Te.style.border="1.5px solid rgba(0,0,0,0.2)",Te.style.boxShadow="0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"),s({type:"input:touch:start",sessionId:t,payload:C})},e[102]=v,e[103]=s,e[104]=t,e[105]=xe,e[106]=Be,e[107]=Q):Q=e[107];const Ne=Q;let Ee;e[108]!==s||e[109]!==t?(Ee=(j,C)=>{if(!$e.current){if(C.stopPropagation(),oe.current){Pe.current.add(C.pointerId);return}O(!0),we.current&&(clearTimeout(we.current),we.current=null),oe.current={name:j,pointerId:C.pointerId},ye(j),C.currentTarget.setPointerCapture(C.pointerId),s({type:"input:button",sessionId:t,requestId:je(),payload:{name:j,phase:"down"}})}},e[108]=s,e[109]=t,e[110]=Ee):Ee=e[110];const Ae=Ee;let me;e[111]!==v||e[112]!==s||e[113]!==t||e[114]!==xe||e[115]!==Be?(me=j=>{var ze;if(Pe.current.has(j.pointerId))return;if(j.buttons===0){if($e.current){pe(Be(j)),Ze.current=null;const ke=nt.current;ke&&(ke.style.display="none")}else{pe(null);const ke=xe(j);Ze.current=ke?v(ke):null,He.current!=="down"&&(He.current="idle");const Me=nt.current;if(Me)if(ke){const vr=j.currentTarget.getBoundingClientRect();Me.style.display="block",Me.style.left=`${j.clientX-vr.left}px`,Me.style.top=`${j.clientY-vr.top}px`,Me.style.width=`${xn*2}px`,Me.style.height=`${xn*2}px`,Me.style.background="transparent",Me.style.border="1.5px solid rgba(255,255,255,0.6)",Me.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"}else Me.style.display="none"}return}if(Ue.current){const ke=Be(j);if(!ke)return;const Me=performance.now();if(Me-Oe.current<Ar)return;Oe.current=Me,pe(ke),s({type:"input:pinch:move",sessionId:t,payload:ke});return}if(((ze=oe.current)==null?void 0:ze.pointerId)===j.pointerId||!Qe.current)return;const C=xe(j);if(!C)return;const T=C.x-Qe.current.x,Te=C.y-Qe.current.y;if(Math.sqrt(T*T+Te*Te)<Gl)return;const at=performance.now();if(at-Oe.current<Ar)return;Oe.current=at,Ze.current=v(C);const q=nt.current;if(q&&q.style.display!=="none"){const ke=j.currentTarget.getBoundingClientRect();q.style.left=`${j.clientX-ke.left}px`,q.style.top=`${j.clientY-ke.top}px`}s({type:"input:touch:move",sessionId:t,payload:C})},e[111]=v,e[112]=s,e[113]=t,e[114]=xe,e[115]=Be,e[116]=me):me=e[116];const Le=me;let vn;e[117]!==s||e[118]!==t?(vn=j=>{var T;if(Pe.current.delete(j.pointerId))return;if(Ue.current){Ue.current=!1,G(!1),pe(null),s({type:"input:pinch:end",sessionId:t,requestId:je()});return}if(Qe.current=null,((T=oe.current)==null?void 0:T.pointerId)===j.pointerId){s({type:"input:button",sessionId:t,requestId:je(),payload:{name:oe.current.name,phase:"up"}}),oe.current=null,we.current=setTimeout(()=>{we.current=null,ye(null)},100);return}He.current="release",yt.current={startTime:performance.now()};const C=nt.current;C&&(C.style.width=`${xn*2}px`,C.style.height=`${xn*2}px`,C.style.background="transparent",C.style.border="1.5px solid rgba(255,255,255,0.6)",C.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"),s({type:"input:touch:end",sessionId:t,requestId:je()})},e[117]=s,e[118]=t,e[119]=vn):vn=e[119];const Kn=vn;let rn;e[120]!==s||e[121]!==t?(rn=j=>{var C;if(!Pe.current.delete(j.pointerId)){if(Ue.current){Ue.current=!1,G(!1),pe(null),s({type:"input:pinch:end",sessionId:t,requestId:je()});return}if(Qe.current=null,((C=oe.current)==null?void 0:C.pointerId)===j.pointerId){s({type:"input:button",sessionId:t,requestId:je(),payload:{name:oe.current.name,phase:"up"}}),oe.current=null,ye(null);return}He.current="release",yt.current={startTime:performance.now()},s({type:"input:touch:end",sessionId:t,requestId:je()})}},e[120]=s,e[121]=t,e[122]=rn):rn=e[122];const _n=rn;let Nn;e[123]===Symbol.for("react.memo_cache_sentinel")?(Nn=()=>{Re(null),pe(null),Ze.current=null;const j=nt.current;j&&(j.style.display="none")},e[123]=Nn):Nn=e[123];const Fn=Nn;let Tn;e[124]!==g?(Tn=oo(g),e[124]=g,e[125]=Tn):Tn=e[125];const{screenPctLeft:En,screenPctTop:un,screenPctW:fn,screenPctH:In}=Tn;let zt;e[126]!==s||e[127]!==t?(zt=()=>s({type:"input:button",sessionId:t,requestId:je(),payload:{name:"home"}}),e[126]=s,e[127]=t,e[128]=zt):zt=e[128];let sn;e[129]===Symbol.for("react.memo_cache_sentinel")?(sn=r.jsx(Xr,{className:"h-4 w-4"}),e[129]=sn):sn=e[129];let Ut;e[130]!==zt?(Ut=r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Home",onClick:zt,children:sn})}),e[130]=zt,e[131]=Ut):Ut=e[131];let on;e[132]===Symbol.for("react.memo_cache_sentinel")?(on=r.jsx(Lt,{side:"left",children:r.jsxs("span",{className:"flex items-center gap-3",children:["Home ",r.jsxs(ir,{children:[r.jsx($n,{children:"⌘"}),r.jsx($n,{children:"⇧"}),r.jsx($n,{children:"U"})]})]})}),e[132]=on):on=e[132];let ln;e[133]!==Ut?(ln=r.jsx(r.Fragment,{children:r.jsxs(Pt,{children:[Ut,on]})}),e[133]=Ut,e[134]=ln):ln=e[134];const Pn=ln,Kt=a.useId(),hn=w?"Changing the software keyboard.":D?"The software keyboard is up.":"The software keyboard is down.";let Wt;e[135]!==Kt||e[136]!==hn?(Wt=r.jsx("span",{id:Kt,role:"status",className:"sr-only",children:hn}),e[135]=Kt,e[136]=hn,e[137]=Wt):Wt=e[137];const pn=w?"Software keyboard — changing it":"Software keyboard";let Vt;e[138]!==E||e[139]!==w?(Vt=()=>{w||E()},e[138]=E,e[139]=w,e[140]=Vt):Vt=e[140];let an;e[141]!==w?(an=w?r.jsx(Hn,{className:"h-4 w-4 animate-spin"}):r.jsx(Eo,{className:"h-4 w-4"}),e[141]=w,e[142]=an):an=e[142];let P;e[143]!==Kt||e[144]!==w||e[145]!==D||e[146]!==pn||e[147]!==Vt||e[148]!==an?(P=r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":pn,"aria-pressed":D,"aria-busy":w,"aria-disabled":w,"aria-describedby":Kt,onClick:Vt,"data-active":D,children:an})}),e[143]=Kt,e[144]=w,e[145]=D,e[146]=pn,e[147]=Vt,e[148]=an,e[149]=P):P=e[149];let W;e[150]!==w?(W=r.jsx(Lt,{side:"left",children:w?r.jsx("span",{children:"Software keyboard — changing it"}):r.jsxs("span",{className:"flex items-center gap-3",children:["Software keyboard ",r.jsxs(ir,{children:[r.jsx($n,{children:"⌘"}),r.jsx($n,{children:"⇧"}),r.jsx($n,{children:"K"})]})]})}),e[150]=w,e[151]=W):W=e[151];let ae;e[152]!==P||e[153]!==W?(ae=r.jsxs(Pt,{children:[P,W]}),e[152]=P,e[153]=W,e[154]=ae):ae=e[154];let A;e[155]!==Wt||e[156]!==ae?(A=r.jsxs(r.Fragment,{children:[Wt,ae]}),e[155]=Wt,e[156]=ae,e[157]=A):A=e[157];const De=A;let U;e[158]!==l||e[159]!==h||e[160]!==i||e[161]!==k?(U=h&&l?r.jsxs(Pt,{children:[r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:k,"aria-label":"Launch app",onClick:i,children:k?r.jsx(Hn,{className:"h-4 w-4 animate-spin"}):r.jsx(Jr,{className:"h-4 w-4"})})}),r.jsx(Lt,{side:"left",children:k?"Launching…":"Launch app"})]}):null,e[158]=l,e[159]=h,e[160]=i,e[161]=k,e[162]=U):U=e[162];const Ye=U;let tt;e[163]===Symbol.for("react.memo_cache_sentinel")?(tt={display:"none"},e[163]=tt):tt=e[163];let gt;e[164]!==M?(gt=r.jsx("canvas",{ref:M,style:tt}),e[164]=M,e[165]=gt):gt=e[165];let Se;e[166]!==ue||e[167]!==o?(Se=r.jsx(vs,{open:ue,onOpenChange:K,openUrl:o}),e[166]=ue,e[167]=o,e[168]=Se):Se=e[168];let mn;e[169]===Symbol.for("react.memo_cache_sentinel")?(mn=()=>K(!0),e[169]=mn):mn=e[169];let wn;e[170]!==Ke||e[171]!==y?(wn=y?{position:Ke.position,steerable:Ke.steerable,reason:Ke.reason,pending:Ke.pending,onToggle:Ke.toggle}:void 0,e[170]=Ke,e[171]=y,e[172]=wn):wn=e[172];let ft;e[173]!==z||e[174]!==F||e[175]!==$?(ft={pending:F,onReboot:z,buttonRef:$},e[173]=z,e[174]=F,e[175]=$,e[176]=ft):ft=e[176];let Sn;e[177]!==De||e[178]!==ot||e[179]!==et||e[180]!==mt||e[181]!==u||e[182]!==Ye||e[183]!==Pn||e[184]!==Y||e[185]!==wn||e[186]!==ft?(Sn=r.jsx(xs,{joined:u,onDeepLink:mn,onScreenshot:mt,onRecordToggle:ot,recordState:Y,onRotate:et,navigationSlot:Pn,deviceSlot:De,launchSlot:Ye,network:wn,reboot:ft}),e[177]=De,e[178]=ot,e[179]=et,e[180]=mt,e[181]=u,e[182]=Ye,e[183]=Pn,e[184]=Y,e[185]=wn,e[186]=ft,e[187]=Sn):Sn=e[187];let lt;e[188]!==_n||e[189]!==Ne||e[190]!==Le||e[191]!==Kn?(lt={onPointerDown:Ne,onPointerMove:Le,onPointerUp:Kn,onPointerCancel:_n,onPointerLeave:Fn},e[188]=_n,e[189]=Ne,e[190]=Le,e[191]=Kn,e[192]=lt):lt=e[192];let cn;e[193]!==fe||e[194]!==ge||e[195]!==Ae?(cn={hovered:ge,flashed:fe,onHoverChange:Re,onPress:Ae},e[193]=fe,e[194]=ge,e[195]=Ae,e[196]=cn):cn=e[196];let gn;e[197]!==H||e[198]!==ce||e[199]!==In||e[200]!==En||e[201]!==un||e[202]!==fn?(gn=ce&&(()=>{const j=En/100,C=un/100,T=fn/100,Te=In/100,at=(q,ze)=>({left:`${(j+q*T)*100}%`,top:`${(C+ze*Te)*100}%`});return r.jsx(r.Fragment,{children:[ce.f0,ce.f1].map((q,ze)=>r.jsx("div",{style:{position:"absolute",zIndex:10,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease",...H?{width:Dn*2,height:Dn*2,background:"rgba(255,255,255,0.92)",border:"1.5px solid rgba(0,0,0,0.2)",boxShadow:"0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"}:{width:xn*2,height:xn*2,background:"transparent",border:"1.5px solid rgba(255,255,255,0.6)",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)"},...at(q.x,q.y)}},ze))})})(),e[197]=H,e[198]=ce,e[199]=In,e[200]=En,e[201]=un,e[202]=fn,e[203]=gn):gn=e[203];let An;e[204]===Symbol.for("react.memo_cache_sentinel")?(An=r.jsx("div",{ref:nt,style:{display:"none",position:"absolute",zIndex:20,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease, box-shadow 0.1s ease"}}),e[204]=An):An=e[204];let bn;e[205]!==g||e[206]!==R||e[207]!==B||e[208]!==X||e[209]!==u||e[210]!==en||e[211]!==lt||e[212]!==cn||e[213]!==gn?(bn=r.jsx(io,{screen:en,chrome:g,formFactor:R,isLandscape:X,joined:u,fps:B,containerHandlers:lt,buttons:cn,overlay:gn,areaOverlay:An}),e[205]=g,e[206]=R,e[207]=B,e[208]=X,e[209]=u,e[210]=en,e[211]=lt,e[212]=cn,e[213]=gn,e[214]=bn):bn=e[214];const qn=lo(g)?"The device frame couldn't be loaded, so its side buttons (lock, volume) are unavailable this session.":void 0;let It;e[215]!==m||e[216]!==b||e[217]!==c||e[218]!==pt||e[219]!==d||e[220]!==B||e[221]!==p||e[222]!==f||e[223]!==u||e[224]!==J||e[225]!==S||e[226]!==qn?(It=r.jsx(ur,{joined:u,fps:B,connected:c,deviceReady:d,bootError:m,bootWaiting:b,servicesOff:S,installing:f,installError:p,decoderUnsupported:pt,keyboardActive:J,note:qn}),e[215]=m,e[216]=b,e[217]=c,e[218]=pt,e[219]=d,e[220]=B,e[221]=p,e[222]=f,e[223]=u,e[224]=J,e[225]=S,e[226]=qn,e[227]=It):It=e[227];let bt;e[228]!==bn||e[229]!==It?(bt=r.jsxs("div",{className:"flex items-start gap-8",children:[bn,It]}),e[228]=bn,e[229]=It,e[230]=bt):bt=e[230];let dn;return e[231]!==gt||e[232]!==Se||e[233]!==Sn||e[234]!==bt?(dn=r.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[gt,Se,Sn,bt]}),e[231]=gt,e[232]=Se,e[233]=Sn,e[234]=bt,e[235]=dn):dn=e[235],dn}function Zl(n){return xt.error(n)}function Jl(n){return xt.error(n)}function ea(n){if(!n)return;const e=URL.createObjectURL(n),t=document.createElement("a");t.href=e,t.download=`tapflow-${Date.now()}.png`,t.click(),URL.revokeObjectURL(e)}const Mn=13,Yn=8,Lr=16,ta=.02;function na(n){const e=de.c(194),{sessionId:t,buildId:l,send:s,openUrl:o,launchApp:i,connected:c,joined:u,deviceReady:d,installing:f,installed:h,installError:p,bootError:m,bootWaiting:b,servicesOff:S,launching:k,androidButtons:g,binaryFrameHandlerRef:R,clipboardHandlerRef:N,clipboardSupported:I,networkHandlerRef:L,networkSupported:_,onRecordingUploaded:y,rebootPending:x,onReboot:D,restartButtonRef:w,screenWidth:E,screenHeight:F,cornerRadius:z,postures:$,streamRotation:Z,perfHookRef:V}=n,B=Z===void 0?0:Z,{fps:ne,frameCount:ee}=Kr();let Y;e[0]!==l||e[1]!==y||e[2]!==t?(Y={sessionId:t,buildId:l,onRecordingUploaded:y},e[0]=l,e[1]=y,e[2]=t,e[3]=Y):Y=e[3];const{recordState:M,recordCanvasRef:re,setComposeFrame:ie,startClientRecording:be,stopClientRecording:ue}=bs(Y),[K,X]=a.useState(!1),[he,J]=a.useState(!1),[O,fe]=a.useState(!1),[ye,ge]=a.useState(!1),[Re,H]=a.useState(null),G=a.useRef(Re);let ce,pe;e[4]!==Re?(ce=()=>{G.current=Re},pe=[Re],e[4]=Re,e[5]=ce,e[6]=pe):(ce=e[5],pe=e[6]),a.useEffect(ce,pe);const ve=a.useRef(!1),Ie=a.useRef(!1),qe=a.useRef(null),oe=a.useRef(0),Ce=a.useRef(null),Pe=a.useRef(null),we=a.useRef("idle"),Ge=a.useRef(null),[We,Qe]=a.useState(!1);let Ue;e[7]!==R||e[8]!==z||e[9]!==ee||e[10]!==V||e[11]!==We||e[12]!==F||e[13]!==E||e[14]!==B||e[15]!==he?(Ue={binaryFrameHandlerRef:R,perfHookRef:V,frameCount:ee,screenWidth:E,screenHeight:F,streamRotation:B,cornerRadius:z,userWantsLandscape:he,rotatePending:We},e[7]=R,e[8]=z,e[9]=ee,e[10]=V,e[11]=We,e[12]=F,e[13]=E,e[14]=B,e[15]=he,e[16]=Ue):Ue=e[16];const $e=co(Ue),{surfaceHostRef:Oe,containerRef:nt,decoderRef:Ze,videoSizeRef:He,needsCSSRotationRef:yt,decoderUnsupported:Xt,totalTurn:Je}=$e;let vt;e[17]!==Ze||e[18]!==re||e[19]!==B||e[20]!==Je||e[21]!==He?(vt=()=>{var qn;const P=re.current,W=(qn=Ze.current)==null?void 0:qn.surface,ae=He.current;if(!P||!W||!ae)return;const A=P.getContext("2d");if(!A)return;const De=ae.width,U=ae.height,Ye=Je,{picW:tt,picH:gt,scale:Se,left:mn,top:wn}=uo(P.width,P.height,De,U,Ye);A.clearRect(0,0,P.width,P.height),A.save(),A.translate(mn+tt*Se/2,wn+gt*Se/2),A.scale(Se,Se),A.rotate(Ye*Math.PI/180),A.drawImage(W,-De/2,-U/2,De,U),A.restore();const ft=mo(De,U,Ye,B);A.save(),A.translate(mn+tt*Se/2,wn+gt*Se/2),A.scale(Se,Se),A.rotate(ft.turn*Math.PI/180),A.translate(-ft.width/2,-ft.height/2);const Sn=Math.max(ft.width,ft.height),lt=Sn>Sr?Sn/Sr:1,cn=Mn*lt,gn=Yn*lt,An=G.current;if(An)for(const It of[An.f0,An.f1]){const bt=It.x*ft.width,dn=It.y*ft.height;ve.current?(A.beginPath(),A.arc(bt,dn,gn,0,Math.PI*2),A.fillStyle="rgba(255,255,255,0.92)",A.fill(),A.strokeStyle="rgba(0,0,0,0.2)",A.lineWidth=lt,A.stroke()):(A.beginPath(),A.arc(bt,dn,cn,0,Math.PI*2),A.strokeStyle="rgba(0,0,0,0.3)",A.lineWidth=3*lt,A.stroke(),A.beginPath(),A.arc(bt,dn,cn,0,Math.PI*2),A.strokeStyle="rgba(255,255,255,0.65)",A.lineWidth=1.5*lt,A.stroke())}const bn=Pe.current;if(bn){const It=bn.x*ft.width,bt=bn.y*ft.height,dn=we.current,j=Ge.current;if(dn==="down")A.beginPath(),A.arc(It,bt,gn,0,Math.PI*2),A.fillStyle="rgba(255,255,255,0.92)",A.fill(),A.strokeStyle="rgba(0,0,0,0.2)",A.lineWidth=lt,A.stroke();else if(dn==="release"&&j){const C=Math.min((performance.now()-j.startTime)/350,1);A.beginPath(),A.arc(It,bt,gn+26*lt*C,0,Math.PI*2),A.strokeStyle=`rgba(255,255,255,${(1-C)*.55})`,A.lineWidth=1.5*lt,A.stroke(),C>=1&&(we.current="idle",Ge.current=null)}else A.beginPath(),A.arc(It,bt,cn,0,Math.PI*2),A.strokeStyle="rgba(0,0,0,0.3)",A.lineWidth=3*lt,A.stroke(),A.beginPath(),A.arc(It,bt,cn,0,Math.PI*2),A.strokeStyle="rgba(255,255,255,0.65)",A.lineWidth=1.5*lt,A.stroke()}A.restore()},e[17]=Ze,e[18]=re,e[19]=B,e[20]=Je,e[21]=He,e[22]=vt):vt=e[22];const rt=vt;let Dt,wt;e[23]!==rt||e[24]!==ie?(Dt=()=>{ie(rt)},wt=[rt,ie],e[23]=rt,e[24]=ie,e[25]=Dt,e[26]=wt):(Dt=e[25],wt=e[26]),a.useLayoutEffect(Dt,wt);let Mt;e[27]!==Ze||e[28]!==Je||e[29]!==He?(Mt=()=>{var Ye;const P=(Ye=Ze.current)==null?void 0:Ye.surface,W=He.current;if(!P||!W)return;const ae=document.createElement("canvas"),A=ae.getContext("2d");if(!A)return;const De=Je,U=wr(W.width,W.height,De);ae.width=U.width,ae.height=U.height,A.translate(ae.width/2,ae.height/2),A.rotate(De*Math.PI/180),A.drawImage(P,-W.width/2,-W.height/2,W.width,W.height),ae.toBlob(aa,"image/png")},e[27]=Ze,e[28]=Je,e[29]=He,e[30]=Mt):Mt=e[30];const st=Mt;let en;e[31]!==re||e[32]!==M||e[33]!==be||e[34]!==ue||e[35]!==Je||e[36]!==He?(en=()=>{if(M==="idle"){const P=re.current;if(!P)return;const W=He.current;if(!W)return;const ae=wr(W.width,W.height,Je);P.width=ae.width,P.height=ae.height,be()}else M==="recording"&&ue()},e[31]=re,e[32]=M,e[33]=be,e[34]=ue,e[35]=Je,e[36]=He,e[37]=en):en=e[37];const te=en,[le,tn]=a.useState(null),pt=le!==null,Gt=a.useRef(0);let $t;e[38]!==s||e[39]!==t?($t=P=>{Gt.current=Date.now()+8e3,tn(P),s({type:"input:posture",sessionId:t,payload:{postureId:P}})},e[38]=s,e[39]=t,e[40]=$t):$t=e[40];const _e=$t;let St;e[41]!==le||e[42]!==($==null?void 0:$.currentId)?(St=()=>{if(le===null)return;const P=($==null?void 0:$.currentId)===le,W=setTimeout(()=>tn(null),P?0:fo(Gt.current,Date.now()));return()=>clearTimeout(W)},e[41]=le,e[42]=$==null?void 0:$.currentId,e[43]=St):St=e[43];let Ve;e[44]!==le||e[45]!==$?(Ve=[le,$],e[44]=le,e[45]=$,e[46]=Ve):Ve=e[46],a.useEffect(St,Ve);let jt,Ot;e[47]!==We?(jt=()=>{if(!We)return;const P=setTimeout(()=>Qe(!1),400);return()=>clearTimeout(P)},Ot=[We],e[47]=We,e[48]=jt,e[49]=Ot):(jt=e[48],Ot=e[49]),a.useEffect(jt,Ot);const mt=a.useRef(!1);let Ht;e[50]===Symbol.for("react.memo_cache_sentinel")?(Ht=()=>{if(!mt.current){mt.current=!0;return}Qe(!1)},e[50]=Ht):Ht=e[50];let ot;e[51]!==F||e[52]!==E||e[53]!==B?(ot=[B,E,F],e[51]=F,e[52]=E,e[53]=B,e[54]=ot):ot=e[54],a.useEffect(Ht,ot);const nn=a.useRef(!1);let Qt;e[55]!==s||e[56]!==t?(Qt=()=>{const P=!nn.current;nn.current=P,Qe(!0),s({type:"input:rotate",sessionId:t,payload:{orientation:P?"landscape":"portrait"}}),J(P)},e[55]=s,e[56]=t,e[57]=Qt):Qt=e[57];const et=Qt,Rt=a.useRef(null);let kt,Bt;e[58]!==s||e[59]!==t?(kt=()=>{Rt.current=()=>{nn.current&&s({type:"input:rotate",sessionId:t,payload:{orientation:"portrait"}})}},Bt=[s,t],e[58]=s,e[59]=t,e[60]=kt,e[61]=Bt):(kt=e[60],Bt=e[61]),a.useEffect(kt,Bt);let Ct,Ft;e[62]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>()=>{var P;(P=Rt.current)==null||P.call(Rt)},Ft=[],e[62]=Ct,e[63]=Ft):(Ct=e[62],Ft=e[63]),a.useEffect(Ct,Ft);let qt;e[64]!==s||e[65]!==t?(qt=(P,W)=>{s({type:"input:key",sessionId:t,requestId:je(),payload:{code:P,modifiers:W}})},e[64]=s,e[65]=t,e[66]=qt):qt=e[66];const Zt=qt;let _t;e[67]!==N||e[68]!==I||e[69]!==O||e[70]!==s||e[71]!==Zt||e[72]!==t?(_t={sessionId:t,send:s,active:O,supported:I,handlerRef:N,sendChord:Zt,onError:la},e[67]=N,e[68]=I,e[69]=O,e[70]=s,e[71]=Zt,e[72]=t,e[73]=_t):_t=e[73],ws(_t);let Nt;e[74]!==d||e[75]!==L||e[76]!==_||e[77]!==s||e[78]!==t?(Nt={sessionId:t,send:s,supported:_,deviceReady:d,handlerRef:L,onError:oa},e[74]=d,e[75]=L,e[76]=_,e[77]=s,e[78]=t,e[79]=Nt):Nt=e[79];const Ke=ys(Nt);let it,ct;e[80]!==I||e[81]!==te||e[82]!==et||e[83]!==st||e[84]!==O||e[85]!==s||e[86]!==t?(it=()=>{const P=new Set(["ShiftLeft","ShiftRight","ControlLeft","ControlRight","MetaLeft","MetaRight"]),W=U=>{if(U.code==="AltLeft"||U.code==="AltRight"){Ie.current=!0;return}if(U.metaKey){const tt=document.activeElement;if(!tt||tt.tagName!=="INPUT"&&tt.tagName!=="TEXTAREA"){if(!U.shiftKey&&U.code==="KeyK"){U.preventDefault(),X(!0);return}if(!U.shiftKey&&U.code==="KeyS"){U.preventDefault(),st();return}if(U.shiftKey&&U.code==="KeyY"){U.preventDefault(),te();return}if(U.shiftKey&&U.code==="KeyO"){U.preventDefault(),U.repeat||et();return}}}if(!O||P.has(U.code)||I&&fr(U))return;U.preventDefault();const Ye=(U.shiftKey?2:0)|(U.ctrlKey?1:0)|(U.metaKey?8:0);s({type:"input:key",sessionId:t,requestId:je(),payload:{code:U.code,modifiers:Ye}})},ae=()=>{ve.current&&(ve.current=!1,ge(!1),s({type:"input:pinch:end",sessionId:t,requestId:je()})),Ie.current=!1,H(null)},A=U=>{(U.code==="AltLeft"||U.code==="AltRight")&&ae()},De=()=>{Ie.current&&ae()};return window.addEventListener("keydown",W),window.addEventListener("keyup",A),window.addEventListener("blur",De),()=>{window.removeEventListener("keydown",W),window.removeEventListener("keyup",A),window.removeEventListener("blur",De)}},ct=[O,I,s,t,st,te,et],e[80]=I,e[81]=te,e[82]=et,e[83]=st,e[84]=O,e[85]=s,e[86]=t,e[87]=it,e[88]=ct):(it=e[87],ct=e[88]),a.useEffect(it,ct);let Tt,dt;e[89]!==nt||e[90]!==O||e[91]!==Oe?(Tt=()=>{if(!O)return;const P=W=>{const ae=nt.current??Oe.current;ae&&!ae.contains(W.target)&&fe(!1)};return document.addEventListener("pointerdown",P),()=>document.removeEventListener("pointerdown",P)},dt=[O,nt,Oe],e[89]=nt,e[90]=O,e[91]=Oe,e[92]=Tt,e[93]=dt):(Tt=e[92],dt=e[93]),a.useEffect(Tt,dt);let Jt;e[94]!==yt||e[95]!==Oe?(Jt=P=>{const W=Oe.current;if(!W)return null;const ae=W.getBoundingClientRect();return ho({x:P.clientX,y:P.clientY},ae,yt.current)},e[94]=yt,e[95]=Oe,e[96]=Jt):Jt=e[96];const xe=Jt;let ut;e[97]!==xe?(ut=P=>{const W=xe(P);return W?Wr(W):null},e[97]=xe,e[98]=ut):ut=e[98];const Be=ut;let Et;e[99]!==s||e[100]!==t||e[101]!==xe||e[102]!==Be?(Et=P=>{if(Ie.current){const De=Be(P);if(!De)return;ve.current=!0,ge(!0),P.target.setPointerCapture(P.pointerId);const U=Ce.current;U&&(U.style.display="none"),H(De),s({type:"input:pinch:start",sessionId:t,payload:De});return}const W=xe(P);if(!W)return;fe(!0),qe.current=W,P.target.setPointerCapture(P.pointerId);const ae=P.currentTarget.getBoundingClientRect();Pe.current=W,we.current="down",Ge.current=null;const A=Ce.current;A&&(A.style.display="block",A.style.left=`${P.clientX-ae.left}px`,A.style.top=`${P.clientY-ae.top}px`,A.style.width=`${Yn*2}px`,A.style.height=`${Yn*2}px`,A.style.background="rgba(255,255,255,0.92)",A.style.border="1.5px solid rgba(0,0,0,0.2)",A.style.boxShadow="0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"),s({type:"input:touch:start",sessionId:t,payload:W})},e[99]=s,e[100]=t,e[101]=xe,e[102]=Be,e[103]=Et):Et=e[103];const v=Et;let Q;e[104]!==s||e[105]!==t||e[106]!==xe||e[107]!==Be?(Q=P=>{if(P.buttons===0){if(Ie.current){H(Be(P)),Pe.current=null;const mn=Ce.current;mn&&(mn.style.display="none");return}const tt=xe(P),gt=P.currentTarget.getBoundingClientRect(),Se=Ce.current;tt?(Pe.current=tt,we.current!=="down"&&(we.current="idle"),Se&&(Se.style.display="block",Se.style.left=`${P.clientX-gt.left}px`,Se.style.top=`${P.clientY-gt.top}px`,Se.style.width=`${Mn*2}px`,Se.style.height=`${Mn*2}px`,Se.style.background="transparent",Se.style.border="1.5px solid rgba(255,255,255,0.6)",Se.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)")):(Pe.current=null,Se&&(Se.style.display="none"));return}if(ve.current){const tt=Be(P);if(!tt)return;const gt=performance.now();if(gt-oe.current<Lr)return;oe.current=gt,H(tt),s({type:"input:pinch:move",sessionId:t,payload:tt});return}if(!qe.current)return;const W=xe(P);if(!W)return;const ae=W.x-qe.current.x,A=W.y-qe.current.y;if(Math.sqrt(ae*ae+A*A)<ta)return;const De=performance.now();if(De-oe.current<Lr)return;oe.current=De;const U=P.currentTarget.getBoundingClientRect();Pe.current=W;const Ye=Ce.current;Ye&&Ye.style.display!=="none"&&(Ye.style.left=`${P.clientX-U.left}px`,Ye.style.top=`${P.clientY-U.top}px`),s({type:"input:touch:move",sessionId:t,payload:W})},e[104]=s,e[105]=t,e[106]=xe,e[107]=Be,e[108]=Q):Q=e[108];const Ne=Q;let Ee;e[109]!==s||e[110]!==t?(Ee=()=>{if(ve.current){ve.current=!1,ge(!1),H(null),s({type:"input:pinch:end",sessionId:t,requestId:je()});return}qe.current=null,we.current="release",Ge.current={startTime:performance.now()};const P=Ce.current;P&&(P.style.width=`${Mn*2}px`,P.style.height=`${Mn*2}px`,P.style.background="transparent",P.style.border="1.5px solid rgba(255,255,255,0.6)",P.style.boxShadow="0 0 0 1px rgba(0,0,0,0.3)"),s({type:"input:touch:end",sessionId:t,requestId:je()})},e[109]=s,e[110]=t,e[111]=Ee):Ee=e[111];const Ae=Ee;let me;e[112]!==s||e[113]!==t?(me=()=>{if(ve.current){ve.current=!1,ge(!1),H(null),s({type:"input:pinch:end",sessionId:t,requestId:je()});return}qe.current=null,we.current="release",Ge.current={startTime:performance.now()},s({type:"input:touch:end",sessionId:t,requestId:je()})},e[112]=s,e[113]=t,e[114]=me):me=e[114];const Le=me;let vn;e[115]===Symbol.for("react.memo_cache_sentinel")?(vn=()=>{H(null),Pe.current=null;const P=Ce.current;P&&(P.style.display="none")},e[115]=vn):vn=e[115];const Kn=vn;let rn,_n;if(e[116]!==g||e[117]!==s||e[118]!==t){const P=["home","back","recent_apps"],W=["volume_up","volume_down","power"],ae=sa,A=De=>r.jsx(r.Fragment,{children:De.map(U=>g==null?void 0:g.find(Ye=>Ye.name===U)).filter(ra).map(U=>r.jsxs(Pt,{children:[r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":U.accessibilityTitle,onClick:()=>s({type:"input:button",sessionId:t,requestId:je(),payload:{name:U.name}}),children:ae(U.name)})}),r.jsx(Lt,{side:"left",children:U.accessibilityTitle})]},U.name))});rn=A(P),_n=A(W),e[116]=g,e[117]=s,e[118]=t,e[119]=rn,e[120]=_n}else rn=e[119],_n=e[120];const Nn=_n;let Fn;e[121]!==l||e[122]!==h||e[123]!==f||e[124]!==i||e[125]!==k?(Fn=h&&l?r.jsxs(Pt,{children:[r.jsx(At,{asChild:!0,children:r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-8 w-8",disabled:k||f,"aria-label":"Launch app",onClick:i,children:k?r.jsx(Hn,{className:"h-4 w-4 animate-spin"}):r.jsx(Jr,{className:"h-4 w-4"})})}),r.jsx(Lt,{side:"left",children:k?"Launching…":f?"Installing…":"Launch app"})]}):null,e[121]=l,e[122]=h,e[123]=f,e[124]=i,e[125]=k,e[126]=Fn):Fn=e[126];const Tn=Fn;let En;e[127]===Symbol.for("react.memo_cache_sentinel")?(En={display:"none"},e[127]=En):En=e[127];let un;e[128]!==re?(un=r.jsx("canvas",{ref:re,style:En}),e[128]=re,e[129]=un):un=e[129];let fn;e[130]!==K||e[131]!==o?(fn=r.jsx(vs,{open:K,onOpenChange:X,openUrl:o}),e[130]=K,e[131]=o,e[132]=fn):fn=e[132];let In;e[133]===Symbol.for("react.memo_cache_sentinel")?(In=()=>X(!0),e[133]=In):In=e[133];let zt;e[134]!==_e||e[135]!==pt||e[136]!==$?(zt=$&&$.postures.length>1?{postures:$.postures,currentId:$.currentId,pending:pt,onSelect:_e}:void 0,e[134]=_e,e[135]=pt,e[136]=$,e[137]=zt):zt=e[137];let sn;e[138]!==Ke||e[139]!==_?(sn=_?{position:Ke.position,steerable:Ke.steerable,reason:Ke.reason,pending:Ke.pending,onToggle:Ke.toggle}:void 0,e[138]=Ke,e[139]=_,e[140]=sn):sn=e[140];let Ut;e[141]!==D||e[142]!==x||e[143]!==w?(Ut={pending:x,onReboot:D,buttonRef:w},e[141]=D,e[142]=x,e[143]=w,e[144]=Ut):Ut=e[144];let on;e[145]!==Nn||e[146]!==te||e[147]!==et||e[148]!==st||e[149]!==u||e[150]!==Tn||e[151]!==rn||e[152]!==M||e[153]!==zt||e[154]!==sn||e[155]!==Ut?(on=r.jsx(xs,{joined:u,onDeepLink:In,onScreenshot:st,onRecordToggle:te,recordState:M,onRotate:et,posture:zt,navigationSlot:rn,deviceSlot:Nn,launchSlot:Tn,network:sn,reboot:Ut}),e[145]=Nn,e[146]=te,e[147]=et,e[148]=st,e[149]=u,e[150]=Tn,e[151]=rn,e[152]=M,e[153]=zt,e[154]=sn,e[155]=Ut,e[156]=on):on=e[156];let ln;e[157]!==Le||e[158]!==v||e[159]!==Ne||e[160]!==Ae?(ln={onPointerDown:v,onPointerMove:Ne,onPointerUp:Ae,onPointerCancel:Le,onPointerLeave:Kn},e[157]=Le,e[158]=v,e[159]=Ne,e[160]=Ae,e[161]=ln):ln=e[161];let Pn;e[162]===Symbol.for("react.memo_cache_sentinel")?(Pn=r.jsx("div",{ref:Ce,style:{display:"none",position:"absolute",zIndex:20,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease, box-shadow 0.1s ease"}}),e[162]=Pn):Pn=e[162];let Kt;e[163]!==ye||e[164]!==Re?(Kt=Re&&r.jsx(r.Fragment,{children:[Re.f0,Re.f1].map((P,W)=>r.jsx("div",{style:{position:"absolute",zIndex:10,borderRadius:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",transition:"width 0.1s ease, height 0.1s ease, background 0.1s ease",left:`${P.x*100}%`,top:`${P.y*100}%`,...ye?{width:Yn*2,height:Yn*2,background:"rgba(255,255,255,0.92)",border:"1.5px solid rgba(0,0,0,0.2)",boxShadow:"0 0 0 1px rgba(0,0,0,0.15), 0 0 8px rgba(255,255,255,0.25)"}:{width:Mn*2,height:Mn*2,background:"transparent",border:"1.5px solid rgba(255,255,255,0.6)",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)"}}},W))}),e[163]=ye,e[164]=Re,e[165]=Kt):Kt=e[165];let hn;e[166]!==Kt?(hn=r.jsxs(r.Fragment,{children:[Pn,Kt]}),e[166]=Kt,e[167]=hn):hn=e[167];let Wt;e[168]!==d||e[169]!==pt||e[170]!==$e||e[171]!==ln||e[172]!==hn?(Wt=r.jsx(po,{screen:$e,deviceReady:d,posturePending:pt,surfaceHandlers:ln,overlay:hn}),e[168]=d,e[169]=pt,e[170]=$e,e[171]=ln,e[172]=hn,e[173]=Wt):Wt=e[173];let pn;e[174]!==m||e[175]!==b||e[176]!==c||e[177]!==Xt||e[178]!==d||e[179]!==ne||e[180]!==p||e[181]!==f||e[182]!==u||e[183]!==O||e[184]!==S?(pn=r.jsx(ur,{joined:u,fps:ne,connected:c,deviceReady:d,bootError:m,bootWaiting:b,servicesOff:S,installing:f,installError:p,decoderUnsupported:Xt,keyboardActive:O}),e[174]=m,e[175]=b,e[176]=c,e[177]=Xt,e[178]=d,e[179]=ne,e[180]=p,e[181]=f,e[182]=u,e[183]=O,e[184]=S,e[185]=pn):pn=e[185];let Vt;e[186]!==Wt||e[187]!==pn?(Vt=r.jsxs("div",{className:"flex items-start gap-8",children:[Wt,pn]}),e[186]=Wt,e[187]=pn,e[188]=Vt):Vt=e[188];let an;return e[189]!==un||e[190]!==fn||e[191]!==on||e[192]!==Vt?(an=r.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[un,fn,on,Vt]}),e[189]=un,e[190]=fn,e[191]=on,e[192]=Vt,e[193]=an):an=e[193],an}function ra(n){return n!==void 0}function sa(n){return n==="back"?r.jsx(Io,{className:"h-4 w-4"}):n==="recent_apps"?r.jsx(Us,{className:"h-4 w-4"}):n==="volume_up"?r.jsx(pl,{className:"h-4 w-4"}):n==="volume_down"?r.jsx(hl,{className:"h-4 w-4"}):n==="power"?r.jsx(ll,{className:"h-4 w-4"}):r.jsx(Xr,{className:"h-4 w-4"})}function oa(n){return xt.error(n)}function la(n){return xt.error(n)}function aa(n){if(!n)return;const e=URL.createObjectURL(n),t=document.createElement("a");t.href=e,t.download=`tapflow-${Date.now()}.png`,t.click(),URL.revokeObjectURL(e)}function ia(n,e){const t=new DataView(n),l=Math.floor(n.byteLength/2),s=Math.floor(l/e),o=[];for(let i=0;i<e;i++)o.push(new Float32Array(s));for(let i=0;i<s;i++)for(let c=0;c<e;c++){const u=t.getInt16((i*e+c)*2,!0);o[c][i]=u/32768}return o}const ca=44100,lr=2,Dr=.06,da=.3;function ua(){const n=de.c(5),e=a.useRef(null),t=a.useRef(0);let l;n[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{if(e.current)return e.current;const f=window.AudioContext??window.webkitAudioContext;return f?(e.current=new f,e.current):null},n[0]=l):l=n[0];const s=l;let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o=f=>{var R;const h=s();if(!h)return;h.state==="suspended"&&h.resume();const p=ia(f,lr),m=((R=p[0])==null?void 0:R.length)??0;if(m===0)return;const b=h.createBuffer(lr,m,ca);for(let N=0;N<lr;N++)b.getChannelData(N).set(p[N]);const S=h.createBufferSource();S.buffer=b,S.connect(h.destination);const k=h.currentTime;let g=t.current;(g<k+.005||g>k+da+Dr)&&(g=k+Dr),S.start(g),t.current=g+b.duration},n[1]=o):o=n[1];const i=o;let c,u;n[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>()=>{var f;(f=e.current)==null||f.close(),e.current=null},u=[],n[2]=c,n[3]=u):(c=n[2],u=n[3]),a.useEffect(c,u);let d;return n[4]===Symbol.for("react.memo_cache_sentinel")?(d={pushFrame:i},n[4]=d):d=n[4],d}const fa=2e4;function ha(n){const e=de.c(32),{sessionId:t,deviceId:l,deviceReady:s,send:o,handlerRef:i,onShutdownComplete:c,onError:u}=n,[d,f]=a.useState(!1),h=a.useRef(null),p=a.useRef(c),m=a.useRef(u);let b,S;e[0]!==c?(b=()=>{p.current=c},S=[c],e[0]=c,e[1]=b,e[2]=S):(b=e[1],S=e[2]),a.useEffect(b,S);let k,g;e[3]!==u?(k=()=>{m.current=u},g=[u],e[3]=u,e[4]=k,e[5]=g):(k=e[4],g=e[5]),a.useEffect(k,g);let R;e[6]!==s||e[7]!==t?(R={sessionId:t,deviceReady:s},e[6]=s,e[7]=t,e[8]=R):R=e[8];const[N,I]=a.useState(R);(N.sessionId!==t||N.deviceReady!==s)&&(I({sessionId:t,deviceReady:s}),(N.sessionId!==t||!s)&&f(!1));let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{h.current=null},e[9]=L):L=e[9];let _;e[10]!==t?(_=[t],e[10]=t,e[11]=_):_=e[11],a.useEffect(L,_);let y,x;e[12]!==s?(y=()=>{s||(h.current=null)},x=[s],e[12]=s,e[13]=y,e[14]=x):(y=e[13],x=e[14]),a.useEffect(y,x);let D,w;e[15]!==i?(D=()=>(i.current=Y=>{if(Y.requestId===h.current){if(h.current=null,f(!1),Y.type==="device:shutdown-error"){m.current(`The device was not restarted. ${Y.message}`);return}p.current()}},()=>{i.current=void 0}),w=[i],e[15]=i,e[16]=D,e[17]=w):(D=e[16],w=e[17]),a.useEffect(D,w);const[E,F]=a.useState(null);let z,$;e[18]!==d?(z=()=>{F(d?h.current:null)},$=[d],e[18]=d,e[19]=z,e[20]=$):(z=e[19],$=e[20]),a.useEffect(z,$);let Z,V;e[21]!==E?(Z=()=>{if(E===null)return;const Y=setTimeout(()=>{h.current===E&&(f(!1),m.current("The device has not answered the restart yet. If its answer arrives tapflow will finish restarting it; if nothing changes, press Restart again."))},fa);return()=>clearTimeout(Y)},V=[E],e[21]=E,e[22]=Z,e[23]=V):(Z=e[22],V=e[23]),a.useEffect(Z,V);let B;e[24]!==l||e[25]!==d||e[26]!==o||e[27]!==t?(B=()=>{if(d)return;const Y=je();h.current=Y,f(!0),o({type:"device:shutdown",sessionId:t,requestId:Y,payload:{deviceId:l}})},e[24]=l,e[25]=d,e[26]=o,e[27]=t,e[28]=B):B=e[28];const ne=B;let ee;return e[29]!==d||e[30]!==ne?(ee={pending:d,reboot:ne},e[29]=d,e[30]=ne,e[31]=ee):ee=e[31],ee}const Mr={"channel-unavailable":{title:"Input is not reaching this device",action:"Rejoin the session to continue."},"not-booted":{title:"The device is not running",action:"Start it again to continue testing."},"dispatch-failed":{title:"The device rejected that input",action:"Try once more. If it keeps failing, restart the device."},unsupported:{title:"That input is not supported on this device",action:"Everything else still works — this one has no equivalent here."},malformed:{title:"tapflow sent a malformed input",action:"This is a bug in tapflow — please report it with what you were doing."},"channel-starting":null,"no-gesture":null,"not-session-owner":{title:"This session is no longer yours",action:"Go back and open the device again — another tester may have taken it. Nothing you just did reached the device."}};function pa(n){const e=n!==void 0&&Object.hasOwn(Mr,n)?n:"channel-unavailable";return{key:e,notice:Mr[e]}}function ma(n){const e=de.c(129),{sessionId:t,deviceId:l,formFactor:s,platform:o,buildId:i,resetMode:c,onRecordingUploaded:u,onSessionEnded:d}=n,f=o===void 0?"ios":o,h=a.useRef(xa),p=a.useRef(!1);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={pending:0,appInstalled:!1},e[0]=m):m=e[0];const b=a.useRef(m),{perfMode:S,visible:k}=Sl(),g=a.useRef(null),R=a.useRef(null);let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[1]=N):N=e[1];const I=a.useRef(N);let L;e[2]===Symbol.for("react.memo_cache_sentinel")?(L={onFrameBegin:()=>{var v;return(v=g.current)==null?void 0:v.onFrameBegin()},onFrameEnd:v=>{var Ee,Ae;const Q=I.current.shift()??null,Ne=Q?{...v,capturedAt:Q.capturedAt,relayedAt:Q.relayedAt}:v;(Ee=g.current)==null||Ee.onFrameEnd(Ne),(Ae=R.current)==null||Ae.call(R,Ne)}},e[2]=L):L=e[2],a.useRef(L);const[_,y]=a.useState(!1),[x,D]=a.useState(!1),[w,E]=a.useState(!1),[F,z]=a.useState(null),[$,Z]=a.useState(null);let V;e[3]===Symbol.for("react.memo_cache_sentinel")?(V=v=>{Z(Q=>Q&&Q.width===v.width&&Q.height===v.height?Q:v)},e[3]=V):V=e[3];const B=V;let ne;e[4]===Symbol.for("react.memo_cache_sentinel")?(ne={postures:[],currentId:null},e[4]=ne):ne=e[4];const[ee,Y]=a.useState(ne),[M,re]=a.useState(!1),[ie,be]=a.useState(!1),[ue,K]=a.useState(null),[X,he]=a.useState(null),[J,O]=a.useState(null),[fe,ye]=a.useState(!1),[ge,Re]=a.useState(!1);let H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=[],e[5]=H):H=e[5];const[G,ce]=a.useState(H);let pe;e[6]===Symbol.for("react.memo_cache_sentinel")?(pe=new Set,e[6]=pe):pe=e[6];const ve=a.useRef(pe),Ie=a.useRef(null);let qe;e[7]===Symbol.for("react.memo_cache_sentinel")?(qe=new Set,e[7]=qe):qe=e[7];const oe=a.useRef(qe);let Ce;e[8]===Symbol.for("react.memo_cache_sentinel")?(Ce=new Set,e[8]=Ce):Ce=e[8];const Pe=a.useRef(Ce);let we;e[9]===Symbol.for("react.memo_cache_sentinel")?(we=new Set,e[9]=we):we=e[9];const Ge=a.useRef(we),[We,Qe]=a.useState(!1),[Ue,$e]=a.useState(!1),Oe=a.useRef(null);let nt,Ze;e[10]===Symbol.for("react.memo_cache_sentinel")?(nt=()=>()=>{Oe.current&&clearTimeout(Oe.current)},Ze=[],e[10]=nt,e[11]=Ze):(nt=e[10],Ze=e[11]),a.useEffect(nt,Ze);const He=a.useRef(void 0),yt=a.useRef(void 0),Xt=a.useRef(void 0),Je=a.useRef(void 0);let vt;e[12]!==l||e[13]!==t?(vt=v=>{const Q=je();ve.current.add(Q),Ie.current=Q,h.current({type:"device:boot",sessionId:t,requestId:Q,payload:{deviceId:l,resetMode:v,acceptH264:bo(),secureContext:window.isSecureContext}})},e[12]=l,e[13]=t,e[14]=vt):vt=e[14];const rt=vt,{pushFrame:Dt}=ua();let wt;e[15]!==x||e[16]!==i||e[17]!==ie||e[18]!==d||e[19]!==c||e[20]!==rt||e[21]!==t?(wt=v=>{var Q,Ne,Ee,Ae;if(!("sessionId"in v&&v.sessionId!==t)){if(v.type==="session:joined"){b.current={pending:0,appInstalled:!1},y(!0),D(!1),ce(v.capabilities??[]);const me=p.current?"app-only":c;p.current=!0,ve.current.clear(),rt(me)}if(v.type==="session:agent-away"){D(!0),z(null),E(!1);return}if(v.type==="session:terminated"){d==null||d(v.reason);return}if(v.type==="session:rebound"){E(!1),z(null),re(!1),K(null),he(null),O(null),Re(!1),$e(!1),Oe.current&&clearTimeout(Oe.current),Qe(!1),I.current=[],ce(v.capabilities);const me=x;D(!1),b.current={pending:b.current.pending+1,appInstalled:b.current.pending>0?b.current.appInstalled:ie},p.current=!0,rt("app-only"),me||xt.info("The agent restarted — reconnecting to the device.");return}if(v.type==="device:boot-error"){if(v.requestId!==void 0&&v.requestId!==Ie.current||x)return;b.current={pending:0,appInstalled:!1},O(null),he(v.message)}if(v.type==="device:boot-waiting"&&v.requestId===Ie.current&&(O(v.reason??"host-booting"),E(!1),he(null)),v.type==="input:error"){if(x)return;const{key:me,notice:Le}=pa(v.reason);v.reason!==void 0&&v.reason!==me&&console.debug(`[tapflow] unrecognised input:error reason "${v.reason}", treated as ${me}`),Le?xt.error(Le.title,{id:`input:${t}:${me}`,description:v.message?`${Le.action} (${v.message})`:Le.action,duration:6e3}):console.debug(`[tapflow] input refused, shown nowhere: ${me}${v.message?` — ${v.message}`:""}`)}if(v.type==="device:booting"&&(O(null),ye(!1),E(!1),re(!1),be(!1),K(null),he(null),Y({postures:[],currentId:null}),Pe.current.clear(),Ge.current.clear(),z(null)),v.type==="device:ready"){if(E(!0),O(null),v.requestId!==void 0&&!ve.current.delete(v.requestId))return;const me=(Q=v.payload)==null?void 0:Q.serviceTier;if(me!==void 0&&ye(me!=="unsupported"&&me.name==="slim"),b.current.pending>0){const{appInstalled:Le}=b.current;if(b.current={pending:b.current.pending-1,appInstalled:Le},Le){be(!0);return}}if(i){re(!0);const Le=je();Pe.current.add(Le),h.current({type:"app:install",sessionId:t,requestId:Le,buildId:i})}}if(v.type==="app:install-done"||v.type==="app:install-error"){if(!Pe.current.delete(v.requestId))return;re(!1),v.type==="app:install-done"?be(!0):K(v.message)}if(v.type==="app:launch-done"||v.type==="app:launch-error"){if(!Ge.current.delete(v.requestId))return;Re(!1),v.type==="app:launch-error"&&xt.error("The app did not launch",{description:v.message})}if(v.type==="session:chrome"&&z(v.payload),v.type==="device:postures"&&Y(v.payload),v.type==="keyboard:toggled"){const{visible:me}=v.payload;Qe(me),$e(!1),Oe.current&&clearTimeout(Oe.current)}if(v.type==="network:state"||v.type==="network:error"){(Ne=Xt.current)==null||Ne.call(Xt,v);return}if(v.type==="device:shutdown-done"||v.type==="device:shutdown-error"){(Ee=Je.current)==null||Ee.call(Je,v);return}if((v.type==="clipboard:data"||v.type==="clipboard:write-done"||v.type==="clipboard:error")&&((Ae=yt.current)==null||Ae.call(yt,v)),v.type==="open-url:done"||v.type==="open-url:error"){if(!oe.current.delete(v.requestId))return;v.type==="open-url:done"?xt.success("Deeplink opened"):xt.error(v.message)}if(v.type==="error")switch(v.reason){case"session-not-found":{d==null||d("agent-disconnected");return}case"session-busy":{d==null||d("busy-elsewhere");return}case"agent-resources-exhausted":{d==null||d("mac-overloaded");return}}}},e[15]=x,e[16]=i,e[17]=ie,e[18]=d,e[19]=c,e[20]=rt,e[21]=t,e[22]=wt):wt=e[22];const Mt=wt;let st;e[23]!==Dt?(st=v=>{var Ae;const Q=xo(v);if(Q&&Q.codec===yo){Dt(v.slice(jr));return}Q&&Q.codec===vo||I.current.push(Q);const Ne=Q?v.slice(jr):v,Ee=Q?{codec:Q.codec,keyframe:Q.keyframe,capturedAt:Q.capturedAt,relayedAt:Q.relayedAt}:void 0;(Ae=He.current)==null||Ae.call(He,Ne,Ee)},e[23]=Dt,e[24]=st):st=e[24];const en=st,{send:te,connected:le}=Ur(Mt,en);let tn;e[25]!==te?(tn=()=>{h.current=te},e[25]=te,e[26]=tn):tn=e[26],a.useLayoutEffect(tn);let pt,Gt;e[27]!==le||e[28]!==te||e[29]!==t?(pt=()=>{le&&te({type:"session:start",sessionId:t,clientKind:"dashboard"})},Gt=[le,te,t],e[27]=le,e[28]=te,e[29]=t,e[30]=pt,e[31]=Gt):(pt=e[30],Gt=e[31]),a.useEffect(pt,Gt);const $t=F!==null&&"framePng"in F?F:null,_e=F!==null&&!("framePng"in F)?F:null;let St;e[32]!==_e||e[33]!==w||e[34]!==s||e[35]!==f||e[36]!==$t||e[37]!==$?(St=$t??(w&&f==="ios"&&!_e?go($??Rr(s,f)):null),e[32]=_e,e[33]=w,e[34]=s,e[35]=f,e[36]=$t,e[37]=$,e[38]=St):St=e[38];const Ve=St;let jt;e[39]!==te||e[40]!==t?(jt=()=>{$e(!0),Oe.current&&clearTimeout(Oe.current),Oe.current=setTimeout(()=>{$e(!1),xt.error("The device did not answer. The software keyboard is where it was, as far as tapflow can tell.")},8e3),te({type:"input:keyboard:toggle",sessionId:t})},e[39]=te,e[40]=t,e[41]=jt):jt=e[41];const Ot=jt;let mt;e[42]!==t?(mt=v=>{const Q=je();oe.current.add(Q),h.current({type:"open-url",sessionId:t,requestId:Q,payload:{url:v}})},e[42]=t,e[43]=mt):mt=e[43];const Ht=mt;let ot;e[44]!==i||e[45]!==t?(ot=()=>{if(i===void 0)return;const v=je();Ge.current.add(v),Re(!0),h.current({type:"app:launch",sessionId:t,requestId:v,buildId:i})},e[44]=i,e[45]=t,e[46]=ot):ot=e[46];const nn=ot,Qt=a.useRef(null),et=a.useRef(!1),Rt=a.useRef(!1);let kt;e[47]!==rt?(kt=()=>{Rt.current=!0,rt("app-only")},e[47]=rt,e[48]=kt):kt=e[48];const Bt=kt;let Ct;e[49]!==l||e[50]!==w||e[51]!==te||e[52]!==t||e[53]!==Bt?(Ct={sessionId:t,deviceId:l,deviceReady:w,send:te,handlerRef:Je,onShutdownComplete:Bt,onError:ba},e[49]=l,e[50]=w,e[51]=te,e[52]=t,e[53]=Bt,e[54]=Ct):Ct=e[54];const{pending:Ft,reboot:qt}=ha(Ct);let Zt,_t;e[55]!==_e||e[56]!==Ve?(Zt=()=>{var Ne;const v=!!(Ve??_e),Q=!et.current&&v;et.current=v,!(!Q||!Rt.current)&&(Rt.current=!1,document.activeElement===document.body&&((Ne=Qt.current)==null||Ne.focus()))},_t=[Ve,_e],e[55]=_e,e[56]=Ve,e[57]=Zt,e[58]=_t):(Zt=e[57],_t=e[58]),a.useEffect(Zt,_t);let Nt,Ke;e[59]!==x||e[60]!==X?(Nt=()=>{(X||x)&&(Rt.current=!1)},Ke=[X,x],e[59]=x,e[60]=X,e[61]=Nt,e[62]=Ke):(Nt=e[61],Ke=e[62]),a.useEffect(Nt,Ke);let it;e[63]!==G?(it=G.includes("clipboard"),e[63]=G,e[64]=it):it=e[64];let ct;e[65]!==G?(ct=G.includes("network-control"),e[65]=G,e[66]=ct):ct=e[66];let Tt;e[67]!==X||e[68]!==J||e[69]!==i||e[70]!==le||e[71]!==w||e[72]!==ue||e[73]!==ie||e[74]!==M||e[75]!==_||e[76]!==nn||e[77]!==ge||e[78]!==Ot||e[79]!==u||e[80]!==Ht||e[81]!==qt||e[82]!==Ft||e[83]!==te||e[84]!==fe||e[85]!==t||e[86]!==Ue||e[87]!==We||e[88]!==it||e[89]!==ct?(Tt={sessionId:t,buildId:i,send:te,openUrl:Ht,launchApp:nn,connected:le,joined:_,deviceReady:w,installing:M,installed:ie,installError:ue,bootError:X,bootWaiting:J,servicesOff:fe,launching:ge,binaryFrameHandlerRef:He,clipboardHandlerRef:yt,clipboardSupported:it,networkHandlerRef:Xt,networkSupported:ct,onRecordingUploaded:u,swKeyboardVisible:We,swKeyboardPending:Ue,onKbdToggle:Ot,rebootPending:Ft,onReboot:qt,restartButtonRef:Qt},e[67]=X,e[68]=J,e[69]=i,e[70]=le,e[71]=w,e[72]=ue,e[73]=ie,e[74]=M,e[75]=_,e[76]=nn,e[77]=ge,e[78]=Ot,e[79]=u,e[80]=Ht,e[81]=qt,e[82]=Ft,e[83]=te,e[84]=fe,e[85]=t,e[86]=Ue,e[87]=We,e[88]=it,e[89]=ct,e[90]=Tt):Tt=e[90];const dt=Tt;if(!Ve&&!_e){let v;e[91]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx("div",{"aria-hidden":"true",className:"flex flex-col items-center gap-0.5 rounded-2xl border bg-background/90 px-1.5 py-2.5 shrink-0 mt-3 opacity-40",children:Array.from({length:5}).map(ga)}),e[91]=v):v=e[91];let Q;e[92]===Symbol.for("react.memo_cache_sentinel")?(Q={background:"#1c1c1e",borderRadius:"34px",padding:"12px",flexShrink:0},e[92]=Q):Q=e[92];let Ne;e[93]!==s||e[94]!==f?(Ne=Rr(s,f),e[93]=s,e[94]=f,e[95]=Ne):Ne=e[95];let Ee;e[96]!==Ne?(Ee=r.jsx("div",{"aria-hidden":"true",style:Q,children:r.jsx("div",{"data-testid":"device-skeleton",className:"animate-pulse bg-zinc-700",style:{...Ne,borderRadius:"22px"}})}),e[96]=Ne,e[97]=Ee):Ee=e[97];let Ae;e[98]!==x||e[99]!==X||e[100]!==J||e[101]!==le||e[102]!==w||e[103]!==ue||e[104]!==M||e[105]!==_||e[106]!==fe?(Ae=r.jsx(ur,{joined:_,fps:0,connected:le,deviceReady:w,bootError:X,bootWaiting:J,servicesOff:fe,installing:M,installError:ue,decoderUnsupported:!1,keyboardActive:!1,agentAway:x}),e[98]=x,e[99]=X,e[100]=J,e[101]=le,e[102]=w,e[103]=ue,e[104]=M,e[105]=_,e[106]=fe,e[107]=Ae):Ae=e[107];let me;e[108]!==Ee||e[109]!==Ae?(me=r.jsxs("div",{className:"flex items-start gap-8",children:[Ee,Ae]}),e[108]=Ee,e[109]=Ae,e[110]=me):me=e[110];let Le;return e[111]!==v||e[112]!==me?(Le=r.jsxs("div",{role:"region","aria-label":"Device screen",className:"flex items-start justify-center gap-16",children:[v,me]}),e[111]=v,e[112]=me,e[113]=Le):Le=e[113],Le}const Jt=void 0;let xe;e[114]!==dt||e[115]!==s||e[116]!==Ve?(xe=Ve&&r.jsx(Ql,{...dt,chrome:Ve,formFactor:s,perfHookRef:Jt,onStreamSize:B}),e[114]=dt,e[115]=s,e[116]=Ve,e[117]=xe):xe=e[117];let ut;e[118]!==_e||e[119]!==dt||e[120]!==ee?(ut=_e&&r.jsx(na,{...dt,androidButtons:_e.buttons,screenWidth:_e.screenWidth,screenHeight:_e.screenHeight,cornerRadius:_e.cornerRadius,postures:ee,streamRotation:_e.streamRotation,perfHookRef:Jt}),e[118]=_e,e[119]=dt,e[120]=ee,e[121]=ut):ut=e[121];let Be;e[122]!==S||e[123]!==k?(Be=!1,e[122]=S,e[123]=k,e[124]=Be):Be=e[124];let Et;return e[125]!==xe||e[126]!==ut||e[127]!==Be?(Et=r.jsxs(r.Fragment,{children:[xe,ut,Be]}),e[125]=xe,e[126]=ut,e[127]=Be,e[128]=Et):Et=e[128],Et}function ga(n,e){return r.jsx("div",{className:"h-8 w-8 rounded-md bg-muted animate-pulse"},e)}function ba(n){xt.error(n)}function xa(){}const Ss=a.forwardRef((n,e)=>{const t=de.c(9);let l,s;t[0]!==n?({className:l,...s}=n,t[0]=n,t[1]=l,t[2]=s):(l=t[1],s=t[2]);let o;t[3]!==l?(o=Fe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",l),t[3]=l,t[4]=o):o=t[4];let i;return t[5]!==s||t[6]!==e||t[7]!==o?(i=r.jsx("textarea",{className:o,ref:e,...s}),t[5]=s,t[6]=e,t[7]=o,t[8]=i):i=t[8],i});Ss.displayName="Textarea";var ya=Object.defineProperty,se=(n,e)=>ya(n,"name",{value:e,configurable:!0});function js(n,e){return a.useReducer((t,l)=>e[t][l]??t,n)}se(js,"useStateMachine");var zn={Auto:"auto",Always:"always",Scroll:"scroll",Hover:"hover"},Un={Vertical:"vertical",Horizontal:"horizontal"},yn={LTR:"ltr",RTL:"rtl"},Rs="ScrollArea",[ks,ji]=Fr(Rs),[va,Yt]=ks(Rs),Cs=a.forwardRef(se(function(e,t){const{__scopeScrollArea:l,type:s=zn.Hover,dir:o,scrollHideDelay:i=600,...c}=e,[u,d]=a.useState(null),[f,h]=a.useState(null),[p,m]=a.useState(null),[b,S]=a.useState(null),[k,g]=a.useState(null),[R,N]=a.useState(0),[I,L]=a.useState(0),[_,y]=a.useState(!1),[x,D]=a.useState(!1),w=Rn(t,d),E=Vs(o);return r.jsx(va,{scope:l,type:s,dir:E,scrollHideDelay:i,scrollArea:u,viewport:f,onViewportChange:h,content:p,onContentChange:m,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:_,onScrollbarXEnabledChange:y,scrollbarY:k,onScrollbarYChange:g,scrollbarYEnabled:x,onScrollbarYEnabledChange:D,onCornerWidthChange:N,onCornerHeightChange:L,children:r.jsx(kn.div,{dir:E,...c,ref:w,style:{position:"relative","--radix-scroll-area-corner-width":R+"px","--radix-scroll-area-corner-height":I+"px",...e.style}})})},"ScrollArea")),_s="ScrollAreaViewport",$r=Ks(_s),wa=a.forwardRef(se(function(e,t){const{__scopeScrollArea:l,children:s,nonce:o,disableImplicitContentElement:i,...c}=e,u=Yt(_s,l),d=a.useRef(null),f=Rn(t,d,u.onViewportChange),h=a.isValidElement(s);return r.jsxs(r.Fragment,{children:[r.jsx(Sa,{nonce:o}),r.jsx(kn.div,{"data-radix-scroll-area-viewport":"",...c,ref:f,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i?s:h?r.jsx($r,{child:s,children:p=>r.jsx(Or,{__scopeScrollArea:l,children:p})}):r.jsx($r,{children:r.jsx(Or,{__scopeScrollArea:l,children:s})})})]})},"ScrollAreaViewport")),Sa=a.memo(se(function({nonce:e}){return r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e})},"ScrollAreaViewportStyle"),(n,e)=>n.nonce===e.nonce),ja="ScrollAreaContent",Or=a.forwardRef(se(function(e,t){const{__scopeScrollArea:l,children:s,...o}=e,i=Yt(ja,l),c=Rn(t,i.onContentChange);return r.jsx(kn.div,{...o,ref:c,style:{minWidth:"100%",display:"table",...e.style},children:s})},"ScrollAreaContent")),Cn="ScrollAreaScrollbar",Ns=a.forwardRef(se(function(e,t){const{forceMount:l,...s}=e,o=Yt(Cn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:c}=o,u=e.orientation===Un.Horizontal;return a.useEffect(()=>(u?i(!0):c(!0),()=>{u?i(!1):c(!1)}),[u,i,c]),o.type===zn.Hover?r.jsx(Ra,{...s,ref:t,forceMount:l}):o.type===zn.Scroll?r.jsx(ka,{...s,ref:t,forceMount:l}):o.type===zn.Auto?r.jsx(Ts,{...s,ref:t,forceMount:l}):o.type===zn.Always?r.jsx(hr,{...s,ref:t,"data-state":"visible"}):null},"ScrollAreaScrollbar")),Ra=a.forwardRef(se(function(e,t){const{forceMount:l,...s}=e,o=Yt(Cn,e.__scopeScrollArea),[i,c]=a.useState(!1);return a.useEffect(()=>{const u=o.scrollArea;let d=0;if(u){const f=se(()=>{window.clearTimeout(d),c(!0)},"handlePointerEnter"),h=se(()=>{d=window.setTimeout(()=>c(!1),o.scrollHideDelay)},"handlePointerLeave");return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),r.jsx(sr,{present:l||i,children:r.jsx(Ts,{"data-state":i?"visible":"hidden",...s,ref:t})})},"ScrollAreaScrollbarHover")),ka=a.forwardRef(se(function(e,t){const{forceMount:l,...s}=e,o=Yt(Cn,e.__scopeScrollArea),i=e.orientation===Un.Horizontal,c=Zn(()=>d("SCROLL_END"),100),[u,d]=js("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,o.scrollHideDelay,d]),a.useEffect(()=>{const f=o.viewport,h=i?"scrollLeft":"scrollTop";if(f){let p=f[h];const m=se(()=>{const b=f[h];p!==b&&(d("SCROLL"),c()),p=b},"handleScroll");return f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[o.viewport,i,d,c]),r.jsx(sr,{present:l||u!=="hidden",children:r.jsx(hr,{"data-state":u==="hidden"?"hidden":"visible",...s,ref:t,onPointerEnter:jn(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:jn(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),Ts=a.forwardRef(se(function(e,t){const l=Yt(Cn,e.__scopeScrollArea),{forceMount:s,...o}=e,[i,c]=a.useState(!1),u=e.orientation===Un.Horizontal,d=Zn(()=>{if(l.viewport){const f=l.viewport.offsetWidth<l.viewport.scrollWidth,h=l.viewport.offsetHeight<l.viewport.scrollHeight;c(u?f:h)}},10);return Bn(l.viewport,d),Bn(l.content,d),r.jsx(sr,{present:s||i,children:r.jsx(hr,{"data-state":i?"visible":"hidden",...o,ref:t})})},"ScrollAreaScrollbarAuto")),hr=a.forwardRef(se(function(e,t){const{orientation:l=Un.Vertical,...s}=e,o=Yt(Cn,e.__scopeScrollArea),i=a.useRef(null),c=a.useRef(0),[u,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=pr(u.viewport,u.content),h={...s,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:se(m=>i.current=m,"onThumbChange"),onThumbPointerUp:se(()=>c.current=0,"onThumbPointerUp"),onThumbPointerDown:se(m=>c.current=m,"onThumbPointerDown")};function p(m,b){return As(m,c.current,u,b)}return se(p,"getScrollPosition"),l===Un.Horizontal?r.jsx(Ca,{...h,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollLeft,b=dr(m,u,o.dir);i.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=p(m,o.dir))}}):l===Un.Vertical?r.jsx(_a,{...h,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const m=o.viewport.scrollTop,b=dr(m,u);i.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=p(m))}}):null},"ScrollAreaScrollbarVisible")),Ca=a.forwardRef(se(function(e,t){const{sizes:l,onSizesChange:s,...o}=e,i=Yt(Cn,e.__scopeScrollArea),[c,u]=a.useState(),d=a.useRef(null),f=Rn(t,d,i.onScrollbarXChange);return a.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),r.jsx(Is,{"data-orientation":"horizontal",...o,ref:f,sizes:l,style:{bottom:0,left:i.dir===yn.RTL?"var(--radix-scroll-area-corner-width)":0,right:i.dir===yn.LTR?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Qn(l)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const m=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(m),gr(m,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&c&&s({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Gn(c.paddingLeft),paddingEnd:Gn(c.paddingRight)}})}})},"ScrollAreaScrollbarX")),_a=a.forwardRef(se(function(e,t){const{sizes:l,onSizesChange:s,...o}=e,i=Yt(Cn,e.__scopeScrollArea),[c,u]=a.useState(),d=a.useRef(null),f=Rn(t,d,i.onScrollbarYChange);return a.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),r.jsx(Is,{"data-orientation":"vertical",...o,ref:f,sizes:l,style:{top:0,right:i.dir===yn.LTR?0:void 0,left:i.dir===yn.RTL?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Qn(l)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const m=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(m),gr(m,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&c&&s({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Gn(c.paddingTop),paddingEnd:Gn(c.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[Na,Es]=ks(Cn),Is=a.forwardRef(se(function(e,t){const{__scopeScrollArea:l,sizes:s,hasThumb:o,onThumbChange:i,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...m}=e,b=Yt(Cn,l),[S,k]=a.useState(null),g=Rn(t,k),R=a.useRef(null),N=a.useRef(""),I=b.viewport,L=s.content-s.viewport,_=On(h),y=On(d),x=Zn(p,10);function D(w){if(R.current){const E=w.clientX-R.current.left,F=w.clientY-R.current.top;f({x:E,y:F})}}return se(D,"handleDragScroll"),a.useEffect(()=>{const w=se(E=>{const F=E.target;(S==null?void 0:S.contains(F))&&_(E,L)},"handleWheel");return document.addEventListener("wheel",w,{passive:!1}),()=>document.removeEventListener("wheel",w,{passive:!1})},[I,S,L,_]),a.useEffect(y,[s,y]),Bn(S,x),Bn(b.content,x),r.jsx(Na,{scope:l,scrollbar:S,hasThumb:o,onThumbChange:On(i),onThumbPointerUp:On(c),onThumbPositionChange:y,onThumbPointerDown:On(u),children:r.jsx(kn.div,{...m,ref:g,style:{position:"absolute",...m.style},onPointerDown:jn(e.onPointerDown,w=>{w.button===0&&(w.target.setPointerCapture(w.pointerId),R.current=S.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),D(w))}),onPointerMove:jn(e.onPointerMove,D),onPointerUp:jn(e.onPointerUp,w=>{const E=w.target;E.hasPointerCapture(w.pointerId)&&E.releasePointerCapture(w.pointerId),document.body.style.webkitUserSelect=N.current,b.viewport&&(b.viewport.style.scrollBehavior=""),R.current=null})})})},"ScrollAreaScrollbarImpl")),cr="ScrollAreaThumb",Ta=a.forwardRef(se(function(e,t){const{forceMount:l,...s}=e,o=Es(cr,e.__scopeScrollArea);return r.jsx(sr,{present:l||o.hasThumb,children:r.jsx(Ea,{ref:t,...s})})},"ScrollAreaThumb")),Ea=a.forwardRef(se(function(e,t){const{__scopeScrollArea:l,style:s,...o}=e,i=Yt(cr,l),c=Es(cr,l),{onThumbPositionChange:u}=c,d=Rn(t,c.onThumbChange),f=a.useRef(void 0),h=Zn(()=>{f.current&&(f.current(),f.current=void 0)},100);return a.useEffect(()=>{const p=i.viewport;if(p){const m=se(()=>{if(h(),!f.current){const b=Aa(p,u);f.current=b,u()}},"handleScroll");return u(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[i.viewport,h,u]),r.jsx(kn.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:jn(e.onPointerDownCapture,p=>{const b=p.target.getBoundingClientRect(),S=p.clientX-b.left,k=p.clientY-b.top;c.onThumbPointerDown({x:S,y:k})}),onPointerUp:jn(e.onPointerUp,c.onThumbPointerUp)})},"ScrollAreaThumbImpl")),Ps="ScrollAreaCorner",Ia=a.forwardRef(se(function(e,t){const l=Yt(Ps,e.__scopeScrollArea),s=!!(l.scrollbarX&&l.scrollbarY);return l.type!==zn.Scroll&&s?r.jsx(Pa,{...e,ref:t}):null},"ScrollAreaCorner")),Pa=a.forwardRef(se(function(e,t){const{__scopeScrollArea:l,...s}=e,o=Yt(Ps,l),[i,c]=a.useState(0),[u,d]=a.useState(0),f=!!(i&&u),{onCornerWidthChange:h,onCornerHeightChange:p}=o;return Bn(o.scrollbarX,()=>{var b;const m=((b=o.scrollbarX)==null?void 0:b.offsetHeight)||0;o.onCornerHeightChange(m),d(m)}),Bn(o.scrollbarY,()=>{var b;const m=((b=o.scrollbarY)==null?void 0:b.offsetWidth)||0;o.onCornerWidthChange(m),c(m)}),a.useEffect(()=>()=>{h(0),p(0)},[h,p]),f?r.jsx(kn.div,{...s,ref:t,style:{width:i,height:u,position:"absolute",right:o.dir===yn.LTR?0:void 0,left:o.dir===yn.RTL?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function Gn(n){return n?parseInt(n,10):0}se(Gn,"toInt");function pr(n,e){const t=n/e;return isNaN(t)?0:t}se(pr,"getThumbRatio");function Qn(n){const e=pr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,l=(n.scrollbar.size-t)*e;return Math.max(l,18)}se(Qn,"getThumbSize");function As(n,e,t,l=yn.LTR){const s=Qn(t),o=s/2,i=e||o,c=s-i,u=t.scrollbar.paddingStart+i,d=t.scrollbar.size-t.scrollbar.paddingEnd-c,f=t.content-t.viewport,h=l===yn.LTR?[0,f]:[f*-1,0];return mr([u,d],h)(n)}se(As,"getScrollPositionFromPointer");function dr(n,e,t=yn.LTR){const l=Qn(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,c=o-l,u=t===yn.LTR?[0,i]:[i*-1,0],d=qo(n,u);return mr([0,i],[0,c])(d)}se(dr,"getThumbOffsetFromScroll");function mr(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(n[1]-n[0]);return e[0]+l*(t-n[0])}}se(mr,"linearScale");function gr(n,e){return n>0&&n<e}se(gr,"isScrollingWithinScrollbarBounds");var Aa=se((n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},l=0;function s(){const o={left:n.scrollLeft,top:n.scrollTop},i=t.left!==o.left,c=t.top!==o.top;(i||c)&&e(),t=o,l=window.requestAnimationFrame(s)}return se(s,"loop"),s(),()=>window.cancelAnimationFrame(l)},"addUnlinkedScrollListener");function Zn(n,e){const t=On(n),l=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(l.current),[]),a.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(t,e)},[t,e])}se(Zn,"useDebounceCallback");function Bn(n,e){const t=On(e);Ws(()=>{let l=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(l),s.unobserve(n)}}},[n,t])}se(Bn,"useResizeObserver");const Ls=a.forwardRef((n,e)=>{const t=de.c(15);let l,s,o;t[0]!==n?({className:s,children:l,...o}=n,t[0]=n,t[1]=l,t[2]=s,t[3]=o):(l=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=Fe("relative overflow-hidden",s),t[4]=s,t[5]=i):i=t[5];let c;t[6]!==l?(c=r.jsx(wa,{className:"h-full w-full rounded-[inherit]",children:l}),t[6]=l,t[7]=c):c=t[7];let u,d;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx(Ds,{}),d=r.jsx(Ia,{}),t[8]=u,t[9]=d):(u=t[8],d=t[9]);let f;return t[10]!==o||t[11]!==e||t[12]!==i||t[13]!==c?(f=r.jsxs(Cs,{ref:e,className:i,...o,children:[c,u,d]}),t[10]=o,t[11]=e,t[12]=i,t[13]=c,t[14]=f):f=t[14],f});Ls.displayName=Cs.displayName;const Ds=a.forwardRef((n,e)=>{const t=de.c(14);let l,s,o;t[0]!==n?({className:l,orientation:o,...s}=n,t[0]=n,t[1]=l,t[2]=s,t[3]=o):(l=t[1],s=t[2],o=t[3]);const i=o===void 0?"vertical":o,c=i==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",u=i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]";let d;t[4]!==l||t[5]!==c||t[6]!==u?(d=Fe("flex touch-none select-none transition-colors",c,u,l),t[4]=l,t[5]=c,t[6]=u,t[7]=d):d=t[7];let f;t[8]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(Ta,{className:"relative flex-1 rounded-full bg-border"}),t[8]=f):f=t[8];let h;return t[9]!==i||t[10]!==s||t[11]!==e||t[12]!==d?(h=r.jsx(Ns,{ref:e,orientation:i,className:d,...s,children:f}),t[9]=i,t[10]=s,t[11]=e,t[12]=d,t[13]=h):h=t[13],h});Ds.displayName=Ns.displayName;function Ms(n){return/[Zz]|[+-]\d{2}/.test(n)?new Date(n):new Date(n.replace(" ","T")+"Z")}function La(n){const e=new Map;for(const s of n){const o=Ms(s.created_at).toDateString();e.has(o)||e.set(o,[]),e.get(o).push(s)}const t=new Date().toDateString(),l=new Date(Date.now()-864e5).toDateString();return Array.from(e.entries()).map(([s,o])=>{let i;if(s===t)i="Today";else if(s===l)i="Yesterday";else{const c=new Date(s);i=c.toLocaleDateString(void 0,{month:"short",day:"numeric",...c.getFullYear()!==new Date().getFullYear()?{year:"numeric"}:{}})}return{label:i,items:o}})}function Da(n){return Ms(n).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}const Ma=5*1024*1024,$a=["image/png","image/jpeg","image/webp"];function Oa({buildId:n}){const e=a.useId(),[t,l]=a.useState(""),[s,o]=a.useState(null),[i,c]=a.useState(!1),[u,d]=a.useState(""),f=a.useRef(null),h=a.useRef(null),p=a.useRef(null),m=a.useRef({}),b=qr(),S=zr({queryKey:rr.comments(n),queryFn:()=>Ys(n)}),k=S.data??[],g=()=>{b.invalidateQueries({queryKey:rr.comments(n)})};a.useEffect(()=>{const _=window.location.hash;if(!_.startsWith("#comment-"))return;const y=Number(_.replace("#comment-","")),x=m.current[y];if(!x)return;x.scrollIntoView({behavior:"smooth"});const D=document.documentElement.classList.contains("dark");x.style.backgroundColor=D?"rgb(0 112 243 / 0.18)":"#d3e5ff",setTimeout(()=>{x.style.backgroundColor=""},2e3)},[S.data]),a.useEffect(()=>{_r()},[]);async function R(_){const{linkBase:y}=await _r(),x=zo(y,`${location.pathname}${location.search}#comment-${_}`);try{if(!navigator.clipboard)throw new Error("no clipboard");await navigator.clipboard.writeText(x),xt.success("Link copied")}catch{xt.error("Could not copy link")}}function N(_){if(d(""),!$a.includes(_.type)){o(null),d("Only png, jpg, webp allowed");return}if(_.size>Ma){o(null),d("Max 5MB");return}o(_)}async function I(_){var x,D;if(_.preventDefault(),i||!t.trim()&&!s)return;c(!0);const y=new FormData;y.append("build_id",String(n)),y.append("body",t),s&&y.append("attachment",s);try{const w=await fetch("/api/v1/comments",{method:"POST",credentials:"include",body:y});if(!w.ok)throw new Error(String(w.status));l(""),o(null),d(""),g();const E=document.activeElement;(E===document.body||(x=p.current)!=null&&x.contains(E))&&((D=h.current)==null||D.focus())}catch{xt.error("Could not post the comment. Try again.")}finally{c(!1)}}const L=La(k);return r.jsxs("div",{className:"flex h-full flex-col gap-3 px-1",children:[r.jsx(Ls,{className:"flex-1 rounded-md border",children:r.jsx("div",{className:"p-3",children:S.isPending?r.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"Loading comments…"}):S.isError&&!S.data?r.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"Couldn't load comments."}):k.length===0?r.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No comments yet."}):r.jsx("div",{className:"flex flex-col",children:L.map(({label:_,items:y})=>r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 py-3",children:[r.jsx("div",{className:"h-px flex-1 bg-border"}),r.jsx("span",{className:"text-[11px] font-medium text-muted-foreground px-1 select-none",children:_}),r.jsx("div",{className:"h-px flex-1 bg-border"})]}),r.jsx("div",{className:"flex flex-col gap-4",children:y.map(x=>r.jsxs("div",{id:`comment-${x.id}`,ref:D=>{m.current[x.id]=D},className:"group flex gap-2.5 rounded-md px-2 py-1.5 transition-all",children:[r.jsx("div",{className:"mt-0.5 shrink-0",children:r.jsx(Xs,{name:x.author,avatarUrl:x.authorAvatarUrl,size:28})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-sm font-semibold leading-none",children:x.author}),r.jsx("span",{className:"text-[11px] text-muted-foreground leading-none",children:Da(x.created_at)}),r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-4 w-4 ml-0.5 opacity-0 group-hover:opacity-50 hover:!opacity-100 group-focus-within:opacity-50 focus-visible:!opacity-100 transition-opacity","aria-label":"Copy link to comment",onClick:()=>void R(x.id),children:r.jsx(Yr,{className:"h-3 w-3","aria-hidden":"true"})})]}),r.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap mt-1",children:x.body}),x.attachments.map(D=>{const w=decodeURIComponent(D.file_path.split("/").pop()??"image");return r.jsx("a",{href:D.file_path,target:"_blank",rel:"noreferrer",className:"mt-1.5 block","aria-label":`Open ${w} in a new tab`,children:r.jsx("img",{src:D.file_path,alt:w,className:"max-h-48 rounded border object-contain"})},D.id)})]})]},x.id))})]},_))})})}),r.jsx("div",{className:"pb-1",children:r.jsx("form",{ref:p,onSubmit:I,children:r.jsxs("div",{className:"rounded-md border border-input bg-background ring-offset-background transition-shadow focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[r.jsx(Ss,{ref:h,"aria-label":"Comment",placeholder:"Leave a comment…",value:t,onChange:_=>l(_.target.value),className:"min-h-16 resize-none border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm"}),(s||u)&&r.jsxs("div",{className:"px-3 -mt-1 pb-1",children:[s&&r.jsx("p",{className:"text-xs text-muted-foreground",children:s.name}),u&&r.jsx("p",{id:e,role:"alert",className:"text-xs text-destructive",children:u})]}),r.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[r.jsx(Xe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground","aria-label":"Attach image","aria-describedby":u?e:void 0,onClick:()=>{var _;return(_=f.current)==null?void 0:_.click()},children:r.jsx(sl,{className:"h-4 w-4","aria-hidden":"true"})}),r.jsx("input",{ref:f,type:"file",accept:"image/png,image/jpeg,image/webp",className:"hidden",onChange:_=>{var x;const y=(x=_.target.files)==null?void 0:x[0];_.target.value="",y&&N(y)}}),r.jsx("div",{className:"flex-1"}),r.jsx(Xe,{type:"submit",size:"icon",className:"h-7 w-7 rounded-full aria-disabled:cursor-not-allowed aria-disabled:opacity-50","aria-label":"Post comment","aria-disabled":i,disabled:!i&&!t.trim()&&!s,children:r.jsx(el,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})})})]})}function Ha(n){return n<1024*1024?`${(n/1024).toFixed(0)} KB`:`${(n/1024/1024).toFixed(1)} MB`}function Ba(n){return new Date(n).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Fa(n){const e=new Date(n).getTime()-Date.now();if(e<=0)return{label:"Expired",urgent:!0};const t=Math.floor(e/36e5);return t<1?{label:"< 1 hour left",urgent:!0}:t<24?{label:`Expires in ${t}h`,urgent:t<6}:{label:`Expires in ${Math.floor(t/24)}d`,urgent:!1}}function qa(n){const e=de.c(17),{buildId:t}=n;let l;e[0]!==t?(l=rr.recordings(t),e[0]=t,e[1]=l):l=e[1];let s;e[2]!==t?(s=()=>Gs(t),e[2]=t,e[3]=s):s=e[3];let o;e[4]!==l||e[5]!==s?(o={queryKey:l,queryFn:s},e[4]=l,e[5]=s,e[6]=o):o=e[6];const i=zr(o);let c;e[7]!==i.data?(c=i.data??[],e[7]=i.data,e[8]=c):c=e[8];const u=c,d=Uo(i.isPending,250,t);if(i.isPending){let p;return e[9]!==d?(p=d?r.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading recordings…"}):null,e[9]=d,e[10]=p):p=e[10],p}if(i.isError&&!i.data){let p;return e[11]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"Couldn't load recordings."}),e[11]=p):p=e[11],p}if(u.length===0){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No recordings yet."}),e[12]=p):p=e[12],p}let f;e[13]!==u?(f=u.map(za),e[13]=u,e[14]=f):f=e[14];let h;return e[15]!==f?(h=r.jsx("div",{className:"flex flex-col gap-2",children:f}),e[15]=f,e[16]=h):h=e[16],h}function za(n){const e=Fa(n.expiresAt);return r.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[r.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[r.jsx("span",{className:"text-xs font-medium truncate",children:Ba(n.createdAt)}),r.jsxs("span",{className:`text-xs ${e.urgent?"text-destructive":"text-muted-foreground"}`,children:[e.label," · ",Ha(n.fileSize)]})]}),r.jsx(Xe,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 ml-2",title:"Download",onClick:()=>{const t=document.createElement("a");t.href=n.url,t.download="",t.click()},children:r.jsx(Po,{className:"h-3.5 w-3.5"})})]},n.id)}function Ua(n){const e=de.c(9),{buildId:t}=n;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsxs(kr,{value:"comments",className:"flex-1 gap-1.5",children:[r.jsx(ol,{className:"h-3.5 w-3.5"}),"Comments"]}),e[0]=l):l=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("div",{className:"shrink-0 px-1",children:r.jsxs(Bo,{className:"w-full",children:[l,r.jsxs(kr,{value:"recordings",className:"flex-1 gap-1.5",children:[r.jsx(nl,{className:"h-3.5 w-3.5"}),"Recordings"]})]})}),e[1]=s):s=e[1];let o;e[2]!==t?(o=r.jsx(Cr,{value:"comments",className:"mt-3 min-h-0 flex-1 overflow-hidden",children:r.jsx(Oa,{buildId:t})}),e[2]=t,e[3]=o):o=e[3];let i;e[4]!==t?(i=r.jsx(Cr,{value:"recordings",className:"mt-3 min-h-0 flex-1 overflow-y-auto",children:r.jsx(qa,{buildId:t})}),e[4]=t,e[5]=i):i=e[5];let c;return e[6]!==o||e[7]!==i?(c=r.jsxs(Fo,{defaultValue:"comments",className:"flex h-full flex-col",children:[s,o,i]}),e[6]=o,e[7]=i,e[8]=c):c=e[8],c}const $s=a.forwardRef((n,e)=>{const t=de.c(5);let l;t[0]!==n?({...l}=n,t[0]=n,t[1]=l):l=t[1];let s;return t[2]!==l||t[3]!==e?(s=r.jsx("nav",{ref:e,"aria-label":"breadcrumb",...l}),t[2]=l,t[3]=e,t[4]=s):s=t[4],s});$s.displayName="Breadcrumb";const Os=a.forwardRef((n,e)=>{const t=de.c(9);let l,s;t[0]!==n?({className:l,...s}=n,t[0]=n,t[1]=l,t[2]=s):(l=t[1],s=t[2]);let o;t[3]!==l?(o=Fe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",l),t[3]=l,t[4]=o):o=t[4];let i;return t[5]!==s||t[6]!==e||t[7]!==o?(i=r.jsx("ol",{ref:e,className:o,...s}),t[5]=s,t[6]=e,t[7]=o,t[8]=i):i=t[8],i});Os.displayName="BreadcrumbList";const Xn=a.forwardRef((n,e)=>{const t=de.c(9);let l,s;t[0]!==n?({className:l,...s}=n,t[0]=n,t[1]=l,t[2]=s):(l=t[1],s=t[2]);let o;t[3]!==l?(o=Fe("inline-flex items-center gap-1.5",l),t[3]=l,t[4]=o):o=t[4];let i;return t[5]!==s||t[6]!==e||t[7]!==o?(i=r.jsx("li",{ref:e,className:o,...s}),t[5]=s,t[6]=e,t[7]=o,t[8]=i):i=t[8],i});Xn.displayName="BreadcrumbItem";const er=a.forwardRef((n,e)=>{const t=de.c(11);let l,s,o;t[0]!==n?({asChild:l,className:s,...o}=n,t[0]=n,t[1]=l,t[2]=s,t[3]=o):(l=t[1],s=t[2],o=t[3]);const i=l?Qs:"a";let c;t[4]!==s?(c=Fe("transition-colors hover:text-foreground cursor-pointer",s),t[4]=s,t[5]=c):c=t[5];let u;return t[6]!==i||t[7]!==o||t[8]!==e||t[9]!==c?(u=r.jsx(i,{ref:e,className:c,...o}),t[6]=i,t[7]=o,t[8]=e,t[9]=c,t[10]=u):u=t[10],u});er.displayName="BreadcrumbLink";const tr=a.forwardRef((n,e)=>{const t=de.c(9);let l,s;t[0]!==n?({className:l,...s}=n,t[0]=n,t[1]=l,t[2]=s):(l=t[1],s=t[2]);let o;t[3]!==l?(o=Fe("font-medium text-foreground",l),t[3]=l,t[4]=o):o=t[4];let i;return t[5]!==s||t[6]!==e||t[7]!==o?(i=r.jsx("span",{ref:e,role:"link","aria-disabled":"true","aria-current":"page",className:o,...s}),t[5]=s,t[6]=e,t[7]=o,t[8]=i):i=t[8],i});tr.displayName="BreadcrumbPage";const nr=n=>{const e=de.c(12);let t,l,s;e[0]!==n?({children:t,className:l,...s}=n,e[0]=n,e[1]=t,e[2]=l,e[3]=s):(t=e[1],l=e[2],s=e[3]);let o;e[4]!==l?(o=Fe("[&>svg]:h-3.5 [&>svg]:w-3.5",l),e[4]=l,e[5]=o):o=e[5];let i;e[6]!==t?(i=t??r.jsx(Zs,{}),e[6]=t,e[7]=i):i=e[7];let c;return e[8]!==s||e[9]!==o||e[10]!==i?(c=r.jsx("li",{role:"presentation","aria-hidden":"true",className:o,...s,children:i}),e[8]=s,e[9]=o,e[10]=i,e[11]=c):c=e[11],c};nr.displayName="BreadcrumbSeparator";var Ka=Object.defineProperty,Ln=(n,e)=>Ka(n,"name",{value:e,configurable:!0}),br="Switch",[Wa,Ri]=Fr(br),[Va,xr]=Wa(br);function Hs(n){const{__scopeSwitch:e,checked:t,children:l,defaultChecked:s,disabled:o,form:i,name:c,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:h}=n,[p,m]=eo({prop:t,defaultProp:s??!1,onChange:u,caller:br}),[b,S]=a.useState(null),[k,g]=a.useState(null),[R,N]=a.useState(null),I=b?!!i||!!b.closest("form"):!0,L={checked:p,setChecked:m,disabled:o,control:b,setControl:S,name:c,form:i,value:f,userClick:R,onUserClick:N,required:d,defaultChecked:s,isFormControl:I,bubbleInput:k,setBubbleInput:g};return r.jsx(Va,{scope:e,...L,children:Fs(h)?h(L):l})}Ln(Hs,"SwitchProvider");var Ya="SwitchTrigger",Xa=a.forwardRef(Ln(function({__scopeSwitch:e,onClick:t,...l},s){const{control:o,form:i,value:c,disabled:u,checked:d,required:f,setControl:h,setChecked:p,onUserClick:m,isFormControl:b,bubbleInput:S}=xr(Ya,e),k=Rn(s,h),g=a.useRef(d);return a.useEffect(()=>{const R=i?o==null?void 0:o.ownerDocument.getElementById(i):o==null?void 0:o.form;if(R instanceof HTMLFormElement){const N=Ln(()=>p(g.current),"reset");return R.addEventListener("reset",N),()=>R.removeEventListener("reset",N)}},[o,i,p]),r.jsx(kn.button,{type:"button",role:"switch","aria-checked":d,"aria-required":f,"data-state":yr(d),"data-disabled":u?"":void 0,disabled:u,value:c,...l,ref:k,onClick:jn(t,R=>{const N=R.isPropagationStopped();m({requestedChecked:!d,hasConsumerStoppedPropagation:N}),p(I=>!I),S&&b&&(N||R.stopPropagation())})})},"SwitchTrigger")),Bs=a.forwardRef(Ln(function(e,t){const{__scopeSwitch:l,name:s,checked:o,defaultChecked:i,required:c,disabled:u,value:d,onCheckedChange:f,form:h,...p}=e;return r.jsx(Hs,{__scopeSwitch:l,checked:o,defaultChecked:i,disabled:u,required:c,onCheckedChange:f,name:s,form:h,value:d,internal_do_not_use_render:({isFormControl:m})=>r.jsxs(r.Fragment,{children:[r.jsx(Xa,{...p,ref:t,__scopeSwitch:l}),m&&r.jsx(Ja,{__scopeSwitch:l})]})})},"Switch")),Ga="SwitchThumb",Qa=a.forwardRef(Ln(function(e,t){const{__scopeSwitch:l,...s}=e,o=xr(Ga,l);return r.jsx(kn.span,{"data-state":yr(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})},"SwitchThumb")),Za="SwitchBubbleInput",Ja=a.forwardRef(Ln(function({__scopeSwitch:e,onClick:t,...l},s){const{control:o,userClick:i,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:p,form:m,bubbleInput:b,setBubbleInput:S}=xr(Za,e),k=Rn(s,S),g=Js(o),R=a.useRef(!1),N=a.useRef(c),I=a.useRef(i),L=a.useRef(null);a.useEffect(()=>{const y=b;if(!y)return;const x=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(x,"checked").set;if(!w)return;const E=N.current!==c;N.current=c;const F=i!==null&&i!==I.current;if(I.current=i,F)L.current=E?null:i,E&&w.call(y,c),y.dispatchEvent(new Event("click",{bubbles:!i.hasConsumerStoppedPropagation}));else if(E){const z=L.current;L.current=null;const $=(z==null?void 0:z.requestedChecked)===c;R.current=!0,w.call(y,c),y.dispatchEvent(new Event("click",{bubbles:!($&&z.hasConsumerStoppedPropagation)})),R.current=!1}},[b,c,i]);const _=a.useRef(c);return r.jsx(kn.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??_.current,required:d,disabled:f,name:h,value:p,form:m,...l,tabIndex:-1,ref:k,onClick:jn(t,y=>{R.current&&y.stopPropagation()}),style:{...l.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Fs(n){return typeof n=="function"}Ln(Fs,"isFunction");function yr(n){return n?"checked":"unchecked"}Ln(yr,"getState");const qs=a.forwardRef((n,e)=>{const t=de.c(10);let l,s;t[0]!==n?({className:l,...s}=n,t[0]=n,t[1]=l,t[2]=s):(l=t[1],s=t[2]);let o;t[3]!==l?(o=Fe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",l),t[3]=l,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Qa,{className:Fe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")}),t[5]=i):i=t[5];let c;return t[6]!==s||t[7]!==e||t[8]!==o?(c=r.jsx(Bs,{className:o,...s,ref:e,children:i}),t[6]=s,t[7]=e,t[8]=o,t[9]=c):c=t[9],c});qs.displayName=Bs.displayName;const ei={"agent-disconnected":{title:"The agent disconnected — this session ended.",description:"Pick the Mac again to start a new session."},"busy-elsewhere":{title:"This device is already open in another browser session.",description:"Someone else may be testing it. If you reloaded while your connection was down it is your own tab, and that clears within about 45 seconds."},"mac-overloaded":{title:"That Mac is too busy to start a session.",description:"Pick a different Mac, or wait for it to settle."}};function ki(){const n=de.c(62),[e]=Vr(),t=wo();let l;n[0]!==e?(l=e.get("id"),n[0]=e,n[1]=l):l=n[1];const s=l,{build:o}=ml(s),i=qr(),c=(o==null?void 0:o.platform)??"ios",{sessions:u,activeFormFactor:d,selectedAgent:f,setSelectedAgent:h,activeSessionId:p,deviceId:m,booting:b,status:S,connected:k,agentGroups:g,startDevice:R,resetDevice:N,handleBack:I,handleBackToMacs:L,handleSessionEnded:_}=gl(c);let y;if(n[2]!==g||n[3]!==f){let H;n[5]!==f?(H=G=>G.agentName===f,n[5]=f,n[6]=H):H=n[6],y=g.find(H),n[2]=g,n[3]=f,n[4]=y}else y=n[4];const x=y,{osVersions:D,osVersion:w,setOsVersion:E,deviceSearch:F,setDeviceSearch:z,versionedDevices:$,resetMode:Z,setResetMode:V,appliedResetMode:B,consumeResetMode:ne,fullResetSupported:ee}=xl(x,c);let Y;if(n[7]!==m||n[8]!==u){const H=u.flatMap(ni);let G;n[10]!==m?(G=ce=>ce.id===m,n[10]=m,n[11]=G):G=n[11],Y=H.find(G),n[7]=m,n[8]=u,n[9]=Y}else Y=n[9];const M=Y,re=M?`${M.name}${M.osVersion?` · ${M.osVersion}`:""}`:"";let ie;n[12]!==i?(ie=()=>{i.invalidateQueries({queryKey:rr.allRecordings})},n[12]=i,n[13]=ie):ie=n[13];const be=ie;let ue;n[14]!==ne||n[15]!==R?(ue=H=>{ne(),R(H)},n[14]=ne,n[15]=R,n[16]=ue):ue=n[16];const K=ue;let X;n[17]!==_?(X=H=>{const G=ei[H];xt.error(G.title,{description:G.description}),_()},n[17]=_,n[18]=X):X=n[18];const he=X,{setNode:J}=to();let O,fe;n[19]!==p||n[20]!==o||n[21]!==re||n[22]!==I||n[23]!==L||n[24]!==t||n[25]!==f||n[26]!==J?(O=()=>{if(o)return J(r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx($s,{children:r.jsxs(Os,{children:[r.jsx(Xn,{children:r.jsx(er,{asChild:!0,children:r.jsx("button",{onClick:()=>t(`/app-center?appId=${o.app_id}`),children:o.name})})}),r.jsx(nr,{}),r.jsx(Xn,{children:f?r.jsx(er,{asChild:!0,children:r.jsx("button",{onClick:L,children:Nr(o)})}):r.jsx(tr,{children:Nr(o)})}),f&&r.jsxs(r.Fragment,{children:[r.jsx(nr,{}),r.jsx(Xn,{children:p?r.jsx(er,{asChild:!0,children:r.jsx("button",{onClick:I,children:f})}):r.jsx(tr,{children:f})})]}),p&&r.jsxs(r.Fragment,{children:[r.jsx(nr,{}),r.jsx(Xn,{children:r.jsx(tr,{children:re})})]})]})}),!f&&o.status_label&&r.jsx(Xo,{tone:Qo[o.status_label],children:o.status_label})]})),()=>J(null)},fe=[o,f,p,re,t,I,L,J],n[19]=p,n[20]=o,n[21]=re,n[22]=I,n[23]=L,n[24]=t,n[25]=f,n[26]=J,n[27]=O,n[28]=fe):(O=n[27],fe=n[28]),a.useEffect(O,fe);let ye;n[29]!==d||n[30]!==p||n[31]!==g||n[32]!==B||n[33]!==b||n[34]!==(o==null?void 0:o.id)||n[35]!==k||n[36]!==m||n[37]!==F||n[38]!==ee||n[39]!==be||n[40]!==K||n[41]!==he||n[42]!==c||n[43]!==w||n[44]!==D||n[45]!==N||n[46]!==Z||n[47]!==f||n[48]!==(M==null?void 0:M.formFactor)||n[49]!==(x==null?void 0:x.admission)||n[50]!==z||n[51]!==E||n[52]!==V||n[53]!==h||n[54]!==S||n[55]!==$?(ye=r.jsx("div",{className:"flex flex-col gap-3 flex-1 min-w-0 min-h-0",children:r.jsx("div",{className:"flex-1 min-h-0 overflow-auto -ml-1 pl-1 -mr-4 pr-4",children:p?r.jsx("div",{className:"min-h-full flex items-center justify-center py-6 px-8 min-w-max",children:r.jsx(ma,{sessionId:p,deviceId:m,formFactor:(M==null?void 0:M.formFactor)??d,platform:c,buildId:o==null?void 0:o.id,resetMode:B,onRecordingUploaded:be,onSessionEnded:he})}):f?r.jsxs("div",{className:"flex flex-col gap-5",children:[r.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Select device"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ho,{"aria-label":"Search devices",placeholder:"Search device…",value:F,onChange:z}),D.length>0&&r.jsxs(Ko,{value:w||"__all__",onValueChange:H=>{E(H==="__all__"?"":H),N()},children:[r.jsx(Wo,{className:"h-8 w-36 shrink-0","aria-label":"Filter by OS version",children:r.jsx(Vo,{})}),r.jsxs(Yo,{children:[r.jsx(es,{value:"__all__",children:"Any version"}),D.map(ti)]})]}),ee&&r.jsx(ar,{children:r.jsxs(Pt,{children:[r.jsx(At,{asChild:!0,children:r.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[r.jsx(no,{htmlFor:"reset-mode",className:"text-sm cursor-pointer whitespace-nowrap",children:"Full reset"}),r.jsx("span",{id:"reset-mode-desc",className:"sr-only",children:"When on, erases all data on the next device you pick"}),r.jsx(qs,{id:"reset-mode","aria-describedby":"reset-mode-desc",checked:Z==="full-erase",onCheckedChange:H=>V(H?"full-erase":"app-only")})]})}),r.jsx(Lt,{children:Z==="full-erase"?"Erase all data on the next device you pick":"Keep existing data"})]})})]}),$.length===0?r.jsx("p",{className:"text-sm text-muted-foreground",children:k?"No devices available for this OS.":"Connecting to relay…"}):r.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-2",children:$.map(H=>{const G=H.status==="booted",ce=H.busy,pe=(x==null?void 0:x.admission.memoryRefuses.includes(H.id))??!1,ve=ce?H.holder?`${Ao(H.holder.kind)} is driving it`:"In use":pe?"Not enough memory to start":G?"Booted":"Available",Ie=ce?"bg-amber-400":G?"bg-emerald-400":"bg-muted-foreground/40";return r.jsxs("button",{disabled:ce||pe||b||!k,onClick:()=>K(H),className:Fe("flex flex-col gap-3 rounded-lg border p-3 text-left transition-colors min-h-[100px]","hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"),children:[r.jsx("span",{className:"text-sm font-medium leading-tight",children:H.name}),H.osVersion&&r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:H.osVersion}),r.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("span",{className:Fe("inline-block h-1.5 w-1.5 rounded-full",Ie)}),ve]}),G&&typeof H.serviceTier=="object"&&H.serviceTier.name==="slim"&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Most services off"})]},H.id)})}),S&&r.jsx("p",{className:"text-sm text-muted-foreground",children:S})]}):r.jsxs("div",{className:"flex flex-col gap-5",children:[r.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Select Mac"}),g.length===0?r.jsx("p",{className:"text-sm text-muted-foreground",children:k?`No agents available for ${Go[c]}.`:"Connecting to relay…"}):r.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-2",children:g.map(H=>{const G=H.resources,ce=G?Date.now()-G.reportedAt>Zo:!1,pe=H.devices.filter(Ce=>Ce.platform===c).length,ve=(G==null?void 0:G.cpuPercent)??0,Ie=G?G.memUsedMB/G.memTotalMB*100:0,qe=Jo(G,ce),oe=H.admission.overloaded;return r.jsx(ar,{children:r.jsxs(Pt,{children:[r.jsx(At,{asChild:!0,children:r.jsx("span",{tabIndex:oe?0:void 0,className:oe?"cursor-not-allowed":void 0,children:r.jsxs("button",{disabled:oe,"aria-disabled":oe,onClick:()=>h(H.agentName??null),className:Fe("flex flex-col gap-3 rounded-lg border p-3 text-left transition-colors min-h-[100px] w-full",oe?"pointer-events-none":"hover:bg-accent"),children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(ri,{health:qe}),r.jsx("span",{className:"text-sm font-medium leading-tight truncate",children:H.agentName??"Unknown"})]}),ce?r.jsx("span",{className:"shrink-0 text-[10px] font-medium text-amber-500",children:"Stale"}):H.admission.booting&&r.jsx("span",{className:"shrink-0 text-[10px] font-medium text-muted-foreground",children:"Starting a device"})]}),r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsxs("span",{children:[pe," device",pe!==1?"s":""]}),G&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:"·"}),r.jsxs("span",{children:[G.slotsAvailable,"/",G.slotsTotal," slots"]})]})]}),G&&!ce&&r.jsxs("div",{className:"flex flex-col gap-1.5 w-full",children:[r.jsx(Hr,{label:"CPU",percent:ve,colorClass:"bg-blue-400"}),r.jsx(Hr,{label:"RAM",percent:Ie,colorClass:"bg-violet-400"})]})]})})}),oe&&r.jsx(Lt,{children:"This Mac is currently overloaded. Try again later."})]})},H.agentName)})})]})})}),n[29]=d,n[30]=p,n[31]=g,n[32]=B,n[33]=b,n[34]=o==null?void 0:o.id,n[35]=k,n[36]=m,n[37]=F,n[38]=ee,n[39]=be,n[40]=K,n[41]=he,n[42]=c,n[43]=w,n[44]=D,n[45]=N,n[46]=Z,n[47]=f,n[48]=M==null?void 0:M.formFactor,n[49]=x==null?void 0:x.admission,n[50]=z,n[51]=E,n[52]=V,n[53]=h,n[54]=S,n[55]=$,n[56]=ye):ye=n[56];let ge;n[57]!==s?(ge=s&&r.jsxs(r.Fragment,{children:[r.jsx(Br,{orientation:"vertical",className:"h-auto"}),r.jsx("div",{className:"w-80 shrink-0 h-full",children:r.jsx(Ua,{buildId:Number(s)})})]}),n[57]=s,n[58]=ge):ge=n[58];let Re;return n[59]!==ye||n[60]!==ge?(Re=r.jsxs("div",{className:"flex h-full min-h-0 gap-6 p-6",children:[ye,ge]}),n[59]=ye,n[60]=ge,n[61]=Re):Re=n[61],Re}function ti(n){return r.jsx(es,{value:n,children:n},n)}function ni(n){return n.devices}function ri(n){const e=de.c(6),{health:t}=n;let l,s;if(e[0]!==t){const i={unknown:"bg-muted-foreground/40",healthy:"bg-emerald-400",warning:"bg-amber-400",overloaded:"bg-red-500"}[t];l="resource-health-dot",s=Fe("inline-block h-2 w-2 shrink-0 rounded-full",i),e[0]=t,e[1]=l,e[2]=s}else l=e[1],s=e[2];let o;return e[3]!==l||e[4]!==s?(o=r.jsx("span",{"data-testid":l,className:s}),e[3]=l,e[4]=s,e[5]=o):o=e[5],o}function Hr(n){const e=de.c(19),{label:t,percent:l,colorClass:s}=n;let o;e[0]!==t?(o=r.jsx("span",{children:t}),e[0]=t,e[1]=o):o=e[1];let i;e[2]!==l?(i=l.toFixed(0),e[2]=l,e[3]=i):i=e[3];let c;e[4]!==i?(c=r.jsxs("span",{children:[i,"%"]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==c?(u=r.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[o,c]}),e[6]=o,e[7]=c,e[8]=u):u=e[8];let d;e[9]!==s?(d=Fe("h-full rounded-full transition-all",s),e[9]=s,e[10]=d):d=e[10];const f=`${Math.min(100,l)}%`;let h;e[11]!==f?(h={width:f},e[11]=f,e[12]=h):h=e[12];let p;e[13]!==d||e[14]!==h?(p=r.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:r.jsx("div",{className:d,style:h})}),e[13]=d,e[14]=h,e[15]=p):p=e[15];let m;return e[16]!==u||e[17]!==p?(m=r.jsxs("div",{className:"flex flex-col gap-0.5",children:[u,p]}),e[16]=u,e[17]=p,e[18]=m):m=e[18],m}export{ki as QASession};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./vendor-react-DTSdA8m-.js";import{u as k,a as q,b as E,c as O,C as w,d as h,e as f,m as x,f as R,L as j,I as y,g as H,P as I,F as i,B as _,h as A,q as g,o as D,s as v,i as L,j as B,r as K}from"./index-
|
|
1
|
+
import{j as s}from"./vendor-react-DTSdA8m-.js";import{u as k,a as q,b as E,c as O,C as w,d as h,e as f,m as x,f as R,L as j,I as y,g as H,P as I,F as i,B as _,h as A,q as g,o as D,s as v,i as L,j as B,r as K}from"./index-C_3Q51YJ.js";import{F as Q}from"./field-hint-qmBa0qqN.js";import{a as W,c as G}from"./vendor-router-B1pQim9Z.js";const J=D({password:v().min(L,B),confirm:v()}).refine(a=>a.password===a.confirm,{message:"Passwords do not match",path:["confirm"]});function X(){var l,m,p;const a=W(),[b]=G(),r=b.get("token")??"",{register:o,handleSubmit:N,setError:t,formState:{errors:e,isSubmitting:n,submitCount:S}}=k({shouldFocusError:!1,resolver:q(J)}),C=E(),d=O({queryKey:g.resetToken(r),queryFn:()=>K(r),enabled:r!=="",staleTime:1/0}),c=!r||d.isError?"invalid":d.isPending?"loading":"valid";async function T(F){try{const u=await fetch("/api/v1/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r,password:F.password})});if(!u.ok){const P=await u.json();t("root",{message:P.error??"Failed to reset password"});return}C.removeQueries({queryKey:g.resetToken(r)}),a("/login",{replace:!0})}catch{t("root",{message:"Network error. Please try again."})}}return c==="loading"?s.jsx("div",{className:"flex min-h-svh items-center justify-center"}):c==="invalid"?s.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:s.jsx(w,{level:4,className:"w-full max-w-sm text-center",children:s.jsxs(h,{children:[s.jsx(f,{children:"Link expired"}),s.jsx(x,{children:"This password reset link is invalid or has expired. Ask your admin to send a new one."})]})})}):s.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:s.jsxs(w,{level:4,className:"w-full max-w-sm",children:[s.jsxs(h,{className:"text-center",children:[s.jsx(f,{children:"Reset password"}),s.jsx(x,{children:"Enter your new password below."})]}),s.jsx(R,{children:s.jsxs("form",{onSubmit:N(T),className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(j,{htmlFor:"password",children:"New password"}),s.jsx(y,{id:"password",type:"password","aria-required":"true",autoComplete:"new-password","aria-invalid":!!e.password,"aria-describedby":H("password-hint","password-error",!!e.password),...o("password")}),!e.password&&s.jsx(Q,{id:"password-hint",children:I}),s.jsx(i,{id:"password-error",message:(l=e.password)==null?void 0:l.message})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(j,{htmlFor:"confirm",children:"Confirm password"}),s.jsx(y,{id:"confirm",type:"password","aria-required":"true",autoComplete:"new-password","aria-invalid":!!e.confirm,"aria-describedby":e.confirm?"confirm-error":void 0,...o("confirm")}),s.jsx(i,{id:"confirm-error",message:(m=e.confirm)==null?void 0:m.message})]}),s.jsx(i,{assertive:!0,id:"resetpassword-error",message:(p=e.root)==null?void 0:p.message}),s.jsx(_,{type:"submit",disabled:n,className:"w-full",children:n?"Saving…":"Set new password"}),s.jsx(A,{errors:e,submitCount:S})]})})]})})}export{X as ResetPassword};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{c as B,r as S,j as t}from"./vendor-react-DTSdA8m-.js";import{G,c as ie,an as je,ao as ye,ap as Ne,aq as ve,T as be,K as ne,M as ae,ar as P,N as le,B as A,as as we,q as ce,at as ke,au as Se,ak as Me,av as Re,aw as $e,I as Ce,H as oe}from"./index-C_3Q51YJ.js";import{B as H}from"./badge-BjEnOmb0.js";import{T as F}from"./tech-label-KAwM5qZ_.js";import{r as de,d as Ie,f as ue,b as Te,s as Ee,a as qe,c as _e,p as Le,S as De,e as fe,U as Fe}from"./runs-CFQ6M4rx.js";import{S as Pe}from"./slider-tyb3JvL2.js";import{d as Ae,S as Be,a as ze,b as Ve,c as Ke}from"./select-CHbE6M4S.js";import{W as Oe}from"./WatchedDevice-CpaKHa1x.js";import{k as Ue,C as We,H as He}from"./AndroidDeviceScreen-C55msKfh.js";import{P as Qe}from"./play-Z1L2Eb91.js";import{V as Ge}from"./video-DdHH0Q0l.js";import{d as Ze,L as Q}from"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";/**
|
|
2
|
+
* @license lucide-react v1.59.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 me={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};me.node;const Je=G(me);/**
|
|
7
|
+
* @license lucide-react v1.59.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 xe={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};xe.node;const he=G(xe);/**
|
|
12
|
+
* @license lucide-react v1.59.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 pe={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};pe.node;const Xe=G(pe),Ye=[.5,1,2,4];function es(n){const e=B.c(43),{runId:s,idx:a,flowName:f,summary:r,running:c}=n,[i,u]=S.useState(!1),[d,j]=S.useState(!1);let x;e[0]!==a||e[1]!==s?(x=ce.runVideo(s,a),e[0]=a,e[1]=s,e[2]=x):x=e[2];let p;e[3]!==a||e[4]!==s?(p=async g=>{const{signal:v}=g,R=await ke(s,a,v);return R.kind==="ready"?{kind:"ready",index:R.index,video:Se(R.index,R.file)}:R},e[3]=a,e[4]=s,e[5]=p):p=e[5];let h;e[6]!==i||e[7]!==x||e[8]!==p?(h={queryKey:x,queryFn:p,enabled:i,staleTime:1/0,refetchOnWindowFocus:!1},e[6]=i,e[7]=x,e[8]=p,e[9]=h):h=e[9];const m=ie(h);let y;e[10]!==r?(y=je(r),e[10]=r,e[11]=y):y=e[11];const k=y;if(k){let g;return e[12]!==k?(g=t.jsx("p",{className:"text-xs text-muted-foreground",children:k}),e[12]=k,e[13]=g):g=e[13],g}const o=m.data;if((o==null?void 0:o.kind)==="ready"){let g;e[14]!==m?(g=()=>void m.refetch(),e[14]=m,e[15]=g):g=e[15];let v;return e[16]!==f||e[17]!==d||e[18]!==o.index||e[19]!==o.video||e[20]!==g?(v=t.jsx(ns,{video:o.video,index:o.index,flowName:f,focusPlay:d,onLoadRest:g},o.index.bytes),e[16]=f,e[17]=d,e[18]=o.index,e[19]=o.video,e[20]=g,e[21]=v):v=e[21],v}const b=i&&m.isFetching,$=(o==null?void 0:o.kind)==="gone"?"Video no longer kept.":(o==null?void 0:o.kind)==="unsupported"?"This video was recorded in a format this dashboard cannot play. Update the relay to play it.":m.isError?"Couldn't load the video. Try again.":"";let w;e[22]!==b||e[23]!==m?(w=g=>{b||(j(document.activeElement===g.currentTarget),m.isError?m.refetch():u(!0))},e[22]=b,e[23]=m,e[24]=w):w=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ge,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),e[25]=C):C=e[25];const D=b?"Loading the video…":"Play the video";let q;e[26]!==b||e[27]!==w||e[28]!==D?(q=t.jsxs(A,{size:"sm",variant:"outline","aria-disabled":b,className:"aria-disabled:opacity-50",onClick:w,children:[C,D]}),e[26]=b,e[27]=w,e[28]=D,e[29]=q):q=e[29];let M;e[30]!==r.bytes?(M=ts(r.bytes),e[30]=r.bytes,e[31]=M):M=e[31];let I;e[32]!==M?(I=t.jsx(F,{className:"text-muted-foreground",children:M}),e[32]=M,e[33]=I):I=e[33];let _;e[34]!==c?(_=c&&t.jsx("span",{className:"text-xs text-muted-foreground",children:"Still recording: it plays what has arrived so far."}),e[34]=c,e[35]=_):_=e[35];let l;e[36]!==$?(l=t.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:$}),e[36]=$,e[37]=l):l=e[37];let N;return e[38]!==I||e[39]!==_||e[40]!==l||e[41]!==q?(N=t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[q,I,_,l]}),e[38]=I,e[39]=_,e[40]=l,e[41]=q,e[42]=N):N=e[42],N}function ss(n,e){return e>0&&n.chunks[e].seq!==n.chunks[e-1].seq+1}function ts(n){return n>=1024*1024?`${(n/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(n/1024))} KB`}function ns({video:n,index:e,flowName:s,focusPlay:a,onLoadRest:f}){const r=S.useRef(null);S.useEffect(()=>{var l;a&&((l=r.current)==null||l.focus())},[a]);const c=S.useRef(()=>{}),[i]=S.useState(()=>{let l;return{get current(){return l},set current(N){l=N,N&&queueMicrotask(()=>{l===N&&c.current()})}}}),u=Math.min(n.meta.flowStartMs,n.durationMs),[d,j]=S.useState(0),[x,p]=S.useState(u),[h,m]=S.useState(!1),[y,k]=S.useState(1),o=S.useRef({ms:u,next:0}),b=S.useRef({ms:u,flush:!0}),$=S.useRef(!1),w=S.useCallback((l,N=!1)=>{var E;const g=n.records;let v=o.current.next,R=-1;for(let T=v;T<g.length&&g[T].ms<=l;T++)g[T].kind==="frame"&&(R=T);for(;v<g.length&&g[v].ms<=l;){const T=g[v];if(T.kind==="frame"){const L=Ue(T.data);(L==null?void 0:L.codec)!==We&&((E=i.current)==null||E.call(i,L?T.data.slice(He):T.data,L?{codec:L.codec,keyframe:L.keyframe,capturedAt:L.capturedAt,flush:N&&v===R}:void 0))}v++}o.current.next=v},[n,i]),C=S.useCallback((l,N)=>{b.current={ms:Math.max(0,Math.min(l,n.durationMs)),flush:N},p(b.current.ms),j(g=>g+1)},[n]);S.useLayoutEffect(()=>{c.current=()=>{const l=b.current,N=ye(n,l.ms);o.current={ms:l.ms,next:N>=0?n.chunkStarts[N]:n.records.length},w(l.ms,l.flush)}},[n,w]),S.useEffect(()=>{if(!h)return;let l=0,N=performance.now();const g=v=>{const R=o.current.ms+(v-N)*y;N=v;const E=n.records[o.current.next];if(E&&E.ms<=R&&o.current.next===n.chunkStarts[E.chunk]&&ss(n,E.chunk)&&o.current.ms<n.chunks[E.chunk].startMs){C(n.chunks[E.chunk].startMs,!1);return}if(o.current.ms=Math.min(R,n.durationMs),w(o.current.ms),p(o.current.ms),o.current.ms>=n.durationMs){m(!1),C(n.durationMs,!0);return}l=requestAnimationFrame(g)};return l=requestAnimationFrame(g),()=>cancelAnimationFrame(l)},[h,y,n,w,C,d]);const D=()=>{if(h){m(!1),C(o.current.ms,!0);return}C(o.current.ms>=n.durationMs?u:o.current.ms,!1),m(!0)},q=Ne(n,x),M=l=>`${n.durationMs>0?l/n.durationMs*100:0}%`,I=ve(e.endReason),_=l=>$.current?we(n,l):l;return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx("div",{role:"region","aria-label":`Video of ${s}`,className:"w-fit origin-top-left",style:{zoom:.6},children:t.jsx(Oe,{screenKey:d,chrome:q,deviceReady:!0,platform:n.meta.platform??"ios",binaryFrameHandlerRef:i,replay:!0})}),t.jsxs("div",{className:"flex max-w-xl flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(be,{delayDuration:150,children:t.jsxs("div",{className:"relative mx-2 h-2",children:[n.gaps.map((l,N)=>t.jsxs(ne,{children:[t.jsx(ae,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":`${P(l.fromMs)} to ${P(l.toMs)}: did not reach the relay`,onClick:()=>C(l.toMs,!h),className:"absolute top-0 h-2 rounded-full bg-muted-foreground/40 active:transform-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",style:{left:M(l.fromMs),width:`max(8px, calc(${M(l.toMs)} - ${M(l.fromMs)}))`}})}),t.jsxs(le,{children:[P(l.fromMs),"–",P(l.toMs)," · did not reach the relay"]})]},`g${N}`)),n.steps.map(l=>t.jsxs(ne,{children:[t.jsx(ae,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":`${P(l.ms)} ${l.name}${l.status==="failed"?", failed":""}`,onClick:()=>C(l.ms,!h),className:`absolute top-0 -ml-1 h-2 w-2 rounded-full active:transform-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${l.status==="failed"?"bg-destructive":"bg-muted-foreground"}`,style:{left:M(l.ms)}})}),t.jsxs(le,{children:[P(l.ms)," · ",l.name,l.status==="failed"&&t.jsx("span",{className:"font-medium",children:" · failed"})]})]},`s${l.index}`))]})}),t.jsx(Pe,{min:0,max:Math.max(1,n.durationMs),step:50,value:[x],onPointerDown:()=>{$.current=!0},onValueChange:([l])=>C(_(l??0),!h),onValueCommit:()=>{$.current=!1},"aria-label":`Position in the video of ${s}`,"aria-valuetext":`${P(x)} of ${P(n.durationMs)}`})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(A,{ref:r,size:"sm",variant:"outline",onClick:D,"aria-label":h?"Pause":"Play",children:h?t.jsx(Xe,{className:"h-3.5 w-3.5","aria-hidden":!0}):t.jsx(Qe,{className:"h-3.5 w-3.5","aria-hidden":!0})}),t.jsxs(F,{className:"text-muted-foreground",children:[P(x)," / ",P(n.durationMs)]}),t.jsxs(Ae,{value:String(y),onValueChange:l=>k(Number(l)),children:[t.jsx(Be,{"aria-label":"Playback speed",className:"ml-auto h-8 w-20 text-xs",children:t.jsx(ze,{})}),t.jsx(Ve,{children:Ye.map(l=>t.jsxs(Ke,{value:String(l),children:[l,"×"]},l))})]})]}),(I||!e.ended)&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[I,!e.ended&&t.jsxs(t.Fragment,{children:[I&&" ","Loaded while the flow was still running."," ",t.jsx("button",{type:"button",onClick:f,className:"underline underline-offset-2 hover:text-foreground",children:"Load the rest"})]})]})]})]})]})}function Rs(){const n=B.c(16),{runId:e}=Ze(),s=e===void 0?"":e;let a;n[0]!==s?(a=ce.run(s),n[0]=s,n[1]=a):a=n[1];let f;n[2]!==s?(f=m=>{const{signal:y}=m;return Re(s,y)},n[2]=s,n[3]=f):f=n[3];let r;n[4]!==a||n[5]!==f?(r={queryKey:a,queryFn:f,refetchInterval:as},n[4]=a,n[5]=f,n[6]=r):r=n[6];const c=ie(r),i=c.data;let u;n[7]!==i?(u=i?de(i.build):"Run",n[7]=i,n[8]=u):u=n[8];const d=u,{setNode:j}=Me();let x,p;n[9]!==d||n[10]!==j?(x=()=>(j(t.jsxs("span",{className:"flex items-center gap-1.5 text-sm",children:[t.jsx(Q,{to:"/automation/runs",className:"text-muted-foreground hover:text-foreground",children:"Flow Runs"}),t.jsx("span",{className:"text-muted-foreground",children:"/"}),t.jsx("span",{className:"font-medium",children:d})]})),()=>j(null)),p=[j,d],n[9]=d,n[10]=j,n[11]=x,n[12]=p):(x=n[11],p=n[12]),S.useEffect(x,p);let h;return n[13]!==i||n[14]!==c?(h=t.jsx("div",{className:"flex flex-col gap-5 p-6",children:i?t.jsx(ls,{run:i}):i===null?t.jsx("p",{className:"text-sm text-muted-foreground",children:"This run is gone. A run is deleted with its build, or after 7 days when it has none."}):c.isError?t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Couldn't load this run.",t.jsx(A,{variant:"outline",size:"sm",className:"ml-3",onClick:()=>void c.refetch(),children:"Try again"})]}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"})}),n[13]=i,n[14]=c,n[15]=h):h=n[15],h}function as(n){return Le(n.state.data?[n.state.data.status]:void 0)}function ls(n){var Z,J,X,Y,ee,se;const e=B.c(84),{run:s}=n;let a;e[0]!==s?(a=Ie(s),e[0]=s,e[1]=a):a=e[1];const f=a;let r;e[2]!==s.failureKind||e[3]!==s.status?(r=ue(s.status,s.failureKind),e[2]=s.failureKind,e[3]=s.status,e[4]=r):r=e[4];const c=r;let i;e[5]!==((Z=s.deviceReset)==null?void 0:Z.devices)?(i=((J=s.deviceReset)==null?void 0:J.devices)??[],e[5]=(X=s.deviceReset)==null?void 0:X.devices,e[6]=i):i=e[6];const u=i,d=u.length>1;let j;e[7]!==s.build?(j=de(s.build),e[7]=s.build,e[8]=j):j=e[8];let x;e[9]!==j?(x=t.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:j}),e[9]=j,e[10]=x):x=e[10];let p;e[11]!==c.label||e[12]!==c.tone?(p=t.jsx(H,{tone:c.tone,className:"text-xs",children:c.label}),e[11]=c.label,e[12]=c.tone,e[13]=p):p=e[13];let h;e[14]!==x||e[15]!==p?(h=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x,p]}),e[14]=x,e[15]=p,e[16]=h):h=e[16];let m;e[17]!==s?(m=Te(s),e[17]=s,e[18]=m):m=e[18];let y;e[19]!==m?(y=t.jsx("span",{children:m}),e[19]=m,e[20]=y):y=e[20];let k;e[21]!==s.ci?(k=((Y=s.ci)==null?void 0:Y.commit)&&t.jsx(F,{children:Ee(s.ci.commit)}),e[21]=s.ci,e[22]=k):k=e[22];let o;e[23]!==s.serviceTier?(o=s.serviceTier&&t.jsxs("span",{children:["Services ",t.jsx(F,{children:ms(s.serviceTier)})]}),e[23]=s.serviceTier,e[24]=o):o=e[24];let b;e[25]!==s.deviceReset||e[26]!==d?(b=!d&&((ee=s.deviceReset)==null?void 0:ee.booted)&&t.jsxs("span",{children:["Device ",t.jsx(F,{children:ge(s.deviceReset)})]}),e[25]=s.deviceReset,e[26]=d,e[27]=b):b=e[27];let $;e[28]!==s.createdAt?($=qe(s.createdAt),e[28]=s.createdAt,e[29]=$):$=e[29];let w;e[30]!==$?(w=t.jsxs("span",{children:["Started ",$]}),e[30]=$,e[31]=w):w=e[31];const C=s.finishedAt?"Took":"Running for";let D;e[32]!==s?(D=_e(s),e[32]=s,e[33]=D):D=e[33];let q;e[34]!==D?(q=t.jsx(F,{children:D}),e[34]=D,e[35]=q):q=e[35];let M;e[36]!==C||e[37]!==q?(M=t.jsxs("span",{children:[C," ",q]}),e[36]=C,e[37]=q,e[38]=M):M=e[38];let I;e[39]!==s.exitCode?(I=s.exitCode!==null&&t.jsxs("span",{children:["Exit code ",t.jsx(F,{children:s.exitCode})]}),e[39]=s.exitCode,e[40]=I):I=e[40];let _;e[41]!==k||e[42]!==o||e[43]!==b||e[44]!==w||e[45]!==M||e[46]!==I||e[47]!==y?(_=t.jsxs("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",children:[y,k,o,b,w,M,I]}),e[41]=k,e[42]=o,e[43]=b,e[44]=w,e[45]=M,e[46]=I,e[47]=y,e[48]=_):_=e[48];let l;e[49]!==_||e[50]!==h?(l=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,_]}),e[49]=_,e[50]=h,e[51]=l):l=e[51];const N=f??(s.status==="running"?"Running. This page follows the run.":"");let g;e[52]!==N?(g=t.jsx("p",{role:"status",className:"text-sm",children:N}),e[52]=N,e[53]=g):g=e[53];let v;e[54]!==s.watchSessionId||e[55]!==d?(v=!d&&s.watchSessionId&&t.jsx(A,{asChild:!0,size:"sm",children:t.jsxs(Q,{to:`/automation/sessions/${encodeURIComponent(s.watchSessionId)}`,children:[t.jsx(he,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),"Watch the device"]})}),e[54]=s.watchSessionId,e[55]=d,e[56]=v):v=e[56];let R;e[57]!==s.ci?(R=((se=s.ci)==null?void 0:se.jobUrl)&&t.jsx(A,{asChild:!0,size:"sm",variant:"outline",children:t.jsxs("a",{href:s.ci.jobUrl,target:"_blank",rel:"noreferrer noopener",children:["Open the CI run",t.jsx(Je,{className:"ml-1.5 h-3.5 w-3.5","aria-hidden":!0})]})}),e[57]=s.ci,e[58]=R):R=e[58];let E;e[59]!==s.build?(E=s.build&&t.jsx(A,{asChild:!0,size:"sm",variant:"outline",children:t.jsx(Q,{to:`/automation/runs?source=all&build=${s.build.id}`,children:"Other runs of this build"})}),e[59]=s.build,e[60]=E):E=e[60];let T;e[61]!==v||e[62]!==R||e[63]!==E?(T=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[v,R,E]}),e[61]=v,e[62]=R,e[63]=E,e[64]=T):T=e[64];let L;e[65]!==l||e[66]!==g||e[67]!==T?(L=t.jsxs("div",{className:"flex flex-col gap-4",children:[l,g,T]}),e[65]=l,e[66]=g,e[67]=T,e[68]=L):L=e[68];let z;e[69]!==u||e[70]!==s||e[71]!==d?(z=d&&t.jsx(rs,{run:s,devices:u}),e[69]=u,e[70]=s,e[71]=d,e[72]=z):z=e[72];let V;if(e[73]!==s.flows||e[74]!==s.id){let U;e[76]!==s.id?(U=te=>t.jsx(is,{runId:s.id,flow:te},te.idx),e[76]=s.id,e[77]=U):U=e[77],V=s.flows.map(U),e[73]=s.flows,e[74]=s.id,e[75]=V}else V=e[75];let K;e[78]!==V?(K=t.jsx("ol",{className:"flex flex-col gap-3","aria-label":"Flows",children:V}),e[78]=V,e[79]=K):K=e[79];let O;return e[80]!==L||e[81]!==z||e[82]!==K?(O=t.jsxs(t.Fragment,{children:[L,z,K]}),e[80]=L,e[81]=z,e[82]=K,e[83]=O):O=e[83],O}function rs(n){var d,j,x,p;const e=B.c(15),{run:s,devices:a}=n;let f;e[0]!==s.watchSessionIds?(f=s.watchSessionIds??[],e[0]=s.watchSessionIds,e[1]=f):f=e[1];let r;e[2]!==f?(r=new Set(f),e[2]=f,e[3]=r):r=e[3];const c=r;let i;if(e[4]!==a||e[5]!==((d=s.deviceReset)==null?void 0:d.requested)||e[6]!==s.flows||e[7]!==c){let h;e[9]!==((j=s.deviceReset)==null?void 0:j.requested)||e[10]!==s.flows||e[11]!==c?(h=(m,y)=>{var b;const k=m.deviceName??m.deviceId??`Device ${y+1}`,o=s.flows.find($=>{var w;return $.status==="running"&&((w=$.device)==null?void 0:w.sessionId)===m.sessionId});return t.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-4 py-2.5 text-sm",children:[t.jsx("span",{className:"font-medium",children:k}),t.jsx(F,{className:"text-muted-foreground",children:ge({requested:((b=s.deviceReset)==null?void 0:b.requested)??!1,cold:m.cold,report:m.report})}),o&&t.jsxs("span",{className:"text-muted-foreground",children:["Running ",o.name]}),c.has(m.sessionId)&&t.jsx(A,{asChild:!0,size:"sm",variant:"outline",className:"ml-auto h-7",children:t.jsxs(Q,{to:`/automation/sessions/${encodeURIComponent(m.sessionId)}`,"aria-label":`Watch ${k}`,children:[t.jsx(he,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),"Watch"]})})]},m.sessionId)},e[9]=(x=s.deviceReset)==null?void 0:x.requested,e[10]=s.flows,e[11]=c,e[12]=h):h=e[12],i=a.map(h),e[4]=a,e[5]=(p=s.deviceReset)==null?void 0:p.requested,e[6]=s.flows,e[7]=c,e[8]=i}else i=e[8];let u;return e[13]!==i?(u=t.jsx("ul",{className:"flex flex-col divide-y rounded-md border bg-card","aria-label":"Devices",children:i}),e[13]=i,e[14]=u):u=e[14],u}function W(n){return n.status==="passed"||n.status==="failed"}function is(n){var k,o;const e=B.c(36),{runId:s,flow:a}=n;let f;e[0]!==a?(f=W(a)?ue(a.status,a.failureKind):null,e[0]=a,e[1]=f):f=e[1];const r=f;let c;e[2]!==a.name?(c=t.jsx("span",{className:"text-sm font-medium",children:a.name}),e[2]=a.name,e[3]=c):c=e[3];let i;e[4]!==(r==null?void 0:r.label)||e[5]!==(r==null?void 0:r.tone)||e[6]!==a?(i=a.status==="skipped"?t.jsx(H,{tone:"backlog",className:"text-xs",children:De[a.skipReason]??"Skipped"}):W(a)?t.jsxs(t.Fragment,{children:[t.jsx(H,{tone:r==null?void 0:r.tone,className:"text-xs",children:r==null?void 0:r.label}),t.jsx(F,{className:"text-muted-foreground",children:fe(a.durationMs)}),((k=a.device)==null?void 0:k.name)&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.device.name})]}):t.jsx(H,{tone:a.status==="running"?"progress":"backlog",className:"text-xs",children:a.status==="running"&&((o=a.device)!=null&&o.name)?`Running on ${a.device.name}`:Fe[a.status]}),e[4]=r==null?void 0:r.label,e[5]=r==null?void 0:r.tone,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==c||e[9]!==i?(u=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c,i]}),e[8]=c,e[9]=i,e[10]=u):u=e[10];let d;e[11]!==a.file?(d=a.file&&t.jsx(F,{className:"block text-muted-foreground",children:a.file}),e[11]=a.file,e[12]=d):d=e[12];let j;e[13]!==u||e[14]!==d?(j=t.jsxs("div",{className:"flex flex-col gap-1",children:[u,d]}),e[13]=u,e[14]=d,e[15]=j):j=e[15];let x;e[16]!==a.failureMessage||e[17]!==a.status?(x=a.status==="skipped"&&a.failureMessage&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a.failureMessage}),e[16]=a.failureMessage,e[17]=a.status,e[18]=x):x=e[18];let p;e[19]!==a||e[20]!==s?(p=W(a)&&a.status==="failed"&&t.jsxs(t.Fragment,{children:[a.failureMessage&&t.jsx("p",{className:"text-sm text-destructive",children:a.failureMessage}),a.steps.length>0&&t.jsx("ol",{className:"flex flex-col gap-1 text-xs","aria-label":`Steps of ${a.name}`,children:a.steps.map(cs)}),a.hasScreenshot&&t.jsx(re,{runId:s,flow:a})]}),e[19]=a,e[20]=s,e[21]=p):p=e[21];let h;e[22]!==a||e[23]!==s?(h=W(a)&&a.status==="passed"&&a.hasScreenshot&&t.jsx(re,{runId:s,flow:a}),e[22]=a,e[23]=s,e[24]=h):h=e[24];let m;e[25]!==a.idx||e[26]!==a.name||e[27]!==a.video||e[28]!==s?(m=a.video&&t.jsx(es,{runId:s,idx:a.idx,flowName:a.name,summary:a.video,running:!a.video.ended}),e[25]=a.idx,e[26]=a.name,e[27]=a.video,e[28]=s,e[29]=m):m=e[29];let y;return e[30]!==m||e[31]!==j||e[32]!==x||e[33]!==p||e[34]!==h?(y=t.jsxs("li",{className:"flex flex-col gap-6 rounded-md border bg-card p-4",children:[j,x,p,h,m]}),e[30]=m,e[31]=j,e[32]=x,e[33]=p,e[34]=h,e[35]=y):y=e[35],y}function cs(n){return t.jsxs("li",{className:"flex gap-2",children:[t.jsxs("span",{className:n.status==="failed"?"text-destructive":"text-muted-foreground",children:[n.status==="passed"?"✓":n.status==="failed"?"✗":"–",t.jsxs("span",{className:"sr-only",children:[" ",n.status]})]}),t.jsxs("span",{className:"min-w-0 flex-1",children:[n.name,n.message&&t.jsx("span",{className:"block text-muted-foreground",children:n.message}),n.suggestions&&n.suggestions.length>0&&t.jsx(os,{step:n})]}),t.jsx(F,{className:"text-muted-foreground",children:fe(n.durationMs)})]},n.index)}function os(n){const e=B.c(8),{step:s}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("span",{className:"text-muted-foreground",children:"Try instead, from the screen it failed on:"}),e[0]=a):a=e[0];let f;if(e[1]!==s.name||e[2]!==s.suggestions){let c;e[4]!==s.name?(c=(i,u)=>t.jsx(ds,{yaml:i.yaml,n:u+1,stepName:s.name},i.yaml),e[4]=s.name,e[5]=c):c=e[5],f=s.suggestions.map(c),e[1]=s.name,e[2]=s.suggestions,e[3]=f}else f=e[3];let r;return e[6]!==f?(r=t.jsxs("span",{className:"mt-1.5 flex flex-col gap-1",children:[a,f]}),e[6]=f,e[7]=r):r=e[7],r}function ds(n){const e=B.c(11),{yaml:s,n:a,stepName:f}=n,r=S.useRef(null),c=`Suggested line ${a} for ${f}`;let i;e[0]!==c||e[1]!==s?(i=t.jsx(Ce,{ref:r,readOnly:!0,value:s,"aria-label":c,onFocus:fs,className:"h-7 min-w-0 font-mono"}),e[0]=c,e[1]=s,e[2]=i):i=e[2];const u=`Copy suggested line ${a}`;let d;e[3]!==s?(d=()=>{(navigator.clipboard?navigator.clipboard.writeText(s):Promise.reject(new Error("no clipboard"))).then(us).catch(()=>{var p;oe.error("Could not copy — select the line and copy it by hand"),(p=r.current)==null||p.focus()})},e[3]=s,e[4]=d):d=e[4];let j;e[5]!==u||e[6]!==d?(j=t.jsx(A,{type:"button",size:"sm",variant:"outline",className:"h-7","aria-label":u,onClick:d,children:"Copy"}),e[5]=u,e[6]=d,e[7]=j):j=e[7];let x;return e[8]!==i||e[9]!==j?(x=t.jsxs("span",{className:"flex items-center gap-2",children:[i,j]}),e[8]=i,e[9]=j,e[10]=x):x=e[10],x}function us(){return oe.success("Copied")}function fs(n){return n.currentTarget.select()}function re(n){const e=B.c(10),{runId:s,flow:a}=n;let f;e[0]!==a.idx||e[1]!==s?(f=$e(s,a.idx),e[0]=a.idx,e[1]=s,e[2]=f):f=e[2];const r=f,c=a.status==="failed"?`The screen when ${a.name} failed`:`The screen ${a.name} ended on`,i=`${a.status==="failed"?"max-h-96":"max-h-64"} rounded-md border`;let u;e[3]!==c||e[4]!==i||e[5]!==r?(u=t.jsx("img",{src:r,alt:c,loading:"lazy",className:i}),e[3]=c,e[4]=i,e[5]=r,e[6]=u):u=e[6];let d;return e[7]!==u||e[8]!==r?(d=t.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:"block w-fit",children:u}),e[7]=u,e[8]=r,e[9]=d):d=e[9],d}function ge(n){var a;const e=((a=n.report)==null?void 0:a.failed)??[],s=n.requested?n.report?n.report.done.length===0?e.length>0?`reset failed: ${e.join(", ")}`:"nothing reset":e.length>0?`reset except ${e.join(", ")}`:"reset":"reset not confirmed":"not reset";return n.cold===!1?`${s}, already running`:s}function ms(n){return n.keep.length>0?`${n.name}, keeping ${n.keep.join(", ")}`:n.name}export{Rs as RunDetail};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as xe,r as Z,j as l}from"./vendor-react-DTSdA8m-.js";import{G as Ke,ak as Oe,c as Ue,O as qe,q as Ge,al as He,$ as Ve,B as Ee,am as We}from"./index-C_3Q51YJ.js";import{B as Be}from"./badge-BjEnOmb0.js";import{S as ze}from"./search-input-B0s9mzRt.js";import{T as Re}from"./tech-label-KAwM5qZ_.js";import{a as Me,T as he,c as Qe}from"./tabs-Bf7ou-eS.js";import{S as Xe,a as Je,b as Ye,c as ke,d as Ze}from"./select-CHbE6M4S.js";import{l as et,T as tt,a as st,b as X,c as lt,d as De,e as J,L as at}from"./list-view-CyM0QUaH.js";import{u as rt}from"./useFocusAfterSwap-BdItkQCu.js";import{r as Fe,f as nt,a as Ce,b as it,c as ot,R as ct,p as ut}from"./runs-CFQ6M4rx.js";import{c as dt,a as ft,L as mt}from"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";import"./useShownAfter-By1Yxysz.js";/**
|
|
2
|
+
* @license lucide-react v1.59.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 $e={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};$e.node;const ht=Ke($e),xt=300,Ae=["running","passed","failed","aborted"],Le="newest";function Dt(){var be,ge,we,je,ve,Se,Ne,Te,ye,Pe;const e=xe.c(89),[t,s]=dt();let c;e[0]!==t?(c=["ci","local","all"].find(r=>r===t.get("source"))??"ci",e[0]=t,e[1]=c):c=e[1];const i=c;let x;e[2]!==t?(x=r=>r===t.get("status"),e[2]=t,e[3]=x):x=e[3];const u=Ae.find(x);let h;e[4]!==t?(h=t.get("build"),e[4]=t,e[5]=h):h=e[5];const p=Number(h);let g;e[6]!==p?(g=Number.isInteger(p)&&p>0?p:void 0,e[6]=p,e[7]=g):g=e[7];const d=g;let k;e[8]!==t?(k=t.get("flow")??"",e[8]=t,e[9]=k):k=e[9];const o=k,P=t.get("after")?{after:t.get("after")}:t.get("before")?{before:t.get("before")}:{},{setNode:b}=Oe();let w,j;e[10]!==b?(w=()=>(b(l.jsx("span",{className:"text-sm font-medium",children:"Flow Runs"})),()=>b(null)),j=[b],e[10]=b,e[11]=w,e[12]=j):(w=e[11],j=e[12]),Z.useEffect(w,j);let v;e[13]!==s?(v=function(y,L){s(Ie=>ue(Ie,y,L),{replace:!0})},e[13]=s,e[14]=v):v=e[14];const f=v,[m,S]=Z.useState(o),[R,C]=Z.useState(o);o!==R&&(C(o),o!==m.trim()&&S(o));let N,T;e[15]!==o||e[16]!==m||e[17]!==s?(N=()=>{const r=m.trim();if(r===o)return;const y=setTimeout(()=>s(L=>ue(L,"flow",r||null),{replace:!0}),xt);return()=>clearTimeout(y)},T=[m,o,s],e[15]=o,e[16]=m,e[17]=s,e[18]=N,e[19]=T):(N=e[18],T=e[19]),Z.useEffect(N,T);const _={...i==="all"?{}:{ci:i==="ci"},...u?{status:u}:{},...o?{flow:o}:{},...d!==void 0?{build:d}:{}},D=Ge.runs({..._,...P}),F=r=>{const{signal:y}=r;return He(_,P,y)};let A;e[20]!==D||e[21]!==F?(A={queryKey:D,queryFn:F,placeholderData:Ve,refetchInterval:gt},e[20]=D,e[21]=F,e[22]=A):A=e[22];const a=Ue(A),n=(be=a.data)==null?void 0:be.items,E=!!(P.before||P.after),de=a.isFetchedAfterMount&&(a.isPlaceholderData||a.isLoading);let ee;e[23]!==de||e[24]!==n||e[25]!==a.isLoadingError?(ee=de?"error":et({data:n,isError:a.isLoadingError}),e[23]=de,e[24]=n,e[25]=a.isLoadingError,e[26]=ee):ee=e[26];const B=ee,pe=Z.useRef(null),fe=rt(B,pe);let te;e[27]!==s?(te=function(y){s(L=>ue(ue(L,"before",y.before??null),"after",y.after??null))},e[27]=s,e[28]=te):te=e[28];const se=te;let le;if(e[29]!==d||e[30]!==n){const r=d===void 0||(ge=n==null?void 0:n.find(y=>{var L;return((L=y.build)==null?void 0:L.id)===d}))==null?void 0:ge.build;le=d===void 0?null:r?Fe(r):`build ${d}`,e[29]=d,e[30]=n,e[31]=le}else le=e[31];const Y=le;let ae;e[32]===Symbol.for("react.memo_cache_sentinel")?(ae=l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Flow Runs"}),e[32]=ae):ae=e[32];let $;e[33]!==f?($=r=>f("source",r==="ci"?null:r),e[33]=f,e[34]=$):$=e[34];let re;e[35]===Symbol.for("react.memo_cache_sentinel")?(re=l.jsxs(Me,{"aria-label":"Where the run came from",children:[l.jsx(he,{ref:pe,value:"all",children:"All"}),l.jsx(he,{value:"ci",children:"CI"}),l.jsx(he,{value:"local",children:"Local"})]}),e[35]=re):re=e[35];let I;e[36]!==i||e[37]!==$?(I=l.jsx(Qe,{value:i,onValueChange:$,children:re}),e[36]=i,e[37]=$,e[38]=I):I=e[38];const me=u??"any";let K;e[39]!==f?(K=r=>f("status",r==="any"?null:r),e[39]=f,e[40]=K):K=e[40];let ne;e[41]===Symbol.for("react.memo_cache_sentinel")?(ne=l.jsx(Xe,{className:"h-8 w-36","aria-label":"Status",children:l.jsx(Je,{})}),e[41]=ne):ne=e[41];let ie;e[42]===Symbol.for("react.memo_cache_sentinel")?(ie=l.jsxs(Ye,{children:[l.jsx(ke,{value:"any",children:"Any status"}),Ae.map(bt)]}),e[42]=ie):ie=e[42];let O;e[43]!==me||e[44]!==K?(O=l.jsxs(Ze,{value:me,onValueChange:K,children:[ne,ie]}),e[43]=me,e[44]=K,e[45]=O):O=e[45];let U;e[46]!==m||e[47]!==S?(U=l.jsx(ze,{value:m,onChange:S,placeholder:"Flow name","aria-label":"Flow name"}),e[46]=m,e[47]=S,e[48]=U):U=e[48];let q;e[49]!==Y||e[50]!==f?(q=Y&&l.jsxs(Be,{variant:"outline",className:"gap-1 pr-1 text-xs font-normal",children:[Y,l.jsx(Ee,{variant:"ghost",size:"icon-sm",className:"h-5 w-5","aria-label":`Show runs of every build, not only ${Y}`,onClick:()=>f("build",null),children:l.jsx(We,{className:"h-3 w-3","aria-hidden":!0})})]}),e[49]=Y,e[50]=f,e[51]=q):q=e[51];let G;e[52]!==I||e[53]!==O||e[54]!==U||e[55]!==q?(G=l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[I,O,U,q]}),e[52]=I,e[53]=O,e[54]=U,e[55]=q,e[56]=G):G=e[56];let oe;e[57]===Symbol.for("react.memo_cache_sentinel")?(oe=l.jsx(lt,{children:l.jsxs(De,{children:[l.jsx(J,{children:"Status"}),l.jsx(J,{children:"Build"}),l.jsx(J,{children:"Flows passed"}),l.jsx(J,{children:"Source"}),l.jsx(J,{children:"Started"}),l.jsx(J,{children:"Duration"})]})}),e[57]=oe):oe=e[57];let H;e[58]!==d||e[59]!==o||e[60]!==E||e[61]!==i||e[62]!==u?(H=E?"No runs on this page any more. Newer goes back to the newest runs.":jt(i,!!(u||o||d!==void 0)),e[58]=d,e[59]=o,e[60]=E,e[61]=i,e[62]=u,e[63]=H):H=e[63];let V;e[64]!==a?(V=()=>void a.refetch(),e[64]=a,e[65]=V):V=e[65];let W;e[66]!==H||e[67]!==V||e[68]!==B?(W=l.jsx(at,{view:B,colSpan:6,rowHeight:54,noun:"flow runs",emptyText:H,onRetry:V}),e[66]=H,e[67]=V,e[68]=B,e[69]=W):W=e[69];let z;e[70]!==n||e[71]!==B?(z=B==="list"&&(n==null?void 0:n.map(pt)),e[70]=n,e[71]=B,e[72]=z):z=e[72];let M;e[73]!==fe||e[74]!==a.isPlaceholderData||e[75]!==W||e[76]!==z?(M=l.jsx("div",{className:"rounded-md border bg-card",children:l.jsxs(tt,{children:[oe,l.jsxs(st,{...fe,"aria-busy":a.isPlaceholderData,children:[W,z]})]})}),e[73]=fe,e[74]=a.isPlaceholderData,e[75]=W,e[76]=z,e[77]=M):M=e[77];let Q;e[78]!==se||e[79]!==E||e[80]!==(n==null?void 0:n.length)||e[81]!==((we=a.data)==null?void 0:we.nextCursor)||e[82]!==((je=a.data)==null?void 0:je.prevCursor)||e[83]!==a.isPlaceholderData?(Q=(E||((ve=a.data)==null?void 0:ve.prevCursor)||((Se=a.data)==null?void 0:Se.nextCursor))&&l.jsxs("nav",{"aria-label":"Pages of flow runs",className:"flex items-center justify-end gap-2",children:[l.jsxs(_e,{cursor:a.isPlaceholderData?null:((Ne=a.data)==null?void 0:Ne.prevCursor)??(E&&!(n!=null&&n.length)?Le:null),onGo:r=>se(r===Le?{}:{after:r}),children:[l.jsx(ht,{className:"mr-1 h-3.5 w-3.5","aria-hidden":!0}),"Newer"]}),l.jsxs(_e,{cursor:a.isPlaceholderData?null:((Te=a.data)==null?void 0:Te.nextCursor)??null,onGo:r=>se({before:r}),children:["Older",l.jsx(qe,{className:"ml-1 h-3.5 w-3.5","aria-hidden":!0})]})]}),e[78]=se,e[79]=E,e[80]=n==null?void 0:n.length,e[81]=(ye=a.data)==null?void 0:ye.nextCursor,e[82]=(Pe=a.data)==null?void 0:Pe.prevCursor,e[83]=a.isPlaceholderData,e[84]=Q):Q=e[84];let ce;return e[85]!==G||e[86]!==M||e[87]!==Q?(ce=l.jsxs("div",{className:"flex flex-col gap-5 p-6",children:[ae,G,M,Q]}),e[85]=G,e[86]=M,e[87]=Q,e[88]=ce):ce=e[88],ce}function pt(e){return l.jsx(vt,{run:e},e.id)}function bt(e){return l.jsx(ke,{value:e,children:ct[e]},e)}function gt(e){var t;return ut((t=e.state.data)==null?void 0:t.items.map(wt))}function wt(e){return e.status}function ue(e,t,s){const c=new URLSearchParams(e);return t!=="before"&&t!=="after"&&(c.delete("before"),c.delete("after")),s===null?c.delete(t):c.set(t,s),c}function _e(e){const t=xe.c(7),{cursor:s,onGo:c,children:i}=e,x=s===null;let u;t[0]!==s||t[1]!==c?(u=()=>{s!==null&&c(s)},t[0]=s,t[1]=c,t[2]=u):u=t[2];let h;return t[3]!==i||t[4]!==x||t[5]!==u?(h=l.jsx(Ee,{variant:"outline",size:"sm",className:"aria-disabled:opacity-50","aria-disabled":x,onClick:u,children:i}),t[3]=i,t[4]=x,t[5]=u,t[6]=h):h=t[6],h}function jt(e,t){return t?"No runs match these filters.":e==="ci"?"No CI runs yet. A run is recorded when tapflow flow run has a token.":e==="local"?"No local runs yet.":"No runs yet. A run is recorded when tapflow flow run has a token."}function vt(e){var D,F;const t=xe.c(48),{run:s}=e,c=ft(),i=`/automation/runs/${s.id}`;let x;t[0]!==s.build?(x=Fe(s.build),t[0]=s.build,t[1]=x):x=t[1];const u=x;let h;t[2]!==s.failureKind||t[3]!==s.status?(h=nt(s.status,s.failureKind),t[2]=s.failureKind,t[3]=s.status,t[4]=h):h=t[4];const p=h;let g;t[5]!==i||t[6]!==c?(g=A=>{var a;A.target.closest('a, button, input, [role="button"]')||(a=window.getSelection())!=null&&a.toString()||(A.metaKey||A.ctrlKey?window.open(i,"_blank","noopener"):c(i))},t[5]=i,t[6]=c,t[7]=g):g=t[7];let d;t[8]!==p.label||t[9]!==p.tone?(d=l.jsx(X,{children:l.jsx(Be,{tone:p.tone,className:"text-xs",children:p.label})}),t[8]=p.label,t[9]=p.tone,t[10]=d):d=t[10];const k=p.label;let o;t[11]!==s.createdAt?(o=Ce(s.createdAt),t[11]=s.createdAt,t[12]=o):o=t[12];const P=`${u}, ${k}, ${o}`;let b;t[13]!==u||t[14]!==i||t[15]!==P?(b=l.jsx(X,{className:"text-sm",children:l.jsx(mt,{to:i,className:"rounded-sm font-medium underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":P,children:u})}),t[13]=u,t[14]=i,t[15]=P,t[16]=b):b=t[16];let w;t[17]!==s.flowsPassed||t[18]!==s.flowsTotal?(w=l.jsxs(Re,{children:[s.flowsPassed,"/",s.flowsTotal]}),t[17]=s.flowsPassed,t[18]=s.flowsTotal,t[19]=w):w=t[19];let j;t[20]!==s.flowsSkipped?(j=s.flowsSkipped>0&&l.jsxs("span",{className:"ml-1 text-xs text-muted-foreground",children:["(",s.flowsSkipped," skipped)"]}),t[20]=s.flowsSkipped,t[21]=j):j=t[21];let v;t[22]!==s.deviceReset?(v=(((F=(D=s.deviceReset)==null?void 0:D.devices)==null?void 0:F.length)??0)>1&&l.jsxs("span",{className:"ml-1 text-xs text-muted-foreground",children:["on ",s.deviceReset.devices.length," devices"]}),t[22]=s.deviceReset,t[23]=v):v=t[23];let f;t[24]!==j||t[25]!==v||t[26]!==w?(f=l.jsxs(X,{children:[w,j,v]}),t[24]=j,t[25]=v,t[26]=w,t[27]=f):f=t[27];let m;t[28]!==s?(m=it(s),t[28]=s,t[29]=m):m=t[29];let S;t[30]!==m?(S=l.jsx(X,{className:"text-sm text-muted-foreground",children:m}),t[30]=m,t[31]=S):S=t[31];let R;t[32]!==s.createdAt?(R=Ce(s.createdAt),t[32]=s.createdAt,t[33]=R):R=t[33];let C;t[34]!==R?(C=l.jsx(X,{className:"text-sm text-muted-foreground",children:R}),t[34]=R,t[35]=C):C=t[35];let N;t[36]!==s?(N=ot(s),t[36]=s,t[37]=N):N=t[37];let T;t[38]!==N?(T=l.jsx(X,{children:l.jsx(Re,{children:N})}),t[38]=N,t[39]=T):T=t[39];let _;return t[40]!==f||t[41]!==S||t[42]!==C||t[43]!==T||t[44]!==g||t[45]!==d||t[46]!==b?(_=l.jsxs(De,{className:"cursor-pointer",onClick:g,children:[d,b,f,S,C,T]}),t[40]=f,t[41]=S,t[42]=C,t[43]=T,t[44]=g,t[45]=d,t[46]=b,t[47]=_):_=t[47],_}export{Dt as Runs};
|
|
Binary file
|
|
Binary file
|