@livelayer/react 0.10.5 → 0.10.6
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.js +3 -3
- package/dist/index.mjs +389 -389
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Component as On, useState as
|
|
2
|
+
import { jsxs as g, jsx as n, Fragment as Ye } from "react/jsx-runtime";
|
|
3
|
+
import { Component as On, useState as C, useRef as N, useEffect as I, useCallback as E, useMemo as Ge, useLayoutEffect as mn, forwardRef as ut, useImperativeHandle as Hn, createElement as Wn } from "react";
|
|
4
4
|
import { createPortal as It } from "react-dom";
|
|
5
5
|
import { LiveKitSession as Bn } from "@livelayer/sdk";
|
|
6
6
|
import { createLocalAudioTrack as qn, Track as gn, createLocalVideoTrack as Fn } from "livekit-client";
|
|
@@ -19,7 +19,7 @@ class Un extends On {
|
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
21
|
var t;
|
|
22
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
22
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ g("div", { className: "ll-error-boundary", role: "alert", children: [
|
|
23
23
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
|
|
24
24
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
|
|
25
25
|
/* @__PURE__ */ n(
|
|
@@ -35,24 +35,24 @@ class Un extends On {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
function jn(e) {
|
|
38
|
-
const [t, r] =
|
|
39
|
-
|
|
38
|
+
const [t, r] = C("idle"), [o, i] = C("idle"), [l, d] = C([]), [a, s] = C(null), [u, y] = C(null), [f, c] = C(null), [A, x] = C(!1), [_, v] = C(null), b = N(null), S = N(e.onDataMessage);
|
|
39
|
+
S.current = e.onDataMessage, I(() => {
|
|
40
40
|
const R = {
|
|
41
41
|
onConnectionStateChange: (q) => {
|
|
42
|
-
r(q), q === "connected" &&
|
|
42
|
+
r(q), q === "connected" && v(null);
|
|
43
43
|
},
|
|
44
44
|
onAgentStateChange: i,
|
|
45
45
|
onTranscript: (q) => d([...q]),
|
|
46
46
|
onAgentConfig: s,
|
|
47
47
|
onAudioTrack: (q) => c(q),
|
|
48
|
-
onVideoTrack: (q) =>
|
|
49
|
-
onVideoTrackRemoved: () =>
|
|
50
|
-
onError: (q) =>
|
|
48
|
+
onVideoTrack: (q) => y(q),
|
|
49
|
+
onVideoTrackRemoved: () => y(null),
|
|
50
|
+
onError: (q) => v(q),
|
|
51
51
|
onDataMessage: (q) => {
|
|
52
52
|
var F;
|
|
53
|
-
(F =
|
|
53
|
+
(F = S.current) == null || F.call(S, q);
|
|
54
54
|
},
|
|
55
|
-
onResumabilityChange:
|
|
55
|
+
onResumabilityChange: x
|
|
56
56
|
}, B = new Bn(
|
|
57
57
|
{
|
|
58
58
|
agentId: e.agentId,
|
|
@@ -63,9 +63,9 @@ function jn(e) {
|
|
|
63
63
|
},
|
|
64
64
|
R
|
|
65
65
|
);
|
|
66
|
-
return
|
|
66
|
+
return b.current = B, r("idle"), i("idle"), d([]), s(null), y(null), c(null), x(!1), v(null), () => {
|
|
67
67
|
var q;
|
|
68
|
-
(q = B.destroy) == null || q.call(B),
|
|
68
|
+
(q = B.destroy) == null || q.call(B), b.current = null;
|
|
69
69
|
};
|
|
70
70
|
}, [
|
|
71
71
|
e.agentId,
|
|
@@ -75,19 +75,19 @@ function jn(e) {
|
|
|
75
75
|
JSON.stringify(e.sessionBody ?? {})
|
|
76
76
|
]);
|
|
77
77
|
const M = E(async () => {
|
|
78
|
-
const R =
|
|
78
|
+
const R = b.current;
|
|
79
79
|
if (R)
|
|
80
80
|
try {
|
|
81
81
|
await R.connect();
|
|
82
82
|
} catch (B) {
|
|
83
|
-
throw
|
|
83
|
+
throw v(B instanceof Error ? B.message : String(B)), B;
|
|
84
84
|
}
|
|
85
85
|
}, []), D = E(() => {
|
|
86
|
-
const R =
|
|
86
|
+
const R = b.current;
|
|
87
87
|
R && R.disconnect();
|
|
88
88
|
}, []), k = E(() => {
|
|
89
89
|
var R;
|
|
90
|
-
return ((R =
|
|
90
|
+
return ((R = b.current) == null ? void 0 : R.getRoom()) ?? null;
|
|
91
91
|
}, []);
|
|
92
92
|
return {
|
|
93
93
|
connectionState: t,
|
|
@@ -97,11 +97,11 @@ function jn(e) {
|
|
|
97
97
|
videoElement: u,
|
|
98
98
|
audioElement: f,
|
|
99
99
|
canResume: A,
|
|
100
|
-
error:
|
|
100
|
+
error: _,
|
|
101
101
|
connect: M,
|
|
102
102
|
disconnect: D,
|
|
103
103
|
getRoom: k,
|
|
104
|
-
session:
|
|
104
|
+
session: b.current
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
function Vn() {
|
|
@@ -117,13 +117,13 @@ function Vn() {
|
|
|
117
117
|
const c = l.current;
|
|
118
118
|
f.getByteFrequencyData(c);
|
|
119
119
|
let A = 0;
|
|
120
|
-
for (let
|
|
121
|
-
const
|
|
122
|
-
for (const
|
|
120
|
+
for (let _ = 0; _ < c.length; _++) A += c[_];
|
|
121
|
+
const x = A / c.length / 255;
|
|
122
|
+
for (const _ of i.current)
|
|
123
123
|
try {
|
|
124
|
-
x
|
|
125
|
-
} catch (
|
|
126
|
-
console.error("[useAudioLevel] subscriber threw:",
|
|
124
|
+
_(x);
|
|
125
|
+
} catch (v) {
|
|
126
|
+
console.error("[useAudioLevel] subscriber threw:", v);
|
|
127
127
|
}
|
|
128
128
|
o.current = requestAnimationFrame(d);
|
|
129
129
|
}, []), a = E(() => {
|
|
@@ -159,7 +159,7 @@ function Vn() {
|
|
|
159
159
|
}
|
|
160
160
|
r.current = null;
|
|
161
161
|
}
|
|
162
|
-
}, []),
|
|
162
|
+
}, []), y = E((f) => (i.current.add(f), () => {
|
|
163
163
|
i.current.delete(f);
|
|
164
164
|
}), []);
|
|
165
165
|
return I(() => () => {
|
|
@@ -178,11 +178,11 @@ function Vn() {
|
|
|
178
178
|
e.current = null;
|
|
179
179
|
}
|
|
180
180
|
i.current.clear(), l.current = null;
|
|
181
|
-
}, [u]), { attach: s, detach: u, subscribe:
|
|
181
|
+
}, [u]), { attach: s, detach: u, subscribe: y };
|
|
182
182
|
}
|
|
183
183
|
function Yn() {
|
|
184
|
-
const [e, t] =
|
|
185
|
-
var
|
|
184
|
+
const [e, t] = C(!1), [r, o] = C(""), [i, l] = C(null), d = N(null), a = N(null), s = E(async (x) => {
|
|
185
|
+
var _, v;
|
|
186
186
|
if (d.current && a.current) {
|
|
187
187
|
try {
|
|
188
188
|
await a.current.localParticipant.unpublishTrack(d.current);
|
|
@@ -190,45 +190,45 @@ function Yn() {
|
|
|
190
190
|
}
|
|
191
191
|
d.current.stop(), d.current = null;
|
|
192
192
|
}
|
|
193
|
-
a.current =
|
|
193
|
+
a.current = x, l(null);
|
|
194
194
|
try {
|
|
195
|
-
const
|
|
195
|
+
const b = await qn({
|
|
196
196
|
echoCancellation: !0,
|
|
197
197
|
noiseSuppression: !0
|
|
198
198
|
});
|
|
199
|
-
await
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
} catch (
|
|
203
|
-
const
|
|
204
|
-
throw l(
|
|
199
|
+
await x.localParticipant.publishTrack(b), d.current = b, t(b.isMuted);
|
|
200
|
+
const S = (v = (_ = b.mediaStreamTrack) == null ? void 0 : _.getSettings) == null ? void 0 : v.call(_);
|
|
201
|
+
S != null && S.deviceId && o(S.deviceId);
|
|
202
|
+
} catch (b) {
|
|
203
|
+
const S = b instanceof Error && b.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
204
|
+
throw l(S), b;
|
|
205
205
|
}
|
|
206
|
-
}, []), u = E((
|
|
207
|
-
a.current =
|
|
208
|
-
}, []),
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
206
|
+
}, []), u = E((x) => {
|
|
207
|
+
a.current = x;
|
|
208
|
+
}, []), y = E(async (x) => {
|
|
209
|
+
const _ = a.current;
|
|
210
|
+
if (_)
|
|
211
211
|
try {
|
|
212
|
-
await
|
|
213
|
-
} catch (
|
|
214
|
-
console.warn("[useMicrophoneState] switchDevice failed:",
|
|
212
|
+
await _.switchActiveDevice("audioinput", x), o(x);
|
|
213
|
+
} catch (v) {
|
|
214
|
+
console.warn("[useMicrophoneState] switchDevice failed:", v);
|
|
215
215
|
}
|
|
216
216
|
}, []), f = E(async () => {
|
|
217
|
-
const
|
|
218
|
-
if (t(
|
|
217
|
+
const x = a.current, _ = !e;
|
|
218
|
+
if (t(_), !!x)
|
|
219
219
|
try {
|
|
220
|
-
await x.localParticipant.setMicrophoneEnabled(!
|
|
221
|
-
} catch (
|
|
222
|
-
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:",
|
|
220
|
+
await x.localParticipant.setMicrophoneEnabled(!_);
|
|
221
|
+
} catch (v) {
|
|
222
|
+
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", v), t(!_);
|
|
223
223
|
}
|
|
224
224
|
}, [e]), c = E(() => {
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
225
|
+
const x = d.current, _ = a.current;
|
|
226
|
+
if (x && _) {
|
|
227
227
|
try {
|
|
228
|
-
|
|
228
|
+
_.localParticipant.unpublishTrack(x);
|
|
229
229
|
} catch {
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
x.stop();
|
|
232
232
|
}
|
|
233
233
|
d.current = null, a.current = null, t(!1), o("");
|
|
234
234
|
}, []), A = E(() => l(null), []);
|
|
@@ -239,22 +239,22 @@ function Yn() {
|
|
|
239
239
|
toggleMute: f,
|
|
240
240
|
setupMic: s,
|
|
241
241
|
attachRoom: u,
|
|
242
|
-
switchDevice:
|
|
242
|
+
switchDevice: y,
|
|
243
243
|
teardownMic: c,
|
|
244
244
|
clearError: A
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
const Gn = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
248
248
|
function Jn() {
|
|
249
|
-
const [e, t] =
|
|
250
|
-
s.current =
|
|
249
|
+
const [e, t] = C(!1), [r, o] = C(null), [i, l] = C(null), [d, a] = C(""), s = N(null), u = N(null), y = E((b) => {
|
|
250
|
+
s.current = b;
|
|
251
251
|
}, []), f = E(() => {
|
|
252
252
|
var M;
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
255
|
-
const D =
|
|
253
|
+
const b = s.current, S = u.current;
|
|
254
|
+
if (S && b) {
|
|
255
|
+
const D = b.localParticipant.getTrackPublication(gn.Source.Camera), R = (D == null ? void 0 : D.track) ?? S;
|
|
256
256
|
try {
|
|
257
|
-
|
|
257
|
+
b.localParticipant.unpublishTrack(R);
|
|
258
258
|
} catch {
|
|
259
259
|
}
|
|
260
260
|
try {
|
|
@@ -263,19 +263,19 @@ function Jn() {
|
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
u.current = null, l(null), t(!1);
|
|
266
|
-
}, []), c = E(async (
|
|
267
|
-
const
|
|
268
|
-
if (
|
|
266
|
+
}, []), c = E(async (b) => {
|
|
267
|
+
const S = s.current;
|
|
268
|
+
if (S) {
|
|
269
269
|
o(null);
|
|
270
270
|
try {
|
|
271
271
|
const M = { ...Gn };
|
|
272
|
-
|
|
272
|
+
b && (M.deviceId = b);
|
|
273
273
|
const D = await Fn(M);
|
|
274
|
-
await
|
|
274
|
+
await S.localParticipant.publishTrack(D), u.current = D;
|
|
275
275
|
const k = D.attach();
|
|
276
|
-
l(k), t(!0),
|
|
276
|
+
l(k), t(!0), b && a(b);
|
|
277
277
|
try {
|
|
278
|
-
|
|
278
|
+
S.localParticipant.publishData(
|
|
279
279
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
280
280
|
{ reliable: !0 }
|
|
281
281
|
);
|
|
@@ -288,11 +288,11 @@ function Jn() {
|
|
|
288
288
|
}
|
|
289
289
|
}, []), A = E(async () => {
|
|
290
290
|
e ? f() : await c(d || void 0);
|
|
291
|
-
}, [e, d, f, c]),
|
|
292
|
-
f(), await c(
|
|
293
|
-
}, [f, c]),
|
|
291
|
+
}, [e, d, f, c]), x = E(async (b) => {
|
|
292
|
+
f(), await c(b);
|
|
293
|
+
}, [f, c]), _ = E(() => {
|
|
294
294
|
f(), s.current = null, o(null), a("");
|
|
295
|
-
}, [f]),
|
|
295
|
+
}, [f]), v = E(() => o(null), []);
|
|
296
296
|
return I(() => () => {
|
|
297
297
|
u.current && u.current.stop();
|
|
298
298
|
}, []), {
|
|
@@ -301,14 +301,14 @@ function Jn() {
|
|
|
301
301
|
previewEl: i,
|
|
302
302
|
activeDeviceId: d,
|
|
303
303
|
toggle: A,
|
|
304
|
-
switchDevice:
|
|
305
|
-
attachRoom:
|
|
306
|
-
teardown:
|
|
307
|
-
clearError:
|
|
304
|
+
switchDevice: x,
|
|
305
|
+
attachRoom: y,
|
|
306
|
+
teardown: _,
|
|
307
|
+
clearError: v
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
function Kn() {
|
|
311
|
-
const [e, t] =
|
|
311
|
+
const [e, t] = C(!1), [r, o] = C(null), [i, l] = C(null), d = N(null), a = E((c) => {
|
|
312
312
|
d.current = c;
|
|
313
313
|
}, []), s = E(() => l(null), []), u = E(async () => {
|
|
314
314
|
const c = d.current;
|
|
@@ -325,11 +325,11 @@ function Kn() {
|
|
|
325
325
|
try {
|
|
326
326
|
await c.localParticipant.setScreenShareEnabled(!0);
|
|
327
327
|
let A = 0;
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
if (
|
|
331
|
-
const
|
|
332
|
-
l(
|
|
328
|
+
const x = () => {
|
|
329
|
+
const _ = c.localParticipant.getTrackPublication(gn.Source.ScreenShare);
|
|
330
|
+
if (_ != null && _.track) {
|
|
331
|
+
const v = _.track.attach();
|
|
332
|
+
l(v), t(!0);
|
|
333
333
|
try {
|
|
334
334
|
c.localParticipant.publishData(
|
|
335
335
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
@@ -339,15 +339,15 @@ function Kn() {
|
|
|
339
339
|
}
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
A++ < 10 ? setTimeout(
|
|
342
|
+
A++ < 10 ? setTimeout(x, 100) : t(!0);
|
|
343
343
|
};
|
|
344
|
-
|
|
344
|
+
x();
|
|
345
345
|
} catch (A) {
|
|
346
|
-
const
|
|
347
|
-
|
|
346
|
+
const x = A instanceof Error ? A.name : "";
|
|
347
|
+
x !== "NotAllowedError" && x !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
}, [e, s]),
|
|
350
|
+
}, [e, s]), y = E(() => {
|
|
351
351
|
const c = d.current;
|
|
352
352
|
if (c && e)
|
|
353
353
|
try {
|
|
@@ -356,10 +356,10 @@ function Kn() {
|
|
|
356
356
|
}
|
|
357
357
|
s(), t(!1), o(null), d.current = null;
|
|
358
358
|
}, [e, s]), f = E(() => o(null), []);
|
|
359
|
-
return { isEnabled: e, error: r, previewEl: i, toggle: u, attachRoom: a, teardown:
|
|
359
|
+
return { isEnabled: e, error: r, previewEl: i, toggle: u, attachRoom: a, teardown: y, clearError: f };
|
|
360
360
|
}
|
|
361
361
|
function Xn() {
|
|
362
|
-
const [e, t] =
|
|
362
|
+
const [e, t] = C([]), [r, o] = C([]), i = E(async () => {
|
|
363
363
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
364
364
|
try {
|
|
365
365
|
const l = await navigator.mediaDevices.enumerateDevices();
|
|
@@ -374,14 +374,14 @@ function Xn() {
|
|
|
374
374
|
}, [i]), { mics: e, cameras: r, refresh: i };
|
|
375
375
|
}
|
|
376
376
|
function Qn(e, t, r = !1) {
|
|
377
|
-
const [o, i] =
|
|
377
|
+
const [o, i] = C(null), [l, d] = C(null), [a, s] = C(!r && !!e);
|
|
378
378
|
return I(() => {
|
|
379
379
|
if (r || !e) {
|
|
380
380
|
s(!1);
|
|
381
381
|
return;
|
|
382
382
|
}
|
|
383
|
-
const u = new AbortController(),
|
|
384
|
-
return s(!0), d(null), fetch(`${
|
|
383
|
+
const u = new AbortController(), y = t || "https://app.livelayer.studio";
|
|
384
|
+
return s(!0), d(null), fetch(`${y}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
385
385
|
signal: u.signal
|
|
386
386
|
}).then(async (f) => {
|
|
387
387
|
if (!f.ok) {
|
|
@@ -416,7 +416,7 @@ function tr({
|
|
|
416
416
|
defaultValue: t = "expanded",
|
|
417
417
|
onChange: r
|
|
418
418
|
} = {}) {
|
|
419
|
-
const o = e !== void 0, [i, l] =
|
|
419
|
+
const o = e !== void 0, [i, l] = C(t), d = o ? e : i, a = E(
|
|
420
420
|
(s) => {
|
|
421
421
|
s !== d && (o || l(s), r == null || r(s));
|
|
422
422
|
},
|
|
@@ -450,7 +450,7 @@ function or({
|
|
|
450
450
|
}
|
|
451
451
|
const ir = 640;
|
|
452
452
|
function lr(e = ir) {
|
|
453
|
-
const [t, r] =
|
|
453
|
+
const [t, r] = C(!1);
|
|
454
454
|
return I(() => {
|
|
455
455
|
if (e === !1) {
|
|
456
456
|
r(!1);
|
|
@@ -480,7 +480,7 @@ function Xt() {
|
|
|
480
480
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
481
481
|
}
|
|
482
482
|
function cr(e) {
|
|
483
|
-
const [t, r] =
|
|
483
|
+
const [t, r] = C(
|
|
484
484
|
() => e ?? Xt()
|
|
485
485
|
);
|
|
486
486
|
return I(() => {
|
|
@@ -589,7 +589,7 @@ function yr(e) {
|
|
|
589
589
|
[l, d, a]
|
|
590
590
|
);
|
|
591
591
|
}
|
|
592
|
-
const en = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */
|
|
592
|
+
const en = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ g(
|
|
593
593
|
"svg",
|
|
594
594
|
{
|
|
595
595
|
className: t,
|
|
@@ -714,23 +714,23 @@ const kr = ({
|
|
|
714
714
|
agentName: d,
|
|
715
715
|
containerEl: a
|
|
716
716
|
}) => {
|
|
717
|
-
const s = wr(e), u = s === "right" ? "left" : "right",
|
|
717
|
+
const s = wr(e), u = s === "right" ? "left" : "right", y = t ? 80 : 72, f = !!l, c = !!a, [A, x] = C(null), [_, v] = C(!1), b = N(null), S = N(!1), M = E(
|
|
718
718
|
(O) => {
|
|
719
719
|
if (typeof window > "u") return O;
|
|
720
|
-
const j =
|
|
720
|
+
const j = y / 2, H = rn + j, G = window.innerHeight - rn - j;
|
|
721
721
|
return G < H ? Math.max(H, O) : Math.max(H, Math.min(G, O));
|
|
722
722
|
},
|
|
723
|
-
[
|
|
723
|
+
[y]
|
|
724
724
|
);
|
|
725
725
|
I(() => {
|
|
726
726
|
if (c) {
|
|
727
|
-
|
|
727
|
+
x(null);
|
|
728
728
|
return;
|
|
729
729
|
}
|
|
730
730
|
const O = xr();
|
|
731
|
-
|
|
731
|
+
x(M(O ?? window.innerHeight / 2));
|
|
732
732
|
const j = () => {
|
|
733
|
-
|
|
733
|
+
x((H) => H === null ? null : M(H));
|
|
734
734
|
};
|
|
735
735
|
return window.addEventListener("resize", j), () => window.removeEventListener("resize", j);
|
|
736
736
|
}, [M, c]);
|
|
@@ -741,7 +741,7 @@ const kr = ({
|
|
|
741
741
|
O.currentTarget.setPointerCapture(O.pointerId);
|
|
742
742
|
} catch {
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
b.current = {
|
|
745
745
|
startClientY: O.clientY,
|
|
746
746
|
startCenterY: A,
|
|
747
747
|
moved: !1
|
|
@@ -751,27 +751,27 @@ const kr = ({
|
|
|
751
751
|
[A, c]
|
|
752
752
|
), k = E(
|
|
753
753
|
(O) => {
|
|
754
|
-
const j =
|
|
754
|
+
const j = b.current;
|
|
755
755
|
if (!j) return;
|
|
756
756
|
const H = O.clientY - j.startClientY;
|
|
757
|
-
!j.moved && Math.abs(H) > _r && (j.moved = !0,
|
|
757
|
+
!j.moved && Math.abs(H) > _r && (j.moved = !0, v(!0)), j.moved && x(M(j.startCenterY + H));
|
|
758
758
|
},
|
|
759
759
|
[M]
|
|
760
760
|
), R = E(
|
|
761
761
|
(O) => {
|
|
762
|
-
const j =
|
|
762
|
+
const j = b.current;
|
|
763
763
|
if (j) {
|
|
764
764
|
try {
|
|
765
765
|
O.currentTarget.releasePointerCapture(O.pointerId);
|
|
766
766
|
} catch {
|
|
767
767
|
}
|
|
768
|
-
|
|
768
|
+
b.current = null, j.moved && (v(!1), S.current = !0, x((H) => (H !== null && on(H), H)));
|
|
769
769
|
}
|
|
770
770
|
},
|
|
771
771
|
[]
|
|
772
772
|
), B = E(() => {
|
|
773
|
-
if (
|
|
774
|
-
|
|
773
|
+
if (S.current) {
|
|
774
|
+
S.current = !1;
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
777
777
|
o();
|
|
@@ -780,7 +780,7 @@ const kr = ({
|
|
|
780
780
|
if (O.key === "ArrowUp" || O.key === "ArrowDown") {
|
|
781
781
|
O.preventDefault();
|
|
782
782
|
const j = O.key === "ArrowUp" ? -8 : 8;
|
|
783
|
-
|
|
783
|
+
x((H) => {
|
|
784
784
|
if (H === null) return H;
|
|
785
785
|
const G = M(H + j);
|
|
786
786
|
return on(G), G;
|
|
@@ -793,10 +793,10 @@ const kr = ({
|
|
|
793
793
|
`ll-hidden--${s}`,
|
|
794
794
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
795
795
|
r ? "ll-hidden--speaking" : null,
|
|
796
|
-
|
|
796
|
+
_ ? "is-dragging" : null,
|
|
797
797
|
f ? "ll-hidden--with-avatar" : null,
|
|
798
798
|
c ? "ll-hidden--scoped" : null
|
|
799
|
-
].filter(Boolean).join(" "), U = A === null ? void 0 : { top: `${A -
|
|
799
|
+
].filter(Boolean).join(" "), U = A === null ? void 0 : { top: `${A - y / 2}px`, transform: "none" };
|
|
800
800
|
return /* @__PURE__ */ n(
|
|
801
801
|
"button",
|
|
802
802
|
{
|
|
@@ -816,7 +816,7 @@ const kr = ({
|
|
|
816
816
|
// as the click affordance), then the circular avatar photo
|
|
817
817
|
// taking the rest of the tab. Reinforces "this is an
|
|
818
818
|
// avatar-based experience" even when collapsed.
|
|
819
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ g(Ye, { children: [
|
|
820
820
|
/* @__PURE__ */ n(
|
|
821
821
|
nn,
|
|
822
822
|
{
|
|
@@ -852,19 +852,19 @@ const kr = ({
|
|
|
852
852
|
barClassName: l
|
|
853
853
|
}) => {
|
|
854
854
|
const d = N(null), a = N([]), s = Ge(() => {
|
|
855
|
-
const
|
|
856
|
-
return Array.from({ length: t }, (f, c) => 0.5 + c *
|
|
855
|
+
const y = (Math.sqrt(5) - 1) / 2;
|
|
856
|
+
return Array.from({ length: t }, (f, c) => 0.5 + c * y % 1 * 0.5);
|
|
857
857
|
}, [t]);
|
|
858
858
|
I(() => e.subscribe((f) => {
|
|
859
859
|
for (let c = 0; c < t; c++) {
|
|
860
860
|
const A = a.current[c];
|
|
861
861
|
if (!A) continue;
|
|
862
|
-
const
|
|
863
|
-
A.style.height = `${
|
|
862
|
+
const x = Math.max(o, f * r * s[c]);
|
|
863
|
+
A.style.height = `${x}px`;
|
|
864
864
|
}
|
|
865
865
|
}), [e, t, r, o, s]);
|
|
866
866
|
const u = ["ll-waveform", i].filter(Boolean).join(" ");
|
|
867
|
-
return /* @__PURE__ */ n("div", { ref: d, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (
|
|
867
|
+
return /* @__PURE__ */ n("div", { ref: d, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (y, f) => /* @__PURE__ */ n(
|
|
868
868
|
"div",
|
|
869
869
|
{
|
|
870
870
|
ref: (c) => {
|
|
@@ -892,7 +892,7 @@ const kr = ({
|
|
|
892
892
|
className: "ll-minimized ll-minimized--mobile",
|
|
893
893
|
role: "region",
|
|
894
894
|
"aria-label": `${r} widget`,
|
|
895
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ g(
|
|
896
896
|
"button",
|
|
897
897
|
{
|
|
898
898
|
type: "button",
|
|
@@ -921,18 +921,18 @@ const kr = ({
|
|
|
921
921
|
}
|
|
922
922
|
),
|
|
923
923
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
924
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ g("div", { className: "ll-minimized__controls", children: [
|
|
925
925
|
/* @__PURE__ */ n(
|
|
926
926
|
"span",
|
|
927
927
|
{
|
|
928
928
|
className: "ll-minimized__btn",
|
|
929
929
|
role: "button",
|
|
930
930
|
tabIndex: 0,
|
|
931
|
-
onClick: (
|
|
932
|
-
|
|
931
|
+
onClick: (y) => {
|
|
932
|
+
y.stopPropagation(), s();
|
|
933
933
|
},
|
|
934
|
-
onKeyDown: (
|
|
935
|
-
(
|
|
934
|
+
onKeyDown: (y) => {
|
|
935
|
+
(y.key === "Enter" || y.key === " ") && (y.stopPropagation(), y.preventDefault(), s());
|
|
936
936
|
},
|
|
937
937
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
938
938
|
children: /* @__PURE__ */ n(en, { muted: l, className: "ll-minimized__icon" })
|
|
@@ -951,7 +951,7 @@ const kr = ({
|
|
|
951
951
|
"data-position": e,
|
|
952
952
|
role: "region",
|
|
953
953
|
"aria-label": `${r} widget`,
|
|
954
|
-
children: /* @__PURE__ */
|
|
954
|
+
children: /* @__PURE__ */ g("div", { className: "ll-minimized__surface", children: [
|
|
955
955
|
o ? (
|
|
956
956
|
// eslint-disable-next-line @next/next/no-img-element
|
|
957
957
|
/* @__PURE__ */ n(
|
|
@@ -963,11 +963,11 @@ const kr = ({
|
|
|
963
963
|
}
|
|
964
964
|
)
|
|
965
965
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
966
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ g("div", { className: "ll-minimized__meta", children: [
|
|
967
967
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
968
968
|
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children: i === "speaking" ? "Speaking" : i === "thinking" ? "Thinking" : "Listening" })
|
|
969
969
|
] }),
|
|
970
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ g("div", { className: "ll-minimized__controls", children: [
|
|
971
971
|
/* @__PURE__ */ n(
|
|
972
972
|
"button",
|
|
973
973
|
{
|
|
@@ -1008,7 +1008,7 @@ const kr = ({
|
|
|
1008
1008
|
className: o,
|
|
1009
1009
|
style: i
|
|
1010
1010
|
}) => {
|
|
1011
|
-
const [l, d] =
|
|
1011
|
+
const [l, d] = C(!1), a = N(e);
|
|
1012
1012
|
if (I(() => {
|
|
1013
1013
|
a.current !== e && (a.current = e, d(!1));
|
|
1014
1014
|
}, [e]), !e) return null;
|
|
@@ -1045,7 +1045,7 @@ const kr = ({
|
|
|
1045
1045
|
anchorRef: r,
|
|
1046
1046
|
children: o
|
|
1047
1047
|
}) => {
|
|
1048
|
-
const i = N(null), [l, d] =
|
|
1048
|
+
const i = N(null), [l, d] = C(null);
|
|
1049
1049
|
return mn(() => {
|
|
1050
1050
|
if (!e) {
|
|
1051
1051
|
d(null);
|
|
@@ -1054,11 +1054,11 @@ const kr = ({
|
|
|
1054
1054
|
const a = r.current;
|
|
1055
1055
|
if (!a) return;
|
|
1056
1056
|
const s = () => {
|
|
1057
|
-
const u = a.getBoundingClientRect(),
|
|
1057
|
+
const u = a.getBoundingClientRect(), y = {
|
|
1058
1058
|
top: u.top - Sr,
|
|
1059
1059
|
left: u.left + u.width / 2
|
|
1060
1060
|
}, f = ln + 90, c = window.innerWidth - ln - 90;
|
|
1061
|
-
|
|
1061
|
+
y.left < f && (y.left = f), y.left > c && (y.left = c), d(y);
|
|
1062
1062
|
};
|
|
1063
1063
|
return s(), window.addEventListener("scroll", s, !0), window.addEventListener("resize", s), () => {
|
|
1064
1064
|
window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
|
|
@@ -1066,8 +1066,8 @@ const kr = ({
|
|
|
1066
1066
|
}, [e, r]), I(() => {
|
|
1067
1067
|
if (!e) return;
|
|
1068
1068
|
const a = (u) => {
|
|
1069
|
-
const
|
|
1070
|
-
f && f.contains(
|
|
1069
|
+
const y = u.target, f = i.current, c = r.current;
|
|
1070
|
+
f && f.contains(y) || c && c.contains(y) || t();
|
|
1071
1071
|
}, s = (u) => {
|
|
1072
1072
|
u.key === "Escape" && (u.stopPropagation(), t());
|
|
1073
1073
|
};
|
|
@@ -1105,19 +1105,19 @@ const kr = ({
|
|
|
1105
1105
|
allowScreenShare: a,
|
|
1106
1106
|
isSpeakerMuted: s,
|
|
1107
1107
|
onToggleSpeaker: u,
|
|
1108
|
-
allowTyping:
|
|
1108
|
+
allowTyping: y,
|
|
1109
1109
|
isTypingOpen: f,
|
|
1110
1110
|
onToggleTyping: c,
|
|
1111
1111
|
onDisconnect: A
|
|
1112
1112
|
}) => {
|
|
1113
|
-
const [
|
|
1114
|
-
return /* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1113
|
+
const [x, _] = C(!1), v = N(null);
|
|
1114
|
+
return /* @__PURE__ */ g(Ye, { children: [
|
|
1115
|
+
/* @__PURE__ */ g(
|
|
1116
1116
|
"div",
|
|
1117
1117
|
{
|
|
1118
1118
|
className: "ll-toolbar ll-toolbar--compact",
|
|
1119
1119
|
"data-testid": "compact-toolbar",
|
|
1120
|
-
onClick: (
|
|
1120
|
+
onClick: (b) => b.stopPropagation(),
|
|
1121
1121
|
children: [
|
|
1122
1122
|
/* @__PURE__ */ n(
|
|
1123
1123
|
"button",
|
|
@@ -1132,13 +1132,13 @@ const kr = ({
|
|
|
1132
1132
|
/* @__PURE__ */ n(
|
|
1133
1133
|
"button",
|
|
1134
1134
|
{
|
|
1135
|
-
ref:
|
|
1135
|
+
ref: v,
|
|
1136
1136
|
type: "button",
|
|
1137
|
-
className: `ll-tool ${
|
|
1138
|
-
onClick: () =>
|
|
1137
|
+
className: `ll-tool ${x ? "is-on" : ""}`,
|
|
1138
|
+
onClick: () => _((b) => !b),
|
|
1139
1139
|
"aria-label": "More controls",
|
|
1140
1140
|
"aria-haspopup": "menu",
|
|
1141
|
-
"aria-expanded":
|
|
1141
|
+
"aria-expanded": x,
|
|
1142
1142
|
children: /* @__PURE__ */ n(Rr, {})
|
|
1143
1143
|
}
|
|
1144
1144
|
),
|
|
@@ -1155,20 +1155,20 @@ const kr = ({
|
|
|
1155
1155
|
]
|
|
1156
1156
|
}
|
|
1157
1157
|
),
|
|
1158
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ g(
|
|
1159
1159
|
Nr,
|
|
1160
1160
|
{
|
|
1161
|
-
open:
|
|
1162
|
-
onClose: () =>
|
|
1163
|
-
anchorRef:
|
|
1161
|
+
open: x,
|
|
1162
|
+
onClose: () => _(!1),
|
|
1163
|
+
anchorRef: v,
|
|
1164
1164
|
children: [
|
|
1165
|
-
i && /* @__PURE__ */
|
|
1165
|
+
i && /* @__PURE__ */ g(
|
|
1166
1166
|
"button",
|
|
1167
1167
|
{
|
|
1168
1168
|
type: "button",
|
|
1169
1169
|
className: `ll-overflow-popover__item ${r ? "is-on" : ""}`,
|
|
1170
1170
|
onClick: () => {
|
|
1171
|
-
o(),
|
|
1171
|
+
o(), _(!1);
|
|
1172
1172
|
},
|
|
1173
1173
|
children: [
|
|
1174
1174
|
/* @__PURE__ */ n(bn, {}),
|
|
@@ -1176,13 +1176,13 @@ const kr = ({
|
|
|
1176
1176
|
]
|
|
1177
1177
|
}
|
|
1178
1178
|
),
|
|
1179
|
-
a && /* @__PURE__ */
|
|
1179
|
+
a && /* @__PURE__ */ g(
|
|
1180
1180
|
"button",
|
|
1181
1181
|
{
|
|
1182
1182
|
type: "button",
|
|
1183
1183
|
className: `ll-overflow-popover__item ${l ? "is-on" : ""}`,
|
|
1184
1184
|
onClick: () => {
|
|
1185
|
-
d(),
|
|
1185
|
+
d(), _(!1);
|
|
1186
1186
|
},
|
|
1187
1187
|
children: [
|
|
1188
1188
|
/* @__PURE__ */ n(vn, {}),
|
|
@@ -1190,13 +1190,13 @@ const kr = ({
|
|
|
1190
1190
|
]
|
|
1191
1191
|
}
|
|
1192
1192
|
),
|
|
1193
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ g(
|
|
1194
1194
|
"button",
|
|
1195
1195
|
{
|
|
1196
1196
|
type: "button",
|
|
1197
1197
|
className: `ll-overflow-popover__item ${s ? "is-on" : ""}`,
|
|
1198
1198
|
onClick: () => {
|
|
1199
|
-
u(),
|
|
1199
|
+
u(), _(!1);
|
|
1200
1200
|
},
|
|
1201
1201
|
children: [
|
|
1202
1202
|
/* @__PURE__ */ n(_n, { muted: s }),
|
|
@@ -1204,13 +1204,13 @@ const kr = ({
|
|
|
1204
1204
|
]
|
|
1205
1205
|
}
|
|
1206
1206
|
),
|
|
1207
|
-
|
|
1207
|
+
y && /* @__PURE__ */ g(
|
|
1208
1208
|
"button",
|
|
1209
1209
|
{
|
|
1210
1210
|
type: "button",
|
|
1211
1211
|
className: `ll-overflow-popover__item ${f ? "is-on" : ""}`,
|
|
1212
1212
|
onClick: () => {
|
|
1213
|
-
c(),
|
|
1213
|
+
c(), _(!1);
|
|
1214
1214
|
},
|
|
1215
1215
|
children: [
|
|
1216
1216
|
/* @__PURE__ */ n(Ir, {}),
|
|
@@ -1218,7 +1218,7 @@ const kr = ({
|
|
|
1218
1218
|
]
|
|
1219
1219
|
}
|
|
1220
1220
|
),
|
|
1221
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ g(
|
|
1222
1222
|
"button",
|
|
1223
1223
|
{
|
|
1224
1224
|
type: "button",
|
|
@@ -1237,7 +1237,7 @@ const kr = ({
|
|
|
1237
1237
|
] });
|
|
1238
1238
|
};
|
|
1239
1239
|
function Rr() {
|
|
1240
|
-
return /* @__PURE__ */
|
|
1240
|
+
return /* @__PURE__ */ g(
|
|
1241
1241
|
"svg",
|
|
1242
1242
|
{
|
|
1243
1243
|
width: "16",
|
|
@@ -1281,15 +1281,15 @@ const Mr = ({
|
|
|
1281
1281
|
teamMembers: a,
|
|
1282
1282
|
currentTeamMemberId: s,
|
|
1283
1283
|
isSwitchingTeamMember: u,
|
|
1284
|
-
teamSwitcherOpen:
|
|
1284
|
+
teamSwitcherOpen: y,
|
|
1285
1285
|
onToggleTeamSwitcher: f,
|
|
1286
1286
|
onSelectTeamMember: c,
|
|
1287
1287
|
languageMenuOpen: A,
|
|
1288
|
-
onToggleLanguageMenu:
|
|
1289
|
-
connectionState:
|
|
1290
|
-
agentState:
|
|
1291
|
-
transcript:
|
|
1292
|
-
canResume:
|
|
1288
|
+
onToggleLanguageMenu: x,
|
|
1289
|
+
connectionState: _,
|
|
1290
|
+
agentState: v,
|
|
1291
|
+
transcript: b,
|
|
1292
|
+
canResume: S,
|
|
1293
1293
|
needsUserGesture: M,
|
|
1294
1294
|
error: D,
|
|
1295
1295
|
isMuted: k,
|
|
@@ -1330,7 +1330,7 @@ const Mr = ({
|
|
|
1330
1330
|
onClearMicError: kt
|
|
1331
1331
|
}) => {
|
|
1332
1332
|
var De;
|
|
1333
|
-
const Ie = ((a == null ? void 0 : a.length) ?? 0) > 1, Me =
|
|
1333
|
+
const Ie = ((a == null ? void 0 : a.length) ?? 0) > 1, Me = _ === "connecting" || _ === "connected", re = _ === "connected", Ze = _ === "idle" || _ === "disconnected" || _ === "error", [et, Oe] = C(!1);
|
|
1334
1334
|
I(() => {
|
|
1335
1335
|
if (!le) {
|
|
1336
1336
|
Oe(!1);
|
|
@@ -1346,7 +1346,7 @@ const Mr = ({
|
|
|
1346
1346
|
le.removeEventListener("playing", h), le.removeEventListener("loadeddata", h);
|
|
1347
1347
|
};
|
|
1348
1348
|
}, [le]);
|
|
1349
|
-
const [Te, ee] =
|
|
1349
|
+
const [Te, ee] = C(!1);
|
|
1350
1350
|
I(() => {
|
|
1351
1351
|
if (!re) {
|
|
1352
1352
|
ee(!1);
|
|
@@ -1356,7 +1356,7 @@ const Mr = ({
|
|
|
1356
1356
|
const h = setTimeout(() => ee(!0), 8e3);
|
|
1357
1357
|
return () => clearTimeout(h);
|
|
1358
1358
|
}, [re, et]);
|
|
1359
|
-
const gt =
|
|
1359
|
+
const gt = _ === "connecting" || re && !!o && !et && !Te, tt = N(null), oe = N(null);
|
|
1360
1360
|
I(() => {
|
|
1361
1361
|
const h = tt.current;
|
|
1362
1362
|
h && (h.innerHTML = "", U && (U.style.width = "100%", U.style.height = "100%", U.style.objectFit = "cover", U.style.transform = "scaleX(-1)", h.appendChild(U)));
|
|
@@ -1364,22 +1364,22 @@ const Mr = ({
|
|
|
1364
1364
|
const h = oe.current;
|
|
1365
1365
|
h && (h.innerHTML = "", G && (G.style.width = "100%", G.style.height = "100%", G.style.objectFit = "contain", h.appendChild(G)));
|
|
1366
1366
|
}, [G]);
|
|
1367
|
-
const [ie, de] =
|
|
1367
|
+
const [ie, de] = C(!1), [ve, X] = C(!1), ue = N(null), be = N(null);
|
|
1368
1368
|
I(() => {
|
|
1369
|
-
if (!ie && !ve && !A && !
|
|
1369
|
+
if (!ie && !ve && !A && !y) return;
|
|
1370
1370
|
const h = () => {
|
|
1371
|
-
de(!1), X(!1), A &&
|
|
1371
|
+
de(!1), X(!1), A && x(), y && f();
|
|
1372
1372
|
};
|
|
1373
1373
|
return document.addEventListener("click", h), () => document.removeEventListener("click", h);
|
|
1374
1374
|
}, [
|
|
1375
1375
|
ie,
|
|
1376
1376
|
ve,
|
|
1377
1377
|
A,
|
|
1378
|
-
|
|
1379
|
-
|
|
1378
|
+
y,
|
|
1379
|
+
x,
|
|
1380
1380
|
f
|
|
1381
1381
|
]);
|
|
1382
|
-
const [He, Lt] =
|
|
1382
|
+
const [He, Lt] = C(!1), nt = E(() => Lt((h) => !h), []), [we, rt] = C(""), ot = E(
|
|
1383
1383
|
(h) => {
|
|
1384
1384
|
h.preventDefault();
|
|
1385
1385
|
const J = we.trim();
|
|
@@ -1388,15 +1388,15 @@ const Mr = ({
|
|
|
1388
1388
|
[we, Re]
|
|
1389
1389
|
), it = d.productName || "Live Layer";
|
|
1390
1390
|
let _e = null, xe = null;
|
|
1391
|
-
for (let h =
|
|
1392
|
-
const J =
|
|
1391
|
+
for (let h = b.length - 1; h >= 0; h--) {
|
|
1392
|
+
const J = b[h];
|
|
1393
1393
|
if (!_e && J.role === "agent" ? _e = J : !xe && J.role === "user" && (xe = J), _e && xe) break;
|
|
1394
1394
|
}
|
|
1395
1395
|
const We = re ? (_e == null ? void 0 : _e.text) || null : l || null, yt = re && (xe == null ? void 0 : xe.text) || null, Be = [
|
|
1396
1396
|
"ll-expanded",
|
|
1397
1397
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1398
1398
|
].join(" ");
|
|
1399
|
-
return /* @__PURE__ */
|
|
1399
|
+
return /* @__PURE__ */ g(
|
|
1400
1400
|
"div",
|
|
1401
1401
|
{
|
|
1402
1402
|
className: Be,
|
|
@@ -1405,7 +1405,7 @@ const Mr = ({
|
|
|
1405
1405
|
role: "dialog",
|
|
1406
1406
|
"aria-label": `${r} widget`,
|
|
1407
1407
|
children: [
|
|
1408
|
-
/* @__PURE__ */
|
|
1408
|
+
/* @__PURE__ */ g("div", { className: "ll-expanded__bg", children: [
|
|
1409
1409
|
o ? /* @__PURE__ */ n(
|
|
1410
1410
|
Cr,
|
|
1411
1411
|
{
|
|
@@ -1427,11 +1427,11 @@ const Mr = ({
|
|
|
1427
1427
|
)
|
|
1428
1428
|
] }),
|
|
1429
1429
|
/* @__PURE__ */ n("div", { ref: pt, className: "ll-expanded__video" }),
|
|
1430
|
-
gt && /* @__PURE__ */
|
|
1430
|
+
gt && /* @__PURE__ */ g("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1431
1431
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1432
1432
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: u ? "Switching..." : "Connecting..." })
|
|
1433
1433
|
] }),
|
|
1434
|
-
M && re && /* @__PURE__ */
|
|
1434
|
+
M && re && /* @__PURE__ */ g(
|
|
1435
1435
|
"button",
|
|
1436
1436
|
{
|
|
1437
1437
|
type: "button",
|
|
@@ -1443,7 +1443,7 @@ const Mr = ({
|
|
|
1443
1443
|
]
|
|
1444
1444
|
}
|
|
1445
1445
|
),
|
|
1446
|
-
ft && /* @__PURE__ */
|
|
1446
|
+
ft && /* @__PURE__ */ g(
|
|
1447
1447
|
"div",
|
|
1448
1448
|
{
|
|
1449
1449
|
className: "ll-expanded__overlay ll-expanded__overlay--transforming",
|
|
@@ -1456,11 +1456,11 @@ const Mr = ({
|
|
|
1456
1456
|
]
|
|
1457
1457
|
}
|
|
1458
1458
|
),
|
|
1459
|
-
Me ? /* @__PURE__ */
|
|
1460
|
-
!ne && /* @__PURE__ */
|
|
1461
|
-
!Pe && /* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */
|
|
1459
|
+
Me ? /* @__PURE__ */ g(Ye, { children: [
|
|
1460
|
+
!ne && /* @__PURE__ */ g("div", { className: "ll-expanded__topbar", children: [
|
|
1461
|
+
!Pe && /* @__PURE__ */ g("div", { className: "ll-expanded__topbar-left", children: [
|
|
1462
|
+
/* @__PURE__ */ g("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1463
|
+
/* @__PURE__ */ g(
|
|
1464
1464
|
"button",
|
|
1465
1465
|
{
|
|
1466
1466
|
type: "button",
|
|
@@ -1469,20 +1469,20 @@ const Mr = ({
|
|
|
1469
1469
|
Ie && (h.stopPropagation(), f());
|
|
1470
1470
|
},
|
|
1471
1471
|
"aria-haspopup": Ie ? "listbox" : void 0,
|
|
1472
|
-
"aria-expanded": Ie ?
|
|
1472
|
+
"aria-expanded": Ie ? y : void 0,
|
|
1473
1473
|
children: [
|
|
1474
1474
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1475
1475
|
Ie && /* @__PURE__ */ n(bt, {})
|
|
1476
1476
|
]
|
|
1477
1477
|
}
|
|
1478
1478
|
),
|
|
1479
|
-
Ie &&
|
|
1479
|
+
Ie && y && /* @__PURE__ */ n(
|
|
1480
1480
|
"div",
|
|
1481
1481
|
{
|
|
1482
1482
|
className: "ll-hmenu",
|
|
1483
1483
|
onClick: (h) => h.stopPropagation(),
|
|
1484
1484
|
role: "listbox",
|
|
1485
|
-
children: a == null ? void 0 : a.map((h) => /* @__PURE__ */
|
|
1485
|
+
children: a == null ? void 0 : a.map((h) => /* @__PURE__ */ g(
|
|
1486
1486
|
"button",
|
|
1487
1487
|
{
|
|
1488
1488
|
type: "button",
|
|
@@ -1508,14 +1508,14 @@ const Mr = ({
|
|
|
1508
1508
|
}
|
|
1509
1509
|
)
|
|
1510
1510
|
] }),
|
|
1511
|
-
/* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1511
|
+
/* @__PURE__ */ g("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1512
|
+
/* @__PURE__ */ g(
|
|
1513
1513
|
"button",
|
|
1514
1514
|
{
|
|
1515
1515
|
type: "button",
|
|
1516
1516
|
className: "ll-hpill ll-hpill--compact",
|
|
1517
1517
|
onClick: (h) => {
|
|
1518
|
-
h.stopPropagation(),
|
|
1518
|
+
h.stopPropagation(), x();
|
|
1519
1519
|
},
|
|
1520
1520
|
"aria-haspopup": "listbox",
|
|
1521
1521
|
"aria-expanded": A,
|
|
@@ -1549,12 +1549,12 @@ const Mr = ({
|
|
|
1549
1549
|
/* @__PURE__ */ n(
|
|
1550
1550
|
"span",
|
|
1551
1551
|
{
|
|
1552
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1553
|
-
children:
|
|
1552
|
+
className: `ll-expanded__state ll-expanded__state--${v}`,
|
|
1553
|
+
children: v
|
|
1554
1554
|
}
|
|
1555
1555
|
)
|
|
1556
1556
|
] }),
|
|
1557
|
-
/* @__PURE__ */
|
|
1557
|
+
/* @__PURE__ */ g("div", { className: "ll-expanded__header-actions", children: [
|
|
1558
1558
|
ye !== !1 && /* @__PURE__ */ n(
|
|
1559
1559
|
"button",
|
|
1560
1560
|
{
|
|
@@ -1579,18 +1579,18 @@ const Mr = ({
|
|
|
1579
1579
|
)
|
|
1580
1580
|
] })
|
|
1581
1581
|
] }),
|
|
1582
|
-
ne && /* @__PURE__ */
|
|
1582
|
+
ne && /* @__PURE__ */ g("div", { className: "ll-compact-status", "data-state": v, children: [
|
|
1583
1583
|
/* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1584
|
-
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children:
|
|
1584
|
+
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: v })
|
|
1585
1585
|
] })
|
|
1586
1586
|
] }) : (
|
|
1587
1587
|
// Idle-state header with Live Layer product name + minimize/close.
|
|
1588
1588
|
// Hidden in compact mode — on a 140×210 docked slot the brand pill
|
|
1589
1589
|
// and 40px buttons crowded out the central "Start video call"
|
|
1590
1590
|
// affordance. The user can dismiss by scrolling past the slot.
|
|
1591
|
-
!ne && /* @__PURE__ */
|
|
1591
|
+
!ne && /* @__PURE__ */ g("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1592
1592
|
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: it }),
|
|
1593
|
-
/* @__PURE__ */
|
|
1593
|
+
/* @__PURE__ */ g("div", { className: "ll-expanded__header-actions", children: [
|
|
1594
1594
|
ye !== !1 && /* @__PURE__ */ n(
|
|
1595
1595
|
"button",
|
|
1596
1596
|
{
|
|
@@ -1615,9 +1615,9 @@ const Mr = ({
|
|
|
1615
1615
|
] })
|
|
1616
1616
|
),
|
|
1617
1617
|
Ze && /* @__PURE__ */ (() => {
|
|
1618
|
-
const h =
|
|
1619
|
-
return /* @__PURE__ */
|
|
1620
|
-
!D && /* @__PURE__ */
|
|
1618
|
+
const h = S ? "Resume session" : _ === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1619
|
+
return /* @__PURE__ */ g(Ye, { children: [
|
|
1620
|
+
!D && /* @__PURE__ */ g(
|
|
1621
1621
|
"button",
|
|
1622
1622
|
{
|
|
1623
1623
|
type: "button",
|
|
@@ -1630,7 +1630,7 @@ const Mr = ({
|
|
|
1630
1630
|
]
|
|
1631
1631
|
}
|
|
1632
1632
|
),
|
|
1633
|
-
!ne && /* @__PURE__ */
|
|
1633
|
+
!ne && /* @__PURE__ */ g("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1634
1634
|
l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
|
|
1635
1635
|
/* @__PURE__ */ n(
|
|
1636
1636
|
"button",
|
|
@@ -1645,7 +1645,7 @@ const Mr = ({
|
|
|
1645
1645
|
] })
|
|
1646
1646
|
] });
|
|
1647
1647
|
})(),
|
|
1648
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ g(
|
|
1649
1649
|
"div",
|
|
1650
1650
|
{
|
|
1651
1651
|
className: `ll-expanded__pip ${Me && (F || H) ? "is-visible" : ""}`,
|
|
@@ -1667,7 +1667,7 @@ const Mr = ({
|
|
|
1667
1667
|
]
|
|
1668
1668
|
}
|
|
1669
1669
|
),
|
|
1670
|
-
Me ? /* @__PURE__ */
|
|
1670
|
+
Me ? /* @__PURE__ */ g("div", { className: "ll-expanded__bottom", children: [
|
|
1671
1671
|
!ne && We && /* @__PURE__ */ n(
|
|
1672
1672
|
"div",
|
|
1673
1673
|
{
|
|
@@ -1684,7 +1684,7 @@ const Mr = ({
|
|
|
1684
1684
|
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: yt })
|
|
1685
1685
|
}
|
|
1686
1686
|
),
|
|
1687
|
-
!Pe && !ne && /* @__PURE__ */
|
|
1687
|
+
!Pe && !ne && /* @__PURE__ */ g("div", { className: "ll-toolbar", onClick: (h) => h.stopPropagation(), children: [
|
|
1688
1688
|
ge && /* @__PURE__ */ n(
|
|
1689
1689
|
"button",
|
|
1690
1690
|
{
|
|
@@ -1696,7 +1696,7 @@ const Mr = ({
|
|
|
1696
1696
|
children: /* @__PURE__ */ n(vn, {})
|
|
1697
1697
|
}
|
|
1698
1698
|
),
|
|
1699
|
-
se && /* @__PURE__ */
|
|
1699
|
+
se && /* @__PURE__ */ g("div", { className: "ll-tool-split", children: [
|
|
1700
1700
|
/* @__PURE__ */ n(
|
|
1701
1701
|
"button",
|
|
1702
1702
|
{
|
|
@@ -1736,7 +1736,7 @@ const Mr = ({
|
|
|
1736
1736
|
}
|
|
1737
1737
|
)
|
|
1738
1738
|
] }),
|
|
1739
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ g("div", { className: "ll-tool-split", children: [
|
|
1740
1740
|
/* @__PURE__ */ n(
|
|
1741
1741
|
"button",
|
|
1742
1742
|
{
|
|
@@ -1818,7 +1818,7 @@ const Mr = ({
|
|
|
1818
1818
|
onDisconnect: Xe
|
|
1819
1819
|
}
|
|
1820
1820
|
),
|
|
1821
|
-
!Pe && pe && (ne ? He : !0) && /* @__PURE__ */
|
|
1821
|
+
!Pe && pe && (ne ? He : !0) && /* @__PURE__ */ g("form", { className: "ll-message-input", onSubmit: ot, children: [
|
|
1822
1822
|
/* @__PURE__ */ n(
|
|
1823
1823
|
"input",
|
|
1824
1824
|
{
|
|
@@ -1842,8 +1842,8 @@ const Mr = ({
|
|
|
1842
1842
|
] })
|
|
1843
1843
|
] }) : null,
|
|
1844
1844
|
(() => {
|
|
1845
|
-
if (R &&
|
|
1846
|
-
return /* @__PURE__ */
|
|
1845
|
+
if (R && _ !== "error")
|
|
1846
|
+
return /* @__PURE__ */ g("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
1847
1847
|
/* @__PURE__ */ n("span", { children: R }),
|
|
1848
1848
|
/* @__PURE__ */ n(
|
|
1849
1849
|
"button",
|
|
@@ -1856,9 +1856,9 @@ const Mr = ({
|
|
|
1856
1856
|
}
|
|
1857
1857
|
)
|
|
1858
1858
|
] });
|
|
1859
|
-
if (!D ||
|
|
1859
|
+
if (!D || _ !== "error") return null;
|
|
1860
1860
|
let h = "Failed to connect", J = "Try again";
|
|
1861
|
-
return D === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : D === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : D === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : D === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : D === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : D.length < 80 && (h = D), /* @__PURE__ */
|
|
1861
|
+
return D === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : D === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : D === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : D === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : D === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : D.length < 80 && (h = D), /* @__PURE__ */ g("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1862
1862
|
/* @__PURE__ */ n("span", { children: h }),
|
|
1863
1863
|
/* @__PURE__ */ n(
|
|
1864
1864
|
"button",
|
|
@@ -1879,7 +1879,7 @@ function bt() {
|
|
|
1879
1879
|
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" }) });
|
|
1880
1880
|
}
|
|
1881
1881
|
function an() {
|
|
1882
|
-
return /* @__PURE__ */
|
|
1882
|
+
return /* @__PURE__ */ g("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1883
1883
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1884
1884
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1885
1885
|
] });
|
|
@@ -1888,20 +1888,20 @@ function cn() {
|
|
|
1888
1888
|
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" }) });
|
|
1889
1889
|
}
|
|
1890
1890
|
function vn() {
|
|
1891
|
-
return /* @__PURE__ */
|
|
1891
|
+
return /* @__PURE__ */ g("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: [
|
|
1892
1892
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1893
1893
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1894
1894
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1895
1895
|
] });
|
|
1896
1896
|
}
|
|
1897
1897
|
function bn() {
|
|
1898
|
-
return /* @__PURE__ */
|
|
1898
|
+
return /* @__PURE__ */ g("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: [
|
|
1899
1899
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1900
1900
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1901
1901
|
] });
|
|
1902
1902
|
}
|
|
1903
1903
|
function wn({ muted: e }) {
|
|
1904
|
-
return /* @__PURE__ */
|
|
1904
|
+
return /* @__PURE__ */ g("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: [
|
|
1905
1905
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1906
1906
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
1907
1907
|
/* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
@@ -1909,16 +1909,16 @@ function wn({ muted: e }) {
|
|
|
1909
1909
|
] });
|
|
1910
1910
|
}
|
|
1911
1911
|
function _n({ muted: e }) {
|
|
1912
|
-
return /* @__PURE__ */
|
|
1912
|
+
return /* @__PURE__ */ g("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: [
|
|
1913
1913
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1914
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */
|
|
1914
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ g(Ye, { children: [
|
|
1915
1915
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1916
1916
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1917
1917
|
] })
|
|
1918
1918
|
] });
|
|
1919
1919
|
}
|
|
1920
1920
|
function Tr() {
|
|
1921
|
-
return /* @__PURE__ */
|
|
1921
|
+
return /* @__PURE__ */ g("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1922
1922
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1923
1923
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
1924
1924
|
] });
|
|
@@ -1939,22 +1939,22 @@ const sn = ({
|
|
|
1939
1939
|
onPick: o,
|
|
1940
1940
|
anchorRef: i
|
|
1941
1941
|
}) => {
|
|
1942
|
-
const [l, d] =
|
|
1942
|
+
const [l, d] = C(null);
|
|
1943
1943
|
return mn(() => {
|
|
1944
1944
|
const a = () => {
|
|
1945
1945
|
const s = i.current;
|
|
1946
1946
|
if (!s) return;
|
|
1947
|
-
const u = s.getBoundingClientRect(),
|
|
1947
|
+
const u = s.getBoundingClientRect(), y = 126, f = window.innerWidth - 16 - 110, c = u.left + u.width / 2;
|
|
1948
1948
|
d({
|
|
1949
1949
|
top: u.top - 8,
|
|
1950
|
-
left: Math.max(
|
|
1950
|
+
left: Math.max(y, Math.min(f, c))
|
|
1951
1951
|
});
|
|
1952
1952
|
};
|
|
1953
1953
|
return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
1954
1954
|
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
1955
1955
|
};
|
|
1956
1956
|
}, [i]), l === null || typeof document > "u" ? null : It(
|
|
1957
|
-
/* @__PURE__ */
|
|
1957
|
+
/* @__PURE__ */ g(
|
|
1958
1958
|
"div",
|
|
1959
1959
|
{
|
|
1960
1960
|
className: "ll-device-menu ll-device-menu--floating",
|
|
@@ -1971,7 +1971,7 @@ const sn = ({
|
|
|
1971
1971
|
/* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
|
|
1972
1972
|
t.map((a, s) => {
|
|
1973
1973
|
const u = r === a.deviceId;
|
|
1974
|
-
return /* @__PURE__ */
|
|
1974
|
+
return /* @__PURE__ */ g(
|
|
1975
1975
|
"button",
|
|
1976
1976
|
{
|
|
1977
1977
|
type: "button",
|
|
@@ -2084,10 +2084,10 @@ function qr(e, t = {}) {
|
|
|
2084
2084
|
);
|
|
2085
2085
|
!R || !q || a.push({ id: R, intent: B, text: q });
|
|
2086
2086
|
}
|
|
2087
|
-
const s = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"],
|
|
2087
|
+
const s = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"], y = Array.from(
|
|
2088
2088
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2089
2089
|
);
|
|
2090
|
-
for (const k of
|
|
2090
|
+
for (const k of y) {
|
|
2091
2091
|
if (st(k) || !dt(k)) continue;
|
|
2092
2092
|
const R = (k.textContent || "").trim();
|
|
2093
2093
|
R && s.push(`${k.tagName}: ${me(R, 200)}`);
|
|
@@ -2099,29 +2099,29 @@ function qr(e, t = {}) {
|
|
|
2099
2099
|
R.length > 10 && s.push(me(R, dn));
|
|
2100
2100
|
}
|
|
2101
2101
|
const c = s.join(`
|
|
2102
|
-
`), A = [],
|
|
2103
|
-
for (const k of
|
|
2102
|
+
`), A = [], x = Array.from(r.querySelectorAll("a[href]"));
|
|
2103
|
+
for (const k of x) {
|
|
2104
2104
|
if (A.length >= Pr) break;
|
|
2105
2105
|
if (st(k) || !dt(k)) continue;
|
|
2106
2106
|
const R = k.getAttribute("href") || "", B = (k.textContent || "").trim();
|
|
2107
2107
|
!R || !B || A.push({ href: R, text: me(B, 100) });
|
|
2108
2108
|
}
|
|
2109
|
-
const
|
|
2109
|
+
const _ = [], v = Array.from(
|
|
2110
2110
|
r.querySelectorAll(
|
|
2111
2111
|
"input, textarea, select"
|
|
2112
2112
|
)
|
|
2113
2113
|
);
|
|
2114
|
-
for (const k of
|
|
2115
|
-
if (
|
|
2114
|
+
for (const k of v) {
|
|
2115
|
+
if (_.length >= $r) break;
|
|
2116
2116
|
if (st(k) || !xt(k) || !dt(k)) continue;
|
|
2117
2117
|
const R = un(k), B = k instanceof HTMLInputElement ? k.type : k.tagName.toLowerCase();
|
|
2118
|
-
R &&
|
|
2118
|
+
R && _.push({ label: me(R, 100), type: B });
|
|
2119
2119
|
}
|
|
2120
|
-
const
|
|
2120
|
+
const b = Array.from(
|
|
2121
2121
|
r.querySelectorAll("[data-ll-form]")
|
|
2122
|
-
),
|
|
2123
|
-
for (const k of
|
|
2124
|
-
if (
|
|
2122
|
+
), S = [];
|
|
2123
|
+
for (const k of b) {
|
|
2124
|
+
if (S.length >= Or) break;
|
|
2125
2125
|
if (Mt(k)) continue;
|
|
2126
2126
|
const R = k.getAttribute("data-ll-form") || "";
|
|
2127
2127
|
if (!R) continue;
|
|
@@ -2153,7 +2153,7 @@ function qr(e, t = {}) {
|
|
|
2153
2153
|
const ce = typeof U.validationMessage == "string" ? U.validationMessage : "";
|
|
2154
2154
|
ce && (G.validationMessage = me(ce, 200)), F.push(G);
|
|
2155
2155
|
}
|
|
2156
|
-
|
|
2156
|
+
S.push({ id: R, intent: B, fields: F });
|
|
2157
2157
|
}
|
|
2158
2158
|
const M = {
|
|
2159
2159
|
url: o,
|
|
@@ -2162,8 +2162,8 @@ function qr(e, t = {}) {
|
|
|
2162
2162
|
regions: a,
|
|
2163
2163
|
visibleText: c,
|
|
2164
2164
|
visibleLinks: A,
|
|
2165
|
-
visibleFields:
|
|
2166
|
-
forms:
|
|
2165
|
+
visibleFields: _,
|
|
2166
|
+
forms: S,
|
|
2167
2167
|
extras: e
|
|
2168
2168
|
};
|
|
2169
2169
|
let D = Ue(JSON.stringify(M.regions)) + Ue(M.visibleText) + Ue(JSON.stringify(M.visibleLinks)) + Ue(JSON.stringify(M.visibleFields));
|
|
@@ -2218,8 +2218,8 @@ function Yr(e) {
|
|
|
2218
2218
|
}
|
|
2219
2219
|
if (o.has(s)) continue;
|
|
2220
2220
|
o.add(s);
|
|
2221
|
-
const
|
|
2222
|
-
i.push({ href: s, text:
|
|
2221
|
+
const y = (d.textContent || "").trim().slice(0, 120);
|
|
2222
|
+
i.push({ href: s, text: y, internal: u });
|
|
2223
2223
|
}
|
|
2224
2224
|
return i;
|
|
2225
2225
|
}
|
|
@@ -2329,15 +2329,15 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2329
2329
|
sessionBody: a,
|
|
2330
2330
|
soundEffects: s,
|
|
2331
2331
|
experienceMode: u = "WIDGET",
|
|
2332
|
-
autoConnect:
|
|
2332
|
+
autoConnect: y = !1,
|
|
2333
2333
|
displayMode: f,
|
|
2334
2334
|
defaultDisplayMode: c = "expanded",
|
|
2335
2335
|
onDisplayModeChange: A,
|
|
2336
|
-
position:
|
|
2337
|
-
mobileBreakpoint:
|
|
2338
|
-
persistKey:
|
|
2339
|
-
disablePersistence:
|
|
2340
|
-
teamMembers:
|
|
2336
|
+
position: x = "bottom-right",
|
|
2337
|
+
mobileBreakpoint: _ = 640,
|
|
2338
|
+
persistKey: v = "ll-widget",
|
|
2339
|
+
disablePersistence: b = !1,
|
|
2340
|
+
teamMembers: S,
|
|
2341
2341
|
currentTeamMemberId: M,
|
|
2342
2342
|
onTeamMemberChange: D,
|
|
2343
2343
|
idleLoopUrl: k,
|
|
@@ -2381,37 +2381,37 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2381
2381
|
I(() => {
|
|
2382
2382
|
Fr(), Jr();
|
|
2383
2383
|
}, [Me]);
|
|
2384
|
-
const Ze = M !== void 0, [et, Oe] =
|
|
2385
|
-
var
|
|
2386
|
-
return M ?? ((
|
|
2384
|
+
const Ze = M !== void 0, [et, Oe] = C(() => {
|
|
2385
|
+
var m;
|
|
2386
|
+
return M ?? ((m = S == null ? void 0 : S[0]) == null ? void 0 : m.id);
|
|
2387
2387
|
}), Te = Ze ? M : et, ee = Ge(
|
|
2388
|
-
() => (
|
|
2389
|
-
[
|
|
2388
|
+
() => (S == null ? void 0 : S.find((m) => m.id === Te)) ?? null,
|
|
2389
|
+
[S, Te]
|
|
2390
2390
|
), gt = (ee == null ? void 0 : ee.agentId) ?? o, tt = u === "EMBEDDED", [oe, ie] = or({
|
|
2391
2391
|
value: f,
|
|
2392
2392
|
defaultValue: c,
|
|
2393
2393
|
onChange: A,
|
|
2394
|
-
persistKey:
|
|
2395
|
-
disablePersistence: tt ||
|
|
2396
|
-
}), de = lr(
|
|
2394
|
+
persistKey: v,
|
|
2395
|
+
disablePersistence: tt || b
|
|
2396
|
+
}), de = lr(_), ve = Vn(), X = Yn(), ue = Jn(), be = Kn(), He = Xn(), [Lt, nt] = C(!1), [we, rt] = C(!1), [ot, it] = C(!1), [_e, xe] = C(!1), [We, yt] = C(!1), Be = yr({ baseUrl: l, config: s }), De = N(Be);
|
|
2397
2397
|
De.current = Be;
|
|
2398
2398
|
const h = N(ft), J = N(Je), Et = N(Xe), Ct = N(ht), Tt = N(pt), Dt = N(le), Pt = N(Ke), St = N(Qe), fe = N(null);
|
|
2399
2399
|
h.current = ft, J.current = Je, Et.current = Xe, Ct.current = ht, Tt.current = pt, Dt.current = le, Pt.current = Ke, St.current = Qe;
|
|
2400
|
-
function ke(
|
|
2400
|
+
function ke(m) {
|
|
2401
2401
|
const p = St.current;
|
|
2402
|
-
return p ? p.includes(
|
|
2402
|
+
return p ? p.includes(m) : !0;
|
|
2403
2403
|
}
|
|
2404
|
-
function Le(
|
|
2404
|
+
function Le(m, p) {
|
|
2405
2405
|
console.warn(
|
|
2406
|
-
`[LiveLayer] Agent command "${
|
|
2406
|
+
`[LiveLayer] Agent command "${m}" blocked — capability "${p}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2407
2407
|
);
|
|
2408
2408
|
}
|
|
2409
2409
|
const lt = E(
|
|
2410
|
-
(
|
|
2410
|
+
(m) => {
|
|
2411
2411
|
var K, ae, he, ct;
|
|
2412
|
-
const p =
|
|
2412
|
+
const p = m;
|
|
2413
2413
|
if (!(!p.type || typeof p.type != "string")) {
|
|
2414
|
-
if (Ae == null || Ae({ eventName: p.type, data:
|
|
2414
|
+
if (Ae == null || Ae({ eventName: p.type, data: m }), p.type === "navigate") {
|
|
2415
2415
|
if (!ke("navigate")) {
|
|
2416
2416
|
Le("navigate", "navigate");
|
|
2417
2417
|
return;
|
|
@@ -2821,13 +2821,13 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2821
2821
|
if (P != null && P.subscribeToDataMessages)
|
|
2822
2822
|
return P.subscribeToDataMessages(lt);
|
|
2823
2823
|
}, [P, lt]), fe.current = () => {
|
|
2824
|
-
var
|
|
2825
|
-
return (
|
|
2824
|
+
var m;
|
|
2825
|
+
return (m = Q.getRoom) == null ? void 0 : m.call(Q);
|
|
2826
2826
|
}, I(() => {
|
|
2827
2827
|
var K;
|
|
2828
2828
|
if (typeof window > "u") return;
|
|
2829
|
-
const
|
|
2830
|
-
if (
|
|
2829
|
+
const m = ((K = window.location) == null ? void 0 : K.hostname) || "";
|
|
2830
|
+
if (m === "localhost" || m === "127.0.0.1" || m === "0.0.0.0" || m.endsWith(".local") || m.endsWith(".test"))
|
|
2831
2831
|
return window.__livelayerSimulateCommand = (ae) => {
|
|
2832
2832
|
try {
|
|
2833
2833
|
lt(ae);
|
|
@@ -2838,7 +2838,7 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2838
2838
|
delete window.__livelayerSimulateCommand;
|
|
2839
2839
|
};
|
|
2840
2840
|
}, [lt]);
|
|
2841
|
-
const
|
|
2841
|
+
const w = Ge(() => P ? {
|
|
2842
2842
|
connectionState: P.connectionState,
|
|
2843
2843
|
agentState: P.agentState,
|
|
2844
2844
|
transcript: P.transcript,
|
|
@@ -2869,18 +2869,18 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2869
2869
|
disconnect: Q.disconnect,
|
|
2870
2870
|
getRoom: Q.getRoom,
|
|
2871
2871
|
isControlled: !1
|
|
2872
|
-
}, [P, Q]), $t = N(
|
|
2873
|
-
$t.current =
|
|
2872
|
+
}, [P, Q]), $t = N(w);
|
|
2873
|
+
$t.current = w;
|
|
2874
2874
|
const zt = N(P);
|
|
2875
2875
|
zt.current = P, Hn(
|
|
2876
2876
|
r,
|
|
2877
2877
|
() => ({
|
|
2878
|
-
sendData: async (
|
|
2878
|
+
sendData: async (m) => {
|
|
2879
2879
|
var he, ct;
|
|
2880
2880
|
const p = zt.current;
|
|
2881
2881
|
if (p != null && p.publishData) {
|
|
2882
2882
|
try {
|
|
2883
|
-
await p.publishData(
|
|
2883
|
+
await p.publishData(m);
|
|
2884
2884
|
} catch (L) {
|
|
2885
2885
|
console.warn("[AvatarWidget] sendData (controlled) failed:", L);
|
|
2886
2886
|
}
|
|
@@ -2889,7 +2889,7 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2889
2889
|
const K = (ct = (he = $t.current) == null ? void 0 : he.getRoom) == null ? void 0 : ct.call(he), ae = K == null ? void 0 : K.localParticipant;
|
|
2890
2890
|
if (ae != null && ae.publishData)
|
|
2891
2891
|
try {
|
|
2892
|
-
const L = new TextEncoder().encode(JSON.stringify(
|
|
2892
|
+
const L = new TextEncoder().encode(JSON.stringify(m));
|
|
2893
2893
|
await ae.publishData(L, { reliable: !0 });
|
|
2894
2894
|
} catch (L) {
|
|
2895
2895
|
console.warn("[AvatarWidget] sendData failed:", L);
|
|
@@ -2900,43 +2900,43 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2900
2900
|
);
|
|
2901
2901
|
const Ot = N(null);
|
|
2902
2902
|
I(() => {
|
|
2903
|
-
const
|
|
2904
|
-
if (!(!
|
|
2905
|
-
return p.appendChild(
|
|
2906
|
-
|
|
2903
|
+
const m = w.videoElement, p = Ot.current;
|
|
2904
|
+
if (!(!m || !p))
|
|
2905
|
+
return p.appendChild(m), () => {
|
|
2906
|
+
m.parentNode === p && p.removeChild(m);
|
|
2907
2907
|
};
|
|
2908
|
-
}, [
|
|
2909
|
-
const
|
|
2910
|
-
if (!
|
|
2911
|
-
ve.attach(
|
|
2912
|
-
const p =
|
|
2908
|
+
}, [w.videoElement]), I(() => {
|
|
2909
|
+
const m = w.audioElement;
|
|
2910
|
+
if (!m) return;
|
|
2911
|
+
ve.attach(m);
|
|
2912
|
+
const p = m.play();
|
|
2913
2913
|
return p && typeof p.catch == "function" && p.catch((K) => {
|
|
2914
2914
|
(K == null ? void 0 : K.name) === "NotAllowedError" && nt(!0);
|
|
2915
2915
|
}), () => {
|
|
2916
2916
|
ve.detach();
|
|
2917
2917
|
};
|
|
2918
|
-
}, [
|
|
2919
|
-
if (
|
|
2920
|
-
const
|
|
2921
|
-
if (
|
|
2922
|
-
return X.setupMic(
|
|
2918
|
+
}, [w.audioElement]), I(() => {
|
|
2919
|
+
if (w.isControlled || w.connectionState !== "connected") return;
|
|
2920
|
+
const m = w.getRoom();
|
|
2921
|
+
if (m)
|
|
2922
|
+
return X.setupMic(m).catch(() => {
|
|
2923
2923
|
}), () => {
|
|
2924
2924
|
X.teardownMic();
|
|
2925
2925
|
};
|
|
2926
|
-
}, [
|
|
2926
|
+
}, [w.isControlled, w.connectionState]), I(() => {
|
|
2927
2927
|
var p;
|
|
2928
|
-
if (
|
|
2929
|
-
const
|
|
2930
|
-
if (
|
|
2931
|
-
return ue.attachRoom(
|
|
2928
|
+
if (w.connectionState !== "connected") return;
|
|
2929
|
+
const m = w.isControlled ? (p = P == null ? void 0 : P.getRoom) == null ? void 0 : p.call(P) : w.getRoom();
|
|
2930
|
+
if (m)
|
|
2931
|
+
return ue.attachRoom(m), be.attachRoom(m), w.isControlled && X.attachRoom(m), He.refresh(), () => {
|
|
2932
2932
|
ue.teardown(), be.teardown();
|
|
2933
2933
|
};
|
|
2934
|
-
}, [
|
|
2935
|
-
const
|
|
2936
|
-
|
|
2937
|
-
}, [
|
|
2938
|
-
const Ln = E((
|
|
2939
|
-
const p = { type: "user_message", text:
|
|
2934
|
+
}, [w.isControlled, w.connectionState, P]), I(() => {
|
|
2935
|
+
const m = w.audioElement;
|
|
2936
|
+
m && (m.muted = We);
|
|
2937
|
+
}, [w.audioElement, We]);
|
|
2938
|
+
const Ln = E((m) => {
|
|
2939
|
+
const p = { type: "user_message", text: m };
|
|
2940
2940
|
if (P != null && P.publishData) {
|
|
2941
2941
|
try {
|
|
2942
2942
|
P.publishData(p);
|
|
@@ -2944,65 +2944,65 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
2944
2944
|
}
|
|
2945
2945
|
return;
|
|
2946
2946
|
}
|
|
2947
|
-
const K =
|
|
2947
|
+
const K = w.getRoom();
|
|
2948
2948
|
if (K)
|
|
2949
2949
|
try {
|
|
2950
2950
|
const ae = new TextEncoder().encode(JSON.stringify(p));
|
|
2951
2951
|
K.localParticipant.publishData(ae, { reliable: !0 });
|
|
2952
2952
|
} catch {
|
|
2953
2953
|
}
|
|
2954
|
-
}, [
|
|
2955
|
-
yt((
|
|
2954
|
+
}, [w, P]), En = E(() => {
|
|
2955
|
+
yt((m) => !m);
|
|
2956
2956
|
}, []);
|
|
2957
2957
|
I(() => {
|
|
2958
|
-
Ne == null || Ne(
|
|
2959
|
-
}, [
|
|
2960
|
-
Se == null || Se(
|
|
2961
|
-
}, [
|
|
2962
|
-
ze == null || ze(
|
|
2963
|
-
}, [
|
|
2964
|
-
Be.setThinking(
|
|
2965
|
-
}, [
|
|
2958
|
+
Ne == null || Ne(w.connectionState), w.connectionState === "connected" ? Ce == null || Ce() : w.connectionState === "disconnected" && ($e == null || $e());
|
|
2959
|
+
}, [w.connectionState, Ce, $e, Ne]), I(() => {
|
|
2960
|
+
Se == null || Se(w.transcript);
|
|
2961
|
+
}, [w.transcript, Se]), I(() => {
|
|
2962
|
+
ze == null || ze(w.agentState);
|
|
2963
|
+
}, [w.agentState, ze]), I(() => {
|
|
2964
|
+
Be.setThinking(w.agentState === "thinking");
|
|
2965
|
+
}, [w.agentState, Be]);
|
|
2966
2966
|
const Ht = N(!1);
|
|
2967
2967
|
I(() => {
|
|
2968
|
-
|
|
2969
|
-
}, [
|
|
2968
|
+
w.isControlled || !y || Ht.current || re && w.connectionState === "idle" && (Ht.current = !0, w.connect());
|
|
2969
|
+
}, [y, w.connectionState, w, re]);
|
|
2970
2970
|
const Cn = E(
|
|
2971
|
-
(
|
|
2972
|
-
const p =
|
|
2973
|
-
p && (it(!1),
|
|
2971
|
+
(m) => {
|
|
2972
|
+
const p = S == null ? void 0 : S.find((K) => K.id === m);
|
|
2973
|
+
p && (it(!1), m !== Te && (rt(!0), w.disconnect(), Ze || Oe(m), D == null || D(p)));
|
|
2974
2974
|
},
|
|
2975
2975
|
[
|
|
2976
|
-
|
|
2976
|
+
S,
|
|
2977
2977
|
Te,
|
|
2978
|
-
|
|
2978
|
+
w,
|
|
2979
2979
|
Ze,
|
|
2980
2980
|
D
|
|
2981
2981
|
]
|
|
2982
2982
|
);
|
|
2983
2983
|
I(() => {
|
|
2984
|
-
we &&
|
|
2985
|
-
}, [
|
|
2984
|
+
we && w.connectionState === "connected" && rt(!1);
|
|
2985
|
+
}, [w.connectionState, we]), I(() => {
|
|
2986
2986
|
if (!ot) return;
|
|
2987
|
-
const
|
|
2987
|
+
const m = (p) => {
|
|
2988
2988
|
p.key === "Escape" && it(!1);
|
|
2989
2989
|
};
|
|
2990
|
-
return window.addEventListener("keydown",
|
|
2990
|
+
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
2991
2991
|
}, [ot]);
|
|
2992
|
-
const Sn = !!B || !!(ee != null && ee.avatarImageUrl) ||
|
|
2992
|
+
const Sn = !!B || !!(ee != null && ee.avatarImageUrl) || w.isControlled, at = Qn(gt, l, Sn);
|
|
2993
2993
|
Qe === void 0 && ((Ft = at.info) != null && Ft.capabilities) && (St.current = at.info.capabilities);
|
|
2994
|
-
const vt = (ee == null ? void 0 : ee.name) ?? q ?? ((Ut =
|
|
2994
|
+
const vt = (ee == null ? void 0 : ee.name) ?? q ?? ((Ut = w.agentConfig) == null ? void 0 : Ut.name) ?? ((jt = at.info) == null ? void 0 : jt.name) ?? "Live Layer", Nt = (ee == null ? void 0 : ee.avatarImageUrl) ?? B ?? ((Vt = w.agentConfig) == null ? void 0 : Vt.avatarImageUrl) ?? ((Yt = at.info) == null ? void 0 : Yt.avatarImageUrl) ?? null, Nn = k ?? ((Gt = w.agentConfig) == null ? void 0 : Gt.idleLoopUrl) ?? ((Jt = at.info) == null ? void 0 : Jt.idleLoopUrl) ?? null, An = R ?? null, Rn = E(() => ie("expanded"), [ie]), In = E(
|
|
2995
2995
|
() => ie("minimized"),
|
|
2996
2996
|
[ie]
|
|
2997
2997
|
), Wt = E(() => {
|
|
2998
|
-
|
|
2999
|
-
}, [
|
|
3000
|
-
const
|
|
3001
|
-
|
|
2998
|
+
w.disconnect(), ie("hidden");
|
|
2999
|
+
}, [w, ie]), Mn = E(() => {
|
|
3000
|
+
const m = w.audioElement;
|
|
3001
|
+
m && m.play().then(() => nt(!1)).catch(() => {
|
|
3002
3002
|
});
|
|
3003
|
-
}, [
|
|
3004
|
-
nt(!1),
|
|
3005
|
-
}, [
|
|
3003
|
+
}, [w.audioElement]), Tn = E(() => {
|
|
3004
|
+
nt(!1), w.connect();
|
|
3005
|
+
}, [w]), qe = {
|
|
3006
3006
|
...kt,
|
|
3007
3007
|
...tt ? {} : { zIndex: Ie }
|
|
3008
3008
|
};
|
|
@@ -3020,27 +3020,27 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
3020
3020
|
className: Dn,
|
|
3021
3021
|
style: qe,
|
|
3022
3022
|
"data-display-mode": oe,
|
|
3023
|
-
"data-position":
|
|
3023
|
+
"data-position": x,
|
|
3024
3024
|
"data-experience-mode": u === "EMBEDDED" ? "embedded" : "widget",
|
|
3025
3025
|
children: oe === "expanded" && /* @__PURE__ */ n(
|
|
3026
3026
|
Mr,
|
|
3027
3027
|
{
|
|
3028
|
-
position:
|
|
3028
|
+
position: x,
|
|
3029
3029
|
isMobile: de,
|
|
3030
3030
|
agentName: vt,
|
|
3031
3031
|
avatarImageUrl: Nt,
|
|
3032
3032
|
idleLoopUrl: Nn,
|
|
3033
3033
|
greeting: An,
|
|
3034
3034
|
branding: F,
|
|
3035
|
-
teamMembers:
|
|
3035
|
+
teamMembers: S,
|
|
3036
3036
|
currentTeamMemberId: Te,
|
|
3037
3037
|
isSwitchingTeamMember: we,
|
|
3038
3038
|
teamSwitcherOpen: ot,
|
|
3039
|
-
onToggleTeamSwitcher: () => it((
|
|
3039
|
+
onToggleTeamSwitcher: () => it((m) => !m),
|
|
3040
3040
|
onSelectTeamMember: Cn,
|
|
3041
|
-
connectionState:
|
|
3042
|
-
agentState:
|
|
3043
|
-
transcript:
|
|
3041
|
+
connectionState: w.connectionState,
|
|
3042
|
+
agentState: w.agentState,
|
|
3043
|
+
transcript: w.transcript,
|
|
3044
3044
|
isMuted: X.isMuted,
|
|
3045
3045
|
micDevices: He.mics,
|
|
3046
3046
|
activeMicId: X.activeDeviceId,
|
|
@@ -3061,21 +3061,21 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
3061
3061
|
transforming: pe,
|
|
3062
3062
|
transformingLabel: ye,
|
|
3063
3063
|
languageMenuOpen: _e,
|
|
3064
|
-
onToggleLanguageMenu: () => xe((
|
|
3064
|
+
onToggleLanguageMenu: () => xe((m) => !m),
|
|
3065
3065
|
needsUserGesture: Lt,
|
|
3066
|
-
canResume:
|
|
3066
|
+
canResume: w.canResume,
|
|
3067
3067
|
micError: X.micError,
|
|
3068
|
-
error:
|
|
3068
|
+
error: w.error,
|
|
3069
3069
|
avatarVideoContainerRef: Ot,
|
|
3070
|
-
agentVideoEl:
|
|
3071
|
-
onConnect: () => void
|
|
3072
|
-
onDisconnect: () =>
|
|
3070
|
+
agentVideoEl: w.videoElement,
|
|
3071
|
+
onConnect: () => void w.connect(),
|
|
3072
|
+
onDisconnect: () => w.disconnect(),
|
|
3073
3073
|
onRetry: Tn,
|
|
3074
3074
|
onResumeAudio: Mn,
|
|
3075
3075
|
onToggleMute: X.toggleMute,
|
|
3076
|
-
onSwitchMicDevice: (
|
|
3076
|
+
onSwitchMicDevice: (m) => void X.switchDevice(m),
|
|
3077
3077
|
onToggleCamera: () => void ue.toggle(),
|
|
3078
|
-
onSwitchCameraDevice: (
|
|
3078
|
+
onSwitchCameraDevice: (m) => void ue.switchDevice(m),
|
|
3079
3079
|
onToggleScreenShare: () => void be.toggle(),
|
|
3080
3080
|
onToggleSpeaker: En,
|
|
3081
3081
|
onSendMessage: Ln,
|
|
@@ -3085,7 +3085,7 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
3085
3085
|
}
|
|
3086
3086
|
)
|
|
3087
3087
|
}
|
|
3088
|
-
), Bt = oe === "hidden" || oe === "minimized" ? /* @__PURE__ */
|
|
3088
|
+
), Bt = oe === "hidden" || oe === "minimized" ? /* @__PURE__ */ g(
|
|
3089
3089
|
"div",
|
|
3090
3090
|
{
|
|
3091
3091
|
className: [
|
|
@@ -3096,14 +3096,14 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
3096
3096
|
].join(" "),
|
|
3097
3097
|
style: qe,
|
|
3098
3098
|
"data-display-mode": oe,
|
|
3099
|
-
"data-position":
|
|
3099
|
+
"data-position": x,
|
|
3100
3100
|
children: [
|
|
3101
3101
|
oe === "hidden" && /* @__PURE__ */ n(
|
|
3102
3102
|
kr,
|
|
3103
3103
|
{
|
|
3104
|
-
position:
|
|
3104
|
+
position: x,
|
|
3105
3105
|
isMobile: de,
|
|
3106
|
-
isSpeaking:
|
|
3106
|
+
isSpeaking: w.agentState === "speaking",
|
|
3107
3107
|
onExpand: () => ie("expanded"),
|
|
3108
3108
|
label: `Open ${vt} widget`,
|
|
3109
3109
|
avatarImageUrl: Nt,
|
|
@@ -3114,11 +3114,11 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
3114
3114
|
oe === "minimized" && /* @__PURE__ */ n(
|
|
3115
3115
|
Er,
|
|
3116
3116
|
{
|
|
3117
|
-
position:
|
|
3117
|
+
position: x,
|
|
3118
3118
|
isMobile: de,
|
|
3119
3119
|
agentName: vt,
|
|
3120
3120
|
avatarImageUrl: Nt,
|
|
3121
|
-
agentState:
|
|
3121
|
+
agentState: w.agentState,
|
|
3122
3122
|
isMuted: X.isMuted,
|
|
3123
3123
|
audioLevel: ve,
|
|
3124
3124
|
onExpand: Rn,
|
|
@@ -3129,7 +3129,7 @@ const ro = /* @__PURE__ */ new Set([
|
|
|
3129
3129
|
]
|
|
3130
3130
|
}
|
|
3131
3131
|
) : null, qt = se ?? (typeof document < "u" ? document.body : null);
|
|
3132
|
-
return /* @__PURE__ */
|
|
3132
|
+
return /* @__PURE__ */ g(Ye, { children: [
|
|
3133
3133
|
Pn,
|
|
3134
3134
|
Bt && qt && It(Bt, qt)
|
|
3135
3135
|
] });
|
|
@@ -3153,7 +3153,7 @@ const mo = ({
|
|
|
3153
3153
|
}) => {
|
|
3154
3154
|
const a = N(null), s = N(null), u = N(i);
|
|
3155
3155
|
u.current = i;
|
|
3156
|
-
const
|
|
3156
|
+
const y = E((f) => {
|
|
3157
3157
|
var A;
|
|
3158
3158
|
const c = f.detail;
|
|
3159
3159
|
(A = u.current) == null || A.call(u, c);
|
|
@@ -3162,8 +3162,8 @@ const mo = ({
|
|
|
3162
3162
|
const f = a.current;
|
|
3163
3163
|
if (!f) return;
|
|
3164
3164
|
const c = document.createElement("livelayer-widget");
|
|
3165
|
-
return c.setAttribute("agent-id", e), t && c.setAttribute("base-url", t), r && c.setAttribute("api-key", r), o && c.setAttribute("mode", o), c.addEventListener("agent-event",
|
|
3166
|
-
c.removeEventListener("agent-event",
|
|
3165
|
+
return c.setAttribute("agent-id", e), t && c.setAttribute("base-url", t), r && c.setAttribute("api-key", r), o && c.setAttribute("mode", o), c.addEventListener("agent-event", y), f.appendChild(c), s.current = c, () => {
|
|
3166
|
+
c.removeEventListener("agent-event", y), f.removeChild(c), s.current = null;
|
|
3167
3167
|
};
|
|
3168
3168
|
}, [e]), I(() => {
|
|
3169
3169
|
s.current && (o ? s.current.setAttribute("mode", o) : s.current.removeAttribute("mode"));
|
|
@@ -3200,7 +3200,7 @@ const mo = ({
|
|
|
3200
3200
|
const { name: o, label: i, labelClassName: l } = t, d = { name: o, "data-ll-field": o };
|
|
3201
3201
|
let a;
|
|
3202
3202
|
if ("as" in t && t.as === "textarea") {
|
|
3203
|
-
const { name: s, label: u, labelClassName:
|
|
3203
|
+
const { name: s, label: u, labelClassName: y, as: f, ...c } = t;
|
|
3204
3204
|
a = /* @__PURE__ */ n(
|
|
3205
3205
|
"textarea",
|
|
3206
3206
|
{
|
|
@@ -3210,7 +3210,7 @@ const mo = ({
|
|
|
3210
3210
|
}
|
|
3211
3211
|
);
|
|
3212
3212
|
} else if ("as" in t && t.as === "select") {
|
|
3213
|
-
const { name: s, label: u, labelClassName:
|
|
3213
|
+
const { name: s, label: u, labelClassName: y, as: f, children: c, ...A } = t;
|
|
3214
3214
|
a = /* @__PURE__ */ n(
|
|
3215
3215
|
"select",
|
|
3216
3216
|
{
|
|
@@ -3221,7 +3221,7 @@ const mo = ({
|
|
|
3221
3221
|
}
|
|
3222
3222
|
);
|
|
3223
3223
|
} else {
|
|
3224
|
-
const { name: s, label: u, labelClassName:
|
|
3224
|
+
const { name: s, label: u, labelClassName: y, as: f, ...c } = t;
|
|
3225
3225
|
a = /* @__PURE__ */ n(
|
|
3226
3226
|
"input",
|
|
3227
3227
|
{
|
|
@@ -3231,7 +3231,7 @@ const mo = ({
|
|
|
3231
3231
|
}
|
|
3232
3232
|
);
|
|
3233
3233
|
}
|
|
3234
|
-
return i === void 0 ? a : /* @__PURE__ */
|
|
3234
|
+
return i === void 0 ? a : /* @__PURE__ */ g("label", { className: l, children: [
|
|
3235
3235
|
i,
|
|
3236
3236
|
a
|
|
3237
3237
|
] });
|
|
@@ -3243,11 +3243,11 @@ function bo({
|
|
|
3243
3243
|
defaultOpen: t = !1,
|
|
3244
3244
|
storageKey: r = "ll-debug-open"
|
|
3245
3245
|
}) {
|
|
3246
|
-
const [o, i] =
|
|
3246
|
+
const [o, i] = C(t), [l, d] = C([]), [a, s] = C(""), [u, y] = C(!1), f = N(/* @__PURE__ */ new Set()), c = N([]), A = N(u);
|
|
3247
3247
|
A.current = u, I(() => {
|
|
3248
3248
|
try {
|
|
3249
|
-
const
|
|
3250
|
-
|
|
3249
|
+
const v = localStorage.getItem(r);
|
|
3250
|
+
v === "1" && i(!0), v === "0" && i(!1);
|
|
3251
3251
|
} catch {
|
|
3252
3252
|
}
|
|
3253
3253
|
}, [r]), I(() => {
|
|
@@ -3256,33 +3256,33 @@ function bo({
|
|
|
3256
3256
|
} catch {
|
|
3257
3257
|
}
|
|
3258
3258
|
}, [o, r]), I(() => {
|
|
3259
|
-
const
|
|
3260
|
-
(
|
|
3259
|
+
const v = (b) => {
|
|
3260
|
+
(b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), i((S) => !S));
|
|
3261
3261
|
};
|
|
3262
|
-
return window.addEventListener("keydown",
|
|
3262
|
+
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
3263
3263
|
}, []), I(() => {
|
|
3264
|
-
const
|
|
3264
|
+
const v = setInterval(() => {
|
|
3265
3265
|
if (c.current.length === 0 || A.current) return;
|
|
3266
|
-
const
|
|
3266
|
+
const b = c.current.splice(0, c.current.length);
|
|
3267
3267
|
d(
|
|
3268
|
-
(
|
|
3268
|
+
(S) => [...b.reverse(), ...S].slice(0, 200)
|
|
3269
3269
|
);
|
|
3270
3270
|
}, 100);
|
|
3271
|
-
return () => clearInterval(
|
|
3271
|
+
return () => clearInterval(v);
|
|
3272
3272
|
}, []);
|
|
3273
|
-
const
|
|
3273
|
+
const x = N(!1);
|
|
3274
3274
|
if (I(() => {
|
|
3275
|
-
!e ||
|
|
3275
|
+
!e || x.current || (x.current = !0, e((v) => {
|
|
3276
3276
|
c.current.push({
|
|
3277
3277
|
id: hn++,
|
|
3278
3278
|
ts: Date.now(),
|
|
3279
3279
|
kind: "event",
|
|
3280
|
-
type:
|
|
3281
|
-
data:
|
|
3280
|
+
type: v.eventName,
|
|
3281
|
+
data: v.data
|
|
3282
3282
|
});
|
|
3283
3283
|
}));
|
|
3284
3284
|
}, [e]), I(() => {
|
|
3285
|
-
const
|
|
3285
|
+
const v = console.warn, b = console.log, S = (M, D) => function(...k) {
|
|
3286
3286
|
try {
|
|
3287
3287
|
const R = typeof k[0] == "string" ? k[0] : "";
|
|
3288
3288
|
R.startsWith("[LiveLayer]") && c.current.push({
|
|
@@ -3296,8 +3296,8 @@ function bo({
|
|
|
3296
3296
|
}
|
|
3297
3297
|
return D.apply(this, k);
|
|
3298
3298
|
};
|
|
3299
|
-
return console.warn =
|
|
3300
|
-
console.warn =
|
|
3299
|
+
return console.warn = S("warn", v), console.log = S("log", b), () => {
|
|
3300
|
+
console.warn = v, console.log = b;
|
|
3301
3301
|
};
|
|
3302
3302
|
}, []), !o)
|
|
3303
3303
|
return /* @__PURE__ */ n(
|
|
@@ -3326,12 +3326,12 @@ function bo({
|
|
|
3326
3326
|
children: "🛰 LL debug"
|
|
3327
3327
|
}
|
|
3328
3328
|
);
|
|
3329
|
-
const
|
|
3329
|
+
const _ = l.filter((v) => {
|
|
3330
3330
|
if (!a) return !0;
|
|
3331
|
-
const
|
|
3332
|
-
return
|
|
3331
|
+
const b = a.toLowerCase();
|
|
3332
|
+
return v.type.toLowerCase().includes(b) || JSON.stringify(v.data || {}).toLowerCase().includes(b);
|
|
3333
3333
|
});
|
|
3334
|
-
return /* @__PURE__ */
|
|
3334
|
+
return /* @__PURE__ */ g(
|
|
3335
3335
|
"div",
|
|
3336
3336
|
{
|
|
3337
3337
|
style: {
|
|
@@ -3353,7 +3353,7 @@ function bo({
|
|
|
3353
3353
|
overflow: "hidden"
|
|
3354
3354
|
},
|
|
3355
3355
|
children: [
|
|
3356
|
-
/* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ g(
|
|
3357
3357
|
"div",
|
|
3358
3358
|
{
|
|
3359
3359
|
style: {
|
|
@@ -3366,7 +3366,7 @@ function bo({
|
|
|
3366
3366
|
},
|
|
3367
3367
|
children: [
|
|
3368
3368
|
/* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
3369
|
-
/* @__PURE__ */
|
|
3369
|
+
/* @__PURE__ */ g("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
3370
3370
|
l.length,
|
|
3371
3371
|
" event",
|
|
3372
3372
|
l.length === 1 ? "" : "s"
|
|
@@ -3376,7 +3376,7 @@ function bo({
|
|
|
3376
3376
|
"button",
|
|
3377
3377
|
{
|
|
3378
3378
|
type: "button",
|
|
3379
|
-
onClick: () =>
|
|
3379
|
+
onClick: () => y((v) => !v),
|
|
3380
3380
|
style: Rt(u ? "#f59e0b" : "transparent"),
|
|
3381
3381
|
title: "Pause / resume capture",
|
|
3382
3382
|
children: u ? "▶ resume" : "⏸ pause"
|
|
@@ -3413,7 +3413,7 @@ function bo({
|
|
|
3413
3413
|
{
|
|
3414
3414
|
type: "text",
|
|
3415
3415
|
value: a,
|
|
3416
|
-
onChange: (
|
|
3416
|
+
onChange: (v) => s(v.target.value),
|
|
3417
3417
|
placeholder: "filter by type or data…",
|
|
3418
3418
|
style: {
|
|
3419
3419
|
margin: 8,
|
|
@@ -3435,7 +3435,7 @@ function bo({
|
|
|
3435
3435
|
overflowY: "auto",
|
|
3436
3436
|
padding: "0 8px 8px"
|
|
3437
3437
|
},
|
|
3438
|
-
children:
|
|
3438
|
+
children: _.length === 0 ? /* @__PURE__ */ g(
|
|
3439
3439
|
"div",
|
|
3440
3440
|
{
|
|
3441
3441
|
style: {
|
|
@@ -3465,16 +3465,16 @@ function bo({
|
|
|
3465
3465
|
)
|
|
3466
3466
|
]
|
|
3467
3467
|
}
|
|
3468
|
-
) :
|
|
3468
|
+
) : _.map((v) => /* @__PURE__ */ n(
|
|
3469
3469
|
io,
|
|
3470
3470
|
{
|
|
3471
|
-
entry:
|
|
3472
|
-
expanded: f.current.has(
|
|
3471
|
+
entry: v,
|
|
3472
|
+
expanded: f.current.has(v.id),
|
|
3473
3473
|
onToggle: () => {
|
|
3474
|
-
f.current.has(
|
|
3474
|
+
f.current.has(v.id) ? f.current.delete(v.id) : f.current.add(v.id), d((b) => [...b]);
|
|
3475
3475
|
}
|
|
3476
3476
|
},
|
|
3477
|
-
|
|
3477
|
+
v.id
|
|
3478
3478
|
))
|
|
3479
3479
|
}
|
|
3480
3480
|
)
|
|
@@ -3490,7 +3490,7 @@ function io({
|
|
|
3490
3490
|
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", i = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
3491
3491
|
hour12: !1
|
|
3492
3492
|
});
|
|
3493
|
-
return /* @__PURE__ */
|
|
3493
|
+
return /* @__PURE__ */ g(
|
|
3494
3494
|
"button",
|
|
3495
3495
|
{
|
|
3496
3496
|
type: "button",
|
|
@@ -3508,7 +3508,7 @@ function io({
|
|
|
3508
3508
|
lineHeight: 1.4
|
|
3509
3509
|
},
|
|
3510
3510
|
children: [
|
|
3511
|
-
/* @__PURE__ */
|
|
3511
|
+
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
3512
3512
|
/* @__PURE__ */ n(
|
|
3513
3513
|
"span",
|
|
3514
3514
|
{
|
|
@@ -3571,7 +3571,7 @@ function lo(e) {
|
|
|
3571
3571
|
}
|
|
3572
3572
|
}
|
|
3573
3573
|
function wo() {
|
|
3574
|
-
const [e, t] =
|
|
3574
|
+
const [e, t] = C([]), r = E((i) => {
|
|
3575
3575
|
t((l) => {
|
|
3576
3576
|
const d = l.findIndex((a) => a.id === i.id);
|
|
3577
3577
|
if (d >= 0) {
|