@limrun/ui 0.21.0 → 0.22.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.
Files changed (45) hide show
  1. package/README.md +36 -8
  2. package/dist/BufferGeometryUtils-Dm5SmmmT.mjs +64 -0
  3. package/dist/BufferGeometryUtils-Dne8i0aT.js +1 -0
  4. package/dist/GLTFLoader-DzSwAt9C.js +1 -0
  5. package/dist/{GLTFLoader-D4AITfgZ.mjs → GLTFLoader-L51A9w-A.mjs} +138 -137
  6. package/dist/components/device-view.d.ts +29 -0
  7. package/dist/components/duo-frame.d.ts +5 -1
  8. package/dist/components/duo-model.d.ts +2 -1
  9. package/dist/components/macbook-frame.d.ts +30 -0
  10. package/dist/components/macbook-geometry.d.ts +77 -0
  11. package/dist/components/model-source.d.ts +8 -0
  12. package/dist/components/remote-control.d.ts +40 -1
  13. package/dist/components/studio-environment.d.ts +6 -0
  14. package/dist/core/mac-pointer.d.ts +56 -0
  15. package/dist/{core-CRIachT9.mjs → core-nbvkIrvp.mjs} +24 -24
  16. package/dist/core.js +12 -12
  17. package/dist/duo-frame-CHI6g7BR.mjs +758 -0
  18. package/dist/duo-frame-Cj-xHHW3.js +11 -0
  19. package/dist/duo-model-BYgtCaCR.mjs +4 -0
  20. package/dist/duo-model-CDWgmLRF.js +1 -0
  21. package/dist/duo-model.d.ts +2 -0
  22. package/dist/{duo-view-BeqYIqfQ.mjs → duo-view-Biy9MAlH.mjs} +84 -86
  23. package/dist/duo-view-D0Ndj2Ee.js +1 -0
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.css +1 -1
  26. package/dist/index.js +32 -25
  27. package/dist/lite.cjs +1 -1
  28. package/dist/lite.js +2 -2
  29. package/dist/macbook-frame-BHQtQNGV.mjs +349 -0
  30. package/dist/macbook-frame-CQyZhRFn.js +3 -0
  31. package/dist/macbook-model-BiMxLpmf.mjs +4 -0
  32. package/dist/macbook-model-BpUdvtlU.js +1 -0
  33. package/dist/macbook-model.d.ts +2 -0
  34. package/dist/meshopt_decoder.module-C4Z_evpr.mjs +217 -0
  35. package/dist/meshopt_decoder.module-DxJdu6ez.js +1 -0
  36. package/dist/{duo-frame-D1JK_cRk.mjs → model-source-BjSq5Any.mjs} +5353 -6125
  37. package/dist/model-source-S12HoOoQ.js +4049 -0
  38. package/dist/remote-control-BGKETUbE.mjs +1746 -0
  39. package/dist/remote-control-OLgfUSR1.js +1 -0
  40. package/package.json +1 -1
  41. package/dist/GLTFLoader-C25N9Y4j.js +0 -1
  42. package/dist/duo-frame-B1NXSk6a.js +0 -4059
  43. package/dist/duo-view-PsR5b045.js +0 -1
  44. package/dist/remote-control-DNr0Pyrx.js +0 -1
  45. package/dist/remote-control-rdm3mDtI.mjs +0 -1299
@@ -0,0 +1,2 @@
1
+ import { default as duoModel } from './assets/iphone_duo.glb?url';
2
+ export default duoModel;
@@ -1,11 +1,12 @@
1
- import { jsx as o, jsxs as x, Fragment as z } from "react/jsx-runtime";
2
- import ot, { useId as J, useState as W, useRef as M, useEffect as T, useCallback as at, useLayoutEffect as it, Suspense as st, lazy as ct } from "react";
3
- import { H as dt, D as A, z as ut, B as lt, C as ht, E as ft, F as j } from "./core-CRIachT9.mjs";
4
- function mt(t, n, r) {
5
- const [s, i] = W(t), a = M({ nativeAngle: t, send: n, failed: r });
1
+ import { jsx as o, jsxs as x, Fragment as R } from "react/jsx-runtime";
2
+ import ot, { useId as J, useState as S, useRef as M, useEffect as T, useCallback as at, useLayoutEffect as it, Suspense as st, lazy as ct } from "react";
3
+ import { u as dt, D as ut } from "./remote-control-BGKETUbE.mjs";
4
+ import { H as lt, D as A, h as ht, i as ft, j as mt, k as pt, l as j } from "./core-nbvkIrvp.mjs";
5
+ function gt(t, n, r) {
6
+ const [s, i] = S(t), a = M({ nativeAngle: t, send: n, failed: r });
6
7
  a.current = { nativeAngle: t, send: n, failed: r };
7
8
  const u = M(void 0), m = M(!1), d = M(null);
8
- return T(() => (d.current = new dt(
9
+ return T(() => (d.current = new lt(
9
10
  async (h) => {
10
11
  await a.current.send(h), u.current === h && (u.current = void 0);
11
12
  },
@@ -18,7 +19,7 @@ function mt(t, n, r) {
18
19
  a.current.failed(void 0), u.current = h, i(h), d.current?.set(h);
19
20
  }, interacting: m };
20
21
  }
21
- function pt({
22
+ function yt({
22
23
  angle: t,
23
24
  watchOnly: n = !1,
24
25
  changeAngle: r,
@@ -101,7 +102,7 @@ function pt({
101
102
  d && /* @__PURE__ */ o("div", { className: "rc-duo-views", "aria-label": "Device view", children: d })
102
103
  ] });
103
104
  }
104
- function gt({ button: t }) {
105
+ function bt({ button: t }) {
105
106
  return /* @__PURE__ */ o(
106
107
  "svg",
107
108
  {
@@ -114,10 +115,10 @@ function gt({ button: t }) {
114
115
  strokeLinecap: "round",
115
116
  strokeLinejoin: "round",
116
117
  "aria-hidden": "true",
117
- children: t === "side" ? /* @__PURE__ */ x(z, { children: [
118
+ children: t === "side" ? /* @__PURE__ */ x(R, { children: [
118
119
  /* @__PURE__ */ o("rect", { x: "6", y: "10", width: "12", height: "11", rx: "2" }),
119
120
  /* @__PURE__ */ o("path", { d: "M8 10V7a4 4 0 0 1 8 0v3" })
120
- ] }) : /* @__PURE__ */ x(z, { children: [
121
+ ] }) : /* @__PURE__ */ x(R, { children: [
121
122
  /* @__PURE__ */ o("path", { d: "M3 9h4l5-5v16l-5-5H3zM17 12h5" }),
122
123
  t === "volumeUp" && /* @__PURE__ */ o("path", { d: "M19.5 9.5v5" })
123
124
  ] })
@@ -151,7 +152,7 @@ function Q({ inner: t, width: n, height: r }) {
151
152
  /* @__PURE__ */ o("stop", { offset: "1", stopColor: "#666e72" })
152
153
  ] })
153
154
  ] }),
154
- !t && /* @__PURE__ */ x(z, { children: [
155
+ !t && /* @__PURE__ */ x(R, { children: [
155
156
  /* @__PURE__ */ o(
156
157
  "rect",
157
158
  {
@@ -227,7 +228,7 @@ function Q({ inner: t, width: n, height: r }) {
227
228
  )
228
229
  ] });
229
230
  }
230
- function yt(t, n, r, s) {
231
+ function vt(t, n, r, s) {
231
232
  const i = A.width / (t ? 1 : 2), a = A.height, u = t ? 157.5 : 77.1, m = t ? 110.8 : 112.2, d = (n + (t ? 3 : 0)) % 4, l = Math.max(
232
233
  0,
233
234
  Math.min(
@@ -238,9 +239,9 @@ function yt(t, n, r, s) {
238
239
  y = (y - i / 2) * l, f = (f - a / 2) * l;
239
240
  const P = d === 1 ? { x: -f, y } : d === 2 ? { x: -y, y: -f } : d === 3 ? { x: f, y: -y } : { x: y, y: f };
240
241
  return { x: P.x + r / 2, y: P.y + s / 2 };
241
- }, H = (d % 2 ? a : i) * l, D = (d % 2 ? i : a) * l, F = {
242
- min: { x: (r - H) / 2, y: (s - D) / 2 },
243
- max: { x: (r + H) / 2, y: (s + D) / 2 }
242
+ }, H = (d % 2 ? a : i) * l, k = (d % 2 ? i : a) * l, F = {
243
+ min: { x: (r - H) / 2, y: (s - k) / 2 },
244
+ max: { x: (r + H) / 2, y: (s + k) / 2 }
244
245
  }, g = [
245
246
  { button: "volumeDown", x: i - 37, y: -0.32, width: 9.5, height: 0.65, edge: "top" },
246
247
  { button: "volumeUp", x: i - 25, y: -0.32, width: 9.5, height: 0.65, edge: "top" },
@@ -265,13 +266,13 @@ function yt(t, n, r, s) {
265
266
  buttons: g,
266
267
  guides: v,
267
268
  rect: F,
268
- iconSize: Math.min(bt(F), 12 * l)
269
+ iconSize: Math.min(wt(F), 12 * l)
269
270
  };
270
271
  }
271
- function bt(t) {
272
+ function wt(t) {
272
273
  return Math.max(12, Math.min(24, Math.max(t.max.x - t.min.x, t.max.y - t.min.y) / 24));
273
274
  }
274
- function vt(t, n, r) {
275
+ function xt(t, n, r) {
275
276
  return [
276
277
  ["top", r.min.y - n, t, r.min.x, r.max.x],
277
278
  ["bottom", n - r.max.y, t, r.min.x, r.max.x],
@@ -291,7 +292,7 @@ function _(t) {
291
292
  return;
292
293
  }
293
294
  }
294
- function wt(t, n) {
295
+ function Mt(t, n) {
295
296
  let r = !1, s;
296
297
  const i = (l) => {
297
298
  r || (d(), n(l));
@@ -308,21 +309,21 @@ function wt(t, n) {
308
309
  }
309
310
  return d;
310
311
  }
311
- function xt(t, n, r, s, i = !0) {
312
+ function Ct(t, n, r, s, i = !0) {
312
313
  const a = M(void 0), u = M(s), m = M({ inner: n, frame: r });
313
314
  m.current = { inner: n, frame: r };
314
- const [d, l] = W(), h = M(void 0), H = M(void 0), D = at(() => {
315
+ const [d, l] = S(), h = M(void 0), H = M(void 0), k = at(() => {
315
316
  clearTimeout(H.current), h.current = void 0, l(void 0);
316
317
  }, []), F = (g) => {
317
318
  if (!i || g === n) {
318
- D();
319
+ k();
319
320
  return;
320
321
  }
321
322
  if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || h.current) return;
322
323
  const b = _(t.current);
323
324
  if (!b) return;
324
325
  const v = m.current;
325
- h.current = { from: v, to: v, before: b, ready: !1 }, l(h.current), H.current = setTimeout(D, 5e3);
326
+ h.current = { from: v, to: v, before: b, ready: !1 }, l(h.current), H.current = setTimeout(k, 5e3);
326
327
  };
327
328
  return T(() => () => clearTimeout(H.current), []), it(() => {
328
329
  const g = a.current, b = { inner: n, frame: r };
@@ -331,7 +332,7 @@ function xt(t, n, r, s, i = !0) {
331
332
  if (u.current = s, !g) return;
332
333
  const w = Math.abs(g.frame.rect.min.x + g.frame.rect.max.x - r.rect.min.x - r.rect.max.x) > 0.5 || Math.abs(g.frame.rect.min.y + g.frame.rect.max.y - r.rect.min.y - r.rect.max.y) > 0.5;
333
334
  if (!i || w || v) {
334
- D();
335
+ k();
335
336
  return;
336
337
  }
337
338
  if (g.inner === n || (l(void 0), !g.frame.scale || !r.scale) || window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;
@@ -339,17 +340,17 @@ function xt(t, n, r, s, i = !0) {
339
340
  clearTimeout(H.current), h.current = void 0, p && l({ from: N, to: b, before: p, ready: !1 });
340
341
  }, [n, r.scale, r.turns, r.rect.min.x, r.rect.min.y, s, i]), T(() => {
341
342
  if (!d || d.from.inner === n) return;
342
- const g = wt(t.current, (w) => {
343
- w ? l((p) => p && { ...p, to: m.current, after: w, ready: !0 }) : D();
343
+ const g = Mt(t.current, (w) => {
344
+ w ? l((p) => p && { ...p, to: m.current, after: w, ready: !0 }) : k();
344
345
  }), b = window.matchMedia?.("(prefers-reduced-motion: reduce)"), v = () => {
345
346
  b?.matches && l(void 0);
346
347
  };
347
348
  return b?.addEventListener("change", v), () => {
348
349
  g(), b?.removeEventListener("change", v);
349
350
  };
350
- }, [d?.from, n]), { motion: d, finish: D, prepare: F };
351
+ }, [d?.from, n]), { motion: d, finish: k, prepare: F };
351
352
  }
352
- function Mt({ pose: t, image: n, scale: r }) {
353
+ function Dt({ pose: t, image: n, scale: r }) {
353
354
  const { bodyWidth: s, bodyHeight: i, screenWidth: a, screenHeight: u } = t.frame, m = a * r, d = u * r;
354
355
  return /* @__PURE__ */ x("div", { className: "rc-duo-fold-still", style: { width: s * r, height: i * r }, children: [
355
356
  /* @__PURE__ */ o(Q, { inner: t.inner, width: s, height: i }),
@@ -381,8 +382,8 @@ function Mt({ pose: t, image: n, scale: r }) {
381
382
  )
382
383
  ] });
383
384
  }
384
- function Ct({ motion: t, onFinish: n }) {
385
- const r = M(null), [s, i] = W(!1);
385
+ function kt({ motion: t, onFinish: n }) {
386
+ const r = M(null), [s, i] = S(!1);
386
387
  return T(() => {
387
388
  if (i(!1), !t.ready) return;
388
389
  let a = !1, u;
@@ -393,7 +394,7 @@ function Ct({ motion: t, onFinish: n }) {
393
394
  }), () => {
394
395
  a = !0, u?.();
395
396
  };
396
- }, [t.ready, t.from, n]), /* @__PURE__ */ x(z, { children: [
397
+ }, [t.ready, t.from, n]), /* @__PURE__ */ x(R, { children: [
397
398
  !s && /* @__PURE__ */ o(
398
399
  "div",
399
400
  {
@@ -404,7 +405,7 @@ function Ct({ motion: t, onFinish: n }) {
404
405
  height: t.from.frame.bodyHeight * t.from.frame.scale,
405
406
  transform: `translate(-50%, -50%) rotate(${t.from.frame.turns * 90}deg)`
406
407
  },
407
- children: /* @__PURE__ */ o(Mt, { pose: t.from, image: t.before, scale: t.from.frame.scale })
408
+ children: /* @__PURE__ */ o(Dt, { pose: t.from, image: t.before, scale: t.from.frame.scale })
408
409
  }
409
410
  ),
410
411
  /* @__PURE__ */ o(
@@ -418,29 +419,26 @@ function Ct({ motion: t, onFinish: n }) {
418
419
  )
419
420
  ] });
420
421
  }
421
- const kt = ct(() => import("./duo-frame-D1JK_cRk.mjs").then((t) => t.ac));
422
- function Dt(t) {
423
- const [n, r] = W("2d");
422
+ const Pt = ct(() => import("./duo-frame-CHI6g7BR.mjs"));
423
+ function Ft(t) {
424
+ const n = dt();
424
425
  return /* @__PURE__ */ x("div", { className: "rc-duo-view", children: [
425
- t.showFrame !== !1 && n === "3d" ? /* @__PURE__ */ o(st, { fallback: /* @__PURE__ */ o(Z, { ...t }), children: /* @__PURE__ */ o(kt, { ...t }) }) : /* @__PURE__ */ o(Z, { ...t }),
426
- t.showFrame !== !1 && /* @__PURE__ */ x("div", { className: "rc-duo-mode", role: "group", "aria-label": "Device rendering", children: [
427
- /* @__PURE__ */ o("button", { type: "button", "aria-pressed": n === "2d", onClick: () => r("2d"), children: "2D" }),
428
- /* @__PURE__ */ o("button", { type: "button", "aria-pressed": n === "3d", onClick: () => r("3d"), children: "3D" })
429
- ] })
426
+ t.showFrame !== !1 && n.mode === "3d" ? /* @__PURE__ */ o(st, { fallback: /* @__PURE__ */ o(Z, { ...t }), children: /* @__PURE__ */ o(Pt, { ...t, onReady: n.onReady }) }) : /* @__PURE__ */ o(Z, { ...t }),
427
+ t.showFrame !== !1 && /* @__PURE__ */ o(ut, { view: n, label: "Device rendering" })
430
428
  ] });
431
429
  }
432
430
  function Z(t) {
433
431
  const n = t.showFrame !== !1, r = M(null), s = M(null), i = M(t);
434
432
  i.current = t;
435
- const [a, u] = W({ width: 0, height: 0 }), [m, d] = W(), [l, h] = W(), [H, D] = W(), [F, g] = W(), b = M(void 0), v = M(null);
436
- v.current || (v.current = new ut((...e) => i.current.touch(...e)));
437
- const w = M(null), p = lt(t.state), N = p?.id === "inner" ? t.inner : t.outer, y = ht(p?.orientation), f = p?.id === "inner", P = { portrait: 0, pud: 2, "landscape-left": 3, "landscape-right": 1 }[t.state.orientation], R = n ? (P + (f ? 1 : 0)) % 4 : y, C = yt(f, R, a.width, a.height), U = n ? C.screenWidth : (f ? p?.height : p?.width) ?? 1, B = n ? C.screenHeight : (f ? p?.width : p?.height) ?? 1, S = n ? C.bodyWidth : U, O = n ? C.bodyHeight : B, k = n ? C.scale : Math.max(
433
+ const [a, u] = S({ width: 0, height: 0 }), [m, d] = S(), [l, h] = S(), [H, k] = S(), [F, g] = S(), b = M(void 0), v = M(null);
434
+ v.current || (v.current = new ht((...e) => i.current.touch(...e)));
435
+ const w = M(null), p = ft(t.state), N = p?.id === "inner" ? t.inner : t.outer, y = mt(p?.orientation), f = p?.id === "inner", P = { portrait: 0, pud: 2, "landscape-left": 3, "landscape-right": 1 }[t.state.orientation], z = n ? (P + (f ? 1 : 0)) % 4 : y, C = vt(f, z, a.width, a.height), U = n ? C.screenWidth : (f ? p?.height : p?.width) ?? 1, V = n ? C.screenHeight : (f ? p?.width : p?.height) ?? 1, E = n ? C.bodyWidth : U, O = n ? C.bodyHeight : V, D = n ? C.scale : Math.max(
438
436
  0,
439
437
  Math.min(
440
- a.width / (C.turns % 2 ? O : S),
441
- a.height / (C.turns % 2 ? S : O)
438
+ a.width / (C.turns % 2 ? O : E),
439
+ a.height / (C.turns % 2 ? E : O)
442
440
  )
443
- ), V = U * k, K = B * k;
441
+ ), B = U * D, K = V * D;
444
442
  T(() => {
445
443
  const e = new ResizeObserver(([c]) => {
446
444
  c && u({ width: c.contentRect.width, height: c.contentRect.height });
@@ -460,10 +458,10 @@ function Z(t) {
460
458
  };
461
459
  }, [N, t.outer, t.inner]);
462
460
  const {
463
- motion: E,
461
+ motion: W,
464
462
  finish: $,
465
463
  prepare: tt
466
- } = xt(s, f, C, t.state.orientation, n), { angle: et, changeAngle: rt, interacting: nt } = mt(
464
+ } = Ct(s, f, C, t.state.orientation, n), { angle: et, changeAngle: rt, interacting: nt } = gt(
467
465
  t.state.angleDegrees,
468
466
  async (e) => {
469
467
  tt(e >= 90);
@@ -478,7 +476,7 @@ function Z(t) {
478
476
  v.current?.release(), b.current = void 0;
479
477
  };
480
478
  T(() => {
481
- w.current = new ft(
479
+ w.current = new pt(
482
480
  (c, X) => i.current.button(c, X),
483
481
  (c) => d(String(c))
484
482
  );
@@ -489,24 +487,24 @@ function Z(t) {
489
487
  e(), window.removeEventListener("blur", e);
490
488
  };
491
489
  }, []), T(() => {
492
- v.current?.setDisplay(p, R), v.current?.active || (b.current = void 0);
493
- }, [p, R]);
490
+ v.current?.setDisplay(p, z), v.current?.active || (b.current = void 0);
491
+ }, [p, z]);
494
492
  const L = () => {
495
493
  w.current?.release(), g(void 0);
496
494
  }, q = (e) => ({
497
495
  disabled: t.watchOnly,
498
496
  onPointerDown: (c) => {
499
- t.watchOnly || E || c.button !== 0 || (c.currentTarget.setPointerCapture(c.pointerId), w.current?.press(e), g(e));
497
+ t.watchOnly || W || c.button !== 0 || (c.currentTarget.setPointerCapture(c.pointerId), w.current?.press(e), g(e));
500
498
  },
501
499
  onPointerUp: L,
502
500
  onPointerCancel: L,
503
501
  onLostPointerCapture: L,
504
502
  onBlur: L,
505
- onPointerEnter: () => D(e),
506
- onPointerLeave: () => D(void 0),
503
+ onPointerEnter: () => k(e),
504
+ onPointerLeave: () => k(void 0),
507
505
  onFocus: () => h(C.guides.find((c) => c.button === e)?.edge),
508
506
  onKeyDown: (c) => {
509
- E || (c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.repeat || (w.current?.press(e), g(e)));
507
+ W || (c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.repeat || (w.current?.press(e), g(e)));
510
508
  },
511
509
  onKeyUp: (c) => {
512
510
  (c.key === "Enter" || c.key === " ") && (c.preventDefault(), L());
@@ -521,15 +519,15 @@ function Z(t) {
521
519
  {
522
520
  ref: r,
523
521
  className: "rc-duo-flat-stage",
524
- "data-folding": !!E,
525
- "aria-busy": !!E,
522
+ "data-folding": !!W,
523
+ "aria-busy": !!W,
526
524
  onPointerMove: (e) => {
527
525
  if (!n) return;
528
526
  const c = e.currentTarget.getBoundingClientRect();
529
- h(vt(e.clientX - c.left, e.clientY - c.top, C.rect));
527
+ h(xt(e.clientX - c.left, e.clientY - c.top, C.rect));
530
528
  },
531
529
  onPointerLeave: () => {
532
- h(void 0), D(void 0);
530
+ h(void 0), k(void 0);
533
531
  },
534
532
  children: [
535
533
  /* @__PURE__ */ x(
@@ -538,12 +536,12 @@ function Z(t) {
538
536
  className: "rc-duo-flat-device",
539
537
  "data-display": f ? "inner" : "outer",
540
538
  style: {
541
- width: S * k,
542
- height: O * k,
539
+ width: E * D,
540
+ height: O * D,
543
541
  transform: "translate(-50%, -50%) rotate(" + C.turns * 90 + "deg)"
544
542
  },
545
543
  children: [
546
- n && /* @__PURE__ */ o(Q, { inner: f, width: S, height: O }),
544
+ n && /* @__PURE__ */ o(Q, { inner: f, width: E, height: O }),
547
545
  /* @__PURE__ */ o(
548
546
  "div",
549
547
  {
@@ -552,16 +550,16 @@ function Z(t) {
552
550
  "aria-label": "iPhone Duo 2D simulator",
553
551
  tabIndex: 0,
554
552
  style: {
555
- width: V,
553
+ width: B,
556
554
  height: K,
557
- left: (S - U) / 2 * k,
558
- top: (O - B) / 2 * k,
559
- borderRadius: n ? f ? 5.3 * k : [0.8, 6.6, 6.6, 0.8].map((e) => e * k + "px").join(" ") : 0
555
+ left: (E - U) / 2 * D,
556
+ top: (O - V) / 2 * D,
557
+ borderRadius: n ? f ? 5.3 * D : [0.8, 6.6, 6.6, 0.8].map((e) => e * D + "px").join(" ") : 0
560
558
  },
561
- onKeyDown: E ? void 0 : t.onKeyDown,
559
+ onKeyDown: W ? void 0 : t.onKeyDown,
562
560
  onKeyUp: t.onKeyUp,
563
561
  onPointerDown: (e) => {
564
- if (t.watchOnly || E || b.current !== void 0 || e.button !== 0 || !p)
562
+ if (t.watchOnly || W || b.current !== void 0 || e.button !== 0 || !p)
565
563
  return;
566
564
  e.currentTarget.focus({ preventScroll: !0 }), e.currentTarget.setPointerCapture(e.pointerId);
567
565
  const c = G(e);
@@ -585,8 +583,8 @@ function Z(t) {
585
583
  muted: !0,
586
584
  playsInline: !0,
587
585
  style: {
588
- width: f ? K : V,
589
- height: f ? V : K,
586
+ width: f ? K : B,
587
+ height: f ? B : K,
590
588
  transform: "translate(-50%, -50%) rotate(" + (f ? 90 : 0) + "deg)"
591
589
  }
592
590
  }
@@ -605,16 +603,16 @@ function Z(t) {
605
603
  "aria-label": j[e.button] + " physical button",
606
604
  title: j[e.button],
607
605
  style: {
608
- left: e.x * k,
609
- top: e.y * k,
610
- width: e.edge === "top" ? Math.max(28, e.width * k) : 28,
611
- height: e.edge === "top" ? 28 : Math.max(28, e.height * k)
606
+ left: e.x * D,
607
+ top: e.y * D,
608
+ width: e.edge === "top" ? Math.max(28, e.width * D) : 28,
609
+ height: e.edge === "top" ? 28 : Math.max(28, e.height * D)
612
610
  },
613
611
  ...q(e.button),
614
612
  children: /* @__PURE__ */ o(
615
613
  "span",
616
614
  {
617
- style: { width: Math.max(2, e.width * k), height: Math.max(2, e.height * k) }
615
+ style: { width: Math.max(2, e.width * D), height: Math.max(2, e.height * D) }
618
616
  }
619
617
  )
620
618
  },
@@ -641,16 +639,16 @@ function Z(t) {
641
639
  "--duo-hardware-icon-y": `${e.y - e.targetY}px`
642
640
  },
643
641
  ...q(e.button),
644
- children: /* @__PURE__ */ o(gt, { button: e.button })
642
+ children: /* @__PURE__ */ o(bt, { button: e.button })
645
643
  },
646
644
  e.button
647
645
  )),
648
- E && /* @__PURE__ */ o(Ct, { motion: E, onFinish: $ })
646
+ W && /* @__PURE__ */ o(kt, { motion: W, onFinish: $ })
649
647
  ]
650
648
  }
651
649
  ),
652
650
  n && /* @__PURE__ */ o(
653
- pt,
651
+ yt,
654
652
  {
655
653
  watchOnly: t.watchOnly,
656
654
  angle: et,
@@ -665,15 +663,15 @@ function Z(t) {
665
663
  m && /* @__PURE__ */ o("div", { role: "alert", className: "rc-duo-error", children: m })
666
664
  ] });
667
665
  }
668
- const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
666
+ const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
669
667
  __proto__: null,
670
- default: Dt
668
+ default: Ft
671
669
  }, Symbol.toStringTag, { value: "Module" }));
672
670
  export {
673
- gt as D,
674
- pt as a,
675
- Ht as d,
676
- vt as f,
677
- bt as h,
678
- mt as u
671
+ bt as D,
672
+ yt as a,
673
+ St as d,
674
+ xt as f,
675
+ wt as h,
676
+ gt as u
679
677
  };
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react/jsx-runtime"),u=require("react"),X=require("./remote-control-OLgfUSR1.js"),R=require("./core-BCBQrYsk.js");function $(e,o,n){const[a,i]=u.useState(e),s=u.useRef({nativeAngle:e,send:o,failed:n});s.current={nativeAngle:e,send:o,failed:n};const l=u.useRef(void 0),x=u.useRef(!1),d=u.useRef(null);return u.useEffect(()=>(d.current=new R.HingeSender(async h=>{await s.current.send(h),l.current===h&&(l.current=void 0)},h=>{l.current=void 0,s.current.failed(String(h)),i(s.current.nativeAngle)}),()=>d.current?.stop()),[]),u.useEffect(()=>{!x.current&&l.current===void 0&&i(e)},[e]),{angle:a,changeAngle:h=>{s.current.failed(void 0),l.current=h,i(h),d.current?.set(h)},interacting:x}}function G({angle:e,watchOnly:o=!1,changeAngle:n,interacting:a,rotate:i,onFold:s,foldTarget:l,onHingeDrag:x,children:d}){const f=u.useId();return r.jsxs("div",{className:"rc-duo-controls",onPointerDown:h=>h.stopPropagation(),children:[r.jsxs("div",{className:"rc-duo-hinge",children:[r.jsx("button",{disabled:o,className:"rc-duo-fold",onClick:s??(()=>n(e<90?180:0)),children:(l??e)<90?"Unfold":"Fold"}),r.jsx("label",{htmlFor:f,children:"Hinge"}),r.jsx("input",{id:f,type:"range",disabled:o,min:0,max:180,step:1,value:e,onPointerDown:h=>{x?.(),a.current=!0,h.currentTarget.setPointerCapture(h.pointerId)},onPointerUp:()=>{a.current=!1},onPointerCancel:()=>{a.current=!1},onLostPointerCapture:()=>{a.current=!1},onChange:h=>n(Number(h.target.value))}),r.jsxs("output",{children:[Math.round(e),"°"]}),r.jsx("button",{disabled:o,className:"rc-duo-rotate","aria-label":"Rotate device",title:"Rotate device",onClick:i,children:r.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:"1.6","aria-hidden":"true",children:[r.jsx("rect",{x:"7",y:"3",width:"10",height:"18",rx:"2"}),r.jsx("path",{d:"M3 9a9 9 0 0 1 3-5M3 4v5h5M21 15a9 9 0 0 1-3 5m3 0v-5h-5"})]})})]}),d&&r.jsx("div",{className:"rc-duo-views","aria-label":"Device view",children:d})]})}function A({button:e}){return r.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e==="side"?r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"6",y:"10",width:"12",height:"11",rx:"2"}),r.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}):r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M3 9h4l5-5v16l-5-5H3zM17 12h5"}),e==="volumeUp"&&r.jsx("path",{d:"M19.5 9.5v5"})]})})}function B(e,o,n,a,i,s){return"M"+(e+i)+","+o+"H"+(e+n-s)+"a"+s+","+s+" 0 0 1 "+s+","+s+"V"+(o+a-s)+"a"+s+","+s+" 0 0 1 "+-s+","+s+"H"+(e+i)+"a"+i+","+i+" 0 0 1 "+-i+","+-i+"V"+(o+i)+"a"+i+","+i+" 0 0 1 "+i+","+-i+"Z"}function Z({inner:e,width:o,height:n}){const a=u.useId().replace(/:/g,""),i=e?8.4:1.25,s=8.4;return r.jsxs("svg",{className:"rc-duo-flat-frame",viewBox:"0 0 "+o+" "+n,"aria-hidden":"true",children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:a+"-silver",x1:"0",y1:"0",x2:"1",y2:"1",children:[r.jsx("stop",{offset:"0",stopColor:"#62676b"}),r.jsx("stop",{offset:"0.035",stopColor:"#f9faf9"}),r.jsx("stop",{offset:"0.11",stopColor:"#b0b4b6"}),r.jsx("stop",{offset:"0.31",stopColor:"#fdfefd"}),r.jsx("stop",{offset:"0.43",stopColor:"#797f84"}),r.jsx("stop",{offset:"0.51",stopColor:"#e8eaea"}),r.jsx("stop",{offset:"0.7",stopColor:"#979da1"}),r.jsx("stop",{offset:"0.87",stopColor:"#fafbf9"}),r.jsx("stop",{offset:"1",stopColor:"#5f676c"})]}),r.jsxs("linearGradient",{id:a+"-spine",children:[r.jsx("stop",{stopColor:"#4a5154"}),r.jsx("stop",{offset:"0.16",stopColor:"#d6d9d9"}),r.jsx("stop",{offset:"0.4",stopColor:"#f8f9f7"}),r.jsx("stop",{offset:"0.62",stopColor:"#a2a8ab"}),r.jsx("stop",{offset:"0.83",stopColor:"#e4e7e5"}),r.jsx("stop",{offset:"1",stopColor:"#666e72"})]})]}),!e&&r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"-2.3",y:"0.7",width:"3.3",height:n-1.4,rx:"0.85",fill:"url(#"+a+"-spine)",stroke:"#8b9296",strokeWidth:"0.15"}),r.jsx("path",{d:"M-.6 2V"+(n-2),stroke:"#f5f6f4",strokeWidth:"0.22"})]}),r.jsx("path",{d:B(0,0,o,n,i,s),fill:"url(#"+a+"-silver)",stroke:"#696f72",strokeWidth:"0.24"}),r.jsx("path",{d:B(.48,.48,o-.96,n-.96,Math.max(.5,i-.48),s-.48),fill:"none",stroke:"#ffffff",strokeOpacity:"0.85",strokeWidth:"0.2"}),r.jsx("path",{d:B(1.12,1.12,o-2.24,n-2.24,e?7.15:.65,7.15),fill:"#090b0d",stroke:"#34393c",strokeWidth:"0.2"}),[o-16,e?19:16].map(l=>r.jsx(u.Fragment,{children:r.jsx("path",{d:"M"+l+",0.17v0.82M"+l+","+(n-1)+"v0.82",stroke:"#b1b2ac",strokeWidth:"1.1"})},l)),e&&[0,n-.6].map(l=>r.jsx("rect",{x:o/2-2.2,y:l,width:"4.4",height:"0.6",rx:"0.18",fill:"url(#"+a+"-spine)",stroke:"#697074",strokeWidth:"0.14"},l)),r.jsx("path",{d:"M"+(o-.1)+",20h-.9m.9,"+(n-40)+"h-.9",stroke:"#b1b2ac",strokeWidth:"1.05"})]})}function oe(e,o,n,a){const i=R.DUO_DIMENSIONS.width/(e?1:2),s=R.DUO_DIMENSIONS.height,l=e?157.5:77.1,x=e?110.8:112.2,d=(o+(e?3:0))%4,f=Math.max(0,Math.min((n-120)/(d%2?s:i),(a-120)/(d%2?i:s))),h=(y,m)=>{y=(y-i/2)*f,m=(m-s/2)*f;const C=d===1?{x:-m,y}:d===2?{x:-y,y:-m}:d===3?{x:m,y:-y}:{x:y,y:m};return{x:C.x+n/2,y:C.y+a/2}},E=(d%2?s:i)*f,D=(d%2?i:s)*f,k={min:{x:(n-E)/2,y:(a-D)/2},max:{x:(n+E)/2,y:(a+D)/2}},p=[{button:"volumeDown",x:i-37,y:-.32,width:9.5,height:.65,edge:"top"},{button:"volumeUp",x:i-25,y:-.32,width:9.5,height:.65,edge:"top"},{button:"side",x:i+.35,y:s/2-21,width:.7,height:13,edge:"right"}],v=["top","right","bottom","left"],b=p.map(y=>{const m=v[(v.indexOf(y.edge)+d)%4],C=h(y.x,y.y);return m==="top"&&(C.y=k.min.y-28),m==="bottom"&&(C.y=k.max.y+28),m==="left"&&(C.x=k.min.x-28),m==="right"&&(C.x=k.max.x+28),{button:y.button,edge:m,...C,targetX:C.x,targetY:C.y}}),j=b.filter(y=>y.button!=="side"),g=d%2?"y":"x";j.sort((y,m)=>y[g]-m[g]);const S=d%2?"targetY":"targetX";if(j[1][g]-j[0][g]<44){const y=(j[0][g]+j[1][g])/2;j[0][S]=y-22,j[1][S]=y+22}return{bodyWidth:i,bodyHeight:s,screenWidth:l,screenHeight:x,scale:f,turns:d,buttons:p,guides:b,rect:k,iconSize:Math.min(J(k),12*f)}}function J(e){return Math.max(12,Math.min(24,Math.max(e.max.x-e.min.x,e.max.y-e.min.y)/24))}function Q(e,o,n){return[["top",n.min.y-o,e,n.min.x,n.max.x],["bottom",o-n.max.y,e,n.min.x,n.max.x],["left",n.min.x-e,o,n.min.y,n.max.y],["right",e-n.max.x,o,n.min.y,n.max.y]].filter(([,i,s,l,x])=>i>=-7&&i<=52&&s>=l-12&&s<=x+12).sort((i,s)=>Math.abs(i[1])-Math.abs(s[1]))[0]?.[0]}function V(e){if(!e||e.readyState<2||!e.videoWidth||!e.videoHeight)return;const o=Math.min(1,1024/Math.max(e.videoWidth,e.videoHeight)),n=document.createElement("canvas");try{const a=n.getContext("2d");return a?(n.width=Math.round(e.videoWidth*o),n.height=Math.round(e.videoHeight*o),a.drawImage(e,0,0,n.width,n.height),n):void 0}catch{return}}function se(e,o){let n=!1,a;const i=f=>{n||(d(),o(f))},s=()=>{if(n)return;const f=V(e);f&&i(f)},l=()=>{a=void 0,s(),n||(a=e?.requestVideoFrameCallback?.(l))},x=setTimeout(()=>i(void 0),2500);a=e?.requestVideoFrameCallback?.(l),e?.addEventListener("loadeddata",s),!e?.requestVideoFrameCallback&&e&&e.readyState>=2&&s();function d(){n=!0,clearTimeout(x),a!==void 0&&e?.cancelVideoFrameCallback(a),e?.removeEventListener("loadeddata",s)}return d}function ie(e,o,n,a,i=!0){const s=u.useRef(void 0),l=u.useRef(a),x=u.useRef({inner:o,frame:n});x.current={inner:o,frame:n};const[d,f]=u.useState(),h=u.useRef(void 0),E=u.useRef(void 0),D=u.useCallback(()=>{clearTimeout(E.current),h.current=void 0,f(void 0)},[]),k=p=>{if(!i||p===o){D();return}if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||h.current)return;const v=V(e.current);if(!v)return;const b=x.current;h.current={from:b,to:b,before:v,ready:!1},f(h.current),E.current=setTimeout(D,5e3)};return u.useEffect(()=>()=>clearTimeout(E.current),[]),u.useLayoutEffect(()=>{const p=s.current,v={inner:o,frame:n};s.current=v;const b=l.current!==a;if(l.current=a,!p)return;const j=Math.abs(p.frame.rect.min.x+p.frame.rect.max.x-n.rect.min.x-n.rect.max.x)>.5||Math.abs(p.frame.rect.min.y+p.frame.rect.max.y-n.rect.min.y-n.rect.max.y)>.5;if(!i||j||b){D();return}if(p.inner===o||(f(void 0),!p.frame.scale||!n.scale)||window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const g=h.current?.before??V(e.current),S=h.current?.from??p;clearTimeout(E.current),h.current=void 0,g&&f({from:S,to:v,before:g,ready:!1})},[o,n.scale,n.turns,n.rect.min.x,n.rect.min.y,a,i]),u.useEffect(()=>{if(!d||d.from.inner===o)return;const p=se(e.current,j=>{j?f(g=>g&&{...g,to:x.current,after:j,ready:!0}):D()}),v=window.matchMedia?.("(prefers-reduced-motion: reduce)"),b=()=>{v?.matches&&f(void 0)};return v?.addEventListener("change",b),()=>{p(),v?.removeEventListener("change",b)}},[d?.from,o]),{motion:d,finish:D,prepare:k}}function ae({pose:e,image:o,scale:n}){const{bodyWidth:a,bodyHeight:i,screenWidth:s,screenHeight:l}=e.frame,x=s*n,d=l*n;return r.jsxs("div",{className:"rc-duo-fold-still",style:{width:a*n,height:i*n},children:[r.jsx(Z,{inner:e.inner,width:a,height:i}),r.jsx("div",{className:"rc-duo-flat-screen",style:{width:x,height:d,left:(a-s)*n/2,top:(i-l)*n/2,borderRadius:e.inner?5.3*n:[.8,6.6,6.6,.8].map(f=>f*n+"px").join(" ")},children:o&&r.jsx("canvas",{ref:f=>{f&&(f.width=o.width,f.height=o.height,f.getContext("2d")?.drawImage(o,0,0))},style:{width:e.inner?d:x,height:e.inner?x:d,transform:`translate(-50%, -50%) rotate(${e.inner?90:0}deg)`}})})]})}function ce({motion:e,onFinish:o}){const n=u.useRef(null),[a,i]=u.useState(!1);return u.useEffect(()=>{if(i(!1),!e.ready)return;let s=!1,l;return Promise.resolve().then(()=>require("./duo-fold-renderer-DdltAnF7.js")).then(({renderFold:x})=>{s||!n.current||(l=x(n.current,e,o),i(!0))}).catch(()=>{s||o()}),()=>{s=!0,l?.()}},[e.ready,e.from,o]),r.jsxs(r.Fragment,{children:[!a&&r.jsx("div",{className:"rc-duo-fold-hold","aria-hidden":"true",style:{width:e.from.frame.bodyWidth*e.from.frame.scale,height:e.from.frame.bodyHeight*e.from.frame.scale,transform:`translate(-50%, -50%) rotate(${e.from.frame.turns*90}deg)`},children:r.jsx(ae,{pose:e.from,image:e.before,scale:e.from.frame.scale})}),r.jsx("canvas",{ref:n,className:"rc-duo-fold-canvas","aria-hidden":"true",style:{visibility:a?"visible":"hidden"}})]})}const ue=u.lazy(()=>Promise.resolve().then(()=>require("./duo-frame-Cj-xHHW3.js")));function de(e){const o=X.useDeviceView();return r.jsxs("div",{className:"rc-duo-view",children:[e.showFrame!==!1&&o.mode==="3d"?r.jsx(u.Suspense,{fallback:r.jsx(Y,{...e}),children:r.jsx(ue,{...e,onReady:o.onReady})}):r.jsx(Y,{...e}),e.showFrame!==!1&&r.jsx(X.DeviceModeToggle,{view:o,label:"Device rendering"})]})}function Y(e){const o=e.showFrame!==!1,n=u.useRef(null),a=u.useRef(null),i=u.useRef(e);i.current=e;const[s,l]=u.useState({width:0,height:0}),[x,d]=u.useState(),[f,h]=u.useState(),[E,D]=u.useState(),[k,p]=u.useState(),v=u.useRef(void 0),b=u.useRef(null);b.current||(b.current=new R.DuoTouchController((...t)=>i.current.touch(...t)));const j=u.useRef(null),g=R.getDuoDisplay(e.state),S=g?.id==="inner"?e.inner:e.outer,y=R.duoDisplayTurns(g?.orientation),m=g?.id==="inner",C={portrait:0,pud:2,"landscape-left":3,"landscape-right":1}[e.state.orientation],H=o?(C+(m?1:0))%4:y,w=oe(m,H,s.width,s.height),W=o?w.screenWidth:(m?g?.height:g?.width)??1,I=o?w.screenHeight:(m?g?.width:g?.height)??1,P=o?w.bodyWidth:W,T=o?w.bodyHeight:I,M=o?w.scale:Math.max(0,Math.min(s.width/(w.turns%2?T:P),s.height/(w.turns%2?P:T))),U=W*M,L=I*M;u.useEffect(()=>{const t=new ResizeObserver(([c])=>{c&&l({width:c.contentRect.width,height:c.contentRect.height})});return n.current&&t.observe(n.current),()=>t.disconnect()},[]),u.useEffect(()=>{const t=a.current;if(!t||!S)return;const c=()=>{t.srcObject!==S.srcObject&&(t.srcObject=S.srcObject),t.play().catch(()=>{}),e.outer?.pause(),e.inner?.pause()};return c(),S.addEventListener("loadedmetadata",c),()=>{S.removeEventListener("loadedmetadata",c),t.pause(),t.srcObject=null;for(const z of[e.outer,e.inner])z?.play().catch(()=>{})}},[S,e.outer,e.inner]);const{motion:N,finish:_,prepare:ee}=ie(a,m,w,e.state.orientation,o),{angle:te,changeAngle:re,interacting:ne}=$(e.state.angleDegrees,async t=>{ee(t>=90);try{await e.setAngle(t)}catch(c){throw _(),c}},d),F=()=>{b.current?.release(),v.current=void 0};u.useEffect(()=>{j.current=new R.DuoButtonSender((c,z)=>i.current.button(c,z),c=>d(String(c)));const t=()=>{F(),j.current?.release(),p(void 0)};return window.addEventListener("blur",t),()=>{t(),window.removeEventListener("blur",t)}},[]),u.useEffect(()=>{b.current?.setDisplay(g,H),b.current?.active||(v.current=void 0)},[g,H]);const O=()=>{j.current?.release(),p(void 0)},q=t=>({disabled:e.watchOnly,onPointerDown:c=>{e.watchOnly||N||c.button!==0||(c.currentTarget.setPointerCapture(c.pointerId),j.current?.press(t),p(t))},onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,onBlur:O,onPointerEnter:()=>D(t),onPointerLeave:()=>D(void 0),onFocus:()=>h(w.guides.find(c=>c.button===t)?.edge),onKeyDown:c=>{N||(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),c.repeat||(j.current?.press(t),p(t)))},onKeyUp:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),O())}}),K=t=>{const c=t.currentTarget.getBoundingClientRect();return{x:(t.clientX-c.left)/c.width,y:(t.clientY-c.top)/c.height}};return r.jsxs("div",{className:o?"rc-duo":"rc-duo rc-duo-frameless",children:[r.jsxs("div",{ref:n,className:"rc-duo-flat-stage","data-folding":!!N,"aria-busy":!!N,onPointerMove:t=>{if(!o)return;const c=t.currentTarget.getBoundingClientRect();h(Q(t.clientX-c.left,t.clientY-c.top,w.rect))},onPointerLeave:()=>{h(void 0),D(void 0)},children:[r.jsxs("div",{className:"rc-duo-flat-device","data-display":m?"inner":"outer",style:{width:P*M,height:T*M,transform:"translate(-50%, -50%) rotate("+w.turns*90+"deg)"},children:[o&&r.jsx(Z,{inner:m,width:P,height:T}),r.jsx("div",{className:"rc-duo-flat-screen",role:"application","aria-label":"iPhone Duo 2D simulator",tabIndex:0,style:{width:U,height:L,left:(P-W)/2*M,top:(T-I)/2*M,borderRadius:o?m?5.3*M:[.8,6.6,6.6,.8].map(t=>t*M+"px").join(" "):0},onKeyDown:N?void 0:e.onKeyDown,onKeyUp:e.onKeyUp,onPointerDown:t=>{if(e.watchOnly||N||v.current!==void 0||t.button!==0||!g)return;t.currentTarget.focus({preventScroll:!0}),t.currentTarget.setPointerCapture(t.pointerId);const c=K(t);v.current=t.pointerId,b.current?.touch("begin",c.x,c.y)},onPointerMove:t=>{if(v.current!==t.pointerId)return;const c=K(t);b.current?.touch("move",c.x,c.y)},onPointerUp:t=>{v.current===t.pointerId&&F()},onPointerCancel:F,onLostPointerCapture:F,children:r.jsx("video",{ref:a,autoPlay:!0,muted:!0,playsInline:!0,style:{width:m?L:U,height:m?U:L,transform:"translate(-50%, -50%) rotate("+(m?90:0)+"deg)"}})}),o&&w.buttons.map(t=>r.jsx("button",{type:"button",className:"rc-duo-physical","data-duo-button":t.button,"data-edge":t.edge,"data-highlighted":E===t.button,"data-pressed":k===t.button,"aria-label":R.DUO_BUTTONS[t.button]+" physical button",title:R.DUO_BUTTONS[t.button],style:{left:t.x*M,top:t.y*M,width:t.edge==="top"?Math.max(28,t.width*M):28,height:t.edge==="top"?28:Math.max(28,t.height*M)},...q(t.button),children:r.jsx("span",{style:{width:Math.max(2,t.width*M),height:Math.max(2,t.height*M)}})},t.button))]}),o&&w.guides.map(t=>r.jsx("button",{type:"button",className:"rc-duo-hardware","data-duo-button":t.button,"data-visible":f===t.edge,"data-pressed":k===t.button,"aria-label":R.DUO_BUTTONS[t.button],title:R.DUO_BUTTONS[t.button],style:{left:t.targetX,top:t.targetY,"--duo-hardware-icon-size":`${w.iconSize}px`,"--duo-hardware-icon-x":`${t.x-t.targetX}px`,"--duo-hardware-icon-y":`${t.y-t.targetY}px`},...q(t.button),children:r.jsx(A,{button:t.button})},t.button)),N&&r.jsx(ce,{motion:N,onFinish:_})]}),o&&r.jsx(G,{watchOnly:e.watchOnly,angle:te,changeAngle:re,interacting:ne,rotate:()=>{e.setOrientation(e.state.orientation==="portrait"?"landscape-left":"portrait").catch(t=>d(String(t)))},children:r.jsx("span",{className:"rc-duo-view-label",children:"Front view"})}),x&&r.jsx("div",{role:"alert",className:"rc-duo-error",children:x})]})}const le=Object.freeze(Object.defineProperty({__proto__:null,default:de},Symbol.toStringTag,{value:"Module"}));exports.DuoControls=G;exports.DuoHardwareIcon=A;exports.duoView=le;exports.flatHoverEdge=Q;exports.hardwareIconSize=J;exports.useDuoHinge=$;