@livelayer/react 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs as w, jsx as n, Fragment as Pe } from "react/jsx-runtime";
3
- import { Component as Un, useState as E, useRef as N, useEffect as I, useCallback as C, useMemo as Ge, useLayoutEffect as wn, forwardRef as Dt, useImperativeHandle as jn, createElement as Vn } from "react";
2
+ import { jsxs as w, jsx as n, Fragment as $e } from "react/jsx-runtime";
3
+ import { Component as Vn, useState as E, useRef as N, useEffect as R, useCallback as C, useMemo as Xe, useLayoutEffect as xn, forwardRef as Dt, useImperativeHandle as Yn, createElement as Gn } from "react";
4
4
  import { createPortal as Pt } from "react-dom";
5
- import { LiveKitSession as Yn, registerFields as Gn } from "@livelayer/sdk";
6
- import { clearFieldRegistry as Do, getRegisteredFields as Po, registerFields as $o, setFieldValue as zo } from "@livelayer/sdk";
7
- import { createLocalAudioTrack as Jn, Track as _n, createLocalVideoTrack as Kn } from "livekit-client";
8
- class Xn extends Un {
5
+ import { LiveKitSession as Kn, registerFields as Jn } from "@livelayer/sdk";
6
+ import { clearFieldRegistry as Oo, getRegisteredFields as Ho, registerFields as Bo, setFieldValue as Wo } from "@livelayer/sdk";
7
+ import { createLocalAudioTrack as Xn, Track as kn, createLocalVideoTrack as Qn } from "livekit-client";
8
+ class Zn extends Vn {
9
9
  constructor() {
10
10
  super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
11
11
  this.setState({ hasError: !1, error: null });
@@ -15,8 +15,8 @@ class Xn extends Un {
15
15
  return { hasError: !0, error: t };
16
16
  }
17
17
  componentDidCatch(t, r) {
18
- var o, i;
19
- (i = (o = this.props).onError) == null || i.call(o, t, r);
18
+ var o, l;
19
+ (l = (o = this.props).onError) == null || l.call(o, t, r);
20
20
  }
21
21
  render() {
22
22
  var t;
@@ -35,14 +35,14 @@ class Xn extends Un {
35
35
  ] }) : this.props.children;
36
36
  }
37
37
  }
38
- function Qn(e) {
39
- const [t, r] = E("idle"), [o, i] = E("idle"), [l, s] = E([]), [a, c] = E(null), [p, v] = E(null), [f, u] = E(null), [R, L] = E(!1), [_, h] = E(null), b = N(null), S = N(e.onDataMessage);
40
- S.current = e.onDataMessage, I(() => {
38
+ function er(e) {
39
+ const [t, r] = E("idle"), [o, l] = E("idle"), [i, s] = E([]), [a, c] = E(null), [p, v] = E(null), [f, u] = E(null), [I, L] = E(!1), [_, h] = E(null), b = N(null), S = N(e.onDataMessage);
40
+ S.current = e.onDataMessage, R(() => {
41
41
  const g = {
42
42
  onConnectionStateChange: (H) => {
43
43
  r(H), H === "connected" && h(null);
44
44
  },
45
- onAgentStateChange: i,
45
+ onAgentStateChange: l,
46
46
  onTranscript: (H) => s([...H]),
47
47
  onAgentConfig: c,
48
48
  onAudioTrack: (H) => u(H),
@@ -50,11 +50,11 @@ function Qn(e) {
50
50
  onVideoTrackRemoved: () => v(null),
51
51
  onError: (H) => h(H),
52
52
  onDataMessage: (H) => {
53
- var q;
54
- (q = S.current) == null || q.call(S, H);
53
+ var F;
54
+ (F = S.current) == null || F.call(S, H);
55
55
  },
56
56
  onResumabilityChange: L
57
- }, P = new Yn(
57
+ }, P = new Kn(
58
58
  {
59
59
  agentId: e.agentId,
60
60
  baseUrl: e.baseUrl,
@@ -64,7 +64,7 @@ function Qn(e) {
64
64
  },
65
65
  g
66
66
  );
67
- return b.current = P, r("idle"), i("idle"), s([]), c(null), v(null), u(null), L(!1), h(null), () => {
67
+ return b.current = P, r("idle"), l("idle"), s([]), c(null), v(null), u(null), L(!1), h(null), () => {
68
68
  var H;
69
69
  (H = P.destroy) == null || H.call(P), b.current = null;
70
70
  };
@@ -86,41 +86,41 @@ function Qn(e) {
86
86
  }, []), A = C(() => {
87
87
  const g = b.current;
88
88
  g && g.disconnect();
89
- }, []), F = C(() => {
89
+ }, []), q = C(() => {
90
90
  var g;
91
91
  return ((g = b.current) == null ? void 0 : g.getRoom()) ?? null;
92
92
  }, []);
93
93
  return {
94
94
  connectionState: t,
95
95
  agentState: o,
96
- transcript: l,
96
+ transcript: i,
97
97
  agentConfig: a,
98
98
  videoElement: p,
99
99
  audioElement: f,
100
- canResume: R,
100
+ canResume: I,
101
101
  error: _,
102
102
  connect: T,
103
103
  disconnect: A,
104
- getRoom: F,
104
+ getRoom: q,
105
105
  session: b.current
106
106
  };
107
107
  }
108
- function Zn() {
109
- const e = N(null), t = N(null), r = N(null), o = N(null), i = N(/* @__PURE__ */ new Set()), l = N(null), s = C(() => {
108
+ function tr() {
109
+ const e = N(null), t = N(null), r = N(null), o = N(null), l = N(/* @__PURE__ */ new Set()), i = N(null), s = C(() => {
110
110
  const f = t.current;
111
111
  if (!f) {
112
112
  o.current = null;
113
113
  return;
114
114
  }
115
- (!l.current || l.current.length !== f.frequencyBinCount) && (l.current = new Uint8Array(
115
+ (!i.current || i.current.length !== f.frequencyBinCount) && (i.current = new Uint8Array(
116
116
  new ArrayBuffer(f.frequencyBinCount)
117
117
  ));
118
- const u = l.current;
118
+ const u = i.current;
119
119
  f.getByteFrequencyData(u);
120
- let R = 0;
121
- for (let _ = 0; _ < u.length; _++) R += u[_];
122
- const L = R / u.length / 255;
123
- for (const _ of i.current)
120
+ let I = 0;
121
+ for (let _ = 0; _ < u.length; _++) I += u[_];
122
+ const L = I / u.length / 255;
123
+ for (const _ of l.current)
124
124
  try {
125
125
  _(L);
126
126
  } catch (h) {
@@ -160,10 +160,10 @@ function Zn() {
160
160
  }
161
161
  r.current = null;
162
162
  }
163
- }, []), v = C((f) => (i.current.add(f), () => {
164
- i.current.delete(f);
163
+ }, []), v = C((f) => (l.current.add(f), () => {
164
+ l.current.delete(f);
165
165
  }), []);
166
- return I(() => () => {
166
+ return R(() => () => {
167
167
  if (p(), t.current) {
168
168
  try {
169
169
  t.current.disconnect();
@@ -178,11 +178,11 @@ function Zn() {
178
178
  }
179
179
  e.current = null;
180
180
  }
181
- i.current.clear(), l.current = null;
181
+ l.current.clear(), i.current = null;
182
182
  }, [p]), { attach: c, detach: p, subscribe: v };
183
183
  }
184
- function er() {
185
- const [e, t] = E(!1), [r, o] = E(""), [i, l] = E(null), s = N(null), a = N(null), c = C(async (L) => {
184
+ function nr() {
185
+ const [e, t] = E(!1), [r, o] = E(""), [l, i] = E(null), s = N(null), a = N(null), c = C(async (L) => {
186
186
  var _, h;
187
187
  if (s.current && a.current) {
188
188
  try {
@@ -191,9 +191,9 @@ function er() {
191
191
  }
192
192
  s.current.stop(), s.current = null;
193
193
  }
194
- a.current = L, l(null);
194
+ a.current = L, i(null);
195
195
  try {
196
- const b = await Jn({
196
+ const b = await Xn({
197
197
  echoCancellation: !0,
198
198
  noiseSuppression: !0
199
199
  });
@@ -202,7 +202,7 @@ function er() {
202
202
  S != null && S.deviceId && o(S.deviceId);
203
203
  } catch (b) {
204
204
  const S = b instanceof Error && b.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
205
- throw l(S), b;
205
+ throw i(S), b;
206
206
  }
207
207
  }, []), p = C((L) => {
208
208
  a.current = L;
@@ -232,28 +232,28 @@ function er() {
232
232
  L.stop();
233
233
  }
234
234
  s.current = null, a.current = null, t(!1), o("");
235
- }, []), R = C(() => l(null), []);
235
+ }, []), I = C(() => i(null), []);
236
236
  return {
237
237
  isMuted: e,
238
238
  activeDeviceId: r,
239
- micError: i,
239
+ micError: l,
240
240
  toggleMute: f,
241
241
  setupMic: c,
242
242
  attachRoom: p,
243
243
  switchDevice: v,
244
244
  teardownMic: u,
245
- clearError: R
245
+ clearError: I
246
246
  };
247
247
  }
248
- const tr = { resolution: { width: 640, height: 480, frameRate: 24 } };
249
- function nr() {
250
- const [e, t] = E(!1), [r, o] = E(null), [i, l] = E(null), [s, a] = E(""), c = N(null), p = N(null), v = C((b) => {
248
+ const rr = { resolution: { width: 640, height: 480, frameRate: 24 } };
249
+ function or() {
250
+ const [e, t] = E(!1), [r, o] = E(null), [l, i] = E(null), [s, a] = E(""), c = N(null), p = N(null), v = C((b) => {
251
251
  c.current = b;
252
252
  }, []), f = C(() => {
253
253
  var T;
254
254
  const b = c.current, S = p.current;
255
255
  if (S && b) {
256
- const A = b.localParticipant.getTrackPublication(_n.Source.Camera), g = (A == null ? void 0 : A.track) ?? S;
256
+ const A = b.localParticipant.getTrackPublication(kn.Source.Camera), g = (A == null ? void 0 : A.track) ?? S;
257
257
  try {
258
258
  b.localParticipant.unpublishTrack(g);
259
259
  } catch {
@@ -263,18 +263,18 @@ function nr() {
263
263
  } catch {
264
264
  }
265
265
  }
266
- p.current = null, l(null), t(!1);
266
+ p.current = null, i(null), t(!1);
267
267
  }, []), u = C(async (b) => {
268
268
  const S = c.current;
269
269
  if (S) {
270
270
  o(null);
271
271
  try {
272
- const T = { ...tr };
272
+ const T = { ...rr };
273
273
  b && (T.deviceId = b);
274
- const A = await Kn(T);
274
+ const A = await Qn(T);
275
275
  await S.localParticipant.publishTrack(A), p.current = A;
276
- const F = A.attach();
277
- l(F), t(!0), b && a(b);
276
+ const q = A.attach();
277
+ i(q), t(!0), b && a(b);
278
278
  try {
279
279
  S.localParticipant.publishData(
280
280
  new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
@@ -287,31 +287,31 @@ function nr() {
287
287
  o(A);
288
288
  }
289
289
  }
290
- }, []), R = C(async () => {
290
+ }, []), I = C(async () => {
291
291
  e ? f() : await u(s || void 0);
292
292
  }, [e, s, f, u]), L = C(async (b) => {
293
293
  f(), await u(b);
294
294
  }, [f, u]), _ = C(() => {
295
295
  f(), c.current = null, o(null), a("");
296
296
  }, [f]), h = C(() => o(null), []);
297
- return I(() => () => {
297
+ return R(() => () => {
298
298
  p.current && p.current.stop();
299
299
  }, []), {
300
300
  isEnabled: e,
301
301
  error: r,
302
- previewEl: i,
302
+ previewEl: l,
303
303
  activeDeviceId: s,
304
- toggle: R,
304
+ toggle: I,
305
305
  switchDevice: L,
306
306
  attachRoom: v,
307
307
  teardown: _,
308
308
  clearError: h
309
309
  };
310
310
  }
311
- function rr() {
312
- const [e, t] = E(!1), [r, o] = E(null), [i, l] = E(null), s = N(null), a = C((u) => {
311
+ function ir() {
312
+ const [e, t] = E(!1), [r, o] = E(null), [l, i] = E(null), s = N(null), a = C((u) => {
313
313
  s.current = u;
314
- }, []), c = C(() => l(null), []), p = C(async () => {
314
+ }, []), c = C(() => i(null), []), p = C(async () => {
315
315
  const u = s.current;
316
316
  if (u) {
317
317
  if (e) {
@@ -325,12 +325,12 @@ function rr() {
325
325
  o(null);
326
326
  try {
327
327
  await u.localParticipant.setScreenShareEnabled(!0);
328
- let R = 0;
328
+ let I = 0;
329
329
  const L = () => {
330
- const _ = u.localParticipant.getTrackPublication(_n.Source.ScreenShare);
330
+ const _ = u.localParticipant.getTrackPublication(kn.Source.ScreenShare);
331
331
  if (_ != null && _.track) {
332
332
  const h = _.track.attach();
333
- l(h), t(!0);
333
+ i(h), t(!0);
334
334
  try {
335
335
  u.localParticipant.publishData(
336
336
  new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
@@ -340,11 +340,11 @@ function rr() {
340
340
  }
341
341
  return;
342
342
  }
343
- R++ < 10 ? setTimeout(L, 100) : t(!0);
343
+ I++ < 10 ? setTimeout(L, 100) : t(!0);
344
344
  };
345
345
  L();
346
- } catch (R) {
347
- const L = R instanceof Error ? R.name : "";
346
+ } catch (I) {
347
+ const L = I instanceof Error ? I.name : "";
348
348
  L !== "NotAllowedError" && L !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
349
349
  }
350
350
  }
@@ -357,26 +357,26 @@ function rr() {
357
357
  }
358
358
  c(), t(!1), o(null), s.current = null;
359
359
  }, [e, c]), f = C(() => o(null), []);
360
- return { isEnabled: e, error: r, previewEl: i, toggle: p, attachRoom: a, teardown: v, clearError: f };
360
+ return { isEnabled: e, error: r, previewEl: l, toggle: p, attachRoom: a, teardown: v, clearError: f };
361
361
  }
362
- function or() {
363
- const [e, t] = E([]), [r, o] = E([]), i = C(async () => {
362
+ function lr() {
363
+ const [e, t] = E([]), [r, o] = E([]), l = C(async () => {
364
364
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
365
365
  try {
366
- const l = await navigator.mediaDevices.enumerateDevices();
367
- t(l.filter((s) => s.kind === "audioinput")), o(l.filter((s) => s.kind === "videoinput"));
366
+ const i = await navigator.mediaDevices.enumerateDevices();
367
+ t(i.filter((s) => s.kind === "audioinput")), o(i.filter((s) => s.kind === "videoinput"));
368
368
  } catch {
369
369
  }
370
370
  }, []);
371
- return I(() => {
372
- if (i(), typeof navigator > "u" || !navigator.mediaDevices) return;
373
- const l = () => void i();
374
- return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
375
- }, [i]), { mics: e, cameras: r, refresh: i };
376
- }
377
- function ir(e, t, r = !1) {
378
- const [o, i] = E(null), [l, s] = E(null), [a, c] = E(!r && !!e);
379
- return I(() => {
371
+ return R(() => {
372
+ if (l(), typeof navigator > "u" || !navigator.mediaDevices) return;
373
+ const i = () => void l();
374
+ return navigator.mediaDevices.addEventListener("devicechange", i), () => navigator.mediaDevices.removeEventListener("devicechange", i);
375
+ }, [l]), { mics: e, cameras: r, refresh: l };
376
+ }
377
+ function ar(e, t, r = !1) {
378
+ const [o, l] = E(null), [i, s] = E(null), [a, c] = E(!r && !!e);
379
+ return R(() => {
380
380
  if (r || !e) {
381
381
  c(!1);
382
382
  return;
@@ -391,13 +391,13 @@ function ir(e, t, r = !1) {
391
391
  }
392
392
  return f.json();
393
393
  }).then((f) => {
394
- p.signal.aborted || (i(f), c(!1));
394
+ p.signal.aborted || (l(f), c(!1));
395
395
  }).catch((f) => {
396
396
  p.signal.aborted || (s(f instanceof Error ? f.message : "Agent lookup failed"), c(!1));
397
397
  }), () => p.abort();
398
- }, [e, t, r]), { info: o, error: l, loading: a };
398
+ }, [e, t, r]), { info: o, error: i, loading: a };
399
399
  }
400
- function lr(e) {
400
+ function sr(e) {
401
401
  if (typeof window > "u") return null;
402
402
  try {
403
403
  return window.localStorage.getItem(e);
@@ -405,68 +405,68 @@ function lr(e) {
405
405
  return null;
406
406
  }
407
407
  }
408
- function ar(e, t) {
408
+ function cr(e, t) {
409
409
  if (!(typeof window > "u"))
410
410
  try {
411
411
  window.localStorage.setItem(e, t);
412
412
  } catch {
413
413
  }
414
414
  }
415
- function sr({
415
+ function dr({
416
416
  value: e,
417
417
  defaultValue: t = "expanded",
418
418
  onChange: r
419
419
  } = {}) {
420
- const o = e !== void 0, [i, l] = E(t), s = o ? e : i, a = C(
420
+ const o = e !== void 0, [l, i] = E(t), s = o ? e : l, a = C(
421
421
  (c) => {
422
- c !== s && (o || l(c), r == null || r(c));
422
+ c !== s && (o || i(c), r == null || r(c));
423
423
  },
424
424
  [s, o, r]
425
425
  );
426
426
  return [s, a];
427
427
  }
428
- const cr = ["hidden", "minimized", "expanded"];
429
- function dr(e) {
430
- return e && cr.includes(e) ? e : null;
428
+ const ur = ["hidden", "minimized", "expanded"];
429
+ function fr(e) {
430
+ return e && ur.includes(e) ? e : null;
431
431
  }
432
- function ur({
432
+ function pr({
433
433
  value: e,
434
434
  defaultValue: t = "expanded",
435
435
  onChange: r,
436
436
  persistKey: o = "ll-widget",
437
- disablePersistence: i = !1
437
+ disablePersistence: l = !1
438
438
  } = {}) {
439
- const l = `${o}:display-mode`, s = N(!1), [a, c] = sr({
439
+ const i = `${o}:display-mode`, s = N(!1), [a, c] = dr({
440
440
  value: e,
441
441
  defaultValue: t,
442
442
  onChange: (p) => {
443
- e === void 0 && !i && ar(l, p), r == null || r(p);
443
+ e === void 0 && !l && cr(i, p), r == null || r(p);
444
444
  }
445
445
  });
446
- return I(() => {
447
- if (s.current || (s.current = !0, i || e !== void 0)) return;
448
- const p = dr(lr(l));
446
+ return R(() => {
447
+ if (s.current || (s.current = !0, l || e !== void 0)) return;
448
+ const p = fr(sr(i));
449
449
  p && p !== a && c(p);
450
450
  }, []), [a, c];
451
451
  }
452
- const fr = 640;
453
- function pr(e = fr) {
452
+ const hr = 640;
453
+ function mr(e = hr) {
454
454
  const [t, r] = E(!1);
455
- return I(() => {
455
+ return R(() => {
456
456
  if (e === !1) {
457
457
  r(!1);
458
458
  return;
459
459
  }
460
460
  if (typeof window > "u" || typeof window.matchMedia > "u")
461
461
  return;
462
- const o = `(max-width: ${e - 1}px)`, i = window.matchMedia(o), l = () => r(i.matches);
463
- return l(), typeof i.addEventListener == "function" ? (i.addEventListener("change", l), () => i.removeEventListener("change", l)) : (i.addListener(l), () => {
464
- i.removeListener(l);
462
+ const o = `(max-width: ${e - 1}px)`, l = window.matchMedia(o), i = () => r(l.matches);
463
+ return i(), typeof l.addEventListener == "function" ? (l.addEventListener("change", i), () => l.removeEventListener("change", i)) : (l.addListener(i), () => {
464
+ l.removeListener(i);
465
465
  });
466
466
  }, [e]), t;
467
467
  }
468
468
  const en = "__llHistoryPatched", _t = "ll:pathname";
469
- function hr() {
469
+ function gr() {
470
470
  if (typeof window > "u" || window.history[en]) return;
471
471
  const e = window.history.pushState, t = window.history.replaceState;
472
472
  window.history.pushState = function(...r) {
@@ -480,60 +480,60 @@ function hr() {
480
480
  function tn() {
481
481
  return typeof window > "u" ? "/" : window.location.pathname || "/";
482
482
  }
483
- function mr(e) {
483
+ function yr(e) {
484
484
  const [t, r] = E(
485
485
  () => e ?? tn()
486
486
  );
487
- return I(() => {
487
+ return R(() => {
488
488
  if (e !== void 0) return;
489
- hr();
489
+ gr();
490
490
  const o = () => r(tn());
491
491
  return o(), window.addEventListener("popstate", o), window.addEventListener(_t, o), () => {
492
492
  window.removeEventListener("popstate", o), window.removeEventListener(_t, o);
493
493
  };
494
494
  }, [e]), e ?? t;
495
495
  }
496
- const nn = /* @__PURE__ */ new Map(), gr = /[\\^$+?.()|{}[\]]/g;
497
- function yr(e) {
498
- return e.replace(gr, "\\$&");
496
+ const nn = /* @__PURE__ */ new Map(), vr = /[\\^$+?.()|{}[\]]/g;
497
+ function br(e) {
498
+ return e.replace(vr, "\\$&");
499
499
  }
500
- function vr(e) {
500
+ function wr(e) {
501
501
  const t = nn.get(e);
502
502
  if (t) return t;
503
- const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", i = "", l = r.replace(/\*\*/g, o).replace(/\*/g, i), a = yr(l).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(i, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
503
+ const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", l = "", i = r.replace(/\*\*/g, o).replace(/\*/g, l), a = br(i).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
504
504
  return nn.set(e, c), c;
505
505
  }
506
- function br(e, t) {
506
+ function _r(e, t) {
507
507
  const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
508
- return vr(e).test(r);
508
+ return wr(e).test(r);
509
509
  }
510
- function wr(e, t) {
511
- return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : br(e, t);
510
+ function xr(e, t) {
511
+ return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : _r(e, t);
512
512
  }
513
513
  function rn(e, t) {
514
514
  if (!e || e.length === 0) return !1;
515
515
  for (const r of e)
516
- if (wr(r, t)) return !0;
516
+ if (xr(r, t)) return !0;
517
517
  return !1;
518
518
  }
519
- function _r(e, t, r) {
519
+ function kr(e, t, r) {
520
520
  return e === void 0 ? !0 : rn(r, e) ? !1 : t && t.length > 0 ? rn(t, e) : !0;
521
521
  }
522
- function xr(e, t, r) {
523
- return Ge(
524
- () => _r(e, t, r),
522
+ function Lr(e, t, r) {
523
+ return Xe(
524
+ () => kr(e, t, r),
525
525
  [e, t, r]
526
526
  );
527
527
  }
528
- function kr(e) {
528
+ function Cr(e) {
529
529
  return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
530
530
  navigate: e.navigate !== !1,
531
531
  thinking: e.thinking !== !1,
532
532
  action: e.action !== !1
533
533
  };
534
534
  }
535
- function Lr(e) {
536
- const t = Ge(() => kr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), o = N(null), i = C(
535
+ function Er(e) {
536
+ const t = Xe(() => Cr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), o = N(null), l = C(
537
537
  (c) => {
538
538
  try {
539
539
  new Audio(`${r}${c}`).play().catch(() => {
@@ -542,11 +542,11 @@ function Lr(e) {
542
542
  }
543
543
  },
544
544
  [r]
545
- ), l = C(() => {
546
- t.navigate && i("/audio/page-change-sound.mp3");
547
- }, [t.navigate, i]), s = C(() => {
548
- t.action && i("/audio/confirmation-sound.mp3");
549
- }, [t.action, i]), a = C(
545
+ ), i = C(() => {
546
+ t.navigate && l("/audio/page-change-sound.mp3");
547
+ }, [t.navigate, l]), s = C(() => {
548
+ t.action && l("/audio/confirmation-sound.mp3");
549
+ }, [t.action, l]), a = C(
550
550
  (c) => {
551
551
  if (!t.thinking) {
552
552
  if (o.current) {
@@ -577,7 +577,7 @@ function Lr(e) {
577
577
  },
578
578
  [r, t.thinking]
579
579
  );
580
- return I(() => () => {
580
+ return R(() => () => {
581
581
  if (o.current) {
582
582
  try {
583
583
  o.current.pause();
@@ -585,9 +585,9 @@ function Lr(e) {
585
585
  }
586
586
  o.current = null;
587
587
  }
588
- }, []), Ge(
589
- () => ({ playPageChange: l, playConfirmation: s, setThinking: a }),
590
- [l, s, a]
588
+ }, []), Xe(
589
+ () => ({ playPageChange: i, playConfirmation: s, setThinking: a }),
590
+ [i, s, a]
591
591
  );
592
592
  }
593
593
  const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
@@ -654,7 +654,7 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
654
654
  }
655
655
  )
656
656
  }
657
- ), Cr = ({ className: e }) => /* @__PURE__ */ n(
657
+ ), Sr = ({ className: e }) => /* @__PURE__ */ n(
658
658
  "svg",
659
659
  {
660
660
  className: e,
@@ -665,7 +665,7 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
665
665
  "aria-hidden": "true",
666
666
  children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
667
667
  }
668
- ), Er = {
668
+ ), Nr = {
669
669
  left: 180,
670
670
  right: 0,
671
671
  up: -90,
@@ -678,19 +678,19 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
678
678
  viewBox: "0 0 24 24",
679
679
  stroke: "currentColor",
680
680
  strokeWidth: 2,
681
- style: { transform: `rotate(${Er[e]}deg)` },
681
+ style: { transform: `rotate(${Nr[e]}deg)` },
682
682
  "aria-hidden": "true",
683
683
  children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
684
684
  }
685
685
  );
686
- function Sr(e) {
686
+ function Ar(e) {
687
687
  return e === "top-left" || e === "bottom-left" ? "left" : "right";
688
688
  }
689
- const xn = "ll-hidden-tab-center-y", Nr = 5, sn = 16;
690
- function Ar() {
689
+ const Ln = "ll-hidden-tab-center-y", Ir = 5, sn = 16;
690
+ function Rr() {
691
691
  if (typeof window > "u") return null;
692
692
  try {
693
- const e = window.localStorage.getItem(xn);
693
+ const e = window.localStorage.getItem(Ln);
694
694
  if (!e) return null;
695
695
  const t = Number.parseFloat(e);
696
696
  return Number.isFinite(t) ? t : null;
@@ -701,72 +701,72 @@ function Ar() {
701
701
  function cn(e) {
702
702
  if (!(typeof window > "u"))
703
703
  try {
704
- window.localStorage.setItem(xn, String(e));
704
+ window.localStorage.setItem(Ln, String(e));
705
705
  } catch {
706
706
  }
707
707
  }
708
- const Rr = ({
708
+ const Mr = ({
709
709
  position: e,
710
710
  isMobile: t,
711
711
  isSpeaking: r,
712
712
  onExpand: o,
713
- label: i = "Open widget",
714
- avatarImageUrl: l,
713
+ label: l = "Open widget",
714
+ avatarImageUrl: i,
715
715
  agentName: s,
716
716
  containerEl: a
717
717
  }) => {
718
- const c = Sr(e), p = c === "right" ? "left" : "right", v = t ? 80 : 72, f = !!l, u = !!a, [R, L] = E(null), [_, h] = E(!1), b = N(null), S = N(!1), T = C(
719
- (M) => {
720
- if (typeof window > "u") return M;
721
- const U = v / 2, B = sn + U, J = window.innerHeight - sn - U;
722
- return J < B ? Math.max(B, M) : Math.max(B, Math.min(J, M));
718
+ const c = Ar(e), p = c === "right" ? "left" : "right", v = t ? 80 : 72, f = !!i, u = !!a, [I, L] = E(null), [_, h] = E(!1), b = N(null), S = N(!1), T = C(
719
+ (B) => {
720
+ if (typeof window > "u") return B;
721
+ const U = v / 2, M = sn + U, J = window.innerHeight - sn - U;
722
+ return J < M ? Math.max(M, B) : Math.max(M, Math.min(J, B));
723
723
  },
724
724
  [v]
725
725
  );
726
- I(() => {
726
+ R(() => {
727
727
  if (u) {
728
728
  L(null);
729
729
  return;
730
730
  }
731
- const M = Ar();
732
- L(T(M ?? window.innerHeight / 2));
731
+ const B = Rr();
732
+ L(T(B ?? window.innerHeight / 2));
733
733
  const U = () => {
734
- L((B) => B === null ? null : T(B));
734
+ L((M) => M === null ? null : T(M));
735
735
  };
736
736
  return window.addEventListener("resize", U), () => window.removeEventListener("resize", U);
737
737
  }, [T, u]);
738
738
  const A = C(
739
- (M) => {
740
- if (!u && !(M.pointerType === "mouse" && M.button !== 0) && R !== null) {
739
+ (B) => {
740
+ if (!u && !(B.pointerType === "mouse" && B.button !== 0) && I !== null) {
741
741
  try {
742
- M.currentTarget.setPointerCapture(M.pointerId);
742
+ B.currentTarget.setPointerCapture(B.pointerId);
743
743
  } catch {
744
744
  }
745
745
  b.current = {
746
- startClientY: M.clientY,
747
- startCenterY: R,
746
+ startClientY: B.clientY,
747
+ startCenterY: I,
748
748
  moved: !1
749
749
  };
750
750
  }
751
751
  },
752
- [R, u]
753
- ), F = C(
754
- (M) => {
752
+ [I, u]
753
+ ), q = C(
754
+ (B) => {
755
755
  const U = b.current;
756
756
  if (!U) return;
757
- const B = M.clientY - U.startClientY;
758
- !U.moved && Math.abs(B) > Nr && (U.moved = !0, h(!0)), U.moved && L(T(U.startCenterY + B));
757
+ const M = B.clientY - U.startClientY;
758
+ !U.moved && Math.abs(M) > Ir && (U.moved = !0, h(!0)), U.moved && L(T(U.startCenterY + M));
759
759
  },
760
760
  [T]
761
761
  ), g = C(
762
- (M) => {
762
+ (B) => {
763
763
  const U = b.current;
764
764
  if (U) {
765
765
  try {
766
- M.currentTarget.releasePointerCapture(M.pointerId);
766
+ B.currentTarget.releasePointerCapture(B.pointerId);
767
767
  } catch {
768
768
  }
769
- b.current = null, U.moved && (h(!1), S.current = !0, L((B) => (B !== null && cn(B), B)));
769
+ b.current = null, U.moved && (h(!1), S.current = !0, L((M) => (M !== null && cn(M), M)));
770
770
  }
771
771
  },
772
772
  []
@@ -777,19 +777,19 @@ const Rr = ({
777
777
  }
778
778
  o();
779
779
  }, [o]), H = C(
780
- (M) => {
781
- if (M.key === "ArrowUp" || M.key === "ArrowDown") {
782
- M.preventDefault();
783
- const U = M.key === "ArrowUp" ? -8 : 8;
784
- L((B) => {
785
- if (B === null) return B;
786
- const J = T(B + U);
780
+ (B) => {
781
+ if (B.key === "ArrowUp" || B.key === "ArrowDown") {
782
+ B.preventDefault();
783
+ const U = B.key === "ArrowUp" ? -8 : 8;
784
+ L((M) => {
785
+ if (M === null) return M;
786
+ const J = T(M + U);
787
787
  return cn(J), J;
788
788
  });
789
789
  }
790
790
  },
791
791
  [T]
792
- ), q = [
792
+ ), F = [
793
793
  "ll-hidden",
794
794
  `ll-hidden--${c}`,
795
795
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
@@ -797,27 +797,27 @@ const Rr = ({
797
797
  _ ? "is-dragging" : null,
798
798
  f ? "ll-hidden--with-avatar" : null,
799
799
  u ? "ll-hidden--scoped" : null
800
- ].filter(Boolean).join(" "), Z = R === null ? void 0 : { top: `${R - v / 2}px`, transform: "none" };
800
+ ].filter(Boolean).join(" "), ee = I === null ? void 0 : { top: `${I - v / 2}px`, transform: "none" };
801
801
  return /* @__PURE__ */ n(
802
802
  "button",
803
803
  {
804
804
  type: "button",
805
- className: q,
805
+ className: F,
806
806
  onPointerDown: A,
807
- onPointerMove: F,
807
+ onPointerMove: q,
808
808
  onPointerUp: g,
809
809
  onPointerCancel: g,
810
810
  onClick: P,
811
811
  onKeyDown: H,
812
- "aria-label": i,
812
+ "aria-label": l,
813
813
  "data-position": e,
814
- style: Z,
814
+ style: ee,
815
815
  children: f ? (
816
816
  // Layout: tiny chevron flush against the inward edge (peeks out
817
817
  // as the click affordance), then the circular avatar photo
818
818
  // taking the rest of the tab. Reinforces "this is an
819
819
  // avatar-based experience" even when collapsed.
820
- /* @__PURE__ */ w(Pe, { children: [
820
+ /* @__PURE__ */ w($e, { children: [
821
821
  /* @__PURE__ */ n(
822
822
  an,
823
823
  {
@@ -828,7 +828,7 @@ const Rr = ({
828
828
  /* @__PURE__ */ n(
829
829
  "img",
830
830
  {
831
- src: l,
831
+ src: i,
832
832
  alt: s ? `${s} avatar` : "Agent avatar",
833
833
  className: "ll-hidden__avatar",
834
834
  draggable: !1
@@ -844,45 +844,45 @@ const Rr = ({
844
844
  )
845
845
  }
846
846
  );
847
- }, Ir = ({
847
+ }, Tr = ({
848
848
  audioLevel: e,
849
849
  bars: t = 20,
850
850
  maxHeight: r = 20,
851
851
  minHeight: o = 4,
852
- className: i,
853
- barClassName: l
852
+ className: l,
853
+ barClassName: i
854
854
  }) => {
855
- const s = N(null), a = N([]), c = Ge(() => {
855
+ const s = N(null), a = N([]), c = Xe(() => {
856
856
  const v = (Math.sqrt(5) - 1) / 2;
857
857
  return Array.from({ length: t }, (f, u) => 0.5 + u * v % 1 * 0.5);
858
858
  }, [t]);
859
- I(() => e.subscribe((f) => {
859
+ R(() => e.subscribe((f) => {
860
860
  for (let u = 0; u < t; u++) {
861
- const R = a.current[u];
862
- if (!R) continue;
861
+ const I = a.current[u];
862
+ if (!I) continue;
863
863
  const L = Math.max(o, f * r * c[u]);
864
- R.style.height = `${L}px`;
864
+ I.style.height = `${L}px`;
865
865
  }
866
866
  }), [e, t, r, o, c]);
867
- const p = ["ll-waveform", i].filter(Boolean).join(" ");
867
+ const p = ["ll-waveform", l].filter(Boolean).join(" ");
868
868
  return /* @__PURE__ */ n("div", { ref: s, className: p, "aria-hidden": "true", children: Array.from({ length: t }, (v, f) => /* @__PURE__ */ n(
869
869
  "div",
870
870
  {
871
871
  ref: (u) => {
872
872
  a.current[f] = u;
873
873
  },
874
- className: ["ll-waveform__bar", l].filter(Boolean).join(" "),
874
+ className: ["ll-waveform__bar", i].filter(Boolean).join(" "),
875
875
  style: { height: `${o}px` }
876
876
  },
877
877
  f
878
878
  )) });
879
- }, Mr = ({
879
+ }, Dr = ({
880
880
  position: e,
881
881
  isMobile: t,
882
882
  agentName: r,
883
883
  avatarImageUrl: o,
884
- agentState: i,
885
- isMuted: l,
884
+ agentState: l,
885
+ isMuted: i,
886
886
  audioLevel: s,
887
887
  onExpand: a,
888
888
  onToggleMute: c,
@@ -913,7 +913,7 @@ const Rr = ({
913
913
  )
914
914
  ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
915
915
  /* @__PURE__ */ n(
916
- Ir,
916
+ Tr,
917
917
  {
918
918
  audioLevel: s,
919
919
  bars: 16,
@@ -935,8 +935,8 @@ const Rr = ({
935
935
  onKeyDown: (v) => {
936
936
  (v.key === "Enter" || v.key === " ") && (v.stopPropagation(), v.preventDefault(), c());
937
937
  },
938
- "aria-label": l ? "Unmute microphone" : "Mute microphone",
939
- children: /* @__PURE__ */ n(on, { muted: l, className: "ll-minimized__icon" })
938
+ "aria-label": i ? "Unmute microphone" : "Mute microphone",
939
+ children: /* @__PURE__ */ n(on, { muted: i, className: "ll-minimized__icon" })
940
940
  }
941
941
  ),
942
942
  /* @__PURE__ */ n(ln, { className: "ll-minimized__icon ll-minimized__icon--expand" })
@@ -966,7 +966,7 @@ const Rr = ({
966
966
  ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
967
967
  /* @__PURE__ */ w("div", { className: "ll-minimized__meta", children: [
968
968
  /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
969
- /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: i === "speaking" ? "Speaking" : i === "thinking" ? "Thinking" : "Listening" })
969
+ /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: l === "speaking" ? "Speaking" : l === "thinking" ? "Thinking" : "Listening" })
970
970
  ] }),
971
971
  /* @__PURE__ */ w("div", { className: "ll-minimized__controls", children: [
972
972
  /* @__PURE__ */ n(
@@ -975,8 +975,8 @@ const Rr = ({
975
975
  type: "button",
976
976
  className: "ll-minimized__btn",
977
977
  onClick: c,
978
- "aria-label": l ? "Unmute microphone" : "Mute microphone",
979
- children: /* @__PURE__ */ n(on, { muted: l, className: "ll-minimized__icon" })
978
+ "aria-label": i ? "Unmute microphone" : "Mute microphone",
979
+ children: /* @__PURE__ */ n(on, { muted: i, className: "ll-minimized__icon" })
980
980
  }
981
981
  ),
982
982
  /* @__PURE__ */ n(
@@ -996,21 +996,21 @@ const Rr = ({
996
996
  className: "ll-minimized__btn ll-minimized__btn--close",
997
997
  onClick: p,
998
998
  "aria-label": "Close widget",
999
- children: /* @__PURE__ */ n(Cr, { className: "ll-minimized__icon" })
999
+ children: /* @__PURE__ */ n(Sr, { className: "ll-minimized__icon" })
1000
1000
  }
1001
1001
  )
1002
1002
  ] })
1003
1003
  ] })
1004
1004
  }
1005
- ), Tr = ({
1005
+ ), Pr = ({
1006
1006
  src: e,
1007
1007
  alt: t,
1008
1008
  preCannedPlaying: r = !1,
1009
1009
  className: o,
1010
- style: i
1010
+ style: l
1011
1011
  }) => {
1012
- const [l, s] = E(!1), a = N(e);
1013
- if (I(() => {
1012
+ const [i, s] = E(!1), a = N(e);
1013
+ if (R(() => {
1014
1014
  a.current !== e && (a.current = e, s(!1));
1015
1015
  }, [e]), !e) return null;
1016
1016
  const c = {
@@ -1022,8 +1022,8 @@ const Rr = ({
1022
1022
  objectPosition: "top",
1023
1023
  transition: "opacity 500ms ease, transform 500ms ease",
1024
1024
  transform: r ? "scale(1.02)" : "scale(1)",
1025
- opacity: l ? 1 : 0,
1026
- ...i
1025
+ opacity: i ? 1 : 0,
1026
+ ...l
1027
1027
  };
1028
1028
  return (
1029
1029
  // eslint-disable-next-line @next/next/no-img-element
@@ -1040,14 +1040,14 @@ const Rr = ({
1040
1040
  }
1041
1041
  )
1042
1042
  );
1043
- }, Dr = 8, dn = 8, Pr = ({
1043
+ }, $r = 8, dn = 8, zr = ({
1044
1044
  open: e,
1045
1045
  onClose: t,
1046
1046
  anchorRef: r,
1047
1047
  children: o
1048
1048
  }) => {
1049
- const i = N(null), [l, s] = E(null);
1050
- return wn(() => {
1049
+ const l = N(null), [i, s] = E(null);
1050
+ return xn(() => {
1051
1051
  if (!e) {
1052
1052
  s(null);
1053
1053
  return;
@@ -1056,7 +1056,7 @@ const Rr = ({
1056
1056
  if (!a) return;
1057
1057
  const c = () => {
1058
1058
  const p = a.getBoundingClientRect(), v = {
1059
- top: p.top - Dr,
1059
+ top: p.top - $r,
1060
1060
  left: p.left + p.width / 2
1061
1061
  }, f = dn + 90, u = window.innerWidth - dn - 90;
1062
1062
  v.left < f && (v.left = f), v.left > u && (v.left = u), s(v);
@@ -1064,10 +1064,10 @@ const Rr = ({
1064
1064
  return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
1065
1065
  window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
1066
1066
  };
1067
- }, [e, r]), I(() => {
1067
+ }, [e, r]), R(() => {
1068
1068
  if (!e) return;
1069
1069
  const a = (p) => {
1070
- const v = p.target, f = i.current, u = r.current;
1070
+ const v = p.target, f = l.current, u = r.current;
1071
1071
  f && f.contains(v) || u && u.contains(v) || t();
1072
1072
  }, c = (p) => {
1073
1073
  p.key === "Escape" && (p.stopPropagation(), t());
@@ -1075,19 +1075,19 @@ const Rr = ({
1075
1075
  return document.addEventListener("mousedown", a), document.addEventListener("keydown", c), () => {
1076
1076
  document.removeEventListener("mousedown", a), document.removeEventListener("keydown", c);
1077
1077
  };
1078
- }, [e, t, r]), !e || l === null || typeof document > "u" ? null : Pt(
1078
+ }, [e, t, r]), !e || i === null || typeof document > "u" ? null : Pt(
1079
1079
  /* @__PURE__ */ n(
1080
1080
  "div",
1081
1081
  {
1082
- ref: i,
1082
+ ref: l,
1083
1083
  className: "ll-overflow-popover",
1084
1084
  role: "menu",
1085
1085
  style: {
1086
1086
  position: "fixed",
1087
1087
  // Lift the popover above the anchor via translateY(-100%).
1088
1088
  // top points to (anchorTop - GAP); transform pulls bottom up to there.
1089
- top: l.top,
1090
- left: l.left,
1089
+ top: i.top,
1090
+ left: i.left,
1091
1091
  transform: "translate(-50%, -100%)"
1092
1092
  },
1093
1093
  children: o
@@ -1095,13 +1095,13 @@ const Rr = ({
1095
1095
  ),
1096
1096
  document.body
1097
1097
  );
1098
- }, $r = ({
1098
+ }, Or = ({
1099
1099
  isMuted: e,
1100
1100
  onToggleMute: t,
1101
1101
  isCameraEnabled: r,
1102
1102
  onToggleCamera: o,
1103
- allowCamera: i,
1104
- isScreenShareEnabled: l,
1103
+ allowCamera: l,
1104
+ isScreenShareEnabled: i,
1105
1105
  onToggleScreenShare: s,
1106
1106
  allowScreenShare: a,
1107
1107
  isSpeakerMuted: c,
@@ -1109,10 +1109,10 @@ const Rr = ({
1109
1109
  allowTyping: v,
1110
1110
  isTypingOpen: f,
1111
1111
  onToggleTyping: u,
1112
- onDisconnect: R
1112
+ onDisconnect: I
1113
1113
  }) => {
1114
1114
  const [L, _] = E(!1), h = N(null);
1115
- return /* @__PURE__ */ w(Pe, { children: [
1115
+ return /* @__PURE__ */ w($e, { children: [
1116
1116
  /* @__PURE__ */ w(
1117
1117
  "div",
1118
1118
  {
@@ -1127,7 +1127,7 @@ const Rr = ({
1127
1127
  className: `ll-tool ${e ? "is-muted" : ""}`,
1128
1128
  onClick: t,
1129
1129
  "aria-label": e ? "Unmute microphone" : "Mute microphone",
1130
- children: /* @__PURE__ */ n(Cn, { muted: e })
1130
+ children: /* @__PURE__ */ n(Sn, { muted: e })
1131
1131
  }
1132
1132
  ),
1133
1133
  /* @__PURE__ */ n(
@@ -1140,7 +1140,7 @@ const Rr = ({
1140
1140
  "aria-label": "More controls",
1141
1141
  "aria-haspopup": "menu",
1142
1142
  "aria-expanded": L,
1143
- children: /* @__PURE__ */ n(zr, {})
1143
+ children: /* @__PURE__ */ n(Hr, {})
1144
1144
  }
1145
1145
  ),
1146
1146
  /* @__PURE__ */ n(
@@ -1148,22 +1148,22 @@ const Rr = ({
1148
1148
  {
1149
1149
  type: "button",
1150
1150
  className: "ll-tool ll-tool--danger",
1151
- onClick: R,
1151
+ onClick: I,
1152
1152
  "aria-label": "End conversation",
1153
- children: /* @__PURE__ */ n(Sn, {})
1153
+ children: /* @__PURE__ */ n(An, {})
1154
1154
  }
1155
1155
  )
1156
1156
  ]
1157
1157
  }
1158
1158
  ),
1159
1159
  /* @__PURE__ */ w(
1160
- Pr,
1160
+ zr,
1161
1161
  {
1162
1162
  open: L,
1163
1163
  onClose: () => _(!1),
1164
1164
  anchorRef: h,
1165
1165
  children: [
1166
- i && /* @__PURE__ */ w(
1166
+ l && /* @__PURE__ */ w(
1167
1167
  "button",
1168
1168
  {
1169
1169
  type: "button",
@@ -1172,7 +1172,7 @@ const Rr = ({
1172
1172
  o(), _(!1);
1173
1173
  },
1174
1174
  children: [
1175
- /* @__PURE__ */ n(Ln, {}),
1175
+ /* @__PURE__ */ n(En, {}),
1176
1176
  /* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
1177
1177
  ]
1178
1178
  }
@@ -1181,13 +1181,13 @@ const Rr = ({
1181
1181
  "button",
1182
1182
  {
1183
1183
  type: "button",
1184
- className: `ll-overflow-popover__item ${l ? "is-on" : ""}`,
1184
+ className: `ll-overflow-popover__item ${i ? "is-on" : ""}`,
1185
1185
  onClick: () => {
1186
1186
  s(), _(!1);
1187
1187
  },
1188
1188
  children: [
1189
- /* @__PURE__ */ n(kn, {}),
1190
- /* @__PURE__ */ n("span", { children: l ? "Stop sharing" : "Share screen" })
1189
+ /* @__PURE__ */ n(Cn, {}),
1190
+ /* @__PURE__ */ n("span", { children: i ? "Stop sharing" : "Share screen" })
1191
1191
  ]
1192
1192
  }
1193
1193
  ),
@@ -1200,7 +1200,7 @@ const Rr = ({
1200
1200
  p(), _(!1);
1201
1201
  },
1202
1202
  children: [
1203
- /* @__PURE__ */ n(En, { muted: c }),
1203
+ /* @__PURE__ */ n(Nn, { muted: c }),
1204
1204
  /* @__PURE__ */ n("span", { children: c ? "Unmute speaker" : "Mute speaker" })
1205
1205
  ]
1206
1206
  }
@@ -1214,7 +1214,7 @@ const Rr = ({
1214
1214
  u(), _(!1);
1215
1215
  },
1216
1216
  children: [
1217
- /* @__PURE__ */ n(Or, {}),
1217
+ /* @__PURE__ */ n(Br, {}),
1218
1218
  /* @__PURE__ */ n("span", { children: f ? "Hide typing" : "Type a message" })
1219
1219
  ]
1220
1220
  }
@@ -1237,7 +1237,7 @@ const Rr = ({
1237
1237
  )
1238
1238
  ] });
1239
1239
  };
1240
- function zr() {
1240
+ function Hr() {
1241
1241
  return /* @__PURE__ */ w(
1242
1242
  "svg",
1243
1243
  {
@@ -1254,7 +1254,7 @@ function zr() {
1254
1254
  }
1255
1255
  );
1256
1256
  }
1257
- function Or() {
1257
+ function Br() {
1258
1258
  return /* @__PURE__ */ n(
1259
1259
  "svg",
1260
1260
  {
@@ -1271,13 +1271,13 @@ function Or() {
1271
1271
  }
1272
1272
  );
1273
1273
  }
1274
- const Hr = ({
1274
+ const Wr = ({
1275
1275
  position: e,
1276
1276
  isMobile: t,
1277
1277
  agentName: r,
1278
1278
  avatarImageUrl: o,
1279
- idleLoopUrl: i,
1280
- greeting: l,
1279
+ idleLoopUrl: l,
1280
+ greeting: i,
1281
1281
  branding: s,
1282
1282
  teamMembers: a,
1283
1283
  currentTeamMemberId: c,
@@ -1285,7 +1285,7 @@ const Hr = ({
1285
1285
  teamSwitcherOpen: v,
1286
1286
  onToggleTeamSwitcher: f,
1287
1287
  onSelectTeamMember: u,
1288
- languageMenuOpen: R,
1288
+ languageMenuOpen: I,
1289
1289
  onToggleLanguageMenu: L,
1290
1290
  connectionState: _,
1291
1291
  agentState: h,
@@ -1293,133 +1293,133 @@ const Hr = ({
1293
1293
  canResume: S,
1294
1294
  needsUserGesture: T,
1295
1295
  error: A,
1296
- isMuted: F,
1296
+ isMuted: q,
1297
1297
  micError: g,
1298
1298
  micDevices: P,
1299
1299
  activeMicId: H,
1300
- isCameraEnabled: q,
1301
- cameraPreviewEl: Z,
1302
- cameraDevices: M,
1300
+ isCameraEnabled: F,
1301
+ cameraPreviewEl: ee,
1302
+ cameraDevices: B,
1303
1303
  activeCameraId: U,
1304
- isScreenShareEnabled: B,
1304
+ isScreenShareEnabled: M,
1305
1305
  screenPreviewEl: J,
1306
- isSpeakerMuted: oe,
1307
- allowCamera: _e,
1308
- allowScreenShare: K,
1309
- allowTyping: xe,
1310
- showMinimize: ye = !0,
1311
- showClose: ke = !0,
1312
- chromeless: ve = !1,
1313
- compactControls: ie = !1,
1314
- transforming: dt,
1315
- transformingLabel: Je,
1316
- avatarVideoContainerRef: ut,
1306
+ isSpeakerMuted: ye,
1307
+ allowCamera: ie,
1308
+ allowScreenShare: ze,
1309
+ allowTyping: Oe,
1310
+ showMinimize: ve = !0,
1311
+ showClose: Ee = !0,
1312
+ chromeless: Y = !1,
1313
+ compactControls: X = !1,
1314
+ transforming: be,
1315
+ transformingLabel: we,
1316
+ avatarVideoContainerRef: Se,
1317
1317
  agentVideoEl: se,
1318
- onConnect: Ke,
1319
- onDisconnect: Xe,
1318
+ onConnect: Qe,
1319
+ onDisconnect: Ze,
1320
1320
  onRetry: ft,
1321
- onResumeAudio: Qe,
1322
- onToggleMute: Se,
1323
- onSwitchMicDevice: $e,
1324
- onToggleCamera: Ne,
1325
- onSwitchCameraDevice: ze,
1326
- onToggleScreenShare: Ae,
1321
+ onResumeAudio: et,
1322
+ onToggleMute: Ne,
1323
+ onSwitchMicDevice: He,
1324
+ onToggleCamera: Ae,
1325
+ onSwitchCameraDevice: Be,
1326
+ onToggleScreenShare: Ie,
1327
1327
  onToggleSpeaker: Re,
1328
- onSendMessage: Ie,
1329
- onMinimize: Me,
1328
+ onSendMessage: Me,
1329
+ onMinimize: Te,
1330
1330
  onClose: $,
1331
- onClearMicError: kt
1331
+ onClearMicError: xt
1332
1332
  }) => {
1333
1333
  var mt;
1334
- const Te = ((a == null ? void 0 : a.length) ?? 0) > 1, Oe = _ === "connecting" || _ === "connected", ce = _ === "connected", Ze = _ === "idle" || _ === "disconnected" || _ === "error", [De, He] = E(!1);
1335
- I(() => {
1334
+ const De = ((a == null ? void 0 : a.length) ?? 0) > 1, We = _ === "connecting" || _ === "connected", ce = _ === "connected", tt = _ === "idle" || _ === "disconnected" || _ === "error", [Pe, Fe] = E(!1);
1335
+ R(() => {
1336
1336
  if (!se) {
1337
- He(!1);
1337
+ Fe(!1);
1338
1338
  return;
1339
1339
  }
1340
1340
  if (!se.paused && se.readyState >= 2) {
1341
- He(!0);
1341
+ Fe(!0);
1342
1342
  return;
1343
1343
  }
1344
- He(!1);
1345
- const m = () => He(!0);
1344
+ Fe(!1);
1345
+ const m = () => Fe(!0);
1346
1346
  return se.addEventListener("playing", m), se.addEventListener("loadeddata", m), () => {
1347
1347
  se.removeEventListener("playing", m), se.removeEventListener("loadeddata", m);
1348
1348
  };
1349
1349
  }, [se]);
1350
- const [Lt, Le] = E(!1);
1351
- I(() => {
1350
+ const [kt, ke] = E(!1);
1351
+ R(() => {
1352
1352
  if (!ce) {
1353
- Le(!1);
1353
+ ke(!1);
1354
1354
  return;
1355
1355
  }
1356
- if (De) return;
1357
- const m = setTimeout(() => Le(!0), 8e3);
1356
+ if (Pe) return;
1357
+ const m = setTimeout(() => ke(!0), 8e3);
1358
1358
  return () => clearTimeout(m);
1359
- }, [ce, De]);
1360
- const ee = _ === "connecting" || ce && !!o && !De && !Lt, et = N(null), ue = N(null);
1361
- I(() => {
1362
- const m = et.current;
1363
- m && (m.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "cover", Z.style.transform = "scaleX(-1)", m.appendChild(Z)));
1364
- }, [Z]), I(() => {
1359
+ }, [ce, Pe]);
1360
+ const te = _ === "connecting" || ce && !!o && !Pe && !kt, nt = N(null), ue = N(null);
1361
+ R(() => {
1362
+ const m = nt.current;
1363
+ m && (m.innerHTML = "", ee && (ee.style.width = "100%", ee.style.height = "100%", ee.style.objectFit = "cover", ee.style.transform = "scaleX(-1)", m.appendChild(ee)));
1364
+ }, [ee]), R(() => {
1365
1365
  const m = ue.current;
1366
1366
  m && (m.innerHTML = "", J && (J.style.width = "100%", J.style.height = "100%", J.style.objectFit = "contain", m.appendChild(J)));
1367
1367
  }, [J]);
1368
- const [Be, We] = E(!1), [te, le] = E(!1), pt = N(null), ht = N(null);
1369
- I(() => {
1370
- if (!Be && !te && !R && !v) return;
1368
+ const [qe, Ue] = E(!1), [ne, le] = E(!1), pt = N(null), ht = N(null);
1369
+ R(() => {
1370
+ if (!qe && !ne && !I && !v) return;
1371
1371
  const m = () => {
1372
- We(!1), le(!1), R && L(), v && f();
1372
+ Ue(!1), le(!1), I && L(), v && f();
1373
1373
  };
1374
1374
  return document.addEventListener("click", m), () => document.removeEventListener("click", m);
1375
1375
  }, [
1376
- Be,
1377
- te,
1378
- R,
1376
+ qe,
1377
+ ne,
1378
+ I,
1379
1379
  v,
1380
1380
  L,
1381
1381
  f
1382
1382
  ]);
1383
- const [Ce, tt] = E(!1), re = C(() => tt((m) => !m), []), [ae, Ee] = E(""), nt = C(
1383
+ const [Le, rt] = E(!1), oe = C(() => rt((m) => !m), []), [ae, Ce] = E(""), ot = C(
1384
1384
  (m) => {
1385
1385
  m.preventDefault();
1386
- const Y = ae.trim();
1387
- Y && (Ie(Y), Ee(""));
1386
+ const G = ae.trim();
1387
+ G && (Me(G), Ce(""));
1388
1388
  },
1389
- [ae, Ie]
1390
- ), Ct = s.productName || "Live Layer";
1389
+ [ae, Me]
1390
+ ), Lt = s.productName || "Live Layer";
1391
1391
  let fe = null, pe = null;
1392
1392
  for (let m = b.length - 1; m >= 0; m--) {
1393
- const Y = b[m];
1394
- if (!fe && Y.role === "agent" ? fe = Y : !pe && Y.role === "user" && (pe = Y), fe && pe) break;
1393
+ const G = b[m];
1394
+ if (!fe && G.role === "agent" ? fe = G : !pe && G.role === "user" && (pe = G), fe && pe) break;
1395
1395
  }
1396
- const rt = ce ? (fe == null ? void 0 : fe.text) || null : l || null, qe = ce && (pe == null ? void 0 : pe.text) || null, ot = [
1396
+ const it = ce ? (fe == null ? void 0 : fe.text) || null : i || null, je = ce && (pe == null ? void 0 : pe.text) || null, lt = [
1397
1397
  "ll-expanded",
1398
1398
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1399
1399
  ].join(" ");
1400
1400
  return /* @__PURE__ */ w(
1401
1401
  "div",
1402
1402
  {
1403
- className: ot,
1403
+ className: lt,
1404
1404
  "data-position": e,
1405
- "data-state": ce ? "connected" : Oe ? "connecting" : "idle",
1405
+ "data-state": ce ? "connected" : We ? "connecting" : "idle",
1406
1406
  role: "dialog",
1407
1407
  "aria-label": `${r} widget`,
1408
1408
  children: [
1409
1409
  /* @__PURE__ */ w("div", { className: "ll-expanded__bg", children: [
1410
1410
  o ? /* @__PURE__ */ n(
1411
- Tr,
1411
+ Pr,
1412
1412
  {
1413
1413
  src: o,
1414
1414
  alt: r,
1415
1415
  className: "ll-expanded__bg-img"
1416
1416
  }
1417
1417
  ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((mt = r == null ? void 0 : r.charAt(0)) == null ? void 0 : mt.toUpperCase()) || "A" }) }),
1418
- i && !ce && /* @__PURE__ */ n(
1418
+ l && !ce && /* @__PURE__ */ n(
1419
1419
  "video",
1420
1420
  {
1421
1421
  className: "ll-expanded__bg-idle",
1422
- src: i,
1422
+ src: l,
1423
1423
  autoPlay: !0,
1424
1424
  loop: !0,
1425
1425
  muted: !0,
@@ -1427,8 +1427,8 @@ const Hr = ({
1427
1427
  }
1428
1428
  )
1429
1429
  ] }),
1430
- /* @__PURE__ */ n("div", { ref: ut, className: "ll-expanded__video" }),
1431
- ee && /* @__PURE__ */ w("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1430
+ /* @__PURE__ */ n("div", { ref: Se, className: "ll-expanded__video" }),
1431
+ te && /* @__PURE__ */ w("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1432
1432
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1433
1433
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: p ? "Switching..." : "Connecting..." })
1434
1434
  ] }),
@@ -1437,29 +1437,29 @@ const Hr = ({
1437
1437
  {
1438
1438
  type: "button",
1439
1439
  className: "ll-expanded__overlay ll-expanded__overlay--gesture",
1440
- onClick: Qe,
1440
+ onClick: et,
1441
1441
  children: [
1442
1442
  /* @__PURE__ */ n("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
1443
1443
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
1444
1444
  ]
1445
1445
  }
1446
1446
  ),
1447
- dt && /* @__PURE__ */ w(
1447
+ be && /* @__PURE__ */ w(
1448
1448
  "div",
1449
1449
  {
1450
1450
  className: "ll-expanded__overlay ll-expanded__overlay--transforming",
1451
1451
  role: "status",
1452
1452
  "aria-live": "polite",
1453
- "aria-label": Je,
1453
+ "aria-label": we,
1454
1454
  children: [
1455
1455
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1456
- /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: Je })
1456
+ /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: we })
1457
1457
  ]
1458
1458
  }
1459
1459
  ),
1460
- Oe ? /* @__PURE__ */ w(Pe, { children: [
1461
- !ie && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar", children: [
1462
- !ve && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar-left", children: [
1460
+ We ? /* @__PURE__ */ w($e, { children: [
1461
+ !X && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar", children: [
1462
+ !Y && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar-left", children: [
1463
1463
  /* @__PURE__ */ w("div", { className: "ll-expanded__pill-wrap", children: [
1464
1464
  /* @__PURE__ */ w(
1465
1465
  "button",
@@ -1467,17 +1467,17 @@ const Hr = ({
1467
1467
  type: "button",
1468
1468
  className: "ll-hpill",
1469
1469
  onClick: (m) => {
1470
- Te && (m.stopPropagation(), f());
1470
+ De && (m.stopPropagation(), f());
1471
1471
  },
1472
- "aria-haspopup": Te ? "listbox" : void 0,
1473
- "aria-expanded": Te ? v : void 0,
1472
+ "aria-haspopup": De ? "listbox" : void 0,
1473
+ "aria-expanded": De ? v : void 0,
1474
1474
  children: [
1475
1475
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
1476
- Te && /* @__PURE__ */ n(bt, {})
1476
+ De && /* @__PURE__ */ n(bt, {})
1477
1477
  ]
1478
1478
  }
1479
1479
  ),
1480
- Te && v && /* @__PURE__ */ n(
1480
+ De && v && /* @__PURE__ */ n(
1481
1481
  "div",
1482
1482
  {
1483
1483
  className: "ll-hmenu",
@@ -1519,7 +1519,7 @@ const Hr = ({
1519
1519
  m.stopPropagation(), L();
1520
1520
  },
1521
1521
  "aria-haspopup": "listbox",
1522
- "aria-expanded": R,
1522
+ "aria-expanded": I,
1523
1523
  "aria-label": "Language: English",
1524
1524
  title: "Language: English",
1525
1525
  children: [
@@ -1528,7 +1528,7 @@ const Hr = ({
1528
1528
  ]
1529
1529
  }
1530
1530
  ),
1531
- R && /* @__PURE__ */ n(
1531
+ I && /* @__PURE__ */ n(
1532
1532
  "div",
1533
1533
  {
1534
1534
  className: "ll-hmenu",
@@ -1556,18 +1556,18 @@ const Hr = ({
1556
1556
  )
1557
1557
  ] }),
1558
1558
  /* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
1559
- ye !== !1 && /* @__PURE__ */ n(
1559
+ ve !== !1 && /* @__PURE__ */ n(
1560
1560
  "button",
1561
1561
  {
1562
1562
  type: "button",
1563
1563
  className: "ll-hbtn",
1564
- onClick: Me,
1564
+ onClick: Te,
1565
1565
  "aria-label": "Minimize widget",
1566
1566
  title: "Minimize",
1567
1567
  children: /* @__PURE__ */ n(fn, {})
1568
1568
  }
1569
1569
  ),
1570
- ke !== !1 && /* @__PURE__ */ n(
1570
+ Ee !== !1 && /* @__PURE__ */ n(
1571
1571
  "button",
1572
1572
  {
1573
1573
  type: "button",
@@ -1580,7 +1580,7 @@ const Hr = ({
1580
1580
  )
1581
1581
  ] })
1582
1582
  ] }),
1583
- ie && /* @__PURE__ */ w("div", { className: "ll-compact-status", "data-state": h, children: [
1583
+ X && /* @__PURE__ */ w("div", { className: "ll-compact-status", "data-state": h, children: [
1584
1584
  /* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
1585
1585
  /* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: h })
1586
1586
  ] })
@@ -1589,20 +1589,20 @@ const Hr = ({
1589
1589
  // Hidden in compact mode — on a 140×210 docked slot the brand pill
1590
1590
  // and 40px buttons crowded out the central "Start video call"
1591
1591
  // affordance. The user can dismiss by scrolling past the slot.
1592
- !ie && /* @__PURE__ */ w("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1593
- /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ct }),
1592
+ !X && /* @__PURE__ */ w("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1593
+ /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Lt }),
1594
1594
  /* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
1595
- ye !== !1 && /* @__PURE__ */ n(
1595
+ ve !== !1 && /* @__PURE__ */ n(
1596
1596
  "button",
1597
1597
  {
1598
1598
  type: "button",
1599
1599
  className: "ll-hbtn ll-hbtn--ghost",
1600
- onClick: Me,
1600
+ onClick: Te,
1601
1601
  "aria-label": "Minimize widget",
1602
1602
  children: /* @__PURE__ */ n(fn, {})
1603
1603
  }
1604
1604
  ),
1605
- ke !== !1 && /* @__PURE__ */ n(
1605
+ Ee !== !1 && /* @__PURE__ */ n(
1606
1606
  "button",
1607
1607
  {
1608
1608
  type: "button",
@@ -1615,30 +1615,30 @@ const Hr = ({
1615
1615
  ] })
1616
1616
  ] })
1617
1617
  ),
1618
- Ze && /* @__PURE__ */ (() => {
1618
+ tt && /* @__PURE__ */ (() => {
1619
1619
  const m = S ? "Resume session" : _ === "disconnected" ? "Reconnect to agent" : "Start video call";
1620
- return /* @__PURE__ */ w(Pe, { children: [
1620
+ return /* @__PURE__ */ w($e, { children: [
1621
1621
  !A && /* @__PURE__ */ w(
1622
1622
  "button",
1623
1623
  {
1624
1624
  type: "button",
1625
1625
  className: "ll-expanded__play",
1626
- onClick: Ke,
1626
+ onClick: Qe,
1627
1627
  "aria-label": m,
1628
1628
  children: [
1629
1629
  /* @__PURE__ */ n("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ n("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
1630
- ie && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: m })
1630
+ X && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: m })
1631
1631
  ]
1632
1632
  }
1633
1633
  ),
1634
- !ie && /* @__PURE__ */ w("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1635
- l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
1634
+ !X && /* @__PURE__ */ w("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1635
+ i && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: i }) }),
1636
1636
  /* @__PURE__ */ n(
1637
1637
  "button",
1638
1638
  {
1639
1639
  type: "button",
1640
1640
  className: "ll-expanded__cta",
1641
- onClick: Ke,
1641
+ onClick: Qe,
1642
1642
  "aria-label": m,
1643
1643
  children: m
1644
1644
  }
@@ -1649,64 +1649,64 @@ const Hr = ({
1649
1649
  /* @__PURE__ */ w(
1650
1650
  "div",
1651
1651
  {
1652
- className: `ll-expanded__pip ${Oe && (q || B) ? "is-visible" : ""}`,
1652
+ className: `ll-expanded__pip ${We && (F || M) ? "is-visible" : ""}`,
1653
1653
  children: [
1654
1654
  /* @__PURE__ */ n(
1655
1655
  "div",
1656
1656
  {
1657
1657
  ref: ue,
1658
- className: B ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1658
+ className: M ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1659
1659
  }
1660
1660
  ),
1661
1661
  /* @__PURE__ */ n(
1662
1662
  "div",
1663
1663
  {
1664
- ref: et,
1665
- className: !B && q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1664
+ ref: nt,
1665
+ className: !M && F ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1666
1666
  }
1667
1667
  )
1668
1668
  ]
1669
1669
  }
1670
1670
  ),
1671
- Oe ? /* @__PURE__ */ w("div", { className: "ll-expanded__bottom", children: [
1672
- !ie && rt && /* @__PURE__ */ n(
1671
+ We ? /* @__PURE__ */ w("div", { className: "ll-expanded__bottom", children: [
1672
+ !X && it && /* @__PURE__ */ n(
1673
1673
  "div",
1674
1674
  {
1675
1675
  className: "ll-expanded__transcript ll-expanded__transcript--agent",
1676
1676
  "data-role": "agent",
1677
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: rt })
1677
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: it })
1678
1678
  }
1679
1679
  ),
1680
- !ie && qe && /* @__PURE__ */ n(
1680
+ !X && je && /* @__PURE__ */ n(
1681
1681
  "div",
1682
1682
  {
1683
1683
  className: "ll-expanded__transcript ll-expanded__transcript--user",
1684
1684
  "data-role": "user",
1685
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: qe })
1685
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: je })
1686
1686
  }
1687
1687
  ),
1688
- !ve && !ie && /* @__PURE__ */ w("div", { className: "ll-toolbar", onClick: (m) => m.stopPropagation(), children: [
1689
- K && /* @__PURE__ */ n(
1688
+ !Y && !X && /* @__PURE__ */ w("div", { className: "ll-toolbar", onClick: (m) => m.stopPropagation(), children: [
1689
+ ze && /* @__PURE__ */ n(
1690
1690
  "button",
1691
1691
  {
1692
1692
  type: "button",
1693
- className: `ll-tool ${B ? "is-on" : ""}`,
1694
- onClick: Ae,
1695
- "aria-label": B ? "Stop sharing screen" : "Share screen",
1696
- title: B ? "Stop sharing" : "Share screen",
1697
- children: /* @__PURE__ */ n(kn, {})
1693
+ className: `ll-tool ${M ? "is-on" : ""}`,
1694
+ onClick: Ie,
1695
+ "aria-label": M ? "Stop sharing screen" : "Share screen",
1696
+ title: M ? "Stop sharing" : "Share screen",
1697
+ children: /* @__PURE__ */ n(Cn, {})
1698
1698
  }
1699
1699
  ),
1700
- _e && /* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
1700
+ ie && /* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
1701
1701
  /* @__PURE__ */ n(
1702
1702
  "button",
1703
1703
  {
1704
1704
  type: "button",
1705
- className: `ll-tool ll-tool--left ${q ? "is-on" : ""}`,
1706
- onClick: Ne,
1707
- "aria-label": q ? "Turn off camera" : "Turn on camera",
1708
- title: q ? "Stop camera" : "Start camera",
1709
- children: /* @__PURE__ */ n(Ln, {})
1705
+ className: `ll-tool ll-tool--left ${F ? "is-on" : ""}`,
1706
+ onClick: Ae,
1707
+ "aria-label": F ? "Turn off camera" : "Turn on camera",
1708
+ title: F ? "Stop camera" : "Start camera",
1709
+ children: /* @__PURE__ */ n(En, {})
1710
1710
  }
1711
1711
  ),
1712
1712
  /* @__PURE__ */ n(
@@ -1714,25 +1714,25 @@ const Hr = ({
1714
1714
  {
1715
1715
  ref: ht,
1716
1716
  type: "button",
1717
- className: `ll-tool ll-tool--right ${q ? "is-on" : ""}`,
1717
+ className: `ll-tool ll-tool--right ${F ? "is-on" : ""}`,
1718
1718
  onClick: (m) => {
1719
- m.stopPropagation(), le((Y) => !Y), We(!1);
1719
+ m.stopPropagation(), le((G) => !G), Ue(!1);
1720
1720
  },
1721
1721
  "aria-label": "Camera devices",
1722
1722
  "aria-haspopup": "listbox",
1723
- "aria-expanded": te,
1723
+ "aria-expanded": ne,
1724
1724
  children: /* @__PURE__ */ n(bt, {})
1725
1725
  }
1726
1726
  ),
1727
- te && M.length > 0 && /* @__PURE__ */ n(
1727
+ ne && B.length > 0 && /* @__PURE__ */ n(
1728
1728
  pn,
1729
1729
  {
1730
1730
  label: "Camera",
1731
- devices: M,
1731
+ devices: B,
1732
1732
  activeId: U,
1733
1733
  anchorRef: ht,
1734
1734
  onPick: (m) => {
1735
- le(!1), ze(m);
1735
+ le(!1), Be(m);
1736
1736
  }
1737
1737
  }
1738
1738
  )
@@ -1742,11 +1742,11 @@ const Hr = ({
1742
1742
  "button",
1743
1743
  {
1744
1744
  type: "button",
1745
- className: `ll-tool ll-tool--left ${F ? "is-muted" : ""}`,
1746
- onClick: Se,
1747
- "aria-label": F ? "Unmute microphone" : "Mute microphone",
1748
- title: F ? "Unmute" : "Mute",
1749
- children: /* @__PURE__ */ n(Cn, { muted: F })
1745
+ className: `ll-tool ll-tool--left ${q ? "is-muted" : ""}`,
1746
+ onClick: Ne,
1747
+ "aria-label": q ? "Unmute microphone" : "Mute microphone",
1748
+ title: q ? "Unmute" : "Mute",
1749
+ children: /* @__PURE__ */ n(Sn, { muted: q })
1750
1750
  }
1751
1751
  ),
1752
1752
  /* @__PURE__ */ n(
@@ -1754,17 +1754,17 @@ const Hr = ({
1754
1754
  {
1755
1755
  ref: pt,
1756
1756
  type: "button",
1757
- className: `ll-tool ll-tool--right ${F ? "is-muted" : ""}`,
1757
+ className: `ll-tool ll-tool--right ${q ? "is-muted" : ""}`,
1758
1758
  onClick: (m) => {
1759
- m.stopPropagation(), We((Y) => !Y), le(!1);
1759
+ m.stopPropagation(), Ue((G) => !G), le(!1);
1760
1760
  },
1761
1761
  "aria-label": "Microphone devices",
1762
1762
  "aria-haspopup": "listbox",
1763
- "aria-expanded": Be,
1763
+ "aria-expanded": qe,
1764
1764
  children: /* @__PURE__ */ n(bt, {})
1765
1765
  }
1766
1766
  ),
1767
- Be && P.length > 0 && /* @__PURE__ */ n(
1767
+ qe && P.length > 0 && /* @__PURE__ */ n(
1768
1768
  pn,
1769
1769
  {
1770
1770
  label: "Microphone",
@@ -1772,7 +1772,7 @@ const Hr = ({
1772
1772
  activeId: H,
1773
1773
  anchorRef: pt,
1774
1774
  onPick: (m) => {
1775
- We(!1), $e(m);
1775
+ Ue(!1), He(m);
1776
1776
  }
1777
1777
  }
1778
1778
  )
@@ -1781,11 +1781,11 @@ const Hr = ({
1781
1781
  "button",
1782
1782
  {
1783
1783
  type: "button",
1784
- className: `ll-tool ${oe ? "is-muted" : ""}`,
1784
+ className: `ll-tool ${ye ? "is-muted" : ""}`,
1785
1785
  onClick: Re,
1786
- "aria-label": oe ? "Unmute speaker" : "Mute speaker",
1787
- title: oe ? "Unmute speaker" : "Mute speaker",
1788
- children: /* @__PURE__ */ n(En, { muted: oe })
1786
+ "aria-label": ye ? "Unmute speaker" : "Mute speaker",
1787
+ title: ye ? "Unmute speaker" : "Mute speaker",
1788
+ children: /* @__PURE__ */ n(Nn, { muted: ye })
1789
1789
  }
1790
1790
  ),
1791
1791
  /* @__PURE__ */ n(
@@ -1793,33 +1793,33 @@ const Hr = ({
1793
1793
  {
1794
1794
  type: "button",
1795
1795
  className: "ll-tool ll-tool--danger",
1796
- onClick: Xe,
1796
+ onClick: Ze,
1797
1797
  "aria-label": "End conversation",
1798
1798
  title: "End conversation",
1799
- children: /* @__PURE__ */ n(Sn, {})
1799
+ children: /* @__PURE__ */ n(An, {})
1800
1800
  }
1801
1801
  )
1802
1802
  ] }),
1803
- !ve && ie && /* @__PURE__ */ n(
1804
- $r,
1803
+ !Y && X && /* @__PURE__ */ n(
1804
+ Or,
1805
1805
  {
1806
- isMuted: F,
1807
- onToggleMute: Se,
1808
- isCameraEnabled: q,
1809
- onToggleCamera: Ne,
1810
- allowCamera: _e,
1811
- isScreenShareEnabled: B,
1812
- onToggleScreenShare: Ae,
1813
- allowScreenShare: K,
1814
- isSpeakerMuted: oe,
1806
+ isMuted: q,
1807
+ onToggleMute: Ne,
1808
+ isCameraEnabled: F,
1809
+ onToggleCamera: Ae,
1810
+ allowCamera: ie,
1811
+ isScreenShareEnabled: M,
1812
+ onToggleScreenShare: Ie,
1813
+ allowScreenShare: ze,
1814
+ isSpeakerMuted: ye,
1815
1815
  onToggleSpeaker: Re,
1816
- allowTyping: xe,
1817
- isTypingOpen: Ce,
1818
- onToggleTyping: re,
1819
- onDisconnect: Xe
1816
+ allowTyping: Oe,
1817
+ isTypingOpen: Le,
1818
+ onToggleTyping: oe,
1819
+ onDisconnect: Ze
1820
1820
  }
1821
1821
  ),
1822
- !ve && xe && (ie ? Ce : !0) && /* @__PURE__ */ w("form", { className: "ll-message-input", onSubmit: nt, children: [
1822
+ !Y && Oe && (X ? Le : !0) && /* @__PURE__ */ w("form", { className: "ll-message-input", onSubmit: ot, children: [
1823
1823
  /* @__PURE__ */ n(
1824
1824
  "input",
1825
1825
  {
@@ -1827,7 +1827,7 @@ const Hr = ({
1827
1827
  className: "ll-message-input__field",
1828
1828
  placeholder: "Message...",
1829
1829
  value: ae,
1830
- onChange: (m) => Ee(m.target.value),
1830
+ onChange: (m) => Ce(m.target.value),
1831
1831
  "aria-label": "Message the agent"
1832
1832
  }
1833
1833
  ),
@@ -1837,7 +1837,7 @@ const Hr = ({
1837
1837
  type: "submit",
1838
1838
  className: "ll-message-input__send",
1839
1839
  "aria-label": "Send message",
1840
- children: /* @__PURE__ */ n(Br, {})
1840
+ children: /* @__PURE__ */ n(Fr, {})
1841
1841
  }
1842
1842
  )
1843
1843
  ] })
@@ -1851,14 +1851,14 @@ const Hr = ({
1851
1851
  {
1852
1852
  type: "button",
1853
1853
  className: "ll-expanded__banner-x",
1854
- onClick: kt,
1854
+ onClick: xt,
1855
1855
  "aria-label": "Dismiss",
1856
1856
  children: "×"
1857
1857
  }
1858
1858
  )
1859
1859
  ] });
1860
1860
  if (!A || _ !== "error") return null;
1861
- let m = "Failed to connect", Y = "Try again";
1861
+ let m = "Failed to connect", G = "Try again";
1862
1862
  return A === "MIC_PERMISSION_DENIED" ? m = "Microphone blocked. Allow access to talk." : A === "MIC_NOT_FOUND" ? m = "No microphone found. Plug one in + retry." : A === "MIC_UNAVAILABLE" ? m = "Mic unavailable. Check other apps using it." : A === "AGENT_TIMEOUT" ? m = "Agent didn't pick up. Try again." : A === "CONNECT_FAILED" ? m = "Connection failed. Check your network." : A.length < 80 && (m = A), /* @__PURE__ */ w("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1863
1863
  /* @__PURE__ */ n("span", { children: m }),
1864
1864
  /* @__PURE__ */ n(
@@ -1867,7 +1867,7 @@ const Hr = ({
1867
1867
  type: "button",
1868
1868
  className: "ll-expanded__banner-retry",
1869
1869
  onClick: ft,
1870
- children: Y
1870
+ children: G
1871
1871
  }
1872
1872
  )
1873
1873
  ] });
@@ -1888,20 +1888,20 @@ function un() {
1888
1888
  function fn() {
1889
1889
  return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
1890
1890
  }
1891
- function kn() {
1891
+ function Cn() {
1892
1892
  return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1893
1893
  /* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
1894
1894
  /* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
1895
1895
  /* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
1896
1896
  ] });
1897
1897
  }
1898
- function Ln() {
1898
+ function En() {
1899
1899
  return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1900
1900
  /* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
1901
1901
  /* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
1902
1902
  ] });
1903
1903
  }
1904
- function Cn({ muted: e }) {
1904
+ function Sn({ muted: e }) {
1905
1905
  return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1906
1906
  /* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
1907
1907
  /* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
@@ -1909,22 +1909,22 @@ function Cn({ muted: e }) {
1909
1909
  e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
1910
1910
  ] });
1911
1911
  }
1912
- function En({ muted: e }) {
1912
+ function Nn({ muted: e }) {
1913
1913
  return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1914
1914
  /* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1915
- e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ w(Pe, { children: [
1915
+ e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ w($e, { children: [
1916
1916
  /* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
1917
1917
  /* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
1918
1918
  ] })
1919
1919
  ] });
1920
1920
  }
1921
- function Br() {
1921
+ function Fr() {
1922
1922
  return /* @__PURE__ */ w("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1923
1923
  /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
1924
1924
  /* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
1925
1925
  ] });
1926
1926
  }
1927
- function Sn() {
1927
+ function An() {
1928
1928
  return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
1929
1929
  "path",
1930
1930
  {
@@ -1938,12 +1938,12 @@ const pn = ({
1938
1938
  devices: t,
1939
1939
  activeId: r,
1940
1940
  onPick: o,
1941
- anchorRef: i
1941
+ anchorRef: l
1942
1942
  }) => {
1943
- const [l, s] = E(null);
1944
- return wn(() => {
1943
+ const [i, s] = E(null);
1944
+ return xn(() => {
1945
1945
  const a = () => {
1946
- const c = i.current;
1946
+ const c = l.current;
1947
1947
  if (!c) return;
1948
1948
  const p = c.getBoundingClientRect(), v = 126, f = window.innerWidth - 16 - 110, u = p.left + p.width / 2;
1949
1949
  s({
@@ -1954,7 +1954,7 @@ const pn = ({
1954
1954
  return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
1955
1955
  window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
1956
1956
  };
1957
- }, [i]), l === null || typeof document > "u" ? null : Pt(
1957
+ }, [l]), i === null || typeof document > "u" ? null : Pt(
1958
1958
  /* @__PURE__ */ w(
1959
1959
  "div",
1960
1960
  {
@@ -1963,8 +1963,8 @@ const pn = ({
1963
1963
  role: "listbox",
1964
1964
  style: {
1965
1965
  position: "fixed",
1966
- top: l.top,
1967
- left: l.left,
1966
+ top: i.top,
1967
+ left: i.left,
1968
1968
  // translate up by 100% so its BOTTOM edge sits at pos.top.
1969
1969
  transform: "translate(-50%, -100%)"
1970
1970
  },
@@ -1993,7 +1993,7 @@ const pn = ({
1993
1993
  ),
1994
1994
  document.body
1995
1995
  );
1996
- }, Wr = [
1996
+ }, qr = [
1997
1997
  // Accept any value (or empty) — `<input data-ll-private />` and
1998
1998
  // `<input data-ll-private="true" />` both opt out. The bare attribute
1999
1999
  // is the recommended spelling; "true" is preserved for back-compat.
@@ -2004,13 +2004,13 @@ const pn = ({
2004
2004
  function $t(e) {
2005
2005
  let t = e;
2006
2006
  for (; t; ) {
2007
- for (const r of Wr)
2007
+ for (const r of qr)
2008
2008
  if (t.matches(r)) return !0;
2009
2009
  t = t.parentElement;
2010
2010
  }
2011
2011
  return !1;
2012
2012
  }
2013
- function xt(e) {
2013
+ function Tt(e) {
2014
2014
  if ($t(e)) return !1;
2015
2015
  if (e instanceof HTMLInputElement) {
2016
2016
  if (e.type === "password") return !1;
@@ -2019,7 +2019,7 @@ function xt(e) {
2019
2019
  }
2020
2020
  return !0;
2021
2021
  }
2022
- const wt = 4096, qr = 20, Fr = 20, Ur = 10, jr = 10, Vr = 30, Yr = 20, hn = 500, Gr = [
2022
+ const wt = 4096, Ur = 20, jr = 20, Vr = 10, Yr = 10, Gr = 30, Kr = 20, hn = 500, Jr = [
2023
2023
  '[data-ll-private="true"]',
2024
2024
  ".ll-widget",
2025
2025
  "script",
@@ -2027,17 +2027,17 @@ const wt = 4096, qr = 20, Fr = 20, Ur = 10, jr = 10, Vr = 30, Yr = 20, hn = 500,
2027
2027
  "noscript",
2028
2028
  "iframe"
2029
2029
  ];
2030
- function st(e) {
2030
+ function dt(e) {
2031
2031
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
2032
2032
  let t = e;
2033
2033
  for (; t; ) {
2034
- for (const r of Gr)
2034
+ for (const r of Jr)
2035
2035
  if (t.matches(r)) return !0;
2036
2036
  t = t.parentElement;
2037
2037
  }
2038
2038
  return !1;
2039
2039
  }
2040
- function ct(e) {
2040
+ function ut(e) {
2041
2041
  if (typeof window > "u") return !0;
2042
2042
  const t = e.getBoundingClientRect();
2043
2043
  if (t.width <= 0 || t.height <= 0) return !1;
@@ -2047,41 +2047,41 @@ function ct(e) {
2047
2047
  function mn(e) {
2048
2048
  const t = e.getAttribute("id");
2049
2049
  if (t) {
2050
- const l = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${l}"]`);
2050
+ const i = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${i}"]`);
2051
2051
  if (s != null && s.textContent) return s.textContent.trim();
2052
2052
  }
2053
2053
  const r = e.getAttribute("aria-label");
2054
2054
  if (r) return r.trim();
2055
2055
  const o = e.getAttribute("placeholder");
2056
2056
  if (o) return o.trim();
2057
- const i = e.closest("label");
2058
- return i != null && i.textContent ? i.textContent.trim() : "";
2057
+ const l = e.closest("label");
2058
+ return l != null && l.textContent ? l.textContent.trim() : "";
2059
2059
  }
2060
- function we(e, t) {
2060
+ function xe(e, t) {
2061
2061
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
2062
2062
  }
2063
- function Jr(e) {
2063
+ function Xr(e) {
2064
2064
  return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2065
2065
  }
2066
- function Kr(e) {
2066
+ function Qr(e) {
2067
2067
  const t = e.getAttribute("aria-label");
2068
2068
  if (t) return t.trim().slice(0, 80);
2069
2069
  const r = e.getAttribute("aria-labelledby");
2070
2070
  if (r) {
2071
- const l = document.getElementById(r);
2072
- if (l != null && l.textContent) return l.textContent.trim().slice(0, 80);
2071
+ const i = document.getElementById(r);
2072
+ if (i != null && i.textContent) return i.textContent.trim().slice(0, 80);
2073
2073
  }
2074
2074
  const o = e.querySelector(
2075
2075
  'button[type="submit"], input[type="submit"], button:not([type])'
2076
2076
  );
2077
2077
  if (o) {
2078
- const l = o instanceof HTMLInputElement ? o.value : (o.textContent ?? "").trim();
2079
- if (l && l.length < 60 && !/^(submit|ok|continue)$/i.test(l))
2080
- return l;
2078
+ const i = o instanceof HTMLInputElement ? o.value : (o.textContent ?? "").trim();
2079
+ if (i && i.length < 60 && !/^(submit|ok|continue)$/i.test(i))
2080
+ return i;
2081
2081
  }
2082
- let i = e.parentElement;
2083
- for (let l = 0; i && l < 4; l++, i = i.parentElement) {
2084
- const s = i.querySelector("h1, h2, h3, h4");
2082
+ let l = e.parentElement;
2083
+ for (let i = 0; l && i < 4; i++, l = l.parentElement) {
2084
+ const s = l.querySelector("h1, h2, h3, h4");
2085
2085
  if (s != null && s.textContent) {
2086
2086
  const a = s.textContent.trim();
2087
2087
  if (a && a.length < 80) return a;
@@ -2089,10 +2089,10 @@ function Kr(e) {
2089
2089
  }
2090
2090
  return null;
2091
2091
  }
2092
- function je(e) {
2092
+ function Ge(e) {
2093
2093
  return e.length;
2094
2094
  }
2095
- function Xr(e, t = {}) {
2095
+ function Zr(e, t = {}) {
2096
2096
  const r = t.doc ?? (typeof document < "u" ? document : null);
2097
2097
  if (!r)
2098
2098
  return {
@@ -2106,39 +2106,39 @@ function Xr(e, t = {}) {
2106
2106
  forms: [],
2107
2107
  extras: e
2108
2108
  };
2109
- const o = typeof window < "u" && window.location.href || "", i = typeof window < "u" && window.location.pathname || "/", l = r.title || "", s = Array.from(
2109
+ const o = typeof window < "u" && window.location.href || "", l = typeof window < "u" && window.location.pathname || "/", i = r.title || "", s = Array.from(
2110
2110
  r.querySelectorAll("[data-ll-region]")
2111
2111
  ), a = [];
2112
2112
  for (const g of s) {
2113
- if (a.length >= Ur) break;
2114
- if (st(g) || !ct(g)) continue;
2115
- const P = g.getAttribute("data-ll-region") ?? "", H = g.getAttribute("data-ll-intent") ?? void 0, q = we(
2113
+ if (a.length >= Vr) break;
2114
+ if (dt(g) || !ut(g)) continue;
2115
+ const P = g.getAttribute("data-ll-region") ?? "", H = g.getAttribute("data-ll-intent") ?? void 0, F = xe(
2116
2116
  (g.innerText || g.textContent || "").trim(),
2117
2117
  hn * 2
2118
2118
  );
2119
- !P || !q || a.push({ id: P, intent: H, text: q });
2119
+ !P || !F || a.push({ id: P, intent: H, text: F });
2120
2120
  }
2121
2121
  const c = [], p = ["H1", "H2", "H3", "H4", "H5", "H6"], v = Array.from(
2122
2122
  r.querySelectorAll("h1, h2, h3, h4, h5, h6")
2123
2123
  );
2124
2124
  for (const g of v) {
2125
- if (st(g) || !ct(g)) continue;
2125
+ if (dt(g) || !ut(g)) continue;
2126
2126
  const P = (g.textContent || "").trim();
2127
- P && c.push(`${g.tagName}: ${we(P, 200)}`);
2127
+ P && c.push(`${g.tagName}: ${xe(P, 200)}`);
2128
2128
  }
2129
2129
  const f = Array.from(r.querySelectorAll("p, li"));
2130
2130
  for (const g of f) {
2131
- if (st(g) || !ct(g) || p.includes(g.tagName)) continue;
2131
+ if (dt(g) || !ut(g) || p.includes(g.tagName)) continue;
2132
2132
  const P = (g.textContent || "").trim();
2133
- P.length > 10 && c.push(we(P, hn));
2133
+ P.length > 10 && c.push(xe(P, hn));
2134
2134
  }
2135
2135
  const u = c.join(`
2136
- `), R = [], L = Array.from(r.querySelectorAll("a[href]"));
2136
+ `), I = [], L = Array.from(r.querySelectorAll("a[href]"));
2137
2137
  for (const g of L) {
2138
- if (R.length >= qr) break;
2139
- if (st(g) || !ct(g)) continue;
2138
+ if (I.length >= Ur) break;
2139
+ if (dt(g) || !ut(g)) continue;
2140
2140
  const P = g.getAttribute("href") || "", H = (g.textContent || "").trim();
2141
- !P || !H || R.push({ href: P, text: we(H, 100) });
2141
+ !P || !H || I.push({ href: P, text: xe(H, 100) });
2142
2142
  }
2143
2143
  const _ = [], h = Array.from(
2144
2144
  r.querySelectorAll(
@@ -2146,81 +2146,84 @@ function Xr(e, t = {}) {
2146
2146
  )
2147
2147
  );
2148
2148
  for (const g of h) {
2149
- if (_.length >= Fr) break;
2150
- if (st(g) || !xt(g) || !ct(g)) continue;
2149
+ if (_.length >= jr) break;
2150
+ if (dt(g) || !Tt(g) || !ut(g)) continue;
2151
2151
  const P = mn(g), H = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
2152
- P && _.push({ label: we(P, 100), type: H });
2152
+ P && _.push({ label: xe(P, 100), type: H });
2153
2153
  }
2154
2154
  const b = Array.from(r.querySelectorAll("form")), S = [];
2155
2155
  let T = 0;
2156
2156
  for (const g of b) {
2157
- if (S.length >= jr) break;
2157
+ if (S.length >= Yr) break;
2158
2158
  if ($t(g) || g.matches(".ll-widget *, .ll-widget")) continue;
2159
- const P = g.getAttribute("id") || g.getAttribute("name") || Jr(g.getAttribute("data-ll-intent")) || `form_${T++}`, H = g.getAttribute("data-ll-intent") || Kr(g) || void 0, q = Array.from(
2159
+ const P = g.getAttribute("id") || g.getAttribute("name") || Xr(g.getAttribute("data-ll-intent")) || `form_${T++}`, H = g.getAttribute("data-ll-intent") || Qr(g) || void 0, F = Array.from(
2160
2160
  g.querySelectorAll(
2161
- "input[name], textarea[name], select[name]"
2161
+ "input, textarea, select"
2162
2162
  )
2163
- ), Z = [];
2164
- for (const M of q) {
2165
- if (Z.length >= Vr) break;
2166
- if (!xt(M)) continue;
2163
+ ), ee = [];
2164
+ let B = 0;
2165
+ const U = /* @__PURE__ */ new Set();
2166
+ for (const M of F) {
2167
+ if (ee.length >= Gr) break;
2168
+ if (!Tt(M)) continue;
2167
2169
  if (M instanceof HTMLInputElement) {
2168
- const K = M.type;
2169
- if (K === "submit" || K === "button" || K === "reset" || K === "hidden" || K === "image" || K === "file") continue;
2170
+ const Y = M.type;
2171
+ if (Y === "submit" || Y === "button" || Y === "reset" || Y === "hidden" || Y === "image" || Y === "file") continue;
2170
2172
  }
2171
- const U = M.getAttribute("name") || "";
2172
- if (!U) continue;
2173
- const B = mn(M) || U, J = M instanceof HTMLInputElement ? M.type : M.tagName.toLowerCase(), oe = {
2174
- name: U,
2175
- label: we(B, 100),
2176
- type: J
2173
+ const J = M.getAttribute("name") || "", ye = M.getAttribute("id") || "";
2174
+ let ie = J || ye || `field_${B}`;
2175
+ U.has(ie) && (ie = `${ie}__${B}`), U.add(ie), B++;
2176
+ const ze = mn(M) || ie, Oe = M instanceof HTMLInputElement ? M.type : M.tagName.toLowerCase(), ve = {
2177
+ name: ie,
2178
+ label: xe(ze, 100),
2179
+ type: Oe
2177
2180
  };
2178
- if (M.required === !0 && (oe.required = !0), M instanceof HTMLSelectElement) {
2179
- const K = [];
2180
- for (let xe = 0; xe < M.options.length && !(K.length >= Yr); xe++) {
2181
- const ye = M.options[xe];
2182
- if (!ye || ye.disabled) continue;
2183
- const ke = ye.value || "", ve = (ye.textContent || "").trim() || ke;
2184
- !ke && !ve || K.push({ value: ke, label: we(ve, 60) });
2181
+ if (M.required === !0 && (ve.required = !0), M instanceof HTMLSelectElement) {
2182
+ const Y = [];
2183
+ for (let X = 0; X < M.options.length && !(Y.length >= Kr); X++) {
2184
+ const be = M.options[X];
2185
+ if (!be || be.disabled) continue;
2186
+ const we = be.value || "", Se = (be.textContent || "").trim() || we;
2187
+ !we && !Se || Y.push({ value: we, label: xe(Se, 60) });
2185
2188
  }
2186
- K.length > 0 && (oe.options = K);
2189
+ Y.length > 0 && (ve.options = Y);
2187
2190
  }
2188
- const _e = typeof M.validationMessage == "string" ? M.validationMessage : "";
2189
- _e && (oe.validationMessage = we(_e, 200)), Z.push(oe);
2191
+ const Ee = typeof M.validationMessage == "string" ? M.validationMessage : "";
2192
+ Ee && (ve.validationMessage = xe(Ee, 200)), ee.push(ve);
2190
2193
  }
2191
- S.push({ id: P, intent: H, fields: Z });
2194
+ S.push({ id: P, intent: H, fields: ee });
2192
2195
  }
2193
2196
  const A = {
2194
2197
  url: o,
2195
- title: l,
2196
- pathname: i,
2198
+ title: i,
2199
+ pathname: l,
2197
2200
  regions: a,
2198
2201
  visibleText: u,
2199
- visibleLinks: R,
2202
+ visibleLinks: I,
2200
2203
  visibleFields: _,
2201
2204
  forms: S,
2202
2205
  extras: e
2203
2206
  };
2204
- let F = je(JSON.stringify(A.regions)) + je(A.visibleText) + je(JSON.stringify(A.visibleLinks)) + je(JSON.stringify(A.visibleFields));
2205
- for (; F > wt && A.visibleFields.length > 0; )
2206
- A.visibleFields.pop(), F = je(JSON.stringify(A.visibleFields));
2207
- for (; F > wt && A.visibleLinks.length > 0; )
2208
- A.visibleLinks.pop(), F -= 80;
2209
- return je(A.visibleText) > wt && (A.visibleText = we(A.visibleText, wt - 100)), A;
2210
- }
2211
- let Ve = null;
2207
+ let q = Ge(JSON.stringify(A.regions)) + Ge(A.visibleText) + Ge(JSON.stringify(A.visibleLinks)) + Ge(JSON.stringify(A.visibleFields));
2208
+ for (; q > wt && A.visibleFields.length > 0; )
2209
+ A.visibleFields.pop(), q = Ge(JSON.stringify(A.visibleFields));
2210
+ for (; q > wt && A.visibleLinks.length > 0; )
2211
+ A.visibleLinks.pop(), q -= 80;
2212
+ return Ge(A.visibleText) > wt && (A.visibleText = xe(A.visibleText, wt - 100)), A;
2213
+ }
2214
+ let Ke = null;
2212
2215
  function gn(e, t = {}) {
2213
- const r = Date.now(), i = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
2214
- if (Ve && Ve.key === i && r - Ve.at < 1e3)
2215
- return Ve.ctx;
2216
- const l = Xr(e, t);
2217
- return Ve = { key: i, at: r, ctx: l }, l;
2216
+ const r = Date.now(), l = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
2217
+ if (Ke && Ke.key === l && r - Ke.at < 1e3)
2218
+ return Ke.ctx;
2219
+ const i = Zr(e, t);
2220
+ return Ke = { key: l, at: r, ctx: i }, i;
2218
2221
  }
2219
- function Qr() {
2220
- Ve = null;
2222
+ function eo() {
2223
+ Ke = null;
2221
2224
  }
2222
- const Zr = 200;
2223
- function eo(e) {
2225
+ const to = 200;
2226
+ function no(e) {
2224
2227
  const t = String(e.href || "");
2225
2228
  return {
2226
2229
  href: t,
@@ -2230,18 +2233,18 @@ function eo(e) {
2230
2233
  description: e.description
2231
2234
  };
2232
2235
  }
2233
- function to(e) {
2236
+ function ro(e) {
2234
2237
  return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
2235
2238
  }
2236
- function no(e) {
2239
+ function oo(e) {
2237
2240
  const t = e ?? (typeof document < "u" ? document : null);
2238
2241
  if (!t) return [];
2239
- const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), i = [], l = Array.from(t.querySelectorAll("a[href]"));
2240
- for (const s of l) {
2241
- if (i.length >= Zr) break;
2242
+ const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), l = [], i = Array.from(t.querySelectorAll("a[href]"));
2243
+ for (const s of i) {
2244
+ if (l.length >= to) break;
2242
2245
  if ($t(s)) continue;
2243
2246
  const a = s.getAttribute("href") || "";
2244
- if (!to(a)) continue;
2247
+ if (!ro(a)) continue;
2245
2248
  let c = a, p = !0;
2246
2249
  try {
2247
2250
  if (typeof window < "u") {
@@ -2254,39 +2257,77 @@ function no(e) {
2254
2257
  if (o.has(c)) continue;
2255
2258
  o.add(c);
2256
2259
  const v = (s.textContent || "").trim().slice(0, 120);
2257
- i.push({ href: c, text: v, internal: p });
2260
+ l.push({ href: c, text: v, internal: p });
2258
2261
  }
2259
- return i;
2262
+ return l;
2260
2263
  }
2261
- let Ye = null;
2262
- const ro = 5e3;
2263
- function Mt() {
2264
+ let Je = null;
2265
+ const io = 5e3;
2266
+ function Rt() {
2264
2267
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
2265
- if (Ye && Ye.pathname === t && e - Ye.at < ro)
2266
- return Ye.routes;
2267
- const r = no();
2268
- return Ye = { at: e, pathname: t, routes: r }, r;
2268
+ if (Je && Je.pathname === t && e - Je.at < io)
2269
+ return Je.routes;
2270
+ const r = oo();
2271
+ return Je = { at: e, pathname: t, routes: r }, r;
2269
2272
  }
2270
- function oo() {
2271
- Ye = null;
2273
+ function lo() {
2274
+ Je = null;
2272
2275
  }
2273
- function io(e, t) {
2274
- const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, o = Object.getOwnPropertyDescriptor(r, "value"), i = o == null ? void 0 : o.set;
2275
- i ? i.call(e, t) : e.value = t;
2276
+ function yn(e) {
2277
+ if (e instanceof HTMLInputElement) {
2278
+ const t = e.type;
2279
+ if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
2280
+ return !1;
2281
+ }
2282
+ return !0;
2283
+ }
2284
+ function ao(e, t) {
2285
+ return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
2276
2286
  }
2277
- function lo(e, t, r = {}) {
2278
- const o = r.triggerInput ?? !0, i = r.triggerChange ?? !0;
2287
+ function so(e, t) {
2288
+ if (!t) return null;
2289
+ try {
2290
+ const i = e.querySelector(
2291
+ `[name="${t.replace(/"/g, '\\"')}"]`
2292
+ );
2293
+ if (i && yn(i)) return i;
2294
+ } catch {
2295
+ }
2296
+ const r = Array.from(
2297
+ e.querySelectorAll("input, textarea, select")
2298
+ );
2299
+ let o = 0;
2300
+ const l = /* @__PURE__ */ new Map();
2301
+ for (const i of r) {
2302
+ if (!yn(i)) continue;
2303
+ const s = ao(i, o);
2304
+ let a = s;
2305
+ if (l.has(s) && (a = `${s}__${o}`), a === t) return i;
2306
+ l.set(s, i), o++;
2307
+ }
2308
+ return null;
2309
+ }
2310
+ function vn(e, t) {
2311
+ const r = so(e, t);
2312
+ return r ? Tt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2313
+ }
2314
+ function co(e, t) {
2315
+ const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, o = Object.getOwnPropertyDescriptor(r, "value"), l = o == null ? void 0 : o.set;
2316
+ l ? l.call(e, t) : e.value = t;
2317
+ }
2318
+ function uo(e, t, r = {}) {
2319
+ const o = r.triggerInput ?? !0, l = r.triggerChange ?? !0;
2279
2320
  if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
2280
- const l = Object.getOwnPropertyDescriptor(
2321
+ const i = Object.getOwnPropertyDescriptor(
2281
2322
  HTMLInputElement.prototype,
2282
2323
  "checked"
2283
- ), s = l == null ? void 0 : l.set, a = t === "true" || t === "1" || t === "on";
2284
- s ? s.call(e, a) : e.checked = a, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2324
+ ), s = i == null ? void 0 : i.set, a = t === "true" || t === "1" || t === "on";
2325
+ s ? s.call(e, a) : e.checked = a, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2285
2326
  return;
2286
2327
  }
2287
- io(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2328
+ co(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2288
2329
  }
2289
- function yn(e, t) {
2330
+ function bn(e, t) {
2290
2331
  if (!t) return null;
2291
2332
  const r = t.replace(/"/g, '\\"');
2292
2333
  try {
@@ -2300,19 +2341,19 @@ function yn(e, t) {
2300
2341
  `form[name="${r}"]`
2301
2342
  );
2302
2343
  if (o) return o;
2303
- const i = e.querySelector(
2344
+ const l = e.querySelector(
2304
2345
  `form[data-ll-intent="${r}"]`
2305
2346
  );
2306
- if (i) return i;
2307
- const l = Array.from(e.querySelectorAll("form"));
2308
- for (const s of l) {
2347
+ if (l) return l;
2348
+ const i = Array.from(e.querySelectorAll("form"));
2349
+ for (const s of i) {
2309
2350
  const a = s.getAttribute("data-ll-intent");
2310
- if (a && ao(a) === t) return s;
2351
+ if (a && fo(a) === t) return s;
2311
2352
  }
2312
2353
  if (/^form_\d+$/.test(t)) {
2313
2354
  const s = parseInt(t.slice(5), 10);
2314
2355
  let a = 0;
2315
- for (const c of l)
2356
+ for (const c of i)
2316
2357
  if (!(c.id || c.getAttribute("name") || c.getAttribute("data-ll-intent"))) {
2317
2358
  if (a === s) return c;
2318
2359
  a++;
@@ -2320,10 +2361,10 @@ function yn(e, t) {
2320
2361
  }
2321
2362
  return null;
2322
2363
  }
2323
- function ao(e) {
2364
+ function fo(e) {
2324
2365
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2325
2366
  }
2326
- function so() {
2367
+ function po() {
2327
2368
  if (typeof window > "u" || typeof document > "u")
2328
2369
  return !1;
2329
2370
  const e = document.scrollingElement || document.documentElement;
@@ -2331,44 +2372,44 @@ function so() {
2331
2372
  const t = window.getComputedStyle(e);
2332
2373
  return !(t.overflowY === "hidden" || t.overflowY === "clip");
2333
2374
  }
2334
- function co(e) {
2375
+ function ho(e) {
2335
2376
  if (!(e instanceof HTMLElement)) return !1;
2336
2377
  const r = window.getComputedStyle(e).overflowY;
2337
2378
  return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
2338
2379
  }
2339
- function uo() {
2380
+ function mo() {
2340
2381
  if (typeof document > "u") return null;
2341
2382
  const e = Array.from(
2342
2383
  document.querySelectorAll("body, body *")
2343
2384
  );
2344
2385
  let t = null, r = 0;
2345
2386
  for (const o of e) {
2346
- if (!co(o)) continue;
2347
- const i = o.getBoundingClientRect();
2348
- if (i.bottom <= 0 || i.top >= window.innerHeight || i.right <= 0 || i.left >= window.innerWidth || i.width <= 0 || i.height <= 0 || o.closest(".ll-widget")) continue;
2349
- const l = i.width * i.height;
2350
- l > r && (r = l, t = o);
2387
+ if (!ho(o)) continue;
2388
+ const l = o.getBoundingClientRect();
2389
+ if (l.bottom <= 0 || l.top >= window.innerHeight || l.right <= 0 || l.left >= window.innerWidth || l.width <= 0 || l.height <= 0 || o.closest(".ll-widget")) continue;
2390
+ const i = l.width * l.height;
2391
+ i > r && (r = i, t = o);
2351
2392
  }
2352
2393
  return t;
2353
2394
  }
2354
- function fo() {
2395
+ function go() {
2355
2396
  if (typeof window > "u")
2356
2397
  return null;
2357
- if (so()) return window;
2358
- const e = uo();
2398
+ if (po()) return window;
2399
+ const e = mo();
2359
2400
  return e || window;
2360
2401
  }
2361
- function vn(e) {
2402
+ function wn(e) {
2362
2403
  return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
2363
2404
  }
2364
- function po(e) {
2405
+ function yo(e) {
2365
2406
  var t, r;
2366
2407
  return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
2367
2408
  ((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
2368
2409
  ((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
2369
2410
  ) : e.scrollHeight - e.clientHeight;
2370
2411
  }
2371
- const ho = /* @__PURE__ */ new Set([
2412
+ const vo = /* @__PURE__ */ new Set([
2372
2413
  "agent_state",
2373
2414
  "avatar_stream_ready",
2374
2415
  "avatar_active",
@@ -2398,13 +2439,13 @@ const ho = /* @__PURE__ */ new Set([
2398
2439
  // to onAgentCommand.
2399
2440
  "task_field_updated",
2400
2441
  "task_completed"
2401
- ]), Nn = Dt(
2442
+ ]), In = Dt(
2402
2443
  function(t, r) {
2403
- var Yt, Gt, Jt, Kt, Xt, Qt, Zt;
2444
+ var Yt, Gt, Kt, Jt, Xt, Qt, Zt;
2404
2445
  const {
2405
2446
  agentId: o,
2406
- apiKey: i,
2407
- baseUrl: l = "https://app.livelayer.studio",
2447
+ apiKey: l,
2448
+ baseUrl: i = "https://app.livelayer.studio",
2408
2449
  sessionEndpoint: s,
2409
2450
  sessionBody: a,
2410
2451
  soundEffects: c,
@@ -2412,7 +2453,7 @@ const ho = /* @__PURE__ */ new Set([
2412
2453
  autoConnect: v = !1,
2413
2454
  displayMode: f,
2414
2455
  defaultDisplayMode: u = "expanded",
2415
- onDisplayModeChange: R,
2456
+ onDisplayModeChange: I,
2416
2457
  position: L = "bottom-right",
2417
2458
  mobileBreakpoint: _ = 640,
2418
2459
  persistKey: h = "ll-widget",
@@ -2420,67 +2461,67 @@ const ho = /* @__PURE__ */ new Set([
2420
2461
  teamMembers: S,
2421
2462
  currentTeamMemberId: T,
2422
2463
  onTeamMemberChange: A,
2423
- idleLoopUrl: F,
2464
+ idleLoopUrl: q,
2424
2465
  greeting: g,
2425
2466
  avatarImageUrl: P,
2426
2467
  agentName: H,
2427
- branding: q = {},
2428
- allowCamera: Z = !0,
2429
- allowScreenShare: M = !0,
2468
+ branding: F = {},
2469
+ allowCamera: ee = !0,
2470
+ allowScreenShare: B = !0,
2430
2471
  allowTyping: U = !0,
2431
- showMinimize: B,
2472
+ showMinimize: M,
2432
2473
  showClose: J,
2433
- chromeless: oe = !1,
2434
- floatingChromeContainer: _e = null,
2435
- compactControls: K = !1,
2436
- transforming: xe = !1,
2437
- transformingLabel: ye = "Transforming…",
2438
- showOn: ke,
2439
- hideOn: ve,
2440
- pathname: ie,
2441
- onNavigate: dt,
2442
- onScrollToSelector: Je,
2443
- getPageContext: ut,
2474
+ chromeless: ye = !1,
2475
+ floatingChromeContainer: ie = null,
2476
+ compactControls: ze = !1,
2477
+ transforming: Oe = !1,
2478
+ transformingLabel: ve = "Transforming…",
2479
+ showOn: Ee,
2480
+ hideOn: Y,
2481
+ pathname: X,
2482
+ onNavigate: be,
2483
+ onScrollToSelector: we,
2484
+ getPageContext: Se,
2444
2485
  pageContextExtras: se,
2445
- getRoutes: Ke,
2446
- onScrollPage: Xe,
2486
+ getRoutes: Qe,
2487
+ onScrollPage: Ze,
2447
2488
  onClick: ft,
2448
- capabilities: Qe,
2449
- onConnect: Se,
2450
- onDisconnect: $e,
2451
- onTranscript: Ne,
2452
- onAgentState: ze,
2453
- onConnectionStateChange: Ae,
2489
+ capabilities: et,
2490
+ onConnect: Ne,
2491
+ onDisconnect: He,
2492
+ onTranscript: Ae,
2493
+ onAgentState: Be,
2494
+ onConnectionStateChange: Ie,
2454
2495
  onAgentEvent: Re,
2455
- onAgentCommand: Ie,
2456
- onCollect: Me,
2496
+ onAgentCommand: Me,
2497
+ onCollect: Te,
2457
2498
  controlledSession: $,
2458
- className: kt,
2459
- style: Te,
2460
- zIndex: Oe = 2147483647
2461
- } = t, ce = mr(ie), Ze = xr(ce, ke, ve);
2462
- I(() => {
2463
- Qr(), oo();
2499
+ className: xt,
2500
+ style: De,
2501
+ zIndex: We = 2147483647
2502
+ } = t, ce = yr(X), tt = Lr(ce, Ee, Y);
2503
+ R(() => {
2504
+ eo(), lo();
2464
2505
  }, [ce]);
2465
- const De = T !== void 0, [He, Lt] = E(() => {
2506
+ const Pe = T !== void 0, [Fe, kt] = E(() => {
2466
2507
  var y;
2467
2508
  return T ?? ((y = S == null ? void 0 : S[0]) == null ? void 0 : y.id);
2468
- }), Le = De ? T : He, ee = Ge(
2469
- () => (S == null ? void 0 : S.find((y) => y.id === Le)) ?? null,
2470
- [S, Le]
2471
- ), et = (ee == null ? void 0 : ee.agentId) ?? o, ue = p === "EMBEDDED", [Be, We] = ur({
2509
+ }), ke = Pe ? T : Fe, te = Xe(
2510
+ () => (S == null ? void 0 : S.find((y) => y.id === ke)) ?? null,
2511
+ [S, ke]
2512
+ ), nt = (te == null ? void 0 : te.agentId) ?? o, ue = p === "EMBEDDED", [qe, Ue] = pr({
2472
2513
  value: f,
2473
2514
  defaultValue: u,
2474
- onChange: R,
2515
+ onChange: I,
2475
2516
  persistKey: h,
2476
2517
  disablePersistence: ue || b
2477
- }), te = ue ? "expanded" : Be, le = ue ? () => {
2478
- } : We, pt = B ?? !ue, ht = J ?? !ue, Ce = pr(_), tt = Zn(), re = er(), ae = nr(), Ee = rr(), nt = or(), [Ct, fe] = E(!1), [pe, rt] = E(!1), [qe, ot] = E(!1), [mt, m] = E(!1), [Y, An] = E(!1), gt = Lr({ baseUrl: l, config: c }), yt = N(gt);
2518
+ }), ne = ue ? "expanded" : qe, le = ue ? () => {
2519
+ } : Ue, pt = M ?? !ue, ht = J ?? !ue, Le = mr(_), rt = tr(), oe = nr(), ae = or(), Ce = ir(), ot = lr(), [Lt, fe] = E(!1), [pe, it] = E(!1), [je, lt] = E(!1), [mt, m] = E(!1), [G, Rn] = E(!1), gt = Er({ baseUrl: i, config: c }), yt = N(gt);
2479
2520
  yt.current = gt;
2480
- const Et = N(dt), St = N(Je), Nt = N(Xe), At = N(ft), zt = N(ut), Ot = N(se), Ht = N(Ke), Rt = N(Qe), he = N(null);
2481
- Et.current = dt, St.current = Je, Nt.current = Xe, At.current = ft, zt.current = ut, Ot.current = se, Ht.current = Ke, Rt.current = Qe;
2521
+ const Ct = N(be), Et = N(we), St = N(Ze), Nt = N(ft), zt = N(Se), Ot = N(se), Ht = N(Qe), At = N(et), he = N(null);
2522
+ Ct.current = be, Et.current = we, St.current = Ze, Nt.current = ft, zt.current = Se, Ot.current = se, Ht.current = Qe, At.current = et;
2482
2523
  function me(y) {
2483
- const d = Rt.current;
2524
+ const d = At.current;
2484
2525
  return d ? d.includes(y) : !0;
2485
2526
  }
2486
2527
  function ge(y, d) {
@@ -2488,9 +2529,9 @@ const ho = /* @__PURE__ */ new Set([
2488
2529
  `[LiveLayer] Agent command "${y}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
2489
2530
  );
2490
2531
  }
2491
- const it = C(
2532
+ const at = C(
2492
2533
  (y) => {
2493
- var G, de, be, at;
2534
+ var K, de, _e, ct;
2494
2535
  const d = y;
2495
2536
  if (!(!d.type || typeof d.type != "string")) {
2496
2537
  if (Re == null || Re({ eventName: d.type, data: y }), d.type === "navigate") {
@@ -2505,9 +2546,9 @@ const ho = /* @__PURE__ */ new Set([
2505
2546
  );
2506
2547
  return;
2507
2548
  }
2508
- if (yt.current.playPageChange(), Et.current) {
2549
+ if (yt.current.playPageChange(), Ct.current) {
2509
2550
  try {
2510
- Et.current(x);
2551
+ Ct.current(x);
2511
2552
  } catch (D) {
2512
2553
  console.warn(
2513
2554
  `[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
@@ -2544,9 +2585,9 @@ const ho = /* @__PURE__ */ new Set([
2544
2585
  const x = typeof d.selector == "string" ? d.selector : null;
2545
2586
  if (!x) return;
2546
2587
  const D = d.behavior === "instant" ? "instant" : "smooth";
2547
- if (St.current) {
2588
+ if (Et.current) {
2548
2589
  try {
2549
- St.current(
2590
+ Et.current(
2550
2591
  x,
2551
2592
  D
2552
2593
  );
@@ -2583,14 +2624,14 @@ const ho = /* @__PURE__ */ new Set([
2583
2624
  ge("request_page_context", "read_page");
2584
2625
  return;
2585
2626
  }
2586
- const x = typeof d.requestId == "string" ? d.requestId : void 0, D = (G = he.current) == null ? void 0 : G.call(he), W = (V) => {
2587
- const z = D, Q = z == null ? void 0 : z.localParticipant;
2588
- if (Q != null && Q.publishData)
2627
+ const x = typeof d.requestId == "string" ? d.requestId : void 0, D = (K = he.current) == null ? void 0 : K.call(he), W = (V) => {
2628
+ const z = D, Z = z == null ? void 0 : z.localParticipant;
2629
+ if (Z != null && Z.publishData)
2589
2630
  try {
2590
- const ne = x ? { ...V, requestId: x } : V, Ue = new TextEncoder().encode(JSON.stringify(ne));
2591
- Q.publishData(Ue, { reliable: !0 });
2592
- } catch (ne) {
2593
- console.warn("[LiveLayer] publishData failed.", ne);
2631
+ const re = x ? { ...V, requestId: x } : V, Ye = new TextEncoder().encode(JSON.stringify(re));
2632
+ Z.publishData(Ye, { reliable: !0 });
2633
+ } catch (re) {
2634
+ console.warn("[LiveLayer] publishData failed.", re);
2594
2635
  }
2595
2636
  }, O = Ot.current, j = zt.current;
2596
2637
  try {
@@ -2639,9 +2680,9 @@ const ho = /* @__PURE__ */ new Set([
2639
2680
  return;
2640
2681
  }
2641
2682
  const D = d.behavior === "instant" ? "instant" : "smooth";
2642
- if (Nt.current) {
2683
+ if (St.current) {
2643
2684
  try {
2644
- Nt.current(
2685
+ St.current(
2645
2686
  x,
2646
2687
  D
2647
2688
  );
@@ -2651,12 +2692,12 @@ const ho = /* @__PURE__ */ new Set([
2651
2692
  return;
2652
2693
  }
2653
2694
  if (typeof window > "u") return;
2654
- const W = { behavior: D }, O = fo(), j = (z) => {
2695
+ const W = { behavior: D }, O = go(), j = (z) => {
2655
2696
  O instanceof Window ? O.scrollBy({ top: z, ...W }) : O.scrollBy({ top: z, ...W });
2656
2697
  }, V = (z) => {
2657
2698
  O instanceof Window ? O.scrollTo({ top: z, ...W }) : O.scrollTo({ top: z, ...W });
2658
2699
  };
2659
- x === "up" ? j(-vn(O)) : x === "down" ? j(vn(O)) : V(x === "top" ? 0 : po(O));
2700
+ x === "up" ? j(-wn(O)) : x === "down" ? j(wn(O)) : V(x === "top" ? 0 : yo(O));
2660
2701
  return;
2661
2702
  }
2662
2703
  if (d.type === "click") {
@@ -2669,9 +2710,9 @@ const ho = /* @__PURE__ */ new Set([
2669
2710
  console.warn("[LiveLayer] click: missing selector.");
2670
2711
  return;
2671
2712
  }
2672
- if (At.current) {
2713
+ if (Nt.current) {
2673
2714
  try {
2674
- At.current(x);
2715
+ Nt.current(x);
2675
2716
  } catch (W) {
2676
2717
  console.warn("[LiveLayer] onClick threw.", W);
2677
2718
  }
@@ -2714,7 +2755,7 @@ const ho = /* @__PURE__ */ new Set([
2714
2755
  console.warn(`[LiveLayer] ${d.type}: missing formId.`);
2715
2756
  return;
2716
2757
  }
2717
- const D = yn(document, x);
2758
+ const D = bn(document, x);
2718
2759
  if (!D) {
2719
2760
  console.warn(
2720
2761
  `[LiveLayer] ${d.type}: no <form> matched id="${x}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
@@ -2733,20 +2774,16 @@ const ho = /* @__PURE__ */ new Set([
2733
2774
  console.warn("[LiveLayer] focus_field: missing fieldName.");
2734
2775
  return;
2735
2776
  }
2736
- const j = D.querySelector(`[name="${O.replace(/"/g, '\\"')}"]`);
2737
- if (!j) {
2738
- console.warn(
2739
- `[LiveLayer] focus_field: no input with name="${O}" in form "${x}".`
2740
- );
2741
- return;
2742
- }
2743
- if (!xt(j)) {
2744
- console.warn(
2777
+ const j = vn(D, O);
2778
+ if (j.el === null) {
2779
+ j.reason === "private" ? console.warn(
2745
2780
  `[LiveLayer] focus_field: field "${O}" is privacy-protected and not focusable.`
2781
+ ) : console.warn(
2782
+ `[LiveLayer] focus_field: no input matching key="${O}" in form "${x}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
2746
2783
  );
2747
2784
  return;
2748
2785
  }
2749
- j.focus();
2786
+ j.el.focus();
2750
2787
  return;
2751
2788
  }
2752
2789
  const W = d.values && typeof d.values == "object" ? d.values : null;
@@ -2756,21 +2793,17 @@ const ho = /* @__PURE__ */ new Set([
2756
2793
  }
2757
2794
  for (const [O, j] of Object.entries(W)) {
2758
2795
  if (typeof j != "string") continue;
2759
- const V = D.querySelector(`[name="${O.replace(/"/g, '\\"')}"]`);
2760
- if (!V) {
2761
- console.warn(
2762
- `[LiveLayer] fill_form: no input with name="${O}" in form "${x}". Skipping.`
2763
- );
2764
- continue;
2765
- }
2766
- if (!xt(V)) {
2767
- console.warn(
2768
- `[LiveLayer] fill_form: field "${O}" is privacy-protected (password / cc-* / private). Skipping.`
2796
+ const V = vn(D, O);
2797
+ if (V.el === null) {
2798
+ V.reason === "private" ? console.warn(
2799
+ `[LiveLayer] fill_form: field "${O}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
2800
+ ) : console.warn(
2801
+ `[LiveLayer] fill_form: no input matching key="${O}" in form "${x}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
2769
2802
  );
2770
2803
  continue;
2771
2804
  }
2772
2805
  try {
2773
- lo(V, j);
2806
+ uo(V.el, j);
2774
2807
  } catch (z) {
2775
2808
  console.warn(
2776
2809
  `[LiveLayer] fill_form: failed to set "${O}".`,
@@ -2792,7 +2825,7 @@ const ho = /* @__PURE__ */ new Set([
2792
2825
  return;
2793
2826
  }
2794
2827
  yt.current.playConfirmation();
2795
- const D = yn(document, x);
2828
+ const D = bn(document, x);
2796
2829
  if (!D) {
2797
2830
  console.warn(
2798
2831
  `[LiveLayer] submit_form: no <form> matched id="${x}" (or matching name / data-ll-intent slug).`
@@ -2805,12 +2838,12 @@ const ho = /* @__PURE__ */ new Set([
2805
2838
  );
2806
2839
  return;
2807
2840
  }
2808
- const W = typeof d.requestId == "string" ? d.requestId : void 0, O = (be = he.current) == null ? void 0 : be.call(he), j = (Q) => {
2809
- const ne = O, Ue = ne == null ? void 0 : ne.localParticipant;
2810
- if (Ue != null && Ue.publishData)
2841
+ const W = typeof d.requestId == "string" ? d.requestId : void 0, O = (_e = he.current) == null ? void 0 : _e.call(he), j = (Z) => {
2842
+ const re = O, Ye = re == null ? void 0 : re.localParticipant;
2843
+ if (Ye != null && Ye.publishData)
2811
2844
  try {
2812
- const qn = W ? { ...Q, requestId: W } : Q, Fn = new TextEncoder().encode(JSON.stringify(qn));
2813
- Ue.publishData(Fn, { reliable: !0 });
2845
+ const Un = W ? { ...Z, requestId: W } : Z, jn = new TextEncoder().encode(JSON.stringify(Un));
2846
+ Ye.publishData(jn, { reliable: !0 });
2814
2847
  } catch {
2815
2848
  }
2816
2849
  };
@@ -2821,8 +2854,8 @@ const ho = /* @__PURE__ */ new Set([
2821
2854
  D.addEventListener("submit", z, { once: !0 });
2822
2855
  try {
2823
2856
  typeof D.requestSubmit == "function" ? D.requestSubmit() : D.submit();
2824
- } catch (Q) {
2825
- console.warn("[LiveLayer] submit_form: requestSubmit threw.", Q), D.removeEventListener("submit", z), j({
2857
+ } catch (Z) {
2858
+ console.warn("[LiveLayer] submit_form: requestSubmit threw.", Z), D.removeEventListener("submit", z), j({
2826
2859
  type: "form_submit_blocked",
2827
2860
  formId: x,
2828
2861
  reason: "exception"
@@ -2843,41 +2876,41 @@ const ho = /* @__PURE__ */ new Set([
2843
2876
  ge("request_routes", "read_page");
2844
2877
  return;
2845
2878
  }
2846
- const x = typeof d.requestId == "string" ? d.requestId : void 0, W = (at = he.current) == null ? void 0 : at.call(he), O = W == null ? void 0 : W.localParticipant;
2879
+ const x = typeof d.requestId == "string" ? d.requestId : void 0, W = (ct = he.current) == null ? void 0 : ct.call(he), O = W == null ? void 0 : W.localParticipant;
2847
2880
  if (!(O != null && O.publishData)) return;
2848
2881
  const j = (z) => {
2849
2882
  try {
2850
- const Q = x ? { type: "routes", routes: z, requestId: x } : { type: "routes", routes: z }, ne = new TextEncoder().encode(JSON.stringify(Q));
2851
- O.publishData(ne, { reliable: !0 });
2852
- } catch (Q) {
2853
- console.warn("[LiveLayer] request_routes: publishData failed.", Q);
2883
+ const Z = x ? { type: "routes", routes: z, requestId: x } : { type: "routes", routes: z }, re = new TextEncoder().encode(JSON.stringify(Z));
2884
+ O.publishData(re, { reliable: !0 });
2885
+ } catch (Z) {
2886
+ console.warn("[LiveLayer] request_routes: publishData failed.", Z);
2854
2887
  }
2855
2888
  }, V = Ht.current;
2856
2889
  if (V) {
2857
2890
  try {
2858
- const z = V(), Q = (ne) => {
2859
- if (!Array.isArray(ne)) {
2891
+ const z = V(), Z = (re) => {
2892
+ if (!Array.isArray(re)) {
2860
2893
  j([]);
2861
2894
  return;
2862
2895
  }
2863
- j(ne.map(eo).slice(0, 200));
2896
+ j(re.map(no).slice(0, 200));
2864
2897
  };
2865
- z instanceof Promise ? z.then(Q).catch((ne) => {
2898
+ z instanceof Promise ? z.then(Z).catch((re) => {
2866
2899
  console.warn(
2867
2900
  "[LiveLayer] getRoutes rejected; falling back to DOM walker.",
2868
- ne
2869
- ), j(Mt());
2870
- }) : Q(z);
2901
+ re
2902
+ ), j(Rt());
2903
+ }) : Z(z);
2871
2904
  } catch (z) {
2872
2905
  console.warn(
2873
2906
  "[LiveLayer] getRoutes threw; falling back to DOM walker.",
2874
2907
  z
2875
- ), j(Mt());
2908
+ ), j(Rt());
2876
2909
  }
2877
2910
  return;
2878
2911
  }
2879
2912
  try {
2880
- j(Mt());
2913
+ j(Rt());
2881
2914
  } catch (z) {
2882
2915
  console.warn("[LiveLayer] request_routes: extractRoutes threw.", z);
2883
2916
  }
@@ -2929,7 +2962,7 @@ const ho = /* @__PURE__ */ new Set([
2929
2962
  } catch {
2930
2963
  }
2931
2964
  try {
2932
- Me == null || Me(
2965
+ Te == null || Te(
2933
2966
  x
2934
2967
  );
2935
2968
  } catch (D) {
@@ -2937,40 +2970,40 @@ const ho = /* @__PURE__ */ new Set([
2937
2970
  }
2938
2971
  return;
2939
2972
  }
2940
- ho.has(d.type) || Ie == null || Ie(d);
2973
+ vo.has(d.type) || Me == null || Me(d);
2941
2974
  }
2942
2975
  },
2943
- [Ie, Re, Me]
2944
- ), X = Qn({
2945
- agentId: $ ? "__controlled__" : et,
2946
- baseUrl: l,
2947
- apiKey: i,
2976
+ [Me, Re, Te]
2977
+ ), Q = er({
2978
+ agentId: $ ? "__controlled__" : nt,
2979
+ baseUrl: i,
2980
+ apiKey: l,
2948
2981
  sessionEndpoint: s,
2949
2982
  sessionBody: a,
2950
- onDataMessage: $ ? void 0 : it
2983
+ onDataMessage: $ ? void 0 : at
2951
2984
  });
2952
- I(() => {
2985
+ R(() => {
2953
2986
  if ($ != null && $.subscribeToDataMessages)
2954
- return $.subscribeToDataMessages(it);
2955
- }, [$, it]), he.current = () => {
2987
+ return $.subscribeToDataMessages(at);
2988
+ }, [$, at]), he.current = () => {
2956
2989
  var y;
2957
- return (y = X.getRoom) == null ? void 0 : y.call(X);
2958
- }, I(() => {
2959
- var G;
2990
+ return (y = Q.getRoom) == null ? void 0 : y.call(Q);
2991
+ }, R(() => {
2992
+ var K;
2960
2993
  if (typeof window > "u") return;
2961
- const y = ((G = window.location) == null ? void 0 : G.hostname) || "";
2994
+ const y = ((K = window.location) == null ? void 0 : K.hostname) || "";
2962
2995
  if (y === "localhost" || y === "127.0.0.1" || y === "0.0.0.0" || y.endsWith(".local") || y.endsWith(".test"))
2963
2996
  return window.__livelayerSimulateCommand = (de) => {
2964
2997
  try {
2965
- it(de);
2966
- } catch (be) {
2967
- console.warn("[LiveLayer] simulate-command threw:", be);
2998
+ at(de);
2999
+ } catch (_e) {
3000
+ console.warn("[LiveLayer] simulate-command threw:", _e);
2968
3001
  }
2969
3002
  }, () => {
2970
3003
  delete window.__livelayerSimulateCommand;
2971
3004
  };
2972
- }, [it]);
2973
- const k = Ge(() => $ ? {
3005
+ }, [at]);
3006
+ const k = Xe(() => $ ? {
2974
3007
  connectionState: $.connectionState,
2975
3008
  agentState: $.agentState,
2976
3009
  transcript: $.transcript,
@@ -2986,29 +3019,29 @@ const ho = /* @__PURE__ */ new Set([
2986
3019
  // Dummy getRoom for shape compatibility — controlled consumers own the Room.
2987
3020
  // Internal session's getRoom returns null when no real connect has happened,
2988
3021
  // so we reuse its reference for type consistency.
2989
- getRoom: X.getRoom,
3022
+ getRoom: Q.getRoom,
2990
3023
  isControlled: !0
2991
3024
  } : {
2992
- connectionState: X.connectionState,
2993
- agentState: X.agentState,
2994
- transcript: X.transcript,
2995
- videoElement: X.videoElement,
2996
- audioElement: X.audioElement,
2997
- canResume: X.canResume,
2998
- error: X.error,
2999
- agentConfig: X.agentConfig,
3000
- connect: X.connect,
3001
- disconnect: X.disconnect,
3002
- getRoom: X.getRoom,
3025
+ connectionState: Q.connectionState,
3026
+ agentState: Q.agentState,
3027
+ transcript: Q.transcript,
3028
+ videoElement: Q.videoElement,
3029
+ audioElement: Q.audioElement,
3030
+ canResume: Q.canResume,
3031
+ error: Q.error,
3032
+ agentConfig: Q.agentConfig,
3033
+ connect: Q.connect,
3034
+ disconnect: Q.disconnect,
3035
+ getRoom: Q.getRoom,
3003
3036
  isControlled: !1
3004
- }, [$, X]), Bt = N(k);
3037
+ }, [$, Q]), Bt = N(k);
3005
3038
  Bt.current = k;
3006
3039
  const Wt = N($);
3007
- Wt.current = $, jn(
3040
+ Wt.current = $, Yn(
3008
3041
  r,
3009
3042
  () => ({
3010
3043
  sendData: async (y) => {
3011
- var be, at;
3044
+ var _e, ct;
3012
3045
  const d = Wt.current;
3013
3046
  if (d != null && d.publishData) {
3014
3047
  try {
@@ -3018,7 +3051,7 @@ const ho = /* @__PURE__ */ new Set([
3018
3051
  }
3019
3052
  return;
3020
3053
  }
3021
- const G = (at = (be = Bt.current) == null ? void 0 : be.getRoom) == null ? void 0 : at.call(be), de = G == null ? void 0 : G.localParticipant;
3054
+ const K = (ct = (_e = Bt.current) == null ? void 0 : _e.getRoom) == null ? void 0 : ct.call(_e), de = K == null ? void 0 : K.localParticipant;
3022
3055
  if (de != null && de.publishData)
3023
3056
  try {
3024
3057
  const x = new TextEncoder().encode(JSON.stringify(y));
@@ -3030,44 +3063,44 @@ const ho = /* @__PURE__ */ new Set([
3030
3063
  }),
3031
3064
  []
3032
3065
  );
3033
- const qt = N(null);
3034
- I(() => {
3035
- const y = k.videoElement, d = qt.current;
3066
+ const Ft = N(null);
3067
+ R(() => {
3068
+ const y = k.videoElement, d = Ft.current;
3036
3069
  if (!(!y || !d))
3037
3070
  return d.appendChild(y), () => {
3038
3071
  y.parentNode === d && d.removeChild(y);
3039
3072
  };
3040
- }, [k.videoElement]), I(() => {
3073
+ }, [k.videoElement]), R(() => {
3041
3074
  const y = k.audioElement;
3042
3075
  if (!y) return;
3043
- tt.attach(y);
3076
+ rt.attach(y);
3044
3077
  const d = y.play();
3045
- return d && typeof d.catch == "function" && d.catch((G) => {
3046
- (G == null ? void 0 : G.name) === "NotAllowedError" && fe(!0);
3078
+ return d && typeof d.catch == "function" && d.catch((K) => {
3079
+ (K == null ? void 0 : K.name) === "NotAllowedError" && fe(!0);
3047
3080
  }), () => {
3048
- tt.detach();
3081
+ rt.detach();
3049
3082
  };
3050
- }, [k.audioElement]), I(() => {
3083
+ }, [k.audioElement]), R(() => {
3051
3084
  if (k.isControlled || k.connectionState !== "connected") return;
3052
3085
  const y = k.getRoom();
3053
3086
  if (y)
3054
- return re.setupMic(y).catch(() => {
3087
+ return oe.setupMic(y).catch(() => {
3055
3088
  }), () => {
3056
- re.teardownMic();
3089
+ oe.teardownMic();
3057
3090
  };
3058
- }, [k.isControlled, k.connectionState]), I(() => {
3091
+ }, [k.isControlled, k.connectionState]), R(() => {
3059
3092
  var d;
3060
3093
  if (k.connectionState !== "connected") return;
3061
3094
  const y = k.isControlled ? (d = $ == null ? void 0 : $.getRoom) == null ? void 0 : d.call($) : k.getRoom();
3062
3095
  if (y)
3063
- return ae.attachRoom(y), Ee.attachRoom(y), k.isControlled && re.attachRoom(y), nt.refresh(), () => {
3064
- ae.teardown(), Ee.teardown();
3096
+ return ae.attachRoom(y), Ce.attachRoom(y), k.isControlled && oe.attachRoom(y), ot.refresh(), () => {
3097
+ ae.teardown(), Ce.teardown();
3065
3098
  };
3066
- }, [k.isControlled, k.connectionState, $]), I(() => {
3099
+ }, [k.isControlled, k.connectionState, $]), R(() => {
3067
3100
  const y = k.audioElement;
3068
- y && (y.muted = Y);
3069
- }, [k.audioElement, Y]);
3070
- const Rn = C((y) => {
3101
+ y && (y.muted = G);
3102
+ }, [k.audioElement, G]);
3103
+ const Mn = C((y) => {
3071
3104
  const d = { type: "user_message", text: y };
3072
3105
  if ($ != null && $.publishData) {
3073
3106
  try {
@@ -3076,254 +3109,254 @@ const ho = /* @__PURE__ */ new Set([
3076
3109
  }
3077
3110
  return;
3078
3111
  }
3079
- const G = k.getRoom();
3080
- if (G)
3112
+ const K = k.getRoom();
3113
+ if (K)
3081
3114
  try {
3082
3115
  const de = new TextEncoder().encode(JSON.stringify(d));
3083
- G.localParticipant.publishData(de, { reliable: !0 });
3116
+ K.localParticipant.publishData(de, { reliable: !0 });
3084
3117
  } catch {
3085
3118
  }
3086
- }, [k, $]), In = C(() => {
3087
- An((y) => !y);
3119
+ }, [k, $]), Tn = C(() => {
3120
+ Rn((y) => !y);
3088
3121
  }, []);
3089
- I(() => {
3090
- Ae == null || Ae(k.connectionState), k.connectionState === "connected" ? Se == null || Se() : k.connectionState === "disconnected" && ($e == null || $e());
3091
- }, [k.connectionState, Se, $e, Ae]), I(() => {
3092
- Ne == null || Ne(k.transcript);
3093
- }, [k.transcript, Ne]), I(() => {
3094
- ze == null || ze(k.agentState);
3095
- }, [k.agentState, ze]), I(() => {
3122
+ R(() => {
3123
+ Ie == null || Ie(k.connectionState), k.connectionState === "connected" ? Ne == null || Ne() : k.connectionState === "disconnected" && (He == null || He());
3124
+ }, [k.connectionState, Ne, He, Ie]), R(() => {
3125
+ Ae == null || Ae(k.transcript);
3126
+ }, [k.transcript, Ae]), R(() => {
3127
+ Be == null || Be(k.agentState);
3128
+ }, [k.agentState, Be]), R(() => {
3096
3129
  gt.setThinking(k.agentState === "thinking");
3097
3130
  }, [k.agentState, gt]);
3098
- const Ft = N(!1);
3099
- I(() => {
3100
- !v || Ft.current || Ze && k.connectionState === "idle" && (Ft.current = !0, k.connect());
3101
- }, [v, k.connectionState, k, Ze]);
3102
- const Mn = C(
3131
+ const qt = N(!1);
3132
+ R(() => {
3133
+ !v || qt.current || tt && k.connectionState === "idle" && (qt.current = !0, k.connect());
3134
+ }, [v, k.connectionState, k, tt]);
3135
+ const Dn = C(
3103
3136
  (y) => {
3104
- const d = S == null ? void 0 : S.find((G) => G.id === y);
3105
- d && (ot(!1), y !== Le && (rt(!0), k.disconnect(), De || Lt(y), A == null || A(d)));
3137
+ const d = S == null ? void 0 : S.find((K) => K.id === y);
3138
+ d && (lt(!1), y !== ke && (it(!0), k.disconnect(), Pe || kt(y), A == null || A(d)));
3106
3139
  },
3107
3140
  [
3108
3141
  S,
3109
- Le,
3142
+ ke,
3110
3143
  k,
3111
- De,
3144
+ Pe,
3112
3145
  A
3113
3146
  ]
3114
3147
  );
3115
- I(() => {
3116
- pe && k.connectionState === "connected" && rt(!1);
3117
- }, [k.connectionState, pe]), I(() => {
3118
- if (!qe) return;
3148
+ R(() => {
3149
+ pe && k.connectionState === "connected" && it(!1);
3150
+ }, [k.connectionState, pe]), R(() => {
3151
+ if (!je) return;
3119
3152
  const y = (d) => {
3120
- d.key === "Escape" && ot(!1);
3153
+ d.key === "Escape" && lt(!1);
3121
3154
  };
3122
3155
  return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
3123
- }, [qe]);
3124
- const Tn = !!P || !!(ee != null && ee.avatarImageUrl) || k.isControlled, lt = ir(et, l, Tn);
3125
- Qe === void 0 && ((Yt = lt.info) != null && Yt.capabilities) && (Rt.current = lt.info.capabilities);
3126
- const vt = (ee == null ? void 0 : ee.name) ?? H ?? ((Gt = k.agentConfig) == null ? void 0 : Gt.name) ?? ((Jt = lt.info) == null ? void 0 : Jt.name) ?? "Live Layer", It = (ee == null ? void 0 : ee.avatarImageUrl) ?? P ?? ((Kt = k.agentConfig) == null ? void 0 : Kt.avatarImageUrl) ?? ((Xt = lt.info) == null ? void 0 : Xt.avatarImageUrl) ?? null, Dn = F ?? ((Qt = k.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((Zt = lt.info) == null ? void 0 : Zt.idleLoopUrl) ?? null, Pn = g ?? null, $n = C(() => le("expanded"), [le]), zn = C(
3156
+ }, [je]);
3157
+ const Pn = !!P || !!(te != null && te.avatarImageUrl) || k.isControlled, st = ar(nt, i, Pn);
3158
+ et === void 0 && ((Yt = st.info) != null && Yt.capabilities) && (At.current = st.info.capabilities);
3159
+ const vt = (te == null ? void 0 : te.name) ?? H ?? ((Gt = k.agentConfig) == null ? void 0 : Gt.name) ?? ((Kt = st.info) == null ? void 0 : Kt.name) ?? "Live Layer", It = (te == null ? void 0 : te.avatarImageUrl) ?? P ?? ((Jt = k.agentConfig) == null ? void 0 : Jt.avatarImageUrl) ?? ((Xt = st.info) == null ? void 0 : Xt.avatarImageUrl) ?? null, $n = q ?? ((Qt = k.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((Zt = st.info) == null ? void 0 : Zt.idleLoopUrl) ?? null, zn = g ?? null, On = C(() => le("expanded"), [le]), Hn = C(
3127
3160
  () => le("minimized"),
3128
3161
  [le]
3129
3162
  ), Ut = C(() => {
3130
3163
  k.disconnect(), le("hidden");
3131
- }, [k, le]), On = C(() => {
3164
+ }, [k, le]), Bn = C(() => {
3132
3165
  const y = k.audioElement;
3133
3166
  y && y.play().then(() => fe(!1)).catch(() => {
3134
3167
  });
3135
- }, [k.audioElement]), Hn = C(() => {
3168
+ }, [k.audioElement]), Wn = C(() => {
3136
3169
  fe(!1), k.connect();
3137
- }, [k]), Fe = {
3138
- ...Te,
3139
- ...ue ? {} : { zIndex: Oe }
3170
+ }, [k]), Ve = {
3171
+ ...De,
3172
+ ...ue ? {} : { zIndex: We }
3140
3173
  };
3141
- q.primaryColor && (Fe["--ll-color-primary"] = q.primaryColor), q.accentColor && (Fe["--ll-color-accent"] = q.accentColor), q.backgroundColor && (Fe["--ll-color-bg"] = q.backgroundColor), q.textColor && (Fe["--ll-color-fg"] = q.textColor);
3142
- const Bn = [
3174
+ F.primaryColor && (Ve["--ll-color-primary"] = F.primaryColor), F.accentColor && (Ve["--ll-color-accent"] = F.accentColor), F.backgroundColor && (Ve["--ll-color-bg"] = F.backgroundColor), F.textColor && (Ve["--ll-color-fg"] = F.textColor);
3175
+ const Fn = [
3143
3176
  "ll-widget",
3144
- `ll-widget--${te}`,
3145
- `ll-widget--${Ce ? "mobile" : "desktop"}`,
3146
- kt
3177
+ `ll-widget--${ne}`,
3178
+ `ll-widget--${Le ? "mobile" : "desktop"}`,
3179
+ xt
3147
3180
  ].filter(Boolean).join(" ");
3148
- if (!Ze) return null;
3149
- const Wn = /* @__PURE__ */ n(
3181
+ if (!tt) return null;
3182
+ const qn = /* @__PURE__ */ n(
3150
3183
  "div",
3151
3184
  {
3152
- className: Bn,
3153
- style: Fe,
3154
- "data-display-mode": te,
3185
+ className: Fn,
3186
+ style: Ve,
3187
+ "data-display-mode": ne,
3155
3188
  "data-position": L,
3156
3189
  "data-experience-mode": p === "EMBEDDED" ? "embedded" : "widget",
3157
- children: te === "expanded" && /* @__PURE__ */ n(
3158
- Hr,
3190
+ children: ne === "expanded" && /* @__PURE__ */ n(
3191
+ Wr,
3159
3192
  {
3160
3193
  position: L,
3161
- isMobile: Ce,
3194
+ isMobile: Le,
3162
3195
  agentName: vt,
3163
3196
  avatarImageUrl: It,
3164
- idleLoopUrl: Dn,
3165
- greeting: Pn,
3166
- branding: q,
3197
+ idleLoopUrl: $n,
3198
+ greeting: zn,
3199
+ branding: F,
3167
3200
  teamMembers: S,
3168
- currentTeamMemberId: Le,
3201
+ currentTeamMemberId: ke,
3169
3202
  isSwitchingTeamMember: pe,
3170
- teamSwitcherOpen: qe,
3171
- onToggleTeamSwitcher: () => ot((y) => !y),
3172
- onSelectTeamMember: Mn,
3203
+ teamSwitcherOpen: je,
3204
+ onToggleTeamSwitcher: () => lt((y) => !y),
3205
+ onSelectTeamMember: Dn,
3173
3206
  connectionState: k.connectionState,
3174
3207
  agentState: k.agentState,
3175
3208
  transcript: k.transcript,
3176
- isMuted: re.isMuted,
3177
- micDevices: nt.mics,
3178
- activeMicId: re.activeDeviceId,
3209
+ isMuted: oe.isMuted,
3210
+ micDevices: ot.mics,
3211
+ activeMicId: oe.activeDeviceId,
3179
3212
  isCameraEnabled: ae.isEnabled,
3180
3213
  cameraPreviewEl: ae.previewEl,
3181
- cameraDevices: nt.cameras,
3214
+ cameraDevices: ot.cameras,
3182
3215
  activeCameraId: ae.activeDeviceId,
3183
- isScreenShareEnabled: Ee.isEnabled,
3184
- screenPreviewEl: Ee.previewEl,
3185
- isSpeakerMuted: Y,
3186
- allowCamera: Z,
3187
- allowScreenShare: M,
3216
+ isScreenShareEnabled: Ce.isEnabled,
3217
+ screenPreviewEl: Ce.previewEl,
3218
+ isSpeakerMuted: G,
3219
+ allowCamera: ee,
3220
+ allowScreenShare: B,
3188
3221
  allowTyping: U,
3189
3222
  showMinimize: pt,
3190
3223
  showClose: ht,
3191
- chromeless: oe,
3192
- compactControls: K,
3193
- transforming: xe,
3194
- transformingLabel: ye,
3224
+ chromeless: ye,
3225
+ compactControls: ze,
3226
+ transforming: Oe,
3227
+ transformingLabel: ve,
3195
3228
  languageMenuOpen: mt,
3196
3229
  onToggleLanguageMenu: () => m((y) => !y),
3197
- needsUserGesture: Ct,
3230
+ needsUserGesture: Lt,
3198
3231
  canResume: k.canResume,
3199
- micError: re.micError,
3232
+ micError: oe.micError,
3200
3233
  error: k.error,
3201
- avatarVideoContainerRef: qt,
3234
+ avatarVideoContainerRef: Ft,
3202
3235
  agentVideoEl: k.videoElement,
3203
3236
  onConnect: () => void k.connect(),
3204
3237
  onDisconnect: () => k.disconnect(),
3205
- onRetry: Hn,
3206
- onResumeAudio: On,
3207
- onToggleMute: re.toggleMute,
3208
- onSwitchMicDevice: (y) => void re.switchDevice(y),
3238
+ onRetry: Wn,
3239
+ onResumeAudio: Bn,
3240
+ onToggleMute: oe.toggleMute,
3241
+ onSwitchMicDevice: (y) => void oe.switchDevice(y),
3209
3242
  onToggleCamera: () => void ae.toggle(),
3210
3243
  onSwitchCameraDevice: (y) => void ae.switchDevice(y),
3211
- onToggleScreenShare: () => void Ee.toggle(),
3212
- onToggleSpeaker: In,
3213
- onSendMessage: Rn,
3214
- onMinimize: zn,
3244
+ onToggleScreenShare: () => void Ce.toggle(),
3245
+ onToggleSpeaker: Tn,
3246
+ onSendMessage: Mn,
3247
+ onMinimize: Hn,
3215
3248
  onClose: Ut,
3216
- onClearMicError: re.clearError
3249
+ onClearMicError: oe.clearError
3217
3250
  }
3218
3251
  )
3219
3252
  }
3220
- ), jt = !ue && (te === "hidden" || te === "minimized") ? /* @__PURE__ */ w(
3253
+ ), jt = !ue && (ne === "hidden" || ne === "minimized") ? /* @__PURE__ */ w(
3221
3254
  "div",
3222
3255
  {
3223
3256
  className: [
3224
3257
  "ll-widget",
3225
3258
  "ll-widget--floating",
3226
- `ll-widget--${te}`,
3227
- `ll-widget--${Ce ? "mobile" : "desktop"}`
3259
+ `ll-widget--${ne}`,
3260
+ `ll-widget--${Le ? "mobile" : "desktop"}`
3228
3261
  ].join(" "),
3229
- style: Fe,
3230
- "data-display-mode": te,
3262
+ style: Ve,
3263
+ "data-display-mode": ne,
3231
3264
  "data-position": L,
3232
3265
  children: [
3233
- te === "hidden" && /* @__PURE__ */ n(
3234
- Rr,
3266
+ ne === "hidden" && /* @__PURE__ */ n(
3267
+ Mr,
3235
3268
  {
3236
3269
  position: L,
3237
- isMobile: Ce,
3270
+ isMobile: Le,
3238
3271
  isSpeaking: k.agentState === "speaking",
3239
3272
  onExpand: () => le("expanded"),
3240
3273
  label: `Open ${vt} widget`,
3241
3274
  avatarImageUrl: It,
3242
3275
  agentName: vt,
3243
- containerEl: _e
3276
+ containerEl: ie
3244
3277
  }
3245
3278
  ),
3246
- te === "minimized" && /* @__PURE__ */ n(
3247
- Mr,
3279
+ ne === "minimized" && /* @__PURE__ */ n(
3280
+ Dr,
3248
3281
  {
3249
3282
  position: L,
3250
- isMobile: Ce,
3283
+ isMobile: Le,
3251
3284
  agentName: vt,
3252
3285
  avatarImageUrl: It,
3253
3286
  agentState: k.agentState,
3254
- isMuted: re.isMuted,
3255
- audioLevel: tt,
3256
- onExpand: $n,
3257
- onToggleMute: re.toggleMute,
3287
+ isMuted: oe.isMuted,
3288
+ audioLevel: rt,
3289
+ onExpand: On,
3290
+ onToggleMute: oe.toggleMute,
3258
3291
  onClose: Ut
3259
3292
  }
3260
3293
  )
3261
3294
  ]
3262
3295
  }
3263
- ) : null, Vt = _e ?? (typeof document < "u" ? document.body : null);
3264
- return /* @__PURE__ */ w(Pe, { children: [
3265
- Wn,
3296
+ ) : null, Vt = ie ?? (typeof document < "u" ? document.body : null);
3297
+ return /* @__PURE__ */ w($e, { children: [
3298
+ qn,
3266
3299
  jt && Vt && Pt(jt, Vt)
3267
3300
  ] });
3268
3301
  }
3269
3302
  );
3270
- Nn.displayName = "AvatarWidgetInner";
3271
- const mo = Dt(
3303
+ In.displayName = "AvatarWidgetInner";
3304
+ const bo = Dt(
3272
3305
  function(t, r) {
3273
- return /* @__PURE__ */ n(Xn, { children: /* @__PURE__ */ n(Nn, { ...t, ref: r }) });
3306
+ return /* @__PURE__ */ n(Zn, { children: /* @__PURE__ */ n(In, { ...t, ref: r }) });
3274
3307
  }
3275
3308
  );
3276
- mo.displayName = "AvatarWidget";
3277
- const Eo = ({
3309
+ bo.displayName = "AvatarWidget";
3310
+ const Io = ({
3278
3311
  agentId: e,
3279
3312
  baseUrl: t,
3280
3313
  apiKey: r,
3281
3314
  mode: o,
3282
- onAgentEvent: i,
3283
- className: l,
3315
+ onAgentEvent: l,
3316
+ className: i,
3284
3317
  style: s
3285
3318
  }) => {
3286
- const a = N(null), c = N(null), p = N(i);
3287
- p.current = i;
3319
+ const a = N(null), c = N(null), p = N(l);
3320
+ p.current = l;
3288
3321
  const v = C((f) => {
3289
- var R;
3322
+ var I;
3290
3323
  const u = f.detail;
3291
- (R = p.current) == null || R.call(p, u);
3324
+ (I = p.current) == null || I.call(p, u);
3292
3325
  }, []);
3293
- return I(() => {
3326
+ return R(() => {
3294
3327
  const f = a.current;
3295
3328
  if (!f) return;
3296
3329
  const u = document.createElement("livelayer-widget");
3297
3330
  return u.setAttribute("agent-id", e), t && u.setAttribute("base-url", t), r && u.setAttribute("api-key", r), o && u.setAttribute("mode", o), u.addEventListener("agent-event", v), f.appendChild(u), c.current = u, () => {
3298
3331
  u.removeEventListener("agent-event", v), f.removeChild(u), c.current = null;
3299
3332
  };
3300
- }, [e]), I(() => {
3333
+ }, [e]), R(() => {
3301
3334
  c.current && (o ? c.current.setAttribute("mode", o) : c.current.removeAttribute("mode"));
3302
- }, [o]), /* @__PURE__ */ n("div", { ref: a, className: l, style: s });
3303
- }, So = Dt(
3304
- function({ id: t, intent: r, as: o = "div", className: i, style: l, children: s }, a) {
3305
- return Vn(
3335
+ }, [o]), /* @__PURE__ */ n("div", { ref: a, className: i, style: s });
3336
+ }, Ro = Dt(
3337
+ function({ id: t, intent: r, as: o = "div", className: l, style: i, children: s }, a) {
3338
+ return Gn(
3306
3339
  o,
3307
3340
  {
3308
3341
  ref: a,
3309
3342
  "data-ll-region": t,
3310
3343
  "data-ll-intent": r,
3311
- className: i,
3312
- style: l
3344
+ className: l,
3345
+ style: i
3313
3346
  },
3314
3347
  s
3315
3348
  );
3316
3349
  }
3317
3350
  );
3318
- function No(e = {}) {
3319
- const { onFieldUpdate: t, onComplete: r, source: o = "all" } = e, [i, l] = E({}), [s, a] = E(!1), [c, p] = E(null), v = N(t), f = N(r), u = N(o);
3320
- I(() => {
3351
+ function Mo(e = {}) {
3352
+ const { onFieldUpdate: t, onComplete: r, source: o = "all" } = e, [l, i] = E({}), [s, a] = E(!1), [c, p] = E(null), v = N(t), f = N(r), u = N(o);
3353
+ R(() => {
3321
3354
  v.current = t, f.current = r, u.current = o;
3322
3355
  }, [t, r, o]);
3323
- const R = C(() => {
3324
- l({}), a(!1);
3356
+ const I = C(() => {
3357
+ i({}), a(!1);
3325
3358
  }, []);
3326
- return I(() => {
3359
+ return R(() => {
3327
3360
  if (typeof window > "u") return;
3328
3361
  const L = (_) => {
3329
3362
  var b, S;
@@ -3332,7 +3365,7 @@ function No(e = {}) {
3332
3365
  if (h.phase === "field") {
3333
3366
  if (u.current !== "all" && h.source !== u.current)
3334
3367
  return;
3335
- a(!0), l(
3368
+ a(!0), i(
3336
3369
  (T) => T[h.fieldName] === h.value ? T : { ...T, [h.fieldName]: h.value }
3337
3370
  );
3338
3371
  try {
@@ -3356,34 +3389,34 @@ function No(e = {}) {
3356
3389
  }
3357
3390
  };
3358
3391
  return document.addEventListener("ll-collected", L), () => document.removeEventListener("ll-collected", L);
3359
- }, []), { fields: i, isCollecting: s, lastResult: c, reset: R };
3392
+ }, []), { fields: l, isCollecting: s, lastResult: c, reset: I };
3360
3393
  }
3361
- let bn = 1;
3362
- function Ao({
3394
+ let _n = 1;
3395
+ function To({
3363
3396
  onMount: e,
3364
3397
  defaultOpen: t = !1,
3365
3398
  storageKey: r = "ll-debug-open"
3366
3399
  }) {
3367
- const [o, i] = E(t), [l, s] = E([]), [a, c] = E(""), [p, v] = E(!1), f = N(/* @__PURE__ */ new Set()), u = N([]), R = N(p);
3368
- R.current = p, I(() => {
3400
+ const [o, l] = E(t), [i, s] = E([]), [a, c] = E(""), [p, v] = E(!1), f = N(/* @__PURE__ */ new Set()), u = N([]), I = N(p);
3401
+ I.current = p, R(() => {
3369
3402
  try {
3370
3403
  const h = localStorage.getItem(r);
3371
- h === "1" && i(!0), h === "0" && i(!1);
3404
+ h === "1" && l(!0), h === "0" && l(!1);
3372
3405
  } catch {
3373
3406
  }
3374
- }, [r]), I(() => {
3407
+ }, [r]), R(() => {
3375
3408
  try {
3376
3409
  localStorage.setItem(r, o ? "1" : "0");
3377
3410
  } catch {
3378
3411
  }
3379
- }, [o, r]), I(() => {
3412
+ }, [o, r]), R(() => {
3380
3413
  const h = (b) => {
3381
- (b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), i((S) => !S));
3414
+ (b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), l((S) => !S));
3382
3415
  };
3383
3416
  return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
3384
- }, []), I(() => {
3417
+ }, []), R(() => {
3385
3418
  const h = setInterval(() => {
3386
- if (u.current.length === 0 || R.current) return;
3419
+ if (u.current.length === 0 || I.current) return;
3387
3420
  const b = u.current.splice(0, u.current.length);
3388
3421
  s(
3389
3422
  (S) => [...b.reverse(), ...S].slice(0, 200)
@@ -3392,30 +3425,30 @@ function Ao({
3392
3425
  return () => clearInterval(h);
3393
3426
  }, []);
3394
3427
  const L = N(!1);
3395
- if (I(() => {
3428
+ if (R(() => {
3396
3429
  !e || L.current || (L.current = !0, e((h) => {
3397
3430
  u.current.push({
3398
- id: bn++,
3431
+ id: _n++,
3399
3432
  ts: Date.now(),
3400
3433
  kind: "event",
3401
3434
  type: h.eventName,
3402
3435
  data: h.data
3403
3436
  });
3404
3437
  }));
3405
- }, [e]), I(() => {
3406
- const h = console.warn, b = console.log, S = (T, A) => function(...F) {
3438
+ }, [e]), R(() => {
3439
+ const h = console.warn, b = console.log, S = (T, A) => function(...q) {
3407
3440
  try {
3408
- const g = typeof F[0] == "string" ? F[0] : "";
3441
+ const g = typeof q[0] == "string" ? q[0] : "";
3409
3442
  g.startsWith("[LiveLayer]") && u.current.push({
3410
- id: bn++,
3443
+ id: _n++,
3411
3444
  ts: Date.now(),
3412
3445
  kind: T,
3413
3446
  type: g.slice(0, 120),
3414
- data: { args: F.slice(1).map((P) => yo(P)) }
3447
+ data: { args: q.slice(1).map((P) => _o(P)) }
3415
3448
  });
3416
3449
  } catch {
3417
3450
  }
3418
- return A.apply(this, F);
3451
+ return A.apply(this, q);
3419
3452
  };
3420
3453
  return console.warn = S("warn", h), console.log = S("log", b), () => {
3421
3454
  console.warn = h, console.log = b;
@@ -3425,7 +3458,7 @@ function Ao({
3425
3458
  "button",
3426
3459
  {
3427
3460
  type: "button",
3428
- onClick: () => i(!0),
3461
+ onClick: () => l(!0),
3429
3462
  title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
3430
3463
  "aria-label": "Open LiveLayer debug panel",
3431
3464
  style: {
@@ -3447,7 +3480,7 @@ function Ao({
3447
3480
  children: "🛰 LL debug"
3448
3481
  }
3449
3482
  );
3450
- const _ = l.filter((h) => {
3483
+ const _ = i.filter((h) => {
3451
3484
  if (!a) return !0;
3452
3485
  const b = a.toLowerCase();
3453
3486
  return h.type.toLowerCase().includes(b) || JSON.stringify(h.data || {}).toLowerCase().includes(b);
@@ -3488,9 +3521,9 @@ function Ao({
3488
3521
  children: [
3489
3522
  /* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
3490
3523
  /* @__PURE__ */ w("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
3491
- l.length,
3524
+ i.length,
3492
3525
  " event",
3493
- l.length === 1 ? "" : "s"
3526
+ i.length === 1 ? "" : "s"
3494
3527
  ] }),
3495
3528
  /* @__PURE__ */ n("span", { style: { flex: 1 } }),
3496
3529
  /* @__PURE__ */ n(
@@ -3498,7 +3531,7 @@ function Ao({
3498
3531
  {
3499
3532
  type: "button",
3500
3533
  onClick: () => v((h) => !h),
3501
- style: Tt(p ? "#f59e0b" : "transparent"),
3534
+ style: Mt(p ? "#f59e0b" : "transparent"),
3502
3535
  title: "Pause / resume capture",
3503
3536
  children: p ? "▶ resume" : "⏸ pause"
3504
3537
  }
@@ -3510,7 +3543,7 @@ function Ao({
3510
3543
  onClick: () => {
3511
3544
  s([]), u.current = [];
3512
3545
  },
3513
- style: Tt("transparent"),
3546
+ style: Mt("transparent"),
3514
3547
  title: "Clear buffer",
3515
3548
  children: "clear"
3516
3549
  }
@@ -3519,8 +3552,8 @@ function Ao({
3519
3552
  "button",
3520
3553
  {
3521
3554
  type: "button",
3522
- onClick: () => i(!1),
3523
- style: Tt("transparent"),
3555
+ onClick: () => l(!1),
3556
+ style: Mt("transparent"),
3524
3557
  "aria-label": "Close",
3525
3558
  title: "Close (Cmd/Ctrl + Shift + L)",
3526
3559
  children: "✕"
@@ -3587,7 +3620,7 @@ function Ao({
3587
3620
  ]
3588
3621
  }
3589
3622
  ) : _.map((h) => /* @__PURE__ */ n(
3590
- go,
3623
+ wo,
3591
3624
  {
3592
3625
  entry: h,
3593
3626
  expanded: f.current.has(h.id),
@@ -3603,12 +3636,12 @@ function Ao({
3603
3636
  }
3604
3637
  );
3605
3638
  }
3606
- function go({
3639
+ function wo({
3607
3640
  entry: e,
3608
3641
  expanded: t,
3609
3642
  onToggle: r
3610
3643
  }) {
3611
- const o = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", i = new Date(e.ts).toLocaleTimeString("en-US", {
3644
+ const o = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", l = new Date(e.ts).toLocaleTimeString("en-US", {
3612
3645
  hour12: !1
3613
3646
  });
3614
3647
  return /* @__PURE__ */ w(
@@ -3638,7 +3671,7 @@ function go({
3638
3671
  fontVariantNumeric: "tabular-nums",
3639
3672
  fontSize: 10
3640
3673
  },
3641
- children: i
3674
+ children: l
3642
3675
  }
3643
3676
  ),
3644
3677
  /* @__PURE__ */ n(
@@ -3673,7 +3706,7 @@ function go({
3673
3706
  }
3674
3707
  );
3675
3708
  }
3676
- function Tt(e) {
3709
+ function Mt(e) {
3677
3710
  return {
3678
3711
  background: e,
3679
3712
  color: "#fff",
@@ -3684,29 +3717,29 @@ function Tt(e) {
3684
3717
  cursor: "pointer"
3685
3718
  };
3686
3719
  }
3687
- function yo(e) {
3720
+ function _o(e) {
3688
3721
  try {
3689
3722
  return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
3690
3723
  } catch {
3691
3724
  return String(e);
3692
3725
  }
3693
3726
  }
3694
- function vo(e) {
3727
+ function xo(e) {
3695
3728
  const t = JSON.stringify(e);
3696
- I(() => Gn(e), [t]);
3729
+ R(() => Jn(e), [t]);
3697
3730
  }
3698
- function Ro({ fields: e, children: t }) {
3699
- return vo(e), /* @__PURE__ */ n(Pe, { children: t });
3731
+ function Do({ fields: e, children: t }) {
3732
+ return xo(e), /* @__PURE__ */ n($e, { children: t });
3700
3733
  }
3701
- function Io() {
3702
- const [e, t] = E([]), r = C((i) => {
3703
- t((l) => {
3704
- const s = l.findIndex((a) => a.id === i.id);
3734
+ function Po() {
3735
+ const [e, t] = E([]), r = C((l) => {
3736
+ t((i) => {
3737
+ const s = i.findIndex((a) => a.id === l.id);
3705
3738
  if (s >= 0) {
3706
- const a = l.slice();
3707
- return a[s] = i, a;
3739
+ const a = i.slice();
3740
+ return a[s] = l, a;
3708
3741
  }
3709
- return [...l, i];
3742
+ return [...i, l];
3710
3743
  });
3711
3744
  }, []), o = C(() => t([]), []);
3712
3745
  return {
@@ -3717,38 +3750,38 @@ function Io() {
3717
3750
  };
3718
3751
  }
3719
3752
  export {
3720
- mo as AvatarWidget,
3721
- Xn as ErrorBoundary,
3722
- Ro as FieldProvider,
3723
- Ao as LiveLayerDebugPanel,
3724
- So as LiveLayerRegion,
3725
- Eo as LiveLayerWidget,
3726
- Do as clearFieldRegistry,
3727
- Qr as clearPageContextCache,
3728
- oo as clearRoutesCache,
3729
- Xr as extractPageContext,
3730
- no as extractRoutes,
3753
+ bo as AvatarWidget,
3754
+ Zn as ErrorBoundary,
3755
+ Do as FieldProvider,
3756
+ To as LiveLayerDebugPanel,
3757
+ Ro as LiveLayerRegion,
3758
+ Io as LiveLayerWidget,
3759
+ Oo as clearFieldRegistry,
3760
+ eo as clearPageContextCache,
3761
+ lo as clearRoutesCache,
3762
+ Zr as extractPageContext,
3763
+ oo as extractRoutes,
3731
3764
  gn as getCachedPageContext,
3732
- Mt as getCachedRoutes,
3733
- Po as getRegisteredFields,
3734
- wr as matchesPattern,
3735
- eo as normalizeRouteInput,
3736
- $o as registerFields,
3737
- zo as setFieldValue,
3738
- _r as shouldRenderAtPath,
3739
- ir as useAgentInfo,
3740
- Zn as useAudioLevel,
3741
- nr as useCameraState,
3742
- No as useCollect,
3743
- sr as useDisplayMode,
3744
- ur as useDisplayModePersistence,
3745
- pr as useIsMobile,
3746
- Qn as useLiveKitSession,
3747
- or as useMediaDevices,
3748
- er as useMicrophoneState,
3749
- mr as usePathname,
3750
- vo as useRegisterFields,
3751
- xr as useRouteMatch,
3752
- rr as useScreenShareState,
3753
- Io as useTranscript
3765
+ Rt as getCachedRoutes,
3766
+ Ho as getRegisteredFields,
3767
+ xr as matchesPattern,
3768
+ no as normalizeRouteInput,
3769
+ Bo as registerFields,
3770
+ Wo as setFieldValue,
3771
+ kr as shouldRenderAtPath,
3772
+ ar as useAgentInfo,
3773
+ tr as useAudioLevel,
3774
+ or as useCameraState,
3775
+ Mo as useCollect,
3776
+ dr as useDisplayMode,
3777
+ pr as useDisplayModePersistence,
3778
+ mr as useIsMobile,
3779
+ er as useLiveKitSession,
3780
+ lr as useMediaDevices,
3781
+ nr as useMicrophoneState,
3782
+ yr as usePathname,
3783
+ xo as useRegisterFields,
3784
+ Lr as useRouteMatch,
3785
+ ir as useScreenShareState,
3786
+ Po as useTranscript
3754
3787
  };