@livelayer/react 0.14.0 → 0.14.1

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