@vincentt-xr/sdk 2.0.0-alpha.16 → 2.0.0-alpha.18

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 (78) hide show
  1. package/GROUNDING.md +224 -1
  2. package/components.json +144 -0
  3. package/dist/{CanonicalHeadFrame-vn-jM9fG.js → CanonicalHeadFrame-CQe2YX9a.js} +3 -3
  4. package/dist/{DebuggerUI-DDpU-nBF.js → DebuggerUI-CKYrYmod.js} +1 -1
  5. package/dist/{FaceRetouch-D2xH5OpW.js → FaceRetouch-l7y4oZBu.js} +4 -4
  6. package/dist/Scenes-BX0bR1j4.js +44 -0
  7. package/dist/Scenes-Dtt8UGE8.cjs +1 -0
  8. package/dist/{TextLabel-DPJBtkUS.cjs → TextLabel-C-AibH5A.cjs} +1 -1
  9. package/dist/{TextLabel--skGFws8.js → TextLabel-fEF1o3wE.js} +1 -1
  10. package/dist/audio/AudioPlayer.d.ts +2 -1
  11. package/dist/{bodyMaskMaterial-C3aXItLo.js → bodyMaskMaterial-BOdSJUEM.js} +1 -1
  12. package/dist/{cache-C85JjyZA.js → cache-Mu-VO_6E.js} +2 -2
  13. package/dist/components/Button/index.d.ts +23 -0
  14. package/dist/components/Button/safeLink.d.ts +6 -0
  15. package/dist/components/HtmlRegion/index.d.ts +8 -0
  16. package/dist/components/Model/index.d.ts +16 -0
  17. package/dist/components/Object3D/index.d.ts +13 -0
  18. package/dist/components/ScreenImage/types.d.ts +2 -2
  19. package/dist/components/ScreenText/types.d.ts +2 -1
  20. package/dist/components/ThemeProvider/index.d.ts +24 -0
  21. package/dist/components/index.d.ts +4 -0
  22. package/dist/{contexts-B5GODwuV.js → contexts-Cl-4dUOI.js} +2 -2
  23. package/dist/debug-ui/media-source.js +1 -1
  24. package/dist/debug-ui.cjs +1 -1
  25. package/dist/debug-ui.js +11 -11
  26. package/dist/{drawNormalizedCrop-BLfB484W.js → drawNormalizedCrop-D606u5-F.js} +5 -5
  27. package/dist/editor-defs/definitions.d.ts +2 -0
  28. package/dist/editor-defs/index.d.ts +3 -0
  29. package/dist/editor-defs/types.d.ts +54 -0
  30. package/dist/editor-sample/sample.d.ts +15 -0
  31. package/dist/editor-scenes.cjs +1 -0
  32. package/dist/editor-scenes.js +59 -0
  33. package/dist/entries/core.d.ts +12 -0
  34. package/dist/entries/editor-scenes.d.ts +8 -0
  35. package/dist/face-effects.js +17 -17
  36. package/dist/{getFaceInfo-D_tCSQC7.js → getFaceInfo-Mt44zlej.js} +1 -1
  37. package/dist/{index-B9DdHE4u.js → index-B0EYdofX.js} +1 -1
  38. package/dist/{index-jkUdoklh.cjs → index-B5X4N2tc.cjs} +3 -3
  39. package/dist/{index-CTqQJj5p.js → index-BDxJWWyy.js} +85 -85
  40. package/dist/{index-nRQNXOVk.cjs → index-BkjRuUdW.cjs} +1 -1
  41. package/dist/{index-DlP4xxaT.js → index-Bn72laBn.js} +4 -4
  42. package/dist/{index-D10O6vqR.js → index-CbBCl2ZU.js} +2 -2
  43. package/dist/{index-CNt8esFO.js → index-CicO_Tnw.js} +1 -1
  44. package/dist/{index-YI3Yidg_.js → index-D5NbXaCn.js} +5 -5
  45. package/dist/{index-DJkmBF-0.js → index-DN_eHnag.js} +203 -197
  46. package/dist/instructions.cjs +1 -1
  47. package/dist/instructions.js +8 -8
  48. package/dist/{internal-TD4QhIry.js → internal-BoFDq5hC.js} +3 -3
  49. package/dist/internal.js +2 -2
  50. package/dist/{landmarks-vLy5QKt6.js → landmarks-C3LvDhMt.js} +1 -1
  51. package/dist/low-level.js +17 -17
  52. package/dist/main.cjs +1 -1
  53. package/dist/main.js +932 -746
  54. package/dist/particles.js +5 -5
  55. package/dist/product.js +2 -2
  56. package/dist/{providers-DmJlgrDD.js → providers-Bxt_MfPK.js} +3 -3
  57. package/dist/{renderGroups-BcQYy_J2.js → renderGroups-uYPzUa66.js} +1 -1
  58. package/dist/{renderPasses-DIPTIU_x.js → renderPasses-C0wu5Cwg.js} +4 -4
  59. package/dist/scene-object.cjs +1 -1
  60. package/dist/scene-object.js +2 -2
  61. package/dist/scenes/Scenes.d.ts +44 -0
  62. package/dist/scenes/edit.d.ts +37 -0
  63. package/dist/{segmentation-CZs5aVvY.js → segmentation-DccvYBBO.js} +9 -9
  64. package/dist/{selectors-K5JKCWxw.js → selectors-J06V0eDb.js} +1 -1
  65. package/dist/{session-DHBNTyJJ.js → session-CYiWfcvz.js} +1 -1
  66. package/dist/tracking.js +25 -25
  67. package/dist/{trigger-BwZ81ENx.js → trigger-CQviD4xp.js} +155 -155
  68. package/dist/{useBodies-BMKHXAOL.js → useBodies-DOuwRuew.js} +2 -2
  69. package/dist/{useEditOverrides-DpPTA6BW.js → useEditOverrides-BBkK8cN2.js} +1 -0
  70. package/dist/useEditOverrides-CgapHJzA.cjs +1 -0
  71. package/dist/{useFaceInfo-BNVdnprN.js → useFaceInfo-XUGYTdfN.js} +4 -4
  72. package/dist/{useFaceResultReader-B15wn6RB.js → useFaceResultReader-D8wXbF1L.js} +1 -1
  73. package/dist/{useIrisTracking-CYm-KDIZ.js → useIrisTracking-B0uLWgNE.js} +10 -10
  74. package/dist/{useXRCapabilities-ClWlG5_Y.js → useXRCapabilities-DPUOvpdf.js} +1 -1
  75. package/dist/utils/useEditOverrides.d.ts +1 -0
  76. package/package.json +11 -2
  77. package/settings.json +2 -1
  78. package/dist/useEditOverrides-C8Kzr6M7.cjs +0 -1
package/dist/main.js CHANGED
@@ -1,77 +1,80 @@
1
- var Ue = Object.defineProperty;
2
- var Ne = (e, t, s) => t in e ? Ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var P = (e, t, s) => Ne(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { j as v, u as Ie, Q as Le, R as Oe, T as Ge, U as qe, V as Be, W as We } from "./index-CTqQJj5p.js";
5
- import { az as Bs, Z as Ws, aA as zs, M as Ks, P as Xs, L as Hs, w as $s, Y as js, aB as Vs, av as Zs, aw as Ys, _ as Qs, c as Js, z as er, y as tr, d as sr, k as rr, af as ar, ag as nr, ah as ir, ai as or, n as cr, aj as lr, i as ur, $ as dr, O as mr, ak as pr, a0 as fr, a1 as hr, al as gr, am as Sr, at as yr, p as Tr, A as Mr, ax as Er, r as Rr, K as br, ay as Ar, a6 as Fr, an as Cr, a7 as vr, a8 as kr, a9 as _r, a5 as xr, aa as wr, ab as Pr, a2 as Dr, ac as Ur, ao as Nr, au as Ir, ad as Lr, ap as Or, t as Gr, a3 as qr, a4 as Br, aq as Wr, ar as zr, ae as Kr, as as Xr } from "./index-CTqQJj5p.js";
6
- import { S as ze } from "./contexts-B5GODwuV.js";
7
- import { X as $r } from "./contexts-B5GODwuV.js";
8
- import { S as Vr, T as Zr } from "./TextLabel--skGFws8.js";
9
- import { jsxs as L, jsx as g, Fragment as re } from "react/jsx-runtime";
10
- import { useRef as F, useMemo as Z, useEffect as _, useState as x, Suspense as Ke, useCallback as R, forwardRef as Xe, useImperativeHandle as He, useContext as $e, createContext as je, useId as Ve, useSyncExternalStore as Ze } from "react";
11
- import * as Ye from "three";
12
- import { MathUtils as Qe, Vector2 as Je, Vector3 as et, DoubleSide as te, RepeatWrapping as Se, LinearFilter as ye } from "three";
13
- import { D as Qr, H as Jr, G as ea, E as ta, J as sa, K as ra, P as aa, S as na, C as ia, I as oa, L as ca, M as la, F as ua, B as da } from "./index-YI3Yidg_.js";
14
- import { useThree as tt, useFrame as st } from "@react-three/fiber";
15
- import { R as rt } from "./uv-DJU_XfmN.js";
16
- import { c as Fe, b as at } from "./selectors-K5JKCWxw.js";
17
- import { u as nt, a as it, s as ot, F as ct } from "./drawNormalizedCrop-BLfB484W.js";
18
- import { d as pa, b as fa, r as ha } from "./drawNormalizedCrop-BLfB484W.js";
19
- import { S as lt, c as ut } from "./index-DJkmBF-0.js";
20
- import { L as Sa, d as ya, R as Ta, a as Ma, e as Ea, b as Ra, f as ba } from "./index-DJkmBF-0.js";
21
- import { useTexture as dt } from "@react-three/drei";
22
- import { a as mt } from "./context-DTxSQvp4.js";
23
- import { k as Fa, D as Ca, j as va, E as ka, M as _a, h as xa, S as wa, T as Pa, l as Da, g as Ua, n as Na, r as Ia } from "./renderPasses-DIPTIU_x.js";
24
- import { D as Oa, a as Ga, M as qa, n as Ba } from "./index-DlP4xxaT.js";
25
- import { M as za } from "./index-D10O6vqR.js";
26
- import { u as Xa } from "./useXRCapabilities-ClWlG5_Y.js";
27
- import { g as Ce } from "./cache-C85JjyZA.js";
28
- import { D as $a, X as ja, c as Va, u as Za } from "./cache-C85JjyZA.js";
29
- import { S as pt } from "./segmentation-CZs5aVvY.js";
30
- import { d as Qa, a as Ja, b as en, e as tn, f as sn, g as rn, h as an } from "./segmentation-CZs5aVvY.js";
31
- const V = (e, t, s, r) => Qe.damp(e, t, Math.max(0, s), Math.max(0, r)), ls = (e, t, s, r, a = new Je()) => a.set(
32
- V(e.x, t.x, s, r),
33
- V(e.y, t.y, s, r)
34
- ), us = (e, t, s, r, a = new et()) => a.set(
35
- V(e.x, t.x, s, r),
36
- V(e.y, t.y, s, r),
37
- V(e.z, t.z, s, r)
38
- ), ft = "rgba(20,40,110,0.88)", ht = 24, gt = 512;
39
- function ds({
40
- color: e = ft,
1
+ var ze = Object.defineProperty;
2
+ var We = (e, t, r) => t in e ? ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var P = (e, t, r) => We(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { j as x, J as Be, u as Xe, as as $e, at as He, au as Ke, av as je, aw as Ve, ax as Ze } from "./index-BDxJWWyy.js";
5
+ import { b8 as gs, az as ys, b9 as Ss, M as Ms, P as Ts, L as Es, w as bs, ay as Rs, ba as As, b5 as Fs, b6 as Cs, aA as vs, c as xs, z as ks, y as _s, d as ws, k as Ps, aR as Ds, aS as Us, aT as Ns, aU as Ls, n as Is, aV as Os, i as Gs, aB as qs, O as zs, aW as Ws, aC as Bs, aD as Xs, aX as $s, aY as Hs, b3 as Ks, p as js, A as Vs, b7 as Zs, r as Ys, K as Js, a3 as Qs, aI as ea, aZ as ta, aJ as ra, aK as sa, aL as aa, aH as na, aM as oa, aN as ia, aE as ca, aO as la, a_ as ua, b4 as da, aP as ma, a$ as fa, t as pa, aF as ha, aG as ga, b0 as ya, b1 as Sa, aQ as Ma, b2 as Ta } from "./index-BDxJWWyy.js";
6
+ import { S as Ye } from "./contexts-Cl-4dUOI.js";
7
+ import { X as ba } from "./contexts-Cl-4dUOI.js";
8
+ import { S as Aa, T as Fa } from "./TextLabel-fEF1o3wE.js";
9
+ import { jsxs as I, jsx as g, Fragment as ae } from "react/jsx-runtime";
10
+ import { useRef as b, useMemo as X, useEffect as v, useState as k, Suspense as Je, useCallback as R, forwardRef as Qe, useImperativeHandle as et, useContext as tt, createContext as rt, useId as st, useSyncExternalStore as at } from "react";
11
+ import * as ue from "three";
12
+ import { MathUtils as nt, Vector2 as ot, Vector3 as it, DoubleSide as te, RepeatWrapping as Te, LinearFilter as Ee } from "three";
13
+ import { D as va, H as xa, G as ka, E as _a, J as wa, K as Pa, P as Da, S as Ua, C as Na, I as La, L as Ia, M as Oa, F as Ga, B as qa } from "./index-D5NbXaCn.js";
14
+ import { useThree as ct, useFrame as we } from "@react-three/fiber";
15
+ import { R as lt } from "./uv-DJU_XfmN.js";
16
+ import { c as Pe, b as ut } from "./selectors-J06V0eDb.js";
17
+ import { u as dt, a as mt, s as ft, F as pt } from "./drawNormalizedCrop-D606u5-F.js";
18
+ import { d as Wa, b as Ba, r as Xa } from "./drawNormalizedCrop-D606u5-F.js";
19
+ import { S as ht, c as gt } from "./index-DN_eHnag.js";
20
+ import { L as Ha, d as Ka, R as ja, a as Va, e as Za, b as Ya, f as Ja } from "./index-DN_eHnag.js";
21
+ import { a as en, b as tn, u as rn } from "./Scenes-BX0bR1j4.js";
22
+ import { useTexture as yt } from "@react-three/drei";
23
+ import { a as St } from "./context-DTxSQvp4.js";
24
+ import { j as re, T as Mt } from "./renderPasses-C0wu5Cwg.js";
25
+ import { k as an, D as nn, E as on, M as cn, h as ln, S as un, l as dn, g as mn, n as fn, r as pn } from "./renderPasses-C0wu5Cwg.js";
26
+ import { D as be, M as Tt } from "./index-Bn72laBn.js";
27
+ import { c as gn, n as yn } from "./index-Bn72laBn.js";
28
+ import { M as Mn } from "./index-CbBCl2ZU.js";
29
+ import { u as En } from "./useXRCapabilities-DPUOvpdf.js";
30
+ import { g as De } from "./cache-Mu-VO_6E.js";
31
+ import { D as Rn, X as An, c as Fn, u as Cn } from "./cache-Mu-VO_6E.js";
32
+ import { a as Et } from "./segmentation-DccvYBBO.js";
33
+ import { d as xn, b as kn, e as _n, f as wn, g as Pn, h as Dn, i as Un } from "./segmentation-DccvYBBO.js";
34
+ const Z = (e, t, r, s) => nt.damp(e, t, Math.max(0, r), Math.max(0, s)), Dr = (e, t, r, s, a = new ot()) => a.set(
35
+ Z(e.x, t.x, r, s),
36
+ Z(e.y, t.y, r, s)
37
+ ), Ur = (e, t, r, s, a = new it()) => a.set(
38
+ Z(e.x, t.x, r, s),
39
+ Z(e.y, t.y, r, s),
40
+ Z(e.z, t.z, r, s)
41
+ ), bt = "rgba(20,40,110,0.88)", Rt = 24, At = 512;
42
+ function Nr({
43
+ color: e = bt,
41
44
  borderColor: t,
42
- borderWidth: s = 0,
43
- borderRadius: r = ht,
44
- resolution: a = gt,
45
+ borderWidth: r = 0,
46
+ borderRadius: s = Rt,
47
+ resolution: a = At,
45
48
  aspect: n = 1,
46
- opacity: i = 1,
49
+ opacity: o = 1,
47
50
  name: c,
48
- overlay: o = !0,
51
+ overlay: i = !0,
49
52
  position: l,
50
53
  rotation: h,
51
54
  scale: d,
52
55
  visible: m
53
56
  }) {
54
- const u = F(null), p = F(null), T = Z(() => St({
57
+ const u = b(null), f = b(null), S = X(() => Ft({
55
58
  width: Math.round(a * Math.max(n, 0.05)),
56
59
  height: Math.round(a),
57
60
  color: e,
58
61
  borderColor: t,
59
- borderWidth: s,
60
- borderRadius: r
61
- }), [e, t, s, r, a, n]);
62
- _(() => () => {
63
- T.dispose();
64
- }, [T]);
65
- const E = F(null), f = F(i);
66
- return f.current !== i && (f.current = i, E.current = null, p.current && (p.current.opacity = i)), _(() => {
67
- const S = u.current;
68
- if (S)
69
- return S.userData.setOpacity = (b) => {
70
- E.current = b, p.current && (p.current.opacity = b);
62
+ borderWidth: r,
63
+ borderRadius: s
64
+ }), [e, t, r, s, a, n]);
65
+ v(() => () => {
66
+ S.dispose();
67
+ }, [S]);
68
+ const T = b(null), p = b(o);
69
+ return p.current !== o && (p.current = o, T.current = null, f.current && (f.current.opacity = o)), v(() => {
70
+ const y = u.current;
71
+ if (y)
72
+ return y.userData.setOpacity = (A) => {
73
+ T.current = A, f.current && (f.current.opacity = A);
71
74
  }, () => {
72
- delete S.userData.setOpacity;
75
+ delete y.userData.setOpacity;
73
76
  };
74
- }, []), /* @__PURE__ */ L(
77
+ }, []), /* @__PURE__ */ I(
75
78
  "mesh",
76
79
  {
77
80
  ref: u,
@@ -85,54 +88,54 @@ function ds({
85
88
  /* @__PURE__ */ g(
86
89
  "meshBasicMaterial",
87
90
  {
88
- ref: p,
89
- map: T,
91
+ ref: f,
92
+ map: S,
90
93
  transparent: !0,
91
- opacity: i,
92
- depthTest: !o,
93
- depthWrite: !o
94
+ opacity: o,
95
+ depthTest: !i,
96
+ depthWrite: !i
94
97
  }
95
98
  )
96
99
  ]
97
100
  }
98
101
  );
99
102
  }
100
- function St(e) {
101
- const { width: t, height: s, color: r, borderColor: a, borderWidth: n, borderRadius: i } = e, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, s) : (() => {
103
+ function Ft(e) {
104
+ const { width: t, height: r, color: s, borderColor: a, borderWidth: n, borderRadius: o } = e, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, r) : (() => {
102
105
  const d = document.createElement("canvas");
103
- return d.width = t, d.height = s, d;
104
- })(), o = c.getContext("2d");
105
- o.clearRect(0, 0, t, s);
106
- const l = Math.min(i, Math.min(t, s) / 2);
107
- o.beginPath(), o.moveTo(l, 0), o.lineTo(t - l, 0), o.quadraticCurveTo(t, 0, t, l), o.lineTo(t, s - l), o.quadraticCurveTo(t, s, t - l, s), o.lineTo(l, s), o.quadraticCurveTo(0, s, 0, s - l), o.lineTo(0, l), o.quadraticCurveTo(0, 0, l, 0), o.closePath(), o.fillStyle = r, o.fill(), a && n > 0 && (o.lineWidth = n, o.strokeStyle = a, o.stroke());
108
- const h = new Ye.CanvasTexture(c);
106
+ return d.width = t, d.height = r, d;
107
+ })(), i = c.getContext("2d");
108
+ i.clearRect(0, 0, t, r);
109
+ const l = Math.min(o, Math.min(t, r) / 2);
110
+ i.beginPath(), i.moveTo(l, 0), i.lineTo(t - l, 0), i.quadraticCurveTo(t, 0, t, l), i.lineTo(t, r - l), i.quadraticCurveTo(t, r, t - l, r), i.lineTo(l, r), i.quadraticCurveTo(0, r, 0, r - l), i.lineTo(0, l), i.quadraticCurveTo(0, 0, l, 0), i.closePath(), i.fillStyle = s, i.fill(), a && n > 0 && (i.lineWidth = n, i.strokeStyle = a, i.stroke());
111
+ const h = new ue.CanvasTexture(c);
109
112
  return h.needsUpdate = !0, h;
110
113
  }
111
- const ms = ({
114
+ const Lr = ({
112
115
  segmentationMask: e,
113
116
  segmentation: t,
114
- invert: s = !1,
115
- customBackground: r,
116
- renderOrder: a = rt.BACKGROUND
117
+ invert: r = !1,
118
+ customBackground: s,
119
+ renderOrder: a = lt.BACKGROUND
117
120
  }) => {
118
- const { camera: n, size: i } = tt(), c = Fe(), o = at(v.BACKGROUND_SEGMENTATION), l = t ? o == null ? void 0 : o.backgroundSegmentationMask : void 0, h = F(!1);
119
- _(() => {
121
+ const { camera: n, size: o } = ct(), c = Pe(), i = ut(x.BACKGROUND_SEGMENTATION), l = t ? i == null ? void 0 : i.backgroundSegmentationMask : void 0, h = b(!1);
122
+ v(() => {
120
123
  if (!t) {
121
124
  h.current = !1;
122
125
  return;
123
126
  }
124
- o === null && !h.current && (console.warn(
127
+ i === null && !h.current && (console.warn(
125
128
  `[VideoBackground] segmentation="${t}" set but no matching <Segmentation> component is mounted; rendering unmasked.`
126
129
  ), h.current = !0);
127
- }, [t, o]);
128
- const d = t ? l : e, m = Z(() => {
130
+ }, [t, i]);
131
+ const d = t ? l : e, m = X(() => {
129
132
  if (!n.isPerspectiveCamera)
130
133
  return [10, 10];
131
- const u = n, E = (u.position.z || 5) - -1, f = u.fov * Math.PI / 180, S = 2 * Math.tan(f / 2) * E;
132
- return [S * (i.width / i.height), S];
133
- }, [n, i]);
134
- return c ? /* @__PURE__ */ g("group", { position: [0, 0, -1], children: s ? /* @__PURE__ */ L(re, { children: [
135
- /* @__PURE__ */ L("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
134
+ const u = n, T = (u.position.z || 5) - -1, p = u.fov * Math.PI / 180, y = 2 * Math.tan(p / 2) * T;
135
+ return [y * (o.width / o.height), y];
136
+ }, [n, o]);
137
+ return c ? /* @__PURE__ */ g("group", { position: [0, 0, -1], children: r ? /* @__PURE__ */ I(ae, { children: [
138
+ /* @__PURE__ */ I("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
136
139
  /* @__PURE__ */ g("planeGeometry", { args: m }),
137
140
  /* @__PURE__ */ g(
138
141
  "meshBasicMaterial",
@@ -145,13 +148,13 @@ const ms = ({
145
148
  }
146
149
  )
147
150
  ] }),
148
- r && d && /* @__PURE__ */ L("mesh", { position: [0, 0, 0], renderOrder: a, children: [
151
+ s && d && /* @__PURE__ */ I("mesh", { position: [0, 0, 0], renderOrder: a, children: [
149
152
  /* @__PURE__ */ g("planeGeometry", { args: m }),
150
153
  /* @__PURE__ */ g(
151
154
  "meshBasicMaterial",
152
155
  {
153
- map: typeof r == "string" ? void 0 : r,
154
- color: typeof r == "string" ? r : void 0,
156
+ map: typeof s == "string" ? void 0 : s,
157
+ color: typeof s == "string" ? s : void 0,
155
158
  alphaMap: d,
156
159
  transparent: !1,
157
160
  alphaTest: 0.5,
@@ -163,14 +166,14 @@ const ms = ({
163
166
  "inverted-mask"
164
167
  )
165
168
  ] })
166
- ] }) : /* @__PURE__ */ L(re, { children: [
167
- r && d && /* @__PURE__ */ L("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
169
+ ] }) : /* @__PURE__ */ I(ae, { children: [
170
+ s && d && /* @__PURE__ */ I("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
168
171
  /* @__PURE__ */ g("planeGeometry", { args: m }),
169
172
  /* @__PURE__ */ g(
170
173
  "meshBasicMaterial",
171
174
  {
172
- map: typeof r == "string" ? void 0 : r,
173
- color: typeof r == "string" ? r : void 0,
175
+ map: typeof s == "string" ? void 0 : s,
176
+ color: typeof s == "string" ? s : void 0,
174
177
  depthTest: !1,
175
178
  depthWrite: !1,
176
179
  toneMapped: !1,
@@ -178,7 +181,7 @@ const ms = ({
178
181
  }
179
182
  )
180
183
  ] }),
181
- /* @__PURE__ */ L("mesh", { position: [0, 0, 0], renderOrder: a, children: [
184
+ /* @__PURE__ */ I("mesh", { position: [0, 0, 0], renderOrder: a, children: [
182
185
  /* @__PURE__ */ g("planeGeometry", { args: m }),
183
186
  /* @__PURE__ */ g(
184
187
  "meshBasicMaterial",
@@ -196,57 +199,57 @@ const ms = ({
196
199
  )
197
200
  ] })
198
201
  ] }) }) : null;
199
- }, ve = ({
202
+ }, Ue = ({
200
203
  mask: e,
201
204
  status: t,
202
- error: s,
203
- invert: r = !1,
205
+ error: r,
206
+ invert: s = !1,
204
207
  fallback: a = "camera",
205
208
  onStatusChange: n,
206
- fit: i = "cover",
207
- anchors: c = ct,
208
- renderOrder: o = 100,
209
+ fit: o = "cover",
210
+ anchors: c = pt,
211
+ renderOrder: i = 100,
209
212
  visible: l = !0,
210
213
  maskFeather: h = 4,
211
214
  maskErode: d = 0.7,
212
215
  ...m
213
216
  }) => {
214
- const u = Fe();
215
- if (_(() => {
216
- n == null || n(t, s);
217
- }, [t, s, n]), !u) return null;
218
- const p = t === "ready" && e;
219
- return !p && !ot(t, a) ? null : /* @__PURE__ */ g(
220
- lt,
217
+ const u = Pe();
218
+ if (v(() => {
219
+ n == null || n(t, r);
220
+ }, [t, r, n]), !u) return null;
221
+ const f = t === "ready" && e;
222
+ return !f && !ft(t, a) ? null : /* @__PURE__ */ g(
223
+ ht,
221
224
  {
222
225
  ...m,
223
226
  source: { kind: "texture", texture: u },
224
- fit: i,
227
+ fit: o,
225
228
  anchors: c,
226
- renderOrder: o,
229
+ renderOrder: i,
227
230
  visible: l,
228
- maskTexture: p ? e : null,
231
+ maskTexture: f ? e : null,
229
232
  maskChannel: "green",
230
- maskInvert: r,
233
+ maskInvert: s,
231
234
  maskFeather: h,
232
235
  maskErode: d
233
236
  }
234
237
  );
235
- }, yt = ({ active: e = !0, ...t }) => {
236
- const { texture: s, status: r, error: a } = it(e);
237
- return /* @__PURE__ */ g(ve, { ...t, mask: s, status: r, error: a });
238
- }, Tt = ({ bodyId: e, subject: t, numBodies: s, active: r = !0, ...a }) => {
239
- const { texture: n, status: i, error: c } = nt({ bodyId: e, subject: t, numBodies: s, active: r });
240
- return /* @__PURE__ */ g(ve, { ...a, mask: n, status: i, error: c });
241
- }, ps = ({ bodyId: e, subject: t, numBodies: s, ...r }) => e !== void 0 || t ? /* @__PURE__ */ g(Tt, { ...r, bodyId: e, subject: t, numBodies: s }) : /* @__PURE__ */ g(yt, { ...r }), ie = 9, oe = 16, fs = ({ children: e }) => {
242
- const [t, s] = x({ width: 0, height: 0 });
243
- return _(() => {
244
- const r = () => {
245
- const a = document.documentElement.clientWidth, n = document.documentElement.clientHeight, i = a / n, c = ie / oe;
246
- let o, l;
247
- i > c ? (l = n, o = l * ie / oe) : (o = a, l = o * oe / ie), s({ width: o, height: l });
238
+ }, Ct = ({ active: e = !0, ...t }) => {
239
+ const { texture: r, status: s, error: a } = mt(e);
240
+ return /* @__PURE__ */ g(Ue, { ...t, mask: r, status: s, error: a });
241
+ }, vt = ({ bodyId: e, subject: t, numBodies: r, active: s = !0, ...a }) => {
242
+ const { texture: n, status: o, error: c } = dt({ bodyId: e, subject: t, numBodies: r, active: s });
243
+ return /* @__PURE__ */ g(Ue, { ...a, mask: n, status: o, error: c });
244
+ }, Ir = ({ bodyId: e, subject: t, numBodies: r, ...s }) => e !== void 0 || t ? /* @__PURE__ */ g(vt, { ...s, bodyId: e, subject: t, numBodies: r }) : /* @__PURE__ */ g(Ct, { ...s }), ie = 9, ce = 16, Or = ({ children: e }) => {
245
+ const [t, r] = k({ width: 0, height: 0 });
246
+ return v(() => {
247
+ const s = () => {
248
+ const a = document.documentElement.clientWidth, n = document.documentElement.clientHeight, o = a / n, c = ie / ce;
249
+ let i, l;
250
+ o > c ? (l = n, i = l * ie / ce) : (i = a, l = i * ce / ie), r({ width: i, height: l });
248
251
  };
249
- return r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
252
+ return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
250
253
  }, []), /* @__PURE__ */ g(
251
254
  "div",
252
255
  {
@@ -261,34 +264,209 @@ const ms = ({
261
264
  children: /* @__PURE__ */ g("div", { style: { width: t.width, height: t.height, position: "relative" }, children: e })
262
265
  }
263
266
  );
264
- }, hs = ({ size: e = 0.25, ...t }) => /* @__PURE__ */ g("axesHelper", { args: [e], ...t }), Mt = { left: -1, right: 1, top: 1, bottom: -1 }, Et = (e, t, s) => {
265
- const r = e % t, a = Math.floor(e / t);
266
- return { x: r / t, y: (s - 1 - a) / s };
267
- }, Rt = ({
267
+ }, Gr = ({ size: e = 0.25, ...t }) => /* @__PURE__ */ g("axesHelper", { args: [e], ...t }), xt = { left: -1, right: 1, top: 1, bottom: -1 }, kt = (e, t, r) => {
268
+ const s = e % t, a = Math.floor(e / t);
269
+ return { x: s / t, y: (r - 1 - a) / r };
270
+ }, _t = ({
268
271
  sheet: e,
269
272
  contentAspect: t,
270
- renderOrder: s,
271
- name: r
273
+ renderOrder: r,
274
+ name: s
272
275
  }) => {
273
- const a = dt(e.url), n = F(0), i = F(-1), c = mt(), [o, l] = t != null ? ut(c, t) : [1, 1];
274
- return st((h, d) => {
275
- a.wrapS = Se, a.wrapT = Se, a.magFilter = ye, a.minFilter = ye, a.generateMipmaps = !1, a.repeat.set(1 / e.cols, 1 / e.rows), n.current += d;
276
+ const a = yt(e.url), n = b(0), o = b(-1), c = St(), [i, l] = t != null ? gt(c, t) : [1, 1];
277
+ return we((h, d) => {
278
+ a.wrapS = Te, a.wrapT = Te, a.magFilter = Ee, a.minFilter = Ee, a.generateMipmaps = !1, a.repeat.set(1 / e.cols, 1 / e.rows), n.current += d;
276
279
  const m = Math.floor(n.current * e.fps) % e.frames;
277
- if (m === i.current) return;
278
- i.current = m;
279
- const { x: u, y: p } = Et(m, e.cols, e.rows);
280
- a.offset.set(u, p);
281
- }), /* @__PURE__ */ L("mesh", { name: r, renderOrder: s, scale: [o, l, 1], children: [
280
+ if (m === o.current) return;
281
+ o.current = m;
282
+ const { x: u, y: f } = kt(m, e.cols, e.rows);
283
+ a.offset.set(u, f);
284
+ }), /* @__PURE__ */ I("mesh", { name: s, renderOrder: r, scale: [i, l, 1], children: [
282
285
  /* @__PURE__ */ g("planeGeometry", { args: [1, 1] }),
283
286
  /* @__PURE__ */ g("meshBasicMaterial", { map: a, transparent: !0, toneMapped: !1, depthWrite: !1 })
284
287
  ] });
285
- }, gs = ({
288
+ }, qr = ({
286
289
  sheet: e,
287
- anchors: t = Mt,
288
- contentAspect: s,
289
- renderOrder: r = 10,
290
+ anchors: t = xt,
291
+ contentAspect: r,
292
+ renderOrder: s = 10,
290
293
  name: a = "spriteAnimation"
291
- }) => /* @__PURE__ */ g(Ke, { fallback: null, children: /* @__PURE__ */ g(ze, { anchors: t, children: /* @__PURE__ */ g(Rt, { sheet: e, contentAspect: s, renderOrder: r, name: a }) }) }), q = (e) => {
294
+ }) => /* @__PURE__ */ g(Je, { fallback: null, children: /* @__PURE__ */ g(Ye, { anchors: t, children: /* @__PURE__ */ g(_t, { sheet: e, contentAspect: r, renderOrder: s, name: a }) }) }), wt = 64, Pt = 3, Dt = /^[A-Za-z][A-Za-z0-9]{0,39}$/, Ut = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, Nt = /^(?:rgb|rgba|hsl|hsla)\([0-9a-z.,%\s/+-]{1,60}\)$/i, Lt = /^-?[0-9]{1,4}(?:\.[0-9]{1,4})?(?:px|em|rem|%)?$/, It = /^[A-Za-z0-9 ,'"_-]{1,120}$/;
295
+ function Ot(e) {
296
+ return Ut.test(e) || Nt.test(e) || Lt.test(e) || It.test(e);
297
+ }
298
+ const Re = (e) => e.map((t) => t.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`)).join("-");
299
+ function Gt(e) {
300
+ const t = {};
301
+ let r = 0;
302
+ const s = (a, n) => {
303
+ for (const o of Object.keys(a)) {
304
+ if (r >= wt) return;
305
+ if (!Dt.test(o)) continue;
306
+ const c = a[o], i = [...n, o];
307
+ typeof c == "number" ? Number.isFinite(c) && (t[`--vincentt-${Re(i)}`] = String(c), r++) : typeof c == "string" ? Ot(c) && (t[`--vincentt-${Re(i)}`] = c, r++) : c && typeof c == "object" && !Array.isArray(c) && i.length < Pt && s(c, i);
308
+ }
309
+ };
310
+ return e && typeof e == "object" && s(e, []), t;
311
+ }
312
+ function zr({ theme: e, className: t, children: r }) {
313
+ const s = { display: "contents", ...Gt(e) };
314
+ return /* @__PURE__ */ g("div", { className: t, style: s, children: r });
315
+ }
316
+ const le = (e, t) => ({
317
+ x: (t == null ? void 0 : t.x) ?? e.x,
318
+ y: (t == null ? void 0 : t.y) ?? e.y,
319
+ z: (t == null ? void 0 : t.z) ?? e.z
320
+ });
321
+ function Wr({
322
+ src: e,
323
+ position: t,
324
+ rotation: r,
325
+ scale: s,
326
+ visible: a = !0,
327
+ material: n,
328
+ // `name` and `locked` are editor metadata; neither changes rendering.
329
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
330
+ name: o,
331
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
332
+ locked: c
333
+ }) {
334
+ const [i, l, h] = [t == null ? void 0 : t.x, t == null ? void 0 : t.y, t == null ? void 0 : t.z], [d, m, u] = [r == null ? void 0 : r.x, r == null ? void 0 : r.y, r == null ? void 0 : r.z], [f, S, T] = [s == null ? void 0 : s.x, s == null ? void 0 : s.y, s == null ? void 0 : s.z], p = X(
335
+ () => ({
336
+ ...re,
337
+ position: le(re.position, { x: i, y: l, z: h }),
338
+ rotation: le(re.rotation, { x: d, y: m, z: u }),
339
+ scale: le(re.scale, { x: f, y: S, z: T }),
340
+ visible: a
341
+ }),
342
+ [i, l, h, d, m, u, f, S, T, a]
343
+ ), y = X(
344
+ () => ({
345
+ ...be,
346
+ assetUrl: e,
347
+ material: { ...be.material, ...n }
348
+ }),
349
+ [e, n]
350
+ );
351
+ return /* @__PURE__ */ g(Mt, { value: p, children: /* @__PURE__ */ g(Tt, { value: y }) });
352
+ }
353
+ const qt = (e) => Array.isArray(e) ? e : [e], zt = (e) => {
354
+ const [t, r] = k(null);
355
+ return v(() => {
356
+ if (!e) return;
357
+ let s = !0, a = null;
358
+ return new ue.TextureLoader().load(
359
+ e,
360
+ (n) => {
361
+ if (a = n, !s) {
362
+ n.dispose();
363
+ return;
364
+ }
365
+ n.colorSpace = ue.SRGBColorSpace, n.flipY = !1, r({ url: e, texture: n });
366
+ },
367
+ void 0,
368
+ () => console.warn(`${Be.loggerPrefix} Object3D could not load ${e}`)
369
+ ), () => {
370
+ s = !1, a == null || a.dispose();
371
+ };
372
+ }, [e]), e && (t == null ? void 0 : t.url) === e ? t.texture : null;
373
+ };
374
+ function Br({
375
+ colour: e,
376
+ texture: t,
377
+ size: r = 1,
378
+ visible: s = !0,
379
+ children: a,
380
+ // `name` and `locked` are editor metadata; neither changes rendering.
381
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
382
+ name: n,
383
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
384
+ locked: o
385
+ }) {
386
+ const c = b(null), i = b(/* @__PURE__ */ new Map()), l = zt(t), h = e !== void 0 || l !== null, d = () => {
387
+ for (const [m, { original: u, own: f }] of i.current)
388
+ m.material = u, f.forEach((S) => S.dispose());
389
+ i.current.clear();
390
+ };
391
+ return we(() => {
392
+ !h || !c.current || c.current.traverse((m) => {
393
+ const u = m;
394
+ if (!u.isMesh || i.current.has(u)) return;
395
+ const f = u.material, S = qt(f).map((T) => {
396
+ var y;
397
+ const p = T.clone();
398
+ return e !== void 0 && ((y = p.color) == null || y.set(e)), l && (p.map = l, p.needsUpdate = !0), p;
399
+ });
400
+ u.material = Array.isArray(f) ? S : S[0], i.current.set(u, { original: f, own: S });
401
+ });
402
+ }), v(() => (d(), d), [e, l]), /* @__PURE__ */ g("group", { ref: c, visible: s, scale: r, children: a });
403
+ }
404
+ function Xr({
405
+ className: e,
406
+ children: t,
407
+ // `name` and `locked` are editor metadata; neither changes rendering.
408
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
409
+ name: r,
410
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
411
+ locked: s
412
+ }) {
413
+ return /* @__PURE__ */ g("div", { className: e, children: t });
414
+ }
415
+ const Wt = 2048;
416
+ function Bt(e) {
417
+ return e <= 32 || e >= 127 && e <= 160 || e === 173 || e === 92 || e === 1564 || e === 6158 || e >= 8192 && e <= 8207 || e >= 8232 && e <= 8238 || e >= 8288 && e <= 8303 || e === 12288 || e === 65279 || e >= 917504 && e <= 917631;
418
+ }
419
+ function Xt(e) {
420
+ if (typeof e != "string" || e.length === 0 || e.length > Wt) return;
421
+ for (const s of e)
422
+ if (Bt(s.codePointAt(0) ?? 0)) return;
423
+ const t = e.toLowerCase();
424
+ return t.startsWith("https://") || t.startsWith("http://") || t.startsWith("mailto:") || t.startsWith("#") || t.startsWith("/") && !t.startsWith("//") ? e : void 0;
425
+ }
426
+ const Ae = {
427
+ display: "inline-block",
428
+ padding: "0.6em 1.2em",
429
+ border: "none",
430
+ borderRadius: "var(--vincentt-radius, 0.5em)",
431
+ background: "var(--vincentt-button, #111827)",
432
+ color: "var(--vincentt-button-text, #ffffff)",
433
+ font: "inherit",
434
+ textDecoration: "none",
435
+ cursor: "pointer"
436
+ };
437
+ function $r({
438
+ label: e,
439
+ link: t,
440
+ onTap: r,
441
+ color: s,
442
+ visible: a = !0,
443
+ className: n,
444
+ children: o,
445
+ // `name` and `locked` are editor metadata; neither changes rendering.
446
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
447
+ name: c,
448
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
449
+ locked: i
450
+ }) {
451
+ if (!a) return null;
452
+ const l = s ? { ...Ae, background: s } : Ae, h = Xt(t), d = o ?? e;
453
+ if (h) {
454
+ const m = /^https?:/i.test(h);
455
+ return /* @__PURE__ */ g(
456
+ "a",
457
+ {
458
+ href: h,
459
+ className: n,
460
+ style: l,
461
+ onClick: r,
462
+ ...m ? { target: "_blank", rel: "noopener noreferrer" } : {},
463
+ children: d
464
+ }
465
+ );
466
+ }
467
+ return /* @__PURE__ */ g("button", { type: "button", className: n, style: l, onClick: r, children: d });
468
+ }
469
+ const q = (e) => {
292
470
  switch (e) {
293
471
  case "start":
294
472
  return "starting";
@@ -306,180 +484,180 @@ const ms = ({
306
484
  case "clear":
307
485
  return "idle";
308
486
  }
309
- }, bt = [
487
+ }, $t = [
310
488
  "video/mp4",
311
489
  "video/webm;codecs=vp9",
312
490
  "video/webm;codecs=vp8",
313
491
  "video/webm"
314
492
  ];
315
- function Ss(e = {}) {
493
+ function Hr(e = {}) {
316
494
  const {
317
495
  audio: t = !1,
318
- mimeType: s,
319
- bitsPerSecond: r,
496
+ mimeType: r,
497
+ bitsPerSecond: s,
320
498
  onData: a,
321
499
  onStop: n,
322
- onRecordingStart: i,
500
+ onRecordingStart: o,
323
501
  onRecordingPause: c,
324
- onRecordingResume: o,
502
+ onRecordingResume: i,
325
503
  onRecordingStop: l,
326
504
  onRecordingComplete: h,
327
505
  onError: d,
328
506
  passThroughStream: m
329
- } = e, u = F(null), p = F(null), T = F([]), [E, f] = x("idle"), [S, b] = x(null), [K, A] = x(null), w = R(() => {
507
+ } = e, u = b(null), f = b(null), S = b([]), [T, p] = k("idle"), [y, A] = k(null), [$, F] = k(null), w = R(() => {
330
508
  var C;
331
- const y = [s, ...bt].filter(Boolean);
332
- for (const M of y)
333
- if ((C = MediaRecorder.isTypeSupported) != null && C.call(MediaRecorder, M)) return M;
334
- }, [s]), G = R(
335
- async (y) => {
509
+ const M = [r, ...$t].filter(Boolean);
510
+ for (const E of M)
511
+ if ((C = MediaRecorder.isTypeSupported) != null && C.call(MediaRecorder, E)) return E;
512
+ }, [r]), G = R(
513
+ async (M) => {
336
514
  const C = new MediaStream();
337
- if (y.getTracks().forEach((M) => C.addTrack(M)), t) {
338
- let M;
515
+ if (M.getTracks().forEach((E) => C.addTrack(E)), t) {
516
+ let E;
339
517
  if (t instanceof MediaStream)
340
- M = t;
518
+ E = t;
341
519
  else {
342
- const k = typeof t == "object" ? { audio: t } : { audio: !0, video: !1 };
343
- M = await navigator.mediaDevices.getUserMedia(k);
520
+ const _ = typeof t == "object" ? { audio: t } : { audio: !0, video: !1 };
521
+ E = await navigator.mediaDevices.getUserMedia(_);
344
522
  }
345
- M.getAudioTracks().forEach((k) => C.addTrack(k));
523
+ E.getAudioTracks().forEach((_) => C.addTrack(_));
346
524
  }
347
525
  if (!C.getTracks().length)
348
526
  throw new Error("No tracks available in combined stream.");
349
- return p.current = C, C;
527
+ return f.current = C, C;
350
528
  },
351
529
  [t]
352
530
  ), Y = R(
353
- async (y, C) => {
354
- f(q("start")), A(null), b(null);
531
+ async (M, C) => {
532
+ p(q("start")), F(null), A(null);
355
533
  try {
356
- let M;
534
+ let E;
357
535
  if (m)
358
- M = m, p.current = M;
536
+ E = m, f.current = E;
359
537
  else {
360
- if (!y) throw new Error("start(stream) requires a MediaStream.");
361
- M = await G(y);
538
+ if (!M) throw new Error("start(stream) requires a MediaStream.");
539
+ E = await G(M);
362
540
  }
363
- const k = w(), X = {};
364
- k && (X.mimeType = k), r && (X.bitsPerSecond = r);
365
- const z = new MediaRecorder(M, X);
366
- z.ondataavailable = (N) => {
367
- var $;
368
- (($ = N.data) == null ? void 0 : $.size) > 0 && (T.current.push(N.data), a == null || a(N.data));
369
- }, z.onstop = () => {
370
- const N = new Blob(T.current, {
371
- type: k ?? "video/webm"
541
+ const _ = w(), H = {};
542
+ _ && (H.mimeType = _), s && (H.bitsPerSecond = s);
543
+ const B = new MediaRecorder(E, H);
544
+ B.ondataavailable = (N) => {
545
+ var j;
546
+ ((j = N.data) == null ? void 0 : j.size) > 0 && (S.current.push(N.data), a == null || a(N.data));
547
+ }, B.onstop = () => {
548
+ const N = new Blob(S.current, {
549
+ type: _ ?? "video/webm"
372
550
  });
373
- b(N), n == null || n(N), h == null || h(N), T.current = [], f(q("complete"));
374
- }, u.current = z, z.start(C), f(q("started")), i == null || i();
375
- } catch (M) {
376
- const k = M instanceof Error ? M : new Error(String(M));
377
- console.error("start(stream) failed", k), A(k), f(q("fail")), d == null || d(k);
551
+ A(N), n == null || n(N), h == null || h(N), S.current = [], p(q("complete"));
552
+ }, u.current = B, B.start(C), p(q("started")), o == null || o();
553
+ } catch (E) {
554
+ const _ = E instanceof Error ? E : new Error(String(E));
555
+ console.error("start(stream) failed", _), F(_), p(q("fail")), d == null || d(_);
378
556
  }
379
557
  },
380
558
  [
381
559
  G,
382
560
  w,
383
- r,
561
+ s,
384
562
  a,
385
563
  n,
386
564
  h,
387
- i,
565
+ o,
388
566
  d,
389
567
  m
390
568
  ]
391
- ), Q = R(() => {
392
- const y = u.current;
393
- !y || y.state === "inactive" || (f(q("stop")), y.stop(), l == null || l());
394
- }, [l]), J = R(() => {
395
- const y = u.current;
396
- (y == null ? void 0 : y.state) === "recording" && (y.pause(), f(q("pause")), c == null || c());
569
+ ), J = R(() => {
570
+ const M = u.current;
571
+ !M || M.state === "inactive" || (p(q("stop")), M.stop(), l == null || l());
572
+ }, [l]), Q = R(() => {
573
+ const M = u.current;
574
+ (M == null ? void 0 : M.state) === "recording" && (M.pause(), p(q("pause")), c == null || c());
397
575
  }, [c]), ee = R(() => {
398
- const y = u.current;
399
- (y == null ? void 0 : y.state) === "paused" && (y.resume(), f(q("resume")), o == null || o());
400
- }, [o]), H = R(() => {
401
- var y;
576
+ const M = u.current;
577
+ (M == null ? void 0 : M.state) === "paused" && (M.resume(), p(q("resume")), i == null || i());
578
+ }, [i]), K = R(() => {
579
+ var M;
402
580
  try {
403
- u.current && (u.current.onstop = null, u.current.state !== "inactive" && u.current.stop()), u.current = null, (y = p.current) == null || y.getTracks().forEach((C) => C.stop()), p.current = null, b(null), f(q("clear")), T.current = [], A(null);
581
+ u.current && (u.current.onstop = null, u.current.state !== "inactive" && u.current.stop()), u.current = null, (M = f.current) == null || M.getTracks().forEach((C) => C.stop()), f.current = null, A(null), p(q("clear")), S.current = [], F(null);
404
582
  } catch (C) {
405
583
  console.error("clear failed", C);
406
584
  }
407
585
  }, []);
408
- return _(() => () => H(), []), {
409
- status: E,
586
+ return v(() => () => K(), []), {
587
+ status: T,
410
588
  start: Y,
411
- stop: Q,
412
- pause: J,
589
+ stop: J,
590
+ pause: Q,
413
591
  resume: ee,
414
- clear: H,
415
- isRecording: E === "recording" || E === "paused",
416
- isPaused: E === "paused",
417
- recordedBlob: S,
418
- error: K,
419
- getActiveStream: () => p.current
592
+ clear: K,
593
+ isRecording: T === "recording" || T === "paused",
594
+ isPaused: T === "paused",
595
+ recordedBlob: y,
596
+ error: $,
597
+ getActiveStream: () => f.current
420
598
  };
421
599
  }
422
- const At = async (e, t = {}) => {
423
- var s, r, a;
424
- (s = t.onCaptureStart) == null || s.call(t), await Promise.resolve();
600
+ const Ht = async (e, t = {}) => {
601
+ var r, s, a;
602
+ (r = t.onCaptureStart) == null || r.call(t), await Promise.resolve();
425
603
  try {
426
604
  const n = e();
427
- return (r = t.onCaptureComplete) == null || r.call(t, n), n;
605
+ return (s = t.onCaptureComplete) == null || s.call(t, n), n;
428
606
  } catch (n) {
429
- const i = n instanceof Error ? n : new Error(String(n));
430
- throw (a = t.onError) == null || a.call(t, i), i;
607
+ const o = n instanceof Error ? n : new Error(String(n));
608
+ throw (a = t.onError) == null || a.call(t, o), o;
431
609
  }
432
- }, ys = (e = {}) => {
433
- const { session: t } = Ie(), {
434
- captureFrame: s = t.captureFrame,
435
- onCaptureStart: r,
610
+ }, Kr = (e = {}) => {
611
+ const { session: t } = Xe(), {
612
+ captureFrame: r = t.captureFrame,
613
+ onCaptureStart: s,
436
614
  onCaptureComplete: a,
437
615
  onError: n
438
- } = e, [i, c] = x("idle"), [o, l] = x(null), [h, d] = x(null), m = R(async () => {
616
+ } = e, [o, c] = k("idle"), [i, l] = k(null), [h, d] = k(null), m = R(async () => {
439
617
  c("capturing"), l(null), d(null);
440
618
  try {
441
- const p = await At(s, {
442
- onCaptureStart: r,
619
+ const f = await Ht(r, {
620
+ onCaptureStart: s,
443
621
  onCaptureComplete: a,
444
622
  onError: n
445
623
  });
446
- return l(p), c("completed"), p;
447
- } catch (p) {
448
- const T = p instanceof Error ? p : new Error(String(p));
449
- return d(T), c("error"), null;
624
+ return l(f), c("completed"), f;
625
+ } catch (f) {
626
+ const S = f instanceof Error ? f : new Error(String(f));
627
+ return d(S), c("error"), null;
450
628
  }
451
- }, [s, r, a, n]), u = R(() => {
629
+ }, [r, s, a, n]), u = R(() => {
452
630
  c("idle"), l(null), d(null);
453
631
  }, []);
454
- return { status: i, capturePhoto: m, clear: u, dataUrl: o, error: h };
455
- }, Ts = (e, t) => {
456
- const s = e.split(","), r = s[0].match(/:(.*?);/), a = r ? r[1] : "application/octet-stream", n = atob(s[s.length - 1]);
457
- let i = n.length;
458
- const c = new Uint8Array(i);
459
- for (; i--; )
460
- c[i] = n.charCodeAt(i);
632
+ return { status: o, capturePhoto: m, clear: u, dataUrl: i, error: h };
633
+ }, jr = (e, t) => {
634
+ const r = e.split(","), s = r[0].match(/:(.*?);/), a = s ? s[1] : "application/octet-stream", n = atob(r[r.length - 1]);
635
+ let o = n.length;
636
+ const c = new Uint8Array(o);
637
+ for (; o--; )
638
+ c[o] = n.charCodeAt(o);
461
639
  return new File([c], t, { type: a });
462
- }, Ft = 4, Ct = 50, vt = 5e3, se = (e) => Math.min(1, Math.max(0, e)), Te = (e) => new Promise((t) => {
640
+ }, Kt = 4, jt = 50, Vt = 5e3, se = (e) => Math.min(1, Math.max(0, e)), Fe = (e) => new Promise((t) => {
463
641
  if (e.readyState >= 4) {
464
642
  t();
465
643
  return;
466
644
  }
467
- let s = !1;
468
- const r = () => {
469
- s || (s = !0, t());
645
+ let r = !1;
646
+ const s = () => {
647
+ r || (r = !0, t());
470
648
  };
471
- e.addEventListener("canplaythrough", r, { once: !0 }), e.addEventListener("error", r, { once: !0 }), setTimeout(r, vt);
472
- }), Me = (e, t) => {
473
- const s = document.createElement("audio");
474
- return s.src = e, s.loop = t, s.preload = "auto", s.setAttribute("playsinline", ""), s.setAttribute("webkit-playsinline", ""), s.load(), s;
475
- }, kt = (e) => {
649
+ e.addEventListener("canplaythrough", s, { once: !0 }), e.addEventListener("error", s, { once: !0 }), setTimeout(s, Vt);
650
+ }), Ce = (e, t) => {
651
+ const r = document.createElement("audio");
652
+ return r.src = e, r.loop = t, r.preload = "auto", r.setAttribute("playsinline", ""), r.setAttribute("webkit-playsinline", ""), r.load(), r;
653
+ }, Zt = (e) => {
476
654
  e.muted = !0, e.play().then(() => {
477
655
  e.pause(), e.currentTime = 0, e.muted = !1;
478
656
  }).catch(() => {
479
657
  e.muted = !1;
480
658
  });
481
659
  };
482
- class _t {
660
+ class Yt {
483
661
  constructor(t = {}) {
484
662
  P(this, "sfxPoolSize");
485
663
  P(this, "coalesceMs");
@@ -494,19 +672,19 @@ class _t {
494
672
  P(this, "lastPlayed", /* @__PURE__ */ new Map());
495
673
  /** Readiness promises so a loading gate can await decode/buffer. */
496
674
  P(this, "ready", /* @__PURE__ */ new Map());
497
- this.sfxPoolSize = t.sfxPoolSize ?? Ft, this.coalesceMs = t.coalesceMs ?? Ct;
675
+ this.sfxPoolSize = t.sfxPoolSize ?? Kt, this.coalesceMs = t.coalesceMs ?? jt;
498
676
  }
499
677
  /**
500
678
  * Create + buffer the looping music element. Await in the loading gate so the
501
679
  * unmute tap is instant. Idempotent per URL (re-requesting the same track is
502
680
  * a no-op that returns the in-flight promise).
503
681
  */
504
- prefetchMusic(t, s = 0.4) {
505
- const r = se(s);
506
- if (this.musicWanted = { url: t, volume: r }, this.musicUrl === t && this.musicReady)
507
- return this.music && (this.music.volume = r), this.musicReady;
508
- this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = Me(t, !0), this.musicUrl = t, this.music.volume = r;
509
- const a = Te(this.music);
682
+ prefetchMusic(t, r = 0.4) {
683
+ const s = se(r);
684
+ if (this.musicWanted = { url: t, volume: s }, this.musicUrl === t && this.musicReady)
685
+ return this.music && (this.music.volume = s), this.musicReady;
686
+ this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = Ce(t, !0), this.musicUrl = t, this.music.volume = s;
687
+ const a = Fe(this.music);
510
688
  return this.musicReady = a, a;
511
689
  }
512
690
  /**
@@ -514,19 +692,19 @@ class _t {
514
692
  * cut each other off). Returns a promise that resolves when the first element
515
693
  * buffers. Idempotent per URL.
516
694
  */
517
- registerSound(t, s = 1) {
518
- const r = this.ready.get(t);
519
- if (r) return r;
520
- const a = se(s), n = [];
695
+ registerSound(t, r = 1) {
696
+ const s = this.ready.get(t);
697
+ if (s) return s;
698
+ const a = se(r), n = [];
521
699
  for (let c = 0; c < this.sfxPoolSize; c += 1) {
522
- const o = Me(t, !1);
523
- o.volume = a, o.addEventListener("ended", () => {
524
- o.currentTime = 0;
525
- }), n.push(o);
700
+ const i = Ce(t, !1);
701
+ i.volume = a, i.addEventListener("ended", () => {
702
+ i.currentTime = 0;
703
+ }), n.push(i);
526
704
  }
527
705
  this.pools.set(t, { els: n, next: 0, volume: a });
528
- const i = Te(n[0]);
529
- return this.ready.set(t, i), i;
706
+ const o = Fe(n[0]);
707
+ return this.ready.set(t, o), o;
530
708
  }
531
709
  /** Subscribe to mute-state changes (for a toggle UI). Fires immediately with
532
710
  * the current state. Returns an unsubscribe. */
@@ -543,7 +721,7 @@ class _t {
543
721
  * then start the music. All elements are already buffered, so this is instant.
544
722
  */
545
723
  setMuted(t) {
546
- t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((s) => s.els.forEach(kt)), this.applyMusic(), this.listeners.forEach((s) => s(this.muted)));
724
+ t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((r) => r.els.forEach(Zt)), this.applyMusic(), this.listeners.forEach((r) => r(this.muted)));
547
725
  }
548
726
  toggleMuted() {
549
727
  this.setMuted(!this.muted);
@@ -554,30 +732,30 @@ class _t {
554
732
  * same sound into one play, and does NO synchronous `currentTime` seek on a
555
733
  * ready element (the pool rewinds on `ended`, off the hot path).
556
734
  */
557
- playOneShot(t, s) {
735
+ playOneShot(t, r) {
558
736
  if (this.muted) return;
559
- const r = this.pools.get(t);
560
- if (!r) return;
737
+ const s = this.pools.get(t);
738
+ if (!s) return;
561
739
  const a = performance.now();
562
740
  if (a - (this.lastPlayed.get(t) ?? -1 / 0) < this.coalesceMs) return;
563
741
  this.lastPlayed.set(t, a);
564
- const n = r.els.length;
565
- let i;
742
+ const n = s.els.length;
743
+ let o;
566
744
  for (let c = 0; c < n; c += 1) {
567
- const o = r.els[(r.next + c) % n];
568
- if (o.paused) {
569
- i = o, r.next = (r.next + c + 1) % n;
745
+ const i = s.els[(s.next + c) % n];
746
+ if (i.paused) {
747
+ o = i, s.next = (s.next + c + 1) % n;
570
748
  break;
571
749
  }
572
750
  }
573
- i || (i = r.els[r.next], r.next = (r.next + 1) % n), i.muted = !1, i.volume = se(s ?? r.volume), i.currentTime !== 0 && (i.currentTime = 0), i.play().catch(() => {
751
+ o || (o = s.els[s.next], s.next = (s.next + 1) % n), o.muted = !1, o.volume = se(r ?? s.volume), o.currentTime !== 0 && (o.currentTime = 0), o.play().catch(() => {
574
752
  });
575
753
  }
576
754
  /** Request the looping background track (buffer it with prefetchMusic, which
577
755
  * a loading gate awaits). Remembered while muted; starts on unmute. */
578
- startMusic(t, s = 0.4) {
579
- const r = se(s);
580
- this.musicUrl !== t && this.prefetchMusic(t, r), this.musicWanted = { url: t, volume: r }, this.applyMusic();
756
+ startMusic(t, r = 0.4) {
757
+ const s = se(r);
758
+ this.musicUrl !== t && this.prefetchMusic(t, s), this.musicWanted = { url: t, volume: s }, this.applyMusic();
581
759
  }
582
760
  stopMusic() {
583
761
  this.musicWanted = null, this.music && (this.music.pause(), this.music.currentTime = 0);
@@ -587,70 +765,70 @@ class _t {
587
765
  }), this.muted && !this.music.paused && this.music.pause());
588
766
  }
589
767
  }
590
- const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math.floor(s)) ? "replay" : "ended", wt = (e, t, s) => e && t !== s, Pt = (e) => Math.min(100, Math.max(0, e)) / 100, Ms = Xe(function({
768
+ const Jt = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math.floor(r)) ? "replay" : "ended", Qt = (e, t, r) => e && t !== r, er = (e) => Math.min(100, Math.max(0, e)) / 100, Vr = Qe(function({
591
769
  src: t,
592
- playMode: s = "once",
593
- loopCount: r = 1,
770
+ playMode: r = "once",
771
+ loopCount: s = 1,
594
772
  autoplay: a = !1,
595
773
  muted: n = !1,
596
- volume: i = 100,
774
+ volume: o = 100,
597
775
  preload: c = "auto",
598
- onReady: o,
776
+ onReady: i,
599
777
  onPlay: l,
600
778
  onPause: h,
601
779
  onEnded: d,
602
780
  onError: m
603
781
  }, u) {
604
- const p = F(null), T = F(0), E = F(null), f = R(async () => {
605
- const A = p.current;
606
- if (A)
782
+ const f = b(null), S = b(0), T = b(null), p = R(async () => {
783
+ const F = f.current;
784
+ if (F)
607
785
  try {
608
- await A.play();
786
+ await F.play();
609
787
  } catch (w) {
610
788
  const G = w instanceof Error ? w : new Error(String(w));
611
789
  throw m == null || m(G), G;
612
790
  }
613
- }, [m]), S = R(() => {
614
- var A;
615
- return (A = p.current) == null ? void 0 : A.pause();
616
- }, []), b = R(() => {
617
- const A = p.current;
618
- A && (A.pause(), A.currentTime = 0, T.current = 0);
791
+ }, [m]), y = R(() => {
792
+ var F;
793
+ return (F = f.current) == null ? void 0 : F.pause();
794
+ }, []), A = R(() => {
795
+ const F = f.current;
796
+ F && (F.pause(), F.currentTime = 0, S.current = 0);
619
797
  }, []);
620
- He(
798
+ et(
621
799
  u,
622
800
  () => ({
623
- play: f,
624
- pause: S,
625
- stop: b,
801
+ play: p,
802
+ pause: y,
803
+ stop: A,
626
804
  get current() {
627
- return p.current;
805
+ return f.current;
628
806
  }
629
807
  }),
630
- [S, f, b]
631
- ), _(() => {
632
- T.current = 0, E.current = null;
633
- }, [t]), _(() => {
634
- p.current && (p.current.volume = Pt(i));
635
- }, [i]), _(() => {
636
- wt(a, E.current, t) && (E.current = t, f().catch(() => {
808
+ [y, p, A]
809
+ ), v(() => {
810
+ S.current = 0, T.current = null;
811
+ }, [t]), v(() => {
812
+ f.current && (f.current.volume = er(o));
813
+ }, [o]), v(() => {
814
+ Qt(a, T.current, t) && (T.current = t, p().catch(() => {
637
815
  }));
638
816
  }, [a, t]);
639
- const K = R(() => {
640
- T.current += 1;
641
- const A = Math.max(1, Math.floor(r));
642
- if (xt(s, T.current, A) === "replay") {
643
- const w = p.current;
644
- w && (w.currentTime = 0, f().catch(() => {
817
+ const $ = R(() => {
818
+ S.current += 1;
819
+ const F = Math.max(1, Math.floor(s));
820
+ if (Jt(r, S.current, F) === "replay") {
821
+ const w = f.current;
822
+ w && (w.currentTime = 0, p().catch(() => {
645
823
  }));
646
824
  return;
647
825
  }
648
- T.current = 0, d == null || d();
649
- }, [r, d, f, s]);
826
+ S.current = 0, d == null || d();
827
+ }, [s, d, p, r]);
650
828
  return /* @__PURE__ */ g(
651
829
  "audio",
652
830
  {
653
- ref: p,
831
+ ref: f,
654
832
  src: t,
655
833
  preload: c,
656
834
  autoPlay: !1,
@@ -658,58 +836,58 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
658
836
  loop: !1,
659
837
  playsInline: !0,
660
838
  style: { display: "none" },
661
- onCanPlayThrough: o,
839
+ onCanPlayThrough: i,
662
840
  onPlay: l,
663
841
  onPause: h,
664
- onEnded: K,
842
+ onEnded: $,
665
843
  onError: () => m == null ? void 0 : m(new Error(`Unable to load audio: ${t}`))
666
844
  }
667
845
  );
668
- }), U = new _t(), Es = (e, t) => U.prefetchMusic(e, t), Rs = (e, t) => U.registerSound(e, t), bs = (e, t) => U.startMusic(e, t), As = () => U.stopMusic(), Fs = (e, t) => U.playOneShot(e, t), Cs = (e) => U.setMuted(e), vs = () => U.toggleMuted(), ks = () => U.isMuted(), _s = (e) => U.onMuteChange(e), xs = () => {
669
- const [e, t] = x(U.isMuted());
670
- return _(() => U.onMuteChange(t), []), e;
671
- }, Dt = (e = {}) => {
672
- const { auto: t = !1 } = e, s = F(e.env ?? Le()), r = F(e.constraints);
673
- r.current = e.constraints;
674
- const [a, n] = x("unknown"), [i, c] = x(null), o = F(0), l = R(async () => {
675
- const d = ++o.current, m = await Oe(s.current);
676
- if (d !== o.current) return a;
846
+ }), U = new Yt(), Zr = (e, t) => U.prefetchMusic(e, t), Yr = (e, t) => U.registerSound(e, t), Jr = (e, t) => U.startMusic(e, t), Qr = () => U.stopMusic(), es = (e, t) => U.playOneShot(e, t), ts = (e) => U.setMuted(e), rs = () => U.toggleMuted(), ss = () => U.isMuted(), as = (e) => U.onMuteChange(e), ns = () => {
847
+ const [e, t] = k(U.isMuted());
848
+ return v(() => U.onMuteChange(t), []), e;
849
+ }, tr = (e = {}) => {
850
+ const { auto: t = !1 } = e, r = b(e.env ?? $e()), s = b(e.constraints);
851
+ s.current = e.constraints;
852
+ const [a, n] = k("unknown"), [o, c] = k(null), i = b(0), l = R(async () => {
853
+ const d = ++i.current, m = await He(r.current);
854
+ if (d !== i.current) return a;
677
855
  const u = m.state === "unknown" ? "unknown" : m.state;
678
- return n((p) => p === "requesting" ? p : u), u !== "blocked" && c(null), u;
856
+ return n((f) => f === "requesting" ? f : u), u !== "blocked" && c(null), u;
679
857
  }, []), h = R(
680
858
  async (d) => {
681
- const m = ++o.current;
859
+ const m = ++i.current;
682
860
  n("requesting"), c(null);
683
- const u = await Ge(
684
- { constraints: (d == null ? void 0 : d.constraints) ?? r.current, keepStream: !1 },
685
- s.current
861
+ const u = await Ke(
862
+ { constraints: (d == null ? void 0 : d.constraints) ?? s.current, keepStream: !1 },
863
+ r.current
686
864
  );
687
- return m !== o.current || (n(u.state), c(u.reason)), u.state;
865
+ return m !== i.current || (n(u.state), c(u.reason)), u.state;
688
866
  },
689
867
  []
690
868
  );
691
- return _(() => {
869
+ return v(() => {
692
870
  let d = () => {
693
871
  }, m = !0;
694
- return t ? h() : l(), qe((u) => {
695
- m && (n((p) => p === "requesting" ? p : u.state === "unknown" ? "unknown" : u.state), u.state !== "blocked" && c(null));
696
- }, s.current).then((u) => {
872
+ return t ? h() : l(), je((u) => {
873
+ m && (n((f) => f === "requesting" ? f : u.state === "unknown" ? "unknown" : u.state), u.state !== "blocked" && c(null));
874
+ }, r.current).then((u) => {
697
875
  m ? d = u : u();
698
876
  }), () => {
699
- m = !1, o.current += 1, d();
877
+ m = !1, i.current += 1, d();
700
878
  };
701
- }, [t, l, h]), Z(
879
+ }, [t, l, h]), X(
702
880
  () => ({
703
881
  state: a,
704
- reason: i,
705
- canPrompt: Be(a),
882
+ reason: o,
883
+ canPrompt: Ve(a),
706
884
  usable: a === "granted",
707
885
  request: h,
708
886
  refresh: l
709
887
  }),
710
- [a, i, h, l]
888
+ [a, o, h, l]
711
889
  );
712
- }, Ut = {
890
+ }, rr = {
713
891
  display: "flex",
714
892
  flexDirection: "column",
715
893
  alignItems: "center",
@@ -722,7 +900,7 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
722
900
  background: "#111827",
723
901
  color: "#f9fafb",
724
902
  fontFamily: "system-ui, sans-serif"
725
- }, Nt = {
903
+ }, sr = {
726
904
  font: "inherit",
727
905
  padding: "10px 18px",
728
906
  borderRadius: 8,
@@ -730,86 +908,86 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
730
908
  background: "#2563eb",
731
909
  color: "#fff",
732
910
  cursor: "pointer"
733
- }, ws = ({
911
+ }, os = ({
734
912
  children: e,
735
913
  fallback: t,
736
- auto: s = !1,
737
- constraints: r,
914
+ auto: r = !1,
915
+ constraints: s,
738
916
  requestLabel: a = "Allow camera"
739
917
  }) => {
740
- const n = Dt({ auto: s, constraints: r });
741
- if (n.usable) return /* @__PURE__ */ g(re, { children: e });
742
- if (t) return /* @__PURE__ */ g(re, { children: t(n) });
743
- const { state: i, reason: c, canPrompt: o, request: l } = n;
744
- return /* @__PURE__ */ L("div", { style: Ut, role: "region", "aria-label": "Camera access", children: [
745
- /* @__PURE__ */ g("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ?? We[i] }),
918
+ const n = tr({ auto: r, constraints: s });
919
+ if (n.usable) return /* @__PURE__ */ g(ae, { children: e });
920
+ if (t) return /* @__PURE__ */ g(ae, { children: t(n) });
921
+ const { state: o, reason: c, canPrompt: i, request: l } = n;
922
+ return /* @__PURE__ */ I("div", { style: rr, role: "region", "aria-label": "Camera access", children: [
923
+ /* @__PURE__ */ g("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ?? Ze[o] }),
746
924
  /* @__PURE__ */ g(
747
925
  "button",
748
926
  {
749
927
  type: "button",
750
928
  onClick: () => void l(),
751
- disabled: !o || i === "requesting",
752
- "aria-disabled": !o || i === "requesting",
753
- style: { ...Nt, opacity: o && i !== "requesting" ? 1 : 0.5 },
754
- children: i === "requesting" ? "Waiting…" : i === "denied" ? "Try again" : a
929
+ disabled: !i || o === "requesting",
930
+ "aria-disabled": !i || o === "requesting",
931
+ style: { ...sr, opacity: i && o !== "requesting" ? 1 : 0.5 },
932
+ children: o === "requesting" ? "Waiting…" : o === "denied" ? "Try again" : a
755
933
  }
756
934
  )
757
935
  ] });
758
- }, It = () => {
936
+ }, ar = () => {
759
937
  var e;
760
938
  return {
761
939
  enumerateDevices: typeof navigator < "u" && ((e = navigator.mediaDevices) != null && e.enumerateDevices) ? () => navigator.mediaDevices.enumerateDevices() : void 0
762
940
  };
763
- }, Lt = /\b(back|rear|environment|world)\b/i, Ot = /\b(front|user|facetime|selfie)\b/i, Gt = (e) => Lt.test(e) ? "environment" : Ot.test(e) ? "user" : null, Ps = async (e = It()) => {
941
+ }, nr = /\b(back|rear|environment|world)\b/i, or = /\b(front|user|facetime|selfie)\b/i, ir = (e) => nr.test(e) ? "environment" : or.test(e) ? "user" : null, is = async (e = ar()) => {
764
942
  if (!e.enumerateDevices) return [];
765
943
  try {
766
- return (await e.enumerateDevices()).filter((s) => s.kind === "videoinput").map((s) => ({
767
- deviceId: s.deviceId,
768
- label: s.label,
769
- facing: Gt(s.label)
944
+ return (await e.enumerateDevices()).filter((r) => r.kind === "videoinput").map((r) => ({
945
+ deviceId: r.deviceId,
946
+ label: r.label,
947
+ facing: ir(r.label)
770
948
  }));
771
949
  } catch {
772
950
  return [];
773
951
  }
774
- }, Ds = (e, t) => e.find((s) => s.facing === t) ?? null, ke = je(null), Us = ({
952
+ }, cs = (e, t) => e.find((r) => r.facing === t) ?? null, Ne = rt(null), ls = ({
775
953
  cache: e,
776
954
  disposeUnreferencedOnUnmount: t = !0,
777
- children: s
955
+ children: r
778
956
  }) => {
779
- const r = e ?? Ce();
780
- return _(() => () => {
781
- t && r.disposeUnreferenced();
782
- }, [r, t]), /* @__PURE__ */ g(ke.Provider, { value: r, children: s });
783
- }, _e = () => $e(ke) ?? Ce(), Ns = (e, t = {}) => {
784
- const { enabled: s = !0 } = t, r = _e(), a = Ve(), n = (e == null ? void 0 : e.key) ?? null, [i, c] = x({
957
+ const s = e ?? De();
958
+ return v(() => () => {
959
+ t && s.disposeUnreferenced();
960
+ }, [s, t]), /* @__PURE__ */ g(Ne.Provider, { value: s, children: r });
961
+ }, Le = () => tt(Ne) ?? De(), us = (e, t = {}) => {
962
+ const { enabled: r = !0 } = t, s = Le(), a = st(), n = (e == null ? void 0 : e.key) ?? null, [o, c] = k({
785
963
  value: null,
786
964
  status: "idle",
787
965
  error: null
788
966
  });
789
- return _(() => {
790
- if (!e || !s) {
967
+ return v(() => {
968
+ if (!e || !r) {
791
969
  c({ value: null, status: "idle", error: null });
792
970
  return;
793
971
  }
794
- let o = !0;
795
- const l = r.get(e.key);
796
- return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }), r.acquire(e, a).then((h) => {
797
- o && c({ value: h, status: "ready", error: null });
972
+ let i = !0;
973
+ const l = s.get(e.key);
974
+ return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }), s.acquire(e, a).then((h) => {
975
+ i && c({ value: h, status: "ready", error: null });
798
976
  }).catch((h) => {
799
- o && c({ value: null, status: "error", error: h });
977
+ i && c({ value: null, status: "error", error: h });
800
978
  }), () => {
801
- o = !1, r.release(e.key, a);
979
+ i = !1, s.release(e.key, a);
802
980
  };
803
- }, [r, n, s, a]), i;
804
- }, Is = (e) => {
805
- const t = _e(), s = e ?? t;
806
- return Ze(
807
- (r) => s.subscribe(r),
808
- () => s.getStats(),
809
- () => s.getStats()
981
+ }, [s, n, r, a]), o;
982
+ }, ds = (e) => {
983
+ const t = Le(), r = e ?? t;
984
+ return at(
985
+ (s) => r.subscribe(s),
986
+ () => r.getStats(),
987
+ () => r.getStats()
810
988
  );
811
- }, ae = 1, xe = Object.freeze({
812
- version: ae,
989
+ }, ne = 1, Ie = Object.freeze({
990
+ version: ne,
813
991
  trackers: {
814
992
  face: { enabled: !0, numFaces: 1, targetFps: null, holdMs: 250, predictMs: 0, smoothing: 0 },
815
993
  hand: { enabled: !1, targetFps: null },
@@ -836,13 +1014,13 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
836
1014
  fallbacks: { onUnsupported: "degrade", delegate: "auto" },
837
1015
  assets: { holisticModelUrl: null, semanticSegmentationModelUrl: null },
838
1016
  updatedAt: 0
839
- }), D = (e, t, s, r, a, n) => {
1017
+ }), D = (e, t, r, s, a, n) => {
840
1018
  if (e === void 0) return t;
841
1019
  if (typeof e != "number" || !Number.isFinite(e))
842
1020
  return n(`${a}: not a number, kept ${t}`), t;
843
- const i = Math.min(r, Math.max(s, e));
844
- return i !== e && n(`${a}: ${e} clamped to ${i}`), i;
845
- }, j = (e, t, s, r) => e === void 0 ? t : e === null ? null : typeof e != "number" || !Number.isFinite(e) || e <= 0 ? (r(`${s}: invalid fps, kept ${t}`), t) : (e > 120 && r(`${s}: ${e} clamped to 120`), Math.min(120, e)), qt = [
1021
+ const o = Math.min(s, Math.max(r, e));
1022
+ return o !== e && n(`${a}: ${e} clamped to ${o}`), o;
1023
+ }, V = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "number" || !Number.isFinite(e) || e <= 0 ? (s(`${r}: invalid fps, kept ${t}`), t) : (e > 120 && s(`${r}: ${e} clamped to 120`), Math.min(120, e)), cr = [
846
1024
  "tiers",
847
1025
  "budget",
848
1026
  "initialTier",
@@ -850,30 +1028,30 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
850
1028
  "maxTier",
851
1029
  "adaptive",
852
1030
  "historySize"
853
- ], Ee = (e) => {
1031
+ ], ve = (e) => {
854
1032
  const t = {};
855
- for (const s of qt) e[s] !== void 0 && (t[s] = e[s]);
1033
+ for (const r of cr) e[r] !== void 0 && (t[r] = e[r]);
856
1034
  return t;
857
- }, I = (e, t, s, r) => e === void 0 ? t : typeof e != "boolean" ? (r(`${s}: not a boolean, kept ${t}`), t) : e, B = (e, t, s, r, a) => e === void 0 ? s : t.includes(e) ? e : (a(`${r}: "${String(e)}" is not one of ${t.join(" | ")}, kept ${s}`), s), Re = (e, t, s, r) => e === void 0 ? t : e === null ? null : typeof e != "string" || !/^https?:\/\//.test(e) ? (r(`${s}: not an http(s) URL, kept ${t === null ? "the SDK default" : t}`), t) : e, W = (e = {}, t = xe, s = []) => {
858
- var c, o, l, h, d, m, u, p, T, E, f, S, b, K, A, w, G, Y, Q, J, ee, H, y, C, M, k, X, z, N, $, le, ue, de, me, pe, fe, he, ge;
859
- const r = (De) => s.push(De), a = e.trackers ?? {}, n = t.trackers, i = e.quality === void 0 ? t.quality === !1 ? !1 : Ee(t.quality) : e.quality === !1 ? !1 : typeof e.quality == "object" && e.quality !== null ? Ee(e.quality) : (r("quality: must be an object or false, kept base"), t.quality);
1035
+ }, L = (e, t, r, s) => e === void 0 ? t : typeof e != "boolean" ? (s(`${r}: not a boolean, kept ${t}`), t) : e, z = (e, t, r, s, a) => e === void 0 ? r : t.includes(e) ? e : (a(`${s}: "${String(e)}" is not one of ${t.join(" | ")}, kept ${r}`), r), xe = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "string" || !/^https?:\/\//.test(e) ? (s(`${r}: not an http(s) URL, kept ${t === null ? "the SDK default" : t}`), t) : e, W = (e = {}, t = Ie, r = []) => {
1036
+ var c, i, l, h, d, m, u, f, S, T, p, y, A, $, F, w, G, Y, J, Q, ee, K, M, C, E, _, H, B, N, j, me, fe, pe, he, ge, ye, Se, Me;
1037
+ const s = (qe) => r.push(qe), a = e.trackers ?? {}, n = t.trackers, o = e.quality === void 0 ? t.quality === !1 ? !1 : ve(t.quality) : e.quality === !1 ? !1 : typeof e.quality == "object" && e.quality !== null ? ve(e.quality) : (s("quality: must be an object or false, kept base"), t.quality);
860
1038
  return {
861
- version: ae,
1039
+ version: ne,
862
1040
  trackers: {
863
1041
  face: {
864
- enabled: I((c = a.face) == null ? void 0 : c.enabled, n.face.enabled, "trackers.face.enabled", r),
1042
+ enabled: L((c = a.face) == null ? void 0 : c.enabled, n.face.enabled, "trackers.face.enabled", s),
865
1043
  numFaces: Math.round(
866
- D((o = a.face) == null ? void 0 : o.numFaces, n.face.numFaces, 1, 10, "trackers.face.numFaces", r)
1044
+ D((i = a.face) == null ? void 0 : i.numFaces, n.face.numFaces, 1, 10, "trackers.face.numFaces", s)
867
1045
  ),
868
- targetFps: j((l = a.face) == null ? void 0 : l.targetFps, n.face.targetFps, "trackers.face.targetFps", r),
869
- holdMs: D((h = a.face) == null ? void 0 : h.holdMs, n.face.holdMs, 0, 5e3, "trackers.face.holdMs", r),
1046
+ targetFps: V((l = a.face) == null ? void 0 : l.targetFps, n.face.targetFps, "trackers.face.targetFps", s),
1047
+ holdMs: D((h = a.face) == null ? void 0 : h.holdMs, n.face.holdMs, 0, 5e3, "trackers.face.holdMs", s),
870
1048
  predictMs: D(
871
1049
  (d = a.face) == null ? void 0 : d.predictMs,
872
1050
  n.face.predictMs,
873
1051
  0,
874
1052
  1e3,
875
1053
  "trackers.face.predictMs",
876
- r
1054
+ s
877
1055
  ),
878
1056
  smoothing: D(
879
1057
  (m = a.face) == null ? void 0 : m.smoothing,
@@ -881,40 +1059,40 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
881
1059
  0,
882
1060
  100,
883
1061
  "trackers.face.smoothing",
884
- r
1062
+ s
885
1063
  )
886
1064
  },
887
1065
  hand: {
888
- enabled: I((u = a.hand) == null ? void 0 : u.enabled, n.hand.enabled, "trackers.hand.enabled", r),
889
- targetFps: j((p = a.hand) == null ? void 0 : p.targetFps, n.hand.targetFps, "trackers.hand.targetFps", r)
1066
+ enabled: L((u = a.hand) == null ? void 0 : u.enabled, n.hand.enabled, "trackers.hand.enabled", s),
1067
+ targetFps: V((f = a.hand) == null ? void 0 : f.targetFps, n.hand.targetFps, "trackers.hand.targetFps", s)
890
1068
  },
891
1069
  gesture: {
892
- enabled: I((T = a.gesture) == null ? void 0 : T.enabled, n.gesture.enabled, "trackers.gesture.enabled", r),
893
- targetFps: j(
894
- (E = a.gesture) == null ? void 0 : E.targetFps,
1070
+ enabled: L((S = a.gesture) == null ? void 0 : S.enabled, n.gesture.enabled, "trackers.gesture.enabled", s),
1071
+ targetFps: V(
1072
+ (T = a.gesture) == null ? void 0 : T.targetFps,
895
1073
  n.gesture.targetFps,
896
1074
  "trackers.gesture.targetFps",
897
- r
1075
+ s
898
1076
  )
899
1077
  },
900
1078
  body: {
901
- enabled: I((f = a.body) == null ? void 0 : f.enabled, n.body.enabled, "trackers.body.enabled", r),
902
- targetFps: j((S = a.body) == null ? void 0 : S.targetFps, n.body.targetFps, "trackers.body.targetFps", r)
1079
+ enabled: L((p = a.body) == null ? void 0 : p.enabled, n.body.enabled, "trackers.body.enabled", s),
1080
+ targetFps: V((y = a.body) == null ? void 0 : y.targetFps, n.body.targetFps, "trackers.body.targetFps", s)
903
1081
  },
904
1082
  holistic: {
905
- enabled: I((b = a.holistic) == null ? void 0 : b.enabled, n.holistic.enabled, "trackers.holistic.enabled", r),
906
- targetFps: j(
907
- (K = a.holistic) == null ? void 0 : K.targetFps,
1083
+ enabled: L((A = a.holistic) == null ? void 0 : A.enabled, n.holistic.enabled, "trackers.holistic.enabled", s),
1084
+ targetFps: V(
1085
+ ($ = a.holistic) == null ? void 0 : $.targetFps,
908
1086
  n.holistic.targetFps,
909
1087
  "trackers.holistic.targetFps",
910
- r
1088
+ s
911
1089
  ),
912
- hands: B(
913
- (A = a.holistic) == null ? void 0 : A.hands,
1090
+ hands: z(
1091
+ (F = a.holistic) == null ? void 0 : F.hands,
914
1092
  ["both", "left", "right", "none"],
915
1093
  n.holistic.hands,
916
1094
  "trackers.holistic.hands",
917
- r
1095
+ s
918
1096
  ),
919
1097
  holdMs: D(
920
1098
  (w = a.holistic) == null ? void 0 : w.holdMs,
@@ -922,7 +1100,7 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
922
1100
  0,
923
1101
  5e3,
924
1102
  "trackers.holistic.holdMs",
925
- r
1103
+ s
926
1104
  ),
927
1105
  predictMs: D(
928
1106
  (G = a.holistic) == null ? void 0 : G.predictMs,
@@ -930,7 +1108,7 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
930
1108
  0,
931
1109
  1e3,
932
1110
  "trackers.holistic.predictMs",
933
- r
1111
+ s
934
1112
  ),
935
1113
  analysisMaxDimension: Math.round(
936
1114
  D(
@@ -939,140 +1117,140 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
939
1117
  128,
940
1118
  2048,
941
1119
  "trackers.holistic.analysisMaxDimension",
942
- r
1120
+ s
943
1121
  )
944
1122
  ),
945
- outputFaceBlendshapes: I(
946
- (Q = a.holistic) == null ? void 0 : Q.outputFaceBlendshapes,
1123
+ outputFaceBlendshapes: L(
1124
+ (J = a.holistic) == null ? void 0 : J.outputFaceBlendshapes,
947
1125
  n.holistic.outputFaceBlendshapes,
948
1126
  "trackers.holistic.outputFaceBlendshapes",
949
- r
1127
+ s
950
1128
  ),
951
1129
  confidence: D(
952
- (J = a.holistic) == null ? void 0 : J.confidence,
1130
+ (Q = a.holistic) == null ? void 0 : Q.confidence,
953
1131
  n.holistic.confidence,
954
1132
  0,
955
1133
  1,
956
1134
  "trackers.holistic.confidence",
957
- r
1135
+ s
958
1136
  ),
959
- delegate: B(
1137
+ delegate: z(
960
1138
  (ee = a.holistic) == null ? void 0 : ee.delegate,
961
1139
  ["auto", "GPU", "CPU"],
962
1140
  n.holistic.delegate,
963
1141
  "trackers.holistic.delegate",
964
- r
1142
+ s
965
1143
  )
966
1144
  },
967
1145
  segmentation: {
968
- enabled: I(
969
- (H = a.segmentation) == null ? void 0 : H.enabled,
1146
+ enabled: L(
1147
+ (K = a.segmentation) == null ? void 0 : K.enabled,
970
1148
  n.segmentation.enabled,
971
1149
  "trackers.segmentation.enabled",
972
- r
1150
+ s
973
1151
  ),
974
- quality: B(
975
- (y = a.segmentation) == null ? void 0 : y.quality,
1152
+ quality: z(
1153
+ (M = a.segmentation) == null ? void 0 : M.quality,
976
1154
  ["low", "medium", "high"],
977
1155
  n.segmentation.quality,
978
1156
  "trackers.segmentation.quality",
979
- r
1157
+ s
980
1158
  )
981
1159
  },
982
1160
  semanticSegmentation: {
983
- enabled: I(
1161
+ enabled: L(
984
1162
  (C = a.semanticSegmentation) == null ? void 0 : C.enabled,
985
1163
  n.semanticSegmentation.enabled,
986
1164
  "trackers.semanticSegmentation.enabled",
987
- r
1165
+ s
988
1166
  ),
989
- preset: B(
990
- (M = a.semanticSegmentation) == null ? void 0 : M.preset,
991
- pt,
1167
+ preset: z(
1168
+ (E = a.semanticSegmentation) == null ? void 0 : E.preset,
1169
+ Et,
992
1170
  n.semanticSegmentation.preset,
993
1171
  "trackers.semanticSegmentation.preset",
994
- r
1172
+ s
995
1173
  ),
996
- quality: B(
997
- (k = a.semanticSegmentation) == null ? void 0 : k.quality,
1174
+ quality: z(
1175
+ (_ = a.semanticSegmentation) == null ? void 0 : _.quality,
998
1176
  ["low", "medium", "high"],
999
1177
  n.semanticSegmentation.quality,
1000
1178
  "trackers.semanticSegmentation.quality",
1001
- r
1179
+ s
1002
1180
  )
1003
1181
  }
1004
1182
  },
1005
1183
  perf: {
1006
- targetFps: D((X = e.perf) == null ? void 0 : X.targetFps, t.perf.targetFps, 0, 120, "perf.targetFps", r),
1007
- camRes: Math.round(D((z = e.perf) == null ? void 0 : z.camRes, t.perf.camRes, 160, 3840, "perf.camRes", r)),
1008
- cameraZoom: D((N = e.perf) == null ? void 0 : N.cameraZoom, t.perf.cameraZoom, 1, 3, "perf.cameraZoom", r),
1184
+ targetFps: D((H = e.perf) == null ? void 0 : H.targetFps, t.perf.targetFps, 0, 120, "perf.targetFps", s),
1185
+ camRes: Math.round(D((B = e.perf) == null ? void 0 : B.camRes, t.perf.camRes, 160, 3840, "perf.camRes", s)),
1186
+ cameraZoom: D((N = e.perf) == null ? void 0 : N.cameraZoom, t.perf.cameraZoom, 1, 3, "perf.cameraZoom", s),
1009
1187
  analysisScale: D(
1010
- ($ = e.perf) == null ? void 0 : $.analysisScale,
1188
+ (j = e.perf) == null ? void 0 : j.analysisScale,
1011
1189
  t.perf.analysisScale,
1012
1190
  0.25,
1013
1191
  1,
1014
1192
  "perf.analysisScale",
1015
- r
1193
+ s
1016
1194
  )
1017
1195
  },
1018
1196
  lifecycle: {
1019
- pauseWhenHidden: I(
1020
- (le = e.lifecycle) == null ? void 0 : le.pauseWhenHidden,
1197
+ pauseWhenHidden: L(
1198
+ (me = e.lifecycle) == null ? void 0 : me.pauseWhenHidden,
1021
1199
  t.lifecycle.pauseWhenHidden,
1022
1200
  "lifecycle.pauseWhenHidden",
1023
- r
1201
+ s
1024
1202
  )
1025
1203
  },
1026
- quality: i,
1204
+ quality: o,
1027
1205
  camera: {
1028
- facingMode: B(
1029
- (ue = e.camera) == null ? void 0 : ue.facingMode,
1206
+ facingMode: z(
1207
+ (fe = e.camera) == null ? void 0 : fe.facingMode,
1030
1208
  ["user", "environment"],
1031
1209
  t.camera.facingMode,
1032
1210
  "camera.facingMode",
1033
- r
1211
+ s
1034
1212
  ),
1035
- deviceId: ((de = e.camera) == null ? void 0 : de.deviceId) === void 0 ? t.camera.deviceId : typeof e.camera.deviceId == "string" || e.camera.deviceId === null ? e.camera.deviceId : (r("camera.deviceId: not a string, kept base"), t.camera.deviceId),
1036
- mirrored: ((me = e.camera) == null ? void 0 : me.mirrored) === void 0 ? t.camera.mirrored : e.camera.mirrored === "auto" || typeof e.camera.mirrored == "boolean" ? e.camera.mirrored : (r('camera.mirrored: must be boolean or "auto", kept base'), t.camera.mirrored)
1213
+ deviceId: ((pe = e.camera) == null ? void 0 : pe.deviceId) === void 0 ? t.camera.deviceId : typeof e.camera.deviceId == "string" || e.camera.deviceId === null ? e.camera.deviceId : (s("camera.deviceId: not a string, kept base"), t.camera.deviceId),
1214
+ mirrored: ((he = e.camera) == null ? void 0 : he.mirrored) === void 0 ? t.camera.mirrored : e.camera.mirrored === "auto" || typeof e.camera.mirrored == "boolean" ? e.camera.mirrored : (s('camera.mirrored: must be boolean or "auto", kept base'), t.camera.mirrored)
1037
1215
  },
1038
1216
  fallbacks: {
1039
- onUnsupported: B(
1040
- (pe = e.fallbacks) == null ? void 0 : pe.onUnsupported,
1217
+ onUnsupported: z(
1218
+ (ge = e.fallbacks) == null ? void 0 : ge.onUnsupported,
1041
1219
  ["block", "degrade"],
1042
1220
  t.fallbacks.onUnsupported,
1043
1221
  "fallbacks.onUnsupported",
1044
- r
1222
+ s
1045
1223
  ),
1046
- delegate: B(
1047
- (fe = e.fallbacks) == null ? void 0 : fe.delegate,
1224
+ delegate: z(
1225
+ (ye = e.fallbacks) == null ? void 0 : ye.delegate,
1048
1226
  ["auto", "GPU", "CPU"],
1049
1227
  t.fallbacks.delegate,
1050
1228
  "fallbacks.delegate",
1051
- r
1229
+ s
1052
1230
  )
1053
1231
  },
1054
1232
  assets: {
1055
- holisticModelUrl: Re(
1056
- (he = e.assets) == null ? void 0 : he.holisticModelUrl,
1233
+ holisticModelUrl: xe(
1234
+ (Se = e.assets) == null ? void 0 : Se.holisticModelUrl,
1057
1235
  t.assets.holisticModelUrl,
1058
1236
  "assets.holisticModelUrl",
1059
- r
1237
+ s
1060
1238
  ),
1061
- semanticSegmentationModelUrl: Re(
1062
- (ge = e.assets) == null ? void 0 : ge.semanticSegmentationModelUrl,
1239
+ semanticSegmentationModelUrl: xe(
1240
+ (Me = e.assets) == null ? void 0 : Me.semanticSegmentationModelUrl,
1063
1241
  t.assets.semanticSegmentationModelUrl,
1064
1242
  "assets.semanticSegmentationModelUrl",
1065
- r
1243
+ s
1066
1244
  )
1067
1245
  },
1068
1246
  updatedAt: typeof e.updatedAt == "number" && Number.isFinite(e.updatedAt) ? e.updatedAt : t.updatedAt
1069
1247
  };
1070
- }, be = (e, t, s = Date.now()) => W({ ...t, updatedAt: s }, e), we = (e) => JSON.stringify(W({}, e)), Pe = (e) => {
1248
+ }, ke = (e, t, r = Date.now()) => W({ ...t, updatedAt: r }, e), Oe = (e) => JSON.stringify(W({}, e)), Ge = (e) => {
1071
1249
  const t = [];
1072
- let s = e;
1250
+ let r = e;
1073
1251
  if (typeof e == "string")
1074
1252
  try {
1075
- s = JSON.parse(e);
1253
+ r = JSON.parse(e);
1076
1254
  } catch {
1077
1255
  return {
1078
1256
  config: W(),
@@ -1080,17 +1258,17 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1080
1258
  warnings: ["not valid JSON; defaults used"]
1081
1259
  };
1082
1260
  }
1083
- if (!s || typeof s != "object")
1261
+ if (!r || typeof r != "object")
1084
1262
  return {
1085
1263
  config: W(),
1086
1264
  migrated: !0,
1087
1265
  warnings: ["not an object; defaults used"]
1088
1266
  };
1089
- const r = s, a = r.version !== ae;
1267
+ const s = r, a = s.version !== ne;
1090
1268
  return a && t.push(
1091
- `migrated from version ${String(r.version ?? "none")} to ${ae}`
1092
- ), { config: W(r, xe, t), migrated: a, warnings: t };
1093
- }, Ls = [
1269
+ `migrated from version ${String(s.version ?? "none")} to ${ne}`
1270
+ ), { config: W(s, Ie, t), migrated: a, warnings: t };
1271
+ }, ms = [
1094
1272
  "face",
1095
1273
  "hand",
1096
1274
  "gesture",
@@ -1098,7 +1276,7 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1098
1276
  "holistic",
1099
1277
  "segmentation",
1100
1278
  "semanticSegmentation"
1101
- ], Bt = (e) => ({
1279
+ ], lr = (e) => ({
1102
1280
  perf: {
1103
1281
  targetFps: e.perf.targetFps > 0 ? e.perf.targetFps : void 0,
1104
1282
  camRes: e.perf.camRes,
@@ -1107,341 +1285,349 @@ const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1107
1285
  },
1108
1286
  lifecycle: { pauseWhenHidden: e.lifecycle.pauseWhenHidden },
1109
1287
  quality: e.quality
1110
- }), Wt = (e) => ({
1288
+ }), ur = (e) => ({
1111
1289
  facingMode: e.camera.facingMode,
1112
1290
  ...e.camera.deviceId ? { deviceId: e.camera.deviceId } : {},
1113
1291
  ...e.camera.mirrored === "auto" ? {} : { mirrored: e.camera.mirrored }
1114
- }), O = (e) => e === null ? {} : { targetFps: e }, zt = (e, t) => {
1115
- const s = e.trackers;
1292
+ }), O = (e) => e === null ? {} : { targetFps: e }, dr = (e, t) => {
1293
+ const r = e.trackers;
1116
1294
  return {
1117
1295
  face: {
1118
- numFaces: s.face.numFaces,
1119
- ...O(s.face.targetFps),
1120
- holdMs: s.face.holdMs,
1121
- predictMs: s.face.predictMs,
1122
- active: s.face.enabled
1296
+ numFaces: r.face.numFaces,
1297
+ ...O(r.face.targetFps),
1298
+ holdMs: r.face.holdMs,
1299
+ predictMs: r.face.predictMs,
1300
+ active: r.face.enabled
1123
1301
  },
1124
- hand: { ...O(s.hand.targetFps), active: s.hand.enabled },
1125
- gesture: { ...O(s.gesture.targetFps), active: s.gesture.enabled },
1126
- body: { active: s.body.enabled },
1302
+ hand: { ...O(r.hand.targetFps), active: r.hand.enabled },
1303
+ gesture: { ...O(r.gesture.targetFps), active: r.gesture.enabled },
1304
+ body: { active: r.body.enabled },
1127
1305
  holistic: {
1128
- ...O(s.holistic.targetFps),
1129
- hands: s.holistic.hands,
1130
- holdMs: s.holistic.holdMs,
1131
- predictMs: s.holistic.predictMs,
1132
- analysisMaxDimension: s.holistic.analysisMaxDimension,
1133
- outputFaceBlendshapes: s.holistic.outputFaceBlendshapes,
1134
- delegate: s.holistic.delegate === "auto" ? e.fallbacks.delegate : s.holistic.delegate,
1306
+ ...O(r.holistic.targetFps),
1307
+ hands: r.holistic.hands,
1308
+ holdMs: r.holistic.holdMs,
1309
+ predictMs: r.holistic.predictMs,
1310
+ analysisMaxDimension: r.holistic.analysisMaxDimension,
1311
+ outputFaceBlendshapes: r.holistic.outputFaceBlendshapes,
1312
+ delegate: r.holistic.delegate === "auto" ? e.fallbacks.delegate : r.holistic.delegate,
1135
1313
  ...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {},
1136
- active: s.holistic.enabled
1314
+ active: r.holistic.enabled
1137
1315
  },
1138
- segmentation: { quality: s.segmentation.quality, active: s.segmentation.enabled },
1316
+ segmentation: { quality: r.segmentation.quality, active: r.segmentation.enabled },
1139
1317
  semanticSegmentation: {
1140
- preset: s.semanticSegmentation.preset,
1141
- quality: s.semanticSegmentation.quality,
1318
+ preset: r.semanticSegmentation.preset,
1319
+ quality: r.semanticSegmentation.quality,
1142
1320
  ...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {},
1143
- active: s.semanticSegmentation.enabled
1321
+ active: r.semanticSegmentation.enabled
1144
1322
  }
1145
1323
  }[t];
1146
- }, Kt = (e, t) => {
1147
- const s = e.trackers;
1324
+ }, mr = (e, t) => {
1325
+ const r = e.trackers;
1148
1326
  switch (t) {
1149
- case v.FACE_TRACKER:
1150
- return { numFaces: s.face.numFaces, ...O(s.face.targetFps) };
1151
- case v.HAND_TRACKER:
1152
- return { ...O(s.hand.targetFps) };
1153
- case v.GESTURE_TRACKER:
1154
- return { ...O(s.gesture.targetFps) };
1155
- case v.BODY_TRACKER:
1156
- return { ...O(s.body.targetFps) };
1157
- case v.HOLISTIC_TRACKER: {
1158
- const r = s.holistic;
1327
+ case x.FACE_TRACKER:
1328
+ return { numFaces: r.face.numFaces, ...O(r.face.targetFps) };
1329
+ case x.HAND_TRACKER:
1330
+ return { ...O(r.hand.targetFps) };
1331
+ case x.GESTURE_TRACKER:
1332
+ return { ...O(r.gesture.targetFps) };
1333
+ case x.BODY_TRACKER:
1334
+ return { ...O(r.body.targetFps) };
1335
+ case x.HOLISTIC_TRACKER: {
1336
+ const s = r.holistic;
1159
1337
  return {
1160
- ...O(r.targetFps),
1161
- hands: r.hands,
1162
- holdMs: r.holdMs,
1163
- predictMs: r.predictMs,
1164
- analysisMaxDimension: r.analysisMaxDimension,
1165
- outputFaceBlendshapes: r.outputFaceBlendshapes,
1166
- minFaceDetectionConfidence: r.confidence,
1167
- minFacePresenceConfidence: r.confidence,
1168
- minPoseDetectionConfidence: r.confidence,
1169
- minPosePresenceConfidence: r.confidence,
1170
- minHandLandmarksConfidence: r.confidence,
1171
- delegate: r.delegate === "auto" ? e.fallbacks.delegate : r.delegate,
1338
+ ...O(s.targetFps),
1339
+ hands: s.hands,
1340
+ holdMs: s.holdMs,
1341
+ predictMs: s.predictMs,
1342
+ analysisMaxDimension: s.analysisMaxDimension,
1343
+ outputFaceBlendshapes: s.outputFaceBlendshapes,
1344
+ minFaceDetectionConfidence: s.confidence,
1345
+ minFacePresenceConfidence: s.confidence,
1346
+ minPoseDetectionConfidence: s.confidence,
1347
+ minPosePresenceConfidence: s.confidence,
1348
+ minHandLandmarksConfidence: s.confidence,
1349
+ delegate: s.delegate === "auto" ? e.fallbacks.delegate : s.delegate,
1172
1350
  ...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {}
1173
1351
  };
1174
1352
  }
1175
- case v.BACKGROUND_SEGMENTATION:
1176
- return { quality: s.segmentation.quality };
1177
- case v.SEMANTIC_SEGMENTATION:
1353
+ case x.BACKGROUND_SEGMENTATION:
1354
+ return { quality: r.segmentation.quality };
1355
+ case x.SEMANTIC_SEGMENTATION:
1178
1356
  return {
1179
- preset: s.semanticSegmentation.preset,
1180
- quality: s.semanticSegmentation.quality,
1357
+ preset: r.semanticSegmentation.preset,
1358
+ quality: r.semanticSegmentation.quality,
1181
1359
  ...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {}
1182
1360
  };
1183
1361
  default:
1184
1362
  return {};
1185
1363
  }
1186
- }, Xt = (e) => {
1187
- const t = e.trackers, s = [];
1188
- return t.face.enabled && s.push(v.FACE_TRACKER), t.hand.enabled && s.push(v.HAND_TRACKER), t.gesture.enabled && s.push(v.GESTURE_TRACKER), t.body.enabled && s.push(v.BODY_TRACKER), t.holistic.enabled && s.push(v.HOLISTIC_TRACKER), t.segmentation.enabled && s.push(v.BACKGROUND_SEGMENTATION), t.semanticSegmentation.enabled && s.push(v.SEMANTIC_SEGMENTATION), s;
1189
- }, ne = "vincentt.xr.tracking-config", ce = () => {
1364
+ }, fr = (e) => {
1365
+ const t = e.trackers, r = [];
1366
+ return t.face.enabled && r.push(x.FACE_TRACKER), t.hand.enabled && r.push(x.HAND_TRACKER), t.gesture.enabled && r.push(x.GESTURE_TRACKER), t.body.enabled && r.push(x.BODY_TRACKER), t.holistic.enabled && r.push(x.HOLISTIC_TRACKER), t.segmentation.enabled && r.push(x.BACKGROUND_SEGMENTATION), t.semanticSegmentation.enabled && r.push(x.SEMANTIC_SEGMENTATION), r;
1367
+ }, oe = "vincentt.xr.tracking-config", de = () => {
1190
1368
  try {
1191
1369
  return typeof localStorage < "u" ? localStorage : null;
1192
1370
  } catch {
1193
1371
  return null;
1194
1372
  }
1195
- }, Ht = (e = ne, t = ce()) => {
1373
+ }, pr = (e = oe, t = de()) => {
1196
1374
  if (!t) return null;
1197
1375
  try {
1198
- const s = t.getItem(e);
1199
- return s ? Pe(s) : null;
1376
+ const r = t.getItem(e);
1377
+ return r ? Ge(r) : null;
1200
1378
  } catch {
1201
1379
  return null;
1202
1380
  }
1203
- }, Ae = (e, t = ne, s = ce()) => {
1204
- if (!s) return !1;
1381
+ }, _e = (e, t = oe, r = de()) => {
1382
+ if (!r) return !1;
1205
1383
  try {
1206
- return s.setItem(t, we(e)), !0;
1384
+ return r.setItem(t, Oe(e)), !0;
1207
1385
  } catch {
1208
1386
  return !1;
1209
1387
  }
1210
- }, $t = (e = ne, t = ce()) => {
1388
+ }, hr = (e = oe, t = de()) => {
1211
1389
  if (t)
1212
1390
  try {
1213
1391
  t.removeItem(e);
1214
1392
  } catch {
1215
1393
  }
1216
- }, Os = (e = {}) => {
1217
- const { storageKey: t = ne, persist: s = !0 } = e, r = e.storage, a = F(e.initial), n = Z(() => W(a.current ?? {}), []), [i, c] = x(n), [o, l] = x([]), [h, d] = x(!s), m = F(i);
1218
- m.current = i, _(() => {
1219
- if (!s) {
1394
+ }, fs = (e = {}) => {
1395
+ const { storageKey: t = oe, persist: r = !0 } = e, s = e.storage, a = b(e.initial), n = X(() => W(a.current ?? {}), []), [o, c] = k(n), [i, l] = k([]), [h, d] = k(!r), m = b(o);
1396
+ m.current = o, v(() => {
1397
+ if (!r) {
1220
1398
  d(!0);
1221
1399
  return;
1222
1400
  }
1223
- const f = Ht(t, r);
1224
- if (f) {
1225
- const S = W(f.config, n);
1226
- m.current = S, c(S), l(f.warnings), f.migrated && Ae(S, t, r);
1401
+ const p = pr(t, s);
1402
+ if (p) {
1403
+ const y = W(p.config, n);
1404
+ m.current = y, c(y), l(p.warnings), p.migrated && _e(y, t, s);
1227
1405
  }
1228
1406
  d(!0);
1229
- }, [s, t, r, n]);
1407
+ }, [r, t, s, n]);
1230
1408
  const u = R(
1231
- (f, S) => (m.current = f, c(f), l(S), s && Ae(f, t, r), f),
1232
- [s, t, r]
1233
- ), p = R(
1234
- (f) => {
1235
- const S = [], b = W({ ...f, updatedAt: Date.now() }, m.current, S);
1236
- return u(b, S);
1409
+ (p, y) => (m.current = p, c(p), l(y), r && _e(p, t, s), p),
1410
+ [r, t, s]
1411
+ ), f = R(
1412
+ (p) => {
1413
+ const y = [], A = W({ ...p, updatedAt: Date.now() }, m.current, y);
1414
+ return u(A, y);
1237
1415
  },
1238
1416
  [u]
1239
- ), T = R(() => {
1240
- const f = be(n, {}, 0);
1241
- return m.current = f, c(f), l([]), s && $t(t, r), f;
1242
- }, [n, s, t, r]), E = R(
1243
- (f) => {
1244
- const S = Pe(f);
1245
- return S.warnings.some((b) => b.startsWith("not valid JSON") || b.startsWith("not an object")) ? (l([`import: ${S.warnings[0]}; config unchanged`]), m.current) : u(be(S.config, {}, Date.now()), S.warnings);
1417
+ ), S = R(() => {
1418
+ const p = ke(n, {}, 0);
1419
+ return m.current = p, c(p), l([]), r && hr(t, s), p;
1420
+ }, [n, r, t, s]), T = R(
1421
+ (p) => {
1422
+ const y = Ge(p);
1423
+ return y.warnings.some((A) => A.startsWith("not valid JSON") || A.startsWith("not an object")) ? (l([`import: ${y.warnings[0]}; config unchanged`]), m.current) : u(ke(y.config, {}, Date.now()), y.warnings);
1246
1424
  },
1247
1425
  [u]
1248
1426
  );
1249
- return Z(
1427
+ return X(
1250
1428
  () => ({
1251
- config: i,
1429
+ config: o,
1252
1430
  hydrated: h,
1253
- warnings: o,
1254
- update: p,
1255
- reset: T,
1256
- importJson: E,
1257
- json: we(i),
1258
- providerProps: Bt(i),
1259
- cameraRequest: Wt(i),
1260
- trackerProps: (f) => zt(i, f),
1261
- modelOptions: (f) => Kt(i, f),
1262
- enabledModels: Xt(i)
1431
+ warnings: i,
1432
+ update: f,
1433
+ reset: S,
1434
+ importJson: T,
1435
+ json: Oe(o),
1436
+ providerProps: lr(o),
1437
+ cameraRequest: ur(o),
1438
+ trackerProps: (p) => dr(o, p),
1439
+ modelOptions: (p) => mr(o, p),
1440
+ enabledModels: fr(o)
1263
1441
  }),
1264
- [i, h, o, p, T, E]
1442
+ [o, h, i, f, S, T]
1265
1443
  );
1266
1444
  };
1267
1445
  export {
1268
- fs as AspectRatioContainer,
1269
- _t as AudioEngine,
1270
- Ms as AudioPlayer,
1271
- hs as Axes,
1272
- We as CAMERA_PERMISSION_MESSAGES,
1273
- ws as CameraPermissionGate,
1274
- $a as DEFAULT_ASSET_BUDGET_BYTES,
1275
- Fa as DEFAULT_MATERIAL_FILL,
1276
- Oa as DEFAULT_MESH_RENDERER,
1277
- Ga as DEFAULT_MESH_RENDERER_RENDER_STATE,
1278
- Bs as DEFAULT_PERFORMANCE_BUDGET,
1279
- Ws as DEFAULT_PIXEL_SNAP_INCREMENT,
1280
- zs as DEFAULT_QUALITY_TIERS,
1281
- Ks as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
1282
- Qr as DEFAULT_SCREEN_GLASS,
1283
- Ca as DEFAULT_SCREEN_GRADIENT,
1284
- Jr as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
1285
- ea as DEFAULT_SCREEN_IMAGE_SETTINGS,
1286
- ta as DEFAULT_SCREEN_SHAPE_SETTINGS,
1287
- sa as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
1288
- ra as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
1289
- Xs as DEFAULT_SCREEN_TRANSFORM_2D,
1290
- Hs as DEFAULT_SCREEN_TRANSFORM_ROOT,
1291
- xe as DEFAULT_TRACKING_CONFIG,
1292
- va as DEFAULT_TRANSFORM_3D,
1293
- ka as EXTERNAL_BACKGROUND_RENDER_LAYER,
1294
- ct as FULL_SCREEN_ANCHORS,
1295
- Sa as LightObject,
1296
- ya as LookAt,
1297
- _a as MAX_RENDER_GROUP_PASSES,
1298
- xa as MaterialFill,
1299
- za as MeshMaterial,
1300
- qa as MeshRenderer,
1301
- ds as Panel,
1302
- ps as PersonCutout,
1303
- aa as PinToMesh,
1304
- Ta as RenderGroupLayer,
1305
- Ma as SCREEN_IMAGE_MASK_CHANNELS,
1306
- Ea as SceneObjectRenderer,
1307
- na as ScreenGlassMaterial,
1308
- wa as ScreenGradientMaterial,
1309
- lt as ScreenImage,
1310
- ia as ScreenShape,
1311
- Vr as ScreenSpaceUI,
1312
- Ra as ScreenText,
1313
- ze as ScreenTransform,
1314
- ba as SequentialRenderPasses,
1315
- gs as SpriteAnimation,
1316
- Ls as TRACKER_KINDS,
1317
- ne as TRACKING_CONFIG_STORAGE_KEY,
1318
- ae as TRACKING_CONFIG_VERSION,
1319
- Zr as TextLabel,
1320
- Pa as Transform3D,
1321
- ms as VideoBackground,
1322
- ja as XRAssetCache,
1323
- Us as XRAssetCacheProvider,
1324
- $s as XRMediaSource,
1325
- v as XRModel,
1326
- js as XRProvider,
1327
- Vs as XRQualityController,
1328
- $r as XRScene,
1329
- Zs as XR_FALLBACK_MESSAGES,
1330
- Ys as XR_MODEL_ASSET_URLS,
1446
+ Or as AspectRatioContainer,
1447
+ Yt as AudioEngine,
1448
+ Vr as AudioPlayer,
1449
+ Gr as Axes,
1450
+ $r as Button,
1451
+ Ze as CAMERA_PERMISSION_MESSAGES,
1452
+ os as CameraPermissionGate,
1453
+ Rn as DEFAULT_ASSET_BUDGET_BYTES,
1454
+ an as DEFAULT_MATERIAL_FILL,
1455
+ be as DEFAULT_MESH_RENDERER,
1456
+ gn as DEFAULT_MESH_RENDERER_RENDER_STATE,
1457
+ gs as DEFAULT_PERFORMANCE_BUDGET,
1458
+ ys as DEFAULT_PIXEL_SNAP_INCREMENT,
1459
+ Ss as DEFAULT_QUALITY_TIERS,
1460
+ Ms as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
1461
+ va as DEFAULT_SCREEN_GLASS,
1462
+ nn as DEFAULT_SCREEN_GRADIENT,
1463
+ xa as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
1464
+ ka as DEFAULT_SCREEN_IMAGE_SETTINGS,
1465
+ _a as DEFAULT_SCREEN_SHAPE_SETTINGS,
1466
+ wa as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
1467
+ Pa as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
1468
+ Ts as DEFAULT_SCREEN_TRANSFORM_2D,
1469
+ Es as DEFAULT_SCREEN_TRANSFORM_ROOT,
1470
+ Ie as DEFAULT_TRACKING_CONFIG,
1471
+ re as DEFAULT_TRANSFORM_3D,
1472
+ on as EXTERNAL_BACKGROUND_RENDER_LAYER,
1473
+ pt as FULL_SCREEN_ANCHORS,
1474
+ Xr as HtmlRegion,
1475
+ Ha as LightObject,
1476
+ Ka as LookAt,
1477
+ cn as MAX_RENDER_GROUP_PASSES,
1478
+ ln as MaterialFill,
1479
+ Mn as MeshMaterial,
1480
+ Tt as MeshRenderer,
1481
+ Wr as Model,
1482
+ Br as Object3D,
1483
+ Nr as Panel,
1484
+ Ir as PersonCutout,
1485
+ Da as PinToMesh,
1486
+ ja as RenderGroupLayer,
1487
+ Va as SCREEN_IMAGE_MASK_CHANNELS,
1488
+ en as Scene,
1489
+ Za as SceneObjectRenderer,
1490
+ tn as Scenes,
1491
+ Ua as ScreenGlassMaterial,
1492
+ un as ScreenGradientMaterial,
1493
+ ht as ScreenImage,
1494
+ Na as ScreenShape,
1495
+ Aa as ScreenSpaceUI,
1496
+ Ya as ScreenText,
1497
+ Ye as ScreenTransform,
1498
+ Ja as SequentialRenderPasses,
1499
+ qr as SpriteAnimation,
1500
+ ms as TRACKER_KINDS,
1501
+ oe as TRACKING_CONFIG_STORAGE_KEY,
1502
+ ne as TRACKING_CONFIG_VERSION,
1503
+ Fa as TextLabel,
1504
+ zr as ThemeProvider,
1505
+ Mt as Transform3D,
1506
+ Lr as VideoBackground,
1507
+ An as XRAssetCache,
1508
+ ls as XRAssetCacheProvider,
1509
+ bs as XRMediaSource,
1510
+ x as XRModel,
1511
+ Rs as XRProvider,
1512
+ As as XRQualityController,
1513
+ ba as XRScene,
1514
+ Fs as XR_FALLBACK_MESSAGES,
1515
+ Cs as XR_MODEL_ASSET_URLS,
1331
1516
  U as audio,
1332
- Be as canPromptForCamera,
1333
- $t as clearTrackingConfig,
1334
- Qs as clientToScreenPixels,
1335
- ut as computeContainScale,
1336
- Js as computeFeedCrop,
1337
- er as computeFitLayout,
1338
- Va as createAssetCache,
1339
- tr as createFallbackReason,
1340
- Da as createTwoStopGradient,
1341
- Ts as dataURLtoFile,
1342
- Qa as defineGltfAsset,
1343
- Ja as defineTextureAsset,
1344
- en as defineVideoAsset,
1345
- sr as detectXRCapabilities,
1346
- tn as disposeObject3D,
1347
- pa as drawNormalizedCrop,
1348
- Xt as enabledModels,
1349
- sn as estimateGeometryBytes,
1350
- rn as estimateObjectBytes,
1351
- an as estimateTextureBytes,
1352
- rr as feedSidedName,
1353
- ar as feedToScreenPixels,
1354
- nr as feedToSource,
1355
- ir as feedToTracker,
1356
- or as feedToViewport,
1357
- cr as feedToWorld,
1358
- Ds as findCameraByFacing,
1359
- Ce as getDefaultAssetCache,
1360
- Ua as getRenderGroupLayer,
1361
- lr as isFeedPointInSource,
1362
- ur as isMirroredSourceKind,
1363
- ks as isMuted,
1364
- Ps as listCameras,
1365
- Ht as loadTrackingConfig,
1366
- oa as mapScreenImageSettingsToProps,
1367
- ca as mapScreenTextInnerShadowToProps,
1368
- la as mapScreenTextSettingsToProps,
1369
- dr as mediaToScreenPixels,
1370
- ua as mergeScreenShapeSettings,
1371
- mr as mergeScreenTransform2D,
1372
- be as mergeTrackingConfig,
1373
- pr as mirrorFeedX,
1374
- Ba as normalizeMeshRendererRenderState,
1375
- da as normalizeScreenGlass,
1376
- Na as normalizeScreenGradient,
1377
- fr as normalizedToScreenPixels,
1378
- hr as normalizedToTransform2DPixels,
1379
- _s as onMuteChange,
1380
- gr as orientSourcePoint,
1381
- Sr as orientedSize,
1382
- yr as otherSide,
1383
- Pe as parseTrackingConfig,
1384
- Tr as personLeftSign,
1385
- Mr as personSide,
1386
- Fs as playOneShot,
1387
- Es as prefetchMusic,
1388
- Oe as queryCameraPermission,
1389
- Rs as registerSound,
1390
- Ia as renderSequentialPasses,
1391
- Ge as requestCameraAccess,
1392
- Er as resolveModelAssetUrl,
1393
- fa as resolveNormalizedCrop,
1394
- ha as resolvePersonCutoutStatus,
1395
- Rr as resolveQualityConfig,
1396
- br as resolveScreenTransform2D,
1397
- Ar as resolveTrackerSupport,
1517
+ Ve as canPromptForCamera,
1518
+ hr as clearTrackingConfig,
1519
+ vs as clientToScreenPixels,
1520
+ gt as computeContainScale,
1521
+ xs as computeFeedCrop,
1522
+ ks as computeFitLayout,
1523
+ Fn as createAssetCache,
1524
+ _s as createFallbackReason,
1525
+ dn as createTwoStopGradient,
1526
+ jr as dataURLtoFile,
1527
+ xn as defineGltfAsset,
1528
+ kn as defineTextureAsset,
1529
+ _n as defineVideoAsset,
1530
+ ws as detectXRCapabilities,
1531
+ wn as disposeObject3D,
1532
+ Wa as drawNormalizedCrop,
1533
+ fr as enabledModels,
1534
+ Pn as estimateGeometryBytes,
1535
+ Dn as estimateObjectBytes,
1536
+ Un as estimateTextureBytes,
1537
+ Ps as feedSidedName,
1538
+ Ds as feedToScreenPixels,
1539
+ Us as feedToSource,
1540
+ Ns as feedToTracker,
1541
+ Ls as feedToViewport,
1542
+ Is as feedToWorld,
1543
+ cs as findCameraByFacing,
1544
+ De as getDefaultAssetCache,
1545
+ mn as getRenderGroupLayer,
1546
+ Os as isFeedPointInSource,
1547
+ Gs as isMirroredSourceKind,
1548
+ ss as isMuted,
1549
+ is as listCameras,
1550
+ pr as loadTrackingConfig,
1551
+ La as mapScreenImageSettingsToProps,
1552
+ Ia as mapScreenTextInnerShadowToProps,
1553
+ Oa as mapScreenTextSettingsToProps,
1554
+ qs as mediaToScreenPixels,
1555
+ Ga as mergeScreenShapeSettings,
1556
+ zs as mergeScreenTransform2D,
1557
+ ke as mergeTrackingConfig,
1558
+ Ws as mirrorFeedX,
1559
+ yn as normalizeMeshRendererRenderState,
1560
+ qa as normalizeScreenGlass,
1561
+ fn as normalizeScreenGradient,
1562
+ Bs as normalizedToScreenPixels,
1563
+ Xs as normalizedToTransform2DPixels,
1564
+ as as onMuteChange,
1565
+ $s as orientSourcePoint,
1566
+ Hs as orientedSize,
1567
+ Ks as otherSide,
1568
+ Ge as parseTrackingConfig,
1569
+ js as personLeftSign,
1570
+ Vs as personSide,
1571
+ es as playOneShot,
1572
+ Zr as prefetchMusic,
1573
+ He as queryCameraPermission,
1574
+ Yr as registerSound,
1575
+ pn as renderSequentialPasses,
1576
+ Ke as requestCameraAccess,
1577
+ Zs as resolveModelAssetUrl,
1578
+ Ba as resolveNormalizedCrop,
1579
+ Xa as resolvePersonCutoutStatus,
1580
+ Ys as resolveQualityConfig,
1581
+ Js as resolveScreenTransform2D,
1582
+ Qs as resolveTrackerSupport,
1398
1583
  W as resolveTrackingConfig,
1399
- Ae as saveTrackingConfig,
1400
- Fr as screenPixelsToClient,
1401
- Cr as screenPixelsToFeed,
1402
- vr as screenPixelsToMedia,
1403
- kr as screenPixelsToNormalized,
1404
- _r as screenPixelsToScreenSpace,
1405
- xr as screenPixelsToUnits,
1406
- wr as screenPointToRay,
1407
- Pr as screenSpaceToScreenPixels,
1408
- Dr as screenTransform2DScale,
1409
- Ur as screenUnitsToPixels,
1410
- we as serializeTrackingConfig,
1411
- Cs as setMuted,
1412
- ot as shouldDrawFallback,
1413
- V as smoothNumber,
1414
- ls as smoothVector2,
1415
- us as smoothVector3,
1416
- Nr as sourceToFeed,
1417
- bs as startMusic,
1418
- As as stopMusic,
1419
- qe as subscribeCameraPermission,
1420
- Ir as swapSidedName,
1421
- Wt as toCameraRequest,
1422
- Kt as toModelOptions,
1423
- Bt as toProviderProps,
1424
- zt as toTrackerProps,
1425
- vs as toggleMuted,
1426
- Lr as trackerPointToScreenPixels,
1427
- Or as trackerToFeed,
1428
- Gr as trackerToWorld,
1429
- qr as transform2DPixelsToNormalized,
1430
- Dt as useCameraPermission,
1431
- ys as useFrameCapture,
1432
- Ss as useMediaRecorder,
1433
- xs as useMuted,
1434
- it as usePersonMaskTexture,
1435
- mt as useScreenRectAspect,
1436
- Ns as useXRAsset,
1437
- _e as useXRAssetCache,
1438
- Is as useXRAssetStats,
1439
- Xa as useXRCapabilities,
1440
- Za as useXRQuality,
1441
- Os as useXRTrackingConfig,
1442
- Br as viewportSizeToTransform2DPixels,
1443
- Wr as viewportToFeed,
1444
- zr as worldToFeed,
1445
- Kr as worldToScreenPixels,
1446
- Xr as worldToTracker
1584
+ _e as saveTrackingConfig,
1585
+ ea as screenPixelsToClient,
1586
+ ta as screenPixelsToFeed,
1587
+ ra as screenPixelsToMedia,
1588
+ sa as screenPixelsToNormalized,
1589
+ aa as screenPixelsToScreenSpace,
1590
+ na as screenPixelsToUnits,
1591
+ oa as screenPointToRay,
1592
+ ia as screenSpaceToScreenPixels,
1593
+ ca as screenTransform2DScale,
1594
+ la as screenUnitsToPixels,
1595
+ Oe as serializeTrackingConfig,
1596
+ ts as setMuted,
1597
+ ft as shouldDrawFallback,
1598
+ Z as smoothNumber,
1599
+ Dr as smoothVector2,
1600
+ Ur as smoothVector3,
1601
+ ua as sourceToFeed,
1602
+ Jr as startMusic,
1603
+ Qr as stopMusic,
1604
+ je as subscribeCameraPermission,
1605
+ da as swapSidedName,
1606
+ ur as toCameraRequest,
1607
+ mr as toModelOptions,
1608
+ lr as toProviderProps,
1609
+ dr as toTrackerProps,
1610
+ rs as toggleMuted,
1611
+ ma as trackerPointToScreenPixels,
1612
+ fa as trackerToFeed,
1613
+ pa as trackerToWorld,
1614
+ ha as transform2DPixelsToNormalized,
1615
+ tr as useCameraPermission,
1616
+ Kr as useFrameCapture,
1617
+ Hr as useMediaRecorder,
1618
+ ns as useMuted,
1619
+ mt as usePersonMaskTexture,
1620
+ rn as useSceneSample,
1621
+ St as useScreenRectAspect,
1622
+ us as useXRAsset,
1623
+ Le as useXRAssetCache,
1624
+ ds as useXRAssetStats,
1625
+ En as useXRCapabilities,
1626
+ Cn as useXRQuality,
1627
+ fs as useXRTrackingConfig,
1628
+ ga as viewportSizeToTransform2DPixels,
1629
+ ya as viewportToFeed,
1630
+ Sa as worldToFeed,
1631
+ Ma as worldToScreenPixels,
1632
+ Ta as worldToTracker
1447
1633
  };