@livelayer/react 0.21.2 → 0.21.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +3 -3
  2. package/dist/index.mjs +1253 -1202
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs as k, jsx as n, Fragment as Fe } from "react/jsx-runtime";
3
- import { Component as sr, useState as M, useRef as I, useEffect as T, useCallback as C, useMemo as et, useLayoutEffect as Tn, forwardRef as jt, useImperativeHandle as cr, createElement as ur } from "react";
4
- import { createPortal as Vt } from "react-dom";
5
- import { LiveKitSession as dr, registerFields as fr } from "@livelayer/sdk";
6
- import { clearFieldRegistry as ao, getRegisteredFields as so, registerFields as co, setFieldValue as uo } from "@livelayer/sdk";
7
- import { createLocalAudioTrack as pr, Track as Pn, createLocalVideoTrack as hr } from "livekit-client";
8
- class mr extends sr {
2
+ import { jsxs as k, jsx as r, Fragment as We } from "react/jsx-runtime";
3
+ import { Component as ur, useState as M, useRef as I, useEffect as T, useCallback as C, useMemo as tt, useLayoutEffect as Dn, forwardRef as Gt, useImperativeHandle as dr, createElement as fr } from "react";
4
+ import { createPortal as Xt } from "react-dom";
5
+ import { LiveKitSession as pr, registerFields as hr } from "@livelayer/sdk";
6
+ import { clearFieldRegistry as po, getRegisteredFields as ho, registerFields as mo, setFieldValue as go } from "@livelayer/sdk";
7
+ import { createLocalAudioTrack as mr, Track as zn, createLocalVideoTrack as gr } from "livekit-client";
8
+ class yr extends ur {
9
9
  constructor() {
10
10
  super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
11
11
  this.setState({ hasError: !1, error: null });
@@ -14,16 +14,16 @@ class mr extends sr {
14
14
  static getDerivedStateFromError(t) {
15
15
  return { hasError: !0, error: t };
16
16
  }
17
- componentDidCatch(t, r) {
17
+ componentDidCatch(t, n) {
18
18
  var i, a;
19
- (a = (i = this.props).onError) == null || a.call(i, t, r);
19
+ (a = (i = this.props).onError) == null || a.call(i, t, n);
20
20
  }
21
21
  render() {
22
22
  var t;
23
23
  return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ k("div", { className: "ll-error-boundary", role: "alert", children: [
24
- /* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
25
- /* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
26
- /* @__PURE__ */ n(
24
+ /* @__PURE__ */ r("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
25
+ /* @__PURE__ */ r("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
26
+ /* @__PURE__ */ r(
27
27
  "button",
28
28
  {
29
29
  type: "button",
@@ -35,26 +35,26 @@ class mr extends sr {
35
35
  ] }) : this.props.children;
36
36
  }
37
37
  }
38
- function gr(e) {
39
- const [t, r] = M("idle"), [i, a] = M("idle"), [o, c] = M([]), [l, s] = M(null), [u, b] = M(null), [p, h] = M(null), [P, x] = M(!1), [E, g] = M(null), w = I(null), R = I(e.onDataMessage);
38
+ function vr(e) {
39
+ const [t, n] = M("idle"), [i, a] = M("idle"), [o, s] = M([]), [l, c] = M(null), [u, m] = M(null), [p, h] = M(null), [P, x] = M(!1), [E, y] = M(null), w = I(null), R = I(e.onDataMessage);
40
40
  R.current = e.onDataMessage, T(() => {
41
- const m = {
41
+ const g = {
42
42
  onConnectionStateChange: (W) => {
43
- r(W), W === "connected" && g(null);
43
+ n(W), W === "connected" && y(null);
44
44
  },
45
45
  onAgentStateChange: a,
46
- onTranscript: (W) => c([...W]),
47
- onAgentConfig: s,
46
+ onTranscript: (W) => s([...W]),
47
+ onAgentConfig: c,
48
48
  onAudioTrack: (W) => h(W),
49
- onVideoTrack: (W) => b(W),
50
- onVideoTrackRemoved: () => b(null),
51
- onError: (W) => g(W),
49
+ onVideoTrack: (W) => m(W),
50
+ onVideoTrackRemoved: () => m(null),
51
+ onError: (W) => y(W),
52
52
  onDataMessage: (W) => {
53
53
  var K;
54
54
  (K = R.current) == null || K.call(R, W);
55
55
  },
56
56
  onResumabilityChange: x
57
- }, D = new dr(
57
+ }, D = new pr(
58
58
  {
59
59
  agentId: e.agentId,
60
60
  baseUrl: e.baseUrl,
@@ -62,9 +62,9 @@ function gr(e) {
62
62
  sessionEndpoint: e.sessionEndpoint,
63
63
  sessionBody: e.sessionBody
64
64
  },
65
- m
65
+ g
66
66
  );
67
- return w.current = D, r("idle"), a("idle"), c([]), s(null), b(null), h(null), x(!1), g(null), () => {
67
+ return w.current = D, n("idle"), a("idle"), s([]), c(null), m(null), h(null), x(!1), y(null), () => {
68
68
  var W;
69
69
  (W = D.destroy) == null || W.call(D), w.current = null;
70
70
  };
@@ -76,19 +76,19 @@ function gr(e) {
76
76
  JSON.stringify(e.sessionBody ?? {})
77
77
  ]);
78
78
  const S = C(async () => {
79
- const m = w.current;
80
- if (m)
79
+ const g = w.current;
80
+ if (g)
81
81
  try {
82
- await m.connect();
82
+ await g.connect();
83
83
  } catch (D) {
84
- throw g(D instanceof Error ? D.message : String(D)), D;
84
+ throw y(D instanceof Error ? D.message : String(D)), D;
85
85
  }
86
- }, []), y = C(() => {
87
- const m = w.current;
88
- m && m.disconnect();
86
+ }, []), v = C(() => {
87
+ const g = w.current;
88
+ g && g.disconnect();
89
89
  }, []), O = C(() => {
90
- var m;
91
- return ((m = w.current) == null ? void 0 : m.getRoom()) ?? null;
90
+ var g;
91
+ return ((g = w.current) == null ? void 0 : g.getRoom()) ?? null;
92
92
  }, []);
93
93
  return {
94
94
  connectionState: t,
@@ -100,35 +100,35 @@ function gr(e) {
100
100
  canResume: P,
101
101
  error: E,
102
102
  connect: S,
103
- disconnect: y,
103
+ disconnect: v,
104
104
  getRoom: O,
105
105
  session: w.current
106
106
  };
107
107
  }
108
- function yr() {
109
- const e = I(null), t = I(/* @__PURE__ */ new Map()), r = I(null), i = I(/* @__PURE__ */ new Set()), a = C(() => {
108
+ function br() {
109
+ const e = I(null), t = I(/* @__PURE__ */ new Map()), n = I(null), i = I(/* @__PURE__ */ new Set()), a = C(() => {
110
110
  const x = t.current;
111
111
  if (x.size === 0) {
112
- r.current = null;
112
+ n.current = null;
113
113
  return;
114
114
  }
115
115
  let E = 0;
116
- for (const { analyser: g, buffer: w } of x.values()) {
117
- g.getByteFrequencyData(w);
116
+ for (const { analyser: y, buffer: w } of x.values()) {
117
+ y.getByteFrequencyData(w);
118
118
  let R = 0;
119
- for (let y = 0; y < w.length; y++) R += w[y];
119
+ for (let v = 0; v < w.length; v++) R += w[v];
120
120
  const S = R / w.length / 255;
121
121
  S > E && (E = S);
122
122
  }
123
- for (const g of i.current)
123
+ for (const y of i.current)
124
124
  try {
125
- g(E);
125
+ y(E);
126
126
  } catch (w) {
127
127
  console.error("[useAudioLevel] subscriber threw:", w);
128
128
  }
129
- r.current = requestAnimationFrame(a);
130
- }, []), o = C(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), c = C(() => {
131
- r.current === null && t.current.size > 0 && (r.current = requestAnimationFrame(a));
129
+ n.current = requestAnimationFrame(a);
130
+ }, []), o = C(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = C(() => {
131
+ n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(a));
132
132
  }, [a]), l = C((x) => {
133
133
  const E = t.current.get(x);
134
134
  if (E) {
@@ -142,14 +142,14 @@ function yr() {
142
142
  }
143
143
  t.current.delete(x);
144
144
  }
145
- }, []), s = C(
145
+ }, []), c = C(
146
146
  (x, E) => {
147
- const g = o();
148
- if (!g) return;
147
+ const y = o();
148
+ if (!y) return;
149
149
  l(x);
150
- const w = E(g);
150
+ const w = E(y);
151
151
  if (!w) return;
152
- const R = g.createAnalyser();
152
+ const R = y.createAnalyser();
153
153
  R.fftSize = 64;
154
154
  try {
155
155
  w.connect(R);
@@ -161,14 +161,14 @@ function yr() {
161
161
  analyser: R,
162
162
  node: w,
163
163
  buffer: new Uint8Array(new ArrayBuffer(R.frequencyBinCount))
164
- }), c();
164
+ }), s();
165
165
  },
166
- [l, o, c]
166
+ [l, o, s]
167
167
  ), u = C(
168
168
  (x, E = "agent") => {
169
- s(E, (g) => {
169
+ c(E, (y) => {
170
170
  try {
171
- return g.createMediaElementSource(x);
171
+ return y.createMediaElementSource(x);
172
172
  } catch (w) {
173
173
  return console.warn(
174
174
  "[useAudioLevel] createMediaElementSource failed for slot",
@@ -178,12 +178,12 @@ function yr() {
178
178
  }
179
179
  });
180
180
  },
181
- [s]
182
- ), b = C(
181
+ [c]
182
+ ), m = C(
183
183
  (x, E = "mic") => {
184
- s(E, (g) => {
184
+ c(E, (y) => {
185
185
  try {
186
- return g.createMediaStreamSource(x);
186
+ return y.createMediaStreamSource(x);
187
187
  } catch (w) {
188
188
  return console.warn(
189
189
  "[useAudioLevel] createMediaStreamSource failed for slot",
@@ -193,14 +193,14 @@ function yr() {
193
193
  }
194
194
  });
195
195
  },
196
- [s]
196
+ [c]
197
197
  ), p = C(
198
198
  (x) => {
199
- l(x), t.current.size === 0 && r.current !== null && (cancelAnimationFrame(r.current), r.current = null);
199
+ l(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
200
200
  },
201
201
  [l]
202
202
  ), h = C(() => {
203
- r.current !== null && (cancelAnimationFrame(r.current), r.current = null);
203
+ n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
204
204
  for (const x of Array.from(t.current.keys()))
205
205
  l(x);
206
206
  }, [l]), P = C((x) => (i.current.add(x), () => {
@@ -215,77 +215,77 @@ function yr() {
215
215
  e.current = null;
216
216
  }
217
217
  i.current.clear();
218
- }, [h]), { attach: u, attachStream: b, detach: h, detachSlot: p, subscribe: P };
218
+ }, [h]), { attach: u, attachStream: m, detach: h, detachSlot: p, subscribe: P };
219
219
  }
220
- function vr(e) {
220
+ function wr(e) {
221
221
  const t = e == null ? void 0 : e.mediaStreamTrack;
222
222
  return t ? new MediaStream([t]) : null;
223
223
  }
224
- function br(e = {}) {
225
- const t = e.gateUntilAgentReady ?? !1, r = e.agentState ?? null, [i, a] = M(t), [o, c] = M(""), [l, s] = M(null), u = I(null), b = I(null), p = I({
224
+ function _r(e = {}) {
225
+ const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, a] = M(t), [o, s] = M(""), [l, c] = M(null), u = I(null), m = I(null), p = I({
226
226
  active: t,
227
227
  lastAutoIntent: null
228
228
  }), h = C(async (S) => {
229
- var y, O;
230
- if (u.current && b.current) {
229
+ var v, O;
230
+ if (u.current && m.current) {
231
231
  try {
232
- await b.current.localParticipant.unpublishTrack(u.current);
232
+ await m.current.localParticipant.unpublishTrack(u.current);
233
233
  } catch {
234
234
  }
235
235
  u.current.stop(), u.current = null;
236
236
  }
237
- b.current = S, s(null);
237
+ m.current = S, c(null);
238
238
  try {
239
- const m = await pr({
239
+ const g = await mr({
240
240
  echoCancellation: !0,
241
241
  noiseSuppression: !0
242
242
  });
243
- await S.localParticipant.publishTrack(m), u.current = m, p.current.active ? (await S.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, a(!0)) : a(m.isMuted);
244
- const D = (O = (y = m.mediaStreamTrack) == null ? void 0 : y.getSettings) == null ? void 0 : O.call(y);
245
- D != null && D.deviceId && c(D.deviceId);
246
- } catch (m) {
247
- const D = m instanceof Error && m.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
248
- throw s(D), m;
243
+ await S.localParticipant.publishTrack(g), u.current = g, p.current.active ? (await S.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, a(!0)) : a(g.isMuted);
244
+ const D = (O = (v = g.mediaStreamTrack) == null ? void 0 : v.getSettings) == null ? void 0 : O.call(v);
245
+ D != null && D.deviceId && s(D.deviceId);
246
+ } catch (g) {
247
+ const D = g instanceof Error && g.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
248
+ throw c(D), g;
249
249
  }
250
250
  }, []), P = C((S) => {
251
- b.current = S;
251
+ m.current = S;
252
252
  }, []), x = C(async (S) => {
253
- const y = b.current;
254
- if (y)
253
+ const v = m.current;
254
+ if (v)
255
255
  try {
256
- await y.switchActiveDevice("audioinput", S), c(S);
256
+ await v.switchActiveDevice("audioinput", S), s(S);
257
257
  } catch (O) {
258
258
  console.warn("[useMicrophoneState] switchDevice failed:", O);
259
259
  }
260
260
  }, []), E = C(async () => {
261
- const S = b.current, y = !i;
262
- if (a(y), p.current.active = !1, !!S)
261
+ const S = m.current, v = !i;
262
+ if (a(v), p.current.active = !1, !!S)
263
263
  try {
264
- await S.localParticipant.setMicrophoneEnabled(!y);
264
+ await S.localParticipant.setMicrophoneEnabled(!v);
265
265
  } catch (O) {
266
- console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), a(!y);
266
+ console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), a(!v);
267
267
  }
268
268
  }, [i]);
269
269
  T(() => {
270
- if (!p.current.active || r !== "listening") return;
271
- const S = b.current, y = S == null ? void 0 : S.localParticipant;
272
- if (!y) {
270
+ if (!p.current.active || n !== "listening") return;
271
+ const S = m.current, v = S == null ? void 0 : S.localParticipant;
272
+ if (!v) {
273
273
  p.current.active = !1;
274
274
  return;
275
275
  }
276
- y.isMicrophoneEnabled === p.current.lastAutoIntent && (y.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, a(!1)), p.current.active = !1;
277
- }, [r]);
278
- const g = C(() => {
279
- const S = u.current, y = b.current;
280
- if (S && y) {
276
+ v.isMicrophoneEnabled === p.current.lastAutoIntent && (v.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, a(!1)), p.current.active = !1;
277
+ }, [n]);
278
+ const y = C(() => {
279
+ const S = u.current, v = m.current;
280
+ if (S && v) {
281
281
  try {
282
- y.localParticipant.unpublishTrack(S);
282
+ v.localParticipant.unpublishTrack(S);
283
283
  } catch {
284
284
  }
285
285
  S.stop();
286
286
  }
287
- u.current = null, b.current = null, p.current = { active: t, lastAutoIntent: null }, a(t), c("");
288
- }, [t]), w = C(() => s(null), []), R = C(() => vr(u.current), []);
287
+ u.current = null, m.current = null, p.current = { active: t, lastAutoIntent: null }, a(t), s("");
288
+ }, [t]), w = C(() => c(null), []), R = C(() => wr(u.current), []);
289
289
  return {
290
290
  isMuted: i,
291
291
  activeDeviceId: o,
@@ -294,40 +294,40 @@ function br(e = {}) {
294
294
  setupMic: h,
295
295
  attachRoom: P,
296
296
  switchDevice: x,
297
- teardownMic: g,
297
+ teardownMic: y,
298
298
  clearError: w,
299
299
  getMicStream: R
300
300
  };
301
301
  }
302
- const wr = { resolution: { width: 640, height: 480, frameRate: 24 } };
303
- function _r() {
304
- const [e, t] = M(!1), [r, i] = M(null), [a, o] = M(null), [c, l] = M(""), s = I(null), u = I(null), b = C((w) => {
305
- s.current = w;
302
+ const xr = { resolution: { width: 640, height: 480, frameRate: 24 } };
303
+ function Lr() {
304
+ const [e, t] = M(!1), [n, i] = M(null), [a, o] = M(null), [s, l] = M(""), c = I(null), u = I(null), m = C((w) => {
305
+ c.current = w;
306
306
  }, []), p = C(() => {
307
307
  var S;
308
- const w = s.current, R = u.current;
308
+ const w = c.current, R = u.current;
309
309
  if (R && w) {
310
- const y = w.localParticipant.getTrackPublication(Pn.Source.Camera), m = (y == null ? void 0 : y.track) ?? R;
310
+ const v = w.localParticipant.getTrackPublication(zn.Source.Camera), g = (v == null ? void 0 : v.track) ?? R;
311
311
  try {
312
- w.localParticipant.unpublishTrack(m);
312
+ w.localParticipant.unpublishTrack(g);
313
313
  } catch {
314
314
  }
315
315
  try {
316
- (S = m.stop) == null || S.call(m);
316
+ (S = g.stop) == null || S.call(g);
317
317
  } catch {
318
318
  }
319
319
  }
320
320
  u.current = null, o(null), t(!1);
321
321
  }, []), h = C(async (w) => {
322
- const R = s.current;
322
+ const R = c.current;
323
323
  if (R) {
324
324
  i(null);
325
325
  try {
326
- const S = { ...wr };
326
+ const S = { ...xr };
327
327
  w && (S.deviceId = w);
328
- const y = await hr(S);
329
- await R.localParticipant.publishTrack(y), u.current = y;
330
- const O = y.attach();
328
+ const v = await gr(S);
329
+ await R.localParticipant.publishTrack(v), u.current = v;
330
+ const O = v.attach();
331
331
  o(O), t(!0), w && l(w);
332
332
  try {
333
333
  R.localParticipant.publishData(
@@ -337,43 +337,43 @@ function _r() {
337
337
  } catch {
338
338
  }
339
339
  } catch (S) {
340
- const y = S instanceof Error && S.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
341
- i(y);
340
+ const v = S instanceof Error && S.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
341
+ i(v);
342
342
  }
343
343
  }
344
344
  }, []), P = C(async () => {
345
- e ? p() : await h(c || void 0);
346
- }, [e, c, p, h]), x = C(async (w) => {
345
+ e ? p() : await h(s || void 0);
346
+ }, [e, s, p, h]), x = C(async (w) => {
347
347
  p(), await h(w);
348
348
  }, [p, h]), E = C(() => {
349
- p(), s.current = null, i(null), l("");
350
- }, [p]), g = C(() => i(null), []);
349
+ p(), c.current = null, i(null), l("");
350
+ }, [p]), y = C(() => i(null), []);
351
351
  return T(() => () => {
352
352
  u.current && u.current.stop();
353
353
  }, []), {
354
354
  isEnabled: e,
355
- error: r,
355
+ error: n,
356
356
  previewEl: a,
357
- activeDeviceId: c,
357
+ activeDeviceId: s,
358
358
  toggle: P,
359
359
  switchDevice: x,
360
- attachRoom: b,
360
+ attachRoom: m,
361
361
  teardown: E,
362
- clearError: g
362
+ clearError: y
363
363
  };
364
364
  }
365
- function xr() {
366
- const [e, t] = M(!1), [r, i] = M(null), [a, o] = M(null), c = I(null), l = C((h) => {
367
- c.current = h;
368
- }, []), s = C(() => o(null), []), u = C(async () => {
369
- const h = c.current;
365
+ function Cr() {
366
+ const [e, t] = M(!1), [n, i] = M(null), [a, o] = M(null), s = I(null), l = C((h) => {
367
+ s.current = h;
368
+ }, []), c = C(() => o(null), []), u = C(async () => {
369
+ const h = s.current;
370
370
  if (h) {
371
371
  if (e) {
372
372
  try {
373
373
  await h.localParticipant.setScreenShareEnabled(!1);
374
374
  } catch {
375
375
  }
376
- s(), t(!1);
376
+ c(), t(!1);
377
377
  return;
378
378
  }
379
379
  i(null);
@@ -381,10 +381,10 @@ function xr() {
381
381
  await h.localParticipant.setScreenShareEnabled(!0);
382
382
  let P = 0;
383
383
  const x = () => {
384
- const E = h.localParticipant.getTrackPublication(Pn.Source.ScreenShare);
384
+ const E = h.localParticipant.getTrackPublication(zn.Source.ScreenShare);
385
385
  if (E != null && E.track) {
386
- const g = E.track.attach();
387
- o(g), t(!0);
386
+ const y = E.track.attach();
387
+ o(y), t(!0);
388
388
  try {
389
389
  h.localParticipant.publishData(
390
390
  new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
@@ -402,23 +402,23 @@ function xr() {
402
402
  x !== "NotAllowedError" && x !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
403
403
  }
404
404
  }
405
- }, [e, s]), b = C(() => {
406
- const h = c.current;
405
+ }, [e, c]), m = C(() => {
406
+ const h = s.current;
407
407
  if (h && e)
408
408
  try {
409
409
  h.localParticipant.setScreenShareEnabled(!1);
410
410
  } catch {
411
411
  }
412
- s(), t(!1), i(null), c.current = null;
413
- }, [e, s]), p = C(() => i(null), []);
414
- return { isEnabled: e, error: r, previewEl: a, toggle: u, attachRoom: l, teardown: b, clearError: p };
412
+ c(), t(!1), i(null), s.current = null;
413
+ }, [e, c]), p = C(() => i(null), []);
414
+ return { isEnabled: e, error: n, previewEl: a, toggle: u, attachRoom: l, teardown: m, clearError: p };
415
415
  }
416
- function Lr() {
417
- const [e, t] = M([]), [r, i] = M([]), a = C(async () => {
416
+ function kr() {
417
+ const [e, t] = M([]), [n, i] = M([]), a = C(async () => {
418
418
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
419
419
  try {
420
420
  const o = await navigator.mediaDevices.enumerateDevices();
421
- t(o.filter((c) => c.kind === "audioinput")), i(o.filter((c) => c.kind === "videoinput"));
421
+ t(o.filter((s) => s.kind === "audioinput")), i(o.filter((s) => s.kind === "videoinput"));
422
422
  } catch {
423
423
  }
424
424
  }, []);
@@ -426,17 +426,17 @@ function Lr() {
426
426
  if (a(), typeof navigator > "u" || !navigator.mediaDevices) return;
427
427
  const o = () => void a();
428
428
  return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
429
- }, [a]), { mics: e, cameras: r, refresh: a };
429
+ }, [a]), { mics: e, cameras: n, refresh: a };
430
430
  }
431
- function Cr(e, t, r = !1) {
432
- const [i, a] = M(null), [o, c] = M(null), [l, s] = M(!r && !!e);
431
+ function Sr(e, t, n = !1) {
432
+ const [i, a] = M(null), [o, s] = M(null), [l, c] = M(!n && !!e);
433
433
  return T(() => {
434
- if (r || !e) {
435
- s(!1);
434
+ if (n || !e) {
435
+ c(!1);
436
436
  return;
437
437
  }
438
- const u = new AbortController(), b = t || "https://app.livelayer.studio";
439
- return s(!0), c(null), fetch(`${b}/api/widget/agent/${encodeURIComponent(e)}`, {
438
+ const u = new AbortController(), m = t || "https://app.livelayer.studio";
439
+ return c(!0), s(null), fetch(`${m}/api/widget/agent/${encodeURIComponent(e)}`, {
440
440
  signal: u.signal
441
441
  }).then(async (p) => {
442
442
  if (!p.ok) {
@@ -445,13 +445,13 @@ function Cr(e, t, r = !1) {
445
445
  }
446
446
  return p.json();
447
447
  }).then((p) => {
448
- u.signal.aborted || (a(p), s(!1));
448
+ u.signal.aborted || (a(p), c(!1));
449
449
  }).catch((p) => {
450
- u.signal.aborted || (c(p instanceof Error ? p.message : "Agent lookup failed"), s(!1));
450
+ u.signal.aborted || (s(p instanceof Error ? p.message : "Agent lookup failed"), c(!1));
451
451
  }), () => u.abort();
452
- }, [e, t, r]), { info: i, error: o, loading: l };
452
+ }, [e, t, n]), { info: i, error: o, loading: l };
453
453
  }
454
- function Dn(e) {
454
+ function $n(e) {
455
455
  if (typeof window > "u") return null;
456
456
  try {
457
457
  return window.localStorage.getItem(e);
@@ -459,78 +459,78 @@ function Dn(e) {
459
459
  return null;
460
460
  }
461
461
  }
462
- function zn(e, t) {
462
+ function Hn(e, t) {
463
463
  if (!(typeof window > "u"))
464
464
  try {
465
465
  window.localStorage.setItem(e, t);
466
466
  } catch {
467
467
  }
468
468
  }
469
- function kr(e) {
469
+ function Er(e) {
470
470
  if (!(typeof window > "u"))
471
471
  try {
472
472
  window.localStorage.removeItem(e);
473
473
  } catch {
474
474
  }
475
475
  }
476
- function Sr({
476
+ function Nr({
477
477
  value: e,
478
478
  defaultValue: t = "expanded",
479
- onChange: r
479
+ onChange: n
480
480
  } = {}) {
481
- const i = e !== void 0, [a, o] = M(t), c = i ? e : a, l = C(
482
- (s) => {
483
- s !== c && (i || o(s), r == null || r(s));
481
+ const i = e !== void 0, [a, o] = M(t), s = i ? e : a, l = C(
482
+ (c) => {
483
+ c !== s && (i || o(c), n == null || n(c));
484
484
  },
485
- [c, i, r]
485
+ [s, i, n]
486
486
  );
487
- return [c, l];
487
+ return [s, l];
488
488
  }
489
- const Er = ["hidden", "minimized", "expanded"];
490
- function Nr(e) {
491
- return e && Er.includes(e) ? e : null;
489
+ const Ar = ["hidden", "minimized", "expanded"];
490
+ function Mr(e) {
491
+ return e && Ar.includes(e) ? e : null;
492
492
  }
493
- function Ar({
493
+ function Ir({
494
494
  value: e,
495
495
  defaultValue: t = "expanded",
496
- onChange: r,
496
+ onChange: n,
497
497
  persistKey: i = "ll-widget",
498
498
  disablePersistence: a = !1
499
499
  } = {}) {
500
- const o = `${i}:display-mode`, c = I(!1), [l, s] = Sr({
500
+ const o = `${i}:display-mode`, s = I(!1), [l, c] = Nr({
501
501
  value: e,
502
502
  defaultValue: t,
503
503
  onChange: (u) => {
504
- e === void 0 && !a && zn(o, u), r == null || r(u);
504
+ e === void 0 && !a && Hn(o, u), n == null || n(u);
505
505
  }
506
506
  });
507
507
  return T(() => {
508
- if (c.current || (c.current = !0, a || e !== void 0)) return;
509
- const u = Nr(Dn(o));
510
- u && u !== l && s(u);
511
- }, []), [l, s];
508
+ if (s.current || (s.current = !0, a || e !== void 0)) return;
509
+ const u = Mr($n(o));
510
+ u && u !== l && c(u);
511
+ }, []), [l, c];
512
512
  }
513
- const Mr = 640;
514
- function Ir(e = Mr) {
515
- const [t, r] = M(!1);
513
+ const Rr = 640;
514
+ function Tr(e = Rr) {
515
+ const [t, n] = M(!1);
516
516
  return T(() => {
517
517
  if (e === !1) {
518
- r(!1);
518
+ n(!1);
519
519
  return;
520
520
  }
521
521
  if (typeof window > "u" || typeof window.matchMedia > "u")
522
522
  return;
523
- const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i), o = () => r(a.matches);
523
+ const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i), o = () => n(a.matches);
524
524
  return o(), typeof a.addEventListener == "function" ? (a.addEventListener("change", o), () => a.removeEventListener("change", o)) : (a.addListener(o), () => {
525
525
  a.removeListener(o);
526
526
  });
527
527
  }, [e]), t;
528
528
  }
529
- const Rr = 280, Tr = 380, Pr = 8, Dr = 4;
530
- function Ot(e) {
529
+ const Pr = 280, Dr = 380, zr = 8, $r = 4;
530
+ function Ft(e) {
531
531
  return `${e}:geometry`;
532
532
  }
533
- function zr(e) {
533
+ function Hr(e) {
534
534
  if (!e) return null;
535
535
  let t;
536
536
  try {
@@ -539,54 +539,54 @@ function zr(e) {
539
539
  return null;
540
540
  }
541
541
  if (typeof t != "object" || t === null) return null;
542
- const r = t, { top: i, left: a, width: o, height: c } = r;
543
- return typeof i != "number" || typeof a != "number" || typeof o != "number" || typeof c != "number" || !Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(c) ? null : { top: i, left: a, width: o, height: c };
542
+ const n = t, { top: i, left: a, width: o, height: s } = n;
543
+ return typeof i != "number" || typeof a != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: a, width: o, height: s };
544
544
  }
545
- function Ct() {
545
+ function kt() {
546
546
  return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
547
547
  }
548
- function Ft(e, t, r) {
549
- const { minWidth: i, minHeight: a, edgeMargin: o, vw: c, vh: l } = r, s = Math.max(i, c - o * 2), u = Math.max(a, l - o * 2);
548
+ function Wt(e, t, n) {
549
+ const { minWidth: i, minHeight: a, edgeMargin: o, vw: s, vh: l } = n, c = Math.max(i, s - o * 2), u = Math.max(a, l - o * 2);
550
550
  return {
551
- width: Math.max(i, Math.min(s, e)),
551
+ width: Math.max(i, Math.min(c, e)),
552
552
  height: Math.max(a, Math.min(u, t))
553
553
  };
554
554
  }
555
- function Wt(e, t, r, i, a) {
556
- const { edgeMargin: o, vw: c, vh: l } = a, s = o, u = o, b = Math.max(s, c - r - o), p = Math.max(u, l - i - o);
555
+ function Bt(e, t, n, i, a) {
556
+ const { edgeMargin: o, vw: s, vh: l } = a, c = o, u = o, m = Math.max(c, s - n - o), p = Math.max(u, l - i - o);
557
557
  return {
558
558
  top: Math.max(u, Math.min(p, e)),
559
- left: Math.max(s, Math.min(b, t))
559
+ left: Math.max(c, Math.min(m, t))
560
560
  };
561
561
  }
562
- function $r(e) {
562
+ function Or(e) {
563
563
  const {
564
564
  draggable: t,
565
- resizable: r,
565
+ resizable: n,
566
566
  persistKey: i,
567
567
  disablePersistence: a,
568
- minWidth: o = Rr,
569
- minHeight: c = Tr,
570
- edgeMargin: l = Pr
571
- } = e, [s, u] = M(null), [b, p] = M(!1), [h, P] = M(!1), x = I(null), E = I(null), g = I(!1), w = I(null);
572
- w.current = s;
568
+ minWidth: o = Pr,
569
+ minHeight: s = Dr,
570
+ edgeMargin: l = zr
571
+ } = e, [c, u] = M(null), [m, p] = M(!1), [h, P] = M(!1), x = I(null), E = I(null), y = I(!1), w = I(null);
572
+ w.current = c;
573
573
  const R = C(
574
574
  (f) => {
575
- a || (f === null ? kr(Ot(i)) : zn(Ot(i), JSON.stringify(f)));
575
+ a || (f === null ? Er(Ft(i)) : Hn(Ft(i), JSON.stringify(f)));
576
576
  },
577
577
  [a, i]
578
578
  );
579
579
  T(() => {
580
- if (g.current || (g.current = !0, a)) return;
581
- const f = zr(Dn(Ot(i)));
580
+ if (y.current || (y.current = !0, a)) return;
581
+ const f = Hr($n(Ft(i)));
582
582
  if (!f) return;
583
- const { vw: N, vh: z } = Ct(), q = Ft(f.width, f.height, {
583
+ const { vw: N, vh: z } = kt(), q = Wt(f.width, f.height, {
584
584
  minWidth: o,
585
- minHeight: c,
585
+ minHeight: s,
586
586
  edgeMargin: l,
587
587
  vw: N,
588
588
  vh: z
589
- }), X = Wt(f.top, f.left, q.width, q.height, {
589
+ }), X = Bt(f.top, f.left, q.width, q.height, {
590
590
  edgeMargin: l,
591
591
  vw: N,
592
592
  vh: z
@@ -597,14 +597,14 @@ function $r(e) {
597
597
  const f = () => {
598
598
  u((N) => {
599
599
  if (N === null) return null;
600
- const { vw: z, vh: q } = Ct(), X = Ft(N.width, N.height, {
600
+ const { vw: z, vh: q } = kt(), X = Wt(N.width, N.height, {
601
601
  minWidth: o,
602
- minHeight: c,
602
+ minHeight: s,
603
603
  edgeMargin: l,
604
604
  vw: z,
605
605
  vh: q
606
606
  });
607
- return { ...Wt(N.top, N.left, X.width, X.height, {
607
+ return { ...Bt(N.top, N.left, X.width, X.height, {
608
608
  edgeMargin: l,
609
609
  vw: z,
610
610
  vh: q
@@ -612,7 +612,7 @@ function $r(e) {
612
612
  });
613
613
  };
614
614
  return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
615
- }, [o, c, l]);
615
+ }, [o, s, l]);
616
616
  const S = C(
617
617
  (f) => {
618
618
  if (!t || f.pointerType === "mouse" && f.button !== 0) return;
@@ -643,13 +643,13 @@ function $r(e) {
643
643
  };
644
644
  },
645
645
  [t]
646
- ), y = C(
646
+ ), v = C(
647
647
  (f) => {
648
648
  const N = x.current;
649
649
  if (!N) return;
650
650
  const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY;
651
- if (!N.moved && Math.abs(z) + Math.abs(q) > Dr && (N.moved = !0, p(!0)), !N.moved) return;
652
- const { vw: X, vh: ee } = Ct(), V = Wt(
651
+ if (!N.moved && Math.abs(z) + Math.abs(q) > $r && (N.moved = !0, p(!0)), !N.moved) return;
652
+ const { vw: X, vh: ee } = kt(), V = Bt(
653
653
  N.startTop + q,
654
654
  N.startLeft + z,
655
655
  N.width,
@@ -671,11 +671,11 @@ function $r(e) {
671
671
  }
672
672
  },
673
673
  [R]
674
- ), m = C(() => {
674
+ ), g = C(() => {
675
675
  x.current = null, E.current = null, p(!1), P(!1), u(null), R(null);
676
676
  }, [R]), D = C(
677
677
  (f) => {
678
- if (!r || f.pointerType === "mouse" && f.button !== 0) return;
678
+ if (!n || f.pointerType === "mouse" && f.button !== 0) return;
679
679
  f.stopPropagation();
680
680
  let N, z, q, X;
681
681
  const ee = w.current;
@@ -699,14 +699,14 @@ function $r(e) {
699
699
  left: z
700
700
  }, P(!0);
701
701
  },
702
- [r]
702
+ [n]
703
703
  ), W = C(
704
704
  (f) => {
705
705
  const N = E.current;
706
706
  if (!N) return;
707
- const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY, { vw: X, vh: ee } = Ct(), V = X - N.left - l, te = ee - N.top - l, oe = Ft(N.startWidth + z, N.startHeight + q, {
707
+ const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY, { vw: X, vh: ee } = kt(), V = X - N.left - l, te = ee - N.top - l, oe = Wt(N.startWidth + z, N.startHeight + q, {
708
708
  minWidth: o,
709
- minHeight: c,
709
+ minHeight: s,
710
710
  edgeMargin: l,
711
711
  // Clamp the available viewport to the room from the anchored corner
712
712
  // so the widget can't grow past the bottom/right edge.
@@ -715,7 +715,7 @@ function $r(e) {
715
715
  });
716
716
  u({ top: N.top, left: N.left, ...oe });
717
717
  },
718
- [l, o, c]
718
+ [l, o, s]
719
719
  ), K = C(
720
720
  (f) => {
721
721
  if (E.current) {
@@ -729,24 +729,24 @@ function $r(e) {
729
729
  [R]
730
730
  );
731
731
  return {
732
- style: s === null ? {} : {
732
+ style: c === null ? {} : {
733
733
  position: "fixed",
734
- top: `${s.top}px`,
735
- left: `${s.left}px`,
734
+ top: `${c.top}px`,
735
+ left: `${c.left}px`,
736
736
  right: "auto",
737
737
  bottom: "auto",
738
- width: `${s.width}px`,
739
- height: `${s.height}px`
738
+ width: `${c.width}px`,
739
+ height: `${c.height}px`
740
740
  },
741
- hasGeometry: s !== null,
742
- isDragging: b,
741
+ hasGeometry: c !== null,
742
+ isDragging: m,
743
743
  isResizing: h,
744
744
  dragHandleProps: {
745
745
  onPointerDown: S,
746
- onPointerMove: y,
746
+ onPointerMove: v,
747
747
  onPointerUp: O,
748
748
  onPointerCancel: O,
749
- onDoubleClick: m,
749
+ onDoubleClick: g,
750
750
  "data-ll-drag-handle": t ? "" : void 0
751
751
  },
752
752
  resizeHandleProps: {
@@ -754,94 +754,94 @@ function $r(e) {
754
754
  onPointerMove: W,
755
755
  onPointerUp: K,
756
756
  onPointerCancel: K,
757
- "data-ll-resize-handle": r ? "" : void 0
757
+ "data-ll-resize-handle": n ? "" : void 0
758
758
  },
759
- reset: m
759
+ reset: g
760
760
  };
761
761
  }
762
- const fn = "__llHistoryPatched", Et = "ll:pathname";
763
- function Hr() {
764
- if (typeof window > "u" || window.history[fn]) return;
762
+ const mn = "__llHistoryPatched", Nt = "ll:pathname";
763
+ function Fr() {
764
+ if (typeof window > "u" || window.history[mn]) return;
765
765
  const e = window.history.pushState, t = window.history.replaceState;
766
- window.history.pushState = function(...r) {
767
- const i = e.apply(this, r);
768
- return window.dispatchEvent(new Event(Et)), i;
769
- }, window.history.replaceState = function(...r) {
770
- const i = t.apply(this, r);
771
- return window.dispatchEvent(new Event(Et)), i;
772
- }, window.history[fn] = !0;
766
+ window.history.pushState = function(...n) {
767
+ const i = e.apply(this, n);
768
+ return window.dispatchEvent(new Event(Nt)), i;
769
+ }, window.history.replaceState = function(...n) {
770
+ const i = t.apply(this, n);
771
+ return window.dispatchEvent(new Event(Nt)), i;
772
+ }, window.history[mn] = !0;
773
773
  }
774
- function pn() {
774
+ function gn() {
775
775
  return typeof window > "u" ? "/" : window.location.pathname || "/";
776
776
  }
777
- function Or(e) {
778
- const [t, r] = M(
779
- () => e ?? pn()
777
+ function Wr(e) {
778
+ const [t, n] = M(
779
+ () => e ?? gn()
780
780
  );
781
781
  return T(() => {
782
782
  if (e !== void 0) return;
783
- Hr();
784
- const i = () => r(pn());
785
- return i(), window.addEventListener("popstate", i), window.addEventListener(Et, i), () => {
786
- window.removeEventListener("popstate", i), window.removeEventListener(Et, i);
783
+ Fr();
784
+ const i = () => n(gn());
785
+ return i(), window.addEventListener("popstate", i), window.addEventListener(Nt, i), () => {
786
+ window.removeEventListener("popstate", i), window.removeEventListener(Nt, i);
787
787
  };
788
788
  }, [e]), e ?? t;
789
789
  }
790
- const hn = /* @__PURE__ */ new Map(), Fr = /[\\^$+?.()|{}[\]]/g;
791
- function Wr(e) {
792
- return e.replace(Fr, "\\$&");
790
+ const yn = /* @__PURE__ */ new Map(), Br = /[\\^$+?.()|{}[\]]/g;
791
+ function qr(e) {
792
+ return e.replace(Br, "\\$&");
793
793
  }
794
- function Br(e) {
795
- const t = hn.get(e);
794
+ function Ur(e) {
795
+ const t = yn.get(e);
796
796
  if (t) return t;
797
- const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", a = "", o = r.replace(/\*\*/g, i).replace(/\*/g, a), l = Wr(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), s = new RegExp(`^${l}\\/?$`);
798
- return hn.set(e, s), s;
797
+ const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", a = "", o = n.replace(/\*\*/g, i).replace(/\*/g, a), l = qr(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
798
+ return yn.set(e, c), c;
799
799
  }
800
- function qr(e, t) {
801
- const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
802
- return Br(e).test(r);
800
+ function jr(e, t) {
801
+ const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
802
+ return Ur(e).test(n);
803
803
  }
804
- function Ur(e, t) {
805
- return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : qr(e, t);
804
+ function Vr(e, t) {
805
+ return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : jr(e, t);
806
806
  }
807
- function mn(e, t) {
807
+ function vn(e, t) {
808
808
  if (!e || e.length === 0) return !1;
809
- for (const r of e)
810
- if (Ur(r, t)) return !0;
809
+ for (const n of e)
810
+ if (Vr(n, t)) return !0;
811
811
  return !1;
812
812
  }
813
- function jr(e, t, r) {
814
- return e === void 0 ? !0 : mn(r, e) ? !1 : t && t.length > 0 ? mn(t, e) : !0;
813
+ function Yr(e, t, n) {
814
+ return e === void 0 ? !0 : vn(n, e) ? !1 : t && t.length > 0 ? vn(t, e) : !0;
815
815
  }
816
- function Vr(e, t, r) {
817
- return et(
818
- () => jr(e, t, r),
819
- [e, t, r]
816
+ function Gr(e, t, n) {
817
+ return tt(
818
+ () => Yr(e, t, n),
819
+ [e, t, n]
820
820
  );
821
821
  }
822
- function Yr(e) {
822
+ function Xr(e) {
823
823
  return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
824
824
  navigate: e.navigate !== !1,
825
825
  thinking: e.thinking !== !1,
826
826
  action: e.action !== !1
827
827
  };
828
828
  }
829
- function Gr(e) {
830
- const t = et(() => Yr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), i = I(null), a = C(
831
- (s) => {
829
+ function Kr(e) {
830
+ const t = tt(() => Xr(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = I(null), a = C(
831
+ (c) => {
832
832
  try {
833
- new Audio(`${r}${s}`).play().catch(() => {
833
+ new Audio(`${n}${c}`).play().catch(() => {
834
834
  });
835
835
  } catch {
836
836
  }
837
837
  },
838
- [r]
838
+ [n]
839
839
  ), o = C(() => {
840
840
  t.navigate && a("/audio/page-change-sound.mp3");
841
- }, [t.navigate, a]), c = C(() => {
841
+ }, [t.navigate, a]), s = C(() => {
842
842
  t.action && a("/audio/confirmation-sound.mp3");
843
843
  }, [t.action, a]), l = C(
844
- (s) => {
844
+ (c) => {
845
845
  if (!t.thinking) {
846
846
  if (i.current) {
847
847
  try {
@@ -852,10 +852,10 @@ function Gr(e) {
852
852
  }
853
853
  return;
854
854
  }
855
- if (s) {
855
+ if (c) {
856
856
  if (i.current) return;
857
857
  try {
858
- const u = new Audio(`${r}/audio/thinking-sound.mp3`);
858
+ const u = new Audio(`${n}/audio/thinking-sound.mp3`);
859
859
  u.loop = !0, u.volume = 0.3, u.play().catch(() => {
860
860
  i.current = null;
861
861
  }), i.current = u;
@@ -869,7 +869,7 @@ function Gr(e) {
869
869
  i.current = null;
870
870
  }
871
871
  },
872
- [r, t.thinking]
872
+ [n, t.thinking]
873
873
  );
874
874
  return T(() => () => {
875
875
  if (i.current) {
@@ -879,12 +879,12 @@ function Gr(e) {
879
879
  }
880
880
  i.current = null;
881
881
  }
882
- }, []), et(
883
- () => ({ playPageChange: o, playConfirmation: c, setThinking: l }),
884
- [o, c, l]
882
+ }, []), tt(
883
+ () => ({ playPageChange: o, playConfirmation: s, setThinking: l }),
884
+ [o, s, l]
885
885
  );
886
886
  }
887
- const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
887
+ const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
888
888
  "svg",
889
889
  {
890
890
  className: t,
@@ -894,7 +894,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
894
894
  strokeWidth: 2,
895
895
  "aria-hidden": "true",
896
896
  children: [
897
- /* @__PURE__ */ n(
897
+ /* @__PURE__ */ r(
898
898
  "path",
899
899
  {
900
900
  strokeLinecap: "round",
@@ -902,7 +902,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
902
902
  d: "M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"
903
903
  }
904
904
  ),
905
- /* @__PURE__ */ n(
905
+ /* @__PURE__ */ r(
906
906
  "path",
907
907
  {
908
908
  strokeLinecap: "round",
@@ -912,7 +912,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
912
912
  )
913
913
  ]
914
914
  }
915
- ) : /* @__PURE__ */ n(
915
+ ) : /* @__PURE__ */ r(
916
916
  "svg",
917
917
  {
918
918
  className: t,
@@ -921,7 +921,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
921
921
  stroke: "currentColor",
922
922
  strokeWidth: 2,
923
923
  "aria-hidden": "true",
924
- children: /* @__PURE__ */ n(
924
+ children: /* @__PURE__ */ r(
925
925
  "path",
926
926
  {
927
927
  strokeLinecap: "round",
@@ -930,7 +930,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
930
930
  }
931
931
  )
932
932
  }
933
- ), yn = ({ className: e }) => /* @__PURE__ */ n(
933
+ ), wn = ({ className: e }) => /* @__PURE__ */ r(
934
934
  "svg",
935
935
  {
936
936
  className: e,
@@ -939,7 +939,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
939
939
  stroke: "currentColor",
940
940
  strokeWidth: 2,
941
941
  "aria-hidden": "true",
942
- children: /* @__PURE__ */ n(
942
+ children: /* @__PURE__ */ r(
943
943
  "path",
944
944
  {
945
945
  strokeLinecap: "round",
@@ -948,7 +948,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
948
948
  }
949
949
  )
950
950
  }
951
- ), Xr = ({ className: e }) => /* @__PURE__ */ n(
951
+ ), Jr = ({ className: e }) => /* @__PURE__ */ r(
952
952
  "svg",
953
953
  {
954
954
  className: e,
@@ -957,14 +957,14 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
957
957
  stroke: "currentColor",
958
958
  strokeWidth: 2,
959
959
  "aria-hidden": "true",
960
- children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
960
+ children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
961
961
  }
962
- ), Kr = {
962
+ ), Zr = {
963
963
  left: 180,
964
964
  right: 0,
965
965
  up: -90,
966
966
  down: 90
967
- }, vn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
967
+ }, _n = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
968
968
  "svg",
969
969
  {
970
970
  className: t,
@@ -972,19 +972,19 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
972
972
  viewBox: "0 0 24 24",
973
973
  stroke: "currentColor",
974
974
  strokeWidth: 2,
975
- style: { transform: `rotate(${Kr[e]}deg)` },
975
+ style: { transform: `rotate(${Zr[e]}deg)` },
976
976
  "aria-hidden": "true",
977
- children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
977
+ children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
978
978
  }
979
979
  );
980
- function Jr(e) {
980
+ function Qr(e) {
981
981
  return e === "top-left" || e === "bottom-left" ? "left" : "right";
982
982
  }
983
- const $n = "ll-hidden-tab-center-y", Zr = 5, bn = 16;
984
- function Qr() {
983
+ const On = "ll-hidden-tab-center-y", ei = 5, xn = 16;
984
+ function ti() {
985
985
  if (typeof window > "u") return null;
986
986
  try {
987
- const e = window.localStorage.getItem($n);
987
+ const e = window.localStorage.getItem(On);
988
988
  if (!e) return null;
989
989
  const t = Number.parseFloat(e);
990
990
  return Number.isFinite(t) ? t : null;
@@ -992,44 +992,44 @@ function Qr() {
992
992
  return null;
993
993
  }
994
994
  }
995
- function wn(e) {
995
+ function Ln(e) {
996
996
  if (!(typeof window > "u"))
997
997
  try {
998
- window.localStorage.setItem($n, String(e));
998
+ window.localStorage.setItem(On, String(e));
999
999
  } catch {
1000
1000
  }
1001
1001
  }
1002
- const ei = ({
1002
+ const ni = ({
1003
1003
  position: e,
1004
1004
  isMobile: t,
1005
- isSpeaking: r,
1005
+ isSpeaking: n,
1006
1006
  onExpand: i,
1007
1007
  label: a = "Open widget",
1008
1008
  avatarImageUrl: o,
1009
- agentName: c,
1009
+ agentName: s,
1010
1010
  containerEl: l
1011
1011
  }) => {
1012
- const s = Jr(e), u = s === "right" ? "left" : "right", b = t ? 80 : 72, p = !!o, h = !!l, [P, x] = M(null), [E, g] = M(!1), w = I(null), R = I(!1), S = C(
1012
+ const c = Qr(e), u = c === "right" ? "left" : "right", m = t ? 80 : 72, p = !!o, h = !!l, [P, x] = M(null), [E, y] = M(!1), w = I(null), R = I(!1), S = C(
1013
1013
  ($) => {
1014
1014
  if (typeof window > "u") return $;
1015
- const G = b / 2, f = bn + G, N = window.innerHeight - bn - G;
1015
+ const G = m / 2, f = xn + G, N = window.innerHeight - xn - G;
1016
1016
  return N < f ? Math.max(f, $) : Math.max(f, Math.min(N, $));
1017
1017
  },
1018
- [b]
1018
+ [m]
1019
1019
  );
1020
1020
  T(() => {
1021
1021
  if (h) {
1022
1022
  x(null);
1023
1023
  return;
1024
1024
  }
1025
- const $ = Qr();
1025
+ const $ = ti();
1026
1026
  x(S($ ?? window.innerHeight / 2));
1027
1027
  const G = () => {
1028
1028
  x((f) => f === null ? null : S(f));
1029
1029
  };
1030
1030
  return window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
1031
1031
  }, [S, h]);
1032
- const y = C(
1032
+ const v = C(
1033
1033
  ($) => {
1034
1034
  if (!h && !($.pointerType === "mouse" && $.button !== 0) && P !== null) {
1035
1035
  try {
@@ -1049,10 +1049,10 @@ const ei = ({
1049
1049
  const G = w.current;
1050
1050
  if (!G) return;
1051
1051
  const f = $.clientY - G.startClientY;
1052
- !G.moved && Math.abs(f) > Zr && (G.moved = !0, g(!0)), G.moved && x(S(G.startCenterY + f));
1052
+ !G.moved && Math.abs(f) > ei && (G.moved = !0, y(!0)), G.moved && x(S(G.startCenterY + f));
1053
1053
  },
1054
1054
  [S]
1055
- ), m = C(
1055
+ ), g = C(
1056
1056
  ($) => {
1057
1057
  const G = w.current;
1058
1058
  if (G) {
@@ -1060,7 +1060,7 @@ const ei = ({
1060
1060
  $.currentTarget.releasePointerCapture($.pointerId);
1061
1061
  } catch {
1062
1062
  }
1063
- w.current = null, G.moved && (g(!1), R.current = !0, x((f) => (f !== null && wn(f), f)));
1063
+ w.current = null, G.moved && (y(!1), R.current = !0, x((f) => (f !== null && Ln(f), f)));
1064
1064
  }
1065
1065
  },
1066
1066
  []
@@ -1078,29 +1078,29 @@ const ei = ({
1078
1078
  x((f) => {
1079
1079
  if (f === null) return f;
1080
1080
  const N = S(f + G);
1081
- return wn(N), N;
1081
+ return Ln(N), N;
1082
1082
  });
1083
1083
  }
1084
1084
  },
1085
1085
  [S]
1086
1086
  ), K = [
1087
1087
  "ll-hidden",
1088
- `ll-hidden--${s}`,
1088
+ `ll-hidden--${c}`,
1089
1089
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
1090
- r ? "ll-hidden--speaking" : null,
1090
+ n ? "ll-hidden--speaking" : null,
1091
1091
  E ? "is-dragging" : null,
1092
1092
  p ? "ll-hidden--with-avatar" : null,
1093
1093
  h ? "ll-hidden--scoped" : null
1094
- ].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P - b / 2}px`, transform: "none" };
1095
- return /* @__PURE__ */ n(
1094
+ ].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P - m / 2}px`, transform: "none" };
1095
+ return /* @__PURE__ */ r(
1096
1096
  "button",
1097
1097
  {
1098
1098
  type: "button",
1099
1099
  className: K,
1100
- onPointerDown: y,
1100
+ onPointerDown: v,
1101
1101
  onPointerMove: O,
1102
- onPointerUp: m,
1103
- onPointerCancel: m,
1102
+ onPointerUp: g,
1103
+ onPointerCancel: g,
1104
1104
  onClick: D,
1105
1105
  onKeyDown: W,
1106
1106
  "aria-label": a,
@@ -1111,26 +1111,26 @@ const ei = ({
1111
1111
  // as the click affordance), then the circular avatar photo
1112
1112
  // taking the rest of the tab. Reinforces "this is an
1113
1113
  // avatar-based experience" even when collapsed.
1114
- /* @__PURE__ */ k(Fe, { children: [
1115
- /* @__PURE__ */ n(
1116
- vn,
1114
+ /* @__PURE__ */ k(We, { children: [
1115
+ /* @__PURE__ */ r(
1116
+ _n,
1117
1117
  {
1118
1118
  direction: u,
1119
1119
  className: "ll-hidden__chevron ll-hidden__chevron--mini"
1120
1120
  }
1121
1121
  ),
1122
- /* @__PURE__ */ n(
1122
+ /* @__PURE__ */ r(
1123
1123
  "img",
1124
1124
  {
1125
1125
  src: o,
1126
- alt: c ? `${c} avatar` : "Agent avatar",
1126
+ alt: s ? `${s} avatar` : "Agent avatar",
1127
1127
  className: "ll-hidden__avatar",
1128
1128
  draggable: !1
1129
1129
  }
1130
1130
  )
1131
1131
  ] })
1132
- ) : /* @__PURE__ */ n(
1133
- vn,
1132
+ ) : /* @__PURE__ */ r(
1133
+ _n,
1134
1134
  {
1135
1135
  direction: u,
1136
1136
  className: "ll-hidden__chevron"
@@ -1138,28 +1138,28 @@ const ei = ({
1138
1138
  )
1139
1139
  }
1140
1140
  );
1141
- }, ti = ({
1141
+ }, ri = ({
1142
1142
  audioLevel: e,
1143
1143
  bars: t = 20,
1144
- maxHeight: r = 20,
1144
+ maxHeight: n = 20,
1145
1145
  minHeight: i = 4,
1146
1146
  className: a,
1147
1147
  barClassName: o
1148
1148
  }) => {
1149
- const c = I(null), l = I([]), s = et(() => {
1150
- const b = (Math.sqrt(5) - 1) / 2;
1151
- return Array.from({ length: t }, (p, h) => 0.5 + h * b % 1 * 0.5);
1149
+ const s = I(null), l = I([]), c = tt(() => {
1150
+ const m = (Math.sqrt(5) - 1) / 2;
1151
+ return Array.from({ length: t }, (p, h) => 0.5 + h * m % 1 * 0.5);
1152
1152
  }, [t]);
1153
1153
  T(() => e.subscribe((p) => {
1154
1154
  for (let h = 0; h < t; h++) {
1155
1155
  const P = l.current[h];
1156
1156
  if (!P) continue;
1157
- const x = Math.max(i, p * r * s[h]);
1157
+ const x = Math.max(i, p * n * c[h]);
1158
1158
  P.style.height = `${x}px`;
1159
1159
  }
1160
- }), [e, t, r, i, s]);
1160
+ }), [e, t, n, i, c]);
1161
1161
  const u = ["ll-waveform", a].filter(Boolean).join(" ");
1162
- return /* @__PURE__ */ n("div", { ref: c, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (b, p) => /* @__PURE__ */ n(
1162
+ return /* @__PURE__ */ r("div", { ref: s, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (m, p) => /* @__PURE__ */ r(
1163
1163
  "div",
1164
1164
  {
1165
1165
  ref: (h) => {
@@ -1170,144 +1170,144 @@ const ei = ({
1170
1170
  },
1171
1171
  p
1172
1172
  )) });
1173
- }, ni = ({
1173
+ }, ii = ({
1174
1174
  position: e,
1175
1175
  isMobile: t,
1176
- agentName: r,
1176
+ agentName: n,
1177
1177
  avatarImageUrl: i,
1178
1178
  agentState: a,
1179
1179
  isMuted: o,
1180
- audioLevel: c,
1180
+ audioLevel: s,
1181
1181
  onExpand: l,
1182
- onToggleMute: s,
1182
+ onToggleMute: c,
1183
1183
  onClose: u
1184
- }) => t ? /* @__PURE__ */ n(
1184
+ }) => t ? /* @__PURE__ */ r(
1185
1185
  "div",
1186
1186
  {
1187
1187
  className: "ll-minimized ll-minimized--mobile",
1188
1188
  role: "region",
1189
- "aria-label": `${r} widget`,
1189
+ "aria-label": `${n} widget`,
1190
1190
  children: /* @__PURE__ */ k(
1191
1191
  "button",
1192
1192
  {
1193
1193
  type: "button",
1194
1194
  className: "ll-minimized__surface",
1195
1195
  onClick: l,
1196
- "aria-label": `Expand ${r} widget`,
1196
+ "aria-label": `Expand ${n} widget`,
1197
1197
  children: [
1198
1198
  i ? (
1199
1199
  // eslint-disable-next-line @next/next/no-img-element
1200
- /* @__PURE__ */ n(
1200
+ /* @__PURE__ */ r(
1201
1201
  "img",
1202
1202
  {
1203
1203
  src: i,
1204
- alt: r,
1204
+ alt: n,
1205
1205
  className: "ll-minimized__avatar"
1206
1206
  }
1207
1207
  )
1208
- ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
1209
- /* @__PURE__ */ n(
1210
- ti,
1208
+ ) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
1209
+ /* @__PURE__ */ r(
1210
+ ri,
1211
1211
  {
1212
- audioLevel: c,
1212
+ audioLevel: s,
1213
1213
  bars: 16,
1214
1214
  maxHeight: 18,
1215
1215
  className: "ll-minimized__waveform"
1216
1216
  }
1217
1217
  ),
1218
- /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
1218
+ /* @__PURE__ */ r("span", { className: "ll-minimized__name", children: n }),
1219
1219
  /* @__PURE__ */ k("div", { className: "ll-minimized__controls", children: [
1220
- /* @__PURE__ */ n(
1220
+ /* @__PURE__ */ r(
1221
1221
  "span",
1222
1222
  {
1223
1223
  className: "ll-minimized__btn",
1224
1224
  role: "button",
1225
1225
  tabIndex: 0,
1226
- onClick: (b) => {
1227
- b.stopPropagation(), s();
1226
+ onClick: (m) => {
1227
+ m.stopPropagation(), c();
1228
1228
  },
1229
- onKeyDown: (b) => {
1230
- (b.key === "Enter" || b.key === " ") && (b.stopPropagation(), b.preventDefault(), s());
1229
+ onKeyDown: (m) => {
1230
+ (m.key === "Enter" || m.key === " ") && (m.stopPropagation(), m.preventDefault(), c());
1231
1231
  },
1232
1232
  "aria-label": o ? "Unmute microphone" : "Mute microphone",
1233
- children: /* @__PURE__ */ n(gn, { muted: o, className: "ll-minimized__icon" })
1233
+ children: /* @__PURE__ */ r(bn, { muted: o, className: "ll-minimized__icon" })
1234
1234
  }
1235
1235
  ),
1236
- /* @__PURE__ */ n(yn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
1236
+ /* @__PURE__ */ r(wn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
1237
1237
  ] })
1238
1238
  ]
1239
1239
  }
1240
1240
  )
1241
1241
  }
1242
- ) : /* @__PURE__ */ n(
1242
+ ) : /* @__PURE__ */ r(
1243
1243
  "div",
1244
1244
  {
1245
1245
  className: "ll-minimized ll-minimized--desktop",
1246
1246
  "data-position": e,
1247
1247
  role: "region",
1248
- "aria-label": `${r} widget`,
1248
+ "aria-label": `${n} widget`,
1249
1249
  children: /* @__PURE__ */ k("div", { className: "ll-minimized__surface", children: [
1250
1250
  i ? (
1251
1251
  // eslint-disable-next-line @next/next/no-img-element
1252
- /* @__PURE__ */ n(
1252
+ /* @__PURE__ */ r(
1253
1253
  "img",
1254
1254
  {
1255
1255
  src: i,
1256
- alt: r,
1256
+ alt: n,
1257
1257
  className: "ll-minimized__avatar"
1258
1258
  }
1259
1259
  )
1260
- ) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
1260
+ ) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
1261
1261
  /* @__PURE__ */ k("div", { className: "ll-minimized__meta", children: [
1262
- /* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
1263
- /* @__PURE__ */ n("span", { className: "ll-minimized__state", children: a === "speaking" ? "Speaking" : a === "thinking" ? "Thinking" : "Listening" })
1262
+ /* @__PURE__ */ r("span", { className: "ll-minimized__name", children: n }),
1263
+ /* @__PURE__ */ r("span", { className: "ll-minimized__state", children: a === "speaking" ? "Speaking" : a === "thinking" ? "Thinking" : "Listening" })
1264
1264
  ] }),
1265
1265
  /* @__PURE__ */ k("div", { className: "ll-minimized__controls", children: [
1266
- /* @__PURE__ */ n(
1266
+ /* @__PURE__ */ r(
1267
1267
  "button",
1268
1268
  {
1269
1269
  type: "button",
1270
1270
  className: "ll-minimized__btn",
1271
- onClick: s,
1271
+ onClick: c,
1272
1272
  "aria-label": o ? "Unmute microphone" : "Mute microphone",
1273
- children: /* @__PURE__ */ n(gn, { muted: o, className: "ll-minimized__icon" })
1273
+ children: /* @__PURE__ */ r(bn, { muted: o, className: "ll-minimized__icon" })
1274
1274
  }
1275
1275
  ),
1276
- /* @__PURE__ */ n(
1276
+ /* @__PURE__ */ r(
1277
1277
  "button",
1278
1278
  {
1279
1279
  type: "button",
1280
1280
  className: "ll-minimized__btn",
1281
1281
  onClick: l,
1282
- "aria-label": `Expand ${r} widget`,
1283
- children: /* @__PURE__ */ n(yn, { className: "ll-minimized__icon" })
1282
+ "aria-label": `Expand ${n} widget`,
1283
+ children: /* @__PURE__ */ r(wn, { className: "ll-minimized__icon" })
1284
1284
  }
1285
1285
  ),
1286
- /* @__PURE__ */ n(
1286
+ /* @__PURE__ */ r(
1287
1287
  "button",
1288
1288
  {
1289
1289
  type: "button",
1290
1290
  className: "ll-minimized__btn ll-minimized__btn--close",
1291
1291
  onClick: u,
1292
1292
  "aria-label": "Close widget",
1293
- children: /* @__PURE__ */ n(Xr, { className: "ll-minimized__icon" })
1293
+ children: /* @__PURE__ */ r(Jr, { className: "ll-minimized__icon" })
1294
1294
  }
1295
1295
  )
1296
1296
  ] })
1297
1297
  ] })
1298
1298
  }
1299
- ), ri = ({
1299
+ ), oi = ({
1300
1300
  src: e,
1301
1301
  alt: t,
1302
- preCannedPlaying: r = !1,
1302
+ preCannedPlaying: n = !1,
1303
1303
  className: i,
1304
1304
  style: a
1305
1305
  }) => {
1306
- const [o, c] = M(!1), l = I(e);
1306
+ const [o, s] = M(!1), l = I(e);
1307
1307
  if (T(() => {
1308
- l.current !== e && (l.current = e, c(!1));
1308
+ l.current !== e && (l.current = e, s(!1));
1309
1309
  }, [e]), !e) return null;
1310
- const s = {
1310
+ const c = {
1311
1311
  position: "absolute",
1312
1312
  inset: 0,
1313
1313
  width: "100%",
@@ -1315,30 +1315,30 @@ const ei = ({
1315
1315
  objectFit: "cover",
1316
1316
  objectPosition: "top",
1317
1317
  transition: "opacity 500ms ease, transform 500ms ease",
1318
- transform: r ? "scale(1.02)" : "scale(1)",
1318
+ transform: n ? "scale(1.02)" : "scale(1)",
1319
1319
  opacity: o ? 1 : 0,
1320
1320
  ...a
1321
1321
  };
1322
1322
  return (
1323
1323
  // eslint-disable-next-line @next/next/no-img-element
1324
- /* @__PURE__ */ n(
1324
+ /* @__PURE__ */ r(
1325
1325
  "img",
1326
1326
  {
1327
1327
  src: e,
1328
1328
  alt: t,
1329
1329
  className: i,
1330
- style: s,
1330
+ style: c,
1331
1331
  loading: "eager",
1332
1332
  fetchPriority: "high",
1333
- onLoad: () => c(!0)
1333
+ onLoad: () => s(!0)
1334
1334
  }
1335
1335
  )
1336
1336
  );
1337
- }, ii = "#E06540";
1338
- function oi({
1337
+ }, li = "#E06540";
1338
+ function ai({
1339
1339
  size: e = 14,
1340
1340
  className: t,
1341
- fill: r = ii
1341
+ fill: n = li
1342
1342
  }) {
1343
1343
  return /* @__PURE__ */ k(
1344
1344
  "svg",
@@ -1351,68 +1351,68 @@ function oi({
1351
1351
  className: t,
1352
1352
  "aria-hidden": !0,
1353
1353
  children: [
1354
- /* @__PURE__ */ n(
1354
+ /* @__PURE__ */ r(
1355
1355
  "path",
1356
1356
  {
1357
1357
  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",
1358
- fill: r
1358
+ fill: n
1359
1359
  }
1360
1360
  ),
1361
- /* @__PURE__ */ n(
1361
+ /* @__PURE__ */ r(
1362
1362
  "path",
1363
1363
  {
1364
1364
  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",
1365
- fill: r
1365
+ fill: n
1366
1366
  }
1367
1367
  ),
1368
- /* @__PURE__ */ n(
1368
+ /* @__PURE__ */ r(
1369
1369
  "path",
1370
1370
  {
1371
1371
  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",
1372
- fill: r
1372
+ fill: n
1373
1373
  }
1374
1374
  )
1375
1375
  ]
1376
1376
  }
1377
1377
  );
1378
1378
  }
1379
- const li = 8, _n = 8, ai = ({
1379
+ const si = 8, Cn = 8, ci = ({
1380
1380
  open: e,
1381
1381
  onClose: t,
1382
- anchorRef: r,
1382
+ anchorRef: n,
1383
1383
  children: i
1384
1384
  }) => {
1385
- const a = I(null), [o, c] = M(null);
1386
- return Tn(() => {
1385
+ const a = I(null), [o, s] = M(null);
1386
+ return Dn(() => {
1387
1387
  if (!e) {
1388
- c(null);
1388
+ s(null);
1389
1389
  return;
1390
1390
  }
1391
- const l = r.current;
1391
+ const l = n.current;
1392
1392
  if (!l) return;
1393
- const s = () => {
1394
- const u = l.getBoundingClientRect(), b = {
1395
- top: u.top - li,
1393
+ const c = () => {
1394
+ const u = l.getBoundingClientRect(), m = {
1395
+ top: u.top - si,
1396
1396
  left: u.left + u.width / 2
1397
- }, p = _n + 90, h = window.innerWidth - _n - 90;
1398
- b.left < p && (b.left = p), b.left > h && (b.left = h), c(b);
1397
+ }, p = Cn + 90, h = window.innerWidth - Cn - 90;
1398
+ m.left < p && (m.left = p), m.left > h && (m.left = h), s(m);
1399
1399
  };
1400
- return s(), window.addEventListener("scroll", s, !0), window.addEventListener("resize", s), () => {
1401
- window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
1400
+ return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
1401
+ window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
1402
1402
  };
1403
- }, [e, r]), T(() => {
1403
+ }, [e, n]), T(() => {
1404
1404
  if (!e) return;
1405
1405
  const l = (u) => {
1406
- const b = u.target, p = a.current, h = r.current;
1407
- p && p.contains(b) || h && h.contains(b) || t();
1408
- }, s = (u) => {
1406
+ const m = u.target, p = a.current, h = n.current;
1407
+ p && p.contains(m) || h && h.contains(m) || t();
1408
+ }, c = (u) => {
1409
1409
  u.key === "Escape" && (u.stopPropagation(), t());
1410
1410
  };
1411
- return document.addEventListener("mousedown", l), document.addEventListener("keydown", s), () => {
1412
- document.removeEventListener("mousedown", l), document.removeEventListener("keydown", s);
1411
+ return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
1412
+ document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
1413
1413
  };
1414
- }, [e, t, r]), !e || o === null || typeof document > "u" ? null : Vt(
1415
- /* @__PURE__ */ n(
1414
+ }, [e, t, n]), !e || o === null || typeof document > "u" ? null : Xt(
1415
+ /* @__PURE__ */ r(
1416
1416
  "div",
1417
1417
  {
1418
1418
  ref: a,
@@ -1431,24 +1431,24 @@ const li = 8, _n = 8, ai = ({
1431
1431
  ),
1432
1432
  document.body
1433
1433
  );
1434
- }, si = ({
1434
+ }, ui = ({
1435
1435
  isMuted: e,
1436
1436
  onToggleMute: t,
1437
- isCameraEnabled: r,
1437
+ isCameraEnabled: n,
1438
1438
  onToggleCamera: i,
1439
1439
  allowCamera: a,
1440
1440
  isScreenShareEnabled: o,
1441
- onToggleScreenShare: c,
1441
+ onToggleScreenShare: s,
1442
1442
  allowScreenShare: l,
1443
- isSpeakerMuted: s,
1443
+ isSpeakerMuted: c,
1444
1444
  onToggleSpeaker: u,
1445
- allowTyping: b,
1445
+ allowTyping: m,
1446
1446
  isTypingOpen: p,
1447
1447
  onToggleTyping: h,
1448
1448
  onDisconnect: P
1449
1449
  }) => {
1450
- const [x, E] = M(!1), g = I(null);
1451
- return /* @__PURE__ */ k(Fe, { children: [
1450
+ const [x, E] = M(!1), y = I(null);
1451
+ return /* @__PURE__ */ k(We, { children: [
1452
1452
  /* @__PURE__ */ k(
1453
1453
  "div",
1454
1454
  {
@@ -1456,60 +1456,60 @@ const li = 8, _n = 8, ai = ({
1456
1456
  "data-testid": "compact-toolbar",
1457
1457
  onClick: (w) => w.stopPropagation(),
1458
1458
  children: [
1459
- /* @__PURE__ */ n(
1459
+ /* @__PURE__ */ r(
1460
1460
  "button",
1461
1461
  {
1462
1462
  type: "button",
1463
1463
  className: `ll-tool ${e ? "is-muted" : ""}`,
1464
1464
  onClick: t,
1465
1465
  "aria-label": e ? "Unmute microphone" : "Mute microphone",
1466
- children: /* @__PURE__ */ n(Fn, { muted: e })
1466
+ children: /* @__PURE__ */ r(Bn, { muted: e })
1467
1467
  }
1468
1468
  ),
1469
- /* @__PURE__ */ n(
1469
+ /* @__PURE__ */ r(
1470
1470
  "button",
1471
1471
  {
1472
- ref: g,
1472
+ ref: y,
1473
1473
  type: "button",
1474
1474
  className: `ll-tool ${x ? "is-on" : ""}`,
1475
1475
  onClick: () => E((w) => !w),
1476
1476
  "aria-label": "More controls",
1477
1477
  "aria-haspopup": "menu",
1478
1478
  "aria-expanded": x,
1479
- children: /* @__PURE__ */ n(ci, {})
1479
+ children: /* @__PURE__ */ r(di, {})
1480
1480
  }
1481
1481
  ),
1482
- /* @__PURE__ */ n(
1482
+ /* @__PURE__ */ r(
1483
1483
  "button",
1484
1484
  {
1485
1485
  type: "button",
1486
1486
  className: "ll-tool ll-tool--danger",
1487
1487
  onClick: P,
1488
1488
  "aria-label": "End conversation",
1489
- children: /* @__PURE__ */ n(Bn, {})
1489
+ children: /* @__PURE__ */ r(Un, {})
1490
1490
  }
1491
1491
  )
1492
1492
  ]
1493
1493
  }
1494
1494
  ),
1495
1495
  /* @__PURE__ */ k(
1496
- ai,
1496
+ ci,
1497
1497
  {
1498
1498
  open: x,
1499
1499
  onClose: () => E(!1),
1500
- anchorRef: g,
1500
+ anchorRef: y,
1501
1501
  children: [
1502
1502
  a && /* @__PURE__ */ k(
1503
1503
  "button",
1504
1504
  {
1505
1505
  type: "button",
1506
- className: `ll-overflow-popover__item ${r ? "is-on" : ""}`,
1506
+ className: `ll-overflow-popover__item ${n ? "is-on" : ""}`,
1507
1507
  onClick: () => {
1508
1508
  i(), E(!1);
1509
1509
  },
1510
1510
  children: [
1511
- /* @__PURE__ */ n(On, {}),
1512
- /* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
1511
+ /* @__PURE__ */ r(Wn, {}),
1512
+ /* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
1513
1513
  ]
1514
1514
  }
1515
1515
  ),
@@ -1519,11 +1519,11 @@ const li = 8, _n = 8, ai = ({
1519
1519
  type: "button",
1520
1520
  className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
1521
1521
  onClick: () => {
1522
- c(), E(!1);
1522
+ s(), E(!1);
1523
1523
  },
1524
1524
  children: [
1525
- /* @__PURE__ */ n(Hn, {}),
1526
- /* @__PURE__ */ n("span", { children: o ? "Stop sharing" : "Share screen" })
1525
+ /* @__PURE__ */ r(Fn, {}),
1526
+ /* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
1527
1527
  ]
1528
1528
  }
1529
1529
  ),
@@ -1531,17 +1531,17 @@ const li = 8, _n = 8, ai = ({
1531
1531
  "button",
1532
1532
  {
1533
1533
  type: "button",
1534
- className: `ll-overflow-popover__item ${s ? "is-on" : ""}`,
1534
+ className: `ll-overflow-popover__item ${c ? "is-on" : ""}`,
1535
1535
  onClick: () => {
1536
1536
  u(), E(!1);
1537
1537
  },
1538
1538
  children: [
1539
- /* @__PURE__ */ n(Wn, { muted: s }),
1540
- /* @__PURE__ */ n("span", { children: s ? "Unmute speaker" : "Mute speaker" })
1539
+ /* @__PURE__ */ r(qn, { muted: c }),
1540
+ /* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
1541
1541
  ]
1542
1542
  }
1543
1543
  ),
1544
- b && /* @__PURE__ */ k(
1544
+ m && /* @__PURE__ */ k(
1545
1545
  "button",
1546
1546
  {
1547
1547
  type: "button",
@@ -1550,8 +1550,8 @@ const li = 8, _n = 8, ai = ({
1550
1550
  h(), E(!1);
1551
1551
  },
1552
1552
  children: [
1553
- /* @__PURE__ */ n(ui, {}),
1554
- /* @__PURE__ */ n("span", { children: p ? "Hide typing" : "Type a message" })
1553
+ /* @__PURE__ */ r(fi, {}),
1554
+ /* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
1555
1555
  ]
1556
1556
  }
1557
1557
  ),
@@ -1563,8 +1563,8 @@ const li = 8, _n = 8, ai = ({
1563
1563
  disabled: !0,
1564
1564
  "aria-current": "true",
1565
1565
  children: [
1566
- /* @__PURE__ */ n("span", { className: "ll-overflow-popover__lang-code", children: "EN" }),
1567
- /* @__PURE__ */ n("span", { children: "English" })
1566
+ /* @__PURE__ */ r("span", { className: "ll-overflow-popover__lang-code", children: "EN" }),
1567
+ /* @__PURE__ */ r("span", { children: "English" })
1568
1568
  ]
1569
1569
  }
1570
1570
  )
@@ -1573,7 +1573,7 @@ const li = 8, _n = 8, ai = ({
1573
1573
  )
1574
1574
  ] });
1575
1575
  };
1576
- function ci() {
1576
+ function di() {
1577
1577
  return /* @__PURE__ */ k(
1578
1578
  "svg",
1579
1579
  {
@@ -1583,15 +1583,15 @@ function ci() {
1583
1583
  fill: "currentColor",
1584
1584
  "aria-hidden": !0,
1585
1585
  children: [
1586
- /* @__PURE__ */ n("circle", { cx: "6", cy: "12", r: "1.5" }),
1587
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "1.5" }),
1588
- /* @__PURE__ */ n("circle", { cx: "18", cy: "12", r: "1.5" })
1586
+ /* @__PURE__ */ r("circle", { cx: "6", cy: "12", r: "1.5" }),
1587
+ /* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "1.5" }),
1588
+ /* @__PURE__ */ r("circle", { cx: "18", cy: "12", r: "1.5" })
1589
1589
  ]
1590
1590
  }
1591
1591
  );
1592
1592
  }
1593
- function ui() {
1594
- return /* @__PURE__ */ n(
1593
+ function fi() {
1594
+ return /* @__PURE__ */ r(
1595
1595
  "svg",
1596
1596
  {
1597
1597
  width: "16",
@@ -1603,34 +1603,34 @@ function ui() {
1603
1603
  strokeLinecap: "round",
1604
1604
  strokeLinejoin: "round",
1605
1605
  "aria-hidden": !0,
1606
- children: /* @__PURE__ */ n("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
1606
+ children: /* @__PURE__ */ r("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
1607
1607
  }
1608
1608
  );
1609
1609
  }
1610
- const di = ({
1610
+ const pi = ({
1611
1611
  position: e,
1612
1612
  isMobile: t,
1613
- agentName: r,
1613
+ agentName: n,
1614
1614
  avatarImageUrl: i,
1615
1615
  idleLoopUrl: a,
1616
1616
  greeting: o,
1617
- branding: c,
1617
+ branding: s,
1618
1618
  teamMembers: l,
1619
- currentTeamMemberId: s,
1619
+ currentTeamMemberId: c,
1620
1620
  isSwitchingTeamMember: u,
1621
- teamSwitcherOpen: b,
1621
+ teamSwitcherOpen: m,
1622
1622
  onToggleTeamSwitcher: p,
1623
1623
  onSelectTeamMember: h,
1624
1624
  languageMenuOpen: P,
1625
1625
  onToggleLanguageMenu: x,
1626
1626
  connectionState: E,
1627
- agentState: g,
1627
+ agentState: y,
1628
1628
  transcript: w,
1629
1629
  canResume: R,
1630
1630
  needsUserGesture: S,
1631
- error: y,
1631
+ error: v,
1632
1632
  isMuted: O,
1633
- micError: m,
1633
+ micError: g,
1634
1634
  micDevices: D,
1635
1635
  activeMicId: W,
1636
1636
  isCameraEnabled: K,
@@ -1651,25 +1651,25 @@ const di = ({
1651
1651
  transformingLabel: Q,
1652
1652
  avatarVideoContainerRef: be,
1653
1653
  agentVideoEl: ne,
1654
- onConnect: tt,
1655
- onDisconnect: nt,
1656
- onRetry: pt,
1657
- onResumeAudio: ht,
1658
- onToggleMute: rt,
1659
- onSwitchMicDevice: mt,
1660
- onToggleCamera: We,
1661
- onSwitchCameraDevice: Be,
1662
- onToggleScreenShare: Ie,
1663
- onToggleSpeaker: Re,
1664
- onSendMessage: Te,
1665
- onMinimize: Pe,
1666
- onClose: De,
1667
- onClearMicError: qe,
1668
- dragHandleProps: ze,
1654
+ onConnect: nt,
1655
+ onDisconnect: rt,
1656
+ onRetry: ht,
1657
+ onResumeAudio: mt,
1658
+ onToggleMute: it,
1659
+ onSwitchMicDevice: gt,
1660
+ onToggleCamera: Be,
1661
+ onSwitchCameraDevice: qe,
1662
+ onToggleScreenShare: Re,
1663
+ onToggleSpeaker: Te,
1664
+ onSendMessage: Pe,
1665
+ onMinimize: De,
1666
+ onClose: ze,
1667
+ onClearMicError: Ue,
1668
+ dragHandleProps: $e,
1669
1669
  resizeHandleProps: F
1670
1670
  }) => {
1671
- var at;
1672
- const $e = ((l == null ? void 0 : l.length) ?? 0) > 1, Ue = E === "connecting" || E === "connected", we = E === "connected", gt = E === "idle" || E === "disconnected" || E === "error", [He, Ne] = M(!1);
1671
+ var st;
1672
+ const He = ((l == null ? void 0 : l.length) ?? 0) > 1, je = E === "connecting" || E === "connected", we = E === "connected", yt = E === "idle" || E === "disconnected" || E === "error", [Oe, Ne] = M(!1);
1673
1673
  T(() => {
1674
1674
  if (!ne) {
1675
1675
  Ne(!1);
@@ -1685,75 +1685,75 @@ const di = ({
1685
1685
  ne.removeEventListener("playing", _), ne.removeEventListener("loadeddata", _);
1686
1686
  };
1687
1687
  }, [ne]);
1688
- const [Nt, yt] = M(!1);
1688
+ const [At, vt] = M(!1);
1689
1689
  T(() => {
1690
1690
  if (!we) {
1691
- yt(!1);
1691
+ vt(!1);
1692
1692
  return;
1693
1693
  }
1694
- if (He) return;
1695
- const _ = setTimeout(() => yt(!0), 8e3);
1694
+ if (Oe) return;
1695
+ const _ = setTimeout(() => vt(!0), 8e3);
1696
1696
  return () => clearTimeout(_);
1697
- }, [we, He]);
1698
- const Oe = E === "connecting" || we && !!i && !He && !Nt, ue = I(null), it = I(null);
1697
+ }, [we, Oe]);
1698
+ const Fe = E === "connecting" || we && !!i && !Oe && !At, ue = I(null), ot = I(null);
1699
1699
  T(() => {
1700
1700
  const _ = ue.current;
1701
1701
  _ && (_.innerHTML = "", ae && (ae.style.width = "100%", ae.style.height = "100%", ae.style.objectFit = "cover", ae.style.transform = "scaleX(-1)", _.appendChild(ae)));
1702
1702
  }, [ae]), T(() => {
1703
- const _ = it.current;
1703
+ const _ = ot.current;
1704
1704
  _ && (_.innerHTML = "", N && (N.style.width = "100%", N.style.height = "100%", N.style.objectFit = "contain", _.appendChild(N)));
1705
1705
  }, [N]);
1706
- const [le, pe] = M(!1), [je, Ve] = M(!1), ge = I(null), _e = I(null);
1706
+ const [le, pe] = M(!1), [Ve, Ye] = M(!1), ge = I(null), _e = I(null);
1707
1707
  T(() => {
1708
- if (!le && !je && !P && !b) return;
1708
+ if (!le && !Ve && !P && !m) return;
1709
1709
  const _ = () => {
1710
- pe(!1), Ve(!1), P && x(), b && p();
1710
+ pe(!1), Ye(!1), P && x(), m && p();
1711
1711
  };
1712
1712
  return document.addEventListener("click", _), () => document.removeEventListener("click", _);
1713
1713
  }, [
1714
1714
  le,
1715
- je,
1715
+ Ve,
1716
1716
  P,
1717
- b,
1717
+ m,
1718
1718
  x,
1719
1719
  p
1720
1720
  ]);
1721
- const [vt, At] = M(!1), Mt = C(() => At((_) => !_), []), [ot, It] = M(""), Ae = C(
1721
+ const [bt, Mt] = M(!1), It = C(() => Mt((_) => !_), []), [lt, Rt] = M(""), Ae = C(
1722
1722
  (_) => {
1723
1723
  _.preventDefault();
1724
- const re = ot.trim();
1725
- re && (Te(re), It(""));
1724
+ const re = lt.trim();
1725
+ re && (Pe(re), Rt(""));
1726
1726
  },
1727
- [ot, Te]
1728
- ), Me = c.productName || "Live Layer", Se = !c.productName;
1727
+ [lt, Pe]
1728
+ ), Me = s.productName || "Live Layer", Se = !s.productName;
1729
1729
  let ye = null, xe = null;
1730
1730
  for (let _ = w.length - 1; _ >= 0; _--) {
1731
1731
  const re = w[_];
1732
1732
  if (!ye && re.role === "agent" ? ye = re : !xe && re.role === "user" && (xe = re), ye && xe) break;
1733
1733
  }
1734
- const bt = we ? (ye == null ? void 0 : ye.text) || null : o || null, Ye = we && (xe == null ? void 0 : xe.text) || null, lt = [
1734
+ const wt = we ? (ye == null ? void 0 : ye.text) || null : o || null, Ge = we && (xe == null ? void 0 : xe.text) || null, at = [
1735
1735
  "ll-expanded",
1736
1736
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1737
1737
  ].join(" ");
1738
1738
  return /* @__PURE__ */ k(
1739
1739
  "div",
1740
1740
  {
1741
- className: lt,
1741
+ className: at,
1742
1742
  "data-position": e,
1743
- "data-state": we ? "connected" : Ue ? "connecting" : "idle",
1743
+ "data-state": we ? "connected" : je ? "connecting" : "idle",
1744
1744
  role: "dialog",
1745
- "aria-label": `${r} widget`,
1745
+ "aria-label": `${n} widget`,
1746
1746
  children: [
1747
1747
  /* @__PURE__ */ k("div", { className: "ll-expanded__bg", children: [
1748
- i ? /* @__PURE__ */ n(
1749
- ri,
1748
+ i ? /* @__PURE__ */ r(
1749
+ oi,
1750
1750
  {
1751
1751
  src: i,
1752
- alt: r,
1752
+ alt: n,
1753
1753
  className: "ll-expanded__bg-img"
1754
1754
  }
1755
- ) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((at = r == null ? void 0 : r.charAt(0)) == null ? void 0 : at.toUpperCase()) || "A" }) }),
1756
- a && !we && /* @__PURE__ */ n(
1755
+ ) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((st = n == null ? void 0 : n.charAt(0)) == null ? void 0 : st.toUpperCase()) || "A" }) }),
1756
+ a && !we && /* @__PURE__ */ r(
1757
1757
  "video",
1758
1758
  {
1759
1759
  className: "ll-expanded__bg-idle",
@@ -1765,20 +1765,20 @@ const di = ({
1765
1765
  }
1766
1766
  )
1767
1767
  ] }),
1768
- /* @__PURE__ */ n("div", { ref: be, className: "ll-expanded__video" }),
1769
- Oe && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1770
- /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1771
- /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: u ? "Switching..." : "Connecting..." })
1768
+ /* @__PURE__ */ r("div", { ref: be, className: "ll-expanded__video" }),
1769
+ Fe && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1770
+ /* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
1771
+ /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: u ? "Switching..." : "Connecting..." })
1772
1772
  ] }),
1773
1773
  S && we && /* @__PURE__ */ k(
1774
1774
  "button",
1775
1775
  {
1776
1776
  type: "button",
1777
1777
  className: "ll-expanded__overlay ll-expanded__overlay--gesture",
1778
- onClick: ht,
1778
+ onClick: mt,
1779
1779
  children: [
1780
- /* @__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" }) }),
1781
- /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
1780
+ /* @__PURE__ */ r("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
1781
+ /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
1782
1782
  ]
1783
1783
  }
1784
1784
  ),
@@ -1790,13 +1790,13 @@ const di = ({
1790
1790
  "aria-live": "polite",
1791
1791
  "aria-label": Q,
1792
1792
  children: [
1793
- /* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
1794
- /* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: Q })
1793
+ /* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
1794
+ /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: Q })
1795
1795
  ]
1796
1796
  }
1797
1797
  ),
1798
- Ue ? /* @__PURE__ */ k(Fe, { children: [
1799
- !U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar", ...ze, children: [
1798
+ je ? /* @__PURE__ */ k(We, { children: [
1799
+ !U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar", ...$e, children: [
1800
1800
  !oe && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar-left", children: [
1801
1801
  /* @__PURE__ */ k("div", { className: "ll-expanded__pill-wrap", children: [
1802
1802
  /* @__PURE__ */ k(
@@ -1805,17 +1805,17 @@ const di = ({
1805
1805
  type: "button",
1806
1806
  className: "ll-hpill",
1807
1807
  onClick: (_) => {
1808
- $e && (_.stopPropagation(), p());
1808
+ He && (_.stopPropagation(), p());
1809
1809
  },
1810
- "aria-haspopup": $e ? "listbox" : void 0,
1811
- "aria-expanded": $e ? b : void 0,
1810
+ "aria-haspopup": He ? "listbox" : void 0,
1811
+ "aria-expanded": He ? m : void 0,
1812
1812
  children: [
1813
- /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
1814
- $e && /* @__PURE__ */ n(kt, {})
1813
+ /* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
1814
+ He && /* @__PURE__ */ r(St, {})
1815
1815
  ]
1816
1816
  }
1817
1817
  ),
1818
- $e && b && /* @__PURE__ */ n(
1818
+ He && m && /* @__PURE__ */ r(
1819
1819
  "div",
1820
1820
  {
1821
1821
  className: "ll-hmenu",
@@ -1825,12 +1825,12 @@ const di = ({
1825
1825
  "button",
1826
1826
  {
1827
1827
  type: "button",
1828
- className: `ll-hmenu__item ${_.id === s ? "is-active" : ""}`,
1828
+ className: `ll-hmenu__item ${_.id === c ? "is-active" : ""}`,
1829
1829
  onClick: () => h(_.id),
1830
1830
  role: "option",
1831
- "aria-selected": _.id === s,
1831
+ "aria-selected": _.id === c,
1832
1832
  children: [
1833
- _.avatarImageUrl && /* @__PURE__ */ n(
1833
+ _.avatarImageUrl && /* @__PURE__ */ r(
1834
1834
  "img",
1835
1835
  {
1836
1836
  src: _.avatarImageUrl,
@@ -1838,8 +1838,8 @@ const di = ({
1838
1838
  className: "ll-hmenu__avatar"
1839
1839
  }
1840
1840
  ),
1841
- /* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: _.name }),
1842
- _.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: _.role })
1841
+ /* @__PURE__ */ r("span", { className: "ll-hmenu__name", children: _.name }),
1842
+ _.role && /* @__PURE__ */ r("span", { className: "ll-hmenu__role", children: _.role })
1843
1843
  ]
1844
1844
  },
1845
1845
  _.id
@@ -1861,66 +1861,66 @@ const di = ({
1861
1861
  "aria-label": "Language: English",
1862
1862
  title: "Language: English",
1863
1863
  children: [
1864
- /* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
1865
- /* @__PURE__ */ n(kt, {})
1864
+ /* @__PURE__ */ r("span", { className: "ll-hpill__label", children: "EN" }),
1865
+ /* @__PURE__ */ r(St, {})
1866
1866
  ]
1867
1867
  }
1868
1868
  ),
1869
- P && /* @__PURE__ */ n(
1869
+ P && /* @__PURE__ */ r(
1870
1870
  "div",
1871
1871
  {
1872
1872
  className: "ll-hmenu",
1873
1873
  onClick: (_) => _.stopPropagation(),
1874
1874
  role: "listbox",
1875
- children: /* @__PURE__ */ n(
1875
+ children: /* @__PURE__ */ r(
1876
1876
  "button",
1877
1877
  {
1878
1878
  type: "button",
1879
1879
  className: "ll-hmenu__item is-active",
1880
1880
  role: "option",
1881
1881
  "aria-selected": !0,
1882
- children: /* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: "English" })
1882
+ children: /* @__PURE__ */ r("span", { className: "ll-hmenu__name", children: "English" })
1883
1883
  }
1884
1884
  )
1885
1885
  }
1886
1886
  )
1887
1887
  ] }),
1888
- /* @__PURE__ */ n(
1888
+ /* @__PURE__ */ r(
1889
1889
  "span",
1890
1890
  {
1891
- className: `ll-expanded__state ll-expanded__state--${g}`,
1892
- children: g
1891
+ className: `ll-expanded__state ll-expanded__state--${y}`,
1892
+ children: y
1893
1893
  }
1894
1894
  )
1895
1895
  ] }),
1896
1896
  /* @__PURE__ */ k("div", { className: "ll-expanded__header-actions", children: [
1897
- V !== !1 && /* @__PURE__ */ n(
1897
+ V !== !1 && /* @__PURE__ */ r(
1898
1898
  "button",
1899
1899
  {
1900
1900
  type: "button",
1901
1901
  className: "ll-hbtn",
1902
- onClick: Pe,
1902
+ onClick: De,
1903
1903
  "aria-label": "Minimize widget",
1904
1904
  title: "Minimize",
1905
- children: /* @__PURE__ */ n(Ln, {})
1905
+ children: /* @__PURE__ */ r(Sn, {})
1906
1906
  }
1907
1907
  ),
1908
- te !== !1 && /* @__PURE__ */ n(
1908
+ te !== !1 && /* @__PURE__ */ r(
1909
1909
  "button",
1910
1910
  {
1911
1911
  type: "button",
1912
1912
  className: "ll-hbtn ll-hbtn--danger",
1913
- onClick: De,
1913
+ onClick: ze,
1914
1914
  "aria-label": "End call",
1915
1915
  title: "End call",
1916
- children: /* @__PURE__ */ n(xn, {})
1916
+ children: /* @__PURE__ */ r(kn, {})
1917
1917
  }
1918
1918
  )
1919
1919
  ] })
1920
1920
  ] }),
1921
- U && /* @__PURE__ */ k("div", { className: "ll-compact-status", "data-state": g, children: [
1922
- /* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
1923
- /* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: g })
1921
+ U && /* @__PURE__ */ k("div", { className: "ll-compact-status", "data-state": y, children: [
1922
+ /* @__PURE__ */ r("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
1923
+ /* @__PURE__ */ r("span", { className: "ll-compact-status__label", children: y })
1924
1924
  ] })
1925
1925
  ] }) : (
1926
1926
  // Idle-state header. In compactControls mode (mobile WIDGET +
@@ -1931,7 +1931,7 @@ const di = ({
1931
1931
  // can always dismiss; making the whole header disappear (the
1932
1932
  // pre-0.18.0 behavior) left users no way out short of scrolling
1933
1933
  // the page itself.
1934
- /* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", ...ze, children: [
1934
+ /* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", ...$e, children: [
1935
1935
  !U && (Se ? /* @__PURE__ */ k(
1936
1936
  "a",
1937
1937
  {
@@ -1942,59 +1942,59 @@ const di = ({
1942
1942
  "aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
1943
1943
  title: "Powered by LiveLayer — visit livelayer.studio",
1944
1944
  children: [
1945
- /* @__PURE__ */ n(oi, { size: 14, className: "ll-expanded__brand-mark" }),
1946
- /* @__PURE__ */ n("span", { children: Me })
1945
+ /* @__PURE__ */ r(ai, { size: 14, className: "ll-expanded__brand-mark" }),
1946
+ /* @__PURE__ */ r("span", { children: Me })
1947
1947
  ]
1948
1948
  }
1949
- ) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Me })),
1949
+ ) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children: Me })),
1950
1950
  /* @__PURE__ */ k("div", { className: "ll-expanded__header-actions", children: [
1951
- !U && V !== !1 && /* @__PURE__ */ n(
1951
+ !U && V !== !1 && /* @__PURE__ */ r(
1952
1952
  "button",
1953
1953
  {
1954
1954
  type: "button",
1955
1955
  className: "ll-hbtn ll-hbtn--ghost",
1956
- onClick: Pe,
1956
+ onClick: De,
1957
1957
  "aria-label": "Minimize widget",
1958
- children: /* @__PURE__ */ n(Ln, {})
1958
+ children: /* @__PURE__ */ r(Sn, {})
1959
1959
  }
1960
1960
  ),
1961
- te !== !1 && /* @__PURE__ */ n(
1961
+ te !== !1 && /* @__PURE__ */ r(
1962
1962
  "button",
1963
1963
  {
1964
1964
  type: "button",
1965
1965
  className: "ll-hbtn ll-hbtn--danger",
1966
- onClick: De,
1966
+ onClick: ze,
1967
1967
  "aria-label": "Close widget",
1968
- children: /* @__PURE__ */ n(xn, {})
1968
+ children: /* @__PURE__ */ r(kn, {})
1969
1969
  }
1970
1970
  )
1971
1971
  ] })
1972
1972
  ] })
1973
1973
  ),
1974
- gt && /* @__PURE__ */ (() => {
1974
+ yt && /* @__PURE__ */ (() => {
1975
1975
  const _ = R ? "Resume session" : E === "disconnected" ? "Reconnect to agent" : "Start video call";
1976
- return /* @__PURE__ */ k(Fe, { children: [
1977
- !y && /* @__PURE__ */ k(
1976
+ return /* @__PURE__ */ k(We, { children: [
1977
+ !v && /* @__PURE__ */ k(
1978
1978
  "button",
1979
1979
  {
1980
1980
  type: "button",
1981
1981
  className: "ll-expanded__play",
1982
- onClick: tt,
1982
+ onClick: nt,
1983
1983
  "aria-label": _,
1984
1984
  children: [
1985
- /* @__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" }) }) }),
1986
- U && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: _ })
1985
+ /* @__PURE__ */ r("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ r("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
1986
+ U && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children: _ })
1987
1987
  ]
1988
1988
  }
1989
1989
  ),
1990
1990
  !U && /* @__PURE__ */ k("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
1991
- o && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: o }) }),
1992
- /* @__PURE__ */ n(
1991
+ o && /* @__PURE__ */ r("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: o }) }),
1992
+ /* @__PURE__ */ r(
1993
1993
  "button",
1994
1994
  {
1995
1995
  type: "button",
1996
1996
  className: "ll-expanded__cta",
1997
- onClick: tt,
1997
+ onClick: nt,
1998
1998
  "aria-label": _,
1999
1999
  children: _
2000
2000
  }
@@ -2005,16 +2005,16 @@ const di = ({
2005
2005
  /* @__PURE__ */ k(
2006
2006
  "div",
2007
2007
  {
2008
- className: `ll-expanded__pip ${Ue && (K || f) ? "is-visible" : ""}`,
2008
+ className: `ll-expanded__pip ${je && (K || f) ? "is-visible" : ""}`,
2009
2009
  children: [
2010
- /* @__PURE__ */ n(
2010
+ /* @__PURE__ */ r(
2011
2011
  "div",
2012
2012
  {
2013
- ref: it,
2013
+ ref: ot,
2014
2014
  className: f ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
2015
2015
  }
2016
2016
  ),
2017
- /* @__PURE__ */ n(
2017
+ /* @__PURE__ */ r(
2018
2018
  "div",
2019
2019
  {
2020
2020
  ref: ue,
@@ -2024,219 +2024,219 @@ const di = ({
2024
2024
  ]
2025
2025
  }
2026
2026
  ),
2027
- Ue ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
2028
- !U && bt && /* @__PURE__ */ n(
2027
+ je ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
2028
+ !U && wt && /* @__PURE__ */ r(
2029
2029
  "div",
2030
2030
  {
2031
2031
  className: "ll-expanded__transcript ll-expanded__transcript--agent",
2032
2032
  "data-role": "agent",
2033
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: bt })
2033
+ children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: wt })
2034
2034
  }
2035
2035
  ),
2036
- !U && Ye && /* @__PURE__ */ n(
2036
+ !U && Ge && /* @__PURE__ */ r(
2037
2037
  "div",
2038
2038
  {
2039
2039
  className: "ll-expanded__transcript ll-expanded__transcript--user",
2040
2040
  "data-role": "user",
2041
- children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ye })
2041
+ children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Ge })
2042
2042
  }
2043
2043
  ),
2044
2044
  !oe && !U && /* @__PURE__ */ k("div", { className: "ll-toolbar", onClick: (_) => _.stopPropagation(), children: [
2045
- X && /* @__PURE__ */ n(
2045
+ X && /* @__PURE__ */ r(
2046
2046
  "button",
2047
2047
  {
2048
2048
  type: "button",
2049
2049
  className: `ll-tool ${f ? "is-on" : ""}`,
2050
- onClick: Ie,
2050
+ onClick: Re,
2051
2051
  "aria-label": f ? "Stop sharing screen" : "Share screen",
2052
2052
  title: f ? "Stop sharing" : "Share screen",
2053
- children: /* @__PURE__ */ n(Hn, {})
2053
+ children: /* @__PURE__ */ r(Fn, {})
2054
2054
  }
2055
2055
  ),
2056
2056
  q && /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
2057
- /* @__PURE__ */ n(
2057
+ /* @__PURE__ */ r(
2058
2058
  "button",
2059
2059
  {
2060
2060
  type: "button",
2061
2061
  className: `ll-tool ll-tool--left ${K ? "is-on" : ""}`,
2062
- onClick: We,
2062
+ onClick: Be,
2063
2063
  "aria-label": K ? "Turn off camera" : "Turn on camera",
2064
2064
  title: K ? "Stop camera" : "Start camera",
2065
- children: /* @__PURE__ */ n(On, {})
2065
+ children: /* @__PURE__ */ r(Wn, {})
2066
2066
  }
2067
2067
  ),
2068
- /* @__PURE__ */ n(
2068
+ /* @__PURE__ */ r(
2069
2069
  "button",
2070
2070
  {
2071
2071
  ref: _e,
2072
2072
  type: "button",
2073
2073
  className: `ll-tool ll-tool--right ${K ? "is-on" : ""}`,
2074
2074
  onClick: (_) => {
2075
- _.stopPropagation(), Ve((re) => !re), pe(!1);
2075
+ _.stopPropagation(), Ye((re) => !re), pe(!1);
2076
2076
  },
2077
2077
  "aria-label": "Camera devices",
2078
2078
  "aria-haspopup": "listbox",
2079
- "aria-expanded": je,
2080
- children: /* @__PURE__ */ n(kt, {})
2079
+ "aria-expanded": Ve,
2080
+ children: /* @__PURE__ */ r(St, {})
2081
2081
  }
2082
2082
  ),
2083
- je && $.length > 0 && /* @__PURE__ */ n(
2084
- Cn,
2083
+ Ve && $.length > 0 && /* @__PURE__ */ r(
2084
+ En,
2085
2085
  {
2086
2086
  label: "Camera",
2087
2087
  devices: $,
2088
2088
  activeId: G,
2089
2089
  anchorRef: _e,
2090
2090
  onPick: (_) => {
2091
- Ve(!1), Be(_);
2091
+ Ye(!1), qe(_);
2092
2092
  }
2093
2093
  }
2094
2094
  )
2095
2095
  ] }),
2096
2096
  /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
2097
- /* @__PURE__ */ n(
2097
+ /* @__PURE__ */ r(
2098
2098
  "button",
2099
2099
  {
2100
2100
  type: "button",
2101
2101
  className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
2102
- onClick: rt,
2102
+ onClick: it,
2103
2103
  "aria-label": O ? "Unmute microphone" : "Mute microphone",
2104
2104
  title: O ? "Unmute" : "Mute",
2105
- children: /* @__PURE__ */ n(Fn, { muted: O })
2105
+ children: /* @__PURE__ */ r(Bn, { muted: O })
2106
2106
  }
2107
2107
  ),
2108
- /* @__PURE__ */ n(
2108
+ /* @__PURE__ */ r(
2109
2109
  "button",
2110
2110
  {
2111
2111
  ref: ge,
2112
2112
  type: "button",
2113
2113
  className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
2114
2114
  onClick: (_) => {
2115
- _.stopPropagation(), pe((re) => !re), Ve(!1);
2115
+ _.stopPropagation(), pe((re) => !re), Ye(!1);
2116
2116
  },
2117
2117
  "aria-label": "Microphone devices",
2118
2118
  "aria-haspopup": "listbox",
2119
2119
  "aria-expanded": le,
2120
- children: /* @__PURE__ */ n(kt, {})
2120
+ children: /* @__PURE__ */ r(St, {})
2121
2121
  }
2122
2122
  ),
2123
- le && D.length > 0 && /* @__PURE__ */ n(
2124
- Cn,
2123
+ le && D.length > 0 && /* @__PURE__ */ r(
2124
+ En,
2125
2125
  {
2126
2126
  label: "Microphone",
2127
2127
  devices: D,
2128
2128
  activeId: W,
2129
2129
  anchorRef: ge,
2130
2130
  onPick: (_) => {
2131
- pe(!1), mt(_);
2131
+ pe(!1), gt(_);
2132
2132
  }
2133
2133
  }
2134
2134
  )
2135
2135
  ] }),
2136
- /* @__PURE__ */ n(
2136
+ /* @__PURE__ */ r(
2137
2137
  "button",
2138
2138
  {
2139
2139
  type: "button",
2140
2140
  className: `ll-tool ${z ? "is-muted" : ""}`,
2141
- onClick: Re,
2141
+ onClick: Te,
2142
2142
  "aria-label": z ? "Unmute speaker" : "Mute speaker",
2143
2143
  title: z ? "Unmute speaker" : "Mute speaker",
2144
- children: /* @__PURE__ */ n(Wn, { muted: z })
2144
+ children: /* @__PURE__ */ r(qn, { muted: z })
2145
2145
  }
2146
2146
  ),
2147
- /* @__PURE__ */ n(
2147
+ /* @__PURE__ */ r(
2148
2148
  "button",
2149
2149
  {
2150
2150
  type: "button",
2151
2151
  className: "ll-tool ll-tool--danger",
2152
- onClick: nt,
2152
+ onClick: rt,
2153
2153
  "aria-label": "End conversation",
2154
2154
  title: "End conversation",
2155
- children: /* @__PURE__ */ n(Bn, {})
2155
+ children: /* @__PURE__ */ r(Un, {})
2156
2156
  }
2157
2157
  )
2158
2158
  ] }),
2159
- !oe && U && /* @__PURE__ */ n(
2160
- si,
2159
+ !oe && U && /* @__PURE__ */ r(
2160
+ ui,
2161
2161
  {
2162
2162
  isMuted: O,
2163
- onToggleMute: rt,
2163
+ onToggleMute: it,
2164
2164
  isCameraEnabled: K,
2165
- onToggleCamera: We,
2165
+ onToggleCamera: Be,
2166
2166
  allowCamera: q,
2167
2167
  isScreenShareEnabled: f,
2168
- onToggleScreenShare: Ie,
2168
+ onToggleScreenShare: Re,
2169
2169
  allowScreenShare: X,
2170
2170
  isSpeakerMuted: z,
2171
- onToggleSpeaker: Re,
2171
+ onToggleSpeaker: Te,
2172
2172
  allowTyping: ee,
2173
- isTypingOpen: vt,
2174
- onToggleTyping: Mt,
2175
- onDisconnect: nt
2173
+ isTypingOpen: bt,
2174
+ onToggleTyping: It,
2175
+ onDisconnect: rt
2176
2176
  }
2177
2177
  ),
2178
- !oe && ee && (U ? vt : !0) && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Ae, children: [
2179
- /* @__PURE__ */ n(
2178
+ !oe && ee && (U ? bt : !0) && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Ae, children: [
2179
+ /* @__PURE__ */ r(
2180
2180
  "input",
2181
2181
  {
2182
2182
  type: "text",
2183
2183
  className: "ll-message-input__field",
2184
2184
  placeholder: "Message...",
2185
- value: ot,
2186
- onChange: (_) => It(_.target.value),
2185
+ value: lt,
2186
+ onChange: (_) => Rt(_.target.value),
2187
2187
  "aria-label": "Message the agent"
2188
2188
  }
2189
2189
  ),
2190
- ot.trim() && /* @__PURE__ */ n(
2190
+ lt.trim() && /* @__PURE__ */ r(
2191
2191
  "button",
2192
2192
  {
2193
2193
  type: "submit",
2194
2194
  className: "ll-message-input__send",
2195
2195
  "aria-label": "Send message",
2196
- children: /* @__PURE__ */ n(fi, {})
2196
+ children: /* @__PURE__ */ r(hi, {})
2197
2197
  }
2198
2198
  )
2199
2199
  ] })
2200
2200
  ] }) : null,
2201
2201
  (() => {
2202
- if (m && E !== "error")
2202
+ if (g && E !== "error")
2203
2203
  return /* @__PURE__ */ k("div", { className: "ll-expanded__banner", role: "alert", children: [
2204
- /* @__PURE__ */ n("span", { children: m }),
2205
- /* @__PURE__ */ n(
2204
+ /* @__PURE__ */ r("span", { children: g }),
2205
+ /* @__PURE__ */ r(
2206
2206
  "button",
2207
2207
  {
2208
2208
  type: "button",
2209
2209
  className: "ll-expanded__banner-x",
2210
- onClick: qe,
2210
+ onClick: Ue,
2211
2211
  "aria-label": "Dismiss",
2212
2212
  children: "×"
2213
2213
  }
2214
2214
  )
2215
2215
  ] });
2216
- if (!y || E !== "error") return null;
2216
+ if (!v || E !== "error") return null;
2217
2217
  let _ = "Failed to connect", re = "Try again";
2218
- return y === "MIC_PERMISSION_DENIED" ? _ = "Microphone blocked. Allow access to talk." : y === "MIC_NOT_FOUND" ? _ = "No microphone found. Plug one in + retry." : y === "MIC_UNAVAILABLE" ? _ = "Mic unavailable. Check other apps using it." : y === "AGENT_TIMEOUT" ? _ = "Agent didn't pick up. Try again." : y === "CONNECT_FAILED" ? _ = "Connection failed. Check your network." : y.length < 80 && (_ = y), /* @__PURE__ */ k("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
2219
- /* @__PURE__ */ n("span", { children: _ }),
2220
- /* @__PURE__ */ n(
2218
+ return v === "MIC_PERMISSION_DENIED" ? _ = "Microphone blocked. Allow access to talk." : v === "MIC_NOT_FOUND" ? _ = "No microphone found. Plug one in + retry." : v === "MIC_UNAVAILABLE" ? _ = "Mic unavailable. Check other apps using it." : v === "AGENT_TIMEOUT" ? _ = "Agent didn't pick up. Try again." : v === "CONNECT_FAILED" ? _ = "Connection failed. Check your network." : v.length < 80 && (_ = v), /* @__PURE__ */ k("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
2219
+ /* @__PURE__ */ r("span", { children: _ }),
2220
+ /* @__PURE__ */ r(
2221
2221
  "button",
2222
2222
  {
2223
2223
  type: "button",
2224
2224
  className: "ll-expanded__banner-retry",
2225
- onClick: pt,
2225
+ onClick: ht,
2226
2226
  children: re
2227
2227
  }
2228
2228
  )
2229
2229
  ] });
2230
2230
  })(),
2231
- (F == null ? void 0 : F["data-ll-resize-handle"]) !== void 0 && /* @__PURE__ */ n(
2231
+ (F == null ? void 0 : F["data-ll-resize-handle"]) !== void 0 && /* @__PURE__ */ r(
2232
2232
  "div",
2233
2233
  {
2234
2234
  className: "ll-expanded__resize-grip",
2235
2235
  ...F,
2236
2236
  "aria-hidden": !0,
2237
2237
  children: /* @__PURE__ */ k("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
2238
- /* @__PURE__ */ n("line", { x1: "11", y1: "4", x2: "4", y2: "11" }),
2239
- /* @__PURE__ */ n("line", { x1: "11", y1: "8", x2: "8", y2: "11" })
2238
+ /* @__PURE__ */ r("line", { x1: "11", y1: "4", x2: "4", y2: "11" }),
2239
+ /* @__PURE__ */ r("line", { x1: "11", y1: "8", x2: "8", y2: "11" })
2240
2240
  ] })
2241
2241
  }
2242
2242
  )
@@ -2244,56 +2244,56 @@ const di = ({
2244
2244
  }
2245
2245
  );
2246
2246
  };
2247
- function kt() {
2248
- 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" }) });
2247
+ function St() {
2248
+ return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" }) });
2249
2249
  }
2250
- function xn() {
2250
+ function kn() {
2251
2251
  return /* @__PURE__ */ k("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
2252
- /* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
2253
- /* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
2252
+ /* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
2253
+ /* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
2254
2254
  ] });
2255
2255
  }
2256
- function Ln() {
2257
- 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" }) });
2256
+ function Sn() {
2257
+ return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
2258
2258
  }
2259
- function Hn() {
2259
+ function Fn() {
2260
2260
  return /* @__PURE__ */ k("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2261
- /* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
2262
- /* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
2263
- /* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
2261
+ /* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
2262
+ /* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
2263
+ /* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
2264
2264
  ] });
2265
2265
  }
2266
- function On() {
2266
+ function Wn() {
2267
2267
  return /* @__PURE__ */ k("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2268
- /* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
2269
- /* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
2268
+ /* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
2269
+ /* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
2270
2270
  ] });
2271
2271
  }
2272
- function Fn({ muted: e }) {
2272
+ function Bn({ muted: e }) {
2273
2273
  return /* @__PURE__ */ k("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2274
- /* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
2275
- /* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
2276
- /* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
2277
- e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2274
+ /* @__PURE__ */ r("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
2275
+ /* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
2276
+ /* @__PURE__ */ r("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
2277
+ e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2278
2278
  ] });
2279
2279
  }
2280
- function Wn({ muted: e }) {
2280
+ function qn({ muted: e }) {
2281
2281
  return /* @__PURE__ */ k("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2282
- /* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
2283
- e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ k(Fe, { children: [
2284
- /* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
2285
- /* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
2282
+ /* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
2283
+ e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ k(We, { children: [
2284
+ /* @__PURE__ */ r("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
2285
+ /* @__PURE__ */ r("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
2286
2286
  ] })
2287
2287
  ] });
2288
2288
  }
2289
- function fi() {
2289
+ function hi() {
2290
2290
  return /* @__PURE__ */ k("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2291
- /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
2292
- /* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
2291
+ /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
2292
+ /* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
2293
2293
  ] });
2294
2294
  }
2295
- function Bn() {
2296
- 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(
2295
+ function Un() {
2296
+ return /* @__PURE__ */ r("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ r(
2297
2297
  "path",
2298
2298
  {
2299
2299
  d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.93.37 1.84.71 2.7a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.38-1.38a2 2 0 0 1 2.11-.45c.86.34 1.77.58 2.7.71A2 2 0 0 1 22 16.92z",
@@ -2301,28 +2301,28 @@ function Bn() {
2301
2301
  }
2302
2302
  ) });
2303
2303
  }
2304
- const Cn = ({
2304
+ const En = ({
2305
2305
  label: e,
2306
2306
  devices: t,
2307
- activeId: r,
2307
+ activeId: n,
2308
2308
  onPick: i,
2309
2309
  anchorRef: a
2310
2310
  }) => {
2311
- const [o, c] = M(null);
2312
- return Tn(() => {
2311
+ const [o, s] = M(null);
2312
+ return Dn(() => {
2313
2313
  const l = () => {
2314
- const s = a.current;
2315
- if (!s) return;
2316
- const u = s.getBoundingClientRect(), b = 126, p = window.innerWidth - 16 - 110, h = u.left + u.width / 2;
2317
- c({
2314
+ const c = a.current;
2315
+ if (!c) return;
2316
+ const u = c.getBoundingClientRect(), m = 126, p = window.innerWidth - 16 - 110, h = u.left + u.width / 2;
2317
+ s({
2318
2318
  top: u.top - 8,
2319
- left: Math.max(b, Math.min(p, h))
2319
+ left: Math.max(m, Math.min(p, h))
2320
2320
  });
2321
2321
  };
2322
2322
  return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
2323
2323
  window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
2324
2324
  };
2325
- }, [a]), o === null || typeof document > "u" ? null : Vt(
2325
+ }, [a]), o === null || typeof document > "u" ? null : Xt(
2326
2326
  /* @__PURE__ */ k(
2327
2327
  "div",
2328
2328
  {
@@ -2337,9 +2337,9 @@ const Cn = ({
2337
2337
  transform: "translate(-50%, -100%)"
2338
2338
  },
2339
2339
  children: [
2340
- /* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
2341
- t.map((l, s) => {
2342
- const u = r === l.deviceId;
2340
+ /* @__PURE__ */ r("p", { className: "ll-device-menu__label", children: e }),
2341
+ t.map((l, c) => {
2342
+ const u = n === l.deviceId;
2343
2343
  return /* @__PURE__ */ k(
2344
2344
  "button",
2345
2345
  {
@@ -2349,11 +2349,11 @@ const Cn = ({
2349
2349
  role: "option",
2350
2350
  "aria-selected": u,
2351
2351
  children: [
2352
- u && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
2353
- /* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: l.label || `${e} ${s + 1}` })
2352
+ u && /* @__PURE__ */ r("span", { className: "ll-device-menu__dot", children: "●" }),
2353
+ /* @__PURE__ */ r("span", { className: "ll-device-menu__name", children: l.label || `${e} ${c + 1}` })
2354
2354
  ]
2355
2355
  },
2356
- l.deviceId || s
2356
+ l.deviceId || c
2357
2357
  );
2358
2358
  })
2359
2359
  ]
@@ -2361,7 +2361,7 @@ const Cn = ({
2361
2361
  ),
2362
2362
  document.body
2363
2363
  );
2364
- }, pi = [
2364
+ }, mi = [
2365
2365
  // Accept any value (or empty) — `<input data-ll-private />` and
2366
2366
  // `<input data-ll-private="true" />` both opt out. The bare attribute
2367
2367
  // is the recommended spelling; "true" is preserved for back-compat.
@@ -2369,17 +2369,17 @@ const Cn = ({
2369
2369
  "[data-ll-skip]",
2370
2370
  ".ll-widget"
2371
2371
  ];
2372
- function Yt(e) {
2372
+ function Kt(e) {
2373
2373
  let t = e;
2374
2374
  for (; t; ) {
2375
- for (const r of pi)
2376
- if (t.matches(r)) return !0;
2375
+ for (const n of mi)
2376
+ if (t.matches(n)) return !0;
2377
2377
  t = t.parentElement;
2378
2378
  }
2379
2379
  return !1;
2380
2380
  }
2381
- function Ut(e) {
2382
- if (Yt(e)) return !1;
2381
+ function Vt(e) {
2382
+ if (Kt(e)) return !1;
2383
2383
  if (e instanceof HTMLInputElement) {
2384
2384
  if (e.type === "password") return !1;
2385
2385
  const t = (e.getAttribute("autocomplete") || "").toLowerCase();
@@ -2387,7 +2387,7 @@ function Ut(e) {
2387
2387
  }
2388
2388
  return !0;
2389
2389
  }
2390
- const St = 4096, hi = 20, mi = 20, gi = 10, yi = 10, vi = 30, bi = 20, kn = 500, wi = [
2390
+ const Et = 4096, gi = 20, yi = 20, vi = 10, bi = 10, wi = 30, _i = 20, Nn = 500, xi = [
2391
2391
  '[data-ll-private="true"]',
2392
2392
  ".ll-widget",
2393
2393
  "script",
@@ -2395,46 +2395,46 @@ const St = 4096, hi = 20, mi = 20, gi = 10, yi = 10, vi = 30, bi = 20, kn = 500,
2395
2395
  "noscript",
2396
2396
  "iframe"
2397
2397
  ];
2398
- function dt(e) {
2398
+ function ft(e) {
2399
2399
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
2400
2400
  let t = e;
2401
2401
  for (; t; ) {
2402
- for (const r of wi)
2403
- if (t.matches(r)) return !0;
2402
+ for (const n of xi)
2403
+ if (t.matches(n)) return !0;
2404
2404
  t = t.parentElement;
2405
2405
  }
2406
2406
  return !1;
2407
2407
  }
2408
- function ft(e) {
2408
+ function pt(e) {
2409
2409
  if (typeof window > "u") return !0;
2410
2410
  const t = e.getBoundingClientRect();
2411
2411
  if (t.width <= 0 || t.height <= 0) return !1;
2412
- const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
2413
- return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
2412
+ const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
2413
+ return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
2414
2414
  }
2415
- function Sn(e) {
2415
+ function An(e) {
2416
2416
  const t = e.getAttribute("id");
2417
2417
  if (t) {
2418
- const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), c = document.querySelector(`label[for="${o}"]`);
2419
- if (c != null && c.textContent) return c.textContent.trim();
2418
+ const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
2419
+ if (s != null && s.textContent) return s.textContent.trim();
2420
2420
  }
2421
- const r = e.getAttribute("aria-label");
2422
- if (r) return r.trim();
2421
+ const n = e.getAttribute("aria-label");
2422
+ if (n) return n.trim();
2423
2423
  const i = e.closest("label");
2424
2424
  if (i) {
2425
2425
  const o = [];
2426
2426
  for (const l of Array.from(i.childNodes))
2427
2427
  if (l.nodeType === Node.TEXT_NODE) {
2428
- const s = (l.textContent || "").trim();
2429
- s && o.push(s);
2428
+ const c = (l.textContent || "").trim();
2429
+ c && o.push(c);
2430
2430
  } else if (l instanceof HTMLElement) {
2431
2431
  if (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement || l instanceof HTMLButtonElement)
2432
2432
  continue;
2433
- const s = (l.textContent || "").trim();
2434
- s && o.push(s);
2433
+ const c = (l.textContent || "").trim();
2434
+ c && o.push(c);
2435
2435
  }
2436
- const c = o.join(" ").trim();
2437
- if (c) return c;
2436
+ const s = o.join(" ").trim();
2437
+ if (s) return s;
2438
2438
  }
2439
2439
  const a = e.getAttribute("placeholder");
2440
2440
  return a ? a.trim() : "";
@@ -2442,15 +2442,15 @@ function Sn(e) {
2442
2442
  function fe(e, t) {
2443
2443
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
2444
2444
  }
2445
- function _i(e) {
2445
+ function Li(e) {
2446
2446
  return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2447
2447
  }
2448
- function xi(e) {
2448
+ function Ci(e) {
2449
2449
  const t = e.getAttribute("aria-label");
2450
2450
  if (t) return t.trim().slice(0, 80);
2451
- const r = e.getAttribute("aria-labelledby");
2452
- if (r) {
2453
- const o = document.getElementById(r);
2451
+ const n = e.getAttribute("aria-labelledby");
2452
+ if (n) {
2453
+ const o = document.getElementById(n);
2454
2454
  if (o != null && o.textContent) return o.textContent.trim().slice(0, 80);
2455
2455
  }
2456
2456
  const i = e.querySelector(
@@ -2463,20 +2463,20 @@ function xi(e) {
2463
2463
  }
2464
2464
  let a = e.parentElement;
2465
2465
  for (let o = 0; a && o < 4; o++, a = a.parentElement) {
2466
- const c = a.querySelector("h1, h2, h3, h4");
2467
- if (c != null && c.textContent) {
2468
- const l = c.textContent.trim();
2466
+ const s = a.querySelector("h1, h2, h3, h4");
2467
+ if (s != null && s.textContent) {
2468
+ const l = s.textContent.trim();
2469
2469
  if (l && l.length < 80) return l;
2470
2470
  }
2471
2471
  }
2472
2472
  return null;
2473
2473
  }
2474
- function Je(e) {
2474
+ function Ze(e) {
2475
2475
  return e.length;
2476
2476
  }
2477
- function Li(e, t = {}) {
2478
- const r = t.doc ?? (typeof document < "u" ? document : null);
2479
- if (!r)
2477
+ function ki(e, t = {}) {
2478
+ const n = t.doc ?? (typeof document < "u" ? document : null);
2479
+ if (!n)
2480
2480
  return {
2481
2481
  url: "",
2482
2482
  title: "",
@@ -2488,66 +2488,66 @@ function Li(e, t = {}) {
2488
2488
  forms: [],
2489
2489
  extras: e
2490
2490
  };
2491
- const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o = r.title || "", c = Array.from(
2492
- r.querySelectorAll("[data-ll-region]")
2491
+ const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o = n.title || "", s = Array.from(
2492
+ n.querySelectorAll("[data-ll-region]")
2493
2493
  ), l = [];
2494
- for (const m of c) {
2495
- if (l.length >= gi) break;
2496
- if (dt(m) || !ft(m)) continue;
2497
- const D = m.getAttribute("data-ll-region") ?? "", W = m.getAttribute("data-ll-intent") ?? void 0, K = fe(
2498
- (m.innerText || m.textContent || "").trim(),
2499
- kn * 2
2494
+ for (const g of s) {
2495
+ if (l.length >= vi) break;
2496
+ if (ft(g) || !pt(g)) continue;
2497
+ const D = g.getAttribute("data-ll-region") ?? "", W = g.getAttribute("data-ll-intent") ?? void 0, K = fe(
2498
+ (g.innerText || g.textContent || "").trim(),
2499
+ Nn * 2
2500
2500
  );
2501
2501
  !D || !K || l.push({ id: D, intent: W, text: K });
2502
2502
  }
2503
- const s = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"], b = Array.from(
2504
- r.querySelectorAll("h1, h2, h3, h4, h5, h6")
2503
+ const c = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"], m = Array.from(
2504
+ n.querySelectorAll("h1, h2, h3, h4, h5, h6")
2505
2505
  );
2506
- for (const m of b) {
2507
- if (dt(m) || !ft(m)) continue;
2508
- const D = (m.textContent || "").trim();
2509
- D && s.push(`${m.tagName}: ${fe(D, 200)}`);
2506
+ for (const g of m) {
2507
+ if (ft(g) || !pt(g)) continue;
2508
+ const D = (g.textContent || "").trim();
2509
+ D && c.push(`${g.tagName}: ${fe(D, 200)}`);
2510
2510
  }
2511
- const p = Array.from(r.querySelectorAll("p, li"));
2512
- for (const m of p) {
2513
- if (dt(m) || !ft(m) || u.includes(m.tagName)) continue;
2514
- const D = (m.textContent || "").trim();
2515
- D.length > 10 && s.push(fe(D, kn));
2511
+ const p = Array.from(n.querySelectorAll("p, li"));
2512
+ for (const g of p) {
2513
+ if (ft(g) || !pt(g) || u.includes(g.tagName)) continue;
2514
+ const D = (g.textContent || "").trim();
2515
+ D.length > 10 && c.push(fe(D, Nn));
2516
2516
  }
2517
- const h = s.join(`
2518
- `), P = [], x = Array.from(r.querySelectorAll("a[href]"));
2519
- for (const m of x) {
2520
- if (P.length >= hi) break;
2521
- if (dt(m) || !ft(m)) continue;
2522
- const D = m.getAttribute("href") || "", W = (m.textContent || "").trim();
2517
+ const h = c.join(`
2518
+ `), P = [], x = Array.from(n.querySelectorAll("a[href]"));
2519
+ for (const g of x) {
2520
+ if (P.length >= gi) break;
2521
+ if (ft(g) || !pt(g)) continue;
2522
+ const D = g.getAttribute("href") || "", W = (g.textContent || "").trim();
2523
2523
  !D || !W || P.push({ href: D, text: fe(W, 100) });
2524
2524
  }
2525
- const E = [], g = Array.from(
2526
- r.querySelectorAll(
2525
+ const E = [], y = Array.from(
2526
+ n.querySelectorAll(
2527
2527
  "input, textarea, select"
2528
2528
  )
2529
2529
  );
2530
- for (const m of g) {
2531
- if (E.length >= mi) break;
2532
- if (dt(m) || !Ut(m) || !ft(m)) continue;
2533
- const D = Sn(m), W = m instanceof HTMLInputElement ? m.type : m.tagName.toLowerCase();
2530
+ for (const g of y) {
2531
+ if (E.length >= yi) break;
2532
+ if (ft(g) || !Vt(g) || !pt(g)) continue;
2533
+ const D = An(g), W = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
2534
2534
  D && E.push({ label: fe(D, 100), type: W });
2535
2535
  }
2536
- const w = Array.from(r.querySelectorAll("form")), R = [];
2536
+ const w = Array.from(n.querySelectorAll("form")), R = [];
2537
2537
  let S = 0;
2538
- for (const m of w) {
2539
- if (R.length >= yi) break;
2540
- if (Yt(m) || m.matches(".ll-widget *, .ll-widget")) continue;
2541
- const D = m.getAttribute("id") || m.getAttribute("name") || _i(m.getAttribute("data-ll-intent")) || `form_${S++}`, W = m.getAttribute("data-ll-intent") || xi(m) || void 0, K = Array.from(
2542
- m.querySelectorAll(
2538
+ for (const g of w) {
2539
+ if (R.length >= bi) break;
2540
+ if (Kt(g) || g.matches(".ll-widget *, .ll-widget")) continue;
2541
+ const D = g.getAttribute("id") || g.getAttribute("name") || Li(g.getAttribute("data-ll-intent")) || `form_${S++}`, W = g.getAttribute("data-ll-intent") || Ci(g) || void 0, K = Array.from(
2542
+ g.querySelectorAll(
2543
2543
  "input, textarea, select"
2544
2544
  )
2545
2545
  ), ae = [];
2546
2546
  let $ = 0;
2547
2547
  const G = /* @__PURE__ */ new Set();
2548
2548
  for (const f of K) {
2549
- if (ae.length >= vi) break;
2550
- if (!Ut(f)) continue;
2549
+ if (ae.length >= wi) break;
2550
+ if (!Vt(f)) continue;
2551
2551
  if (f instanceof HTMLInputElement) {
2552
2552
  const U = f.type;
2553
2553
  if (U === "submit" || U === "button" || U === "reset" || U === "hidden" || U === "image" || U === "file") continue;
@@ -2555,7 +2555,7 @@ function Li(e, t = {}) {
2555
2555
  const N = f.getAttribute("name") || "", z = f.getAttribute("id") || "";
2556
2556
  let q = N || z || `field_${$}`;
2557
2557
  G.has(q) && (q = `${q}__${$}`), G.add(q), $++;
2558
- const X = Sn(f) || q, ee = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), V = {
2558
+ const X = An(f) || q, ee = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), V = {
2559
2559
  name: q,
2560
2560
  label: fe(X, 100),
2561
2561
  type: ee
@@ -2588,7 +2588,7 @@ function Li(e, t = {}) {
2588
2588
  }
2589
2589
  if (f instanceof HTMLSelectElement) {
2590
2590
  const U = [];
2591
- for (let me = 0; me < f.options.length && !(U.length >= bi); me++) {
2591
+ for (let me = 0; me < f.options.length && !(U.length >= _i); me++) {
2592
2592
  const Q = f.options[me];
2593
2593
  if (!Q || Q.disabled) continue;
2594
2594
  const be = Q.value || "", ne = (Q.textContent || "").trim() || be;
@@ -2601,7 +2601,7 @@ function Li(e, t = {}) {
2601
2601
  }
2602
2602
  R.push({ id: D, intent: W, fields: ae });
2603
2603
  }
2604
- const y = {
2604
+ const v = {
2605
2605
  url: i,
2606
2606
  title: o,
2607
2607
  pathname: a,
@@ -2612,26 +2612,33 @@ function Li(e, t = {}) {
2612
2612
  forms: R,
2613
2613
  extras: e
2614
2614
  };
2615
- let O = Je(JSON.stringify(y.regions)) + Je(y.visibleText) + Je(JSON.stringify(y.visibleLinks)) + Je(JSON.stringify(y.visibleFields));
2616
- for (; O > St && y.visibleFields.length > 0; )
2617
- y.visibleFields.pop(), O = Je(JSON.stringify(y.visibleFields));
2618
- for (; O > St && y.visibleLinks.length > 0; )
2619
- y.visibleLinks.pop(), O -= 80;
2620
- return Je(y.visibleText) > St && (y.visibleText = fe(y.visibleText, St - 100)), y;
2615
+ let O = Ze(JSON.stringify(v.regions)) + Ze(v.visibleText) + Ze(JSON.stringify(v.visibleLinks)) + Ze(JSON.stringify(v.visibleFields));
2616
+ for (; O > Et && v.visibleFields.length > 0; )
2617
+ v.visibleFields.pop(), O = Ze(JSON.stringify(v.visibleFields));
2618
+ for (; O > Et && v.visibleLinks.length > 0; )
2619
+ v.visibleLinks.pop(), O -= 80;
2620
+ return Ze(v.visibleText) > Et && (v.visibleText = fe(v.visibleText, Et - 100)), v;
2621
2621
  }
2622
- let Ze = null;
2623
- function En(e, t = {}) {
2624
- const r = Date.now(), a = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
2625
- if (Ze && Ze.key === a && r - Ze.at < 1e3)
2626
- return Ze.ctx;
2627
- const o = Li(e, t);
2628
- return Ze = { key: a, at: r, ctx: o }, o;
2622
+ let Qe = null;
2623
+ function Si(e) {
2624
+ const t = e.querySelectorAll("form");
2625
+ let n = `f${t.length}`;
2626
+ return t.forEach((i) => {
2627
+ n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
2628
+ }), n;
2629
2629
  }
2630
- function Ci() {
2631
- Ze = null;
2630
+ function Mn(e, t = {}) {
2631
+ const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), a = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${a}::${o}::${i ? Si(i) : ""}`;
2632
+ if (Qe && Qe.key === s && n - Qe.at < 1e3)
2633
+ return Qe.ctx;
2634
+ const l = ki(e, t);
2635
+ return Qe = { key: s, at: n, ctx: l }, l;
2632
2636
  }
2633
- const ki = 200;
2634
- function Si(e) {
2637
+ function Ei() {
2638
+ Qe = null;
2639
+ }
2640
+ const Ni = 200;
2641
+ function Ai(e) {
2635
2642
  const t = String(e.href || "");
2636
2643
  return {
2637
2644
  href: t,
@@ -2641,47 +2648,47 @@ function Si(e) {
2641
2648
  description: e.description
2642
2649
  };
2643
2650
  }
2644
- function Ei(e) {
2651
+ function Mi(e) {
2645
2652
  return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
2646
2653
  }
2647
- function Ni(e) {
2654
+ function Ii(e) {
2648
2655
  const t = e ?? (typeof document < "u" ? document : null);
2649
2656
  if (!t) return [];
2650
- const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [], o = Array.from(t.querySelectorAll("a[href]"));
2651
- for (const c of o) {
2652
- if (a.length >= ki) break;
2653
- if (Yt(c)) continue;
2654
- const l = c.getAttribute("href") || "";
2655
- if (!Ei(l)) continue;
2656
- let s = l, u = !0;
2657
+ const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [], o = Array.from(t.querySelectorAll("a[href]"));
2658
+ for (const s of o) {
2659
+ if (a.length >= Ni) break;
2660
+ if (Kt(s)) continue;
2661
+ const l = s.getAttribute("href") || "";
2662
+ if (!Mi(l)) continue;
2663
+ let c = l, u = !0;
2657
2664
  try {
2658
2665
  if (typeof window < "u") {
2659
- const p = new URL(l, r);
2660
- u = p.origin === r, u && l.startsWith("http") && (s = p.pathname + p.search + p.hash);
2666
+ const p = new URL(l, n);
2667
+ u = p.origin === n, u && l.startsWith("http") && (c = p.pathname + p.search + p.hash);
2661
2668
  }
2662
2669
  } catch {
2663
2670
  continue;
2664
2671
  }
2665
- if (i.has(s)) continue;
2666
- i.add(s);
2667
- const b = (c.textContent || "").trim().slice(0, 120);
2668
- a.push({ href: s, text: b, internal: u });
2672
+ if (i.has(c)) continue;
2673
+ i.add(c);
2674
+ const m = (s.textContent || "").trim().slice(0, 120);
2675
+ a.push({ href: c, text: m, internal: u });
2669
2676
  }
2670
2677
  return a;
2671
2678
  }
2672
- let Qe = null;
2673
- const Ai = 5e3;
2674
- function Bt() {
2679
+ let et = null;
2680
+ const Ri = 5e3;
2681
+ function qt() {
2675
2682
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
2676
- if (Qe && Qe.pathname === t && e - Qe.at < Ai)
2677
- return Qe.routes;
2678
- const r = Ni();
2679
- return Qe = { at: e, pathname: t, routes: r }, r;
2683
+ if (et && et.pathname === t && e - et.at < Ri)
2684
+ return et.routes;
2685
+ const n = Ii();
2686
+ return et = { at: e, pathname: t, routes: n }, n;
2680
2687
  }
2681
- function Mi() {
2682
- Qe = null;
2688
+ function Ti() {
2689
+ et = null;
2683
2690
  }
2684
- function Nn(e) {
2691
+ function Yt(e) {
2685
2692
  if (e instanceof HTMLInputElement) {
2686
2693
  const t = e.type;
2687
2694
  if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
@@ -2689,55 +2696,99 @@ function Nn(e) {
2689
2696
  }
2690
2697
  return !0;
2691
2698
  }
2692
- function Ii(e, t) {
2699
+ function Pi(e, t) {
2693
2700
  return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
2694
2701
  }
2695
- function Ri(e, t) {
2702
+ function Ie(e) {
2703
+ return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
2704
+ }
2705
+ function Ut(e) {
2706
+ const t = e.lastIndexOf(".");
2707
+ return t >= 0 ? e.slice(t + 1) : e;
2708
+ }
2709
+ function Di(e) {
2710
+ var i;
2711
+ const t = e.getAttribute("id");
2712
+ if (t)
2713
+ try {
2714
+ const a = (i = e.ownerDocument) == null ? void 0 : i.querySelector(
2715
+ `label[for="${t.replace(/"/g, '\\"')}"]`
2716
+ );
2717
+ if (a != null && a.textContent) return a.textContent;
2718
+ } catch {
2719
+ }
2720
+ const n = e.closest("label");
2721
+ return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
2722
+ }
2723
+ function zi(e, t) {
2724
+ const n = Ie(t);
2725
+ if (n.length < 2) return null;
2726
+ let i = null, a = 0;
2727
+ for (const o of Array.from(
2728
+ e.querySelectorAll("input, textarea, select")
2729
+ )) {
2730
+ if (!Yt(o)) continue;
2731
+ const s = o.getAttribute("name") || "", l = o.getAttribute("id") || "", c = [
2732
+ Ie(Ut(s)),
2733
+ Ie(Ut(l)),
2734
+ Ie(s),
2735
+ Ie(l)
2736
+ ];
2737
+ let u = 0;
2738
+ c.some((m) => m.length >= 2 && m === n) ? u = 4 : [
2739
+ Ie(s),
2740
+ Ie(Ut(s)),
2741
+ Ie(Di(o))
2742
+ ].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (u = 2), u > a && (a = u, i = o);
2743
+ }
2744
+ return a >= 2 ? i : null;
2745
+ }
2746
+ function $i(e, t) {
2696
2747
  if (!t) return null;
2697
2748
  try {
2698
2749
  const o = e.querySelector(
2699
2750
  `[name="${t.replace(/"/g, '\\"')}"]`
2700
2751
  );
2701
- if (o && Nn(o)) return o;
2752
+ if (o && Yt(o)) return o;
2702
2753
  } catch {
2703
2754
  }
2704
- const r = Array.from(
2755
+ const n = Array.from(
2705
2756
  e.querySelectorAll("input, textarea, select")
2706
2757
  );
2707
2758
  let i = 0;
2708
2759
  const a = /* @__PURE__ */ new Map();
2709
- for (const o of r) {
2710
- if (!Nn(o)) continue;
2711
- const c = Ii(o, i);
2712
- let l = c;
2713
- if (a.has(c) && (l = `${c}__${i}`), l === t) return o;
2714
- a.set(c, o), i++;
2760
+ for (const o of n) {
2761
+ if (!Yt(o)) continue;
2762
+ const s = Pi(o, i);
2763
+ let l = s;
2764
+ if (a.has(s) && (l = `${s}__${i}`), l === t) return o;
2765
+ a.set(s, o), i++;
2715
2766
  }
2716
- return null;
2767
+ return zi(e, t);
2717
2768
  }
2718
- function An(e, t) {
2719
- const r = Ri(e, t);
2720
- return r ? Ut(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2769
+ function In(e, t) {
2770
+ const n = $i(e, t);
2771
+ return n ? Vt(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2721
2772
  }
2722
- function Ti(e, t) {
2723
- 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;
2773
+ function Hi(e, t) {
2774
+ const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), a = i == null ? void 0 : i.set;
2724
2775
  a ? a.call(e, t) : e.value = t;
2725
2776
  }
2726
- function Pi(e, t, r = {}) {
2727
- const i = r.triggerInput ?? !0, a = r.triggerChange ?? !0;
2777
+ function Oi(e, t, n = {}) {
2778
+ const i = n.triggerInput ?? !0, a = n.triggerChange ?? !0;
2728
2779
  if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
2729
2780
  const o = Object.getOwnPropertyDescriptor(
2730
2781
  HTMLInputElement.prototype,
2731
2782
  "checked"
2732
- ), c = o == null ? void 0 : o.set, l = t === "true" || t === "1" || t === "on";
2733
- c ? c.call(e, l) : e.checked = l, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2783
+ ), s = o == null ? void 0 : o.set, l = t === "true" || t === "1" || t === "on";
2784
+ s ? s.call(e, l) : e.checked = l, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2734
2785
  return;
2735
2786
  }
2736
- Ti(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2787
+ Hi(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2737
2788
  }
2738
- function Mn(e, t) {
2789
+ function Rn(e, t) {
2739
2790
  if (!t) return null;
2740
- const r = t.replace(/"/g, '\\"'), i = (l) => l.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
2791
+ const n = t.replace(/"/g, '\\"'), i = (l) => l.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
2741
2792
  try {
2742
2793
  const l = e.querySelector(
2743
2794
  `form#${CSS.escape(t)}`
@@ -2746,35 +2797,35 @@ function Mn(e, t) {
2746
2797
  } catch {
2747
2798
  }
2748
2799
  const a = e.querySelector(
2749
- `form[name="${r}"]`
2800
+ `form[name="${n}"]`
2750
2801
  );
2751
2802
  if (a && !i(a)) return a;
2752
2803
  const o = e.querySelector(
2753
- `form[data-ll-intent="${r}"]`
2804
+ `form[data-ll-intent="${n}"]`
2754
2805
  );
2755
2806
  if (o && !i(o)) return o;
2756
- const c = Array.from(
2807
+ const s = Array.from(
2757
2808
  e.querySelectorAll("form")
2758
2809
  ).filter((l) => !i(l));
2759
- for (const l of c) {
2760
- const s = l.getAttribute("data-ll-intent");
2761
- if (s && Di(s) === t) return l;
2810
+ for (const l of s) {
2811
+ const c = l.getAttribute("data-ll-intent");
2812
+ if (c && Fi(c) === t) return l;
2762
2813
  }
2763
2814
  if (/^form_\d+$/.test(t)) {
2764
2815
  const l = parseInt(t.slice(5), 10);
2765
- let s = 0;
2766
- for (const u of c)
2816
+ let c = 0;
2817
+ for (const u of s)
2767
2818
  if (!(u.id || u.getAttribute("name") || u.getAttribute("data-ll-intent"))) {
2768
- if (s === l) return u;
2769
- s++;
2819
+ if (c === l) return u;
2820
+ c++;
2770
2821
  }
2771
2822
  }
2772
- return c.length === 1 ? c[0] : null;
2823
+ return s.length === 1 ? s[0] : null;
2773
2824
  }
2774
- function Di(e) {
2825
+ function Fi(e) {
2775
2826
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2776
2827
  }
2777
- function zi() {
2828
+ function Wi() {
2778
2829
  if (typeof window > "u" || typeof document > "u")
2779
2830
  return !1;
2780
2831
  const e = document.scrollingElement || document.documentElement;
@@ -2782,44 +2833,44 @@ function zi() {
2782
2833
  const t = window.getComputedStyle(e);
2783
2834
  return !(t.overflowY === "hidden" || t.overflowY === "clip");
2784
2835
  }
2785
- function $i(e) {
2836
+ function Bi(e) {
2786
2837
  if (!(e instanceof HTMLElement)) return !1;
2787
- const r = window.getComputedStyle(e).overflowY;
2788
- return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
2838
+ const n = window.getComputedStyle(e).overflowY;
2839
+ return !(n !== "auto" && n !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
2789
2840
  }
2790
- function Hi() {
2841
+ function qi() {
2791
2842
  if (typeof document > "u") return null;
2792
2843
  const e = Array.from(
2793
2844
  document.querySelectorAll("body, body *")
2794
2845
  );
2795
- let t = null, r = 0;
2846
+ let t = null, n = 0;
2796
2847
  for (const i of e) {
2797
- if (!$i(i)) continue;
2848
+ if (!Bi(i)) continue;
2798
2849
  const a = i.getBoundingClientRect();
2799
2850
  if (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth || a.width <= 0 || a.height <= 0 || i.closest(".ll-widget")) continue;
2800
2851
  const o = a.width * a.height;
2801
- o > r && (r = o, t = i);
2852
+ o > n && (n = o, t = i);
2802
2853
  }
2803
2854
  return t;
2804
2855
  }
2805
- function Oi() {
2856
+ function Ui() {
2806
2857
  if (typeof window > "u")
2807
2858
  return null;
2808
- if (zi()) return window;
2809
- const e = Hi();
2859
+ if (Wi()) return window;
2860
+ const e = qi();
2810
2861
  return e || window;
2811
2862
  }
2812
- function In(e) {
2863
+ function Tn(e) {
2813
2864
  return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
2814
2865
  }
2815
- function Fi(e) {
2816
- var t, r;
2866
+ function ji(e) {
2867
+ var t, n;
2817
2868
  return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
2818
2869
  ((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
2819
- ((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
2870
+ ((n = document.documentElement) == null ? void 0 : n.scrollHeight) ?? 0
2820
2871
  ) : e.scrollHeight - e.clientHeight;
2821
2872
  }
2822
- const Wi = /* @__PURE__ */ new Set([
2873
+ const Vi = /* @__PURE__ */ new Set([
2823
2874
  "agent_state",
2824
2875
  "avatar_stream_ready",
2825
2876
  "avatar_active",
@@ -2849,18 +2900,18 @@ const Wi = /* @__PURE__ */ new Set([
2849
2900
  // to onAgentCommand.
2850
2901
  "task_field_updated",
2851
2902
  "task_completed"
2852
- ]), qn = jt(
2853
- function(t, r) {
2854
- var on, ln, an, sn, cn, un, dn;
2903
+ ]), jn = Gt(
2904
+ function(t, n) {
2905
+ var sn, cn, un, dn, fn, pn, hn;
2855
2906
  const {
2856
2907
  agentId: i,
2857
2908
  apiKey: a,
2858
2909
  baseUrl: o = "https://app.livelayer.studio",
2859
- sessionEndpoint: c,
2910
+ sessionEndpoint: s,
2860
2911
  sessionBody: l,
2861
- soundEffects: s,
2912
+ soundEffects: c,
2862
2913
  experienceMode: u = "WIDGET",
2863
- autoConnect: b = !1,
2914
+ autoConnect: m = !1,
2864
2915
  displayMode: p,
2865
2916
  // Initial display mode. Mobile gets a smaller card layout (not the
2866
2917
  // full-screen sheet) so "expanded" is the right default on every
@@ -2873,13 +2924,13 @@ const Wi = /* @__PURE__ */ new Set([
2873
2924
  onDisplayModeChange: P,
2874
2925
  position: x = "bottom-right",
2875
2926
  mobileBreakpoint: E = 640,
2876
- draggable: g,
2927
+ draggable: y,
2877
2928
  resizable: w,
2878
2929
  persistKey: R = "ll-widget",
2879
2930
  disablePersistence: S = !1,
2880
- teamMembers: y,
2931
+ teamMembers: v,
2881
2932
  currentTeamMemberId: O,
2882
- onTeamMemberChange: m,
2933
+ onTeamMemberChange: g,
2883
2934
  idleLoopUrl: D,
2884
2935
  greeting: W,
2885
2936
  avatarImageUrl: K,
@@ -2900,66 +2951,66 @@ const Wi = /* @__PURE__ */ new Set([
2900
2951
  hideOn: Q,
2901
2952
  pathname: be,
2902
2953
  onNavigate: ne,
2903
- onScrollToSelector: tt,
2904
- getPageContext: nt,
2905
- pageContextExtras: pt,
2906
- getRoutes: ht,
2907
- onScrollPage: rt,
2908
- onClick: mt,
2909
- capabilities: We,
2910
- onConnect: Be,
2911
- onDisconnect: Ie,
2912
- onTranscript: Re,
2913
- onAgentState: Te,
2914
- onConnectionStateChange: Pe,
2915
- onAgentEvent: De,
2916
- onAgentCommand: qe,
2917
- onCollect: ze,
2954
+ onScrollToSelector: nt,
2955
+ getPageContext: rt,
2956
+ pageContextExtras: ht,
2957
+ getRoutes: mt,
2958
+ onScrollPage: it,
2959
+ onClick: gt,
2960
+ capabilities: Be,
2961
+ onConnect: qe,
2962
+ onDisconnect: Re,
2963
+ onTranscript: Te,
2964
+ onAgentState: Pe,
2965
+ onConnectionStateChange: De,
2966
+ onAgentEvent: ze,
2967
+ onAgentCommand: Ue,
2968
+ onCollect: $e,
2918
2969
  controlledSession: F,
2919
- className: $e,
2920
- style: Ue,
2970
+ className: He,
2971
+ style: je,
2921
2972
  zIndex: we = 2147483647
2922
- } = t, gt = Or(be), He = Vr(gt, me, Q);
2973
+ } = t, yt = Wr(be), Oe = Gr(yt, me, Q);
2923
2974
  T(() => {
2924
- Ci(), Mi();
2925
- }, [gt]);
2926
- const Ne = O !== void 0, [Nt, yt] = M(() => {
2927
- var v;
2928
- return O ?? ((v = y == null ? void 0 : y[0]) == null ? void 0 : v.id);
2929
- }), Oe = Ne ? O : Nt, ue = et(
2930
- () => (y == null ? void 0 : y.find((v) => v.id === Oe)) ?? null,
2931
- [y, Oe]
2932
- ), it = (ue == null ? void 0 : ue.agentId) ?? i, le = u === "EMBEDDED", pe = Ir(E), [je, Ve] = Ar({
2975
+ Ei(), Ti();
2976
+ }, [yt]);
2977
+ const Ne = O !== void 0, [At, vt] = M(() => {
2978
+ var b;
2979
+ return O ?? ((b = v == null ? void 0 : v[0]) == null ? void 0 : b.id);
2980
+ }), Fe = Ne ? O : At, ue = tt(
2981
+ () => (v == null ? void 0 : v.find((b) => b.id === Fe)) ?? null,
2982
+ [v, Fe]
2983
+ ), ot = (ue == null ? void 0 : ue.agentId) ?? i, le = u === "EMBEDDED", pe = Tr(E), [Ve, Ye] = Ir({
2933
2984
  value: p,
2934
2985
  defaultValue: h,
2935
2986
  onChange: P,
2936
2987
  persistKey: R,
2937
2988
  disablePersistence: le || S
2938
- }), ge = le ? "expanded" : je, _e = le ? () => {
2939
- } : Ve, vt = q ?? !le, At = X ?? !le, Mt = te || !le && pe, Ae = $r({
2940
- draggable: !le && (g ?? !pe),
2989
+ }), ge = le ? "expanded" : Ve, _e = le ? () => {
2990
+ } : Ye, bt = q ?? !le, Mt = X ?? !le, It = te || !le && pe, Ae = Or({
2991
+ draggable: !le && (y ?? !pe),
2941
2992
  resizable: !le && (w ?? !pe),
2942
2993
  persistKey: R,
2943
2994
  disablePersistence: le || S
2944
- }), Me = yr(), Se = _r(), ye = xr(), xe = Lr(), [bt, Ye] = M(!1), [lt, at] = M(!1), [_, re] = M(!1), [Un, jn] = M(!1), [Rt, Vn] = M(!1), wt = Gr({ baseUrl: o, config: s }), _t = I(wt);
2945
- _t.current = wt;
2946
- const Tt = I(ne), Pt = I(tt), Dt = I(rt), zt = I(mt), Gt = I(nt), Xt = I(pt), Kt = I(ht), $t = I(We), Le = I(null);
2947
- Tt.current = ne, Pt.current = tt, Dt.current = rt, zt.current = mt, Gt.current = nt, Xt.current = pt, Kt.current = ht, $t.current = We;
2948
- function Ce(v) {
2949
- const d = $t.current;
2950
- return d ? d.includes(v) : !0;
2995
+ }), Me = br(), Se = Lr(), ye = Cr(), xe = kr(), [wt, Ge] = M(!1), [at, st] = M(!1), [_, re] = M(!1), [Vn, Yn] = M(!1), [Tt, Gn] = M(!1), _t = Kr({ baseUrl: o, config: c }), xt = I(_t);
2996
+ xt.current = _t;
2997
+ const Pt = I(ne), Dt = I(nt), zt = I(it), $t = I(gt), Jt = I(rt), Zt = I(ht), Qt = I(mt), Ht = I(Be), Le = I(null);
2998
+ Pt.current = ne, Dt.current = nt, zt.current = it, $t.current = gt, Jt.current = rt, Zt.current = ht, Qt.current = mt, Ht.current = Be;
2999
+ function Ce(b) {
3000
+ const d = Ht.current;
3001
+ return d ? d.includes(b) : !0;
2951
3002
  }
2952
- function ke(v, d) {
3003
+ function ke(b, d) {
2953
3004
  console.warn(
2954
- `[LiveLayer] Agent command "${v}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
3005
+ `[LiveLayer] Agent command "${b}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
2955
3006
  );
2956
3007
  }
2957
- const st = C(
2958
- (v) => {
2959
- var ie, de, Ee, ut;
2960
- const d = v;
3008
+ const ct = C(
3009
+ (b) => {
3010
+ var ie, de, Ee, dt;
3011
+ const d = b;
2961
3012
  if (!(!d.type || typeof d.type != "string")) {
2962
- if (De == null || De({ eventName: d.type, data: v }), d.type === "navigate") {
3013
+ if (ze == null || ze({ eventName: d.type, data: b }), d.type === "navigate") {
2963
3014
  if (!Ce("navigate")) {
2964
3015
  ke("navigate", "navigate");
2965
3016
  return;
@@ -2971,9 +3022,9 @@ const Wi = /* @__PURE__ */ new Set([
2971
3022
  );
2972
3023
  return;
2973
3024
  }
2974
- if (_t.current.playPageChange(), Tt.current) {
3025
+ if (xt.current.playPageChange(), Pt.current) {
2975
3026
  try {
2976
- Tt.current(A);
3027
+ Pt.current(A);
2977
3028
  } catch (H) {
2978
3029
  console.warn(
2979
3030
  `[LiveLayer] onNavigate threw for "${A}". Falling back. Error:`,
@@ -3010,9 +3061,9 @@ const Wi = /* @__PURE__ */ new Set([
3010
3061
  const A = typeof d.selector == "string" ? d.selector : null;
3011
3062
  if (!A) return;
3012
3063
  const H = d.behavior === "instant" ? "instant" : "smooth";
3013
- if (Pt.current) {
3064
+ if (Dt.current) {
3014
3065
  try {
3015
- Pt.current(
3066
+ Dt.current(
3016
3067
  A,
3017
3068
  H
3018
3069
  );
@@ -3053,12 +3104,12 @@ const Wi = /* @__PURE__ */ new Set([
3053
3104
  const B = H, ce = B == null ? void 0 : B.localParticipant;
3054
3105
  if (ce != null && ce.publishData)
3055
3106
  try {
3056
- const he = A ? { ...Z, requestId: A } : Z, Ke = new TextEncoder().encode(JSON.stringify(he));
3057
- ce.publishData(Ke, { reliable: !0 });
3107
+ const he = A ? { ...Z, requestId: A } : Z, Je = new TextEncoder().encode(JSON.stringify(he));
3108
+ ce.publishData(Je, { reliable: !0 });
3058
3109
  } catch (he) {
3059
3110
  console.warn("[LiveLayer] publishData failed.", he);
3060
3111
  }
3061
- }, j = Xt.current, J = Gt.current;
3112
+ }, j = Zt.current, J = Jt.current;
3062
3113
  try {
3063
3114
  if (J) {
3064
3115
  const Z = J(j);
@@ -3069,7 +3120,7 @@ const Wi = /* @__PURE__ */ new Set([
3069
3120
  B
3070
3121
  ), Y({
3071
3122
  type: "page_context",
3072
- context: En(j)
3123
+ context: Mn(j)
3073
3124
  });
3074
3125
  });
3075
3126
  return;
@@ -3079,7 +3130,7 @@ const Wi = /* @__PURE__ */ new Set([
3079
3130
  }
3080
3131
  Y({
3081
3132
  type: "page_context",
3082
- context: En(j)
3133
+ context: Mn(j)
3083
3134
  });
3084
3135
  } catch (Z) {
3085
3136
  console.warn(
@@ -3105,9 +3156,9 @@ const Wi = /* @__PURE__ */ new Set([
3105
3156
  return;
3106
3157
  }
3107
3158
  const H = d.behavior === "instant" ? "instant" : "smooth";
3108
- if (Dt.current) {
3159
+ if (zt.current) {
3109
3160
  try {
3110
- Dt.current(
3161
+ zt.current(
3111
3162
  A,
3112
3163
  H
3113
3164
  );
@@ -3117,12 +3168,12 @@ const Wi = /* @__PURE__ */ new Set([
3117
3168
  return;
3118
3169
  }
3119
3170
  if (typeof window > "u") return;
3120
- const Y = { behavior: H }, j = Oi(), J = (B) => {
3171
+ const Y = { behavior: H }, j = Ui(), J = (B) => {
3121
3172
  j instanceof Window ? j.scrollBy({ top: B, ...Y }) : j.scrollBy({ top: B, ...Y });
3122
3173
  }, Z = (B) => {
3123
3174
  j instanceof Window ? j.scrollTo({ top: B, ...Y }) : j.scrollTo({ top: B, ...Y });
3124
3175
  };
3125
- A === "up" ? J(-In(j)) : A === "down" ? J(In(j)) : Z(A === "top" ? 0 : Fi(j));
3176
+ A === "up" ? J(-Tn(j)) : A === "down" ? J(Tn(j)) : Z(A === "top" ? 0 : ji(j));
3126
3177
  return;
3127
3178
  }
3128
3179
  if (d.type === "click") {
@@ -3135,9 +3186,9 @@ const Wi = /* @__PURE__ */ new Set([
3135
3186
  console.warn("[LiveLayer] click: missing selector.");
3136
3187
  return;
3137
3188
  }
3138
- if (zt.current) {
3189
+ if ($t.current) {
3139
3190
  try {
3140
- zt.current(A);
3191
+ $t.current(A);
3141
3192
  } catch (Y) {
3142
3193
  console.warn("[LiveLayer] onClick threw.", Y);
3143
3194
  }
@@ -3174,13 +3225,13 @@ const Wi = /* @__PURE__ */ new Set([
3174
3225
  return;
3175
3226
  }
3176
3227
  if (typeof document > "u") return;
3177
- d.type === "fill_form" && _t.current.playConfirmation();
3228
+ d.type === "fill_form" && xt.current.playConfirmation();
3178
3229
  const A = typeof d.formId == "string" ? d.formId : null;
3179
3230
  if (!A) {
3180
3231
  console.warn(`[LiveLayer] ${d.type}: missing formId.`);
3181
3232
  return;
3182
3233
  }
3183
- const H = Mn(document, A);
3234
+ const H = Rn(document, A);
3184
3235
  if (!H) {
3185
3236
  console.warn(
3186
3237
  `[LiveLayer] ${d.type}: no <form> matched id="${A}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
@@ -3199,7 +3250,7 @@ const Wi = /* @__PURE__ */ new Set([
3199
3250
  console.warn("[LiveLayer] focus_field: missing fieldName.");
3200
3251
  return;
3201
3252
  }
3202
- const J = An(H, j);
3253
+ const J = In(H, j);
3203
3254
  if (J.el === null) {
3204
3255
  J.reason === "private" ? console.warn(
3205
3256
  `[LiveLayer] focus_field: field "${j}" is privacy-protected and not focusable.`
@@ -3218,7 +3269,7 @@ const Wi = /* @__PURE__ */ new Set([
3218
3269
  }
3219
3270
  for (const [j, J] of Object.entries(Y)) {
3220
3271
  if (typeof J != "string") continue;
3221
- const Z = An(H, j);
3272
+ const Z = In(H, j);
3222
3273
  if (Z.el === null) {
3223
3274
  Z.reason === "private" ? console.warn(
3224
3275
  `[LiveLayer] fill_form: field "${j}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
@@ -3228,7 +3279,7 @@ const Wi = /* @__PURE__ */ new Set([
3228
3279
  continue;
3229
3280
  }
3230
3281
  try {
3231
- Pi(Z.el, J);
3282
+ Oi(Z.el, J);
3232
3283
  } catch (B) {
3233
3284
  console.warn(
3234
3285
  `[LiveLayer] fill_form: failed to set "${j}".`,
@@ -3249,8 +3300,8 @@ const Wi = /* @__PURE__ */ new Set([
3249
3300
  console.warn("[LiveLayer] submit_form: missing formId.");
3250
3301
  return;
3251
3302
  }
3252
- _t.current.playConfirmation();
3253
- const H = Mn(document, A);
3303
+ xt.current.playConfirmation();
3304
+ const H = Rn(document, A);
3254
3305
  if (!H) {
3255
3306
  console.warn(
3256
3307
  `[LiveLayer] submit_form: no <form> matched id="${A}" (or matching name / data-ll-intent slug).`
@@ -3264,11 +3315,11 @@ const Wi = /* @__PURE__ */ new Set([
3264
3315
  return;
3265
3316
  }
3266
3317
  const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (Ee = Le.current) == null ? void 0 : Ee.call(Le), J = (ce) => {
3267
- const he = j, Ke = he == null ? void 0 : he.localParticipant;
3268
- if (Ke != null && Ke.publishData)
3318
+ const he = j, Je = he == null ? void 0 : he.localParticipant;
3319
+ if (Je != null && Je.publishData)
3269
3320
  try {
3270
- const lr = Y ? { ...ce, requestId: Y } : ce, ar = new TextEncoder().encode(JSON.stringify(lr));
3271
- Ke.publishData(ar, { reliable: !0 });
3321
+ const sr = Y ? { ...ce, requestId: Y } : ce, cr = new TextEncoder().encode(JSON.stringify(sr));
3322
+ Je.publishData(cr, { reliable: !0 });
3272
3323
  } catch {
3273
3324
  }
3274
3325
  };
@@ -3301,7 +3352,7 @@ const Wi = /* @__PURE__ */ new Set([
3301
3352
  ke("request_routes", "read_page");
3302
3353
  return;
3303
3354
  }
3304
- const A = typeof d.requestId == "string" ? d.requestId : void 0, Y = (ut = Le.current) == null ? void 0 : ut.call(Le), j = Y == null ? void 0 : Y.localParticipant;
3355
+ const A = typeof d.requestId == "string" ? d.requestId : void 0, Y = (dt = Le.current) == null ? void 0 : dt.call(Le), j = Y == null ? void 0 : Y.localParticipant;
3305
3356
  if (!(j != null && j.publishData)) return;
3306
3357
  const J = (B) => {
3307
3358
  try {
@@ -3310,7 +3361,7 @@ const Wi = /* @__PURE__ */ new Set([
3310
3361
  } catch (ce) {
3311
3362
  console.warn("[LiveLayer] request_routes: publishData failed.", ce);
3312
3363
  }
3313
- }, Z = Kt.current;
3364
+ }, Z = Qt.current;
3314
3365
  if (Z) {
3315
3366
  try {
3316
3367
  const B = Z(), ce = (he) => {
@@ -3318,24 +3369,24 @@ const Wi = /* @__PURE__ */ new Set([
3318
3369
  J([]);
3319
3370
  return;
3320
3371
  }
3321
- J(he.map(Si).slice(0, 200));
3372
+ J(he.map(Ai).slice(0, 200));
3322
3373
  };
3323
3374
  B instanceof Promise ? B.then(ce).catch((he) => {
3324
3375
  console.warn(
3325
3376
  "[LiveLayer] getRoutes rejected; falling back to DOM walker.",
3326
3377
  he
3327
- ), J(Bt());
3378
+ ), J(qt());
3328
3379
  }) : ce(B);
3329
3380
  } catch (B) {
3330
3381
  console.warn(
3331
3382
  "[LiveLayer] getRoutes threw; falling back to DOM walker.",
3332
3383
  B
3333
- ), J(Bt());
3384
+ ), J(qt());
3334
3385
  }
3335
3386
  return;
3336
3387
  }
3337
3388
  try {
3338
- J(Bt());
3389
+ J(qt());
3339
3390
  } catch (B) {
3340
3391
  console.warn("[LiveLayer] request_routes: extractRoutes threw.", B);
3341
3392
  }
@@ -3387,7 +3438,7 @@ const Wi = /* @__PURE__ */ new Set([
3387
3438
  } catch {
3388
3439
  }
3389
3440
  try {
3390
- ze == null || ze(
3441
+ $e == null || $e(
3391
3442
  A
3392
3443
  );
3393
3444
  } catch (H) {
@@ -3395,40 +3446,40 @@ const Wi = /* @__PURE__ */ new Set([
3395
3446
  }
3396
3447
  return;
3397
3448
  }
3398
- Wi.has(d.type) || qe == null || qe(d);
3449
+ Vi.has(d.type) || Ue == null || Ue(d);
3399
3450
  }
3400
3451
  },
3401
- [qe, De, ze]
3402
- ), se = gr({
3403
- agentId: F ? "__controlled__" : it,
3452
+ [Ue, ze, $e]
3453
+ ), se = vr({
3454
+ agentId: F ? "__controlled__" : ot,
3404
3455
  baseUrl: o,
3405
3456
  apiKey: a,
3406
- sessionEndpoint: c,
3457
+ sessionEndpoint: s,
3407
3458
  sessionBody: l,
3408
- onDataMessage: F ? void 0 : st
3459
+ onDataMessage: F ? void 0 : ct
3409
3460
  });
3410
3461
  T(() => {
3411
3462
  if (F != null && F.subscribeToDataMessages)
3412
- return F.subscribeToDataMessages(st);
3413
- }, [F, st]), Le.current = () => {
3414
- var v;
3415
- return (v = se.getRoom) == null ? void 0 : v.call(se);
3463
+ return F.subscribeToDataMessages(ct);
3464
+ }, [F, ct]), Le.current = () => {
3465
+ var b;
3466
+ return (b = se.getRoom) == null ? void 0 : b.call(se);
3416
3467
  }, T(() => {
3417
3468
  var ie;
3418
3469
  if (typeof window > "u") return;
3419
- const v = ((ie = window.location) == null ? void 0 : ie.hostname) || "";
3420
- if (v === "localhost" || v === "127.0.0.1" || v === "0.0.0.0" || v.endsWith(".local") || v.endsWith(".test"))
3470
+ const b = ((ie = window.location) == null ? void 0 : ie.hostname) || "";
3471
+ if (b === "localhost" || b === "127.0.0.1" || b === "0.0.0.0" || b.endsWith(".local") || b.endsWith(".test"))
3421
3472
  return window.__livelayerSimulateCommand = (de) => {
3422
3473
  try {
3423
- st(de);
3474
+ ct(de);
3424
3475
  } catch (Ee) {
3425
3476
  console.warn("[LiveLayer] simulate-command threw:", Ee);
3426
3477
  }
3427
3478
  }, () => {
3428
3479
  delete window.__livelayerSimulateCommand;
3429
3480
  };
3430
- }, [st]);
3431
- const L = et(() => F ? {
3481
+ }, [ct]);
3482
+ const L = tt(() => F ? {
3432
3483
  connectionState: F.connectionState,
3433
3484
  agentState: F.agentState,
3434
3485
  transcript: F.transcript,
@@ -3459,27 +3510,27 @@ const Wi = /* @__PURE__ */ new Set([
3459
3510
  disconnect: se.disconnect,
3460
3511
  getRoom: se.getRoom,
3461
3512
  isControlled: !1
3462
- }, [F, se]), Jt = I(L);
3463
- Jt.current = L;
3464
- const Zt = I(F);
3465
- Zt.current = F, cr(
3466
- r,
3513
+ }, [F, se]), en = I(L);
3514
+ en.current = L;
3515
+ const tn = I(F);
3516
+ tn.current = F, dr(
3517
+ n,
3467
3518
  () => ({
3468
- sendData: async (v) => {
3469
- var Ee, ut;
3470
- const d = Zt.current;
3519
+ sendData: async (b) => {
3520
+ var Ee, dt;
3521
+ const d = tn.current;
3471
3522
  if (d != null && d.publishData) {
3472
3523
  try {
3473
- await d.publishData(v);
3524
+ await d.publishData(b);
3474
3525
  } catch (A) {
3475
3526
  console.warn("[AvatarWidget] sendData (controlled) failed:", A);
3476
3527
  }
3477
3528
  return;
3478
3529
  }
3479
- const ie = (ut = (Ee = Jt.current) == null ? void 0 : Ee.getRoom) == null ? void 0 : ut.call(Ee), de = ie == null ? void 0 : ie.localParticipant;
3530
+ const ie = (dt = (Ee = en.current) == null ? void 0 : Ee.getRoom) == null ? void 0 : dt.call(Ee), de = ie == null ? void 0 : ie.localParticipant;
3480
3531
  if (de != null && de.publishData)
3481
3532
  try {
3482
- const A = new TextEncoder().encode(JSON.stringify(v));
3533
+ const A = new TextEncoder().encode(JSON.stringify(b));
3483
3534
  await de.publishData(A, { reliable: !0 });
3484
3535
  } catch (A) {
3485
3536
  console.warn("[AvatarWidget] sendData failed:", A);
@@ -3488,59 +3539,59 @@ const Wi = /* @__PURE__ */ new Set([
3488
3539
  }),
3489
3540
  []
3490
3541
  );
3491
- const Qt = I(null);
3542
+ const nn = I(null);
3492
3543
  T(() => {
3493
- const v = L.videoElement, d = Qt.current;
3494
- if (!(!v || !d))
3495
- return d.appendChild(v), () => {
3496
- v.parentNode === d && d.removeChild(v);
3544
+ const b = L.videoElement, d = nn.current;
3545
+ if (!(!b || !d))
3546
+ return d.appendChild(b), () => {
3547
+ b.parentNode === d && d.removeChild(b);
3497
3548
  };
3498
3549
  }, [L.videoElement]);
3499
- const [Ge, xt] = M(!1);
3550
+ const [Xe, Lt] = M(!1);
3500
3551
  T(() => {
3501
3552
  if (!z) {
3502
- xt(!0);
3553
+ Lt(!0);
3503
3554
  return;
3504
3555
  }
3505
- L.agentState === "speaking" && !Ge && xt(!0);
3506
- }, [z, L.agentState, Ge]), T(() => {
3556
+ L.agentState === "speaking" && !Xe && Lt(!0);
3557
+ }, [z, L.agentState, Xe]), T(() => {
3507
3558
  if (!z) return;
3508
- const v = L.connectionState;
3509
- (v === "disconnected" || v === "idle") && xt(!1);
3559
+ const b = L.connectionState;
3560
+ (b === "disconnected" || b === "idle") && Lt(!1);
3510
3561
  }, [z, L.connectionState]), T(() => {
3511
- if (!z || !L.videoElement || Ge) return;
3512
- const v = setTimeout(() => xt(!0), 5e3);
3513
- return () => clearTimeout(v);
3514
- }, [z, L.videoElement, Ge]), T(() => {
3515
- const v = L.videoElement;
3516
- if (v) {
3562
+ if (!z || !L.videoElement || Xe) return;
3563
+ const b = setTimeout(() => Lt(!0), 5e3);
3564
+ return () => clearTimeout(b);
3565
+ }, [z, L.videoElement, Xe]), T(() => {
3566
+ const b = L.videoElement;
3567
+ if (b) {
3517
3568
  if (!z) {
3518
- v.style.filter = "";
3569
+ b.style.filter = "";
3519
3570
  return;
3520
3571
  }
3521
- v.style.transition = "filter 500ms ease-out", v.style.filter = Ge ? "" : "blur(8px)";
3572
+ b.style.transition = "filter 500ms ease-out", b.style.filter = Xe ? "" : "blur(8px)";
3522
3573
  }
3523
- }, [z, L.videoElement, Ge]), T(() => {
3524
- const v = L.audioElement;
3525
- if (!v) return;
3574
+ }, [z, L.videoElement, Xe]), T(() => {
3575
+ const b = L.audioElement;
3576
+ if (!b) return;
3526
3577
  const d = document.createElement("div");
3527
- d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(v), document.body.appendChild(d), Me.attach(v);
3528
- const ie = v.play();
3578
+ d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(b), document.body.appendChild(d), Me.attach(b);
3579
+ const ie = b.play();
3529
3580
  return ie && typeof ie.catch == "function" && ie.catch((de) => {
3530
- (de == null ? void 0 : de.name) === "NotAllowedError" && Ye(!0);
3581
+ (de == null ? void 0 : de.name) === "NotAllowedError" && Ge(!0);
3531
3582
  }), () => {
3532
- Me.detach(), v.parentNode === d && d.removeChild(v), d.parentNode === document.body && document.body.removeChild(d);
3583
+ Me.detach(), b.parentNode === d && d.removeChild(b), d.parentNode === document.body && document.body.removeChild(d);
3533
3584
  };
3534
3585
  }, [L.audioElement]);
3535
- const ve = br({
3586
+ const ve = _r({
3536
3587
  gateUntilAgentReady: !0,
3537
3588
  agentState: L.agentState
3538
3589
  });
3539
3590
  T(() => {
3540
3591
  if (L.isControlled || L.connectionState !== "connected") return;
3541
- const v = L.getRoom();
3542
- if (v)
3543
- return ve.setupMic(v).then(() => {
3592
+ const b = L.getRoom();
3593
+ if (b)
3594
+ return ve.setupMic(b).then(() => {
3544
3595
  const d = ve.getMicStream();
3545
3596
  d && Me.attachStream(d, "mic");
3546
3597
  }).catch(() => {
@@ -3550,17 +3601,17 @@ const Wi = /* @__PURE__ */ new Set([
3550
3601
  }, [L.isControlled, L.connectionState]), T(() => {
3551
3602
  var d;
3552
3603
  if (L.connectionState !== "connected") return;
3553
- const v = L.isControlled ? (d = F == null ? void 0 : F.getRoom) == null ? void 0 : d.call(F) : L.getRoom();
3554
- if (v)
3555
- return Se.attachRoom(v), ye.attachRoom(v), L.isControlled && ve.attachRoom(v), xe.refresh(), () => {
3604
+ const b = L.isControlled ? (d = F == null ? void 0 : F.getRoom) == null ? void 0 : d.call(F) : L.getRoom();
3605
+ if (b)
3606
+ return Se.attachRoom(b), ye.attachRoom(b), L.isControlled && ve.attachRoom(b), xe.refresh(), () => {
3556
3607
  Se.teardown(), ye.teardown();
3557
3608
  };
3558
3609
  }, [L.isControlled, L.connectionState, F]), T(() => {
3559
- const v = L.audioElement;
3560
- v && (v.muted = Rt);
3561
- }, [L.audioElement, Rt]);
3562
- const Yn = C((v) => {
3563
- const d = { type: "user_message", text: v };
3610
+ const b = L.audioElement;
3611
+ b && (b.muted = Tt);
3612
+ }, [L.audioElement, Tt]);
3613
+ const Xn = C((b) => {
3614
+ const d = { type: "user_message", text: b };
3564
3615
  if (F != null && F.publishData) {
3565
3616
  try {
3566
3617
  F.publishData(d);
@@ -3575,99 +3626,99 @@ const Wi = /* @__PURE__ */ new Set([
3575
3626
  ie.localParticipant.publishData(de, { reliable: !0 });
3576
3627
  } catch {
3577
3628
  }
3578
- }, [L, F]), Gn = C(() => {
3579
- Vn((v) => !v);
3629
+ }, [L, F]), Kn = C(() => {
3630
+ Gn((b) => !b);
3580
3631
  }, []);
3581
3632
  T(() => {
3582
- Pe == null || Pe(L.connectionState), L.connectionState === "connected" ? Be == null || Be() : L.connectionState === "disconnected" && (Ie == null || Ie());
3583
- }, [L.connectionState, Be, Ie, Pe]), T(() => {
3584
- Re == null || Re(L.transcript);
3585
- }, [L.transcript, Re]), T(() => {
3586
- Te == null || Te(L.agentState);
3587
- }, [L.agentState, Te]), T(() => {
3588
- wt.setThinking(L.agentState === "thinking");
3589
- }, [L.agentState, wt]);
3590
- const en = I(!1);
3633
+ De == null || De(L.connectionState), L.connectionState === "connected" ? qe == null || qe() : L.connectionState === "disconnected" && (Re == null || Re());
3634
+ }, [L.connectionState, qe, Re, De]), T(() => {
3635
+ Te == null || Te(L.transcript);
3636
+ }, [L.transcript, Te]), T(() => {
3637
+ Pe == null || Pe(L.agentState);
3638
+ }, [L.agentState, Pe]), T(() => {
3639
+ _t.setThinking(L.agentState === "thinking");
3640
+ }, [L.agentState, _t]);
3641
+ const rn = I(!1);
3591
3642
  T(() => {
3592
- !b || en.current || He && L.connectionState === "idle" && (en.current = !0, L.connect());
3593
- }, [b, L.connectionState, L, He]);
3594
- const Xn = C(
3595
- (v) => {
3596
- const d = y == null ? void 0 : y.find((ie) => ie.id === v);
3597
- d && (re(!1), v !== Oe && (at(!0), L.disconnect(), Ne || yt(v), m == null || m(d)));
3643
+ !m || rn.current || Oe && L.connectionState === "idle" && (rn.current = !0, L.connect());
3644
+ }, [m, L.connectionState, L, Oe]);
3645
+ const Jn = C(
3646
+ (b) => {
3647
+ const d = v == null ? void 0 : v.find((ie) => ie.id === b);
3648
+ d && (re(!1), b !== Fe && (st(!0), L.disconnect(), Ne || vt(b), g == null || g(d)));
3598
3649
  },
3599
3650
  [
3600
- y,
3601
- Oe,
3651
+ v,
3652
+ Fe,
3602
3653
  L,
3603
3654
  Ne,
3604
- m
3655
+ g
3605
3656
  ]
3606
3657
  );
3607
3658
  T(() => {
3608
- lt && L.connectionState === "connected" && at(!1);
3609
- }, [L.connectionState, lt]), T(() => {
3659
+ at && L.connectionState === "connected" && st(!1);
3660
+ }, [L.connectionState, at]), T(() => {
3610
3661
  if (!_) return;
3611
- const v = (d) => {
3662
+ const b = (d) => {
3612
3663
  d.key === "Escape" && re(!1);
3613
3664
  };
3614
- return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
3665
+ return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
3615
3666
  }, [_]);
3616
- const Kn = !!K || !!(ue != null && ue.avatarImageUrl) || L.isControlled, ct = Cr(it, o, Kn);
3617
- We === void 0 && ((on = ct.info) != null && on.capabilities) && ($t.current = ct.info.capabilities);
3618
- const Lt = (ue == null ? void 0 : ue.name) ?? ae ?? ((ln = L.agentConfig) == null ? void 0 : ln.name) ?? ((an = ct.info) == null ? void 0 : an.name) ?? "Live Layer", Ht = (ue == null ? void 0 : ue.avatarImageUrl) ?? K ?? ((sn = L.agentConfig) == null ? void 0 : sn.avatarImageUrl) ?? ((cn = ct.info) == null ? void 0 : cn.avatarImageUrl) ?? null, Jn = D ?? ((un = L.agentConfig) == null ? void 0 : un.idleLoopUrl) ?? ((dn = ct.info) == null ? void 0 : dn.idleLoopUrl) ?? null, Zn = W ?? null, Qn = C(() => _e("expanded"), [_e]), er = C(
3667
+ const Zn = !!K || !!(ue != null && ue.avatarImageUrl) || L.isControlled, ut = Sr(ot, o, Zn);
3668
+ Be === void 0 && ((sn = ut.info) != null && sn.capabilities) && (Ht.current = ut.info.capabilities);
3669
+ const Ct = (ue == null ? void 0 : ue.name) ?? ae ?? ((cn = L.agentConfig) == null ? void 0 : cn.name) ?? ((un = ut.info) == null ? void 0 : un.name) ?? "Live Layer", Ot = (ue == null ? void 0 : ue.avatarImageUrl) ?? K ?? ((dn = L.agentConfig) == null ? void 0 : dn.avatarImageUrl) ?? ((fn = ut.info) == null ? void 0 : fn.avatarImageUrl) ?? null, Qn = D ?? ((pn = L.agentConfig) == null ? void 0 : pn.idleLoopUrl) ?? ((hn = ut.info) == null ? void 0 : hn.idleLoopUrl) ?? null, er = W ?? null, tr = C(() => _e("expanded"), [_e]), nr = C(
3619
3670
  () => _e("minimized"),
3620
3671
  [_e]
3621
- ), tn = C(() => {
3672
+ ), on = C(() => {
3622
3673
  L.disconnect(), _e("hidden");
3623
- }, [L, _e]), tr = C(() => {
3624
- const v = L.audioElement;
3625
- v && v.play().then(() => Ye(!1)).catch(() => {
3674
+ }, [L, _e]), rr = C(() => {
3675
+ const b = L.audioElement;
3676
+ b && b.play().then(() => Ge(!1)).catch(() => {
3626
3677
  });
3627
- }, [L.audioElement]), nr = C(() => {
3628
- Ye(!1), L.connect();
3629
- }, [L]), Xe = {
3630
- ...Ue,
3678
+ }, [L.audioElement]), ir = C(() => {
3679
+ Ge(!1), L.connect();
3680
+ }, [L]), Ke = {
3681
+ ...je,
3631
3682
  ...le ? {} : { zIndex: we }
3632
3683
  };
3633
- $.primaryColor && (Xe["--ll-color-primary"] = $.primaryColor), $.accentColor && (Xe["--ll-color-accent"] = $.accentColor), $.backgroundColor && (Xe["--ll-color-bg"] = $.backgroundColor), $.textColor && (Xe["--ll-color-fg"] = $.textColor);
3634
- const rr = {
3635
- ...Xe,
3684
+ $.primaryColor && (Ke["--ll-color-primary"] = $.primaryColor), $.accentColor && (Ke["--ll-color-accent"] = $.accentColor), $.backgroundColor && (Ke["--ll-color-bg"] = $.backgroundColor), $.textColor && (Ke["--ll-color-fg"] = $.textColor);
3685
+ const or = {
3686
+ ...Ke,
3636
3687
  ...Ae.style
3637
- }, ir = [
3688
+ }, lr = [
3638
3689
  "ll-widget",
3639
3690
  `ll-widget--${ge}`,
3640
3691
  `ll-widget--${pe ? "mobile" : "desktop"}`,
3641
3692
  Ae.hasGeometry ? "ll-widget--has-geometry" : null,
3642
3693
  Ae.isDragging ? "is-dragging" : null,
3643
3694
  Ae.isResizing ? "is-resizing" : null,
3644
- $e
3695
+ He
3645
3696
  ].filter(Boolean).join(" ");
3646
- if (!He) return null;
3647
- const or = /* @__PURE__ */ n(
3697
+ if (!Oe) return null;
3698
+ const ar = /* @__PURE__ */ r(
3648
3699
  "div",
3649
3700
  {
3650
- className: ir,
3651
- style: rr,
3701
+ className: lr,
3702
+ style: or,
3652
3703
  "data-display-mode": ge,
3653
3704
  "data-position": x,
3654
3705
  "data-experience-mode": u === "EMBEDDED" ? "embedded" : "widget",
3655
- children: ge === "expanded" && /* @__PURE__ */ n(
3656
- di,
3706
+ children: ge === "expanded" && /* @__PURE__ */ r(
3707
+ pi,
3657
3708
  {
3658
3709
  position: x,
3659
3710
  isMobile: pe,
3660
- agentName: Lt,
3661
- avatarImageUrl: Ht,
3662
- idleLoopUrl: Jn,
3663
- greeting: Zn,
3711
+ agentName: Ct,
3712
+ avatarImageUrl: Ot,
3713
+ idleLoopUrl: Qn,
3714
+ greeting: er,
3664
3715
  branding: $,
3665
- teamMembers: y,
3666
- currentTeamMemberId: Oe,
3667
- isSwitchingTeamMember: lt,
3716
+ teamMembers: v,
3717
+ currentTeamMemberId: Fe,
3718
+ isSwitchingTeamMember: at,
3668
3719
  teamSwitcherOpen: _,
3669
- onToggleTeamSwitcher: () => re((v) => !v),
3670
- onSelectTeamMember: Xn,
3720
+ onToggleTeamSwitcher: () => re((b) => !b),
3721
+ onSelectTeamMember: Jn,
3671
3722
  connectionState: L.connectionState,
3672
3723
  agentState: L.agentState,
3673
3724
  transcript: L.transcript,
@@ -3680,44 +3731,44 @@ const Wi = /* @__PURE__ */ new Set([
3680
3731
  activeCameraId: Se.activeDeviceId,
3681
3732
  isScreenShareEnabled: ye.isEnabled,
3682
3733
  screenPreviewEl: ye.previewEl,
3683
- isSpeakerMuted: Rt,
3734
+ isSpeakerMuted: Tt,
3684
3735
  allowCamera: G,
3685
3736
  allowScreenShare: f,
3686
3737
  allowTyping: N,
3687
- showMinimize: pe && !le ? !1 : vt,
3688
- showClose: At,
3738
+ showMinimize: pe && !le ? !1 : bt,
3739
+ showClose: Mt,
3689
3740
  chromeless: ee,
3690
- compactControls: Mt,
3741
+ compactControls: It,
3691
3742
  transforming: oe,
3692
3743
  transformingLabel: U,
3693
- languageMenuOpen: Un,
3694
- onToggleLanguageMenu: () => jn((v) => !v),
3695
- needsUserGesture: bt,
3744
+ languageMenuOpen: Vn,
3745
+ onToggleLanguageMenu: () => Yn((b) => !b),
3746
+ needsUserGesture: wt,
3696
3747
  canResume: L.canResume,
3697
3748
  micError: ve.micError,
3698
3749
  error: L.error,
3699
- avatarVideoContainerRef: Qt,
3750
+ avatarVideoContainerRef: nn,
3700
3751
  agentVideoEl: L.videoElement,
3701
3752
  onConnect: () => void L.connect(),
3702
3753
  onDisconnect: () => L.disconnect(),
3703
- onRetry: nr,
3704
- onResumeAudio: tr,
3754
+ onRetry: ir,
3755
+ onResumeAudio: rr,
3705
3756
  onToggleMute: ve.toggleMute,
3706
- onSwitchMicDevice: (v) => void ve.switchDevice(v),
3757
+ onSwitchMicDevice: (b) => void ve.switchDevice(b),
3707
3758
  onToggleCamera: () => void Se.toggle(),
3708
- onSwitchCameraDevice: (v) => void Se.switchDevice(v),
3759
+ onSwitchCameraDevice: (b) => void Se.switchDevice(b),
3709
3760
  onToggleScreenShare: () => void ye.toggle(),
3710
- onToggleSpeaker: Gn,
3711
- onSendMessage: Yn,
3712
- onMinimize: er,
3713
- onClose: tn,
3761
+ onToggleSpeaker: Kn,
3762
+ onSendMessage: Xn,
3763
+ onMinimize: nr,
3764
+ onClose: on,
3714
3765
  onClearMicError: ve.clearError,
3715
3766
  dragHandleProps: Ae.dragHandleProps,
3716
3767
  resizeHandleProps: Ae.resizeHandleProps
3717
3768
  }
3718
3769
  )
3719
3770
  }
3720
- ), nn = !le && (ge === "hidden" || ge === "minimized") ? /* @__PURE__ */ k(
3771
+ ), ln = !le && (ge === "hidden" || ge === "minimized") ? /* @__PURE__ */ k(
3721
3772
  "div",
3722
3773
  {
3723
3774
  className: [
@@ -3726,66 +3777,66 @@ const Wi = /* @__PURE__ */ new Set([
3726
3777
  `ll-widget--${ge}`,
3727
3778
  `ll-widget--${pe ? "mobile" : "desktop"}`
3728
3779
  ].join(" "),
3729
- style: Xe,
3780
+ style: Ke,
3730
3781
  "data-display-mode": ge,
3731
3782
  "data-position": x,
3732
3783
  children: [
3733
- ge === "hidden" && /* @__PURE__ */ n(
3734
- ei,
3784
+ ge === "hidden" && /* @__PURE__ */ r(
3785
+ ni,
3735
3786
  {
3736
3787
  position: x,
3737
3788
  isMobile: pe,
3738
3789
  isSpeaking: L.agentState === "speaking",
3739
3790
  onExpand: () => _e("expanded"),
3740
- label: `Open ${Lt} widget`,
3741
- avatarImageUrl: Ht,
3742
- agentName: Lt,
3791
+ label: `Open ${Ct} widget`,
3792
+ avatarImageUrl: Ot,
3793
+ agentName: Ct,
3743
3794
  containerEl: V
3744
3795
  }
3745
3796
  ),
3746
- ge === "minimized" && /* @__PURE__ */ n(
3747
- ni,
3797
+ ge === "minimized" && /* @__PURE__ */ r(
3798
+ ii,
3748
3799
  {
3749
3800
  position: x,
3750
3801
  isMobile: pe,
3751
- agentName: Lt,
3752
- avatarImageUrl: Ht,
3802
+ agentName: Ct,
3803
+ avatarImageUrl: Ot,
3753
3804
  agentState: L.agentState,
3754
3805
  isMuted: ve.isMuted,
3755
3806
  audioLevel: Me,
3756
- onExpand: Qn,
3807
+ onExpand: tr,
3757
3808
  onToggleMute: ve.toggleMute,
3758
- onClose: tn
3809
+ onClose: on
3759
3810
  }
3760
3811
  )
3761
3812
  ]
3762
3813
  }
3763
- ) : null, rn = V ?? (typeof document < "u" ? document.body : null);
3764
- return /* @__PURE__ */ k(Fe, { children: [
3765
- or,
3766
- nn && rn && Vt(nn, rn)
3814
+ ) : null, an = V ?? (typeof document < "u" ? document.body : null);
3815
+ return /* @__PURE__ */ k(We, { children: [
3816
+ ar,
3817
+ ln && an && Xt(ln, an)
3767
3818
  ] });
3768
3819
  }
3769
3820
  );
3770
- qn.displayName = "AvatarWidgetInner";
3771
- const Bi = jt(
3772
- function(t, r) {
3773
- return /* @__PURE__ */ n(mr, { children: /* @__PURE__ */ n(qn, { ...t, ref: r }) });
3821
+ jn.displayName = "AvatarWidgetInner";
3822
+ const Yi = Gt(
3823
+ function(t, n) {
3824
+ return /* @__PURE__ */ r(yr, { children: /* @__PURE__ */ r(jn, { ...t, ref: n }) });
3774
3825
  }
3775
3826
  );
3776
- Bi.displayName = "AvatarWidget";
3777
- const Qi = ({
3827
+ Yi.displayName = "AvatarWidget";
3828
+ const io = ({
3778
3829
  agentId: e,
3779
3830
  baseUrl: t,
3780
- apiKey: r,
3831
+ apiKey: n,
3781
3832
  mode: i,
3782
3833
  onAgentEvent: a,
3783
3834
  className: o,
3784
- style: c
3835
+ style: s
3785
3836
  }) => {
3786
- const l = I(null), s = I(null), u = I(a);
3837
+ const l = I(null), c = I(null), u = I(a);
3787
3838
  u.current = a;
3788
- const b = C((p) => {
3839
+ const m = C((p) => {
3789
3840
  var P;
3790
3841
  const h = p.detail;
3791
3842
  (P = u.current) == null || P.call(u, h);
@@ -3794,32 +3845,32 @@ const Qi = ({
3794
3845
  const p = l.current;
3795
3846
  if (!p) return;
3796
3847
  const h = document.createElement("livelayer-widget");
3797
- return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t), r && h.setAttribute("api-key", r), i && h.setAttribute("mode", i), h.addEventListener("agent-event", b), p.appendChild(h), s.current = h, () => {
3798
- h.removeEventListener("agent-event", b), p.removeChild(h), s.current = null;
3848
+ return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t), n && h.setAttribute("api-key", n), i && h.setAttribute("mode", i), h.addEventListener("agent-event", m), p.appendChild(h), c.current = h, () => {
3849
+ h.removeEventListener("agent-event", m), p.removeChild(h), c.current = null;
3799
3850
  };
3800
3851
  }, [e]), T(() => {
3801
- s.current && (i ? s.current.setAttribute("mode", i) : s.current.removeAttribute("mode"));
3802
- }, [i]), /* @__PURE__ */ n("div", { ref: l, className: o, style: c });
3803
- }, eo = jt(
3804
- function({ id: t, intent: r, as: i = "div", className: a, style: o, children: c }, l) {
3805
- return ur(
3852
+ c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
3853
+ }, [i]), /* @__PURE__ */ r("div", { ref: l, className: o, style: s });
3854
+ }, oo = Gt(
3855
+ function({ id: t, intent: n, as: i = "div", className: a, style: o, children: s }, l) {
3856
+ return fr(
3806
3857
  i,
3807
3858
  {
3808
3859
  ref: l,
3809
3860
  "data-ll-region": t,
3810
- "data-ll-intent": r,
3861
+ "data-ll-intent": n,
3811
3862
  className: a,
3812
3863
  style: o
3813
3864
  },
3814
- c
3865
+ s
3815
3866
  );
3816
3867
  }
3817
3868
  );
3818
- function to(e = {}) {
3819
- const { onFieldUpdate: t, onComplete: r, source: i = "all" } = e, [a, o] = M({}), [c, l] = M(!1), [s, u] = M(null), b = I(t), p = I(r), h = I(i);
3869
+ function lo(e = {}) {
3870
+ const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [a, o] = M({}), [s, l] = M(!1), [c, u] = M(null), m = I(t), p = I(n), h = I(i);
3820
3871
  T(() => {
3821
- b.current = t, p.current = r, h.current = i;
3822
- }, [t, r, i]);
3872
+ m.current = t, p.current = n, h.current = i;
3873
+ }, [t, n, i]);
3823
3874
  const P = C(() => {
3824
3875
  o({}), l(!1);
3825
3876
  }, []);
@@ -3827,101 +3878,101 @@ function to(e = {}) {
3827
3878
  if (typeof window > "u") return;
3828
3879
  const x = (E) => {
3829
3880
  var w, R;
3830
- const g = E.detail;
3831
- if (g) {
3832
- if (g.phase === "field") {
3833
- if (h.current !== "all" && g.source !== h.current)
3881
+ const y = E.detail;
3882
+ if (y) {
3883
+ if (y.phase === "field") {
3884
+ if (h.current !== "all" && y.source !== h.current)
3834
3885
  return;
3835
3886
  l(!0), o(
3836
- (S) => S[g.fieldName] === g.value ? S : { ...S, [g.fieldName]: g.value }
3887
+ (S) => S[y.fieldName] === y.value ? S : { ...S, [y.fieldName]: y.value }
3837
3888
  );
3838
3889
  try {
3839
- (w = b.current) == null || w.call(b, g);
3890
+ (w = m.current) == null || w.call(m, y);
3840
3891
  } catch (S) {
3841
3892
  console.warn("[LiveLayer] useCollect onFieldUpdate threw.", S);
3842
3893
  }
3843
3894
  return;
3844
3895
  }
3845
- if (g.phase === "complete") {
3846
- const S = g.result;
3896
+ if (y.phase === "complete") {
3897
+ const S = y.result;
3847
3898
  if (h.current !== "all" && S.source !== h.current)
3848
3899
  return;
3849
3900
  u(S), l(!1);
3850
3901
  try {
3851
3902
  (R = p.current) == null || R.call(p, S);
3852
- } catch (y) {
3853
- console.warn("[LiveLayer] useCollect onComplete threw.", y);
3903
+ } catch (v) {
3904
+ console.warn("[LiveLayer] useCollect onComplete threw.", v);
3854
3905
  }
3855
3906
  }
3856
3907
  }
3857
3908
  };
3858
3909
  return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
3859
- }, []), { fields: a, isCollecting: c, lastResult: s, reset: P };
3910
+ }, []), { fields: a, isCollecting: s, lastResult: c, reset: P };
3860
3911
  }
3861
- let Rn = 1;
3862
- function no({
3912
+ let Pn = 1;
3913
+ function ao({
3863
3914
  onMount: e,
3864
3915
  defaultOpen: t = !1,
3865
- storageKey: r = "ll-debug-open"
3916
+ storageKey: n = "ll-debug-open"
3866
3917
  }) {
3867
- const [i, a] = M(t), [o, c] = M([]), [l, s] = M(""), [u, b] = M(!1), p = I(/* @__PURE__ */ new Set()), h = I([]), P = I(u);
3918
+ const [i, a] = M(t), [o, s] = M([]), [l, c] = M(""), [u, m] = M(!1), p = I(/* @__PURE__ */ new Set()), h = I([]), P = I(u);
3868
3919
  P.current = u, T(() => {
3869
3920
  try {
3870
- const g = localStorage.getItem(r);
3871
- g === "1" && a(!0), g === "0" && a(!1);
3921
+ const y = localStorage.getItem(n);
3922
+ y === "1" && a(!0), y === "0" && a(!1);
3872
3923
  } catch {
3873
3924
  }
3874
- }, [r]), T(() => {
3925
+ }, [n]), T(() => {
3875
3926
  try {
3876
- localStorage.setItem(r, i ? "1" : "0");
3927
+ localStorage.setItem(n, i ? "1" : "0");
3877
3928
  } catch {
3878
3929
  }
3879
- }, [i, r]), T(() => {
3880
- const g = (w) => {
3930
+ }, [i, n]), T(() => {
3931
+ const y = (w) => {
3881
3932
  (w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), a((R) => !R));
3882
3933
  };
3883
- return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
3934
+ return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
3884
3935
  }, []), T(() => {
3885
- const g = setInterval(() => {
3936
+ const y = setInterval(() => {
3886
3937
  if (h.current.length === 0 || P.current) return;
3887
3938
  const w = h.current.splice(0, h.current.length);
3888
- c(
3939
+ s(
3889
3940
  (R) => [...w.reverse(), ...R].slice(0, 200)
3890
3941
  );
3891
3942
  }, 100);
3892
- return () => clearInterval(g);
3943
+ return () => clearInterval(y);
3893
3944
  }, []);
3894
3945
  const x = I(!1);
3895
3946
  if (T(() => {
3896
- !e || x.current || (x.current = !0, e((g) => {
3947
+ !e || x.current || (x.current = !0, e((y) => {
3897
3948
  h.current.push({
3898
- id: Rn++,
3949
+ id: Pn++,
3899
3950
  ts: Date.now(),
3900
3951
  kind: "event",
3901
- type: g.eventName,
3902
- data: g.data
3952
+ type: y.eventName,
3953
+ data: y.data
3903
3954
  });
3904
3955
  }));
3905
3956
  }, [e]), T(() => {
3906
- const g = console.warn, w = console.log, R = (S, y) => function(...O) {
3957
+ const y = console.warn, w = console.log, R = (S, v) => function(...O) {
3907
3958
  try {
3908
- const m = typeof O[0] == "string" ? O[0] : "";
3909
- m.startsWith("[LiveLayer]") && h.current.push({
3910
- id: Rn++,
3959
+ const g = typeof O[0] == "string" ? O[0] : "";
3960
+ g.startsWith("[LiveLayer]") && h.current.push({
3961
+ id: Pn++,
3911
3962
  ts: Date.now(),
3912
3963
  kind: S,
3913
- type: m.slice(0, 120),
3914
- data: { args: O.slice(1).map((D) => Ui(D)) }
3964
+ type: g.slice(0, 120),
3965
+ data: { args: O.slice(1).map((D) => Xi(D)) }
3915
3966
  });
3916
3967
  } catch {
3917
3968
  }
3918
- return y.apply(this, O);
3969
+ return v.apply(this, O);
3919
3970
  };
3920
- return console.warn = R("warn", g), console.log = R("log", w), () => {
3921
- console.warn = g, console.log = w;
3971
+ return console.warn = R("warn", y), console.log = R("log", w), () => {
3972
+ console.warn = y, console.log = w;
3922
3973
  };
3923
3974
  }, []), !i)
3924
- return /* @__PURE__ */ n(
3975
+ return /* @__PURE__ */ r(
3925
3976
  "button",
3926
3977
  {
3927
3978
  type: "button",
@@ -3947,10 +3998,10 @@ function no({
3947
3998
  children: "🛰 LL debug"
3948
3999
  }
3949
4000
  );
3950
- const E = o.filter((g) => {
4001
+ const E = o.filter((y) => {
3951
4002
  if (!l) return !0;
3952
4003
  const w = l.toLowerCase();
3953
- return g.type.toLowerCase().includes(w) || JSON.stringify(g.data || {}).toLowerCase().includes(w);
4004
+ return y.type.toLowerCase().includes(w) || JSON.stringify(y.data || {}).toLowerCase().includes(w);
3954
4005
  });
3955
4006
  return /* @__PURE__ */ k(
3956
4007
  "div",
@@ -3986,41 +4037,41 @@ function no({
3986
4037
  gap: 8
3987
4038
  },
3988
4039
  children: [
3989
- /* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
4040
+ /* @__PURE__ */ r("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
3990
4041
  /* @__PURE__ */ k("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
3991
4042
  o.length,
3992
4043
  " event",
3993
4044
  o.length === 1 ? "" : "s"
3994
4045
  ] }),
3995
- /* @__PURE__ */ n("span", { style: { flex: 1 } }),
3996
- /* @__PURE__ */ n(
4046
+ /* @__PURE__ */ r("span", { style: { flex: 1 } }),
4047
+ /* @__PURE__ */ r(
3997
4048
  "button",
3998
4049
  {
3999
4050
  type: "button",
4000
- onClick: () => b((g) => !g),
4001
- style: qt(u ? "#f59e0b" : "transparent"),
4051
+ onClick: () => m((y) => !y),
4052
+ style: jt(u ? "#f59e0b" : "transparent"),
4002
4053
  title: "Pause / resume capture",
4003
4054
  children: u ? "▶ resume" : "⏸ pause"
4004
4055
  }
4005
4056
  ),
4006
- /* @__PURE__ */ n(
4057
+ /* @__PURE__ */ r(
4007
4058
  "button",
4008
4059
  {
4009
4060
  type: "button",
4010
4061
  onClick: () => {
4011
- c([]), h.current = [];
4062
+ s([]), h.current = [];
4012
4063
  },
4013
- style: qt("transparent"),
4064
+ style: jt("transparent"),
4014
4065
  title: "Clear buffer",
4015
4066
  children: "clear"
4016
4067
  }
4017
4068
  ),
4018
- /* @__PURE__ */ n(
4069
+ /* @__PURE__ */ r(
4019
4070
  "button",
4020
4071
  {
4021
4072
  type: "button",
4022
4073
  onClick: () => a(!1),
4023
- style: qt("transparent"),
4074
+ style: jt("transparent"),
4024
4075
  "aria-label": "Close",
4025
4076
  title: "Close (Cmd/Ctrl + Shift + L)",
4026
4077
  children: "✕"
@@ -4029,12 +4080,12 @@ function no({
4029
4080
  ]
4030
4081
  }
4031
4082
  ),
4032
- /* @__PURE__ */ n(
4083
+ /* @__PURE__ */ r(
4033
4084
  "input",
4034
4085
  {
4035
4086
  type: "text",
4036
4087
  value: l,
4037
- onChange: (g) => s(g.target.value),
4088
+ onChange: (y) => c(y.target.value),
4038
4089
  placeholder: "filter by type or data…",
4039
4090
  style: {
4040
4091
  margin: 8,
@@ -4048,7 +4099,7 @@ function no({
4048
4099
  }
4049
4100
  }
4050
4101
  ),
4051
- /* @__PURE__ */ n(
4102
+ /* @__PURE__ */ r(
4052
4103
  "div",
4053
4104
  {
4054
4105
  style: {
@@ -4067,7 +4118,7 @@ function no({
4067
4118
  },
4068
4119
  children: [
4069
4120
  "No events yet. Connect to the agent and trigger a tool call — the events will stream in here. You can also dispatch commands manually in DevTools:",
4070
- /* @__PURE__ */ n(
4121
+ /* @__PURE__ */ r(
4071
4122
  "pre",
4072
4123
  {
4073
4124
  style: {
@@ -4086,16 +4137,16 @@ function no({
4086
4137
  )
4087
4138
  ]
4088
4139
  }
4089
- ) : E.map((g) => /* @__PURE__ */ n(
4090
- qi,
4140
+ ) : E.map((y) => /* @__PURE__ */ r(
4141
+ Gi,
4091
4142
  {
4092
- entry: g,
4093
- expanded: p.current.has(g.id),
4143
+ entry: y,
4144
+ expanded: p.current.has(y.id),
4094
4145
  onToggle: () => {
4095
- p.current.has(g.id) ? p.current.delete(g.id) : p.current.add(g.id), c((w) => [...w]);
4146
+ p.current.has(y.id) ? p.current.delete(y.id) : p.current.add(y.id), s((w) => [...w]);
4096
4147
  }
4097
4148
  },
4098
- g.id
4149
+ y.id
4099
4150
  ))
4100
4151
  }
4101
4152
  )
@@ -4103,10 +4154,10 @@ function no({
4103
4154
  }
4104
4155
  );
4105
4156
  }
4106
- function qi({
4157
+ function Gi({
4107
4158
  entry: e,
4108
4159
  expanded: t,
4109
- onToggle: r
4160
+ onToggle: n
4110
4161
  }) {
4111
4162
  const i = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", a = new Date(e.ts).toLocaleTimeString("en-US", {
4112
4163
  hour12: !1
@@ -4115,7 +4166,7 @@ function qi({
4115
4166
  "button",
4116
4167
  {
4117
4168
  type: "button",
4118
- onClick: r,
4169
+ onClick: n,
4119
4170
  style: {
4120
4171
  textAlign: "left",
4121
4172
  background: "transparent",
@@ -4130,7 +4181,7 @@ function qi({
4130
4181
  },
4131
4182
  children: [
4132
4183
  /* @__PURE__ */ k("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
4133
- /* @__PURE__ */ n(
4184
+ /* @__PURE__ */ r(
4134
4185
  "span",
4135
4186
  {
4136
4187
  style: {
@@ -4141,7 +4192,7 @@ function qi({
4141
4192
  children: a
4142
4193
  }
4143
4194
  ),
4144
- /* @__PURE__ */ n(
4195
+ /* @__PURE__ */ r(
4145
4196
  "span",
4146
4197
  {
4147
4198
  style: {
@@ -4153,7 +4204,7 @@ function qi({
4153
4204
  }
4154
4205
  )
4155
4206
  ] }),
4156
- t && e.data && /* @__PURE__ */ n(
4207
+ t && e.data && /* @__PURE__ */ r(
4157
4208
  "pre",
4158
4209
  {
4159
4210
  style: {
@@ -4173,7 +4224,7 @@ function qi({
4173
4224
  }
4174
4225
  );
4175
4226
  }
4176
- function qt(e) {
4227
+ function jt(e) {
4177
4228
  return {
4178
4229
  background: e,
4179
4230
  color: "#fff",
@@ -4184,71 +4235,71 @@ function qt(e) {
4184
4235
  cursor: "pointer"
4185
4236
  };
4186
4237
  }
4187
- function Ui(e) {
4238
+ function Xi(e) {
4188
4239
  try {
4189
4240
  return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
4190
4241
  } catch {
4191
4242
  return String(e);
4192
4243
  }
4193
4244
  }
4194
- function ji(e) {
4245
+ function Ki(e) {
4195
4246
  const t = JSON.stringify(e);
4196
- T(() => fr(e), [t]);
4247
+ T(() => hr(e), [t]);
4197
4248
  }
4198
- function ro({ fields: e, children: t }) {
4199
- return ji(e), /* @__PURE__ */ n(Fe, { children: t });
4249
+ function so({ fields: e, children: t }) {
4250
+ return Ki(e), /* @__PURE__ */ r(We, { children: t });
4200
4251
  }
4201
- function io() {
4202
- const [e, t] = M([]), r = C((a) => {
4252
+ function co() {
4253
+ const [e, t] = M([]), n = C((a) => {
4203
4254
  t((o) => {
4204
- const c = o.findIndex((l) => l.id === a.id);
4205
- if (c >= 0) {
4255
+ const s = o.findIndex((l) => l.id === a.id);
4256
+ if (s >= 0) {
4206
4257
  const l = o.slice();
4207
- return l[c] = a, l;
4258
+ return l[s] = a, l;
4208
4259
  }
4209
4260
  return [...o, a];
4210
4261
  });
4211
4262
  }, []), i = C(() => t([]), []);
4212
4263
  return {
4213
4264
  entries: e,
4214
- pushSegment: r,
4265
+ pushSegment: n,
4215
4266
  clear: i,
4216
4267
  latest: e.length > 0 ? e[e.length - 1] : null
4217
4268
  };
4218
4269
  }
4219
4270
  export {
4220
- Bi as AvatarWidget,
4221
- mr as ErrorBoundary,
4222
- ro as FieldProvider,
4223
- no as LiveLayerDebugPanel,
4224
- eo as LiveLayerRegion,
4225
- Qi as LiveLayerWidget,
4226
- ao as clearFieldRegistry,
4227
- Ci as clearPageContextCache,
4228
- Mi as clearRoutesCache,
4229
- Li as extractPageContext,
4230
- Ni as extractRoutes,
4231
- En as getCachedPageContext,
4232
- Bt as getCachedRoutes,
4233
- so as getRegisteredFields,
4234
- Ur as matchesPattern,
4235
- Si as normalizeRouteInput,
4236
- co as registerFields,
4237
- uo as setFieldValue,
4238
- jr as shouldRenderAtPath,
4239
- Cr as useAgentInfo,
4240
- yr as useAudioLevel,
4241
- _r as useCameraState,
4242
- to as useCollect,
4243
- Sr as useDisplayMode,
4244
- Ar as useDisplayModePersistence,
4245
- Ir as useIsMobile,
4246
- gr as useLiveKitSession,
4247
- Lr as useMediaDevices,
4248
- br as useMicrophoneState,
4249
- Or as usePathname,
4250
- ji as useRegisterFields,
4251
- Vr as useRouteMatch,
4252
- xr as useScreenShareState,
4253
- io as useTranscript
4271
+ Yi as AvatarWidget,
4272
+ yr as ErrorBoundary,
4273
+ so as FieldProvider,
4274
+ ao as LiveLayerDebugPanel,
4275
+ oo as LiveLayerRegion,
4276
+ io as LiveLayerWidget,
4277
+ po as clearFieldRegistry,
4278
+ Ei as clearPageContextCache,
4279
+ Ti as clearRoutesCache,
4280
+ ki as extractPageContext,
4281
+ Ii as extractRoutes,
4282
+ Mn as getCachedPageContext,
4283
+ qt as getCachedRoutes,
4284
+ ho as getRegisteredFields,
4285
+ Vr as matchesPattern,
4286
+ Ai as normalizeRouteInput,
4287
+ mo as registerFields,
4288
+ go as setFieldValue,
4289
+ Yr as shouldRenderAtPath,
4290
+ Sr as useAgentInfo,
4291
+ br as useAudioLevel,
4292
+ Lr as useCameraState,
4293
+ lo as useCollect,
4294
+ Nr as useDisplayMode,
4295
+ Ir as useDisplayModePersistence,
4296
+ Tr as useIsMobile,
4297
+ vr as useLiveKitSession,
4298
+ kr as useMediaDevices,
4299
+ _r as useMicrophoneState,
4300
+ Wr as usePathname,
4301
+ Ki as useRegisterFields,
4302
+ Gr as useRouteMatch,
4303
+ Cr as useScreenShareState,
4304
+ co as useTranscript
4254
4305
  };