@limrun/ui 0.17.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsx as k, jsxs as oe, Fragment as Lr } from "react/jsx-runtime";
2
- import { memo as er, useState as V, useEffect as de, useMemo as Re, useCallback as bn, lazy as Rn, forwardRef as Nn, useRef as O, useImperativeHandle as In, Suspense as Yn } from "react";
2
+ import { memo as er, useState as V, useEffect as de, useMemo as Ne, useCallback as bn, lazy as Rn, forwardRef as Nn, useRef as O, useImperativeHandle as In, Suspense as Yn } from "react";
3
3
  import { createPortal as Kn } from "react-dom";
4
4
  import './index.css';function Fr(r) {
5
5
  var t, c, a = "";
@@ -10,7 +10,7 @@ import './index.css';function Fr(r) {
10
10
  } else for (c in r) r[c] && (a && (a += " "), a += c);
11
11
  return a;
12
12
  }
13
- function Ne() {
13
+ function Ie() {
14
14
  for (var r, t, c = 0, a = "", E = arguments.length; c < E; c++) (r = arguments[c]) && (t = Fr(r)) && (a && (a += " "), a += t);
15
15
  return a;
16
16
  }
@@ -771,7 +771,7 @@ const ui = async (r) => {
771
771
  "button",
772
772
  {
773
773
  type: "button",
774
- className: Ne("rc-inspect-box", !t.enabled && "rc-inspect-box-disabled"),
774
+ className: Ie("rc-inspect-box", !t.enabled && "rc-inspect-box-disabled"),
775
775
  "data-ax-id": t.id,
776
776
  "data-ax-path": t.path,
777
777
  "data-ax-label": t.label || void 0,
@@ -806,15 +806,15 @@ const ui = async (r) => {
806
806
  const X = window.setTimeout(() => b(null), 1100);
807
807
  return () => window.clearTimeout(X);
808
808
  }, [v]);
809
- const D = Re(() => {
810
- const X = di, fe = fi, ne = hi, H = pi, he = typeof window < "u" ? window.innerWidth : 1024, mt = typeof window < "u" ? window.innerHeight : 768, Ye = a.x + ne + X <= he - H, pe = a.y - ne - fe >= H;
811
- let x = Ye ? a.x + ne : a.x - ne, Ke = pe ? a.y - ne : a.y + ne;
812
- const ce = `translate(${Ye ? "0" : "-100%"}, ${pe ? "-100%" : "0"})`;
813
- return x = Math.max(H + (Ye ? 0 : X), Math.min(he - H - (Ye ? X : 0), x)), Ke = Math.max(H + (pe ? fe : 0), Math.min(mt - H - (pe ? 0 : fe), Ke)), { left: `${x}px`, top: `${Ke}px`, transform: ce };
814
- }, [a.x, a.y]), R = Re(() => Jn(t, c), [t, c]), S = c === "ios" ? t.selectors.AXUniqueId : t.selectors.resourceId, Z = c === "ios" ? "AXUniqueId" : "resourceId", ge = bn(async (X, fe) => {
809
+ const D = Ne(() => {
810
+ const X = di, fe = fi, ne = hi, H = pi, he = typeof window < "u" ? window.innerWidth : 1024, mt = typeof window < "u" ? window.innerHeight : 768, Ke = a.x + ne + X <= he - H, pe = a.y - ne - fe >= H;
811
+ let x = Ke ? a.x + ne : a.x - ne, ke = pe ? a.y - ne : a.y + ne;
812
+ const ce = `translate(${Ke ? "0" : "-100%"}, ${pe ? "-100%" : "0"})`;
813
+ return x = Math.max(H + (Ke ? 0 : X), Math.min(he - H - (Ke ? X : 0), x)), ke = Math.max(H + (pe ? fe : 0), Math.min(mt - H - (pe ? 0 : fe), ke)), { left: `${x}px`, top: `${ke}px`, transform: ce };
814
+ }, [a.x, a.y]), R = Ne(() => Jn(t, c), [t, c]), S = c === "ios" ? t.selectors.AXUniqueId : t.selectors.resourceId, Z = c === "ios" ? "AXUniqueId" : "resourceId", Ce = bn(async (X, fe) => {
815
815
  if (!X) return;
816
816
  await ui(X) && b(fe);
817
- }, []), Ce = Xr(t), Ze = t.label || t.value || Ce, Ie = Br(t);
817
+ }, []), ye = Xr(t), Ze = t.label || t.value || ye, Ye = Br(t);
818
818
  return Kn(
819
819
  /* @__PURE__ */ oe(
820
820
  "div",
@@ -827,11 +827,11 @@ const ui = async (r) => {
827
827
  onMouseMove: (X) => X.stopPropagation(),
828
828
  children: [
829
829
  /* @__PURE__ */ oe("div", { className: "rc-inspect-card-header", children: [
830
- /* @__PURE__ */ k("span", { className: "rc-inspect-card-role", children: Ce }),
830
+ /* @__PURE__ */ k("span", { className: "rc-inspect-card-role", children: ye }),
831
831
  !t.enabled && /* @__PURE__ */ k("span", { className: "rc-inspect-card-tag", children: "disabled" }),
832
832
  t.focused && /* @__PURE__ */ k("span", { className: "rc-inspect-card-tag rc-inspect-card-tag-blue", children: "focused" })
833
833
  ] }),
834
- /* @__PURE__ */ k("p", { className: "rc-inspect-card-title", title: Ie, children: Ze }),
834
+ /* @__PURE__ */ k("p", { className: "rc-inspect-card-title", title: Ye, children: Ze }),
835
835
  S && /* @__PURE__ */ oe("div", { className: "rc-inspect-card-row", children: [
836
836
  /* @__PURE__ */ oe("span", { className: "rc-inspect-card-row-label", children: [
837
837
  Z,
@@ -869,10 +869,10 @@ const ui = async (r) => {
869
869
  "button",
870
870
  {
871
871
  type: "button",
872
- className: Ne("rc-inspect-card-btn", v === "selector" && "rc-inspect-card-btn-copied"),
872
+ className: Ie("rc-inspect-card-btn", v === "selector" && "rc-inspect-card-btn-copied"),
873
873
  disabled: !R,
874
874
  title: R ?? "No usable selector for this element",
875
- onClick: () => ge(R ?? void 0, "selector"),
875
+ onClick: () => Ce(R ?? void 0, "selector"),
876
876
  children: v === "selector" ? "Copied!" : "Copy selector"
877
877
  }
878
878
  ),
@@ -880,10 +880,10 @@ const ui = async (r) => {
880
880
  "button",
881
881
  {
882
882
  type: "button",
883
- className: Ne("rc-inspect-card-btn", v === "id" && "rc-inspect-card-btn-copied"),
883
+ className: Ie("rc-inspect-card-btn", v === "id" && "rc-inspect-card-btn-copied"),
884
884
  disabled: !S,
885
885
  title: S ?? `No ${Z}`,
886
- onClick: () => ge(S, "id"),
886
+ onClick: () => Ce(S, "id"),
887
887
  children: v === "id" ? "Copied!" : `Copy ${Z}`
888
888
  }
889
889
  )
@@ -904,21 +904,21 @@ const ui = async (r) => {
904
904
  onSelectChange: b,
905
905
  onTapElement: D
906
906
  }) {
907
- const R = p === "select", S = R ? a !== null && a !== E : a !== null, Z = R ? a ?? E : a, ge = Re(() => {
907
+ const R = p === "select", S = R ? a !== null && a !== E : a !== null, Z = R ? a ?? E : a, Ce = Ne(() => {
908
908
  const H = /* @__PURE__ */ new Map();
909
909
  if (!t) return H;
910
910
  for (const he of t.elements) H.set(he.id, he);
911
911
  return H;
912
- }, [t]), Ce = Re(() => Z ? ge.get(Z) ?? null : null, [Z, ge]);
912
+ }, [t]), ye = Ne(() => Z ? Ce.get(Z) ?? null : null, [Z, Ce]);
913
913
  if (!(!!t && !!c && t.screen.width > 0 && t.screen.height > 0 && t.elements.length > 0)) return null;
914
- const Ie = S ? C : v ?? C, X = S, fe = R && !S && E !== null, ne = (H) => {
914
+ const Ye = S ? C : v ?? C, X = S, fe = R && !S && E !== null, ne = (H) => {
915
915
  R && H.target === H.currentTarget && b(null, null);
916
916
  };
917
917
  return /* @__PURE__ */ oe(Lr, { children: [
918
918
  /* @__PURE__ */ k(
919
919
  "div",
920
920
  {
921
- className: Ne("rc-inspect-overlay", R && "rc-inspect-overlay-select"),
921
+ className: Ie("rc-inspect-overlay", R && "rc-inspect-overlay-select"),
922
922
  style: {
923
923
  left: `${c.left}px`,
924
924
  top: `${c.top}px`,
@@ -940,19 +940,19 @@ const ui = async (r) => {
940
940
  ))
941
941
  }
942
942
  ),
943
- Ce && Ie && /* @__PURE__ */ k(
943
+ ye && Ye && /* @__PURE__ */ k(
944
944
  mi,
945
945
  {
946
- element: Ce,
946
+ element: ye,
947
947
  platform: t.platform,
948
- anchor: Ie,
948
+ anchor: Ye,
949
949
  cursorAnchored: X,
950
950
  showActions: fe,
951
951
  onTap: D
952
952
  }
953
953
  )
954
954
  ] });
955
- }), gi = Rn(() => import("./duo-view-D1WxkDni.mjs").then((r) => r.d)), F = (...r) => {
955
+ }), gi = Rn(() => import("./duo-view-BNktEtvj.mjs").then((r) => r.d)), F = (...r) => {
956
956
  window.debugRemoteControl && console.log(...r);
957
957
  }, w = (...r) => {
958
958
  window.debugRemoteControl && console.warn(...r);
@@ -1012,18 +1012,18 @@ const Li = Nn(
1012
1012
  assets: R,
1013
1013
  onConnectionStateChange: S,
1014
1014
  inspectMode: Z,
1015
- onAxSnapshotChange: ge,
1016
- onInspectSelectionChange: Ce,
1015
+ onAxSnapshotChange: Ce,
1016
+ onInspectSelectionChange: ye,
1017
1017
  onAxStatusChange: Ze,
1018
- axPollIntervalMs: Ie,
1018
+ axPollIntervalMs: Ye,
1019
1019
  axMaxBackoffMs: X,
1020
1020
  androidElementTreeOptions: fe,
1021
1021
  onCameraDemandChange: ne,
1022
1022
  onCameraStats: H,
1023
1023
  microphoneEnabled: he = !1,
1024
1024
  onMicrophoneStateChange: mt
1025
- }, Ye) => {
1026
- const pe = O(null), x = O(null), Ke = O(null), [tr, rr] = V(!1), ce = C === "iphone-duo" || tr, et = O(null), [nr, ir] = V(null), [or, cr] = V(), ke = O(
1025
+ }, Ke) => {
1026
+ const pe = O(null), x = O(null), ke = O(null), [tr, rr] = V(!1), ce = C === "iphone-duo" || tr, et = O(null), [nr, ir] = V(null), [or, cr] = V(), Pe = O(
1027
1027
  /* @__PURE__ */ new Map()
1028
1028
  ), Ut = (e, o) => new Promise((i, n) => {
1029
1029
  const l = T.current;
@@ -1032,25 +1032,25 @@ const Li = Nn(
1032
1032
  return;
1033
1033
  }
1034
1034
  const u = crypto.randomUUID(), f = setTimeout(() => {
1035
- ke.current.delete(u), n(new Error("Device control timed out"));
1035
+ Pe.current.delete(u), n(new Error("Device control timed out"));
1036
1036
  }, 5e3);
1037
- ke.current.set(u, { resolve: i, reject: n, timer: f }), l.send(JSON.stringify({ type: e, id: u, ...o }));
1038
- }), [qr, Lt] = V(!1), [Vr, Et] = V(!1), [Gr, sr] = V(!1), Pe = O(!1), Ft = O(!1), [ar, Jr] = V(!1), [zr, jr] = V(!1), [Qr, ur] = V({}), T = O(null), W = O(null), P = O(null), Ue = O(void 0), tt = O(void 0), rt = O(void 0), gt = O(void 0), Le = O(void 0), Oe = O(0), Ct = O(0), Fe = O(!1), xt = O(b);
1037
+ Pe.current.set(u, { resolve: i, reject: n, timer: f }), l.send(JSON.stringify({ type: e, id: u, ...o }));
1038
+ }), [qr, Lt] = V(!1), [Vr, Et] = V(!1), [Gr, sr] = V(!1), Ue = O(!1), Ft = O(!1), [ar, Jr] = V(!1), [zr, jr] = V(!1), [Qr, ur] = V({}), T = O(null), W = O(null), P = O(null), Le = O(void 0), tt = O(void 0), rt = O(void 0), gt = O(void 0), Fe = O(void 0), _e = O(0), Ct = O(0), me = O(!1), xt = O(b);
1039
1039
  xt.current = b;
1040
- const _e = O(null), ee = O(null), De = O(void 0), Wt = Re(() => new ni(), []), me = O(ne);
1041
- me.current = ne;
1040
+ const De = O(null), ee = O(null), Te = O(void 0), Wt = Ne(() => new ni(), []), Ee = O(ne);
1041
+ Ee.current = ne;
1042
1042
  const yt = O(H);
1043
1043
  yt.current = H;
1044
1044
  const nt = O(null), vt = O(null), Ht = O(he);
1045
1045
  Ht.current = he;
1046
1046
  const $t = O(!1), it = O(mt);
1047
1047
  it.current = mt;
1048
- const ot = O(null), ue = O(null), Ot = O(0), lr = O(Promise.resolve()), xe = O(null), ct = O(!1), ye = O(/* @__PURE__ */ new Map()), Ee = O(/* @__PURE__ */ new Map()), Te = O(/* @__PURE__ */ new Map()), we = O(/* @__PURE__ */ new Map()), J = O(/* @__PURE__ */ new Map()), Ae = O(!1), [Zr, en] = V(!1), B = O(null), We = O(null), st = O({
1048
+ const ot = O(null), ue = O(null), Ot = O(0), lr = O(Promise.resolve()), xe = O(null), ct = O(!1), ve = O(/* @__PURE__ */ new Map()), ge = O(/* @__PURE__ */ new Map()), we = O(/* @__PURE__ */ new Map()), Ae = O(/* @__PURE__ */ new Map()), J = O(/* @__PURE__ */ new Map()), Se = O(!1), [Zr, en] = V(!1), B = O(null), We = O(null), st = O({
1049
1049
  handle: () => {
1050
1050
  },
1051
1051
  end: () => {
1052
1052
  }
1053
- }), [Se, _t] = V(null), z = O(null), [dr, fr] = V(null), [Xt, at] = V(null), [Bt, Dt] = V(null), [tn, hr] = V(null), [rn, pr] = V(null), Tt = O(null), ie = O(void 0), mr = (e) => {
1053
+ }), [Me, _t] = V(null), z = O(null), [dr, fr] = V(null), [Xt, at] = V(null), [Bt, Dt] = V(null), [tn, hr] = V(null), [rn, pr] = V(null), Tt = O(null), ie = O(void 0), mr = (e) => {
1054
1054
  Tt.current = e, ie.current === void 0 && (ie.current = window.requestAnimationFrame(() => {
1055
1055
  ie.current = void 0, pr(Tt.current);
1056
1056
  }));
@@ -1058,10 +1058,10 @@ const Li = Nn(
1058
1058
  $e.current = Z;
1059
1059
  const Xe = O(null);
1060
1060
  Xe.current = dr;
1061
- const qt = O(ge);
1062
- qt.current = ge;
1063
- const Be = O(Ce);
1064
- Be.current = Ce;
1061
+ const qt = O(Ce);
1062
+ qt.current = Ce;
1063
+ const Be = O(ye);
1064
+ Be.current = ye;
1065
1065
  const Er = O(Ze);
1066
1066
  Er.current = Ze;
1067
1067
  const gr = O(D);
@@ -1070,10 +1070,10 @@ const Li = Nn(
1070
1070
  Cr.current = S;
1071
1071
  const Vt = O(null), qe = (e) => {
1072
1072
  Vt.current !== e && (Vt.current = e, L("onConnectionStateChange", Cr.current, e));
1073
- }, ut = Z === !0 || Z === "hover-only", on = Z === "hover-only" ? "hover-only" : "select", se = Re(
1073
+ }, ut = Z === !0 || Z === "hover-only", on = Z === "hover-only" ? "hover-only" : "select", se = Ne(
1074
1074
  () => a || Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15),
1075
1075
  [a]
1076
- ), le = Re(() => Ci(t), [t]), Ve = Ti[le], lt = R?.[le], yr = le === "android" && zr ? ar ? lt?.tabletFrameLandscape : lt?.tabletFrame : ar ? lt?.frameLandscape : lt?.frame, vr = lt?.loadingLogo, wt = !ce && p && !!yr, Y = (e) => {
1076
+ ), le = Ne(() => Ci(t), [t]), Ve = Ti[le], lt = R?.[le], yr = le === "android" && zr ? ar ? lt?.tabletFrameLandscape : lt?.tabletFrame : ar ? lt?.frameLandscape : lt?.frame, vr = lt?.loadingLogo, wt = !ce && p && !!yr, Y = (e) => {
1077
1077
  F(e);
1078
1078
  }, ae = (e) => {
1079
1079
  !P.current || P.current.readyState !== "open" || (P.current.send(e), z.current?.bumpActivity());
@@ -1112,7 +1112,7 @@ const Li = Nn(
1112
1112
  if (!i || o.screen.width <= 0 || o.screen.height <= 0) return;
1113
1113
  const n = e.frame.x + e.frame.width / 2, l = e.frame.y + e.frame.height / 2, u = n / o.screen.width * i.actualWidth, f = l / o.screen.height * i.actualHeight, m = i.videoRect.left + i.offsetX + u, g = i.videoRect.top + i.offsetY + f;
1114
1114
  _r(m, g);
1115
- }, At = -1, St = -2, Me = -3, Ge = (e, o, i, n, l, u) => {
1115
+ }, At = -1, St = -2, be = -3, Ge = (e, o, i, n, l, u) => {
1116
1116
  const f = Yt(
1117
1117
  e,
1118
1118
  o,
@@ -1133,14 +1133,14 @@ const Li = Nn(
1133
1133
  y: u,
1134
1134
  video: { width: i, height: n }
1135
1135
  }), ae(f));
1136
- }, be = (e, o, i) => {
1136
+ }, Re = (e, o, i) => {
1137
1137
  if (!i) return;
1138
1138
  const { videoX: n, videoY: l, videoWidth: u, videoHeight: f } = i;
1139
1139
  let m = null, g = null, h = 1;
1140
1140
  const M = U.BUTTON_PRIMARY;
1141
1141
  switch (o) {
1142
1142
  case "down":
1143
- e !== Me && st.current.end(), m = J.current.size === 0 ? U.ACTION_DOWN : U.ACTION_POINTER_DOWN, g = { x: n, y: l }, J.current.set(e, g), e === -1 && x.current?.focus();
1143
+ e !== be && st.current.end(), m = J.current.size === 0 ? U.ACTION_DOWN : U.ACTION_POINTER_DOWN, g = { x: n, y: l }, J.current.set(e, g), e === -1 && x.current?.focus();
1144
1144
  break;
1145
1145
  case "move":
1146
1146
  J.current.has(e) && (m = U.ACTION_MOVE, g = { x: n, y: l }, J.current.set(e, g));
@@ -1158,7 +1158,7 @@ const Li = Nn(
1158
1158
  actionName: Kt(m),
1159
1159
  positionToSend: g,
1160
1160
  video: { width: u, height: f },
1161
- altHeld: Ae.current,
1161
+ altHeld: Se.current,
1162
1162
  activePointersAfter: Array.from(J.current.entries()).map(([N, $]) => ({
1163
1163
  id: N,
1164
1164
  x: $.x,
@@ -1183,7 +1183,7 @@ const Li = Nn(
1183
1183
  }), ae(_));
1184
1184
  } else (o === "up" || o === "cancel") && J.current.delete(e);
1185
1185
  }, Gt = (e) => {
1186
- if (Ae.current !== e && (Ae.current = e, en(e), e || _t(null), F("[rc-touch][alt] updateAltHeld", {
1186
+ if (Se.current !== e && (Se.current = e, en(e), e || _t(null), F("[rc-touch][alt] updateAltHeld", {
1187
1187
  nextHeld: e,
1188
1188
  activePointerIds: Array.from(J.current.keys())
1189
1189
  }), le === "ios" && P.current && P.current.readyState === "open")) {
@@ -1273,8 +1273,8 @@ const Li = Nn(
1273
1273
  } else
1274
1274
  e === "down" ? (Ge(U.ACTION_DOWN, m, o, i, n, l), Ge(U.ACTION_POINTER_DOWN, g, o, i, u, f)) : e === "move" ? (Ge(U.ACTION_MOVE, m, o, i, n, l), Ge(U.ACTION_MOVE, g, o, i, u, f)) : (Ge(U.ACTION_POINTER_UP, g, o, i, u, f), Ge(U.ACTION_UP, m, o, i, n, l));
1275
1275
  }, un = (e, o, i) => {
1276
- if (!Ae.current) {
1277
- Se !== null && _t(null);
1276
+ if (!Se.current) {
1277
+ Me !== null && _t(null);
1278
1278
  return;
1279
1279
  }
1280
1280
  const n = sn(e, o, i);
@@ -1286,7 +1286,7 @@ const Li = Nn(
1286
1286
  if (l < 0 || u < 0 || l > e.actualWidth || u > e.actualHeight) return null;
1287
1287
  const f = l / e.actualWidth * n.screen.width, m = u / e.actualHeight * n.screen.height;
1288
1288
  return Gn(n, f, m);
1289
- }, ve = (e) => {
1289
+ }, Oe = (e) => {
1290
1290
  if (ce) return;
1291
1291
  e.preventDefault(), e.stopPropagation();
1292
1292
  const o = dt();
@@ -1369,7 +1369,7 @@ const Li = Nn(
1369
1369
  const f = l[0];
1370
1370
  if (f) {
1371
1371
  const m = Je(o, f.clientX, f.clientY);
1372
- be(f.identifier, u, m);
1372
+ Re(f.identifier, u, m);
1373
1373
  }
1374
1374
  }
1375
1375
  }
@@ -1400,7 +1400,7 @@ const Li = Nn(
1400
1400
  button: e.button,
1401
1401
  buttons: e.buttons,
1402
1402
  client: { x: e.clientX, y: e.clientY },
1403
- altHeldRef: Ae.current,
1403
+ altHeldRef: Se.current,
1404
1404
  inTwoFingerMode: u,
1405
1405
  geometry: {
1406
1406
  videoX: f.videoX,
@@ -1409,7 +1409,7 @@ const Li = Nn(
1409
1409
  videoHeight: f.videoHeight
1410
1410
  },
1411
1411
  activePointerIds: Array.from(J.current.keys())
1412
- }), Ae.current || u ? dn(l, f) : be(-1, l, f);
1412
+ }), Se.current || u ? dn(l, f) : Re(-1, l, f);
1413
1413
  }
1414
1414
  }
1415
1415
  }, dn = (e, o) => {
@@ -1469,11 +1469,11 @@ const Li = Nn(
1469
1469
  }
1470
1470
  }, fn = 150, Dr = () => {
1471
1471
  const e = We.current;
1472
- e && (window.clearTimeout(e.endTimer), be(Me, "up", e.pos), We.current = null);
1472
+ e && (window.clearTimeout(e.endTimer), Re(be, "up", e.pos), We.current = null);
1473
1473
  }, hn = (e) => {
1474
- if (e.ctrlKey || Ae.current || B.current) return;
1474
+ if (e.ctrlKey || Se.current || B.current) return;
1475
1475
  const o = J.current.size;
1476
- if (o > 1 || o === 1 && !J.current.has(Me)) return;
1476
+ if (o > 1 || o === 1 && !J.current.has(be)) return;
1477
1477
  const i = dt();
1478
1478
  if (!i) return;
1479
1479
  const n = e.clientX - i.videoRect.left - i.offsetX, l = e.clientY - i.videoRect.top - i.offsetY;
@@ -1504,10 +1504,10 @@ const Li = Nn(
1504
1504
  window.clearTimeout($.endTimer);
1505
1505
  else {
1506
1506
  const y = _();
1507
- be(Me, "down", y), $ = { pos: y, endTimer: 0 }, We.current = $;
1507
+ Re(be, "down", y), $ = { pos: y, endTimer: 0 }, We.current = $;
1508
1508
  }
1509
1509
  let te = $.pos, G = N(te);
1510
- G.videoX === te.videoX && G.videoY === te.videoY && (be(Me, "up", te), te = _(), be(Me, "down", te), G = N(te)), be(Me, "move", G), $.pos = G, M($);
1510
+ G.videoX === te.videoX && G.videoY === te.videoY && (Re(be, "up", te), te = _(), Re(be, "down", te), G = N(te)), Re(be, "move", G), $.pos = G, M($);
1511
1511
  };
1512
1512
  de(() => {
1513
1513
  st.current = { handle: hn, end: Dr };
@@ -1606,9 +1606,9 @@ const Li = Nn(
1606
1606
  })
1607
1607
  );
1608
1608
  }, Tr = () => {
1609
- Ue.current && window.clearInterval(Ue.current), Ue.current = window.setInterval(pn, 1e4);
1609
+ Le.current && window.clearInterval(Le.current), Le.current = window.setInterval(pn, 1e4);
1610
1610
  }, wr = () => {
1611
- Ue.current && (window.clearInterval(Ue.current), Ue.current = void 0);
1611
+ Le.current && (window.clearInterval(Le.current), Le.current = void 0);
1612
1612
  }, bt = () => {
1613
1613
  tt.current && (window.clearTimeout(tt.current), tt.current = void 0);
1614
1614
  }, Rt = () => {
@@ -1616,7 +1616,7 @@ const Li = Nn(
1616
1616
  }, ft = () => {
1617
1617
  gt.current && (window.clearInterval(gt.current), gt.current = void 0);
1618
1618
  }, ht = () => {
1619
- Le.current !== void 0 && (window.clearTimeout(Le.current), Le.current = void 0);
1619
+ Fe.current !== void 0 && (window.clearTimeout(Fe.current), Fe.current = void 0);
1620
1620
  }, mn = () => {
1621
1621
  ct.current || (ct.current = !0, ft(), Lt(!0), qe("connected"));
1622
1622
  }, j = (e) => {
@@ -1726,13 +1726,13 @@ const Li = Nn(
1726
1726
  }
1727
1727
  };
1728
1728
  }
1729
- e.send(JSON.stringify(i)), L("onCameraDemandChange", me.current, !0, !0, i.camera);
1729
+ e.send(JSON.stringify(i)), L("onCameraDemandChange", Ee.current, !0, !0, i.camera);
1730
1730
  }, Cn = (e) => {
1731
1731
  if (!e) return;
1732
1732
  const o = e.indexOf("/"), n = (o >= 0 ? e.slice(o + 1) : e).toUpperCase();
1733
1733
  return n === "HEVC" ? "H265" : n;
1734
1734
  }, yn = async () => {
1735
- const e = _e.current, o = yt.current;
1735
+ const e = De.current, o = yt.current;
1736
1736
  if (!e || !o) return;
1737
1737
  let i;
1738
1738
  try {
@@ -1785,7 +1785,7 @@ const Li = Nn(
1785
1785
  }, It = () => {
1786
1786
  nt.current !== null && (clearInterval(nt.current), nt.current = null), vt.current = null, L("onCameraStats", yt.current, null);
1787
1787
  }, vn = (e, o, i, n) => Wt.enqueue(async ({ isCurrent: l }) => {
1788
- const u = () => l() && n() && T.current === o && _e.current === i;
1788
+ const u = () => l() && n() && T.current === o && De.current === i;
1789
1789
  if (!u()) return;
1790
1790
  if (!e.active) {
1791
1791
  const _ = ee.current;
@@ -1794,14 +1794,14 @@ const Li = Nn(
1794
1794
  } catch (N) {
1795
1795
  w("replaceTrack(null) on camera detach failed:", N);
1796
1796
  }
1797
- if (ee.current === _ && (ee.current = null, De.current = void 0, _ && j(_)), It(), !u()) return;
1798
- L("onCameraDemandChange", me.current, !1);
1797
+ if (ee.current === _ && (ee.current = null, Te.current = void 0, _ && j(_)), It(), !u()) return;
1798
+ L("onCameraDemandChange", Ee.current, !1);
1799
1799
  return;
1800
1800
  }
1801
- L("onCameraDemandChange", me.current, !0);
1802
- const f = ee.current, m = f?.getVideoTracks()[0], g = De.current;
1801
+ L("onCameraDemandChange", Ee.current, !0);
1802
+ const f = ee.current, m = f?.getVideoTracks()[0], g = Te.current;
1803
1803
  if (m?.readyState === "live" && g && !ci(g, e)) {
1804
- De.current = e, Mr(o, m), br();
1804
+ Te.current = e, Mr(o, m), br();
1805
1805
  return;
1806
1806
  }
1807
1807
  if (f) {
@@ -1810,13 +1810,13 @@ const Li = Nn(
1810
1810
  } catch (_) {
1811
1811
  w("replaceTrack(null) before camera switch failed:", _);
1812
1812
  }
1813
- if (ee.current === f && (ee.current = null, De.current = void 0, j(f)), It(), !u()) return;
1813
+ if (ee.current === f && (ee.current = null, Te.current = void 0, j(f)), It(), !u()) return;
1814
1814
  }
1815
1815
  if (!navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia != "function") {
1816
1816
  if (console.warn(
1817
1817
  "[RemoteControl] navigator.mediaDevices.getUserMedia unavailable. getUserMedia requires a secure context (https or http://localhost). Replying cameraResult granted=false so limulator falls back to black frames."
1818
1818
  ), !u()) return;
1819
- o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", me.current, !0, !1);
1819
+ o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", Ee.current, !0, !1);
1820
1820
  return;
1821
1821
  }
1822
1822
  let h = null;
@@ -1833,13 +1833,13 @@ const Li = Nn(
1833
1833
  return;
1834
1834
  }
1835
1835
  if (!h) {
1836
- o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", me.current, !0, !1);
1836
+ o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", Ee.current, !0, !1);
1837
1837
  return;
1838
1838
  }
1839
1839
  const M = h.getVideoTracks()[0] ?? null;
1840
1840
  if (!M) {
1841
1841
  if (j(h), !u()) return;
1842
- o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", me.current, !0, !1);
1842
+ o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", Ee.current, !0, !1);
1843
1843
  return;
1844
1844
  }
1845
1845
  try {
@@ -1850,7 +1850,7 @@ const Li = Nn(
1850
1850
  await i.replaceTrack(M);
1851
1851
  } catch (_) {
1852
1852
  if (w("replaceTrack(videoTrack) failed:", _), j(h), !u()) return;
1853
- o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", me.current, !0, !1);
1853
+ o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", Ee.current, !0, !1);
1854
1854
  return;
1855
1855
  }
1856
1856
  if (!u()) {
@@ -1877,22 +1877,22 @@ const Li = Nn(
1877
1877
  j(h);
1878
1878
  return;
1879
1879
  }
1880
- ee.current = h, De.current = e, M.onended = () => {
1880
+ ee.current = h, Te.current = e, M.onended = () => {
1881
1881
  ee.current === h && Wt.enqueueCurrent(async ({ isCurrent: _ }) => {
1882
- if (!(!_() || ee.current !== h || !n() || T.current !== o || _e.current !== i)) {
1882
+ if (!(!_() || ee.current !== h || !n() || T.current !== o || De.current !== i)) {
1883
1883
  try {
1884
1884
  await i.replaceTrack(null);
1885
1885
  } catch (N) {
1886
1886
  w("replaceTrack(null) after camera ended failed:", N);
1887
1887
  }
1888
- !_() || ee.current !== h || !n() || T.current !== o || _e.current !== i || (ee.current = null, De.current = void 0, j(h), It(), o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", me.current, !0, !1));
1888
+ !_() || ee.current !== h || !n() || T.current !== o || De.current !== i || (ee.current = null, Te.current = void 0, j(h), It(), o.send(JSON.stringify({ type: "cameraResult", granted: !1 })), L("onCameraDemandChange", Ee.current, !0, !1));
1889
1889
  }
1890
1890
  }).catch((_) => w("camera ended cleanup failed:", _));
1891
1891
  }, u() && (Mr(o, M), br());
1892
1892
  }), je = () => {
1893
- for (const e of ke.current.values())
1893
+ for (const e of Pe.current.values())
1894
1894
  clearTimeout(e.timer), e.reject(new Error("Simulator disconnected"));
1895
- ke.current.clear(), ir(null), et.current && (et.current.srcObject = null), Rt(), ht(), ft(), z.current && (z.current.stop(), z.current = null), Wt.invalidate(), It(), En(), De.current = void 0, _e.current = null, ++Ot.current, $t.current = !1, xe.current = null, ue.current && (j(ue.current), ue.current = null, L("onMicrophoneStateChange", it.current, {
1895
+ Pe.current.clear(), ir(null), et.current && (et.current.srcObject = null), Rt(), ht(), ft(), z.current && (z.current.stop(), z.current = null), Wt.invalidate(), It(), En(), Te.current = void 0, De.current = null, ++Ot.current, $t.current = !1, xe.current = null, ue.current && (j(ue.current), ue.current = null, L("onMicrophoneStateChange", it.current, {
1896
1896
  active: !1
1897
1897
  })), ot.current = null, ie.current !== void 0 && (window.cancelAnimationFrame(ie.current), ie.current = void 0), T.current && (T.current.onopen = null, T.current.onmessage = null, T.current.onerror = null, T.current.onclose = null, T.current.close(), T.current = null), W.current && (W.current.onconnectionstatechange = null, W.current.oniceconnectionstatechange = null, W.current.ontrack = null, W.current.onicecandidate = null, W.current.close(), W.current = null), x.current && (x.current.srcObject = null), P.current && (P.current.onopen = null, P.current.onclose = null, P.current.onerror = null, P.current.close(), P.current = null);
1898
1898
  }, Rr = () => {
@@ -1916,20 +1916,20 @@ const Li = Nn(
1916
1916
  window.clearTimeout(i);
1917
1917
  }
1918
1918
  }, _n = () => {
1919
- Pe.current || (Pe.current = !0, sr(!0), Et(!1), Oe.current += 1, bt(), Rt(), ht(), je(), Y("Instance terminated"), qe("terminated"), L("onTerminated", gr.current));
1919
+ Ue.current || (Ue.current = !0, sr(!0), Et(!1), _e.current += 1, bt(), Rt(), ht(), je(), Y("Instance terminated"), qe("terminated"), L("onTerminated", gr.current));
1920
1920
  }, Dn = () => {
1921
- Pe.current || Ft.current || (Ft.current = !0, On().then((e) => {
1921
+ Ue.current || Ft.current || (Ft.current = !0, On().then((e) => {
1922
1922
  Ft.current = !1, e && _n();
1923
1923
  }));
1924
1924
  }, Qe = (e, o) => {
1925
- if (Pe.current || o !== Oe.current)
1925
+ if (Ue.current || o !== _e.current)
1926
1926
  return;
1927
- if (Dn(), Fe.current) {
1927
+ if (Dn(), me.current) {
1928
1928
  if (!xt.current) {
1929
1929
  Y(`Connection failed after it was established: ${e}`), Et(!0), qe("failed"), je();
1930
1930
  return;
1931
1931
  }
1932
- Y(`Reconnecting after established session dropped: ${e}`), Fe.current = !1, Ct.current = -1;
1932
+ Y(`Reconnecting after established session dropped: ${e}`), me.current = !1, Ct.current = -1;
1933
1933
  }
1934
1934
  bt();
1935
1935
  const i = Ct.current + 1;
@@ -1938,15 +1938,15 @@ const Li = Nn(
1938
1938
  return;
1939
1939
  }
1940
1940
  Y(`Retrying connection (${i + 1}/${Zt})`), qe("reconnecting"), je(), tt.current = window.setTimeout(() => {
1941
- tt.current = void 0, o === Oe.current && Nr(i);
1941
+ tt.current = void 0, o === _e.current && Nr(i);
1942
1942
  }, yi);
1943
1943
  }, Nr = async (e = 0) => {
1944
- if (Pe.current) return;
1945
- const o = Oe.current + 1;
1946
- Oe.current = o, Ct.current = e, Fe.current = !1, Et(!1), e === 0 && Vt.current !== "reconnecting" && qe("connecting"), bt(), Rt(), ft(), ct.current = !1, Lt(!1), je();
1947
- const i = () => o === Oe.current;
1944
+ if (Ue.current) return;
1945
+ const o = _e.current + 1;
1946
+ _e.current = o, Ct.current = e, me.current = !1, Et(!1), e === 0 && Vt.current !== "reconnecting" && qe("connecting"), bt(), Rt(), ft(), ct.current = !1, Lt(!1), je();
1947
+ const i = () => o === _e.current;
1948
1948
  rt.current = window.setTimeout(() => {
1949
- rt.current = void 0, !(!i() || Fe.current) && Qe("Connection did not succeed within 15 seconds", o);
1949
+ rt.current = void 0, !(!i() || me.current) && Qe("Connection did not succeed within 15 seconds", o);
1950
1950
  }, vi);
1951
1951
  try {
1952
1952
  const n = new WebSocket(kr(t, c));
@@ -2013,7 +2013,7 @@ const Li = Nn(
2013
2013
  const M = h.addTransceiver("video", { direction: "recvonly" }), _ = g ? h.addTransceiver("video", { direction: "recvonly" }) : null, N = le === "ios" || f, $ = N ? h.addTransceiver("video", {
2014
2014
  direction: "sendonly"
2015
2015
  }) : null;
2016
- _e.current = $?.sender ?? null;
2016
+ De.current = $?.sender ?? null;
2017
2017
  const te = N ? h.addTransceiver("audio", {
2018
2018
  direction: "sendonly"
2019
2019
  }) : null;
@@ -2055,9 +2055,9 @@ const Li = Nn(
2055
2055
  if (P.current = G, G.onopen = () => {
2056
2056
  if (!i() || P.current !== G || T.current !== n)
2057
2057
  return;
2058
- Fe.current = !0, Rt(), Y("Control channel opened"), g && n.send(JSON.stringify({ type: "getFoldState", id: "duo-capabilities" })), z.current || (z.current = new ri({
2058
+ me.current = !0, Rt(), Y("Control channel opened"), g && n.send(JSON.stringify({ type: "getFoldState", id: "duo-capabilities" })), z.current || (z.current = new ri({
2059
2059
  platform: le,
2060
- baseIntervalMs: Ie,
2060
+ baseIntervalMs: Ye,
2061
2061
  maxBackoffMs: X,
2062
2062
  androidElementTreeOptions: fe,
2063
2063
  send: (d) => {
@@ -2112,7 +2112,7 @@ const Li = Nn(
2112
2112
  }, G.onerror = (y) => {
2113
2113
  !i() || P.current !== G || (console.error("Control channel error:", y), Y("Control channel error: " + y));
2114
2114
  }, h.onconnectionstatechange = () => {
2115
- !i() || W.current !== h || (Y("Connection state: " + h.connectionState), h.connectionState === "failed" && Qe("WebRTC connection entered failed state", o));
2115
+ !i() || W.current !== h || (Y("Connection state: " + h.connectionState), h.connectionState === "failed" && me.current && Qe("WebRTC connection entered failed state", o));
2116
2116
  }, h.oniceconnectionstatechange = () => {
2117
2117
  if (!i() || W.current !== h)
2118
2118
  return;
@@ -2122,11 +2122,11 @@ const Li = Nn(
2122
2122
  return;
2123
2123
  }
2124
2124
  if (y === "failed") {
2125
- ht(), Qe("ICE connection entered failed state", o);
2125
+ ht(), me.current && Qe("ICE connection entered failed state", o);
2126
2126
  return;
2127
2127
  }
2128
- y === "disconnected" && xt.current && Le.current === void 0 && (Le.current = window.setTimeout(() => {
2129
- Le.current = void 0, !(!i() || W.current !== h) && h.iceConnectionState === "disconnected" && Qe("ICE stayed disconnected past grace period", o);
2128
+ y === "disconnected" && me.current && xt.current && Fe.current === void 0 && (Fe.current = window.setTimeout(() => {
2129
+ Fe.current = void 0, !(!i() || W.current !== h) && h.iceConnectionState === "disconnected" && Qe("ICE stayed disconnected past grace period", o);
2130
2130
  }, Oi));
2131
2131
  }, h.ontrack = (y) => {
2132
2132
  if (!(!i() || W.current !== h) && (Y("Received remote track: " + y.track.kind), y.track.kind === "video" && x.current)) {
@@ -2165,8 +2165,8 @@ const Li = Nn(
2165
2165
  case "foldStateChanged": {
2166
2166
  if (!g) break;
2167
2167
  d.state ? (ir(d.state), cr(void 0)) : d.id === "duo-capabilities" && cr(d.error || "This instance does not support native iPhone Duo displays.");
2168
- const A = ke.current.get(d.id);
2169
- A && (clearTimeout(A.timer), ke.current.delete(d.id), d.error ? A.reject(new Error(d.error)) : A.resolve());
2168
+ const A = Pe.current.get(d.id);
2169
+ A && (clearTimeout(A.timer), Pe.current.delete(d.id), d.error ? A.reject(new Error(d.error)) : A.resolve());
2170
2170
  break;
2171
2171
  }
2172
2172
  case "signalingError": {
@@ -2213,12 +2213,12 @@ const Li = Nn(
2213
2213
  }
2214
2214
  const A = Ai(d);
2215
2215
  if (A) {
2216
- const re = Ee.current.get(d.id);
2216
+ const re = ge.current.get(d.id);
2217
2217
  if (!re) {
2218
2218
  w(`Received screenshot error for unknown or handled id: ${d.id}`);
2219
2219
  break;
2220
2220
  }
2221
- w(`Received screenshot error for id ${d.id}: ${A}`), re(new Error(A)), ye.current.delete(d.id), Ee.current.delete(d.id);
2221
+ w(`Received screenshot error for id ${d.id}: ${A}`), re(new Error(A)), ve.current.delete(d.id), ge.current.delete(d.id);
2222
2222
  break;
2223
2223
  }
2224
2224
  const I = Si(d);
@@ -2226,12 +2226,12 @@ const Li = Nn(
2226
2226
  w("Received screenshot message without image data:", d);
2227
2227
  break;
2228
2228
  }
2229
- const q = ye.current.get(d.id);
2229
+ const q = ve.current.get(d.id);
2230
2230
  if (!q) {
2231
2231
  w(`Received screenshot data for unknown or handled id: ${d.id}`);
2232
2232
  break;
2233
2233
  }
2234
- F(`Received screenshot data for id ${d.id}`), q(I), ye.current.delete(d.id), Ee.current.delete(d.id);
2234
+ F(`Received screenshot data for id ${d.id}`), q(I), ve.current.delete(d.id), ge.current.delete(d.id);
2235
2235
  break;
2236
2236
  }
2237
2237
  case "screenshotError":
@@ -2239,15 +2239,15 @@ const Li = Nn(
2239
2239
  w("Received invalid screenshot error message:", d);
2240
2240
  break;
2241
2241
  }
2242
- const K = Ee.current.get(d.id);
2242
+ const K = ge.current.get(d.id);
2243
2243
  if (!K) {
2244
2244
  w(`Received screenshot error for unknown or handled id: ${d.id}`);
2245
2245
  break;
2246
2246
  }
2247
- w(`Received screenshot error for id ${d.id}: ${d.message}`), K(new Error(d.message)), ye.current.delete(d.id), Ee.current.delete(d.id);
2247
+ w(`Received screenshot error for id ${d.id}: ${d.message}`), K(new Error(d.message)), ve.current.delete(d.id), ge.current.delete(d.id);
2248
2248
  break;
2249
2249
  case "cameraRequest": {
2250
- const A = _e.current;
2250
+ const A = De.current;
2251
2251
  if (!A)
2252
2252
  break;
2253
2253
  const I = ii(d);
@@ -2285,20 +2285,20 @@ const Li = Nn(
2285
2285
  break;
2286
2286
  }
2287
2287
  if (typeof d.error == "string") {
2288
- const A = we.current.get(d.id);
2288
+ const A = Ae.current.get(d.id);
2289
2289
  if (!A) {
2290
2290
  w(`Received terminateApp error for unknown or handled id: ${d.id}`);
2291
2291
  break;
2292
2292
  }
2293
- w(`Received terminateApp error for id ${d.id}: ${d.error}`), A(new Error(d.error)), Te.current.delete(d.id), we.current.delete(d.id);
2293
+ w(`Received terminateApp error for id ${d.id}: ${d.error}`), A(new Error(d.error)), we.current.delete(d.id), Ae.current.delete(d.id);
2294
2294
  break;
2295
2295
  }
2296
- const Q = Te.current.get(d.id);
2296
+ const Q = we.current.get(d.id);
2297
2297
  if (!Q) {
2298
2298
  w(`Received terminateApp result for unknown or handled id: ${d.id}`);
2299
2299
  break;
2300
2300
  }
2301
- F(`Received terminateApp success for id ${d.id}`), Q(), Te.current.delete(d.id), we.current.delete(d.id);
2301
+ F(`Received terminateApp success for id ${d.id}`), Q(), we.current.delete(d.id), Ae.current.delete(d.id);
2302
2302
  break;
2303
2303
  default:
2304
2304
  w(`Received unhandled message type: ${d.type}`, d);
@@ -2327,9 +2327,9 @@ const Li = Nn(
2327
2327
  Y("Error: " + l), Qe(l, o);
2328
2328
  }
2329
2329
  }, jt = () => {
2330
- Pe.current = !1, sr(!1), Nr(0);
2330
+ Ue.current = !1, sr(!1), Nr(0);
2331
2331
  }, Tn = () => {
2332
- Oe.current += 1, Ct.current = 0, Fe.current = !1, bt(), ht(), je(), Y("Stopped");
2332
+ _e.current += 1, Ct.current = 0, me.current = !1, bt(), ht(), je(), Y("Stopped");
2333
2333
  }, wn = (e) => {
2334
2334
  e.stopPropagation(), jt();
2335
2335
  };
@@ -2355,7 +2355,7 @@ const Li = Nn(
2355
2355
  );
2356
2356
  };
2357
2357
  de(() => {
2358
- const e = x.current, o = Ke.current, i = pe.current;
2358
+ const e = x.current, o = ke.current, i = pe.current;
2359
2359
  if (!e) return;
2360
2360
  const n = () => {
2361
2361
  if (!wt || !o) {
@@ -2394,7 +2394,7 @@ const Li = Nn(
2394
2394
  const An = () => {
2395
2395
  x.current && x.current.focus();
2396
2396
  };
2397
- In(Ye, () => ({
2397
+ In(Ke, () => ({
2398
2398
  openUrl: (e) => {
2399
2399
  if (!T.current || T.current.readyState !== WebSocket.OPEN) {
2400
2400
  w("WebSocket not open, cannot send open_url command via ref.");
@@ -2453,15 +2453,15 @@ const Li = Nn(
2453
2453
  ...e ? { display: e } : {},
2454
2454
  id: n
2455
2455
  };
2456
- ye.current.set(n, o), Ee.current.set(n, i), F("Sending screenshot request:", l);
2456
+ ve.current.set(n, o), ge.current.set(n, i), F("Sending screenshot request:", l);
2457
2457
  try {
2458
2458
  T.current.send(JSON.stringify(l));
2459
2459
  } catch (u) {
2460
- w("Failed to send screenshot request immediately:", u), ye.current.delete(n), Ee.current.delete(n), i(u);
2460
+ w("Failed to send screenshot request immediately:", u), ve.current.delete(n), ge.current.delete(n), i(u);
2461
2461
  return;
2462
2462
  }
2463
2463
  setTimeout(() => {
2464
- ye.current.has(n) && (w(`Screenshot request timed out for id ${n}`), Ee.current.get(n)?.(new Error("Screenshot request timed out")), ye.current.delete(n), Ee.current.delete(n));
2464
+ ve.current.has(n) && (w(`Screenshot request timed out for id ${n}`), ge.current.get(n)?.(new Error("Screenshot request timed out")), ve.current.delete(n), ge.current.delete(n));
2465
2465
  }, 3e4);
2466
2466
  }),
2467
2467
  terminateApp: (e) => new Promise((o, i) => {
@@ -2472,15 +2472,15 @@ const Li = Nn(
2472
2472
  id: n,
2473
2473
  bundleId: e
2474
2474
  };
2475
- Te.current.set(n, o), we.current.set(n, i), F("Sending terminateApp request:", l);
2475
+ we.current.set(n, o), Ae.current.set(n, i), F("Sending terminateApp request:", l);
2476
2476
  try {
2477
2477
  T.current.send(JSON.stringify(l));
2478
2478
  } catch (u) {
2479
- w("Failed to send terminateApp request immediately:", u), Te.current.delete(n), we.current.delete(n), i(u);
2479
+ w("Failed to send terminateApp request immediately:", u), we.current.delete(n), Ae.current.delete(n), i(u);
2480
2480
  return;
2481
2481
  }
2482
2482
  z.current?.bumpActivity(), setTimeout(() => {
2483
- Te.current.has(n) && (w(`terminateApp request timed out for id ${n}`), we.current.get(n)?.(new Error("terminateApp request timed out")), Te.current.delete(n), we.current.delete(n));
2483
+ we.current.has(n) && (w(`terminateApp request timed out for id ${n}`), Ae.current.get(n)?.(new Error("terminateApp request timed out")), we.current.delete(n), Ae.current.delete(n));
2484
2484
  }, 3e4);
2485
2485
  }),
2486
2486
  reconnect: () => jt(),
@@ -2501,30 +2501,30 @@ const Li = Nn(
2501
2501
  },
2502
2502
  getAxStatus: () => z.current?.getStatus() ?? "idle"
2503
2503
  }));
2504
- const Sn = Zr && Se !== null;
2504
+ const Sn = Zr && Me !== null;
2505
2505
  return /* @__PURE__ */ oe(
2506
2506
  "div",
2507
2507
  {
2508
2508
  ref: pe,
2509
- className: Ne("rc-container", r),
2509
+ className: Ie("rc-container", r),
2510
2510
  style: { touchAction: "none" },
2511
- onMouseDown: ve,
2512
- onMouseMove: ve,
2513
- onMouseUp: ve,
2514
- onMouseLeave: ve,
2515
- onTouchStart: ve,
2516
- onTouchMove: ve,
2517
- onTouchEnd: ve,
2518
- onTouchCancel: ve,
2511
+ onMouseDown: Oe,
2512
+ onMouseMove: Oe,
2513
+ onMouseUp: Oe,
2514
+ onMouseLeave: Oe,
2515
+ onTouchStart: Oe,
2516
+ onTouchMove: Oe,
2517
+ onTouchEnd: Oe,
2518
+ onTouchCancel: Oe,
2519
2519
  children: [
2520
- Sn && Se && /* @__PURE__ */ oe(Lr, { children: [
2520
+ Sn && Me && /* @__PURE__ */ oe(Lr, { children: [
2521
2521
  /* @__PURE__ */ k(
2522
2522
  "div",
2523
2523
  {
2524
2524
  className: "rc-touch-indicator",
2525
2525
  style: {
2526
- left: `${Se.containerX}px`,
2527
- top: `${Se.containerY}px`
2526
+ left: `${Me.containerX}px`,
2527
+ top: `${Me.containerY}px`
2528
2528
  }
2529
2529
  }
2530
2530
  ),
@@ -2533,8 +2533,8 @@ const Li = Nn(
2533
2533
  {
2534
2534
  className: "rc-touch-indicator",
2535
2535
  style: {
2536
- left: `${Se.mirrorContainerX}px`,
2537
- top: `${Se.mirrorContainerY}px`
2536
+ left: `${Me.mirrorContainerX}px`,
2537
+ top: `${Me.mirrorContainerY}px`
2538
2538
  }
2539
2539
  }
2540
2540
  )
@@ -2542,10 +2542,10 @@ const Li = Nn(
2542
2542
  wt && /* @__PURE__ */ k(
2543
2543
  "img",
2544
2544
  {
2545
- ref: Ke,
2545
+ ref: ke,
2546
2546
  src: yr,
2547
2547
  alt: "",
2548
- className: le === "ios" ? Ne("rc-phone-frame", "rc-phone-frame-ios") : "rc-phone-frame",
2548
+ className: le === "ios" ? Ie("rc-phone-frame", "rc-phone-frame-ios") : "rc-phone-frame",
2549
2549
  draggable: !1
2550
2550
  }
2551
2551
  ),
@@ -2553,7 +2553,7 @@ const Li = Nn(
2553
2553
  "video",
2554
2554
  {
2555
2555
  ref: x,
2556
- className: Ne(
2556
+ className: Ie(
2557
2557
  "rc-video",
2558
2558
  !wt && "rc-video-frameless",
2559
2559
  !qr && "rc-video-loading"