@zeroweight/react 0.2.32 → 0.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,101 +1,98 @@
1
- import { useMemo as be, useRef as k, useState as x, useCallback as S, useEffect as h } from "react";
1
+ import { useMemo as be, useRef as k, useState as x, useCallback as S, useEffect as g } from "react";
2
2
  import { ZeroWeightRenderer as Se, ActionQueue as xe, VoiceActivityDetector as ke } from "@zeroweight/renderer";
3
- import { jsxs as w, jsx as r, Fragment as j } from "react/jsx-runtime";
4
- import { useVoiceAssistant as we, useLocalParticipant as Ae, useIsSpeaking as Te, useDataChannel as Ie, RoomAudioRenderer as Ce, LiveKitRoom as Re } from "@livekit/components-react";
3
+ import { jsxs as A, jsx as r, Fragment as j } from "react/jsx-runtime";
4
+ import { useVoiceAssistant as Ae, useLocalParticipant as we, useIsSpeaking as Te, useDataChannel as Ie, RoomAudioRenderer as Ce, LiveKitRoom as Re } from "@livekit/components-react";
5
5
  import "@livekit/components-styles";
6
6
  import { Loader2 as J, MicOff as Me, Mic as Ee, Power as Le, Activity as De } from "lucide-react";
7
- const ze = 3e4, Pe = 120, Fe = "wss://prod-project-pazuyq69.livekit.cloud", ne = "https://api.zeroweight.ai";
7
+ const ze = 3e4, Pe = 120, Fe = "wss://prod-project-pazuyq69.livekit.cloud", ne = "https://api.zeroweight.ai/api/v1";
8
8
  function Ue(v) {
9
9
  const {
10
10
  avatarId: a,
11
11
  apiKey: e = null,
12
- api: u,
13
- turnOffMicWhenAISpeaking: d = !0,
14
- livekitUrl: A = Fe,
15
- sessionDuration: p = Pe,
12
+ api: l,
13
+ turnOffMicWhenAISpeaking: u = !0,
14
+ livekitUrl: w = Fe,
15
+ sessionDuration: d = Pe,
16
16
  inactivityTimeout: C = ze
17
- } = v, D = A, y = be(() => {
18
- if (u) return u;
17
+ } = v, D = w, y = be(() => {
18
+ if (l) return l;
19
19
  const t = e ? { "X-ZW-Api-Key": e } : void 0;
20
20
  return {
21
- getBundle: async (g) => {
22
- const T = await fetch(
21
+ getBundle: async (f) => {
22
+ const m = await fetch(
23
23
  `${ne}/avatars/bundle/${encodeURIComponent(
24
- g
24
+ f
25
25
  )}`,
26
26
  { headers: t }
27
27
  );
28
- if (!T.ok)
28
+ if (!m.ok)
29
29
  throw new Error(
30
- `Failed to fetch avatar bundle (${T.status} ${T.statusText})`
30
+ `Failed to fetch avatar bundle (${m.status} ${m.statusText})`
31
31
  );
32
- return T.json();
32
+ return m.json();
33
33
  },
34
- getLiveKitToken: async (g) => {
35
- const T = new URLSearchParams({
36
- avatar_id: g,
37
- name: "anonymuous"
38
- }), c = await fetch(
39
- `${ne}/livekit/token?${T.toString()}`,
34
+ getLiveKitToken: async (f) => {
35
+ const m = await fetch(
36
+ `${ne}/livekit/getToken?avatar_id=${f}&name=anonymuous`,
40
37
  { headers: t }
41
38
  );
42
- if (!c.ok)
39
+ if (!m.ok)
43
40
  throw new Error(
44
- `Failed to fetch LiveKit token (${c.status} ${c.statusText})`
41
+ `Failed to fetch LiveKit token (${m.status} ${m.statusText})`
45
42
  );
46
- return c.json();
43
+ return m.json();
47
44
  }
48
45
  };
49
- }, [u, e]), m = k(null), E = k(null), i = k(null), l = k(null), [b, R] = x("idle"), [f, P] = x(null), [s, U] = x(
46
+ }, [l, e]), h = k(null), E = k(null), i = k(null), c = k(null), [b, R] = x("idle"), [p, P] = x(null), [s, U] = x(
50
47
  /* @__PURE__ */ new Set(["listening"])
51
48
  ), [n, o] = x({
52
49
  listening: { kind: "looped" },
53
50
  speaking: { kind: "looped" }
54
- }), [O, z] = x(!1), [F, $] = x(null), [W, K] = x(!1), [N, Z] = x(!1), [ae, V] = x(p), M = k(null), B = k(() => {
51
+ }), [O, z] = x(!1), [F, $] = x(null), [W, K] = x(!1), [N, Z] = x(!1), [ae, V] = x(d), M = k(null), B = k(() => {
55
52
  }), [oe, X] = x(!1), [se, Y] = x(0.8), L = k(null), H = b === "ready", G = S(() => {
56
- const t = m.current;
53
+ const t = h.current;
57
54
  if (!t) return null;
58
- let g = t.querySelector("canvas");
59
- return g || (g = document.createElement("canvas"), g.style.width = "100%", g.style.height = "100%", g.style.display = "block", t.appendChild(g)), E.current = g, g;
55
+ let f = t.querySelector("canvas");
56
+ return f || (f = document.createElement("canvas"), f.style.width = "100%", f.style.height = "100%", f.style.display = "block", t.appendChild(f)), E.current = f, f;
60
57
  }, []);
61
- h(() => {
58
+ g(() => {
62
59
  let t = !1;
63
60
  return (async () => {
64
- const T = G();
65
- if (!T) return;
66
- const c = new Se();
67
- i.current = c;
61
+ const m = G();
62
+ if (!m) return;
63
+ const T = new Se();
64
+ i.current = T;
68
65
  const q = new xe((I, _) => {
69
- c.play(I, _);
66
+ T.play(I, _);
70
67
  });
71
- l.current = q, c.on("stateChanged", (I) => {
68
+ c.current = q, T.on("stateChanged", (I) => {
72
69
  t || R(I);
73
- }), c.on("dimensions", (I, _) => {
70
+ }), T.on("dimensions", (I, _) => {
74
71
  t || P({ width: I, height: _ });
75
- }), c.on("actionLoaded", (I) => {
72
+ }), T.on("actionLoaded", (I) => {
76
73
  t || U((_) => {
77
74
  const te = new Set(_);
78
75
  return te.add(I), te;
79
76
  });
80
- }), c.on("allActionsLoaded", () => {
77
+ }), T.on("allActionsLoaded", () => {
81
78
  t || z(!1);
82
- }), c.on("ready", () => {
83
- t || (o(c.getActionMetadata()), q.setActionMetadata(c.getActionMetadata()));
79
+ }), T.on("ready", () => {
80
+ t || (o(T.getActionMetadata()), q.setActionMetadata(T.getActionMetadata()));
84
81
  });
85
82
  try {
86
83
  z(!0);
87
84
  const I = await y.getBundle(a);
88
- if (t || (await c.init(T, { payload: I.payload }), t)) return;
89
- o(c.getActionMetadata()), q.setActionMetadata(c.getActionMetadata());
85
+ if (t || (await T.init(m, { payload: I.payload }), t)) return;
86
+ o(T.getActionMetadata()), q.setActionMetadata(T.getActionMetadata());
90
87
  } catch (I) {
91
88
  console.error("[useAvatarSession] Init failed:", I);
92
89
  }
93
90
  })(), () => {
94
- t = !0, i.current?.destroy(), i.current = null, l.current = null;
91
+ t = !0, i.current?.destroy(), i.current = null, c.current = null;
95
92
  };
96
93
  }, [a, G, y]);
97
94
  const ee = k(!1);
98
- h(() => {
95
+ g(() => {
99
96
  H && i.current && s.has("wave_hand") && !ee.current && (i.current.play("wave_hand", "listening"), ee.current = !0);
100
97
  }, [H, s]);
101
98
  const ce = S(async () => {
@@ -110,22 +107,22 @@ function Ue(v) {
110
107
  }
111
108
  }
112
109
  }, [W, N, a, y]), Q = S(() => {
113
- M.current && (clearInterval(M.current), M.current = null), V(p), L.current && (clearTimeout(L.current), L.current = null), $(null), Z(!1), K(!1), l.current?.forceListening();
114
- }, [p]);
115
- h(() => {
110
+ M.current && (clearInterval(M.current), M.current = null), V(d), L.current && (clearTimeout(L.current), L.current = null), $(null), Z(!1), K(!1), c.current?.forceListening();
111
+ }, [d]);
112
+ g(() => {
116
113
  B.current = Q;
117
114
  }, [Q]);
118
115
  const le = S(() => {
119
116
  Z(!0), K(!1);
120
117
  }, []), ue = S(() => {
121
- M.current && clearInterval(M.current), V(p), M.current = setInterval(() => {
118
+ M.current && clearInterval(M.current), V(d), M.current = setInterval(() => {
122
119
  V((t) => t <= 1 ? (clearInterval(M.current), M.current = null, setTimeout(() => B.current(), 0), 0) : t - 1);
123
120
  }, 1e3);
124
- }, [p]), de = S((t) => {
125
- const g = Math.floor(t / 60).toString().padStart(2, "0"), T = (t % 60).toString().padStart(2, "0");
126
- return `${g}:${T}`;
121
+ }, [d]), de = S((t) => {
122
+ const f = Math.floor(t / 60).toString().padStart(2, "0"), m = (t % 60).toString().padStart(2, "0");
123
+ return `${f}:${m}`;
127
124
  }, []);
128
- h(() => () => {
125
+ g(() => () => {
129
126
  M.current && clearInterval(M.current);
130
127
  }, []);
131
128
  const pe = S(
@@ -153,11 +150,11 @@ function Ue(v) {
153
150
  i.current?.play(t, "listening");
154
151
  }, []);
155
152
  return {
156
- containerRef: m,
153
+ containerRef: h,
157
154
  renderer: i.current,
158
- actionQueue: l.current,
155
+ actionQueue: c.current,
159
156
  rendererState: b,
160
- avatarDimensions: f,
157
+ avatarDimensions: p,
161
158
  loadedActions: s,
162
159
  actionMetadata: n,
163
160
  isLoadingActions: O,
@@ -170,7 +167,7 @@ function Ue(v) {
170
167
  formatTime: de,
171
168
  micMuted: oe,
172
169
  volume: se,
173
- turnOffMicWhenAISpeaking: d,
170
+ turnOffMicWhenAISpeaking: u,
174
171
  connect: ce,
175
172
  disconnect: Q,
176
173
  toggleMic: fe,
@@ -188,7 +185,7 @@ const _e = ({
188
185
  session: v,
189
186
  style: a,
190
187
  loadingContent: e
191
- }) => /* @__PURE__ */ w(
188
+ }) => /* @__PURE__ */ A(
192
189
  "div",
193
190
  {
194
191
  style: {
@@ -238,7 +235,7 @@ const _e = ({
238
235
  backdropFilter: "blur(4px)",
239
236
  zIndex: 10
240
237
  },
241
- children: e || /* @__PURE__ */ w(
238
+ children: e || /* @__PURE__ */ A(
242
239
  "div",
243
240
  {
244
241
  style: {
@@ -313,25 +310,25 @@ const _e = ({
313
310
  }) => {
314
311
  const {
315
312
  micMuted: e,
316
- toggleMic: u,
317
- isConnected: d,
318
- isConnecting: A,
319
- isEngineReady: p,
313
+ toggleMic: l,
314
+ isConnected: u,
315
+ isConnecting: w,
316
+ isEngineReady: d,
320
317
  loadedActions: C,
321
318
  connect: D,
322
319
  disconnect: y
323
- } = v, [m, E] = x(!1), [i, l] = x(!1), b = p && C.has("listening") && C.has("speaking"), R = e ? {
320
+ } = v, [h, E] = x(!1), [i, c] = x(!1), b = d && C.has("listening") && C.has("speaking"), R = e ? {
324
321
  ...re,
325
322
  background: "rgba(239,68,68,0.1)",
326
323
  color: "#f87171",
327
324
  boxShadow: "inset 0 0 0 1px rgba(239,68,68,0.3)",
328
- ...m ? { background: "rgba(239,68,68,0.2)" } : {}
325
+ ...h ? { background: "rgba(239,68,68,0.2)" } : {}
329
326
  } : {
330
327
  ...re,
331
- background: m ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.4)",
328
+ background: h ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.4)",
332
329
  color: "#fff",
333
330
  boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.1)"
334
- }, f = d ? {
331
+ }, p = u ? {
335
332
  ...ie,
336
333
  background: i ? "rgba(239,68,68,0.22)" : "rgba(239,68,68,0.14)",
337
334
  boxShadow: "inset 0 0 0 1px rgba(239,68,68,0.5), 0 0 20px rgba(239,68,68,0.2)"
@@ -341,7 +338,7 @@ const _e = ({
341
338
  boxShadow: "0 0 30px rgba(236,72,153,0.3)",
342
339
  opacity: i ? 0.9 : 1
343
340
  };
344
- return (A || !b) && (f.opacity = 0.5, f.cursor = "not-allowed"), /* @__PURE__ */ w(
341
+ return (w || !b) && (p.opacity = 0.5, p.cursor = "not-allowed"), /* @__PURE__ */ A(
345
342
  "div",
346
343
  {
347
344
  style: {
@@ -361,7 +358,7 @@ const _e = ({
361
358
  to { transform: rotate(360deg); }
362
359
  }
363
360
  ` }),
364
- /* @__PURE__ */ w(
361
+ /* @__PURE__ */ A(
365
362
  "div",
366
363
  {
367
364
  style: {
@@ -378,7 +375,7 @@ const _e = ({
378
375
  "button",
379
376
  {
380
377
  type: "button",
381
- onClick: u,
378
+ onClick: l,
382
379
  onMouseEnter: () => E(!0),
383
380
  onMouseLeave: () => E(!1),
384
381
  style: R,
@@ -390,21 +387,21 @@ const _e = ({
390
387
  "button",
391
388
  {
392
389
  type: "button",
393
- onClick: d ? y : D,
394
- onMouseEnter: () => l(!0),
395
- onMouseLeave: () => l(!1),
396
- disabled: !d && (A || !b),
397
- style: f,
398
- children: A ? /* @__PURE__ */ w(j, { children: [
390
+ onClick: u ? y : D,
391
+ onMouseEnter: () => c(!0),
392
+ onMouseLeave: () => c(!1),
393
+ disabled: !u && (w || !b),
394
+ style: p,
395
+ children: w ? /* @__PURE__ */ A(j, { children: [
399
396
  /* @__PURE__ */ r(J, { size: 20, style: { animation: "zwr-spin 1s linear infinite" } }),
400
397
  /* @__PURE__ */ r("span", { children: "Connecting..." })
401
- ] }) : !d && !b ? /* @__PURE__ */ w(j, { children: [
398
+ ] }) : !u && !b ? /* @__PURE__ */ A(j, { children: [
402
399
  /* @__PURE__ */ r(J, { size: 20, style: { animation: "zwr-spin 1s linear infinite" } }),
403
400
  /* @__PURE__ */ r("span", { children: "Loading Avatar..." })
404
- ] }) : d ? /* @__PURE__ */ w(j, { children: [
401
+ ] }) : u ? /* @__PURE__ */ A(j, { children: [
405
402
  /* @__PURE__ */ r(Le, { size: 20 }),
406
403
  /* @__PURE__ */ r("span", { children: "End Session" })
407
- ] }) : /* @__PURE__ */ w(j, { children: [
404
+ ] }) : /* @__PURE__ */ A(j, { children: [
408
405
  /* @__PURE__ */ r(De, { size: 20 }),
409
406
  /* @__PURE__ */ r("span", { children: "Start Session" })
410
407
  ] })
@@ -419,7 +416,7 @@ const _e = ({
419
416
  }, Oe = ({
420
417
  session: v
421
418
  }) => {
422
- const { isConnected: a, timeRemaining: e, formatTime: u } = v, d = a && e <= 30, A = a && e > 30 && e <= 60, p = {
419
+ const { isConnected: a, timeRemaining: e, formatTime: l } = v, u = a && e <= 30, w = a && e > 30 && e <= 60, d = {
423
420
  display: "flex",
424
421
  alignItems: "center",
425
422
  gap: 8,
@@ -429,12 +426,12 @@ const _e = ({
429
426
  border: "1px solid",
430
427
  pointerEvents: "auto",
431
428
  transition: "all 0.3s",
432
- ...d ? {
429
+ ...u ? {
433
430
  background: "rgba(239,68,68,0.3)",
434
431
  borderColor: "rgba(239,68,68,0.4)",
435
432
  boxShadow: "0 0 15px rgba(239,68,68,0.3)",
436
433
  animation: "zwr-pulse 2s ease-in-out infinite"
437
- } : A ? {
434
+ } : w ? {
438
435
  background: "rgba(249,115,22,0.2)",
439
436
  borderColor: "rgba(249,115,22,0.3)",
440
437
  boxShadow: "0 4px 12px rgba(0,0,0,0.3)"
@@ -444,14 +441,14 @@ const _e = ({
444
441
  boxShadow: "0 4px 12px rgba(0,0,0,0.3)"
445
442
  }
446
443
  };
447
- return /* @__PURE__ */ w(j, { children: [
444
+ return /* @__PURE__ */ A(j, { children: [
448
445
  /* @__PURE__ */ r("style", { children: `
449
446
  @keyframes zwr-pulse {
450
447
  0%, 100% { opacity: 1; }
451
448
  50% { opacity: 0.5; }
452
449
  }
453
450
  ` }),
454
- /* @__PURE__ */ w("div", { style: p, children: [
451
+ /* @__PURE__ */ A("div", { style: d, children: [
455
452
  /* @__PURE__ */ r(
456
453
  "div",
457
454
  {
@@ -478,7 +475,7 @@ const _e = ({
478
475
  color: "rgba(255,255,255,0.7)",
479
476
  textTransform: "uppercase"
480
477
  },
481
- children: a ? `Online ${u(e)}` : "Offline"
478
+ children: a ? `Online ${l(e)}` : "Offline"
482
479
  }
483
480
  )
484
481
  ] })
@@ -489,16 +486,16 @@ const _e = ({
489
486
  const {
490
487
  renderer: a,
491
488
  actionQueue: e,
492
- micMuted: u,
493
- volume: d,
494
- setInactivityActive: A,
495
- loadedActions: p,
489
+ micMuted: l,
490
+ volume: u,
491
+ setInactivityActive: w,
492
+ loadedActions: d,
496
493
  token: C,
497
494
  isConnected: D
498
- } = v, { turnOffMicWhenAISpeaking: y, setMicMuted: m } = v, E = k(!1), { state: i, audioTrack: l } = we(), b = Ae(), R = Te(b.localParticipant), f = k(null), P = k(p);
499
- h(() => {
500
- P.current = p;
501
- }, [p]), h(() => {
495
+ } = v, { turnOffMicWhenAISpeaking: y, setMicMuted: h } = v, E = k(!1), { state: i, audioTrack: c } = Ae(), b = we(), R = Te(b.localParticipant), p = k(null), P = k(d);
496
+ g(() => {
497
+ P.current = d;
498
+ }, [d]), g(() => {
502
499
  const n = b.localParticipant;
503
500
  if (!a || !n) return;
504
501
  const o = new TextEncoder();
@@ -515,7 +512,7 @@ const _e = ({
515
512
  console.error("[LiveKitAvatarProvider] Failed to publish action completion:", $);
516
513
  });
517
514
  });
518
- }, [a, b.localParticipant]), h(() => {
515
+ }, [a, b.localParticipant]), g(() => {
519
516
  if (!e) return;
520
517
  const n = new ke({
521
518
  threshold: 8e-3,
@@ -524,50 +521,50 @@ const _e = ({
524
521
  speechPauseFrames: 30,
525
522
  turnEndFrames: 50
526
523
  });
527
- return f.current = n, n.on("speechStart", () => {
524
+ return p.current = n, n.on("speechStart", () => {
528
525
  e.setTurnActive(!0), e.setSpeechState("speaking");
529
526
  }), n.on("turnEnd", () => {
530
527
  e.setTurnActive(!1);
531
528
  }), () => {
532
- n.stop(), f.current = null;
529
+ n.stop(), p.current = null;
533
530
  };
534
- }, [e]), h(() => {
535
- const n = f.current;
531
+ }, [e]), g(() => {
532
+ const n = p.current;
536
533
  if (n)
537
- if (l?.publication?.track) {
538
- const o = l.publication.track.mediaStreamTrack;
534
+ if (c?.publication?.track) {
535
+ const o = c.publication.track.mediaStreamTrack;
539
536
  o && n.start(o);
540
537
  } else
541
538
  n.stop();
542
- }, [l?.publication?.track]);
539
+ }, [c?.publication?.track]);
543
540
  const s = k(null), U = k(!1);
544
- return h(() => {
541
+ return g(() => {
545
542
  if (!e) return;
546
543
  const n = i;
547
544
  if (!C || !D || n === "disconnected") {
548
- s.current && (clearTimeout(s.current), s.current = null), f.current?.endTurn(), e.forceListening();
545
+ s.current && (clearTimeout(s.current), s.current = null), p.current?.endTurn(), e.forceListening();
549
546
  return;
550
547
  }
551
- n === "speaking" ? (s.current && (clearTimeout(s.current), s.current = null), e.setTurnActive(!0), e.setSpeechState("speaking")) : n === "listening" || n === "idle" ? (s.current && (clearTimeout(s.current), s.current = null), f.current?.endTurn(), e.setTurnActive(!1)) : n === "thinking" && (s.current || (s.current = setTimeout(() => {
552
- s.current = null, f.current?.endTurn(), e.setTurnActive(!1);
548
+ n === "speaking" ? (s.current && (clearTimeout(s.current), s.current = null), e.setTurnActive(!0), e.setSpeechState("speaking")) : n === "listening" || n === "idle" ? (s.current && (clearTimeout(s.current), s.current = null), p.current?.endTurn(), e.setTurnActive(!1)) : n === "thinking" && (s.current || (s.current = setTimeout(() => {
549
+ s.current = null, p.current?.endTurn(), e.setTurnActive(!1);
553
550
  }, 500)));
554
- }, [e, D, i, C]), h(() => {
551
+ }, [e, D, i, C]), g(() => {
555
552
  const n = i === "speaking";
556
553
  if (!y) {
557
554
  U.current = n;
558
555
  return;
559
556
  }
560
557
  const o = U.current;
561
- !o && n ? u || m(!0) : o && !n && u && m(!1), U.current = n;
562
- }, [u, m, i, y]), h(() => {
558
+ !o && n ? l || h(!0) : o && !n && l && h(!1), U.current = n;
559
+ }, [l, h, i, y]), g(() => {
563
560
  if (!y || !e) return;
564
561
  const n = (o) => {
565
- o || m(!1);
562
+ o || h(!1);
566
563
  };
567
564
  return e.on("turnChanged", n), () => {
568
565
  e.off("turnChanged", n);
569
566
  };
570
- }, [e, m, y]), h(() => () => {
567
+ }, [e, h, y]), g(() => () => {
571
568
  s.current && clearTimeout(s.current);
572
569
  }, []), Ie((n) => {
573
570
  try {
@@ -581,48 +578,48 @@ const _e = ({
581
578
  } catch (o) {
582
579
  console.error("[LiveKitAvatarProvider] Failed to parse data message:", o);
583
580
  }
584
- }), h(() => {
585
- A(!(i === "speaking") && !R);
586
- }, [R, A, i]), h(() => {
581
+ }), g(() => {
582
+ w(!(i === "speaking") && !R);
583
+ }, [R, w, i]), g(() => {
587
584
  if (!e) return;
588
- const n = !!l;
589
- (!n || i === "disconnected") && (f.current?.endTurn(), e.forceListening()), E.current = n;
590
- }, [l, i, e]), h(() => {
585
+ const n = !!c;
586
+ (!n || i === "disconnected") && (p.current?.endTurn(), e.forceListening()), E.current = n;
587
+ }, [c, i, e]), g(() => {
591
588
  const n = b.localParticipant;
592
- n && n.setMicrophoneEnabled(!u).catch((o) => {
589
+ n && n.setMicrophoneEnabled(!l).catch((o) => {
593
590
  console.error("[LiveKitAvatarProvider] Failed to set mic state:", o);
594
591
  });
595
- }, [u, b.localParticipant]), /* @__PURE__ */ r("div", { style: { position: "absolute", bottom: 80, left: 8, right: 8, display: "flex", flexDirection: "column", gap: 8 }, children: /* @__PURE__ */ r(Ce, { volume: d }) });
592
+ }, [l, b.localParticipant]), /* @__PURE__ */ r("div", { style: { position: "absolute", bottom: 80, left: 8, right: 8, display: "flex", flexDirection: "column", gap: 8 }, children: /* @__PURE__ */ r(Ce, { volume: u }) });
596
593
  }, Qe = ({
597
594
  avatarId: v,
598
595
  apiKey: a,
599
596
  api: e,
600
- turnOffMicWhenAISpeaking: u,
601
- livekitUrl: d,
602
- sessionDuration: A,
603
- inactivityTimeout: p,
597
+ turnOffMicWhenAISpeaking: l,
598
+ livekitUrl: u,
599
+ sessionDuration: w,
600
+ inactivityTimeout: d,
604
601
  style: C,
605
602
  className: D,
606
603
  loadingContent: y,
607
- customControls: m,
604
+ customControls: h,
608
605
  customStatusBadge: E
609
606
  }) => {
610
607
  const i = Ue({
611
608
  avatarId: v,
612
609
  apiKey: a,
613
610
  api: e,
614
- turnOffMicWhenAISpeaking: u,
615
- livekitUrl: d,
616
- sessionDuration: A,
617
- inactivityTimeout: p
611
+ turnOffMicWhenAISpeaking: l,
612
+ livekitUrl: u,
613
+ sessionDuration: w,
614
+ inactivityTimeout: d
618
615
  }), {
619
- token: l,
616
+ token: c,
620
617
  isConnected: b,
621
618
  avatarDimensions: R,
622
- disconnect: f,
619
+ disconnect: p,
623
620
  startSessionTimer: P
624
621
  } = i;
625
- return /* @__PURE__ */ w(
622
+ return /* @__PURE__ */ A(
626
623
  "section",
627
624
  {
628
625
  className: D,
@@ -644,7 +641,7 @@ const _e = ({
644
641
  },
645
642
  children: [
646
643
  /* @__PURE__ */ r(_e, { session: i, loadingContent: y }),
647
- /* @__PURE__ */ w(
644
+ /* @__PURE__ */ A(
648
645
  "div",
649
646
  {
650
647
  style: {
@@ -658,7 +655,7 @@ const _e = ({
658
655
  padding: 16
659
656
  },
660
657
  children: [
661
- /* @__PURE__ */ w(
658
+ /* @__PURE__ */ A(
662
659
  "div",
663
660
  {
664
661
  style: {
@@ -673,22 +670,22 @@ const _e = ({
673
670
  ]
674
671
  }
675
672
  ),
676
- m ? m(i) : /* @__PURE__ */ r(je, { session: i })
673
+ h ? h(i) : /* @__PURE__ */ r(je, { session: i })
677
674
  ]
678
675
  }
679
676
  ),
680
- /* @__PURE__ */ r("div", { style: { display: "none" }, children: l && d && /* @__PURE__ */ r(
677
+ /* @__PURE__ */ r("div", { style: { display: "none" }, children: c && u && /* @__PURE__ */ r(
681
678
  Re,
682
679
  {
683
- serverUrl: d,
684
- token: l,
680
+ serverUrl: u,
681
+ token: c,
685
682
  connect: !0,
686
683
  video: !1,
687
684
  audio: !0,
688
685
  onConnected: () => {
689
686
  i.markConnected(), P();
690
687
  },
691
- onDisconnected: f,
688
+ onDisconnected: p,
692
689
  children: /* @__PURE__ */ r($e, { session: i })
693
690
  }
694
691
  ) })