@livelayer/react 0.23.3 → 0.23.5

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 S, jsx as r, Fragment as Ve } from "react/jsx-runtime";
3
- import { Component as Er, useState as M, useRef as R, useEffect as I, useCallback as L, useMemo as at, useLayoutEffect as er, forwardRef as on, useImperativeHandle as Ar, createElement as Nr } from "react";
4
- import { createPortal as ln } from "react-dom";
5
- import { LiveKitSession as Mr, registerFields as Ir } from "@livelayer/sdk";
6
- import { clearFieldRegistry as Wo, getRegisteredFields as qo, registerFields as Uo, setFieldValue as jo } from "@livelayer/sdk";
7
- import { createLocalAudioTrack as Rr, Track as tr, createLocalVideoTrack as Tr } from "livekit-client";
8
- class Pr extends Er {
2
+ import { jsxs as S, jsx as r, Fragment as Xe } from "react/jsx-runtime";
3
+ import { Component as zr, useState as M, useRef as R, useEffect as T, useCallback as k, useMemo as ut, useLayoutEffect as ar, forwardRef as un, useImperativeHandle as $r, createElement as Hr } from "react";
4
+ import { createPortal as dn } from "react-dom";
5
+ import { LiveKitSession as Or, registerFields as Fr } from "@livelayer/sdk";
6
+ import { clearFieldRegistry as Jo, getRegisteredFields as Zo, registerFields as Qo, setFieldValue as el } from "@livelayer/sdk";
7
+ import { createLocalAudioTrack as Br, Track as sr, createLocalVideoTrack as Wr } from "livekit-client";
8
+ class qr extends zr {
9
9
  constructor() {
10
10
  super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
11
11
  this.setState({ hasError: !1, error: null });
@@ -35,9 +35,9 @@ class Pr extends Er {
35
35
  ] }) : this.props.children;
36
36
  }
37
37
  }
38
- function Dr(e) {
39
- const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [d, g] = M(null), [p, m] = M(null), [D, x] = M(!1), [C, y] = M(null), w = R(null), P = R(e.onDataMessage);
40
- P.current = e.onDataMessage, I(() => {
38
+ function Ur(e) {
39
+ const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [d, g] = M(null), [p, m] = M(null), [P, x] = M(!1), [L, y] = M(null), w = R(null), D = R(e.onDataMessage);
40
+ D.current = e.onDataMessage, T(() => {
41
41
  const v = {
42
42
  onConnectionStateChange: (B) => {
43
43
  n(B), B === "connected" && y(null);
@@ -50,11 +50,11 @@ function Dr(e) {
50
50
  onVideoTrackRemoved: () => g(null),
51
51
  onError: (B) => y(B),
52
52
  onDataMessage: (B) => {
53
- var J;
54
- (J = P.current) == null || J.call(P, B);
53
+ var Z;
54
+ (Z = D.current) == null || Z.call(D, B);
55
55
  },
56
56
  onResumabilityChange: x
57
- }, z = new Mr(
57
+ }, z = new Or(
58
58
  {
59
59
  agentId: e.agentId,
60
60
  baseUrl: e.baseUrl,
@@ -75,7 +75,7 @@ function Dr(e) {
75
75
  e.sessionEndpoint,
76
76
  JSON.stringify(e.sessionBody ?? {})
77
77
  ]);
78
- const E = L(async () => {
78
+ const E = k(async () => {
79
79
  const v = w.current;
80
80
  if (v)
81
81
  try {
@@ -83,10 +83,10 @@ function Dr(e) {
83
83
  } catch (z) {
84
84
  throw y(z instanceof Error ? z.message : String(z)), z;
85
85
  }
86
- }, []), b = L(() => {
86
+ }, []), b = k(() => {
87
87
  const v = w.current;
88
88
  v && v.disconnect();
89
- }, []), O = L(() => {
89
+ }, []), O = k(() => {
90
90
  var v;
91
91
  return ((v = w.current) == null ? void 0 : v.getRoom()) ?? null;
92
92
  }, []);
@@ -97,116 +97,116 @@ function Dr(e) {
97
97
  agentConfig: a,
98
98
  videoElement: d,
99
99
  audioElement: p,
100
- canResume: D,
101
- error: C,
100
+ canResume: P,
101
+ error: L,
102
102
  connect: E,
103
103
  disconnect: b,
104
104
  getRoom: O,
105
105
  session: w.current
106
106
  };
107
107
  }
108
- function zr() {
109
- const e = R(null), t = R(/* @__PURE__ */ new Map()), n = R(null), i = R(/* @__PURE__ */ new Set()), l = L(() => {
108
+ function jr() {
109
+ const e = R(null), t = R(/* @__PURE__ */ new Map()), n = R(null), i = R(/* @__PURE__ */ new Set()), l = k(() => {
110
110
  const x = t.current;
111
111
  if (x.size === 0) {
112
112
  n.current = null;
113
113
  return;
114
114
  }
115
- let C = 0;
115
+ let L = 0;
116
116
  for (const { analyser: y, buffer: w } of x.values()) {
117
117
  y.getByteFrequencyData(w);
118
- let P = 0;
119
- for (let b = 0; b < w.length; b++) P += w[b];
120
- const E = P / w.length / 255;
121
- E > C && (C = E);
118
+ let D = 0;
119
+ for (let b = 0; b < w.length; b++) D += w[b];
120
+ const E = D / w.length / 255;
121
+ E > L && (L = E);
122
122
  }
123
123
  for (const y of i.current)
124
124
  try {
125
- y(C);
125
+ y(L);
126
126
  } catch (w) {
127
127
  console.error("[useAudioLevel] subscriber threw:", w);
128
128
  }
129
129
  n.current = requestAnimationFrame(l);
130
- }, []), o = L(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = L(() => {
130
+ }, []), o = k(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = k(() => {
131
131
  n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(l));
132
- }, [l]), a = L((x) => {
133
- const C = t.current.get(x);
134
- if (C) {
132
+ }, [l]), a = k((x) => {
133
+ const L = t.current.get(x);
134
+ if (L) {
135
135
  try {
136
- C.node.disconnect();
136
+ L.node.disconnect();
137
137
  } catch {
138
138
  }
139
139
  try {
140
- C.analyser.disconnect();
140
+ L.analyser.disconnect();
141
141
  } catch {
142
142
  }
143
143
  t.current.delete(x);
144
144
  }
145
- }, []), c = L(
146
- (x, C) => {
145
+ }, []), c = k(
146
+ (x, L) => {
147
147
  const y = o();
148
148
  if (!y) return;
149
149
  a(x);
150
- const w = C(y);
150
+ const w = L(y);
151
151
  if (!w) return;
152
- const P = y.createAnalyser();
153
- P.fftSize = 64;
152
+ const D = y.createAnalyser();
153
+ D.fftSize = 64;
154
154
  try {
155
- w.connect(P);
155
+ w.connect(D);
156
156
  } catch (E) {
157
157
  console.warn("[useAudioLevel] connect failed for slot", x, E);
158
158
  return;
159
159
  }
160
160
  t.current.set(x, {
161
- analyser: P,
161
+ analyser: D,
162
162
  node: w,
163
- buffer: new Uint8Array(new ArrayBuffer(P.frequencyBinCount))
163
+ buffer: new Uint8Array(new ArrayBuffer(D.frequencyBinCount))
164
164
  }), s();
165
165
  },
166
166
  [a, o, s]
167
- ), d = L(
168
- (x, C = "agent") => {
169
- c(C, (y) => {
167
+ ), d = k(
168
+ (x, L = "agent") => {
169
+ c(L, (y) => {
170
170
  try {
171
171
  return y.createMediaElementSource(x);
172
172
  } catch (w) {
173
173
  return console.warn(
174
174
  "[useAudioLevel] createMediaElementSource failed for slot",
175
- C,
175
+ L,
176
176
  w
177
177
  ), null;
178
178
  }
179
179
  });
180
180
  },
181
181
  [c]
182
- ), g = L(
183
- (x, C = "mic") => {
184
- c(C, (y) => {
182
+ ), g = k(
183
+ (x, L = "mic") => {
184
+ c(L, (y) => {
185
185
  try {
186
186
  return y.createMediaStreamSource(x);
187
187
  } catch (w) {
188
188
  return console.warn(
189
189
  "[useAudioLevel] createMediaStreamSource failed for slot",
190
- C,
190
+ L,
191
191
  w
192
192
  ), null;
193
193
  }
194
194
  });
195
195
  },
196
196
  [c]
197
- ), p = L(
197
+ ), p = k(
198
198
  (x) => {
199
199
  a(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
200
200
  },
201
201
  [a]
202
- ), m = L(() => {
202
+ ), m = k(() => {
203
203
  n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
204
204
  for (const x of Array.from(t.current.keys()))
205
205
  a(x);
206
- }, [a]), D = L((x) => (i.current.add(x), () => {
206
+ }, [a]), P = k((x) => (i.current.add(x), () => {
207
207
  i.current.delete(x);
208
208
  }), []);
209
- return I(() => () => {
209
+ return T(() => () => {
210
210
  if (m(), e.current) {
211
211
  try {
212
212
  e.current.close();
@@ -215,17 +215,17 @@ function zr() {
215
215
  e.current = null;
216
216
  }
217
217
  i.current.clear();
218
- }, [m]), { attach: d, attachStream: g, detach: m, detachSlot: p, subscribe: D };
218
+ }, [m]), { attach: d, attachStream: g, detach: m, detachSlot: p, subscribe: P };
219
219
  }
220
- function $r(e) {
220
+ function Vr(e) {
221
221
  const t = e == null ? void 0 : e.mediaStreamTrack;
222
222
  return t ? new MediaStream([t]) : null;
223
223
  }
224
- function Hr(e = {}) {
224
+ function Yr(e = {}) {
225
225
  const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, l] = M(t), [o, s] = M(""), [a, c] = M(null), d = R(null), g = R(null), p = R({
226
226
  active: t,
227
227
  lastAutoIntent: null
228
- }), m = L(async (E) => {
228
+ }), m = k(async (E) => {
229
229
  var b, O;
230
230
  if (d.current && g.current) {
231
231
  try {
@@ -236,7 +236,7 @@ function Hr(e = {}) {
236
236
  }
237
237
  g.current = E, c(null);
238
238
  try {
239
- const v = await Rr({
239
+ const v = await Br({
240
240
  echoCancellation: !0,
241
241
  noiseSuppression: !0
242
242
  });
@@ -247,9 +247,9 @@ function Hr(e = {}) {
247
247
  const z = v instanceof Error && v.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
248
248
  throw c(z), v;
249
249
  }
250
- }, []), D = L((E) => {
250
+ }, []), P = k((E) => {
251
251
  g.current = E;
252
- }, []), x = L(async (E) => {
252
+ }, []), x = k(async (E) => {
253
253
  const b = g.current;
254
254
  if (b)
255
255
  try {
@@ -257,7 +257,7 @@ function Hr(e = {}) {
257
257
  } catch (O) {
258
258
  console.warn("[useMicrophoneState] switchDevice failed:", O);
259
259
  }
260
- }, []), C = L(async () => {
260
+ }, []), L = k(async () => {
261
261
  const E = g.current, b = !i;
262
262
  if (l(b), p.current.active = !1, !!E)
263
263
  try {
@@ -266,7 +266,7 @@ function Hr(e = {}) {
266
266
  console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), l(!b);
267
267
  }
268
268
  }, [i]);
269
- I(() => {
269
+ T(() => {
270
270
  if (!p.current.active || n !== "listening") return;
271
271
  const E = g.current, b = E == null ? void 0 : E.localParticipant;
272
272
  if (!b) {
@@ -275,7 +275,7 @@ function Hr(e = {}) {
275
275
  }
276
276
  b.isMicrophoneEnabled === p.current.lastAutoIntent && (b.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, l(!1)), p.current.active = !1;
277
277
  }, [n]);
278
- const y = L(() => {
278
+ const y = k(() => {
279
279
  const E = d.current, b = g.current;
280
280
  if (E && b) {
281
281
  try {
@@ -285,29 +285,29 @@ function Hr(e = {}) {
285
285
  E.stop();
286
286
  }
287
287
  d.current = null, g.current = null, p.current = { active: t, lastAutoIntent: null }, l(t), s("");
288
- }, [t]), w = L(() => c(null), []), P = L(() => $r(d.current), []);
288
+ }, [t]), w = k(() => c(null), []), D = k(() => Vr(d.current), []);
289
289
  return {
290
290
  isMuted: i,
291
291
  activeDeviceId: o,
292
292
  micError: a,
293
- toggleMute: C,
293
+ toggleMute: L,
294
294
  setupMic: m,
295
- attachRoom: D,
295
+ attachRoom: P,
296
296
  switchDevice: x,
297
297
  teardownMic: y,
298
298
  clearError: w,
299
- getMicStream: P
299
+ getMicStream: D
300
300
  };
301
301
  }
302
- const Or = { resolution: { width: 640, height: 480, frameRate: 24 } };
303
- function Fr() {
304
- const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c = R(null), d = R(null), g = L((w) => {
302
+ const Gr = { resolution: { width: 640, height: 480, frameRate: 24 } };
303
+ function Xr() {
304
+ const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c = R(null), d = R(null), g = k((w) => {
305
305
  c.current = w;
306
- }, []), p = L(() => {
306
+ }, []), p = k(() => {
307
307
  var E;
308
- const w = c.current, P = d.current;
309
- if (P && w) {
310
- const b = w.localParticipant.getTrackPublication(tr.Source.Camera), v = (b == null ? void 0 : b.track) ?? P;
308
+ const w = c.current, D = d.current;
309
+ if (D && w) {
310
+ const b = w.localParticipant.getTrackPublication(sr.Source.Camera), v = (b == null ? void 0 : b.track) ?? D;
311
311
  try {
312
312
  w.localParticipant.unpublishTrack(v);
313
313
  } catch {
@@ -318,19 +318,19 @@ function Fr() {
318
318
  }
319
319
  }
320
320
  d.current = null, o(null), t(!1);
321
- }, []), m = L(async (w) => {
322
- const P = c.current;
323
- if (P) {
321
+ }, []), m = k(async (w) => {
322
+ const D = c.current;
323
+ if (D) {
324
324
  i(null);
325
325
  try {
326
- const E = { ...Or };
326
+ const E = { ...Gr };
327
327
  w && (E.deviceId = w);
328
- const b = await Tr(E);
329
- await P.localParticipant.publishTrack(b), d.current = b;
328
+ const b = await Wr(E);
329
+ await D.localParticipant.publishTrack(b), d.current = b;
330
330
  const O = b.attach();
331
331
  o(O), t(!0), w && a(w);
332
332
  try {
333
- P.localParticipant.publishData(
333
+ D.localParticipant.publishData(
334
334
  new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
335
335
  { reliable: !0 }
336
336
  );
@@ -341,31 +341,31 @@ function Fr() {
341
341
  i(b);
342
342
  }
343
343
  }
344
- }, []), D = L(async () => {
344
+ }, []), P = k(async () => {
345
345
  e ? p() : await m(s || void 0);
346
- }, [e, s, p, m]), x = L(async (w) => {
346
+ }, [e, s, p, m]), x = k(async (w) => {
347
347
  p(), await m(w);
348
- }, [p, m]), C = L(() => {
348
+ }, [p, m]), L = k(() => {
349
349
  p(), c.current = null, i(null), a("");
350
- }, [p]), y = L(() => i(null), []);
351
- return I(() => () => {
350
+ }, [p]), y = k(() => i(null), []);
351
+ return T(() => () => {
352
352
  d.current && d.current.stop();
353
353
  }, []), {
354
354
  isEnabled: e,
355
355
  error: n,
356
356
  previewEl: l,
357
357
  activeDeviceId: s,
358
- toggle: D,
358
+ toggle: P,
359
359
  switchDevice: x,
360
360
  attachRoom: g,
361
- teardown: C,
361
+ teardown: L,
362
362
  clearError: y
363
363
  };
364
364
  }
365
- function Br() {
366
- const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = R(null), a = L((m) => {
365
+ function Kr() {
366
+ const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = R(null), a = k((m) => {
367
367
  s.current = m;
368
- }, []), c = L(() => o(null), []), d = L(async () => {
368
+ }, []), c = k(() => o(null), []), d = k(async () => {
369
369
  const m = s.current;
370
370
  if (m) {
371
371
  if (e) {
@@ -379,11 +379,11 @@ function Br() {
379
379
  i(null);
380
380
  try {
381
381
  await m.localParticipant.setScreenShareEnabled(!0);
382
- let D = 0;
382
+ let P = 0;
383
383
  const x = () => {
384
- const C = m.localParticipant.getTrackPublication(tr.Source.ScreenShare);
385
- if (C != null && C.track) {
386
- const y = C.track.attach();
384
+ const L = m.localParticipant.getTrackPublication(sr.Source.ScreenShare);
385
+ if (L != null && L.track) {
386
+ const y = L.track.attach();
387
387
  o(y), t(!0);
388
388
  try {
389
389
  m.localParticipant.publishData(
@@ -394,15 +394,15 @@ function Br() {
394
394
  }
395
395
  return;
396
396
  }
397
- D++ < 10 ? setTimeout(x, 100) : t(!0);
397
+ P++ < 10 ? setTimeout(x, 100) : t(!0);
398
398
  };
399
399
  x();
400
- } catch (D) {
401
- const x = D instanceof Error ? D.name : "";
400
+ } catch (P) {
401
+ const x = P instanceof Error ? P.name : "";
402
402
  x !== "NotAllowedError" && x !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
403
403
  }
404
404
  }
405
- }, [e, c]), g = L(() => {
405
+ }, [e, c]), g = k(() => {
406
406
  const m = s.current;
407
407
  if (m && e)
408
408
  try {
@@ -410,11 +410,11 @@ function Br() {
410
410
  } catch {
411
411
  }
412
412
  c(), t(!1), i(null), s.current = null;
413
- }, [e, c]), p = L(() => i(null), []);
413
+ }, [e, c]), p = k(() => i(null), []);
414
414
  return { isEnabled: e, error: n, previewEl: l, toggle: d, attachRoom: a, teardown: g, clearError: p };
415
415
  }
416
- function Wr() {
417
- const [e, t] = M([]), [n, i] = M([]), l = L(async () => {
416
+ function Jr() {
417
+ const [e, t] = M([]), [n, i] = M([]), l = k(async () => {
418
418
  if (!(typeof navigator > "u" || !navigator.mediaDevices))
419
419
  try {
420
420
  const o = await navigator.mediaDevices.enumerateDevices();
@@ -422,15 +422,15 @@ function Wr() {
422
422
  } catch {
423
423
  }
424
424
  }, []);
425
- return I(() => {
425
+ return T(() => {
426
426
  if (l(), typeof navigator > "u" || !navigator.mediaDevices) return;
427
427
  const o = () => void l();
428
428
  return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
429
429
  }, [l]), { mics: e, cameras: n, refresh: l };
430
430
  }
431
- function qr(e, t, n = !1) {
431
+ function Zr(e, t, n = !1) {
432
432
  const [i, l] = M(null), [o, s] = M(null), [a, c] = M(!n && !!e);
433
- return I(() => {
433
+ return T(() => {
434
434
  if (n || !e) {
435
435
  c(!1);
436
436
  return;
@@ -451,7 +451,7 @@ function qr(e, t, n = !1) {
451
451
  }), () => d.abort();
452
452
  }, [e, t, n]), { info: i, error: o, loading: a };
453
453
  }
454
- function nr(e) {
454
+ function cr(e) {
455
455
  if (typeof window > "u") return null;
456
456
  try {
457
457
  return window.localStorage.getItem(e);
@@ -459,26 +459,26 @@ function nr(e) {
459
459
  return null;
460
460
  }
461
461
  }
462
- function rr(e, t) {
462
+ function ur(e, t) {
463
463
  if (!(typeof window > "u"))
464
464
  try {
465
465
  window.localStorage.setItem(e, t);
466
466
  } catch {
467
467
  }
468
468
  }
469
- function Ur(e) {
469
+ function Qr(e) {
470
470
  if (!(typeof window > "u"))
471
471
  try {
472
472
  window.localStorage.removeItem(e);
473
473
  } catch {
474
474
  }
475
475
  }
476
- function jr({
476
+ function ei({
477
477
  value: e,
478
478
  defaultValue: t = "expanded",
479
479
  onChange: n
480
480
  } = {}) {
481
- const i = e !== void 0, [l, o] = M(t), s = i ? e : l, a = L(
481
+ const i = e !== void 0, [l, o] = M(t), s = i ? e : l, a = k(
482
482
  (c) => {
483
483
  c !== s && (i || o(c), n == null || n(c));
484
484
  },
@@ -486,34 +486,34 @@ function jr({
486
486
  );
487
487
  return [s, a];
488
488
  }
489
- const Vr = ["hidden", "minimized", "expanded"];
490
- function Yr(e) {
491
- return e && Vr.includes(e) ? e : null;
489
+ const ti = ["hidden", "minimized", "expanded"];
490
+ function ni(e) {
491
+ return e && ti.includes(e) ? e : null;
492
492
  }
493
- function Gr({
493
+ function ri({
494
494
  value: e,
495
495
  defaultValue: t = "expanded",
496
496
  onChange: n,
497
497
  persistKey: i = "ll-widget",
498
498
  disablePersistence: l = !1
499
499
  } = {}) {
500
- const o = `${i}:display-mode`, s = R(!1), [a, c] = jr({
500
+ const o = `${i}:display-mode`, s = R(!1), [a, c] = ei({
501
501
  value: e,
502
502
  defaultValue: t,
503
503
  onChange: (d) => {
504
- e === void 0 && !l && rr(o, d), n == null || n(d);
504
+ e === void 0 && !l && ur(o, d), n == null || n(d);
505
505
  }
506
506
  });
507
- return I(() => {
507
+ return T(() => {
508
508
  if (s.current || (s.current = !0, l || e !== void 0)) return;
509
- const d = Yr(nr(o));
509
+ const d = ni(cr(o));
510
510
  d && d !== a && c(d);
511
511
  }, []), [a, c];
512
512
  }
513
- const Xr = 640;
514
- function Kr(e = Xr) {
513
+ const ii = 640;
514
+ function oi(e = ii) {
515
515
  const [t, n] = M(!1);
516
- return I(() => {
516
+ return T(() => {
517
517
  if (e === !1) {
518
518
  n(!1);
519
519
  return;
@@ -526,11 +526,11 @@ function Kr(e = Xr) {
526
526
  });
527
527
  }, [e]), t;
528
528
  }
529
- const Jr = 280, Zr = 380, Qr = 8, ei = 4;
530
- function Kt(e) {
529
+ const li = 280, ai = 380, si = 8, ci = 4;
530
+ function tn(e) {
531
531
  return `${e}:geometry`;
532
532
  }
533
- function ti(e) {
533
+ function ui(e) {
534
534
  if (!e) return null;
535
535
  let t;
536
536
  try {
@@ -542,91 +542,91 @@ function ti(e) {
542
542
  const n = t, { top: i, left: l, width: o, height: s } = n;
543
543
  return typeof i != "number" || typeof l != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(l) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: l, width: o, height: s };
544
544
  }
545
- function Ht() {
545
+ function Wt() {
546
546
  return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
547
547
  }
548
- function Jt(e, t, n) {
548
+ function nn(e, t, n) {
549
549
  const { minWidth: i, minHeight: l, edgeMargin: o, vw: s, vh: a } = n, c = Math.max(i, s - o * 2), d = Math.max(l, a - o * 2);
550
550
  return {
551
551
  width: Math.max(i, Math.min(c, e)),
552
552
  height: Math.max(l, Math.min(d, t))
553
553
  };
554
554
  }
555
- function Zt(e, t, n, i, l) {
555
+ function rn(e, t, n, i, l) {
556
556
  const { edgeMargin: o, vw: s, vh: a } = l, c = o, d = o, g = Math.max(c, s - n - o), p = Math.max(d, a - i - o);
557
557
  return {
558
558
  top: Math.max(d, Math.min(p, e)),
559
559
  left: Math.max(c, Math.min(g, t))
560
560
  };
561
561
  }
562
- function ni(e) {
562
+ function di(e) {
563
563
  const {
564
564
  draggable: t,
565
565
  resizable: n,
566
566
  persistKey: i,
567
567
  disablePersistence: l,
568
- minWidth: o = Jr,
569
- minHeight: s = Zr,
570
- edgeMargin: a = Qr
571
- } = e, [c, d] = M(null), [g, p] = M(!1), [m, D] = M(!1), x = R(null), C = R(null), y = R(!1), w = R(null);
568
+ minWidth: o = li,
569
+ minHeight: s = ai,
570
+ edgeMargin: a = si
571
+ } = e, [c, d] = M(null), [g, p] = M(!1), [m, P] = M(!1), x = R(null), L = R(null), y = R(!1), w = R(null);
572
572
  w.current = c;
573
- const P = L(
573
+ const D = k(
574
574
  (f) => {
575
- l || (f === null ? Ur(Kt(i)) : rr(Kt(i), JSON.stringify(f)));
575
+ l || (f === null ? Qr(tn(i)) : ur(tn(i), JSON.stringify(f)));
576
576
  },
577
577
  [l, i]
578
578
  );
579
- I(() => {
579
+ T(() => {
580
580
  if (y.current || (y.current = !0, l)) return;
581
- const f = ti(nr(Kt(i)));
581
+ const f = ui(cr(tn(i)));
582
582
  if (!f) return;
583
- const { vw: A, vh: $ } = Ht(), q = Jt(f.width, f.height, {
583
+ const { vw: N, vh: $ } = Wt(), U = nn(f.width, f.height, {
584
584
  minWidth: o,
585
585
  minHeight: s,
586
586
  edgeMargin: a,
587
- vw: A,
587
+ vw: N,
588
588
  vh: $
589
- }), X = Zt(f.top, f.left, q.width, q.height, {
589
+ }), K = rn(f.top, f.left, U.width, U.height, {
590
590
  edgeMargin: a,
591
- vw: A,
591
+ vw: N,
592
592
  vh: $
593
593
  });
594
- d({ ...X, ...q });
595
- }, []), I(() => {
594
+ d({ ...K, ...U });
595
+ }, []), T(() => {
596
596
  if (typeof window > "u") return;
597
597
  const f = () => {
598
- d((A) => {
599
- if (A === null) return null;
600
- const { vw: $, vh: q } = Ht(), X = Jt(A.width, A.height, {
598
+ d((N) => {
599
+ if (N === null) return null;
600
+ const { vw: $, vh: U } = Wt(), K = nn(N.width, N.height, {
601
601
  minWidth: o,
602
602
  minHeight: s,
603
603
  edgeMargin: a,
604
604
  vw: $,
605
- vh: q
605
+ vh: U
606
606
  });
607
- return { ...Zt(A.top, A.left, X.width, X.height, {
607
+ return { ...rn(N.top, N.left, K.width, K.height, {
608
608
  edgeMargin: a,
609
609
  vw: $,
610
- vh: q
611
- }), ...X };
610
+ vh: U
611
+ }), ...K };
612
612
  });
613
613
  };
614
614
  return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
615
615
  }, [o, s, a]);
616
- const E = L(
616
+ const E = k(
617
617
  (f) => {
618
618
  if (!t || f.pointerType === "mouse" && f.button !== 0) return;
619
- const A = f.target;
620
- if (A && typeof A.closest == "function" && A.closest('button, a, input, select, textarea, [role="listbox"], [role="option"], [data-ll-no-drag]'))
619
+ const N = f.target;
620
+ if (N && typeof N.closest == "function" && N.closest('button, a, input, select, textarea, [role="listbox"], [role="option"], [data-ll-no-drag]'))
621
621
  return;
622
- let $, q, X, te;
622
+ let $, U, K, re;
623
623
  const W = w.current;
624
624
  if (W)
625
- ({ top: $, left: q, width: X, height: te } = W);
625
+ ({ top: $, left: U, width: K, height: re } = W);
626
626
  else {
627
- const ne = f.currentTarget.closest(".ll-widget"), ie = ne == null ? void 0 : ne.getBoundingClientRect();
628
- if (!ie) return;
629
- $ = ie.top, q = ie.left, X = ie.width, te = ie.height;
627
+ const ie = f.currentTarget.closest(".ll-widget"), le = ie == null ? void 0 : ie.getBoundingClientRect();
628
+ if (!le) return;
629
+ $ = le.top, U = le.left, K = le.width, re = le.height;
630
630
  }
631
631
  try {
632
632
  f.currentTarget.setPointerCapture(f.pointerId);
@@ -636,97 +636,97 @@ function ni(e) {
636
636
  startClientX: f.clientX,
637
637
  startClientY: f.clientY,
638
638
  startTop: $,
639
- startLeft: q,
640
- width: X,
641
- height: te,
639
+ startLeft: U,
640
+ width: K,
641
+ height: re,
642
642
  moved: !1
643
643
  };
644
644
  },
645
645
  [t]
646
- ), b = L(
646
+ ), b = k(
647
647
  (f) => {
648
- const A = x.current;
649
- if (!A) return;
650
- const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY;
651
- if (!A.moved && Math.abs($) + Math.abs(q) > ei && (A.moved = !0, p(!0)), !A.moved) return;
652
- const { vw: X, vh: te } = Ht(), W = Zt(
653
- A.startTop + q,
654
- A.startLeft + $,
655
- A.width,
656
- A.height,
657
- { edgeMargin: a, vw: X, vh: te }
648
+ const N = x.current;
649
+ if (!N) return;
650
+ const $ = f.clientX - N.startClientX, U = f.clientY - N.startClientY;
651
+ if (!N.moved && Math.abs($) + Math.abs(U) > ci && (N.moved = !0, p(!0)), !N.moved) return;
652
+ const { vw: K, vh: re } = Wt(), W = rn(
653
+ N.startTop + U,
654
+ N.startLeft + $,
655
+ N.width,
656
+ N.height,
657
+ { edgeMargin: a, vw: K, vh: re }
658
658
  );
659
- d({ ...W, width: A.width, height: A.height });
659
+ d({ ...W, width: N.width, height: N.height });
660
660
  },
661
661
  [a]
662
- ), O = L(
662
+ ), O = k(
663
663
  (f) => {
664
- const A = x.current;
665
- if (A) {
664
+ const N = x.current;
665
+ if (N) {
666
666
  try {
667
667
  f.currentTarget.releasePointerCapture(f.pointerId);
668
668
  } catch {
669
669
  }
670
- x.current = null, A.moved && (p(!1), d(($) => ($ && P($), $)));
670
+ x.current = null, N.moved && (p(!1), d(($) => ($ && D($), $)));
671
671
  }
672
672
  },
673
- [P]
674
- ), v = L(() => {
675
- x.current = null, C.current = null, p(!1), D(!1), d(null), P(null);
676
- }, [P]), z = L(
673
+ [D]
674
+ ), v = k(() => {
675
+ x.current = null, L.current = null, p(!1), P(!1), d(null), D(null);
676
+ }, [D]), z = k(
677
677
  (f) => {
678
678
  if (!n || f.pointerType === "mouse" && f.button !== 0) return;
679
679
  f.stopPropagation();
680
- let A, $, q, X;
681
- const te = w.current;
682
- if (te)
683
- ({ top: A, left: $, width: q, height: X } = te);
680
+ let N, $, U, K;
681
+ const re = w.current;
682
+ if (re)
683
+ ({ top: N, left: $, width: U, height: K } = re);
684
684
  else {
685
- const W = f.currentTarget.closest(".ll-widget"), ne = W == null ? void 0 : W.getBoundingClientRect();
686
- if (!ne) return;
687
- A = ne.top, $ = ne.left, q = ne.width, X = ne.height;
685
+ const W = f.currentTarget.closest(".ll-widget"), ie = W == null ? void 0 : W.getBoundingClientRect();
686
+ if (!ie) return;
687
+ N = ie.top, $ = ie.left, U = ie.width, K = ie.height;
688
688
  }
689
689
  try {
690
690
  f.currentTarget.setPointerCapture(f.pointerId);
691
691
  } catch {
692
692
  }
693
- C.current = {
693
+ L.current = {
694
694
  startClientX: f.clientX,
695
695
  startClientY: f.clientY,
696
- startWidth: q,
697
- startHeight: X,
698
- top: A,
696
+ startWidth: U,
697
+ startHeight: K,
698
+ top: N,
699
699
  left: $
700
- }, D(!0);
700
+ }, P(!0);
701
701
  },
702
702
  [n]
703
- ), B = L(
703
+ ), B = k(
704
704
  (f) => {
705
- const A = C.current;
706
- if (!A) return;
707
- const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY, { vw: X, vh: te } = Ht(), W = X - A.left - a, ne = te - A.top - a, ie = Jt(A.startWidth + $, A.startHeight + q, {
705
+ const N = L.current;
706
+ if (!N) return;
707
+ const $ = f.clientX - N.startClientX, U = f.clientY - N.startClientY, { vw: K, vh: re } = Wt(), W = K - N.left - a, ie = re - N.top - a, le = nn(N.startWidth + $, N.startHeight + U, {
708
708
  minWidth: o,
709
709
  minHeight: s,
710
710
  edgeMargin: a,
711
711
  // Clamp the available viewport to the room from the anchored corner
712
712
  // so the widget can't grow past the bottom/right edge.
713
- vw: Math.min(X, A.left + W + a),
714
- vh: Math.min(te, A.top + ne + a)
713
+ vw: Math.min(K, N.left + W + a),
714
+ vh: Math.min(re, N.top + ie + a)
715
715
  });
716
- d({ top: A.top, left: A.left, ...ie });
716
+ d({ top: N.top, left: N.left, ...le });
717
717
  },
718
718
  [a, o, s]
719
- ), J = L(
719
+ ), Z = k(
720
720
  (f) => {
721
- if (C.current) {
721
+ if (L.current) {
722
722
  try {
723
723
  f.currentTarget.releasePointerCapture(f.pointerId);
724
724
  } catch {
725
725
  }
726
- C.current = null, D(!1), d(($) => ($ && P($), $));
726
+ L.current = null, P(!1), d(($) => ($ && D($), $));
727
727
  }
728
728
  },
729
- [P]
729
+ [D]
730
730
  );
731
731
  return {
732
732
  style: c === null ? {} : {
@@ -752,82 +752,82 @@ function ni(e) {
752
752
  resizeHandleProps: {
753
753
  onPointerDown: z,
754
754
  onPointerMove: B,
755
- onPointerUp: J,
756
- onPointerCancel: J,
755
+ onPointerUp: Z,
756
+ onPointerCancel: Z,
757
757
  "data-ll-resize-handle": n ? "" : void 0
758
758
  },
759
759
  reset: v
760
760
  };
761
761
  }
762
- const Mn = "__llHistoryPatched", Bt = "ll:pathname";
763
- function ri() {
764
- if (typeof window > "u" || window.history[Mn]) return;
762
+ const $n = "__llHistoryPatched", jt = "ll:pathname";
763
+ function fi() {
764
+ if (typeof window > "u" || window.history[$n]) return;
765
765
  const e = window.history.pushState, t = window.history.replaceState;
766
766
  window.history.pushState = function(...n) {
767
767
  const i = e.apply(this, n);
768
- return window.dispatchEvent(new Event(Bt)), i;
768
+ return window.dispatchEvent(new Event(jt)), i;
769
769
  }, window.history.replaceState = function(...n) {
770
770
  const i = t.apply(this, n);
771
- return window.dispatchEvent(new Event(Bt)), i;
772
- }, window.history[Mn] = !0;
771
+ return window.dispatchEvent(new Event(jt)), i;
772
+ }, window.history[$n] = !0;
773
773
  }
774
- function In() {
774
+ function Hn() {
775
775
  return typeof window > "u" ? "/" : window.location.pathname || "/";
776
776
  }
777
- function ii(e) {
777
+ function pi(e) {
778
778
  const [t, n] = M(
779
- () => e ?? In()
779
+ () => e ?? Hn()
780
780
  );
781
- return I(() => {
781
+ return T(() => {
782
782
  if (e !== void 0) return;
783
- ri();
784
- const i = () => n(In());
785
- return i(), window.addEventListener("popstate", i), window.addEventListener(Bt, i), () => {
786
- window.removeEventListener("popstate", i), window.removeEventListener(Bt, i);
783
+ fi();
784
+ const i = () => n(Hn());
785
+ return i(), window.addEventListener("popstate", i), window.addEventListener(jt, i), () => {
786
+ window.removeEventListener("popstate", i), window.removeEventListener(jt, i);
787
787
  };
788
788
  }, [e]), e ?? t;
789
789
  }
790
- const Rn = /* @__PURE__ */ new Map(), oi = /[\\^$+?.()|{}[\]]/g;
791
- function li(e) {
792
- return e.replace(oi, "\\$&");
790
+ const On = /* @__PURE__ */ new Map(), hi = /[\\^$+?.()|{}[\]]/g;
791
+ function mi(e) {
792
+ return e.replace(hi, "\\$&");
793
793
  }
794
- function ai(e) {
795
- const t = Rn.get(e);
794
+ function gi(e) {
795
+ const t = On.get(e);
796
796
  if (t) return t;
797
- const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", l = "", o = n.replace(/\*\*/g, i).replace(/\*/g, l), a = li(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
798
- return Rn.set(e, c), c;
797
+ const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", l = "", o = n.replace(/\*\*/g, i).replace(/\*/g, l), a = mi(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
798
+ return On.set(e, c), c;
799
799
  }
800
- function si(e, t) {
800
+ function yi(e, t) {
801
801
  const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
802
- return ai(e).test(n);
802
+ return gi(e).test(n);
803
803
  }
804
- function ci(e, t) {
805
- return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : si(e, t);
804
+ function vi(e, t) {
805
+ return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : yi(e, t);
806
806
  }
807
- function Tn(e, t) {
807
+ function Fn(e, t) {
808
808
  if (!e || e.length === 0) return !1;
809
809
  for (const n of e)
810
- if (ci(n, t)) return !0;
810
+ if (vi(n, t)) return !0;
811
811
  return !1;
812
812
  }
813
- function ui(e, t, n) {
814
- return e === void 0 ? !0 : Tn(n, e) ? !1 : t && t.length > 0 ? Tn(t, e) : !0;
813
+ function bi(e, t, n) {
814
+ return e === void 0 ? !0 : Fn(n, e) ? !1 : t && t.length > 0 ? Fn(t, e) : !0;
815
815
  }
816
- function di(e, t, n) {
817
- return at(
818
- () => ui(e, t, n),
816
+ function wi(e, t, n) {
817
+ return ut(
818
+ () => bi(e, t, n),
819
819
  [e, t, n]
820
820
  );
821
821
  }
822
- function fi(e) {
822
+ function _i(e) {
823
823
  return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
824
824
  navigate: e.navigate !== !1,
825
825
  thinking: e.thinking !== !1,
826
826
  action: e.action !== !1
827
827
  };
828
828
  }
829
- function pi(e) {
830
- const t = at(() => fi(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = R(null), l = L(
829
+ function xi(e) {
830
+ const t = ut(() => _i(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = R(null), l = k(
831
831
  (c) => {
832
832
  try {
833
833
  new Audio(`${n}${c}`).play().catch(() => {
@@ -836,11 +836,11 @@ function pi(e) {
836
836
  }
837
837
  },
838
838
  [n]
839
- ), o = L(() => {
839
+ ), o = k(() => {
840
840
  t.navigate && l("/audio/page-change-sound.mp3");
841
- }, [t.navigate, l]), s = L(() => {
841
+ }, [t.navigate, l]), s = k(() => {
842
842
  t.action && l("/audio/confirmation-sound.mp3");
843
- }, [t.action, l]), a = L(
843
+ }, [t.action, l]), a = k(
844
844
  (c) => {
845
845
  if (!t.thinking) {
846
846
  if (i.current) {
@@ -871,7 +871,7 @@ function pi(e) {
871
871
  },
872
872
  [n, t.thinking]
873
873
  );
874
- return I(() => () => {
874
+ return T(() => () => {
875
875
  if (i.current) {
876
876
  try {
877
877
  i.current.pause();
@@ -879,12 +879,12 @@ function pi(e) {
879
879
  }
880
880
  i.current = null;
881
881
  }
882
- }, []), at(
882
+ }, []), ut(
883
883
  () => ({ playPageChange: o, playConfirmation: s, setThinking: a }),
884
884
  [o, s, a]
885
885
  );
886
886
  }
887
- const Pn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
887
+ const Bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
888
888
  "svg",
889
889
  {
890
890
  className: t,
@@ -930,7 +930,7 @@ const Pn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
930
930
  }
931
931
  )
932
932
  }
933
- ), Dn = ({ className: e }) => /* @__PURE__ */ r(
933
+ ), Wn = ({ className: e }) => /* @__PURE__ */ r(
934
934
  "svg",
935
935
  {
936
936
  className: e,
@@ -948,7 +948,7 @@ const Pn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
948
948
  }
949
949
  )
950
950
  }
951
- ), hi = ({ className: e }) => /* @__PURE__ */ r(
951
+ ), Ci = ({ className: e }) => /* @__PURE__ */ r(
952
952
  "svg",
953
953
  {
954
954
  className: e,
@@ -959,12 +959,12 @@ const Pn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
959
959
  "aria-hidden": "true",
960
960
  children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
961
961
  }
962
- ), mi = {
962
+ ), ki = {
963
963
  left: 180,
964
964
  right: 0,
965
965
  up: -90,
966
966
  down: 90
967
- }, zn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
967
+ }, qn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
968
968
  "svg",
969
969
  {
970
970
  className: t,
@@ -972,19 +972,19 @@ const Pn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
972
972
  viewBox: "0 0 24 24",
973
973
  stroke: "currentColor",
974
974
  strokeWidth: 2,
975
- style: { transform: `rotate(${mi[e]}deg)` },
975
+ style: { transform: `rotate(${ki[e]}deg)` },
976
976
  "aria-hidden": "true",
977
977
  children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
978
978
  }
979
979
  );
980
- function gi(e) {
980
+ function Li(e) {
981
981
  return e === "top-left" || e === "bottom-left" ? "left" : "right";
982
982
  }
983
- const ir = "ll-hidden-tab-center-y", yi = 5, $n = 16;
984
- function vi() {
983
+ const dr = "ll-hidden-tab-center-y", Si = 5, Un = 16;
984
+ function Ei() {
985
985
  if (typeof window > "u") return null;
986
986
  try {
987
- const e = window.localStorage.getItem(ir);
987
+ const e = window.localStorage.getItem(dr);
988
988
  if (!e) return null;
989
989
  const t = Number.parseFloat(e);
990
990
  return Number.isFinite(t) ? t : null;
@@ -992,14 +992,14 @@ function vi() {
992
992
  return null;
993
993
  }
994
994
  }
995
- function Hn(e) {
995
+ function jn(e) {
996
996
  if (!(typeof window > "u"))
997
997
  try {
998
- window.localStorage.setItem(ir, String(e));
998
+ window.localStorage.setItem(dr, String(e));
999
999
  } catch {
1000
1000
  }
1001
1001
  }
1002
- const bi = ({
1002
+ const Ai = ({
1003
1003
  position: e,
1004
1004
  isMobile: t,
1005
1005
  isSpeaking: n,
@@ -1009,94 +1009,94 @@ const bi = ({
1009
1009
  agentName: s,
1010
1010
  containerEl: a
1011
1011
  }) => {
1012
- const c = gi(e), d = c === "right" ? "left" : "right", g = t ? 80 : 72, p = !!o, m = !!a, [D, x] = M(null), [C, y] = M(!1), w = R(null), P = R(!1), E = L(
1012
+ const c = Li(e), d = c === "right" ? "left" : "right", g = t ? 80 : 72, p = !!o, m = !!a, [P, x] = M(null), [L, y] = M(!1), w = R(null), D = R(!1), E = k(
1013
1013
  (H) => {
1014
1014
  if (typeof window > "u") return H;
1015
- const G = g / 2, f = $n + G, A = window.innerHeight - $n - G;
1016
- return A < f ? Math.max(f, H) : Math.max(f, Math.min(A, H));
1015
+ const X = g / 2, f = Un + X, N = window.innerHeight - Un - X;
1016
+ return N < f ? Math.max(f, H) : Math.max(f, Math.min(N, H));
1017
1017
  },
1018
1018
  [g]
1019
1019
  );
1020
- I(() => {
1020
+ T(() => {
1021
1021
  if (m) {
1022
1022
  x(null);
1023
1023
  return;
1024
1024
  }
1025
- const H = vi();
1025
+ const H = Ei();
1026
1026
  x(E(H ?? window.innerHeight / 2));
1027
- const G = () => {
1027
+ const X = () => {
1028
1028
  x((f) => f === null ? null : E(f));
1029
1029
  };
1030
- return window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
1030
+ return window.addEventListener("resize", X), () => window.removeEventListener("resize", X);
1031
1031
  }, [E, m]);
1032
- const b = L(
1032
+ const b = k(
1033
1033
  (H) => {
1034
- if (!m && !(H.pointerType === "mouse" && H.button !== 0) && D !== null) {
1034
+ if (!m && !(H.pointerType === "mouse" && H.button !== 0) && P !== null) {
1035
1035
  try {
1036
1036
  H.currentTarget.setPointerCapture(H.pointerId);
1037
1037
  } catch {
1038
1038
  }
1039
1039
  w.current = {
1040
1040
  startClientY: H.clientY,
1041
- startCenterY: D,
1041
+ startCenterY: P,
1042
1042
  moved: !1
1043
1043
  };
1044
1044
  }
1045
1045
  },
1046
- [D, m]
1047
- ), O = L(
1046
+ [P, m]
1047
+ ), O = k(
1048
1048
  (H) => {
1049
- const G = w.current;
1050
- if (!G) return;
1051
- const f = H.clientY - G.startClientY;
1052
- !G.moved && Math.abs(f) > yi && (G.moved = !0, y(!0)), G.moved && x(E(G.startCenterY + f));
1049
+ const X = w.current;
1050
+ if (!X) return;
1051
+ const f = H.clientY - X.startClientY;
1052
+ !X.moved && Math.abs(f) > Si && (X.moved = !0, y(!0)), X.moved && x(E(X.startCenterY + f));
1053
1053
  },
1054
1054
  [E]
1055
- ), v = L(
1055
+ ), v = k(
1056
1056
  (H) => {
1057
- const G = w.current;
1058
- if (G) {
1057
+ const X = w.current;
1058
+ if (X) {
1059
1059
  try {
1060
1060
  H.currentTarget.releasePointerCapture(H.pointerId);
1061
1061
  } catch {
1062
1062
  }
1063
- w.current = null, G.moved && (y(!1), P.current = !0, x((f) => (f !== null && Hn(f), f)));
1063
+ w.current = null, X.moved && (y(!1), D.current = !0, x((f) => (f !== null && jn(f), f)));
1064
1064
  }
1065
1065
  },
1066
1066
  []
1067
- ), z = L(() => {
1068
- if (P.current) {
1069
- P.current = !1;
1067
+ ), z = k(() => {
1068
+ if (D.current) {
1069
+ D.current = !1;
1070
1070
  return;
1071
1071
  }
1072
1072
  i();
1073
- }, [i]), B = L(
1073
+ }, [i]), B = k(
1074
1074
  (H) => {
1075
1075
  if (H.key === "ArrowUp" || H.key === "ArrowDown") {
1076
1076
  H.preventDefault();
1077
- const G = H.key === "ArrowUp" ? -8 : 8;
1077
+ const X = H.key === "ArrowUp" ? -8 : 8;
1078
1078
  x((f) => {
1079
1079
  if (f === null) return f;
1080
- const A = E(f + G);
1081
- return Hn(A), A;
1080
+ const N = E(f + X);
1081
+ return jn(N), N;
1082
1082
  });
1083
1083
  }
1084
1084
  },
1085
1085
  [E]
1086
- ), J = [
1086
+ ), Z = [
1087
1087
  "ll-hidden",
1088
1088
  `ll-hidden--${c}`,
1089
1089
  t ? "ll-hidden--mobile" : "ll-hidden--desktop",
1090
1090
  n ? "ll-hidden--speaking" : null,
1091
- C ? "is-dragging" : null,
1091
+ L ? "is-dragging" : null,
1092
1092
  p ? "ll-hidden--with-avatar" : null,
1093
1093
  m ? "ll-hidden--scoped" : null
1094
- ].filter(Boolean).join(" "), le = D === null ? void 0 : { top: `${D - g / 2}px`, transform: "none" };
1094
+ ].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P - g / 2}px`, transform: "none" };
1095
1095
  return /* @__PURE__ */ r(
1096
1096
  "button",
1097
1097
  {
1098
1098
  type: "button",
1099
- className: J,
1099
+ className: Z,
1100
1100
  onPointerDown: b,
1101
1101
  onPointerMove: O,
1102
1102
  onPointerUp: v,
@@ -1105,15 +1105,15 @@ const bi = ({
1105
1105
  onKeyDown: B,
1106
1106
  "aria-label": l,
1107
1107
  "data-position": e,
1108
- style: le,
1108
+ style: ae,
1109
1109
  children: p ? (
1110
1110
  // Layout: tiny chevron flush against the inward edge (peeks out
1111
1111
  // as the click affordance), then the circular avatar photo
1112
1112
  // taking the rest of the tab. Reinforces "this is an
1113
1113
  // avatar-based experience" even when collapsed.
1114
- /* @__PURE__ */ S(Ve, { children: [
1114
+ /* @__PURE__ */ S(Xe, { children: [
1115
1115
  /* @__PURE__ */ r(
1116
- zn,
1116
+ qn,
1117
1117
  {
1118
1118
  direction: d,
1119
1119
  className: "ll-hidden__chevron ll-hidden__chevron--mini"
@@ -1130,7 +1130,7 @@ const bi = ({
1130
1130
  )
1131
1131
  ] })
1132
1132
  ) : /* @__PURE__ */ r(
1133
- zn,
1133
+ qn,
1134
1134
  {
1135
1135
  direction: d,
1136
1136
  className: "ll-hidden__chevron"
@@ -1138,7 +1138,7 @@ const bi = ({
1138
1138
  )
1139
1139
  }
1140
1140
  );
1141
- }, wi = ({
1141
+ }, Ni = ({
1142
1142
  audioLevel: e,
1143
1143
  bars: t = 20,
1144
1144
  maxHeight: n = 20,
@@ -1146,16 +1146,16 @@ const bi = ({
1146
1146
  className: l,
1147
1147
  barClassName: o
1148
1148
  }) => {
1149
- const s = R(null), a = R([]), c = at(() => {
1149
+ const s = R(null), a = R([]), c = ut(() => {
1150
1150
  const g = (Math.sqrt(5) - 1) / 2;
1151
1151
  return Array.from({ length: t }, (p, m) => 0.5 + m * g % 1 * 0.5);
1152
1152
  }, [t]);
1153
- I(() => e.subscribe((p) => {
1153
+ T(() => e.subscribe((p) => {
1154
1154
  for (let m = 0; m < t; m++) {
1155
- const D = a.current[m];
1156
- if (!D) continue;
1155
+ const P = a.current[m];
1156
+ if (!P) continue;
1157
1157
  const x = Math.max(i, p * n * c[m]);
1158
- D.style.height = `${x}px`;
1158
+ P.style.height = `${x}px`;
1159
1159
  }
1160
1160
  }), [e, t, n, i, c]);
1161
1161
  const d = ["ll-waveform", l].filter(Boolean).join(" ");
@@ -1170,7 +1170,7 @@ const bi = ({
1170
1170
  },
1171
1171
  p
1172
1172
  )) });
1173
- }, _i = ({
1173
+ }, Mi = ({
1174
1174
  position: e,
1175
1175
  isMobile: t,
1176
1176
  agentName: n,
@@ -1207,7 +1207,7 @@ const bi = ({
1207
1207
  )
1208
1208
  ) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
1209
1209
  /* @__PURE__ */ r(
1210
- wi,
1210
+ Ni,
1211
1211
  {
1212
1212
  audioLevel: s,
1213
1213
  bars: 16,
@@ -1230,10 +1230,10 @@ const bi = ({
1230
1230
  (g.key === "Enter" || g.key === " ") && (g.stopPropagation(), g.preventDefault(), c());
1231
1231
  },
1232
1232
  "aria-label": o ? "Unmute microphone" : "Mute microphone",
1233
- children: /* @__PURE__ */ r(Pn, { muted: o, className: "ll-minimized__icon" })
1233
+ children: /* @__PURE__ */ r(Bn, { muted: o, className: "ll-minimized__icon" })
1234
1234
  }
1235
1235
  ),
1236
- /* @__PURE__ */ r(Dn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
1236
+ /* @__PURE__ */ r(Wn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
1237
1237
  ] })
1238
1238
  ]
1239
1239
  }
@@ -1270,7 +1270,7 @@ const bi = ({
1270
1270
  className: "ll-minimized__btn",
1271
1271
  onClick: c,
1272
1272
  "aria-label": o ? "Unmute microphone" : "Mute microphone",
1273
- children: /* @__PURE__ */ r(Pn, { muted: o, className: "ll-minimized__icon" })
1273
+ children: /* @__PURE__ */ r(Bn, { muted: o, className: "ll-minimized__icon" })
1274
1274
  }
1275
1275
  ),
1276
1276
  /* @__PURE__ */ r(
@@ -1280,7 +1280,7 @@ const bi = ({
1280
1280
  className: "ll-minimized__btn",
1281
1281
  onClick: a,
1282
1282
  "aria-label": `Expand ${n} widget`,
1283
- children: /* @__PURE__ */ r(Dn, { className: "ll-minimized__icon" })
1283
+ children: /* @__PURE__ */ r(Wn, { className: "ll-minimized__icon" })
1284
1284
  }
1285
1285
  ),
1286
1286
  /* @__PURE__ */ r(
@@ -1290,13 +1290,13 @@ const bi = ({
1290
1290
  className: "ll-minimized__btn ll-minimized__btn--close",
1291
1291
  onClick: d,
1292
1292
  "aria-label": "Close widget",
1293
- children: /* @__PURE__ */ r(hi, { className: "ll-minimized__icon" })
1293
+ children: /* @__PURE__ */ r(Ci, { className: "ll-minimized__icon" })
1294
1294
  }
1295
1295
  )
1296
1296
  ] })
1297
1297
  ] })
1298
1298
  }
1299
- ), xi = ({
1299
+ ), Ii = ({
1300
1300
  src: e,
1301
1301
  alt: t,
1302
1302
  preCannedPlaying: n = !1,
@@ -1304,7 +1304,7 @@ const bi = ({
1304
1304
  style: l
1305
1305
  }) => {
1306
1306
  const [o, s] = M(!1), a = R(e);
1307
- if (I(() => {
1307
+ if (T(() => {
1308
1308
  a.current !== e && (a.current = e, s(!1));
1309
1309
  }, [e]), !e) return null;
1310
1310
  const c = {
@@ -1334,11 +1334,11 @@ const bi = ({
1334
1334
  }
1335
1335
  )
1336
1336
  );
1337
- }, ki = "#E06540";
1338
- function Li({
1337
+ }, Ti = "#E06540";
1338
+ function Ri({
1339
1339
  size: e = 14,
1340
1340
  className: t,
1341
- fill: n = ki
1341
+ fill: n = Ti
1342
1342
  }) {
1343
1343
  return /* @__PURE__ */ S(
1344
1344
  "svg",
@@ -1376,14 +1376,14 @@ function Li({
1376
1376
  }
1377
1377
  );
1378
1378
  }
1379
- const Ci = 8, On = 8, Si = ({
1379
+ const Di = 8, Vn = 8, Pi = ({
1380
1380
  open: e,
1381
1381
  onClose: t,
1382
1382
  anchorRef: n,
1383
1383
  children: i
1384
1384
  }) => {
1385
1385
  const l = R(null), [o, s] = M(null);
1386
- return er(() => {
1386
+ return ar(() => {
1387
1387
  if (!e) {
1388
1388
  s(null);
1389
1389
  return;
@@ -1392,15 +1392,15 @@ const Ci = 8, On = 8, Si = ({
1392
1392
  if (!a) return;
1393
1393
  const c = () => {
1394
1394
  const d = a.getBoundingClientRect(), g = {
1395
- top: d.top - Ci,
1395
+ top: d.top - Di,
1396
1396
  left: d.left + d.width / 2
1397
- }, p = On + 90, m = window.innerWidth - On - 90;
1397
+ }, p = Vn + 90, m = window.innerWidth - Vn - 90;
1398
1398
  g.left < p && (g.left = p), g.left > m && (g.left = m), s(g);
1399
1399
  };
1400
1400
  return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
1401
1401
  window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
1402
1402
  };
1403
- }, [e, n]), I(() => {
1403
+ }, [e, n]), T(() => {
1404
1404
  if (!e) return;
1405
1405
  const a = (d) => {
1406
1406
  const g = d.target, p = l.current, m = n.current;
@@ -1411,7 +1411,7 @@ const Ci = 8, On = 8, Si = ({
1411
1411
  return document.addEventListener("mousedown", a), document.addEventListener("keydown", c), () => {
1412
1412
  document.removeEventListener("mousedown", a), document.removeEventListener("keydown", c);
1413
1413
  };
1414
- }, [e, t, n]), !e || o === null || typeof document > "u" ? null : ln(
1414
+ }, [e, t, n]), !e || o === null || typeof document > "u" ? null : dn(
1415
1415
  /* @__PURE__ */ r(
1416
1416
  "div",
1417
1417
  {
@@ -1431,7 +1431,7 @@ const Ci = 8, On = 8, Si = ({
1431
1431
  ),
1432
1432
  document.body
1433
1433
  );
1434
- }, Ei = ({
1434
+ }, zi = ({
1435
1435
  isMuted: e,
1436
1436
  onToggleMute: t,
1437
1437
  isCameraEnabled: n,
@@ -1445,10 +1445,10 @@ const Ci = 8, On = 8, Si = ({
1445
1445
  allowTyping: g,
1446
1446
  isTypingOpen: p,
1447
1447
  onToggleTyping: m,
1448
- onDisconnect: D
1448
+ onDisconnect: P
1449
1449
  }) => {
1450
- const [x, C] = M(!1), y = R(null);
1451
- return /* @__PURE__ */ S(Ve, { children: [
1450
+ const [x, L] = M(!1), y = R(null);
1451
+ return /* @__PURE__ */ S(Xe, { children: [
1452
1452
  /* @__PURE__ */ S(
1453
1453
  "div",
1454
1454
  {
@@ -1463,7 +1463,7 @@ const Ci = 8, On = 8, Si = ({
1463
1463
  className: `ll-tool ${e ? "is-muted" : ""}`,
1464
1464
  onClick: t,
1465
1465
  "aria-label": e ? "Unmute microphone" : "Mute microphone",
1466
- children: /* @__PURE__ */ r(ar, { muted: e })
1466
+ children: /* @__PURE__ */ r(hr, { muted: e })
1467
1467
  }
1468
1468
  ),
1469
1469
  /* @__PURE__ */ r(
@@ -1472,11 +1472,11 @@ const Ci = 8, On = 8, Si = ({
1472
1472
  ref: y,
1473
1473
  type: "button",
1474
1474
  className: `ll-tool ${x ? "is-on" : ""}`,
1475
- onClick: () => C((w) => !w),
1475
+ onClick: () => L((w) => !w),
1476
1476
  "aria-label": "More controls",
1477
1477
  "aria-haspopup": "menu",
1478
1478
  "aria-expanded": x,
1479
- children: /* @__PURE__ */ r(Ai, {})
1479
+ children: /* @__PURE__ */ r($i, {})
1480
1480
  }
1481
1481
  ),
1482
1482
  /* @__PURE__ */ r(
@@ -1484,19 +1484,19 @@ const Ci = 8, On = 8, Si = ({
1484
1484
  {
1485
1485
  type: "button",
1486
1486
  className: "ll-tool ll-tool--danger",
1487
- onClick: D,
1487
+ onClick: P,
1488
1488
  "aria-label": "End conversation",
1489
- children: /* @__PURE__ */ r(cr, {})
1489
+ children: /* @__PURE__ */ r(gr, {})
1490
1490
  }
1491
1491
  )
1492
1492
  ]
1493
1493
  }
1494
1494
  ),
1495
1495
  /* @__PURE__ */ S(
1496
- Si,
1496
+ Pi,
1497
1497
  {
1498
1498
  open: x,
1499
- onClose: () => C(!1),
1499
+ onClose: () => L(!1),
1500
1500
  anchorRef: y,
1501
1501
  children: [
1502
1502
  l && /* @__PURE__ */ S(
@@ -1505,10 +1505,10 @@ const Ci = 8, On = 8, Si = ({
1505
1505
  type: "button",
1506
1506
  className: `ll-overflow-popover__item ${n ? "is-on" : ""}`,
1507
1507
  onClick: () => {
1508
- i(), C(!1);
1508
+ i(), L(!1);
1509
1509
  },
1510
1510
  children: [
1511
- /* @__PURE__ */ r(lr, {}),
1511
+ /* @__PURE__ */ r(pr, {}),
1512
1512
  /* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
1513
1513
  ]
1514
1514
  }
@@ -1519,10 +1519,10 @@ const Ci = 8, On = 8, Si = ({
1519
1519
  type: "button",
1520
1520
  className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
1521
1521
  onClick: () => {
1522
- s(), C(!1);
1522
+ s(), L(!1);
1523
1523
  },
1524
1524
  children: [
1525
- /* @__PURE__ */ r(or, {}),
1525
+ /* @__PURE__ */ r(fr, {}),
1526
1526
  /* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
1527
1527
  ]
1528
1528
  }
@@ -1533,10 +1533,10 @@ const Ci = 8, On = 8, Si = ({
1533
1533
  type: "button",
1534
1534
  className: `ll-overflow-popover__item ${c ? "is-on" : ""}`,
1535
1535
  onClick: () => {
1536
- d(), C(!1);
1536
+ d(), L(!1);
1537
1537
  },
1538
1538
  children: [
1539
- /* @__PURE__ */ r(sr, { muted: c }),
1539
+ /* @__PURE__ */ r(mr, { muted: c }),
1540
1540
  /* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
1541
1541
  ]
1542
1542
  }
@@ -1547,10 +1547,10 @@ const Ci = 8, On = 8, Si = ({
1547
1547
  type: "button",
1548
1548
  className: `ll-overflow-popover__item ${p ? "is-on" : ""}`,
1549
1549
  onClick: () => {
1550
- m(), C(!1);
1550
+ m(), L(!1);
1551
1551
  },
1552
1552
  children: [
1553
- /* @__PURE__ */ r(Ni, {}),
1553
+ /* @__PURE__ */ r(Hi, {}),
1554
1554
  /* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
1555
1555
  ]
1556
1556
  }
@@ -1573,7 +1573,7 @@ const Ci = 8, On = 8, Si = ({
1573
1573
  )
1574
1574
  ] });
1575
1575
  };
1576
- function Ai() {
1576
+ function $i() {
1577
1577
  return /* @__PURE__ */ S(
1578
1578
  "svg",
1579
1579
  {
@@ -1590,7 +1590,7 @@ function Ai() {
1590
1590
  }
1591
1591
  );
1592
1592
  }
1593
- function Ni() {
1593
+ function Hi() {
1594
1594
  return /* @__PURE__ */ r(
1595
1595
  "svg",
1596
1596
  {
@@ -1607,7 +1607,7 @@ function Ni() {
1607
1607
  }
1608
1608
  );
1609
1609
  }
1610
- const Mi = ({
1610
+ const Oi = ({
1611
1611
  position: e,
1612
1612
  isMobile: t,
1613
1613
  agentName: n,
@@ -1621,145 +1621,145 @@ const Mi = ({
1621
1621
  teamSwitcherOpen: g,
1622
1622
  onToggleTeamSwitcher: p,
1623
1623
  onSelectTeamMember: m,
1624
- languageMenuOpen: D,
1624
+ languageMenuOpen: P,
1625
1625
  onToggleLanguageMenu: x,
1626
- connectionState: C,
1626
+ connectionState: L,
1627
1627
  agentState: y,
1628
1628
  transcript: w,
1629
- canResume: P,
1629
+ canResume: D,
1630
1630
  needsUserGesture: E,
1631
1631
  error: b,
1632
1632
  isMuted: O,
1633
1633
  micError: v,
1634
1634
  micDevices: z,
1635
1635
  activeMicId: B,
1636
- isCameraEnabled: J,
1637
- cameraPreviewEl: le,
1636
+ isCameraEnabled: Z,
1637
+ cameraPreviewEl: ae,
1638
1638
  cameraDevices: H,
1639
- activeCameraId: G,
1639
+ activeCameraId: X,
1640
1640
  isScreenShareEnabled: f,
1641
- screenPreviewEl: A,
1641
+ screenPreviewEl: N,
1642
1642
  isSpeakerMuted: $,
1643
- allowCamera: q,
1644
- allowScreenShare: X,
1645
- allowTyping: te,
1643
+ allowCamera: U,
1644
+ allowScreenShare: K,
1645
+ allowTyping: re,
1646
1646
  showMinimize: W = !0,
1647
- showClose: ne = !0,
1648
- chromeless: ie = !1,
1649
- compactControls: U = !1,
1647
+ showClose: ie = !0,
1648
+ chromeless: le = !1,
1649
+ compactControls: j = !1,
1650
1650
  transforming: ge,
1651
- transformingLabel: Z,
1651
+ transformingLabel: Q,
1652
1652
  avatarVideoContainerRef: Le,
1653
- agentVideoEl: re,
1654
- onConnect: Me,
1655
- onDisconnect: st,
1656
- onRetry: _t,
1657
- onResumeAudio: xt,
1658
- onToggleMute: ct,
1659
- onSwitchMicDevice: kt,
1660
- onToggleCamera: Ye,
1661
- onSwitchCameraDevice: Ge,
1662
- onToggleScreenShare: $e,
1663
- onToggleSpeaker: He,
1664
- onSendMessage: Oe,
1665
- onMinimize: Fe,
1666
- onClose: Be,
1667
- onClearMicError: Xe,
1668
- dragHandleProps: We,
1653
+ agentVideoEl: oe,
1654
+ onConnect: Ie,
1655
+ onDisconnect: dt,
1656
+ onRetry: kt,
1657
+ onResumeAudio: Lt,
1658
+ onToggleMute: ft,
1659
+ onSwitchMicDevice: St,
1660
+ onToggleCamera: Ke,
1661
+ onSwitchCameraDevice: Je,
1662
+ onToggleScreenShare: Fe,
1663
+ onToggleSpeaker: Be,
1664
+ onSendMessage: We,
1665
+ onMinimize: qe,
1666
+ onClose: Ue,
1667
+ onClearMicError: Ze,
1668
+ dragHandleProps: je,
1669
1669
  resizeHandleProps: F
1670
1670
  }) => {
1671
- var et;
1672
- const qe = ((a == null ? void 0 : a.length) ?? 0) > 1, Ke = C === "connecting" || C === "connected", Ce = C === "connected", Lt = C === "idle" || C === "disconnected" || C === "error", [ut, Ie] = M(!1);
1673
- I(() => {
1674
- if (!re) {
1675
- Ie(!1);
1671
+ var rt;
1672
+ const Ve = ((a == null ? void 0 : a.length) ?? 0) > 1, Qe = L === "connecting" || L === "connected", Se = L === "connected", Et = L === "idle" || L === "disconnected" || L === "error", [pt, Te] = M(!1);
1673
+ T(() => {
1674
+ if (!oe) {
1675
+ Te(!1);
1676
1676
  return;
1677
1677
  }
1678
- if (!re.paused && re.readyState >= 2) {
1679
- Ie(!0);
1678
+ if (!oe.paused && oe.readyState >= 2) {
1679
+ Te(!0);
1680
1680
  return;
1681
1681
  }
1682
- Ie(!1);
1683
- const k = () => Ie(!0);
1684
- return re.addEventListener("playing", k), re.addEventListener("loadeddata", k), () => {
1685
- re.removeEventListener("playing", k), re.removeEventListener("loadeddata", k);
1682
+ Te(!1);
1683
+ const C = () => Te(!0);
1684
+ return oe.addEventListener("playing", C), oe.addEventListener("loadeddata", C), () => {
1685
+ oe.removeEventListener("playing", C), oe.removeEventListener("loadeddata", C);
1686
1686
  };
1687
- }, [re]);
1688
- const [dt, Ct] = M(!1);
1689
- I(() => {
1690
- y === "speaking" && Ct(!0);
1691
- }, [y]), I(() => {
1692
- (C === "disconnected" || C === "idle") && Ct(!1);
1693
- }, [C]);
1694
- const [Ue, ue] = M(!1);
1695
- I(() => {
1696
- if (!Ce) {
1697
- ue(!1);
1687
+ }, [oe]);
1688
+ const [ht, At] = M(!1);
1689
+ T(() => {
1690
+ y === "speaking" && At(!0);
1691
+ }, [y]), T(() => {
1692
+ (L === "disconnected" || L === "idle") && At(!1);
1693
+ }, [L]);
1694
+ const [Ye, fe] = M(!1);
1695
+ T(() => {
1696
+ if (!Se) {
1697
+ fe(!1);
1698
1698
  return;
1699
1699
  }
1700
- if (dt) return;
1701
- const k = setTimeout(() => ue(!0), 12e3);
1702
- return () => clearTimeout(k);
1703
- }, [Ce, dt]);
1704
- const St = C === "connecting" || Ce && !dt && !Ue, de = R(null), ve = R(null);
1705
- I(() => {
1706
- const k = de.current;
1707
- k && (k.innerHTML = "", le && (le.style.width = "100%", le.style.height = "100%", le.style.objectFit = "cover", le.style.transform = "scaleX(-1)", k.appendChild(le)));
1708
- }, [le]), I(() => {
1709
- const k = ve.current;
1710
- k && (k.innerHTML = "", A && (A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "contain", k.appendChild(A)));
1711
- }, [A]);
1712
- const [Je, Ze] = M(!1), [pe, be] = M(!1), Et = R(null), At = R(null);
1713
- I(() => {
1714
- if (!Je && !pe && !D && !g) return;
1715
- const k = () => {
1716
- Ze(!1), be(!1), D && x(), g && p();
1700
+ if (ht) return;
1701
+ const C = setTimeout(() => fe(!0), 12e3);
1702
+ return () => clearTimeout(C);
1703
+ }, [Se, ht]);
1704
+ const Nt = L === "connecting" || Se && !ht && !Ye, pe = R(null), be = R(null);
1705
+ T(() => {
1706
+ const C = pe.current;
1707
+ C && (C.innerHTML = "", ae && (ae.style.width = "100%", ae.style.height = "100%", ae.style.objectFit = "cover", ae.style.transform = "scaleX(-1)", C.appendChild(ae)));
1708
+ }, [ae]), T(() => {
1709
+ const C = be.current;
1710
+ C && (C.innerHTML = "", N && (N.style.width = "100%", N.style.height = "100%", N.style.objectFit = "contain", C.appendChild(N)));
1711
+ }, [N]);
1712
+ const [et, tt] = M(!1), [me, we] = M(!1), Mt = R(null), It = R(null);
1713
+ T(() => {
1714
+ if (!et && !me && !P && !g) return;
1715
+ const C = () => {
1716
+ tt(!1), we(!1), P && x(), g && p();
1717
1717
  };
1718
- return document.addEventListener("click", k), () => document.removeEventListener("click", k);
1718
+ return document.addEventListener("click", C), () => document.removeEventListener("click", C);
1719
1719
  }, [
1720
- Je,
1721
- pe,
1722
- D,
1720
+ et,
1721
+ me,
1722
+ P,
1723
1723
  g,
1724
1724
  x,
1725
1725
  p
1726
1726
  ]);
1727
- const [Nt, an] = M(!1), sn = L(() => an((k) => !k), []), [_e, Re] = M(""), Ae = L(
1728
- (k) => {
1729
- k.preventDefault();
1730
- const ae = _e.trim();
1731
- ae && (Oe(ae), Re(""));
1727
+ const [Tt, fn] = M(!1), pn = k(() => fn((C) => !C), []), [xe, Re] = M(""), Ne = k(
1728
+ (C) => {
1729
+ C.preventDefault();
1730
+ const se = xe.trim();
1731
+ se && (We(se), Re(""));
1732
1732
  },
1733
- [_e, Oe]
1734
- ), Te = s.productName || "Live Layer", ft = !s.productName;
1735
- let Pe = null, Se = null;
1736
- for (let k = w.length - 1; k >= 0; k--) {
1737
- const ae = w[k];
1738
- if (!Pe && ae.role === "agent" ? Pe = ae : !Se && ae.role === "user" && (Se = ae), Pe && Se) break;
1733
+ [xe, We]
1734
+ ), De = s.productName || "Live Layer", mt = !s.productName;
1735
+ let Pe = null, Ee = null;
1736
+ for (let C = w.length - 1; C >= 0; C--) {
1737
+ const se = w[C];
1738
+ if (!Pe && se.role === "agent" ? Pe = se : !Ee && se.role === "user" && (Ee = se), Pe && Ee) break;
1739
1739
  }
1740
- const Qe = Ce ? (Pe == null ? void 0 : Pe.text) || null : o || null, pt = Ce && (Se == null ? void 0 : Se.text) || null, ht = [
1740
+ const nt = Se ? (Pe == null ? void 0 : Pe.text) || null : o || null, gt = Se && (Ee == null ? void 0 : Ee.text) || null, yt = [
1741
1741
  "ll-expanded",
1742
1742
  t ? "ll-expanded--mobile" : "ll-expanded--desktop"
1743
1743
  ].join(" ");
1744
1744
  return /* @__PURE__ */ S(
1745
1745
  "div",
1746
1746
  {
1747
- className: ht,
1747
+ className: yt,
1748
1748
  "data-position": e,
1749
- "data-state": Ce ? "connected" : Ke ? "connecting" : "idle",
1749
+ "data-state": Se ? "connected" : Qe ? "connecting" : "idle",
1750
1750
  role: "dialog",
1751
1751
  "aria-label": `${n} widget`,
1752
1752
  children: [
1753
1753
  /* @__PURE__ */ S("div", { className: "ll-expanded__bg", children: [
1754
1754
  i ? /* @__PURE__ */ r(
1755
- xi,
1755
+ Ii,
1756
1756
  {
1757
1757
  src: i,
1758
1758
  alt: n,
1759
1759
  className: "ll-expanded__bg-img"
1760
1760
  }
1761
- ) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((et = n == null ? void 0 : n.charAt(0)) == null ? void 0 : et.toUpperCase()) || "A" }) }),
1762
- l && !Ce && /* @__PURE__ */ r(
1761
+ ) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((rt = n == null ? void 0 : n.charAt(0)) == null ? void 0 : rt.toUpperCase()) || "A" }) }),
1762
+ l && !Se && /* @__PURE__ */ r(
1763
1763
  "video",
1764
1764
  {
1765
1765
  className: "ll-expanded__bg-idle",
@@ -1776,19 +1776,19 @@ const Mi = ({
1776
1776
  {
1777
1777
  ref: Le,
1778
1778
  className: "ll-expanded__video",
1779
- "data-ready": ut
1779
+ "data-ready": pt
1780
1780
  }
1781
1781
  ),
1782
- St && /* @__PURE__ */ S("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1782
+ Nt && /* @__PURE__ */ S("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
1783
1783
  /* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
1784
1784
  /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: d ? "Switching..." : "Connecting..." })
1785
1785
  ] }),
1786
- E && Ce && /* @__PURE__ */ S(
1786
+ E && Se && /* @__PURE__ */ S(
1787
1787
  "button",
1788
1788
  {
1789
1789
  type: "button",
1790
1790
  className: "ll-expanded__overlay ll-expanded__overlay--gesture",
1791
- onClick: xt,
1791
+ onClick: Lt,
1792
1792
  children: [
1793
1793
  /* @__PURE__ */ r("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
1794
1794
  /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
@@ -1801,61 +1801,61 @@ const Mi = ({
1801
1801
  className: "ll-expanded__overlay ll-expanded__overlay--transforming",
1802
1802
  role: "status",
1803
1803
  "aria-live": "polite",
1804
- "aria-label": Z,
1804
+ "aria-label": Q,
1805
1805
  children: [
1806
1806
  /* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
1807
- /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: Z })
1807
+ /* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: Q })
1808
1808
  ]
1809
1809
  }
1810
1810
  ),
1811
- Ke ? /* @__PURE__ */ S(Ve, { children: [
1812
- !U && /* @__PURE__ */ S("div", { className: "ll-expanded__topbar", ...We, children: [
1813
- !ie && /* @__PURE__ */ S("div", { className: "ll-expanded__topbar-left", children: [
1811
+ Qe ? /* @__PURE__ */ S(Xe, { children: [
1812
+ !j && /* @__PURE__ */ S("div", { className: "ll-expanded__topbar", ...je, children: [
1813
+ !le && /* @__PURE__ */ S("div", { className: "ll-expanded__topbar-left", children: [
1814
1814
  /* @__PURE__ */ S("div", { className: "ll-expanded__pill-wrap", children: [
1815
1815
  /* @__PURE__ */ S(
1816
1816
  "button",
1817
1817
  {
1818
1818
  type: "button",
1819
1819
  className: "ll-hpill",
1820
- onClick: (k) => {
1821
- qe && (k.stopPropagation(), p());
1820
+ onClick: (C) => {
1821
+ Ve && (C.stopPropagation(), p());
1822
1822
  },
1823
- "aria-haspopup": qe ? "listbox" : void 0,
1824
- "aria-expanded": qe ? g : void 0,
1823
+ "aria-haspopup": Ve ? "listbox" : void 0,
1824
+ "aria-expanded": Ve ? g : void 0,
1825
1825
  children: [
1826
1826
  /* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
1827
- qe && /* @__PURE__ */ r(Ot, {})
1827
+ Ve && /* @__PURE__ */ r(qt, {})
1828
1828
  ]
1829
1829
  }
1830
1830
  ),
1831
- qe && g && /* @__PURE__ */ r(
1831
+ Ve && g && /* @__PURE__ */ r(
1832
1832
  "div",
1833
1833
  {
1834
1834
  className: "ll-hmenu",
1835
- onClick: (k) => k.stopPropagation(),
1835
+ onClick: (C) => C.stopPropagation(),
1836
1836
  role: "listbox",
1837
- children: a == null ? void 0 : a.map((k) => /* @__PURE__ */ S(
1837
+ children: a == null ? void 0 : a.map((C) => /* @__PURE__ */ S(
1838
1838
  "button",
1839
1839
  {
1840
1840
  type: "button",
1841
- className: `ll-hmenu__item ${k.id === c ? "is-active" : ""}`,
1842
- onClick: () => m(k.id),
1841
+ className: `ll-hmenu__item ${C.id === c ? "is-active" : ""}`,
1842
+ onClick: () => m(C.id),
1843
1843
  role: "option",
1844
- "aria-selected": k.id === c,
1844
+ "aria-selected": C.id === c,
1845
1845
  children: [
1846
- k.avatarImageUrl && /* @__PURE__ */ r(
1846
+ C.avatarImageUrl && /* @__PURE__ */ r(
1847
1847
  "img",
1848
1848
  {
1849
- src: k.avatarImageUrl,
1849
+ src: C.avatarImageUrl,
1850
1850
  alt: "",
1851
1851
  className: "ll-hmenu__avatar"
1852
1852
  }
1853
1853
  ),
1854
- /* @__PURE__ */ r("span", { className: "ll-hmenu__name", children: k.name }),
1855
- k.role && /* @__PURE__ */ r("span", { className: "ll-hmenu__role", children: k.role })
1854
+ /* @__PURE__ */ r("span", { className: "ll-hmenu__name", children: C.name }),
1855
+ C.role && /* @__PURE__ */ r("span", { className: "ll-hmenu__role", children: C.role })
1856
1856
  ]
1857
1857
  },
1858
- k.id
1858
+ C.id
1859
1859
  ))
1860
1860
  }
1861
1861
  )
@@ -1866,24 +1866,24 @@ const Mi = ({
1866
1866
  {
1867
1867
  type: "button",
1868
1868
  className: "ll-hpill ll-hpill--compact",
1869
- onClick: (k) => {
1870
- k.stopPropagation(), x();
1869
+ onClick: (C) => {
1870
+ C.stopPropagation(), x();
1871
1871
  },
1872
1872
  "aria-haspopup": "listbox",
1873
- "aria-expanded": D,
1873
+ "aria-expanded": P,
1874
1874
  "aria-label": "Language: English",
1875
1875
  title: "Language: English",
1876
1876
  children: [
1877
1877
  /* @__PURE__ */ r("span", { className: "ll-hpill__label", children: "EN" }),
1878
- /* @__PURE__ */ r(Ot, {})
1878
+ /* @__PURE__ */ r(qt, {})
1879
1879
  ]
1880
1880
  }
1881
1881
  ),
1882
- D && /* @__PURE__ */ r(
1882
+ P && /* @__PURE__ */ r(
1883
1883
  "div",
1884
1884
  {
1885
1885
  className: "ll-hmenu",
1886
- onClick: (k) => k.stopPropagation(),
1886
+ onClick: (C) => C.stopPropagation(),
1887
1887
  role: "listbox",
1888
1888
  children: /* @__PURE__ */ r(
1889
1889
  "button",
@@ -1912,26 +1912,26 @@ const Mi = ({
1912
1912
  {
1913
1913
  type: "button",
1914
1914
  className: "ll-hbtn",
1915
- onClick: Fe,
1915
+ onClick: qe,
1916
1916
  "aria-label": "Minimize widget",
1917
1917
  title: "Minimize",
1918
- children: /* @__PURE__ */ r(Bn, {})
1918
+ children: /* @__PURE__ */ r(Gn, {})
1919
1919
  }
1920
1920
  ),
1921
- ne !== !1 && /* @__PURE__ */ r(
1921
+ ie !== !1 && /* @__PURE__ */ r(
1922
1922
  "button",
1923
1923
  {
1924
1924
  type: "button",
1925
1925
  className: "ll-hbtn ll-hbtn--danger",
1926
- onClick: Be,
1926
+ onClick: Ue,
1927
1927
  "aria-label": "End call",
1928
1928
  title: "End call",
1929
- children: /* @__PURE__ */ r(Fn, {})
1929
+ children: /* @__PURE__ */ r(Yn, {})
1930
1930
  }
1931
1931
  )
1932
1932
  ] })
1933
1933
  ] }),
1934
- U && /* @__PURE__ */ S("div", { className: "ll-compact-status", "data-state": y, children: [
1934
+ j && /* @__PURE__ */ S("div", { className: "ll-compact-status", "data-state": y, children: [
1935
1935
  /* @__PURE__ */ r("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
1936
1936
  /* @__PURE__ */ r("span", { className: "ll-compact-status__label", children: y })
1937
1937
  ] })
@@ -1944,8 +1944,8 @@ const Mi = ({
1944
1944
  // can always dismiss; making the whole header disappear (the
1945
1945
  // pre-0.18.0 behavior) left users no way out short of scrolling
1946
1946
  // the page itself.
1947
- /* @__PURE__ */ S("div", { className: "ll-expanded__header ll-expanded__header--idle", ...We, children: [
1948
- !U && (ft ? /* @__PURE__ */ S(
1947
+ /* @__PURE__ */ S("div", { className: "ll-expanded__header ll-expanded__header--idle", ...je, children: [
1948
+ !j && (mt ? /* @__PURE__ */ S(
1949
1949
  "a",
1950
1950
  {
1951
1951
  className: "ll-expanded__brand ll-expanded__brand--link",
@@ -1955,61 +1955,61 @@ const Mi = ({
1955
1955
  "aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
1956
1956
  title: "Powered by LiveLayer — visit livelayer.studio",
1957
1957
  children: [
1958
- /* @__PURE__ */ r(Li, { size: 14, className: "ll-expanded__brand-mark" }),
1959
- /* @__PURE__ */ r("span", { children: Te })
1958
+ /* @__PURE__ */ r(Ri, { size: 14, className: "ll-expanded__brand-mark" }),
1959
+ /* @__PURE__ */ r("span", { children: De })
1960
1960
  ]
1961
1961
  }
1962
- ) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children: Te })),
1962
+ ) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children: De })),
1963
1963
  /* @__PURE__ */ S("div", { className: "ll-expanded__header-actions", children: [
1964
- !U && W !== !1 && /* @__PURE__ */ r(
1964
+ !j && W !== !1 && /* @__PURE__ */ r(
1965
1965
  "button",
1966
1966
  {
1967
1967
  type: "button",
1968
1968
  className: "ll-hbtn ll-hbtn--ghost",
1969
- onClick: Fe,
1969
+ onClick: qe,
1970
1970
  "aria-label": "Minimize widget",
1971
- children: /* @__PURE__ */ r(Bn, {})
1971
+ children: /* @__PURE__ */ r(Gn, {})
1972
1972
  }
1973
1973
  ),
1974
- ne !== !1 && /* @__PURE__ */ r(
1974
+ ie !== !1 && /* @__PURE__ */ r(
1975
1975
  "button",
1976
1976
  {
1977
1977
  type: "button",
1978
1978
  className: "ll-hbtn ll-hbtn--danger",
1979
- onClick: Be,
1979
+ onClick: Ue,
1980
1980
  "aria-label": "Close widget",
1981
- children: /* @__PURE__ */ r(Fn, {})
1981
+ children: /* @__PURE__ */ r(Yn, {})
1982
1982
  }
1983
1983
  )
1984
1984
  ] })
1985
1985
  ] })
1986
1986
  ),
1987
- Lt && /* @__PURE__ */ (() => {
1988
- const k = P ? "Resume session" : C === "disconnected" ? "Reconnect to agent" : "Start video call";
1989
- return /* @__PURE__ */ S(Ve, { children: [
1987
+ Et && /* @__PURE__ */ (() => {
1988
+ const C = D ? "Resume session" : L === "disconnected" ? "Reconnect to agent" : "Start video call";
1989
+ return /* @__PURE__ */ S(Xe, { children: [
1990
1990
  !b && /* @__PURE__ */ S(
1991
1991
  "button",
1992
1992
  {
1993
1993
  type: "button",
1994
1994
  className: "ll-expanded__play",
1995
- onClick: Me,
1996
- "aria-label": k,
1995
+ onClick: Ie,
1996
+ "aria-label": C,
1997
1997
  children: [
1998
1998
  /* @__PURE__ */ r("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ r("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
1999
- U && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children: k })
1999
+ j && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children: C })
2000
2000
  ]
2001
2001
  }
2002
2002
  ),
2003
- !U && /* @__PURE__ */ S("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
2003
+ !j && /* @__PURE__ */ S("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
2004
2004
  o && /* @__PURE__ */ r("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: o }) }),
2005
2005
  /* @__PURE__ */ r(
2006
2006
  "button",
2007
2007
  {
2008
2008
  type: "button",
2009
2009
  className: "ll-expanded__cta",
2010
- onClick: Me,
2011
- "aria-label": k,
2012
- children: k
2010
+ onClick: Ie,
2011
+ "aria-label": C,
2012
+ children: C
2013
2013
  }
2014
2014
  )
2015
2015
  ] })
@@ -2018,90 +2018,90 @@ const Mi = ({
2018
2018
  /* @__PURE__ */ S(
2019
2019
  "div",
2020
2020
  {
2021
- className: `ll-expanded__pip ${Ke && (J || f) ? "is-visible" : ""}`,
2021
+ className: `ll-expanded__pip ${Qe && (Z || f) ? "is-visible" : ""}`,
2022
2022
  children: [
2023
2023
  /* @__PURE__ */ r(
2024
2024
  "div",
2025
2025
  {
2026
- ref: ve,
2026
+ ref: be,
2027
2027
  className: f ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
2028
2028
  }
2029
2029
  ),
2030
2030
  /* @__PURE__ */ r(
2031
2031
  "div",
2032
2032
  {
2033
- ref: de,
2034
- className: !f && J ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
2033
+ ref: pe,
2034
+ className: !f && Z ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
2035
2035
  }
2036
2036
  )
2037
2037
  ]
2038
2038
  }
2039
2039
  ),
2040
- Ke ? /* @__PURE__ */ S("div", { className: "ll-expanded__bottom", children: [
2041
- !U && Qe && /* @__PURE__ */ r(
2040
+ Qe ? /* @__PURE__ */ S("div", { className: "ll-expanded__bottom", children: [
2041
+ !j && nt && /* @__PURE__ */ r(
2042
2042
  "div",
2043
2043
  {
2044
2044
  className: "ll-expanded__transcript ll-expanded__transcript--agent",
2045
2045
  "data-role": "agent",
2046
- children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Qe })
2046
+ children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: nt })
2047
2047
  }
2048
2048
  ),
2049
- !U && pt && /* @__PURE__ */ r(
2049
+ !j && gt && /* @__PURE__ */ r(
2050
2050
  "div",
2051
2051
  {
2052
2052
  className: "ll-expanded__transcript ll-expanded__transcript--user",
2053
2053
  "data-role": "user",
2054
- children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: pt })
2054
+ children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: gt })
2055
2055
  }
2056
2056
  ),
2057
- !ie && !U && /* @__PURE__ */ S("div", { className: "ll-toolbar", onClick: (k) => k.stopPropagation(), children: [
2058
- X && /* @__PURE__ */ r(
2057
+ !le && !j && /* @__PURE__ */ S("div", { className: "ll-toolbar", onClick: (C) => C.stopPropagation(), children: [
2058
+ K && /* @__PURE__ */ r(
2059
2059
  "button",
2060
2060
  {
2061
2061
  type: "button",
2062
2062
  className: `ll-tool ${f ? "is-on" : ""}`,
2063
- onClick: $e,
2063
+ onClick: Fe,
2064
2064
  "aria-label": f ? "Stop sharing screen" : "Share screen",
2065
2065
  title: f ? "Stop sharing" : "Share screen",
2066
- children: /* @__PURE__ */ r(or, {})
2066
+ children: /* @__PURE__ */ r(fr, {})
2067
2067
  }
2068
2068
  ),
2069
- q && /* @__PURE__ */ S("div", { className: "ll-tool-split", children: [
2069
+ U && /* @__PURE__ */ S("div", { className: "ll-tool-split", children: [
2070
2070
  /* @__PURE__ */ r(
2071
2071
  "button",
2072
2072
  {
2073
2073
  type: "button",
2074
- className: `ll-tool ll-tool--left ${J ? "is-on" : ""}`,
2075
- onClick: Ye,
2076
- "aria-label": J ? "Turn off camera" : "Turn on camera",
2077
- title: J ? "Stop camera" : "Start camera",
2078
- children: /* @__PURE__ */ r(lr, {})
2074
+ className: `ll-tool ll-tool--left ${Z ? "is-on" : ""}`,
2075
+ onClick: Ke,
2076
+ "aria-label": Z ? "Turn off camera" : "Turn on camera",
2077
+ title: Z ? "Stop camera" : "Start camera",
2078
+ children: /* @__PURE__ */ r(pr, {})
2079
2079
  }
2080
2080
  ),
2081
2081
  /* @__PURE__ */ r(
2082
2082
  "button",
2083
2083
  {
2084
- ref: At,
2084
+ ref: It,
2085
2085
  type: "button",
2086
- className: `ll-tool ll-tool--right ${J ? "is-on" : ""}`,
2087
- onClick: (k) => {
2088
- k.stopPropagation(), be((ae) => !ae), Ze(!1);
2086
+ className: `ll-tool ll-tool--right ${Z ? "is-on" : ""}`,
2087
+ onClick: (C) => {
2088
+ C.stopPropagation(), we((se) => !se), tt(!1);
2089
2089
  },
2090
2090
  "aria-label": "Camera devices",
2091
2091
  "aria-haspopup": "listbox",
2092
- "aria-expanded": pe,
2093
- children: /* @__PURE__ */ r(Ot, {})
2092
+ "aria-expanded": me,
2093
+ children: /* @__PURE__ */ r(qt, {})
2094
2094
  }
2095
2095
  ),
2096
- pe && H.length > 0 && /* @__PURE__ */ r(
2097
- Wn,
2096
+ me && H.length > 0 && /* @__PURE__ */ r(
2097
+ Xn,
2098
2098
  {
2099
2099
  label: "Camera",
2100
2100
  devices: H,
2101
- activeId: G,
2102
- anchorRef: At,
2103
- onPick: (k) => {
2104
- be(!1), Ge(k);
2101
+ activeId: X,
2102
+ anchorRef: It,
2103
+ onPick: (C) => {
2104
+ we(!1), Je(C);
2105
2105
  }
2106
2106
  }
2107
2107
  )
@@ -2112,36 +2112,36 @@ const Mi = ({
2112
2112
  {
2113
2113
  type: "button",
2114
2114
  className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
2115
- onClick: ct,
2115
+ onClick: ft,
2116
2116
  "aria-label": O ? "Unmute microphone" : "Mute microphone",
2117
2117
  title: O ? "Unmute" : "Mute",
2118
- children: /* @__PURE__ */ r(ar, { muted: O })
2118
+ children: /* @__PURE__ */ r(hr, { muted: O })
2119
2119
  }
2120
2120
  ),
2121
2121
  /* @__PURE__ */ r(
2122
2122
  "button",
2123
2123
  {
2124
- ref: Et,
2124
+ ref: Mt,
2125
2125
  type: "button",
2126
2126
  className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
2127
- onClick: (k) => {
2128
- k.stopPropagation(), Ze((ae) => !ae), be(!1);
2127
+ onClick: (C) => {
2128
+ C.stopPropagation(), tt((se) => !se), we(!1);
2129
2129
  },
2130
2130
  "aria-label": "Microphone devices",
2131
2131
  "aria-haspopup": "listbox",
2132
- "aria-expanded": Je,
2133
- children: /* @__PURE__ */ r(Ot, {})
2132
+ "aria-expanded": et,
2133
+ children: /* @__PURE__ */ r(qt, {})
2134
2134
  }
2135
2135
  ),
2136
- Je && z.length > 0 && /* @__PURE__ */ r(
2137
- Wn,
2136
+ et && z.length > 0 && /* @__PURE__ */ r(
2137
+ Xn,
2138
2138
  {
2139
2139
  label: "Microphone",
2140
2140
  devices: z,
2141
2141
  activeId: B,
2142
- anchorRef: Et,
2143
- onPick: (k) => {
2144
- Ze(!1), kt(k);
2142
+ anchorRef: Mt,
2143
+ onPick: (C) => {
2144
+ tt(!1), St(C);
2145
2145
  }
2146
2146
  }
2147
2147
  )
@@ -2151,10 +2151,10 @@ const Mi = ({
2151
2151
  {
2152
2152
  type: "button",
2153
2153
  className: `ll-tool ${$ ? "is-muted" : ""}`,
2154
- onClick: He,
2154
+ onClick: Be,
2155
2155
  "aria-label": $ ? "Unmute speaker" : "Mute speaker",
2156
2156
  title: $ ? "Unmute speaker" : "Mute speaker",
2157
- children: /* @__PURE__ */ r(sr, { muted: $ })
2157
+ children: /* @__PURE__ */ r(mr, { muted: $ })
2158
2158
  }
2159
2159
  ),
2160
2160
  /* @__PURE__ */ r(
@@ -2162,57 +2162,57 @@ const Mi = ({
2162
2162
  {
2163
2163
  type: "button",
2164
2164
  className: "ll-tool ll-tool--danger",
2165
- onClick: st,
2165
+ onClick: dt,
2166
2166
  "aria-label": "End conversation",
2167
2167
  title: "End conversation",
2168
- children: /* @__PURE__ */ r(cr, {})
2168
+ children: /* @__PURE__ */ r(gr, {})
2169
2169
  }
2170
2170
  )
2171
2171
  ] }),
2172
- !ie && U && /* @__PURE__ */ r(
2173
- Ei,
2172
+ !le && j && /* @__PURE__ */ r(
2173
+ zi,
2174
2174
  {
2175
2175
  isMuted: O,
2176
- onToggleMute: ct,
2177
- isCameraEnabled: J,
2178
- onToggleCamera: Ye,
2179
- allowCamera: q,
2176
+ onToggleMute: ft,
2177
+ isCameraEnabled: Z,
2178
+ onToggleCamera: Ke,
2179
+ allowCamera: U,
2180
2180
  isScreenShareEnabled: f,
2181
- onToggleScreenShare: $e,
2182
- allowScreenShare: X,
2181
+ onToggleScreenShare: Fe,
2182
+ allowScreenShare: K,
2183
2183
  isSpeakerMuted: $,
2184
- onToggleSpeaker: He,
2185
- allowTyping: te,
2186
- isTypingOpen: Nt,
2187
- onToggleTyping: sn,
2188
- onDisconnect: st
2184
+ onToggleSpeaker: Be,
2185
+ allowTyping: re,
2186
+ isTypingOpen: Tt,
2187
+ onToggleTyping: pn,
2188
+ onDisconnect: dt
2189
2189
  }
2190
2190
  ),
2191
- !ie && te && (U ? Nt : !0) && /* @__PURE__ */ S("form", { className: "ll-message-input", onSubmit: Ae, children: [
2191
+ !le && re && (j ? Tt : !0) && /* @__PURE__ */ S("form", { className: "ll-message-input", onSubmit: Ne, children: [
2192
2192
  /* @__PURE__ */ r(
2193
2193
  "input",
2194
2194
  {
2195
2195
  type: "text",
2196
2196
  className: "ll-message-input__field",
2197
2197
  placeholder: "Message...",
2198
- value: _e,
2199
- onChange: (k) => Re(k.target.value),
2198
+ value: xe,
2199
+ onChange: (C) => Re(C.target.value),
2200
2200
  "aria-label": "Message the agent"
2201
2201
  }
2202
2202
  ),
2203
- _e.trim() && /* @__PURE__ */ r(
2203
+ xe.trim() && /* @__PURE__ */ r(
2204
2204
  "button",
2205
2205
  {
2206
2206
  type: "submit",
2207
2207
  className: "ll-message-input__send",
2208
2208
  "aria-label": "Send message",
2209
- children: /* @__PURE__ */ r(Ii, {})
2209
+ children: /* @__PURE__ */ r(Fi, {})
2210
2210
  }
2211
2211
  )
2212
2212
  ] })
2213
2213
  ] }) : null,
2214
2214
  (() => {
2215
- if (v && C !== "error")
2215
+ if (v && L !== "error")
2216
2216
  return /* @__PURE__ */ S("div", { className: "ll-expanded__banner", role: "alert", children: [
2217
2217
  /* @__PURE__ */ r("span", { children: v }),
2218
2218
  /* @__PURE__ */ r(
@@ -2220,23 +2220,23 @@ const Mi = ({
2220
2220
  {
2221
2221
  type: "button",
2222
2222
  className: "ll-expanded__banner-x",
2223
- onClick: Xe,
2223
+ onClick: Ze,
2224
2224
  "aria-label": "Dismiss",
2225
2225
  children: "×"
2226
2226
  }
2227
2227
  )
2228
2228
  ] });
2229
- if (!b || C !== "error") return null;
2230
- let k = "Failed to connect", ae = "Try again";
2231
- return b === "MIC_PERMISSION_DENIED" ? k = "Microphone blocked. Allow access to talk." : b === "MIC_NOT_FOUND" ? k = "No microphone found. Plug one in + retry." : b === "MIC_UNAVAILABLE" ? k = "Mic unavailable. Check other apps using it." : b === "AGENT_TIMEOUT" ? k = "Agent didn't pick up. Try again." : b === "CONNECT_FAILED" ? k = "Connection failed. Check your network." : b.length < 80 && (k = b), /* @__PURE__ */ S("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
2232
- /* @__PURE__ */ r("span", { children: k }),
2229
+ if (!b || L !== "error") return null;
2230
+ let C = "Failed to connect", se = "Try again";
2231
+ return b === "MIC_PERMISSION_DENIED" ? C = "Microphone blocked. Allow access to talk." : b === "MIC_NOT_FOUND" ? C = "No microphone found. Plug one in + retry." : b === "MIC_UNAVAILABLE" ? C = "Mic unavailable. Check other apps using it." : b === "AGENT_TIMEOUT" ? C = "Agent didn't pick up. Try again." : b === "CONNECT_FAILED" ? C = "Connection failed. Check your network." : b.length < 80 && (C = b), /* @__PURE__ */ S("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
2232
+ /* @__PURE__ */ r("span", { children: C }),
2233
2233
  /* @__PURE__ */ r(
2234
2234
  "button",
2235
2235
  {
2236
2236
  type: "button",
2237
2237
  className: "ll-expanded__banner-retry",
2238
- onClick: _t,
2239
- children: ae
2238
+ onClick: kt,
2239
+ children: se
2240
2240
  }
2241
2241
  )
2242
2242
  ] });
@@ -2257,32 +2257,32 @@ const Mi = ({
2257
2257
  }
2258
2258
  );
2259
2259
  };
2260
- function Ot() {
2260
+ function qt() {
2261
2261
  return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" }) });
2262
2262
  }
2263
- function Fn() {
2263
+ function Yn() {
2264
2264
  return /* @__PURE__ */ S("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
2265
2265
  /* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
2266
2266
  /* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
2267
2267
  ] });
2268
2268
  }
2269
- function Bn() {
2269
+ function Gn() {
2270
2270
  return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
2271
2271
  }
2272
- function or() {
2272
+ function fr() {
2273
2273
  return /* @__PURE__ */ S("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2274
2274
  /* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
2275
2275
  /* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
2276
2276
  /* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
2277
2277
  ] });
2278
2278
  }
2279
- function lr() {
2279
+ function pr() {
2280
2280
  return /* @__PURE__ */ S("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: [
2281
2281
  /* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
2282
2282
  /* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
2283
2283
  ] });
2284
2284
  }
2285
- function ar({ muted: e }) {
2285
+ function hr({ muted: e }) {
2286
2286
  return /* @__PURE__ */ S("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: [
2287
2287
  /* @__PURE__ */ r("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
2288
2288
  /* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
@@ -2290,22 +2290,22 @@ function ar({ muted: e }) {
2290
2290
  e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2291
2291
  ] });
2292
2292
  }
2293
- function sr({ muted: e }) {
2293
+ function mr({ muted: e }) {
2294
2294
  return /* @__PURE__ */ S("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: [
2295
2295
  /* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
2296
- e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ S(Ve, { children: [
2296
+ e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ S(Xe, { children: [
2297
2297
  /* @__PURE__ */ r("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
2298
2298
  /* @__PURE__ */ r("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
2299
2299
  ] })
2300
2300
  ] });
2301
2301
  }
2302
- function Ii() {
2302
+ function Fi() {
2303
2303
  return /* @__PURE__ */ S("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
2304
2304
  /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
2305
2305
  /* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
2306
2306
  ] });
2307
2307
  }
2308
- function cr() {
2308
+ function gr() {
2309
2309
  return /* @__PURE__ */ r("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ r(
2310
2310
  "path",
2311
2311
  {
@@ -2314,7 +2314,7 @@ function cr() {
2314
2314
  }
2315
2315
  ) });
2316
2316
  }
2317
- const Wn = ({
2317
+ const Xn = ({
2318
2318
  label: e,
2319
2319
  devices: t,
2320
2320
  activeId: n,
@@ -2322,7 +2322,7 @@ const Wn = ({
2322
2322
  anchorRef: l
2323
2323
  }) => {
2324
2324
  const [o, s] = M(null);
2325
- return er(() => {
2325
+ return ar(() => {
2326
2326
  const a = () => {
2327
2327
  const c = l.current;
2328
2328
  if (!c) return;
@@ -2335,7 +2335,7 @@ const Wn = ({
2335
2335
  return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
2336
2336
  window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
2337
2337
  };
2338
- }, [l]), o === null || typeof document > "u" ? null : ln(
2338
+ }, [l]), o === null || typeof document > "u" ? null : dn(
2339
2339
  /* @__PURE__ */ S(
2340
2340
  "div",
2341
2341
  {
@@ -2374,7 +2374,7 @@ const Wn = ({
2374
2374
  ),
2375
2375
  document.body
2376
2376
  );
2377
- }, Ri = [
2377
+ }, Bi = [
2378
2378
  // Accept any value (or empty) — `<input data-ll-private />` and
2379
2379
  // `<input data-ll-private="true" />` both opt out. The bare attribute
2380
2380
  // is the recommended spelling; "true" is preserved for back-compat.
@@ -2382,17 +2382,17 @@ const Wn = ({
2382
2382
  "[data-ll-skip]",
2383
2383
  ".ll-widget"
2384
2384
  ];
2385
- function Wt(e) {
2385
+ function Vt(e) {
2386
2386
  let t = e;
2387
2387
  for (; t; ) {
2388
- for (const n of Ri)
2388
+ for (const n of Bi)
2389
2389
  if (t.matches(n)) return !0;
2390
2390
  t = t.parentElement;
2391
2391
  }
2392
2392
  return !1;
2393
2393
  }
2394
- function nn(e) {
2395
- if (Wt(e)) return !1;
2394
+ function sn(e) {
2395
+ if (Vt(e)) return !1;
2396
2396
  if (e instanceof HTMLInputElement) {
2397
2397
  if (e.type === "password") return !1;
2398
2398
  const t = (e.getAttribute("autocomplete") || "").toLowerCase();
@@ -2400,66 +2400,66 @@ function nn(e) {
2400
2400
  }
2401
2401
  return !0;
2402
2402
  }
2403
- const Ti = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i, qn = /\b(back|previous|prev|go\s*back)\b|←|‹/i, Pi = /\b(submit|finish|done|complete|send)\b/i, wt = /* @__PURE__ */ new Map();
2404
- function Un(e) {
2405
- const t = wt.get(e);
2403
+ const Wi = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i, Kn = /\b(back|previous|prev|go\s*back)\b|←|‹/i, qi = /\b(submit|finish|done|complete|send)\b/i, Ct = /* @__PURE__ */ new Map();
2404
+ function Jn(e) {
2405
+ const t = Ct.get(e);
2406
2406
  return t && t.isConnected ? t : null;
2407
2407
  }
2408
- function it(e) {
2409
- if (Wt(e) || e.hidden || e.getAttribute("aria-hidden") === "true") return !0;
2408
+ function at(e) {
2409
+ if (Vt(e) || e.hidden || e.getAttribute("aria-hidden") === "true") return !0;
2410
2410
  const t = typeof window < "u" && window.getComputedStyle ? window.getComputedStyle(e) : null;
2411
2411
  return !!(t && (t.display === "none" || t.visibility === "hidden"));
2412
2412
  }
2413
- function Di(e) {
2413
+ function Ui(e) {
2414
2414
  return !!(e.disabled || e.getAttribute("aria-disabled") === "true");
2415
2415
  }
2416
- function zi(e) {
2416
+ function ji(e) {
2417
2417
  return (e.innerText || e.textContent || e.getAttribute("aria-label") || e.value || "").trim();
2418
2418
  }
2419
- function $i(e) {
2419
+ function Vi(e) {
2420
2420
  return Array.from(e.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"]')).filter(
2421
- (n) => !it(n) && !Di(n)
2421
+ (n) => !at(n) && !Ui(n)
2422
2422
  );
2423
2423
  }
2424
- function ur(e) {
2425
- wt.clear();
2426
- const t = $i(e);
2424
+ function yr(e) {
2425
+ Ct.clear();
2426
+ const t = Vi(e);
2427
2427
  let n, i, l;
2428
2428
  for (const a of t) {
2429
- const c = zi(a);
2429
+ const c = ji(a);
2430
2430
  if (!c || c.length > 40) continue;
2431
2431
  const d = a.getAttribute("type") === "submit" || a.tagName === "BUTTON" && !a.getAttribute("type") && !!a.closest("form");
2432
- !n && Ti.test(c) && !qn.test(c) ? (n = { id: "ll-advance", label: c }, wt.set("ll-advance", a)) : !i && qn.test(c) ? (i = { id: "ll-back", label: c }, wt.set("ll-back", a)) : !l && (Pi.test(c) || d) && (l = { id: "ll-submit", label: c }, wt.set("ll-submit", a));
2432
+ !n && Wi.test(c) && !Kn.test(c) ? (n = { id: "ll-advance", label: c }, Ct.set("ll-advance", a)) : !i && Kn.test(c) ? (i = { id: "ll-back", label: c }, Ct.set("ll-back", a)) : !l && (qi.test(c) || d) && (l = { id: "ll-submit", label: c }, Ct.set("ll-submit", a));
2433
2433
  }
2434
- const o = Ui(e);
2434
+ const o = Qi(e);
2435
2435
  return { kind: n || o.totalSteps ? "multi-step" : "single-page", advance: n, back: i, submit: l, ...o };
2436
2436
  }
2437
- const Hi = 60;
2438
- function dr(e) {
2439
- return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0, Hi);
2437
+ const Yi = 60;
2438
+ function vr(e) {
2439
+ return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0, Yi);
2440
2440
  }
2441
- function Oi(e) {
2441
+ function Gi(e) {
2442
2442
  const t = e.getAttribute("class");
2443
2443
  return t ? t.toLowerCase() : "";
2444
2444
  }
2445
- const Fi = /stepper|wizard|ant-steps|step-indicator/;
2446
- function Bi(e) {
2447
- return Fi.test(Oi(e));
2445
+ const Xi = /stepper|wizard|ant-steps|step-indicator/;
2446
+ function Ki(e) {
2447
+ return Xi.test(Gi(e));
2448
2448
  }
2449
- function jn(e) {
2449
+ function Zn(e) {
2450
2450
  const t = e.getAttribute("aria-current");
2451
2451
  return t === "step" || t === "true" ? !0 : Array.from(e.classList).some(
2452
2452
  (n) => /(^|[-_])(active|current|selected)([-_]|$)/i.test(n)
2453
2453
  );
2454
2454
  }
2455
- const Wi = '[aria-current="step"],[aria-current="true"],[class*="active"],[class*="Active"],[class*="current"],[class*="Current"],[class*="selected"],[class*="Selected"]';
2456
- function qi(e) {
2457
- return jn(e) ? !0 : Array.from(e.querySelectorAll(Wi)).some(
2458
- jn
2455
+ const Ji = '[aria-current="step"],[aria-current="true"],[class*="active"],[class*="Active"],[class*="current"],[class*="Current"],[class*="selected"],[class*="Selected"]';
2456
+ function Zi(e) {
2457
+ return Zn(e) ? !0 : Array.from(e.querySelectorAll(Ji)).some(
2458
+ Zn
2459
2459
  );
2460
2460
  }
2461
- function Vn(e, t) {
2462
- const n = dr(
2461
+ function Qn(e, t) {
2462
+ const n = vr(
2463
2463
  e[t].innerText || e[t].textContent || ""
2464
2464
  );
2465
2465
  return {
@@ -2468,23 +2468,23 @@ function Vn(e, t) {
2468
2468
  ...n ? { stepLabel: n } : {}
2469
2469
  };
2470
2470
  }
2471
- function Ui(e) {
2471
+ function Qi(e) {
2472
2472
  const t = e.querySelector('[aria-current="step"]');
2473
- if (t && t.parentElement && !it(t)) {
2473
+ if (t && t.parentElement && !at(t)) {
2474
2474
  const l = Array.from(t.parentElement.children).filter(
2475
- (s) => s.tagName === t.tagName && !it(s)
2475
+ (s) => s.tagName === t.tagName && !at(s)
2476
2476
  ), o = l.indexOf(t);
2477
- if (o >= 0 && l.length >= 2) return Vn(l, o);
2477
+ if (o >= 0 && l.length >= 2) return Qn(l, o);
2478
2478
  }
2479
2479
  const n = e.querySelector('[role="progressbar"]');
2480
- if (n && !it(n)) {
2480
+ if (n && !at(n)) {
2481
2481
  const l = Number(n.getAttribute("aria-valuenow")), o = Number(n.getAttribute("aria-valuemax"));
2482
2482
  if (Number.isFinite(l) && Number.isFinite(o) && o >= 2) {
2483
2483
  const s = (n.getAttribute("aria-valuetext") || "").trim();
2484
2484
  return {
2485
2485
  totalSteps: o,
2486
2486
  currentStep: l,
2487
- ...s ? { stepLabel: dr(s) } : {}
2487
+ ...s ? { stepLabel: vr(s) } : {}
2488
2488
  };
2489
2489
  }
2490
2490
  }
@@ -2492,19 +2492,19 @@ function Ui(e) {
2492
2492
  e.querySelectorAll(
2493
2493
  '[class*="step"], [class*="Step"], [class*="wizard"], [class*="Wizard"]'
2494
2494
  )
2495
- ).filter((l) => !it(l) && Bi(l));
2495
+ ).filter((l) => !at(l) && Ki(l));
2496
2496
  for (const l of i) {
2497
2497
  const o = Array.from(l.children).filter(
2498
- (a) => !it(a) && (a.textContent || "").trim().length > 0
2498
+ (a) => !at(a) && (a.textContent || "").trim().length > 0
2499
2499
  );
2500
2500
  if (o.length < 2 || o.length > 12) continue;
2501
- const s = o.findIndex(qi);
2501
+ const s = o.findIndex(Zi);
2502
2502
  if (!(s < 0))
2503
- return Vn(o, s);
2503
+ return Qn(o, s);
2504
2504
  }
2505
2505
  return {};
2506
2506
  }
2507
- const Ft = 4096, ji = 20, Vi = 20, Yi = 10, Gi = 10, Xi = 30, Ki = 20, Yn = 500, Ji = [
2507
+ const Ut = 4096, eo = 20, to = 20, no = 10, ro = 10, io = 30, oo = 20, er = 500, lo = [
2508
2508
  '[data-ll-private="true"]',
2509
2509
  ".ll-widget",
2510
2510
  "script",
@@ -2512,24 +2512,24 @@ const Ft = 4096, ji = 20, Vi = 20, Yi = 10, Gi = 10, Xi = 30, Ki = 20, Yn = 500,
2512
2512
  "noscript",
2513
2513
  "iframe"
2514
2514
  ];
2515
- function vt(e) {
2515
+ function _t(e) {
2516
2516
  if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
2517
2517
  let t = e;
2518
2518
  for (; t; ) {
2519
- for (const n of Ji)
2519
+ for (const n of lo)
2520
2520
  if (t.matches(n)) return !0;
2521
2521
  t = t.parentElement;
2522
2522
  }
2523
2523
  return !1;
2524
2524
  }
2525
- function bt(e) {
2525
+ function xt(e) {
2526
2526
  if (typeof window > "u") return !0;
2527
2527
  const t = e.getBoundingClientRect();
2528
2528
  if (t.width <= 0 || t.height <= 0) return !1;
2529
2529
  const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
2530
2530
  return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
2531
2531
  }
2532
- function Gn(e) {
2532
+ function tr(e) {
2533
2533
  const t = e.getAttribute("id");
2534
2534
  if (t) {
2535
2535
  const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
@@ -2556,13 +2556,13 @@ function Gn(e) {
2556
2556
  const l = e.getAttribute("placeholder");
2557
2557
  return l ? l.trim() : "";
2558
2558
  }
2559
- function ce(e, t) {
2559
+ function de(e, t) {
2560
2560
  return e.length <= t ? e : e.slice(0, t - 1) + "…";
2561
2561
  }
2562
- function Zi(e) {
2562
+ function ao(e) {
2563
2563
  return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2564
2564
  }
2565
- function Qi(e) {
2565
+ function so(e) {
2566
2566
  const t = e.getAttribute("aria-label");
2567
2567
  if (t) return t.trim().slice(0, 80);
2568
2568
  const n = e.getAttribute("aria-labelledby");
@@ -2588,10 +2588,10 @@ function Qi(e) {
2588
2588
  }
2589
2589
  return null;
2590
2590
  }
2591
- function rt(e) {
2591
+ function lt(e) {
2592
2592
  return e.length;
2593
2593
  }
2594
- function eo(e, t = {}) {
2594
+ function co(e, t = {}) {
2595
2595
  const n = t.doc ?? (typeof document < "u" ? document : null);
2596
2596
  if (!n)
2597
2597
  return {
@@ -2609,119 +2609,119 @@ function eo(e, t = {}) {
2609
2609
  n.querySelectorAll("[data-ll-region]")
2610
2610
  ), a = [];
2611
2611
  for (const v of s) {
2612
- if (a.length >= Yi) break;
2613
- if (vt(v) || !bt(v)) continue;
2614
- const z = v.getAttribute("data-ll-region") ?? "", B = v.getAttribute("data-ll-intent") ?? void 0, J = ce(
2612
+ if (a.length >= no) break;
2613
+ if (_t(v) || !xt(v)) continue;
2614
+ const z = v.getAttribute("data-ll-region") ?? "", B = v.getAttribute("data-ll-intent") ?? void 0, Z = de(
2615
2615
  (v.innerText || v.textContent || "").trim(),
2616
- Yn * 2
2616
+ er * 2
2617
2617
  );
2618
- !z || !J || a.push({ id: z, intent: B, text: J });
2618
+ !z || !Z || a.push({ id: z, intent: B, text: Z });
2619
2619
  }
2620
2620
  const c = [], d = ["H1", "H2", "H3", "H4", "H5", "H6"], g = Array.from(
2621
2621
  n.querySelectorAll("h1, h2, h3, h4, h5, h6")
2622
2622
  );
2623
2623
  for (const v of g) {
2624
- if (vt(v) || !bt(v)) continue;
2624
+ if (_t(v) || !xt(v)) continue;
2625
2625
  const z = (v.textContent || "").trim();
2626
- z && c.push(`${v.tagName}: ${ce(z, 200)}`);
2626
+ z && c.push(`${v.tagName}: ${de(z, 200)}`);
2627
2627
  }
2628
2628
  const p = Array.from(n.querySelectorAll("p, li"));
2629
2629
  for (const v of p) {
2630
- if (vt(v) || !bt(v) || d.includes(v.tagName)) continue;
2630
+ if (_t(v) || !xt(v) || d.includes(v.tagName)) continue;
2631
2631
  const z = (v.textContent || "").trim();
2632
- z.length > 10 && c.push(ce(z, Yn));
2632
+ z.length > 10 && c.push(de(z, er));
2633
2633
  }
2634
2634
  const m = c.join(`
2635
- `), D = [], x = Array.from(n.querySelectorAll("a[href]"));
2635
+ `), P = [], x = Array.from(n.querySelectorAll("a[href]"));
2636
2636
  for (const v of x) {
2637
- if (D.length >= ji) break;
2638
- if (vt(v) || !bt(v)) continue;
2637
+ if (P.length >= eo) break;
2638
+ if (_t(v) || !xt(v)) continue;
2639
2639
  const z = v.getAttribute("href") || "", B = (v.textContent || "").trim();
2640
- !z || !B || D.push({ href: z, text: ce(B, 100) });
2640
+ !z || !B || P.push({ href: z, text: de(B, 100) });
2641
2641
  }
2642
- const C = [], y = Array.from(
2642
+ const L = [], y = Array.from(
2643
2643
  n.querySelectorAll(
2644
2644
  "input, textarea, select"
2645
2645
  )
2646
2646
  );
2647
2647
  for (const v of y) {
2648
- if (C.length >= Vi) break;
2649
- if (vt(v) || !nn(v) || !bt(v)) continue;
2650
- const z = Gn(v), B = v instanceof HTMLInputElement ? v.type : v.tagName.toLowerCase();
2651
- z && C.push({ label: ce(z, 100), type: B });
2648
+ if (L.length >= to) break;
2649
+ if (_t(v) || !sn(v) || !xt(v)) continue;
2650
+ const z = tr(v), B = v instanceof HTMLInputElement ? v.type : v.tagName.toLowerCase();
2651
+ z && L.push({ label: de(z, 100), type: B });
2652
2652
  }
2653
- const w = Array.from(n.querySelectorAll("form")), P = [];
2653
+ const w = Array.from(n.querySelectorAll("form")), D = [];
2654
2654
  let E = 0;
2655
2655
  for (const v of w) {
2656
- if (P.length >= Gi) break;
2657
- if (Wt(v) || v.matches(".ll-widget *, .ll-widget")) continue;
2658
- const z = v.getAttribute("id") || v.getAttribute("name") || Zi(v.getAttribute("data-ll-intent")) || `form_${E++}`, B = v.getAttribute("data-ll-intent") || Qi(v) || void 0, J = Array.from(
2656
+ if (D.length >= ro) break;
2657
+ if (Vt(v) || v.matches(".ll-widget *, .ll-widget")) continue;
2658
+ const z = v.getAttribute("id") || v.getAttribute("name") || ao(v.getAttribute("data-ll-intent")) || `form_${E++}`, B = v.getAttribute("data-ll-intent") || so(v) || void 0, Z = Array.from(
2659
2659
  v.querySelectorAll(
2660
2660
  "input, textarea, select"
2661
2661
  )
2662
- ), le = [];
2662
+ ), ae = [];
2663
2663
  let H = 0;
2664
- const G = /* @__PURE__ */ new Set();
2665
- for (const f of J) {
2666
- if (le.length >= Xi) break;
2667
- if (!nn(f)) continue;
2664
+ const X = /* @__PURE__ */ new Set();
2665
+ for (const f of Z) {
2666
+ if (ae.length >= io) break;
2667
+ if (!sn(f)) continue;
2668
2668
  if (f instanceof HTMLInputElement) {
2669
- const U = f.type;
2670
- if (U === "submit" || U === "button" || U === "reset" || U === "hidden" || U === "image" || U === "file") continue;
2669
+ const j = f.type;
2670
+ if (j === "submit" || j === "button" || j === "reset" || j === "hidden" || j === "image" || j === "file") continue;
2671
2671
  }
2672
- const A = f.getAttribute("name") || "", $ = f.getAttribute("id") || "";
2673
- let q = A || $ || `field_${H}`;
2674
- G.has(q) && (q = `${q}__${H}`), G.add(q), H++;
2675
- const X = Gn(f) || q, te = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), W = {
2676
- name: q,
2677
- label: ce(X, 100),
2678
- type: te
2672
+ const N = f.getAttribute("name") || "", $ = f.getAttribute("id") || "";
2673
+ let U = N || $ || `field_${H}`;
2674
+ X.has(U) && (U = `${U}__${H}`), X.add(U), H++;
2675
+ const K = tr(f) || U, re = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), W = {
2676
+ name: U,
2677
+ label: de(K, 100),
2678
+ type: re
2679
2679
  };
2680
2680
  f.required === !0 && (W.required = !0);
2681
- const ne = f.getAttribute("placeholder");
2682
- if (ne && (W.placeholder = ce(ne.trim(), 100)), f instanceof HTMLInputElement || f instanceof HTMLTextAreaElement) {
2683
- const U = f.getAttribute("minlength");
2684
- if (U !== null) {
2685
- const Z = parseInt(U, 10);
2686
- !Number.isNaN(Z) && Z >= 0 && (W.minLength = Z);
2681
+ const ie = f.getAttribute("placeholder");
2682
+ if (ie && (W.placeholder = de(ie.trim(), 100)), f instanceof HTMLInputElement || f instanceof HTMLTextAreaElement) {
2683
+ const j = f.getAttribute("minlength");
2684
+ if (j !== null) {
2685
+ const Q = parseInt(j, 10);
2686
+ !Number.isNaN(Q) && Q >= 0 && (W.minLength = Q);
2687
2687
  }
2688
2688
  const ge = f.getAttribute("maxlength");
2689
2689
  if (ge !== null) {
2690
- const Z = parseInt(ge, 10);
2691
- !Number.isNaN(Z) && Z >= 0 && (W.maxLength = Z);
2690
+ const Q = parseInt(ge, 10);
2691
+ !Number.isNaN(Q) && Q >= 0 && (W.maxLength = Q);
2692
2692
  }
2693
2693
  }
2694
2694
  if (f instanceof HTMLInputElement) {
2695
- const U = f.getAttribute("min");
2696
- U !== null && (W.min = ce(U, 50));
2695
+ const j = f.getAttribute("min");
2696
+ j !== null && (W.min = de(j, 50));
2697
2697
  const ge = f.getAttribute("max");
2698
- ge !== null && (W.max = ce(ge, 50));
2699
- const Z = f.getAttribute("step");
2700
- Z !== null && (W.step = ce(Z, 20));
2698
+ ge !== null && (W.max = de(ge, 50));
2699
+ const Q = f.getAttribute("step");
2700
+ Q !== null && (W.step = de(Q, 20));
2701
2701
  const Le = f.getAttribute("pattern");
2702
- Le !== null && (W.pattern = ce(Le, 200));
2703
- const re = (f.getAttribute("autocomplete") || "").toLowerCase();
2704
- re && re !== "off" && !re.startsWith("cc-") && (W.autocomplete = ce(re, 50));
2702
+ Le !== null && (W.pattern = de(Le, 200));
2703
+ const oe = (f.getAttribute("autocomplete") || "").toLowerCase();
2704
+ oe && oe !== "off" && !oe.startsWith("cc-") && (W.autocomplete = de(oe, 50));
2705
2705
  }
2706
2706
  if (f instanceof HTMLSelectElement) {
2707
- const U = [];
2707
+ const j = [];
2708
2708
  for (let ge = 0; ge < f.options.length; ge++) {
2709
- const Z = f.options[ge];
2710
- if (!Z) continue;
2711
- if (Z.value === "" || Z.disabled) {
2712
- const Me = (Z.textContent || "").trim();
2713
- if (Me && !W.placeholderOption && (W.placeholderOption = ce(Me, 60)), W.hasEmptyOption = !0, Z.disabled) continue;
2709
+ const Q = f.options[ge];
2710
+ if (!Q) continue;
2711
+ if (Q.value === "" || Q.disabled) {
2712
+ const Ie = (Q.textContent || "").trim();
2713
+ if (Ie && !W.placeholderOption && (W.placeholderOption = de(Ie, 60)), W.hasEmptyOption = !0, Q.disabled) continue;
2714
2714
  }
2715
- if (U.length >= Ki) break;
2716
- const Le = Z.value || "", re = (Z.textContent || "").trim() || Le;
2717
- !Le && !re || U.push({ value: Le, label: ce(re, 60) });
2715
+ if (j.length >= oo) break;
2716
+ const Le = Q.value || "", oe = (Q.textContent || "").trim() || Le;
2717
+ !Le && !oe || j.push({ value: Le, label: de(oe, 60) });
2718
2718
  }
2719
- U.length > 0 && (W.options = U);
2719
+ j.length > 0 && (W.options = j);
2720
2720
  }
2721
- const ie = typeof f.validationMessage == "string" ? f.validationMessage : "";
2722
- ie && (W.validationMessage = ce(ie, 200)), le.push(W);
2721
+ const le = typeof f.validationMessage == "string" ? f.validationMessage : "";
2722
+ le && (W.validationMessage = de(le, 200)), ae.push(W);
2723
2723
  }
2724
- P.push({ id: z, intent: B, fields: le });
2724
+ D.push({ id: z, intent: B, fields: ae });
2725
2725
  }
2726
2726
  const b = {
2727
2727
  url: i,
@@ -2729,39 +2729,39 @@ function eo(e, t = {}) {
2729
2729
  pathname: l,
2730
2730
  regions: a,
2731
2731
  visibleText: m,
2732
- visibleLinks: D,
2733
- visibleFields: C,
2734
- forms: P,
2735
- flow: ur(n),
2732
+ visibleLinks: P,
2733
+ visibleFields: L,
2734
+ forms: D,
2735
+ flow: yr(n),
2736
2736
  extras: e
2737
2737
  };
2738
- let O = rt(JSON.stringify(b.regions)) + rt(b.visibleText) + rt(JSON.stringify(b.visibleLinks)) + rt(JSON.stringify(b.visibleFields));
2739
- for (; O > Ft && b.visibleFields.length > 0; )
2740
- b.visibleFields.pop(), O = rt(JSON.stringify(b.visibleFields));
2741
- for (; O > Ft && b.visibleLinks.length > 0; )
2738
+ let O = lt(JSON.stringify(b.regions)) + lt(b.visibleText) + lt(JSON.stringify(b.visibleLinks)) + lt(JSON.stringify(b.visibleFields));
2739
+ for (; O > Ut && b.visibleFields.length > 0; )
2740
+ b.visibleFields.pop(), O = lt(JSON.stringify(b.visibleFields));
2741
+ for (; O > Ut && b.visibleLinks.length > 0; )
2742
2742
  b.visibleLinks.pop(), O -= 80;
2743
- return rt(b.visibleText) > Ft && (b.visibleText = ce(b.visibleText, Ft - 100)), b;
2743
+ return lt(b.visibleText) > Ut && (b.visibleText = de(b.visibleText, Ut - 100)), b;
2744
2744
  }
2745
- let ot = null;
2746
- function to(e) {
2745
+ let st = null;
2746
+ function uo(e) {
2747
2747
  const t = e.querySelectorAll("form");
2748
2748
  let n = `f${t.length}`;
2749
2749
  return t.forEach((i) => {
2750
2750
  n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
2751
2751
  }), n;
2752
2752
  }
2753
- function Xn(e, t = {}) {
2754
- const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), l = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${l}::${o}::${i ? to(i) : ""}`;
2755
- if (ot && ot.key === s && n - ot.at < 1e3)
2756
- return ot.ctx;
2757
- const a = eo(e, t);
2758
- return ot = { key: s, at: n, ctx: a }, a;
2753
+ function nr(e, t = {}) {
2754
+ const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), l = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${l}::${o}::${i ? uo(i) : ""}`;
2755
+ if (st && st.key === s && n - st.at < 1e3)
2756
+ return st.ctx;
2757
+ const a = co(e, t);
2758
+ return st = { key: s, at: n, ctx: a }, a;
2759
2759
  }
2760
- function no() {
2761
- ot = null;
2760
+ function fo() {
2761
+ st = null;
2762
2762
  }
2763
- const ro = 200;
2764
- function io(e) {
2763
+ const po = 200;
2764
+ function ho(e) {
2765
2765
  const t = String(e.href || "");
2766
2766
  return {
2767
2767
  href: t,
@@ -2771,18 +2771,18 @@ function io(e) {
2771
2771
  description: e.description
2772
2772
  };
2773
2773
  }
2774
- function oo(e) {
2774
+ function mo(e) {
2775
2775
  return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
2776
2776
  }
2777
- function lo(e) {
2777
+ function go(e) {
2778
2778
  const t = e ?? (typeof document < "u" ? document : null);
2779
2779
  if (!t) return [];
2780
2780
  const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), l = [], o = Array.from(t.querySelectorAll("a[href]"));
2781
2781
  for (const s of o) {
2782
- if (l.length >= ro) break;
2783
- if (Wt(s)) continue;
2782
+ if (l.length >= po) break;
2783
+ if (Vt(s)) continue;
2784
2784
  const a = s.getAttribute("href") || "";
2785
- if (!oo(a)) continue;
2785
+ if (!mo(a)) continue;
2786
2786
  let c = a, d = !0;
2787
2787
  try {
2788
2788
  if (typeof window < "u") {
@@ -2799,19 +2799,19 @@ function lo(e) {
2799
2799
  }
2800
2800
  return l;
2801
2801
  }
2802
- let lt = null;
2803
- const ao = 5e3;
2804
- function Qt() {
2802
+ let ct = null;
2803
+ const yo = 5e3;
2804
+ function on() {
2805
2805
  const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
2806
- if (lt && lt.pathname === t && e - lt.at < ao)
2807
- return lt.routes;
2808
- const n = lo();
2809
- return lt = { at: e, pathname: t, routes: n }, n;
2806
+ if (ct && ct.pathname === t && e - ct.at < yo)
2807
+ return ct.routes;
2808
+ const n = go();
2809
+ return ct = { at: e, pathname: t, routes: n }, n;
2810
2810
  }
2811
- function so() {
2812
- lt = null;
2811
+ function vo() {
2812
+ ct = null;
2813
2813
  }
2814
- function rn(e) {
2814
+ function cn(e) {
2815
2815
  if (e instanceof HTMLInputElement) {
2816
2816
  const t = e.type;
2817
2817
  if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
@@ -2819,17 +2819,17 @@ function rn(e) {
2819
2819
  }
2820
2820
  return !0;
2821
2821
  }
2822
- function co(e, t) {
2822
+ function bo(e, t) {
2823
2823
  return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
2824
2824
  }
2825
- function ze(e) {
2825
+ function Oe(e) {
2826
2826
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
2827
2827
  }
2828
- function en(e) {
2828
+ function ln(e) {
2829
2829
  const t = e.lastIndexOf(".");
2830
2830
  return t >= 0 ? e.slice(t + 1) : e;
2831
2831
  }
2832
- function uo(e) {
2832
+ function wo(e) {
2833
2833
  var i;
2834
2834
  const t = e.getAttribute("id");
2835
2835
  if (t)
@@ -2843,36 +2843,36 @@ function uo(e) {
2843
2843
  const n = e.closest("label");
2844
2844
  return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
2845
2845
  }
2846
- function fo(e, t) {
2847
- const n = ze(t);
2846
+ function _o(e, t) {
2847
+ const n = Oe(t);
2848
2848
  if (n.length < 2) return null;
2849
2849
  let i = null, l = 0;
2850
2850
  for (const o of Array.from(
2851
2851
  e.querySelectorAll("input, textarea, select")
2852
2852
  )) {
2853
- if (!rn(o)) continue;
2853
+ if (!cn(o)) continue;
2854
2854
  const s = o.getAttribute("name") || "", a = o.getAttribute("id") || "", c = [
2855
- ze(en(s)),
2856
- ze(en(a)),
2857
- ze(s),
2858
- ze(a)
2855
+ Oe(ln(s)),
2856
+ Oe(ln(a)),
2857
+ Oe(s),
2858
+ Oe(a)
2859
2859
  ];
2860
2860
  let d = 0;
2861
2861
  c.some((g) => g.length >= 2 && g === n) ? d = 4 : [
2862
- ze(s),
2863
- ze(en(s)),
2864
- ze(uo(o))
2862
+ Oe(s),
2863
+ Oe(ln(s)),
2864
+ Oe(wo(o))
2865
2865
  ].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (d = 2), d > l && (l = d, i = o);
2866
2866
  }
2867
2867
  return l >= 2 ? i : null;
2868
2868
  }
2869
- function po(e, t) {
2869
+ function xo(e, t) {
2870
2870
  if (!t) return null;
2871
2871
  try {
2872
2872
  const o = e.querySelector(
2873
2873
  `[name="${t.replace(/"/g, '\\"')}"]`
2874
2874
  );
2875
- if (o && rn(o)) return o;
2875
+ if (o && cn(o)) return o;
2876
2876
  } catch {
2877
2877
  }
2878
2878
  const n = Array.from(
@@ -2881,23 +2881,23 @@ function po(e, t) {
2881
2881
  let i = 0;
2882
2882
  const l = /* @__PURE__ */ new Map();
2883
2883
  for (const o of n) {
2884
- if (!rn(o)) continue;
2885
- const s = co(o, i);
2884
+ if (!cn(o)) continue;
2885
+ const s = bo(o, i);
2886
2886
  let a = s;
2887
2887
  if (l.has(s) && (a = `${s}__${i}`), a === t) return o;
2888
2888
  l.set(s, o), i++;
2889
2889
  }
2890
- return fo(e, t);
2890
+ return _o(e, t);
2891
2891
  }
2892
- function Kn(e, t) {
2893
- const n = po(e, t);
2894
- return n ? nn(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2892
+ function rr(e, t) {
2893
+ const n = xo(e, t);
2894
+ return n ? sn(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
2895
2895
  }
2896
- function ho(e, t) {
2896
+ function Co(e, t) {
2897
2897
  const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), l = i == null ? void 0 : i.set;
2898
2898
  l ? l.call(e, t) : e.value = t;
2899
2899
  }
2900
- function mo(e, t, n = {}) {
2900
+ function ko(e, t, n = {}) {
2901
2901
  const i = n.triggerInput ?? !0, l = n.triggerChange ?? !0;
2902
2902
  if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
2903
2903
  const o = Object.getOwnPropertyDescriptor(
@@ -2907,9 +2907,9 @@ function mo(e, t, n = {}) {
2907
2907
  s ? s.call(e, a) : e.checked = a, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2908
2908
  return;
2909
2909
  }
2910
- ho(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2910
+ Co(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
2911
2911
  }
2912
- function Jn(e, t) {
2912
+ function ir(e, t) {
2913
2913
  if (!t) return null;
2914
2914
  const n = t.replace(/"/g, '\\"'), i = (a) => a.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
2915
2915
  try {
@@ -2932,7 +2932,7 @@ function Jn(e, t) {
2932
2932
  ).filter((a) => !i(a));
2933
2933
  for (const a of s) {
2934
2934
  const c = a.getAttribute("data-ll-intent");
2935
- if (c && go(c) === t) return a;
2935
+ if (c && Lo(c) === t) return a;
2936
2936
  }
2937
2937
  if (/^form_\d+$/.test(t)) {
2938
2938
  const a = parseInt(t.slice(5), 10);
@@ -2945,10 +2945,10 @@ function Jn(e, t) {
2945
2945
  }
2946
2946
  return s.length === 1 ? s[0] : null;
2947
2947
  }
2948
- function go(e) {
2948
+ function Lo(e) {
2949
2949
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
2950
2950
  }
2951
- function yo() {
2951
+ function So() {
2952
2952
  if (typeof window > "u" || typeof document > "u")
2953
2953
  return !1;
2954
2954
  const e = document.scrollingElement || document.documentElement;
@@ -2956,19 +2956,19 @@ function yo() {
2956
2956
  const t = window.getComputedStyle(e);
2957
2957
  return !(t.overflowY === "hidden" || t.overflowY === "clip");
2958
2958
  }
2959
- function vo(e) {
2959
+ function Eo(e) {
2960
2960
  if (!(e instanceof HTMLElement)) return !1;
2961
2961
  const n = window.getComputedStyle(e).overflowY;
2962
2962
  return !(n !== "auto" && n !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
2963
2963
  }
2964
- function bo() {
2964
+ function Ao() {
2965
2965
  if (typeof document > "u") return null;
2966
2966
  const e = Array.from(
2967
2967
  document.querySelectorAll("body, body *")
2968
2968
  );
2969
2969
  let t = null, n = 0;
2970
2970
  for (const i of e) {
2971
- if (!vo(i)) continue;
2971
+ if (!Eo(i)) continue;
2972
2972
  const l = i.getBoundingClientRect();
2973
2973
  if (l.bottom <= 0 || l.top >= window.innerHeight || l.right <= 0 || l.left >= window.innerWidth || l.width <= 0 || l.height <= 0 || i.closest(".ll-widget")) continue;
2974
2974
  const o = l.width * l.height;
@@ -2976,24 +2976,24 @@ function bo() {
2976
2976
  }
2977
2977
  return t;
2978
2978
  }
2979
- function wo() {
2979
+ function No() {
2980
2980
  if (typeof window > "u")
2981
2981
  return null;
2982
- if (yo()) return window;
2983
- const e = bo();
2982
+ if (So()) return window;
2983
+ const e = Ao();
2984
2984
  return e || window;
2985
2985
  }
2986
- function Zn(e) {
2986
+ function or(e) {
2987
2987
  return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
2988
2988
  }
2989
- function _o(e) {
2989
+ function Mo(e) {
2990
2990
  var t, n;
2991
2991
  return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
2992
2992
  ((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
2993
2993
  ((n = document.documentElement) == null ? void 0 : n.scrollHeight) ?? 0
2994
2994
  ) : e.scrollHeight - e.clientHeight;
2995
2995
  }
2996
- const xo = /* @__PURE__ */ new Set([
2996
+ const Io = /* @__PURE__ */ new Set([
2997
2997
  "agent_state",
2998
2998
  "avatar_stream_ready",
2999
2999
  "avatar_active",
@@ -3028,9 +3028,9 @@ const xo = /* @__PURE__ */ new Set([
3028
3028
  // to onAgentCommand.
3029
3029
  "task_field_updated",
3030
3030
  "task_completed"
3031
- ]), fr = on(
3031
+ ]), br = un(
3032
3032
  function(t, n) {
3033
- var bn, wn, _n, xn, kn, Ln, Cn;
3033
+ var kn, Ln, Sn, En, An, Nn, Mn;
3034
3034
  const {
3035
3035
  agentId: i,
3036
3036
  apiKey: l,
@@ -3049,83 +3049,83 @@ const xo = /* @__PURE__ */ new Set([
3049
3049
  // minimized produced). The card sizing now lives in CSS — see
3050
3050
  // .ll-expanded--mobile in styles.css.
3051
3051
  defaultDisplayMode: m = "expanded",
3052
- onDisplayModeChange: D,
3052
+ onDisplayModeChange: P,
3053
3053
  position: x = "bottom-right",
3054
- mobileBreakpoint: C = 640,
3054
+ mobileBreakpoint: L = 640,
3055
3055
  draggable: y,
3056
3056
  resizable: w,
3057
- persistKey: P = "ll-widget",
3057
+ persistKey: D = "ll-widget",
3058
3058
  disablePersistence: E = !1,
3059
3059
  teamMembers: b,
3060
3060
  currentTeamMemberId: O,
3061
3061
  onTeamMemberChange: v,
3062
3062
  idleLoopUrl: z,
3063
3063
  greeting: B,
3064
- avatarImageUrl: J,
3065
- agentName: le,
3064
+ avatarImageUrl: Z,
3065
+ agentName: ae,
3066
3066
  branding: H = {},
3067
- allowCamera: G = !0,
3067
+ allowCamera: X = !0,
3068
3068
  allowScreenShare: f = !0,
3069
- allowTyping: A = !0,
3069
+ allowTyping: N = !0,
3070
3070
  blurUntilFirstSpeech: $ = !0,
3071
- showMinimize: q,
3072
- showClose: X,
3073
- chromeless: te = !1,
3071
+ showMinimize: U,
3072
+ showClose: K,
3073
+ chromeless: re = !1,
3074
3074
  floatingChromeContainer: W = null,
3075
- compactControls: ne = !1,
3076
- transforming: ie = !1,
3077
- transformingLabel: U = "Transforming…",
3075
+ compactControls: ie = !1,
3076
+ transforming: le = !1,
3077
+ transformingLabel: j = "Transforming…",
3078
3078
  showOn: ge,
3079
- hideOn: Z,
3079
+ hideOn: Q,
3080
3080
  pathname: Le,
3081
- onNavigate: re,
3082
- onScrollToSelector: Me,
3083
- getPageContext: st,
3084
- pageContextExtras: _t,
3085
- getRoutes: xt,
3086
- onScrollPage: ct,
3087
- onClick: kt,
3088
- capabilities: Ye,
3089
- onConnect: Ge,
3090
- onDisconnect: $e,
3091
- onTranscript: He,
3092
- onAgentState: Oe,
3093
- onConnectionStateChange: Fe,
3094
- onAgentEvent: Be,
3095
- onAgentCommand: Xe,
3096
- onCollect: We,
3081
+ onNavigate: oe,
3082
+ onScrollToSelector: Ie,
3083
+ getPageContext: dt,
3084
+ pageContextExtras: kt,
3085
+ getRoutes: Lt,
3086
+ onScrollPage: ft,
3087
+ onClick: St,
3088
+ capabilities: Ke,
3089
+ onConnect: Je,
3090
+ onDisconnect: Fe,
3091
+ onTranscript: Be,
3092
+ onAgentState: We,
3093
+ onConnectionStateChange: qe,
3094
+ onAgentEvent: Ue,
3095
+ onAgentCommand: Ze,
3096
+ onCollect: je,
3097
3097
  controlledSession: F,
3098
- className: qe,
3099
- style: Ke,
3100
- zIndex: Ce = 2147483647
3101
- } = t, Lt = ii(Le), ut = di(Lt, ge, Z);
3102
- I(() => {
3103
- no(), so();
3104
- }, [Lt]);
3105
- const Ie = O !== void 0, [dt, Ct] = M(() => {
3098
+ className: Ve,
3099
+ style: Qe,
3100
+ zIndex: Se = 2147483647
3101
+ } = t, Et = pi(Le), pt = wi(Et, ge, Q);
3102
+ T(() => {
3103
+ fo(), vo();
3104
+ }, [Et]);
3105
+ const Te = O !== void 0, [ht, At] = M(() => {
3106
3106
  var h;
3107
3107
  return O ?? ((h = b == null ? void 0 : b[0]) == null ? void 0 : h.id);
3108
- }), Ue = Ie ? O : dt, ue = at(
3109
- () => (b == null ? void 0 : b.find((h) => h.id === Ue)) ?? null,
3110
- [b, Ue]
3111
- ), St = (ue == null ? void 0 : ue.agentId) ?? i, de = d === "EMBEDDED", ve = Kr(C), [Je, Ze] = Gr({
3108
+ }), Ye = Te ? O : ht, fe = ut(
3109
+ () => (b == null ? void 0 : b.find((h) => h.id === Ye)) ?? null,
3110
+ [b, Ye]
3111
+ ), Nt = (fe == null ? void 0 : fe.agentId) ?? i, pe = d === "EMBEDDED", be = oi(L), [et, tt] = ri({
3112
3112
  value: p,
3113
3113
  defaultValue: m,
3114
- onChange: D,
3115
- persistKey: P,
3116
- disablePersistence: de || E
3117
- }), pe = de ? "expanded" : Je, be = de ? () => {
3118
- } : Ze, Et = q ?? !de, At = X ?? !de, Nt = ne || !de && ve, _e = ni({
3119
- draggable: !de && (y ?? !ve),
3120
- resizable: !de && (w ?? !ve),
3121
- persistKey: P,
3122
- disablePersistence: de || E
3123
- }), Re = zr(), Ae = Fr(), Te = Br(), ft = Wr(), [Pe, Se] = M(!1), [Qe, pt] = M(!1), [ht, et] = M(!1), [k, ae] = M(!1), [qt, pr] = M(!1), Mt = pi({ baseUrl: o, config: c }), It = R(Mt);
3124
- It.current = Mt;
3125
- const Ut = R(re), jt = R(Me), Vt = R(ct), Yt = R(kt), cn = R(st), un = R(_t), dn = R(xt), Gt = R(Ye), Ee = R(null);
3126
- Ut.current = re, jt.current = Me, Vt.current = ct, Yt.current = kt, cn.current = st, un.current = _t, dn.current = xt, Gt.current = Ye;
3127
- function xe(h) {
3128
- const u = Gt.current;
3114
+ onChange: P,
3115
+ persistKey: D,
3116
+ disablePersistence: pe || E
3117
+ }), me = pe ? "expanded" : et, we = pe ? () => {
3118
+ } : tt, Mt = U ?? !pe, It = K ?? !pe, Tt = ie || !pe && be, xe = di({
3119
+ draggable: !pe && (y ?? !be),
3120
+ resizable: !pe && (w ?? !be),
3121
+ persistKey: D,
3122
+ disablePersistence: pe || E
3123
+ }), Re = jr(), Ne = Xr(), De = Kr(), mt = Jr(), [Pe, Ee] = M(!1), [nt, gt] = M(!1), [yt, rt] = M(!1), [C, se] = M(!1), [Yt, wr] = M(!1), Rt = xi({ baseUrl: o, config: c }), Dt = R(Rt);
3124
+ Dt.current = Rt;
3125
+ const Gt = R(oe), Xt = R(Ie), Kt = R(ft), Jt = R(St), hn = R(dt), mn = R(kt), gn = R(Lt), Zt = R(Ke), Ae = R(null);
3126
+ Gt.current = oe, Xt.current = Ie, Kt.current = ft, Jt.current = St, hn.current = dt, mn.current = kt, gn.current = Lt, Zt.current = Ke;
3127
+ function Ce(h) {
3128
+ const u = Zt.current;
3129
3129
  return u ? u.includes(h) : !0;
3130
3130
  }
3131
3131
  function ke(h, u) {
@@ -3133,67 +3133,67 @@ const xo = /* @__PURE__ */ new Set([
3133
3133
  `[LiveLayer] Agent command "${h}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
3134
3134
  );
3135
3135
  }
3136
- const mt = L(
3136
+ const vt = k(
3137
3137
  (h) => {
3138
- var Q, fe, Ne, yt, De, Sn;
3138
+ var ee, he, Me, wt, ze, In, Tn;
3139
3139
  const u = h;
3140
3140
  if (!(!u.type || typeof u.type != "string")) {
3141
- if (Be == null || Be({ eventName: u.type, data: h }), u.type === "navigate") {
3142
- if (!xe("navigate")) {
3141
+ if (Ue == null || Ue({ eventName: u.type, data: h }), u.type === "navigate") {
3142
+ if (!Ce("navigate")) {
3143
3143
  ke("navigate", "navigate");
3144
3144
  return;
3145
3145
  }
3146
- const N = typeof u.href == "string" ? u.href : null;
3147
- if (!N) {
3146
+ const A = typeof u.href == "string" ? u.href : null;
3147
+ if (!A) {
3148
3148
  console.warn(
3149
3149
  `[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
3150
3150
  );
3151
3151
  return;
3152
3152
  }
3153
- if (It.current.playPageChange(), Ut.current) {
3153
+ if (Dt.current.playPageChange(), Gt.current) {
3154
3154
  try {
3155
- Ut.current(N);
3156
- } catch (T) {
3155
+ Gt.current(A);
3156
+ } catch (I) {
3157
3157
  console.warn(
3158
- `[LiveLayer] onNavigate threw for "${N}". Falling back. Error:`,
3159
- T
3158
+ `[LiveLayer] onNavigate threw for "${A}". Falling back. Error:`,
3159
+ I
3160
3160
  );
3161
3161
  }
3162
3162
  return;
3163
3163
  }
3164
3164
  if (typeof document < "u") {
3165
- const T = document.querySelector(
3166
- `a[href="${N.replace(/"/g, '\\"')}"]`
3165
+ const I = document.querySelector(
3166
+ `a[href="${A.replace(/"/g, '\\"')}"]`
3167
3167
  );
3168
- if (T) {
3169
- T.click();
3168
+ if (I) {
3169
+ I.click();
3170
3170
  return;
3171
3171
  }
3172
3172
  }
3173
3173
  if (typeof window < "u" && typeof history < "u")
3174
3174
  try {
3175
- history.pushState({}, "", N), window.dispatchEvent(new PopStateEvent("popstate"));
3176
- } catch (T) {
3175
+ history.pushState({}, "", A), window.dispatchEvent(new PopStateEvent("popstate"));
3176
+ } catch (I) {
3177
3177
  console.warn(
3178
- `[LiveLayer] history.pushState fallback failed for "${N}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
3179
- T
3178
+ `[LiveLayer] history.pushState fallback failed for "${A}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
3179
+ I
3180
3180
  );
3181
3181
  }
3182
3182
  return;
3183
3183
  }
3184
3184
  if (u.type === "scroll_to") {
3185
- if (!xe("scroll")) {
3185
+ if (!Ce("scroll")) {
3186
3186
  ke("scroll_to", "scroll");
3187
3187
  return;
3188
3188
  }
3189
- const N = typeof u.selector == "string" ? u.selector : null;
3190
- if (!N) return;
3191
- const T = u.behavior === "instant" ? "instant" : "smooth";
3192
- if (jt.current) {
3189
+ const A = typeof u.selector == "string" ? u.selector : null;
3190
+ if (!A) return;
3191
+ const I = u.behavior === "instant" ? "instant" : "smooth";
3192
+ if (Xt.current) {
3193
3193
  try {
3194
- jt.current(
3195
- N,
3196
- T
3194
+ Xt.current(
3195
+ A,
3196
+ I
3197
3197
  );
3198
3198
  } catch (Y) {
3199
3199
  console.warn("[LiveLayer] onScrollToSelector threw.", Y);
@@ -3203,206 +3203,206 @@ const xo = /* @__PURE__ */ new Set([
3203
3203
  if (typeof document < "u") {
3204
3204
  let Y = null;
3205
3205
  try {
3206
- Y = document.querySelector(N);
3206
+ Y = document.querySelector(A);
3207
3207
  } catch {
3208
3208
  console.warn(
3209
- `[LiveLayer] scroll_to: invalid selector "${N}".`
3209
+ `[LiveLayer] scroll_to: invalid selector "${A}".`
3210
3210
  );
3211
3211
  return;
3212
3212
  }
3213
3213
  if (!Y) {
3214
3214
  console.warn(
3215
- `[LiveLayer] scroll_to: no element matched "${N}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
3215
+ `[LiveLayer] scroll_to: no element matched "${A}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
3216
3216
  );
3217
3217
  return;
3218
3218
  }
3219
3219
  Y.scrollIntoView({
3220
- behavior: T,
3220
+ behavior: I,
3221
3221
  block: "start"
3222
3222
  });
3223
3223
  }
3224
3224
  return;
3225
3225
  }
3226
3226
  if (u.type === "request_page_context") {
3227
- if (!xe("read_page")) {
3227
+ if (!Ce("read_page")) {
3228
3228
  ke("request_page_context", "read_page");
3229
3229
  return;
3230
3230
  }
3231
- const N = typeof u.requestId == "string" ? u.requestId : void 0, T = (Q = Ee.current) == null ? void 0 : Q.call(Ee), Y = (ee) => {
3232
- const V = T, he = V == null ? void 0 : V.localParticipant;
3233
- if (he != null && he.publishData)
3231
+ const A = typeof u.requestId == "string" ? u.requestId : void 0, I = (ee = Ae.current) == null ? void 0 : ee.call(Ae), Y = (ne) => {
3232
+ const q = I, ye = q == null ? void 0 : q.localParticipant;
3233
+ if (ye != null && ye.publishData)
3234
3234
  try {
3235
- const me = N ? { ...ee, requestId: N } : ee, oe = new TextEncoder().encode(JSON.stringify(me));
3236
- he.publishData(oe, { reliable: !0 });
3237
- } catch (me) {
3238
- console.warn("[LiveLayer] publishData failed.", me);
3235
+ const ve = A ? { ...ne, requestId: A } : ne, Ht = new TextEncoder().encode(JSON.stringify(ve));
3236
+ ye.publishData(Ht, { reliable: !0 });
3237
+ } catch (ve) {
3238
+ console.warn("[LiveLayer] publishData failed.", ve);
3239
3239
  }
3240
- }, j = un.current, K = cn.current;
3240
+ }, V = mn.current, te = hn.current;
3241
3241
  try {
3242
- if (K) {
3243
- const ee = K(j);
3244
- if (ee instanceof Promise) {
3245
- Y({ type: "page_context_pending" }), ee.then((V) => Y({ type: "page_context", context: V })).catch((V) => {
3242
+ if (te) {
3243
+ const ne = te(V);
3244
+ if (ne instanceof Promise) {
3245
+ Y({ type: "page_context_pending" }), ne.then((q) => Y({ type: "page_context", context: q })).catch((q) => {
3246
3246
  console.warn(
3247
3247
  "[LiveLayer] getPageContext rejected; falling back to default walker.",
3248
- V
3248
+ q
3249
3249
  ), Y({
3250
3250
  type: "page_context",
3251
- context: Xn(j)
3251
+ context: nr(V)
3252
3252
  });
3253
3253
  });
3254
3254
  return;
3255
3255
  }
3256
- Y({ type: "page_context", context: ee });
3256
+ Y({ type: "page_context", context: ne });
3257
3257
  return;
3258
3258
  }
3259
3259
  Y({
3260
3260
  type: "page_context",
3261
- context: Xn(j)
3261
+ context: nr(V)
3262
3262
  });
3263
- } catch (ee) {
3263
+ } catch (ne) {
3264
3264
  console.warn(
3265
3265
  "[LiveLayer] page-context extraction threw. Sending empty context.",
3266
- ee
3266
+ ne
3267
3267
  ), Y({
3268
3268
  type: "page_context",
3269
- context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: j }
3269
+ context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: V }
3270
3270
  });
3271
3271
  }
3272
3272
  return;
3273
3273
  }
3274
3274
  if (u.type === "scroll_page") {
3275
- if (!xe("scroll")) {
3275
+ if (!Ce("scroll")) {
3276
3276
  ke("scroll_page", "scroll");
3277
3277
  return;
3278
3278
  }
3279
- const N = u.direction;
3280
- if (N !== "up" && N !== "down" && N !== "top" && N !== "bottom") {
3279
+ const A = u.direction;
3280
+ if (A !== "up" && A !== "down" && A !== "top" && A !== "bottom") {
3281
3281
  console.warn(
3282
- `[LiveLayer] scroll_page: invalid direction "${String(N)}". Expected up | down | top | bottom.`
3282
+ `[LiveLayer] scroll_page: invalid direction "${String(A)}". Expected up | down | top | bottom.`
3283
3283
  );
3284
3284
  return;
3285
3285
  }
3286
- const T = u.behavior === "instant" ? "instant" : "smooth";
3287
- if (Vt.current) {
3286
+ const I = u.behavior === "instant" ? "instant" : "smooth";
3287
+ if (Kt.current) {
3288
3288
  try {
3289
- Vt.current(
3290
- N,
3291
- T
3289
+ Kt.current(
3290
+ A,
3291
+ I
3292
3292
  );
3293
- } catch (V) {
3294
- console.warn("[LiveLayer] onScrollPage threw.", V);
3293
+ } catch (q) {
3294
+ console.warn("[LiveLayer] onScrollPage threw.", q);
3295
3295
  }
3296
3296
  return;
3297
3297
  }
3298
3298
  if (typeof window > "u") return;
3299
- const Y = { behavior: T }, j = wo(), K = (V) => {
3300
- j instanceof Window ? j.scrollBy({ top: V, ...Y }) : j.scrollBy({ top: V, ...Y });
3301
- }, ee = (V) => {
3302
- j instanceof Window ? j.scrollTo({ top: V, ...Y }) : j.scrollTo({ top: V, ...Y });
3299
+ const Y = { behavior: I }, V = No(), te = (q) => {
3300
+ V instanceof Window ? V.scrollBy({ top: q, ...Y }) : V.scrollBy({ top: q, ...Y });
3301
+ }, ne = (q) => {
3302
+ V instanceof Window ? V.scrollTo({ top: q, ...Y }) : V.scrollTo({ top: q, ...Y });
3303
3303
  };
3304
- N === "up" ? K(-Zn(j)) : N === "down" ? K(Zn(j)) : ee(N === "top" ? 0 : _o(j));
3304
+ A === "up" ? te(-or(V)) : A === "down" ? te(or(V)) : ne(A === "top" ? 0 : Mo(V));
3305
3305
  return;
3306
3306
  }
3307
3307
  if (u.type === "click") {
3308
- if (!xe("click")) {
3308
+ if (!Ce("click")) {
3309
3309
  ke("click", "click");
3310
3310
  return;
3311
3311
  }
3312
- const N = typeof u.selector == "string" ? u.selector : null;
3313
- if (!N) {
3312
+ const A = typeof u.selector == "string" ? u.selector : null;
3313
+ if (!A) {
3314
3314
  console.warn("[LiveLayer] click: missing selector.");
3315
3315
  return;
3316
3316
  }
3317
- if (Yt.current) {
3317
+ if (Jt.current) {
3318
3318
  try {
3319
- Yt.current(N);
3319
+ Jt.current(A);
3320
3320
  } catch (Y) {
3321
3321
  console.warn("[LiveLayer] onClick threw.", Y);
3322
3322
  }
3323
3323
  return;
3324
3324
  }
3325
3325
  if (typeof document > "u") return;
3326
- let T = null;
3326
+ let I = null;
3327
3327
  try {
3328
- T = document.querySelector(N);
3328
+ I = document.querySelector(A);
3329
3329
  } catch {
3330
3330
  console.warn(
3331
- `[LiveLayer] click: invalid selector "${N}".`
3331
+ `[LiveLayer] click: invalid selector "${A}".`
3332
3332
  );
3333
3333
  return;
3334
3334
  }
3335
- if (!T) {
3335
+ if (!I) {
3336
3336
  console.warn(
3337
- `[LiveLayer] click: no element matched "${N}". See https://livelayer.studio/docs/errors/click-no-match`
3337
+ `[LiveLayer] click: no element matched "${A}". See https://livelayer.studio/docs/errors/click-no-match`
3338
3338
  );
3339
3339
  return;
3340
3340
  }
3341
- if (T.closest('[data-ll-private="true"], .ll-widget')) {
3341
+ if (I.closest('[data-ll-private="true"], .ll-widget')) {
3342
3342
  console.warn(
3343
3343
  "[LiveLayer] click: refusing to click element inside a private subtree."
3344
3344
  );
3345
3345
  return;
3346
3346
  }
3347
- (fe = T.click) == null || fe.call(T);
3347
+ (he = I.click) == null || he.call(I);
3348
3348
  return;
3349
3349
  }
3350
3350
  if (u.type === "advance_step" || u.type === "go_back" || u.type === "submit_flow") {
3351
- if (!xe("click")) {
3351
+ if (!Ce("click")) {
3352
3352
  ke(u.type, "click");
3353
3353
  return;
3354
3354
  }
3355
3355
  if (typeof document > "u") return;
3356
- const N = u.type === "advance_step" ? "ll-advance" : u.type === "go_back" ? "ll-back" : "ll-submit";
3357
- let T = Un(N);
3358
- if (T || (ur(document), T = Un(N)), !T) {
3359
- console.warn(`[LiveLayer] ${u.type}: no "${N}" control found.`);
3356
+ const A = u.type === "advance_step" ? "ll-advance" : u.type === "go_back" ? "ll-back" : "ll-submit";
3357
+ let I = Jn(A);
3358
+ if (I || (yr(document), I = Jn(A)), !I) {
3359
+ console.warn(`[LiveLayer] ${u.type}: no "${A}" control found.`);
3360
3360
  return;
3361
3361
  }
3362
- (Ne = T.click) == null || Ne.call(T);
3362
+ (Me = I.click) == null || Me.call(I);
3363
3363
  return;
3364
3364
  }
3365
3365
  if (u.type === "fill_form" || u.type === "focus_field") {
3366
- if (!xe("fill_forms")) {
3366
+ if (!Ce("fill_forms")) {
3367
3367
  ke(u.type, "fill_forms");
3368
3368
  return;
3369
3369
  }
3370
3370
  if (typeof document > "u") return;
3371
- u.type === "fill_form" && It.current.playConfirmation();
3372
- const N = typeof u.formId == "string" ? u.formId : null;
3373
- if (!N) {
3371
+ u.type === "fill_form" && Dt.current.playConfirmation();
3372
+ const A = typeof u.formId == "string" ? u.formId : null;
3373
+ if (!A) {
3374
3374
  console.warn(`[LiveLayer] ${u.type}: missing formId.`);
3375
3375
  return;
3376
3376
  }
3377
- const T = Jn(document, N);
3378
- if (!T) {
3377
+ const I = ir(document, A);
3378
+ if (!I) {
3379
3379
  console.warn(
3380
- `[LiveLayer] ${u.type}: no <form> matched id="${N}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
3380
+ `[LiveLayer] ${u.type}: no <form> matched id="${A}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
3381
3381
  );
3382
3382
  return;
3383
3383
  }
3384
- if (T.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
3384
+ if (I.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
3385
3385
  console.warn(
3386
3386
  `[LiveLayer] ${u.type}: refusing to touch a form in a private / opted-out subtree.`
3387
3387
  );
3388
3388
  return;
3389
3389
  }
3390
3390
  if (u.type === "focus_field") {
3391
- const j = typeof u.fieldName == "string" ? u.fieldName : null;
3392
- if (!j) {
3391
+ const V = typeof u.fieldName == "string" ? u.fieldName : null;
3392
+ if (!V) {
3393
3393
  console.warn("[LiveLayer] focus_field: missing fieldName.");
3394
3394
  return;
3395
3395
  }
3396
- const K = Kn(T, j);
3397
- if (K.el === null) {
3398
- K.reason === "private" ? console.warn(
3399
- `[LiveLayer] focus_field: field "${j}" is privacy-protected and not focusable.`
3396
+ const te = rr(I, V);
3397
+ if (te.el === null) {
3398
+ te.reason === "private" ? console.warn(
3399
+ `[LiveLayer] focus_field: field "${V}" is privacy-protected and not focusable.`
3400
3400
  ) : console.warn(
3401
- `[LiveLayer] focus_field: no input matching key="${j}" in form "${N}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
3401
+ `[LiveLayer] focus_field: no input matching key="${V}" in form "${A}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
3402
3402
  );
3403
3403
  return;
3404
3404
  }
3405
- K.el.focus();
3405
+ te.el.focus();
3406
3406
  return;
3407
3407
  }
3408
3408
  const Y = u.values && typeof u.values == "object" ? u.values : null;
@@ -3410,171 +3410,210 @@ const xo = /* @__PURE__ */ new Set([
3410
3410
  console.warn("[LiveLayer] fill_form: missing or invalid values.");
3411
3411
  return;
3412
3412
  }
3413
- for (const [j, K] of Object.entries(Y)) {
3414
- if (typeof K != "string") continue;
3415
- const ee = Kn(T, j);
3416
- if (ee.el === null) {
3417
- ee.reason === "private" ? console.warn(
3418
- `[LiveLayer] fill_form: field "${j}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
3413
+ for (const [V, te] of Object.entries(Y)) {
3414
+ if (typeof te != "string") continue;
3415
+ const ne = rr(I, V);
3416
+ if (ne.el === null) {
3417
+ ne.reason === "private" ? console.warn(
3418
+ `[LiveLayer] fill_form: field "${V}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
3419
3419
  ) : console.warn(
3420
- `[LiveLayer] fill_form: no input matching key="${j}" in form "${N}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
3420
+ `[LiveLayer] fill_form: no input matching key="${V}" in form "${A}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
3421
3421
  );
3422
3422
  continue;
3423
3423
  }
3424
3424
  try {
3425
- mo(ee.el, K);
3426
- } catch (V) {
3425
+ ko(ne.el, te);
3426
+ } catch (q) {
3427
3427
  console.warn(
3428
- `[LiveLayer] fill_form: failed to set "${j}".`,
3429
- V
3428
+ `[LiveLayer] fill_form: failed to set "${V}".`,
3429
+ q
3430
3430
  );
3431
3431
  }
3432
3432
  }
3433
3433
  return;
3434
3434
  }
3435
3435
  if (u.type === "submit_form") {
3436
- if (!xe("submit_forms")) {
3436
+ if (!Ce("submit_forms")) {
3437
3437
  ke("submit_form", "submit_forms");
3438
3438
  return;
3439
3439
  }
3440
3440
  if (typeof document > "u") return;
3441
- const N = typeof u.formId == "string" ? u.formId : null;
3442
- if (!N) {
3441
+ const A = typeof u.formId == "string" ? u.formId : null;
3442
+ if (!A) {
3443
3443
  console.warn("[LiveLayer] submit_form: missing formId.");
3444
3444
  return;
3445
3445
  }
3446
- It.current.playConfirmation();
3447
- const T = Jn(document, N);
3448
- if (!T) {
3446
+ Dt.current.playConfirmation();
3447
+ const I = ir(document, A);
3448
+ if (!I) {
3449
3449
  console.warn(
3450
- `[LiveLayer] submit_form: no <form> matched id="${N}" (or matching name / data-ll-intent slug).`
3450
+ `[LiveLayer] submit_form: no <form> matched id="${A}" (or matching name / data-ll-intent slug).`
3451
3451
  );
3452
3452
  return;
3453
3453
  }
3454
- if (T.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
3454
+ if (I.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
3455
3455
  console.warn(
3456
3456
  "[LiveLayer] submit_form: refusing to submit a form in a private / opted-out subtree."
3457
3457
  );
3458
3458
  return;
3459
3459
  }
3460
- const Y = typeof u.requestId == "string" ? u.requestId : void 0, j = (yt = Ee.current) == null ? void 0 : yt.call(Ee), K = (oe) => {
3461
- const ye = j, je = ye == null ? void 0 : ye.localParticipant;
3462
- if (je != null && je.publishData)
3460
+ const Y = typeof u.requestId == "string" ? u.requestId : void 0, V = (wt = Ae.current) == null ? void 0 : wt.call(Ae), te = (G) => {
3461
+ const J = V, ue = J == null ? void 0 : J.localParticipant;
3462
+ if (ue != null && ue.publishData)
3463
3463
  try {
3464
- const Dt = Y ? { ...oe, requestId: Y } : oe, zt = new TextEncoder().encode(JSON.stringify(Dt));
3465
- je.publishData(zt, { reliable: !0 });
3464
+ const He = Y ? { ...G, requestId: Y } : G, Ge = new TextEncoder().encode(JSON.stringify(He));
3465
+ ue.publishData(Ge, { reliable: !0 });
3466
3466
  } catch {
3467
3467
  }
3468
- }, ee = (oe) => {
3469
- var zt, En, An, Nn;
3470
- const ye = oe, je = (zt = ye.getAttribute) == null ? void 0 : zt.call(ye, "aria-label");
3471
- if (je) return je;
3472
- const Dt = ye.id;
3473
- if (Dt) {
3474
- const $t = (En = T.ownerDocument) == null ? void 0 : En.querySelector(`label[for="${Dt}"]`);
3475
- if ((An = $t == null ? void 0 : $t.textContent) != null && An.trim()) return $t.textContent.trim();
3468
+ }, ne = (G) => {
3469
+ var Ge, Ft, Pn, zn;
3470
+ const J = G, ue = (Ge = J.getAttribute) == null ? void 0 : Ge.call(J, "aria-label");
3471
+ if (ue) return ue;
3472
+ const He = J.id;
3473
+ if (He) {
3474
+ const Bt = (Ft = I.ownerDocument) == null ? void 0 : Ft.querySelector(`label[for="${He}"]`);
3475
+ if ((Pn = Bt == null ? void 0 : Bt.textContent) != null && Pn.trim()) return Bt.textContent.trim();
3476
3476
  }
3477
- return ((Nn = ye.getAttribute) == null ? void 0 : Nn.call(ye, "name")) || ye.id || ye.type || "field";
3478
- }, V = () => {
3477
+ return ((zn = J.getAttribute) == null ? void 0 : zn.call(J, "name")) || J.id || J.type || "field";
3478
+ }, q = () => {
3479
3479
  try {
3480
- return Array.from(T.elements).filter(
3481
- (oe) => "willValidate" in oe && oe.willValidate && !oe.checkValidity()
3482
- ).map((oe) => `${ee(oe)}: ${oe.validationMessage}`);
3480
+ return Array.from(I.elements).filter(
3481
+ (G) => "willValidate" in G && G.willValidate && !G.checkValidity()
3482
+ ).map((G) => `${ne(G)}: ${G.validationMessage}`);
3483
3483
  } catch {
3484
3484
  return [];
3485
3485
  }
3486
3486
  };
3487
- if (typeof T.checkValidity == "function" && !T.checkValidity()) {
3487
+ if (typeof I.checkValidity == "function" && !I.checkValidity()) {
3488
3488
  try {
3489
- (De = T.reportValidity) == null || De.call(T);
3489
+ (ze = I.reportValidity) == null || ze.call(I);
3490
3490
  } catch {
3491
3491
  }
3492
- K({
3492
+ te({
3493
3493
  type: "form_submit_blocked",
3494
- formId: N,
3494
+ formId: A,
3495
3495
  reason: "validation",
3496
- invalidFields: V()
3496
+ invalidFields: q()
3497
3497
  });
3498
3498
  return;
3499
3499
  }
3500
- let he = !1;
3501
- const me = (oe) => {
3502
- he = !0, queueMicrotask(() => {
3503
- oe.defaultPrevented ? K({ type: "form_submit_uncertain", formId: N, reason: "spa_prevented" }) : K({ type: "form_submitted", formId: N });
3500
+ const ye = (G) => {
3501
+ var ue;
3502
+ const J = (ue = G.tagName) == null ? void 0 : ue.toLowerCase();
3503
+ if (J === "textarea" || J === "select") return !0;
3504
+ if (J === "input") {
3505
+ const He = (G.type || "text").toLowerCase();
3506
+ return !["hidden", "submit", "button", "reset", "file", "image"].includes(He);
3507
+ }
3508
+ return !1;
3509
+ }, ve = (G) => {
3510
+ var ue;
3511
+ const J = G;
3512
+ return ((ue = G.tagName) == null ? void 0 : ue.toLowerCase()) === "input" && (J.type === "checkbox" || J.type === "radio") ? J.checked ? "on" : "" : (J.value || "").trim();
3513
+ }, Ht = Array.from(I.elements).filter(
3514
+ (G) => ye(G) && ve(G).length > 0
3515
+ ), Rn = /(thank you|thanks|we'?ll be in touch|message sent|message has been sent|successfully|submission received|got your message|we received|talk soon|be in touch)/i, Dr = (((In = I.parentElement) == null ? void 0 : In.textContent) || "").toLowerCase();
3516
+ let Dn = !1, Ot = !1;
3517
+ const $e = (G) => {
3518
+ Ot || (Ot = !0, te(G));
3519
+ }, Pr = () => {
3520
+ const G = Date.now(), J = () => {
3521
+ var Ge;
3522
+ if (Ot) return;
3523
+ const ue = q();
3524
+ if (ue.length > 0) {
3525
+ $e({ type: "form_submit_blocked", formId: A, reason: "validation", invalidFields: ue });
3526
+ return;
3527
+ }
3528
+ if (!I.isConnected) {
3529
+ $e({ type: "form_submitted", formId: A, reason: "form_removed" });
3530
+ return;
3531
+ }
3532
+ if (Ht.length > 0 && Ht.every((Ft) => ve(Ft).length === 0)) {
3533
+ $e({ type: "form_submitted", formId: A, reason: "form_reset" });
3534
+ return;
3535
+ }
3536
+ const He = (((Ge = I.parentElement) == null ? void 0 : Ge.textContent) || "").toLowerCase();
3537
+ if (Rn.test(He) && !Rn.test(Dr)) {
3538
+ $e({ type: "form_submitted", formId: A, reason: "success_text" });
3539
+ return;
3540
+ }
3541
+ Date.now() - G < 2e3 ? setTimeout(J, 250) : $e({ type: "form_submit_uncertain", formId: A, reason: "spa_prevented" });
3542
+ };
3543
+ setTimeout(J, 200);
3544
+ }, en = (G) => {
3545
+ Dn = !0, queueMicrotask(() => {
3546
+ G.defaultPrevented ? Pr() : $e({ type: "form_submitted", formId: A });
3504
3547
  });
3505
3548
  };
3506
- T.addEventListener("submit", me, { once: !0 });
3549
+ I.addEventListener("submit", en, { once: !0 });
3507
3550
  try {
3508
- typeof T.requestSubmit == "function" ? T.requestSubmit() : T.submit();
3509
- } catch (oe) {
3510
- console.warn("[LiveLayer] submit_form: requestSubmit threw.", oe), T.removeEventListener("submit", me), K({
3511
- type: "form_submit_blocked",
3512
- formId: N,
3513
- reason: "exception"
3514
- });
3551
+ typeof I.requestSubmit == "function" ? I.requestSubmit() : I.submit();
3552
+ } catch (G) {
3553
+ console.warn("[LiveLayer] submit_form: requestSubmit threw.", G), I.removeEventListener("submit", en), $e({ type: "form_submit_blocked", formId: A, reason: "exception" });
3515
3554
  return;
3516
3555
  }
3517
3556
  setTimeout(() => {
3518
- he || (T.removeEventListener("submit", me), K({
3557
+ !Dn && !Ot && (I.removeEventListener("submit", en), $e({
3519
3558
  type: "form_submit_blocked",
3520
- formId: N,
3559
+ formId: A,
3521
3560
  reason: "validation",
3522
- invalidFields: V()
3561
+ invalidFields: q()
3523
3562
  }));
3524
3563
  }, 500);
3525
3564
  return;
3526
3565
  }
3527
3566
  if (u.type === "request_routes") {
3528
- if (!xe("read_page")) {
3567
+ if (!Ce("read_page")) {
3529
3568
  ke("request_routes", "read_page");
3530
3569
  return;
3531
3570
  }
3532
- const N = typeof u.requestId == "string" ? u.requestId : void 0, Y = (Sn = Ee.current) == null ? void 0 : Sn.call(Ee), j = Y == null ? void 0 : Y.localParticipant;
3533
- if (!(j != null && j.publishData)) return;
3534
- const K = (V) => {
3571
+ const A = typeof u.requestId == "string" ? u.requestId : void 0, Y = (Tn = Ae.current) == null ? void 0 : Tn.call(Ae), V = Y == null ? void 0 : Y.localParticipant;
3572
+ if (!(V != null && V.publishData)) return;
3573
+ const te = (q) => {
3535
3574
  try {
3536
- const he = N ? { type: "routes", routes: V, requestId: N } : { type: "routes", routes: V }, me = new TextEncoder().encode(JSON.stringify(he));
3537
- j.publishData(me, { reliable: !0 });
3538
- } catch (he) {
3539
- console.warn("[LiveLayer] request_routes: publishData failed.", he);
3575
+ const ye = A ? { type: "routes", routes: q, requestId: A } : { type: "routes", routes: q }, ve = new TextEncoder().encode(JSON.stringify(ye));
3576
+ V.publishData(ve, { reliable: !0 });
3577
+ } catch (ye) {
3578
+ console.warn("[LiveLayer] request_routes: publishData failed.", ye);
3540
3579
  }
3541
- }, ee = dn.current;
3542
- if (ee) {
3580
+ }, ne = gn.current;
3581
+ if (ne) {
3543
3582
  try {
3544
- const V = ee(), he = (me) => {
3545
- if (!Array.isArray(me)) {
3546
- K([]);
3583
+ const q = ne(), ye = (ve) => {
3584
+ if (!Array.isArray(ve)) {
3585
+ te([]);
3547
3586
  return;
3548
3587
  }
3549
- K(me.map(io).slice(0, 200));
3588
+ te(ve.map(ho).slice(0, 200));
3550
3589
  };
3551
- V instanceof Promise ? V.then(he).catch((me) => {
3590
+ q instanceof Promise ? q.then(ye).catch((ve) => {
3552
3591
  console.warn(
3553
3592
  "[LiveLayer] getRoutes rejected; falling back to DOM walker.",
3554
- me
3555
- ), K(Qt());
3556
- }) : he(V);
3557
- } catch (V) {
3593
+ ve
3594
+ ), te(on());
3595
+ }) : ye(q);
3596
+ } catch (q) {
3558
3597
  console.warn(
3559
3598
  "[LiveLayer] getRoutes threw; falling back to DOM walker.",
3560
- V
3561
- ), K(Qt());
3599
+ q
3600
+ ), te(on());
3562
3601
  }
3563
3602
  return;
3564
3603
  }
3565
3604
  try {
3566
- K(Qt());
3567
- } catch (V) {
3568
- console.warn("[LiveLayer] request_routes: extractRoutes threw.", V);
3605
+ te(on());
3606
+ } catch (q) {
3607
+ console.warn("[LiveLayer] request_routes: extractRoutes threw.", q);
3569
3608
  }
3570
3609
  return;
3571
3610
  }
3572
3611
  if (u.type === "task_field_updated") {
3573
- if (!xe("collect_data")) {
3612
+ if (!Ce("collect_data")) {
3574
3613
  ke("task_field_updated", "collect_data");
3575
3614
  return;
3576
3615
  }
3577
- const N = {
3616
+ const A = {
3578
3617
  phase: "field",
3579
3618
  fieldId: typeof u.fieldId == "string" ? u.fieldId : "",
3580
3619
  fieldName: typeof u.fieldName == "string" ? u.fieldName : typeof u.fieldId == "string" ? u.fieldId : "",
@@ -3587,19 +3626,19 @@ const xo = /* @__PURE__ */ new Set([
3587
3626
  if (typeof document < "u")
3588
3627
  try {
3589
3628
  document.dispatchEvent(
3590
- new CustomEvent("ll-collected", { detail: N })
3629
+ new CustomEvent("ll-collected", { detail: A })
3591
3630
  );
3592
3631
  } catch {
3593
3632
  }
3594
3633
  return;
3595
3634
  }
3596
3635
  if (u.type === "task_completed") {
3597
- if (!xe("collect_data")) {
3636
+ if (!Ce("collect_data")) {
3598
3637
  ke("task_completed", "collect_data");
3599
3638
  return;
3600
3639
  }
3601
- const N = u.result;
3602
- if (!N || typeof N != "object") {
3640
+ const A = u.result;
3641
+ if (!A || typeof A != "object") {
3603
3642
  console.warn(
3604
3643
  "[LiveLayer] task_completed missing `result` payload."
3605
3644
  );
@@ -3609,54 +3648,54 @@ const xo = /* @__PURE__ */ new Set([
3609
3648
  try {
3610
3649
  document.dispatchEvent(
3611
3650
  new CustomEvent("ll-collected", {
3612
- detail: { phase: "complete", result: N }
3651
+ detail: { phase: "complete", result: A }
3613
3652
  })
3614
3653
  );
3615
3654
  } catch {
3616
3655
  }
3617
3656
  try {
3618
- We == null || We(
3619
- N
3657
+ je == null || je(
3658
+ A
3620
3659
  );
3621
- } catch (T) {
3622
- console.warn("[LiveLayer] onCollect threw.", T);
3660
+ } catch (I) {
3661
+ console.warn("[LiveLayer] onCollect threw.", I);
3623
3662
  }
3624
3663
  return;
3625
3664
  }
3626
- xo.has(u.type) || Xe == null || Xe(u);
3665
+ Io.has(u.type) || Ze == null || Ze(u);
3627
3666
  }
3628
3667
  },
3629
- [Xe, Be, We]
3630
- ), se = Dr({
3631
- agentId: F ? "__controlled__" : St,
3668
+ [Ze, Ue, je]
3669
+ ), ce = Ur({
3670
+ agentId: F ? "__controlled__" : Nt,
3632
3671
  baseUrl: o,
3633
3672
  apiKey: l,
3634
3673
  sessionEndpoint: s,
3635
3674
  sessionBody: a,
3636
- onDataMessage: F ? void 0 : mt
3675
+ onDataMessage: F ? void 0 : vt
3637
3676
  });
3638
- I(() => {
3677
+ T(() => {
3639
3678
  if (F != null && F.subscribeToDataMessages)
3640
- return F.subscribeToDataMessages(mt);
3641
- }, [F, mt]), Ee.current = () => {
3679
+ return F.subscribeToDataMessages(vt);
3680
+ }, [F, vt]), Ae.current = () => {
3642
3681
  var h;
3643
- return (h = se.getRoom) == null ? void 0 : h.call(se);
3644
- }, I(() => {
3645
- var Q;
3682
+ return (h = ce.getRoom) == null ? void 0 : h.call(ce);
3683
+ }, T(() => {
3684
+ var ee;
3646
3685
  if (typeof window > "u") return;
3647
- const h = ((Q = window.location) == null ? void 0 : Q.hostname) || "";
3686
+ const h = ((ee = window.location) == null ? void 0 : ee.hostname) || "";
3648
3687
  if (h === "localhost" || h === "127.0.0.1" || h === "0.0.0.0" || h.endsWith(".local") || h.endsWith(".test"))
3649
- return window.__livelayerSimulateCommand = (fe) => {
3688
+ return window.__livelayerSimulateCommand = (he) => {
3650
3689
  try {
3651
- mt(fe);
3652
- } catch (Ne) {
3653
- console.warn("[LiveLayer] simulate-command threw:", Ne);
3690
+ vt(he);
3691
+ } catch (Me) {
3692
+ console.warn("[LiveLayer] simulate-command threw:", Me);
3654
3693
  }
3655
3694
  }, () => {
3656
3695
  delete window.__livelayerSimulateCommand;
3657
3696
  };
3658
- }, [mt]);
3659
- const _ = at(() => F ? {
3697
+ }, [vt]);
3698
+ const _ = ut(() => F ? {
3660
3699
  connectionState: F.connectionState,
3661
3700
  agentState: F.agentState,
3662
3701
  transcript: F.transcript,
@@ -3672,130 +3711,130 @@ const xo = /* @__PURE__ */ new Set([
3672
3711
  // Dummy getRoom for shape compatibility — controlled consumers own the Room.
3673
3712
  // Internal session's getRoom returns null when no real connect has happened,
3674
3713
  // so we reuse its reference for type consistency.
3675
- getRoom: se.getRoom,
3714
+ getRoom: ce.getRoom,
3676
3715
  isControlled: !0
3677
3716
  } : {
3678
- connectionState: se.connectionState,
3679
- agentState: se.agentState,
3680
- transcript: se.transcript,
3681
- videoElement: se.videoElement,
3682
- audioElement: se.audioElement,
3683
- canResume: se.canResume,
3684
- error: se.error,
3685
- agentConfig: se.agentConfig,
3686
- connect: se.connect,
3687
- disconnect: se.disconnect,
3688
- getRoom: se.getRoom,
3717
+ connectionState: ce.connectionState,
3718
+ agentState: ce.agentState,
3719
+ transcript: ce.transcript,
3720
+ videoElement: ce.videoElement,
3721
+ audioElement: ce.audioElement,
3722
+ canResume: ce.canResume,
3723
+ error: ce.error,
3724
+ agentConfig: ce.agentConfig,
3725
+ connect: ce.connect,
3726
+ disconnect: ce.disconnect,
3727
+ getRoom: ce.getRoom,
3689
3728
  isControlled: !1
3690
- }, [F, se]), fn = R(_);
3691
- fn.current = _;
3692
- const pn = R(F);
3693
- pn.current = F, Ar(
3729
+ }, [F, ce]), yn = R(_);
3730
+ yn.current = _;
3731
+ const vn = R(F);
3732
+ vn.current = F, $r(
3694
3733
  n,
3695
3734
  () => ({
3696
3735
  sendData: async (h) => {
3697
- var Ne, yt;
3698
- const u = pn.current;
3736
+ var Me, wt;
3737
+ const u = vn.current;
3699
3738
  if (u != null && u.publishData) {
3700
3739
  try {
3701
3740
  await u.publishData(h);
3702
- } catch (De) {
3703
- console.warn("[AvatarWidget] sendData (controlled) failed:", De);
3741
+ } catch (ze) {
3742
+ console.warn("[AvatarWidget] sendData (controlled) failed:", ze);
3704
3743
  }
3705
3744
  return;
3706
3745
  }
3707
- const Q = (yt = (Ne = fn.current) == null ? void 0 : Ne.getRoom) == null ? void 0 : yt.call(Ne), fe = Q == null ? void 0 : Q.localParticipant;
3708
- if (fe != null && fe.publishData)
3746
+ const ee = (wt = (Me = yn.current) == null ? void 0 : Me.getRoom) == null ? void 0 : wt.call(Me), he = ee == null ? void 0 : ee.localParticipant;
3747
+ if (he != null && he.publishData)
3709
3748
  try {
3710
- const De = new TextEncoder().encode(JSON.stringify(h));
3711
- await fe.publishData(De, { reliable: !0 });
3712
- } catch (De) {
3713
- console.warn("[AvatarWidget] sendData failed:", De);
3749
+ const ze = new TextEncoder().encode(JSON.stringify(h));
3750
+ await he.publishData(ze, { reliable: !0 });
3751
+ } catch (ze) {
3752
+ console.warn("[AvatarWidget] sendData failed:", ze);
3714
3753
  }
3715
3754
  }
3716
3755
  }),
3717
3756
  []
3718
3757
  );
3719
- const hn = R(null);
3720
- I(() => {
3721
- const h = _.videoElement, u = hn.current;
3758
+ const bn = R(null);
3759
+ T(() => {
3760
+ const h = _.videoElement, u = bn.current;
3722
3761
  if (!(!h || !u))
3723
3762
  return u.appendChild(h), () => {
3724
3763
  h.parentNode === u && u.removeChild(h);
3725
3764
  };
3726
3765
  }, [_.videoElement]);
3727
- const [tt, Rt] = M(!1);
3728
- I(() => {
3766
+ const [it, Pt] = M(!1);
3767
+ T(() => {
3729
3768
  if (!$) {
3730
- Rt(!0);
3769
+ Pt(!0);
3731
3770
  return;
3732
3771
  }
3733
- _.agentState === "speaking" && !tt && Rt(!0);
3734
- }, [$, _.agentState, tt]), I(() => {
3772
+ _.agentState === "speaking" && !it && Pt(!0);
3773
+ }, [$, _.agentState, it]), T(() => {
3735
3774
  if (!$) return;
3736
3775
  const h = _.connectionState;
3737
- (h === "disconnected" || h === "idle") && Rt(!1);
3738
- }, [$, _.connectionState]), I(() => {
3739
- if (!$ || !_.videoElement || tt) return;
3740
- const h = setTimeout(() => Rt(!0), 5e3);
3776
+ (h === "disconnected" || h === "idle") && Pt(!1);
3777
+ }, [$, _.connectionState]), T(() => {
3778
+ if (!$ || !_.videoElement || it) return;
3779
+ const h = setTimeout(() => Pt(!0), 5e3);
3741
3780
  return () => clearTimeout(h);
3742
- }, [$, _.videoElement, tt]), I(() => {
3781
+ }, [$, _.videoElement, it]), T(() => {
3743
3782
  const h = _.videoElement;
3744
3783
  if (h) {
3745
3784
  if (!$) {
3746
3785
  h.style.filter = "";
3747
3786
  return;
3748
3787
  }
3749
- h.style.transition = "filter 500ms ease-out", h.style.filter = tt ? "" : "blur(8px)";
3788
+ h.style.transition = "filter 500ms ease-out", h.style.filter = it ? "" : "blur(8px)";
3750
3789
  }
3751
- }, [$, _.videoElement, tt]);
3752
- const Tt = R(/* @__PURE__ */ new Map());
3753
- I(() => {
3790
+ }, [$, _.videoElement, it]);
3791
+ const zt = R(/* @__PURE__ */ new Map());
3792
+ T(() => {
3754
3793
  const h = _.audioElement;
3755
- if (!h || Tt.current.has(h)) return;
3794
+ if (!h || zt.current.has(h)) return;
3756
3795
  const u = document.createElement("div");
3757
- u.className = "ll-audio-sink", u.setAttribute("aria-hidden", "true"), u.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", u.appendChild(h), document.body.appendChild(u), Tt.current.set(h, u), Re.attach(h);
3758
- const Q = h.play();
3759
- Q && typeof Q.catch == "function" && Q.catch((fe) => {
3760
- (fe == null ? void 0 : fe.name) === "NotAllowedError" && Se(!0);
3796
+ u.className = "ll-audio-sink", u.setAttribute("aria-hidden", "true"), u.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", u.appendChild(h), document.body.appendChild(u), zt.current.set(h, u), Re.attach(h);
3797
+ const ee = h.play();
3798
+ ee && typeof ee.catch == "function" && ee.catch((he) => {
3799
+ (he == null ? void 0 : he.name) === "NotAllowedError" && Ee(!0);
3761
3800
  });
3762
- }, [_.audioElement]), I(() => {
3801
+ }, [_.audioElement]), T(() => {
3763
3802
  const h = _.connectionState;
3764
3803
  if (!(h !== "disconnected" && h !== "idle" && h !== "error")) {
3765
3804
  Re.detach();
3766
- for (const [u, Q] of Tt.current)
3767
- u.parentNode === Q && Q.removeChild(u), Q.parentNode === document.body && document.body.removeChild(Q);
3768
- Tt.current.clear();
3805
+ for (const [u, ee] of zt.current)
3806
+ u.parentNode === ee && ee.removeChild(u), ee.parentNode === document.body && document.body.removeChild(ee);
3807
+ zt.current.clear();
3769
3808
  }
3770
3809
  }, [_.connectionState]);
3771
- const we = Hr({
3810
+ const _e = Yr({
3772
3811
  gateUntilAgentReady: !0,
3773
3812
  agentState: _.agentState
3774
3813
  });
3775
- I(() => {
3814
+ T(() => {
3776
3815
  if (_.isControlled || _.connectionState !== "connected") return;
3777
3816
  const h = _.getRoom();
3778
3817
  if (h)
3779
- return we.setupMic(h).then(() => {
3780
- const u = we.getMicStream();
3818
+ return _e.setupMic(h).then(() => {
3819
+ const u = _e.getMicStream();
3781
3820
  u && Re.attachStream(u, "mic");
3782
3821
  }).catch(() => {
3783
3822
  }), () => {
3784
- Re.detachSlot("mic"), we.teardownMic();
3823
+ Re.detachSlot("mic"), _e.teardownMic();
3785
3824
  };
3786
- }, [_.isControlled, _.connectionState]), I(() => {
3825
+ }, [_.isControlled, _.connectionState]), T(() => {
3787
3826
  var u;
3788
3827
  if (_.connectionState !== "connected") return;
3789
3828
  const h = _.isControlled ? (u = F == null ? void 0 : F.getRoom) == null ? void 0 : u.call(F) : _.getRoom();
3790
3829
  if (h)
3791
- return Ae.attachRoom(h), Te.attachRoom(h), _.isControlled && we.attachRoom(h), ft.refresh(), () => {
3792
- Ae.teardown(), Te.teardown();
3830
+ return Ne.attachRoom(h), De.attachRoom(h), _.isControlled && _e.attachRoom(h), mt.refresh(), () => {
3831
+ Ne.teardown(), De.teardown();
3793
3832
  };
3794
- }, [_.isControlled, _.connectionState, F]), I(() => {
3833
+ }, [_.isControlled, _.connectionState, F]), T(() => {
3795
3834
  const h = _.audioElement;
3796
- h && (h.muted = qt);
3797
- }, [_.audioElement, qt]);
3798
- const hr = L((h) => {
3835
+ h && (h.muted = Yt);
3836
+ }, [_.audioElement, Yt]);
3837
+ const _r = k((h) => {
3799
3838
  const u = { type: "user_message", text: h };
3800
3839
  if (F != null && F.publishData) {
3801
3840
  try {
@@ -3804,135 +3843,135 @@ const xo = /* @__PURE__ */ new Set([
3804
3843
  }
3805
3844
  return;
3806
3845
  }
3807
- const Q = _.getRoom();
3808
- if (Q)
3846
+ const ee = _.getRoom();
3847
+ if (ee)
3809
3848
  try {
3810
- const fe = new TextEncoder().encode(JSON.stringify(u));
3811
- Q.localParticipant.publishData(fe, { reliable: !0 });
3849
+ const he = new TextEncoder().encode(JSON.stringify(u));
3850
+ ee.localParticipant.publishData(he, { reliable: !0 });
3812
3851
  } catch {
3813
3852
  }
3814
- }, [_, F]), mr = L(() => {
3815
- pr((h) => !h);
3853
+ }, [_, F]), xr = k(() => {
3854
+ wr((h) => !h);
3816
3855
  }, []);
3817
- I(() => {
3818
- Fe == null || Fe(_.connectionState), _.connectionState === "connected" ? Ge == null || Ge() : _.connectionState === "disconnected" && ($e == null || $e());
3819
- }, [_.connectionState, Ge, $e, Fe]), I(() => {
3820
- He == null || He(_.transcript);
3821
- }, [_.transcript, He]), I(() => {
3822
- Oe == null || Oe(_.agentState);
3823
- }, [_.agentState, Oe]), I(() => {
3824
- Mt.setThinking(_.agentState === "thinking");
3825
- }, [_.agentState, Mt]);
3826
- const mn = R(!1);
3827
- I(() => {
3828
- !g || mn.current || ut && _.connectionState === "idle" && (mn.current = !0, _.connect());
3829
- }, [g, _.connectionState, _, ut]);
3830
- const gr = L(
3856
+ T(() => {
3857
+ qe == null || qe(_.connectionState), _.connectionState === "connected" ? Je == null || Je() : _.connectionState === "disconnected" && (Fe == null || Fe());
3858
+ }, [_.connectionState, Je, Fe, qe]), T(() => {
3859
+ Be == null || Be(_.transcript);
3860
+ }, [_.transcript, Be]), T(() => {
3861
+ We == null || We(_.agentState);
3862
+ }, [_.agentState, We]), T(() => {
3863
+ Rt.setThinking(_.agentState === "thinking");
3864
+ }, [_.agentState, Rt]);
3865
+ const wn = R(!1);
3866
+ T(() => {
3867
+ !g || wn.current || pt && _.connectionState === "idle" && (wn.current = !0, _.connect());
3868
+ }, [g, _.connectionState, _, pt]);
3869
+ const Cr = k(
3831
3870
  (h) => {
3832
- const u = b == null ? void 0 : b.find((Q) => Q.id === h);
3833
- u && (et(!1), h !== Ue && (pt(!0), _.disconnect(), Ie || Ct(h), v == null || v(u)));
3871
+ const u = b == null ? void 0 : b.find((ee) => ee.id === h);
3872
+ u && (rt(!1), h !== Ye && (gt(!0), _.disconnect(), Te || At(h), v == null || v(u)));
3834
3873
  },
3835
3874
  [
3836
3875
  b,
3837
- Ue,
3876
+ Ye,
3838
3877
  _,
3839
- Ie,
3878
+ Te,
3840
3879
  v
3841
3880
  ]
3842
3881
  );
3843
- I(() => {
3844
- Qe && _.connectionState === "connected" && pt(!1);
3845
- }, [_.connectionState, Qe]), I(() => {
3846
- if (!ht) return;
3882
+ T(() => {
3883
+ nt && _.connectionState === "connected" && gt(!1);
3884
+ }, [_.connectionState, nt]), T(() => {
3885
+ if (!yt) return;
3847
3886
  const h = (u) => {
3848
- u.key === "Escape" && et(!1);
3887
+ u.key === "Escape" && rt(!1);
3849
3888
  };
3850
3889
  return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
3851
- }, [ht]);
3852
- const yr = !!J || !!(ue != null && ue.avatarImageUrl) || _.isControlled, gt = qr(St, o, yr);
3853
- Ye === void 0 && ((bn = gt.info) != null && bn.capabilities) && (Gt.current = gt.info.capabilities);
3854
- const Pt = (ue == null ? void 0 : ue.name) ?? le ?? ((wn = _.agentConfig) == null ? void 0 : wn.name) ?? ((_n = gt.info) == null ? void 0 : _n.name) ?? "Live Layer", Xt = (ue == null ? void 0 : ue.avatarImageUrl) ?? J ?? ((xn = _.agentConfig) == null ? void 0 : xn.avatarImageUrl) ?? ((kn = gt.info) == null ? void 0 : kn.avatarImageUrl) ?? null, vr = z ?? ((Ln = _.agentConfig) == null ? void 0 : Ln.idleLoopUrl) ?? ((Cn = gt.info) == null ? void 0 : Cn.idleLoopUrl) ?? null, br = B ?? null, wr = L(() => be("expanded"), [be]), _r = L(
3855
- () => be("minimized"),
3856
- [be]
3857
- ), gn = L(() => {
3858
- _.disconnect(), be("hidden");
3859
- }, [_, be]), xr = L(() => {
3890
+ }, [yt]);
3891
+ const kr = !!Z || !!(fe != null && fe.avatarImageUrl) || _.isControlled, bt = Zr(Nt, o, kr);
3892
+ Ke === void 0 && ((kn = bt.info) != null && kn.capabilities) && (Zt.current = bt.info.capabilities);
3893
+ const $t = (fe == null ? void 0 : fe.name) ?? ae ?? ((Ln = _.agentConfig) == null ? void 0 : Ln.name) ?? ((Sn = bt.info) == null ? void 0 : Sn.name) ?? "Live Layer", Qt = (fe == null ? void 0 : fe.avatarImageUrl) ?? Z ?? ((En = _.agentConfig) == null ? void 0 : En.avatarImageUrl) ?? ((An = bt.info) == null ? void 0 : An.avatarImageUrl) ?? null, Lr = z ?? ((Nn = _.agentConfig) == null ? void 0 : Nn.idleLoopUrl) ?? ((Mn = bt.info) == null ? void 0 : Mn.idleLoopUrl) ?? null, Sr = B ?? null, Er = k(() => we("expanded"), [we]), Ar = k(
3894
+ () => we("minimized"),
3895
+ [we]
3896
+ ), _n = k(() => {
3897
+ _.disconnect(), we("hidden");
3898
+ }, [_, we]), Nr = k(() => {
3860
3899
  const h = _.audioElement;
3861
- h && h.play().then(() => Se(!1)).catch(() => {
3900
+ h && h.play().then(() => Ee(!1)).catch(() => {
3862
3901
  });
3863
- }, [_.audioElement]), kr = L(() => {
3864
- Se(!1), _.connect();
3865
- }, [_]), nt = {
3866
- ...Ke,
3867
- ...de ? {} : { zIndex: Ce }
3902
+ }, [_.audioElement]), Mr = k(() => {
3903
+ Ee(!1), _.connect();
3904
+ }, [_]), ot = {
3905
+ ...Qe,
3906
+ ...pe ? {} : { zIndex: Se }
3868
3907
  };
3869
- H.primaryColor && (nt["--ll-color-primary"] = H.primaryColor), H.accentColor && (nt["--ll-color-accent"] = H.accentColor), H.backgroundColor && (nt["--ll-color-bg"] = H.backgroundColor), H.textColor && (nt["--ll-color-fg"] = H.textColor);
3870
- const Lr = {
3871
- ...nt,
3872
- ..._e.style
3873
- }, Cr = [
3908
+ H.primaryColor && (ot["--ll-color-primary"] = H.primaryColor), H.accentColor && (ot["--ll-color-accent"] = H.accentColor), H.backgroundColor && (ot["--ll-color-bg"] = H.backgroundColor), H.textColor && (ot["--ll-color-fg"] = H.textColor);
3909
+ const Ir = {
3910
+ ...ot,
3911
+ ...xe.style
3912
+ }, Tr = [
3874
3913
  "ll-widget",
3875
- `ll-widget--${pe}`,
3876
- `ll-widget--${ve ? "mobile" : "desktop"}`,
3877
- _e.hasGeometry ? "ll-widget--has-geometry" : null,
3878
- _e.isDragging ? "is-dragging" : null,
3879
- _e.isResizing ? "is-resizing" : null,
3880
- qe
3914
+ `ll-widget--${me}`,
3915
+ `ll-widget--${be ? "mobile" : "desktop"}`,
3916
+ xe.hasGeometry ? "ll-widget--has-geometry" : null,
3917
+ xe.isDragging ? "is-dragging" : null,
3918
+ xe.isResizing ? "is-resizing" : null,
3919
+ Ve
3881
3920
  ].filter(Boolean).join(" ");
3882
- if (!ut) return null;
3883
- const Sr = /* @__PURE__ */ r(
3921
+ if (!pt) return null;
3922
+ const Rr = /* @__PURE__ */ r(
3884
3923
  "div",
3885
3924
  {
3886
- className: Cr,
3887
- style: Lr,
3888
- "data-display-mode": pe,
3925
+ className: Tr,
3926
+ style: Ir,
3927
+ "data-display-mode": me,
3889
3928
  "data-position": x,
3890
3929
  "data-experience-mode": d === "EMBEDDED" ? "embedded" : "widget",
3891
- children: pe === "expanded" && /* @__PURE__ */ r(
3892
- Mi,
3930
+ children: me === "expanded" && /* @__PURE__ */ r(
3931
+ Oi,
3893
3932
  {
3894
3933
  position: x,
3895
- isMobile: ve,
3896
- agentName: Pt,
3897
- avatarImageUrl: Xt,
3898
- idleLoopUrl: vr,
3899
- greeting: br,
3934
+ isMobile: be,
3935
+ agentName: $t,
3936
+ avatarImageUrl: Qt,
3937
+ idleLoopUrl: Lr,
3938
+ greeting: Sr,
3900
3939
  branding: H,
3901
3940
  teamMembers: b,
3902
- currentTeamMemberId: Ue,
3903
- isSwitchingTeamMember: Qe,
3904
- teamSwitcherOpen: ht,
3905
- onToggleTeamSwitcher: () => et((h) => !h),
3906
- onSelectTeamMember: gr,
3941
+ currentTeamMemberId: Ye,
3942
+ isSwitchingTeamMember: nt,
3943
+ teamSwitcherOpen: yt,
3944
+ onToggleTeamSwitcher: () => rt((h) => !h),
3945
+ onSelectTeamMember: Cr,
3907
3946
  connectionState: _.connectionState,
3908
3947
  agentState: _.agentState,
3909
3948
  transcript: _.transcript,
3910
- isMuted: we.isMuted,
3911
- micDevices: ft.mics,
3912
- activeMicId: we.activeDeviceId,
3913
- isCameraEnabled: Ae.isEnabled,
3914
- cameraPreviewEl: Ae.previewEl,
3915
- cameraDevices: ft.cameras,
3916
- activeCameraId: Ae.activeDeviceId,
3917
- isScreenShareEnabled: Te.isEnabled,
3918
- screenPreviewEl: Te.previewEl,
3919
- isSpeakerMuted: qt,
3920
- allowCamera: G,
3949
+ isMuted: _e.isMuted,
3950
+ micDevices: mt.mics,
3951
+ activeMicId: _e.activeDeviceId,
3952
+ isCameraEnabled: Ne.isEnabled,
3953
+ cameraPreviewEl: Ne.previewEl,
3954
+ cameraDevices: mt.cameras,
3955
+ activeCameraId: Ne.activeDeviceId,
3956
+ isScreenShareEnabled: De.isEnabled,
3957
+ screenPreviewEl: De.previewEl,
3958
+ isSpeakerMuted: Yt,
3959
+ allowCamera: X,
3921
3960
  allowScreenShare: f,
3922
- allowTyping: A,
3923
- showMinimize: ve && !de ? !1 : Et,
3924
- showClose: At,
3925
- chromeless: te,
3926
- compactControls: Nt,
3927
- transforming: ie,
3928
- transformingLabel: U,
3929
- languageMenuOpen: k,
3930
- onToggleLanguageMenu: () => ae((h) => !h),
3961
+ allowTyping: N,
3962
+ showMinimize: be && !pe ? !1 : Mt,
3963
+ showClose: It,
3964
+ chromeless: re,
3965
+ compactControls: Tt,
3966
+ transforming: le,
3967
+ transformingLabel: j,
3968
+ languageMenuOpen: C,
3969
+ onToggleLanguageMenu: () => se((h) => !h),
3931
3970
  needsUserGesture: Pe,
3932
3971
  canResume: _.canResume,
3933
- micError: we.micError,
3972
+ micError: _e.micError,
3934
3973
  error: _.error,
3935
- avatarVideoContainerRef: hn,
3974
+ avatarVideoContainerRef: bn,
3936
3975
  agentVideoEl: _.videoElement,
3937
3976
  onConnect: () => {
3938
3977
  Promise.resolve(_.connect()).then(() => {
@@ -3943,81 +3982,81 @@ const xo = /* @__PURE__ */ new Set([
3943
3982
  });
3944
3983
  },
3945
3984
  onDisconnect: () => _.disconnect(),
3946
- onRetry: kr,
3947
- onResumeAudio: xr,
3948
- onToggleMute: we.toggleMute,
3949
- onSwitchMicDevice: (h) => void we.switchDevice(h),
3950
- onToggleCamera: () => void Ae.toggle(),
3951
- onSwitchCameraDevice: (h) => void Ae.switchDevice(h),
3952
- onToggleScreenShare: () => void Te.toggle(),
3953
- onToggleSpeaker: mr,
3954
- onSendMessage: hr,
3955
- onMinimize: _r,
3956
- onClose: gn,
3957
- onClearMicError: we.clearError,
3958
- dragHandleProps: _e.dragHandleProps,
3959
- resizeHandleProps: _e.resizeHandleProps
3985
+ onRetry: Mr,
3986
+ onResumeAudio: Nr,
3987
+ onToggleMute: _e.toggleMute,
3988
+ onSwitchMicDevice: (h) => void _e.switchDevice(h),
3989
+ onToggleCamera: () => void Ne.toggle(),
3990
+ onSwitchCameraDevice: (h) => void Ne.switchDevice(h),
3991
+ onToggleScreenShare: () => void De.toggle(),
3992
+ onToggleSpeaker: xr,
3993
+ onSendMessage: _r,
3994
+ onMinimize: Ar,
3995
+ onClose: _n,
3996
+ onClearMicError: _e.clearError,
3997
+ dragHandleProps: xe.dragHandleProps,
3998
+ resizeHandleProps: xe.resizeHandleProps
3960
3999
  }
3961
4000
  )
3962
4001
  }
3963
- ), yn = !de && (pe === "hidden" || pe === "minimized") ? /* @__PURE__ */ S(
4002
+ ), xn = !pe && (me === "hidden" || me === "minimized") ? /* @__PURE__ */ S(
3964
4003
  "div",
3965
4004
  {
3966
4005
  className: [
3967
4006
  "ll-widget",
3968
4007
  "ll-widget--floating",
3969
- `ll-widget--${pe}`,
3970
- `ll-widget--${ve ? "mobile" : "desktop"}`
4008
+ `ll-widget--${me}`,
4009
+ `ll-widget--${be ? "mobile" : "desktop"}`
3971
4010
  ].join(" "),
3972
- style: nt,
3973
- "data-display-mode": pe,
4011
+ style: ot,
4012
+ "data-display-mode": me,
3974
4013
  "data-position": x,
3975
4014
  children: [
3976
- pe === "hidden" && /* @__PURE__ */ r(
3977
- bi,
4015
+ me === "hidden" && /* @__PURE__ */ r(
4016
+ Ai,
3978
4017
  {
3979
4018
  position: x,
3980
- isMobile: ve,
4019
+ isMobile: be,
3981
4020
  isSpeaking: _.agentState === "speaking",
3982
- onExpand: () => be("expanded"),
3983
- label: `Open ${Pt} widget`,
3984
- avatarImageUrl: Xt,
3985
- agentName: Pt,
4021
+ onExpand: () => we("expanded"),
4022
+ label: `Open ${$t} widget`,
4023
+ avatarImageUrl: Qt,
4024
+ agentName: $t,
3986
4025
  containerEl: W
3987
4026
  }
3988
4027
  ),
3989
- pe === "minimized" && /* @__PURE__ */ r(
3990
- _i,
4028
+ me === "minimized" && /* @__PURE__ */ r(
4029
+ Mi,
3991
4030
  {
3992
4031
  position: x,
3993
- isMobile: ve,
3994
- agentName: Pt,
3995
- avatarImageUrl: Xt,
4032
+ isMobile: be,
4033
+ agentName: $t,
4034
+ avatarImageUrl: Qt,
3996
4035
  agentState: _.agentState,
3997
- isMuted: we.isMuted,
4036
+ isMuted: _e.isMuted,
3998
4037
  audioLevel: Re,
3999
- onExpand: wr,
4000
- onToggleMute: we.toggleMute,
4001
- onClose: gn
4038
+ onExpand: Er,
4039
+ onToggleMute: _e.toggleMute,
4040
+ onClose: _n
4002
4041
  }
4003
4042
  )
4004
4043
  ]
4005
4044
  }
4006
- ) : null, vn = W ?? (typeof document < "u" ? document.body : null);
4007
- return /* @__PURE__ */ S(Ve, { children: [
4008
- Sr,
4009
- yn && vn && ln(yn, vn)
4045
+ ) : null, Cn = W ?? (typeof document < "u" ? document.body : null);
4046
+ return /* @__PURE__ */ S(Xe, { children: [
4047
+ Rr,
4048
+ xn && Cn && dn(xn, Cn)
4010
4049
  ] });
4011
4050
  }
4012
4051
  );
4013
- fr.displayName = "AvatarWidgetInner";
4014
- const ko = on(
4052
+ br.displayName = "AvatarWidgetInner";
4053
+ const To = un(
4015
4054
  function(t, n) {
4016
- return /* @__PURE__ */ r(Pr, { children: /* @__PURE__ */ r(fr, { ...t, ref: n }) });
4055
+ return /* @__PURE__ */ r(qr, { children: /* @__PURE__ */ r(br, { ...t, ref: n }) });
4017
4056
  }
4018
4057
  );
4019
- ko.displayName = "AvatarWidget";
4020
- const Po = ({
4058
+ To.displayName = "AvatarWidget";
4059
+ const qo = ({
4021
4060
  agentId: e,
4022
4061
  baseUrl: t,
4023
4062
  apiKey: n,
@@ -4028,24 +4067,24 @@ const Po = ({
4028
4067
  }) => {
4029
4068
  const a = R(null), c = R(null), d = R(l);
4030
4069
  d.current = l;
4031
- const g = L((p) => {
4032
- var D;
4070
+ const g = k((p) => {
4071
+ var P;
4033
4072
  const m = p.detail;
4034
- (D = d.current) == null || D.call(d, m);
4073
+ (P = d.current) == null || P.call(d, m);
4035
4074
  }, []);
4036
- return I(() => {
4075
+ return T(() => {
4037
4076
  const p = a.current;
4038
4077
  if (!p) return;
4039
4078
  const m = document.createElement("livelayer-widget");
4040
4079
  return m.setAttribute("agent-id", e), t && m.setAttribute("base-url", t), n && m.setAttribute("api-key", n), i && m.setAttribute("mode", i), m.addEventListener("agent-event", g), p.appendChild(m), c.current = m, () => {
4041
4080
  m.removeEventListener("agent-event", g), p.removeChild(m), c.current = null;
4042
4081
  };
4043
- }, [e]), I(() => {
4082
+ }, [e]), T(() => {
4044
4083
  c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
4045
4084
  }, [i]), /* @__PURE__ */ r("div", { ref: a, className: o, style: s });
4046
- }, Do = on(
4085
+ }, Uo = un(
4047
4086
  function({ id: t, intent: n, as: i = "div", className: l, style: o, children: s }, a) {
4048
- return Nr(
4087
+ return Hr(
4049
4088
  i,
4050
4089
  {
4051
4090
  ref: a,
@@ -4058,19 +4097,19 @@ const Po = ({
4058
4097
  );
4059
4098
  }
4060
4099
  );
4061
- function zo(e = {}) {
4100
+ function jo(e = {}) {
4062
4101
  const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [l, o] = M({}), [s, a] = M(!1), [c, d] = M(null), g = R(t), p = R(n), m = R(i);
4063
- I(() => {
4102
+ T(() => {
4064
4103
  g.current = t, p.current = n, m.current = i;
4065
4104
  }, [t, n, i]);
4066
- const D = L(() => {
4105
+ const P = k(() => {
4067
4106
  o({}), a(!1);
4068
4107
  }, []);
4069
- return I(() => {
4108
+ return T(() => {
4070
4109
  if (typeof window > "u") return;
4071
- const x = (C) => {
4072
- var w, P;
4073
- const y = C.detail;
4110
+ const x = (L) => {
4111
+ var w, D;
4112
+ const y = L.detail;
4074
4113
  if (y) {
4075
4114
  if (y.phase === "field") {
4076
4115
  if (m.current !== "all" && y.source !== m.current)
@@ -4091,7 +4130,7 @@ function zo(e = {}) {
4091
4130
  return;
4092
4131
  d(E), a(!1);
4093
4132
  try {
4094
- (P = p.current) == null || P.call(p, E);
4133
+ (D = p.current) == null || D.call(p, E);
4095
4134
  } catch (b) {
4096
4135
  console.warn("[LiveLayer] useCollect onComplete threw.", b);
4097
4136
  }
@@ -4099,68 +4138,68 @@ function zo(e = {}) {
4099
4138
  }
4100
4139
  };
4101
4140
  return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
4102
- }, []), { fields: l, isCollecting: s, lastResult: c, reset: D };
4141
+ }, []), { fields: l, isCollecting: s, lastResult: c, reset: P };
4103
4142
  }
4104
- let Qn = 1;
4105
- function $o({
4143
+ let lr = 1;
4144
+ function Vo({
4106
4145
  onMount: e,
4107
4146
  defaultOpen: t = !1,
4108
4147
  storageKey: n = "ll-debug-open"
4109
4148
  }) {
4110
- const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [d, g] = M(!1), p = R(/* @__PURE__ */ new Set()), m = R([]), D = R(d);
4111
- D.current = d, I(() => {
4149
+ const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [d, g] = M(!1), p = R(/* @__PURE__ */ new Set()), m = R([]), P = R(d);
4150
+ P.current = d, T(() => {
4112
4151
  try {
4113
4152
  const y = localStorage.getItem(n);
4114
4153
  y === "1" && l(!0), y === "0" && l(!1);
4115
4154
  } catch {
4116
4155
  }
4117
- }, [n]), I(() => {
4156
+ }, [n]), T(() => {
4118
4157
  try {
4119
4158
  localStorage.setItem(n, i ? "1" : "0");
4120
4159
  } catch {
4121
4160
  }
4122
- }, [i, n]), I(() => {
4161
+ }, [i, n]), T(() => {
4123
4162
  const y = (w) => {
4124
- (w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((P) => !P));
4163
+ (w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((D) => !D));
4125
4164
  };
4126
4165
  return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
4127
- }, []), I(() => {
4166
+ }, []), T(() => {
4128
4167
  const y = setInterval(() => {
4129
- if (m.current.length === 0 || D.current) return;
4168
+ if (m.current.length === 0 || P.current) return;
4130
4169
  const w = m.current.splice(0, m.current.length);
4131
4170
  s(
4132
- (P) => [...w.reverse(), ...P].slice(0, 200)
4171
+ (D) => [...w.reverse(), ...D].slice(0, 200)
4133
4172
  );
4134
4173
  }, 100);
4135
4174
  return () => clearInterval(y);
4136
4175
  }, []);
4137
4176
  const x = R(!1);
4138
- if (I(() => {
4177
+ if (T(() => {
4139
4178
  !e || x.current || (x.current = !0, e((y) => {
4140
4179
  m.current.push({
4141
- id: Qn++,
4180
+ id: lr++,
4142
4181
  ts: Date.now(),
4143
4182
  kind: "event",
4144
4183
  type: y.eventName,
4145
4184
  data: y.data
4146
4185
  });
4147
4186
  }));
4148
- }, [e]), I(() => {
4149
- const y = console.warn, w = console.log, P = (E, b) => function(...O) {
4187
+ }, [e]), T(() => {
4188
+ const y = console.warn, w = console.log, D = (E, b) => function(...O) {
4150
4189
  try {
4151
4190
  const v = typeof O[0] == "string" ? O[0] : "";
4152
4191
  v.startsWith("[LiveLayer]") && m.current.push({
4153
- id: Qn++,
4192
+ id: lr++,
4154
4193
  ts: Date.now(),
4155
4194
  kind: E,
4156
4195
  type: v.slice(0, 120),
4157
- data: { args: O.slice(1).map((z) => Co(z)) }
4196
+ data: { args: O.slice(1).map((z) => Do(z)) }
4158
4197
  });
4159
4198
  } catch {
4160
4199
  }
4161
4200
  return b.apply(this, O);
4162
4201
  };
4163
- return console.warn = P("warn", y), console.log = P("log", w), () => {
4202
+ return console.warn = D("warn", y), console.log = D("log", w), () => {
4164
4203
  console.warn = y, console.log = w;
4165
4204
  };
4166
4205
  }, []), !i)
@@ -4190,7 +4229,7 @@ function $o({
4190
4229
  children: "🛰 LL debug"
4191
4230
  }
4192
4231
  );
4193
- const C = o.filter((y) => {
4232
+ const L = o.filter((y) => {
4194
4233
  if (!a) return !0;
4195
4234
  const w = a.toLowerCase();
4196
4235
  return y.type.toLowerCase().includes(w) || JSON.stringify(y.data || {}).toLowerCase().includes(w);
@@ -4241,7 +4280,7 @@ function $o({
4241
4280
  {
4242
4281
  type: "button",
4243
4282
  onClick: () => g((y) => !y),
4244
- style: tn(d ? "#f59e0b" : "transparent"),
4283
+ style: an(d ? "#f59e0b" : "transparent"),
4245
4284
  title: "Pause / resume capture",
4246
4285
  children: d ? "▶ resume" : "⏸ pause"
4247
4286
  }
@@ -4253,7 +4292,7 @@ function $o({
4253
4292
  onClick: () => {
4254
4293
  s([]), m.current = [];
4255
4294
  },
4256
- style: tn("transparent"),
4295
+ style: an("transparent"),
4257
4296
  title: "Clear buffer",
4258
4297
  children: "clear"
4259
4298
  }
@@ -4263,7 +4302,7 @@ function $o({
4263
4302
  {
4264
4303
  type: "button",
4265
4304
  onClick: () => l(!1),
4266
- style: tn("transparent"),
4305
+ style: an("transparent"),
4267
4306
  "aria-label": "Close",
4268
4307
  title: "Close (Cmd/Ctrl + Shift + L)",
4269
4308
  children: "✕"
@@ -4299,7 +4338,7 @@ function $o({
4299
4338
  overflowY: "auto",
4300
4339
  padding: "0 8px 8px"
4301
4340
  },
4302
- children: C.length === 0 ? /* @__PURE__ */ S(
4341
+ children: L.length === 0 ? /* @__PURE__ */ S(
4303
4342
  "div",
4304
4343
  {
4305
4344
  style: {
@@ -4329,8 +4368,8 @@ function $o({
4329
4368
  )
4330
4369
  ]
4331
4370
  }
4332
- ) : C.map((y) => /* @__PURE__ */ r(
4333
- Lo,
4371
+ ) : L.map((y) => /* @__PURE__ */ r(
4372
+ Ro,
4334
4373
  {
4335
4374
  entry: y,
4336
4375
  expanded: p.current.has(y.id),
@@ -4346,7 +4385,7 @@ function $o({
4346
4385
  }
4347
4386
  );
4348
4387
  }
4349
- function Lo({
4388
+ function Ro({
4350
4389
  entry: e,
4351
4390
  expanded: t,
4352
4391
  onToggle: n
@@ -4416,7 +4455,7 @@ function Lo({
4416
4455
  }
4417
4456
  );
4418
4457
  }
4419
- function tn(e) {
4458
+ function an(e) {
4420
4459
  return {
4421
4460
  background: e,
4422
4461
  color: "#fff",
@@ -4427,22 +4466,22 @@ function tn(e) {
4427
4466
  cursor: "pointer"
4428
4467
  };
4429
4468
  }
4430
- function Co(e) {
4469
+ function Do(e) {
4431
4470
  try {
4432
4471
  return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
4433
4472
  } catch {
4434
4473
  return String(e);
4435
4474
  }
4436
4475
  }
4437
- function So(e) {
4476
+ function Po(e) {
4438
4477
  const t = JSON.stringify(e);
4439
- I(() => Ir(e), [t]);
4478
+ T(() => Fr(e), [t]);
4440
4479
  }
4441
- function Ho({ fields: e, children: t }) {
4442
- return So(e), /* @__PURE__ */ r(Ve, { children: t });
4480
+ function Yo({ fields: e, children: t }) {
4481
+ return Po(e), /* @__PURE__ */ r(Xe, { children: t });
4443
4482
  }
4444
- function Oo() {
4445
- const [e, t] = M([]), n = L((l) => {
4483
+ function Go() {
4484
+ const [e, t] = M([]), n = k((l) => {
4446
4485
  t((o) => {
4447
4486
  const s = o.findIndex((a) => a.id === l.id);
4448
4487
  if (s >= 0) {
@@ -4451,7 +4490,7 @@ function Oo() {
4451
4490
  }
4452
4491
  return [...o, l];
4453
4492
  });
4454
- }, []), i = L(() => t([]), []);
4493
+ }, []), i = k(() => t([]), []);
4455
4494
  return {
4456
4495
  entries: e,
4457
4496
  pushSegment: n,
@@ -4460,38 +4499,38 @@ function Oo() {
4460
4499
  };
4461
4500
  }
4462
4501
  export {
4463
- ko as AvatarWidget,
4464
- Pr as ErrorBoundary,
4465
- Ho as FieldProvider,
4466
- $o as LiveLayerDebugPanel,
4467
- Do as LiveLayerRegion,
4468
- Po as LiveLayerWidget,
4469
- Wo as clearFieldRegistry,
4470
- no as clearPageContextCache,
4471
- so as clearRoutesCache,
4472
- eo as extractPageContext,
4473
- lo as extractRoutes,
4474
- Xn as getCachedPageContext,
4475
- Qt as getCachedRoutes,
4476
- qo as getRegisteredFields,
4477
- ci as matchesPattern,
4478
- io as normalizeRouteInput,
4479
- Uo as registerFields,
4480
- jo as setFieldValue,
4481
- ui as shouldRenderAtPath,
4482
- qr as useAgentInfo,
4483
- zr as useAudioLevel,
4484
- Fr as useCameraState,
4485
- zo as useCollect,
4486
- jr as useDisplayMode,
4487
- Gr as useDisplayModePersistence,
4488
- Kr as useIsMobile,
4489
- Dr as useLiveKitSession,
4490
- Wr as useMediaDevices,
4491
- Hr as useMicrophoneState,
4492
- ii as usePathname,
4493
- So as useRegisterFields,
4494
- di as useRouteMatch,
4495
- Br as useScreenShareState,
4496
- Oo as useTranscript
4502
+ To as AvatarWidget,
4503
+ qr as ErrorBoundary,
4504
+ Yo as FieldProvider,
4505
+ Vo as LiveLayerDebugPanel,
4506
+ Uo as LiveLayerRegion,
4507
+ qo as LiveLayerWidget,
4508
+ Jo as clearFieldRegistry,
4509
+ fo as clearPageContextCache,
4510
+ vo as clearRoutesCache,
4511
+ co as extractPageContext,
4512
+ go as extractRoutes,
4513
+ nr as getCachedPageContext,
4514
+ on as getCachedRoutes,
4515
+ Zo as getRegisteredFields,
4516
+ vi as matchesPattern,
4517
+ ho as normalizeRouteInput,
4518
+ Qo as registerFields,
4519
+ el as setFieldValue,
4520
+ bi as shouldRenderAtPath,
4521
+ Zr as useAgentInfo,
4522
+ jr as useAudioLevel,
4523
+ Xr as useCameraState,
4524
+ jo as useCollect,
4525
+ ei as useDisplayMode,
4526
+ ri as useDisplayModePersistence,
4527
+ oi as useIsMobile,
4528
+ Ur as useLiveKitSession,
4529
+ Jr as useMediaDevices,
4530
+ Yr as useMicrophoneState,
4531
+ pi as usePathname,
4532
+ Po as useRegisterFields,
4533
+ wi as useRouteMatch,
4534
+ Kr as useScreenShareState,
4535
+ Go as useTranscript
4497
4536
  };