@livelayer/react 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs as w, jsx as n, Fragment as $e } from "react/jsx-runtime";
3
- import { Component as Vn, useState as E, useRef as N, useEffect as R, useCallback as C, useMemo as Xe, useLayoutEffect as xn, forwardRef as Dt, useImperativeHandle as Yn, createElement as Gn } from "react";
4
- import { createPortal as Pt } from "react-dom";
2
+ import { jsxs as b, jsx as n, Fragment as $e } from "react/jsx-runtime";
3
+ import { Component as Vn, useState as S, useRef as A, useEffect as M, useCallback as E, useMemo as Ze, useLayoutEffect as Ln, forwardRef as Pt, useImperativeHandle as Yn, createElement as Gn } from "react";
4
+ import { createPortal as $t } from "react-dom";
5
5
  import { LiveKitSession as Kn, registerFields as Jn } from "@livelayer/sdk";
6
- import { clearFieldRegistry as Oo, getRegisteredFields as Ho, registerFields as Bo, setFieldValue as Wo } from "@livelayer/sdk";
7
- import { createLocalAudioTrack as Xn, Track as kn, createLocalVideoTrack as Qn } from "livekit-client";
8
- class Zn extends Vn {
6
+ import { clearFieldRegistry as Oi, getRegisteredFields as Bi, registerFields as Wi, setFieldValue as Fi } from "@livelayer/sdk";
7
+ import { createLocalAudioTrack as Xn, Track as kn, createLocalVideoTrack as Zn } from "livekit-client";
8
+ class Qn extends Vn {
9
9
  constructor() {
10
10
  super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
11
11
  this.setState({ hasError: !1, error: null });
@@ -15,12 +15,12 @@ class Zn extends Vn {
15
15
  return { hasError: !0, error: t };
16
16
  }
17
17
  componentDidCatch(t, r) {
18
- var o, l;
19
- (l = (o = this.props).onError) == null || l.call(o, t, r);
18
+ var i, a;
19
+ (a = (i = this.props).onError) == null || a.call(i, t, r);
20
20
  }
21
21
  render() {
22
22
  var t;
23
- return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ w("div", { className: "ll-error-boundary", role: "alert", children: [
23
+ return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ b("div", { className: "ll-error-boundary", role: "alert", children: [
24
24
  /* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
25
25
  /* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
26
26
  /* @__PURE__ */ n(
@@ -36,24 +36,24 @@ class Zn extends Vn {
36
36
  }
37
37
  }
38
38
  function er(e) {
39
- const [t, r] = E("idle"), [o, l] = E("idle"), [i, s] = E([]), [a, c] = E(null), [p, v] = E(null), [f, u] = E(null), [I, L] = E(!1), [_, h] = E(null), b = N(null), S = N(e.onDataMessage);
40
- S.current = e.onDataMessage, R(() => {
39
+ const [t, r] = S("idle"), [i, a] = S("idle"), [o, s] = S([]), [l, c] = S(null), [p, v] = S(null), [f, u] = S(null), [R, k] = S(!1), [_, m] = S(null), w = A(null), N = A(e.onDataMessage);
40
+ N.current = e.onDataMessage, M(() => {
41
41
  const g = {
42
- onConnectionStateChange: (H) => {
43
- r(H), H === "connected" && h(null);
42
+ onConnectionStateChange: (O) => {
43
+ r(O), O === "connected" && m(null);
44
44
  },
45
- onAgentStateChange: l,
46
- onTranscript: (H) => s([...H]),
45
+ onAgentStateChange: a,
46
+ onTranscript: (O) => s([...O]),
47
47
  onAgentConfig: c,
48
- onAudioTrack: (H) => u(H),
49
- onVideoTrack: (H) => v(H),
48
+ onAudioTrack: (O) => u(O),
49
+ onVideoTrack: (O) => v(O),
50
50
  onVideoTrackRemoved: () => v(null),
51
- onError: (H) => h(H),
52
- onDataMessage: (H) => {
53
- var F;
54
- (F = S.current) == null || F.call(S, H);
51
+ onError: (O) => m(O),
52
+ onDataMessage: (O) => {
53
+ var q;
54
+ (q = N.current) == null || q.call(N, O);
55
55
  },
56
- onResumabilityChange: L
56
+ onResumabilityChange: k
57
57
  }, P = new Kn(
58
58
  {
59
59
  agentId: e.agentId,
@@ -64,9 +64,9 @@ function er(e) {
64
64
  },
65
65
  g
66
66
  );
67
- return b.current = P, r("idle"), l("idle"), s([]), c(null), v(null), u(null), L(!1), h(null), () => {
68
- var H;
69
- (H = P.destroy) == null || H.call(P), b.current = null;
67
+ return w.current = P, r("idle"), a("idle"), s([]), c(null), v(null), u(null), k(!1), m(null), () => {
68
+ var O;
69
+ (O = P.destroy) == null || O.call(P), w.current = null;
70
70
  };
71
71
  }, [
72
72
  e.agentId,
@@ -75,65 +75,65 @@ function er(e) {
75
75
  e.sessionEndpoint,
76
76
  JSON.stringify(e.sessionBody ?? {})
77
77
  ]);
78
- const T = C(async () => {
79
- const g = b.current;
78
+ const T = E(async () => {
79
+ const g = w.current;
80
80
  if (g)
81
81
  try {
82
82
  await g.connect();
83
83
  } catch (P) {
84
- throw h(P instanceof Error ? P.message : String(P)), P;
84
+ throw m(P instanceof Error ? P.message : String(P)), P;
85
85
  }
86
- }, []), A = C(() => {
87
- const g = b.current;
86
+ }, []), I = E(() => {
87
+ const g = w.current;
88
88
  g && g.disconnect();
89
- }, []), q = C(() => {
89
+ }, []), U = E(() => {
90
90
  var g;
91
- return ((g = b.current) == null ? void 0 : g.getRoom()) ?? null;
91
+ return ((g = w.current) == null ? void 0 : g.getRoom()) ?? null;
92
92
  }, []);
93
93
  return {
94
94
  connectionState: t,
95
- agentState: o,
96
- transcript: i,
97
- agentConfig: a,
95
+ agentState: i,
96
+ transcript: o,
97
+ agentConfig: l,
98
98
  videoElement: p,
99
99
  audioElement: f,
100
- canResume: I,
100
+ canResume: R,
101
101
  error: _,
102
102
  connect: T,
103
- disconnect: A,
104
- getRoom: q,
105
- session: b.current
103
+ disconnect: I,
104
+ getRoom: U,
105
+ session: w.current
106
106
  };
107
107
  }
108
108
  function tr() {
109
- const e = N(null), t = N(null), r = N(null), o = N(null), l = N(/* @__PURE__ */ new Set()), i = N(null), s = C(() => {
109
+ const e = A(null), t = A(null), r = A(null), i = A(null), a = A(/* @__PURE__ */ new Set()), o = A(null), s = E(() => {
110
110
  const f = t.current;
111
111
  if (!f) {
112
- o.current = null;
112
+ i.current = null;
113
113
  return;
114
114
  }
115
- (!i.current || i.current.length !== f.frequencyBinCount) && (i.current = new Uint8Array(
115
+ (!o.current || o.current.length !== f.frequencyBinCount) && (o.current = new Uint8Array(
116
116
  new ArrayBuffer(f.frequencyBinCount)
117
117
  ));
118
- const u = i.current;
118
+ const u = o.current;
119
119
  f.getByteFrequencyData(u);
120
- let I = 0;
121
- for (let _ = 0; _ < u.length; _++) I += u[_];
122
- const L = I / u.length / 255;
123
- for (const _ of l.current)
120
+ let R = 0;
121
+ for (let _ = 0; _ < u.length; _++) R += u[_];
122
+ const k = R / u.length / 255;
123
+ for (const _ of a.current)
124
124
  try {
125
- _(L);
126
- } catch (h) {
127
- console.error("[useAudioLevel] subscriber threw:", h);
125
+ _(k);
126
+ } catch (m) {
127
+ console.error("[useAudioLevel] subscriber threw:", m);
128
128
  }
129
- o.current = requestAnimationFrame(s);
130
- }, []), a = C(() => {
129
+ i.current = requestAnimationFrame(s);
130
+ }, []), l = E(() => {
131
131
  if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
132
132
  const f = new AudioContext(), u = f.createAnalyser();
133
133
  u.fftSize = 64, u.connect(f.destination), e.current = f, t.current = u;
134
- }, []), c = C(
134
+ }, []), c = E(
135
135
  (f) => {
136
- if (a(), !(!e.current || !t.current)) {
136
+ if (l(), !(!e.current || !t.current)) {
137
137
  if (r.current) {
138
138
  try {
139
139
  r.current.disconnect();
@@ -148,22 +148,22 @@ function tr() {
148
148
  console.warn("[useAudioLevel] createMediaElementSource failed:", u);
149
149
  return;
150
150
  }
151
- o.current === null && (o.current = requestAnimationFrame(s));
151
+ i.current === null && (i.current = requestAnimationFrame(s));
152
152
  }
153
153
  },
154
- [a, s]
155
- ), p = C(() => {
156
- if (o.current !== null && (cancelAnimationFrame(o.current), o.current = null), r.current) {
154
+ [l, s]
155
+ ), p = E(() => {
156
+ if (i.current !== null && (cancelAnimationFrame(i.current), i.current = null), r.current) {
157
157
  try {
158
158
  r.current.disconnect();
159
159
  } catch {
160
160
  }
161
161
  r.current = null;
162
162
  }
163
- }, []), v = C((f) => (l.current.add(f), () => {
164
- l.current.delete(f);
163
+ }, []), v = E((f) => (a.current.add(f), () => {
164
+ a.current.delete(f);
165
165
  }), []);
166
- return R(() => () => {
166
+ return M(() => () => {
167
167
  if (p(), t.current) {
168
168
  try {
169
169
  t.current.disconnect();
@@ -178,84 +178,84 @@ function tr() {
178
178
  }
179
179
  e.current = null;
180
180
  }
181
- l.current.clear(), i.current = null;
181
+ a.current.clear(), o.current = null;
182
182
  }, [p]), { attach: c, detach: p, subscribe: v };
183
183
  }
184
184
  function nr() {
185
- const [e, t] = E(!1), [r, o] = E(""), [l, i] = E(null), s = N(null), a = N(null), c = C(async (L) => {
186
- var _, h;
187
- if (s.current && a.current) {
185
+ const [e, t] = S(!1), [r, i] = S(""), [a, o] = S(null), s = A(null), l = A(null), c = E(async (k) => {
186
+ var _, m;
187
+ if (s.current && l.current) {
188
188
  try {
189
- await a.current.localParticipant.unpublishTrack(s.current);
189
+ await l.current.localParticipant.unpublishTrack(s.current);
190
190
  } catch {
191
191
  }
192
192
  s.current.stop(), s.current = null;
193
193
  }
194
- a.current = L, i(null);
194
+ l.current = k, o(null);
195
195
  try {
196
- const b = await Xn({
196
+ const w = await Xn({
197
197
  echoCancellation: !0,
198
198
  noiseSuppression: !0
199
199
  });
200
- await L.localParticipant.publishTrack(b), s.current = b, t(b.isMuted);
201
- const S = (h = (_ = b.mediaStreamTrack) == null ? void 0 : _.getSettings) == null ? void 0 : h.call(_);
202
- S != null && S.deviceId && o(S.deviceId);
203
- } catch (b) {
204
- const S = b instanceof Error && b.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
205
- throw i(S), b;
200
+ await k.localParticipant.publishTrack(w), s.current = w, t(w.isMuted);
201
+ const N = (m = (_ = w.mediaStreamTrack) == null ? void 0 : _.getSettings) == null ? void 0 : m.call(_);
202
+ N != null && N.deviceId && i(N.deviceId);
203
+ } catch (w) {
204
+ const N = w instanceof Error && w.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
205
+ throw o(N), w;
206
206
  }
207
- }, []), p = C((L) => {
208
- a.current = L;
209
- }, []), v = C(async (L) => {
210
- const _ = a.current;
207
+ }, []), p = E((k) => {
208
+ l.current = k;
209
+ }, []), v = E(async (k) => {
210
+ const _ = l.current;
211
211
  if (_)
212
212
  try {
213
- await _.switchActiveDevice("audioinput", L), o(L);
214
- } catch (h) {
215
- console.warn("[useMicrophoneState] switchDevice failed:", h);
213
+ await _.switchActiveDevice("audioinput", k), i(k);
214
+ } catch (m) {
215
+ console.warn("[useMicrophoneState] switchDevice failed:", m);
216
216
  }
217
- }, []), f = C(async () => {
218
- const L = a.current, _ = !e;
219
- if (t(_), !!L)
217
+ }, []), f = E(async () => {
218
+ const k = l.current, _ = !e;
219
+ if (t(_), !!k)
220
220
  try {
221
- await L.localParticipant.setMicrophoneEnabled(!_);
222
- } catch (h) {
223
- console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", h), t(!_);
221
+ await k.localParticipant.setMicrophoneEnabled(!_);
222
+ } catch (m) {
223
+ console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", m), t(!_);
224
224
  }
225
- }, [e]), u = C(() => {
226
- const L = s.current, _ = a.current;
227
- if (L && _) {
225
+ }, [e]), u = E(() => {
226
+ const k = s.current, _ = l.current;
227
+ if (k && _) {
228
228
  try {
229
- _.localParticipant.unpublishTrack(L);
229
+ _.localParticipant.unpublishTrack(k);
230
230
  } catch {
231
231
  }
232
- L.stop();
232
+ k.stop();
233
233
  }
234
- s.current = null, a.current = null, t(!1), o("");
235
- }, []), I = C(() => i(null), []);
234
+ s.current = null, l.current = null, t(!1), i("");
235
+ }, []), R = E(() => o(null), []);
236
236
  return {
237
237
  isMuted: e,
238
238
  activeDeviceId: r,
239
- micError: l,
239
+ micError: a,
240
240
  toggleMute: f,
241
241
  setupMic: c,
242
242
  attachRoom: p,
243
243
  switchDevice: v,
244
244
  teardownMic: u,
245
- clearError: I
245
+ clearError: R
246
246
  };
247
247
  }
248
248
  const rr = { resolution: { width: 640, height: 480, frameRate: 24 } };
249
- function or() {
250
- const [e, t] = E(!1), [r, o] = E(null), [l, i] = E(null), [s, a] = E(""), c = N(null), p = N(null), v = C((b) => {
251
- c.current = b;
252
- }, []), f = C(() => {
249
+ function ir() {
250
+ const [e, t] = S(!1), [r, i] = S(null), [a, o] = S(null), [s, l] = S(""), c = A(null), p = A(null), v = E((w) => {
251
+ c.current = w;
252
+ }, []), f = E(() => {
253
253
  var T;
254
- const b = c.current, S = p.current;
255
- if (S && b) {
256
- const A = b.localParticipant.getTrackPublication(kn.Source.Camera), g = (A == null ? void 0 : A.track) ?? S;
254
+ const w = c.current, N = p.current;
255
+ if (N && w) {
256
+ const I = w.localParticipant.getTrackPublication(kn.Source.Camera), g = (I == null ? void 0 : I.track) ?? N;
257
257
  try {
258
- b.localParticipant.unpublishTrack(g);
258
+ w.localParticipant.unpublishTrack(g);
259
259
  } catch {
260
260
  }
261
261
  try {
@@ -263,55 +263,55 @@ function or() {
263
263
  } catch {
264
264
  }
265
265
  }
266
- p.current = null, i(null), t(!1);
267
- }, []), u = C(async (b) => {
268
- const S = c.current;
269
- if (S) {
270
- o(null);
266
+ p.current = null, o(null), t(!1);
267
+ }, []), u = E(async (w) => {
268
+ const N = c.current;
269
+ if (N) {
270
+ i(null);
271
271
  try {
272
272
  const T = { ...rr };
273
- b && (T.deviceId = b);
274
- const A = await Qn(T);
275
- await S.localParticipant.publishTrack(A), p.current = A;
276
- const q = A.attach();
277
- i(q), t(!0), b && a(b);
273
+ w && (T.deviceId = w);
274
+ const I = await Zn(T);
275
+ await N.localParticipant.publishTrack(I), p.current = I;
276
+ const U = I.attach();
277
+ o(U), t(!0), w && l(w);
278
278
  try {
279
- S.localParticipant.publishData(
279
+ N.localParticipant.publishData(
280
280
  new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
281
281
  { reliable: !0 }
282
282
  );
283
283
  } catch {
284
284
  }
285
285
  } catch (T) {
286
- const A = T instanceof Error && T.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
287
- o(A);
286
+ const I = T instanceof Error && T.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
287
+ i(I);
288
288
  }
289
289
  }
290
- }, []), I = C(async () => {
290
+ }, []), R = E(async () => {
291
291
  e ? f() : await u(s || void 0);
292
- }, [e, s, f, u]), L = C(async (b) => {
293
- f(), await u(b);
294
- }, [f, u]), _ = C(() => {
295
- f(), c.current = null, o(null), a("");
296
- }, [f]), h = C(() => o(null), []);
297
- return R(() => () => {
292
+ }, [e, s, f, u]), k = E(async (w) => {
293
+ f(), await u(w);
294
+ }, [f, u]), _ = E(() => {
295
+ f(), c.current = null, i(null), l("");
296
+ }, [f]), m = E(() => i(null), []);
297
+ return M(() => () => {
298
298
  p.current && p.current.stop();
299
299
  }, []), {
300
300
  isEnabled: e,
301
301
  error: r,
302
- previewEl: l,
302
+ previewEl: a,
303
303
  activeDeviceId: s,
304
- toggle: I,
305
- switchDevice: L,
304
+ toggle: R,
305
+ switchDevice: k,
306
306
  attachRoom: v,
307
307
  teardown: _,
308
- clearError: h
308
+ clearError: m
309
309
  };
310
310
  }
311
- function ir() {
312
- const [e, t] = E(!1), [r, o] = E(null), [l, i] = E(null), s = N(null), a = C((u) => {
311
+ function or() {
312
+ const [e, t] = S(!1), [r, i] = S(null), [a, o] = S(null), s = A(null), l = E((u) => {
313
313
  s.current = u;
314
- }, []), c = C(() => i(null), []), p = C(async () => {
314
+ }, []), c = E(() => o(null), []), p = E(async () => {
315
315
  const u = s.current;
316
316
  if (u) {
317
317
  if (e) {
@@ -322,15 +322,15 @@ function ir() {
322
322
  c(), t(!1);
323
323
  return;
324
324
  }
325
- o(null);
325
+ i(null);
326
326
  try {
327
327
  await u.localParticipant.setScreenShareEnabled(!0);
328
- let I = 0;
329
- const L = () => {
328
+ let R = 0;
329
+ const k = () => {
330
330
  const _ = u.localParticipant.getTrackPublication(kn.Source.ScreenShare);
331
331
  if (_ != null && _.track) {
332
- const h = _.track.attach();
333
- i(h), t(!0);
332
+ const m = _.track.attach();
333
+ o(m), t(!0);
334
334
  try {
335
335
  u.localParticipant.publishData(
336
336
  new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
@@ -340,43 +340,43 @@ function ir() {
340
340
  }
341
341
  return;
342
342
  }
343
- I++ < 10 ? setTimeout(L, 100) : t(!0);
343
+ R++ < 10 ? setTimeout(k, 100) : t(!0);
344
344
  };
345
- L();
346
- } catch (I) {
347
- const L = I instanceof Error ? I.name : "";
348
- L !== "NotAllowedError" && L !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
345
+ k();
346
+ } catch (R) {
347
+ const k = R instanceof Error ? R.name : "";
348
+ k !== "NotAllowedError" && k !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
349
349
  }
350
350
  }
351
- }, [e, c]), v = C(() => {
351
+ }, [e, c]), v = E(() => {
352
352
  const u = s.current;
353
353
  if (u && e)
354
354
  try {
355
355
  u.localParticipant.setScreenShareEnabled(!1);
356
356
  } catch {
357
357
  }
358
- c(), t(!1), o(null), s.current = null;
359
- }, [e, c]), f = C(() => o(null), []);
360
- return { isEnabled: e, error: r, previewEl: l, toggle: p, attachRoom: a, teardown: v, clearError: f };
358
+ c(), t(!1), i(null), s.current = null;
359
+ }, [e, c]), f = E(() => i(null), []);
360
+ return { isEnabled: e, error: r, previewEl: a, toggle: p, attachRoom: l, teardown: v, clearError: f };
361
361
  }
362
362
  function lr() {
363
- const [e, t] = E([]), [r, o] = E([]), l = C(async () => {
363
+ const [e, t] = S([]), [r, i] = S([]), a = E(async () => {
364
364
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
365
365
  try {
366
- const i = await navigator.mediaDevices.enumerateDevices();
367
- t(i.filter((s) => s.kind === "audioinput")), o(i.filter((s) => s.kind === "videoinput"));
366
+ const o = await navigator.mediaDevices.enumerateDevices();
367
+ t(o.filter((s) => s.kind === "audioinput")), i(o.filter((s) => s.kind === "videoinput"));
368
368
  } catch {
369
369
  }
370
370
  }, []);
371
- return R(() => {
372
- if (l(), typeof navigator > "u" || !navigator.mediaDevices) return;
373
- const i = () => void l();
374
- return navigator.mediaDevices.addEventListener("devicechange", i), () => navigator.mediaDevices.removeEventListener("devicechange", i);
375
- }, [l]), { mics: e, cameras: r, refresh: l };
371
+ return M(() => {
372
+ if (a(), typeof navigator > "u" || !navigator.mediaDevices) return;
373
+ const o = () => void a();
374
+ return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
375
+ }, [a]), { mics: e, cameras: r, refresh: a };
376
376
  }
377
377
  function ar(e, t, r = !1) {
378
- const [o, l] = E(null), [i, s] = E(null), [a, c] = E(!r && !!e);
379
- return R(() => {
378
+ const [i, a] = S(null), [o, s] = S(null), [l, c] = S(!r && !!e);
379
+ return M(() => {
380
380
  if (r || !e) {
381
381
  c(!1);
382
382
  return;
@@ -391,11 +391,11 @@ function ar(e, t, r = !1) {
391
391
  }
392
392
  return f.json();
393
393
  }).then((f) => {
394
- p.signal.aborted || (l(f), c(!1));
394
+ p.signal.aborted || (a(f), c(!1));
395
395
  }).catch((f) => {
396
396
  p.signal.aborted || (s(f instanceof Error ? f.message : "Agent lookup failed"), c(!1));
397
397
  }), () => p.abort();
398
- }, [e, t, r]), { info: o, error: i, loading: a };
398
+ }, [e, t, r]), { info: i, error: o, loading: l };
399
399
  }
400
400
  function sr(e) {
401
401
  if (typeof window > "u") return null;
@@ -417,13 +417,13 @@ function dr({
417
417
  defaultValue: t = "expanded",
418
418
  onChange: r
419
419
  } = {}) {
420
- const o = e !== void 0, [l, i] = E(t), s = o ? e : l, a = C(
420
+ const i = e !== void 0, [a, o] = S(t), s = i ? e : a, l = E(
421
421
  (c) => {
422
- c !== s && (o || i(c), r == null || r(c));
422
+ c !== s && (i || o(c), r == null || r(c));
423
423
  },
424
- [s, o, r]
424
+ [s, i, r]
425
425
  );
426
- return [s, a];
426
+ return [s, l];
427
427
  }
428
428
  const ur = ["hidden", "minimized", "expanded"];
429
429
  function fr(e) {
@@ -433,75 +433,75 @@ function pr({
433
433
  value: e,
434
434
  defaultValue: t = "expanded",
435
435
  onChange: r,
436
- persistKey: o = "ll-widget",
437
- disablePersistence: l = !1
436
+ persistKey: i = "ll-widget",
437
+ disablePersistence: a = !1
438
438
  } = {}) {
439
- const i = `${o}:display-mode`, s = N(!1), [a, c] = dr({
439
+ const o = `${i}:display-mode`, s = A(!1), [l, c] = dr({
440
440
  value: e,
441
441
  defaultValue: t,
442
442
  onChange: (p) => {
443
- e === void 0 && !l && cr(i, p), r == null || r(p);
443
+ e === void 0 && !a && cr(o, p), r == null || r(p);
444
444
  }
445
445
  });
446
- return R(() => {
447
- if (s.current || (s.current = !0, l || e !== void 0)) return;
448
- const p = fr(sr(i));
449
- p && p !== a && c(p);
450
- }, []), [a, c];
446
+ return M(() => {
447
+ if (s.current || (s.current = !0, a || e !== void 0)) return;
448
+ const p = fr(sr(o));
449
+ p && p !== l && c(p);
450
+ }, []), [l, c];
451
451
  }
452
452
  const hr = 640;
453
453
  function mr(e = hr) {
454
- const [t, r] = E(!1);
455
- return R(() => {
454
+ const [t, r] = S(!1);
455
+ return M(() => {
456
456
  if (e === !1) {
457
457
  r(!1);
458
458
  return;
459
459
  }
460
460
  if (typeof window > "u" || typeof window.matchMedia > "u")
461
461
  return;
462
- const o = `(max-width: ${e - 1}px)`, l = window.matchMedia(o), i = () => r(l.matches);
463
- return i(), typeof l.addEventListener == "function" ? (l.addEventListener("change", i), () => l.removeEventListener("change", i)) : (l.addListener(i), () => {
464
- l.removeListener(i);
462
+ const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i), o = () => r(a.matches);
463
+ return o(), typeof a.addEventListener == "function" ? (a.addEventListener("change", o), () => a.removeEventListener("change", o)) : (a.addListener(o), () => {
464
+ a.removeListener(o);
465
465
  });
466
466
  }, [e]), t;
467
467
  }
468
- const en = "__llHistoryPatched", _t = "ll:pathname";
468
+ const tn = "__llHistoryPatched", xt = "ll:pathname";
469
469
  function gr() {
470
- if (typeof window > "u" || window.history[en]) return;
470
+ if (typeof window > "u" || window.history[tn]) return;
471
471
  const e = window.history.pushState, t = window.history.replaceState;
472
472
  window.history.pushState = function(...r) {
473
- const o = e.apply(this, r);
474
- return window.dispatchEvent(new Event(_t)), o;
473
+ const i = e.apply(this, r);
474
+ return window.dispatchEvent(new Event(xt)), i;
475
475
  }, window.history.replaceState = function(...r) {
476
- const o = t.apply(this, r);
477
- return window.dispatchEvent(new Event(_t)), o;
478
- }, window.history[en] = !0;
476
+ const i = t.apply(this, r);
477
+ return window.dispatchEvent(new Event(xt)), i;
478
+ }, window.history[tn] = !0;
479
479
  }
480
- function tn() {
480
+ function nn() {
481
481
  return typeof window > "u" ? "/" : window.location.pathname || "/";
482
482
  }
483
483
  function yr(e) {
484
- const [t, r] = E(
485
- () => e ?? tn()
484
+ const [t, r] = S(
485
+ () => e ?? nn()
486
486
  );
487
- return R(() => {
487
+ return M(() => {
488
488
  if (e !== void 0) return;
489
489
  gr();
490
- const o = () => r(tn());
491
- return o(), window.addEventListener("popstate", o), window.addEventListener(_t, o), () => {
492
- window.removeEventListener("popstate", o), window.removeEventListener(_t, o);
490
+ const i = () => r(nn());
491
+ return i(), window.addEventListener("popstate", i), window.addEventListener(xt, i), () => {
492
+ window.removeEventListener("popstate", i), window.removeEventListener(xt, i);
493
493
  };
494
494
  }, [e]), e ?? t;
495
495
  }
496
- const nn = /* @__PURE__ */ new Map(), vr = /[\\^$+?.()|{}[\]]/g;
496
+ const rn = /* @__PURE__ */ new Map(), vr = /[\\^$+?.()|{}[\]]/g;
497
497
  function br(e) {
498
498
  return e.replace(vr, "\\$&");
499
499
  }
500
500
  function wr(e) {
501
- const t = nn.get(e);
501
+ const t = rn.get(e);
502
502
  if (t) return t;
503
- const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", l = "", i = r.replace(/\*\*/g, o).replace(/\*/g, l), a = br(i).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
504
- return nn.set(e, c), c;
503
+ const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", a = "", o = r.replace(/\*\*/g, i).replace(/\*/g, a), l = br(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
504
+ return rn.set(e, c), c;
505
505
  }
506
506
  function _r(e, t) {
507
507
  const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
@@ -510,18 +510,18 @@ function _r(e, t) {
510
510
  function xr(e, t) {
511
511
  return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : _r(e, t);
512
512
  }
513
- function rn(e, t) {
513
+ function on(e, t) {
514
514
  if (!e || e.length === 0) return !1;
515
515
  for (const r of e)
516
516
  if (xr(r, t)) return !0;
517
517
  return !1;
518
518
  }
519
- function kr(e, t, r) {
520
- return e === void 0 ? !0 : rn(r, e) ? !1 : t && t.length > 0 ? rn(t, e) : !0;
521
- }
522
519
  function Lr(e, t, r) {
523
- return Xe(
524
- () => kr(e, t, r),
520
+ return e === void 0 ? !0 : on(r, e) ? !1 : t && t.length > 0 ? on(t, e) : !0;
521
+ }
522
+ function kr(e, t, r) {
523
+ return Ze(
524
+ () => Lr(e, t, r),
525
525
  [e, t, r]
526
526
  );
527
527
  }
@@ -533,7 +533,7 @@ function Cr(e) {
533
533
  };
534
534
  }
535
535
  function Er(e) {
536
- const t = Xe(() => Cr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), o = N(null), l = C(
536
+ const t = Ze(() => Cr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), i = A(null), a = E(
537
537
  (c) => {
538
538
  try {
539
539
  new Audio(`${r}${c}`).play().catch(() => {
@@ -542,55 +542,55 @@ function Er(e) {
542
542
  }
543
543
  },
544
544
  [r]
545
- ), i = C(() => {
546
- t.navigate && l("/audio/page-change-sound.mp3");
547
- }, [t.navigate, l]), s = C(() => {
548
- t.action && l("/audio/confirmation-sound.mp3");
549
- }, [t.action, l]), a = C(
545
+ ), o = E(() => {
546
+ t.navigate && a("/audio/page-change-sound.mp3");
547
+ }, [t.navigate, a]), s = E(() => {
548
+ t.action && a("/audio/confirmation-sound.mp3");
549
+ }, [t.action, a]), l = E(
550
550
  (c) => {
551
551
  if (!t.thinking) {
552
- if (o.current) {
552
+ if (i.current) {
553
553
  try {
554
- o.current.pause();
554
+ i.current.pause();
555
555
  } catch {
556
556
  }
557
- o.current = null;
557
+ i.current = null;
558
558
  }
559
559
  return;
560
560
  }
561
561
  if (c) {
562
- if (o.current) return;
562
+ if (i.current) return;
563
563
  try {
564
564
  const p = new Audio(`${r}/audio/thinking-sound.mp3`);
565
565
  p.loop = !0, p.volume = 0.3, p.play().catch(() => {
566
- o.current = null;
567
- }), o.current = p;
566
+ i.current = null;
567
+ }), i.current = p;
568
568
  } catch {
569
569
  }
570
- } else if (o.current) {
570
+ } else if (i.current) {
571
571
  try {
572
- o.current.pause();
572
+ i.current.pause();
573
573
  } catch {
574
574
  }
575
- o.current = null;
575
+ i.current = null;
576
576
  }
577
577
  },
578
578
  [r, t.thinking]
579
579
  );
580
- return R(() => () => {
581
- if (o.current) {
580
+ return M(() => () => {
581
+ if (i.current) {
582
582
  try {
583
- o.current.pause();
583
+ i.current.pause();
584
584
  } catch {
585
585
  }
586
- o.current = null;
586
+ i.current = null;
587
587
  }
588
- }, []), Xe(
589
- () => ({ playPageChange: i, playConfirmation: s, setThinking: a }),
590
- [i, s, a]
588
+ }, []), Ze(
589
+ () => ({ playPageChange: o, playConfirmation: s, setThinking: l }),
590
+ [o, s, l]
591
591
  );
592
592
  }
593
- const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
593
+ const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ b(
594
594
  "svg",
595
595
  {
596
596
  className: t,
@@ -636,7 +636,7 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
636
636
  }
637
637
  )
638
638
  }
639
- ), ln = ({ className: e }) => /* @__PURE__ */ n(
639
+ ), an = ({ className: e }) => /* @__PURE__ */ n(
640
640
  "svg",
641
641
  {
642
642
  className: e,
@@ -670,7 +670,7 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
670
670
  right: 0,
671
671
  up: -90,
672
672
  down: 90
673
- }, an = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
673
+ }, sn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
674
674
  "svg",
675
675
  {
676
676
  className: t,
@@ -686,11 +686,11 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
686
686
  function Ar(e) {
687
687
  return e === "top-left" || e === "bottom-left" ? "left" : "right";
688
688
  }
689
- const Ln = "ll-hidden-tab-center-y", Ir = 5, sn = 16;
689
+ const Cn = "ll-hidden-tab-center-y", Ir = 5, cn = 16;
690
690
  function Rr() {
691
691
  if (typeof window > "u") return null;
692
692
  try {
693
- const e = window.localStorage.getItem(Ln);
693
+ const e = window.localStorage.getItem(Cn);
694
694
  if (!e) return null;
695
695
  const t = Number.parseFloat(e);
696
696
  return Number.isFinite(t) ? t : null;
@@ -698,10 +698,10 @@ function Rr() {
698
698
  return null;
699
699
  }
700
700
  }
701
- function cn(e) {
701
+ function dn(e) {
702
702
  if (!(typeof window > "u"))
703
703
  try {
704
- window.localStorage.setItem(Ln, String(e));
704
+ window.localStorage.setItem(Cn, String(e));
705
705
  } catch {
706
706
  }
707
707
  }
@@ -709,87 +709,87 @@ const Mr = ({
709
709
  position: e,
710
710
  isMobile: t,
711
711
  isSpeaking: r,
712
- onExpand: o,
713
- label: l = "Open widget",
714
- avatarImageUrl: i,
712
+ onExpand: i,
713
+ label: a = "Open widget",
714
+ avatarImageUrl: o,
715
715
  agentName: s,
716
- containerEl: a
716
+ containerEl: l
717
717
  }) => {
718
- const c = Ar(e), p = c === "right" ? "left" : "right", v = t ? 80 : 72, f = !!i, u = !!a, [I, L] = E(null), [_, h] = E(!1), b = N(null), S = N(!1), T = C(
718
+ const c = Ar(e), p = c === "right" ? "left" : "right", v = t ? 80 : 72, f = !!o, u = !!l, [R, k] = S(null), [_, m] = S(!1), w = A(null), N = A(!1), T = E(
719
719
  (B) => {
720
720
  if (typeof window > "u") return B;
721
- const U = v / 2, M = sn + U, J = window.innerHeight - sn - U;
722
- return J < M ? Math.max(M, B) : Math.max(M, Math.min(J, B));
721
+ const j = v / 2, C = cn + j, Z = window.innerHeight - cn - j;
722
+ return Z < C ? Math.max(C, B) : Math.max(C, Math.min(Z, B));
723
723
  },
724
724
  [v]
725
725
  );
726
- R(() => {
726
+ M(() => {
727
727
  if (u) {
728
- L(null);
728
+ k(null);
729
729
  return;
730
730
  }
731
731
  const B = Rr();
732
- L(T(B ?? window.innerHeight / 2));
733
- const U = () => {
734
- L((M) => M === null ? null : T(M));
732
+ k(T(B ?? window.innerHeight / 2));
733
+ const j = () => {
734
+ k((C) => C === null ? null : T(C));
735
735
  };
736
- return window.addEventListener("resize", U), () => window.removeEventListener("resize", U);
736
+ return window.addEventListener("resize", j), () => window.removeEventListener("resize", j);
737
737
  }, [T, u]);
738
- const A = C(
738
+ const I = E(
739
739
  (B) => {
740
- if (!u && !(B.pointerType === "mouse" && B.button !== 0) && I !== null) {
740
+ if (!u && !(B.pointerType === "mouse" && B.button !== 0) && R !== null) {
741
741
  try {
742
742
  B.currentTarget.setPointerCapture(B.pointerId);
743
743
  } catch {
744
744
  }
745
- b.current = {
745
+ w.current = {
746
746
  startClientY: B.clientY,
747
- startCenterY: I,
747
+ startCenterY: R,
748
748
  moved: !1
749
749
  };
750
750
  }
751
751
  },
752
- [I, u]
753
- ), q = C(
752
+ [R, u]
753
+ ), U = E(
754
754
  (B) => {
755
- const U = b.current;
756
- if (!U) return;
757
- const M = B.clientY - U.startClientY;
758
- !U.moved && Math.abs(M) > Ir && (U.moved = !0, h(!0)), U.moved && L(T(U.startCenterY + M));
755
+ const j = w.current;
756
+ if (!j) return;
757
+ const C = B.clientY - j.startClientY;
758
+ !j.moved && Math.abs(C) > Ir && (j.moved = !0, m(!0)), j.moved && k(T(j.startCenterY + C));
759
759
  },
760
760
  [T]
761
- ), g = C(
761
+ ), g = E(
762
762
  (B) => {
763
- const U = b.current;
764
- if (U) {
763
+ const j = w.current;
764
+ if (j) {
765
765
  try {
766
766
  B.currentTarget.releasePointerCapture(B.pointerId);
767
767
  } catch {
768
768
  }
769
- b.current = null, U.moved && (h(!1), S.current = !0, L((M) => (M !== null && cn(M), M)));
769
+ w.current = null, j.moved && (m(!1), N.current = !0, k((C) => (C !== null && dn(C), C)));
770
770
  }
771
771
  },
772
772
  []
773
- ), P = C(() => {
774
- if (S.current) {
775
- S.current = !1;
773
+ ), P = E(() => {
774
+ if (N.current) {
775
+ N.current = !1;
776
776
  return;
777
777
  }
778
- o();
779
- }, [o]), H = C(
778
+ i();
779
+ }, [i]), O = E(
780
780
  (B) => {
781
781
  if (B.key === "ArrowUp" || B.key === "ArrowDown") {
782
782
  B.preventDefault();
783
- const U = B.key === "ArrowUp" ? -8 : 8;
784
- L((M) => {
785
- if (M === null) return M;
786
- const J = T(M + U);
787
- return cn(J), J;
783
+ const j = B.key === "ArrowUp" ? -8 : 8;
784
+ k((C) => {
785
+ if (C === null) return C;
786
+ const Z = T(C + j);
787
+ return dn(Z), Z;
788
788
  });
789
789
  }
790
790
  },
791
791
  [T]
792
- ), F = [
792
+ ), q = [
793
793
  "ll-hidden",
794
794
  `ll-hidden--${c}`,
795
795
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
@@ -797,29 +797,29 @@ const Mr = ({
797
797
  _ ? "is-dragging" : null,
798
798
  f ? "ll-hidden--with-avatar" : null,
799
799
  u ? "ll-hidden--scoped" : null
800
- ].filter(Boolean).join(" "), ee = I === null ? void 0 : { top: `${I - v / 2}px`, transform: "none" };
800
+ ].filter(Boolean).join(" "), ne = R === null ? void 0 : { top: `${R - v / 2}px`, transform: "none" };
801
801
  return /* @__PURE__ */ n(
802
802
  "button",
803
803
  {
804
804
  type: "button",
805
- className: F,
806
- onPointerDown: A,
807
- onPointerMove: q,
805
+ className: q,
806
+ onPointerDown: I,
807
+ onPointerMove: U,
808
808
  onPointerUp: g,
809
809
  onPointerCancel: g,
810
810
  onClick: P,
811
- onKeyDown: H,
812
- "aria-label": l,
811
+ onKeyDown: O,
812
+ "aria-label": a,
813
813
  "data-position": e,
814
- style: ee,
814
+ style: ne,
815
815
  children: f ? (
816
816
  // Layout: tiny chevron flush against the inward edge (peeks out
817
817
  // as the click affordance), then the circular avatar photo
818
818
  // taking the rest of the tab. Reinforces "this is an
819
819
  // avatar-based experience" even when collapsed.
820
- /* @__PURE__ */ w($e, { children: [
820
+ /* @__PURE__ */ b($e, { children: [
821
821
  /* @__PURE__ */ n(
822
- an,
822
+ sn,
823
823
  {
824
824
  direction: p,
825
825
  className: "ll-hidden__chevron ll-hidden__chevron--mini"
@@ -828,7 +828,7 @@ const Mr = ({
828
828
  /* @__PURE__ */ n(
829
829
  "img",
830
830
  {
831
- src: i,
831
+ src: o,
832
832
  alt: s ? `${s} avatar` : "Agent avatar",
833
833
  className: "ll-hidden__avatar",
834
834
  draggable: !1
@@ -836,7 +836,7 @@ const Mr = ({
836
836
  )
837
837
  ] })
838
838
  ) : /* @__PURE__ */ n(
839
- an,
839
+ sn,
840
840
  {
841
841
  direction: p,
842
842
  className: "ll-hidden__chevron"
@@ -848,31 +848,31 @@ const Mr = ({
848
848
  audioLevel: e,
849
849
  bars: t = 20,
850
850
  maxHeight: r = 20,
851
- minHeight: o = 4,
852
- className: l,
853
- barClassName: i
851
+ minHeight: i = 4,
852
+ className: a,
853
+ barClassName: o
854
854
  }) => {
855
- const s = N(null), a = N([]), c = Xe(() => {
855
+ const s = A(null), l = A([]), c = Ze(() => {
856
856
  const v = (Math.sqrt(5) - 1) / 2;
857
857
  return Array.from({ length: t }, (f, u) => 0.5 + u * v % 1 * 0.5);
858
858
  }, [t]);
859
- R(() => e.subscribe((f) => {
859
+ M(() => e.subscribe((f) => {
860
860
  for (let u = 0; u < t; u++) {
861
- const I = a.current[u];
862
- if (!I) continue;
863
- const L = Math.max(o, f * r * c[u]);
864
- I.style.height = `${L}px`;
861
+ const R = l.current[u];
862
+ if (!R) continue;
863
+ const k = Math.max(i, f * r * c[u]);
864
+ R.style.height = `${k}px`;
865
865
  }
866
- }), [e, t, r, o, c]);
867
- const p = ["ll-waveform", l].filter(Boolean).join(" ");
866
+ }), [e, t, r, i, c]);
867
+ const p = ["ll-waveform", a].filter(Boolean).join(" ");
868
868
  return /* @__PURE__ */ n("div", { ref: s, className: p, "aria-hidden": "true", children: Array.from({ length: t }, (v, f) => /* @__PURE__ */ n(
869
869
  "div",
870
870
  {
871
871
  ref: (u) => {
872
- a.current[f] = u;
872
+ l.current[f] = u;
873
873
  },
874
- className: ["ll-waveform__bar", i].filter(Boolean).join(" "),
875
- style: { height: `${o}px` }
874
+ className: ["ll-waveform__bar", o].filter(Boolean).join(" "),
875
+ style: { height: `${i}px` }
876
876
  },
877
877
  f
878
878
  )) });
@@ -880,11 +880,11 @@ const Mr = ({
880
880
  position: e,
881
881
  isMobile: t,
882
882
  agentName: r,
883
- avatarImageUrl: o,
884
- agentState: l,
885
- isMuted: i,
883
+ avatarImageUrl: i,
884
+ agentState: a,
885
+ isMuted: o,
886
886
  audioLevel: s,
887
- onExpand: a,
887
+ onExpand: l,
888
888
  onToggleMute: c,
889
889
  onClose: p
890
890
  }) => t ? /* @__PURE__ */ n(
@@ -893,20 +893,20 @@ const Mr = ({
893
893
  className: "ll-minimized ll-minimized--mobile",
894
894
  role: "region",
895
895
  "aria-label": `${r} widget`,
896
- children: /* @__PURE__ */ w(
896
+ children: /* @__PURE__ */ b(
897
897
  "button",
898
898
  {
899
899
  type: "button",
900
900
  className: "ll-minimized__surface",
901
- onClick: a,
901
+ onClick: l,
902
902
  "aria-label": `Expand ${r} widget`,
903
903
  children: [
904
- o ? (
904
+ i ? (
905
905
  // eslint-disable-next-line @next/next/no-img-element
906
906
  /* @__PURE__ */ n(
907
907
  "img",
908
908
  {
909
- src: o,
909
+ src: i,
910
910
  alt: r,
911
911
  className: "ll-minimized__avatar"
912
912
  }
@@ -922,7 +922,7 @@ const Mr = ({
922
922
  }
923
923
  ),
924
924
  /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
925
- /* @__PURE__ */ w("div", { className: "ll-minimized__controls", children: [
925
+ /* @__PURE__ */ b("div", { className: "ll-minimized__controls", children: [
926
926
  /* @__PURE__ */ n(
927
927
  "span",
928
928
  {
@@ -935,11 +935,11 @@ const Mr = ({
935
935
  onKeyDown: (v) => {
936
936
  (v.key === "Enter" || v.key === " ") && (v.stopPropagation(), v.preventDefault(), c());
937
937
  },
938
- "aria-label": i ? "Unmute microphone" : "Mute microphone",
939
- children: /* @__PURE__ */ n(on, { muted: i, className: "ll-minimized__icon" })
938
+ "aria-label": o ? "Unmute microphone" : "Mute microphone",
939
+ children: /* @__PURE__ */ n(ln, { muted: o, className: "ll-minimized__icon" })
940
940
  }
941
941
  ),
942
- /* @__PURE__ */ n(ln, { className: "ll-minimized__icon ll-minimized__icon--expand" })
942
+ /* @__PURE__ */ n(an, { className: "ll-minimized__icon ll-minimized__icon--expand" })
943
943
  ] })
944
944
  ]
945
945
  }
@@ -952,31 +952,31 @@ const Mr = ({
952
952
  "data-position": e,
953
953
  role: "region",
954
954
  "aria-label": `${r} widget`,
955
- children: /* @__PURE__ */ w("div", { className: "ll-minimized__surface", children: [
956
- o ? (
955
+ children: /* @__PURE__ */ b("div", { className: "ll-minimized__surface", children: [
956
+ i ? (
957
957
  // eslint-disable-next-line @next/next/no-img-element
958
958
  /* @__PURE__ */ n(
959
959
  "img",
960
960
  {
961
- src: o,
961
+ src: i,
962
962
  alt: r,
963
963
  className: "ll-minimized__avatar"
964
964
  }
965
965
  )
966
966
  ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
967
- /* @__PURE__ */ w("div", { className: "ll-minimized__meta", children: [
967
+ /* @__PURE__ */ b("div", { className: "ll-minimized__meta", children: [
968
968
  /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
969
- /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: l === "speaking" ? "Speaking" : l === "thinking" ? "Thinking" : "Listening" })
969
+ /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: a === "speaking" ? "Speaking" : a === "thinking" ? "Thinking" : "Listening" })
970
970
  ] }),
971
- /* @__PURE__ */ w("div", { className: "ll-minimized__controls", children: [
971
+ /* @__PURE__ */ b("div", { className: "ll-minimized__controls", children: [
972
972
  /* @__PURE__ */ n(
973
973
  "button",
974
974
  {
975
975
  type: "button",
976
976
  className: "ll-minimized__btn",
977
977
  onClick: c,
978
- "aria-label": i ? "Unmute microphone" : "Mute microphone",
979
- children: /* @__PURE__ */ n(on, { muted: i, className: "ll-minimized__icon" })
978
+ "aria-label": o ? "Unmute microphone" : "Mute microphone",
979
+ children: /* @__PURE__ */ n(ln, { muted: o, className: "ll-minimized__icon" })
980
980
  }
981
981
  ),
982
982
  /* @__PURE__ */ n(
@@ -984,9 +984,9 @@ const Mr = ({
984
984
  {
985
985
  type: "button",
986
986
  className: "ll-minimized__btn",
987
- onClick: a,
987
+ onClick: l,
988
988
  "aria-label": `Expand ${r} widget`,
989
- children: /* @__PURE__ */ n(ln, { className: "ll-minimized__icon" })
989
+ children: /* @__PURE__ */ n(an, { className: "ll-minimized__icon" })
990
990
  }
991
991
  ),
992
992
  /* @__PURE__ */ n(
@@ -1006,12 +1006,12 @@ const Mr = ({
1006
1006
  src: e,
1007
1007
  alt: t,
1008
1008
  preCannedPlaying: r = !1,
1009
- className: o,
1010
- style: l
1009
+ className: i,
1010
+ style: a
1011
1011
  }) => {
1012
- const [i, s] = E(!1), a = N(e);
1013
- if (R(() => {
1014
- a.current !== e && (a.current = e, s(!1));
1012
+ const [o, s] = S(!1), l = A(e);
1013
+ if (M(() => {
1014
+ l.current !== e && (l.current = e, s(!1));
1015
1015
  }, [e]), !e) return null;
1016
1016
  const c = {
1017
1017
  position: "absolute",
@@ -1022,8 +1022,8 @@ const Mr = ({
1022
1022
  objectPosition: "top",
1023
1023
  transition: "opacity 500ms ease, transform 500ms ease",
1024
1024
  transform: r ? "scale(1.02)" : "scale(1)",
1025
- opacity: i ? 1 : 0,
1026
- ...l
1025
+ opacity: o ? 1 : 0,
1026
+ ...a
1027
1027
  };
1028
1028
  return (
1029
1029
  // eslint-disable-next-line @next/next/no-img-element
@@ -1032,7 +1032,7 @@ const Mr = ({
1032
1032
  {
1033
1033
  src: e,
1034
1034
  alt: t,
1035
- className: o,
1035
+ className: i,
1036
1036
  style: c,
1037
1037
  loading: "eager",
1038
1038
  fetchPriority: "high",
@@ -1040,85 +1040,127 @@ const Mr = ({
1040
1040
  }
1041
1041
  )
1042
1042
  );
1043
- }, $r = 8, dn = 8, zr = ({
1043
+ }, $r = "#E06540";
1044
+ function zr({
1045
+ size: e = 14,
1046
+ className: t,
1047
+ fill: r = $r
1048
+ }) {
1049
+ return /* @__PURE__ */ b(
1050
+ "svg",
1051
+ {
1052
+ xmlns: "http://www.w3.org/2000/svg",
1053
+ width: e,
1054
+ height: e,
1055
+ viewBox: "0 0 52 52",
1056
+ fill: "none",
1057
+ className: t,
1058
+ "aria-hidden": !0,
1059
+ children: [
1060
+ /* @__PURE__ */ n(
1061
+ "path",
1062
+ {
1063
+ d: "M44.5714 26C44.5714 23.5612 44.0908 21.146 43.1575 18.8928C42.2242 16.6397 40.8565 14.5924 39.132 12.868C37.4076 11.1435 35.3603 9.77577 33.1072 8.84247C30.854 7.90917 28.4388 7.42857 26 7.42857C23.5612 7.42857 21.146 7.90916 18.8928 8.84247C16.6397 9.77577 14.5924 11.1435 12.868 12.868C11.1435 14.5924 9.77577 16.6397 8.84247 18.8928C7.90917 21.146 7.42857 23.5612 7.42857 26C7.42857 28.4388 7.90916 30.854 8.84247 33.1072C9.77577 35.3603 11.1435 37.4076 12.868 39.132C14.5924 40.8565 16.6397 42.2242 18.8928 43.1575C21.146 44.0908 23.5612 44.5714 26 44.5714H48.2857C50.3371 44.5714 52 46.2344 52 48.2857C52 50.3371 50.3371 52 48.2857 52H26C22.5857 52 19.2049 51.3275 16.0505 50.021C12.896 48.7144 10.0293 46.7993 7.61501 44.385C5.20069 41.9707 3.28564 39.104 1.97902 35.9495C0.67247 32.7951 -3.54212e-07 29.4143 0 26C-1.68163e-07 22.5857 0.672469 19.2049 1.97902 16.0505C3.28564 12.896 5.20069 10.0293 7.61501 7.61501C10.0293 5.20069 12.896 3.28564 16.0505 1.97902C19.2049 0.67247 22.5857 0 26 0C29.4143 1.86048e-07 32.7951 0.67247 35.9495 1.97902C39.104 3.28564 41.9707 5.20069 44.385 7.61501C46.7993 10.0293 48.7144 12.896 50.021 16.0505C51.3275 19.2049 52 22.5857 52 26C52 28.0513 50.3371 29.7143 48.2857 29.7143C46.2344 29.7143 44.5714 28.0513 44.5714 26Z",
1064
+ fill: r
1065
+ }
1066
+ ),
1067
+ /* @__PURE__ */ n(
1068
+ "path",
1069
+ {
1070
+ d: "M28.9717 23.7714C28.9717 21.3098 30.9672 19.3143 33.4288 19.3143C35.8904 19.3143 37.886 21.3098 37.886 23.7714C37.886 26.233 35.8904 28.2286 33.4288 28.2286C30.9672 28.2286 28.9717 26.233 28.9717 23.7714Z",
1071
+ fill: r
1072
+ }
1073
+ ),
1074
+ /* @__PURE__ */ n(
1075
+ "path",
1076
+ {
1077
+ d: "M18.5714 19.3143C16.1098 19.3143 14.1143 21.3098 14.1143 23.7714C14.1143 26.233 16.1098 28.2286 18.5714 28.2286C21.033 28.2286 23.0285 26.233 23.0285 23.7714C23.0285 21.3098 21.033 19.3143 18.5714 19.3143Z",
1078
+ fill: r
1079
+ }
1080
+ )
1081
+ ]
1082
+ }
1083
+ );
1084
+ }
1085
+ const Hr = 8, un = 8, Or = ({
1044
1086
  open: e,
1045
1087
  onClose: t,
1046
1088
  anchorRef: r,
1047
- children: o
1089
+ children: i
1048
1090
  }) => {
1049
- const l = N(null), [i, s] = E(null);
1050
- return xn(() => {
1091
+ const a = A(null), [o, s] = S(null);
1092
+ return Ln(() => {
1051
1093
  if (!e) {
1052
1094
  s(null);
1053
1095
  return;
1054
1096
  }
1055
- const a = r.current;
1056
- if (!a) return;
1097
+ const l = r.current;
1098
+ if (!l) return;
1057
1099
  const c = () => {
1058
- const p = a.getBoundingClientRect(), v = {
1059
- top: p.top - $r,
1100
+ const p = l.getBoundingClientRect(), v = {
1101
+ top: p.top - Hr,
1060
1102
  left: p.left + p.width / 2
1061
- }, f = dn + 90, u = window.innerWidth - dn - 90;
1103
+ }, f = un + 90, u = window.innerWidth - un - 90;
1062
1104
  v.left < f && (v.left = f), v.left > u && (v.left = u), s(v);
1063
1105
  };
1064
1106
  return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
1065
1107
  window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
1066
1108
  };
1067
- }, [e, r]), R(() => {
1109
+ }, [e, r]), M(() => {
1068
1110
  if (!e) return;
1069
- const a = (p) => {
1070
- const v = p.target, f = l.current, u = r.current;
1111
+ const l = (p) => {
1112
+ const v = p.target, f = a.current, u = r.current;
1071
1113
  f && f.contains(v) || u && u.contains(v) || t();
1072
1114
  }, c = (p) => {
1073
1115
  p.key === "Escape" && (p.stopPropagation(), t());
1074
1116
  };
1075
- return document.addEventListener("mousedown", a), document.addEventListener("keydown", c), () => {
1076
- document.removeEventListener("mousedown", a), document.removeEventListener("keydown", c);
1117
+ return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
1118
+ document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
1077
1119
  };
1078
- }, [e, t, r]), !e || i === null || typeof document > "u" ? null : Pt(
1120
+ }, [e, t, r]), !e || o === null || typeof document > "u" ? null : $t(
1079
1121
  /* @__PURE__ */ n(
1080
1122
  "div",
1081
1123
  {
1082
- ref: l,
1124
+ ref: a,
1083
1125
  className: "ll-overflow-popover",
1084
1126
  role: "menu",
1085
1127
  style: {
1086
1128
  position: "fixed",
1087
1129
  // Lift the popover above the anchor via translateY(-100%).
1088
1130
  // top points to (anchorTop - GAP); transform pulls bottom up to there.
1089
- top: i.top,
1090
- left: i.left,
1131
+ top: o.top,
1132
+ left: o.left,
1091
1133
  transform: "translate(-50%, -100%)"
1092
1134
  },
1093
- children: o
1135
+ children: i
1094
1136
  }
1095
1137
  ),
1096
1138
  document.body
1097
1139
  );
1098
- }, Or = ({
1140
+ }, Br = ({
1099
1141
  isMuted: e,
1100
1142
  onToggleMute: t,
1101
1143
  isCameraEnabled: r,
1102
- onToggleCamera: o,
1103
- allowCamera: l,
1104
- isScreenShareEnabled: i,
1144
+ onToggleCamera: i,
1145
+ allowCamera: a,
1146
+ isScreenShareEnabled: o,
1105
1147
  onToggleScreenShare: s,
1106
- allowScreenShare: a,
1148
+ allowScreenShare: l,
1107
1149
  isSpeakerMuted: c,
1108
1150
  onToggleSpeaker: p,
1109
1151
  allowTyping: v,
1110
1152
  isTypingOpen: f,
1111
1153
  onToggleTyping: u,
1112
- onDisconnect: I
1154
+ onDisconnect: R
1113
1155
  }) => {
1114
- const [L, _] = E(!1), h = N(null);
1115
- return /* @__PURE__ */ w($e, { children: [
1116
- /* @__PURE__ */ w(
1156
+ const [k, _] = S(!1), m = A(null);
1157
+ return /* @__PURE__ */ b($e, { children: [
1158
+ /* @__PURE__ */ b(
1117
1159
  "div",
1118
1160
  {
1119
1161
  className: "ll-toolbar ll-toolbar--compact",
1120
1162
  "data-testid": "compact-toolbar",
1121
- onClick: (b) => b.stopPropagation(),
1163
+ onClick: (w) => w.stopPropagation(),
1122
1164
  children: [
1123
1165
  /* @__PURE__ */ n(
1124
1166
  "button",
@@ -1127,20 +1169,20 @@ const Mr = ({
1127
1169
  className: `ll-tool ${e ? "is-muted" : ""}`,
1128
1170
  onClick: t,
1129
1171
  "aria-label": e ? "Unmute microphone" : "Mute microphone",
1130
- children: /* @__PURE__ */ n(Sn, { muted: e })
1172
+ children: /* @__PURE__ */ n(Nn, { muted: e })
1131
1173
  }
1132
1174
  ),
1133
1175
  /* @__PURE__ */ n(
1134
1176
  "button",
1135
1177
  {
1136
- ref: h,
1178
+ ref: m,
1137
1179
  type: "button",
1138
- className: `ll-tool ${L ? "is-on" : ""}`,
1139
- onClick: () => _((b) => !b),
1180
+ className: `ll-tool ${k ? "is-on" : ""}`,
1181
+ onClick: () => _((w) => !w),
1140
1182
  "aria-label": "More controls",
1141
1183
  "aria-haspopup": "menu",
1142
- "aria-expanded": L,
1143
- children: /* @__PURE__ */ n(Hr, {})
1184
+ "aria-expanded": k,
1185
+ children: /* @__PURE__ */ n(Wr, {})
1144
1186
  }
1145
1187
  ),
1146
1188
  /* @__PURE__ */ n(
@@ -1148,50 +1190,50 @@ const Mr = ({
1148
1190
  {
1149
1191
  type: "button",
1150
1192
  className: "ll-tool ll-tool--danger",
1151
- onClick: I,
1193
+ onClick: R,
1152
1194
  "aria-label": "End conversation",
1153
- children: /* @__PURE__ */ n(An, {})
1195
+ children: /* @__PURE__ */ n(In, {})
1154
1196
  }
1155
1197
  )
1156
1198
  ]
1157
1199
  }
1158
1200
  ),
1159
- /* @__PURE__ */ w(
1160
- zr,
1201
+ /* @__PURE__ */ b(
1202
+ Or,
1161
1203
  {
1162
- open: L,
1204
+ open: k,
1163
1205
  onClose: () => _(!1),
1164
- anchorRef: h,
1206
+ anchorRef: m,
1165
1207
  children: [
1166
- l && /* @__PURE__ */ w(
1208
+ a && /* @__PURE__ */ b(
1167
1209
  "button",
1168
1210
  {
1169
1211
  type: "button",
1170
1212
  className: `ll-overflow-popover__item ${r ? "is-on" : ""}`,
1171
1213
  onClick: () => {
1172
- o(), _(!1);
1214
+ i(), _(!1);
1173
1215
  },
1174
1216
  children: [
1175
- /* @__PURE__ */ n(En, {}),
1217
+ /* @__PURE__ */ n(Sn, {}),
1176
1218
  /* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
1177
1219
  ]
1178
1220
  }
1179
1221
  ),
1180
- a && /* @__PURE__ */ w(
1222
+ l && /* @__PURE__ */ b(
1181
1223
  "button",
1182
1224
  {
1183
1225
  type: "button",
1184
- className: `ll-overflow-popover__item ${i ? "is-on" : ""}`,
1226
+ className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
1185
1227
  onClick: () => {
1186
1228
  s(), _(!1);
1187
1229
  },
1188
1230
  children: [
1189
- /* @__PURE__ */ n(Cn, {}),
1190
- /* @__PURE__ */ n("span", { children: i ? "Stop sharing" : "Share screen" })
1231
+ /* @__PURE__ */ n(En, {}),
1232
+ /* @__PURE__ */ n("span", { children: o ? "Stop sharing" : "Share screen" })
1191
1233
  ]
1192
1234
  }
1193
1235
  ),
1194
- /* @__PURE__ */ w(
1236
+ /* @__PURE__ */ b(
1195
1237
  "button",
1196
1238
  {
1197
1239
  type: "button",
@@ -1200,12 +1242,12 @@ const Mr = ({
1200
1242
  p(), _(!1);
1201
1243
  },
1202
1244
  children: [
1203
- /* @__PURE__ */ n(Nn, { muted: c }),
1245
+ /* @__PURE__ */ n(An, { muted: c }),
1204
1246
  /* @__PURE__ */ n("span", { children: c ? "Unmute speaker" : "Mute speaker" })
1205
1247
  ]
1206
1248
  }
1207
1249
  ),
1208
- v && /* @__PURE__ */ w(
1250
+ v && /* @__PURE__ */ b(
1209
1251
  "button",
1210
1252
  {
1211
1253
  type: "button",
@@ -1214,12 +1256,12 @@ const Mr = ({
1214
1256
  u(), _(!1);
1215
1257
  },
1216
1258
  children: [
1217
- /* @__PURE__ */ n(Br, {}),
1259
+ /* @__PURE__ */ n(Fr, {}),
1218
1260
  /* @__PURE__ */ n("span", { children: f ? "Hide typing" : "Type a message" })
1219
1261
  ]
1220
1262
  }
1221
1263
  ),
1222
- /* @__PURE__ */ w(
1264
+ /* @__PURE__ */ b(
1223
1265
  "button",
1224
1266
  {
1225
1267
  type: "button",
@@ -1237,8 +1279,8 @@ const Mr = ({
1237
1279
  )
1238
1280
  ] });
1239
1281
  };
1240
- function Hr() {
1241
- return /* @__PURE__ */ w(
1282
+ function Wr() {
1283
+ return /* @__PURE__ */ b(
1242
1284
  "svg",
1243
1285
  {
1244
1286
  width: "16",
@@ -1254,7 +1296,7 @@ function Hr() {
1254
1296
  }
1255
1297
  );
1256
1298
  }
1257
- function Br() {
1299
+ function Fr() {
1258
1300
  return /* @__PURE__ */ n(
1259
1301
  "svg",
1260
1302
  {
@@ -1271,56 +1313,56 @@ function Br() {
1271
1313
  }
1272
1314
  );
1273
1315
  }
1274
- const Wr = ({
1316
+ const qr = ({
1275
1317
  position: e,
1276
1318
  isMobile: t,
1277
1319
  agentName: r,
1278
- avatarImageUrl: o,
1279
- idleLoopUrl: l,
1280
- greeting: i,
1320
+ avatarImageUrl: i,
1321
+ idleLoopUrl: a,
1322
+ greeting: o,
1281
1323
  branding: s,
1282
- teamMembers: a,
1324
+ teamMembers: l,
1283
1325
  currentTeamMemberId: c,
1284
1326
  isSwitchingTeamMember: p,
1285
1327
  teamSwitcherOpen: v,
1286
1328
  onToggleTeamSwitcher: f,
1287
1329
  onSelectTeamMember: u,
1288
- languageMenuOpen: I,
1289
- onToggleLanguageMenu: L,
1330
+ languageMenuOpen: R,
1331
+ onToggleLanguageMenu: k,
1290
1332
  connectionState: _,
1291
- agentState: h,
1292
- transcript: b,
1293
- canResume: S,
1333
+ agentState: m,
1334
+ transcript: w,
1335
+ canResume: N,
1294
1336
  needsUserGesture: T,
1295
- error: A,
1296
- isMuted: q,
1337
+ error: I,
1338
+ isMuted: U,
1297
1339
  micError: g,
1298
1340
  micDevices: P,
1299
- activeMicId: H,
1300
- isCameraEnabled: F,
1301
- cameraPreviewEl: ee,
1341
+ activeMicId: O,
1342
+ isCameraEnabled: q,
1343
+ cameraPreviewEl: ne,
1302
1344
  cameraDevices: B,
1303
- activeCameraId: U,
1304
- isScreenShareEnabled: M,
1305
- screenPreviewEl: J,
1306
- isSpeakerMuted: ye,
1307
- allowCamera: ie,
1345
+ activeCameraId: j,
1346
+ isScreenShareEnabled: C,
1347
+ screenPreviewEl: Z,
1348
+ isSpeakerMuted: we,
1349
+ allowCamera: ce,
1308
1350
  allowScreenShare: ze,
1309
- allowTyping: Oe,
1310
- showMinimize: ve = !0,
1311
- showClose: Ee = !0,
1312
- chromeless: Y = !1,
1313
- compactControls: X = !1,
1314
- transforming: be,
1315
- transformingLabel: we,
1316
- avatarVideoContainerRef: Se,
1317
- agentVideoEl: se,
1351
+ allowTyping: He,
1352
+ showMinimize: X = !0,
1353
+ showClose: Se = !0,
1354
+ chromeless: _e = !1,
1355
+ compactControls: W = !1,
1356
+ transforming: ie,
1357
+ transformingLabel: Y,
1358
+ avatarVideoContainerRef: fe,
1359
+ agentVideoEl: K,
1318
1360
  onConnect: Qe,
1319
- onDisconnect: Ze,
1361
+ onDisconnect: et,
1320
1362
  onRetry: ft,
1321
- onResumeAudio: et,
1363
+ onResumeAudio: tt,
1322
1364
  onToggleMute: Ne,
1323
- onSwitchMicDevice: He,
1365
+ onSwitchMicDevice: Oe,
1324
1366
  onToggleCamera: Ae,
1325
1367
  onSwitchCameraDevice: Be,
1326
1368
  onToggleScreenShare: Ie,
@@ -1328,98 +1370,98 @@ const Wr = ({
1328
1370
  onSendMessage: Me,
1329
1371
  onMinimize: Te,
1330
1372
  onClose: $,
1331
- onClearMicError: xt
1373
+ onClearMicError: Lt
1332
1374
  }) => {
1333
- var mt;
1334
- const De = ((a == null ? void 0 : a.length) ?? 0) > 1, We = _ === "connecting" || _ === "connected", ce = _ === "connected", tt = _ === "idle" || _ === "disconnected" || _ === "error", [Pe, Fe] = E(!1);
1335
- R(() => {
1336
- if (!se) {
1375
+ var gt;
1376
+ const De = ((l == null ? void 0 : l.length) ?? 0) > 1, We = _ === "connecting" || _ === "connected", pe = _ === "connected", nt = _ === "idle" || _ === "disconnected" || _ === "error", [Pe, Fe] = S(!1);
1377
+ M(() => {
1378
+ if (!K) {
1337
1379
  Fe(!1);
1338
1380
  return;
1339
1381
  }
1340
- if (!se.paused && se.readyState >= 2) {
1382
+ if (!K.paused && K.readyState >= 2) {
1341
1383
  Fe(!0);
1342
1384
  return;
1343
1385
  }
1344
1386
  Fe(!1);
1345
- const m = () => Fe(!0);
1346
- return se.addEventListener("playing", m), se.addEventListener("loadeddata", m), () => {
1347
- se.removeEventListener("playing", m), se.removeEventListener("loadeddata", m);
1387
+ const h = () => Fe(!0);
1388
+ return K.addEventListener("playing", h), K.addEventListener("loadeddata", h), () => {
1389
+ K.removeEventListener("playing", h), K.removeEventListener("loadeddata", h);
1348
1390
  };
1349
- }, [se]);
1350
- const [kt, ke] = E(!1);
1351
- R(() => {
1352
- if (!ce) {
1391
+ }, [K]);
1392
+ const [kt, ke] = S(!1);
1393
+ M(() => {
1394
+ if (!pe) {
1353
1395
  ke(!1);
1354
1396
  return;
1355
1397
  }
1356
1398
  if (Pe) return;
1357
- const m = setTimeout(() => ke(!0), 8e3);
1358
- return () => clearTimeout(m);
1359
- }, [ce, Pe]);
1360
- const te = _ === "connecting" || ce && !!o && !Pe && !kt, nt = N(null), ue = N(null);
1361
- R(() => {
1362
- const m = nt.current;
1363
- m && (m.innerHTML = "", ee && (ee.style.width = "100%", ee.style.height = "100%", ee.style.objectFit = "cover", ee.style.transform = "scaleX(-1)", m.appendChild(ee)));
1364
- }, [ee]), R(() => {
1365
- const m = ue.current;
1366
- m && (m.innerHTML = "", J && (J.style.width = "100%", J.style.height = "100%", J.style.objectFit = "contain", m.appendChild(J)));
1367
- }, [J]);
1368
- const [qe, Ue] = E(!1), [ne, le] = E(!1), pt = N(null), ht = N(null);
1369
- R(() => {
1370
- if (!qe && !ne && !I && !v) return;
1371
- const m = () => {
1372
- Ue(!1), le(!1), I && L(), v && f();
1399
+ const h = setTimeout(() => ke(!0), 8e3);
1400
+ return () => clearTimeout(h);
1401
+ }, [pe, Pe]);
1402
+ const oe = _ === "connecting" || pe && !!i && !Pe && !kt, rt = A(null), me = A(null);
1403
+ M(() => {
1404
+ const h = rt.current;
1405
+ h && (h.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "cover", ne.style.transform = "scaleX(-1)", h.appendChild(ne)));
1406
+ }, [ne]), M(() => {
1407
+ const h = me.current;
1408
+ h && (h.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", h.appendChild(Z)));
1409
+ }, [Z]);
1410
+ const [qe, Ue] = S(!1), [le, de] = S(!1), pt = A(null), ht = A(null);
1411
+ M(() => {
1412
+ if (!qe && !le && !R && !v) return;
1413
+ const h = () => {
1414
+ Ue(!1), de(!1), R && k(), v && f();
1373
1415
  };
1374
- return document.addEventListener("click", m), () => document.removeEventListener("click", m);
1416
+ return document.addEventListener("click", h), () => document.removeEventListener("click", h);
1375
1417
  }, [
1376
1418
  qe,
1377
- ne,
1378
- I,
1419
+ le,
1420
+ R,
1379
1421
  v,
1380
- L,
1422
+ k,
1381
1423
  f
1382
1424
  ]);
1383
- const [Le, rt] = E(!1), oe = C(() => rt((m) => !m), []), [ae, Ce] = E(""), ot = C(
1384
- (m) => {
1385
- m.preventDefault();
1386
- const G = ae.trim();
1387
- G && (Me(G), Ce(""));
1425
+ const [Ce, it] = S(!1), se = E(() => it((h) => !h), []), [ue, Ee] = S(""), ot = E(
1426
+ (h) => {
1427
+ h.preventDefault();
1428
+ const Q = ue.trim();
1429
+ Q && (Me(Q), Ee(""));
1388
1430
  },
1389
- [ae, Me]
1390
- ), Lt = s.productName || "Live Layer";
1391
- let fe = null, pe = null;
1392
- for (let m = b.length - 1; m >= 0; m--) {
1393
- const G = b[m];
1394
- if (!fe && G.role === "agent" ? fe = G : !pe && G.role === "user" && (pe = G), fe && pe) break;
1431
+ [ue, Me]
1432
+ ), mt = s.productName || "Live Layer", lt = !s.productName;
1433
+ let ge = null, xe = null;
1434
+ for (let h = w.length - 1; h >= 0; h--) {
1435
+ const Q = w[h];
1436
+ if (!ge && Q.role === "agent" ? ge = Q : !xe && Q.role === "user" && (xe = Q), ge && xe) break;
1395
1437
  }
1396
- const it = ce ? (fe == null ? void 0 : fe.text) || null : i || null, je = ce && (pe == null ? void 0 : pe.text) || null, lt = [
1438
+ const je = pe ? (ge == null ? void 0 : ge.text) || null : o || null, Ve = pe && (xe == null ? void 0 : xe.text) || null, Ct = [
1397
1439
  "ll-expanded",
1398
1440
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1399
1441
  ].join(" ");
1400
- return /* @__PURE__ */ w(
1442
+ return /* @__PURE__ */ b(
1401
1443
  "div",
1402
1444
  {
1403
- className: lt,
1445
+ className: Ct,
1404
1446
  "data-position": e,
1405
- "data-state": ce ? "connected" : We ? "connecting" : "idle",
1447
+ "data-state": pe ? "connected" : We ? "connecting" : "idle",
1406
1448
  role: "dialog",
1407
1449
  "aria-label": `${r} widget`,
1408
1450
  children: [
1409
- /* @__PURE__ */ w("div", { className: "ll-expanded__bg", children: [
1410
- o ? /* @__PURE__ */ n(
1451
+ /* @__PURE__ */ b("div", { className: "ll-expanded__bg", children: [
1452
+ i ? /* @__PURE__ */ n(
1411
1453
  Pr,
1412
1454
  {
1413
- src: o,
1455
+ src: i,
1414
1456
  alt: r,
1415
1457
  className: "ll-expanded__bg-img"
1416
1458
  }
1417
- ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((mt = r == null ? void 0 : r.charAt(0)) == null ? void 0 : mt.toUpperCase()) || "A" }) }),
1418
- l && !ce && /* @__PURE__ */ n(
1459
+ ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((gt = r == null ? void 0 : r.charAt(0)) == null ? void 0 : gt.toUpperCase()) || "A" }) }),
1460
+ a && !pe && /* @__PURE__ */ n(
1419
1461
  "video",
1420
1462
  {
1421
1463
  className: "ll-expanded__bg-idle",
1422
- src: l,
1464
+ src: a,
1423
1465
  autoPlay: !0,
1424
1466
  loop: !0,
1425
1467
  muted: !0,
@@ -1427,53 +1469,53 @@ const Wr = ({
1427
1469
  }
1428
1470
  )
1429
1471
  ] }),
1430
- /* @__PURE__ */ n("div", { ref: Se, className: "ll-expanded__video" }),
1431
- te && /* @__PURE__ */ w("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1472
+ /* @__PURE__ */ n("div", { ref: fe, className: "ll-expanded__video" }),
1473
+ oe && /* @__PURE__ */ b("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1432
1474
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1433
1475
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: p ? "Switching..." : "Connecting..." })
1434
1476
  ] }),
1435
- T && ce && /* @__PURE__ */ w(
1477
+ T && pe && /* @__PURE__ */ b(
1436
1478
  "button",
1437
1479
  {
1438
1480
  type: "button",
1439
1481
  className: "ll-expanded__overlay ll-expanded__overlay--gesture",
1440
- onClick: et,
1482
+ onClick: tt,
1441
1483
  children: [
1442
1484
  /* @__PURE__ */ n("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
1443
1485
  /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
1444
1486
  ]
1445
1487
  }
1446
1488
  ),
1447
- be && /* @__PURE__ */ w(
1489
+ ie && /* @__PURE__ */ b(
1448
1490
  "div",
1449
1491
  {
1450
1492
  className: "ll-expanded__overlay ll-expanded__overlay--transforming",
1451
1493
  role: "status",
1452
1494
  "aria-live": "polite",
1453
- "aria-label": we,
1495
+ "aria-label": Y,
1454
1496
  children: [
1455
1497
  /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1456
- /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: we })
1498
+ /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: Y })
1457
1499
  ]
1458
1500
  }
1459
1501
  ),
1460
- We ? /* @__PURE__ */ w($e, { children: [
1461
- !X && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar", children: [
1462
- !Y && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar-left", children: [
1463
- /* @__PURE__ */ w("div", { className: "ll-expanded__pill-wrap", children: [
1464
- /* @__PURE__ */ w(
1502
+ We ? /* @__PURE__ */ b($e, { children: [
1503
+ !W && /* @__PURE__ */ b("div", { className: "ll-expanded__topbar", children: [
1504
+ !_e && /* @__PURE__ */ b("div", { className: "ll-expanded__topbar-left", children: [
1505
+ /* @__PURE__ */ b("div", { className: "ll-expanded__pill-wrap", children: [
1506
+ /* @__PURE__ */ b(
1465
1507
  "button",
1466
1508
  {
1467
1509
  type: "button",
1468
1510
  className: "ll-hpill",
1469
- onClick: (m) => {
1470
- De && (m.stopPropagation(), f());
1511
+ onClick: (h) => {
1512
+ De && (h.stopPropagation(), f());
1471
1513
  },
1472
1514
  "aria-haspopup": De ? "listbox" : void 0,
1473
1515
  "aria-expanded": De ? v : void 0,
1474
1516
  children: [
1475
1517
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
1476
- De && /* @__PURE__ */ n(bt, {})
1518
+ De && /* @__PURE__ */ n(wt, {})
1477
1519
  ]
1478
1520
  }
1479
1521
  ),
@@ -1481,58 +1523,58 @@ const Wr = ({
1481
1523
  "div",
1482
1524
  {
1483
1525
  className: "ll-hmenu",
1484
- onClick: (m) => m.stopPropagation(),
1526
+ onClick: (h) => h.stopPropagation(),
1485
1527
  role: "listbox",
1486
- children: a == null ? void 0 : a.map((m) => /* @__PURE__ */ w(
1528
+ children: l == null ? void 0 : l.map((h) => /* @__PURE__ */ b(
1487
1529
  "button",
1488
1530
  {
1489
1531
  type: "button",
1490
- className: `ll-hmenu__item ${m.id === c ? "is-active" : ""}`,
1491
- onClick: () => u(m.id),
1532
+ className: `ll-hmenu__item ${h.id === c ? "is-active" : ""}`,
1533
+ onClick: () => u(h.id),
1492
1534
  role: "option",
1493
- "aria-selected": m.id === c,
1535
+ "aria-selected": h.id === c,
1494
1536
  children: [
1495
- m.avatarImageUrl && /* @__PURE__ */ n(
1537
+ h.avatarImageUrl && /* @__PURE__ */ n(
1496
1538
  "img",
1497
1539
  {
1498
- src: m.avatarImageUrl,
1540
+ src: h.avatarImageUrl,
1499
1541
  alt: "",
1500
1542
  className: "ll-hmenu__avatar"
1501
1543
  }
1502
1544
  ),
1503
- /* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: m.name }),
1504
- m.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: m.role })
1545
+ /* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: h.name }),
1546
+ h.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: h.role })
1505
1547
  ]
1506
1548
  },
1507
- m.id
1549
+ h.id
1508
1550
  ))
1509
1551
  }
1510
1552
  )
1511
1553
  ] }),
1512
- /* @__PURE__ */ w("div", { className: "ll-expanded__pill-wrap", children: [
1513
- /* @__PURE__ */ w(
1554
+ /* @__PURE__ */ b("div", { className: "ll-expanded__pill-wrap", children: [
1555
+ /* @__PURE__ */ b(
1514
1556
  "button",
1515
1557
  {
1516
1558
  type: "button",
1517
1559
  className: "ll-hpill ll-hpill--compact",
1518
- onClick: (m) => {
1519
- m.stopPropagation(), L();
1560
+ onClick: (h) => {
1561
+ h.stopPropagation(), k();
1520
1562
  },
1521
1563
  "aria-haspopup": "listbox",
1522
- "aria-expanded": I,
1564
+ "aria-expanded": R,
1523
1565
  "aria-label": "Language: English",
1524
1566
  title: "Language: English",
1525
1567
  children: [
1526
1568
  /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
1527
- /* @__PURE__ */ n(bt, {})
1569
+ /* @__PURE__ */ n(wt, {})
1528
1570
  ]
1529
1571
  }
1530
1572
  ),
1531
- I && /* @__PURE__ */ n(
1573
+ R && /* @__PURE__ */ n(
1532
1574
  "div",
1533
1575
  {
1534
1576
  className: "ll-hmenu",
1535
- onClick: (m) => m.stopPropagation(),
1577
+ onClick: (h) => h.stopPropagation(),
1536
1578
  role: "listbox",
1537
1579
  children: /* @__PURE__ */ n(
1538
1580
  "button",
@@ -1550,13 +1592,13 @@ const Wr = ({
1550
1592
  /* @__PURE__ */ n(
1551
1593
  "span",
1552
1594
  {
1553
- className: `ll-expanded__state ll-expanded__state--${h}`,
1554
- children: h
1595
+ className: `ll-expanded__state ll-expanded__state--${m}`,
1596
+ children: m
1555
1597
  }
1556
1598
  )
1557
1599
  ] }),
1558
- /* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
1559
- ve !== !1 && /* @__PURE__ */ n(
1600
+ /* @__PURE__ */ b("div", { className: "ll-expanded__header-actions", children: [
1601
+ X !== !1 && /* @__PURE__ */ n(
1560
1602
  "button",
1561
1603
  {
1562
1604
  type: "button",
@@ -1564,10 +1606,10 @@ const Wr = ({
1564
1606
  onClick: Te,
1565
1607
  "aria-label": "Minimize widget",
1566
1608
  title: "Minimize",
1567
- children: /* @__PURE__ */ n(fn, {})
1609
+ children: /* @__PURE__ */ n(pn, {})
1568
1610
  }
1569
1611
  ),
1570
- Ee !== !1 && /* @__PURE__ */ n(
1612
+ Se !== !1 && /* @__PURE__ */ n(
1571
1613
  "button",
1572
1614
  {
1573
1615
  type: "button",
@@ -1575,138 +1617,152 @@ const Wr = ({
1575
1617
  onClick: $,
1576
1618
  "aria-label": "End call",
1577
1619
  title: "End call",
1578
- children: /* @__PURE__ */ n(un, {})
1620
+ children: /* @__PURE__ */ n(fn, {})
1579
1621
  }
1580
1622
  )
1581
1623
  ] })
1582
1624
  ] }),
1583
- X && /* @__PURE__ */ w("div", { className: "ll-compact-status", "data-state": h, children: [
1625
+ W && /* @__PURE__ */ b("div", { className: "ll-compact-status", "data-state": m, children: [
1584
1626
  /* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
1585
- /* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: h })
1627
+ /* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: m })
1586
1628
  ] })
1587
1629
  ] }) : (
1588
1630
  // Idle-state header with Live Layer product name + minimize/close.
1589
1631
  // Hidden in compact mode — on a 140×210 docked slot the brand pill
1590
1632
  // and 40px buttons crowded out the central "Start video call"
1591
1633
  // affordance. The user can dismiss by scrolling past the slot.
1592
- !X && /* @__PURE__ */ w("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1593
- /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Lt }),
1594
- /* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
1595
- ve !== !1 && /* @__PURE__ */ n(
1634
+ !W && /* @__PURE__ */ b("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
1635
+ lt ? /* @__PURE__ */ b(
1636
+ "a",
1637
+ {
1638
+ className: "ll-expanded__brand ll-expanded__brand--link",
1639
+ href: "https://livelayer.studio?utm_source=widget&utm_medium=brand-badge",
1640
+ target: "_blank",
1641
+ rel: "noopener noreferrer",
1642
+ "aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
1643
+ title: "Powered by LiveLayer — visit livelayer.studio",
1644
+ children: [
1645
+ /* @__PURE__ */ n(zr, { size: 14, className: "ll-expanded__brand-mark" }),
1646
+ /* @__PURE__ */ n("span", { children: mt })
1647
+ ]
1648
+ }
1649
+ ) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: mt }),
1650
+ /* @__PURE__ */ b("div", { className: "ll-expanded__header-actions", children: [
1651
+ X !== !1 && /* @__PURE__ */ n(
1596
1652
  "button",
1597
1653
  {
1598
1654
  type: "button",
1599
1655
  className: "ll-hbtn ll-hbtn--ghost",
1600
1656
  onClick: Te,
1601
1657
  "aria-label": "Minimize widget",
1602
- children: /* @__PURE__ */ n(fn, {})
1658
+ children: /* @__PURE__ */ n(pn, {})
1603
1659
  }
1604
1660
  ),
1605
- Ee !== !1 && /* @__PURE__ */ n(
1661
+ Se !== !1 && /* @__PURE__ */ n(
1606
1662
  "button",
1607
1663
  {
1608
1664
  type: "button",
1609
1665
  className: "ll-hbtn ll-hbtn--danger",
1610
1666
  onClick: $,
1611
1667
  "aria-label": "Close widget",
1612
- children: /* @__PURE__ */ n(un, {})
1668
+ children: /* @__PURE__ */ n(fn, {})
1613
1669
  }
1614
1670
  )
1615
1671
  ] })
1616
1672
  ] })
1617
1673
  ),
1618
- tt && /* @__PURE__ */ (() => {
1619
- const m = S ? "Resume session" : _ === "disconnected" ? "Reconnect to agent" : "Start video call";
1620
- return /* @__PURE__ */ w($e, { children: [
1621
- !A && /* @__PURE__ */ w(
1674
+ nt && /* @__PURE__ */ (() => {
1675
+ const h = N ? "Resume session" : _ === "disconnected" ? "Reconnect to agent" : "Start video call";
1676
+ return /* @__PURE__ */ b($e, { children: [
1677
+ !I && /* @__PURE__ */ b(
1622
1678
  "button",
1623
1679
  {
1624
1680
  type: "button",
1625
1681
  className: "ll-expanded__play",
1626
1682
  onClick: Qe,
1627
- "aria-label": m,
1683
+ "aria-label": h,
1628
1684
  children: [
1629
1685
  /* @__PURE__ */ n("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ n("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
1630
- X && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: m })
1686
+ W && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: h })
1631
1687
  ]
1632
1688
  }
1633
1689
  ),
1634
- !X && /* @__PURE__ */ w("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1635
- i && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: i }) }),
1690
+ !W && /* @__PURE__ */ b("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1691
+ o && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: o }) }),
1636
1692
  /* @__PURE__ */ n(
1637
1693
  "button",
1638
1694
  {
1639
1695
  type: "button",
1640
1696
  className: "ll-expanded__cta",
1641
1697
  onClick: Qe,
1642
- "aria-label": m,
1643
- children: m
1698
+ "aria-label": h,
1699
+ children: h
1644
1700
  }
1645
1701
  )
1646
1702
  ] })
1647
1703
  ] });
1648
1704
  })(),
1649
- /* @__PURE__ */ w(
1705
+ /* @__PURE__ */ b(
1650
1706
  "div",
1651
1707
  {
1652
- className: `ll-expanded__pip ${We && (F || M) ? "is-visible" : ""}`,
1708
+ className: `ll-expanded__pip ${We && (q || C) ? "is-visible" : ""}`,
1653
1709
  children: [
1654
1710
  /* @__PURE__ */ n(
1655
1711
  "div",
1656
1712
  {
1657
- ref: ue,
1658
- className: M ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1713
+ ref: me,
1714
+ className: C ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1659
1715
  }
1660
1716
  ),
1661
1717
  /* @__PURE__ */ n(
1662
1718
  "div",
1663
1719
  {
1664
- ref: nt,
1665
- className: !M && F ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1720
+ ref: rt,
1721
+ className: !C && q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
1666
1722
  }
1667
1723
  )
1668
1724
  ]
1669
1725
  }
1670
1726
  ),
1671
- We ? /* @__PURE__ */ w("div", { className: "ll-expanded__bottom", children: [
1672
- !X && it && /* @__PURE__ */ n(
1727
+ We ? /* @__PURE__ */ b("div", { className: "ll-expanded__bottom", children: [
1728
+ !W && je && /* @__PURE__ */ n(
1673
1729
  "div",
1674
1730
  {
1675
1731
  className: "ll-expanded__transcript ll-expanded__transcript--agent",
1676
1732
  "data-role": "agent",
1677
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: it })
1733
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: je })
1678
1734
  }
1679
1735
  ),
1680
- !X && je && /* @__PURE__ */ n(
1736
+ !W && Ve && /* @__PURE__ */ n(
1681
1737
  "div",
1682
1738
  {
1683
1739
  className: "ll-expanded__transcript ll-expanded__transcript--user",
1684
1740
  "data-role": "user",
1685
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: je })
1741
+ children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ve })
1686
1742
  }
1687
1743
  ),
1688
- !Y && !X && /* @__PURE__ */ w("div", { className: "ll-toolbar", onClick: (m) => m.stopPropagation(), children: [
1744
+ !_e && !W && /* @__PURE__ */ b("div", { className: "ll-toolbar", onClick: (h) => h.stopPropagation(), children: [
1689
1745
  ze && /* @__PURE__ */ n(
1690
1746
  "button",
1691
1747
  {
1692
1748
  type: "button",
1693
- className: `ll-tool ${M ? "is-on" : ""}`,
1749
+ className: `ll-tool ${C ? "is-on" : ""}`,
1694
1750
  onClick: Ie,
1695
- "aria-label": M ? "Stop sharing screen" : "Share screen",
1696
- title: M ? "Stop sharing" : "Share screen",
1697
- children: /* @__PURE__ */ n(Cn, {})
1751
+ "aria-label": C ? "Stop sharing screen" : "Share screen",
1752
+ title: C ? "Stop sharing" : "Share screen",
1753
+ children: /* @__PURE__ */ n(En, {})
1698
1754
  }
1699
1755
  ),
1700
- ie && /* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
1756
+ ce && /* @__PURE__ */ b("div", { className: "ll-tool-split", children: [
1701
1757
  /* @__PURE__ */ n(
1702
1758
  "button",
1703
1759
  {
1704
1760
  type: "button",
1705
- className: `ll-tool ll-tool--left ${F ? "is-on" : ""}`,
1761
+ className: `ll-tool ll-tool--left ${q ? "is-on" : ""}`,
1706
1762
  onClick: Ae,
1707
- "aria-label": F ? "Turn off camera" : "Turn on camera",
1708
- title: F ? "Stop camera" : "Start camera",
1709
- children: /* @__PURE__ */ n(En, {})
1763
+ "aria-label": q ? "Turn off camera" : "Turn on camera",
1764
+ title: q ? "Stop camera" : "Start camera",
1765
+ children: /* @__PURE__ */ n(Sn, {})
1710
1766
  }
1711
1767
  ),
1712
1768
  /* @__PURE__ */ n(
@@ -1714,39 +1770,39 @@ const Wr = ({
1714
1770
  {
1715
1771
  ref: ht,
1716
1772
  type: "button",
1717
- className: `ll-tool ll-tool--right ${F ? "is-on" : ""}`,
1718
- onClick: (m) => {
1719
- m.stopPropagation(), le((G) => !G), Ue(!1);
1773
+ className: `ll-tool ll-tool--right ${q ? "is-on" : ""}`,
1774
+ onClick: (h) => {
1775
+ h.stopPropagation(), de((Q) => !Q), Ue(!1);
1720
1776
  },
1721
1777
  "aria-label": "Camera devices",
1722
1778
  "aria-haspopup": "listbox",
1723
- "aria-expanded": ne,
1724
- children: /* @__PURE__ */ n(bt, {})
1779
+ "aria-expanded": le,
1780
+ children: /* @__PURE__ */ n(wt, {})
1725
1781
  }
1726
1782
  ),
1727
- ne && B.length > 0 && /* @__PURE__ */ n(
1728
- pn,
1783
+ le && B.length > 0 && /* @__PURE__ */ n(
1784
+ hn,
1729
1785
  {
1730
1786
  label: "Camera",
1731
1787
  devices: B,
1732
- activeId: U,
1788
+ activeId: j,
1733
1789
  anchorRef: ht,
1734
- onPick: (m) => {
1735
- le(!1), Be(m);
1790
+ onPick: (h) => {
1791
+ de(!1), Be(h);
1736
1792
  }
1737
1793
  }
1738
1794
  )
1739
1795
  ] }),
1740
- /* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
1796
+ /* @__PURE__ */ b("div", { className: "ll-tool-split", children: [
1741
1797
  /* @__PURE__ */ n(
1742
1798
  "button",
1743
1799
  {
1744
1800
  type: "button",
1745
- className: `ll-tool ll-tool--left ${q ? "is-muted" : ""}`,
1801
+ className: `ll-tool ll-tool--left ${U ? "is-muted" : ""}`,
1746
1802
  onClick: Ne,
1747
- "aria-label": q ? "Unmute microphone" : "Mute microphone",
1748
- title: q ? "Unmute" : "Mute",
1749
- children: /* @__PURE__ */ n(Sn, { muted: q })
1803
+ "aria-label": U ? "Unmute microphone" : "Mute microphone",
1804
+ title: U ? "Unmute" : "Mute",
1805
+ children: /* @__PURE__ */ n(Nn, { muted: U })
1750
1806
  }
1751
1807
  ),
1752
1808
  /* @__PURE__ */ n(
@@ -1754,25 +1810,25 @@ const Wr = ({
1754
1810
  {
1755
1811
  ref: pt,
1756
1812
  type: "button",
1757
- className: `ll-tool ll-tool--right ${q ? "is-muted" : ""}`,
1758
- onClick: (m) => {
1759
- m.stopPropagation(), Ue((G) => !G), le(!1);
1813
+ className: `ll-tool ll-tool--right ${U ? "is-muted" : ""}`,
1814
+ onClick: (h) => {
1815
+ h.stopPropagation(), Ue((Q) => !Q), de(!1);
1760
1816
  },
1761
1817
  "aria-label": "Microphone devices",
1762
1818
  "aria-haspopup": "listbox",
1763
1819
  "aria-expanded": qe,
1764
- children: /* @__PURE__ */ n(bt, {})
1820
+ children: /* @__PURE__ */ n(wt, {})
1765
1821
  }
1766
1822
  ),
1767
1823
  qe && P.length > 0 && /* @__PURE__ */ n(
1768
- pn,
1824
+ hn,
1769
1825
  {
1770
1826
  label: "Microphone",
1771
1827
  devices: P,
1772
- activeId: H,
1828
+ activeId: O,
1773
1829
  anchorRef: pt,
1774
- onPick: (m) => {
1775
- Ue(!1), He(m);
1830
+ onPick: (h) => {
1831
+ Ue(!1), Oe(h);
1776
1832
  }
1777
1833
  }
1778
1834
  )
@@ -1781,11 +1837,11 @@ const Wr = ({
1781
1837
  "button",
1782
1838
  {
1783
1839
  type: "button",
1784
- className: `ll-tool ${ye ? "is-muted" : ""}`,
1840
+ className: `ll-tool ${we ? "is-muted" : ""}`,
1785
1841
  onClick: Re,
1786
- "aria-label": ye ? "Unmute speaker" : "Mute speaker",
1787
- title: ye ? "Unmute speaker" : "Mute speaker",
1788
- children: /* @__PURE__ */ n(Nn, { muted: ye })
1842
+ "aria-label": we ? "Unmute speaker" : "Mute speaker",
1843
+ title: we ? "Unmute speaker" : "Mute speaker",
1844
+ children: /* @__PURE__ */ n(An, { muted: we })
1789
1845
  }
1790
1846
  ),
1791
1847
  /* @__PURE__ */ n(
@@ -1793,81 +1849,81 @@ const Wr = ({
1793
1849
  {
1794
1850
  type: "button",
1795
1851
  className: "ll-tool ll-tool--danger",
1796
- onClick: Ze,
1852
+ onClick: et,
1797
1853
  "aria-label": "End conversation",
1798
1854
  title: "End conversation",
1799
- children: /* @__PURE__ */ n(An, {})
1855
+ children: /* @__PURE__ */ n(In, {})
1800
1856
  }
1801
1857
  )
1802
1858
  ] }),
1803
- !Y && X && /* @__PURE__ */ n(
1804
- Or,
1859
+ !_e && W && /* @__PURE__ */ n(
1860
+ Br,
1805
1861
  {
1806
- isMuted: q,
1862
+ isMuted: U,
1807
1863
  onToggleMute: Ne,
1808
- isCameraEnabled: F,
1864
+ isCameraEnabled: q,
1809
1865
  onToggleCamera: Ae,
1810
- allowCamera: ie,
1811
- isScreenShareEnabled: M,
1866
+ allowCamera: ce,
1867
+ isScreenShareEnabled: C,
1812
1868
  onToggleScreenShare: Ie,
1813
1869
  allowScreenShare: ze,
1814
- isSpeakerMuted: ye,
1870
+ isSpeakerMuted: we,
1815
1871
  onToggleSpeaker: Re,
1816
- allowTyping: Oe,
1817
- isTypingOpen: Le,
1818
- onToggleTyping: oe,
1819
- onDisconnect: Ze
1872
+ allowTyping: He,
1873
+ isTypingOpen: Ce,
1874
+ onToggleTyping: se,
1875
+ onDisconnect: et
1820
1876
  }
1821
1877
  ),
1822
- !Y && Oe && (X ? Le : !0) && /* @__PURE__ */ w("form", { className: "ll-message-input", onSubmit: ot, children: [
1878
+ !_e && He && (W ? Ce : !0) && /* @__PURE__ */ b("form", { className: "ll-message-input", onSubmit: ot, children: [
1823
1879
  /* @__PURE__ */ n(
1824
1880
  "input",
1825
1881
  {
1826
1882
  type: "text",
1827
1883
  className: "ll-message-input__field",
1828
1884
  placeholder: "Message...",
1829
- value: ae,
1830
- onChange: (m) => Ce(m.target.value),
1885
+ value: ue,
1886
+ onChange: (h) => Ee(h.target.value),
1831
1887
  "aria-label": "Message the agent"
1832
1888
  }
1833
1889
  ),
1834
- ae.trim() && /* @__PURE__ */ n(
1890
+ ue.trim() && /* @__PURE__ */ n(
1835
1891
  "button",
1836
1892
  {
1837
1893
  type: "submit",
1838
1894
  className: "ll-message-input__send",
1839
1895
  "aria-label": "Send message",
1840
- children: /* @__PURE__ */ n(Fr, {})
1896
+ children: /* @__PURE__ */ n(Ur, {})
1841
1897
  }
1842
1898
  )
1843
1899
  ] })
1844
1900
  ] }) : null,
1845
1901
  (() => {
1846
1902
  if (g && _ !== "error")
1847
- return /* @__PURE__ */ w("div", { className: "ll-expanded__banner", role: "alert", children: [
1903
+ return /* @__PURE__ */ b("div", { className: "ll-expanded__banner", role: "alert", children: [
1848
1904
  /* @__PURE__ */ n("span", { children: g }),
1849
1905
  /* @__PURE__ */ n(
1850
1906
  "button",
1851
1907
  {
1852
1908
  type: "button",
1853
1909
  className: "ll-expanded__banner-x",
1854
- onClick: xt,
1910
+ onClick: Lt,
1855
1911
  "aria-label": "Dismiss",
1856
1912
  children: "×"
1857
1913
  }
1858
1914
  )
1859
1915
  ] });
1860
- if (!A || _ !== "error") return null;
1861
- let m = "Failed to connect", G = "Try again";
1862
- return A === "MIC_PERMISSION_DENIED" ? m = "Microphone blocked. Allow access to talk." : A === "MIC_NOT_FOUND" ? m = "No microphone found. Plug one in + retry." : A === "MIC_UNAVAILABLE" ? m = "Mic unavailable. Check other apps using it." : A === "AGENT_TIMEOUT" ? m = "Agent didn't pick up. Try again." : A === "CONNECT_FAILED" ? m = "Connection failed. Check your network." : A.length < 80 && (m = A), /* @__PURE__ */ w("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1863
- /* @__PURE__ */ n("span", { children: m }),
1916
+ if (!I || _ !== "error") return null;
1917
+ let h = "Failed to connect", Q = "Try again";
1918
+ return I === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : I === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : I === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : I === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : I === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : I.length < 80 && (h = I), /* @__PURE__ */ b("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
1919
+ /* @__PURE__ */ n("span", { children: h }),
1864
1920
  /* @__PURE__ */ n(
1865
1921
  "button",
1866
1922
  {
1867
1923
  type: "button",
1868
1924
  className: "ll-expanded__banner-retry",
1869
1925
  onClick: ft,
1870
- children: G
1926
+ children: Q
1871
1927
  }
1872
1928
  )
1873
1929
  ] });
@@ -1876,55 +1932,55 @@ const Wr = ({
1876
1932
  }
1877
1933
  );
1878
1934
  };
1879
- function bt() {
1935
+ function wt() {
1880
1936
  return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
1881
1937
  }
1882
- function un() {
1883
- return /* @__PURE__ */ w("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
1938
+ function fn() {
1939
+ return /* @__PURE__ */ b("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
1884
1940
  /* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
1885
1941
  /* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
1886
1942
  ] });
1887
1943
  }
1888
- function fn() {
1944
+ function pn() {
1889
1945
  return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
1890
1946
  }
1891
- function Cn() {
1892
- return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1947
+ function En() {
1948
+ return /* @__PURE__ */ b("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1893
1949
  /* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
1894
1950
  /* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
1895
1951
  /* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
1896
1952
  ] });
1897
1953
  }
1898
- function En() {
1899
- return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1954
+ function Sn() {
1955
+ return /* @__PURE__ */ b("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1900
1956
  /* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
1901
1957
  /* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
1902
1958
  ] });
1903
1959
  }
1904
- function Sn({ muted: e }) {
1905
- return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1960
+ function Nn({ muted: e }) {
1961
+ return /* @__PURE__ */ b("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1906
1962
  /* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
1907
1963
  /* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
1908
1964
  /* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
1909
1965
  e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
1910
1966
  ] });
1911
1967
  }
1912
- function Nn({ muted: e }) {
1913
- return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1968
+ function An({ muted: e }) {
1969
+ return /* @__PURE__ */ b("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1914
1970
  /* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1915
- e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ w($e, { children: [
1971
+ e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ b($e, { children: [
1916
1972
  /* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
1917
1973
  /* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
1918
1974
  ] })
1919
1975
  ] });
1920
1976
  }
1921
- function Fr() {
1922
- return /* @__PURE__ */ w("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1977
+ function Ur() {
1978
+ return /* @__PURE__ */ b("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
1923
1979
  /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
1924
1980
  /* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
1925
1981
  ] });
1926
1982
  }
1927
- function An() {
1983
+ function In() {
1928
1984
  return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
1929
1985
  "path",
1930
1986
  {
@@ -1933,17 +1989,17 @@ function An() {
1933
1989
  }
1934
1990
  ) });
1935
1991
  }
1936
- const pn = ({
1992
+ const hn = ({
1937
1993
  label: e,
1938
1994
  devices: t,
1939
1995
  activeId: r,
1940
- onPick: o,
1941
- anchorRef: l
1996
+ onPick: i,
1997
+ anchorRef: a
1942
1998
  }) => {
1943
- const [i, s] = E(null);
1944
- return xn(() => {
1945
- const a = () => {
1946
- const c = l.current;
1999
+ const [o, s] = S(null);
2000
+ return Ln(() => {
2001
+ const l = () => {
2002
+ const c = a.current;
1947
2003
  if (!c) return;
1948
2004
  const p = c.getBoundingClientRect(), v = 126, f = window.innerWidth - 16 - 110, u = p.left + p.width / 2;
1949
2005
  s({
@@ -1951,41 +2007,41 @@ const pn = ({
1951
2007
  left: Math.max(v, Math.min(f, u))
1952
2008
  });
1953
2009
  };
1954
- return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
1955
- window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
2010
+ return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
2011
+ window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
1956
2012
  };
1957
- }, [l]), i === null || typeof document > "u" ? null : Pt(
1958
- /* @__PURE__ */ w(
2013
+ }, [a]), o === null || typeof document > "u" ? null : $t(
2014
+ /* @__PURE__ */ b(
1959
2015
  "div",
1960
2016
  {
1961
2017
  className: "ll-device-menu ll-device-menu--floating",
1962
- onClick: (a) => a.stopPropagation(),
2018
+ onClick: (l) => l.stopPropagation(),
1963
2019
  role: "listbox",
1964
2020
  style: {
1965
2021
  position: "fixed",
1966
- top: i.top,
1967
- left: i.left,
2022
+ top: o.top,
2023
+ left: o.left,
1968
2024
  // translate up by 100% so its BOTTOM edge sits at pos.top.
1969
2025
  transform: "translate(-50%, -100%)"
1970
2026
  },
1971
2027
  children: [
1972
2028
  /* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
1973
- t.map((a, c) => {
1974
- const p = r === a.deviceId;
1975
- return /* @__PURE__ */ w(
2029
+ t.map((l, c) => {
2030
+ const p = r === l.deviceId;
2031
+ return /* @__PURE__ */ b(
1976
2032
  "button",
1977
2033
  {
1978
2034
  type: "button",
1979
2035
  className: `ll-device-menu__item ${p ? "is-active" : ""}`,
1980
- onClick: () => o(a.deviceId),
2036
+ onClick: () => i(l.deviceId),
1981
2037
  role: "option",
1982
2038
  "aria-selected": p,
1983
2039
  children: [
1984
2040
  p && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
1985
- /* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: a.label || `${e} ${c + 1}` })
2041
+ /* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: l.label || `${e} ${c + 1}` })
1986
2042
  ]
1987
2043
  },
1988
- a.deviceId || c
2044
+ l.deviceId || c
1989
2045
  );
1990
2046
  })
1991
2047
  ]
@@ -1993,7 +2049,7 @@ const pn = ({
1993
2049
  ),
1994
2050
  document.body
1995
2051
  );
1996
- }, qr = [
2052
+ }, jr = [
1997
2053
  // Accept any value (or empty) — `<input data-ll-private />` and
1998
2054
  // `<input data-ll-private="true" />` both opt out. The bare attribute
1999
2055
  // is the recommended spelling; "true" is preserved for back-compat.
@@ -2001,17 +2057,17 @@ const pn = ({
2001
2057
  "[data-ll-skip]",
2002
2058
  ".ll-widget"
2003
2059
  ];
2004
- function $t(e) {
2060
+ function zt(e) {
2005
2061
  let t = e;
2006
2062
  for (; t; ) {
2007
- for (const r of qr)
2063
+ for (const r of jr)
2008
2064
  if (t.matches(r)) return !0;
2009
2065
  t = t.parentElement;
2010
2066
  }
2011
2067
  return !1;
2012
2068
  }
2013
- function Tt(e) {
2014
- if ($t(e)) return !1;
2069
+ function Dt(e) {
2070
+ if (zt(e)) return !1;
2015
2071
  if (e instanceof HTMLInputElement) {
2016
2072
  if (e.type === "password") return !1;
2017
2073
  const t = (e.getAttribute("autocomplete") || "").toLowerCase();
@@ -2019,7 +2075,7 @@ function Tt(e) {
2019
2075
  }
2020
2076
  return !0;
2021
2077
  }
2022
- const wt = 4096, Ur = 20, jr = 20, Vr = 10, Yr = 10, Gr = 30, Kr = 20, hn = 500, Jr = [
2078
+ const _t = 4096, Vr = 20, Yr = 20, Gr = 10, Kr = 10, Jr = 30, Xr = 20, mn = 500, Zr = [
2023
2079
  '[data-ll-private="true"]',
2024
2080
  ".ll-widget",
2025
2081
  "script",
@@ -2031,7 +2087,7 @@ function dt(e) {
2031
2087
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
2032
2088
  let t = e;
2033
2089
  for (; t; ) {
2034
- for (const r of Jr)
2090
+ for (const r of Zr)
2035
2091
  if (t.matches(r)) return !0;
2036
2092
  t = t.parentElement;
2037
2093
  }
@@ -2041,58 +2097,72 @@ function ut(e) {
2041
2097
  if (typeof window > "u") return !0;
2042
2098
  const t = e.getBoundingClientRect();
2043
2099
  if (t.width <= 0 || t.height <= 0) return !1;
2044
- const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
2045
- return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
2100
+ const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
2101
+ return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
2046
2102
  }
2047
- function mn(e) {
2103
+ function gn(e) {
2048
2104
  const t = e.getAttribute("id");
2049
2105
  if (t) {
2050
- const i = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${i}"]`);
2106
+ const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
2051
2107
  if (s != null && s.textContent) return s.textContent.trim();
2052
2108
  }
2053
2109
  const r = e.getAttribute("aria-label");
2054
2110
  if (r) return r.trim();
2055
- const o = e.getAttribute("placeholder");
2056
- if (o) return o.trim();
2057
- const l = e.closest("label");
2058
- return l != null && l.textContent ? l.textContent.trim() : "";
2111
+ const i = e.closest("label");
2112
+ if (i) {
2113
+ const o = [];
2114
+ for (const l of Array.from(i.childNodes))
2115
+ if (l.nodeType === Node.TEXT_NODE) {
2116
+ const c = (l.textContent || "").trim();
2117
+ c && o.push(c);
2118
+ } else if (l instanceof HTMLElement) {
2119
+ if (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement || l instanceof HTMLButtonElement)
2120
+ continue;
2121
+ const c = (l.textContent || "").trim();
2122
+ c && o.push(c);
2123
+ }
2124
+ const s = o.join(" ").trim();
2125
+ if (s) return s;
2126
+ }
2127
+ const a = e.getAttribute("placeholder");
2128
+ return a ? a.trim() : "";
2059
2129
  }
2060
- function xe(e, t) {
2130
+ function re(e, t) {
2061
2131
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
2062
2132
  }
2063
- function Xr(e) {
2133
+ function Qr(e) {
2064
2134
  return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2065
2135
  }
2066
- function Qr(e) {
2136
+ function ei(e) {
2067
2137
  const t = e.getAttribute("aria-label");
2068
2138
  if (t) return t.trim().slice(0, 80);
2069
2139
  const r = e.getAttribute("aria-labelledby");
2070
2140
  if (r) {
2071
- const i = document.getElementById(r);
2072
- if (i != null && i.textContent) return i.textContent.trim().slice(0, 80);
2141
+ const o = document.getElementById(r);
2142
+ if (o != null && o.textContent) return o.textContent.trim().slice(0, 80);
2073
2143
  }
2074
- const o = e.querySelector(
2144
+ const i = e.querySelector(
2075
2145
  'button[type="submit"], input[type="submit"], button:not([type])'
2076
2146
  );
2077
- if (o) {
2078
- const i = o instanceof HTMLInputElement ? o.value : (o.textContent ?? "").trim();
2079
- if (i && i.length < 60 && !/^(submit|ok|continue)$/i.test(i))
2080
- return i;
2147
+ if (i) {
2148
+ const o = i instanceof HTMLInputElement ? i.value : (i.textContent ?? "").trim();
2149
+ if (o && o.length < 60 && !/^(submit|ok|continue)$/i.test(o))
2150
+ return o;
2081
2151
  }
2082
- let l = e.parentElement;
2083
- for (let i = 0; l && i < 4; i++, l = l.parentElement) {
2084
- const s = l.querySelector("h1, h2, h3, h4");
2152
+ let a = e.parentElement;
2153
+ for (let o = 0; a && o < 4; o++, a = a.parentElement) {
2154
+ const s = a.querySelector("h1, h2, h3, h4");
2085
2155
  if (s != null && s.textContent) {
2086
- const a = s.textContent.trim();
2087
- if (a && a.length < 80) return a;
2156
+ const l = s.textContent.trim();
2157
+ if (l && l.length < 80) return l;
2088
2158
  }
2089
2159
  }
2090
2160
  return null;
2091
2161
  }
2092
- function Ge(e) {
2162
+ function Ke(e) {
2093
2163
  return e.length;
2094
2164
  }
2095
- function Zr(e, t = {}) {
2165
+ function ti(e, t = {}) {
2096
2166
  const r = t.doc ?? (typeof document < "u" ? document : null);
2097
2167
  if (!r)
2098
2168
  return {
@@ -2106,17 +2176,17 @@ function Zr(e, t = {}) {
2106
2176
  forms: [],
2107
2177
  extras: e
2108
2178
  };
2109
- const o = typeof window < "u" && window.location.href || "", l = typeof window < "u" && window.location.pathname || "/", i = r.title || "", s = Array.from(
2179
+ const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o = r.title || "", s = Array.from(
2110
2180
  r.querySelectorAll("[data-ll-region]")
2111
- ), a = [];
2181
+ ), l = [];
2112
2182
  for (const g of s) {
2113
- if (a.length >= Vr) break;
2183
+ if (l.length >= Gr) break;
2114
2184
  if (dt(g) || !ut(g)) continue;
2115
- const P = g.getAttribute("data-ll-region") ?? "", H = g.getAttribute("data-ll-intent") ?? void 0, F = xe(
2185
+ const P = g.getAttribute("data-ll-region") ?? "", O = g.getAttribute("data-ll-intent") ?? void 0, q = re(
2116
2186
  (g.innerText || g.textContent || "").trim(),
2117
- hn * 2
2187
+ mn * 2
2118
2188
  );
2119
- !P || !F || a.push({ id: P, intent: H, text: F });
2189
+ !P || !q || l.push({ id: P, intent: O, text: q });
2120
2190
  }
2121
2191
  const c = [], p = ["H1", "H2", "H3", "H4", "H5", "H6"], v = Array.from(
2122
2192
  r.querySelectorAll("h1, h2, h3, h4, h5, h6")
@@ -2124,106 +2194,132 @@ function Zr(e, t = {}) {
2124
2194
  for (const g of v) {
2125
2195
  if (dt(g) || !ut(g)) continue;
2126
2196
  const P = (g.textContent || "").trim();
2127
- P && c.push(`${g.tagName}: ${xe(P, 200)}`);
2197
+ P && c.push(`${g.tagName}: ${re(P, 200)}`);
2128
2198
  }
2129
2199
  const f = Array.from(r.querySelectorAll("p, li"));
2130
2200
  for (const g of f) {
2131
2201
  if (dt(g) || !ut(g) || p.includes(g.tagName)) continue;
2132
2202
  const P = (g.textContent || "").trim();
2133
- P.length > 10 && c.push(xe(P, hn));
2203
+ P.length > 10 && c.push(re(P, mn));
2134
2204
  }
2135
2205
  const u = c.join(`
2136
- `), I = [], L = Array.from(r.querySelectorAll("a[href]"));
2137
- for (const g of L) {
2138
- if (I.length >= Ur) break;
2206
+ `), R = [], k = Array.from(r.querySelectorAll("a[href]"));
2207
+ for (const g of k) {
2208
+ if (R.length >= Vr) break;
2139
2209
  if (dt(g) || !ut(g)) continue;
2140
- const P = g.getAttribute("href") || "", H = (g.textContent || "").trim();
2141
- !P || !H || I.push({ href: P, text: xe(H, 100) });
2210
+ const P = g.getAttribute("href") || "", O = (g.textContent || "").trim();
2211
+ !P || !O || R.push({ href: P, text: re(O, 100) });
2142
2212
  }
2143
- const _ = [], h = Array.from(
2213
+ const _ = [], m = Array.from(
2144
2214
  r.querySelectorAll(
2145
2215
  "input, textarea, select"
2146
2216
  )
2147
2217
  );
2148
- for (const g of h) {
2149
- if (_.length >= jr) break;
2150
- if (dt(g) || !Tt(g) || !ut(g)) continue;
2151
- const P = mn(g), H = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
2152
- P && _.push({ label: xe(P, 100), type: H });
2218
+ for (const g of m) {
2219
+ if (_.length >= Yr) break;
2220
+ if (dt(g) || !Dt(g) || !ut(g)) continue;
2221
+ const P = gn(g), O = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
2222
+ P && _.push({ label: re(P, 100), type: O });
2153
2223
  }
2154
- const b = Array.from(r.querySelectorAll("form")), S = [];
2224
+ const w = Array.from(r.querySelectorAll("form")), N = [];
2155
2225
  let T = 0;
2156
- for (const g of b) {
2157
- if (S.length >= Yr) break;
2158
- if ($t(g) || g.matches(".ll-widget *, .ll-widget")) continue;
2159
- const P = g.getAttribute("id") || g.getAttribute("name") || Xr(g.getAttribute("data-ll-intent")) || `form_${T++}`, H = g.getAttribute("data-ll-intent") || Qr(g) || void 0, F = Array.from(
2226
+ for (const g of w) {
2227
+ if (N.length >= Kr) break;
2228
+ if (zt(g) || g.matches(".ll-widget *, .ll-widget")) continue;
2229
+ const P = g.getAttribute("id") || g.getAttribute("name") || Qr(g.getAttribute("data-ll-intent")) || `form_${T++}`, O = g.getAttribute("data-ll-intent") || ei(g) || void 0, q = Array.from(
2160
2230
  g.querySelectorAll(
2161
2231
  "input, textarea, select"
2162
2232
  )
2163
- ), ee = [];
2233
+ ), ne = [];
2164
2234
  let B = 0;
2165
- const U = /* @__PURE__ */ new Set();
2166
- for (const M of F) {
2167
- if (ee.length >= Gr) break;
2168
- if (!Tt(M)) continue;
2169
- if (M instanceof HTMLInputElement) {
2170
- const Y = M.type;
2171
- if (Y === "submit" || Y === "button" || Y === "reset" || Y === "hidden" || Y === "image" || Y === "file") continue;
2235
+ const j = /* @__PURE__ */ new Set();
2236
+ for (const C of q) {
2237
+ if (ne.length >= Jr) break;
2238
+ if (!Dt(C)) continue;
2239
+ if (C instanceof HTMLInputElement) {
2240
+ const W = C.type;
2241
+ if (W === "submit" || W === "button" || W === "reset" || W === "hidden" || W === "image" || W === "file") continue;
2172
2242
  }
2173
- const J = M.getAttribute("name") || "", ye = M.getAttribute("id") || "";
2174
- let ie = J || ye || `field_${B}`;
2175
- U.has(ie) && (ie = `${ie}__${B}`), U.add(ie), B++;
2176
- const ze = mn(M) || ie, Oe = M instanceof HTMLInputElement ? M.type : M.tagName.toLowerCase(), ve = {
2177
- name: ie,
2178
- label: xe(ze, 100),
2179
- type: Oe
2243
+ const Z = C.getAttribute("name") || "", we = C.getAttribute("id") || "";
2244
+ let ce = Z || we || `field_${B}`;
2245
+ j.has(ce) && (ce = `${ce}__${B}`), j.add(ce), B++;
2246
+ const ze = gn(C) || ce, He = C instanceof HTMLInputElement ? C.type : C.tagName.toLowerCase(), X = {
2247
+ name: ce,
2248
+ label: re(ze, 100),
2249
+ type: He
2180
2250
  };
2181
- if (M.required === !0 && (ve.required = !0), M instanceof HTMLSelectElement) {
2182
- const Y = [];
2183
- for (let X = 0; X < M.options.length && !(Y.length >= Kr); X++) {
2184
- const be = M.options[X];
2185
- if (!be || be.disabled) continue;
2186
- const we = be.value || "", Se = (be.textContent || "").trim() || we;
2187
- !we && !Se || Y.push({ value: we, label: xe(Se, 60) });
2251
+ C.required === !0 && (X.required = !0);
2252
+ const Se = C.getAttribute("placeholder");
2253
+ if (Se && (X.placeholder = re(Se.trim(), 100)), C instanceof HTMLInputElement || C instanceof HTMLTextAreaElement) {
2254
+ const W = C.getAttribute("minlength");
2255
+ if (W !== null) {
2256
+ const Y = parseInt(W, 10);
2257
+ !Number.isNaN(Y) && Y >= 0 && (X.minLength = Y);
2258
+ }
2259
+ const ie = C.getAttribute("maxlength");
2260
+ if (ie !== null) {
2261
+ const Y = parseInt(ie, 10);
2262
+ !Number.isNaN(Y) && Y >= 0 && (X.maxLength = Y);
2263
+ }
2264
+ }
2265
+ if (C instanceof HTMLInputElement) {
2266
+ const W = C.getAttribute("min");
2267
+ W !== null && (X.min = re(W, 50));
2268
+ const ie = C.getAttribute("max");
2269
+ ie !== null && (X.max = re(ie, 50));
2270
+ const Y = C.getAttribute("step");
2271
+ Y !== null && (X.step = re(Y, 20));
2272
+ const fe = C.getAttribute("pattern");
2273
+ fe !== null && (X.pattern = re(fe, 200));
2274
+ const K = (C.getAttribute("autocomplete") || "").toLowerCase();
2275
+ K && K !== "off" && !K.startsWith("cc-") && (X.autocomplete = re(K, 50));
2276
+ }
2277
+ if (C instanceof HTMLSelectElement) {
2278
+ const W = [];
2279
+ for (let ie = 0; ie < C.options.length && !(W.length >= Xr); ie++) {
2280
+ const Y = C.options[ie];
2281
+ if (!Y || Y.disabled) continue;
2282
+ const fe = Y.value || "", K = (Y.textContent || "").trim() || fe;
2283
+ !fe && !K || W.push({ value: fe, label: re(K, 60) });
2188
2284
  }
2189
- Y.length > 0 && (ve.options = Y);
2285
+ W.length > 0 && (X.options = W);
2190
2286
  }
2191
- const Ee = typeof M.validationMessage == "string" ? M.validationMessage : "";
2192
- Ee && (ve.validationMessage = xe(Ee, 200)), ee.push(ve);
2287
+ const _e = typeof C.validationMessage == "string" ? C.validationMessage : "";
2288
+ _e && (X.validationMessage = re(_e, 200)), ne.push(X);
2193
2289
  }
2194
- S.push({ id: P, intent: H, fields: ee });
2290
+ N.push({ id: P, intent: O, fields: ne });
2195
2291
  }
2196
- const A = {
2197
- url: o,
2198
- title: i,
2199
- pathname: l,
2200
- regions: a,
2292
+ const I = {
2293
+ url: i,
2294
+ title: o,
2295
+ pathname: a,
2296
+ regions: l,
2201
2297
  visibleText: u,
2202
- visibleLinks: I,
2298
+ visibleLinks: R,
2203
2299
  visibleFields: _,
2204
- forms: S,
2300
+ forms: N,
2205
2301
  extras: e
2206
2302
  };
2207
- let q = Ge(JSON.stringify(A.regions)) + Ge(A.visibleText) + Ge(JSON.stringify(A.visibleLinks)) + Ge(JSON.stringify(A.visibleFields));
2208
- for (; q > wt && A.visibleFields.length > 0; )
2209
- A.visibleFields.pop(), q = Ge(JSON.stringify(A.visibleFields));
2210
- for (; q > wt && A.visibleLinks.length > 0; )
2211
- A.visibleLinks.pop(), q -= 80;
2212
- return Ge(A.visibleText) > wt && (A.visibleText = xe(A.visibleText, wt - 100)), A;
2213
- }
2214
- let Ke = null;
2215
- function gn(e, t = {}) {
2216
- const r = Date.now(), l = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
2217
- if (Ke && Ke.key === l && r - Ke.at < 1e3)
2218
- return Ke.ctx;
2219
- const i = Zr(e, t);
2220
- return Ke = { key: l, at: r, ctx: i }, i;
2221
- }
2222
- function eo() {
2223
- Ke = null;
2224
- }
2225
- const to = 200;
2226
- function no(e) {
2303
+ let U = Ke(JSON.stringify(I.regions)) + Ke(I.visibleText) + Ke(JSON.stringify(I.visibleLinks)) + Ke(JSON.stringify(I.visibleFields));
2304
+ for (; U > _t && I.visibleFields.length > 0; )
2305
+ I.visibleFields.pop(), U = Ke(JSON.stringify(I.visibleFields));
2306
+ for (; U > _t && I.visibleLinks.length > 0; )
2307
+ I.visibleLinks.pop(), U -= 80;
2308
+ return Ke(I.visibleText) > _t && (I.visibleText = re(I.visibleText, _t - 100)), I;
2309
+ }
2310
+ let Je = null;
2311
+ function yn(e, t = {}) {
2312
+ const r = Date.now(), a = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
2313
+ if (Je && Je.key === a && r - Je.at < 1e3)
2314
+ return Je.ctx;
2315
+ const o = ti(e, t);
2316
+ return Je = { key: a, at: r, ctx: o }, o;
2317
+ }
2318
+ function ni() {
2319
+ Je = null;
2320
+ }
2321
+ const ri = 200;
2322
+ function ii(e) {
2227
2323
  const t = String(e.href || "");
2228
2324
  return {
2229
2325
  href: t,
@@ -2233,47 +2329,47 @@ function no(e) {
2233
2329
  description: e.description
2234
2330
  };
2235
2331
  }
2236
- function ro(e) {
2332
+ function oi(e) {
2237
2333
  return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
2238
2334
  }
2239
- function oo(e) {
2335
+ function li(e) {
2240
2336
  const t = e ?? (typeof document < "u" ? document : null);
2241
2337
  if (!t) return [];
2242
- const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), l = [], i = Array.from(t.querySelectorAll("a[href]"));
2243
- for (const s of i) {
2244
- if (l.length >= to) break;
2245
- if ($t(s)) continue;
2246
- const a = s.getAttribute("href") || "";
2247
- if (!ro(a)) continue;
2248
- let c = a, p = !0;
2338
+ const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [], o = Array.from(t.querySelectorAll("a[href]"));
2339
+ for (const s of o) {
2340
+ if (a.length >= ri) break;
2341
+ if (zt(s)) continue;
2342
+ const l = s.getAttribute("href") || "";
2343
+ if (!oi(l)) continue;
2344
+ let c = l, p = !0;
2249
2345
  try {
2250
2346
  if (typeof window < "u") {
2251
- const f = new URL(a, r);
2252
- p = f.origin === r, p && a.startsWith("http") && (c = f.pathname + f.search + f.hash);
2347
+ const f = new URL(l, r);
2348
+ p = f.origin === r, p && l.startsWith("http") && (c = f.pathname + f.search + f.hash);
2253
2349
  }
2254
2350
  } catch {
2255
2351
  continue;
2256
2352
  }
2257
- if (o.has(c)) continue;
2258
- o.add(c);
2353
+ if (i.has(c)) continue;
2354
+ i.add(c);
2259
2355
  const v = (s.textContent || "").trim().slice(0, 120);
2260
- l.push({ href: c, text: v, internal: p });
2356
+ a.push({ href: c, text: v, internal: p });
2261
2357
  }
2262
- return l;
2358
+ return a;
2263
2359
  }
2264
- let Je = null;
2265
- const io = 5e3;
2266
- function Rt() {
2360
+ let Xe = null;
2361
+ const ai = 5e3;
2362
+ function Mt() {
2267
2363
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
2268
- if (Je && Je.pathname === t && e - Je.at < io)
2269
- return Je.routes;
2270
- const r = oo();
2271
- return Je = { at: e, pathname: t, routes: r }, r;
2364
+ if (Xe && Xe.pathname === t && e - Xe.at < ai)
2365
+ return Xe.routes;
2366
+ const r = li();
2367
+ return Xe = { at: e, pathname: t, routes: r }, r;
2272
2368
  }
2273
- function lo() {
2274
- Je = null;
2369
+ function si() {
2370
+ Xe = null;
2275
2371
  }
2276
- function yn(e) {
2372
+ function vn(e) {
2277
2373
  if (e instanceof HTMLInputElement) {
2278
2374
  const t = e.type;
2279
2375
  if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
@@ -2281,53 +2377,53 @@ function yn(e) {
2281
2377
  }
2282
2378
  return !0;
2283
2379
  }
2284
- function ao(e, t) {
2380
+ function ci(e, t) {
2285
2381
  return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
2286
2382
  }
2287
- function so(e, t) {
2383
+ function di(e, t) {
2288
2384
  if (!t) return null;
2289
2385
  try {
2290
- const i = e.querySelector(
2386
+ const o = e.querySelector(
2291
2387
  `[name="${t.replace(/"/g, '\\"')}"]`
2292
2388
  );
2293
- if (i && yn(i)) return i;
2389
+ if (o && vn(o)) return o;
2294
2390
  } catch {
2295
2391
  }
2296
2392
  const r = Array.from(
2297
2393
  e.querySelectorAll("input, textarea, select")
2298
2394
  );
2299
- let o = 0;
2300
- const l = /* @__PURE__ */ new Map();
2301
- for (const i of r) {
2302
- if (!yn(i)) continue;
2303
- const s = ao(i, o);
2304
- let a = s;
2305
- if (l.has(s) && (a = `${s}__${o}`), a === t) return i;
2306
- l.set(s, i), o++;
2395
+ let i = 0;
2396
+ const a = /* @__PURE__ */ new Map();
2397
+ for (const o of r) {
2398
+ if (!vn(o)) continue;
2399
+ const s = ci(o, i);
2400
+ let l = s;
2401
+ if (a.has(s) && (l = `${s}__${i}`), l === t) return o;
2402
+ a.set(s, o), i++;
2307
2403
  }
2308
2404
  return null;
2309
2405
  }
2310
- function vn(e, t) {
2311
- const r = so(e, t);
2312
- return r ? Tt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2406
+ function bn(e, t) {
2407
+ const r = di(e, t);
2408
+ return r ? Dt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2313
2409
  }
2314
- function co(e, t) {
2315
- const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, o = Object.getOwnPropertyDescriptor(r, "value"), l = o == null ? void 0 : o.set;
2316
- l ? l.call(e, t) : e.value = t;
2410
+ function ui(e, t) {
2411
+ const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(r, "value"), a = i == null ? void 0 : i.set;
2412
+ a ? a.call(e, t) : e.value = t;
2317
2413
  }
2318
- function uo(e, t, r = {}) {
2319
- const o = r.triggerInput ?? !0, l = r.triggerChange ?? !0;
2414
+ function fi(e, t, r = {}) {
2415
+ const i = r.triggerInput ?? !0, a = r.triggerChange ?? !0;
2320
2416
  if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
2321
- const i = Object.getOwnPropertyDescriptor(
2417
+ const o = Object.getOwnPropertyDescriptor(
2322
2418
  HTMLInputElement.prototype,
2323
2419
  "checked"
2324
- ), s = i == null ? void 0 : i.set, a = t === "true" || t === "1" || t === "on";
2325
- s ? s.call(e, a) : e.checked = a, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2420
+ ), s = o == null ? void 0 : o.set, l = t === "true" || t === "1" || t === "on";
2421
+ s ? s.call(e, l) : e.checked = l, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2326
2422
  return;
2327
2423
  }
2328
- co(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2424
+ ui(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2329
2425
  }
2330
- function bn(e, t) {
2426
+ function wn(e, t) {
2331
2427
  if (!t) return null;
2332
2428
  const r = t.replace(/"/g, '\\"');
2333
2429
  try {
@@ -2337,34 +2433,34 @@ function bn(e, t) {
2337
2433
  if (s) return s;
2338
2434
  } catch {
2339
2435
  }
2340
- const o = e.querySelector(
2436
+ const i = e.querySelector(
2341
2437
  `form[name="${r}"]`
2342
2438
  );
2343
- if (o) return o;
2344
- const l = e.querySelector(
2439
+ if (i) return i;
2440
+ const a = e.querySelector(
2345
2441
  `form[data-ll-intent="${r}"]`
2346
2442
  );
2347
- if (l) return l;
2348
- const i = Array.from(e.querySelectorAll("form"));
2349
- for (const s of i) {
2350
- const a = s.getAttribute("data-ll-intent");
2351
- if (a && fo(a) === t) return s;
2443
+ if (a) return a;
2444
+ const o = Array.from(e.querySelectorAll("form"));
2445
+ for (const s of o) {
2446
+ const l = s.getAttribute("data-ll-intent");
2447
+ if (l && pi(l) === t) return s;
2352
2448
  }
2353
2449
  if (/^form_\d+$/.test(t)) {
2354
2450
  const s = parseInt(t.slice(5), 10);
2355
- let a = 0;
2356
- for (const c of i)
2451
+ let l = 0;
2452
+ for (const c of o)
2357
2453
  if (!(c.id || c.getAttribute("name") || c.getAttribute("data-ll-intent"))) {
2358
- if (a === s) return c;
2359
- a++;
2454
+ if (l === s) return c;
2455
+ l++;
2360
2456
  }
2361
2457
  }
2362
2458
  return null;
2363
2459
  }
2364
- function fo(e) {
2460
+ function pi(e) {
2365
2461
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2366
2462
  }
2367
- function po() {
2463
+ function hi() {
2368
2464
  if (typeof window > "u" || typeof document > "u")
2369
2465
  return !1;
2370
2466
  const e = document.scrollingElement || document.documentElement;
@@ -2372,44 +2468,44 @@ function po() {
2372
2468
  const t = window.getComputedStyle(e);
2373
2469
  return !(t.overflowY === "hidden" || t.overflowY === "clip");
2374
2470
  }
2375
- function ho(e) {
2471
+ function mi(e) {
2376
2472
  if (!(e instanceof HTMLElement)) return !1;
2377
2473
  const r = window.getComputedStyle(e).overflowY;
2378
2474
  return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
2379
2475
  }
2380
- function mo() {
2476
+ function gi() {
2381
2477
  if (typeof document > "u") return null;
2382
2478
  const e = Array.from(
2383
2479
  document.querySelectorAll("body, body *")
2384
2480
  );
2385
2481
  let t = null, r = 0;
2386
- for (const o of e) {
2387
- if (!ho(o)) continue;
2388
- const l = o.getBoundingClientRect();
2389
- if (l.bottom <= 0 || l.top >= window.innerHeight || l.right <= 0 || l.left >= window.innerWidth || l.width <= 0 || l.height <= 0 || o.closest(".ll-widget")) continue;
2390
- const i = l.width * l.height;
2391
- i > r && (r = i, t = o);
2482
+ for (const i of e) {
2483
+ if (!mi(i)) continue;
2484
+ const a = i.getBoundingClientRect();
2485
+ 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;
2486
+ const o = a.width * a.height;
2487
+ o > r && (r = o, t = i);
2392
2488
  }
2393
2489
  return t;
2394
2490
  }
2395
- function go() {
2491
+ function yi() {
2396
2492
  if (typeof window > "u")
2397
2493
  return null;
2398
- if (po()) return window;
2399
- const e = mo();
2494
+ if (hi()) return window;
2495
+ const e = gi();
2400
2496
  return e || window;
2401
2497
  }
2402
- function wn(e) {
2498
+ function _n(e) {
2403
2499
  return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
2404
2500
  }
2405
- function yo(e) {
2501
+ function vi(e) {
2406
2502
  var t, r;
2407
2503
  return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
2408
2504
  ((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
2409
2505
  ((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
2410
2506
  ) : e.scrollHeight - e.clientHeight;
2411
2507
  }
2412
- const vo = /* @__PURE__ */ new Set([
2508
+ const bi = /* @__PURE__ */ new Set([
2413
2509
  "agent_state",
2414
2510
  "avatar_stream_ready",
2415
2511
  "avatar_active",
@@ -2439,56 +2535,56 @@ const vo = /* @__PURE__ */ new Set([
2439
2535
  // to onAgentCommand.
2440
2536
  "task_field_updated",
2441
2537
  "task_completed"
2442
- ]), In = Dt(
2538
+ ]), Rn = Pt(
2443
2539
  function(t, r) {
2444
- var Yt, Gt, Kt, Jt, Xt, Qt, Zt;
2540
+ var Gt, Kt, Jt, Xt, Zt, Qt, en;
2445
2541
  const {
2446
- agentId: o,
2447
- apiKey: l,
2448
- baseUrl: i = "https://app.livelayer.studio",
2542
+ agentId: i,
2543
+ apiKey: a,
2544
+ baseUrl: o = "https://app.livelayer.studio",
2449
2545
  sessionEndpoint: s,
2450
- sessionBody: a,
2546
+ sessionBody: l,
2451
2547
  soundEffects: c,
2452
2548
  experienceMode: p = "WIDGET",
2453
2549
  autoConnect: v = !1,
2454
2550
  displayMode: f,
2455
2551
  defaultDisplayMode: u = "expanded",
2456
- onDisplayModeChange: I,
2457
- position: L = "bottom-right",
2552
+ onDisplayModeChange: R,
2553
+ position: k = "bottom-right",
2458
2554
  mobileBreakpoint: _ = 640,
2459
- persistKey: h = "ll-widget",
2460
- disablePersistence: b = !1,
2461
- teamMembers: S,
2555
+ persistKey: m = "ll-widget",
2556
+ disablePersistence: w = !1,
2557
+ teamMembers: N,
2462
2558
  currentTeamMemberId: T,
2463
- onTeamMemberChange: A,
2464
- idleLoopUrl: q,
2559
+ onTeamMemberChange: I,
2560
+ idleLoopUrl: U,
2465
2561
  greeting: g,
2466
2562
  avatarImageUrl: P,
2467
- agentName: H,
2468
- branding: F = {},
2469
- allowCamera: ee = !0,
2563
+ agentName: O,
2564
+ branding: q = {},
2565
+ allowCamera: ne = !0,
2470
2566
  allowScreenShare: B = !0,
2471
- allowTyping: U = !0,
2472
- showMinimize: M,
2473
- showClose: J,
2474
- chromeless: ye = !1,
2475
- floatingChromeContainer: ie = null,
2567
+ allowTyping: j = !0,
2568
+ showMinimize: C,
2569
+ showClose: Z,
2570
+ chromeless: we = !1,
2571
+ floatingChromeContainer: ce = null,
2476
2572
  compactControls: ze = !1,
2477
- transforming: Oe = !1,
2478
- transformingLabel: ve = "Transforming…",
2479
- showOn: Ee,
2480
- hideOn: Y,
2481
- pathname: X,
2482
- onNavigate: be,
2483
- onScrollToSelector: we,
2484
- getPageContext: Se,
2485
- pageContextExtras: se,
2573
+ transforming: He = !1,
2574
+ transformingLabel: X = "Transforming…",
2575
+ showOn: Se,
2576
+ hideOn: _e,
2577
+ pathname: W,
2578
+ onNavigate: ie,
2579
+ onScrollToSelector: Y,
2580
+ getPageContext: fe,
2581
+ pageContextExtras: K,
2486
2582
  getRoutes: Qe,
2487
- onScrollPage: Ze,
2583
+ onScrollPage: et,
2488
2584
  onClick: ft,
2489
- capabilities: et,
2585
+ capabilities: tt,
2490
2586
  onConnect: Ne,
2491
- onDisconnect: He,
2587
+ onDisconnect: Oe,
2492
2588
  onTranscript: Ae,
2493
2589
  onAgentState: Be,
2494
2590
  onConnectionStateChange: Ie,
@@ -2496,47 +2592,47 @@ const vo = /* @__PURE__ */ new Set([
2496
2592
  onAgentCommand: Me,
2497
2593
  onCollect: Te,
2498
2594
  controlledSession: $,
2499
- className: xt,
2595
+ className: Lt,
2500
2596
  style: De,
2501
2597
  zIndex: We = 2147483647
2502
- } = t, ce = yr(X), tt = Lr(ce, Ee, Y);
2503
- R(() => {
2504
- eo(), lo();
2505
- }, [ce]);
2506
- const Pe = T !== void 0, [Fe, kt] = E(() => {
2598
+ } = t, pe = yr(W), nt = kr(pe, Se, _e);
2599
+ M(() => {
2600
+ ni(), si();
2601
+ }, [pe]);
2602
+ const Pe = T !== void 0, [Fe, kt] = S(() => {
2507
2603
  var y;
2508
- return T ?? ((y = S == null ? void 0 : S[0]) == null ? void 0 : y.id);
2509
- }), ke = Pe ? T : Fe, te = Xe(
2510
- () => (S == null ? void 0 : S.find((y) => y.id === ke)) ?? null,
2511
- [S, ke]
2512
- ), nt = (te == null ? void 0 : te.agentId) ?? o, ue = p === "EMBEDDED", [qe, Ue] = pr({
2604
+ return T ?? ((y = N == null ? void 0 : N[0]) == null ? void 0 : y.id);
2605
+ }), ke = Pe ? T : Fe, oe = Ze(
2606
+ () => (N == null ? void 0 : N.find((y) => y.id === ke)) ?? null,
2607
+ [N, ke]
2608
+ ), rt = (oe == null ? void 0 : oe.agentId) ?? i, me = p === "EMBEDDED", [qe, Ue] = pr({
2513
2609
  value: f,
2514
2610
  defaultValue: u,
2515
- onChange: I,
2516
- persistKey: h,
2517
- disablePersistence: ue || b
2518
- }), ne = ue ? "expanded" : qe, le = ue ? () => {
2519
- } : Ue, pt = M ?? !ue, ht = J ?? !ue, Le = mr(_), rt = tr(), oe = nr(), ae = or(), Ce = ir(), ot = lr(), [Lt, fe] = E(!1), [pe, it] = E(!1), [je, lt] = E(!1), [mt, m] = E(!1), [G, Rn] = E(!1), gt = Er({ baseUrl: i, config: c }), yt = N(gt);
2520
- yt.current = gt;
2521
- const Ct = N(be), Et = N(we), St = N(Ze), Nt = N(ft), zt = N(Se), Ot = N(se), Ht = N(Qe), At = N(et), he = N(null);
2522
- Ct.current = be, Et.current = we, St.current = Ze, Nt.current = ft, zt.current = Se, Ot.current = se, Ht.current = Qe, At.current = et;
2523
- function me(y) {
2524
- const d = At.current;
2611
+ onChange: R,
2612
+ persistKey: m,
2613
+ disablePersistence: me || w
2614
+ }), le = me ? "expanded" : qe, de = me ? () => {
2615
+ } : Ue, pt = C ?? !me, ht = Z ?? !me, Ce = mr(_), it = tr(), se = nr(), ue = ir(), Ee = or(), ot = lr(), [mt, lt] = S(!1), [ge, xe] = S(!1), [je, Ve] = S(!1), [Ct, gt] = S(!1), [h, Q] = S(!1), yt = Er({ baseUrl: o, config: c }), vt = A(yt);
2616
+ vt.current = yt;
2617
+ const Et = A(ie), St = A(Y), Nt = A(et), At = A(ft), Ht = A(fe), Ot = A(K), Bt = A(Qe), It = A(tt), ye = A(null);
2618
+ Et.current = ie, St.current = Y, Nt.current = et, At.current = ft, Ht.current = fe, Ot.current = K, Bt.current = Qe, It.current = tt;
2619
+ function ve(y) {
2620
+ const d = It.current;
2525
2621
  return d ? d.includes(y) : !0;
2526
2622
  }
2527
- function ge(y, d) {
2623
+ function be(y, d) {
2528
2624
  console.warn(
2529
2625
  `[LiveLayer] Agent command "${y}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
2530
2626
  );
2531
2627
  }
2532
- const at = C(
2628
+ const at = E(
2533
2629
  (y) => {
2534
- var K, de, _e, ct;
2630
+ var J, he, Le, ct;
2535
2631
  const d = y;
2536
2632
  if (!(!d.type || typeof d.type != "string")) {
2537
2633
  if (Re == null || Re({ eventName: d.type, data: y }), d.type === "navigate") {
2538
- if (!me("navigate")) {
2539
- ge("navigate", "navigate");
2634
+ if (!ve("navigate")) {
2635
+ be("navigate", "navigate");
2540
2636
  return;
2541
2637
  }
2542
2638
  const x = typeof d.href == "string" ? d.href : null;
@@ -2546,9 +2642,9 @@ const vo = /* @__PURE__ */ new Set([
2546
2642
  );
2547
2643
  return;
2548
2644
  }
2549
- if (yt.current.playPageChange(), Ct.current) {
2645
+ if (vt.current.playPageChange(), Et.current) {
2550
2646
  try {
2551
- Ct.current(x);
2647
+ Et.current(x);
2552
2648
  } catch (D) {
2553
2649
  console.warn(
2554
2650
  `[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
@@ -2578,41 +2674,41 @@ const vo = /* @__PURE__ */ new Set([
2578
2674
  return;
2579
2675
  }
2580
2676
  if (d.type === "scroll_to") {
2581
- if (!me("scroll")) {
2582
- ge("scroll_to", "scroll");
2677
+ if (!ve("scroll")) {
2678
+ be("scroll_to", "scroll");
2583
2679
  return;
2584
2680
  }
2585
2681
  const x = typeof d.selector == "string" ? d.selector : null;
2586
2682
  if (!x) return;
2587
2683
  const D = d.behavior === "instant" ? "instant" : "smooth";
2588
- if (Et.current) {
2684
+ if (St.current) {
2589
2685
  try {
2590
- Et.current(
2686
+ St.current(
2591
2687
  x,
2592
2688
  D
2593
2689
  );
2594
- } catch (W) {
2595
- console.warn("[LiveLayer] onScrollToSelector threw.", W);
2690
+ } catch (F) {
2691
+ console.warn("[LiveLayer] onScrollToSelector threw.", F);
2596
2692
  }
2597
2693
  return;
2598
2694
  }
2599
2695
  if (typeof document < "u") {
2600
- let W = null;
2696
+ let F = null;
2601
2697
  try {
2602
- W = document.querySelector(x);
2698
+ F = document.querySelector(x);
2603
2699
  } catch {
2604
2700
  console.warn(
2605
2701
  `[LiveLayer] scroll_to: invalid selector "${x}".`
2606
2702
  );
2607
2703
  return;
2608
2704
  }
2609
- if (!W) {
2705
+ if (!F) {
2610
2706
  console.warn(
2611
2707
  `[LiveLayer] scroll_to: no element matched "${x}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
2612
2708
  );
2613
2709
  return;
2614
2710
  }
2615
- W.scrollIntoView({
2711
+ F.scrollIntoView({
2616
2712
  behavior: D,
2617
2713
  block: "start"
2618
2714
  });
@@ -2620,56 +2716,56 @@ const vo = /* @__PURE__ */ new Set([
2620
2716
  return;
2621
2717
  }
2622
2718
  if (d.type === "request_page_context") {
2623
- if (!me("read_page")) {
2624
- ge("request_page_context", "read_page");
2719
+ if (!ve("read_page")) {
2720
+ be("request_page_context", "read_page");
2625
2721
  return;
2626
2722
  }
2627
- const x = typeof d.requestId == "string" ? d.requestId : void 0, D = (K = he.current) == null ? void 0 : K.call(he), W = (V) => {
2628
- const z = D, Z = z == null ? void 0 : z.localParticipant;
2629
- if (Z != null && Z.publishData)
2723
+ const x = typeof d.requestId == "string" ? d.requestId : void 0, D = (J = ye.current) == null ? void 0 : J.call(ye), F = (G) => {
2724
+ const z = D, te = z == null ? void 0 : z.localParticipant;
2725
+ if (te != null && te.publishData)
2630
2726
  try {
2631
- const re = x ? { ...V, requestId: x } : V, Ye = new TextEncoder().encode(JSON.stringify(re));
2632
- Z.publishData(Ye, { reliable: !0 });
2633
- } catch (re) {
2634
- console.warn("[LiveLayer] publishData failed.", re);
2727
+ const ae = x ? { ...G, requestId: x } : G, Ge = new TextEncoder().encode(JSON.stringify(ae));
2728
+ te.publishData(Ge, { reliable: !0 });
2729
+ } catch (ae) {
2730
+ console.warn("[LiveLayer] publishData failed.", ae);
2635
2731
  }
2636
- }, O = Ot.current, j = zt.current;
2732
+ }, H = Ot.current, V = Ht.current;
2637
2733
  try {
2638
- if (j) {
2639
- const V = j(O);
2640
- if (V instanceof Promise) {
2641
- W({ type: "page_context_pending" }), V.then((z) => W({ type: "page_context", context: z })).catch((z) => {
2734
+ if (V) {
2735
+ const G = V(H);
2736
+ if (G instanceof Promise) {
2737
+ F({ type: "page_context_pending" }), G.then((z) => F({ type: "page_context", context: z })).catch((z) => {
2642
2738
  console.warn(
2643
2739
  "[LiveLayer] getPageContext rejected; falling back to default walker.",
2644
2740
  z
2645
- ), W({
2741
+ ), F({
2646
2742
  type: "page_context",
2647
- context: gn(O)
2743
+ context: yn(H)
2648
2744
  });
2649
2745
  });
2650
2746
  return;
2651
2747
  }
2652
- W({ type: "page_context", context: V });
2748
+ F({ type: "page_context", context: G });
2653
2749
  return;
2654
2750
  }
2655
- W({
2751
+ F({
2656
2752
  type: "page_context",
2657
- context: gn(O)
2753
+ context: yn(H)
2658
2754
  });
2659
- } catch (V) {
2755
+ } catch (G) {
2660
2756
  console.warn(
2661
2757
  "[LiveLayer] page-context extraction threw. Sending empty context.",
2662
- V
2663
- ), W({
2758
+ G
2759
+ ), F({
2664
2760
  type: "page_context",
2665
- context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: O }
2761
+ context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: H }
2666
2762
  });
2667
2763
  }
2668
2764
  return;
2669
2765
  }
2670
2766
  if (d.type === "scroll_page") {
2671
- if (!me("scroll")) {
2672
- ge("scroll_page", "scroll");
2767
+ if (!ve("scroll")) {
2768
+ be("scroll_page", "scroll");
2673
2769
  return;
2674
2770
  }
2675
2771
  const x = d.direction;
@@ -2680,9 +2776,9 @@ const vo = /* @__PURE__ */ new Set([
2680
2776
  return;
2681
2777
  }
2682
2778
  const D = d.behavior === "instant" ? "instant" : "smooth";
2683
- if (St.current) {
2779
+ if (Nt.current) {
2684
2780
  try {
2685
- St.current(
2781
+ Nt.current(
2686
2782
  x,
2687
2783
  D
2688
2784
  );
@@ -2692,17 +2788,17 @@ const vo = /* @__PURE__ */ new Set([
2692
2788
  return;
2693
2789
  }
2694
2790
  if (typeof window > "u") return;
2695
- const W = { behavior: D }, O = go(), j = (z) => {
2696
- O instanceof Window ? O.scrollBy({ top: z, ...W }) : O.scrollBy({ top: z, ...W });
2697
- }, V = (z) => {
2698
- O instanceof Window ? O.scrollTo({ top: z, ...W }) : O.scrollTo({ top: z, ...W });
2791
+ const F = { behavior: D }, H = yi(), V = (z) => {
2792
+ H instanceof Window ? H.scrollBy({ top: z, ...F }) : H.scrollBy({ top: z, ...F });
2793
+ }, G = (z) => {
2794
+ H instanceof Window ? H.scrollTo({ top: z, ...F }) : H.scrollTo({ top: z, ...F });
2699
2795
  };
2700
- x === "up" ? j(-wn(O)) : x === "down" ? j(wn(O)) : V(x === "top" ? 0 : yo(O));
2796
+ x === "up" ? V(-_n(H)) : x === "down" ? V(_n(H)) : G(x === "top" ? 0 : vi(H));
2701
2797
  return;
2702
2798
  }
2703
2799
  if (d.type === "click") {
2704
- if (!me("click")) {
2705
- ge("click", "click");
2800
+ if (!ve("click")) {
2801
+ be("click", "click");
2706
2802
  return;
2707
2803
  }
2708
2804
  const x = typeof d.selector == "string" ? d.selector : null;
@@ -2710,11 +2806,11 @@ const vo = /* @__PURE__ */ new Set([
2710
2806
  console.warn("[LiveLayer] click: missing selector.");
2711
2807
  return;
2712
2808
  }
2713
- if (Nt.current) {
2809
+ if (At.current) {
2714
2810
  try {
2715
- Nt.current(x);
2716
- } catch (W) {
2717
- console.warn("[LiveLayer] onClick threw.", W);
2811
+ At.current(x);
2812
+ } catch (F) {
2813
+ console.warn("[LiveLayer] onClick threw.", F);
2718
2814
  }
2719
2815
  return;
2720
2816
  }
@@ -2740,22 +2836,22 @@ const vo = /* @__PURE__ */ new Set([
2740
2836
  );
2741
2837
  return;
2742
2838
  }
2743
- (de = D.click) == null || de.call(D);
2839
+ (he = D.click) == null || he.call(D);
2744
2840
  return;
2745
2841
  }
2746
2842
  if (d.type === "fill_form" || d.type === "focus_field") {
2747
- if (!me("fill_forms")) {
2748
- ge(d.type, "fill_forms");
2843
+ if (!ve("fill_forms")) {
2844
+ be(d.type, "fill_forms");
2749
2845
  return;
2750
2846
  }
2751
2847
  if (typeof document > "u") return;
2752
- d.type === "fill_form" && yt.current.playConfirmation();
2848
+ d.type === "fill_form" && vt.current.playConfirmation();
2753
2849
  const x = typeof d.formId == "string" ? d.formId : null;
2754
2850
  if (!x) {
2755
2851
  console.warn(`[LiveLayer] ${d.type}: missing formId.`);
2756
2852
  return;
2757
2853
  }
2758
- const D = bn(document, x);
2854
+ const D = wn(document, x);
2759
2855
  if (!D) {
2760
2856
  console.warn(
2761
2857
  `[LiveLayer] ${d.type}: no <form> matched id="${x}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
@@ -2769,44 +2865,44 @@ const vo = /* @__PURE__ */ new Set([
2769
2865
  return;
2770
2866
  }
2771
2867
  if (d.type === "focus_field") {
2772
- const O = typeof d.fieldName == "string" ? d.fieldName : null;
2773
- if (!O) {
2868
+ const H = typeof d.fieldName == "string" ? d.fieldName : null;
2869
+ if (!H) {
2774
2870
  console.warn("[LiveLayer] focus_field: missing fieldName.");
2775
2871
  return;
2776
2872
  }
2777
- const j = vn(D, O);
2778
- if (j.el === null) {
2779
- j.reason === "private" ? console.warn(
2780
- `[LiveLayer] focus_field: field "${O}" is privacy-protected and not focusable.`
2873
+ const V = bn(D, H);
2874
+ if (V.el === null) {
2875
+ V.reason === "private" ? console.warn(
2876
+ `[LiveLayer] focus_field: field "${H}" is privacy-protected and not focusable.`
2781
2877
  ) : console.warn(
2782
- `[LiveLayer] focus_field: no input matching key="${O}" in form "${x}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
2878
+ `[LiveLayer] focus_field: no input matching key="${H}" in form "${x}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
2783
2879
  );
2784
2880
  return;
2785
2881
  }
2786
- j.el.focus();
2882
+ V.el.focus();
2787
2883
  return;
2788
2884
  }
2789
- const W = d.values && typeof d.values == "object" ? d.values : null;
2790
- if (!W) {
2885
+ const F = d.values && typeof d.values == "object" ? d.values : null;
2886
+ if (!F) {
2791
2887
  console.warn("[LiveLayer] fill_form: missing or invalid values.");
2792
2888
  return;
2793
2889
  }
2794
- for (const [O, j] of Object.entries(W)) {
2795
- if (typeof j != "string") continue;
2796
- const V = vn(D, O);
2797
- if (V.el === null) {
2798
- V.reason === "private" ? console.warn(
2799
- `[LiveLayer] fill_form: field "${O}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
2890
+ for (const [H, V] of Object.entries(F)) {
2891
+ if (typeof V != "string") continue;
2892
+ const G = bn(D, H);
2893
+ if (G.el === null) {
2894
+ G.reason === "private" ? console.warn(
2895
+ `[LiveLayer] fill_form: field "${H}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
2800
2896
  ) : console.warn(
2801
- `[LiveLayer] fill_form: no input matching key="${O}" in form "${x}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
2897
+ `[LiveLayer] fill_form: no input matching key="${H}" in form "${x}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
2802
2898
  );
2803
2899
  continue;
2804
2900
  }
2805
2901
  try {
2806
- uo(V.el, j);
2902
+ fi(G.el, V);
2807
2903
  } catch (z) {
2808
2904
  console.warn(
2809
- `[LiveLayer] fill_form: failed to set "${O}".`,
2905
+ `[LiveLayer] fill_form: failed to set "${H}".`,
2810
2906
  z
2811
2907
  );
2812
2908
  }
@@ -2814,8 +2910,8 @@ const vo = /* @__PURE__ */ new Set([
2814
2910
  return;
2815
2911
  }
2816
2912
  if (d.type === "submit_form") {
2817
- if (!me("submit_forms")) {
2818
- ge("submit_form", "submit_forms");
2913
+ if (!ve("submit_forms")) {
2914
+ be("submit_form", "submit_forms");
2819
2915
  return;
2820
2916
  }
2821
2917
  if (typeof document > "u") return;
@@ -2824,8 +2920,8 @@ const vo = /* @__PURE__ */ new Set([
2824
2920
  console.warn("[LiveLayer] submit_form: missing formId.");
2825
2921
  return;
2826
2922
  }
2827
- yt.current.playConfirmation();
2828
- const D = bn(document, x);
2923
+ vt.current.playConfirmation();
2924
+ const D = wn(document, x);
2829
2925
  if (!D) {
2830
2926
  console.warn(
2831
2927
  `[LiveLayer] submit_form: no <form> matched id="${x}" (or matching name / data-ll-intent slug).`
@@ -2838,24 +2934,24 @@ const vo = /* @__PURE__ */ new Set([
2838
2934
  );
2839
2935
  return;
2840
2936
  }
2841
- const W = typeof d.requestId == "string" ? d.requestId : void 0, O = (_e = he.current) == null ? void 0 : _e.call(he), j = (Z) => {
2842
- const re = O, Ye = re == null ? void 0 : re.localParticipant;
2843
- if (Ye != null && Ye.publishData)
2937
+ const F = typeof d.requestId == "string" ? d.requestId : void 0, H = (Le = ye.current) == null ? void 0 : Le.call(ye), V = (te) => {
2938
+ const ae = H, Ge = ae == null ? void 0 : ae.localParticipant;
2939
+ if (Ge != null && Ge.publishData)
2844
2940
  try {
2845
- const Un = W ? { ...Z, requestId: W } : Z, jn = new TextEncoder().encode(JSON.stringify(Un));
2846
- Ye.publishData(jn, { reliable: !0 });
2941
+ const Un = F ? { ...te, requestId: F } : te, jn = new TextEncoder().encode(JSON.stringify(Un));
2942
+ Ge.publishData(jn, { reliable: !0 });
2847
2943
  } catch {
2848
2944
  }
2849
2945
  };
2850
- let V = !1;
2946
+ let G = !1;
2851
2947
  const z = () => {
2852
- V = !0, j({ type: "form_submitted", formId: x });
2948
+ G = !0, V({ type: "form_submitted", formId: x });
2853
2949
  };
2854
2950
  D.addEventListener("submit", z, { once: !0 });
2855
2951
  try {
2856
2952
  typeof D.requestSubmit == "function" ? D.requestSubmit() : D.submit();
2857
- } catch (Z) {
2858
- console.warn("[LiveLayer] submit_form: requestSubmit threw.", Z), D.removeEventListener("submit", z), j({
2953
+ } catch (te) {
2954
+ console.warn("[LiveLayer] submit_form: requestSubmit threw.", te), D.removeEventListener("submit", z), V({
2859
2955
  type: "form_submit_blocked",
2860
2956
  formId: x,
2861
2957
  reason: "exception"
@@ -2863,7 +2959,7 @@ const vo = /* @__PURE__ */ new Set([
2863
2959
  return;
2864
2960
  }
2865
2961
  setTimeout(() => {
2866
- V || (D.removeEventListener("submit", z), j({
2962
+ G || (D.removeEventListener("submit", z), V({
2867
2963
  type: "form_submit_blocked",
2868
2964
  formId: x,
2869
2965
  reason: "validation"
@@ -2872,53 +2968,53 @@ const vo = /* @__PURE__ */ new Set([
2872
2968
  return;
2873
2969
  }
2874
2970
  if (d.type === "request_routes") {
2875
- if (!me("read_page")) {
2876
- ge("request_routes", "read_page");
2971
+ if (!ve("read_page")) {
2972
+ be("request_routes", "read_page");
2877
2973
  return;
2878
2974
  }
2879
- const x = typeof d.requestId == "string" ? d.requestId : void 0, W = (ct = he.current) == null ? void 0 : ct.call(he), O = W == null ? void 0 : W.localParticipant;
2880
- if (!(O != null && O.publishData)) return;
2881
- const j = (z) => {
2975
+ const x = typeof d.requestId == "string" ? d.requestId : void 0, F = (ct = ye.current) == null ? void 0 : ct.call(ye), H = F == null ? void 0 : F.localParticipant;
2976
+ if (!(H != null && H.publishData)) return;
2977
+ const V = (z) => {
2882
2978
  try {
2883
- const Z = x ? { type: "routes", routes: z, requestId: x } : { type: "routes", routes: z }, re = new TextEncoder().encode(JSON.stringify(Z));
2884
- O.publishData(re, { reliable: !0 });
2885
- } catch (Z) {
2886
- console.warn("[LiveLayer] request_routes: publishData failed.", Z);
2979
+ const te = x ? { type: "routes", routes: z, requestId: x } : { type: "routes", routes: z }, ae = new TextEncoder().encode(JSON.stringify(te));
2980
+ H.publishData(ae, { reliable: !0 });
2981
+ } catch (te) {
2982
+ console.warn("[LiveLayer] request_routes: publishData failed.", te);
2887
2983
  }
2888
- }, V = Ht.current;
2889
- if (V) {
2984
+ }, G = Bt.current;
2985
+ if (G) {
2890
2986
  try {
2891
- const z = V(), Z = (re) => {
2892
- if (!Array.isArray(re)) {
2893
- j([]);
2987
+ const z = G(), te = (ae) => {
2988
+ if (!Array.isArray(ae)) {
2989
+ V([]);
2894
2990
  return;
2895
2991
  }
2896
- j(re.map(no).slice(0, 200));
2992
+ V(ae.map(ii).slice(0, 200));
2897
2993
  };
2898
- z instanceof Promise ? z.then(Z).catch((re) => {
2994
+ z instanceof Promise ? z.then(te).catch((ae) => {
2899
2995
  console.warn(
2900
2996
  "[LiveLayer] getRoutes rejected; falling back to DOM walker.",
2901
- re
2902
- ), j(Rt());
2903
- }) : Z(z);
2997
+ ae
2998
+ ), V(Mt());
2999
+ }) : te(z);
2904
3000
  } catch (z) {
2905
3001
  console.warn(
2906
3002
  "[LiveLayer] getRoutes threw; falling back to DOM walker.",
2907
3003
  z
2908
- ), j(Rt());
3004
+ ), V(Mt());
2909
3005
  }
2910
3006
  return;
2911
3007
  }
2912
3008
  try {
2913
- j(Rt());
3009
+ V(Mt());
2914
3010
  } catch (z) {
2915
3011
  console.warn("[LiveLayer] request_routes: extractRoutes threw.", z);
2916
3012
  }
2917
3013
  return;
2918
3014
  }
2919
3015
  if (d.type === "task_field_updated") {
2920
- if (!me("collect_data")) {
2921
- ge("task_field_updated", "collect_data");
3016
+ if (!ve("collect_data")) {
3017
+ be("task_field_updated", "collect_data");
2922
3018
  return;
2923
3019
  }
2924
3020
  const x = {
@@ -2941,8 +3037,8 @@ const vo = /* @__PURE__ */ new Set([
2941
3037
  return;
2942
3038
  }
2943
3039
  if (d.type === "task_completed") {
2944
- if (!me("collect_data")) {
2945
- ge("task_completed", "collect_data");
3040
+ if (!ve("collect_data")) {
3041
+ be("task_completed", "collect_data");
2946
3042
  return;
2947
3043
  }
2948
3044
  const x = d.result;
@@ -2970,40 +3066,40 @@ const vo = /* @__PURE__ */ new Set([
2970
3066
  }
2971
3067
  return;
2972
3068
  }
2973
- vo.has(d.type) || Me == null || Me(d);
3069
+ bi.has(d.type) || Me == null || Me(d);
2974
3070
  }
2975
3071
  },
2976
3072
  [Me, Re, Te]
2977
- ), Q = er({
2978
- agentId: $ ? "__controlled__" : nt,
2979
- baseUrl: i,
2980
- apiKey: l,
3073
+ ), ee = er({
3074
+ agentId: $ ? "__controlled__" : rt,
3075
+ baseUrl: o,
3076
+ apiKey: a,
2981
3077
  sessionEndpoint: s,
2982
- sessionBody: a,
3078
+ sessionBody: l,
2983
3079
  onDataMessage: $ ? void 0 : at
2984
3080
  });
2985
- R(() => {
3081
+ M(() => {
2986
3082
  if ($ != null && $.subscribeToDataMessages)
2987
3083
  return $.subscribeToDataMessages(at);
2988
- }, [$, at]), he.current = () => {
3084
+ }, [$, at]), ye.current = () => {
2989
3085
  var y;
2990
- return (y = Q.getRoom) == null ? void 0 : y.call(Q);
2991
- }, R(() => {
2992
- var K;
3086
+ return (y = ee.getRoom) == null ? void 0 : y.call(ee);
3087
+ }, M(() => {
3088
+ var J;
2993
3089
  if (typeof window > "u") return;
2994
- const y = ((K = window.location) == null ? void 0 : K.hostname) || "";
3090
+ const y = ((J = window.location) == null ? void 0 : J.hostname) || "";
2995
3091
  if (y === "localhost" || y === "127.0.0.1" || y === "0.0.0.0" || y.endsWith(".local") || y.endsWith(".test"))
2996
- return window.__livelayerSimulateCommand = (de) => {
3092
+ return window.__livelayerSimulateCommand = (he) => {
2997
3093
  try {
2998
- at(de);
2999
- } catch (_e) {
3000
- console.warn("[LiveLayer] simulate-command threw:", _e);
3094
+ at(he);
3095
+ } catch (Le) {
3096
+ console.warn("[LiveLayer] simulate-command threw:", Le);
3001
3097
  }
3002
3098
  }, () => {
3003
3099
  delete window.__livelayerSimulateCommand;
3004
3100
  };
3005
3101
  }, [at]);
3006
- const k = Xe(() => $ ? {
3102
+ const L = Ze(() => $ ? {
3007
3103
  connectionState: $.connectionState,
3008
3104
  agentState: $.agentState,
3009
3105
  transcript: $.transcript,
@@ -3019,30 +3115,30 @@ const vo = /* @__PURE__ */ new Set([
3019
3115
  // Dummy getRoom for shape compatibility — controlled consumers own the Room.
3020
3116
  // Internal session's getRoom returns null when no real connect has happened,
3021
3117
  // so we reuse its reference for type consistency.
3022
- getRoom: Q.getRoom,
3118
+ getRoom: ee.getRoom,
3023
3119
  isControlled: !0
3024
3120
  } : {
3025
- connectionState: Q.connectionState,
3026
- agentState: Q.agentState,
3027
- transcript: Q.transcript,
3028
- videoElement: Q.videoElement,
3029
- audioElement: Q.audioElement,
3030
- canResume: Q.canResume,
3031
- error: Q.error,
3032
- agentConfig: Q.agentConfig,
3033
- connect: Q.connect,
3034
- disconnect: Q.disconnect,
3035
- getRoom: Q.getRoom,
3121
+ connectionState: ee.connectionState,
3122
+ agentState: ee.agentState,
3123
+ transcript: ee.transcript,
3124
+ videoElement: ee.videoElement,
3125
+ audioElement: ee.audioElement,
3126
+ canResume: ee.canResume,
3127
+ error: ee.error,
3128
+ agentConfig: ee.agentConfig,
3129
+ connect: ee.connect,
3130
+ disconnect: ee.disconnect,
3131
+ getRoom: ee.getRoom,
3036
3132
  isControlled: !1
3037
- }, [$, Q]), Bt = N(k);
3038
- Bt.current = k;
3039
- const Wt = N($);
3040
- Wt.current = $, Yn(
3133
+ }, [$, ee]), Wt = A(L);
3134
+ Wt.current = L;
3135
+ const Ft = A($);
3136
+ Ft.current = $, Yn(
3041
3137
  r,
3042
3138
  () => ({
3043
3139
  sendData: async (y) => {
3044
- var _e, ct;
3045
- const d = Wt.current;
3140
+ var Le, ct;
3141
+ const d = Ft.current;
3046
3142
  if (d != null && d.publishData) {
3047
3143
  try {
3048
3144
  await d.publishData(y);
@@ -3051,11 +3147,11 @@ const vo = /* @__PURE__ */ new Set([
3051
3147
  }
3052
3148
  return;
3053
3149
  }
3054
- const K = (ct = (_e = Bt.current) == null ? void 0 : _e.getRoom) == null ? void 0 : ct.call(_e), de = K == null ? void 0 : K.localParticipant;
3055
- if (de != null && de.publishData)
3150
+ const J = (ct = (Le = Wt.current) == null ? void 0 : Le.getRoom) == null ? void 0 : ct.call(Le), he = J == null ? void 0 : J.localParticipant;
3151
+ if (he != null && he.publishData)
3056
3152
  try {
3057
3153
  const x = new TextEncoder().encode(JSON.stringify(y));
3058
- await de.publishData(x, { reliable: !0 });
3154
+ await he.publishData(x, { reliable: !0 });
3059
3155
  } catch (x) {
3060
3156
  console.warn("[AvatarWidget] sendData failed:", x);
3061
3157
  }
@@ -3063,44 +3159,44 @@ const vo = /* @__PURE__ */ new Set([
3063
3159
  }),
3064
3160
  []
3065
3161
  );
3066
- const Ft = N(null);
3067
- R(() => {
3068
- const y = k.videoElement, d = Ft.current;
3162
+ const qt = A(null);
3163
+ M(() => {
3164
+ const y = L.videoElement, d = qt.current;
3069
3165
  if (!(!y || !d))
3070
3166
  return d.appendChild(y), () => {
3071
3167
  y.parentNode === d && d.removeChild(y);
3072
3168
  };
3073
- }, [k.videoElement]), R(() => {
3074
- const y = k.audioElement;
3169
+ }, [L.videoElement]), M(() => {
3170
+ const y = L.audioElement;
3075
3171
  if (!y) return;
3076
- rt.attach(y);
3172
+ it.attach(y);
3077
3173
  const d = y.play();
3078
- return d && typeof d.catch == "function" && d.catch((K) => {
3079
- (K == null ? void 0 : K.name) === "NotAllowedError" && fe(!0);
3174
+ return d && typeof d.catch == "function" && d.catch((J) => {
3175
+ (J == null ? void 0 : J.name) === "NotAllowedError" && lt(!0);
3080
3176
  }), () => {
3081
- rt.detach();
3177
+ it.detach();
3082
3178
  };
3083
- }, [k.audioElement]), R(() => {
3084
- if (k.isControlled || k.connectionState !== "connected") return;
3085
- const y = k.getRoom();
3179
+ }, [L.audioElement]), M(() => {
3180
+ if (L.isControlled || L.connectionState !== "connected") return;
3181
+ const y = L.getRoom();
3086
3182
  if (y)
3087
- return oe.setupMic(y).catch(() => {
3183
+ return se.setupMic(y).catch(() => {
3088
3184
  }), () => {
3089
- oe.teardownMic();
3185
+ se.teardownMic();
3090
3186
  };
3091
- }, [k.isControlled, k.connectionState]), R(() => {
3187
+ }, [L.isControlled, L.connectionState]), M(() => {
3092
3188
  var d;
3093
- if (k.connectionState !== "connected") return;
3094
- const y = k.isControlled ? (d = $ == null ? void 0 : $.getRoom) == null ? void 0 : d.call($) : k.getRoom();
3189
+ if (L.connectionState !== "connected") return;
3190
+ const y = L.isControlled ? (d = $ == null ? void 0 : $.getRoom) == null ? void 0 : d.call($) : L.getRoom();
3095
3191
  if (y)
3096
- return ae.attachRoom(y), Ce.attachRoom(y), k.isControlled && oe.attachRoom(y), ot.refresh(), () => {
3097
- ae.teardown(), Ce.teardown();
3192
+ return ue.attachRoom(y), Ee.attachRoom(y), L.isControlled && se.attachRoom(y), ot.refresh(), () => {
3193
+ ue.teardown(), Ee.teardown();
3098
3194
  };
3099
- }, [k.isControlled, k.connectionState, $]), R(() => {
3100
- const y = k.audioElement;
3101
- y && (y.muted = G);
3102
- }, [k.audioElement, G]);
3103
- const Mn = C((y) => {
3195
+ }, [L.isControlled, L.connectionState, $]), M(() => {
3196
+ const y = L.audioElement;
3197
+ y && (y.muted = h);
3198
+ }, [L.audioElement, h]);
3199
+ const Mn = E((y) => {
3104
3200
  const d = { type: "user_message", text: y };
3105
3201
  if ($ != null && $.publishData) {
3106
3202
  try {
@@ -3109,356 +3205,356 @@ const vo = /* @__PURE__ */ new Set([
3109
3205
  }
3110
3206
  return;
3111
3207
  }
3112
- const K = k.getRoom();
3113
- if (K)
3208
+ const J = L.getRoom();
3209
+ if (J)
3114
3210
  try {
3115
- const de = new TextEncoder().encode(JSON.stringify(d));
3116
- K.localParticipant.publishData(de, { reliable: !0 });
3211
+ const he = new TextEncoder().encode(JSON.stringify(d));
3212
+ J.localParticipant.publishData(he, { reliable: !0 });
3117
3213
  } catch {
3118
3214
  }
3119
- }, [k, $]), Tn = C(() => {
3120
- Rn((y) => !y);
3215
+ }, [L, $]), Tn = E(() => {
3216
+ Q((y) => !y);
3121
3217
  }, []);
3122
- R(() => {
3123
- Ie == null || Ie(k.connectionState), k.connectionState === "connected" ? Ne == null || Ne() : k.connectionState === "disconnected" && (He == null || He());
3124
- }, [k.connectionState, Ne, He, Ie]), R(() => {
3125
- Ae == null || Ae(k.transcript);
3126
- }, [k.transcript, Ae]), R(() => {
3127
- Be == null || Be(k.agentState);
3128
- }, [k.agentState, Be]), R(() => {
3129
- gt.setThinking(k.agentState === "thinking");
3130
- }, [k.agentState, gt]);
3131
- const qt = N(!1);
3132
- R(() => {
3133
- !v || qt.current || tt && k.connectionState === "idle" && (qt.current = !0, k.connect());
3134
- }, [v, k.connectionState, k, tt]);
3135
- const Dn = C(
3218
+ M(() => {
3219
+ Ie == null || Ie(L.connectionState), L.connectionState === "connected" ? Ne == null || Ne() : L.connectionState === "disconnected" && (Oe == null || Oe());
3220
+ }, [L.connectionState, Ne, Oe, Ie]), M(() => {
3221
+ Ae == null || Ae(L.transcript);
3222
+ }, [L.transcript, Ae]), M(() => {
3223
+ Be == null || Be(L.agentState);
3224
+ }, [L.agentState, Be]), M(() => {
3225
+ yt.setThinking(L.agentState === "thinking");
3226
+ }, [L.agentState, yt]);
3227
+ const Ut = A(!1);
3228
+ M(() => {
3229
+ !v || Ut.current || nt && L.connectionState === "idle" && (Ut.current = !0, L.connect());
3230
+ }, [v, L.connectionState, L, nt]);
3231
+ const Dn = E(
3136
3232
  (y) => {
3137
- const d = S == null ? void 0 : S.find((K) => K.id === y);
3138
- d && (lt(!1), y !== ke && (it(!0), k.disconnect(), Pe || kt(y), A == null || A(d)));
3233
+ const d = N == null ? void 0 : N.find((J) => J.id === y);
3234
+ d && (Ve(!1), y !== ke && (xe(!0), L.disconnect(), Pe || kt(y), I == null || I(d)));
3139
3235
  },
3140
3236
  [
3141
- S,
3237
+ N,
3142
3238
  ke,
3143
- k,
3239
+ L,
3144
3240
  Pe,
3145
- A
3241
+ I
3146
3242
  ]
3147
3243
  );
3148
- R(() => {
3149
- pe && k.connectionState === "connected" && it(!1);
3150
- }, [k.connectionState, pe]), R(() => {
3244
+ M(() => {
3245
+ ge && L.connectionState === "connected" && xe(!1);
3246
+ }, [L.connectionState, ge]), M(() => {
3151
3247
  if (!je) return;
3152
3248
  const y = (d) => {
3153
- d.key === "Escape" && lt(!1);
3249
+ d.key === "Escape" && Ve(!1);
3154
3250
  };
3155
3251
  return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
3156
3252
  }, [je]);
3157
- const Pn = !!P || !!(te != null && te.avatarImageUrl) || k.isControlled, st = ar(nt, i, Pn);
3158
- et === void 0 && ((Yt = st.info) != null && Yt.capabilities) && (At.current = st.info.capabilities);
3159
- const vt = (te == null ? void 0 : te.name) ?? H ?? ((Gt = k.agentConfig) == null ? void 0 : Gt.name) ?? ((Kt = st.info) == null ? void 0 : Kt.name) ?? "Live Layer", It = (te == null ? void 0 : te.avatarImageUrl) ?? P ?? ((Jt = k.agentConfig) == null ? void 0 : Jt.avatarImageUrl) ?? ((Xt = st.info) == null ? void 0 : Xt.avatarImageUrl) ?? null, $n = q ?? ((Qt = k.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((Zt = st.info) == null ? void 0 : Zt.idleLoopUrl) ?? null, zn = g ?? null, On = C(() => le("expanded"), [le]), Hn = C(
3160
- () => le("minimized"),
3161
- [le]
3162
- ), Ut = C(() => {
3163
- k.disconnect(), le("hidden");
3164
- }, [k, le]), Bn = C(() => {
3165
- const y = k.audioElement;
3166
- y && y.play().then(() => fe(!1)).catch(() => {
3253
+ const Pn = !!P || !!(oe != null && oe.avatarImageUrl) || L.isControlled, st = ar(rt, o, Pn);
3254
+ tt === void 0 && ((Gt = st.info) != null && Gt.capabilities) && (It.current = st.info.capabilities);
3255
+ const bt = (oe == null ? void 0 : oe.name) ?? O ?? ((Kt = L.agentConfig) == null ? void 0 : Kt.name) ?? ((Jt = st.info) == null ? void 0 : Jt.name) ?? "Live Layer", Rt = (oe == null ? void 0 : oe.avatarImageUrl) ?? P ?? ((Xt = L.agentConfig) == null ? void 0 : Xt.avatarImageUrl) ?? ((Zt = st.info) == null ? void 0 : Zt.avatarImageUrl) ?? null, $n = U ?? ((Qt = L.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((en = st.info) == null ? void 0 : en.idleLoopUrl) ?? null, zn = g ?? null, Hn = E(() => de("expanded"), [de]), On = E(
3256
+ () => de("minimized"),
3257
+ [de]
3258
+ ), jt = E(() => {
3259
+ L.disconnect(), de("hidden");
3260
+ }, [L, de]), Bn = E(() => {
3261
+ const y = L.audioElement;
3262
+ y && y.play().then(() => lt(!1)).catch(() => {
3167
3263
  });
3168
- }, [k.audioElement]), Wn = C(() => {
3169
- fe(!1), k.connect();
3170
- }, [k]), Ve = {
3264
+ }, [L.audioElement]), Wn = E(() => {
3265
+ lt(!1), L.connect();
3266
+ }, [L]), Ye = {
3171
3267
  ...De,
3172
- ...ue ? {} : { zIndex: We }
3268
+ ...me ? {} : { zIndex: We }
3173
3269
  };
3174
- F.primaryColor && (Ve["--ll-color-primary"] = F.primaryColor), F.accentColor && (Ve["--ll-color-accent"] = F.accentColor), F.backgroundColor && (Ve["--ll-color-bg"] = F.backgroundColor), F.textColor && (Ve["--ll-color-fg"] = F.textColor);
3270
+ q.primaryColor && (Ye["--ll-color-primary"] = q.primaryColor), q.accentColor && (Ye["--ll-color-accent"] = q.accentColor), q.backgroundColor && (Ye["--ll-color-bg"] = q.backgroundColor), q.textColor && (Ye["--ll-color-fg"] = q.textColor);
3175
3271
  const Fn = [
3176
3272
  "ll-widget",
3177
- `ll-widget--${ne}`,
3178
- `ll-widget--${Le ? "mobile" : "desktop"}`,
3179
- xt
3273
+ `ll-widget--${le}`,
3274
+ `ll-widget--${Ce ? "mobile" : "desktop"}`,
3275
+ Lt
3180
3276
  ].filter(Boolean).join(" ");
3181
- if (!tt) return null;
3277
+ if (!nt) return null;
3182
3278
  const qn = /* @__PURE__ */ n(
3183
3279
  "div",
3184
3280
  {
3185
3281
  className: Fn,
3186
- style: Ve,
3187
- "data-display-mode": ne,
3188
- "data-position": L,
3282
+ style: Ye,
3283
+ "data-display-mode": le,
3284
+ "data-position": k,
3189
3285
  "data-experience-mode": p === "EMBEDDED" ? "embedded" : "widget",
3190
- children: ne === "expanded" && /* @__PURE__ */ n(
3191
- Wr,
3286
+ children: le === "expanded" && /* @__PURE__ */ n(
3287
+ qr,
3192
3288
  {
3193
- position: L,
3194
- isMobile: Le,
3195
- agentName: vt,
3196
- avatarImageUrl: It,
3289
+ position: k,
3290
+ isMobile: Ce,
3291
+ agentName: bt,
3292
+ avatarImageUrl: Rt,
3197
3293
  idleLoopUrl: $n,
3198
3294
  greeting: zn,
3199
- branding: F,
3200
- teamMembers: S,
3295
+ branding: q,
3296
+ teamMembers: N,
3201
3297
  currentTeamMemberId: ke,
3202
- isSwitchingTeamMember: pe,
3298
+ isSwitchingTeamMember: ge,
3203
3299
  teamSwitcherOpen: je,
3204
- onToggleTeamSwitcher: () => lt((y) => !y),
3300
+ onToggleTeamSwitcher: () => Ve((y) => !y),
3205
3301
  onSelectTeamMember: Dn,
3206
- connectionState: k.connectionState,
3207
- agentState: k.agentState,
3208
- transcript: k.transcript,
3209
- isMuted: oe.isMuted,
3302
+ connectionState: L.connectionState,
3303
+ agentState: L.agentState,
3304
+ transcript: L.transcript,
3305
+ isMuted: se.isMuted,
3210
3306
  micDevices: ot.mics,
3211
- activeMicId: oe.activeDeviceId,
3212
- isCameraEnabled: ae.isEnabled,
3213
- cameraPreviewEl: ae.previewEl,
3307
+ activeMicId: se.activeDeviceId,
3308
+ isCameraEnabled: ue.isEnabled,
3309
+ cameraPreviewEl: ue.previewEl,
3214
3310
  cameraDevices: ot.cameras,
3215
- activeCameraId: ae.activeDeviceId,
3216
- isScreenShareEnabled: Ce.isEnabled,
3217
- screenPreviewEl: Ce.previewEl,
3218
- isSpeakerMuted: G,
3219
- allowCamera: ee,
3311
+ activeCameraId: ue.activeDeviceId,
3312
+ isScreenShareEnabled: Ee.isEnabled,
3313
+ screenPreviewEl: Ee.previewEl,
3314
+ isSpeakerMuted: h,
3315
+ allowCamera: ne,
3220
3316
  allowScreenShare: B,
3221
- allowTyping: U,
3317
+ allowTyping: j,
3222
3318
  showMinimize: pt,
3223
3319
  showClose: ht,
3224
- chromeless: ye,
3320
+ chromeless: we,
3225
3321
  compactControls: ze,
3226
- transforming: Oe,
3227
- transformingLabel: ve,
3228
- languageMenuOpen: mt,
3229
- onToggleLanguageMenu: () => m((y) => !y),
3230
- needsUserGesture: Lt,
3231
- canResume: k.canResume,
3232
- micError: oe.micError,
3233
- error: k.error,
3234
- avatarVideoContainerRef: Ft,
3235
- agentVideoEl: k.videoElement,
3236
- onConnect: () => void k.connect(),
3237
- onDisconnect: () => k.disconnect(),
3322
+ transforming: He,
3323
+ transformingLabel: X,
3324
+ languageMenuOpen: Ct,
3325
+ onToggleLanguageMenu: () => gt((y) => !y),
3326
+ needsUserGesture: mt,
3327
+ canResume: L.canResume,
3328
+ micError: se.micError,
3329
+ error: L.error,
3330
+ avatarVideoContainerRef: qt,
3331
+ agentVideoEl: L.videoElement,
3332
+ onConnect: () => void L.connect(),
3333
+ onDisconnect: () => L.disconnect(),
3238
3334
  onRetry: Wn,
3239
3335
  onResumeAudio: Bn,
3240
- onToggleMute: oe.toggleMute,
3241
- onSwitchMicDevice: (y) => void oe.switchDevice(y),
3242
- onToggleCamera: () => void ae.toggle(),
3243
- onSwitchCameraDevice: (y) => void ae.switchDevice(y),
3244
- onToggleScreenShare: () => void Ce.toggle(),
3336
+ onToggleMute: se.toggleMute,
3337
+ onSwitchMicDevice: (y) => void se.switchDevice(y),
3338
+ onToggleCamera: () => void ue.toggle(),
3339
+ onSwitchCameraDevice: (y) => void ue.switchDevice(y),
3340
+ onToggleScreenShare: () => void Ee.toggle(),
3245
3341
  onToggleSpeaker: Tn,
3246
3342
  onSendMessage: Mn,
3247
- onMinimize: Hn,
3248
- onClose: Ut,
3249
- onClearMicError: oe.clearError
3343
+ onMinimize: On,
3344
+ onClose: jt,
3345
+ onClearMicError: se.clearError
3250
3346
  }
3251
3347
  )
3252
3348
  }
3253
- ), jt = !ue && (ne === "hidden" || ne === "minimized") ? /* @__PURE__ */ w(
3349
+ ), Vt = !me && (le === "hidden" || le === "minimized") ? /* @__PURE__ */ b(
3254
3350
  "div",
3255
3351
  {
3256
3352
  className: [
3257
3353
  "ll-widget",
3258
3354
  "ll-widget--floating",
3259
- `ll-widget--${ne}`,
3260
- `ll-widget--${Le ? "mobile" : "desktop"}`
3355
+ `ll-widget--${le}`,
3356
+ `ll-widget--${Ce ? "mobile" : "desktop"}`
3261
3357
  ].join(" "),
3262
- style: Ve,
3263
- "data-display-mode": ne,
3264
- "data-position": L,
3358
+ style: Ye,
3359
+ "data-display-mode": le,
3360
+ "data-position": k,
3265
3361
  children: [
3266
- ne === "hidden" && /* @__PURE__ */ n(
3362
+ le === "hidden" && /* @__PURE__ */ n(
3267
3363
  Mr,
3268
3364
  {
3269
- position: L,
3270
- isMobile: Le,
3271
- isSpeaking: k.agentState === "speaking",
3272
- onExpand: () => le("expanded"),
3273
- label: `Open ${vt} widget`,
3274
- avatarImageUrl: It,
3275
- agentName: vt,
3276
- containerEl: ie
3365
+ position: k,
3366
+ isMobile: Ce,
3367
+ isSpeaking: L.agentState === "speaking",
3368
+ onExpand: () => de("expanded"),
3369
+ label: `Open ${bt} widget`,
3370
+ avatarImageUrl: Rt,
3371
+ agentName: bt,
3372
+ containerEl: ce
3277
3373
  }
3278
3374
  ),
3279
- ne === "minimized" && /* @__PURE__ */ n(
3375
+ le === "minimized" && /* @__PURE__ */ n(
3280
3376
  Dr,
3281
3377
  {
3282
- position: L,
3283
- isMobile: Le,
3284
- agentName: vt,
3285
- avatarImageUrl: It,
3286
- agentState: k.agentState,
3287
- isMuted: oe.isMuted,
3288
- audioLevel: rt,
3289
- onExpand: On,
3290
- onToggleMute: oe.toggleMute,
3291
- onClose: Ut
3378
+ position: k,
3379
+ isMobile: Ce,
3380
+ agentName: bt,
3381
+ avatarImageUrl: Rt,
3382
+ agentState: L.agentState,
3383
+ isMuted: se.isMuted,
3384
+ audioLevel: it,
3385
+ onExpand: Hn,
3386
+ onToggleMute: se.toggleMute,
3387
+ onClose: jt
3292
3388
  }
3293
3389
  )
3294
3390
  ]
3295
3391
  }
3296
- ) : null, Vt = ie ?? (typeof document < "u" ? document.body : null);
3297
- return /* @__PURE__ */ w($e, { children: [
3392
+ ) : null, Yt = ce ?? (typeof document < "u" ? document.body : null);
3393
+ return /* @__PURE__ */ b($e, { children: [
3298
3394
  qn,
3299
- jt && Vt && Pt(jt, Vt)
3395
+ Vt && Yt && $t(Vt, Yt)
3300
3396
  ] });
3301
3397
  }
3302
3398
  );
3303
- In.displayName = "AvatarWidgetInner";
3304
- const bo = Dt(
3399
+ Rn.displayName = "AvatarWidgetInner";
3400
+ const wi = Pt(
3305
3401
  function(t, r) {
3306
- return /* @__PURE__ */ n(Zn, { children: /* @__PURE__ */ n(In, { ...t, ref: r }) });
3402
+ return /* @__PURE__ */ n(Qn, { children: /* @__PURE__ */ n(Rn, { ...t, ref: r }) });
3307
3403
  }
3308
3404
  );
3309
- bo.displayName = "AvatarWidget";
3310
- const Io = ({
3405
+ wi.displayName = "AvatarWidget";
3406
+ const Ri = ({
3311
3407
  agentId: e,
3312
3408
  baseUrl: t,
3313
3409
  apiKey: r,
3314
- mode: o,
3315
- onAgentEvent: l,
3316
- className: i,
3410
+ mode: i,
3411
+ onAgentEvent: a,
3412
+ className: o,
3317
3413
  style: s
3318
3414
  }) => {
3319
- const a = N(null), c = N(null), p = N(l);
3320
- p.current = l;
3321
- const v = C((f) => {
3322
- var I;
3415
+ const l = A(null), c = A(null), p = A(a);
3416
+ p.current = a;
3417
+ const v = E((f) => {
3418
+ var R;
3323
3419
  const u = f.detail;
3324
- (I = p.current) == null || I.call(p, u);
3420
+ (R = p.current) == null || R.call(p, u);
3325
3421
  }, []);
3326
- return R(() => {
3327
- const f = a.current;
3422
+ return M(() => {
3423
+ const f = l.current;
3328
3424
  if (!f) return;
3329
3425
  const u = document.createElement("livelayer-widget");
3330
- return u.setAttribute("agent-id", e), t && u.setAttribute("base-url", t), r && u.setAttribute("api-key", r), o && u.setAttribute("mode", o), u.addEventListener("agent-event", v), f.appendChild(u), c.current = u, () => {
3426
+ return u.setAttribute("agent-id", e), t && u.setAttribute("base-url", t), r && u.setAttribute("api-key", r), i && u.setAttribute("mode", i), u.addEventListener("agent-event", v), f.appendChild(u), c.current = u, () => {
3331
3427
  u.removeEventListener("agent-event", v), f.removeChild(u), c.current = null;
3332
3428
  };
3333
- }, [e]), R(() => {
3334
- c.current && (o ? c.current.setAttribute("mode", o) : c.current.removeAttribute("mode"));
3335
- }, [o]), /* @__PURE__ */ n("div", { ref: a, className: i, style: s });
3336
- }, Ro = Dt(
3337
- function({ id: t, intent: r, as: o = "div", className: l, style: i, children: s }, a) {
3429
+ }, [e]), M(() => {
3430
+ c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
3431
+ }, [i]), /* @__PURE__ */ n("div", { ref: l, className: o, style: s });
3432
+ }, Mi = Pt(
3433
+ function({ id: t, intent: r, as: i = "div", className: a, style: o, children: s }, l) {
3338
3434
  return Gn(
3339
- o,
3435
+ i,
3340
3436
  {
3341
- ref: a,
3437
+ ref: l,
3342
3438
  "data-ll-region": t,
3343
3439
  "data-ll-intent": r,
3344
- className: l,
3345
- style: i
3440
+ className: a,
3441
+ style: o
3346
3442
  },
3347
3443
  s
3348
3444
  );
3349
3445
  }
3350
3446
  );
3351
- function Mo(e = {}) {
3352
- const { onFieldUpdate: t, onComplete: r, source: o = "all" } = e, [l, i] = E({}), [s, a] = E(!1), [c, p] = E(null), v = N(t), f = N(r), u = N(o);
3353
- R(() => {
3354
- v.current = t, f.current = r, u.current = o;
3355
- }, [t, r, o]);
3356
- const I = C(() => {
3357
- i({}), a(!1);
3447
+ function Ti(e = {}) {
3448
+ const { onFieldUpdate: t, onComplete: r, source: i = "all" } = e, [a, o] = S({}), [s, l] = S(!1), [c, p] = S(null), v = A(t), f = A(r), u = A(i);
3449
+ M(() => {
3450
+ v.current = t, f.current = r, u.current = i;
3451
+ }, [t, r, i]);
3452
+ const R = E(() => {
3453
+ o({}), l(!1);
3358
3454
  }, []);
3359
- return R(() => {
3455
+ return M(() => {
3360
3456
  if (typeof window > "u") return;
3361
- const L = (_) => {
3362
- var b, S;
3363
- const h = _.detail;
3364
- if (h) {
3365
- if (h.phase === "field") {
3366
- if (u.current !== "all" && h.source !== u.current)
3457
+ const k = (_) => {
3458
+ var w, N;
3459
+ const m = _.detail;
3460
+ if (m) {
3461
+ if (m.phase === "field") {
3462
+ if (u.current !== "all" && m.source !== u.current)
3367
3463
  return;
3368
- a(!0), i(
3369
- (T) => T[h.fieldName] === h.value ? T : { ...T, [h.fieldName]: h.value }
3464
+ l(!0), o(
3465
+ (T) => T[m.fieldName] === m.value ? T : { ...T, [m.fieldName]: m.value }
3370
3466
  );
3371
3467
  try {
3372
- (b = v.current) == null || b.call(v, h);
3468
+ (w = v.current) == null || w.call(v, m);
3373
3469
  } catch (T) {
3374
3470
  console.warn("[LiveLayer] useCollect onFieldUpdate threw.", T);
3375
3471
  }
3376
3472
  return;
3377
3473
  }
3378
- if (h.phase === "complete") {
3379
- const T = h.result;
3474
+ if (m.phase === "complete") {
3475
+ const T = m.result;
3380
3476
  if (u.current !== "all" && T.source !== u.current)
3381
3477
  return;
3382
- p(T), a(!1);
3478
+ p(T), l(!1);
3383
3479
  try {
3384
- (S = f.current) == null || S.call(f, T);
3385
- } catch (A) {
3386
- console.warn("[LiveLayer] useCollect onComplete threw.", A);
3480
+ (N = f.current) == null || N.call(f, T);
3481
+ } catch (I) {
3482
+ console.warn("[LiveLayer] useCollect onComplete threw.", I);
3387
3483
  }
3388
3484
  }
3389
3485
  }
3390
3486
  };
3391
- return document.addEventListener("ll-collected", L), () => document.removeEventListener("ll-collected", L);
3392
- }, []), { fields: l, isCollecting: s, lastResult: c, reset: I };
3487
+ return document.addEventListener("ll-collected", k), () => document.removeEventListener("ll-collected", k);
3488
+ }, []), { fields: a, isCollecting: s, lastResult: c, reset: R };
3393
3489
  }
3394
- let _n = 1;
3395
- function To({
3490
+ let xn = 1;
3491
+ function Di({
3396
3492
  onMount: e,
3397
3493
  defaultOpen: t = !1,
3398
3494
  storageKey: r = "ll-debug-open"
3399
3495
  }) {
3400
- const [o, l] = E(t), [i, s] = E([]), [a, c] = E(""), [p, v] = E(!1), f = N(/* @__PURE__ */ new Set()), u = N([]), I = N(p);
3401
- I.current = p, R(() => {
3496
+ const [i, a] = S(t), [o, s] = S([]), [l, c] = S(""), [p, v] = S(!1), f = A(/* @__PURE__ */ new Set()), u = A([]), R = A(p);
3497
+ R.current = p, M(() => {
3402
3498
  try {
3403
- const h = localStorage.getItem(r);
3404
- h === "1" && l(!0), h === "0" && l(!1);
3499
+ const m = localStorage.getItem(r);
3500
+ m === "1" && a(!0), m === "0" && a(!1);
3405
3501
  } catch {
3406
3502
  }
3407
- }, [r]), R(() => {
3503
+ }, [r]), M(() => {
3408
3504
  try {
3409
- localStorage.setItem(r, o ? "1" : "0");
3505
+ localStorage.setItem(r, i ? "1" : "0");
3410
3506
  } catch {
3411
3507
  }
3412
- }, [o, r]), R(() => {
3413
- const h = (b) => {
3414
- (b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), l((S) => !S));
3508
+ }, [i, r]), M(() => {
3509
+ const m = (w) => {
3510
+ (w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), a((N) => !N));
3415
3511
  };
3416
- return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
3417
- }, []), R(() => {
3418
- const h = setInterval(() => {
3419
- if (u.current.length === 0 || I.current) return;
3420
- const b = u.current.splice(0, u.current.length);
3512
+ return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
3513
+ }, []), M(() => {
3514
+ const m = setInterval(() => {
3515
+ if (u.current.length === 0 || R.current) return;
3516
+ const w = u.current.splice(0, u.current.length);
3421
3517
  s(
3422
- (S) => [...b.reverse(), ...S].slice(0, 200)
3518
+ (N) => [...w.reverse(), ...N].slice(0, 200)
3423
3519
  );
3424
3520
  }, 100);
3425
- return () => clearInterval(h);
3521
+ return () => clearInterval(m);
3426
3522
  }, []);
3427
- const L = N(!1);
3428
- if (R(() => {
3429
- !e || L.current || (L.current = !0, e((h) => {
3523
+ const k = A(!1);
3524
+ if (M(() => {
3525
+ !e || k.current || (k.current = !0, e((m) => {
3430
3526
  u.current.push({
3431
- id: _n++,
3527
+ id: xn++,
3432
3528
  ts: Date.now(),
3433
3529
  kind: "event",
3434
- type: h.eventName,
3435
- data: h.data
3530
+ type: m.eventName,
3531
+ data: m.data
3436
3532
  });
3437
3533
  }));
3438
- }, [e]), R(() => {
3439
- const h = console.warn, b = console.log, S = (T, A) => function(...q) {
3534
+ }, [e]), M(() => {
3535
+ const m = console.warn, w = console.log, N = (T, I) => function(...U) {
3440
3536
  try {
3441
- const g = typeof q[0] == "string" ? q[0] : "";
3537
+ const g = typeof U[0] == "string" ? U[0] : "";
3442
3538
  g.startsWith("[LiveLayer]") && u.current.push({
3443
- id: _n++,
3539
+ id: xn++,
3444
3540
  ts: Date.now(),
3445
3541
  kind: T,
3446
3542
  type: g.slice(0, 120),
3447
- data: { args: q.slice(1).map((P) => _o(P)) }
3543
+ data: { args: U.slice(1).map((P) => xi(P)) }
3448
3544
  });
3449
3545
  } catch {
3450
3546
  }
3451
- return A.apply(this, q);
3547
+ return I.apply(this, U);
3452
3548
  };
3453
- return console.warn = S("warn", h), console.log = S("log", b), () => {
3454
- console.warn = h, console.log = b;
3549
+ return console.warn = N("warn", m), console.log = N("log", w), () => {
3550
+ console.warn = m, console.log = w;
3455
3551
  };
3456
- }, []), !o)
3552
+ }, []), !i)
3457
3553
  return /* @__PURE__ */ n(
3458
3554
  "button",
3459
3555
  {
3460
3556
  type: "button",
3461
- onClick: () => l(!0),
3557
+ onClick: () => a(!0),
3462
3558
  title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
3463
3559
  "aria-label": "Open LiveLayer debug panel",
3464
3560
  style: {
@@ -3480,12 +3576,12 @@ function To({
3480
3576
  children: "🛰 LL debug"
3481
3577
  }
3482
3578
  );
3483
- const _ = i.filter((h) => {
3484
- if (!a) return !0;
3485
- const b = a.toLowerCase();
3486
- return h.type.toLowerCase().includes(b) || JSON.stringify(h.data || {}).toLowerCase().includes(b);
3579
+ const _ = o.filter((m) => {
3580
+ if (!l) return !0;
3581
+ const w = l.toLowerCase();
3582
+ return m.type.toLowerCase().includes(w) || JSON.stringify(m.data || {}).toLowerCase().includes(w);
3487
3583
  });
3488
- return /* @__PURE__ */ w(
3584
+ return /* @__PURE__ */ b(
3489
3585
  "div",
3490
3586
  {
3491
3587
  style: {
@@ -3507,7 +3603,7 @@ function To({
3507
3603
  overflow: "hidden"
3508
3604
  },
3509
3605
  children: [
3510
- /* @__PURE__ */ w(
3606
+ /* @__PURE__ */ b(
3511
3607
  "div",
3512
3608
  {
3513
3609
  style: {
@@ -3520,18 +3616,18 @@ function To({
3520
3616
  },
3521
3617
  children: [
3522
3618
  /* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
3523
- /* @__PURE__ */ w("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
3524
- i.length,
3619
+ /* @__PURE__ */ b("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
3620
+ o.length,
3525
3621
  " event",
3526
- i.length === 1 ? "" : "s"
3622
+ o.length === 1 ? "" : "s"
3527
3623
  ] }),
3528
3624
  /* @__PURE__ */ n("span", { style: { flex: 1 } }),
3529
3625
  /* @__PURE__ */ n(
3530
3626
  "button",
3531
3627
  {
3532
3628
  type: "button",
3533
- onClick: () => v((h) => !h),
3534
- style: Mt(p ? "#f59e0b" : "transparent"),
3629
+ onClick: () => v((m) => !m),
3630
+ style: Tt(p ? "#f59e0b" : "transparent"),
3535
3631
  title: "Pause / resume capture",
3536
3632
  children: p ? "▶ resume" : "⏸ pause"
3537
3633
  }
@@ -3543,7 +3639,7 @@ function To({
3543
3639
  onClick: () => {
3544
3640
  s([]), u.current = [];
3545
3641
  },
3546
- style: Mt("transparent"),
3642
+ style: Tt("transparent"),
3547
3643
  title: "Clear buffer",
3548
3644
  children: "clear"
3549
3645
  }
@@ -3552,8 +3648,8 @@ function To({
3552
3648
  "button",
3553
3649
  {
3554
3650
  type: "button",
3555
- onClick: () => l(!1),
3556
- style: Mt("transparent"),
3651
+ onClick: () => a(!1),
3652
+ style: Tt("transparent"),
3557
3653
  "aria-label": "Close",
3558
3654
  title: "Close (Cmd/Ctrl + Shift + L)",
3559
3655
  children: "✕"
@@ -3566,8 +3662,8 @@ function To({
3566
3662
  "input",
3567
3663
  {
3568
3664
  type: "text",
3569
- value: a,
3570
- onChange: (h) => c(h.target.value),
3665
+ value: l,
3666
+ onChange: (m) => c(m.target.value),
3571
3667
  placeholder: "filter by type or data…",
3572
3668
  style: {
3573
3669
  margin: 8,
@@ -3589,7 +3685,7 @@ function To({
3589
3685
  overflowY: "auto",
3590
3686
  padding: "0 8px 8px"
3591
3687
  },
3592
- children: _.length === 0 ? /* @__PURE__ */ w(
3688
+ children: _.length === 0 ? /* @__PURE__ */ b(
3593
3689
  "div",
3594
3690
  {
3595
3691
  style: {
@@ -3619,16 +3715,16 @@ function To({
3619
3715
  )
3620
3716
  ]
3621
3717
  }
3622
- ) : _.map((h) => /* @__PURE__ */ n(
3623
- wo,
3718
+ ) : _.map((m) => /* @__PURE__ */ n(
3719
+ _i,
3624
3720
  {
3625
- entry: h,
3626
- expanded: f.current.has(h.id),
3721
+ entry: m,
3722
+ expanded: f.current.has(m.id),
3627
3723
  onToggle: () => {
3628
- f.current.has(h.id) ? f.current.delete(h.id) : f.current.add(h.id), s((b) => [...b]);
3724
+ f.current.has(m.id) ? f.current.delete(m.id) : f.current.add(m.id), s((w) => [...w]);
3629
3725
  }
3630
3726
  },
3631
- h.id
3727
+ m.id
3632
3728
  ))
3633
3729
  }
3634
3730
  )
@@ -3636,15 +3732,15 @@ function To({
3636
3732
  }
3637
3733
  );
3638
3734
  }
3639
- function wo({
3735
+ function _i({
3640
3736
  entry: e,
3641
3737
  expanded: t,
3642
3738
  onToggle: r
3643
3739
  }) {
3644
- const o = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", l = new Date(e.ts).toLocaleTimeString("en-US", {
3740
+ 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", {
3645
3741
  hour12: !1
3646
3742
  });
3647
- return /* @__PURE__ */ w(
3743
+ return /* @__PURE__ */ b(
3648
3744
  "button",
3649
3745
  {
3650
3746
  type: "button",
@@ -3662,7 +3758,7 @@ function wo({
3662
3758
  lineHeight: 1.4
3663
3759
  },
3664
3760
  children: [
3665
- /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
3761
+ /* @__PURE__ */ b("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
3666
3762
  /* @__PURE__ */ n(
3667
3763
  "span",
3668
3764
  {
@@ -3671,14 +3767,14 @@ function wo({
3671
3767
  fontVariantNumeric: "tabular-nums",
3672
3768
  fontSize: 10
3673
3769
  },
3674
- children: l
3770
+ children: a
3675
3771
  }
3676
3772
  ),
3677
3773
  /* @__PURE__ */ n(
3678
3774
  "span",
3679
3775
  {
3680
3776
  style: {
3681
- color: o,
3777
+ color: i,
3682
3778
  fontWeight: 600,
3683
3779
  flexShrink: 0
3684
3780
  },
@@ -3706,7 +3802,7 @@ function wo({
3706
3802
  }
3707
3803
  );
3708
3804
  }
3709
- function Mt(e) {
3805
+ function Tt(e) {
3710
3806
  return {
3711
3807
  background: e,
3712
3808
  color: "#fff",
@@ -3717,62 +3813,62 @@ function Mt(e) {
3717
3813
  cursor: "pointer"
3718
3814
  };
3719
3815
  }
3720
- function _o(e) {
3816
+ function xi(e) {
3721
3817
  try {
3722
3818
  return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
3723
3819
  } catch {
3724
3820
  return String(e);
3725
3821
  }
3726
3822
  }
3727
- function xo(e) {
3823
+ function Li(e) {
3728
3824
  const t = JSON.stringify(e);
3729
- R(() => Jn(e), [t]);
3825
+ M(() => Jn(e), [t]);
3730
3826
  }
3731
- function Do({ fields: e, children: t }) {
3732
- return xo(e), /* @__PURE__ */ n($e, { children: t });
3827
+ function Pi({ fields: e, children: t }) {
3828
+ return Li(e), /* @__PURE__ */ n($e, { children: t });
3733
3829
  }
3734
- function Po() {
3735
- const [e, t] = E([]), r = C((l) => {
3736
- t((i) => {
3737
- const s = i.findIndex((a) => a.id === l.id);
3830
+ function $i() {
3831
+ const [e, t] = S([]), r = E((a) => {
3832
+ t((o) => {
3833
+ const s = o.findIndex((l) => l.id === a.id);
3738
3834
  if (s >= 0) {
3739
- const a = i.slice();
3740
- return a[s] = l, a;
3835
+ const l = o.slice();
3836
+ return l[s] = a, l;
3741
3837
  }
3742
- return [...i, l];
3838
+ return [...o, a];
3743
3839
  });
3744
- }, []), o = C(() => t([]), []);
3840
+ }, []), i = E(() => t([]), []);
3745
3841
  return {
3746
3842
  entries: e,
3747
3843
  pushSegment: r,
3748
- clear: o,
3844
+ clear: i,
3749
3845
  latest: e.length > 0 ? e[e.length - 1] : null
3750
3846
  };
3751
3847
  }
3752
3848
  export {
3753
- bo as AvatarWidget,
3754
- Zn as ErrorBoundary,
3755
- Do as FieldProvider,
3756
- To as LiveLayerDebugPanel,
3757
- Ro as LiveLayerRegion,
3758
- Io as LiveLayerWidget,
3759
- Oo as clearFieldRegistry,
3760
- eo as clearPageContextCache,
3761
- lo as clearRoutesCache,
3762
- Zr as extractPageContext,
3763
- oo as extractRoutes,
3764
- gn as getCachedPageContext,
3765
- Rt as getCachedRoutes,
3766
- Ho as getRegisteredFields,
3849
+ wi as AvatarWidget,
3850
+ Qn as ErrorBoundary,
3851
+ Pi as FieldProvider,
3852
+ Di as LiveLayerDebugPanel,
3853
+ Mi as LiveLayerRegion,
3854
+ Ri as LiveLayerWidget,
3855
+ Oi as clearFieldRegistry,
3856
+ ni as clearPageContextCache,
3857
+ si as clearRoutesCache,
3858
+ ti as extractPageContext,
3859
+ li as extractRoutes,
3860
+ yn as getCachedPageContext,
3861
+ Mt as getCachedRoutes,
3862
+ Bi as getRegisteredFields,
3767
3863
  xr as matchesPattern,
3768
- no as normalizeRouteInput,
3769
- Bo as registerFields,
3770
- Wo as setFieldValue,
3771
- kr as shouldRenderAtPath,
3864
+ ii as normalizeRouteInput,
3865
+ Wi as registerFields,
3866
+ Fi as setFieldValue,
3867
+ Lr as shouldRenderAtPath,
3772
3868
  ar as useAgentInfo,
3773
3869
  tr as useAudioLevel,
3774
- or as useCameraState,
3775
- Mo as useCollect,
3870
+ ir as useCameraState,
3871
+ Ti as useCollect,
3776
3872
  dr as useDisplayMode,
3777
3873
  pr as useDisplayModePersistence,
3778
3874
  mr as useIsMobile,
@@ -3780,8 +3876,8 @@ export {
3780
3876
  lr as useMediaDevices,
3781
3877
  nr as useMicrophoneState,
3782
3878
  yr as usePathname,
3783
- xo as useRegisterFields,
3784
- Lr as useRouteMatch,
3785
- ir as useScreenShareState,
3786
- Po as useTranscript
3879
+ Li as useRegisterFields,
3880
+ kr as useRouteMatch,
3881
+ or as useScreenShareState,
3882
+ $i as useTranscript
3787
3883
  };