@livelayer/react 0.18.0 → 0.18.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.js +3 -3
- package/dist/index.mjs +610 -610
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as x, jsx as n, Fragment as ze } from "react/jsx-runtime";
|
|
3
|
-
import { Component as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as
|
|
8
|
-
class
|
|
3
|
+
import { Component as Yn, useState as N, useRef as M, useEffect as T, useCallback as E, useMemo as Qe, useLayoutEffect as Ln, forwardRef as Pt, useImperativeHandle as Gn, createElement as Kn } from "react";
|
|
4
|
+
import { createPortal as $t } from "react-dom";
|
|
5
|
+
import { LiveKitSession as Jn, registerFields as Xn } from "@livelayer/sdk";
|
|
6
|
+
import { clearFieldRegistry as Wo, getRegisteredFields as qo, registerFields as Uo, setFieldValue as jo } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as Zn, Track as kn, createLocalVideoTrack as Qn } from "livekit-client";
|
|
8
|
+
class er extends Yn {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -35,7 +35,7 @@ class tr extends Gn {
|
|
|
35
35
|
] }) : this.props.children;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function tr(e) {
|
|
39
39
|
const [t, r] = N("idle"), [o, a] = N("idle"), [i, s] = N([]), [l, c] = N(null), [p, w] = N(null), [m, f] = N(null), [R, _] = N(!1), [g, u] = N(null), h = M(null), L = M(e.onDataMessage);
|
|
40
40
|
L.current = e.onDataMessage, T(() => {
|
|
41
41
|
const b = {
|
|
@@ -54,7 +54,7 @@ function nr(e) {
|
|
|
54
54
|
(q = L.current) == null || q.call(L, B);
|
|
55
55
|
},
|
|
56
56
|
onResumabilityChange: _
|
|
57
|
-
}, P = new
|
|
57
|
+
}, P = new Jn(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
60
60
|
baseUrl: e.baseUrl,
|
|
@@ -105,7 +105,7 @@ function nr(e) {
|
|
|
105
105
|
session: h.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function nr() {
|
|
109
109
|
const e = M(null), t = M(/* @__PURE__ */ new Map()), r = M(null), o = M(/* @__PURE__ */ new Set()), a = E(() => {
|
|
110
110
|
const _ = t.current;
|
|
111
111
|
if (_.size === 0) {
|
|
@@ -217,11 +217,11 @@ function rr() {
|
|
|
217
217
|
o.current.clear();
|
|
218
218
|
}, [f]), { attach: p, attachStream: w, detach: f, detachSlot: m, subscribe: R };
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function rr(e) {
|
|
221
221
|
const t = e == null ? void 0 : e.mediaStreamTrack;
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function or() {
|
|
225
225
|
const [e, t] = N(!1), [r, o] = N(""), [a, i] = N(null), s = M(null), l = M(null), c = E(async (g) => {
|
|
226
226
|
var u, h;
|
|
227
227
|
if (s.current && l.current) {
|
|
@@ -233,7 +233,7 @@ function ir() {
|
|
|
233
233
|
}
|
|
234
234
|
l.current = g, i(null);
|
|
235
235
|
try {
|
|
236
|
-
const L = await
|
|
236
|
+
const L = await Zn({
|
|
237
237
|
echoCancellation: !0,
|
|
238
238
|
noiseSuppression: !0
|
|
239
239
|
});
|
|
@@ -272,7 +272,7 @@ function ir() {
|
|
|
272
272
|
g.stop();
|
|
273
273
|
}
|
|
274
274
|
s.current = null, l.current = null, t(!1), o("");
|
|
275
|
-
}, []), R = E(() => i(null), []), _ = E(() =>
|
|
275
|
+
}, []), R = E(() => i(null), []), _ = E(() => rr(s.current), []);
|
|
276
276
|
return {
|
|
277
277
|
isMuted: e,
|
|
278
278
|
activeDeviceId: r,
|
|
@@ -286,15 +286,15 @@ function ir() {
|
|
|
286
286
|
getMicStream: _
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
289
|
+
const ir = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
290
|
+
function lr() {
|
|
291
291
|
const [e, t] = N(!1), [r, o] = N(null), [a, i] = N(null), [s, l] = N(""), c = M(null), p = M(null), w = E((h) => {
|
|
292
292
|
c.current = h;
|
|
293
293
|
}, []), m = E(() => {
|
|
294
294
|
var A;
|
|
295
295
|
const h = c.current, L = p.current;
|
|
296
296
|
if (L && h) {
|
|
297
|
-
const I = h.localParticipant.getTrackPublication(
|
|
297
|
+
const I = h.localParticipant.getTrackPublication(kn.Source.Camera), b = (I == null ? void 0 : I.track) ?? L;
|
|
298
298
|
try {
|
|
299
299
|
h.localParticipant.unpublishTrack(b);
|
|
300
300
|
} catch {
|
|
@@ -310,9 +310,9 @@ function ar() {
|
|
|
310
310
|
if (L) {
|
|
311
311
|
o(null);
|
|
312
312
|
try {
|
|
313
|
-
const A = { ...
|
|
313
|
+
const A = { ...ir };
|
|
314
314
|
h && (A.deviceId = h);
|
|
315
|
-
const I = await
|
|
315
|
+
const I = await Qn(A);
|
|
316
316
|
await L.localParticipant.publishTrack(I), p.current = I;
|
|
317
317
|
const U = I.attach();
|
|
318
318
|
i(U), t(!0), h && l(h);
|
|
@@ -349,7 +349,7 @@ function ar() {
|
|
|
349
349
|
clearError: u
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function ar() {
|
|
353
353
|
const [e, t] = N(!1), [r, o] = N(null), [a, i] = N(null), s = M(null), l = E((f) => {
|
|
354
354
|
s.current = f;
|
|
355
355
|
}, []), c = E(() => i(null), []), p = E(async () => {
|
|
@@ -368,7 +368,7 @@ function sr() {
|
|
|
368
368
|
await f.localParticipant.setScreenShareEnabled(!0);
|
|
369
369
|
let R = 0;
|
|
370
370
|
const _ = () => {
|
|
371
|
-
const g = f.localParticipant.getTrackPublication(
|
|
371
|
+
const g = f.localParticipant.getTrackPublication(kn.Source.ScreenShare);
|
|
372
372
|
if (g != null && g.track) {
|
|
373
373
|
const u = g.track.attach();
|
|
374
374
|
i(u), t(!0);
|
|
@@ -400,7 +400,7 @@ function sr() {
|
|
|
400
400
|
}, [e, c]), m = E(() => o(null), []);
|
|
401
401
|
return { isEnabled: e, error: r, previewEl: a, toggle: p, attachRoom: l, teardown: w, clearError: m };
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function sr() {
|
|
404
404
|
const [e, t] = N([]), [r, o] = N([]), a = E(async () => {
|
|
405
405
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
406
406
|
try {
|
|
@@ -415,7 +415,7 @@ function cr() {
|
|
|
415
415
|
return navigator.mediaDevices.addEventListener("devicechange", i), () => navigator.mediaDevices.removeEventListener("devicechange", i);
|
|
416
416
|
}, [a]), { mics: e, cameras: r, refresh: a };
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function cr(e, t, r = !1) {
|
|
419
419
|
const [o, a] = N(null), [i, s] = N(null), [l, c] = N(!r && !!e);
|
|
420
420
|
return T(() => {
|
|
421
421
|
if (r || !e) {
|
|
@@ -438,7 +438,7 @@ function dr(e, t, r = !1) {
|
|
|
438
438
|
}), () => p.abort();
|
|
439
439
|
}, [e, t, r]), { info: o, error: i, loading: l };
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function dr(e) {
|
|
442
442
|
if (typeof window > "u") return null;
|
|
443
443
|
try {
|
|
444
444
|
return window.localStorage.getItem(e);
|
|
@@ -446,14 +446,14 @@ function ur(e) {
|
|
|
446
446
|
return null;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function ur(e, t) {
|
|
450
450
|
if (!(typeof window > "u"))
|
|
451
451
|
try {
|
|
452
452
|
window.localStorage.setItem(e, t);
|
|
453
453
|
} catch {
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function fr({
|
|
457
457
|
value: e,
|
|
458
458
|
defaultValue: t = "expanded",
|
|
459
459
|
onChange: r
|
|
@@ -466,32 +466,32 @@ function pr({
|
|
|
466
466
|
);
|
|
467
467
|
return [s, l];
|
|
468
468
|
}
|
|
469
|
-
const
|
|
470
|
-
function
|
|
471
|
-
return e &&
|
|
469
|
+
const pr = ["hidden", "minimized", "expanded"];
|
|
470
|
+
function hr(e) {
|
|
471
|
+
return e && pr.includes(e) ? e : null;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function mr({
|
|
474
474
|
value: e,
|
|
475
475
|
defaultValue: t = "expanded",
|
|
476
476
|
onChange: r,
|
|
477
477
|
persistKey: o = "ll-widget",
|
|
478
478
|
disablePersistence: a = !1
|
|
479
479
|
} = {}) {
|
|
480
|
-
const i = `${o}:display-mode`, s = M(!1), [l, c] =
|
|
480
|
+
const i = `${o}:display-mode`, s = M(!1), [l, c] = fr({
|
|
481
481
|
value: e,
|
|
482
482
|
defaultValue: t,
|
|
483
483
|
onChange: (p) => {
|
|
484
|
-
e === void 0 && !a &&
|
|
484
|
+
e === void 0 && !a && ur(i, p), r == null || r(p);
|
|
485
485
|
}
|
|
486
486
|
});
|
|
487
487
|
return T(() => {
|
|
488
488
|
if (s.current || (s.current = !0, a || e !== void 0)) return;
|
|
489
|
-
const p =
|
|
489
|
+
const p = hr(dr(i));
|
|
490
490
|
p && p !== l && c(p);
|
|
491
491
|
}, []), [l, c];
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
function
|
|
493
|
+
const gr = 640;
|
|
494
|
+
function yr(e = gr) {
|
|
495
495
|
const [t, r] = N(!1);
|
|
496
496
|
return T(() => {
|
|
497
497
|
if (e === !1) {
|
|
@@ -506,9 +506,9 @@ function vr(e = yr) {
|
|
|
506
506
|
});
|
|
507
507
|
}, [e]), t;
|
|
508
508
|
}
|
|
509
|
-
const
|
|
510
|
-
function
|
|
511
|
-
if (typeof window > "u" || window.history[
|
|
509
|
+
const tn = "__llHistoryPatched", _t = "ll:pathname";
|
|
510
|
+
function vr() {
|
|
511
|
+
if (typeof window > "u" || window.history[tn]) return;
|
|
512
512
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
513
513
|
window.history.pushState = function(...r) {
|
|
514
514
|
const o = e.apply(this, r);
|
|
@@ -516,65 +516,65 @@ function br() {
|
|
|
516
516
|
}, window.history.replaceState = function(...r) {
|
|
517
517
|
const o = t.apply(this, r);
|
|
518
518
|
return window.dispatchEvent(new Event(_t)), o;
|
|
519
|
-
}, window.history[
|
|
519
|
+
}, window.history[tn] = !0;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function nn() {
|
|
522
522
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function br(e) {
|
|
525
525
|
const [t, r] = N(
|
|
526
|
-
() => e ??
|
|
526
|
+
() => e ?? nn()
|
|
527
527
|
);
|
|
528
528
|
return T(() => {
|
|
529
529
|
if (e !== void 0) return;
|
|
530
|
-
|
|
531
|
-
const o = () => r(
|
|
530
|
+
vr();
|
|
531
|
+
const o = () => r(nn());
|
|
532
532
|
return o(), window.addEventListener("popstate", o), window.addEventListener(_t, o), () => {
|
|
533
533
|
window.removeEventListener("popstate", o), window.removeEventListener(_t, o);
|
|
534
534
|
};
|
|
535
535
|
}, [e]), e ?? t;
|
|
536
536
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
539
|
-
return e.replace(
|
|
537
|
+
const rn = /* @__PURE__ */ new Map(), wr = /[\\^$+?.()|{}[\]]/g;
|
|
538
|
+
function _r(e) {
|
|
539
|
+
return e.replace(wr, "\\$&");
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
const t =
|
|
541
|
+
function xr(e) {
|
|
542
|
+
const t = rn.get(e);
|
|
543
543
|
if (t) return t;
|
|
544
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", a = "", i = r.replace(/\*\*/g, o).replace(/\*/g, a), l =
|
|
545
|
-
return
|
|
544
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", a = "", i = r.replace(/\*\*/g, o).replace(/\*/g, a), l = _r(i).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
|
|
545
|
+
return rn.set(e, c), c;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function Lr(e, t) {
|
|
548
548
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
549
|
-
return
|
|
549
|
+
return xr(e).test(r);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
551
|
+
function kr(e, t) {
|
|
552
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : Lr(e, t);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function on(e, t) {
|
|
555
555
|
if (!e || e.length === 0) return !1;
|
|
556
556
|
for (const r of e)
|
|
557
|
-
if (
|
|
557
|
+
if (kr(r, t)) return !0;
|
|
558
558
|
return !1;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
return e === void 0 ? !0 :
|
|
560
|
+
function Cr(e, t, r) {
|
|
561
|
+
return e === void 0 ? !0 : on(r, e) ? !1 : t && t.length > 0 ? on(t, e) : !0;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Er(e, t, r) {
|
|
564
564
|
return Qe(
|
|
565
|
-
() =>
|
|
565
|
+
() => Cr(e, t, r),
|
|
566
566
|
[e, t, r]
|
|
567
567
|
);
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function Sr(e) {
|
|
570
570
|
return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
|
|
571
571
|
navigate: e.navigate !== !1,
|
|
572
572
|
thinking: e.thinking !== !1,
|
|
573
573
|
action: e.action !== !1
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
const t = Qe(() =>
|
|
576
|
+
function Nr(e) {
|
|
577
|
+
const t = Qe(() => Sr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), o = M(null), a = E(
|
|
578
578
|
(c) => {
|
|
579
579
|
try {
|
|
580
580
|
new Audio(`${r}${c}`).play().catch(() => {
|
|
@@ -631,7 +631,7 @@ function Ar(e) {
|
|
|
631
631
|
[i, s, l]
|
|
632
632
|
);
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
635
635
|
"svg",
|
|
636
636
|
{
|
|
637
637
|
className: t,
|
|
@@ -677,7 +677,7 @@ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
|
677
677
|
}
|
|
678
678
|
)
|
|
679
679
|
}
|
|
680
|
-
),
|
|
680
|
+
), an = ({ className: e }) => /* @__PURE__ */ n(
|
|
681
681
|
"svg",
|
|
682
682
|
{
|
|
683
683
|
className: e,
|
|
@@ -695,7 +695,7 @@ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
|
695
695
|
}
|
|
696
696
|
)
|
|
697
697
|
}
|
|
698
|
-
),
|
|
698
|
+
), Ar = ({ className: e }) => /* @__PURE__ */ n(
|
|
699
699
|
"svg",
|
|
700
700
|
{
|
|
701
701
|
className: e,
|
|
@@ -706,12 +706,12 @@ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
|
706
706
|
"aria-hidden": "true",
|
|
707
707
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
708
708
|
}
|
|
709
|
-
),
|
|
709
|
+
), Ir = {
|
|
710
710
|
left: 180,
|
|
711
711
|
right: 0,
|
|
712
712
|
up: -90,
|
|
713
713
|
down: 90
|
|
714
|
-
},
|
|
714
|
+
}, sn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
715
715
|
"svg",
|
|
716
716
|
{
|
|
717
717
|
className: t,
|
|
@@ -719,19 +719,19 @@ const an = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ x(
|
|
|
719
719
|
viewBox: "0 0 24 24",
|
|
720
720
|
stroke: "currentColor",
|
|
721
721
|
strokeWidth: 2,
|
|
722
|
-
style: { transform: `rotate(${
|
|
722
|
+
style: { transform: `rotate(${Ir[e]}deg)` },
|
|
723
723
|
"aria-hidden": "true",
|
|
724
724
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
725
725
|
}
|
|
726
726
|
);
|
|
727
|
-
function
|
|
727
|
+
function Mr(e) {
|
|
728
728
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
729
729
|
}
|
|
730
|
-
const
|
|
731
|
-
function
|
|
730
|
+
const Cn = "ll-hidden-tab-center-y", Rr = 5, cn = 16;
|
|
731
|
+
function Tr() {
|
|
732
732
|
if (typeof window > "u") return null;
|
|
733
733
|
try {
|
|
734
|
-
const e = window.localStorage.getItem(
|
|
734
|
+
const e = window.localStorage.getItem(Cn);
|
|
735
735
|
if (!e) return null;
|
|
736
736
|
const t = Number.parseFloat(e);
|
|
737
737
|
return Number.isFinite(t) ? t : null;
|
|
@@ -739,14 +739,14 @@ function Dr() {
|
|
|
739
739
|
return null;
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function dn(e) {
|
|
743
743
|
if (!(typeof window > "u"))
|
|
744
744
|
try {
|
|
745
|
-
window.localStorage.setItem(
|
|
745
|
+
window.localStorage.setItem(Cn, String(e));
|
|
746
746
|
} catch {
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
const
|
|
749
|
+
const Dr = ({
|
|
750
750
|
position: e,
|
|
751
751
|
isMobile: t,
|
|
752
752
|
isSpeaking: r,
|
|
@@ -756,11 +756,11 @@ const Pr = ({
|
|
|
756
756
|
agentName: s,
|
|
757
757
|
containerEl: l
|
|
758
758
|
}) => {
|
|
759
|
-
const c =
|
|
759
|
+
const c = Mr(e), p = c === "right" ? "left" : "right", w = t ? 80 : 72, m = !!i, f = !!l, [R, _] = N(null), [g, u] = N(!1), h = M(null), L = M(!1), A = E(
|
|
760
760
|
(F) => {
|
|
761
761
|
if (typeof window > "u") return F;
|
|
762
|
-
const j = w / 2, S =
|
|
763
|
-
return
|
|
762
|
+
const j = w / 2, S = cn + j, ee = window.innerHeight - cn - j;
|
|
763
|
+
return ee < S ? Math.max(S, F) : Math.max(S, Math.min(ee, F));
|
|
764
764
|
},
|
|
765
765
|
[w]
|
|
766
766
|
);
|
|
@@ -769,7 +769,7 @@ const Pr = ({
|
|
|
769
769
|
_(null);
|
|
770
770
|
return;
|
|
771
771
|
}
|
|
772
|
-
const F =
|
|
772
|
+
const F = Tr();
|
|
773
773
|
_(A(F ?? window.innerHeight / 2));
|
|
774
774
|
const j = () => {
|
|
775
775
|
_((S) => S === null ? null : A(S));
|
|
@@ -796,7 +796,7 @@ const Pr = ({
|
|
|
796
796
|
const j = h.current;
|
|
797
797
|
if (!j) return;
|
|
798
798
|
const S = F.clientY - j.startClientY;
|
|
799
|
-
!j.moved && Math.abs(S) >
|
|
799
|
+
!j.moved && Math.abs(S) > Rr && (j.moved = !0, u(!0)), j.moved && _(A(j.startCenterY + S));
|
|
800
800
|
},
|
|
801
801
|
[A]
|
|
802
802
|
), b = E(
|
|
@@ -807,7 +807,7 @@ const Pr = ({
|
|
|
807
807
|
F.currentTarget.releasePointerCapture(F.pointerId);
|
|
808
808
|
} catch {
|
|
809
809
|
}
|
|
810
|
-
h.current = null, j.moved && (u(!1), L.current = !0, _((S) => (S !== null &&
|
|
810
|
+
h.current = null, j.moved && (u(!1), L.current = !0, _((S) => (S !== null && dn(S), S)));
|
|
811
811
|
}
|
|
812
812
|
},
|
|
813
813
|
[]
|
|
@@ -824,8 +824,8 @@ const Pr = ({
|
|
|
824
824
|
const j = F.key === "ArrowUp" ? -8 : 8;
|
|
825
825
|
_((S) => {
|
|
826
826
|
if (S === null) return S;
|
|
827
|
-
const
|
|
828
|
-
return
|
|
827
|
+
const ee = A(S + j);
|
|
828
|
+
return dn(ee), ee;
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
831
|
},
|
|
@@ -838,7 +838,7 @@ const Pr = ({
|
|
|
838
838
|
g ? "is-dragging" : null,
|
|
839
839
|
m ? "ll-hidden--with-avatar" : null,
|
|
840
840
|
f ? "ll-hidden--scoped" : null
|
|
841
|
-
].filter(Boolean).join(" "),
|
|
841
|
+
].filter(Boolean).join(" "), re = R === null ? void 0 : { top: `${R - w / 2}px`, transform: "none" };
|
|
842
842
|
return /* @__PURE__ */ n(
|
|
843
843
|
"button",
|
|
844
844
|
{
|
|
@@ -852,7 +852,7 @@ const Pr = ({
|
|
|
852
852
|
onKeyDown: B,
|
|
853
853
|
"aria-label": a,
|
|
854
854
|
"data-position": e,
|
|
855
|
-
style:
|
|
855
|
+
style: re,
|
|
856
856
|
children: m ? (
|
|
857
857
|
// Layout: tiny chevron flush against the inward edge (peeks out
|
|
858
858
|
// as the click affordance), then the circular avatar photo
|
|
@@ -860,7 +860,7 @@ const Pr = ({
|
|
|
860
860
|
// avatar-based experience" even when collapsed.
|
|
861
861
|
/* @__PURE__ */ x(ze, { children: [
|
|
862
862
|
/* @__PURE__ */ n(
|
|
863
|
-
|
|
863
|
+
sn,
|
|
864
864
|
{
|
|
865
865
|
direction: p,
|
|
866
866
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -877,7 +877,7 @@ const Pr = ({
|
|
|
877
877
|
)
|
|
878
878
|
] })
|
|
879
879
|
) : /* @__PURE__ */ n(
|
|
880
|
-
|
|
880
|
+
sn,
|
|
881
881
|
{
|
|
882
882
|
direction: p,
|
|
883
883
|
className: "ll-hidden__chevron"
|
|
@@ -885,7 +885,7 @@ const Pr = ({
|
|
|
885
885
|
)
|
|
886
886
|
}
|
|
887
887
|
);
|
|
888
|
-
},
|
|
888
|
+
}, Pr = ({
|
|
889
889
|
audioLevel: e,
|
|
890
890
|
bars: t = 20,
|
|
891
891
|
maxHeight: r = 20,
|
|
@@ -917,7 +917,7 @@ const Pr = ({
|
|
|
917
917
|
},
|
|
918
918
|
m
|
|
919
919
|
)) });
|
|
920
|
-
},
|
|
920
|
+
}, $r = ({
|
|
921
921
|
position: e,
|
|
922
922
|
isMobile: t,
|
|
923
923
|
agentName: r,
|
|
@@ -954,7 +954,7 @@ const Pr = ({
|
|
|
954
954
|
)
|
|
955
955
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
956
956
|
/* @__PURE__ */ n(
|
|
957
|
-
|
|
957
|
+
Pr,
|
|
958
958
|
{
|
|
959
959
|
audioLevel: s,
|
|
960
960
|
bars: 16,
|
|
@@ -977,10 +977,10 @@ const Pr = ({
|
|
|
977
977
|
(w.key === "Enter" || w.key === " ") && (w.stopPropagation(), w.preventDefault(), c());
|
|
978
978
|
},
|
|
979
979
|
"aria-label": i ? "Unmute microphone" : "Mute microphone",
|
|
980
|
-
children: /* @__PURE__ */ n(
|
|
980
|
+
children: /* @__PURE__ */ n(ln, { muted: i, className: "ll-minimized__icon" })
|
|
981
981
|
}
|
|
982
982
|
),
|
|
983
|
-
/* @__PURE__ */ n(
|
|
983
|
+
/* @__PURE__ */ n(an, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
984
984
|
] })
|
|
985
985
|
]
|
|
986
986
|
}
|
|
@@ -1017,7 +1017,7 @@ const Pr = ({
|
|
|
1017
1017
|
className: "ll-minimized__btn",
|
|
1018
1018
|
onClick: c,
|
|
1019
1019
|
"aria-label": i ? "Unmute microphone" : "Mute microphone",
|
|
1020
|
-
children: /* @__PURE__ */ n(
|
|
1020
|
+
children: /* @__PURE__ */ n(ln, { muted: i, className: "ll-minimized__icon" })
|
|
1021
1021
|
}
|
|
1022
1022
|
),
|
|
1023
1023
|
/* @__PURE__ */ n(
|
|
@@ -1027,7 +1027,7 @@ const Pr = ({
|
|
|
1027
1027
|
className: "ll-minimized__btn",
|
|
1028
1028
|
onClick: l,
|
|
1029
1029
|
"aria-label": `Expand ${r} widget`,
|
|
1030
|
-
children: /* @__PURE__ */ n(
|
|
1030
|
+
children: /* @__PURE__ */ n(an, { className: "ll-minimized__icon" })
|
|
1031
1031
|
}
|
|
1032
1032
|
),
|
|
1033
1033
|
/* @__PURE__ */ n(
|
|
@@ -1037,13 +1037,13 @@ const Pr = ({
|
|
|
1037
1037
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
1038
1038
|
onClick: p,
|
|
1039
1039
|
"aria-label": "Close widget",
|
|
1040
|
-
children: /* @__PURE__ */ n(
|
|
1040
|
+
children: /* @__PURE__ */ n(Ar, { className: "ll-minimized__icon" })
|
|
1041
1041
|
}
|
|
1042
1042
|
)
|
|
1043
1043
|
] })
|
|
1044
1044
|
] })
|
|
1045
1045
|
}
|
|
1046
|
-
),
|
|
1046
|
+
), zr = ({
|
|
1047
1047
|
src: e,
|
|
1048
1048
|
alt: t,
|
|
1049
1049
|
preCannedPlaying: r = !1,
|
|
@@ -1081,11 +1081,11 @@ const Pr = ({
|
|
|
1081
1081
|
}
|
|
1082
1082
|
)
|
|
1083
1083
|
);
|
|
1084
|
-
},
|
|
1085
|
-
function
|
|
1084
|
+
}, Hr = "#E06540";
|
|
1085
|
+
function Or({
|
|
1086
1086
|
size: e = 14,
|
|
1087
1087
|
className: t,
|
|
1088
|
-
fill: r =
|
|
1088
|
+
fill: r = Hr
|
|
1089
1089
|
}) {
|
|
1090
1090
|
return /* @__PURE__ */ x(
|
|
1091
1091
|
"svg",
|
|
@@ -1123,14 +1123,14 @@ function Br({
|
|
|
1123
1123
|
}
|
|
1124
1124
|
);
|
|
1125
1125
|
}
|
|
1126
|
-
const
|
|
1126
|
+
const Br = 8, un = 8, Fr = ({
|
|
1127
1127
|
open: e,
|
|
1128
1128
|
onClose: t,
|
|
1129
1129
|
anchorRef: r,
|
|
1130
1130
|
children: o
|
|
1131
1131
|
}) => {
|
|
1132
1132
|
const a = M(null), [i, s] = N(null);
|
|
1133
|
-
return
|
|
1133
|
+
return Ln(() => {
|
|
1134
1134
|
if (!e) {
|
|
1135
1135
|
s(null);
|
|
1136
1136
|
return;
|
|
@@ -1139,9 +1139,9 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1139
1139
|
if (!l) return;
|
|
1140
1140
|
const c = () => {
|
|
1141
1141
|
const p = l.getBoundingClientRect(), w = {
|
|
1142
|
-
top: p.top -
|
|
1142
|
+
top: p.top - Br,
|
|
1143
1143
|
left: p.left + p.width / 2
|
|
1144
|
-
}, m =
|
|
1144
|
+
}, m = un + 90, f = window.innerWidth - un - 90;
|
|
1145
1145
|
w.left < m && (w.left = m), w.left > f && (w.left = f), s(w);
|
|
1146
1146
|
};
|
|
1147
1147
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
@@ -1158,7 +1158,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1158
1158
|
return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
|
|
1159
1159
|
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
|
|
1160
1160
|
};
|
|
1161
|
-
}, [e, t, r]), !e || i === null || typeof document > "u" ? null :
|
|
1161
|
+
}, [e, t, r]), !e || i === null || typeof document > "u" ? null : $t(
|
|
1162
1162
|
/* @__PURE__ */ n(
|
|
1163
1163
|
"div",
|
|
1164
1164
|
{
|
|
@@ -1178,7 +1178,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1178
1178
|
),
|
|
1179
1179
|
document.body
|
|
1180
1180
|
);
|
|
1181
|
-
},
|
|
1181
|
+
}, Wr = ({
|
|
1182
1182
|
isMuted: e,
|
|
1183
1183
|
onToggleMute: t,
|
|
1184
1184
|
isCameraEnabled: r,
|
|
@@ -1210,7 +1210,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1210
1210
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1211
1211
|
onClick: t,
|
|
1212
1212
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1213
|
-
children: /* @__PURE__ */ n(
|
|
1213
|
+
children: /* @__PURE__ */ n(Nn, { muted: e })
|
|
1214
1214
|
}
|
|
1215
1215
|
),
|
|
1216
1216
|
/* @__PURE__ */ n(
|
|
@@ -1223,7 +1223,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1223
1223
|
"aria-label": "More controls",
|
|
1224
1224
|
"aria-haspopup": "menu",
|
|
1225
1225
|
"aria-expanded": _,
|
|
1226
|
-
children: /* @__PURE__ */ n(
|
|
1226
|
+
children: /* @__PURE__ */ n(qr, {})
|
|
1227
1227
|
}
|
|
1228
1228
|
),
|
|
1229
1229
|
/* @__PURE__ */ n(
|
|
@@ -1233,14 +1233,14 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1233
1233
|
className: "ll-tool ll-tool--danger",
|
|
1234
1234
|
onClick: R,
|
|
1235
1235
|
"aria-label": "End conversation",
|
|
1236
|
-
children: /* @__PURE__ */ n(
|
|
1236
|
+
children: /* @__PURE__ */ n(In, {})
|
|
1237
1237
|
}
|
|
1238
1238
|
)
|
|
1239
1239
|
]
|
|
1240
1240
|
}
|
|
1241
1241
|
),
|
|
1242
1242
|
/* @__PURE__ */ x(
|
|
1243
|
-
|
|
1243
|
+
Fr,
|
|
1244
1244
|
{
|
|
1245
1245
|
open: _,
|
|
1246
1246
|
onClose: () => g(!1),
|
|
@@ -1255,7 +1255,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1255
1255
|
o(), g(!1);
|
|
1256
1256
|
},
|
|
1257
1257
|
children: [
|
|
1258
|
-
/* @__PURE__ */ n(
|
|
1258
|
+
/* @__PURE__ */ n(Sn, {}),
|
|
1259
1259
|
/* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
|
|
1260
1260
|
]
|
|
1261
1261
|
}
|
|
@@ -1269,7 +1269,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1269
1269
|
s(), g(!1);
|
|
1270
1270
|
},
|
|
1271
1271
|
children: [
|
|
1272
|
-
/* @__PURE__ */ n(
|
|
1272
|
+
/* @__PURE__ */ n(En, {}),
|
|
1273
1273
|
/* @__PURE__ */ n("span", { children: i ? "Stop sharing" : "Share screen" })
|
|
1274
1274
|
]
|
|
1275
1275
|
}
|
|
@@ -1283,7 +1283,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1283
1283
|
p(), g(!1);
|
|
1284
1284
|
},
|
|
1285
1285
|
children: [
|
|
1286
|
-
/* @__PURE__ */ n(
|
|
1286
|
+
/* @__PURE__ */ n(An, { muted: c }),
|
|
1287
1287
|
/* @__PURE__ */ n("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1288
1288
|
]
|
|
1289
1289
|
}
|
|
@@ -1297,7 +1297,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1297
1297
|
f(), g(!1);
|
|
1298
1298
|
},
|
|
1299
1299
|
children: [
|
|
1300
|
-
/* @__PURE__ */ n(
|
|
1300
|
+
/* @__PURE__ */ n(Ur, {}),
|
|
1301
1301
|
/* @__PURE__ */ n("span", { children: m ? "Hide typing" : "Type a message" })
|
|
1302
1302
|
]
|
|
1303
1303
|
}
|
|
@@ -1320,7 +1320,7 @@ const Fr = 8, fn = 8, Wr = ({
|
|
|
1320
1320
|
)
|
|
1321
1321
|
] });
|
|
1322
1322
|
};
|
|
1323
|
-
function
|
|
1323
|
+
function qr() {
|
|
1324
1324
|
return /* @__PURE__ */ x(
|
|
1325
1325
|
"svg",
|
|
1326
1326
|
{
|
|
@@ -1337,7 +1337,7 @@ function Ur() {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
);
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1340
|
+
function Ur() {
|
|
1341
1341
|
return /* @__PURE__ */ n(
|
|
1342
1342
|
"svg",
|
|
1343
1343
|
{
|
|
@@ -1354,7 +1354,7 @@ function jr() {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
1356
1356
|
}
|
|
1357
|
-
const
|
|
1357
|
+
const jr = ({
|
|
1358
1358
|
position: e,
|
|
1359
1359
|
isMobile: t,
|
|
1360
1360
|
agentName: r,
|
|
@@ -1381,18 +1381,18 @@ const Vr = ({
|
|
|
1381
1381
|
micDevices: P,
|
|
1382
1382
|
activeMicId: B,
|
|
1383
1383
|
isCameraEnabled: q,
|
|
1384
|
-
cameraPreviewEl:
|
|
1384
|
+
cameraPreviewEl: re,
|
|
1385
1385
|
cameraDevices: F,
|
|
1386
1386
|
activeCameraId: j,
|
|
1387
1387
|
isScreenShareEnabled: S,
|
|
1388
|
-
screenPreviewEl:
|
|
1389
|
-
isSpeakerMuted:
|
|
1390
|
-
allowCamera:
|
|
1388
|
+
screenPreviewEl: ee,
|
|
1389
|
+
isSpeakerMuted: xe,
|
|
1390
|
+
allowCamera: de,
|
|
1391
1391
|
allowScreenShare: He,
|
|
1392
1392
|
allowTyping: Oe,
|
|
1393
|
-
showMinimize:
|
|
1394
|
-
showClose:
|
|
1395
|
-
chromeless:
|
|
1393
|
+
showMinimize: Z = !0,
|
|
1394
|
+
showClose: Ee = !0,
|
|
1395
|
+
chromeless: Le = !1,
|
|
1396
1396
|
compactControls: H = !1,
|
|
1397
1397
|
transforming: le,
|
|
1398
1398
|
transformingLabel: Y,
|
|
@@ -1400,21 +1400,21 @@ const Vr = ({
|
|
|
1400
1400
|
agentVideoEl: K,
|
|
1401
1401
|
onConnect: et,
|
|
1402
1402
|
onDisconnect: tt,
|
|
1403
|
-
onRetry:
|
|
1403
|
+
onRetry: ft,
|
|
1404
1404
|
onResumeAudio: nt,
|
|
1405
|
-
onToggleMute:
|
|
1405
|
+
onToggleMute: Se,
|
|
1406
1406
|
onSwitchMicDevice: Be,
|
|
1407
|
-
onToggleCamera:
|
|
1407
|
+
onToggleCamera: Ne,
|
|
1408
1408
|
onSwitchCameraDevice: Fe,
|
|
1409
|
-
onToggleScreenShare:
|
|
1410
|
-
onToggleSpeaker:
|
|
1411
|
-
onSendMessage:
|
|
1412
|
-
onMinimize:
|
|
1409
|
+
onToggleScreenShare: Ae,
|
|
1410
|
+
onToggleSpeaker: Ie,
|
|
1411
|
+
onSendMessage: Me,
|
|
1412
|
+
onMinimize: Re,
|
|
1413
1413
|
onClose: $,
|
|
1414
1414
|
onClearMicError: xt
|
|
1415
1415
|
}) => {
|
|
1416
|
-
var
|
|
1417
|
-
const
|
|
1416
|
+
var mt;
|
|
1417
|
+
const Te = ((l == null ? void 0 : l.length) ?? 0) > 1, We = g === "connecting" || g === "connected", he = g === "connected", rt = g === "idle" || g === "disconnected" || g === "error", [De, qe] = N(!1);
|
|
1418
1418
|
T(() => {
|
|
1419
1419
|
if (!K) {
|
|
1420
1420
|
qe(!1);
|
|
@@ -1436,54 +1436,54 @@ const Vr = ({
|
|
|
1436
1436
|
Ce(!1);
|
|
1437
1437
|
return;
|
|
1438
1438
|
}
|
|
1439
|
-
if (
|
|
1439
|
+
if (De) return;
|
|
1440
1440
|
const y = setTimeout(() => Ce(!0), 8e3);
|
|
1441
1441
|
return () => clearTimeout(y);
|
|
1442
|
-
}, [he,
|
|
1443
|
-
const ae = g === "connecting" || he && !!o &&
|
|
1442
|
+
}, [he, De]);
|
|
1443
|
+
const ae = g === "connecting" || he && !!o && !De && !Lt, ot = M(null), ue = M(null);
|
|
1444
1444
|
T(() => {
|
|
1445
1445
|
const y = ot.current;
|
|
1446
|
-
y && (y.innerHTML = "",
|
|
1447
|
-
}, [
|
|
1448
|
-
const y =
|
|
1449
|
-
y && (y.innerHTML = "",
|
|
1450
|
-
}, [
|
|
1451
|
-
const [
|
|
1446
|
+
y && (y.innerHTML = "", re && (re.style.width = "100%", re.style.height = "100%", re.style.objectFit = "cover", re.style.transform = "scaleX(-1)", y.appendChild(re)));
|
|
1447
|
+
}, [re]), T(() => {
|
|
1448
|
+
const y = ue.current;
|
|
1449
|
+
y && (y.innerHTML = "", ee && (ee.style.width = "100%", ee.style.height = "100%", ee.style.objectFit = "contain", y.appendChild(ee)));
|
|
1450
|
+
}, [ee]);
|
|
1451
|
+
const [fe, Ue] = N(!1), [je, se] = N(!1), me = M(null), pt = M(null);
|
|
1452
1452
|
T(() => {
|
|
1453
|
-
if (!
|
|
1453
|
+
if (!fe && !je && !R && !w) return;
|
|
1454
1454
|
const y = () => {
|
|
1455
1455
|
Ue(!1), se(!1), R && _(), w && m();
|
|
1456
1456
|
};
|
|
1457
1457
|
return document.addEventListener("click", y), () => document.removeEventListener("click", y);
|
|
1458
1458
|
}, [
|
|
1459
|
-
|
|
1459
|
+
fe,
|
|
1460
1460
|
je,
|
|
1461
1461
|
R,
|
|
1462
1462
|
w,
|
|
1463
1463
|
_,
|
|
1464
1464
|
m
|
|
1465
1465
|
]);
|
|
1466
|
-
const [
|
|
1466
|
+
const [ht, kt] = N(!1), Pe = E(() => kt((y) => !y), []), [Q, ge] = N(""), $e = E(
|
|
1467
1467
|
(y) => {
|
|
1468
1468
|
y.preventDefault();
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1469
|
+
const J = Q.trim();
|
|
1470
|
+
J && (Me(J), ge(""));
|
|
1471
1471
|
},
|
|
1472
|
-
[
|
|
1473
|
-
),
|
|
1474
|
-
let
|
|
1472
|
+
[Q, Me]
|
|
1473
|
+
), Ve = s.productName || "Live Layer", Ct = !s.productName;
|
|
1474
|
+
let ye = null, ve = null;
|
|
1475
1475
|
for (let y = h.length - 1; y >= 0; y--) {
|
|
1476
|
-
const
|
|
1477
|
-
if (!
|
|
1476
|
+
const J = h[y];
|
|
1477
|
+
if (!ye && J.role === "agent" ? ye = J : !ve && J.role === "user" && (ve = J), ye && ve) break;
|
|
1478
1478
|
}
|
|
1479
|
-
const
|
|
1479
|
+
const it = he ? (ye == null ? void 0 : ye.text) || null : i || null, Ye = he && (ve == null ? void 0 : ve.text) || null, lt = [
|
|
1480
1480
|
"ll-expanded",
|
|
1481
1481
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1482
1482
|
].join(" ");
|
|
1483
1483
|
return /* @__PURE__ */ x(
|
|
1484
1484
|
"div",
|
|
1485
1485
|
{
|
|
1486
|
-
className:
|
|
1486
|
+
className: lt,
|
|
1487
1487
|
"data-position": e,
|
|
1488
1488
|
"data-state": he ? "connected" : We ? "connecting" : "idle",
|
|
1489
1489
|
role: "dialog",
|
|
@@ -1491,13 +1491,13 @@ const Vr = ({
|
|
|
1491
1491
|
children: [
|
|
1492
1492
|
/* @__PURE__ */ x("div", { className: "ll-expanded__bg", children: [
|
|
1493
1493
|
o ? /* @__PURE__ */ n(
|
|
1494
|
-
|
|
1494
|
+
zr,
|
|
1495
1495
|
{
|
|
1496
1496
|
src: o,
|
|
1497
1497
|
alt: r,
|
|
1498
1498
|
className: "ll-expanded__bg-img"
|
|
1499
1499
|
}
|
|
1500
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1500
|
+
) : /* @__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" }) }),
|
|
1501
1501
|
a && !he && /* @__PURE__ */ n(
|
|
1502
1502
|
"video",
|
|
1503
1503
|
{
|
|
@@ -1542,7 +1542,7 @@ const Vr = ({
|
|
|
1542
1542
|
),
|
|
1543
1543
|
We ? /* @__PURE__ */ x(ze, { children: [
|
|
1544
1544
|
!H && /* @__PURE__ */ x("div", { className: "ll-expanded__topbar", children: [
|
|
1545
|
-
!
|
|
1545
|
+
!Le && /* @__PURE__ */ x("div", { className: "ll-expanded__topbar-left", children: [
|
|
1546
1546
|
/* @__PURE__ */ x("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1547
1547
|
/* @__PURE__ */ x(
|
|
1548
1548
|
"button",
|
|
@@ -1550,17 +1550,17 @@ const Vr = ({
|
|
|
1550
1550
|
type: "button",
|
|
1551
1551
|
className: "ll-hpill",
|
|
1552
1552
|
onClick: (y) => {
|
|
1553
|
-
|
|
1553
|
+
Te && (y.stopPropagation(), m());
|
|
1554
1554
|
},
|
|
1555
|
-
"aria-haspopup":
|
|
1556
|
-
"aria-expanded":
|
|
1555
|
+
"aria-haspopup": Te ? "listbox" : void 0,
|
|
1556
|
+
"aria-expanded": Te ? w : void 0,
|
|
1557
1557
|
children: [
|
|
1558
1558
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1559
|
-
|
|
1559
|
+
Te && /* @__PURE__ */ n(bt, {})
|
|
1560
1560
|
]
|
|
1561
1561
|
}
|
|
1562
1562
|
),
|
|
1563
|
-
|
|
1563
|
+
Te && w && /* @__PURE__ */ n(
|
|
1564
1564
|
"div",
|
|
1565
1565
|
{
|
|
1566
1566
|
className: "ll-hmenu",
|
|
@@ -1639,18 +1639,18 @@ const Vr = ({
|
|
|
1639
1639
|
)
|
|
1640
1640
|
] }),
|
|
1641
1641
|
/* @__PURE__ */ x("div", { className: "ll-expanded__header-actions", children: [
|
|
1642
|
-
|
|
1642
|
+
Z !== !1 && /* @__PURE__ */ n(
|
|
1643
1643
|
"button",
|
|
1644
1644
|
{
|
|
1645
1645
|
type: "button",
|
|
1646
1646
|
className: "ll-hbtn",
|
|
1647
|
-
onClick:
|
|
1647
|
+
onClick: Re,
|
|
1648
1648
|
"aria-label": "Minimize widget",
|
|
1649
1649
|
title: "Minimize",
|
|
1650
|
-
children: /* @__PURE__ */ n(
|
|
1650
|
+
children: /* @__PURE__ */ n(pn, {})
|
|
1651
1651
|
}
|
|
1652
1652
|
),
|
|
1653
|
-
|
|
1653
|
+
Ee !== !1 && /* @__PURE__ */ n(
|
|
1654
1654
|
"button",
|
|
1655
1655
|
{
|
|
1656
1656
|
type: "button",
|
|
@@ -1658,7 +1658,7 @@ const Vr = ({
|
|
|
1658
1658
|
onClick: $,
|
|
1659
1659
|
"aria-label": "End call",
|
|
1660
1660
|
title: "End call",
|
|
1661
|
-
children: /* @__PURE__ */ n(
|
|
1661
|
+
children: /* @__PURE__ */ n(fn, {})
|
|
1662
1662
|
}
|
|
1663
1663
|
)
|
|
1664
1664
|
] })
|
|
@@ -1677,7 +1677,7 @@ const Vr = ({
|
|
|
1677
1677
|
// pre-0.18.0 behavior) left users no way out short of scrolling
|
|
1678
1678
|
// the page itself.
|
|
1679
1679
|
/* @__PURE__ */ x("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1680
|
-
!H && (
|
|
1680
|
+
!H && (Ct ? /* @__PURE__ */ x(
|
|
1681
1681
|
"a",
|
|
1682
1682
|
{
|
|
1683
1683
|
className: "ll-expanded__brand ll-expanded__brand--link",
|
|
@@ -1687,30 +1687,30 @@ const Vr = ({
|
|
|
1687
1687
|
"aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
|
|
1688
1688
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1689
1689
|
children: [
|
|
1690
|
-
/* @__PURE__ */ n(
|
|
1691
|
-
/* @__PURE__ */ n("span", { children:
|
|
1690
|
+
/* @__PURE__ */ n(Or, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1691
|
+
/* @__PURE__ */ n("span", { children: Ve })
|
|
1692
1692
|
]
|
|
1693
1693
|
}
|
|
1694
|
-
) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children:
|
|
1694
|
+
) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ve })),
|
|
1695
1695
|
/* @__PURE__ */ x("div", { className: "ll-expanded__header-actions", children: [
|
|
1696
|
-
!H &&
|
|
1696
|
+
!H && Z !== !1 && /* @__PURE__ */ n(
|
|
1697
1697
|
"button",
|
|
1698
1698
|
{
|
|
1699
1699
|
type: "button",
|
|
1700
1700
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1701
|
-
onClick:
|
|
1701
|
+
onClick: Re,
|
|
1702
1702
|
"aria-label": "Minimize widget",
|
|
1703
|
-
children: /* @__PURE__ */ n(
|
|
1703
|
+
children: /* @__PURE__ */ n(pn, {})
|
|
1704
1704
|
}
|
|
1705
1705
|
),
|
|
1706
|
-
|
|
1706
|
+
Ee !== !1 && /* @__PURE__ */ n(
|
|
1707
1707
|
"button",
|
|
1708
1708
|
{
|
|
1709
1709
|
type: "button",
|
|
1710
1710
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1711
1711
|
onClick: $,
|
|
1712
1712
|
"aria-label": "Close widget",
|
|
1713
|
-
children: /* @__PURE__ */ n(
|
|
1713
|
+
children: /* @__PURE__ */ n(fn, {})
|
|
1714
1714
|
}
|
|
1715
1715
|
)
|
|
1716
1716
|
] })
|
|
@@ -1755,7 +1755,7 @@ const Vr = ({
|
|
|
1755
1755
|
/* @__PURE__ */ n(
|
|
1756
1756
|
"div",
|
|
1757
1757
|
{
|
|
1758
|
-
ref:
|
|
1758
|
+
ref: ue,
|
|
1759
1759
|
className: S ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1760
1760
|
}
|
|
1761
1761
|
),
|
|
@@ -1770,54 +1770,54 @@ const Vr = ({
|
|
|
1770
1770
|
}
|
|
1771
1771
|
),
|
|
1772
1772
|
We ? /* @__PURE__ */ x("div", { className: "ll-expanded__bottom", children: [
|
|
1773
|
-
!H &&
|
|
1773
|
+
!H && it && /* @__PURE__ */ n(
|
|
1774
1774
|
"div",
|
|
1775
1775
|
{
|
|
1776
1776
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1777
1777
|
"data-role": "agent",
|
|
1778
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1778
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: it })
|
|
1779
1779
|
}
|
|
1780
1780
|
),
|
|
1781
|
-
!H &&
|
|
1781
|
+
!H && Ye && /* @__PURE__ */ n(
|
|
1782
1782
|
"div",
|
|
1783
1783
|
{
|
|
1784
1784
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
1785
1785
|
"data-role": "user",
|
|
1786
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1786
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ye })
|
|
1787
1787
|
}
|
|
1788
1788
|
),
|
|
1789
|
-
!
|
|
1789
|
+
!Le && !H && /* @__PURE__ */ x("div", { className: "ll-toolbar", onClick: (y) => y.stopPropagation(), children: [
|
|
1790
1790
|
He && /* @__PURE__ */ n(
|
|
1791
1791
|
"button",
|
|
1792
1792
|
{
|
|
1793
1793
|
type: "button",
|
|
1794
1794
|
className: `ll-tool ${S ? "is-on" : ""}`,
|
|
1795
|
-
onClick:
|
|
1795
|
+
onClick: Ae,
|
|
1796
1796
|
"aria-label": S ? "Stop sharing screen" : "Share screen",
|
|
1797
1797
|
title: S ? "Stop sharing" : "Share screen",
|
|
1798
|
-
children: /* @__PURE__ */ n(
|
|
1798
|
+
children: /* @__PURE__ */ n(En, {})
|
|
1799
1799
|
}
|
|
1800
1800
|
),
|
|
1801
|
-
|
|
1801
|
+
de && /* @__PURE__ */ x("div", { className: "ll-tool-split", children: [
|
|
1802
1802
|
/* @__PURE__ */ n(
|
|
1803
1803
|
"button",
|
|
1804
1804
|
{
|
|
1805
1805
|
type: "button",
|
|
1806
1806
|
className: `ll-tool ll-tool--left ${q ? "is-on" : ""}`,
|
|
1807
|
-
onClick:
|
|
1807
|
+
onClick: Ne,
|
|
1808
1808
|
"aria-label": q ? "Turn off camera" : "Turn on camera",
|
|
1809
1809
|
title: q ? "Stop camera" : "Start camera",
|
|
1810
|
-
children: /* @__PURE__ */ n(
|
|
1810
|
+
children: /* @__PURE__ */ n(Sn, {})
|
|
1811
1811
|
}
|
|
1812
1812
|
),
|
|
1813
1813
|
/* @__PURE__ */ n(
|
|
1814
1814
|
"button",
|
|
1815
1815
|
{
|
|
1816
|
-
ref:
|
|
1816
|
+
ref: pt,
|
|
1817
1817
|
type: "button",
|
|
1818
1818
|
className: `ll-tool ll-tool--right ${q ? "is-on" : ""}`,
|
|
1819
1819
|
onClick: (y) => {
|
|
1820
|
-
y.stopPropagation(), se((
|
|
1820
|
+
y.stopPropagation(), se((J) => !J), Ue(!1);
|
|
1821
1821
|
},
|
|
1822
1822
|
"aria-label": "Camera devices",
|
|
1823
1823
|
"aria-haspopup": "listbox",
|
|
@@ -1826,12 +1826,12 @@ const Vr = ({
|
|
|
1826
1826
|
}
|
|
1827
1827
|
),
|
|
1828
1828
|
je && F.length > 0 && /* @__PURE__ */ n(
|
|
1829
|
-
|
|
1829
|
+
hn,
|
|
1830
1830
|
{
|
|
1831
1831
|
label: "Camera",
|
|
1832
1832
|
devices: F,
|
|
1833
1833
|
activeId: j,
|
|
1834
|
-
anchorRef:
|
|
1834
|
+
anchorRef: pt,
|
|
1835
1835
|
onPick: (y) => {
|
|
1836
1836
|
se(!1), Fe(y);
|
|
1837
1837
|
}
|
|
@@ -1844,10 +1844,10 @@ const Vr = ({
|
|
|
1844
1844
|
{
|
|
1845
1845
|
type: "button",
|
|
1846
1846
|
className: `ll-tool ll-tool--left ${U ? "is-muted" : ""}`,
|
|
1847
|
-
onClick:
|
|
1847
|
+
onClick: Se,
|
|
1848
1848
|
"aria-label": U ? "Unmute microphone" : "Mute microphone",
|
|
1849
1849
|
title: U ? "Unmute" : "Mute",
|
|
1850
|
-
children: /* @__PURE__ */ n(
|
|
1850
|
+
children: /* @__PURE__ */ n(Nn, { muted: U })
|
|
1851
1851
|
}
|
|
1852
1852
|
),
|
|
1853
1853
|
/* @__PURE__ */ n(
|
|
@@ -1857,16 +1857,16 @@ const Vr = ({
|
|
|
1857
1857
|
type: "button",
|
|
1858
1858
|
className: `ll-tool ll-tool--right ${U ? "is-muted" : ""}`,
|
|
1859
1859
|
onClick: (y) => {
|
|
1860
|
-
y.stopPropagation(), Ue((
|
|
1860
|
+
y.stopPropagation(), Ue((J) => !J), se(!1);
|
|
1861
1861
|
},
|
|
1862
1862
|
"aria-label": "Microphone devices",
|
|
1863
1863
|
"aria-haspopup": "listbox",
|
|
1864
|
-
"aria-expanded":
|
|
1864
|
+
"aria-expanded": fe,
|
|
1865
1865
|
children: /* @__PURE__ */ n(bt, {})
|
|
1866
1866
|
}
|
|
1867
1867
|
),
|
|
1868
|
-
|
|
1869
|
-
|
|
1868
|
+
fe && P.length > 0 && /* @__PURE__ */ n(
|
|
1869
|
+
hn,
|
|
1870
1870
|
{
|
|
1871
1871
|
label: "Microphone",
|
|
1872
1872
|
devices: P,
|
|
@@ -1882,11 +1882,11 @@ const Vr = ({
|
|
|
1882
1882
|
"button",
|
|
1883
1883
|
{
|
|
1884
1884
|
type: "button",
|
|
1885
|
-
className: `ll-tool ${
|
|
1886
|
-
onClick:
|
|
1887
|
-
"aria-label":
|
|
1888
|
-
title:
|
|
1889
|
-
children: /* @__PURE__ */ n(
|
|
1885
|
+
className: `ll-tool ${xe ? "is-muted" : ""}`,
|
|
1886
|
+
onClick: Ie,
|
|
1887
|
+
"aria-label": xe ? "Unmute speaker" : "Mute speaker",
|
|
1888
|
+
title: xe ? "Unmute speaker" : "Mute speaker",
|
|
1889
|
+
children: /* @__PURE__ */ n(An, { muted: xe })
|
|
1890
1890
|
}
|
|
1891
1891
|
),
|
|
1892
1892
|
/* @__PURE__ */ n(
|
|
@@ -1897,48 +1897,48 @@ const Vr = ({
|
|
|
1897
1897
|
onClick: tt,
|
|
1898
1898
|
"aria-label": "End conversation",
|
|
1899
1899
|
title: "End conversation",
|
|
1900
|
-
children: /* @__PURE__ */ n(
|
|
1900
|
+
children: /* @__PURE__ */ n(In, {})
|
|
1901
1901
|
}
|
|
1902
1902
|
)
|
|
1903
1903
|
] }),
|
|
1904
|
-
!
|
|
1905
|
-
|
|
1904
|
+
!Le && H && /* @__PURE__ */ n(
|
|
1905
|
+
Wr,
|
|
1906
1906
|
{
|
|
1907
1907
|
isMuted: U,
|
|
1908
|
-
onToggleMute:
|
|
1908
|
+
onToggleMute: Se,
|
|
1909
1909
|
isCameraEnabled: q,
|
|
1910
|
-
onToggleCamera:
|
|
1911
|
-
allowCamera:
|
|
1910
|
+
onToggleCamera: Ne,
|
|
1911
|
+
allowCamera: de,
|
|
1912
1912
|
isScreenShareEnabled: S,
|
|
1913
|
-
onToggleScreenShare:
|
|
1913
|
+
onToggleScreenShare: Ae,
|
|
1914
1914
|
allowScreenShare: He,
|
|
1915
|
-
isSpeakerMuted:
|
|
1916
|
-
onToggleSpeaker:
|
|
1915
|
+
isSpeakerMuted: xe,
|
|
1916
|
+
onToggleSpeaker: Ie,
|
|
1917
1917
|
allowTyping: Oe,
|
|
1918
|
-
isTypingOpen:
|
|
1919
|
-
onToggleTyping:
|
|
1918
|
+
isTypingOpen: ht,
|
|
1919
|
+
onToggleTyping: Pe,
|
|
1920
1920
|
onDisconnect: tt
|
|
1921
1921
|
}
|
|
1922
1922
|
),
|
|
1923
|
-
!
|
|
1923
|
+
!Le && Oe && (H ? ht : !0) && /* @__PURE__ */ x("form", { className: "ll-message-input", onSubmit: $e, children: [
|
|
1924
1924
|
/* @__PURE__ */ n(
|
|
1925
1925
|
"input",
|
|
1926
1926
|
{
|
|
1927
1927
|
type: "text",
|
|
1928
1928
|
className: "ll-message-input__field",
|
|
1929
1929
|
placeholder: "Message...",
|
|
1930
|
-
value:
|
|
1931
|
-
onChange: (y) =>
|
|
1930
|
+
value: Q,
|
|
1931
|
+
onChange: (y) => ge(y.target.value),
|
|
1932
1932
|
"aria-label": "Message the agent"
|
|
1933
1933
|
}
|
|
1934
1934
|
),
|
|
1935
|
-
|
|
1935
|
+
Q.trim() && /* @__PURE__ */ n(
|
|
1936
1936
|
"button",
|
|
1937
1937
|
{
|
|
1938
1938
|
type: "submit",
|
|
1939
1939
|
className: "ll-message-input__send",
|
|
1940
1940
|
"aria-label": "Send message",
|
|
1941
|
-
children: /* @__PURE__ */ n(
|
|
1941
|
+
children: /* @__PURE__ */ n(Vr, {})
|
|
1942
1942
|
}
|
|
1943
1943
|
)
|
|
1944
1944
|
] })
|
|
@@ -1959,7 +1959,7 @@ const Vr = ({
|
|
|
1959
1959
|
)
|
|
1960
1960
|
] });
|
|
1961
1961
|
if (!I || g !== "error") return null;
|
|
1962
|
-
let y = "Failed to connect",
|
|
1962
|
+
let y = "Failed to connect", J = "Try again";
|
|
1963
1963
|
return I === "MIC_PERMISSION_DENIED" ? y = "Microphone blocked. Allow access to talk." : I === "MIC_NOT_FOUND" ? y = "No microphone found. Plug one in + retry." : I === "MIC_UNAVAILABLE" ? y = "Mic unavailable. Check other apps using it." : I === "AGENT_TIMEOUT" ? y = "Agent didn't pick up. Try again." : I === "CONNECT_FAILED" ? y = "Connection failed. Check your network." : I.length < 80 && (y = I), /* @__PURE__ */ x("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1964
1964
|
/* @__PURE__ */ n("span", { children: y }),
|
|
1965
1965
|
/* @__PURE__ */ n(
|
|
@@ -1967,8 +1967,8 @@ const Vr = ({
|
|
|
1967
1967
|
{
|
|
1968
1968
|
type: "button",
|
|
1969
1969
|
className: "ll-expanded__banner-retry",
|
|
1970
|
-
onClick:
|
|
1971
|
-
children:
|
|
1970
|
+
onClick: ft,
|
|
1971
|
+
children: J
|
|
1972
1972
|
}
|
|
1973
1973
|
)
|
|
1974
1974
|
] });
|
|
@@ -1980,29 +1980,29 @@ const Vr = ({
|
|
|
1980
1980
|
function bt() {
|
|
1981
1981
|
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" }) });
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1983
|
+
function fn() {
|
|
1984
1984
|
return /* @__PURE__ */ x("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1985
1985
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1986
1986
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1987
1987
|
] });
|
|
1988
1988
|
}
|
|
1989
|
-
function
|
|
1989
|
+
function pn() {
|
|
1990
1990
|
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" }) });
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1992
|
+
function En() {
|
|
1993
1993
|
return /* @__PURE__ */ x("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: [
|
|
1994
1994
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1995
1995
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1996
1996
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1997
1997
|
] });
|
|
1998
1998
|
}
|
|
1999
|
-
function
|
|
1999
|
+
function Sn() {
|
|
2000
2000
|
return /* @__PURE__ */ x("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: [
|
|
2001
2001
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
2002
2002
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
2003
2003
|
] });
|
|
2004
2004
|
}
|
|
2005
|
-
function
|
|
2005
|
+
function Nn({ muted: e }) {
|
|
2006
2006
|
return /* @__PURE__ */ x("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: [
|
|
2007
2007
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
2008
2008
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -2010,7 +2010,7 @@ function An({ muted: e }) {
|
|
|
2010
2010
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2011
2011
|
] });
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function An({ muted: e }) {
|
|
2014
2014
|
return /* @__PURE__ */ x("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: [
|
|
2015
2015
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
2016
2016
|
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ x(ze, { children: [
|
|
@@ -2019,13 +2019,13 @@ function In({ muted: e }) {
|
|
|
2019
2019
|
] })
|
|
2020
2020
|
] });
|
|
2021
2021
|
}
|
|
2022
|
-
function
|
|
2022
|
+
function Vr() {
|
|
2023
2023
|
return /* @__PURE__ */ x("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2024
2024
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
2025
2025
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
2026
2026
|
] });
|
|
2027
2027
|
}
|
|
2028
|
-
function
|
|
2028
|
+
function In() {
|
|
2029
2029
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
|
|
2030
2030
|
"path",
|
|
2031
2031
|
{
|
|
@@ -2034,7 +2034,7 @@ function Mn() {
|
|
|
2034
2034
|
}
|
|
2035
2035
|
) });
|
|
2036
2036
|
}
|
|
2037
|
-
const
|
|
2037
|
+
const hn = ({
|
|
2038
2038
|
label: e,
|
|
2039
2039
|
devices: t,
|
|
2040
2040
|
activeId: r,
|
|
@@ -2042,7 +2042,7 @@ const mn = ({
|
|
|
2042
2042
|
anchorRef: a
|
|
2043
2043
|
}) => {
|
|
2044
2044
|
const [i, s] = N(null);
|
|
2045
|
-
return
|
|
2045
|
+
return Ln(() => {
|
|
2046
2046
|
const l = () => {
|
|
2047
2047
|
const c = a.current;
|
|
2048
2048
|
if (!c) return;
|
|
@@ -2055,7 +2055,7 @@ const mn = ({
|
|
|
2055
2055
|
return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
|
|
2056
2056
|
window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
2057
2057
|
};
|
|
2058
|
-
}, [a]), i === null || typeof document > "u" ? null :
|
|
2058
|
+
}, [a]), i === null || typeof document > "u" ? null : $t(
|
|
2059
2059
|
/* @__PURE__ */ x(
|
|
2060
2060
|
"div",
|
|
2061
2061
|
{
|
|
@@ -2094,7 +2094,7 @@ const mn = ({
|
|
|
2094
2094
|
),
|
|
2095
2095
|
document.body
|
|
2096
2096
|
);
|
|
2097
|
-
},
|
|
2097
|
+
}, Yr = [
|
|
2098
2098
|
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
2099
2099
|
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
2100
2100
|
// is the recommended spelling; "true" is preserved for back-compat.
|
|
@@ -2102,17 +2102,17 @@ const mn = ({
|
|
|
2102
2102
|
"[data-ll-skip]",
|
|
2103
2103
|
".ll-widget"
|
|
2104
2104
|
];
|
|
2105
|
-
function
|
|
2105
|
+
function zt(e) {
|
|
2106
2106
|
let t = e;
|
|
2107
2107
|
for (; t; ) {
|
|
2108
|
-
for (const r of
|
|
2108
|
+
for (const r of Yr)
|
|
2109
2109
|
if (t.matches(r)) return !0;
|
|
2110
2110
|
t = t.parentElement;
|
|
2111
2111
|
}
|
|
2112
2112
|
return !1;
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2115
|
-
if (
|
|
2114
|
+
function Dt(e) {
|
|
2115
|
+
if (zt(e)) return !1;
|
|
2116
2116
|
if (e instanceof HTMLInputElement) {
|
|
2117
2117
|
if (e.type === "password") return !1;
|
|
2118
2118
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2120,7 +2120,7 @@ function Pt(e) {
|
|
|
2120
2120
|
}
|
|
2121
2121
|
return !0;
|
|
2122
2122
|
}
|
|
2123
|
-
const wt = 4096,
|
|
2123
|
+
const wt = 4096, Gr = 20, Kr = 20, Jr = 10, Xr = 10, Zr = 30, Qr = 20, mn = 500, eo = [
|
|
2124
2124
|
'[data-ll-private="true"]',
|
|
2125
2125
|
".ll-widget",
|
|
2126
2126
|
"script",
|
|
@@ -2128,24 +2128,24 @@ const wt = 4096, Kr = 20, Jr = 20, Xr = 10, Zr = 10, Qr = 30, eo = 20, gn = 500,
|
|
|
2128
2128
|
"noscript",
|
|
2129
2129
|
"iframe"
|
|
2130
2130
|
];
|
|
2131
|
-
function
|
|
2131
|
+
function dt(e) {
|
|
2132
2132
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2133
2133
|
let t = e;
|
|
2134
2134
|
for (; t; ) {
|
|
2135
|
-
for (const r of
|
|
2135
|
+
for (const r of eo)
|
|
2136
2136
|
if (t.matches(r)) return !0;
|
|
2137
2137
|
t = t.parentElement;
|
|
2138
2138
|
}
|
|
2139
2139
|
return !1;
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function ut(e) {
|
|
2142
2142
|
if (typeof window > "u") return !0;
|
|
2143
2143
|
const t = e.getBoundingClientRect();
|
|
2144
2144
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
2145
2145
|
const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
|
|
2146
2146
|
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
|
|
2147
2147
|
}
|
|
2148
|
-
function
|
|
2148
|
+
function gn(e) {
|
|
2149
2149
|
const t = e.getAttribute("id");
|
|
2150
2150
|
if (t) {
|
|
2151
2151
|
const i = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${i}"]`);
|
|
@@ -2175,10 +2175,10 @@ function yn(e) {
|
|
|
2175
2175
|
function ie(e, t) {
|
|
2176
2176
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2177
2177
|
}
|
|
2178
|
-
function
|
|
2178
|
+
function to(e) {
|
|
2179
2179
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2180
2180
|
}
|
|
2181
|
-
function
|
|
2181
|
+
function no(e) {
|
|
2182
2182
|
const t = e.getAttribute("aria-label");
|
|
2183
2183
|
if (t) return t.trim().slice(0, 80);
|
|
2184
2184
|
const r = e.getAttribute("aria-labelledby");
|
|
@@ -2207,7 +2207,7 @@ function ro(e) {
|
|
|
2207
2207
|
function Je(e) {
|
|
2208
2208
|
return e.length;
|
|
2209
2209
|
}
|
|
2210
|
-
function
|
|
2210
|
+
function ro(e, t = {}) {
|
|
2211
2211
|
const r = t.doc ?? (typeof document < "u" ? document : null);
|
|
2212
2212
|
if (!r)
|
|
2213
2213
|
return {
|
|
@@ -2225,11 +2225,11 @@ function oo(e, t = {}) {
|
|
|
2225
2225
|
r.querySelectorAll("[data-ll-region]")
|
|
2226
2226
|
), l = [];
|
|
2227
2227
|
for (const b of s) {
|
|
2228
|
-
if (l.length >=
|
|
2229
|
-
if (
|
|
2228
|
+
if (l.length >= Jr) break;
|
|
2229
|
+
if (dt(b) || !ut(b)) continue;
|
|
2230
2230
|
const P = b.getAttribute("data-ll-region") ?? "", B = b.getAttribute("data-ll-intent") ?? void 0, q = ie(
|
|
2231
2231
|
(b.innerText || b.textContent || "").trim(),
|
|
2232
|
-
|
|
2232
|
+
mn * 2
|
|
2233
2233
|
);
|
|
2234
2234
|
!P || !q || l.push({ id: P, intent: B, text: q });
|
|
2235
2235
|
}
|
|
@@ -2237,21 +2237,21 @@ function oo(e, t = {}) {
|
|
|
2237
2237
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2238
2238
|
);
|
|
2239
2239
|
for (const b of w) {
|
|
2240
|
-
if (
|
|
2240
|
+
if (dt(b) || !ut(b)) continue;
|
|
2241
2241
|
const P = (b.textContent || "").trim();
|
|
2242
2242
|
P && c.push(`${b.tagName}: ${ie(P, 200)}`);
|
|
2243
2243
|
}
|
|
2244
2244
|
const m = Array.from(r.querySelectorAll("p, li"));
|
|
2245
2245
|
for (const b of m) {
|
|
2246
|
-
if (
|
|
2246
|
+
if (dt(b) || !ut(b) || p.includes(b.tagName)) continue;
|
|
2247
2247
|
const P = (b.textContent || "").trim();
|
|
2248
|
-
P.length > 10 && c.push(ie(P,
|
|
2248
|
+
P.length > 10 && c.push(ie(P, mn));
|
|
2249
2249
|
}
|
|
2250
2250
|
const f = c.join(`
|
|
2251
2251
|
`), R = [], _ = Array.from(r.querySelectorAll("a[href]"));
|
|
2252
2252
|
for (const b of _) {
|
|
2253
|
-
if (R.length >=
|
|
2254
|
-
if (
|
|
2253
|
+
if (R.length >= Gr) break;
|
|
2254
|
+
if (dt(b) || !ut(b)) continue;
|
|
2255
2255
|
const P = b.getAttribute("href") || "", B = (b.textContent || "").trim();
|
|
2256
2256
|
!P || !B || R.push({ href: P, text: ie(B, 100) });
|
|
2257
2257
|
}
|
|
@@ -2261,78 +2261,78 @@ function oo(e, t = {}) {
|
|
|
2261
2261
|
)
|
|
2262
2262
|
);
|
|
2263
2263
|
for (const b of u) {
|
|
2264
|
-
if (g.length >=
|
|
2265
|
-
if (
|
|
2266
|
-
const P =
|
|
2264
|
+
if (g.length >= Kr) break;
|
|
2265
|
+
if (dt(b) || !Dt(b) || !ut(b)) continue;
|
|
2266
|
+
const P = gn(b), B = b instanceof HTMLInputElement ? b.type : b.tagName.toLowerCase();
|
|
2267
2267
|
P && g.push({ label: ie(P, 100), type: B });
|
|
2268
2268
|
}
|
|
2269
2269
|
const h = Array.from(r.querySelectorAll("form")), L = [];
|
|
2270
2270
|
let A = 0;
|
|
2271
2271
|
for (const b of h) {
|
|
2272
|
-
if (L.length >=
|
|
2273
|
-
if (
|
|
2274
|
-
const P = b.getAttribute("id") || b.getAttribute("name") ||
|
|
2272
|
+
if (L.length >= Xr) break;
|
|
2273
|
+
if (zt(b) || b.matches(".ll-widget *, .ll-widget")) continue;
|
|
2274
|
+
const P = b.getAttribute("id") || b.getAttribute("name") || to(b.getAttribute("data-ll-intent")) || `form_${A++}`, B = b.getAttribute("data-ll-intent") || no(b) || void 0, q = Array.from(
|
|
2275
2275
|
b.querySelectorAll(
|
|
2276
2276
|
"input, textarea, select"
|
|
2277
2277
|
)
|
|
2278
|
-
),
|
|
2278
|
+
), re = [];
|
|
2279
2279
|
let F = 0;
|
|
2280
2280
|
const j = /* @__PURE__ */ new Set();
|
|
2281
2281
|
for (const S of q) {
|
|
2282
|
-
if (
|
|
2283
|
-
if (!
|
|
2282
|
+
if (re.length >= Zr) break;
|
|
2283
|
+
if (!Dt(S)) continue;
|
|
2284
2284
|
if (S instanceof HTMLInputElement) {
|
|
2285
2285
|
const H = S.type;
|
|
2286
2286
|
if (H === "submit" || H === "button" || H === "reset" || H === "hidden" || H === "image" || H === "file") continue;
|
|
2287
2287
|
}
|
|
2288
|
-
const
|
|
2289
|
-
let
|
|
2290
|
-
j.has(
|
|
2291
|
-
const He =
|
|
2292
|
-
name:
|
|
2288
|
+
const ee = S.getAttribute("name") || "", xe = S.getAttribute("id") || "";
|
|
2289
|
+
let de = ee || xe || `field_${F}`;
|
|
2290
|
+
j.has(de) && (de = `${de}__${F}`), j.add(de), F++;
|
|
2291
|
+
const He = gn(S) || de, Oe = S instanceof HTMLInputElement ? S.type : S.tagName.toLowerCase(), Z = {
|
|
2292
|
+
name: de,
|
|
2293
2293
|
label: ie(He, 100),
|
|
2294
2294
|
type: Oe
|
|
2295
2295
|
};
|
|
2296
|
-
S.required === !0 && (
|
|
2297
|
-
const
|
|
2298
|
-
if (
|
|
2296
|
+
S.required === !0 && (Z.required = !0);
|
|
2297
|
+
const Ee = S.getAttribute("placeholder");
|
|
2298
|
+
if (Ee && (Z.placeholder = ie(Ee.trim(), 100)), S instanceof HTMLInputElement || S instanceof HTMLTextAreaElement) {
|
|
2299
2299
|
const H = S.getAttribute("minlength");
|
|
2300
2300
|
if (H !== null) {
|
|
2301
2301
|
const Y = parseInt(H, 10);
|
|
2302
|
-
!Number.isNaN(Y) && Y >= 0 && (
|
|
2302
|
+
!Number.isNaN(Y) && Y >= 0 && (Z.minLength = Y);
|
|
2303
2303
|
}
|
|
2304
2304
|
const le = S.getAttribute("maxlength");
|
|
2305
2305
|
if (le !== null) {
|
|
2306
2306
|
const Y = parseInt(le, 10);
|
|
2307
|
-
!Number.isNaN(Y) && Y >= 0 && (
|
|
2307
|
+
!Number.isNaN(Y) && Y >= 0 && (Z.maxLength = Y);
|
|
2308
2308
|
}
|
|
2309
2309
|
}
|
|
2310
2310
|
if (S instanceof HTMLInputElement) {
|
|
2311
2311
|
const H = S.getAttribute("min");
|
|
2312
|
-
H !== null && (
|
|
2312
|
+
H !== null && (Z.min = ie(H, 50));
|
|
2313
2313
|
const le = S.getAttribute("max");
|
|
2314
|
-
le !== null && (
|
|
2314
|
+
le !== null && (Z.max = ie(le, 50));
|
|
2315
2315
|
const Y = S.getAttribute("step");
|
|
2316
|
-
Y !== null && (
|
|
2316
|
+
Y !== null && (Z.step = ie(Y, 20));
|
|
2317
2317
|
const pe = S.getAttribute("pattern");
|
|
2318
|
-
pe !== null && (
|
|
2318
|
+
pe !== null && (Z.pattern = ie(pe, 200));
|
|
2319
2319
|
const K = (S.getAttribute("autocomplete") || "").toLowerCase();
|
|
2320
|
-
K && K !== "off" && !K.startsWith("cc-") && (
|
|
2320
|
+
K && K !== "off" && !K.startsWith("cc-") && (Z.autocomplete = ie(K, 50));
|
|
2321
2321
|
}
|
|
2322
2322
|
if (S instanceof HTMLSelectElement) {
|
|
2323
2323
|
const H = [];
|
|
2324
|
-
for (let le = 0; le < S.options.length && !(H.length >=
|
|
2324
|
+
for (let le = 0; le < S.options.length && !(H.length >= Qr); le++) {
|
|
2325
2325
|
const Y = S.options[le];
|
|
2326
2326
|
if (!Y || Y.disabled) continue;
|
|
2327
2327
|
const pe = Y.value || "", K = (Y.textContent || "").trim() || pe;
|
|
2328
2328
|
!pe && !K || H.push({ value: pe, label: ie(K, 60) });
|
|
2329
2329
|
}
|
|
2330
|
-
H.length > 0 && (
|
|
2330
|
+
H.length > 0 && (Z.options = H);
|
|
2331
2331
|
}
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2332
|
+
const Le = typeof S.validationMessage == "string" ? S.validationMessage : "";
|
|
2333
|
+
Le && (Z.validationMessage = ie(Le, 200)), re.push(Z);
|
|
2334
2334
|
}
|
|
2335
|
-
L.push({ id: P, intent: B, fields:
|
|
2335
|
+
L.push({ id: P, intent: B, fields: re });
|
|
2336
2336
|
}
|
|
2337
2337
|
const I = {
|
|
2338
2338
|
url: o,
|
|
@@ -2353,18 +2353,18 @@ function oo(e, t = {}) {
|
|
|
2353
2353
|
return Je(I.visibleText) > wt && (I.visibleText = ie(I.visibleText, wt - 100)), I;
|
|
2354
2354
|
}
|
|
2355
2355
|
let Xe = null;
|
|
2356
|
-
function
|
|
2356
|
+
function yn(e, t = {}) {
|
|
2357
2357
|
const r = Date.now(), a = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
2358
2358
|
if (Xe && Xe.key === a && r - Xe.at < 1e3)
|
|
2359
2359
|
return Xe.ctx;
|
|
2360
|
-
const i =
|
|
2360
|
+
const i = ro(e, t);
|
|
2361
2361
|
return Xe = { key: a, at: r, ctx: i }, i;
|
|
2362
2362
|
}
|
|
2363
|
-
function
|
|
2363
|
+
function oo() {
|
|
2364
2364
|
Xe = null;
|
|
2365
2365
|
}
|
|
2366
|
-
const
|
|
2367
|
-
function
|
|
2366
|
+
const io = 200;
|
|
2367
|
+
function lo(e) {
|
|
2368
2368
|
const t = String(e.href || "");
|
|
2369
2369
|
return {
|
|
2370
2370
|
href: t,
|
|
@@ -2374,18 +2374,18 @@ function ao(e) {
|
|
|
2374
2374
|
description: e.description
|
|
2375
2375
|
};
|
|
2376
2376
|
}
|
|
2377
|
-
function
|
|
2377
|
+
function ao(e) {
|
|
2378
2378
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2379
2379
|
}
|
|
2380
|
-
function
|
|
2380
|
+
function so(e) {
|
|
2381
2381
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2382
2382
|
if (!t) return [];
|
|
2383
2383
|
const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), a = [], i = Array.from(t.querySelectorAll("a[href]"));
|
|
2384
2384
|
for (const s of i) {
|
|
2385
|
-
if (a.length >=
|
|
2386
|
-
if (
|
|
2385
|
+
if (a.length >= io) break;
|
|
2386
|
+
if (zt(s)) continue;
|
|
2387
2387
|
const l = s.getAttribute("href") || "";
|
|
2388
|
-
if (!
|
|
2388
|
+
if (!ao(l)) continue;
|
|
2389
2389
|
let c = l, p = !0;
|
|
2390
2390
|
try {
|
|
2391
2391
|
if (typeof window < "u") {
|
|
@@ -2403,18 +2403,18 @@ function co(e) {
|
|
|
2403
2403
|
return a;
|
|
2404
2404
|
}
|
|
2405
2405
|
let Ze = null;
|
|
2406
|
-
const
|
|
2407
|
-
function
|
|
2406
|
+
const co = 5e3;
|
|
2407
|
+
function Rt() {
|
|
2408
2408
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2409
|
-
if (Ze && Ze.pathname === t && e - Ze.at <
|
|
2409
|
+
if (Ze && Ze.pathname === t && e - Ze.at < co)
|
|
2410
2410
|
return Ze.routes;
|
|
2411
|
-
const r =
|
|
2411
|
+
const r = so();
|
|
2412
2412
|
return Ze = { at: e, pathname: t, routes: r }, r;
|
|
2413
2413
|
}
|
|
2414
|
-
function
|
|
2414
|
+
function uo() {
|
|
2415
2415
|
Ze = null;
|
|
2416
2416
|
}
|
|
2417
|
-
function
|
|
2417
|
+
function vn(e) {
|
|
2418
2418
|
if (e instanceof HTMLInputElement) {
|
|
2419
2419
|
const t = e.type;
|
|
2420
2420
|
if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
|
|
@@ -2422,16 +2422,16 @@ function bn(e) {
|
|
|
2422
2422
|
}
|
|
2423
2423
|
return !0;
|
|
2424
2424
|
}
|
|
2425
|
-
function
|
|
2425
|
+
function fo(e, t) {
|
|
2426
2426
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2427
2427
|
}
|
|
2428
|
-
function
|
|
2428
|
+
function po(e, t) {
|
|
2429
2429
|
if (!t) return null;
|
|
2430
2430
|
try {
|
|
2431
2431
|
const i = e.querySelector(
|
|
2432
2432
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2433
2433
|
);
|
|
2434
|
-
if (i &&
|
|
2434
|
+
if (i && vn(i)) return i;
|
|
2435
2435
|
} catch {
|
|
2436
2436
|
}
|
|
2437
2437
|
const r = Array.from(
|
|
@@ -2440,23 +2440,23 @@ function ho(e, t) {
|
|
|
2440
2440
|
let o = 0;
|
|
2441
2441
|
const a = /* @__PURE__ */ new Map();
|
|
2442
2442
|
for (const i of r) {
|
|
2443
|
-
if (!
|
|
2444
|
-
const s =
|
|
2443
|
+
if (!vn(i)) continue;
|
|
2444
|
+
const s = fo(i, o);
|
|
2445
2445
|
let l = s;
|
|
2446
2446
|
if (a.has(s) && (l = `${s}__${o}`), l === t) return i;
|
|
2447
2447
|
a.set(s, i), o++;
|
|
2448
2448
|
}
|
|
2449
2449
|
return null;
|
|
2450
2450
|
}
|
|
2451
|
-
function
|
|
2452
|
-
const r =
|
|
2453
|
-
return r ?
|
|
2451
|
+
function bn(e, t) {
|
|
2452
|
+
const r = po(e, t);
|
|
2453
|
+
return r ? Dt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function ho(e, t) {
|
|
2456
2456
|
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, o = Object.getOwnPropertyDescriptor(r, "value"), a = o == null ? void 0 : o.set;
|
|
2457
2457
|
a ? a.call(e, t) : e.value = t;
|
|
2458
2458
|
}
|
|
2459
|
-
function
|
|
2459
|
+
function mo(e, t, r = {}) {
|
|
2460
2460
|
const o = r.triggerInput ?? !0, a = r.triggerChange ?? !0;
|
|
2461
2461
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2462
2462
|
const i = Object.getOwnPropertyDescriptor(
|
|
@@ -2466,9 +2466,9 @@ function go(e, t, r = {}) {
|
|
|
2466
2466
|
s ? s.call(e, l) : e.checked = l, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2467
2467
|
return;
|
|
2468
2468
|
}
|
|
2469
|
-
|
|
2469
|
+
ho(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2471
|
+
function wn(e, t) {
|
|
2472
2472
|
if (!t) return null;
|
|
2473
2473
|
const r = t.replace(/"/g, '\\"');
|
|
2474
2474
|
try {
|
|
@@ -2489,7 +2489,7 @@ function _n(e, t) {
|
|
|
2489
2489
|
const i = Array.from(e.querySelectorAll("form"));
|
|
2490
2490
|
for (const s of i) {
|
|
2491
2491
|
const l = s.getAttribute("data-ll-intent");
|
|
2492
|
-
if (l &&
|
|
2492
|
+
if (l && go(l) === t) return s;
|
|
2493
2493
|
}
|
|
2494
2494
|
if (/^form_\d+$/.test(t)) {
|
|
2495
2495
|
const s = parseInt(t.slice(5), 10);
|
|
@@ -2502,10 +2502,10 @@ function _n(e, t) {
|
|
|
2502
2502
|
}
|
|
2503
2503
|
return null;
|
|
2504
2504
|
}
|
|
2505
|
-
function
|
|
2505
|
+
function go(e) {
|
|
2506
2506
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2507
2507
|
}
|
|
2508
|
-
function
|
|
2508
|
+
function yo() {
|
|
2509
2509
|
if (typeof window > "u" || typeof document > "u")
|
|
2510
2510
|
return !1;
|
|
2511
2511
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2513,19 +2513,19 @@ function vo() {
|
|
|
2513
2513
|
const t = window.getComputedStyle(e);
|
|
2514
2514
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2515
2515
|
}
|
|
2516
|
-
function
|
|
2516
|
+
function vo(e) {
|
|
2517
2517
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2518
2518
|
const r = window.getComputedStyle(e).overflowY;
|
|
2519
2519
|
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2520
2520
|
}
|
|
2521
|
-
function
|
|
2521
|
+
function bo() {
|
|
2522
2522
|
if (typeof document > "u") return null;
|
|
2523
2523
|
const e = Array.from(
|
|
2524
2524
|
document.querySelectorAll("body, body *")
|
|
2525
2525
|
);
|
|
2526
2526
|
let t = null, r = 0;
|
|
2527
2527
|
for (const o of e) {
|
|
2528
|
-
if (!
|
|
2528
|
+
if (!vo(o)) continue;
|
|
2529
2529
|
const a = o.getBoundingClientRect();
|
|
2530
2530
|
if (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth || a.width <= 0 || a.height <= 0 || o.closest(".ll-widget")) continue;
|
|
2531
2531
|
const i = a.width * a.height;
|
|
@@ -2533,24 +2533,24 @@ function wo() {
|
|
|
2533
2533
|
}
|
|
2534
2534
|
return t;
|
|
2535
2535
|
}
|
|
2536
|
-
function
|
|
2536
|
+
function wo() {
|
|
2537
2537
|
if (typeof window > "u")
|
|
2538
2538
|
return null;
|
|
2539
|
-
if (
|
|
2540
|
-
const e =
|
|
2539
|
+
if (yo()) return window;
|
|
2540
|
+
const e = bo();
|
|
2541
2541
|
return e || window;
|
|
2542
2542
|
}
|
|
2543
|
-
function
|
|
2543
|
+
function _n(e) {
|
|
2544
2544
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2545
2545
|
}
|
|
2546
|
-
function
|
|
2546
|
+
function _o(e) {
|
|
2547
2547
|
var t, r;
|
|
2548
2548
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2549
2549
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2550
2550
|
((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
|
|
2551
2551
|
) : e.scrollHeight - e.clientHeight;
|
|
2552
2552
|
}
|
|
2553
|
-
const
|
|
2553
|
+
const xo = /* @__PURE__ */ new Set([
|
|
2554
2554
|
"agent_state",
|
|
2555
2555
|
"avatar_stream_ready",
|
|
2556
2556
|
"avatar_active",
|
|
@@ -2580,9 +2580,9 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2580
2580
|
// to onAgentCommand.
|
|
2581
2581
|
"task_field_updated",
|
|
2582
2582
|
"task_completed"
|
|
2583
|
-
]),
|
|
2583
|
+
]), Mn = Pt(
|
|
2584
2584
|
function(t, r) {
|
|
2585
|
-
var Kt, Jt, Xt, Zt, Qt, en
|
|
2585
|
+
var Gt, Kt, Jt, Xt, Zt, Qt, en;
|
|
2586
2586
|
const {
|
|
2587
2587
|
agentId: o,
|
|
2588
2588
|
apiKey: a,
|
|
@@ -2614,18 +2614,18 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2614
2614
|
avatarImageUrl: P,
|
|
2615
2615
|
agentName: B,
|
|
2616
2616
|
branding: q = {},
|
|
2617
|
-
allowCamera:
|
|
2617
|
+
allowCamera: re = !0,
|
|
2618
2618
|
allowScreenShare: F = !0,
|
|
2619
2619
|
allowTyping: j = !0,
|
|
2620
2620
|
showMinimize: S,
|
|
2621
|
-
showClose:
|
|
2622
|
-
chromeless:
|
|
2623
|
-
floatingChromeContainer:
|
|
2621
|
+
showClose: ee,
|
|
2622
|
+
chromeless: xe = !1,
|
|
2623
|
+
floatingChromeContainer: de = null,
|
|
2624
2624
|
compactControls: He = !1,
|
|
2625
2625
|
transforming: Oe = !1,
|
|
2626
|
-
transformingLabel:
|
|
2627
|
-
showOn:
|
|
2628
|
-
hideOn:
|
|
2626
|
+
transformingLabel: Z = "Transforming…",
|
|
2627
|
+
showOn: Ee,
|
|
2628
|
+
hideOn: Le,
|
|
2629
2629
|
pathname: H,
|
|
2630
2630
|
onNavigate: le,
|
|
2631
2631
|
onScrollToSelector: Y,
|
|
@@ -2633,58 +2633,58 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2633
2633
|
pageContextExtras: K,
|
|
2634
2634
|
getRoutes: et,
|
|
2635
2635
|
onScrollPage: tt,
|
|
2636
|
-
onClick:
|
|
2636
|
+
onClick: ft,
|
|
2637
2637
|
capabilities: nt,
|
|
2638
|
-
onConnect:
|
|
2638
|
+
onConnect: Se,
|
|
2639
2639
|
onDisconnect: Be,
|
|
2640
|
-
onTranscript:
|
|
2640
|
+
onTranscript: Ne,
|
|
2641
2641
|
onAgentState: Fe,
|
|
2642
|
-
onConnectionStateChange:
|
|
2643
|
-
onAgentEvent:
|
|
2644
|
-
onAgentCommand:
|
|
2645
|
-
onCollect:
|
|
2642
|
+
onConnectionStateChange: Ae,
|
|
2643
|
+
onAgentEvent: Ie,
|
|
2644
|
+
onAgentCommand: Me,
|
|
2645
|
+
onCollect: Re,
|
|
2646
2646
|
controlledSession: $,
|
|
2647
2647
|
className: xt,
|
|
2648
|
-
style:
|
|
2648
|
+
style: Te,
|
|
2649
2649
|
zIndex: We = 2147483647
|
|
2650
|
-
} = t, he =
|
|
2650
|
+
} = t, he = br(H), rt = Er(he, Ee, Le);
|
|
2651
2651
|
T(() => {
|
|
2652
|
-
|
|
2652
|
+
oo(), uo();
|
|
2653
2653
|
}, [he]);
|
|
2654
|
-
const
|
|
2654
|
+
const De = A !== void 0, [qe, Lt] = N(() => {
|
|
2655
2655
|
var v;
|
|
2656
2656
|
return A ?? ((v = L == null ? void 0 : L[0]) == null ? void 0 : v.id);
|
|
2657
|
-
}), Ce =
|
|
2657
|
+
}), Ce = De ? A : qe, ae = Qe(
|
|
2658
2658
|
() => (L == null ? void 0 : L.find((v) => v.id === Ce)) ?? null,
|
|
2659
2659
|
[L, Ce]
|
|
2660
|
-
), ot = (ae == null ? void 0 : ae.agentId) ?? o,
|
|
2660
|
+
), ot = (ae == null ? void 0 : ae.agentId) ?? o, ue = p === "EMBEDDED", fe = yr(g), [Ue, je] = mr({
|
|
2661
2661
|
value: m,
|
|
2662
2662
|
defaultValue: f,
|
|
2663
2663
|
onChange: R,
|
|
2664
2664
|
persistKey: u,
|
|
2665
|
-
disablePersistence:
|
|
2666
|
-
}), se =
|
|
2667
|
-
} : je,
|
|
2665
|
+
disablePersistence: ue || h
|
|
2666
|
+
}), se = ue ? "expanded" : Ue, me = ue ? () => {
|
|
2667
|
+
} : je, pt = S ?? !ue, ht = ee ?? !ue, kt = He || !ue && fe, Pe = nr(), Q = or(), ge = lr(), $e = ar(), Ve = sr(), [Ct, ye] = N(!1), [ve, it] = N(!1), [Ye, lt] = N(!1), [mt, y] = N(!1), [J, Rn] = N(!1), gt = Nr({ baseUrl: i, config: c }), yt = M(gt);
|
|
2668
2668
|
yt.current = gt;
|
|
2669
|
-
const
|
|
2670
|
-
|
|
2671
|
-
function
|
|
2672
|
-
const d =
|
|
2669
|
+
const Et = M(le), St = M(Y), Nt = M(tt), At = M(ft), Ht = M(pe), Ot = M(K), Bt = M(et), It = M(nt), be = M(null);
|
|
2670
|
+
Et.current = le, St.current = Y, Nt.current = tt, At.current = ft, Ht.current = pe, Ot.current = K, Bt.current = et, It.current = nt;
|
|
2671
|
+
function we(v) {
|
|
2672
|
+
const d = It.current;
|
|
2673
2673
|
return d ? d.includes(v) : !0;
|
|
2674
2674
|
}
|
|
2675
|
-
function
|
|
2675
|
+
function _e(v, d) {
|
|
2676
2676
|
console.warn(
|
|
2677
2677
|
`[LiveLayer] Agent command "${v}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2678
2678
|
);
|
|
2679
2679
|
}
|
|
2680
|
-
const
|
|
2680
|
+
const at = E(
|
|
2681
2681
|
(v) => {
|
|
2682
|
-
var
|
|
2682
|
+
var X, oe, ke, ct;
|
|
2683
2683
|
const d = v;
|
|
2684
2684
|
if (!(!d.type || typeof d.type != "string")) {
|
|
2685
|
-
if (
|
|
2686
|
-
if (!
|
|
2687
|
-
|
|
2685
|
+
if (Ie == null || Ie({ eventName: d.type, data: v }), d.type === "navigate") {
|
|
2686
|
+
if (!we("navigate")) {
|
|
2687
|
+
_e("navigate", "navigate");
|
|
2688
2688
|
return;
|
|
2689
2689
|
}
|
|
2690
2690
|
const k = typeof d.href == "string" ? d.href : null;
|
|
@@ -2694,9 +2694,9 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2694
2694
|
);
|
|
2695
2695
|
return;
|
|
2696
2696
|
}
|
|
2697
|
-
if (yt.current.playPageChange(),
|
|
2697
|
+
if (yt.current.playPageChange(), Et.current) {
|
|
2698
2698
|
try {
|
|
2699
|
-
|
|
2699
|
+
Et.current(k);
|
|
2700
2700
|
} catch (D) {
|
|
2701
2701
|
console.warn(
|
|
2702
2702
|
`[LiveLayer] onNavigate threw for "${k}". Falling back. Error:`,
|
|
@@ -2726,16 +2726,16 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2726
2726
|
return;
|
|
2727
2727
|
}
|
|
2728
2728
|
if (d.type === "scroll_to") {
|
|
2729
|
-
if (!
|
|
2730
|
-
|
|
2729
|
+
if (!we("scroll")) {
|
|
2730
|
+
_e("scroll_to", "scroll");
|
|
2731
2731
|
return;
|
|
2732
2732
|
}
|
|
2733
2733
|
const k = typeof d.selector == "string" ? d.selector : null;
|
|
2734
2734
|
if (!k) return;
|
|
2735
2735
|
const D = d.behavior === "instant" ? "instant" : "smooth";
|
|
2736
|
-
if (
|
|
2736
|
+
if (St.current) {
|
|
2737
2737
|
try {
|
|
2738
|
-
|
|
2738
|
+
St.current(
|
|
2739
2739
|
k,
|
|
2740
2740
|
D
|
|
2741
2741
|
);
|
|
@@ -2768,20 +2768,20 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2768
2768
|
return;
|
|
2769
2769
|
}
|
|
2770
2770
|
if (d.type === "request_page_context") {
|
|
2771
|
-
if (!
|
|
2772
|
-
|
|
2771
|
+
if (!we("read_page")) {
|
|
2772
|
+
_e("request_page_context", "read_page");
|
|
2773
2773
|
return;
|
|
2774
2774
|
}
|
|
2775
|
-
const k = typeof d.requestId == "string" ? d.requestId : void 0, D = (
|
|
2776
|
-
const z = D,
|
|
2777
|
-
if (
|
|
2775
|
+
const k = typeof d.requestId == "string" ? d.requestId : void 0, D = (X = be.current) == null ? void 0 : X.call(be), W = (G) => {
|
|
2776
|
+
const z = D, ne = z == null ? void 0 : z.localParticipant;
|
|
2777
|
+
if (ne != null && ne.publishData)
|
|
2778
2778
|
try {
|
|
2779
2779
|
const ce = k ? { ...G, requestId: k } : G, Ke = new TextEncoder().encode(JSON.stringify(ce));
|
|
2780
|
-
|
|
2780
|
+
ne.publishData(Ke, { reliable: !0 });
|
|
2781
2781
|
} catch (ce) {
|
|
2782
2782
|
console.warn("[LiveLayer] publishData failed.", ce);
|
|
2783
2783
|
}
|
|
2784
|
-
}, O =
|
|
2784
|
+
}, O = Ot.current, V = Ht.current;
|
|
2785
2785
|
try {
|
|
2786
2786
|
if (V) {
|
|
2787
2787
|
const G = V(O);
|
|
@@ -2792,7 +2792,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2792
2792
|
z
|
|
2793
2793
|
), W({
|
|
2794
2794
|
type: "page_context",
|
|
2795
|
-
context:
|
|
2795
|
+
context: yn(O)
|
|
2796
2796
|
});
|
|
2797
2797
|
});
|
|
2798
2798
|
return;
|
|
@@ -2802,7 +2802,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2802
2802
|
}
|
|
2803
2803
|
W({
|
|
2804
2804
|
type: "page_context",
|
|
2805
|
-
context:
|
|
2805
|
+
context: yn(O)
|
|
2806
2806
|
});
|
|
2807
2807
|
} catch (G) {
|
|
2808
2808
|
console.warn(
|
|
@@ -2816,8 +2816,8 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2816
2816
|
return;
|
|
2817
2817
|
}
|
|
2818
2818
|
if (d.type === "scroll_page") {
|
|
2819
|
-
if (!
|
|
2820
|
-
|
|
2819
|
+
if (!we("scroll")) {
|
|
2820
|
+
_e("scroll_page", "scroll");
|
|
2821
2821
|
return;
|
|
2822
2822
|
}
|
|
2823
2823
|
const k = d.direction;
|
|
@@ -2828,9 +2828,9 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2828
2828
|
return;
|
|
2829
2829
|
}
|
|
2830
2830
|
const D = d.behavior === "instant" ? "instant" : "smooth";
|
|
2831
|
-
if (
|
|
2831
|
+
if (Nt.current) {
|
|
2832
2832
|
try {
|
|
2833
|
-
|
|
2833
|
+
Nt.current(
|
|
2834
2834
|
k,
|
|
2835
2835
|
D
|
|
2836
2836
|
);
|
|
@@ -2840,17 +2840,17 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2840
2840
|
return;
|
|
2841
2841
|
}
|
|
2842
2842
|
if (typeof window > "u") return;
|
|
2843
|
-
const W = { behavior: D }, O =
|
|
2843
|
+
const W = { behavior: D }, O = wo(), V = (z) => {
|
|
2844
2844
|
O instanceof Window ? O.scrollBy({ top: z, ...W }) : O.scrollBy({ top: z, ...W });
|
|
2845
2845
|
}, G = (z) => {
|
|
2846
2846
|
O instanceof Window ? O.scrollTo({ top: z, ...W }) : O.scrollTo({ top: z, ...W });
|
|
2847
2847
|
};
|
|
2848
|
-
k === "up" ? V(-
|
|
2848
|
+
k === "up" ? V(-_n(O)) : k === "down" ? V(_n(O)) : G(k === "top" ? 0 : _o(O));
|
|
2849
2849
|
return;
|
|
2850
2850
|
}
|
|
2851
2851
|
if (d.type === "click") {
|
|
2852
|
-
if (!
|
|
2853
|
-
|
|
2852
|
+
if (!we("click")) {
|
|
2853
|
+
_e("click", "click");
|
|
2854
2854
|
return;
|
|
2855
2855
|
}
|
|
2856
2856
|
const k = typeof d.selector == "string" ? d.selector : null;
|
|
@@ -2858,9 +2858,9 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2858
2858
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2859
2859
|
return;
|
|
2860
2860
|
}
|
|
2861
|
-
if (
|
|
2861
|
+
if (At.current) {
|
|
2862
2862
|
try {
|
|
2863
|
-
|
|
2863
|
+
At.current(k);
|
|
2864
2864
|
} catch (W) {
|
|
2865
2865
|
console.warn("[LiveLayer] onClick threw.", W);
|
|
2866
2866
|
}
|
|
@@ -2892,8 +2892,8 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2892
2892
|
return;
|
|
2893
2893
|
}
|
|
2894
2894
|
if (d.type === "fill_form" || d.type === "focus_field") {
|
|
2895
|
-
if (!
|
|
2896
|
-
|
|
2895
|
+
if (!we("fill_forms")) {
|
|
2896
|
+
_e(d.type, "fill_forms");
|
|
2897
2897
|
return;
|
|
2898
2898
|
}
|
|
2899
2899
|
if (typeof document > "u") return;
|
|
@@ -2903,7 +2903,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2903
2903
|
console.warn(`[LiveLayer] ${d.type}: missing formId.`);
|
|
2904
2904
|
return;
|
|
2905
2905
|
}
|
|
2906
|
-
const D =
|
|
2906
|
+
const D = wn(document, k);
|
|
2907
2907
|
if (!D) {
|
|
2908
2908
|
console.warn(
|
|
2909
2909
|
`[LiveLayer] ${d.type}: no <form> matched id="${k}" (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.`
|
|
@@ -2922,7 +2922,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2922
2922
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2923
2923
|
return;
|
|
2924
2924
|
}
|
|
2925
|
-
const V =
|
|
2925
|
+
const V = bn(D, O);
|
|
2926
2926
|
if (V.el === null) {
|
|
2927
2927
|
V.reason === "private" ? console.warn(
|
|
2928
2928
|
`[LiveLayer] focus_field: field "${O}" is privacy-protected and not focusable.`
|
|
@@ -2941,7 +2941,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2941
2941
|
}
|
|
2942
2942
|
for (const [O, V] of Object.entries(W)) {
|
|
2943
2943
|
if (typeof V != "string") continue;
|
|
2944
|
-
const G =
|
|
2944
|
+
const G = bn(D, O);
|
|
2945
2945
|
if (G.el === null) {
|
|
2946
2946
|
G.reason === "private" ? console.warn(
|
|
2947
2947
|
`[LiveLayer] fill_form: field "${O}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
@@ -2951,7 +2951,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2951
2951
|
continue;
|
|
2952
2952
|
}
|
|
2953
2953
|
try {
|
|
2954
|
-
|
|
2954
|
+
mo(G.el, V);
|
|
2955
2955
|
} catch (z) {
|
|
2956
2956
|
console.warn(
|
|
2957
2957
|
`[LiveLayer] fill_form: failed to set "${O}".`,
|
|
@@ -2962,8 +2962,8 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2962
2962
|
return;
|
|
2963
2963
|
}
|
|
2964
2964
|
if (d.type === "submit_form") {
|
|
2965
|
-
if (!
|
|
2966
|
-
|
|
2965
|
+
if (!we("submit_forms")) {
|
|
2966
|
+
_e("submit_form", "submit_forms");
|
|
2967
2967
|
return;
|
|
2968
2968
|
}
|
|
2969
2969
|
if (typeof document > "u") return;
|
|
@@ -2973,7 +2973,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2973
2973
|
return;
|
|
2974
2974
|
}
|
|
2975
2975
|
yt.current.playConfirmation();
|
|
2976
|
-
const D =
|
|
2976
|
+
const D = wn(document, k);
|
|
2977
2977
|
if (!D) {
|
|
2978
2978
|
console.warn(
|
|
2979
2979
|
`[LiveLayer] submit_form: no <form> matched id="${k}" (or matching name / data-ll-intent slug).`
|
|
@@ -2986,12 +2986,12 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
2986
2986
|
);
|
|
2987
2987
|
return;
|
|
2988
2988
|
}
|
|
2989
|
-
const W = typeof d.requestId == "string" ? d.requestId : void 0, O = (ke =
|
|
2989
|
+
const W = typeof d.requestId == "string" ? d.requestId : void 0, O = (ke = be.current) == null ? void 0 : ke.call(be), V = (ne) => {
|
|
2990
2990
|
const ce = O, Ke = ce == null ? void 0 : ce.localParticipant;
|
|
2991
2991
|
if (Ke != null && Ke.publishData)
|
|
2992
2992
|
try {
|
|
2993
|
-
const
|
|
2994
|
-
Ke.publishData(
|
|
2993
|
+
const jn = W ? { ...ne, requestId: W } : ne, Vn = new TextEncoder().encode(JSON.stringify(jn));
|
|
2994
|
+
Ke.publishData(Vn, { reliable: !0 });
|
|
2995
2995
|
} catch {
|
|
2996
2996
|
}
|
|
2997
2997
|
};
|
|
@@ -3002,8 +3002,8 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3002
3002
|
D.addEventListener("submit", z, { once: !0 });
|
|
3003
3003
|
try {
|
|
3004
3004
|
typeof D.requestSubmit == "function" ? D.requestSubmit() : D.submit();
|
|
3005
|
-
} catch (
|
|
3006
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.",
|
|
3005
|
+
} catch (ne) {
|
|
3006
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", ne), D.removeEventListener("submit", z), V({
|
|
3007
3007
|
type: "form_submit_blocked",
|
|
3008
3008
|
formId: k,
|
|
3009
3009
|
reason: "exception"
|
|
@@ -3020,53 +3020,53 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3020
3020
|
return;
|
|
3021
3021
|
}
|
|
3022
3022
|
if (d.type === "request_routes") {
|
|
3023
|
-
if (!
|
|
3024
|
-
|
|
3023
|
+
if (!we("read_page")) {
|
|
3024
|
+
_e("request_routes", "read_page");
|
|
3025
3025
|
return;
|
|
3026
3026
|
}
|
|
3027
|
-
const k = typeof d.requestId == "string" ? d.requestId : void 0, W = (
|
|
3027
|
+
const k = typeof d.requestId == "string" ? d.requestId : void 0, W = (ct = be.current) == null ? void 0 : ct.call(be), O = W == null ? void 0 : W.localParticipant;
|
|
3028
3028
|
if (!(O != null && O.publishData)) return;
|
|
3029
3029
|
const V = (z) => {
|
|
3030
3030
|
try {
|
|
3031
|
-
const
|
|
3031
|
+
const ne = k ? { type: "routes", routes: z, requestId: k } : { type: "routes", routes: z }, ce = new TextEncoder().encode(JSON.stringify(ne));
|
|
3032
3032
|
O.publishData(ce, { reliable: !0 });
|
|
3033
|
-
} catch (
|
|
3034
|
-
console.warn("[LiveLayer] request_routes: publishData failed.",
|
|
3033
|
+
} catch (ne) {
|
|
3034
|
+
console.warn("[LiveLayer] request_routes: publishData failed.", ne);
|
|
3035
3035
|
}
|
|
3036
|
-
}, G =
|
|
3036
|
+
}, G = Bt.current;
|
|
3037
3037
|
if (G) {
|
|
3038
3038
|
try {
|
|
3039
|
-
const z = G(),
|
|
3039
|
+
const z = G(), ne = (ce) => {
|
|
3040
3040
|
if (!Array.isArray(ce)) {
|
|
3041
3041
|
V([]);
|
|
3042
3042
|
return;
|
|
3043
3043
|
}
|
|
3044
|
-
V(ce.map(
|
|
3044
|
+
V(ce.map(lo).slice(0, 200));
|
|
3045
3045
|
};
|
|
3046
|
-
z instanceof Promise ? z.then(
|
|
3046
|
+
z instanceof Promise ? z.then(ne).catch((ce) => {
|
|
3047
3047
|
console.warn(
|
|
3048
3048
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
3049
3049
|
ce
|
|
3050
|
-
), V(
|
|
3051
|
-
}) :
|
|
3050
|
+
), V(Rt());
|
|
3051
|
+
}) : ne(z);
|
|
3052
3052
|
} catch (z) {
|
|
3053
3053
|
console.warn(
|
|
3054
3054
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
3055
3055
|
z
|
|
3056
|
-
), V(
|
|
3056
|
+
), V(Rt());
|
|
3057
3057
|
}
|
|
3058
3058
|
return;
|
|
3059
3059
|
}
|
|
3060
3060
|
try {
|
|
3061
|
-
V(
|
|
3061
|
+
V(Rt());
|
|
3062
3062
|
} catch (z) {
|
|
3063
3063
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", z);
|
|
3064
3064
|
}
|
|
3065
3065
|
return;
|
|
3066
3066
|
}
|
|
3067
3067
|
if (d.type === "task_field_updated") {
|
|
3068
|
-
if (!
|
|
3069
|
-
|
|
3068
|
+
if (!we("collect_data")) {
|
|
3069
|
+
_e("task_field_updated", "collect_data");
|
|
3070
3070
|
return;
|
|
3071
3071
|
}
|
|
3072
3072
|
const k = {
|
|
@@ -3089,8 +3089,8 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3089
3089
|
return;
|
|
3090
3090
|
}
|
|
3091
3091
|
if (d.type === "task_completed") {
|
|
3092
|
-
if (!
|
|
3093
|
-
|
|
3092
|
+
if (!we("collect_data")) {
|
|
3093
|
+
_e("task_completed", "collect_data");
|
|
3094
3094
|
return;
|
|
3095
3095
|
}
|
|
3096
3096
|
const k = d.result;
|
|
@@ -3110,7 +3110,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3110
3110
|
} catch {
|
|
3111
3111
|
}
|
|
3112
3112
|
try {
|
|
3113
|
-
|
|
3113
|
+
Re == null || Re(
|
|
3114
3114
|
k
|
|
3115
3115
|
);
|
|
3116
3116
|
} catch (D) {
|
|
@@ -3118,39 +3118,39 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3118
3118
|
}
|
|
3119
3119
|
return;
|
|
3120
3120
|
}
|
|
3121
|
-
|
|
3121
|
+
xo.has(d.type) || Me == null || Me(d);
|
|
3122
3122
|
}
|
|
3123
3123
|
},
|
|
3124
|
-
[
|
|
3125
|
-
),
|
|
3124
|
+
[Me, Ie, Re]
|
|
3125
|
+
), te = tr({
|
|
3126
3126
|
agentId: $ ? "__controlled__" : ot,
|
|
3127
3127
|
baseUrl: i,
|
|
3128
3128
|
apiKey: a,
|
|
3129
3129
|
sessionEndpoint: s,
|
|
3130
3130
|
sessionBody: l,
|
|
3131
|
-
onDataMessage: $ ? void 0 :
|
|
3131
|
+
onDataMessage: $ ? void 0 : at
|
|
3132
3132
|
});
|
|
3133
3133
|
T(() => {
|
|
3134
3134
|
if ($ != null && $.subscribeToDataMessages)
|
|
3135
|
-
return $.subscribeToDataMessages(
|
|
3136
|
-
}, [$,
|
|
3135
|
+
return $.subscribeToDataMessages(at);
|
|
3136
|
+
}, [$, at]), be.current = () => {
|
|
3137
3137
|
var v;
|
|
3138
|
-
return (v =
|
|
3138
|
+
return (v = te.getRoom) == null ? void 0 : v.call(te);
|
|
3139
3139
|
}, T(() => {
|
|
3140
|
-
var
|
|
3140
|
+
var X;
|
|
3141
3141
|
if (typeof window > "u") return;
|
|
3142
|
-
const v = ((
|
|
3142
|
+
const v = ((X = window.location) == null ? void 0 : X.hostname) || "";
|
|
3143
3143
|
if (v === "localhost" || v === "127.0.0.1" || v === "0.0.0.0" || v.endsWith(".local") || v.endsWith(".test"))
|
|
3144
3144
|
return window.__livelayerSimulateCommand = (oe) => {
|
|
3145
3145
|
try {
|
|
3146
|
-
|
|
3146
|
+
at(oe);
|
|
3147
3147
|
} catch (ke) {
|
|
3148
3148
|
console.warn("[LiveLayer] simulate-command threw:", ke);
|
|
3149
3149
|
}
|
|
3150
3150
|
}, () => {
|
|
3151
3151
|
delete window.__livelayerSimulateCommand;
|
|
3152
3152
|
};
|
|
3153
|
-
}, [
|
|
3153
|
+
}, [at]);
|
|
3154
3154
|
const C = Qe(() => $ ? {
|
|
3155
3155
|
connectionState: $.connectionState,
|
|
3156
3156
|
agentState: $.agentState,
|
|
@@ -3167,30 +3167,30 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3167
3167
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
3168
3168
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
3169
3169
|
// so we reuse its reference for type consistency.
|
|
3170
|
-
getRoom:
|
|
3170
|
+
getRoom: te.getRoom,
|
|
3171
3171
|
isControlled: !0
|
|
3172
3172
|
} : {
|
|
3173
|
-
connectionState:
|
|
3174
|
-
agentState:
|
|
3175
|
-
transcript:
|
|
3176
|
-
videoElement:
|
|
3177
|
-
audioElement:
|
|
3178
|
-
canResume:
|
|
3179
|
-
error:
|
|
3180
|
-
agentConfig:
|
|
3181
|
-
connect:
|
|
3182
|
-
disconnect:
|
|
3183
|
-
getRoom:
|
|
3173
|
+
connectionState: te.connectionState,
|
|
3174
|
+
agentState: te.agentState,
|
|
3175
|
+
transcript: te.transcript,
|
|
3176
|
+
videoElement: te.videoElement,
|
|
3177
|
+
audioElement: te.audioElement,
|
|
3178
|
+
canResume: te.canResume,
|
|
3179
|
+
error: te.error,
|
|
3180
|
+
agentConfig: te.agentConfig,
|
|
3181
|
+
connect: te.connect,
|
|
3182
|
+
disconnect: te.disconnect,
|
|
3183
|
+
getRoom: te.getRoom,
|
|
3184
3184
|
isControlled: !1
|
|
3185
|
-
}, [$,
|
|
3186
|
-
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3185
|
+
}, [$, te]), Ft = M(C);
|
|
3186
|
+
Ft.current = C;
|
|
3187
|
+
const Wt = M($);
|
|
3188
|
+
Wt.current = $, Gn(
|
|
3189
3189
|
r,
|
|
3190
3190
|
() => ({
|
|
3191
3191
|
sendData: async (v) => {
|
|
3192
|
-
var ke,
|
|
3193
|
-
const d =
|
|
3192
|
+
var ke, ct;
|
|
3193
|
+
const d = Wt.current;
|
|
3194
3194
|
if (d != null && d.publishData) {
|
|
3195
3195
|
try {
|
|
3196
3196
|
await d.publishData(v);
|
|
@@ -3199,7 +3199,7 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3199
3199
|
}
|
|
3200
3200
|
return;
|
|
3201
3201
|
}
|
|
3202
|
-
const
|
|
3202
|
+
const X = (ct = (ke = Ft.current) == null ? void 0 : ke.getRoom) == null ? void 0 : ct.call(ke), oe = X == null ? void 0 : X.localParticipant;
|
|
3203
3203
|
if (oe != null && oe.publishData)
|
|
3204
3204
|
try {
|
|
3205
3205
|
const k = new TextEncoder().encode(JSON.stringify(v));
|
|
@@ -3211,9 +3211,9 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3211
3211
|
}),
|
|
3212
3212
|
[]
|
|
3213
3213
|
);
|
|
3214
|
-
const
|
|
3214
|
+
const qt = M(null);
|
|
3215
3215
|
T(() => {
|
|
3216
|
-
const v = C.videoElement, d =
|
|
3216
|
+
const v = C.videoElement, d = qt.current;
|
|
3217
3217
|
if (!(!v || !d))
|
|
3218
3218
|
return d.appendChild(v), () => {
|
|
3219
3219
|
v.parentNode === d && d.removeChild(v);
|
|
@@ -3222,37 +3222,37 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3222
3222
|
const v = C.audioElement;
|
|
3223
3223
|
if (!v) return;
|
|
3224
3224
|
const d = document.createElement("div");
|
|
3225
|
-
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(v), document.body.appendChild(d),
|
|
3226
|
-
const
|
|
3227
|
-
return
|
|
3225
|
+
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(v), document.body.appendChild(d), Pe.attach(v);
|
|
3226
|
+
const X = v.play();
|
|
3227
|
+
return X && typeof X.catch == "function" && X.catch((oe) => {
|
|
3228
3228
|
(oe == null ? void 0 : oe.name) === "NotAllowedError" && ye(!0);
|
|
3229
3229
|
}), () => {
|
|
3230
|
-
|
|
3230
|
+
Pe.detach(), v.parentNode === d && d.removeChild(v), d.parentNode === document.body && document.body.removeChild(d);
|
|
3231
3231
|
};
|
|
3232
3232
|
}, [C.audioElement]), T(() => {
|
|
3233
3233
|
if (C.isControlled || C.connectionState !== "connected") return;
|
|
3234
3234
|
const v = C.getRoom();
|
|
3235
3235
|
if (v)
|
|
3236
|
-
return
|
|
3237
|
-
const d =
|
|
3238
|
-
d &&
|
|
3236
|
+
return Q.setupMic(v).then(() => {
|
|
3237
|
+
const d = Q.getMicStream();
|
|
3238
|
+
d && Pe.attachStream(d, "mic");
|
|
3239
3239
|
}).catch(() => {
|
|
3240
3240
|
}), () => {
|
|
3241
|
-
|
|
3241
|
+
Pe.detachSlot("mic"), Q.teardownMic();
|
|
3242
3242
|
};
|
|
3243
3243
|
}, [C.isControlled, C.connectionState]), T(() => {
|
|
3244
3244
|
var d;
|
|
3245
3245
|
if (C.connectionState !== "connected") return;
|
|
3246
3246
|
const v = C.isControlled ? (d = $ == null ? void 0 : $.getRoom) == null ? void 0 : d.call($) : C.getRoom();
|
|
3247
3247
|
if (v)
|
|
3248
|
-
return
|
|
3249
|
-
|
|
3248
|
+
return ge.attachRoom(v), $e.attachRoom(v), C.isControlled && Q.attachRoom(v), Ve.refresh(), () => {
|
|
3249
|
+
ge.teardown(), $e.teardown();
|
|
3250
3250
|
};
|
|
3251
3251
|
}, [C.isControlled, C.connectionState, $]), T(() => {
|
|
3252
3252
|
const v = C.audioElement;
|
|
3253
|
-
v && (v.muted =
|
|
3254
|
-
}, [C.audioElement,
|
|
3255
|
-
const
|
|
3253
|
+
v && (v.muted = J);
|
|
3254
|
+
}, [C.audioElement, J]);
|
|
3255
|
+
const Tn = E((v) => {
|
|
3256
3256
|
const d = { type: "user_message", text: v };
|
|
3257
3257
|
if ($ != null && $.publishData) {
|
|
3258
3258
|
try {
|
|
@@ -3261,205 +3261,205 @@ const Lo = /* @__PURE__ */ new Set([
|
|
|
3261
3261
|
}
|
|
3262
3262
|
return;
|
|
3263
3263
|
}
|
|
3264
|
-
const
|
|
3265
|
-
if (
|
|
3264
|
+
const X = C.getRoom();
|
|
3265
|
+
if (X)
|
|
3266
3266
|
try {
|
|
3267
3267
|
const oe = new TextEncoder().encode(JSON.stringify(d));
|
|
3268
|
-
|
|
3268
|
+
X.localParticipant.publishData(oe, { reliable: !0 });
|
|
3269
3269
|
} catch {
|
|
3270
3270
|
}
|
|
3271
|
-
}, [C, $]),
|
|
3272
|
-
|
|
3271
|
+
}, [C, $]), Dn = E(() => {
|
|
3272
|
+
Rn((v) => !v);
|
|
3273
3273
|
}, []);
|
|
3274
3274
|
T(() => {
|
|
3275
|
-
|
|
3276
|
-
}, [C.connectionState,
|
|
3277
|
-
|
|
3278
|
-
}, [C.transcript,
|
|
3275
|
+
Ae == null || Ae(C.connectionState), C.connectionState === "connected" ? Se == null || Se() : C.connectionState === "disconnected" && (Be == null || Be());
|
|
3276
|
+
}, [C.connectionState, Se, Be, Ae]), T(() => {
|
|
3277
|
+
Ne == null || Ne(C.transcript);
|
|
3278
|
+
}, [C.transcript, Ne]), T(() => {
|
|
3279
3279
|
Fe == null || Fe(C.agentState);
|
|
3280
3280
|
}, [C.agentState, Fe]), T(() => {
|
|
3281
3281
|
gt.setThinking(C.agentState === "thinking");
|
|
3282
3282
|
}, [C.agentState, gt]);
|
|
3283
|
-
const
|
|
3283
|
+
const Ut = M(!1);
|
|
3284
3284
|
T(() => {
|
|
3285
|
-
!w ||
|
|
3285
|
+
!w || Ut.current || rt && C.connectionState === "idle" && (Ut.current = !0, C.connect());
|
|
3286
3286
|
}, [w, C.connectionState, C, rt]);
|
|
3287
|
-
const
|
|
3287
|
+
const Pn = E(
|
|
3288
3288
|
(v) => {
|
|
3289
|
-
const d = L == null ? void 0 : L.find((
|
|
3290
|
-
d && (
|
|
3289
|
+
const d = L == null ? void 0 : L.find((X) => X.id === v);
|
|
3290
|
+
d && (lt(!1), v !== Ce && (it(!0), C.disconnect(), De || Lt(v), I == null || I(d)));
|
|
3291
3291
|
},
|
|
3292
3292
|
[
|
|
3293
3293
|
L,
|
|
3294
3294
|
Ce,
|
|
3295
3295
|
C,
|
|
3296
|
-
|
|
3296
|
+
De,
|
|
3297
3297
|
I
|
|
3298
3298
|
]
|
|
3299
3299
|
);
|
|
3300
3300
|
T(() => {
|
|
3301
|
-
|
|
3302
|
-
}, [C.connectionState,
|
|
3303
|
-
if (!
|
|
3301
|
+
ve && C.connectionState === "connected" && it(!1);
|
|
3302
|
+
}, [C.connectionState, ve]), T(() => {
|
|
3303
|
+
if (!Ye) return;
|
|
3304
3304
|
const v = (d) => {
|
|
3305
|
-
d.key === "Escape" &&
|
|
3305
|
+
d.key === "Escape" && lt(!1);
|
|
3306
3306
|
};
|
|
3307
3307
|
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
3308
|
-
}, [
|
|
3309
|
-
const
|
|
3310
|
-
nt === void 0 && ((
|
|
3311
|
-
const vt = (ae == null ? void 0 : ae.name) ?? B ?? ((
|
|
3308
|
+
}, [Ye]);
|
|
3309
|
+
const $n = !!P || !!(ae != null && ae.avatarImageUrl) || C.isControlled, st = cr(ot, i, $n);
|
|
3310
|
+
nt === void 0 && ((Gt = st.info) != null && Gt.capabilities) && (It.current = st.info.capabilities);
|
|
3311
|
+
const vt = (ae == null ? void 0 : ae.name) ?? B ?? ((Kt = C.agentConfig) == null ? void 0 : Kt.name) ?? ((Jt = st.info) == null ? void 0 : Jt.name) ?? "Live Layer", Mt = (ae == null ? void 0 : ae.avatarImageUrl) ?? P ?? ((Xt = C.agentConfig) == null ? void 0 : Xt.avatarImageUrl) ?? ((Zt = st.info) == null ? void 0 : Zt.avatarImageUrl) ?? null, zn = U ?? ((Qt = C.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((en = st.info) == null ? void 0 : en.idleLoopUrl) ?? null, Hn = b ?? null, On = E(() => me("expanded"), [me]), Bn = E(
|
|
3312
3312
|
() => me("minimized"),
|
|
3313
3313
|
[me]
|
|
3314
|
-
),
|
|
3314
|
+
), jt = E(() => {
|
|
3315
3315
|
C.disconnect(), me("hidden");
|
|
3316
|
-
}, [C, me]),
|
|
3316
|
+
}, [C, me]), Fn = E(() => {
|
|
3317
3317
|
const v = C.audioElement;
|
|
3318
3318
|
v && v.play().then(() => ye(!1)).catch(() => {
|
|
3319
3319
|
});
|
|
3320
|
-
}, [C.audioElement]),
|
|
3320
|
+
}, [C.audioElement]), Wn = E(() => {
|
|
3321
3321
|
ye(!1), C.connect();
|
|
3322
3322
|
}, [C]), Ge = {
|
|
3323
|
-
...
|
|
3324
|
-
...
|
|
3323
|
+
...Te,
|
|
3324
|
+
...ue ? {} : { zIndex: We }
|
|
3325
3325
|
};
|
|
3326
3326
|
q.primaryColor && (Ge["--ll-color-primary"] = q.primaryColor), q.accentColor && (Ge["--ll-color-accent"] = q.accentColor), q.backgroundColor && (Ge["--ll-color-bg"] = q.backgroundColor), q.textColor && (Ge["--ll-color-fg"] = q.textColor);
|
|
3327
|
-
const
|
|
3327
|
+
const qn = [
|
|
3328
3328
|
"ll-widget",
|
|
3329
3329
|
`ll-widget--${se}`,
|
|
3330
|
-
`ll-widget--${
|
|
3330
|
+
`ll-widget--${fe ? "mobile" : "desktop"}`,
|
|
3331
3331
|
xt
|
|
3332
3332
|
].filter(Boolean).join(" ");
|
|
3333
3333
|
if (!rt) return null;
|
|
3334
|
-
const
|
|
3334
|
+
const Un = /* @__PURE__ */ n(
|
|
3335
3335
|
"div",
|
|
3336
3336
|
{
|
|
3337
|
-
className:
|
|
3337
|
+
className: qn,
|
|
3338
3338
|
style: Ge,
|
|
3339
3339
|
"data-display-mode": se,
|
|
3340
3340
|
"data-position": _,
|
|
3341
3341
|
"data-experience-mode": p === "EMBEDDED" ? "embedded" : "widget",
|
|
3342
3342
|
children: se === "expanded" && /* @__PURE__ */ n(
|
|
3343
|
-
|
|
3343
|
+
jr,
|
|
3344
3344
|
{
|
|
3345
3345
|
position: _,
|
|
3346
|
-
isMobile:
|
|
3346
|
+
isMobile: fe,
|
|
3347
3347
|
agentName: vt,
|
|
3348
|
-
avatarImageUrl:
|
|
3349
|
-
idleLoopUrl:
|
|
3350
|
-
greeting:
|
|
3348
|
+
avatarImageUrl: Mt,
|
|
3349
|
+
idleLoopUrl: zn,
|
|
3350
|
+
greeting: Hn,
|
|
3351
3351
|
branding: q,
|
|
3352
3352
|
teamMembers: L,
|
|
3353
3353
|
currentTeamMemberId: Ce,
|
|
3354
|
-
isSwitchingTeamMember:
|
|
3355
|
-
teamSwitcherOpen:
|
|
3356
|
-
onToggleTeamSwitcher: () =>
|
|
3357
|
-
onSelectTeamMember:
|
|
3354
|
+
isSwitchingTeamMember: ve,
|
|
3355
|
+
teamSwitcherOpen: Ye,
|
|
3356
|
+
onToggleTeamSwitcher: () => lt((v) => !v),
|
|
3357
|
+
onSelectTeamMember: Pn,
|
|
3358
3358
|
connectionState: C.connectionState,
|
|
3359
3359
|
agentState: C.agentState,
|
|
3360
3360
|
transcript: C.transcript,
|
|
3361
|
-
isMuted:
|
|
3362
|
-
micDevices:
|
|
3363
|
-
activeMicId:
|
|
3364
|
-
isCameraEnabled:
|
|
3365
|
-
cameraPreviewEl:
|
|
3366
|
-
cameraDevices:
|
|
3367
|
-
activeCameraId:
|
|
3368
|
-
isScreenShareEnabled:
|
|
3369
|
-
screenPreviewEl:
|
|
3370
|
-
isSpeakerMuted:
|
|
3371
|
-
allowCamera:
|
|
3361
|
+
isMuted: Q.isMuted,
|
|
3362
|
+
micDevices: Ve.mics,
|
|
3363
|
+
activeMicId: Q.activeDeviceId,
|
|
3364
|
+
isCameraEnabled: ge.isEnabled,
|
|
3365
|
+
cameraPreviewEl: ge.previewEl,
|
|
3366
|
+
cameraDevices: Ve.cameras,
|
|
3367
|
+
activeCameraId: ge.activeDeviceId,
|
|
3368
|
+
isScreenShareEnabled: $e.isEnabled,
|
|
3369
|
+
screenPreviewEl: $e.previewEl,
|
|
3370
|
+
isSpeakerMuted: J,
|
|
3371
|
+
allowCamera: re,
|
|
3372
3372
|
allowScreenShare: F,
|
|
3373
3373
|
allowTyping: j,
|
|
3374
|
-
showMinimize:
|
|
3375
|
-
showClose:
|
|
3376
|
-
chromeless:
|
|
3377
|
-
compactControls:
|
|
3374
|
+
showMinimize: fe && !ue ? !1 : pt,
|
|
3375
|
+
showClose: ht,
|
|
3376
|
+
chromeless: xe,
|
|
3377
|
+
compactControls: kt,
|
|
3378
3378
|
transforming: Oe,
|
|
3379
|
-
transformingLabel:
|
|
3380
|
-
languageMenuOpen:
|
|
3381
|
-
onToggleLanguageMenu: () =>
|
|
3382
|
-
needsUserGesture:
|
|
3379
|
+
transformingLabel: Z,
|
|
3380
|
+
languageMenuOpen: mt,
|
|
3381
|
+
onToggleLanguageMenu: () => y((v) => !v),
|
|
3382
|
+
needsUserGesture: Ct,
|
|
3383
3383
|
canResume: C.canResume,
|
|
3384
|
-
micError:
|
|
3384
|
+
micError: Q.micError,
|
|
3385
3385
|
error: C.error,
|
|
3386
|
-
avatarVideoContainerRef:
|
|
3386
|
+
avatarVideoContainerRef: qt,
|
|
3387
3387
|
agentVideoEl: C.videoElement,
|
|
3388
3388
|
onConnect: () => void C.connect(),
|
|
3389
3389
|
onDisconnect: () => C.disconnect(),
|
|
3390
|
-
onRetry:
|
|
3391
|
-
onResumeAudio:
|
|
3392
|
-
onToggleMute:
|
|
3393
|
-
onSwitchMicDevice: (v) => void
|
|
3394
|
-
onToggleCamera: () => void
|
|
3395
|
-
onSwitchCameraDevice: (v) => void
|
|
3396
|
-
onToggleScreenShare: () => void
|
|
3397
|
-
onToggleSpeaker:
|
|
3398
|
-
onSendMessage:
|
|
3399
|
-
onMinimize:
|
|
3400
|
-
onClose:
|
|
3401
|
-
onClearMicError:
|
|
3390
|
+
onRetry: Wn,
|
|
3391
|
+
onResumeAudio: Fn,
|
|
3392
|
+
onToggleMute: Q.toggleMute,
|
|
3393
|
+
onSwitchMicDevice: (v) => void Q.switchDevice(v),
|
|
3394
|
+
onToggleCamera: () => void ge.toggle(),
|
|
3395
|
+
onSwitchCameraDevice: (v) => void ge.switchDevice(v),
|
|
3396
|
+
onToggleScreenShare: () => void $e.toggle(),
|
|
3397
|
+
onToggleSpeaker: Dn,
|
|
3398
|
+
onSendMessage: Tn,
|
|
3399
|
+
onMinimize: Bn,
|
|
3400
|
+
onClose: jt,
|
|
3401
|
+
onClearMicError: Q.clearError
|
|
3402
3402
|
}
|
|
3403
3403
|
)
|
|
3404
3404
|
}
|
|
3405
|
-
),
|
|
3405
|
+
), Vt = !ue && (se === "hidden" || se === "minimized") ? /* @__PURE__ */ x(
|
|
3406
3406
|
"div",
|
|
3407
3407
|
{
|
|
3408
3408
|
className: [
|
|
3409
3409
|
"ll-widget",
|
|
3410
3410
|
"ll-widget--floating",
|
|
3411
3411
|
`ll-widget--${se}`,
|
|
3412
|
-
`ll-widget--${
|
|
3412
|
+
`ll-widget--${fe ? "mobile" : "desktop"}`
|
|
3413
3413
|
].join(" "),
|
|
3414
3414
|
style: Ge,
|
|
3415
3415
|
"data-display-mode": se,
|
|
3416
3416
|
"data-position": _,
|
|
3417
3417
|
children: [
|
|
3418
3418
|
se === "hidden" && /* @__PURE__ */ n(
|
|
3419
|
-
|
|
3419
|
+
Dr,
|
|
3420
3420
|
{
|
|
3421
3421
|
position: _,
|
|
3422
|
-
isMobile:
|
|
3422
|
+
isMobile: fe,
|
|
3423
3423
|
isSpeaking: C.agentState === "speaking",
|
|
3424
3424
|
onExpand: () => me("expanded"),
|
|
3425
3425
|
label: `Open ${vt} widget`,
|
|
3426
|
-
avatarImageUrl:
|
|
3426
|
+
avatarImageUrl: Mt,
|
|
3427
3427
|
agentName: vt,
|
|
3428
|
-
containerEl:
|
|
3428
|
+
containerEl: de
|
|
3429
3429
|
}
|
|
3430
3430
|
),
|
|
3431
3431
|
se === "minimized" && /* @__PURE__ */ n(
|
|
3432
|
-
|
|
3432
|
+
$r,
|
|
3433
3433
|
{
|
|
3434
3434
|
position: _,
|
|
3435
|
-
isMobile:
|
|
3435
|
+
isMobile: fe,
|
|
3436
3436
|
agentName: vt,
|
|
3437
|
-
avatarImageUrl:
|
|
3437
|
+
avatarImageUrl: Mt,
|
|
3438
3438
|
agentState: C.agentState,
|
|
3439
|
-
isMuted:
|
|
3440
|
-
audioLevel:
|
|
3441
|
-
onExpand:
|
|
3442
|
-
onToggleMute:
|
|
3443
|
-
onClose:
|
|
3439
|
+
isMuted: Q.isMuted,
|
|
3440
|
+
audioLevel: Pe,
|
|
3441
|
+
onExpand: On,
|
|
3442
|
+
onToggleMute: Q.toggleMute,
|
|
3443
|
+
onClose: jt
|
|
3444
3444
|
}
|
|
3445
3445
|
)
|
|
3446
3446
|
]
|
|
3447
3447
|
}
|
|
3448
|
-
) : null,
|
|
3448
|
+
) : null, Yt = de ?? (typeof document < "u" ? document.body : null);
|
|
3449
3449
|
return /* @__PURE__ */ x(ze, { children: [
|
|
3450
|
-
|
|
3451
|
-
|
|
3450
|
+
Un,
|
|
3451
|
+
Vt && Yt && $t(Vt, Yt)
|
|
3452
3452
|
] });
|
|
3453
3453
|
}
|
|
3454
3454
|
);
|
|
3455
|
-
|
|
3456
|
-
const
|
|
3455
|
+
Mn.displayName = "AvatarWidgetInner";
|
|
3456
|
+
const Lo = Pt(
|
|
3457
3457
|
function(t, r) {
|
|
3458
|
-
return /* @__PURE__ */ n(
|
|
3458
|
+
return /* @__PURE__ */ n(er, { children: /* @__PURE__ */ n(Mn, { ...t, ref: r }) });
|
|
3459
3459
|
}
|
|
3460
3460
|
);
|
|
3461
|
-
|
|
3462
|
-
const
|
|
3461
|
+
Lo.displayName = "AvatarWidget";
|
|
3462
|
+
const Do = ({
|
|
3463
3463
|
agentId: e,
|
|
3464
3464
|
baseUrl: t,
|
|
3465
3465
|
apiKey: r,
|
|
@@ -3485,9 +3485,9 @@ const Po = ({
|
|
|
3485
3485
|
}, [e]), T(() => {
|
|
3486
3486
|
c.current && (o ? c.current.setAttribute("mode", o) : c.current.removeAttribute("mode"));
|
|
3487
3487
|
}, [o]), /* @__PURE__ */ n("div", { ref: l, className: i, style: s });
|
|
3488
|
-
},
|
|
3488
|
+
}, Po = Pt(
|
|
3489
3489
|
function({ id: t, intent: r, as: o = "div", className: a, style: i, children: s }, l) {
|
|
3490
|
-
return
|
|
3490
|
+
return Kn(
|
|
3491
3491
|
o,
|
|
3492
3492
|
{
|
|
3493
3493
|
ref: l,
|
|
@@ -3500,7 +3500,7 @@ const Po = ({
|
|
|
3500
3500
|
);
|
|
3501
3501
|
}
|
|
3502
3502
|
);
|
|
3503
|
-
function
|
|
3503
|
+
function $o(e = {}) {
|
|
3504
3504
|
const { onFieldUpdate: t, onComplete: r, source: o = "all" } = e, [a, i] = N({}), [s, l] = N(!1), [c, p] = N(null), w = M(t), m = M(r), f = M(o);
|
|
3505
3505
|
T(() => {
|
|
3506
3506
|
w.current = t, m.current = r, f.current = o;
|
|
@@ -3543,8 +3543,8 @@ function zo(e = {}) {
|
|
|
3543
3543
|
return document.addEventListener("ll-collected", _), () => document.removeEventListener("ll-collected", _);
|
|
3544
3544
|
}, []), { fields: a, isCollecting: s, lastResult: c, reset: R };
|
|
3545
3545
|
}
|
|
3546
|
-
let
|
|
3547
|
-
function
|
|
3546
|
+
let xn = 1;
|
|
3547
|
+
function zo({
|
|
3548
3548
|
onMount: e,
|
|
3549
3549
|
defaultOpen: t = !1,
|
|
3550
3550
|
storageKey: r = "ll-debug-open"
|
|
@@ -3580,7 +3580,7 @@ function Ho({
|
|
|
3580
3580
|
if (T(() => {
|
|
3581
3581
|
!e || _.current || (_.current = !0, e((u) => {
|
|
3582
3582
|
f.current.push({
|
|
3583
|
-
id:
|
|
3583
|
+
id: xn++,
|
|
3584
3584
|
ts: Date.now(),
|
|
3585
3585
|
kind: "event",
|
|
3586
3586
|
type: u.eventName,
|
|
@@ -3592,11 +3592,11 @@ function Ho({
|
|
|
3592
3592
|
try {
|
|
3593
3593
|
const b = typeof U[0] == "string" ? U[0] : "";
|
|
3594
3594
|
b.startsWith("[LiveLayer]") && f.current.push({
|
|
3595
|
-
id:
|
|
3595
|
+
id: xn++,
|
|
3596
3596
|
ts: Date.now(),
|
|
3597
3597
|
kind: A,
|
|
3598
3598
|
type: b.slice(0, 120),
|
|
3599
|
-
data: { args: U.slice(1).map((P) =>
|
|
3599
|
+
data: { args: U.slice(1).map((P) => Co(P)) }
|
|
3600
3600
|
});
|
|
3601
3601
|
} catch {
|
|
3602
3602
|
}
|
|
@@ -3683,7 +3683,7 @@ function Ho({
|
|
|
3683
3683
|
{
|
|
3684
3684
|
type: "button",
|
|
3685
3685
|
onClick: () => w((u) => !u),
|
|
3686
|
-
style:
|
|
3686
|
+
style: Tt(p ? "#f59e0b" : "transparent"),
|
|
3687
3687
|
title: "Pause / resume capture",
|
|
3688
3688
|
children: p ? "▶ resume" : "⏸ pause"
|
|
3689
3689
|
}
|
|
@@ -3695,7 +3695,7 @@ function Ho({
|
|
|
3695
3695
|
onClick: () => {
|
|
3696
3696
|
s([]), f.current = [];
|
|
3697
3697
|
},
|
|
3698
|
-
style:
|
|
3698
|
+
style: Tt("transparent"),
|
|
3699
3699
|
title: "Clear buffer",
|
|
3700
3700
|
children: "clear"
|
|
3701
3701
|
}
|
|
@@ -3705,7 +3705,7 @@ function Ho({
|
|
|
3705
3705
|
{
|
|
3706
3706
|
type: "button",
|
|
3707
3707
|
onClick: () => a(!1),
|
|
3708
|
-
style:
|
|
3708
|
+
style: Tt("transparent"),
|
|
3709
3709
|
"aria-label": "Close",
|
|
3710
3710
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
3711
3711
|
children: "✕"
|
|
@@ -3772,7 +3772,7 @@ function Ho({
|
|
|
3772
3772
|
]
|
|
3773
3773
|
}
|
|
3774
3774
|
) : g.map((u) => /* @__PURE__ */ n(
|
|
3775
|
-
|
|
3775
|
+
ko,
|
|
3776
3776
|
{
|
|
3777
3777
|
entry: u,
|
|
3778
3778
|
expanded: m.current.has(u.id),
|
|
@@ -3788,7 +3788,7 @@ function Ho({
|
|
|
3788
3788
|
}
|
|
3789
3789
|
);
|
|
3790
3790
|
}
|
|
3791
|
-
function
|
|
3791
|
+
function ko({
|
|
3792
3792
|
entry: e,
|
|
3793
3793
|
expanded: t,
|
|
3794
3794
|
onToggle: r
|
|
@@ -3858,7 +3858,7 @@ function Co({
|
|
|
3858
3858
|
}
|
|
3859
3859
|
);
|
|
3860
3860
|
}
|
|
3861
|
-
function
|
|
3861
|
+
function Tt(e) {
|
|
3862
3862
|
return {
|
|
3863
3863
|
background: e,
|
|
3864
3864
|
color: "#fff",
|
|
@@ -3869,21 +3869,21 @@ function Dt(e) {
|
|
|
3869
3869
|
cursor: "pointer"
|
|
3870
3870
|
};
|
|
3871
3871
|
}
|
|
3872
|
-
function
|
|
3872
|
+
function Co(e) {
|
|
3873
3873
|
try {
|
|
3874
3874
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
3875
3875
|
} catch {
|
|
3876
3876
|
return String(e);
|
|
3877
3877
|
}
|
|
3878
3878
|
}
|
|
3879
|
-
function
|
|
3879
|
+
function Eo(e) {
|
|
3880
3880
|
const t = JSON.stringify(e);
|
|
3881
|
-
T(() =>
|
|
3881
|
+
T(() => Xn(e), [t]);
|
|
3882
3882
|
}
|
|
3883
|
-
function
|
|
3884
|
-
return
|
|
3883
|
+
function Ho({ fields: e, children: t }) {
|
|
3884
|
+
return Eo(e), /* @__PURE__ */ n(ze, { children: t });
|
|
3885
3885
|
}
|
|
3886
|
-
function
|
|
3886
|
+
function Oo() {
|
|
3887
3887
|
const [e, t] = N([]), r = E((a) => {
|
|
3888
3888
|
t((i) => {
|
|
3889
3889
|
const s = i.findIndex((l) => l.id === a.id);
|
|
@@ -3902,38 +3902,38 @@ function Bo() {
|
|
|
3902
3902
|
};
|
|
3903
3903
|
}
|
|
3904
3904
|
export {
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3905
|
+
Lo as AvatarWidget,
|
|
3906
|
+
er as ErrorBoundary,
|
|
3907
|
+
Ho as FieldProvider,
|
|
3908
|
+
zo as LiveLayerDebugPanel,
|
|
3909
|
+
Po as LiveLayerRegion,
|
|
3910
|
+
Do as LiveLayerWidget,
|
|
3911
|
+
Wo as clearFieldRegistry,
|
|
3912
|
+
oo as clearPageContextCache,
|
|
3913
|
+
uo as clearRoutesCache,
|
|
3914
|
+
ro as extractPageContext,
|
|
3915
|
+
so as extractRoutes,
|
|
3916
|
+
yn as getCachedPageContext,
|
|
3917
|
+
Rt as getCachedRoutes,
|
|
3918
|
+
qo as getRegisteredFields,
|
|
3919
|
+
kr as matchesPattern,
|
|
3920
|
+
lo as normalizeRouteInput,
|
|
3921
|
+
Uo as registerFields,
|
|
3922
|
+
jo as setFieldValue,
|
|
3923
|
+
Cr as shouldRenderAtPath,
|
|
3924
|
+
cr as useAgentInfo,
|
|
3925
|
+
nr as useAudioLevel,
|
|
3926
|
+
lr as useCameraState,
|
|
3927
|
+
$o as useCollect,
|
|
3928
|
+
fr as useDisplayMode,
|
|
3929
|
+
mr as useDisplayModePersistence,
|
|
3930
|
+
yr as useIsMobile,
|
|
3931
|
+
tr as useLiveKitSession,
|
|
3932
|
+
sr as useMediaDevices,
|
|
3933
|
+
or as useMicrophoneState,
|
|
3934
|
+
br as usePathname,
|
|
3935
|
+
Eo as useRegisterFields,
|
|
3936
|
+
Er as useRouteMatch,
|
|
3937
|
+
ar as useScreenShareState,
|
|
3938
|
+
Oo as useTranscript
|
|
3939
3939
|
};
|