@livelayer/react 0.14.1 → 0.15.1

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