@livelayer/react 0.21.4 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsxs as k, jsx as r, Fragment as We } from "react/jsx-runtime";
3
- import { Component as ur, useState as M, useRef as I, useEffect as T, useCallback as C, useMemo as tt, useLayoutEffect as Dn, forwardRef as Gt, useImperativeHandle as dr, createElement as fr } from "react";
4
- import { createPortal as Xt } from "react-dom";
5
- import { LiveKitSession as pr, registerFields as hr } from "@livelayer/sdk";
6
- import { clearFieldRegistry as po, getRegisteredFields as ho, registerFields as mo, setFieldValue as go } from "@livelayer/sdk";
7
- import { createLocalAudioTrack as mr, Track as zn, createLocalVideoTrack as gr } from "livekit-client";
8
- class yr extends ur {
3
+ import { Component as br, useState as M, useRef as I, useEffect as R, useCallback as C, useMemo as rt, useLayoutEffect as Wn, forwardRef as Zt, useImperativeHandle as wr, createElement as _r } from "react";
4
+ import { createPortal as Qt } from "react-dom";
5
+ import { LiveKitSession as xr, registerFields as Lr } from "@livelayer/sdk";
6
+ import { clearFieldRegistry as Do, getRegisteredFields as Po, registerFields as zo, setFieldValue as $o } from "@livelayer/sdk";
7
+ import { createLocalAudioTrack as Cr, Track as qn, createLocalVideoTrack as kr } from "livekit-client";
8
+ class Sr extends br {
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 yr extends ur {
15
15
  return { hasError: !0, error: t };
16
16
  }
17
17
  componentDidCatch(t, n) {
18
- var i, a;
19
- (a = (i = this.props).onError) == null || a.call(i, t, n);
18
+ var i, l;
19
+ (l = (i = this.props).onError) == null || l.call(i, t, n);
20
20
  }
21
21
  render() {
22
22
  var t;
@@ -35,26 +35,26 @@ class yr extends ur {
35
35
  ] }) : this.props.children;
36
36
  }
37
37
  }
38
- function vr(e) {
39
- const [t, n] = M("idle"), [i, a] = M("idle"), [o, s] = M([]), [l, c] = M(null), [u, m] = M(null), [p, h] = M(null), [P, x] = M(!1), [E, y] = M(null), w = I(null), R = I(e.onDataMessage);
40
- R.current = e.onDataMessage, T(() => {
38
+ function Er(e) {
39
+ const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [u, m] = M(null), [p, h] = M(null), [D, x] = M(!1), [E, y] = M(null), w = I(null), T = I(e.onDataMessage);
40
+ T.current = e.onDataMessage, R(() => {
41
41
  const g = {
42
- onConnectionStateChange: (W) => {
43
- n(W), W === "connected" && y(null);
42
+ onConnectionStateChange: (B) => {
43
+ n(B), B === "connected" && y(null);
44
44
  },
45
- onAgentStateChange: a,
46
- onTranscript: (W) => s([...W]),
45
+ onAgentStateChange: l,
46
+ onTranscript: (B) => s([...B]),
47
47
  onAgentConfig: c,
48
- onAudioTrack: (W) => h(W),
49
- onVideoTrack: (W) => m(W),
48
+ onAudioTrack: (B) => h(B),
49
+ onVideoTrack: (B) => m(B),
50
50
  onVideoTrackRemoved: () => m(null),
51
- onError: (W) => y(W),
52
- onDataMessage: (W) => {
51
+ onError: (B) => y(B),
52
+ onDataMessage: (B) => {
53
53
  var K;
54
- (K = R.current) == null || K.call(R, W);
54
+ (K = T.current) == null || K.call(T, B);
55
55
  },
56
56
  onResumabilityChange: x
57
- }, D = new pr(
57
+ }, z = new xr(
58
58
  {
59
59
  agentId: e.agentId,
60
60
  baseUrl: e.baseUrl,
@@ -64,9 +64,9 @@ function vr(e) {
64
64
  },
65
65
  g
66
66
  );
67
- return w.current = D, n("idle"), a("idle"), s([]), c(null), m(null), h(null), x(!1), y(null), () => {
68
- var W;
69
- (W = D.destroy) == null || W.call(D), w.current = null;
67
+ return w.current = z, n("idle"), l("idle"), s([]), c(null), m(null), h(null), x(!1), y(null), () => {
68
+ var B;
69
+ (B = z.destroy) == null || B.call(z), w.current = null;
70
70
  };
71
71
  }, [
72
72
  e.agentId,
@@ -80,8 +80,8 @@ function vr(e) {
80
80
  if (g)
81
81
  try {
82
82
  await g.connect();
83
- } catch (D) {
84
- throw y(D instanceof Error ? D.message : String(D)), D;
83
+ } catch (z) {
84
+ throw y(z instanceof Error ? z.message : String(z)), z;
85
85
  }
86
86
  }, []), v = C(() => {
87
87
  const g = w.current;
@@ -94,10 +94,10 @@ function vr(e) {
94
94
  connectionState: t,
95
95
  agentState: i,
96
96
  transcript: o,
97
- agentConfig: l,
97
+ agentConfig: a,
98
98
  videoElement: u,
99
99
  audioElement: p,
100
- canResume: P,
100
+ canResume: D,
101
101
  error: E,
102
102
  connect: S,
103
103
  disconnect: v,
@@ -105,8 +105,8 @@ function vr(e) {
105
105
  session: w.current
106
106
  };
107
107
  }
108
- function br() {
109
- const e = I(null), t = I(/* @__PURE__ */ new Map()), n = I(null), i = I(/* @__PURE__ */ new Set()), a = C(() => {
108
+ function Ar() {
109
+ const e = I(null), t = I(/* @__PURE__ */ new Map()), n = I(null), i = I(/* @__PURE__ */ new Set()), l = C(() => {
110
110
  const x = t.current;
111
111
  if (x.size === 0) {
112
112
  n.current = null;
@@ -115,9 +115,9 @@ function br() {
115
115
  let E = 0;
116
116
  for (const { analyser: y, buffer: w } of x.values()) {
117
117
  y.getByteFrequencyData(w);
118
- let R = 0;
119
- for (let v = 0; v < w.length; v++) R += w[v];
120
- const S = R / w.length / 255;
118
+ let T = 0;
119
+ for (let v = 0; v < w.length; v++) T += w[v];
120
+ const S = T / w.length / 255;
121
121
  S > E && (E = S);
122
122
  }
123
123
  for (const y of i.current)
@@ -126,10 +126,10 @@ function br() {
126
126
  } catch (w) {
127
127
  console.error("[useAudioLevel] subscriber threw:", w);
128
128
  }
129
- n.current = requestAnimationFrame(a);
129
+ n.current = requestAnimationFrame(l);
130
130
  }, []), o = C(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = C(() => {
131
- n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(a));
132
- }, [a]), l = C((x) => {
131
+ n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(l));
132
+ }, [l]), a = C((x) => {
133
133
  const E = t.current.get(x);
134
134
  if (E) {
135
135
  try {
@@ -146,24 +146,24 @@ function br() {
146
146
  (x, E) => {
147
147
  const y = o();
148
148
  if (!y) return;
149
- l(x);
149
+ a(x);
150
150
  const w = E(y);
151
151
  if (!w) return;
152
- const R = y.createAnalyser();
153
- R.fftSize = 64;
152
+ const T = y.createAnalyser();
153
+ T.fftSize = 64;
154
154
  try {
155
- w.connect(R);
155
+ w.connect(T);
156
156
  } catch (S) {
157
157
  console.warn("[useAudioLevel] connect failed for slot", x, S);
158
158
  return;
159
159
  }
160
160
  t.current.set(x, {
161
- analyser: R,
161
+ analyser: T,
162
162
  node: w,
163
- buffer: new Uint8Array(new ArrayBuffer(R.frequencyBinCount))
163
+ buffer: new Uint8Array(new ArrayBuffer(T.frequencyBinCount))
164
164
  }), s();
165
165
  },
166
- [l, o, s]
166
+ [a, o, s]
167
167
  ), u = C(
168
168
  (x, E = "agent") => {
169
169
  c(E, (y) => {
@@ -196,17 +196,17 @@ function br() {
196
196
  [c]
197
197
  ), p = C(
198
198
  (x) => {
199
- l(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
199
+ a(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
200
200
  },
201
- [l]
201
+ [a]
202
202
  ), h = C(() => {
203
203
  n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
204
204
  for (const x of Array.from(t.current.keys()))
205
- l(x);
206
- }, [l]), P = C((x) => (i.current.add(x), () => {
205
+ a(x);
206
+ }, [a]), D = C((x) => (i.current.add(x), () => {
207
207
  i.current.delete(x);
208
208
  }), []);
209
- return T(() => () => {
209
+ return R(() => () => {
210
210
  if (h(), e.current) {
211
211
  try {
212
212
  e.current.close();
@@ -215,14 +215,14 @@ function br() {
215
215
  e.current = null;
216
216
  }
217
217
  i.current.clear();
218
- }, [h]), { attach: u, attachStream: m, detach: h, detachSlot: p, subscribe: P };
218
+ }, [h]), { attach: u, attachStream: m, detach: h, detachSlot: p, subscribe: D };
219
219
  }
220
- function wr(e) {
220
+ function Nr(e) {
221
221
  const t = e == null ? void 0 : e.mediaStreamTrack;
222
222
  return t ? new MediaStream([t]) : null;
223
223
  }
224
- function _r(e = {}) {
225
- const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, a] = M(t), [o, s] = M(""), [l, c] = M(null), u = I(null), m = I(null), p = I({
224
+ function Mr(e = {}) {
225
+ const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, l] = M(t), [o, s] = M(""), [a, c] = M(null), u = I(null), m = I(null), p = I({
226
226
  active: t,
227
227
  lastAutoIntent: null
228
228
  }), h = C(async (S) => {
@@ -236,18 +236,18 @@ function _r(e = {}) {
236
236
  }
237
237
  m.current = S, c(null);
238
238
  try {
239
- const g = await mr({
239
+ const g = await Cr({
240
240
  echoCancellation: !0,
241
241
  noiseSuppression: !0
242
242
  });
243
- await S.localParticipant.publishTrack(g), u.current = g, p.current.active ? (await S.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, a(!0)) : a(g.isMuted);
244
- const D = (O = (v = g.mediaStreamTrack) == null ? void 0 : v.getSettings) == null ? void 0 : O.call(v);
245
- D != null && D.deviceId && s(D.deviceId);
243
+ await S.localParticipant.publishTrack(g), u.current = g, p.current.active ? (await S.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, l(!0)) : l(g.isMuted);
244
+ const z = (O = (v = g.mediaStreamTrack) == null ? void 0 : v.getSettings) == null ? void 0 : O.call(v);
245
+ z != null && z.deviceId && s(z.deviceId);
246
246
  } catch (g) {
247
- const D = g instanceof Error && g.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
248
- throw c(D), g;
247
+ const z = g instanceof Error && g.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
248
+ throw c(z), g;
249
249
  }
250
- }, []), P = C((S) => {
250
+ }, []), D = C((S) => {
251
251
  m.current = S;
252
252
  }, []), x = C(async (S) => {
253
253
  const v = m.current;
@@ -259,21 +259,21 @@ function _r(e = {}) {
259
259
  }
260
260
  }, []), E = C(async () => {
261
261
  const S = m.current, v = !i;
262
- if (a(v), p.current.active = !1, !!S)
262
+ if (l(v), p.current.active = !1, !!S)
263
263
  try {
264
264
  await S.localParticipant.setMicrophoneEnabled(!v);
265
265
  } catch (O) {
266
- console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), a(!v);
266
+ console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), l(!v);
267
267
  }
268
268
  }, [i]);
269
- T(() => {
269
+ R(() => {
270
270
  if (!p.current.active || n !== "listening") return;
271
271
  const S = m.current, v = S == null ? void 0 : S.localParticipant;
272
272
  if (!v) {
273
273
  p.current.active = !1;
274
274
  return;
275
275
  }
276
- v.isMicrophoneEnabled === p.current.lastAutoIntent && (v.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, a(!1)), p.current.active = !1;
276
+ v.isMicrophoneEnabled === p.current.lastAutoIntent && (v.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, l(!1)), p.current.active = !1;
277
277
  }, [n]);
278
278
  const y = C(() => {
279
279
  const S = u.current, v = m.current;
@@ -284,30 +284,30 @@ function _r(e = {}) {
284
284
  }
285
285
  S.stop();
286
286
  }
287
- u.current = null, m.current = null, p.current = { active: t, lastAutoIntent: null }, a(t), s("");
288
- }, [t]), w = C(() => c(null), []), R = C(() => wr(u.current), []);
287
+ u.current = null, m.current = null, p.current = { active: t, lastAutoIntent: null }, l(t), s("");
288
+ }, [t]), w = C(() => c(null), []), T = C(() => Nr(u.current), []);
289
289
  return {
290
290
  isMuted: i,
291
291
  activeDeviceId: o,
292
- micError: l,
292
+ micError: a,
293
293
  toggleMute: E,
294
294
  setupMic: h,
295
- attachRoom: P,
295
+ attachRoom: D,
296
296
  switchDevice: x,
297
297
  teardownMic: y,
298
298
  clearError: w,
299
- getMicStream: R
299
+ getMicStream: T
300
300
  };
301
301
  }
302
- const xr = { resolution: { width: 640, height: 480, frameRate: 24 } };
303
- function Lr() {
304
- const [e, t] = M(!1), [n, i] = M(null), [a, o] = M(null), [s, l] = M(""), c = I(null), u = I(null), m = C((w) => {
302
+ const Ir = { resolution: { width: 640, height: 480, frameRate: 24 } };
303
+ function Tr() {
304
+ const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c = I(null), u = I(null), m = C((w) => {
305
305
  c.current = w;
306
306
  }, []), p = C(() => {
307
307
  var S;
308
- const w = c.current, R = u.current;
309
- if (R && w) {
310
- const v = w.localParticipant.getTrackPublication(zn.Source.Camera), g = (v == null ? void 0 : v.track) ?? R;
308
+ const w = c.current, T = u.current;
309
+ if (T && w) {
310
+ const v = w.localParticipant.getTrackPublication(qn.Source.Camera), g = (v == null ? void 0 : v.track) ?? T;
311
311
  try {
312
312
  w.localParticipant.unpublishTrack(g);
313
313
  } catch {
@@ -319,18 +319,18 @@ function Lr() {
319
319
  }
320
320
  u.current = null, o(null), t(!1);
321
321
  }, []), h = C(async (w) => {
322
- const R = c.current;
323
- if (R) {
322
+ const T = c.current;
323
+ if (T) {
324
324
  i(null);
325
325
  try {
326
- const S = { ...xr };
326
+ const S = { ...Ir };
327
327
  w && (S.deviceId = w);
328
- const v = await gr(S);
329
- await R.localParticipant.publishTrack(v), u.current = v;
328
+ const v = await kr(S);
329
+ await T.localParticipant.publishTrack(v), u.current = v;
330
330
  const O = v.attach();
331
- o(O), t(!0), w && l(w);
331
+ o(O), t(!0), w && a(w);
332
332
  try {
333
- R.localParticipant.publishData(
333
+ T.localParticipant.publishData(
334
334
  new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
335
335
  { reliable: !0 }
336
336
  );
@@ -341,29 +341,29 @@ function Lr() {
341
341
  i(v);
342
342
  }
343
343
  }
344
- }, []), P = C(async () => {
344
+ }, []), D = C(async () => {
345
345
  e ? p() : await h(s || void 0);
346
346
  }, [e, s, p, h]), x = C(async (w) => {
347
347
  p(), await h(w);
348
348
  }, [p, h]), E = C(() => {
349
- p(), c.current = null, i(null), l("");
349
+ p(), c.current = null, i(null), a("");
350
350
  }, [p]), y = C(() => i(null), []);
351
- return T(() => () => {
351
+ return R(() => () => {
352
352
  u.current && u.current.stop();
353
353
  }, []), {
354
354
  isEnabled: e,
355
355
  error: n,
356
- previewEl: a,
356
+ previewEl: l,
357
357
  activeDeviceId: s,
358
- toggle: P,
358
+ toggle: D,
359
359
  switchDevice: x,
360
360
  attachRoom: m,
361
361
  teardown: E,
362
362
  clearError: y
363
363
  };
364
364
  }
365
- function Cr() {
366
- const [e, t] = M(!1), [n, i] = M(null), [a, o] = M(null), s = I(null), l = C((h) => {
365
+ function Rr() {
366
+ const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = I(null), a = C((h) => {
367
367
  s.current = h;
368
368
  }, []), c = C(() => o(null), []), u = C(async () => {
369
369
  const h = s.current;
@@ -379,9 +379,9 @@ function Cr() {
379
379
  i(null);
380
380
  try {
381
381
  await h.localParticipant.setScreenShareEnabled(!0);
382
- let P = 0;
382
+ let D = 0;
383
383
  const x = () => {
384
- const E = h.localParticipant.getTrackPublication(zn.Source.ScreenShare);
384
+ const E = h.localParticipant.getTrackPublication(qn.Source.ScreenShare);
385
385
  if (E != null && E.track) {
386
386
  const y = E.track.attach();
387
387
  o(y), t(!0);
@@ -394,11 +394,11 @@ function Cr() {
394
394
  }
395
395
  return;
396
396
  }
397
- P++ < 10 ? setTimeout(x, 100) : t(!0);
397
+ D++ < 10 ? setTimeout(x, 100) : t(!0);
398
398
  };
399
399
  x();
400
- } catch (P) {
401
- const x = P instanceof Error ? P.name : "";
400
+ } catch (D) {
401
+ const x = D instanceof Error ? D.name : "";
402
402
  x !== "NotAllowedError" && x !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
403
403
  }
404
404
  }
@@ -411,10 +411,10 @@ function Cr() {
411
411
  }
412
412
  c(), t(!1), i(null), s.current = null;
413
413
  }, [e, c]), p = C(() => i(null), []);
414
- return { isEnabled: e, error: n, previewEl: a, toggle: u, attachRoom: l, teardown: m, clearError: p };
414
+ return { isEnabled: e, error: n, previewEl: l, toggle: u, attachRoom: a, teardown: m, clearError: p };
415
415
  }
416
- function kr() {
417
- const [e, t] = M([]), [n, i] = M([]), a = C(async () => {
416
+ function Dr() {
417
+ const [e, t] = M([]), [n, i] = M([]), l = C(async () => {
418
418
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
419
419
  try {
420
420
  const o = await navigator.mediaDevices.enumerateDevices();
@@ -422,15 +422,15 @@ function kr() {
422
422
  } catch {
423
423
  }
424
424
  }, []);
425
- return T(() => {
426
- if (a(), typeof navigator > "u" || !navigator.mediaDevices) return;
427
- const o = () => void a();
425
+ return R(() => {
426
+ if (l(), typeof navigator > "u" || !navigator.mediaDevices) return;
427
+ const o = () => void l();
428
428
  return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
429
- }, [a]), { mics: e, cameras: n, refresh: a };
429
+ }, [l]), { mics: e, cameras: n, refresh: l };
430
430
  }
431
- function Sr(e, t, n = !1) {
432
- const [i, a] = M(null), [o, s] = M(null), [l, c] = M(!n && !!e);
433
- return T(() => {
431
+ function Pr(e, t, n = !1) {
432
+ const [i, l] = M(null), [o, s] = M(null), [a, c] = M(!n && !!e);
433
+ return R(() => {
434
434
  if (n || !e) {
435
435
  c(!1);
436
436
  return;
@@ -445,13 +445,13 @@ function Sr(e, t, n = !1) {
445
445
  }
446
446
  return p.json();
447
447
  }).then((p) => {
448
- u.signal.aborted || (a(p), c(!1));
448
+ u.signal.aborted || (l(p), c(!1));
449
449
  }).catch((p) => {
450
450
  u.signal.aborted || (s(p instanceof Error ? p.message : "Agent lookup failed"), c(!1));
451
451
  }), () => u.abort();
452
- }, [e, t, n]), { info: i, error: o, loading: l };
452
+ }, [e, t, n]), { info: i, error: o, loading: a };
453
453
  }
454
- function $n(e) {
454
+ function Un(e) {
455
455
  if (typeof window > "u") return null;
456
456
  try {
457
457
  return window.localStorage.getItem(e);
@@ -459,78 +459,78 @@ function $n(e) {
459
459
  return null;
460
460
  }
461
461
  }
462
- function Hn(e, t) {
462
+ function jn(e, t) {
463
463
  if (!(typeof window > "u"))
464
464
  try {
465
465
  window.localStorage.setItem(e, t);
466
466
  } catch {
467
467
  }
468
468
  }
469
- function Er(e) {
469
+ function zr(e) {
470
470
  if (!(typeof window > "u"))
471
471
  try {
472
472
  window.localStorage.removeItem(e);
473
473
  } catch {
474
474
  }
475
475
  }
476
- function Nr({
476
+ function $r({
477
477
  value: e,
478
478
  defaultValue: t = "expanded",
479
479
  onChange: n
480
480
  } = {}) {
481
- const i = e !== void 0, [a, o] = M(t), s = i ? e : a, l = C(
481
+ const i = e !== void 0, [l, o] = M(t), s = i ? e : l, a = C(
482
482
  (c) => {
483
483
  c !== s && (i || o(c), n == null || n(c));
484
484
  },
485
485
  [s, i, n]
486
486
  );
487
- return [s, l];
487
+ return [s, a];
488
488
  }
489
- const Ar = ["hidden", "minimized", "expanded"];
490
- function Mr(e) {
491
- return e && Ar.includes(e) ? e : null;
489
+ const Hr = ["hidden", "minimized", "expanded"];
490
+ function Or(e) {
491
+ return e && Hr.includes(e) ? e : null;
492
492
  }
493
- function Ir({
493
+ function Fr({
494
494
  value: e,
495
495
  defaultValue: t = "expanded",
496
496
  onChange: n,
497
497
  persistKey: i = "ll-widget",
498
- disablePersistence: a = !1
498
+ disablePersistence: l = !1
499
499
  } = {}) {
500
- const o = `${i}:display-mode`, s = I(!1), [l, c] = Nr({
500
+ const o = `${i}:display-mode`, s = I(!1), [a, c] = $r({
501
501
  value: e,
502
502
  defaultValue: t,
503
503
  onChange: (u) => {
504
- e === void 0 && !a && Hn(o, u), n == null || n(u);
504
+ e === void 0 && !l && jn(o, u), n == null || n(u);
505
505
  }
506
506
  });
507
- return T(() => {
508
- if (s.current || (s.current = !0, a || e !== void 0)) return;
509
- const u = Mr($n(o));
510
- u && u !== l && c(u);
511
- }, []), [l, c];
507
+ return R(() => {
508
+ if (s.current || (s.current = !0, l || e !== void 0)) return;
509
+ const u = Or(Un(o));
510
+ u && u !== a && c(u);
511
+ }, []), [a, c];
512
512
  }
513
- const Rr = 640;
514
- function Tr(e = Rr) {
513
+ const Br = 640;
514
+ function Wr(e = Br) {
515
515
  const [t, n] = M(!1);
516
- return T(() => {
516
+ return R(() => {
517
517
  if (e === !1) {
518
518
  n(!1);
519
519
  return;
520
520
  }
521
521
  if (typeof window > "u" || typeof window.matchMedia > "u")
522
522
  return;
523
- const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i), o = () => n(a.matches);
524
- return o(), typeof a.addEventListener == "function" ? (a.addEventListener("change", o), () => a.removeEventListener("change", o)) : (a.addListener(o), () => {
525
- a.removeListener(o);
523
+ const i = `(max-width: ${e - 1}px)`, l = window.matchMedia(i), o = () => n(l.matches);
524
+ return o(), typeof l.addEventListener == "function" ? (l.addEventListener("change", o), () => l.removeEventListener("change", o)) : (l.addListener(o), () => {
525
+ l.removeListener(o);
526
526
  });
527
527
  }, [e]), t;
528
528
  }
529
- const Pr = 280, Dr = 380, zr = 8, $r = 4;
530
- function Ft(e) {
529
+ const qr = 280, Ur = 380, jr = 8, Vr = 4;
530
+ function Ut(e) {
531
531
  return `${e}:geometry`;
532
532
  }
533
- function Hr(e) {
533
+ function Yr(e) {
534
534
  if (!e) return null;
535
535
  let t;
536
536
  try {
@@ -539,94 +539,94 @@ function Hr(e) {
539
539
  return null;
540
540
  }
541
541
  if (typeof t != "object" || t === null) return null;
542
- const n = t, { top: i, left: a, width: o, height: s } = n;
543
- return typeof i != "number" || typeof a != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: a, width: o, height: s };
542
+ const n = t, { top: i, left: l, width: o, height: s } = n;
543
+ return typeof i != "number" || typeof l != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(l) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: l, width: o, height: s };
544
544
  }
545
- function kt() {
545
+ function At() {
546
546
  return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
547
547
  }
548
- function Wt(e, t, n) {
549
- const { minWidth: i, minHeight: a, edgeMargin: o, vw: s, vh: l } = n, c = Math.max(i, s - o * 2), u = Math.max(a, l - o * 2);
548
+ function jt(e, t, n) {
549
+ const { minWidth: i, minHeight: l, edgeMargin: o, vw: s, vh: a } = n, c = Math.max(i, s - o * 2), u = Math.max(l, a - o * 2);
550
550
  return {
551
551
  width: Math.max(i, Math.min(c, e)),
552
- height: Math.max(a, Math.min(u, t))
552
+ height: Math.max(l, Math.min(u, t))
553
553
  };
554
554
  }
555
- function Bt(e, t, n, i, a) {
556
- const { edgeMargin: o, vw: s, vh: l } = a, c = o, u = o, m = Math.max(c, s - n - o), p = Math.max(u, l - i - o);
555
+ function Vt(e, t, n, i, l) {
556
+ const { edgeMargin: o, vw: s, vh: a } = l, c = o, u = o, m = Math.max(c, s - n - o), p = Math.max(u, a - i - o);
557
557
  return {
558
558
  top: Math.max(u, Math.min(p, e)),
559
559
  left: Math.max(c, Math.min(m, t))
560
560
  };
561
561
  }
562
- function Or(e) {
562
+ function Gr(e) {
563
563
  const {
564
564
  draggable: t,
565
565
  resizable: n,
566
566
  persistKey: i,
567
- disablePersistence: a,
568
- minWidth: o = Pr,
569
- minHeight: s = Dr,
570
- edgeMargin: l = zr
571
- } = e, [c, u] = M(null), [m, p] = M(!1), [h, P] = M(!1), x = I(null), E = I(null), y = I(!1), w = I(null);
567
+ disablePersistence: l,
568
+ minWidth: o = qr,
569
+ minHeight: s = Ur,
570
+ edgeMargin: a = jr
571
+ } = e, [c, u] = M(null), [m, p] = M(!1), [h, D] = M(!1), x = I(null), E = I(null), y = I(!1), w = I(null);
572
572
  w.current = c;
573
- const R = C(
573
+ const T = C(
574
574
  (f) => {
575
- a || (f === null ? Er(Ft(i)) : Hn(Ft(i), JSON.stringify(f)));
575
+ l || (f === null ? zr(Ut(i)) : jn(Ut(i), JSON.stringify(f)));
576
576
  },
577
- [a, i]
577
+ [l, i]
578
578
  );
579
- T(() => {
580
- if (y.current || (y.current = !0, a)) return;
581
- const f = Hr($n(Ft(i)));
579
+ R(() => {
580
+ if (y.current || (y.current = !0, l)) return;
581
+ const f = Yr(Un(Ut(i)));
582
582
  if (!f) return;
583
- const { vw: N, vh: z } = kt(), q = Wt(f.width, f.height, {
583
+ const { vw: A, vh: $ } = At(), q = jt(f.width, f.height, {
584
584
  minWidth: o,
585
585
  minHeight: s,
586
- edgeMargin: l,
587
- vw: N,
588
- vh: z
589
- }), X = Bt(f.top, f.left, q.width, q.height, {
590
- edgeMargin: l,
591
- vw: N,
592
- vh: z
586
+ edgeMargin: a,
587
+ vw: A,
588
+ vh: $
589
+ }), X = Vt(f.top, f.left, q.width, q.height, {
590
+ edgeMargin: a,
591
+ vw: A,
592
+ vh: $
593
593
  });
594
594
  u({ ...X, ...q });
595
- }, []), T(() => {
595
+ }, []), R(() => {
596
596
  if (typeof window > "u") return;
597
597
  const f = () => {
598
- u((N) => {
599
- if (N === null) return null;
600
- const { vw: z, vh: q } = kt(), X = Wt(N.width, N.height, {
598
+ u((A) => {
599
+ if (A === null) return null;
600
+ const { vw: $, vh: q } = At(), X = jt(A.width, A.height, {
601
601
  minWidth: o,
602
602
  minHeight: s,
603
- edgeMargin: l,
604
- vw: z,
603
+ edgeMargin: a,
604
+ vw: $,
605
605
  vh: q
606
606
  });
607
- return { ...Bt(N.top, N.left, X.width, X.height, {
608
- edgeMargin: l,
609
- vw: z,
607
+ return { ...Vt(A.top, A.left, X.width, X.height, {
608
+ edgeMargin: a,
609
+ vw: $,
610
610
  vh: q
611
611
  }), ...X };
612
612
  });
613
613
  };
614
614
  return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
615
- }, [o, s, l]);
615
+ }, [o, s, a]);
616
616
  const S = C(
617
617
  (f) => {
618
618
  if (!t || f.pointerType === "mouse" && f.button !== 0) return;
619
- const N = f.target;
620
- if (N && typeof N.closest == "function" && N.closest('button, a, input, select, textarea, [role="listbox"], [role="option"], [data-ll-no-drag]'))
619
+ const A = f.target;
620
+ if (A && typeof A.closest == "function" && A.closest('button, a, input, select, textarea, [role="listbox"], [role="option"], [data-ll-no-drag]'))
621
621
  return;
622
- let z, q, X, ee;
622
+ let $, q, X, ee;
623
623
  const V = w.current;
624
624
  if (V)
625
- ({ top: z, left: q, width: X, height: ee } = V);
625
+ ({ top: $, left: q, width: X, height: ee } = V);
626
626
  else {
627
627
  const te = f.currentTarget.closest(".ll-widget"), oe = te == null ? void 0 : te.getBoundingClientRect();
628
628
  if (!oe) return;
629
- z = oe.top, q = oe.left, X = oe.width, ee = oe.height;
629
+ $ = oe.top, q = oe.left, X = oe.width, ee = oe.height;
630
630
  }
631
631
  try {
632
632
  f.currentTarget.setPointerCapture(f.pointerId);
@@ -635,7 +635,7 @@ function Or(e) {
635
635
  x.current = {
636
636
  startClientX: f.clientX,
637
637
  startClientY: f.clientY,
638
- startTop: z,
638
+ startTop: $,
639
639
  startLeft: q,
640
640
  width: X,
641
641
  height: ee,
@@ -645,46 +645,46 @@ function Or(e) {
645
645
  [t]
646
646
  ), v = C(
647
647
  (f) => {
648
- const N = x.current;
649
- if (!N) return;
650
- const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY;
651
- if (!N.moved && Math.abs(z) + Math.abs(q) > $r && (N.moved = !0, p(!0)), !N.moved) return;
652
- const { vw: X, vh: ee } = kt(), V = Bt(
653
- N.startTop + q,
654
- N.startLeft + z,
655
- N.width,
656
- N.height,
657
- { edgeMargin: l, vw: X, vh: ee }
648
+ const A = x.current;
649
+ if (!A) return;
650
+ const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY;
651
+ if (!A.moved && Math.abs($) + Math.abs(q) > Vr && (A.moved = !0, p(!0)), !A.moved) return;
652
+ const { vw: X, vh: ee } = At(), V = Vt(
653
+ A.startTop + q,
654
+ A.startLeft + $,
655
+ A.width,
656
+ A.height,
657
+ { edgeMargin: a, vw: X, vh: ee }
658
658
  );
659
- u({ ...V, width: N.width, height: N.height });
659
+ u({ ...V, width: A.width, height: A.height });
660
660
  },
661
- [l]
661
+ [a]
662
662
  ), O = C(
663
663
  (f) => {
664
- const N = x.current;
665
- if (N) {
664
+ const A = x.current;
665
+ if (A) {
666
666
  try {
667
667
  f.currentTarget.releasePointerCapture(f.pointerId);
668
668
  } catch {
669
669
  }
670
- x.current = null, N.moved && (p(!1), u((z) => (z && R(z), z)));
670
+ x.current = null, A.moved && (p(!1), u(($) => ($ && T($), $)));
671
671
  }
672
672
  },
673
- [R]
673
+ [T]
674
674
  ), g = C(() => {
675
- x.current = null, E.current = null, p(!1), P(!1), u(null), R(null);
676
- }, [R]), D = C(
675
+ x.current = null, E.current = null, p(!1), D(!1), u(null), T(null);
676
+ }, [T]), z = C(
677
677
  (f) => {
678
678
  if (!n || f.pointerType === "mouse" && f.button !== 0) return;
679
679
  f.stopPropagation();
680
- let N, z, q, X;
680
+ let A, $, q, X;
681
681
  const ee = w.current;
682
682
  if (ee)
683
- ({ top: N, left: z, width: q, height: X } = ee);
683
+ ({ top: A, left: $, width: q, height: X } = ee);
684
684
  else {
685
685
  const V = f.currentTarget.closest(".ll-widget"), te = V == null ? void 0 : V.getBoundingClientRect();
686
686
  if (!te) return;
687
- N = te.top, z = te.left, q = te.width, X = te.height;
687
+ A = te.top, $ = te.left, q = te.width, X = te.height;
688
688
  }
689
689
  try {
690
690
  f.currentTarget.setPointerCapture(f.pointerId);
@@ -695,27 +695,27 @@ function Or(e) {
695
695
  startClientY: f.clientY,
696
696
  startWidth: q,
697
697
  startHeight: X,
698
- top: N,
699
- left: z
700
- }, P(!0);
698
+ top: A,
699
+ left: $
700
+ }, D(!0);
701
701
  },
702
702
  [n]
703
- ), W = C(
703
+ ), B = C(
704
704
  (f) => {
705
- const N = E.current;
706
- if (!N) return;
707
- const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY, { vw: X, vh: ee } = kt(), V = X - N.left - l, te = ee - N.top - l, oe = Wt(N.startWidth + z, N.startHeight + q, {
705
+ const A = E.current;
706
+ if (!A) return;
707
+ const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY, { vw: X, vh: ee } = At(), V = X - A.left - a, te = ee - A.top - a, oe = jt(A.startWidth + $, A.startHeight + q, {
708
708
  minWidth: o,
709
709
  minHeight: s,
710
- edgeMargin: l,
710
+ edgeMargin: a,
711
711
  // Clamp the available viewport to the room from the anchored corner
712
712
  // so the widget can't grow past the bottom/right edge.
713
- vw: Math.min(X, N.left + V + l),
714
- vh: Math.min(ee, N.top + te + l)
713
+ vw: Math.min(X, A.left + V + a),
714
+ vh: Math.min(ee, A.top + te + a)
715
715
  });
716
- u({ top: N.top, left: N.left, ...oe });
716
+ u({ top: A.top, left: A.left, ...oe });
717
717
  },
718
- [l, o, s]
718
+ [a, o, s]
719
719
  ), K = C(
720
720
  (f) => {
721
721
  if (E.current) {
@@ -723,10 +723,10 @@ function Or(e) {
723
723
  f.currentTarget.releasePointerCapture(f.pointerId);
724
724
  } catch {
725
725
  }
726
- E.current = null, P(!1), u((z) => (z && R(z), z));
726
+ E.current = null, D(!1), u(($) => ($ && T($), $));
727
727
  }
728
728
  },
729
- [R]
729
+ [T]
730
730
  );
731
731
  return {
732
732
  style: c === null ? {} : {
@@ -750,8 +750,8 @@ function Or(e) {
750
750
  "data-ll-drag-handle": t ? "" : void 0
751
751
  },
752
752
  resizeHandleProps: {
753
- onPointerDown: D,
754
- onPointerMove: W,
753
+ onPointerDown: z,
754
+ onPointerMove: B,
755
755
  onPointerUp: K,
756
756
  onPointerCancel: K,
757
757
  "data-ll-resize-handle": n ? "" : void 0
@@ -759,75 +759,75 @@ function Or(e) {
759
759
  reset: g
760
760
  };
761
761
  }
762
- const mn = "__llHistoryPatched", Nt = "ll:pathname";
763
- function Fr() {
764
- if (typeof window > "u" || window.history[mn]) return;
762
+ const vn = "__llHistoryPatched", It = "ll:pathname";
763
+ function Xr() {
764
+ if (typeof window > "u" || window.history[vn]) return;
765
765
  const e = window.history.pushState, t = window.history.replaceState;
766
766
  window.history.pushState = function(...n) {
767
767
  const i = e.apply(this, n);
768
- return window.dispatchEvent(new Event(Nt)), i;
768
+ return window.dispatchEvent(new Event(It)), i;
769
769
  }, window.history.replaceState = function(...n) {
770
770
  const i = t.apply(this, n);
771
- return window.dispatchEvent(new Event(Nt)), i;
772
- }, window.history[mn] = !0;
771
+ return window.dispatchEvent(new Event(It)), i;
772
+ }, window.history[vn] = !0;
773
773
  }
774
- function gn() {
774
+ function bn() {
775
775
  return typeof window > "u" ? "/" : window.location.pathname || "/";
776
776
  }
777
- function Wr(e) {
777
+ function Kr(e) {
778
778
  const [t, n] = M(
779
- () => e ?? gn()
779
+ () => e ?? bn()
780
780
  );
781
- return T(() => {
781
+ return R(() => {
782
782
  if (e !== void 0) return;
783
- Fr();
784
- const i = () => n(gn());
785
- return i(), window.addEventListener("popstate", i), window.addEventListener(Nt, i), () => {
786
- window.removeEventListener("popstate", i), window.removeEventListener(Nt, i);
783
+ Xr();
784
+ const i = () => n(bn());
785
+ return i(), window.addEventListener("popstate", i), window.addEventListener(It, i), () => {
786
+ window.removeEventListener("popstate", i), window.removeEventListener(It, i);
787
787
  };
788
788
  }, [e]), e ?? t;
789
789
  }
790
- const yn = /* @__PURE__ */ new Map(), Br = /[\\^$+?.()|{}[\]]/g;
791
- function qr(e) {
792
- return e.replace(Br, "\\$&");
790
+ const wn = /* @__PURE__ */ new Map(), Jr = /[\\^$+?.()|{}[\]]/g;
791
+ function Zr(e) {
792
+ return e.replace(Jr, "\\$&");
793
793
  }
794
- function Ur(e) {
795
- const t = yn.get(e);
794
+ function Qr(e) {
795
+ const t = wn.get(e);
796
796
  if (t) return t;
797
- const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", a = "", o = n.replace(/\*\*/g, i).replace(/\*/g, a), l = qr(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
798
- return yn.set(e, c), c;
797
+ const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", l = "", o = n.replace(/\*\*/g, i).replace(/\*/g, l), a = Zr(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
798
+ return wn.set(e, c), c;
799
799
  }
800
- function jr(e, t) {
800
+ function ei(e, t) {
801
801
  const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
802
- return Ur(e).test(n);
802
+ return Qr(e).test(n);
803
803
  }
804
- function Vr(e, t) {
805
- return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : jr(e, t);
804
+ function ti(e, t) {
805
+ return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : ei(e, t);
806
806
  }
807
- function vn(e, t) {
807
+ function _n(e, t) {
808
808
  if (!e || e.length === 0) return !1;
809
809
  for (const n of e)
810
- if (Vr(n, t)) return !0;
810
+ if (ti(n, t)) return !0;
811
811
  return !1;
812
812
  }
813
- function Yr(e, t, n) {
814
- return e === void 0 ? !0 : vn(n, e) ? !1 : t && t.length > 0 ? vn(t, e) : !0;
813
+ function ni(e, t, n) {
814
+ return e === void 0 ? !0 : _n(n, e) ? !1 : t && t.length > 0 ? _n(t, e) : !0;
815
815
  }
816
- function Gr(e, t, n) {
817
- return tt(
818
- () => Yr(e, t, n),
816
+ function ri(e, t, n) {
817
+ return rt(
818
+ () => ni(e, t, n),
819
819
  [e, t, n]
820
820
  );
821
821
  }
822
- function Xr(e) {
822
+ function ii(e) {
823
823
  return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
824
824
  navigate: e.navigate !== !1,
825
825
  thinking: e.thinking !== !1,
826
826
  action: e.action !== !1
827
827
  };
828
828
  }
829
- function Kr(e) {
830
- const t = tt(() => Xr(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = I(null), a = C(
829
+ function oi(e) {
830
+ const t = rt(() => ii(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = I(null), l = C(
831
831
  (c) => {
832
832
  try {
833
833
  new Audio(`${n}${c}`).play().catch(() => {
@@ -837,10 +837,10 @@ function Kr(e) {
837
837
  },
838
838
  [n]
839
839
  ), o = C(() => {
840
- t.navigate && a("/audio/page-change-sound.mp3");
841
- }, [t.navigate, a]), s = C(() => {
842
- t.action && a("/audio/confirmation-sound.mp3");
843
- }, [t.action, a]), l = C(
840
+ t.navigate && l("/audio/page-change-sound.mp3");
841
+ }, [t.navigate, l]), s = C(() => {
842
+ t.action && l("/audio/confirmation-sound.mp3");
843
+ }, [t.action, l]), a = C(
844
844
  (c) => {
845
845
  if (!t.thinking) {
846
846
  if (i.current) {
@@ -871,7 +871,7 @@ function Kr(e) {
871
871
  },
872
872
  [n, t.thinking]
873
873
  );
874
- return T(() => () => {
874
+ return R(() => () => {
875
875
  if (i.current) {
876
876
  try {
877
877
  i.current.pause();
@@ -879,12 +879,12 @@ function Kr(e) {
879
879
  }
880
880
  i.current = null;
881
881
  }
882
- }, []), tt(
883
- () => ({ playPageChange: o, playConfirmation: s, setThinking: l }),
884
- [o, s, l]
882
+ }, []), rt(
883
+ () => ({ playPageChange: o, playConfirmation: s, setThinking: a }),
884
+ [o, s, a]
885
885
  );
886
886
  }
887
- const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
887
+ const xn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
888
888
  "svg",
889
889
  {
890
890
  className: t,
@@ -930,7 +930,7 @@ const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
930
930
  }
931
931
  )
932
932
  }
933
- ), wn = ({ className: e }) => /* @__PURE__ */ r(
933
+ ), Ln = ({ className: e }) => /* @__PURE__ */ r(
934
934
  "svg",
935
935
  {
936
936
  className: e,
@@ -948,7 +948,7 @@ const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
948
948
  }
949
949
  )
950
950
  }
951
- ), Jr = ({ className: e }) => /* @__PURE__ */ r(
951
+ ), li = ({ className: e }) => /* @__PURE__ */ r(
952
952
  "svg",
953
953
  {
954
954
  className: e,
@@ -959,12 +959,12 @@ const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
959
959
  "aria-hidden": "true",
960
960
  children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
961
961
  }
962
- ), Zr = {
962
+ ), ai = {
963
963
  left: 180,
964
964
  right: 0,
965
965
  up: -90,
966
966
  down: 90
967
- }, _n = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
967
+ }, Cn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
968
968
  "svg",
969
969
  {
970
970
  className: t,
@@ -972,19 +972,19 @@ const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
972
972
  viewBox: "0 0 24 24",
973
973
  stroke: "currentColor",
974
974
  strokeWidth: 2,
975
- style: { transform: `rotate(${Zr[e]}deg)` },
975
+ style: { transform: `rotate(${ai[e]}deg)` },
976
976
  "aria-hidden": "true",
977
977
  children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
978
978
  }
979
979
  );
980
- function Qr(e) {
980
+ function si(e) {
981
981
  return e === "top-left" || e === "bottom-left" ? "left" : "right";
982
982
  }
983
- const On = "ll-hidden-tab-center-y", ei = 5, xn = 16;
984
- function ti() {
983
+ const Vn = "ll-hidden-tab-center-y", ci = 5, kn = 16;
984
+ function ui() {
985
985
  if (typeof window > "u") return null;
986
986
  try {
987
- const e = window.localStorage.getItem(On);
987
+ const e = window.localStorage.getItem(Vn);
988
988
  if (!e) return null;
989
989
  const t = Number.parseFloat(e);
990
990
  return Number.isFinite(t) ? t : null;
@@ -992,93 +992,93 @@ function ti() {
992
992
  return null;
993
993
  }
994
994
  }
995
- function Ln(e) {
995
+ function Sn(e) {
996
996
  if (!(typeof window > "u"))
997
997
  try {
998
- window.localStorage.setItem(On, String(e));
998
+ window.localStorage.setItem(Vn, String(e));
999
999
  } catch {
1000
1000
  }
1001
1001
  }
1002
- const ni = ({
1002
+ const di = ({
1003
1003
  position: e,
1004
1004
  isMobile: t,
1005
1005
  isSpeaking: n,
1006
1006
  onExpand: i,
1007
- label: a = "Open widget",
1007
+ label: l = "Open widget",
1008
1008
  avatarImageUrl: o,
1009
1009
  agentName: s,
1010
- containerEl: l
1010
+ containerEl: a
1011
1011
  }) => {
1012
- const c = Qr(e), u = c === "right" ? "left" : "right", m = t ? 80 : 72, p = !!o, h = !!l, [P, x] = M(null), [E, y] = M(!1), w = I(null), R = I(!1), S = C(
1013
- ($) => {
1014
- if (typeof window > "u") return $;
1015
- const G = m / 2, f = xn + G, N = window.innerHeight - xn - G;
1016
- return N < f ? Math.max(f, $) : Math.max(f, Math.min(N, $));
1012
+ const c = si(e), u = c === "right" ? "left" : "right", m = t ? 80 : 72, p = !!o, h = !!a, [D, x] = M(null), [E, y] = M(!1), w = I(null), T = I(!1), S = C(
1013
+ (H) => {
1014
+ if (typeof window > "u") return H;
1015
+ const G = m / 2, f = kn + G, A = window.innerHeight - kn - G;
1016
+ return A < f ? Math.max(f, H) : Math.max(f, Math.min(A, H));
1017
1017
  },
1018
1018
  [m]
1019
1019
  );
1020
- T(() => {
1020
+ R(() => {
1021
1021
  if (h) {
1022
1022
  x(null);
1023
1023
  return;
1024
1024
  }
1025
- const $ = ti();
1026
- x(S($ ?? window.innerHeight / 2));
1025
+ const H = ui();
1026
+ x(S(H ?? window.innerHeight / 2));
1027
1027
  const G = () => {
1028
1028
  x((f) => f === null ? null : S(f));
1029
1029
  };
1030
1030
  return window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
1031
1031
  }, [S, h]);
1032
1032
  const v = C(
1033
- ($) => {
1034
- if (!h && !($.pointerType === "mouse" && $.button !== 0) && P !== null) {
1033
+ (H) => {
1034
+ if (!h && !(H.pointerType === "mouse" && H.button !== 0) && D !== null) {
1035
1035
  try {
1036
- $.currentTarget.setPointerCapture($.pointerId);
1036
+ H.currentTarget.setPointerCapture(H.pointerId);
1037
1037
  } catch {
1038
1038
  }
1039
1039
  w.current = {
1040
- startClientY: $.clientY,
1041
- startCenterY: P,
1040
+ startClientY: H.clientY,
1041
+ startCenterY: D,
1042
1042
  moved: !1
1043
1043
  };
1044
1044
  }
1045
1045
  },
1046
- [P, h]
1046
+ [D, h]
1047
1047
  ), O = C(
1048
- ($) => {
1048
+ (H) => {
1049
1049
  const G = w.current;
1050
1050
  if (!G) return;
1051
- const f = $.clientY - G.startClientY;
1052
- !G.moved && Math.abs(f) > ei && (G.moved = !0, y(!0)), G.moved && x(S(G.startCenterY + f));
1051
+ const f = H.clientY - G.startClientY;
1052
+ !G.moved && Math.abs(f) > ci && (G.moved = !0, y(!0)), G.moved && x(S(G.startCenterY + f));
1053
1053
  },
1054
1054
  [S]
1055
1055
  ), g = C(
1056
- ($) => {
1056
+ (H) => {
1057
1057
  const G = w.current;
1058
1058
  if (G) {
1059
1059
  try {
1060
- $.currentTarget.releasePointerCapture($.pointerId);
1060
+ H.currentTarget.releasePointerCapture(H.pointerId);
1061
1061
  } catch {
1062
1062
  }
1063
- w.current = null, G.moved && (y(!1), R.current = !0, x((f) => (f !== null && Ln(f), f)));
1063
+ w.current = null, G.moved && (y(!1), T.current = !0, x((f) => (f !== null && Sn(f), f)));
1064
1064
  }
1065
1065
  },
1066
1066
  []
1067
- ), D = C(() => {
1068
- if (R.current) {
1069
- R.current = !1;
1067
+ ), z = C(() => {
1068
+ if (T.current) {
1069
+ T.current = !1;
1070
1070
  return;
1071
1071
  }
1072
1072
  i();
1073
- }, [i]), W = C(
1074
- ($) => {
1075
- if ($.key === "ArrowUp" || $.key === "ArrowDown") {
1076
- $.preventDefault();
1077
- const G = $.key === "ArrowUp" ? -8 : 8;
1073
+ }, [i]), B = C(
1074
+ (H) => {
1075
+ if (H.key === "ArrowUp" || H.key === "ArrowDown") {
1076
+ H.preventDefault();
1077
+ const G = H.key === "ArrowUp" ? -8 : 8;
1078
1078
  x((f) => {
1079
1079
  if (f === null) return f;
1080
- const N = S(f + G);
1081
- return Ln(N), N;
1080
+ const A = S(f + G);
1081
+ return Sn(A), A;
1082
1082
  });
1083
1083
  }
1084
1084
  },
@@ -1091,7 +1091,7 @@ const ni = ({
1091
1091
  E ? "is-dragging" : null,
1092
1092
  p ? "ll-hidden--with-avatar" : null,
1093
1093
  h ? "ll-hidden--scoped" : null
1094
- ].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P - m / 2}px`, transform: "none" };
1094
+ ].filter(Boolean).join(" "), ae = D === null ? void 0 : { top: `${D - m / 2}px`, transform: "none" };
1095
1095
  return /* @__PURE__ */ r(
1096
1096
  "button",
1097
1097
  {
@@ -1101,9 +1101,9 @@ const ni = ({
1101
1101
  onPointerMove: O,
1102
1102
  onPointerUp: g,
1103
1103
  onPointerCancel: g,
1104
- onClick: D,
1105
- onKeyDown: W,
1106
- "aria-label": a,
1104
+ onClick: z,
1105
+ onKeyDown: B,
1106
+ "aria-label": l,
1107
1107
  "data-position": e,
1108
1108
  style: ae,
1109
1109
  children: p ? (
@@ -1113,7 +1113,7 @@ const ni = ({
1113
1113
  // avatar-based experience" even when collapsed.
1114
1114
  /* @__PURE__ */ k(We, { children: [
1115
1115
  /* @__PURE__ */ r(
1116
- _n,
1116
+ Cn,
1117
1117
  {
1118
1118
  direction: u,
1119
1119
  className: "ll-hidden__chevron ll-hidden__chevron--mini"
@@ -1130,7 +1130,7 @@ const ni = ({
1130
1130
  )
1131
1131
  ] })
1132
1132
  ) : /* @__PURE__ */ r(
1133
- _n,
1133
+ Cn,
1134
1134
  {
1135
1135
  direction: u,
1136
1136
  className: "ll-hidden__chevron"
@@ -1138,47 +1138,47 @@ const ni = ({
1138
1138
  )
1139
1139
  }
1140
1140
  );
1141
- }, ri = ({
1141
+ }, fi = ({
1142
1142
  audioLevel: e,
1143
1143
  bars: t = 20,
1144
1144
  maxHeight: n = 20,
1145
1145
  minHeight: i = 4,
1146
- className: a,
1146
+ className: l,
1147
1147
  barClassName: o
1148
1148
  }) => {
1149
- const s = I(null), l = I([]), c = tt(() => {
1149
+ const s = I(null), a = I([]), c = rt(() => {
1150
1150
  const m = (Math.sqrt(5) - 1) / 2;
1151
1151
  return Array.from({ length: t }, (p, h) => 0.5 + h * m % 1 * 0.5);
1152
1152
  }, [t]);
1153
- T(() => e.subscribe((p) => {
1153
+ R(() => e.subscribe((p) => {
1154
1154
  for (let h = 0; h < t; h++) {
1155
- const P = l.current[h];
1156
- if (!P) continue;
1155
+ const D = a.current[h];
1156
+ if (!D) continue;
1157
1157
  const x = Math.max(i, p * n * c[h]);
1158
- P.style.height = `${x}px`;
1158
+ D.style.height = `${x}px`;
1159
1159
  }
1160
1160
  }), [e, t, n, i, c]);
1161
- const u = ["ll-waveform", a].filter(Boolean).join(" ");
1161
+ const u = ["ll-waveform", l].filter(Boolean).join(" ");
1162
1162
  return /* @__PURE__ */ r("div", { ref: s, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (m, p) => /* @__PURE__ */ r(
1163
1163
  "div",
1164
1164
  {
1165
1165
  ref: (h) => {
1166
- l.current[p] = h;
1166
+ a.current[p] = h;
1167
1167
  },
1168
1168
  className: ["ll-waveform__bar", o].filter(Boolean).join(" "),
1169
1169
  style: { height: `${i}px` }
1170
1170
  },
1171
1171
  p
1172
1172
  )) });
1173
- }, ii = ({
1173
+ }, pi = ({
1174
1174
  position: e,
1175
1175
  isMobile: t,
1176
1176
  agentName: n,
1177
1177
  avatarImageUrl: i,
1178
- agentState: a,
1178
+ agentState: l,
1179
1179
  isMuted: o,
1180
1180
  audioLevel: s,
1181
- onExpand: l,
1181
+ onExpand: a,
1182
1182
  onToggleMute: c,
1183
1183
  onClose: u
1184
1184
  }) => t ? /* @__PURE__ */ r(
@@ -1192,7 +1192,7 @@ const ni = ({
1192
1192
  {
1193
1193
  type: "button",
1194
1194
  className: "ll-minimized__surface",
1195
- onClick: l,
1195
+ onClick: a,
1196
1196
  "aria-label": `Expand ${n} widget`,
1197
1197
  children: [
1198
1198
  i ? (
@@ -1207,7 +1207,7 @@ const ni = ({
1207
1207
  )
1208
1208
  ) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
1209
1209
  /* @__PURE__ */ r(
1210
- ri,
1210
+ fi,
1211
1211
  {
1212
1212
  audioLevel: s,
1213
1213
  bars: 16,
@@ -1230,10 +1230,10 @@ const ni = ({
1230
1230
  (m.key === "Enter" || m.key === " ") && (m.stopPropagation(), m.preventDefault(), c());
1231
1231
  },
1232
1232
  "aria-label": o ? "Unmute microphone" : "Mute microphone",
1233
- children: /* @__PURE__ */ r(bn, { muted: o, className: "ll-minimized__icon" })
1233
+ children: /* @__PURE__ */ r(xn, { muted: o, className: "ll-minimized__icon" })
1234
1234
  }
1235
1235
  ),
1236
- /* @__PURE__ */ r(wn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
1236
+ /* @__PURE__ */ r(Ln, { className: "ll-minimized__icon ll-minimized__icon--expand" })
1237
1237
  ] })
1238
1238
  ]
1239
1239
  }
@@ -1260,7 +1260,7 @@ const ni = ({
1260
1260
  ) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
1261
1261
  /* @__PURE__ */ k("div", { className: "ll-minimized__meta", children: [
1262
1262
  /* @__PURE__ */ r("span", { className: "ll-minimized__name", children: n }),
1263
- /* @__PURE__ */ r("span", { className: "ll-minimized__state", children: a === "speaking" ? "Speaking" : a === "thinking" ? "Thinking" : "Listening" })
1263
+ /* @__PURE__ */ r("span", { className: "ll-minimized__state", children: l === "speaking" ? "Speaking" : l === "thinking" ? "Thinking" : "Listening" })
1264
1264
  ] }),
1265
1265
  /* @__PURE__ */ k("div", { className: "ll-minimized__controls", children: [
1266
1266
  /* @__PURE__ */ r(
@@ -1270,7 +1270,7 @@ const ni = ({
1270
1270
  className: "ll-minimized__btn",
1271
1271
  onClick: c,
1272
1272
  "aria-label": o ? "Unmute microphone" : "Mute microphone",
1273
- children: /* @__PURE__ */ r(bn, { muted: o, className: "ll-minimized__icon" })
1273
+ children: /* @__PURE__ */ r(xn, { muted: o, className: "ll-minimized__icon" })
1274
1274
  }
1275
1275
  ),
1276
1276
  /* @__PURE__ */ r(
@@ -1278,9 +1278,9 @@ const ni = ({
1278
1278
  {
1279
1279
  type: "button",
1280
1280
  className: "ll-minimized__btn",
1281
- onClick: l,
1281
+ onClick: a,
1282
1282
  "aria-label": `Expand ${n} widget`,
1283
- children: /* @__PURE__ */ r(wn, { className: "ll-minimized__icon" })
1283
+ children: /* @__PURE__ */ r(Ln, { className: "ll-minimized__icon" })
1284
1284
  }
1285
1285
  ),
1286
1286
  /* @__PURE__ */ r(
@@ -1290,22 +1290,22 @@ const ni = ({
1290
1290
  className: "ll-minimized__btn ll-minimized__btn--close",
1291
1291
  onClick: u,
1292
1292
  "aria-label": "Close widget",
1293
- children: /* @__PURE__ */ r(Jr, { className: "ll-minimized__icon" })
1293
+ children: /* @__PURE__ */ r(li, { className: "ll-minimized__icon" })
1294
1294
  }
1295
1295
  )
1296
1296
  ] })
1297
1297
  ] })
1298
1298
  }
1299
- ), oi = ({
1299
+ ), hi = ({
1300
1300
  src: e,
1301
1301
  alt: t,
1302
1302
  preCannedPlaying: n = !1,
1303
1303
  className: i,
1304
- style: a
1304
+ style: l
1305
1305
  }) => {
1306
- const [o, s] = M(!1), l = I(e);
1307
- if (T(() => {
1308
- l.current !== e && (l.current = e, s(!1));
1306
+ const [o, s] = M(!1), a = I(e);
1307
+ if (R(() => {
1308
+ a.current !== e && (a.current = e, s(!1));
1309
1309
  }, [e]), !e) return null;
1310
1310
  const c = {
1311
1311
  position: "absolute",
@@ -1317,7 +1317,7 @@ const ni = ({
1317
1317
  transition: "opacity 500ms ease, transform 500ms ease",
1318
1318
  transform: n ? "scale(1.02)" : "scale(1)",
1319
1319
  opacity: o ? 1 : 0,
1320
- ...a
1320
+ ...l
1321
1321
  };
1322
1322
  return (
1323
1323
  // eslint-disable-next-line @next/next/no-img-element
@@ -1334,11 +1334,11 @@ const ni = ({
1334
1334
  }
1335
1335
  )
1336
1336
  );
1337
- }, li = "#E06540";
1338
- function ai({
1337
+ }, mi = "#E06540";
1338
+ function gi({
1339
1339
  size: e = 14,
1340
1340
  className: t,
1341
- fill: n = li
1341
+ fill: n = mi
1342
1342
  }) {
1343
1343
  return /* @__PURE__ */ k(
1344
1344
  "svg",
@@ -1376,46 +1376,46 @@ function ai({
1376
1376
  }
1377
1377
  );
1378
1378
  }
1379
- const si = 8, Cn = 8, ci = ({
1379
+ const yi = 8, En = 8, vi = ({
1380
1380
  open: e,
1381
1381
  onClose: t,
1382
1382
  anchorRef: n,
1383
1383
  children: i
1384
1384
  }) => {
1385
- const a = I(null), [o, s] = M(null);
1386
- return Dn(() => {
1385
+ const l = I(null), [o, s] = M(null);
1386
+ return Wn(() => {
1387
1387
  if (!e) {
1388
1388
  s(null);
1389
1389
  return;
1390
1390
  }
1391
- const l = n.current;
1392
- if (!l) return;
1391
+ const a = n.current;
1392
+ if (!a) return;
1393
1393
  const c = () => {
1394
- const u = l.getBoundingClientRect(), m = {
1395
- top: u.top - si,
1394
+ const u = a.getBoundingClientRect(), m = {
1395
+ top: u.top - yi,
1396
1396
  left: u.left + u.width / 2
1397
- }, p = Cn + 90, h = window.innerWidth - Cn - 90;
1397
+ }, p = En + 90, h = window.innerWidth - En - 90;
1398
1398
  m.left < p && (m.left = p), m.left > h && (m.left = h), s(m);
1399
1399
  };
1400
1400
  return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
1401
1401
  window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
1402
1402
  };
1403
- }, [e, n]), T(() => {
1403
+ }, [e, n]), R(() => {
1404
1404
  if (!e) return;
1405
- const l = (u) => {
1406
- const m = u.target, p = a.current, h = n.current;
1405
+ const a = (u) => {
1406
+ const m = u.target, p = l.current, h = n.current;
1407
1407
  p && p.contains(m) || h && h.contains(m) || t();
1408
1408
  }, c = (u) => {
1409
1409
  u.key === "Escape" && (u.stopPropagation(), t());
1410
1410
  };
1411
- return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
1412
- document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
1411
+ return document.addEventListener("mousedown", a), document.addEventListener("keydown", c), () => {
1412
+ document.removeEventListener("mousedown", a), document.removeEventListener("keydown", c);
1413
1413
  };
1414
- }, [e, t, n]), !e || o === null || typeof document > "u" ? null : Xt(
1414
+ }, [e, t, n]), !e || o === null || typeof document > "u" ? null : Qt(
1415
1415
  /* @__PURE__ */ r(
1416
1416
  "div",
1417
1417
  {
1418
- ref: a,
1418
+ ref: l,
1419
1419
  className: "ll-overflow-popover",
1420
1420
  role: "menu",
1421
1421
  style: {
@@ -1431,21 +1431,21 @@ const si = 8, Cn = 8, ci = ({
1431
1431
  ),
1432
1432
  document.body
1433
1433
  );
1434
- }, ui = ({
1434
+ }, bi = ({
1435
1435
  isMuted: e,
1436
1436
  onToggleMute: t,
1437
1437
  isCameraEnabled: n,
1438
1438
  onToggleCamera: i,
1439
- allowCamera: a,
1439
+ allowCamera: l,
1440
1440
  isScreenShareEnabled: o,
1441
1441
  onToggleScreenShare: s,
1442
- allowScreenShare: l,
1442
+ allowScreenShare: a,
1443
1443
  isSpeakerMuted: c,
1444
1444
  onToggleSpeaker: u,
1445
1445
  allowTyping: m,
1446
1446
  isTypingOpen: p,
1447
1447
  onToggleTyping: h,
1448
- onDisconnect: P
1448
+ onDisconnect: D
1449
1449
  }) => {
1450
1450
  const [x, E] = M(!1), y = I(null);
1451
1451
  return /* @__PURE__ */ k(We, { children: [
@@ -1463,7 +1463,7 @@ const si = 8, Cn = 8, ci = ({
1463
1463
  className: `ll-tool ${e ? "is-muted" : ""}`,
1464
1464
  onClick: t,
1465
1465
  "aria-label": e ? "Unmute microphone" : "Mute microphone",
1466
- children: /* @__PURE__ */ r(Bn, { muted: e })
1466
+ children: /* @__PURE__ */ r(Xn, { muted: e })
1467
1467
  }
1468
1468
  ),
1469
1469
  /* @__PURE__ */ r(
@@ -1476,7 +1476,7 @@ const si = 8, Cn = 8, ci = ({
1476
1476
  "aria-label": "More controls",
1477
1477
  "aria-haspopup": "menu",
1478
1478
  "aria-expanded": x,
1479
- children: /* @__PURE__ */ r(di, {})
1479
+ children: /* @__PURE__ */ r(wi, {})
1480
1480
  }
1481
1481
  ),
1482
1482
  /* @__PURE__ */ r(
@@ -1484,22 +1484,22 @@ const si = 8, Cn = 8, ci = ({
1484
1484
  {
1485
1485
  type: "button",
1486
1486
  className: "ll-tool ll-tool--danger",
1487
- onClick: P,
1487
+ onClick: D,
1488
1488
  "aria-label": "End conversation",
1489
- children: /* @__PURE__ */ r(Un, {})
1489
+ children: /* @__PURE__ */ r(Jn, {})
1490
1490
  }
1491
1491
  )
1492
1492
  ]
1493
1493
  }
1494
1494
  ),
1495
1495
  /* @__PURE__ */ k(
1496
- ci,
1496
+ vi,
1497
1497
  {
1498
1498
  open: x,
1499
1499
  onClose: () => E(!1),
1500
1500
  anchorRef: y,
1501
1501
  children: [
1502
- a && /* @__PURE__ */ k(
1502
+ l && /* @__PURE__ */ k(
1503
1503
  "button",
1504
1504
  {
1505
1505
  type: "button",
@@ -1508,12 +1508,12 @@ const si = 8, Cn = 8, ci = ({
1508
1508
  i(), E(!1);
1509
1509
  },
1510
1510
  children: [
1511
- /* @__PURE__ */ r(Wn, {}),
1511
+ /* @__PURE__ */ r(Gn, {}),
1512
1512
  /* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
1513
1513
  ]
1514
1514
  }
1515
1515
  ),
1516
- l && /* @__PURE__ */ k(
1516
+ a && /* @__PURE__ */ k(
1517
1517
  "button",
1518
1518
  {
1519
1519
  type: "button",
@@ -1522,7 +1522,7 @@ const si = 8, Cn = 8, ci = ({
1522
1522
  s(), E(!1);
1523
1523
  },
1524
1524
  children: [
1525
- /* @__PURE__ */ r(Fn, {}),
1525
+ /* @__PURE__ */ r(Yn, {}),
1526
1526
  /* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
1527
1527
  ]
1528
1528
  }
@@ -1536,7 +1536,7 @@ const si = 8, Cn = 8, ci = ({
1536
1536
  u(), E(!1);
1537
1537
  },
1538
1538
  children: [
1539
- /* @__PURE__ */ r(qn, { muted: c }),
1539
+ /* @__PURE__ */ r(Kn, { muted: c }),
1540
1540
  /* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
1541
1541
  ]
1542
1542
  }
@@ -1550,7 +1550,7 @@ const si = 8, Cn = 8, ci = ({
1550
1550
  h(), E(!1);
1551
1551
  },
1552
1552
  children: [
1553
- /* @__PURE__ */ r(fi, {}),
1553
+ /* @__PURE__ */ r(_i, {}),
1554
1554
  /* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
1555
1555
  ]
1556
1556
  }
@@ -1573,7 +1573,7 @@ const si = 8, Cn = 8, ci = ({
1573
1573
  )
1574
1574
  ] });
1575
1575
  };
1576
- function di() {
1576
+ function wi() {
1577
1577
  return /* @__PURE__ */ k(
1578
1578
  "svg",
1579
1579
  {
@@ -1590,7 +1590,7 @@ function di() {
1590
1590
  }
1591
1591
  );
1592
1592
  }
1593
- function fi() {
1593
+ function _i() {
1594
1594
  return /* @__PURE__ */ r(
1595
1595
  "svg",
1596
1596
  {
@@ -1607,39 +1607,39 @@ function fi() {
1607
1607
  }
1608
1608
  );
1609
1609
  }
1610
- const pi = ({
1610
+ const xi = ({
1611
1611
  position: e,
1612
1612
  isMobile: t,
1613
1613
  agentName: n,
1614
1614
  avatarImageUrl: i,
1615
- idleLoopUrl: a,
1615
+ idleLoopUrl: l,
1616
1616
  greeting: o,
1617
1617
  branding: s,
1618
- teamMembers: l,
1618
+ teamMembers: a,
1619
1619
  currentTeamMemberId: c,
1620
1620
  isSwitchingTeamMember: u,
1621
1621
  teamSwitcherOpen: m,
1622
1622
  onToggleTeamSwitcher: p,
1623
1623
  onSelectTeamMember: h,
1624
- languageMenuOpen: P,
1624
+ languageMenuOpen: D,
1625
1625
  onToggleLanguageMenu: x,
1626
1626
  connectionState: E,
1627
1627
  agentState: y,
1628
1628
  transcript: w,
1629
- canResume: R,
1629
+ canResume: T,
1630
1630
  needsUserGesture: S,
1631
1631
  error: v,
1632
1632
  isMuted: O,
1633
1633
  micError: g,
1634
- micDevices: D,
1635
- activeMicId: W,
1634
+ micDevices: z,
1635
+ activeMicId: B,
1636
1636
  isCameraEnabled: K,
1637
1637
  cameraPreviewEl: ae,
1638
- cameraDevices: $,
1638
+ cameraDevices: H,
1639
1639
  activeCameraId: G,
1640
1640
  isScreenShareEnabled: f,
1641
- screenPreviewEl: N,
1642
- isSpeakerMuted: z,
1641
+ screenPreviewEl: A,
1642
+ isSpeakerMuted: $,
1643
1643
  allowCamera: q,
1644
1644
  allowScreenShare: X,
1645
1645
  allowTyping: ee,
@@ -1649,115 +1649,115 @@ const pi = ({
1649
1649
  compactControls: U = !1,
1650
1650
  transforming: me,
1651
1651
  transformingLabel: Q,
1652
- avatarVideoContainerRef: be,
1652
+ avatarVideoContainerRef: _e,
1653
1653
  agentVideoEl: ne,
1654
- onConnect: nt,
1655
- onDisconnect: rt,
1656
- onRetry: ht,
1657
- onResumeAudio: mt,
1658
- onToggleMute: it,
1659
- onSwitchMicDevice: gt,
1660
- onToggleCamera: Be,
1661
- onSwitchCameraDevice: qe,
1654
+ onConnect: it,
1655
+ onDisconnect: ot,
1656
+ onRetry: yt,
1657
+ onResumeAudio: vt,
1658
+ onToggleMute: lt,
1659
+ onSwitchMicDevice: bt,
1660
+ onToggleCamera: qe,
1661
+ onSwitchCameraDevice: Ue,
1662
1662
  onToggleScreenShare: Re,
1663
- onToggleSpeaker: Te,
1663
+ onToggleSpeaker: De,
1664
1664
  onSendMessage: Pe,
1665
- onMinimize: De,
1666
- onClose: ze,
1667
- onClearMicError: Ue,
1668
- dragHandleProps: $e,
1665
+ onMinimize: ze,
1666
+ onClose: $e,
1667
+ onClearMicError: je,
1668
+ dragHandleProps: He,
1669
1669
  resizeHandleProps: F
1670
1670
  }) => {
1671
- var st;
1672
- const He = ((l == null ? void 0 : l.length) ?? 0) > 1, je = E === "connecting" || E === "connected", we = E === "connected", yt = E === "idle" || E === "disconnected" || E === "error", [Oe, Ne] = M(!1);
1673
- T(() => {
1671
+ var ut;
1672
+ const Oe = ((a == null ? void 0 : a.length) ?? 0) > 1, Ve = E === "connecting" || E === "connected", xe = E === "connected", wt = E === "idle" || E === "disconnected" || E === "error", [Fe, Ae] = M(!1);
1673
+ R(() => {
1674
1674
  if (!ne) {
1675
- Ne(!1);
1675
+ Ae(!1);
1676
1676
  return;
1677
1677
  }
1678
1678
  if (!ne.paused && ne.readyState >= 2) {
1679
- Ne(!0);
1679
+ Ae(!0);
1680
1680
  return;
1681
1681
  }
1682
- Ne(!1);
1683
- const _ = () => Ne(!0);
1682
+ Ae(!1);
1683
+ const _ = () => Ae(!0);
1684
1684
  return ne.addEventListener("playing", _), ne.addEventListener("loadeddata", _), () => {
1685
1685
  ne.removeEventListener("playing", _), ne.removeEventListener("loadeddata", _);
1686
1686
  };
1687
1687
  }, [ne]);
1688
- const [At, vt] = M(!1);
1689
- T(() => {
1690
- if (!we) {
1691
- vt(!1);
1688
+ const [Rt, _t] = M(!1);
1689
+ R(() => {
1690
+ if (!xe) {
1691
+ _t(!1);
1692
1692
  return;
1693
1693
  }
1694
- if (Oe) return;
1695
- const _ = setTimeout(() => vt(!0), 8e3);
1694
+ if (Fe) return;
1695
+ const _ = setTimeout(() => _t(!0), 8e3);
1696
1696
  return () => clearTimeout(_);
1697
- }, [we, Oe]);
1698
- const Fe = E === "connecting" || we && !!i && !Oe && !At, ue = I(null), ot = I(null);
1699
- T(() => {
1697
+ }, [xe, Fe]);
1698
+ const Be = E === "connecting" || xe && !!i && !Fe && !Rt, ue = I(null), at = I(null);
1699
+ R(() => {
1700
1700
  const _ = ue.current;
1701
1701
  _ && (_.innerHTML = "", ae && (ae.style.width = "100%", ae.style.height = "100%", ae.style.objectFit = "cover", ae.style.transform = "scaleX(-1)", _.appendChild(ae)));
1702
- }, [ae]), T(() => {
1703
- const _ = ot.current;
1704
- _ && (_.innerHTML = "", N && (N.style.width = "100%", N.style.height = "100%", N.style.objectFit = "contain", _.appendChild(N)));
1705
- }, [N]);
1706
- const [le, pe] = M(!1), [Ve, Ye] = M(!1), ge = I(null), _e = I(null);
1707
- T(() => {
1708
- if (!le && !Ve && !P && !m) return;
1702
+ }, [ae]), R(() => {
1703
+ const _ = at.current;
1704
+ _ && (_.innerHTML = "", A && (A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "contain", _.appendChild(A)));
1705
+ }, [A]);
1706
+ const [le, pe] = M(!1), [Ye, Ge] = M(!1), ge = I(null), Le = I(null);
1707
+ R(() => {
1708
+ if (!le && !Ye && !D && !m) return;
1709
1709
  const _ = () => {
1710
- pe(!1), Ye(!1), P && x(), m && p();
1710
+ pe(!1), Ge(!1), D && x(), m && p();
1711
1711
  };
1712
1712
  return document.addEventListener("click", _), () => document.removeEventListener("click", _);
1713
1713
  }, [
1714
1714
  le,
1715
- Ve,
1716
- P,
1715
+ Ye,
1716
+ D,
1717
1717
  m,
1718
1718
  x,
1719
1719
  p
1720
1720
  ]);
1721
- const [bt, Mt] = M(!1), It = C(() => Mt((_) => !_), []), [lt, Rt] = M(""), Ae = C(
1721
+ const [xt, Dt] = M(!1), Pt = C(() => Dt((_) => !_), []), [st, zt] = M(""), Ne = C(
1722
1722
  (_) => {
1723
1723
  _.preventDefault();
1724
- const re = lt.trim();
1725
- re && (Pe(re), Rt(""));
1724
+ const re = st.trim();
1725
+ re && (Pe(re), zt(""));
1726
1726
  },
1727
- [lt, Pe]
1727
+ [st, Pe]
1728
1728
  ), Me = s.productName || "Live Layer", Se = !s.productName;
1729
- let ye = null, xe = null;
1729
+ let ye = null, Ce = null;
1730
1730
  for (let _ = w.length - 1; _ >= 0; _--) {
1731
1731
  const re = w[_];
1732
- if (!ye && re.role === "agent" ? ye = re : !xe && re.role === "user" && (xe = re), ye && xe) break;
1732
+ if (!ye && re.role === "agent" ? ye = re : !Ce && re.role === "user" && (Ce = re), ye && Ce) break;
1733
1733
  }
1734
- const wt = we ? (ye == null ? void 0 : ye.text) || null : o || null, Ge = we && (xe == null ? void 0 : xe.text) || null, at = [
1734
+ const Lt = xe ? (ye == null ? void 0 : ye.text) || null : o || null, Xe = xe && (Ce == null ? void 0 : Ce.text) || null, ct = [
1735
1735
  "ll-expanded",
1736
1736
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1737
1737
  ].join(" ");
1738
1738
  return /* @__PURE__ */ k(
1739
1739
  "div",
1740
1740
  {
1741
- className: at,
1741
+ className: ct,
1742
1742
  "data-position": e,
1743
- "data-state": we ? "connected" : je ? "connecting" : "idle",
1743
+ "data-state": xe ? "connected" : Ve ? "connecting" : "idle",
1744
1744
  role: "dialog",
1745
1745
  "aria-label": `${n} widget`,
1746
1746
  children: [
1747
1747
  /* @__PURE__ */ k("div", { className: "ll-expanded__bg", children: [
1748
1748
  i ? /* @__PURE__ */ r(
1749
- oi,
1749
+ hi,
1750
1750
  {
1751
1751
  src: i,
1752
1752
  alt: n,
1753
1753
  className: "ll-expanded__bg-img"
1754
1754
  }
1755
- ) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((st = n == null ? void 0 : n.charAt(0)) == null ? void 0 : st.toUpperCase()) || "A" }) }),
1756
- a && !we && /* @__PURE__ */ r(
1755
+ ) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((ut = n == null ? void 0 : n.charAt(0)) == null ? void 0 : ut.toUpperCase()) || "A" }) }),
1756
+ l && !xe && /* @__PURE__ */ r(
1757
1757
  "video",
1758
1758
  {
1759
1759
  className: "ll-expanded__bg-idle",
1760
- src: a,
1760
+ src: l,
1761
1761
  autoPlay: !0,
1762
1762
  loop: !0,
1763
1763
  muted: !0,
@@ -1765,17 +1765,17 @@ const pi = ({
1765
1765
  }
1766
1766
  )
1767
1767
  ] }),
1768
- /* @__PURE__ */ r("div", { ref: be, className: "ll-expanded__video" }),
1769
- Fe && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1768
+ /* @__PURE__ */ r("div", { ref: _e, className: "ll-expanded__video" }),
1769
+ Be && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1770
1770
  /* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
1771
1771
  /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: u ? "Switching..." : "Connecting..." })
1772
1772
  ] }),
1773
- S && we && /* @__PURE__ */ k(
1773
+ S && xe && /* @__PURE__ */ k(
1774
1774
  "button",
1775
1775
  {
1776
1776
  type: "button",
1777
1777
  className: "ll-expanded__overlay ll-expanded__overlay--gesture",
1778
- onClick: mt,
1778
+ onClick: vt,
1779
1779
  children: [
1780
1780
  /* @__PURE__ */ r("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("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" }) }),
1781
1781
  /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
@@ -1795,8 +1795,8 @@ const pi = ({
1795
1795
  ]
1796
1796
  }
1797
1797
  ),
1798
- je ? /* @__PURE__ */ k(We, { children: [
1799
- !U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar", ...$e, children: [
1798
+ Ve ? /* @__PURE__ */ k(We, { children: [
1799
+ !U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar", ...He, children: [
1800
1800
  !oe && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar-left", children: [
1801
1801
  /* @__PURE__ */ k("div", { className: "ll-expanded__pill-wrap", children: [
1802
1802
  /* @__PURE__ */ k(
@@ -1805,23 +1805,23 @@ const pi = ({
1805
1805
  type: "button",
1806
1806
  className: "ll-hpill",
1807
1807
  onClick: (_) => {
1808
- He && (_.stopPropagation(), p());
1808
+ Oe && (_.stopPropagation(), p());
1809
1809
  },
1810
- "aria-haspopup": He ? "listbox" : void 0,
1811
- "aria-expanded": He ? m : void 0,
1810
+ "aria-haspopup": Oe ? "listbox" : void 0,
1811
+ "aria-expanded": Oe ? m : void 0,
1812
1812
  children: [
1813
1813
  /* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
1814
- He && /* @__PURE__ */ r(St, {})
1814
+ Oe && /* @__PURE__ */ r(Nt, {})
1815
1815
  ]
1816
1816
  }
1817
1817
  ),
1818
- He && m && /* @__PURE__ */ r(
1818
+ Oe && m && /* @__PURE__ */ r(
1819
1819
  "div",
1820
1820
  {
1821
1821
  className: "ll-hmenu",
1822
1822
  onClick: (_) => _.stopPropagation(),
1823
1823
  role: "listbox",
1824
- children: l == null ? void 0 : l.map((_) => /* @__PURE__ */ k(
1824
+ children: a == null ? void 0 : a.map((_) => /* @__PURE__ */ k(
1825
1825
  "button",
1826
1826
  {
1827
1827
  type: "button",
@@ -1857,16 +1857,16 @@ const pi = ({
1857
1857
  _.stopPropagation(), x();
1858
1858
  },
1859
1859
  "aria-haspopup": "listbox",
1860
- "aria-expanded": P,
1860
+ "aria-expanded": D,
1861
1861
  "aria-label": "Language: English",
1862
1862
  title: "Language: English",
1863
1863
  children: [
1864
1864
  /* @__PURE__ */ r("span", { className: "ll-hpill__label", children: "EN" }),
1865
- /* @__PURE__ */ r(St, {})
1865
+ /* @__PURE__ */ r(Nt, {})
1866
1866
  ]
1867
1867
  }
1868
1868
  ),
1869
- P && /* @__PURE__ */ r(
1869
+ D && /* @__PURE__ */ r(
1870
1870
  "div",
1871
1871
  {
1872
1872
  className: "ll-hmenu",
@@ -1899,10 +1899,10 @@ const pi = ({
1899
1899
  {
1900
1900
  type: "button",
1901
1901
  className: "ll-hbtn",
1902
- onClick: De,
1902
+ onClick: ze,
1903
1903
  "aria-label": "Minimize widget",
1904
1904
  title: "Minimize",
1905
- children: /* @__PURE__ */ r(Sn, {})
1905
+ children: /* @__PURE__ */ r(Nn, {})
1906
1906
  }
1907
1907
  ),
1908
1908
  te !== !1 && /* @__PURE__ */ r(
@@ -1910,10 +1910,10 @@ const pi = ({
1910
1910
  {
1911
1911
  type: "button",
1912
1912
  className: "ll-hbtn ll-hbtn--danger",
1913
- onClick: ze,
1913
+ onClick: $e,
1914
1914
  "aria-label": "End call",
1915
1915
  title: "End call",
1916
- children: /* @__PURE__ */ r(kn, {})
1916
+ children: /* @__PURE__ */ r(An, {})
1917
1917
  }
1918
1918
  )
1919
1919
  ] })
@@ -1931,7 +1931,7 @@ const pi = ({
1931
1931
  // can always dismiss; making the whole header disappear (the
1932
1932
  // pre-0.18.0 behavior) left users no way out short of scrolling
1933
1933
  // the page itself.
1934
- /* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", ...$e, children: [
1934
+ /* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", ...He, children: [
1935
1935
  !U && (Se ? /* @__PURE__ */ k(
1936
1936
  "a",
1937
1937
  {
@@ -1942,7 +1942,7 @@ const pi = ({
1942
1942
  "aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
1943
1943
  title: "Powered by LiveLayer — visit livelayer.studio",
1944
1944
  children: [
1945
- /* @__PURE__ */ r(ai, { size: 14, className: "ll-expanded__brand-mark" }),
1945
+ /* @__PURE__ */ r(gi, { size: 14, className: "ll-expanded__brand-mark" }),
1946
1946
  /* @__PURE__ */ r("span", { children: Me })
1947
1947
  ]
1948
1948
  }
@@ -1953,9 +1953,9 @@ const pi = ({
1953
1953
  {
1954
1954
  type: "button",
1955
1955
  className: "ll-hbtn ll-hbtn--ghost",
1956
- onClick: De,
1956
+ onClick: ze,
1957
1957
  "aria-label": "Minimize widget",
1958
- children: /* @__PURE__ */ r(Sn, {})
1958
+ children: /* @__PURE__ */ r(Nn, {})
1959
1959
  }
1960
1960
  ),
1961
1961
  te !== !1 && /* @__PURE__ */ r(
@@ -1963,23 +1963,23 @@ const pi = ({
1963
1963
  {
1964
1964
  type: "button",
1965
1965
  className: "ll-hbtn ll-hbtn--danger",
1966
- onClick: ze,
1966
+ onClick: $e,
1967
1967
  "aria-label": "Close widget",
1968
- children: /* @__PURE__ */ r(kn, {})
1968
+ children: /* @__PURE__ */ r(An, {})
1969
1969
  }
1970
1970
  )
1971
1971
  ] })
1972
1972
  ] })
1973
1973
  ),
1974
- yt && /* @__PURE__ */ (() => {
1975
- const _ = R ? "Resume session" : E === "disconnected" ? "Reconnect to agent" : "Start video call";
1974
+ wt && /* @__PURE__ */ (() => {
1975
+ const _ = T ? "Resume session" : E === "disconnected" ? "Reconnect to agent" : "Start video call";
1976
1976
  return /* @__PURE__ */ k(We, { children: [
1977
1977
  !v && /* @__PURE__ */ k(
1978
1978
  "button",
1979
1979
  {
1980
1980
  type: "button",
1981
1981
  className: "ll-expanded__play",
1982
- onClick: nt,
1982
+ onClick: it,
1983
1983
  "aria-label": _,
1984
1984
  children: [
1985
1985
  /* @__PURE__ */ r("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ r("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
@@ -1994,7 +1994,7 @@ const pi = ({
1994
1994
  {
1995
1995
  type: "button",
1996
1996
  className: "ll-expanded__cta",
1997
- onClick: nt,
1997
+ onClick: it,
1998
1998
  "aria-label": _,
1999
1999
  children: _
2000
2000
  }
@@ -2005,12 +2005,12 @@ const pi = ({
2005
2005
  /* @__PURE__ */ k(
2006
2006
  "div",
2007
2007
  {
2008
- className: `ll-expanded__pip ${je && (K || f) ? "is-visible" : ""}`,
2008
+ className: `ll-expanded__pip ${Ve && (K || f) ? "is-visible" : ""}`,
2009
2009
  children: [
2010
2010
  /* @__PURE__ */ r(
2011
2011
  "div",
2012
2012
  {
2013
- ref: ot,
2013
+ ref: at,
2014
2014
  className: f ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
2015
2015
  }
2016
2016
  ),
@@ -2024,21 +2024,21 @@ const pi = ({
2024
2024
  ]
2025
2025
  }
2026
2026
  ),
2027
- je ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
2028
- !U && wt && /* @__PURE__ */ r(
2027
+ Ve ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
2028
+ !U && Lt && /* @__PURE__ */ r(
2029
2029
  "div",
2030
2030
  {
2031
2031
  className: "ll-expanded__transcript ll-expanded__transcript--agent",
2032
2032
  "data-role": "agent",
2033
- children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: wt })
2033
+ children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Lt })
2034
2034
  }
2035
2035
  ),
2036
- !U && Ge && /* @__PURE__ */ r(
2036
+ !U && Xe && /* @__PURE__ */ r(
2037
2037
  "div",
2038
2038
  {
2039
2039
  className: "ll-expanded__transcript ll-expanded__transcript--user",
2040
2040
  "data-role": "user",
2041
- children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Ge })
2041
+ children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Xe })
2042
2042
  }
2043
2043
  ),
2044
2044
  !oe && !U && /* @__PURE__ */ k("div", { className: "ll-toolbar", onClick: (_) => _.stopPropagation(), children: [
@@ -2050,7 +2050,7 @@ const pi = ({
2050
2050
  onClick: Re,
2051
2051
  "aria-label": f ? "Stop sharing screen" : "Share screen",
2052
2052
  title: f ? "Stop sharing" : "Share screen",
2053
- children: /* @__PURE__ */ r(Fn, {})
2053
+ children: /* @__PURE__ */ r(Yn, {})
2054
2054
  }
2055
2055
  ),
2056
2056
  q && /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
@@ -2059,36 +2059,36 @@ const pi = ({
2059
2059
  {
2060
2060
  type: "button",
2061
2061
  className: `ll-tool ll-tool--left ${K ? "is-on" : ""}`,
2062
- onClick: Be,
2062
+ onClick: qe,
2063
2063
  "aria-label": K ? "Turn off camera" : "Turn on camera",
2064
2064
  title: K ? "Stop camera" : "Start camera",
2065
- children: /* @__PURE__ */ r(Wn, {})
2065
+ children: /* @__PURE__ */ r(Gn, {})
2066
2066
  }
2067
2067
  ),
2068
2068
  /* @__PURE__ */ r(
2069
2069
  "button",
2070
2070
  {
2071
- ref: _e,
2071
+ ref: Le,
2072
2072
  type: "button",
2073
2073
  className: `ll-tool ll-tool--right ${K ? "is-on" : ""}`,
2074
2074
  onClick: (_) => {
2075
- _.stopPropagation(), Ye((re) => !re), pe(!1);
2075
+ _.stopPropagation(), Ge((re) => !re), pe(!1);
2076
2076
  },
2077
2077
  "aria-label": "Camera devices",
2078
2078
  "aria-haspopup": "listbox",
2079
- "aria-expanded": Ve,
2080
- children: /* @__PURE__ */ r(St, {})
2079
+ "aria-expanded": Ye,
2080
+ children: /* @__PURE__ */ r(Nt, {})
2081
2081
  }
2082
2082
  ),
2083
- Ve && $.length > 0 && /* @__PURE__ */ r(
2084
- En,
2083
+ Ye && H.length > 0 && /* @__PURE__ */ r(
2084
+ Mn,
2085
2085
  {
2086
2086
  label: "Camera",
2087
- devices: $,
2087
+ devices: H,
2088
2088
  activeId: G,
2089
- anchorRef: _e,
2089
+ anchorRef: Le,
2090
2090
  onPick: (_) => {
2091
- Ye(!1), qe(_);
2091
+ Ge(!1), Ue(_);
2092
2092
  }
2093
2093
  }
2094
2094
  )
@@ -2099,10 +2099,10 @@ const pi = ({
2099
2099
  {
2100
2100
  type: "button",
2101
2101
  className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
2102
- onClick: it,
2102
+ onClick: lt,
2103
2103
  "aria-label": O ? "Unmute microphone" : "Mute microphone",
2104
2104
  title: O ? "Unmute" : "Mute",
2105
- children: /* @__PURE__ */ r(Bn, { muted: O })
2105
+ children: /* @__PURE__ */ r(Xn, { muted: O })
2106
2106
  }
2107
2107
  ),
2108
2108
  /* @__PURE__ */ r(
@@ -2112,23 +2112,23 @@ const pi = ({
2112
2112
  type: "button",
2113
2113
  className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
2114
2114
  onClick: (_) => {
2115
- _.stopPropagation(), pe((re) => !re), Ye(!1);
2115
+ _.stopPropagation(), pe((re) => !re), Ge(!1);
2116
2116
  },
2117
2117
  "aria-label": "Microphone devices",
2118
2118
  "aria-haspopup": "listbox",
2119
2119
  "aria-expanded": le,
2120
- children: /* @__PURE__ */ r(St, {})
2120
+ children: /* @__PURE__ */ r(Nt, {})
2121
2121
  }
2122
2122
  ),
2123
- le && D.length > 0 && /* @__PURE__ */ r(
2124
- En,
2123
+ le && z.length > 0 && /* @__PURE__ */ r(
2124
+ Mn,
2125
2125
  {
2126
2126
  label: "Microphone",
2127
- devices: D,
2128
- activeId: W,
2127
+ devices: z,
2128
+ activeId: B,
2129
2129
  anchorRef: ge,
2130
2130
  onPick: (_) => {
2131
- pe(!1), gt(_);
2131
+ pe(!1), bt(_);
2132
2132
  }
2133
2133
  }
2134
2134
  )
@@ -2137,11 +2137,11 @@ const pi = ({
2137
2137
  "button",
2138
2138
  {
2139
2139
  type: "button",
2140
- className: `ll-tool ${z ? "is-muted" : ""}`,
2141
- onClick: Te,
2142
- "aria-label": z ? "Unmute speaker" : "Mute speaker",
2143
- title: z ? "Unmute speaker" : "Mute speaker",
2144
- children: /* @__PURE__ */ r(qn, { muted: z })
2140
+ className: `ll-tool ${$ ? "is-muted" : ""}`,
2141
+ onClick: De,
2142
+ "aria-label": $ ? "Unmute speaker" : "Mute speaker",
2143
+ title: $ ? "Unmute speaker" : "Mute speaker",
2144
+ children: /* @__PURE__ */ r(Kn, { muted: $ })
2145
2145
  }
2146
2146
  ),
2147
2147
  /* @__PURE__ */ r(
@@ -2149,51 +2149,51 @@ const pi = ({
2149
2149
  {
2150
2150
  type: "button",
2151
2151
  className: "ll-tool ll-tool--danger",
2152
- onClick: rt,
2152
+ onClick: ot,
2153
2153
  "aria-label": "End conversation",
2154
2154
  title: "End conversation",
2155
- children: /* @__PURE__ */ r(Un, {})
2155
+ children: /* @__PURE__ */ r(Jn, {})
2156
2156
  }
2157
2157
  )
2158
2158
  ] }),
2159
2159
  !oe && U && /* @__PURE__ */ r(
2160
- ui,
2160
+ bi,
2161
2161
  {
2162
2162
  isMuted: O,
2163
- onToggleMute: it,
2163
+ onToggleMute: lt,
2164
2164
  isCameraEnabled: K,
2165
- onToggleCamera: Be,
2165
+ onToggleCamera: qe,
2166
2166
  allowCamera: q,
2167
2167
  isScreenShareEnabled: f,
2168
2168
  onToggleScreenShare: Re,
2169
2169
  allowScreenShare: X,
2170
- isSpeakerMuted: z,
2171
- onToggleSpeaker: Te,
2170
+ isSpeakerMuted: $,
2171
+ onToggleSpeaker: De,
2172
2172
  allowTyping: ee,
2173
- isTypingOpen: bt,
2174
- onToggleTyping: It,
2175
- onDisconnect: rt
2173
+ isTypingOpen: xt,
2174
+ onToggleTyping: Pt,
2175
+ onDisconnect: ot
2176
2176
  }
2177
2177
  ),
2178
- !oe && ee && (U ? bt : !0) && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Ae, children: [
2178
+ !oe && ee && (U ? xt : !0) && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Ne, children: [
2179
2179
  /* @__PURE__ */ r(
2180
2180
  "input",
2181
2181
  {
2182
2182
  type: "text",
2183
2183
  className: "ll-message-input__field",
2184
2184
  placeholder: "Message...",
2185
- value: lt,
2186
- onChange: (_) => Rt(_.target.value),
2185
+ value: st,
2186
+ onChange: (_) => zt(_.target.value),
2187
2187
  "aria-label": "Message the agent"
2188
2188
  }
2189
2189
  ),
2190
- lt.trim() && /* @__PURE__ */ r(
2190
+ st.trim() && /* @__PURE__ */ r(
2191
2191
  "button",
2192
2192
  {
2193
2193
  type: "submit",
2194
2194
  className: "ll-message-input__send",
2195
2195
  "aria-label": "Send message",
2196
- children: /* @__PURE__ */ r(hi, {})
2196
+ children: /* @__PURE__ */ r(Li, {})
2197
2197
  }
2198
2198
  )
2199
2199
  ] })
@@ -2207,7 +2207,7 @@ const pi = ({
2207
2207
  {
2208
2208
  type: "button",
2209
2209
  className: "ll-expanded__banner-x",
2210
- onClick: Ue,
2210
+ onClick: je,
2211
2211
  "aria-label": "Dismiss",
2212
2212
  children: "×"
2213
2213
  }
@@ -2222,7 +2222,7 @@ const pi = ({
2222
2222
  {
2223
2223
  type: "button",
2224
2224
  className: "ll-expanded__banner-retry",
2225
- onClick: ht,
2225
+ onClick: yt,
2226
2226
  children: re
2227
2227
  }
2228
2228
  )
@@ -2244,32 +2244,32 @@ const pi = ({
2244
2244
  }
2245
2245
  );
2246
2246
  };
2247
- function St() {
2247
+ function Nt() {
2248
2248
  return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" }) });
2249
2249
  }
2250
- function kn() {
2250
+ function An() {
2251
2251
  return /* @__PURE__ */ k("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
2252
2252
  /* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
2253
2253
  /* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
2254
2254
  ] });
2255
2255
  }
2256
- function Sn() {
2256
+ function Nn() {
2257
2257
  return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
2258
2258
  }
2259
- function Fn() {
2259
+ function Yn() {
2260
2260
  return /* @__PURE__ */ k("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: [
2261
2261
  /* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
2262
2262
  /* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
2263
2263
  /* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
2264
2264
  ] });
2265
2265
  }
2266
- function Wn() {
2266
+ function Gn() {
2267
2267
  return /* @__PURE__ */ k("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: [
2268
2268
  /* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
2269
2269
  /* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
2270
2270
  ] });
2271
2271
  }
2272
- function Bn({ muted: e }) {
2272
+ function Xn({ muted: e }) {
2273
2273
  return /* @__PURE__ */ k("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: [
2274
2274
  /* @__PURE__ */ r("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
2275
2275
  /* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
@@ -2277,7 +2277,7 @@ function Bn({ muted: e }) {
2277
2277
  e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2278
2278
  ] });
2279
2279
  }
2280
- function qn({ muted: e }) {
2280
+ function Kn({ muted: e }) {
2281
2281
  return /* @__PURE__ */ k("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: [
2282
2282
  /* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
2283
2283
  e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ k(We, { children: [
@@ -2286,13 +2286,13 @@ function qn({ muted: e }) {
2286
2286
  ] })
2287
2287
  ] });
2288
2288
  }
2289
- function hi() {
2289
+ function Li() {
2290
2290
  return /* @__PURE__ */ k("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2291
2291
  /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
2292
2292
  /* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
2293
2293
  ] });
2294
2294
  }
2295
- function Un() {
2295
+ function Jn() {
2296
2296
  return /* @__PURE__ */ r("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__ */ r(
2297
2297
  "path",
2298
2298
  {
@@ -2301,17 +2301,17 @@ function Un() {
2301
2301
  }
2302
2302
  ) });
2303
2303
  }
2304
- const En = ({
2304
+ const Mn = ({
2305
2305
  label: e,
2306
2306
  devices: t,
2307
2307
  activeId: n,
2308
2308
  onPick: i,
2309
- anchorRef: a
2309
+ anchorRef: l
2310
2310
  }) => {
2311
2311
  const [o, s] = M(null);
2312
- return Dn(() => {
2313
- const l = () => {
2314
- const c = a.current;
2312
+ return Wn(() => {
2313
+ const a = () => {
2314
+ const c = l.current;
2315
2315
  if (!c) return;
2316
2316
  const u = c.getBoundingClientRect(), m = 126, p = window.innerWidth - 16 - 110, h = u.left + u.width / 2;
2317
2317
  s({
@@ -2319,15 +2319,15 @@ const En = ({
2319
2319
  left: Math.max(m, Math.min(p, h))
2320
2320
  });
2321
2321
  };
2322
- return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
2323
- window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
2322
+ return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
2323
+ window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
2324
2324
  };
2325
- }, [a]), o === null || typeof document > "u" ? null : Xt(
2325
+ }, [l]), o === null || typeof document > "u" ? null : Qt(
2326
2326
  /* @__PURE__ */ k(
2327
2327
  "div",
2328
2328
  {
2329
2329
  className: "ll-device-menu ll-device-menu--floating",
2330
- onClick: (l) => l.stopPropagation(),
2330
+ onClick: (a) => a.stopPropagation(),
2331
2331
  role: "listbox",
2332
2332
  style: {
2333
2333
  position: "fixed",
@@ -2338,22 +2338,22 @@ const En = ({
2338
2338
  },
2339
2339
  children: [
2340
2340
  /* @__PURE__ */ r("p", { className: "ll-device-menu__label", children: e }),
2341
- t.map((l, c) => {
2342
- const u = n === l.deviceId;
2341
+ t.map((a, c) => {
2342
+ const u = n === a.deviceId;
2343
2343
  return /* @__PURE__ */ k(
2344
2344
  "button",
2345
2345
  {
2346
2346
  type: "button",
2347
2347
  className: `ll-device-menu__item ${u ? "is-active" : ""}`,
2348
- onClick: () => i(l.deviceId),
2348
+ onClick: () => i(a.deviceId),
2349
2349
  role: "option",
2350
2350
  "aria-selected": u,
2351
2351
  children: [
2352
2352
  u && /* @__PURE__ */ r("span", { className: "ll-device-menu__dot", children: "●" }),
2353
- /* @__PURE__ */ r("span", { className: "ll-device-menu__name", children: l.label || `${e} ${c + 1}` })
2353
+ /* @__PURE__ */ r("span", { className: "ll-device-menu__name", children: a.label || `${e} ${c + 1}` })
2354
2354
  ]
2355
2355
  },
2356
- l.deviceId || c
2356
+ a.deviceId || c
2357
2357
  );
2358
2358
  })
2359
2359
  ]
@@ -2361,7 +2361,7 @@ const En = ({
2361
2361
  ),
2362
2362
  document.body
2363
2363
  );
2364
- }, mi = [
2364
+ }, Ci = [
2365
2365
  // Accept any value (or empty) — `<input data-ll-private />` and
2366
2366
  // `<input data-ll-private="true" />` both opt out. The bare attribute
2367
2367
  // is the recommended spelling; "true" is preserved for back-compat.
@@ -2369,17 +2369,17 @@ const En = ({
2369
2369
  "[data-ll-skip]",
2370
2370
  ".ll-widget"
2371
2371
  ];
2372
- function Kt(e) {
2372
+ function Tt(e) {
2373
2373
  let t = e;
2374
2374
  for (; t; ) {
2375
- for (const n of mi)
2375
+ for (const n of Ci)
2376
2376
  if (t.matches(n)) return !0;
2377
2377
  t = t.parentElement;
2378
2378
  }
2379
2379
  return !1;
2380
2380
  }
2381
- function Vt(e) {
2382
- if (Kt(e)) return !1;
2381
+ function Kt(e) {
2382
+ if (Tt(e)) return !1;
2383
2383
  if (e instanceof HTMLInputElement) {
2384
2384
  if (e.type === "password") return !1;
2385
2385
  const t = (e.getAttribute("autocomplete") || "").toLowerCase();
@@ -2387,7 +2387,111 @@ function Vt(e) {
2387
2387
  }
2388
2388
  return !0;
2389
2389
  }
2390
- const Et = 4096, gi = 20, yi = 20, vi = 10, bi = 10, wi = 30, _i = 20, Nn = 500, xi = [
2390
+ const ki = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i, In = /\b(back|previous|prev|go\s*back)\b|←|‹/i, Si = /\b(submit|finish|done|complete|send)\b/i, gt = /* @__PURE__ */ new Map();
2391
+ function Tn(e) {
2392
+ const t = gt.get(e);
2393
+ return t && t.isConnected ? t : null;
2394
+ }
2395
+ function et(e) {
2396
+ if (Tt(e) || e.hidden || e.getAttribute("aria-hidden") === "true") return !0;
2397
+ const t = typeof window < "u" && window.getComputedStyle ? window.getComputedStyle(e) : null;
2398
+ return !!(t && (t.display === "none" || t.visibility === "hidden"));
2399
+ }
2400
+ function Ei(e) {
2401
+ return !!(e.disabled || e.getAttribute("aria-disabled") === "true");
2402
+ }
2403
+ function Ai(e) {
2404
+ return (e.innerText || e.textContent || e.getAttribute("aria-label") || e.value || "").trim();
2405
+ }
2406
+ function Ni(e) {
2407
+ return Array.from(e.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"]')).filter(
2408
+ (n) => !et(n) && !Ei(n)
2409
+ );
2410
+ }
2411
+ function Zn(e) {
2412
+ gt.clear();
2413
+ const t = Ni(e);
2414
+ let n, i, l;
2415
+ for (const a of t) {
2416
+ const c = Ai(a);
2417
+ if (!c || c.length > 40) continue;
2418
+ const u = a.getAttribute("type") === "submit" || a.tagName === "BUTTON" && !a.getAttribute("type") && !!a.closest("form");
2419
+ !n && ki.test(c) && !In.test(c) ? (n = { id: "ll-advance", label: c }, gt.set("ll-advance", a)) : !i && In.test(c) ? (i = { id: "ll-back", label: c }, gt.set("ll-back", a)) : !l && (Si.test(c) || u) && (l = { id: "ll-submit", label: c }, gt.set("ll-submit", a));
2420
+ }
2421
+ const o = zi(e);
2422
+ return { kind: n || o.totalSteps ? "multi-step" : "single-page", advance: n, back: i, submit: l, ...o };
2423
+ }
2424
+ const Mi = 60;
2425
+ function Qn(e) {
2426
+ return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0, Mi);
2427
+ }
2428
+ function Ii(e) {
2429
+ const t = e.getAttribute("class");
2430
+ return t ? t.toLowerCase() : "";
2431
+ }
2432
+ const Ti = /stepper|wizard|ant-steps|step-indicator/;
2433
+ function Ri(e) {
2434
+ return Ti.test(Ii(e));
2435
+ }
2436
+ function Rn(e) {
2437
+ const t = e.getAttribute("aria-current");
2438
+ return t === "step" || t === "true" ? !0 : Array.from(e.classList).some(
2439
+ (n) => /(^|[-_])(active|current|selected)([-_]|$)/i.test(n)
2440
+ );
2441
+ }
2442
+ const Di = '[aria-current="step"],[aria-current="true"],[class*="active"],[class*="Active"],[class*="current"],[class*="Current"],[class*="selected"],[class*="Selected"]';
2443
+ function Pi(e) {
2444
+ return Rn(e) ? !0 : Array.from(e.querySelectorAll(Di)).some(
2445
+ Rn
2446
+ );
2447
+ }
2448
+ function Dn(e, t) {
2449
+ const n = Qn(
2450
+ e[t].innerText || e[t].textContent || ""
2451
+ );
2452
+ return {
2453
+ totalSteps: e.length,
2454
+ currentStep: t + 1,
2455
+ ...n ? { stepLabel: n } : {}
2456
+ };
2457
+ }
2458
+ function zi(e) {
2459
+ const t = e.querySelector('[aria-current="step"]');
2460
+ if (t && t.parentElement && !et(t)) {
2461
+ const l = Array.from(t.parentElement.children).filter(
2462
+ (s) => s.tagName === t.tagName && !et(s)
2463
+ ), o = l.indexOf(t);
2464
+ if (o >= 0 && l.length >= 2) return Dn(l, o);
2465
+ }
2466
+ const n = e.querySelector('[role="progressbar"]');
2467
+ if (n && !et(n)) {
2468
+ const l = Number(n.getAttribute("aria-valuenow")), o = Number(n.getAttribute("aria-valuemax"));
2469
+ if (Number.isFinite(l) && Number.isFinite(o) && o >= 2) {
2470
+ const s = (n.getAttribute("aria-valuetext") || "").trim();
2471
+ return {
2472
+ totalSteps: o,
2473
+ currentStep: l,
2474
+ ...s ? { stepLabel: Qn(s) } : {}
2475
+ };
2476
+ }
2477
+ }
2478
+ const i = Array.from(
2479
+ e.querySelectorAll(
2480
+ '[class*="step"], [class*="Step"], [class*="wizard"], [class*="Wizard"]'
2481
+ )
2482
+ ).filter((l) => !et(l) && Ri(l));
2483
+ for (const l of i) {
2484
+ const o = Array.from(l.children).filter(
2485
+ (a) => !et(a) && (a.textContent || "").trim().length > 0
2486
+ );
2487
+ if (o.length < 2 || o.length > 12) continue;
2488
+ const s = o.findIndex(Pi);
2489
+ if (!(s < 0))
2490
+ return Dn(o, s);
2491
+ }
2492
+ return {};
2493
+ }
2494
+ const Mt = 4096, $i = 20, Hi = 20, Oi = 10, Fi = 10, Bi = 30, Wi = 20, Pn = 500, qi = [
2391
2495
  '[data-ll-private="true"]',
2392
2496
  ".ll-widget",
2393
2497
  "script",
@@ -2395,24 +2499,24 @@ const Et = 4096, gi = 20, yi = 20, vi = 10, bi = 10, wi = 30, _i = 20, Nn = 500,
2395
2499
  "noscript",
2396
2500
  "iframe"
2397
2501
  ];
2398
- function ft(e) {
2502
+ function ht(e) {
2399
2503
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
2400
2504
  let t = e;
2401
2505
  for (; t; ) {
2402
- for (const n of xi)
2506
+ for (const n of qi)
2403
2507
  if (t.matches(n)) return !0;
2404
2508
  t = t.parentElement;
2405
2509
  }
2406
2510
  return !1;
2407
2511
  }
2408
- function pt(e) {
2512
+ function mt(e) {
2409
2513
  if (typeof window > "u") return !0;
2410
2514
  const t = e.getBoundingClientRect();
2411
2515
  if (t.width <= 0 || t.height <= 0) return !1;
2412
2516
  const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
2413
2517
  return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
2414
2518
  }
2415
- function An(e) {
2519
+ function zn(e) {
2416
2520
  const t = e.getAttribute("id");
2417
2521
  if (t) {
2418
2522
  const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
@@ -2423,29 +2527,29 @@ function An(e) {
2423
2527
  const i = e.closest("label");
2424
2528
  if (i) {
2425
2529
  const o = [];
2426
- for (const l of Array.from(i.childNodes))
2427
- if (l.nodeType === Node.TEXT_NODE) {
2428
- const c = (l.textContent || "").trim();
2530
+ for (const a of Array.from(i.childNodes))
2531
+ if (a.nodeType === Node.TEXT_NODE) {
2532
+ const c = (a.textContent || "").trim();
2429
2533
  c && o.push(c);
2430
- } else if (l instanceof HTMLElement) {
2431
- if (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement || l instanceof HTMLButtonElement)
2534
+ } else if (a instanceof HTMLElement) {
2535
+ if (a instanceof HTMLInputElement || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement || a instanceof HTMLButtonElement)
2432
2536
  continue;
2433
- const c = (l.textContent || "").trim();
2537
+ const c = (a.textContent || "").trim();
2434
2538
  c && o.push(c);
2435
2539
  }
2436
2540
  const s = o.join(" ").trim();
2437
2541
  if (s) return s;
2438
2542
  }
2439
- const a = e.getAttribute("placeholder");
2440
- return a ? a.trim() : "";
2543
+ const l = e.getAttribute("placeholder");
2544
+ return l ? l.trim() : "";
2441
2545
  }
2442
2546
  function fe(e, t) {
2443
2547
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
2444
2548
  }
2445
- function Li(e) {
2549
+ function Ui(e) {
2446
2550
  return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2447
2551
  }
2448
- function Ci(e) {
2552
+ function ji(e) {
2449
2553
  const t = e.getAttribute("aria-label");
2450
2554
  if (t) return t.trim().slice(0, 80);
2451
2555
  const n = e.getAttribute("aria-labelledby");
@@ -2461,20 +2565,20 @@ function Ci(e) {
2461
2565
  if (o && o.length < 60 && !/^(submit|ok|continue)$/i.test(o))
2462
2566
  return o;
2463
2567
  }
2464
- let a = e.parentElement;
2465
- for (let o = 0; a && o < 4; o++, a = a.parentElement) {
2466
- const s = a.querySelector("h1, h2, h3, h4");
2568
+ let l = e.parentElement;
2569
+ for (let o = 0; l && o < 4; o++, l = l.parentElement) {
2570
+ const s = l.querySelector("h1, h2, h3, h4");
2467
2571
  if (s != null && s.textContent) {
2468
- const l = s.textContent.trim();
2469
- if (l && l.length < 80) return l;
2572
+ const a = s.textContent.trim();
2573
+ if (a && a.length < 80) return a;
2470
2574
  }
2471
2575
  }
2472
2576
  return null;
2473
2577
  }
2474
- function Ze(e) {
2578
+ function Qe(e) {
2475
2579
  return e.length;
2476
2580
  }
2477
- function ki(e, t = {}) {
2581
+ function Vi(e, t = {}) {
2478
2582
  const n = t.doc ?? (typeof document < "u" ? document : null);
2479
2583
  if (!n)
2480
2584
  return {
@@ -2488,39 +2592,39 @@ function ki(e, t = {}) {
2488
2592
  forms: [],
2489
2593
  extras: e
2490
2594
  };
2491
- const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o = n.title || "", s = Array.from(
2595
+ const i = typeof window < "u" && window.location.href || "", l = typeof window < "u" && window.location.pathname || "/", o = n.title || "", s = Array.from(
2492
2596
  n.querySelectorAll("[data-ll-region]")
2493
- ), l = [];
2597
+ ), a = [];
2494
2598
  for (const g of s) {
2495
- if (l.length >= vi) break;
2496
- if (ft(g) || !pt(g)) continue;
2497
- const D = g.getAttribute("data-ll-region") ?? "", W = g.getAttribute("data-ll-intent") ?? void 0, K = fe(
2599
+ if (a.length >= Oi) break;
2600
+ if (ht(g) || !mt(g)) continue;
2601
+ const z = g.getAttribute("data-ll-region") ?? "", B = g.getAttribute("data-ll-intent") ?? void 0, K = fe(
2498
2602
  (g.innerText || g.textContent || "").trim(),
2499
- Nn * 2
2603
+ Pn * 2
2500
2604
  );
2501
- !D || !K || l.push({ id: D, intent: W, text: K });
2605
+ !z || !K || a.push({ id: z, intent: B, text: K });
2502
2606
  }
2503
2607
  const c = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"], m = Array.from(
2504
2608
  n.querySelectorAll("h1, h2, h3, h4, h5, h6")
2505
2609
  );
2506
2610
  for (const g of m) {
2507
- if (ft(g) || !pt(g)) continue;
2508
- const D = (g.textContent || "").trim();
2509
- D && c.push(`${g.tagName}: ${fe(D, 200)}`);
2611
+ if (ht(g) || !mt(g)) continue;
2612
+ const z = (g.textContent || "").trim();
2613
+ z && c.push(`${g.tagName}: ${fe(z, 200)}`);
2510
2614
  }
2511
2615
  const p = Array.from(n.querySelectorAll("p, li"));
2512
2616
  for (const g of p) {
2513
- if (ft(g) || !pt(g) || u.includes(g.tagName)) continue;
2514
- const D = (g.textContent || "").trim();
2515
- D.length > 10 && c.push(fe(D, Nn));
2617
+ if (ht(g) || !mt(g) || u.includes(g.tagName)) continue;
2618
+ const z = (g.textContent || "").trim();
2619
+ z.length > 10 && c.push(fe(z, Pn));
2516
2620
  }
2517
2621
  const h = c.join(`
2518
- `), P = [], x = Array.from(n.querySelectorAll("a[href]"));
2622
+ `), D = [], x = Array.from(n.querySelectorAll("a[href]"));
2519
2623
  for (const g of x) {
2520
- if (P.length >= gi) break;
2521
- if (ft(g) || !pt(g)) continue;
2522
- const D = g.getAttribute("href") || "", W = (g.textContent || "").trim();
2523
- !D || !W || P.push({ href: D, text: fe(W, 100) });
2624
+ if (D.length >= $i) break;
2625
+ if (ht(g) || !mt(g)) continue;
2626
+ const z = g.getAttribute("href") || "", B = (g.textContent || "").trim();
2627
+ !z || !B || D.push({ href: z, text: fe(B, 100) });
2524
2628
  }
2525
2629
  const E = [], y = Array.from(
2526
2630
  n.querySelectorAll(
@@ -2528,34 +2632,34 @@ function ki(e, t = {}) {
2528
2632
  )
2529
2633
  );
2530
2634
  for (const g of y) {
2531
- if (E.length >= yi) break;
2532
- if (ft(g) || !Vt(g) || !pt(g)) continue;
2533
- const D = An(g), W = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
2534
- D && E.push({ label: fe(D, 100), type: W });
2635
+ if (E.length >= Hi) break;
2636
+ if (ht(g) || !Kt(g) || !mt(g)) continue;
2637
+ const z = zn(g), B = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
2638
+ z && E.push({ label: fe(z, 100), type: B });
2535
2639
  }
2536
- const w = Array.from(n.querySelectorAll("form")), R = [];
2640
+ const w = Array.from(n.querySelectorAll("form")), T = [];
2537
2641
  let S = 0;
2538
2642
  for (const g of w) {
2539
- if (R.length >= bi) break;
2540
- if (Kt(g) || g.matches(".ll-widget *, .ll-widget")) continue;
2541
- const D = g.getAttribute("id") || g.getAttribute("name") || Li(g.getAttribute("data-ll-intent")) || `form_${S++}`, W = g.getAttribute("data-ll-intent") || Ci(g) || void 0, K = Array.from(
2643
+ if (T.length >= Fi) break;
2644
+ if (Tt(g) || g.matches(".ll-widget *, .ll-widget")) continue;
2645
+ const z = g.getAttribute("id") || g.getAttribute("name") || Ui(g.getAttribute("data-ll-intent")) || `form_${S++}`, B = g.getAttribute("data-ll-intent") || ji(g) || void 0, K = Array.from(
2542
2646
  g.querySelectorAll(
2543
2647
  "input, textarea, select"
2544
2648
  )
2545
2649
  ), ae = [];
2546
- let $ = 0;
2650
+ let H = 0;
2547
2651
  const G = /* @__PURE__ */ new Set();
2548
2652
  for (const f of K) {
2549
- if (ae.length >= wi) break;
2550
- if (!Vt(f)) continue;
2653
+ if (ae.length >= Bi) break;
2654
+ if (!Kt(f)) continue;
2551
2655
  if (f instanceof HTMLInputElement) {
2552
2656
  const U = f.type;
2553
2657
  if (U === "submit" || U === "button" || U === "reset" || U === "hidden" || U === "image" || U === "file") continue;
2554
2658
  }
2555
- const N = f.getAttribute("name") || "", z = f.getAttribute("id") || "";
2556
- let q = N || z || `field_${$}`;
2557
- G.has(q) && (q = `${q}__${$}`), G.add(q), $++;
2558
- const X = An(f) || q, ee = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), V = {
2659
+ const A = f.getAttribute("name") || "", $ = f.getAttribute("id") || "";
2660
+ let q = A || $ || `field_${H}`;
2661
+ G.has(q) && (q = `${q}__${H}`), G.add(q), H++;
2662
+ const X = zn(f) || q, ee = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), V = {
2559
2663
  name: q,
2560
2664
  label: fe(X, 100),
2561
2665
  type: ee
@@ -2581,64 +2685,65 @@ function ki(e, t = {}) {
2581
2685
  me !== null && (V.max = fe(me, 50));
2582
2686
  const Q = f.getAttribute("step");
2583
2687
  Q !== null && (V.step = fe(Q, 20));
2584
- const be = f.getAttribute("pattern");
2585
- be !== null && (V.pattern = fe(be, 200));
2688
+ const _e = f.getAttribute("pattern");
2689
+ _e !== null && (V.pattern = fe(_e, 200));
2586
2690
  const ne = (f.getAttribute("autocomplete") || "").toLowerCase();
2587
2691
  ne && ne !== "off" && !ne.startsWith("cc-") && (V.autocomplete = fe(ne, 50));
2588
2692
  }
2589
2693
  if (f instanceof HTMLSelectElement) {
2590
2694
  const U = [];
2591
- for (let me = 0; me < f.options.length && !(U.length >= _i); me++) {
2695
+ for (let me = 0; me < f.options.length && !(U.length >= Wi); me++) {
2592
2696
  const Q = f.options[me];
2593
2697
  if (!Q || Q.disabled) continue;
2594
- const be = Q.value || "", ne = (Q.textContent || "").trim() || be;
2595
- !be && !ne || U.push({ value: be, label: fe(ne, 60) });
2698
+ const _e = Q.value || "", ne = (Q.textContent || "").trim() || _e;
2699
+ !_e && !ne || U.push({ value: _e, label: fe(ne, 60) });
2596
2700
  }
2597
2701
  U.length > 0 && (V.options = U);
2598
2702
  }
2599
2703
  const oe = typeof f.validationMessage == "string" ? f.validationMessage : "";
2600
2704
  oe && (V.validationMessage = fe(oe, 200)), ae.push(V);
2601
2705
  }
2602
- R.push({ id: D, intent: W, fields: ae });
2706
+ T.push({ id: z, intent: B, fields: ae });
2603
2707
  }
2604
2708
  const v = {
2605
2709
  url: i,
2606
2710
  title: o,
2607
- pathname: a,
2608
- regions: l,
2711
+ pathname: l,
2712
+ regions: a,
2609
2713
  visibleText: h,
2610
- visibleLinks: P,
2714
+ visibleLinks: D,
2611
2715
  visibleFields: E,
2612
- forms: R,
2716
+ forms: T,
2717
+ flow: Zn(n),
2613
2718
  extras: e
2614
2719
  };
2615
- let O = Ze(JSON.stringify(v.regions)) + Ze(v.visibleText) + Ze(JSON.stringify(v.visibleLinks)) + Ze(JSON.stringify(v.visibleFields));
2616
- for (; O > Et && v.visibleFields.length > 0; )
2617
- v.visibleFields.pop(), O = Ze(JSON.stringify(v.visibleFields));
2618
- for (; O > Et && v.visibleLinks.length > 0; )
2720
+ let O = Qe(JSON.stringify(v.regions)) + Qe(v.visibleText) + Qe(JSON.stringify(v.visibleLinks)) + Qe(JSON.stringify(v.visibleFields));
2721
+ for (; O > Mt && v.visibleFields.length > 0; )
2722
+ v.visibleFields.pop(), O = Qe(JSON.stringify(v.visibleFields));
2723
+ for (; O > Mt && v.visibleLinks.length > 0; )
2619
2724
  v.visibleLinks.pop(), O -= 80;
2620
- return Ze(v.visibleText) > Et && (v.visibleText = fe(v.visibleText, Et - 100)), v;
2725
+ return Qe(v.visibleText) > Mt && (v.visibleText = fe(v.visibleText, Mt - 100)), v;
2621
2726
  }
2622
- let Qe = null;
2623
- function Si(e) {
2727
+ let tt = null;
2728
+ function Yi(e) {
2624
2729
  const t = e.querySelectorAll("form");
2625
2730
  let n = `f${t.length}`;
2626
2731
  return t.forEach((i) => {
2627
2732
  n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
2628
2733
  }), n;
2629
2734
  }
2630
- function Mn(e, t = {}) {
2631
- const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), a = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${a}::${o}::${i ? Si(i) : ""}`;
2632
- if (Qe && Qe.key === s && n - Qe.at < 1e3)
2633
- return Qe.ctx;
2634
- const l = ki(e, t);
2635
- return Qe = { key: s, at: n, ctx: l }, l;
2735
+ function $n(e, t = {}) {
2736
+ const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), l = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${l}::${o}::${i ? Yi(i) : ""}`;
2737
+ if (tt && tt.key === s && n - tt.at < 1e3)
2738
+ return tt.ctx;
2739
+ const a = Vi(e, t);
2740
+ return tt = { key: s, at: n, ctx: a }, a;
2636
2741
  }
2637
- function Ei() {
2638
- Qe = null;
2742
+ function Gi() {
2743
+ tt = null;
2639
2744
  }
2640
- const Ni = 200;
2641
- function Ai(e) {
2745
+ const Xi = 200;
2746
+ function Ki(e) {
2642
2747
  const t = String(e.href || "");
2643
2748
  return {
2644
2749
  href: t,
@@ -2648,23 +2753,23 @@ function Ai(e) {
2648
2753
  description: e.description
2649
2754
  };
2650
2755
  }
2651
- function Mi(e) {
2756
+ function Ji(e) {
2652
2757
  return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
2653
2758
  }
2654
- function Ii(e) {
2759
+ function Zi(e) {
2655
2760
  const t = e ?? (typeof document < "u" ? document : null);
2656
2761
  if (!t) return [];
2657
- const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [], o = Array.from(t.querySelectorAll("a[href]"));
2762
+ const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), l = [], o = Array.from(t.querySelectorAll("a[href]"));
2658
2763
  for (const s of o) {
2659
- if (a.length >= Ni) break;
2660
- if (Kt(s)) continue;
2661
- const l = s.getAttribute("href") || "";
2662
- if (!Mi(l)) continue;
2663
- let c = l, u = !0;
2764
+ if (l.length >= Xi) break;
2765
+ if (Tt(s)) continue;
2766
+ const a = s.getAttribute("href") || "";
2767
+ if (!Ji(a)) continue;
2768
+ let c = a, u = !0;
2664
2769
  try {
2665
2770
  if (typeof window < "u") {
2666
- const p = new URL(l, n);
2667
- u = p.origin === n, u && l.startsWith("http") && (c = p.pathname + p.search + p.hash);
2771
+ const p = new URL(a, n);
2772
+ u = p.origin === n, u && a.startsWith("http") && (c = p.pathname + p.search + p.hash);
2668
2773
  }
2669
2774
  } catch {
2670
2775
  continue;
@@ -2672,23 +2777,23 @@ function Ii(e) {
2672
2777
  if (i.has(c)) continue;
2673
2778
  i.add(c);
2674
2779
  const m = (s.textContent || "").trim().slice(0, 120);
2675
- a.push({ href: c, text: m, internal: u });
2780
+ l.push({ href: c, text: m, internal: u });
2676
2781
  }
2677
- return a;
2782
+ return l;
2678
2783
  }
2679
- let et = null;
2680
- const Ri = 5e3;
2681
- function qt() {
2784
+ let nt = null;
2785
+ const Qi = 5e3;
2786
+ function Yt() {
2682
2787
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
2683
- if (et && et.pathname === t && e - et.at < Ri)
2684
- return et.routes;
2685
- const n = Ii();
2686
- return et = { at: e, pathname: t, routes: n }, n;
2788
+ if (nt && nt.pathname === t && e - nt.at < Qi)
2789
+ return nt.routes;
2790
+ const n = Zi();
2791
+ return nt = { at: e, pathname: t, routes: n }, n;
2687
2792
  }
2688
- function Ti() {
2689
- et = null;
2793
+ function eo() {
2794
+ nt = null;
2690
2795
  }
2691
- function Yt(e) {
2796
+ function Jt(e) {
2692
2797
  if (e instanceof HTMLInputElement) {
2693
2798
  const t = e.type;
2694
2799
  if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
@@ -2696,136 +2801,136 @@ function Yt(e) {
2696
2801
  }
2697
2802
  return !0;
2698
2803
  }
2699
- function Pi(e, t) {
2804
+ function to(e, t) {
2700
2805
  return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
2701
2806
  }
2702
- function Ie(e) {
2807
+ function Te(e) {
2703
2808
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
2704
2809
  }
2705
- function Ut(e) {
2810
+ function Gt(e) {
2706
2811
  const t = e.lastIndexOf(".");
2707
2812
  return t >= 0 ? e.slice(t + 1) : e;
2708
2813
  }
2709
- function Di(e) {
2814
+ function no(e) {
2710
2815
  var i;
2711
2816
  const t = e.getAttribute("id");
2712
2817
  if (t)
2713
2818
  try {
2714
- const a = (i = e.ownerDocument) == null ? void 0 : i.querySelector(
2819
+ const l = (i = e.ownerDocument) == null ? void 0 : i.querySelector(
2715
2820
  `label[for="${t.replace(/"/g, '\\"')}"]`
2716
2821
  );
2717
- if (a != null && a.textContent) return a.textContent;
2822
+ if (l != null && l.textContent) return l.textContent;
2718
2823
  } catch {
2719
2824
  }
2720
2825
  const n = e.closest("label");
2721
2826
  return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
2722
2827
  }
2723
- function zi(e, t) {
2724
- const n = Ie(t);
2828
+ function ro(e, t) {
2829
+ const n = Te(t);
2725
2830
  if (n.length < 2) return null;
2726
- let i = null, a = 0;
2831
+ let i = null, l = 0;
2727
2832
  for (const o of Array.from(
2728
2833
  e.querySelectorAll("input, textarea, select")
2729
2834
  )) {
2730
- if (!Yt(o)) continue;
2731
- const s = o.getAttribute("name") || "", l = o.getAttribute("id") || "", c = [
2732
- Ie(Ut(s)),
2733
- Ie(Ut(l)),
2734
- Ie(s),
2735
- Ie(l)
2835
+ if (!Jt(o)) continue;
2836
+ const s = o.getAttribute("name") || "", a = o.getAttribute("id") || "", c = [
2837
+ Te(Gt(s)),
2838
+ Te(Gt(a)),
2839
+ Te(s),
2840
+ Te(a)
2736
2841
  ];
2737
2842
  let u = 0;
2738
2843
  c.some((m) => m.length >= 2 && m === n) ? u = 4 : [
2739
- Ie(s),
2740
- Ie(Ut(s)),
2741
- Ie(Di(o))
2742
- ].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (u = 2), u > a && (a = u, i = o);
2844
+ Te(s),
2845
+ Te(Gt(s)),
2846
+ Te(no(o))
2847
+ ].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (u = 2), u > l && (l = u, i = o);
2743
2848
  }
2744
- return a >= 2 ? i : null;
2849
+ return l >= 2 ? i : null;
2745
2850
  }
2746
- function $i(e, t) {
2851
+ function io(e, t) {
2747
2852
  if (!t) return null;
2748
2853
  try {
2749
2854
  const o = e.querySelector(
2750
2855
  `[name="${t.replace(/"/g, '\\"')}"]`
2751
2856
  );
2752
- if (o && Yt(o)) return o;
2857
+ if (o && Jt(o)) return o;
2753
2858
  } catch {
2754
2859
  }
2755
2860
  const n = Array.from(
2756
2861
  e.querySelectorAll("input, textarea, select")
2757
2862
  );
2758
2863
  let i = 0;
2759
- const a = /* @__PURE__ */ new Map();
2864
+ const l = /* @__PURE__ */ new Map();
2760
2865
  for (const o of n) {
2761
- if (!Yt(o)) continue;
2762
- const s = Pi(o, i);
2763
- let l = s;
2764
- if (a.has(s) && (l = `${s}__${i}`), l === t) return o;
2765
- a.set(s, o), i++;
2866
+ if (!Jt(o)) continue;
2867
+ const s = to(o, i);
2868
+ let a = s;
2869
+ if (l.has(s) && (a = `${s}__${i}`), a === t) return o;
2870
+ l.set(s, o), i++;
2766
2871
  }
2767
- return zi(e, t);
2872
+ return ro(e, t);
2768
2873
  }
2769
- function In(e, t) {
2770
- const n = $i(e, t);
2771
- return n ? Vt(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2874
+ function Hn(e, t) {
2875
+ const n = io(e, t);
2876
+ return n ? Kt(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2772
2877
  }
2773
- function Hi(e, t) {
2774
- const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), a = i == null ? void 0 : i.set;
2775
- a ? a.call(e, t) : e.value = t;
2878
+ function oo(e, t) {
2879
+ const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), l = i == null ? void 0 : i.set;
2880
+ l ? l.call(e, t) : e.value = t;
2776
2881
  }
2777
- function Oi(e, t, n = {}) {
2778
- const i = n.triggerInput ?? !0, a = n.triggerChange ?? !0;
2882
+ function lo(e, t, n = {}) {
2883
+ const i = n.triggerInput ?? !0, l = n.triggerChange ?? !0;
2779
2884
  if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
2780
2885
  const o = Object.getOwnPropertyDescriptor(
2781
2886
  HTMLInputElement.prototype,
2782
2887
  "checked"
2783
- ), s = o == null ? void 0 : o.set, l = t === "true" || t === "1" || t === "on";
2784
- s ? s.call(e, l) : e.checked = l, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2888
+ ), s = o == null ? void 0 : o.set, a = t === "true" || t === "1" || t === "on";
2889
+ s ? s.call(e, a) : e.checked = a, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2785
2890
  return;
2786
2891
  }
2787
- Hi(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2892
+ oo(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2788
2893
  }
2789
- function Rn(e, t) {
2894
+ function On(e, t) {
2790
2895
  if (!t) return null;
2791
- const n = t.replace(/"/g, '\\"'), i = (l) => l.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
2896
+ const n = t.replace(/"/g, '\\"'), i = (a) => a.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
2792
2897
  try {
2793
- const l = e.querySelector(
2898
+ const a = e.querySelector(
2794
2899
  `form#${CSS.escape(t)}`
2795
2900
  );
2796
- if (l && !i(l)) return l;
2901
+ if (a && !i(a)) return a;
2797
2902
  } catch {
2798
2903
  }
2799
- const a = e.querySelector(
2904
+ const l = e.querySelector(
2800
2905
  `form[name="${n}"]`
2801
2906
  );
2802
- if (a && !i(a)) return a;
2907
+ if (l && !i(l)) return l;
2803
2908
  const o = e.querySelector(
2804
2909
  `form[data-ll-intent="${n}"]`
2805
2910
  );
2806
2911
  if (o && !i(o)) return o;
2807
2912
  const s = Array.from(
2808
2913
  e.querySelectorAll("form")
2809
- ).filter((l) => !i(l));
2810
- for (const l of s) {
2811
- const c = l.getAttribute("data-ll-intent");
2812
- if (c && Fi(c) === t) return l;
2914
+ ).filter((a) => !i(a));
2915
+ for (const a of s) {
2916
+ const c = a.getAttribute("data-ll-intent");
2917
+ if (c && ao(c) === t) return a;
2813
2918
  }
2814
2919
  if (/^form_\d+$/.test(t)) {
2815
- const l = parseInt(t.slice(5), 10);
2920
+ const a = parseInt(t.slice(5), 10);
2816
2921
  let c = 0;
2817
2922
  for (const u of s)
2818
2923
  if (!(u.id || u.getAttribute("name") || u.getAttribute("data-ll-intent"))) {
2819
- if (c === l) return u;
2924
+ if (c === a) return u;
2820
2925
  c++;
2821
2926
  }
2822
2927
  }
2823
2928
  return s.length === 1 ? s[0] : null;
2824
2929
  }
2825
- function Fi(e) {
2930
+ function ao(e) {
2826
2931
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2827
2932
  }
2828
- function Wi() {
2933
+ function so() {
2829
2934
  if (typeof window > "u" || typeof document > "u")
2830
2935
  return !1;
2831
2936
  const e = document.scrollingElement || document.documentElement;
@@ -2833,44 +2938,44 @@ function Wi() {
2833
2938
  const t = window.getComputedStyle(e);
2834
2939
  return !(t.overflowY === "hidden" || t.overflowY === "clip");
2835
2940
  }
2836
- function Bi(e) {
2941
+ function co(e) {
2837
2942
  if (!(e instanceof HTMLElement)) return !1;
2838
2943
  const n = window.getComputedStyle(e).overflowY;
2839
2944
  return !(n !== "auto" && n !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
2840
2945
  }
2841
- function qi() {
2946
+ function uo() {
2842
2947
  if (typeof document > "u") return null;
2843
2948
  const e = Array.from(
2844
2949
  document.querySelectorAll("body, body *")
2845
2950
  );
2846
2951
  let t = null, n = 0;
2847
2952
  for (const i of e) {
2848
- if (!Bi(i)) continue;
2849
- const a = i.getBoundingClientRect();
2850
- if (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth || a.width <= 0 || a.height <= 0 || i.closest(".ll-widget")) continue;
2851
- const o = a.width * a.height;
2953
+ if (!co(i)) continue;
2954
+ const l = i.getBoundingClientRect();
2955
+ if (l.bottom <= 0 || l.top >= window.innerHeight || l.right <= 0 || l.left >= window.innerWidth || l.width <= 0 || l.height <= 0 || i.closest(".ll-widget")) continue;
2956
+ const o = l.width * l.height;
2852
2957
  o > n && (n = o, t = i);
2853
2958
  }
2854
2959
  return t;
2855
2960
  }
2856
- function Ui() {
2961
+ function fo() {
2857
2962
  if (typeof window > "u")
2858
2963
  return null;
2859
- if (Wi()) return window;
2860
- const e = qi();
2964
+ if (so()) return window;
2965
+ const e = uo();
2861
2966
  return e || window;
2862
2967
  }
2863
- function Tn(e) {
2968
+ function Fn(e) {
2864
2969
  return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
2865
2970
  }
2866
- function ji(e) {
2971
+ function po(e) {
2867
2972
  var t, n;
2868
2973
  return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
2869
2974
  ((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
2870
2975
  ((n = document.documentElement) == null ? void 0 : n.scrollHeight) ?? 0
2871
2976
  ) : e.scrollHeight - e.clientHeight;
2872
2977
  }
2873
- const Vi = /* @__PURE__ */ new Set([
2978
+ const ho = /* @__PURE__ */ new Set([
2874
2979
  "agent_state",
2875
2980
  "avatar_stream_ready",
2876
2981
  "avatar_active",
@@ -2892,6 +2997,11 @@ const Vi = /* @__PURE__ */ new Set([
2892
2997
  "focus_field",
2893
2998
  "submit_form",
2894
2999
  "request_routes",
3000
+ // 0.22.0 — multi-step flow controls (handled internally via the flow
3001
+ // registry; see detectFlow). Not bubbled to onAgentCommand.
3002
+ "advance_step",
3003
+ "go_back",
3004
+ "submit_flow",
2895
3005
  // 0.12.0 — structured collection (unified API).
2896
3006
  // Both `task_field_updated` and `task_completed` data-channel commands
2897
3007
  // fan out into a single document-level `ll-collected` CustomEvent
@@ -2900,15 +3010,15 @@ const Vi = /* @__PURE__ */ new Set([
2900
3010
  // to onAgentCommand.
2901
3011
  "task_field_updated",
2902
3012
  "task_completed"
2903
- ]), jn = Gt(
3013
+ ]), er = Zt(
2904
3014
  function(t, n) {
2905
- var sn, cn, un, dn, fn, pn, hn;
3015
+ var dn, fn, pn, hn, mn, gn, yn;
2906
3016
  const {
2907
3017
  agentId: i,
2908
- apiKey: a,
3018
+ apiKey: l,
2909
3019
  baseUrl: o = "https://app.livelayer.studio",
2910
3020
  sessionEndpoint: s,
2911
- sessionBody: l,
3021
+ sessionBody: a,
2912
3022
  soundEffects: c,
2913
3023
  experienceMode: u = "WIDGET",
2914
3024
  autoConnect: m = !1,
@@ -2921,25 +3031,25 @@ const Vi = /* @__PURE__ */ new Set([
2921
3031
  // minimized produced). The card sizing now lives in CSS — see
2922
3032
  // .ll-expanded--mobile in styles.css.
2923
3033
  defaultDisplayMode: h = "expanded",
2924
- onDisplayModeChange: P,
3034
+ onDisplayModeChange: D,
2925
3035
  position: x = "bottom-right",
2926
3036
  mobileBreakpoint: E = 640,
2927
3037
  draggable: y,
2928
3038
  resizable: w,
2929
- persistKey: R = "ll-widget",
3039
+ persistKey: T = "ll-widget",
2930
3040
  disablePersistence: S = !1,
2931
3041
  teamMembers: v,
2932
3042
  currentTeamMemberId: O,
2933
3043
  onTeamMemberChange: g,
2934
- idleLoopUrl: D,
2935
- greeting: W,
3044
+ idleLoopUrl: z,
3045
+ greeting: B,
2936
3046
  avatarImageUrl: K,
2937
3047
  agentName: ae,
2938
- branding: $ = {},
3048
+ branding: H = {},
2939
3049
  allowCamera: G = !0,
2940
3050
  allowScreenShare: f = !0,
2941
- allowTyping: N = !0,
2942
- blurUntilFirstSpeech: z = !0,
3051
+ allowTyping: A = !0,
3052
+ blurUntilFirstSpeech: $ = !0,
2943
3053
  showMinimize: q,
2944
3054
  showClose: X,
2945
3055
  chromeless: ee = !1,
@@ -2949,123 +3059,123 @@ const Vi = /* @__PURE__ */ new Set([
2949
3059
  transformingLabel: U = "Transforming…",
2950
3060
  showOn: me,
2951
3061
  hideOn: Q,
2952
- pathname: be,
3062
+ pathname: _e,
2953
3063
  onNavigate: ne,
2954
- onScrollToSelector: nt,
2955
- getPageContext: rt,
2956
- pageContextExtras: ht,
2957
- getRoutes: mt,
2958
- onScrollPage: it,
2959
- onClick: gt,
2960
- capabilities: Be,
2961
- onConnect: qe,
3064
+ onScrollToSelector: it,
3065
+ getPageContext: ot,
3066
+ pageContextExtras: yt,
3067
+ getRoutes: vt,
3068
+ onScrollPage: lt,
3069
+ onClick: bt,
3070
+ capabilities: qe,
3071
+ onConnect: Ue,
2962
3072
  onDisconnect: Re,
2963
- onTranscript: Te,
3073
+ onTranscript: De,
2964
3074
  onAgentState: Pe,
2965
- onConnectionStateChange: De,
2966
- onAgentEvent: ze,
2967
- onAgentCommand: Ue,
2968
- onCollect: $e,
3075
+ onConnectionStateChange: ze,
3076
+ onAgentEvent: $e,
3077
+ onAgentCommand: je,
3078
+ onCollect: He,
2969
3079
  controlledSession: F,
2970
- className: He,
2971
- style: je,
2972
- zIndex: we = 2147483647
2973
- } = t, yt = Wr(be), Oe = Gr(yt, me, Q);
2974
- T(() => {
2975
- Ei(), Ti();
2976
- }, [yt]);
2977
- const Ne = O !== void 0, [At, vt] = M(() => {
3080
+ className: Oe,
3081
+ style: Ve,
3082
+ zIndex: xe = 2147483647
3083
+ } = t, wt = Kr(_e), Fe = ri(wt, me, Q);
3084
+ R(() => {
3085
+ Gi(), eo();
3086
+ }, [wt]);
3087
+ const Ae = O !== void 0, [Rt, _t] = M(() => {
2978
3088
  var b;
2979
3089
  return O ?? ((b = v == null ? void 0 : v[0]) == null ? void 0 : b.id);
2980
- }), Fe = Ne ? O : At, ue = tt(
2981
- () => (v == null ? void 0 : v.find((b) => b.id === Fe)) ?? null,
2982
- [v, Fe]
2983
- ), ot = (ue == null ? void 0 : ue.agentId) ?? i, le = u === "EMBEDDED", pe = Tr(E), [Ve, Ye] = Ir({
3090
+ }), Be = Ae ? O : Rt, ue = rt(
3091
+ () => (v == null ? void 0 : v.find((b) => b.id === Be)) ?? null,
3092
+ [v, Be]
3093
+ ), at = (ue == null ? void 0 : ue.agentId) ?? i, le = u === "EMBEDDED", pe = Wr(E), [Ye, Ge] = Fr({
2984
3094
  value: p,
2985
3095
  defaultValue: h,
2986
- onChange: P,
2987
- persistKey: R,
3096
+ onChange: D,
3097
+ persistKey: T,
2988
3098
  disablePersistence: le || S
2989
- }), ge = le ? "expanded" : Ve, _e = le ? () => {
2990
- } : Ye, bt = q ?? !le, Mt = X ?? !le, It = te || !le && pe, Ae = Or({
3099
+ }), ge = le ? "expanded" : Ye, Le = le ? () => {
3100
+ } : Ge, xt = q ?? !le, Dt = X ?? !le, Pt = te || !le && pe, Ne = Gr({
2991
3101
  draggable: !le && (y ?? !pe),
2992
3102
  resizable: !le && (w ?? !pe),
2993
- persistKey: R,
3103
+ persistKey: T,
2994
3104
  disablePersistence: le || S
2995
- }), Me = br(), Se = Lr(), ye = Cr(), xe = kr(), [wt, Ge] = M(!1), [at, st] = M(!1), [_, re] = M(!1), [Vn, Yn] = M(!1), [Tt, Gn] = M(!1), _t = Kr({ baseUrl: o, config: c }), xt = I(_t);
2996
- xt.current = _t;
2997
- const Pt = I(ne), Dt = I(nt), zt = I(it), $t = I(gt), Jt = I(rt), Zt = I(ht), Qt = I(mt), Ht = I(Be), Le = I(null);
2998
- Pt.current = ne, Dt.current = nt, zt.current = it, $t.current = gt, Jt.current = rt, Zt.current = ht, Qt.current = mt, Ht.current = Be;
2999
- function Ce(b) {
3000
- const d = Ht.current;
3105
+ }), Me = Ar(), Se = Tr(), ye = Rr(), Ce = Dr(), [Lt, Xe] = M(!1), [ct, ut] = M(!1), [_, re] = M(!1), [tr, nr] = M(!1), [$t, rr] = M(!1), Ct = oi({ baseUrl: o, config: c }), kt = I(Ct);
3106
+ kt.current = Ct;
3107
+ const Ht = I(ne), Ot = I(it), Ft = I(lt), Bt = I(bt), en = I(ot), tn = I(yt), nn = I(vt), Wt = I(qe), ke = I(null);
3108
+ Ht.current = ne, Ot.current = it, Ft.current = lt, Bt.current = bt, en.current = ot, tn.current = yt, nn.current = vt, Wt.current = qe;
3109
+ function be(b) {
3110
+ const d = Wt.current;
3001
3111
  return d ? d.includes(b) : !0;
3002
3112
  }
3003
- function ke(b, d) {
3113
+ function we(b, d) {
3004
3114
  console.warn(
3005
3115
  `[LiveLayer] Agent command "${b}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
3006
3116
  );
3007
3117
  }
3008
- const ct = C(
3118
+ const dt = C(
3009
3119
  (b) => {
3010
- var ie, de, Ee, dt;
3120
+ var ie, de, Ee, pt, Ie;
3011
3121
  const d = b;
3012
3122
  if (!(!d.type || typeof d.type != "string")) {
3013
- if (ze == null || ze({ eventName: d.type, data: b }), d.type === "navigate") {
3014
- if (!Ce("navigate")) {
3015
- ke("navigate", "navigate");
3123
+ if ($e == null || $e({ eventName: d.type, data: b }), d.type === "navigate") {
3124
+ if (!be("navigate")) {
3125
+ we("navigate", "navigate");
3016
3126
  return;
3017
3127
  }
3018
- const A = typeof d.href == "string" ? d.href : null;
3019
- if (!A) {
3128
+ const N = typeof d.href == "string" ? d.href : null;
3129
+ if (!N) {
3020
3130
  console.warn(
3021
3131
  `[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
3022
3132
  );
3023
3133
  return;
3024
3134
  }
3025
- if (xt.current.playPageChange(), Pt.current) {
3135
+ if (kt.current.playPageChange(), Ht.current) {
3026
3136
  try {
3027
- Pt.current(A);
3028
- } catch (H) {
3137
+ Ht.current(N);
3138
+ } catch (P) {
3029
3139
  console.warn(
3030
- `[LiveLayer] onNavigate threw for "${A}". Falling back. Error:`,
3031
- H
3140
+ `[LiveLayer] onNavigate threw for "${N}". Falling back. Error:`,
3141
+ P
3032
3142
  );
3033
3143
  }
3034
3144
  return;
3035
3145
  }
3036
3146
  if (typeof document < "u") {
3037
- const H = document.querySelector(
3038
- `a[href="${A.replace(/"/g, '\\"')}"]`
3147
+ const P = document.querySelector(
3148
+ `a[href="${N.replace(/"/g, '\\"')}"]`
3039
3149
  );
3040
- if (H) {
3041
- H.click();
3150
+ if (P) {
3151
+ P.click();
3042
3152
  return;
3043
3153
  }
3044
3154
  }
3045
3155
  if (typeof window < "u" && typeof history < "u")
3046
3156
  try {
3047
- history.pushState({}, "", A), window.dispatchEvent(new PopStateEvent("popstate"));
3048
- } catch (H) {
3157
+ history.pushState({}, "", N), window.dispatchEvent(new PopStateEvent("popstate"));
3158
+ } catch (P) {
3049
3159
  console.warn(
3050
- `[LiveLayer] history.pushState fallback failed for "${A}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
3051
- H
3160
+ `[LiveLayer] history.pushState fallback failed for "${N}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
3161
+ P
3052
3162
  );
3053
3163
  }
3054
3164
  return;
3055
3165
  }
3056
3166
  if (d.type === "scroll_to") {
3057
- if (!Ce("scroll")) {
3058
- ke("scroll_to", "scroll");
3167
+ if (!be("scroll")) {
3168
+ we("scroll_to", "scroll");
3059
3169
  return;
3060
3170
  }
3061
- const A = typeof d.selector == "string" ? d.selector : null;
3062
- if (!A) return;
3063
- const H = d.behavior === "instant" ? "instant" : "smooth";
3064
- if (Dt.current) {
3171
+ const N = typeof d.selector == "string" ? d.selector : null;
3172
+ if (!N) return;
3173
+ const P = d.behavior === "instant" ? "instant" : "smooth";
3174
+ if (Ot.current) {
3065
3175
  try {
3066
- Dt.current(
3067
- A,
3068
- H
3176
+ Ot.current(
3177
+ N,
3178
+ P
3069
3179
  );
3070
3180
  } catch (Y) {
3071
3181
  console.warn("[LiveLayer] onScrollToSelector threw.", Y);
@@ -3075,52 +3185,52 @@ const Vi = /* @__PURE__ */ new Set([
3075
3185
  if (typeof document < "u") {
3076
3186
  let Y = null;
3077
3187
  try {
3078
- Y = document.querySelector(A);
3188
+ Y = document.querySelector(N);
3079
3189
  } catch {
3080
3190
  console.warn(
3081
- `[LiveLayer] scroll_to: invalid selector "${A}".`
3191
+ `[LiveLayer] scroll_to: invalid selector "${N}".`
3082
3192
  );
3083
3193
  return;
3084
3194
  }
3085
3195
  if (!Y) {
3086
3196
  console.warn(
3087
- `[LiveLayer] scroll_to: no element matched "${A}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
3197
+ `[LiveLayer] scroll_to: no element matched "${N}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
3088
3198
  );
3089
3199
  return;
3090
3200
  }
3091
3201
  Y.scrollIntoView({
3092
- behavior: H,
3202
+ behavior: P,
3093
3203
  block: "start"
3094
3204
  });
3095
3205
  }
3096
3206
  return;
3097
3207
  }
3098
3208
  if (d.type === "request_page_context") {
3099
- if (!Ce("read_page")) {
3100
- ke("request_page_context", "read_page");
3209
+ if (!be("read_page")) {
3210
+ we("request_page_context", "read_page");
3101
3211
  return;
3102
3212
  }
3103
- const A = typeof d.requestId == "string" ? d.requestId : void 0, H = (ie = Le.current) == null ? void 0 : ie.call(Le), Y = (Z) => {
3104
- const B = H, ce = B == null ? void 0 : B.localParticipant;
3213
+ const N = typeof d.requestId == "string" ? d.requestId : void 0, P = (ie = ke.current) == null ? void 0 : ie.call(ke), Y = (Z) => {
3214
+ const W = P, ce = W == null ? void 0 : W.localParticipant;
3105
3215
  if (ce != null && ce.publishData)
3106
3216
  try {
3107
- const he = A ? { ...Z, requestId: A } : Z, Je = new TextEncoder().encode(JSON.stringify(he));
3108
- ce.publishData(Je, { reliable: !0 });
3217
+ const he = N ? { ...Z, requestId: N } : Z, Ze = new TextEncoder().encode(JSON.stringify(he));
3218
+ ce.publishData(Ze, { reliable: !0 });
3109
3219
  } catch (he) {
3110
3220
  console.warn("[LiveLayer] publishData failed.", he);
3111
3221
  }
3112
- }, j = Zt.current, J = Jt.current;
3222
+ }, j = tn.current, J = en.current;
3113
3223
  try {
3114
3224
  if (J) {
3115
3225
  const Z = J(j);
3116
3226
  if (Z instanceof Promise) {
3117
- Y({ type: "page_context_pending" }), Z.then((B) => Y({ type: "page_context", context: B })).catch((B) => {
3227
+ Y({ type: "page_context_pending" }), Z.then((W) => Y({ type: "page_context", context: W })).catch((W) => {
3118
3228
  console.warn(
3119
3229
  "[LiveLayer] getPageContext rejected; falling back to default walker.",
3120
- B
3230
+ W
3121
3231
  ), Y({
3122
3232
  type: "page_context",
3123
- context: Mn(j)
3233
+ context: $n(j)
3124
3234
  });
3125
3235
  });
3126
3236
  return;
@@ -3130,7 +3240,7 @@ const Vi = /* @__PURE__ */ new Set([
3130
3240
  }
3131
3241
  Y({
3132
3242
  type: "page_context",
3133
- context: Mn(j)
3243
+ context: $n(j)
3134
3244
  });
3135
3245
  } catch (Z) {
3136
3246
  console.warn(
@@ -3144,101 +3254,116 @@ const Vi = /* @__PURE__ */ new Set([
3144
3254
  return;
3145
3255
  }
3146
3256
  if (d.type === "scroll_page") {
3147
- if (!Ce("scroll")) {
3148
- ke("scroll_page", "scroll");
3257
+ if (!be("scroll")) {
3258
+ we("scroll_page", "scroll");
3149
3259
  return;
3150
3260
  }
3151
- const A = d.direction;
3152
- if (A !== "up" && A !== "down" && A !== "top" && A !== "bottom") {
3261
+ const N = d.direction;
3262
+ if (N !== "up" && N !== "down" && N !== "top" && N !== "bottom") {
3153
3263
  console.warn(
3154
- `[LiveLayer] scroll_page: invalid direction "${String(A)}". Expected up | down | top | bottom.`
3264
+ `[LiveLayer] scroll_page: invalid direction "${String(N)}". Expected up | down | top | bottom.`
3155
3265
  );
3156
3266
  return;
3157
3267
  }
3158
- const H = d.behavior === "instant" ? "instant" : "smooth";
3159
- if (zt.current) {
3268
+ const P = d.behavior === "instant" ? "instant" : "smooth";
3269
+ if (Ft.current) {
3160
3270
  try {
3161
- zt.current(
3162
- A,
3163
- H
3271
+ Ft.current(
3272
+ N,
3273
+ P
3164
3274
  );
3165
- } catch (B) {
3166
- console.warn("[LiveLayer] onScrollPage threw.", B);
3275
+ } catch (W) {
3276
+ console.warn("[LiveLayer] onScrollPage threw.", W);
3167
3277
  }
3168
3278
  return;
3169
3279
  }
3170
3280
  if (typeof window > "u") return;
3171
- const Y = { behavior: H }, j = Ui(), J = (B) => {
3172
- j instanceof Window ? j.scrollBy({ top: B, ...Y }) : j.scrollBy({ top: B, ...Y });
3173
- }, Z = (B) => {
3174
- j instanceof Window ? j.scrollTo({ top: B, ...Y }) : j.scrollTo({ top: B, ...Y });
3281
+ const Y = { behavior: P }, j = fo(), J = (W) => {
3282
+ j instanceof Window ? j.scrollBy({ top: W, ...Y }) : j.scrollBy({ top: W, ...Y });
3283
+ }, Z = (W) => {
3284
+ j instanceof Window ? j.scrollTo({ top: W, ...Y }) : j.scrollTo({ top: W, ...Y });
3175
3285
  };
3176
- A === "up" ? J(-Tn(j)) : A === "down" ? J(Tn(j)) : Z(A === "top" ? 0 : ji(j));
3286
+ N === "up" ? J(-Fn(j)) : N === "down" ? J(Fn(j)) : Z(N === "top" ? 0 : po(j));
3177
3287
  return;
3178
3288
  }
3179
3289
  if (d.type === "click") {
3180
- if (!Ce("click")) {
3181
- ke("click", "click");
3290
+ if (!be("click")) {
3291
+ we("click", "click");
3182
3292
  return;
3183
3293
  }
3184
- const A = typeof d.selector == "string" ? d.selector : null;
3185
- if (!A) {
3294
+ const N = typeof d.selector == "string" ? d.selector : null;
3295
+ if (!N) {
3186
3296
  console.warn("[LiveLayer] click: missing selector.");
3187
3297
  return;
3188
3298
  }
3189
- if ($t.current) {
3299
+ if (Bt.current) {
3190
3300
  try {
3191
- $t.current(A);
3301
+ Bt.current(N);
3192
3302
  } catch (Y) {
3193
3303
  console.warn("[LiveLayer] onClick threw.", Y);
3194
3304
  }
3195
3305
  return;
3196
3306
  }
3197
3307
  if (typeof document > "u") return;
3198
- let H = null;
3308
+ let P = null;
3199
3309
  try {
3200
- H = document.querySelector(A);
3310
+ P = document.querySelector(N);
3201
3311
  } catch {
3202
3312
  console.warn(
3203
- `[LiveLayer] click: invalid selector "${A}".`
3313
+ `[LiveLayer] click: invalid selector "${N}".`
3204
3314
  );
3205
3315
  return;
3206
3316
  }
3207
- if (!H) {
3317
+ if (!P) {
3208
3318
  console.warn(
3209
- `[LiveLayer] click: no element matched "${A}". See https://livelayer.studio/docs/errors/click-no-match`
3319
+ `[LiveLayer] click: no element matched "${N}". See https://livelayer.studio/docs/errors/click-no-match`
3210
3320
  );
3211
3321
  return;
3212
3322
  }
3213
- if (H.closest('[data-ll-private="true"], .ll-widget')) {
3323
+ if (P.closest('[data-ll-private="true"], .ll-widget')) {
3214
3324
  console.warn(
3215
3325
  "[LiveLayer] click: refusing to click element inside a private subtree."
3216
3326
  );
3217
3327
  return;
3218
3328
  }
3219
- (de = H.click) == null || de.call(H);
3329
+ (de = P.click) == null || de.call(P);
3330
+ return;
3331
+ }
3332
+ if (d.type === "advance_step" || d.type === "go_back" || d.type === "submit_flow") {
3333
+ if (!be("click")) {
3334
+ we(d.type, "click");
3335
+ return;
3336
+ }
3337
+ if (typeof document > "u") return;
3338
+ const N = d.type === "advance_step" ? "ll-advance" : d.type === "go_back" ? "ll-back" : "ll-submit";
3339
+ let P = Tn(N);
3340
+ if (P || (Zn(document), P = Tn(N)), !P) {
3341
+ console.warn(`[LiveLayer] ${d.type}: no "${N}" control found.`);
3342
+ return;
3343
+ }
3344
+ (Ee = P.click) == null || Ee.call(P);
3220
3345
  return;
3221
3346
  }
3222
3347
  if (d.type === "fill_form" || d.type === "focus_field") {
3223
- if (!Ce("fill_forms")) {
3224
- ke(d.type, "fill_forms");
3348
+ if (!be("fill_forms")) {
3349
+ we(d.type, "fill_forms");
3225
3350
  return;
3226
3351
  }
3227
3352
  if (typeof document > "u") return;
3228
- d.type === "fill_form" && xt.current.playConfirmation();
3229
- const A = typeof d.formId == "string" ? d.formId : null;
3230
- if (!A) {
3353
+ d.type === "fill_form" && kt.current.playConfirmation();
3354
+ const N = typeof d.formId == "string" ? d.formId : null;
3355
+ if (!N) {
3231
3356
  console.warn(`[LiveLayer] ${d.type}: missing formId.`);
3232
3357
  return;
3233
3358
  }
3234
- const H = Rn(document, A);
3235
- if (!H) {
3359
+ const P = On(document, N);
3360
+ if (!P) {
3236
3361
  console.warn(
3237
- `[LiveLayer] ${d.type}: no <form> matched id="${A}" (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.`
3362
+ `[LiveLayer] ${d.type}: no <form> matched id="${N}" (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.`
3238
3363
  );
3239
3364
  return;
3240
3365
  }
3241
- if (H.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
3366
+ if (P.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
3242
3367
  console.warn(
3243
3368
  `[LiveLayer] ${d.type}: refusing to touch a form in a private / opted-out subtree.`
3244
3369
  );
@@ -3250,12 +3375,12 @@ const Vi = /* @__PURE__ */ new Set([
3250
3375
  console.warn("[LiveLayer] focus_field: missing fieldName.");
3251
3376
  return;
3252
3377
  }
3253
- const J = In(H, j);
3378
+ const J = Hn(P, j);
3254
3379
  if (J.el === null) {
3255
3380
  J.reason === "private" ? console.warn(
3256
3381
  `[LiveLayer] focus_field: field "${j}" is privacy-protected and not focusable.`
3257
3382
  ) : console.warn(
3258
- `[LiveLayer] focus_field: no input matching key="${j}" in form "${A}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
3383
+ `[LiveLayer] focus_field: no input matching key="${j}" in form "${N}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
3259
3384
  );
3260
3385
  return;
3261
3386
  }
@@ -3269,135 +3394,135 @@ const Vi = /* @__PURE__ */ new Set([
3269
3394
  }
3270
3395
  for (const [j, J] of Object.entries(Y)) {
3271
3396
  if (typeof J != "string") continue;
3272
- const Z = In(H, j);
3397
+ const Z = Hn(P, j);
3273
3398
  if (Z.el === null) {
3274
3399
  Z.reason === "private" ? console.warn(
3275
3400
  `[LiveLayer] fill_form: field "${j}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
3276
3401
  ) : console.warn(
3277
- `[LiveLayer] fill_form: no input matching key="${j}" in form "${A}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
3402
+ `[LiveLayer] fill_form: no input matching key="${j}" in form "${N}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
3278
3403
  );
3279
3404
  continue;
3280
3405
  }
3281
3406
  try {
3282
- Oi(Z.el, J);
3283
- } catch (B) {
3407
+ lo(Z.el, J);
3408
+ } catch (W) {
3284
3409
  console.warn(
3285
3410
  `[LiveLayer] fill_form: failed to set "${j}".`,
3286
- B
3411
+ W
3287
3412
  );
3288
3413
  }
3289
3414
  }
3290
3415
  return;
3291
3416
  }
3292
3417
  if (d.type === "submit_form") {
3293
- if (!Ce("submit_forms")) {
3294
- ke("submit_form", "submit_forms");
3418
+ if (!be("submit_forms")) {
3419
+ we("submit_form", "submit_forms");
3295
3420
  return;
3296
3421
  }
3297
3422
  if (typeof document > "u") return;
3298
- const A = typeof d.formId == "string" ? d.formId : null;
3299
- if (!A) {
3423
+ const N = typeof d.formId == "string" ? d.formId : null;
3424
+ if (!N) {
3300
3425
  console.warn("[LiveLayer] submit_form: missing formId.");
3301
3426
  return;
3302
3427
  }
3303
- xt.current.playConfirmation();
3304
- const H = Rn(document, A);
3305
- if (!H) {
3428
+ kt.current.playConfirmation();
3429
+ const P = On(document, N);
3430
+ if (!P) {
3306
3431
  console.warn(
3307
- `[LiveLayer] submit_form: no <form> matched id="${A}" (or matching name / data-ll-intent slug).`
3432
+ `[LiveLayer] submit_form: no <form> matched id="${N}" (or matching name / data-ll-intent slug).`
3308
3433
  );
3309
3434
  return;
3310
3435
  }
3311
- if (H.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
3436
+ if (P.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
3312
3437
  console.warn(
3313
3438
  "[LiveLayer] submit_form: refusing to submit a form in a private / opted-out subtree."
3314
3439
  );
3315
3440
  return;
3316
3441
  }
3317
- const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (Ee = Le.current) == null ? void 0 : Ee.call(Le), J = (ce) => {
3318
- const he = j, Je = he == null ? void 0 : he.localParticipant;
3319
- if (Je != null && Je.publishData)
3442
+ const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (pt = ke.current) == null ? void 0 : pt.call(ke), J = (ce) => {
3443
+ const he = j, Ze = he == null ? void 0 : he.localParticipant;
3444
+ if (Ze != null && Ze.publishData)
3320
3445
  try {
3321
- const sr = Y ? { ...ce, requestId: Y } : ce, cr = new TextEncoder().encode(JSON.stringify(sr));
3322
- Je.publishData(cr, { reliable: !0 });
3446
+ const yr = Y ? { ...ce, requestId: Y } : ce, vr = new TextEncoder().encode(JSON.stringify(yr));
3447
+ Ze.publishData(vr, { reliable: !0 });
3323
3448
  } catch {
3324
3449
  }
3325
3450
  };
3326
3451
  let Z = !1;
3327
- const B = () => {
3328
- Z = !0, J({ type: "form_submitted", formId: A });
3452
+ const W = () => {
3453
+ Z = !0, J({ type: "form_submitted", formId: N });
3329
3454
  };
3330
- H.addEventListener("submit", B, { once: !0 });
3455
+ P.addEventListener("submit", W, { once: !0 });
3331
3456
  try {
3332
- typeof H.requestSubmit == "function" ? H.requestSubmit() : H.submit();
3457
+ typeof P.requestSubmit == "function" ? P.requestSubmit() : P.submit();
3333
3458
  } catch (ce) {
3334
- console.warn("[LiveLayer] submit_form: requestSubmit threw.", ce), H.removeEventListener("submit", B), J({
3459
+ console.warn("[LiveLayer] submit_form: requestSubmit threw.", ce), P.removeEventListener("submit", W), J({
3335
3460
  type: "form_submit_blocked",
3336
- formId: A,
3461
+ formId: N,
3337
3462
  reason: "exception"
3338
3463
  });
3339
3464
  return;
3340
3465
  }
3341
3466
  setTimeout(() => {
3342
- Z || (H.removeEventListener("submit", B), J({
3467
+ Z || (P.removeEventListener("submit", W), J({
3343
3468
  type: "form_submit_blocked",
3344
- formId: A,
3469
+ formId: N,
3345
3470
  reason: "validation"
3346
3471
  }));
3347
3472
  }, 500);
3348
3473
  return;
3349
3474
  }
3350
3475
  if (d.type === "request_routes") {
3351
- if (!Ce("read_page")) {
3352
- ke("request_routes", "read_page");
3476
+ if (!be("read_page")) {
3477
+ we("request_routes", "read_page");
3353
3478
  return;
3354
3479
  }
3355
- const A = typeof d.requestId == "string" ? d.requestId : void 0, Y = (dt = Le.current) == null ? void 0 : dt.call(Le), j = Y == null ? void 0 : Y.localParticipant;
3480
+ const N = typeof d.requestId == "string" ? d.requestId : void 0, Y = (Ie = ke.current) == null ? void 0 : Ie.call(ke), j = Y == null ? void 0 : Y.localParticipant;
3356
3481
  if (!(j != null && j.publishData)) return;
3357
- const J = (B) => {
3482
+ const J = (W) => {
3358
3483
  try {
3359
- const ce = A ? { type: "routes", routes: B, requestId: A } : { type: "routes", routes: B }, he = new TextEncoder().encode(JSON.stringify(ce));
3484
+ const ce = N ? { type: "routes", routes: W, requestId: N } : { type: "routes", routes: W }, he = new TextEncoder().encode(JSON.stringify(ce));
3360
3485
  j.publishData(he, { reliable: !0 });
3361
3486
  } catch (ce) {
3362
3487
  console.warn("[LiveLayer] request_routes: publishData failed.", ce);
3363
3488
  }
3364
- }, Z = Qt.current;
3489
+ }, Z = nn.current;
3365
3490
  if (Z) {
3366
3491
  try {
3367
- const B = Z(), ce = (he) => {
3492
+ const W = Z(), ce = (he) => {
3368
3493
  if (!Array.isArray(he)) {
3369
3494
  J([]);
3370
3495
  return;
3371
3496
  }
3372
- J(he.map(Ai).slice(0, 200));
3497
+ J(he.map(Ki).slice(0, 200));
3373
3498
  };
3374
- B instanceof Promise ? B.then(ce).catch((he) => {
3499
+ W instanceof Promise ? W.then(ce).catch((he) => {
3375
3500
  console.warn(
3376
3501
  "[LiveLayer] getRoutes rejected; falling back to DOM walker.",
3377
3502
  he
3378
- ), J(qt());
3379
- }) : ce(B);
3380
- } catch (B) {
3503
+ ), J(Yt());
3504
+ }) : ce(W);
3505
+ } catch (W) {
3381
3506
  console.warn(
3382
3507
  "[LiveLayer] getRoutes threw; falling back to DOM walker.",
3383
- B
3384
- ), J(qt());
3508
+ W
3509
+ ), J(Yt());
3385
3510
  }
3386
3511
  return;
3387
3512
  }
3388
3513
  try {
3389
- J(qt());
3390
- } catch (B) {
3391
- console.warn("[LiveLayer] request_routes: extractRoutes threw.", B);
3514
+ J(Yt());
3515
+ } catch (W) {
3516
+ console.warn("[LiveLayer] request_routes: extractRoutes threw.", W);
3392
3517
  }
3393
3518
  return;
3394
3519
  }
3395
3520
  if (d.type === "task_field_updated") {
3396
- if (!Ce("collect_data")) {
3397
- ke("task_field_updated", "collect_data");
3521
+ if (!be("collect_data")) {
3522
+ we("task_field_updated", "collect_data");
3398
3523
  return;
3399
3524
  }
3400
- const A = {
3525
+ const N = {
3401
3526
  phase: "field",
3402
3527
  fieldId: typeof d.fieldId == "string" ? d.fieldId : "",
3403
3528
  fieldName: typeof d.fieldName == "string" ? d.fieldName : typeof d.fieldId == "string" ? d.fieldId : "",
@@ -3410,19 +3535,19 @@ const Vi = /* @__PURE__ */ new Set([
3410
3535
  if (typeof document < "u")
3411
3536
  try {
3412
3537
  document.dispatchEvent(
3413
- new CustomEvent("ll-collected", { detail: A })
3538
+ new CustomEvent("ll-collected", { detail: N })
3414
3539
  );
3415
3540
  } catch {
3416
3541
  }
3417
3542
  return;
3418
3543
  }
3419
3544
  if (d.type === "task_completed") {
3420
- if (!Ce("collect_data")) {
3421
- ke("task_completed", "collect_data");
3545
+ if (!be("collect_data")) {
3546
+ we("task_completed", "collect_data");
3422
3547
  return;
3423
3548
  }
3424
- const A = d.result;
3425
- if (!A || typeof A != "object") {
3549
+ const N = d.result;
3550
+ if (!N || typeof N != "object") {
3426
3551
  console.warn(
3427
3552
  "[LiveLayer] task_completed missing `result` payload."
3428
3553
  );
@@ -3432,54 +3557,54 @@ const Vi = /* @__PURE__ */ new Set([
3432
3557
  try {
3433
3558
  document.dispatchEvent(
3434
3559
  new CustomEvent("ll-collected", {
3435
- detail: { phase: "complete", result: A }
3560
+ detail: { phase: "complete", result: N }
3436
3561
  })
3437
3562
  );
3438
3563
  } catch {
3439
3564
  }
3440
3565
  try {
3441
- $e == null || $e(
3442
- A
3566
+ He == null || He(
3567
+ N
3443
3568
  );
3444
- } catch (H) {
3445
- console.warn("[LiveLayer] onCollect threw.", H);
3569
+ } catch (P) {
3570
+ console.warn("[LiveLayer] onCollect threw.", P);
3446
3571
  }
3447
3572
  return;
3448
3573
  }
3449
- Vi.has(d.type) || Ue == null || Ue(d);
3574
+ ho.has(d.type) || je == null || je(d);
3450
3575
  }
3451
3576
  },
3452
- [Ue, ze, $e]
3453
- ), se = vr({
3454
- agentId: F ? "__controlled__" : ot,
3577
+ [je, $e, He]
3578
+ ), se = Er({
3579
+ agentId: F ? "__controlled__" : at,
3455
3580
  baseUrl: o,
3456
- apiKey: a,
3581
+ apiKey: l,
3457
3582
  sessionEndpoint: s,
3458
- sessionBody: l,
3459
- onDataMessage: F ? void 0 : ct
3583
+ sessionBody: a,
3584
+ onDataMessage: F ? void 0 : dt
3460
3585
  });
3461
- T(() => {
3586
+ R(() => {
3462
3587
  if (F != null && F.subscribeToDataMessages)
3463
- return F.subscribeToDataMessages(ct);
3464
- }, [F, ct]), Le.current = () => {
3588
+ return F.subscribeToDataMessages(dt);
3589
+ }, [F, dt]), ke.current = () => {
3465
3590
  var b;
3466
3591
  return (b = se.getRoom) == null ? void 0 : b.call(se);
3467
- }, T(() => {
3592
+ }, R(() => {
3468
3593
  var ie;
3469
3594
  if (typeof window > "u") return;
3470
3595
  const b = ((ie = window.location) == null ? void 0 : ie.hostname) || "";
3471
3596
  if (b === "localhost" || b === "127.0.0.1" || b === "0.0.0.0" || b.endsWith(".local") || b.endsWith(".test"))
3472
3597
  return window.__livelayerSimulateCommand = (de) => {
3473
3598
  try {
3474
- ct(de);
3599
+ dt(de);
3475
3600
  } catch (Ee) {
3476
3601
  console.warn("[LiveLayer] simulate-command threw:", Ee);
3477
3602
  }
3478
3603
  }, () => {
3479
3604
  delete window.__livelayerSimulateCommand;
3480
3605
  };
3481
- }, [ct]);
3482
- const L = tt(() => F ? {
3606
+ }, [dt]);
3607
+ const L = rt(() => F ? {
3483
3608
  connectionState: F.connectionState,
3484
3609
  agentState: F.agentState,
3485
3610
  transcript: F.transcript,
@@ -3510,84 +3635,84 @@ const Vi = /* @__PURE__ */ new Set([
3510
3635
  disconnect: se.disconnect,
3511
3636
  getRoom: se.getRoom,
3512
3637
  isControlled: !1
3513
- }, [F, se]), en = I(L);
3514
- en.current = L;
3515
- const tn = I(F);
3516
- tn.current = F, dr(
3638
+ }, [F, se]), rn = I(L);
3639
+ rn.current = L;
3640
+ const on = I(F);
3641
+ on.current = F, wr(
3517
3642
  n,
3518
3643
  () => ({
3519
3644
  sendData: async (b) => {
3520
- var Ee, dt;
3521
- const d = tn.current;
3645
+ var Ee, pt;
3646
+ const d = on.current;
3522
3647
  if (d != null && d.publishData) {
3523
3648
  try {
3524
3649
  await d.publishData(b);
3525
- } catch (A) {
3526
- console.warn("[AvatarWidget] sendData (controlled) failed:", A);
3650
+ } catch (Ie) {
3651
+ console.warn("[AvatarWidget] sendData (controlled) failed:", Ie);
3527
3652
  }
3528
3653
  return;
3529
3654
  }
3530
- const ie = (dt = (Ee = en.current) == null ? void 0 : Ee.getRoom) == null ? void 0 : dt.call(Ee), de = ie == null ? void 0 : ie.localParticipant;
3655
+ const ie = (pt = (Ee = rn.current) == null ? void 0 : Ee.getRoom) == null ? void 0 : pt.call(Ee), de = ie == null ? void 0 : ie.localParticipant;
3531
3656
  if (de != null && de.publishData)
3532
3657
  try {
3533
- const A = new TextEncoder().encode(JSON.stringify(b));
3534
- await de.publishData(A, { reliable: !0 });
3535
- } catch (A) {
3536
- console.warn("[AvatarWidget] sendData failed:", A);
3658
+ const Ie = new TextEncoder().encode(JSON.stringify(b));
3659
+ await de.publishData(Ie, { reliable: !0 });
3660
+ } catch (Ie) {
3661
+ console.warn("[AvatarWidget] sendData failed:", Ie);
3537
3662
  }
3538
3663
  }
3539
3664
  }),
3540
3665
  []
3541
3666
  );
3542
- const nn = I(null);
3543
- T(() => {
3544
- const b = L.videoElement, d = nn.current;
3667
+ const ln = I(null);
3668
+ R(() => {
3669
+ const b = L.videoElement, d = ln.current;
3545
3670
  if (!(!b || !d))
3546
3671
  return d.appendChild(b), () => {
3547
3672
  b.parentNode === d && d.removeChild(b);
3548
3673
  };
3549
3674
  }, [L.videoElement]);
3550
- const [Xe, Lt] = M(!1);
3551
- T(() => {
3552
- if (!z) {
3553
- Lt(!0);
3675
+ const [Ke, St] = M(!1);
3676
+ R(() => {
3677
+ if (!$) {
3678
+ St(!0);
3554
3679
  return;
3555
3680
  }
3556
- L.agentState === "speaking" && !Xe && Lt(!0);
3557
- }, [z, L.agentState, Xe]), T(() => {
3558
- if (!z) return;
3681
+ L.agentState === "speaking" && !Ke && St(!0);
3682
+ }, [$, L.agentState, Ke]), R(() => {
3683
+ if (!$) return;
3559
3684
  const b = L.connectionState;
3560
- (b === "disconnected" || b === "idle") && Lt(!1);
3561
- }, [z, L.connectionState]), T(() => {
3562
- if (!z || !L.videoElement || Xe) return;
3563
- const b = setTimeout(() => Lt(!0), 5e3);
3685
+ (b === "disconnected" || b === "idle") && St(!1);
3686
+ }, [$, L.connectionState]), R(() => {
3687
+ if (!$ || !L.videoElement || Ke) return;
3688
+ const b = setTimeout(() => St(!0), 5e3);
3564
3689
  return () => clearTimeout(b);
3565
- }, [z, L.videoElement, Xe]), T(() => {
3690
+ }, [$, L.videoElement, Ke]), R(() => {
3566
3691
  const b = L.videoElement;
3567
3692
  if (b) {
3568
- if (!z) {
3693
+ if (!$) {
3569
3694
  b.style.filter = "";
3570
3695
  return;
3571
3696
  }
3572
- b.style.transition = "filter 500ms ease-out", b.style.filter = Xe ? "" : "blur(8px)";
3697
+ b.style.transition = "filter 500ms ease-out", b.style.filter = Ke ? "" : "blur(8px)";
3573
3698
  }
3574
- }, [z, L.videoElement, Xe]), T(() => {
3699
+ }, [$, L.videoElement, Ke]), R(() => {
3575
3700
  const b = L.audioElement;
3576
3701
  if (!b) return;
3577
3702
  const d = document.createElement("div");
3578
3703
  d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(b), document.body.appendChild(d), Me.attach(b);
3579
3704
  const ie = b.play();
3580
3705
  return ie && typeof ie.catch == "function" && ie.catch((de) => {
3581
- (de == null ? void 0 : de.name) === "NotAllowedError" && Ge(!0);
3706
+ (de == null ? void 0 : de.name) === "NotAllowedError" && Xe(!0);
3582
3707
  }), () => {
3583
3708
  Me.detach(), b.parentNode === d && d.removeChild(b), d.parentNode === document.body && document.body.removeChild(d);
3584
3709
  };
3585
3710
  }, [L.audioElement]);
3586
- const ve = _r({
3711
+ const ve = Mr({
3587
3712
  gateUntilAgentReady: !0,
3588
3713
  agentState: L.agentState
3589
3714
  });
3590
- T(() => {
3715
+ R(() => {
3591
3716
  if (L.isControlled || L.connectionState !== "connected") return;
3592
3717
  const b = L.getRoom();
3593
3718
  if (b)
@@ -3598,19 +3723,19 @@ const Vi = /* @__PURE__ */ new Set([
3598
3723
  }), () => {
3599
3724
  Me.detachSlot("mic"), ve.teardownMic();
3600
3725
  };
3601
- }, [L.isControlled, L.connectionState]), T(() => {
3726
+ }, [L.isControlled, L.connectionState]), R(() => {
3602
3727
  var d;
3603
3728
  if (L.connectionState !== "connected") return;
3604
3729
  const b = L.isControlled ? (d = F == null ? void 0 : F.getRoom) == null ? void 0 : d.call(F) : L.getRoom();
3605
3730
  if (b)
3606
- return Se.attachRoom(b), ye.attachRoom(b), L.isControlled && ve.attachRoom(b), xe.refresh(), () => {
3731
+ return Se.attachRoom(b), ye.attachRoom(b), L.isControlled && ve.attachRoom(b), Ce.refresh(), () => {
3607
3732
  Se.teardown(), ye.teardown();
3608
3733
  };
3609
- }, [L.isControlled, L.connectionState, F]), T(() => {
3734
+ }, [L.isControlled, L.connectionState, F]), R(() => {
3610
3735
  const b = L.audioElement;
3611
- b && (b.muted = Tt);
3612
- }, [L.audioElement, Tt]);
3613
- const Xn = C((b) => {
3736
+ b && (b.muted = $t);
3737
+ }, [L.audioElement, $t]);
3738
+ const ir = C((b) => {
3614
3739
  const d = { type: "user_message", text: b };
3615
3740
  if (F != null && F.publishData) {
3616
3741
  try {
@@ -3626,149 +3751,149 @@ const Vi = /* @__PURE__ */ new Set([
3626
3751
  ie.localParticipant.publishData(de, { reliable: !0 });
3627
3752
  } catch {
3628
3753
  }
3629
- }, [L, F]), Kn = C(() => {
3630
- Gn((b) => !b);
3754
+ }, [L, F]), or = C(() => {
3755
+ rr((b) => !b);
3631
3756
  }, []);
3632
- T(() => {
3633
- De == null || De(L.connectionState), L.connectionState === "connected" ? qe == null || qe() : L.connectionState === "disconnected" && (Re == null || Re());
3634
- }, [L.connectionState, qe, Re, De]), T(() => {
3635
- Te == null || Te(L.transcript);
3636
- }, [L.transcript, Te]), T(() => {
3757
+ R(() => {
3758
+ ze == null || ze(L.connectionState), L.connectionState === "connected" ? Ue == null || Ue() : L.connectionState === "disconnected" && (Re == null || Re());
3759
+ }, [L.connectionState, Ue, Re, ze]), R(() => {
3760
+ De == null || De(L.transcript);
3761
+ }, [L.transcript, De]), R(() => {
3637
3762
  Pe == null || Pe(L.agentState);
3638
- }, [L.agentState, Pe]), T(() => {
3639
- _t.setThinking(L.agentState === "thinking");
3640
- }, [L.agentState, _t]);
3641
- const rn = I(!1);
3642
- T(() => {
3643
- !m || rn.current || Oe && L.connectionState === "idle" && (rn.current = !0, L.connect());
3644
- }, [m, L.connectionState, L, Oe]);
3645
- const Jn = C(
3763
+ }, [L.agentState, Pe]), R(() => {
3764
+ Ct.setThinking(L.agentState === "thinking");
3765
+ }, [L.agentState, Ct]);
3766
+ const an = I(!1);
3767
+ R(() => {
3768
+ !m || an.current || Fe && L.connectionState === "idle" && (an.current = !0, L.connect());
3769
+ }, [m, L.connectionState, L, Fe]);
3770
+ const lr = C(
3646
3771
  (b) => {
3647
3772
  const d = v == null ? void 0 : v.find((ie) => ie.id === b);
3648
- d && (re(!1), b !== Fe && (st(!0), L.disconnect(), Ne || vt(b), g == null || g(d)));
3773
+ d && (re(!1), b !== Be && (ut(!0), L.disconnect(), Ae || _t(b), g == null || g(d)));
3649
3774
  },
3650
3775
  [
3651
3776
  v,
3652
- Fe,
3777
+ Be,
3653
3778
  L,
3654
- Ne,
3779
+ Ae,
3655
3780
  g
3656
3781
  ]
3657
3782
  );
3658
- T(() => {
3659
- at && L.connectionState === "connected" && st(!1);
3660
- }, [L.connectionState, at]), T(() => {
3783
+ R(() => {
3784
+ ct && L.connectionState === "connected" && ut(!1);
3785
+ }, [L.connectionState, ct]), R(() => {
3661
3786
  if (!_) return;
3662
3787
  const b = (d) => {
3663
3788
  d.key === "Escape" && re(!1);
3664
3789
  };
3665
3790
  return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
3666
3791
  }, [_]);
3667
- const Zn = !!K || !!(ue != null && ue.avatarImageUrl) || L.isControlled, ut = Sr(ot, o, Zn);
3668
- Be === void 0 && ((sn = ut.info) != null && sn.capabilities) && (Ht.current = ut.info.capabilities);
3669
- const Ct = (ue == null ? void 0 : ue.name) ?? ae ?? ((cn = L.agentConfig) == null ? void 0 : cn.name) ?? ((un = ut.info) == null ? void 0 : un.name) ?? "Live Layer", Ot = (ue == null ? void 0 : ue.avatarImageUrl) ?? K ?? ((dn = L.agentConfig) == null ? void 0 : dn.avatarImageUrl) ?? ((fn = ut.info) == null ? void 0 : fn.avatarImageUrl) ?? null, Qn = D ?? ((pn = L.agentConfig) == null ? void 0 : pn.idleLoopUrl) ?? ((hn = ut.info) == null ? void 0 : hn.idleLoopUrl) ?? null, er = W ?? null, tr = C(() => _e("expanded"), [_e]), nr = C(
3670
- () => _e("minimized"),
3671
- [_e]
3672
- ), on = C(() => {
3673
- L.disconnect(), _e("hidden");
3674
- }, [L, _e]), rr = C(() => {
3792
+ const ar = !!K || !!(ue != null && ue.avatarImageUrl) || L.isControlled, ft = Pr(at, o, ar);
3793
+ qe === void 0 && ((dn = ft.info) != null && dn.capabilities) && (Wt.current = ft.info.capabilities);
3794
+ const Et = (ue == null ? void 0 : ue.name) ?? ae ?? ((fn = L.agentConfig) == null ? void 0 : fn.name) ?? ((pn = ft.info) == null ? void 0 : pn.name) ?? "Live Layer", qt = (ue == null ? void 0 : ue.avatarImageUrl) ?? K ?? ((hn = L.agentConfig) == null ? void 0 : hn.avatarImageUrl) ?? ((mn = ft.info) == null ? void 0 : mn.avatarImageUrl) ?? null, sr = z ?? ((gn = L.agentConfig) == null ? void 0 : gn.idleLoopUrl) ?? ((yn = ft.info) == null ? void 0 : yn.idleLoopUrl) ?? null, cr = B ?? null, ur = C(() => Le("expanded"), [Le]), dr = C(
3795
+ () => Le("minimized"),
3796
+ [Le]
3797
+ ), sn = C(() => {
3798
+ L.disconnect(), Le("hidden");
3799
+ }, [L, Le]), fr = C(() => {
3675
3800
  const b = L.audioElement;
3676
- b && b.play().then(() => Ge(!1)).catch(() => {
3801
+ b && b.play().then(() => Xe(!1)).catch(() => {
3677
3802
  });
3678
- }, [L.audioElement]), ir = C(() => {
3679
- Ge(!1), L.connect();
3680
- }, [L]), Ke = {
3681
- ...je,
3682
- ...le ? {} : { zIndex: we }
3803
+ }, [L.audioElement]), pr = C(() => {
3804
+ Xe(!1), L.connect();
3805
+ }, [L]), Je = {
3806
+ ...Ve,
3807
+ ...le ? {} : { zIndex: xe }
3683
3808
  };
3684
- $.primaryColor && (Ke["--ll-color-primary"] = $.primaryColor), $.accentColor && (Ke["--ll-color-accent"] = $.accentColor), $.backgroundColor && (Ke["--ll-color-bg"] = $.backgroundColor), $.textColor && (Ke["--ll-color-fg"] = $.textColor);
3685
- const or = {
3686
- ...Ke,
3687
- ...Ae.style
3688
- }, lr = [
3809
+ H.primaryColor && (Je["--ll-color-primary"] = H.primaryColor), H.accentColor && (Je["--ll-color-accent"] = H.accentColor), H.backgroundColor && (Je["--ll-color-bg"] = H.backgroundColor), H.textColor && (Je["--ll-color-fg"] = H.textColor);
3810
+ const hr = {
3811
+ ...Je,
3812
+ ...Ne.style
3813
+ }, mr = [
3689
3814
  "ll-widget",
3690
3815
  `ll-widget--${ge}`,
3691
3816
  `ll-widget--${pe ? "mobile" : "desktop"}`,
3692
- Ae.hasGeometry ? "ll-widget--has-geometry" : null,
3693
- Ae.isDragging ? "is-dragging" : null,
3694
- Ae.isResizing ? "is-resizing" : null,
3695
- He
3817
+ Ne.hasGeometry ? "ll-widget--has-geometry" : null,
3818
+ Ne.isDragging ? "is-dragging" : null,
3819
+ Ne.isResizing ? "is-resizing" : null,
3820
+ Oe
3696
3821
  ].filter(Boolean).join(" ");
3697
- if (!Oe) return null;
3698
- const ar = /* @__PURE__ */ r(
3822
+ if (!Fe) return null;
3823
+ const gr = /* @__PURE__ */ r(
3699
3824
  "div",
3700
3825
  {
3701
- className: lr,
3702
- style: or,
3826
+ className: mr,
3827
+ style: hr,
3703
3828
  "data-display-mode": ge,
3704
3829
  "data-position": x,
3705
3830
  "data-experience-mode": u === "EMBEDDED" ? "embedded" : "widget",
3706
3831
  children: ge === "expanded" && /* @__PURE__ */ r(
3707
- pi,
3832
+ xi,
3708
3833
  {
3709
3834
  position: x,
3710
3835
  isMobile: pe,
3711
- agentName: Ct,
3712
- avatarImageUrl: Ot,
3713
- idleLoopUrl: Qn,
3714
- greeting: er,
3715
- branding: $,
3836
+ agentName: Et,
3837
+ avatarImageUrl: qt,
3838
+ idleLoopUrl: sr,
3839
+ greeting: cr,
3840
+ branding: H,
3716
3841
  teamMembers: v,
3717
- currentTeamMemberId: Fe,
3718
- isSwitchingTeamMember: at,
3842
+ currentTeamMemberId: Be,
3843
+ isSwitchingTeamMember: ct,
3719
3844
  teamSwitcherOpen: _,
3720
3845
  onToggleTeamSwitcher: () => re((b) => !b),
3721
- onSelectTeamMember: Jn,
3846
+ onSelectTeamMember: lr,
3722
3847
  connectionState: L.connectionState,
3723
3848
  agentState: L.agentState,
3724
3849
  transcript: L.transcript,
3725
3850
  isMuted: ve.isMuted,
3726
- micDevices: xe.mics,
3851
+ micDevices: Ce.mics,
3727
3852
  activeMicId: ve.activeDeviceId,
3728
3853
  isCameraEnabled: Se.isEnabled,
3729
3854
  cameraPreviewEl: Se.previewEl,
3730
- cameraDevices: xe.cameras,
3855
+ cameraDevices: Ce.cameras,
3731
3856
  activeCameraId: Se.activeDeviceId,
3732
3857
  isScreenShareEnabled: ye.isEnabled,
3733
3858
  screenPreviewEl: ye.previewEl,
3734
- isSpeakerMuted: Tt,
3859
+ isSpeakerMuted: $t,
3735
3860
  allowCamera: G,
3736
3861
  allowScreenShare: f,
3737
- allowTyping: N,
3738
- showMinimize: pe && !le ? !1 : bt,
3739
- showClose: Mt,
3862
+ allowTyping: A,
3863
+ showMinimize: pe && !le ? !1 : xt,
3864
+ showClose: Dt,
3740
3865
  chromeless: ee,
3741
- compactControls: It,
3866
+ compactControls: Pt,
3742
3867
  transforming: oe,
3743
3868
  transformingLabel: U,
3744
- languageMenuOpen: Vn,
3745
- onToggleLanguageMenu: () => Yn((b) => !b),
3746
- needsUserGesture: wt,
3869
+ languageMenuOpen: tr,
3870
+ onToggleLanguageMenu: () => nr((b) => !b),
3871
+ needsUserGesture: Lt,
3747
3872
  canResume: L.canResume,
3748
3873
  micError: ve.micError,
3749
3874
  error: L.error,
3750
- avatarVideoContainerRef: nn,
3875
+ avatarVideoContainerRef: ln,
3751
3876
  agentVideoEl: L.videoElement,
3752
3877
  onConnect: () => void L.connect(),
3753
3878
  onDisconnect: () => L.disconnect(),
3754
- onRetry: ir,
3755
- onResumeAudio: rr,
3879
+ onRetry: pr,
3880
+ onResumeAudio: fr,
3756
3881
  onToggleMute: ve.toggleMute,
3757
3882
  onSwitchMicDevice: (b) => void ve.switchDevice(b),
3758
3883
  onToggleCamera: () => void Se.toggle(),
3759
3884
  onSwitchCameraDevice: (b) => void Se.switchDevice(b),
3760
3885
  onToggleScreenShare: () => void ye.toggle(),
3761
- onToggleSpeaker: Kn,
3762
- onSendMessage: Xn,
3763
- onMinimize: nr,
3764
- onClose: on,
3886
+ onToggleSpeaker: or,
3887
+ onSendMessage: ir,
3888
+ onMinimize: dr,
3889
+ onClose: sn,
3765
3890
  onClearMicError: ve.clearError,
3766
- dragHandleProps: Ae.dragHandleProps,
3767
- resizeHandleProps: Ae.resizeHandleProps
3891
+ dragHandleProps: Ne.dragHandleProps,
3892
+ resizeHandleProps: Ne.resizeHandleProps
3768
3893
  }
3769
3894
  )
3770
3895
  }
3771
- ), ln = !le && (ge === "hidden" || ge === "minimized") ? /* @__PURE__ */ k(
3896
+ ), cn = !le && (ge === "hidden" || ge === "minimized") ? /* @__PURE__ */ k(
3772
3897
  "div",
3773
3898
  {
3774
3899
  className: [
@@ -3777,113 +3902,113 @@ const Vi = /* @__PURE__ */ new Set([
3777
3902
  `ll-widget--${ge}`,
3778
3903
  `ll-widget--${pe ? "mobile" : "desktop"}`
3779
3904
  ].join(" "),
3780
- style: Ke,
3905
+ style: Je,
3781
3906
  "data-display-mode": ge,
3782
3907
  "data-position": x,
3783
3908
  children: [
3784
3909
  ge === "hidden" && /* @__PURE__ */ r(
3785
- ni,
3910
+ di,
3786
3911
  {
3787
3912
  position: x,
3788
3913
  isMobile: pe,
3789
3914
  isSpeaking: L.agentState === "speaking",
3790
- onExpand: () => _e("expanded"),
3791
- label: `Open ${Ct} widget`,
3792
- avatarImageUrl: Ot,
3793
- agentName: Ct,
3915
+ onExpand: () => Le("expanded"),
3916
+ label: `Open ${Et} widget`,
3917
+ avatarImageUrl: qt,
3918
+ agentName: Et,
3794
3919
  containerEl: V
3795
3920
  }
3796
3921
  ),
3797
3922
  ge === "minimized" && /* @__PURE__ */ r(
3798
- ii,
3923
+ pi,
3799
3924
  {
3800
3925
  position: x,
3801
3926
  isMobile: pe,
3802
- agentName: Ct,
3803
- avatarImageUrl: Ot,
3927
+ agentName: Et,
3928
+ avatarImageUrl: qt,
3804
3929
  agentState: L.agentState,
3805
3930
  isMuted: ve.isMuted,
3806
3931
  audioLevel: Me,
3807
- onExpand: tr,
3932
+ onExpand: ur,
3808
3933
  onToggleMute: ve.toggleMute,
3809
- onClose: on
3934
+ onClose: sn
3810
3935
  }
3811
3936
  )
3812
3937
  ]
3813
3938
  }
3814
- ) : null, an = V ?? (typeof document < "u" ? document.body : null);
3939
+ ) : null, un = V ?? (typeof document < "u" ? document.body : null);
3815
3940
  return /* @__PURE__ */ k(We, { children: [
3816
- ar,
3817
- ln && an && Xt(ln, an)
3941
+ gr,
3942
+ cn && un && Qt(cn, un)
3818
3943
  ] });
3819
3944
  }
3820
3945
  );
3821
- jn.displayName = "AvatarWidgetInner";
3822
- const Yi = Gt(
3946
+ er.displayName = "AvatarWidgetInner";
3947
+ const mo = Zt(
3823
3948
  function(t, n) {
3824
- return /* @__PURE__ */ r(yr, { children: /* @__PURE__ */ r(jn, { ...t, ref: n }) });
3949
+ return /* @__PURE__ */ r(Sr, { children: /* @__PURE__ */ r(er, { ...t, ref: n }) });
3825
3950
  }
3826
3951
  );
3827
- Yi.displayName = "AvatarWidget";
3828
- const io = ({
3952
+ mo.displayName = "AvatarWidget";
3953
+ const So = ({
3829
3954
  agentId: e,
3830
3955
  baseUrl: t,
3831
3956
  apiKey: n,
3832
3957
  mode: i,
3833
- onAgentEvent: a,
3958
+ onAgentEvent: l,
3834
3959
  className: o,
3835
3960
  style: s
3836
3961
  }) => {
3837
- const l = I(null), c = I(null), u = I(a);
3838
- u.current = a;
3962
+ const a = I(null), c = I(null), u = I(l);
3963
+ u.current = l;
3839
3964
  const m = C((p) => {
3840
- var P;
3965
+ var D;
3841
3966
  const h = p.detail;
3842
- (P = u.current) == null || P.call(u, h);
3967
+ (D = u.current) == null || D.call(u, h);
3843
3968
  }, []);
3844
- return T(() => {
3845
- const p = l.current;
3969
+ return R(() => {
3970
+ const p = a.current;
3846
3971
  if (!p) return;
3847
3972
  const h = document.createElement("livelayer-widget");
3848
3973
  return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t), n && h.setAttribute("api-key", n), i && h.setAttribute("mode", i), h.addEventListener("agent-event", m), p.appendChild(h), c.current = h, () => {
3849
3974
  h.removeEventListener("agent-event", m), p.removeChild(h), c.current = null;
3850
3975
  };
3851
- }, [e]), T(() => {
3976
+ }, [e]), R(() => {
3852
3977
  c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
3853
- }, [i]), /* @__PURE__ */ r("div", { ref: l, className: o, style: s });
3854
- }, oo = Gt(
3855
- function({ id: t, intent: n, as: i = "div", className: a, style: o, children: s }, l) {
3856
- return fr(
3978
+ }, [i]), /* @__PURE__ */ r("div", { ref: a, className: o, style: s });
3979
+ }, Eo = Zt(
3980
+ function({ id: t, intent: n, as: i = "div", className: l, style: o, children: s }, a) {
3981
+ return _r(
3857
3982
  i,
3858
3983
  {
3859
- ref: l,
3984
+ ref: a,
3860
3985
  "data-ll-region": t,
3861
3986
  "data-ll-intent": n,
3862
- className: a,
3987
+ className: l,
3863
3988
  style: o
3864
3989
  },
3865
3990
  s
3866
3991
  );
3867
3992
  }
3868
3993
  );
3869
- function lo(e = {}) {
3870
- const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [a, o] = M({}), [s, l] = M(!1), [c, u] = M(null), m = I(t), p = I(n), h = I(i);
3871
- T(() => {
3994
+ function Ao(e = {}) {
3995
+ const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [l, o] = M({}), [s, a] = M(!1), [c, u] = M(null), m = I(t), p = I(n), h = I(i);
3996
+ R(() => {
3872
3997
  m.current = t, p.current = n, h.current = i;
3873
3998
  }, [t, n, i]);
3874
- const P = C(() => {
3875
- o({}), l(!1);
3999
+ const D = C(() => {
4000
+ o({}), a(!1);
3876
4001
  }, []);
3877
- return T(() => {
4002
+ return R(() => {
3878
4003
  if (typeof window > "u") return;
3879
4004
  const x = (E) => {
3880
- var w, R;
4005
+ var w, T;
3881
4006
  const y = E.detail;
3882
4007
  if (y) {
3883
4008
  if (y.phase === "field") {
3884
4009
  if (h.current !== "all" && y.source !== h.current)
3885
4010
  return;
3886
- l(!0), o(
4011
+ a(!0), o(
3887
4012
  (S) => S[y.fieldName] === y.value ? S : { ...S, [y.fieldName]: y.value }
3888
4013
  );
3889
4014
  try {
@@ -3897,9 +4022,9 @@ function lo(e = {}) {
3897
4022
  const S = y.result;
3898
4023
  if (h.current !== "all" && S.source !== h.current)
3899
4024
  return;
3900
- u(S), l(!1);
4025
+ u(S), a(!1);
3901
4026
  try {
3902
- (R = p.current) == null || R.call(p, S);
4027
+ (T = p.current) == null || T.call(p, S);
3903
4028
  } catch (v) {
3904
4029
  console.warn("[LiveLayer] useCollect onComplete threw.", v);
3905
4030
  }
@@ -3907,68 +4032,68 @@ function lo(e = {}) {
3907
4032
  }
3908
4033
  };
3909
4034
  return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
3910
- }, []), { fields: a, isCollecting: s, lastResult: c, reset: P };
4035
+ }, []), { fields: l, isCollecting: s, lastResult: c, reset: D };
3911
4036
  }
3912
- let Pn = 1;
3913
- function ao({
4037
+ let Bn = 1;
4038
+ function No({
3914
4039
  onMount: e,
3915
4040
  defaultOpen: t = !1,
3916
4041
  storageKey: n = "ll-debug-open"
3917
4042
  }) {
3918
- const [i, a] = M(t), [o, s] = M([]), [l, c] = M(""), [u, m] = M(!1), p = I(/* @__PURE__ */ new Set()), h = I([]), P = I(u);
3919
- P.current = u, T(() => {
4043
+ const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [u, m] = M(!1), p = I(/* @__PURE__ */ new Set()), h = I([]), D = I(u);
4044
+ D.current = u, R(() => {
3920
4045
  try {
3921
4046
  const y = localStorage.getItem(n);
3922
- y === "1" && a(!0), y === "0" && a(!1);
4047
+ y === "1" && l(!0), y === "0" && l(!1);
3923
4048
  } catch {
3924
4049
  }
3925
- }, [n]), T(() => {
4050
+ }, [n]), R(() => {
3926
4051
  try {
3927
4052
  localStorage.setItem(n, i ? "1" : "0");
3928
4053
  } catch {
3929
4054
  }
3930
- }, [i, n]), T(() => {
4055
+ }, [i, n]), R(() => {
3931
4056
  const y = (w) => {
3932
- (w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), a((R) => !R));
4057
+ (w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((T) => !T));
3933
4058
  };
3934
4059
  return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
3935
- }, []), T(() => {
4060
+ }, []), R(() => {
3936
4061
  const y = setInterval(() => {
3937
- if (h.current.length === 0 || P.current) return;
4062
+ if (h.current.length === 0 || D.current) return;
3938
4063
  const w = h.current.splice(0, h.current.length);
3939
4064
  s(
3940
- (R) => [...w.reverse(), ...R].slice(0, 200)
4065
+ (T) => [...w.reverse(), ...T].slice(0, 200)
3941
4066
  );
3942
4067
  }, 100);
3943
4068
  return () => clearInterval(y);
3944
4069
  }, []);
3945
4070
  const x = I(!1);
3946
- if (T(() => {
4071
+ if (R(() => {
3947
4072
  !e || x.current || (x.current = !0, e((y) => {
3948
4073
  h.current.push({
3949
- id: Pn++,
4074
+ id: Bn++,
3950
4075
  ts: Date.now(),
3951
4076
  kind: "event",
3952
4077
  type: y.eventName,
3953
4078
  data: y.data
3954
4079
  });
3955
4080
  }));
3956
- }, [e]), T(() => {
3957
- const y = console.warn, w = console.log, R = (S, v) => function(...O) {
4081
+ }, [e]), R(() => {
4082
+ const y = console.warn, w = console.log, T = (S, v) => function(...O) {
3958
4083
  try {
3959
4084
  const g = typeof O[0] == "string" ? O[0] : "";
3960
4085
  g.startsWith("[LiveLayer]") && h.current.push({
3961
- id: Pn++,
4086
+ id: Bn++,
3962
4087
  ts: Date.now(),
3963
4088
  kind: S,
3964
4089
  type: g.slice(0, 120),
3965
- data: { args: O.slice(1).map((D) => Xi(D)) }
4090
+ data: { args: O.slice(1).map((z) => yo(z)) }
3966
4091
  });
3967
4092
  } catch {
3968
4093
  }
3969
4094
  return v.apply(this, O);
3970
4095
  };
3971
- return console.warn = R("warn", y), console.log = R("log", w), () => {
4096
+ return console.warn = T("warn", y), console.log = T("log", w), () => {
3972
4097
  console.warn = y, console.log = w;
3973
4098
  };
3974
4099
  }, []), !i)
@@ -3976,7 +4101,7 @@ function ao({
3976
4101
  "button",
3977
4102
  {
3978
4103
  type: "button",
3979
- onClick: () => a(!0),
4104
+ onClick: () => l(!0),
3980
4105
  title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
3981
4106
  "aria-label": "Open LiveLayer debug panel",
3982
4107
  style: {
@@ -3999,8 +4124,8 @@ function ao({
3999
4124
  }
4000
4125
  );
4001
4126
  const E = o.filter((y) => {
4002
- if (!l) return !0;
4003
- const w = l.toLowerCase();
4127
+ if (!a) return !0;
4128
+ const w = a.toLowerCase();
4004
4129
  return y.type.toLowerCase().includes(w) || JSON.stringify(y.data || {}).toLowerCase().includes(w);
4005
4130
  });
4006
4131
  return /* @__PURE__ */ k(
@@ -4049,7 +4174,7 @@ function ao({
4049
4174
  {
4050
4175
  type: "button",
4051
4176
  onClick: () => m((y) => !y),
4052
- style: jt(u ? "#f59e0b" : "transparent"),
4177
+ style: Xt(u ? "#f59e0b" : "transparent"),
4053
4178
  title: "Pause / resume capture",
4054
4179
  children: u ? "▶ resume" : "⏸ pause"
4055
4180
  }
@@ -4061,7 +4186,7 @@ function ao({
4061
4186
  onClick: () => {
4062
4187
  s([]), h.current = [];
4063
4188
  },
4064
- style: jt("transparent"),
4189
+ style: Xt("transparent"),
4065
4190
  title: "Clear buffer",
4066
4191
  children: "clear"
4067
4192
  }
@@ -4070,8 +4195,8 @@ function ao({
4070
4195
  "button",
4071
4196
  {
4072
4197
  type: "button",
4073
- onClick: () => a(!1),
4074
- style: jt("transparent"),
4198
+ onClick: () => l(!1),
4199
+ style: Xt("transparent"),
4075
4200
  "aria-label": "Close",
4076
4201
  title: "Close (Cmd/Ctrl + Shift + L)",
4077
4202
  children: "✕"
@@ -4084,7 +4209,7 @@ function ao({
4084
4209
  "input",
4085
4210
  {
4086
4211
  type: "text",
4087
- value: l,
4212
+ value: a,
4088
4213
  onChange: (y) => c(y.target.value),
4089
4214
  placeholder: "filter by type or data…",
4090
4215
  style: {
@@ -4138,7 +4263,7 @@ function ao({
4138
4263
  ]
4139
4264
  }
4140
4265
  ) : E.map((y) => /* @__PURE__ */ r(
4141
- Gi,
4266
+ go,
4142
4267
  {
4143
4268
  entry: y,
4144
4269
  expanded: p.current.has(y.id),
@@ -4154,12 +4279,12 @@ function ao({
4154
4279
  }
4155
4280
  );
4156
4281
  }
4157
- function Gi({
4282
+ function go({
4158
4283
  entry: e,
4159
4284
  expanded: t,
4160
4285
  onToggle: n
4161
4286
  }) {
4162
- const i = 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", a = new Date(e.ts).toLocaleTimeString("en-US", {
4287
+ const i = 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", {
4163
4288
  hour12: !1
4164
4289
  });
4165
4290
  return /* @__PURE__ */ k(
@@ -4189,7 +4314,7 @@ function Gi({
4189
4314
  fontVariantNumeric: "tabular-nums",
4190
4315
  fontSize: 10
4191
4316
  },
4192
- children: a
4317
+ children: l
4193
4318
  }
4194
4319
  ),
4195
4320
  /* @__PURE__ */ r(
@@ -4224,7 +4349,7 @@ function Gi({
4224
4349
  }
4225
4350
  );
4226
4351
  }
4227
- function jt(e) {
4352
+ function Xt(e) {
4228
4353
  return {
4229
4354
  background: e,
4230
4355
  color: "#fff",
@@ -4235,29 +4360,29 @@ function jt(e) {
4235
4360
  cursor: "pointer"
4236
4361
  };
4237
4362
  }
4238
- function Xi(e) {
4363
+ function yo(e) {
4239
4364
  try {
4240
4365
  return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
4241
4366
  } catch {
4242
4367
  return String(e);
4243
4368
  }
4244
4369
  }
4245
- function Ki(e) {
4370
+ function vo(e) {
4246
4371
  const t = JSON.stringify(e);
4247
- T(() => hr(e), [t]);
4372
+ R(() => Lr(e), [t]);
4248
4373
  }
4249
- function so({ fields: e, children: t }) {
4250
- return Ki(e), /* @__PURE__ */ r(We, { children: t });
4374
+ function Mo({ fields: e, children: t }) {
4375
+ return vo(e), /* @__PURE__ */ r(We, { children: t });
4251
4376
  }
4252
- function co() {
4253
- const [e, t] = M([]), n = C((a) => {
4377
+ function Io() {
4378
+ const [e, t] = M([]), n = C((l) => {
4254
4379
  t((o) => {
4255
- const s = o.findIndex((l) => l.id === a.id);
4380
+ const s = o.findIndex((a) => a.id === l.id);
4256
4381
  if (s >= 0) {
4257
- const l = o.slice();
4258
- return l[s] = a, l;
4382
+ const a = o.slice();
4383
+ return a[s] = l, a;
4259
4384
  }
4260
- return [...o, a];
4385
+ return [...o, l];
4261
4386
  });
4262
4387
  }, []), i = C(() => t([]), []);
4263
4388
  return {
@@ -4268,38 +4393,38 @@ function co() {
4268
4393
  };
4269
4394
  }
4270
4395
  export {
4271
- Yi as AvatarWidget,
4272
- yr as ErrorBoundary,
4273
- so as FieldProvider,
4274
- ao as LiveLayerDebugPanel,
4275
- oo as LiveLayerRegion,
4276
- io as LiveLayerWidget,
4277
- po as clearFieldRegistry,
4278
- Ei as clearPageContextCache,
4279
- Ti as clearRoutesCache,
4280
- ki as extractPageContext,
4281
- Ii as extractRoutes,
4282
- Mn as getCachedPageContext,
4283
- qt as getCachedRoutes,
4284
- ho as getRegisteredFields,
4285
- Vr as matchesPattern,
4286
- Ai as normalizeRouteInput,
4287
- mo as registerFields,
4288
- go as setFieldValue,
4289
- Yr as shouldRenderAtPath,
4290
- Sr as useAgentInfo,
4291
- br as useAudioLevel,
4292
- Lr as useCameraState,
4293
- lo as useCollect,
4294
- Nr as useDisplayMode,
4295
- Ir as useDisplayModePersistence,
4296
- Tr as useIsMobile,
4297
- vr as useLiveKitSession,
4298
- kr as useMediaDevices,
4299
- _r as useMicrophoneState,
4300
- Wr as usePathname,
4301
- Ki as useRegisterFields,
4302
- Gr as useRouteMatch,
4303
- Cr as useScreenShareState,
4304
- co as useTranscript
4396
+ mo as AvatarWidget,
4397
+ Sr as ErrorBoundary,
4398
+ Mo as FieldProvider,
4399
+ No as LiveLayerDebugPanel,
4400
+ Eo as LiveLayerRegion,
4401
+ So as LiveLayerWidget,
4402
+ Do as clearFieldRegistry,
4403
+ Gi as clearPageContextCache,
4404
+ eo as clearRoutesCache,
4405
+ Vi as extractPageContext,
4406
+ Zi as extractRoutes,
4407
+ $n as getCachedPageContext,
4408
+ Yt as getCachedRoutes,
4409
+ Po as getRegisteredFields,
4410
+ ti as matchesPattern,
4411
+ Ki as normalizeRouteInput,
4412
+ zo as registerFields,
4413
+ $o as setFieldValue,
4414
+ ni as shouldRenderAtPath,
4415
+ Pr as useAgentInfo,
4416
+ Ar as useAudioLevel,
4417
+ Tr as useCameraState,
4418
+ Ao as useCollect,
4419
+ $r as useDisplayMode,
4420
+ Fr as useDisplayModePersistence,
4421
+ Wr as useIsMobile,
4422
+ Er as useLiveKitSession,
4423
+ Dr as useMediaDevices,
4424
+ Mr as useMicrophoneState,
4425
+ Kr as usePathname,
4426
+ vo as useRegisterFields,
4427
+ ri as useRouteMatch,
4428
+ Rr as useScreenShareState,
4429
+ Io as useTranscript
4305
4430
  };