@livelayer/react 0.5.1 → 0.5.3
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.d.ts +15 -0
- package/dist/index.js +5 -2
- package/dist/index.mjs +1364 -981
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { LiveKitSession as
|
|
5
|
-
import { createLocalAudioTrack as
|
|
6
|
-
class
|
|
2
|
+
import { jsxs as _, jsx as n, Fragment as Bt } from "react/jsx-runtime";
|
|
3
|
+
import { Component as ln, useState as N, useRef as I, useEffect as P, useCallback as S, useMemo as Je, forwardRef as ct, createElement as an } from "react";
|
|
4
|
+
import { LiveKitSession as cn } from "@livelayer/sdk";
|
|
5
|
+
import { createLocalAudioTrack as sn, Track as Wt, createLocalVideoTrack as dn } from "livekit-client";
|
|
6
|
+
class un extends ln {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
9
9
|
this.setState({ hasError: !1, error: null });
|
|
@@ -13,12 +13,12 @@ class cn extends nn {
|
|
|
13
13
|
return { hasError: !0, error: t };
|
|
14
14
|
}
|
|
15
15
|
componentDidCatch(t, r) {
|
|
16
|
-
var
|
|
17
|
-
(
|
|
16
|
+
var o, i;
|
|
17
|
+
(i = (o = this.props).onError) == null || i.call(o, t, r);
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
20
|
var t;
|
|
21
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
21
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ _("div", { className: "ll-error-boundary", role: "alert", children: [
|
|
22
22
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
|
|
23
23
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
|
|
24
24
|
/* @__PURE__ */ n(
|
|
@@ -33,26 +33,26 @@ class cn extends nn {
|
|
|
33
33
|
] }) : this.props.children;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const [t, r] =
|
|
36
|
+
function fn(e) {
|
|
37
|
+
const [t, r] = N("idle"), [o, i] = N("idle"), [l, s] = N([]), [d, u] = N(null), [h, m] = N(null), [a, c] = N(null), [A, C] = N(!1), [R, b] = N(null), L = I(null), $ = I(e.onDataMessage);
|
|
38
38
|
$.current = e.onDataMessage, P(() => {
|
|
39
|
-
const
|
|
40
|
-
onConnectionStateChange: (
|
|
41
|
-
r(
|
|
39
|
+
const g = {
|
|
40
|
+
onConnectionStateChange: (x) => {
|
|
41
|
+
r(x), x === "connected" && b(null);
|
|
42
42
|
},
|
|
43
|
-
onAgentStateChange:
|
|
44
|
-
onTranscript: (
|
|
43
|
+
onAgentStateChange: i,
|
|
44
|
+
onTranscript: (x) => s([...x]),
|
|
45
45
|
onAgentConfig: u,
|
|
46
|
-
onAudioTrack: (
|
|
47
|
-
onVideoTrack: (
|
|
48
|
-
onVideoTrackRemoved: () =>
|
|
49
|
-
onError: (
|
|
50
|
-
onDataMessage: (
|
|
51
|
-
var
|
|
52
|
-
(
|
|
46
|
+
onAudioTrack: (x) => c(x),
|
|
47
|
+
onVideoTrack: (x) => m(x),
|
|
48
|
+
onVideoTrackRemoved: () => m(null),
|
|
49
|
+
onError: (x) => b(x),
|
|
50
|
+
onDataMessage: (x) => {
|
|
51
|
+
var q;
|
|
52
|
+
(q = $.current) == null || q.call($, x);
|
|
53
53
|
},
|
|
54
|
-
onResumabilityChange:
|
|
55
|
-
}, E = new
|
|
54
|
+
onResumabilityChange: C
|
|
55
|
+
}, E = new cn(
|
|
56
56
|
{
|
|
57
57
|
agentId: e.agentId,
|
|
58
58
|
baseUrl: e.baseUrl,
|
|
@@ -60,11 +60,11 @@ function sn(e) {
|
|
|
60
60
|
sessionEndpoint: e.sessionEndpoint,
|
|
61
61
|
sessionBody: e.sessionBody
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
g
|
|
64
64
|
);
|
|
65
|
-
return
|
|
66
|
-
var
|
|
67
|
-
(
|
|
65
|
+
return L.current = E, r("idle"), i("idle"), s([]), u(null), m(null), c(null), C(!1), b(null), () => {
|
|
66
|
+
var x;
|
|
67
|
+
(x = E.destroy) == null || x.call(E), L.current = null;
|
|
68
68
|
};
|
|
69
69
|
}, [
|
|
70
70
|
e.agentId,
|
|
@@ -73,41 +73,41 @@ function sn(e) {
|
|
|
73
73
|
e.sessionEndpoint,
|
|
74
74
|
JSON.stringify(e.sessionBody ?? {})
|
|
75
75
|
]);
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
76
|
+
const M = S(async () => {
|
|
77
|
+
const g = L.current;
|
|
78
|
+
if (g)
|
|
79
79
|
try {
|
|
80
|
-
await
|
|
80
|
+
await g.connect();
|
|
81
81
|
} catch (E) {
|
|
82
|
-
throw
|
|
82
|
+
throw b(E instanceof Error ? E.message : String(E)), E;
|
|
83
83
|
}
|
|
84
|
-
}, []),
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
}, []),
|
|
88
|
-
var
|
|
89
|
-
return ((
|
|
84
|
+
}, []), H = S(() => {
|
|
85
|
+
const g = L.current;
|
|
86
|
+
g && g.disconnect();
|
|
87
|
+
}, []), p = S(() => {
|
|
88
|
+
var g;
|
|
89
|
+
return ((g = L.current) == null ? void 0 : g.getRoom()) ?? null;
|
|
90
90
|
}, []);
|
|
91
91
|
return {
|
|
92
92
|
connectionState: t,
|
|
93
|
-
agentState:
|
|
93
|
+
agentState: o,
|
|
94
94
|
transcript: l,
|
|
95
95
|
agentConfig: d,
|
|
96
|
-
videoElement:
|
|
96
|
+
videoElement: h,
|
|
97
97
|
audioElement: a,
|
|
98
|
-
canResume:
|
|
99
|
-
error:
|
|
100
|
-
connect:
|
|
101
|
-
disconnect:
|
|
102
|
-
getRoom:
|
|
103
|
-
session:
|
|
98
|
+
canResume: A,
|
|
99
|
+
error: R,
|
|
100
|
+
connect: M,
|
|
101
|
+
disconnect: H,
|
|
102
|
+
getRoom: p,
|
|
103
|
+
session: L.current
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
const e =
|
|
106
|
+
function pn() {
|
|
107
|
+
const e = I(null), t = I(null), r = I(null), o = I(null), i = I(/* @__PURE__ */ new Set()), l = I(null), s = S(() => {
|
|
108
108
|
const a = t.current;
|
|
109
109
|
if (!a) {
|
|
110
|
-
|
|
110
|
+
o.current = null;
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
(!l.current || l.current.length !== a.frequencyBinCount) && (l.current = new Uint8Array(
|
|
@@ -115,21 +115,21 @@ function dn() {
|
|
|
115
115
|
));
|
|
116
116
|
const c = l.current;
|
|
117
117
|
a.getByteFrequencyData(c);
|
|
118
|
-
let
|
|
119
|
-
for (let
|
|
120
|
-
const
|
|
121
|
-
for (const
|
|
118
|
+
let A = 0;
|
|
119
|
+
for (let R = 0; R < c.length; R++) A += c[R];
|
|
120
|
+
const C = A / c.length / 255;
|
|
121
|
+
for (const R of i.current)
|
|
122
122
|
try {
|
|
123
|
-
|
|
124
|
-
} catch (
|
|
125
|
-
console.error("[useAudioLevel] subscriber threw:",
|
|
123
|
+
R(C);
|
|
124
|
+
} catch (b) {
|
|
125
|
+
console.error("[useAudioLevel] subscriber threw:", b);
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
}, []), d =
|
|
127
|
+
o.current = requestAnimationFrame(s);
|
|
128
|
+
}, []), d = S(() => {
|
|
129
129
|
if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
|
|
130
130
|
const a = new AudioContext(), c = a.createAnalyser();
|
|
131
131
|
c.fftSize = 64, c.connect(a.destination), e.current = a, t.current = c;
|
|
132
|
-
}, []), u =
|
|
132
|
+
}, []), u = S(
|
|
133
133
|
(a) => {
|
|
134
134
|
if (d(), !(!e.current || !t.current)) {
|
|
135
135
|
if (r.current) {
|
|
@@ -146,23 +146,23 @@ function dn() {
|
|
|
146
146
|
console.warn("[useAudioLevel] createMediaElementSource failed:", c);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
o.current === null && (o.current = requestAnimationFrame(s));
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
[d, s]
|
|
153
|
-
),
|
|
154
|
-
if (
|
|
153
|
+
), h = S(() => {
|
|
154
|
+
if (o.current !== null && (cancelAnimationFrame(o.current), o.current = null), r.current) {
|
|
155
155
|
try {
|
|
156
156
|
r.current.disconnect();
|
|
157
157
|
} catch {
|
|
158
158
|
}
|
|
159
159
|
r.current = null;
|
|
160
160
|
}
|
|
161
|
-
}, []),
|
|
162
|
-
|
|
161
|
+
}, []), m = S((a) => (i.current.add(a), () => {
|
|
162
|
+
i.current.delete(a);
|
|
163
163
|
}), []);
|
|
164
164
|
return P(() => () => {
|
|
165
|
-
if (
|
|
165
|
+
if (h(), t.current) {
|
|
166
166
|
try {
|
|
167
167
|
t.current.disconnect();
|
|
168
168
|
} catch {
|
|
@@ -176,81 +176,81 @@ function dn() {
|
|
|
176
176
|
}
|
|
177
177
|
e.current = null;
|
|
178
178
|
}
|
|
179
|
-
|
|
180
|
-
}, [
|
|
179
|
+
i.current.clear(), l.current = null;
|
|
180
|
+
}, [h]), { attach: u, detach: h, subscribe: m };
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const [e, t] =
|
|
184
|
-
if (
|
|
182
|
+
function hn() {
|
|
183
|
+
const [e, t] = N(!1), [r, o] = N(null), i = I(null), l = I(null), s = S(async (m) => {
|
|
184
|
+
if (i.current && l.current) {
|
|
185
185
|
try {
|
|
186
|
-
await l.current.localParticipant.unpublishTrack(
|
|
186
|
+
await l.current.localParticipant.unpublishTrack(i.current);
|
|
187
187
|
} catch {
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
i.current.stop(), i.current = null;
|
|
190
190
|
}
|
|
191
|
-
l.current =
|
|
191
|
+
l.current = m, o(null);
|
|
192
192
|
try {
|
|
193
|
-
const a = await
|
|
193
|
+
const a = await sn({
|
|
194
194
|
echoCancellation: !0,
|
|
195
195
|
noiseSuppression: !0
|
|
196
196
|
});
|
|
197
|
-
await
|
|
197
|
+
await m.localParticipant.publishTrack(a), i.current = a, t(a.isMuted);
|
|
198
198
|
} catch (a) {
|
|
199
199
|
const c = a instanceof Error && a.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
200
|
-
throw
|
|
200
|
+
throw o(c), a;
|
|
201
201
|
}
|
|
202
|
-
}, []), d =
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
}, []), u =
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
202
|
+
}, []), d = S(() => {
|
|
203
|
+
const m = i.current;
|
|
204
|
+
m && (m.isMuted ? (m.unmute(), t(!1)) : (m.mute(), t(!0)));
|
|
205
|
+
}, []), u = S(() => {
|
|
206
|
+
const m = i.current, a = l.current;
|
|
207
|
+
if (m && a) {
|
|
208
208
|
try {
|
|
209
|
-
a.localParticipant.unpublishTrack(
|
|
209
|
+
a.localParticipant.unpublishTrack(m);
|
|
210
210
|
} catch {
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
m.stop();
|
|
213
213
|
}
|
|
214
|
-
|
|
215
|
-
}, []),
|
|
214
|
+
i.current = null, l.current = null, t(!1);
|
|
215
|
+
}, []), h = S(() => o(null), []);
|
|
216
216
|
return {
|
|
217
217
|
isMuted: e,
|
|
218
218
|
micError: r,
|
|
219
219
|
toggleMute: d,
|
|
220
220
|
setupMic: s,
|
|
221
221
|
teardownMic: u,
|
|
222
|
-
clearError:
|
|
222
|
+
clearError: h
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
const [e, t] =
|
|
228
|
-
u.current =
|
|
229
|
-
}, []), a =
|
|
230
|
-
const
|
|
231
|
-
if ($ &&
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
225
|
+
const mn = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
226
|
+
function gn() {
|
|
227
|
+
const [e, t] = N(!1), [r, o] = N(null), [i, l] = N(null), [s, d] = N(""), u = I(null), h = I(null), m = S((L) => {
|
|
228
|
+
u.current = L;
|
|
229
|
+
}, []), a = S(() => {
|
|
230
|
+
const L = u.current, $ = h.current;
|
|
231
|
+
if ($ && L) {
|
|
232
|
+
const M = L.localParticipant.getTrackPublication(Wt.Source.Camera);
|
|
233
|
+
if (M != null && M.track) {
|
|
234
234
|
try {
|
|
235
|
-
|
|
235
|
+
L.localParticipant.unpublishTrack(M.track);
|
|
236
236
|
} catch {
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
M.track.stop();
|
|
239
239
|
} else
|
|
240
240
|
$.stop();
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
}, []), c =
|
|
242
|
+
h.current = null, l(null), t(!1);
|
|
243
|
+
}, []), c = S(async (L) => {
|
|
244
244
|
const $ = u.current;
|
|
245
245
|
if ($) {
|
|
246
|
-
|
|
246
|
+
o(null);
|
|
247
247
|
try {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
await $.localParticipant.publishTrack(
|
|
252
|
-
const
|
|
253
|
-
l(
|
|
248
|
+
const M = { ...mn };
|
|
249
|
+
L && (M.deviceId = L);
|
|
250
|
+
const H = await dn(M);
|
|
251
|
+
await $.localParticipant.publishTrack(H), h.current = H;
|
|
252
|
+
const p = H.attach();
|
|
253
|
+
l(p), t(!0), L && d(L);
|
|
254
254
|
try {
|
|
255
255
|
$.localParticipant.publishData(
|
|
256
256
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
@@ -258,36 +258,36 @@ function pn() {
|
|
|
258
258
|
);
|
|
259
259
|
} catch {
|
|
260
260
|
}
|
|
261
|
-
} catch (
|
|
262
|
-
const
|
|
263
|
-
|
|
261
|
+
} catch (M) {
|
|
262
|
+
const H = M instanceof Error && M.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
263
|
+
o(H);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
}, []),
|
|
266
|
+
}, []), A = S(async () => {
|
|
267
267
|
e ? a() : await c(s || void 0);
|
|
268
|
-
}, [e, s, a, c]),
|
|
269
|
-
a(), await c(
|
|
270
|
-
}, [a, c]),
|
|
271
|
-
a(), u.current = null,
|
|
272
|
-
}, [a]),
|
|
268
|
+
}, [e, s, a, c]), C = S(async (L) => {
|
|
269
|
+
a(), await c(L);
|
|
270
|
+
}, [a, c]), R = S(() => {
|
|
271
|
+
a(), u.current = null, o(null), d("");
|
|
272
|
+
}, [a]), b = S(() => o(null), []);
|
|
273
273
|
return P(() => () => {
|
|
274
|
-
|
|
274
|
+
h.current && h.current.stop();
|
|
275
275
|
}, []), {
|
|
276
276
|
isEnabled: e,
|
|
277
277
|
error: r,
|
|
278
|
-
previewEl:
|
|
278
|
+
previewEl: i,
|
|
279
279
|
activeDeviceId: s,
|
|
280
|
-
toggle:
|
|
281
|
-
switchDevice:
|
|
282
|
-
attachRoom:
|
|
283
|
-
teardown:
|
|
284
|
-
clearError:
|
|
280
|
+
toggle: A,
|
|
281
|
+
switchDevice: C,
|
|
282
|
+
attachRoom: m,
|
|
283
|
+
teardown: R,
|
|
284
|
+
clearError: b
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const [e, t] =
|
|
287
|
+
function yn() {
|
|
288
|
+
const [e, t] = N(!1), [r, o] = N(null), [i, l] = N(null), s = I(null), d = S((c) => {
|
|
289
289
|
s.current = c;
|
|
290
|
-
}, []), u =
|
|
290
|
+
}, []), u = S(() => l(null), []), h = S(async () => {
|
|
291
291
|
const c = s.current;
|
|
292
292
|
if (c) {
|
|
293
293
|
if (e) {
|
|
@@ -298,15 +298,15 @@ function hn() {
|
|
|
298
298
|
u(), t(!1);
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
o(null);
|
|
302
302
|
try {
|
|
303
303
|
await c.localParticipant.setScreenShareEnabled(!0);
|
|
304
|
-
let
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
l(
|
|
304
|
+
let A = 0;
|
|
305
|
+
const C = () => {
|
|
306
|
+
const R = c.localParticipant.getTrackPublication(Wt.Source.ScreenShare);
|
|
307
|
+
if (R != null && R.track) {
|
|
308
|
+
const b = R.track.attach();
|
|
309
|
+
l(b), t(!0);
|
|
310
310
|
try {
|
|
311
311
|
c.localParticipant.publishData(
|
|
312
312
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
@@ -316,50 +316,50 @@ function hn() {
|
|
|
316
316
|
}
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
|
|
319
|
+
A++ < 10 ? setTimeout(C, 100) : t(!0);
|
|
320
320
|
};
|
|
321
|
-
|
|
322
|
-
} catch (
|
|
323
|
-
const
|
|
324
|
-
|
|
321
|
+
C();
|
|
322
|
+
} catch (A) {
|
|
323
|
+
const C = A instanceof Error ? A.name : "";
|
|
324
|
+
C !== "NotAllowedError" && C !== "AbortError" && o("Screen share unavailable. Try again."), t(!1);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
}, [e, u]),
|
|
327
|
+
}, [e, u]), m = S(() => {
|
|
328
328
|
const c = s.current;
|
|
329
329
|
if (c && e)
|
|
330
330
|
try {
|
|
331
331
|
c.localParticipant.setScreenShareEnabled(!1);
|
|
332
332
|
} catch {
|
|
333
333
|
}
|
|
334
|
-
u(), t(!1),
|
|
335
|
-
}, [e, u]), a =
|
|
336
|
-
return { isEnabled: e, error: r, previewEl:
|
|
334
|
+
u(), t(!1), o(null), s.current = null;
|
|
335
|
+
}, [e, u]), a = S(() => o(null), []);
|
|
336
|
+
return { isEnabled: e, error: r, previewEl: i, toggle: h, attachRoom: d, teardown: m, clearError: a };
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
const [e, t] =
|
|
338
|
+
function vn() {
|
|
339
|
+
const [e, t] = N([]), [r, o] = N([]), i = S(async () => {
|
|
340
340
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
341
341
|
try {
|
|
342
342
|
const l = await navigator.mediaDevices.enumerateDevices();
|
|
343
|
-
t(l.filter((s) => s.kind === "audioinput")),
|
|
343
|
+
t(l.filter((s) => s.kind === "audioinput")), o(l.filter((s) => s.kind === "videoinput"));
|
|
344
344
|
} catch {
|
|
345
345
|
}
|
|
346
346
|
}, []);
|
|
347
347
|
return P(() => {
|
|
348
|
-
if (
|
|
349
|
-
const l = () => void
|
|
348
|
+
if (i(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
349
|
+
const l = () => void i();
|
|
350
350
|
return navigator.mediaDevices.addEventListener("devicechange", l), () => navigator.mediaDevices.removeEventListener("devicechange", l);
|
|
351
|
-
}, [
|
|
351
|
+
}, [i]), { mics: e, cameras: r, refresh: i };
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
const [
|
|
353
|
+
function bn(e, t, r = !1) {
|
|
354
|
+
const [o, i] = N(null), [l, s] = N(null), [d, u] = N(!r && !!e);
|
|
355
355
|
return P(() => {
|
|
356
356
|
if (r || !e) {
|
|
357
357
|
u(!1);
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
|
-
const
|
|
361
|
-
return u(!0), s(null), fetch(`${
|
|
362
|
-
signal:
|
|
360
|
+
const h = new AbortController(), m = t || "https://app.livelayer.studio";
|
|
361
|
+
return u(!0), s(null), fetch(`${m}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
362
|
+
signal: h.signal
|
|
363
363
|
}).then(async (a) => {
|
|
364
364
|
if (!a.ok) {
|
|
365
365
|
const c = await a.json().catch(() => ({}));
|
|
@@ -367,13 +367,13 @@ function gn(e, t, r = !1) {
|
|
|
367
367
|
}
|
|
368
368
|
return a.json();
|
|
369
369
|
}).then((a) => {
|
|
370
|
-
|
|
370
|
+
h.signal.aborted || (i(a), u(!1));
|
|
371
371
|
}).catch((a) => {
|
|
372
|
-
|
|
373
|
-
}), () =>
|
|
374
|
-
}, [e, t, r]), { info:
|
|
372
|
+
h.signal.aborted || (s(a instanceof Error ? a.message : "Agent lookup failed"), u(!1));
|
|
373
|
+
}), () => h.abort();
|
|
374
|
+
}, [e, t, r]), { info: o, error: l, loading: d };
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function wn(e) {
|
|
377
377
|
if (typeof window > "u") return null;
|
|
378
378
|
try {
|
|
379
379
|
return window.localStorage.getItem(e);
|
|
@@ -381,53 +381,53 @@ function yn(e) {
|
|
|
381
381
|
return null;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function _n(e, t) {
|
|
385
385
|
if (!(typeof window > "u"))
|
|
386
386
|
try {
|
|
387
387
|
window.localStorage.setItem(e, t);
|
|
388
388
|
} catch {
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function xn({
|
|
392
392
|
value: e,
|
|
393
393
|
defaultValue: t = "expanded",
|
|
394
394
|
onChange: r
|
|
395
395
|
} = {}) {
|
|
396
|
-
const
|
|
396
|
+
const o = e !== void 0, [i, l] = N(t), s = o ? e : i, d = S(
|
|
397
397
|
(u) => {
|
|
398
|
-
u !== s && (
|
|
398
|
+
u !== s && (o || l(u), r == null || r(u));
|
|
399
399
|
},
|
|
400
|
-
[s,
|
|
400
|
+
[s, o, r]
|
|
401
401
|
);
|
|
402
402
|
return [s, d];
|
|
403
403
|
}
|
|
404
|
-
const
|
|
405
|
-
function
|
|
406
|
-
return e &&
|
|
404
|
+
const kn = ["hidden", "minimized", "expanded"];
|
|
405
|
+
function Ln(e) {
|
|
406
|
+
return e && kn.includes(e) ? e : null;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Sn({
|
|
409
409
|
value: e,
|
|
410
410
|
defaultValue: t = "expanded",
|
|
411
411
|
onChange: r,
|
|
412
|
-
persistKey:
|
|
413
|
-
disablePersistence:
|
|
412
|
+
persistKey: o = "ll-widget",
|
|
413
|
+
disablePersistence: i = !1
|
|
414
414
|
} = {}) {
|
|
415
|
-
const l = `${
|
|
415
|
+
const l = `${o}:display-mode`, s = I(!1), [d, u] = xn({
|
|
416
416
|
value: e,
|
|
417
417
|
defaultValue: t,
|
|
418
|
-
onChange: (
|
|
419
|
-
e === void 0 && !
|
|
418
|
+
onChange: (h) => {
|
|
419
|
+
e === void 0 && !i && _n(l, h), r == null || r(h);
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
422
|
return P(() => {
|
|
423
|
-
if (s.current || (s.current = !0,
|
|
424
|
-
const
|
|
425
|
-
|
|
423
|
+
if (s.current || (s.current = !0, i || e !== void 0)) return;
|
|
424
|
+
const h = Ln(wn(l));
|
|
425
|
+
h && h !== d && u(h);
|
|
426
426
|
}, []), [d, u];
|
|
427
427
|
}
|
|
428
|
-
const
|
|
429
|
-
function
|
|
430
|
-
const [t, r] =
|
|
428
|
+
const Cn = 640;
|
|
429
|
+
function En(e = Cn) {
|
|
430
|
+
const [t, r] = N(!1);
|
|
431
431
|
return P(() => {
|
|
432
432
|
if (e === !1) {
|
|
433
433
|
r(!1);
|
|
@@ -435,73 +435,73 @@ function Ln(e = kn) {
|
|
|
435
435
|
}
|
|
436
436
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
437
437
|
return;
|
|
438
|
-
const
|
|
439
|
-
return l(), typeof
|
|
440
|
-
|
|
438
|
+
const o = `(max-width: ${e - 1}px)`, i = window.matchMedia(o), l = () => r(i.matches);
|
|
439
|
+
return l(), typeof i.addEventListener == "function" ? (i.addEventListener("change", l), () => i.removeEventListener("change", l)) : (i.addListener(l), () => {
|
|
440
|
+
i.removeListener(l);
|
|
441
441
|
});
|
|
442
442
|
}, [e]), t;
|
|
443
443
|
}
|
|
444
|
-
const
|
|
445
|
-
function
|
|
446
|
-
if (typeof window > "u" || window.history[
|
|
444
|
+
const St = "__llHistoryPatched", Ke = "ll:pathname";
|
|
445
|
+
function Nn() {
|
|
446
|
+
if (typeof window > "u" || window.history[St]) return;
|
|
447
447
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
448
448
|
window.history.pushState = function(...r) {
|
|
449
|
-
const
|
|
450
|
-
return window.dispatchEvent(new Event(
|
|
449
|
+
const o = e.apply(this, r);
|
|
450
|
+
return window.dispatchEvent(new Event(Ke)), o;
|
|
451
451
|
}, window.history.replaceState = function(...r) {
|
|
452
|
-
const
|
|
453
|
-
return window.dispatchEvent(new Event(
|
|
454
|
-
}, window.history[
|
|
452
|
+
const o = t.apply(this, r);
|
|
453
|
+
return window.dispatchEvent(new Event(Ke)), o;
|
|
454
|
+
}, window.history[St] = !0;
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function Ct() {
|
|
457
457
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
const [t, r] =
|
|
461
|
-
() => e ??
|
|
459
|
+
function An(e) {
|
|
460
|
+
const [t, r] = N(
|
|
461
|
+
() => e ?? Ct()
|
|
462
462
|
);
|
|
463
463
|
return P(() => {
|
|
464
464
|
if (e !== void 0) return;
|
|
465
|
-
|
|
466
|
-
const
|
|
467
|
-
return
|
|
468
|
-
window.removeEventListener("popstate",
|
|
465
|
+
Nn();
|
|
466
|
+
const o = () => r(Ct());
|
|
467
|
+
return o(), window.addEventListener("popstate", o), window.addEventListener(Ke, o), () => {
|
|
468
|
+
window.removeEventListener("popstate", o), window.removeEventListener(Ke, o);
|
|
469
469
|
};
|
|
470
470
|
}, [e]), e ?? t;
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
function
|
|
474
|
-
return e.replace(
|
|
472
|
+
const Et = /* @__PURE__ */ new Map(), Rn = /[\\^$+?.()|{}[\]]/g;
|
|
473
|
+
function In(e) {
|
|
474
|
+
return e.replace(Rn, "\\$&");
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
const t =
|
|
476
|
+
function Mn(e) {
|
|
477
|
+
const t = Et.get(e);
|
|
478
478
|
if (t) return t;
|
|
479
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e,
|
|
480
|
-
return
|
|
479
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, o = "", i = "", l = r.replace(/\*\*/g, o).replace(/\*/g, i), d = In(l).replace(new RegExp(`\\/${o}`, "g"), "(?:\\/.*)?").replace(new RegExp(o, "g"), ".*").replace(new RegExp(i, "g"), "[^/]+"), u = new RegExp(`^${d}\\/?$`);
|
|
480
|
+
return Et.set(e, u), u;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Tn(e, t) {
|
|
483
483
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
484
|
-
return
|
|
484
|
+
return Mn(e).test(r);
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
486
|
+
function Pn(e, t) {
|
|
487
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : Tn(e, t);
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Nt(e, t) {
|
|
490
490
|
if (!e || e.length === 0) return !1;
|
|
491
491
|
for (const r of e)
|
|
492
|
-
if (
|
|
492
|
+
if (Pn(r, t)) return !0;
|
|
493
493
|
return !1;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
return e === void 0 ? !0 :
|
|
495
|
+
function Dn(e, t, r) {
|
|
496
|
+
return e === void 0 ? !0 : Nt(r, e) ? !1 : t && t.length > 0 ? Nt(t, e) : !0;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
return
|
|
500
|
-
() =>
|
|
498
|
+
function $n(e, t, r) {
|
|
499
|
+
return Je(
|
|
500
|
+
() => Dn(e, t, r),
|
|
501
501
|
[e, t, r]
|
|
502
502
|
);
|
|
503
503
|
}
|
|
504
|
-
const
|
|
504
|
+
const At = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ _(
|
|
505
505
|
"svg",
|
|
506
506
|
{
|
|
507
507
|
className: t,
|
|
@@ -547,7 +547,7 @@ const Nt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
547
547
|
}
|
|
548
548
|
)
|
|
549
549
|
}
|
|
550
|
-
),
|
|
550
|
+
), Rt = ({ className: e }) => /* @__PURE__ */ n(
|
|
551
551
|
"svg",
|
|
552
552
|
{
|
|
553
553
|
className: e,
|
|
@@ -565,7 +565,7 @@ const Nt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
565
565
|
}
|
|
566
566
|
)
|
|
567
567
|
}
|
|
568
|
-
),
|
|
568
|
+
), zn = ({ className: e }) => /* @__PURE__ */ n(
|
|
569
569
|
"svg",
|
|
570
570
|
{
|
|
571
571
|
className: e,
|
|
@@ -576,12 +576,12 @@ const Nt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
576
576
|
"aria-hidden": "true",
|
|
577
577
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
578
578
|
}
|
|
579
|
-
),
|
|
579
|
+
), Hn = {
|
|
580
580
|
left: 180,
|
|
581
581
|
right: 0,
|
|
582
582
|
up: -90,
|
|
583
583
|
down: 90
|
|
584
|
-
},
|
|
584
|
+
}, On = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
585
585
|
"svg",
|
|
586
586
|
{
|
|
587
587
|
className: t,
|
|
@@ -589,19 +589,19 @@ const Nt = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
589
589
|
viewBox: "0 0 24 24",
|
|
590
590
|
stroke: "currentColor",
|
|
591
591
|
strokeWidth: 2,
|
|
592
|
-
style: { transform: `rotate(${
|
|
592
|
+
style: { transform: `rotate(${Hn[e]}deg)` },
|
|
593
593
|
"aria-hidden": "true",
|
|
594
594
|
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
595
595
|
}
|
|
596
596
|
);
|
|
597
|
-
function
|
|
597
|
+
function qn(e) {
|
|
598
598
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
599
599
|
}
|
|
600
|
-
const
|
|
601
|
-
function
|
|
600
|
+
const Ft = "ll-hidden-tab-center-y", Bn = 5, It = 16;
|
|
601
|
+
function Wn() {
|
|
602
602
|
if (typeof window > "u") return null;
|
|
603
603
|
try {
|
|
604
|
-
const e = window.localStorage.getItem(
|
|
604
|
+
const e = window.localStorage.getItem(Ft);
|
|
605
605
|
if (!e) return null;
|
|
606
606
|
const t = Number.parseFloat(e);
|
|
607
607
|
return Number.isFinite(t) ? t : null;
|
|
@@ -612,161 +612,161 @@ function On() {
|
|
|
612
612
|
function Mt(e) {
|
|
613
613
|
if (!(typeof window > "u"))
|
|
614
614
|
try {
|
|
615
|
-
window.localStorage.setItem(
|
|
615
|
+
window.localStorage.setItem(Ft, String(e));
|
|
616
616
|
} catch {
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
const
|
|
619
|
+
const Fn = ({
|
|
620
620
|
position: e,
|
|
621
621
|
isMobile: t,
|
|
622
622
|
isSpeaking: r,
|
|
623
|
-
onExpand:
|
|
624
|
-
label:
|
|
623
|
+
onExpand: o,
|
|
624
|
+
label: i = "Open widget"
|
|
625
625
|
}) => {
|
|
626
|
-
const l =
|
|
627
|
-
(
|
|
628
|
-
if (typeof window > "u") return
|
|
629
|
-
const E = d / 2,
|
|
630
|
-
return
|
|
626
|
+
const l = qn(e), s = l === "right" ? "left" : "right", d = t ? 80 : 72, [u, h] = N(null), [m, a] = N(!1), c = I(null), A = I(!1), C = S(
|
|
627
|
+
(g) => {
|
|
628
|
+
if (typeof window > "u") return g;
|
|
629
|
+
const E = d / 2, x = It + E, q = window.innerHeight - It - E;
|
|
630
|
+
return q < x ? Math.max(x, g) : Math.max(x, Math.min(q, g));
|
|
631
631
|
},
|
|
632
632
|
[d]
|
|
633
633
|
);
|
|
634
634
|
P(() => {
|
|
635
|
-
const
|
|
636
|
-
|
|
635
|
+
const g = Wn();
|
|
636
|
+
h(C(g ?? window.innerHeight / 2));
|
|
637
637
|
const E = () => {
|
|
638
|
-
|
|
638
|
+
h((x) => x === null ? null : C(x));
|
|
639
639
|
};
|
|
640
640
|
return window.addEventListener("resize", E), () => window.removeEventListener("resize", E);
|
|
641
|
-
}, [
|
|
642
|
-
const
|
|
643
|
-
(
|
|
644
|
-
if (!(
|
|
641
|
+
}, [C]);
|
|
642
|
+
const R = S(
|
|
643
|
+
(g) => {
|
|
644
|
+
if (!(g.pointerType === "mouse" && g.button !== 0) && u !== null) {
|
|
645
645
|
try {
|
|
646
|
-
|
|
646
|
+
g.currentTarget.setPointerCapture(g.pointerId);
|
|
647
647
|
} catch {
|
|
648
648
|
}
|
|
649
649
|
c.current = {
|
|
650
|
-
startClientY:
|
|
650
|
+
startClientY: g.clientY,
|
|
651
651
|
startCenterY: u,
|
|
652
652
|
moved: !1
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
655
|
},
|
|
656
656
|
[u]
|
|
657
|
-
),
|
|
658
|
-
(
|
|
657
|
+
), b = S(
|
|
658
|
+
(g) => {
|
|
659
659
|
const E = c.current;
|
|
660
660
|
if (!E) return;
|
|
661
|
-
const
|
|
662
|
-
!E.moved && Math.abs(
|
|
661
|
+
const x = g.clientY - E.startClientY;
|
|
662
|
+
!E.moved && Math.abs(x) > Bn && (E.moved = !0, a(!0)), E.moved && h(C(E.startCenterY + x));
|
|
663
663
|
},
|
|
664
|
-
[
|
|
665
|
-
),
|
|
666
|
-
(
|
|
664
|
+
[C]
|
|
665
|
+
), L = S(
|
|
666
|
+
(g) => {
|
|
667
667
|
const E = c.current;
|
|
668
668
|
if (E) {
|
|
669
669
|
try {
|
|
670
|
-
|
|
670
|
+
g.currentTarget.releasePointerCapture(g.pointerId);
|
|
671
671
|
} catch {
|
|
672
672
|
}
|
|
673
|
-
c.current = null, E.moved && (a(!1),
|
|
673
|
+
c.current = null, E.moved && (a(!1), A.current = !0, h((x) => (x !== null && Mt(x), x)));
|
|
674
674
|
}
|
|
675
675
|
},
|
|
676
676
|
[]
|
|
677
|
-
), $ =
|
|
678
|
-
if (
|
|
679
|
-
|
|
677
|
+
), $ = S(() => {
|
|
678
|
+
if (A.current) {
|
|
679
|
+
A.current = !1;
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
|
-
|
|
683
|
-
}, [
|
|
684
|
-
(
|
|
685
|
-
if (
|
|
686
|
-
|
|
687
|
-
const E =
|
|
688
|
-
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
return Mt(
|
|
682
|
+
o();
|
|
683
|
+
}, [o]), M = S(
|
|
684
|
+
(g) => {
|
|
685
|
+
if (g.key === "ArrowUp" || g.key === "ArrowDown") {
|
|
686
|
+
g.preventDefault();
|
|
687
|
+
const E = g.key === "ArrowUp" ? -8 : 8;
|
|
688
|
+
h((x) => {
|
|
689
|
+
if (x === null) return x;
|
|
690
|
+
const q = C(x + E);
|
|
691
|
+
return Mt(q), q;
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
694
|
},
|
|
695
|
-
[
|
|
696
|
-
),
|
|
695
|
+
[C]
|
|
696
|
+
), H = [
|
|
697
697
|
"ll-hidden",
|
|
698
698
|
`ll-hidden--${l}`,
|
|
699
699
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
700
700
|
r ? "ll-hidden--speaking" : null,
|
|
701
|
-
|
|
702
|
-
].filter(Boolean).join(" "),
|
|
701
|
+
m ? "is-dragging" : null
|
|
702
|
+
].filter(Boolean).join(" "), p = u === null ? void 0 : { top: `${u - d / 2}px`, transform: "none" };
|
|
703
703
|
return /* @__PURE__ */ n(
|
|
704
704
|
"button",
|
|
705
705
|
{
|
|
706
706
|
type: "button",
|
|
707
|
-
className:
|
|
708
|
-
onPointerDown:
|
|
709
|
-
onPointerMove:
|
|
710
|
-
onPointerUp:
|
|
711
|
-
onPointerCancel:
|
|
707
|
+
className: H,
|
|
708
|
+
onPointerDown: R,
|
|
709
|
+
onPointerMove: b,
|
|
710
|
+
onPointerUp: L,
|
|
711
|
+
onPointerCancel: L,
|
|
712
712
|
onClick: $,
|
|
713
|
-
onKeyDown:
|
|
714
|
-
"aria-label":
|
|
713
|
+
onKeyDown: M,
|
|
714
|
+
"aria-label": i,
|
|
715
715
|
"data-position": e,
|
|
716
|
-
style:
|
|
717
|
-
children: /* @__PURE__ */ n(
|
|
716
|
+
style: p,
|
|
717
|
+
children: /* @__PURE__ */ n(On, { direction: s, className: "ll-hidden__chevron" })
|
|
718
718
|
}
|
|
719
719
|
);
|
|
720
|
-
},
|
|
720
|
+
}, Un = ({
|
|
721
721
|
audioLevel: e,
|
|
722
722
|
bars: t = 20,
|
|
723
723
|
maxHeight: r = 20,
|
|
724
|
-
minHeight:
|
|
725
|
-
className:
|
|
724
|
+
minHeight: o = 4,
|
|
725
|
+
className: i,
|
|
726
726
|
barClassName: l
|
|
727
727
|
}) => {
|
|
728
|
-
const s =
|
|
729
|
-
const
|
|
730
|
-
return Array.from({ length: t }, (a, c) => 0.5 + c *
|
|
728
|
+
const s = I(null), d = I([]), u = Je(() => {
|
|
729
|
+
const m = (Math.sqrt(5) - 1) / 2;
|
|
730
|
+
return Array.from({ length: t }, (a, c) => 0.5 + c * m % 1 * 0.5);
|
|
731
731
|
}, [t]);
|
|
732
732
|
P(() => e.subscribe((a) => {
|
|
733
733
|
for (let c = 0; c < t; c++) {
|
|
734
|
-
const
|
|
735
|
-
if (!
|
|
736
|
-
const
|
|
737
|
-
|
|
734
|
+
const A = d.current[c];
|
|
735
|
+
if (!A) continue;
|
|
736
|
+
const C = Math.max(o, a * r * u[c]);
|
|
737
|
+
A.style.height = `${C}px`;
|
|
738
738
|
}
|
|
739
|
-
}), [e, t, r,
|
|
740
|
-
const
|
|
741
|
-
return /* @__PURE__ */ n("div", { ref: s, className:
|
|
739
|
+
}), [e, t, r, o, u]);
|
|
740
|
+
const h = ["ll-waveform", i].filter(Boolean).join(" ");
|
|
741
|
+
return /* @__PURE__ */ n("div", { ref: s, className: h, "aria-hidden": "true", children: Array.from({ length: t }, (m, a) => /* @__PURE__ */ n(
|
|
742
742
|
"div",
|
|
743
743
|
{
|
|
744
744
|
ref: (c) => {
|
|
745
745
|
d.current[a] = c;
|
|
746
746
|
},
|
|
747
747
|
className: ["ll-waveform__bar", l].filter(Boolean).join(" "),
|
|
748
|
-
style: { height: `${
|
|
748
|
+
style: { height: `${o}px` }
|
|
749
749
|
},
|
|
750
750
|
a
|
|
751
751
|
)) });
|
|
752
|
-
},
|
|
752
|
+
}, jn = ({
|
|
753
753
|
position: e,
|
|
754
754
|
isMobile: t,
|
|
755
755
|
agentName: r,
|
|
756
|
-
avatarImageUrl:
|
|
757
|
-
agentState:
|
|
756
|
+
avatarImageUrl: o,
|
|
757
|
+
agentState: i,
|
|
758
758
|
isMuted: l,
|
|
759
759
|
audioLevel: s,
|
|
760
760
|
onExpand: d,
|
|
761
761
|
onToggleMute: u,
|
|
762
|
-
onClose:
|
|
762
|
+
onClose: h
|
|
763
763
|
}) => t ? /* @__PURE__ */ n(
|
|
764
764
|
"div",
|
|
765
765
|
{
|
|
766
766
|
className: "ll-minimized ll-minimized--mobile",
|
|
767
767
|
role: "region",
|
|
768
768
|
"aria-label": `${r} widget`,
|
|
769
|
-
children: /* @__PURE__ */
|
|
769
|
+
children: /* @__PURE__ */ _(
|
|
770
770
|
"button",
|
|
771
771
|
{
|
|
772
772
|
type: "button",
|
|
@@ -774,19 +774,19 @@ const qn = ({
|
|
|
774
774
|
onClick: d,
|
|
775
775
|
"aria-label": `Expand ${r} widget`,
|
|
776
776
|
children: [
|
|
777
|
-
|
|
777
|
+
o ? (
|
|
778
778
|
// eslint-disable-next-line @next/next/no-img-element
|
|
779
779
|
/* @__PURE__ */ n(
|
|
780
780
|
"img",
|
|
781
781
|
{
|
|
782
|
-
src:
|
|
782
|
+
src: o,
|
|
783
783
|
alt: r,
|
|
784
784
|
className: "ll-minimized__avatar"
|
|
785
785
|
}
|
|
786
786
|
)
|
|
787
787
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
788
788
|
/* @__PURE__ */ n(
|
|
789
|
-
|
|
789
|
+
Un,
|
|
790
790
|
{
|
|
791
791
|
audioLevel: s,
|
|
792
792
|
bars: 16,
|
|
@@ -795,24 +795,24 @@ const qn = ({
|
|
|
795
795
|
}
|
|
796
796
|
),
|
|
797
797
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
798
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ _("div", { className: "ll-minimized__controls", children: [
|
|
799
799
|
/* @__PURE__ */ n(
|
|
800
800
|
"span",
|
|
801
801
|
{
|
|
802
802
|
className: "ll-minimized__btn",
|
|
803
803
|
role: "button",
|
|
804
804
|
tabIndex: 0,
|
|
805
|
-
onClick: (
|
|
806
|
-
|
|
805
|
+
onClick: (m) => {
|
|
806
|
+
m.stopPropagation(), u();
|
|
807
807
|
},
|
|
808
|
-
onKeyDown: (
|
|
809
|
-
(
|
|
808
|
+
onKeyDown: (m) => {
|
|
809
|
+
(m.key === "Enter" || m.key === " ") && (m.stopPropagation(), m.preventDefault(), u());
|
|
810
810
|
},
|
|
811
811
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
812
|
-
children: /* @__PURE__ */ n(
|
|
812
|
+
children: /* @__PURE__ */ n(At, { muted: l, className: "ll-minimized__icon" })
|
|
813
813
|
}
|
|
814
814
|
),
|
|
815
|
-
/* @__PURE__ */ n(
|
|
815
|
+
/* @__PURE__ */ n(Rt, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
816
816
|
] })
|
|
817
817
|
]
|
|
818
818
|
}
|
|
@@ -825,23 +825,23 @@ const qn = ({
|
|
|
825
825
|
"data-position": e,
|
|
826
826
|
role: "region",
|
|
827
827
|
"aria-label": `${r} widget`,
|
|
828
|
-
children: /* @__PURE__ */
|
|
829
|
-
|
|
828
|
+
children: /* @__PURE__ */ _("div", { className: "ll-minimized__surface", children: [
|
|
829
|
+
o ? (
|
|
830
830
|
// eslint-disable-next-line @next/next/no-img-element
|
|
831
831
|
/* @__PURE__ */ n(
|
|
832
832
|
"img",
|
|
833
833
|
{
|
|
834
|
-
src:
|
|
834
|
+
src: o,
|
|
835
835
|
alt: r,
|
|
836
836
|
className: "ll-minimized__avatar"
|
|
837
837
|
}
|
|
838
838
|
)
|
|
839
839
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
840
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ _("div", { className: "ll-minimized__meta", children: [
|
|
841
841
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
842
|
-
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children:
|
|
842
|
+
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children: i === "speaking" ? "Speaking" : i === "thinking" ? "Thinking" : "Listening" })
|
|
843
843
|
] }),
|
|
844
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ _("div", { className: "ll-minimized__controls", children: [
|
|
845
845
|
/* @__PURE__ */ n(
|
|
846
846
|
"button",
|
|
847
847
|
{
|
|
@@ -849,7 +849,7 @@ const qn = ({
|
|
|
849
849
|
className: "ll-minimized__btn",
|
|
850
850
|
onClick: u,
|
|
851
851
|
"aria-label": l ? "Unmute microphone" : "Mute microphone",
|
|
852
|
-
children: /* @__PURE__ */ n(
|
|
852
|
+
children: /* @__PURE__ */ n(At, { muted: l, className: "ll-minimized__icon" })
|
|
853
853
|
}
|
|
854
854
|
),
|
|
855
855
|
/* @__PURE__ */ n(
|
|
@@ -859,7 +859,7 @@ const qn = ({
|
|
|
859
859
|
className: "ll-minimized__btn",
|
|
860
860
|
onClick: d,
|
|
861
861
|
"aria-label": `Expand ${r} widget`,
|
|
862
|
-
children: /* @__PURE__ */ n(
|
|
862
|
+
children: /* @__PURE__ */ n(Rt, { className: "ll-minimized__icon" })
|
|
863
863
|
}
|
|
864
864
|
),
|
|
865
865
|
/* @__PURE__ */ n(
|
|
@@ -867,22 +867,22 @@ const qn = ({
|
|
|
867
867
|
{
|
|
868
868
|
type: "button",
|
|
869
869
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
870
|
-
onClick:
|
|
870
|
+
onClick: h,
|
|
871
871
|
"aria-label": "Close widget",
|
|
872
|
-
children: /* @__PURE__ */ n(
|
|
872
|
+
children: /* @__PURE__ */ n(zn, { className: "ll-minimized__icon" })
|
|
873
873
|
}
|
|
874
874
|
)
|
|
875
875
|
] })
|
|
876
876
|
] })
|
|
877
877
|
}
|
|
878
|
-
),
|
|
878
|
+
), Vn = ({
|
|
879
879
|
src: e,
|
|
880
880
|
alt: t,
|
|
881
881
|
preCannedPlaying: r = !1,
|
|
882
|
-
className:
|
|
883
|
-
style:
|
|
882
|
+
className: o,
|
|
883
|
+
style: i
|
|
884
884
|
}) => {
|
|
885
|
-
const [l, s] =
|
|
885
|
+
const [l, s] = N(!1), d = I(e);
|
|
886
886
|
if (P(() => {
|
|
887
887
|
d.current !== e && (d.current = e, s(!1));
|
|
888
888
|
}, [e]), !e) return null;
|
|
@@ -896,7 +896,7 @@ const qn = ({
|
|
|
896
896
|
transition: "opacity 500ms ease, transform 500ms ease",
|
|
897
897
|
transform: r ? "scale(1.02)" : "scale(1)",
|
|
898
898
|
opacity: l ? 1 : 0,
|
|
899
|
-
...
|
|
899
|
+
...i
|
|
900
900
|
};
|
|
901
901
|
return (
|
|
902
902
|
// eslint-disable-next-line @next/next/no-img-element
|
|
@@ -905,7 +905,7 @@ const qn = ({
|
|
|
905
905
|
{
|
|
906
906
|
src: e,
|
|
907
907
|
alt: t,
|
|
908
|
-
className:
|
|
908
|
+
className: o,
|
|
909
909
|
style: u,
|
|
910
910
|
loading: "eager",
|
|
911
911
|
fetchpriority: "high",
|
|
@@ -913,41 +913,41 @@ const qn = ({
|
|
|
913
913
|
}
|
|
914
914
|
)
|
|
915
915
|
);
|
|
916
|
-
},
|
|
916
|
+
}, Yn = ({
|
|
917
917
|
position: e,
|
|
918
918
|
isMobile: t,
|
|
919
919
|
agentName: r,
|
|
920
|
-
avatarImageUrl:
|
|
921
|
-
idleLoopUrl:
|
|
920
|
+
avatarImageUrl: o,
|
|
921
|
+
idleLoopUrl: i,
|
|
922
922
|
greeting: l,
|
|
923
923
|
branding: s,
|
|
924
924
|
teamMembers: d,
|
|
925
925
|
currentTeamMemberId: u,
|
|
926
|
-
isSwitchingTeamMember:
|
|
927
|
-
teamSwitcherOpen:
|
|
926
|
+
isSwitchingTeamMember: h,
|
|
927
|
+
teamSwitcherOpen: m,
|
|
928
928
|
onToggleTeamSwitcher: a,
|
|
929
929
|
onSelectTeamMember: c,
|
|
930
|
-
languageMenuOpen:
|
|
931
|
-
onToggleLanguageMenu:
|
|
932
|
-
connectionState:
|
|
933
|
-
agentState:
|
|
934
|
-
transcript:
|
|
930
|
+
languageMenuOpen: A,
|
|
931
|
+
onToggleLanguageMenu: C,
|
|
932
|
+
connectionState: R,
|
|
933
|
+
agentState: b,
|
|
934
|
+
transcript: L,
|
|
935
935
|
canResume: $,
|
|
936
|
-
needsUserGesture:
|
|
937
|
-
error:
|
|
938
|
-
isMuted:
|
|
939
|
-
micError:
|
|
936
|
+
needsUserGesture: M,
|
|
937
|
+
error: H,
|
|
938
|
+
isMuted: p,
|
|
939
|
+
micError: g,
|
|
940
940
|
micDevices: E,
|
|
941
|
-
isCameraEnabled:
|
|
942
|
-
cameraPreviewEl:
|
|
943
|
-
cameraDevices:
|
|
941
|
+
isCameraEnabled: x,
|
|
942
|
+
cameraPreviewEl: q,
|
|
943
|
+
cameraDevices: X,
|
|
944
944
|
activeCameraId: de,
|
|
945
945
|
isScreenShareEnabled: Q,
|
|
946
946
|
screenPreviewEl: Z,
|
|
947
947
|
isSpeakerMuted: ue,
|
|
948
948
|
allowCamera: qe,
|
|
949
949
|
allowScreenShare: Be,
|
|
950
|
-
allowTyping:
|
|
950
|
+
allowTyping: We,
|
|
951
951
|
avatarVideoContainerRef: Ne,
|
|
952
952
|
onConnect: fe,
|
|
953
953
|
onDisconnect: ge,
|
|
@@ -956,49 +956,49 @@ const qn = ({
|
|
|
956
956
|
onToggleMute: be,
|
|
957
957
|
onToggleCamera: we,
|
|
958
958
|
onSwitchCameraDevice: _e,
|
|
959
|
-
onToggleScreenShare:
|
|
959
|
+
onToggleScreenShare: W,
|
|
960
960
|
onToggleSpeaker: Qe,
|
|
961
961
|
onSendMessage: Fe,
|
|
962
|
-
onMinimize:
|
|
962
|
+
onMinimize: Ue,
|
|
963
963
|
onClose: Ae,
|
|
964
|
-
onClearMicError:
|
|
964
|
+
onClearMicError: Re
|
|
965
965
|
}) => {
|
|
966
966
|
var Pe;
|
|
967
|
-
const
|
|
967
|
+
const oe = L.length > 0 ? L[L.length - 1] : null, pe = ((d == null ? void 0 : d.length) ?? 0) > 1, xe = R === "connecting" || R === "connected", ee = R === "connected", V = R === "idle" || R === "disconnected" || R === "error", Ie = I(null), ie = I(null);
|
|
968
968
|
P(() => {
|
|
969
|
-
const
|
|
970
|
-
|
|
971
|
-
}, [
|
|
972
|
-
const
|
|
973
|
-
|
|
969
|
+
const y = Ie.current;
|
|
970
|
+
y && (y.innerHTML = "", q && (q.style.width = "100%", q.style.height = "100%", q.style.objectFit = "cover", q.style.transform = "scaleX(-1)", y.appendChild(q)));
|
|
971
|
+
}, [q]), P(() => {
|
|
972
|
+
const y = ie.current;
|
|
973
|
+
y && (y.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", y.appendChild(Z)));
|
|
974
974
|
}, [Z]);
|
|
975
|
-
const [
|
|
975
|
+
const [J, ne] = N(!1), [le, Y] = N(!1);
|
|
976
976
|
P(() => {
|
|
977
|
-
if (!
|
|
978
|
-
const
|
|
979
|
-
ne(!1), Y(!1),
|
|
977
|
+
if (!J && !le && !A && !m) return;
|
|
978
|
+
const y = () => {
|
|
979
|
+
ne(!1), Y(!1), A && C(), m && a();
|
|
980
980
|
};
|
|
981
|
-
return document.addEventListener("click",
|
|
981
|
+
return document.addEventListener("click", y), () => document.removeEventListener("click", y);
|
|
982
982
|
}, [
|
|
983
|
-
|
|
983
|
+
J,
|
|
984
984
|
le,
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
985
|
+
A,
|
|
986
|
+
m,
|
|
987
|
+
C,
|
|
988
988
|
a
|
|
989
989
|
]);
|
|
990
|
-
const [
|
|
991
|
-
(
|
|
992
|
-
|
|
993
|
-
const
|
|
994
|
-
|
|
990
|
+
const [K, ae] = N(""), Me = S(
|
|
991
|
+
(y) => {
|
|
992
|
+
y.preventDefault();
|
|
993
|
+
const j = K.trim();
|
|
994
|
+
j && (Fe(j), ae(""));
|
|
995
995
|
},
|
|
996
|
-
[
|
|
997
|
-
), Ze = s.productName || "Live Layer", ke = ee && (
|
|
996
|
+
[K, Fe]
|
|
997
|
+
), Ze = s.productName || "Live Layer", ke = ee && (oe != null && oe.text) ? oe.text : l || "", Te = [
|
|
998
998
|
"ll-expanded",
|
|
999
999
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1000
1000
|
].join(" ");
|
|
1001
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ _(
|
|
1002
1002
|
"div",
|
|
1003
1003
|
{
|
|
1004
1004
|
className: Te,
|
|
@@ -1007,20 +1007,20 @@ const qn = ({
|
|
|
1007
1007
|
role: "dialog",
|
|
1008
1008
|
"aria-label": `${r} widget`,
|
|
1009
1009
|
children: [
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
|
|
1012
|
-
|
|
1010
|
+
/* @__PURE__ */ _("div", { className: "ll-expanded__bg", children: [
|
|
1011
|
+
o ? /* @__PURE__ */ n(
|
|
1012
|
+
Vn,
|
|
1013
1013
|
{
|
|
1014
|
-
src:
|
|
1014
|
+
src: o,
|
|
1015
1015
|
alt: r,
|
|
1016
1016
|
className: "ll-expanded__bg-img"
|
|
1017
1017
|
}
|
|
1018
1018
|
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((Pe = r == null ? void 0 : r.charAt(0)) == null ? void 0 : Pe.toUpperCase()) || "A" }) }),
|
|
1019
|
-
|
|
1019
|
+
i && !ee && /* @__PURE__ */ n(
|
|
1020
1020
|
"video",
|
|
1021
1021
|
{
|
|
1022
1022
|
className: "ll-expanded__bg-idle",
|
|
1023
|
-
src:
|
|
1023
|
+
src: i,
|
|
1024
1024
|
autoPlay: !0,
|
|
1025
1025
|
loop: !0,
|
|
1026
1026
|
muted: !0,
|
|
@@ -1029,11 +1029,11 @@ const qn = ({
|
|
|
1029
1029
|
)
|
|
1030
1030
|
] }),
|
|
1031
1031
|
/* @__PURE__ */ n("div", { ref: Ne, className: "ll-expanded__video" }),
|
|
1032
|
-
|
|
1032
|
+
R === "connecting" && /* @__PURE__ */ _("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1033
1033
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1034
|
-
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children:
|
|
1034
|
+
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: h ? "Switching..." : "Connecting..." })
|
|
1035
1035
|
] }),
|
|
1036
|
-
|
|
1036
|
+
M && ee && /* @__PURE__ */ _(
|
|
1037
1037
|
"button",
|
|
1038
1038
|
{
|
|
1039
1039
|
type: "button",
|
|
@@ -1045,68 +1045,68 @@ const qn = ({
|
|
|
1045
1045
|
]
|
|
1046
1046
|
}
|
|
1047
1047
|
),
|
|
1048
|
-
xe ? /* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1048
|
+
xe ? /* @__PURE__ */ _("div", { className: "ll-expanded__topbar", children: [
|
|
1049
|
+
/* @__PURE__ */ _("div", { className: "ll-expanded__topbar-left", children: [
|
|
1050
|
+
/* @__PURE__ */ _("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1051
|
+
/* @__PURE__ */ _(
|
|
1052
1052
|
"button",
|
|
1053
1053
|
{
|
|
1054
1054
|
type: "button",
|
|
1055
1055
|
className: "ll-hpill",
|
|
1056
|
-
onClick: (
|
|
1057
|
-
pe && (
|
|
1056
|
+
onClick: (y) => {
|
|
1057
|
+
pe && (y.stopPropagation(), a());
|
|
1058
1058
|
},
|
|
1059
1059
|
"aria-haspopup": pe ? "listbox" : void 0,
|
|
1060
|
-
"aria-expanded": pe ?
|
|
1060
|
+
"aria-expanded": pe ? m : void 0,
|
|
1061
1061
|
children: [
|
|
1062
1062
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1063
1063
|
pe && /* @__PURE__ */ n(Ye, {})
|
|
1064
1064
|
]
|
|
1065
1065
|
}
|
|
1066
1066
|
),
|
|
1067
|
-
pe &&
|
|
1067
|
+
pe && m && /* @__PURE__ */ n(
|
|
1068
1068
|
"div",
|
|
1069
1069
|
{
|
|
1070
1070
|
className: "ll-hmenu",
|
|
1071
|
-
onClick: (
|
|
1071
|
+
onClick: (y) => y.stopPropagation(),
|
|
1072
1072
|
role: "listbox",
|
|
1073
|
-
children: d == null ? void 0 : d.map((
|
|
1073
|
+
children: d == null ? void 0 : d.map((y) => /* @__PURE__ */ _(
|
|
1074
1074
|
"button",
|
|
1075
1075
|
{
|
|
1076
1076
|
type: "button",
|
|
1077
|
-
className: `ll-hmenu__item ${
|
|
1078
|
-
onClick: () => c(
|
|
1077
|
+
className: `ll-hmenu__item ${y.id === u ? "is-active" : ""}`,
|
|
1078
|
+
onClick: () => c(y.id),
|
|
1079
1079
|
role: "option",
|
|
1080
|
-
"aria-selected":
|
|
1080
|
+
"aria-selected": y.id === u,
|
|
1081
1081
|
children: [
|
|
1082
|
-
|
|
1082
|
+
y.avatarImageUrl && /* @__PURE__ */ n(
|
|
1083
1083
|
"img",
|
|
1084
1084
|
{
|
|
1085
|
-
src:
|
|
1085
|
+
src: y.avatarImageUrl,
|
|
1086
1086
|
alt: "",
|
|
1087
1087
|
className: "ll-hmenu__avatar"
|
|
1088
1088
|
}
|
|
1089
1089
|
),
|
|
1090
|
-
/* @__PURE__ */ n("span", { className: "ll-hmenu__name", children:
|
|
1091
|
-
|
|
1090
|
+
/* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: y.name }),
|
|
1091
|
+
y.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: y.role })
|
|
1092
1092
|
]
|
|
1093
1093
|
},
|
|
1094
|
-
|
|
1094
|
+
y.id
|
|
1095
1095
|
))
|
|
1096
1096
|
}
|
|
1097
1097
|
)
|
|
1098
1098
|
] }),
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ _("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1100
|
+
/* @__PURE__ */ _(
|
|
1101
1101
|
"button",
|
|
1102
1102
|
{
|
|
1103
1103
|
type: "button",
|
|
1104
1104
|
className: "ll-hpill ll-hpill--compact",
|
|
1105
|
-
onClick: (
|
|
1106
|
-
|
|
1105
|
+
onClick: (y) => {
|
|
1106
|
+
y.stopPropagation(), C();
|
|
1107
1107
|
},
|
|
1108
1108
|
"aria-haspopup": "listbox",
|
|
1109
|
-
"aria-expanded":
|
|
1109
|
+
"aria-expanded": A,
|
|
1110
1110
|
"aria-label": "Language: English",
|
|
1111
1111
|
title: "Language: English",
|
|
1112
1112
|
children: [
|
|
@@ -1115,11 +1115,11 @@ const qn = ({
|
|
|
1115
1115
|
]
|
|
1116
1116
|
}
|
|
1117
1117
|
),
|
|
1118
|
-
|
|
1118
|
+
A && /* @__PURE__ */ n(
|
|
1119
1119
|
"div",
|
|
1120
1120
|
{
|
|
1121
1121
|
className: "ll-hmenu",
|
|
1122
|
-
onClick: (
|
|
1122
|
+
onClick: (y) => y.stopPropagation(),
|
|
1123
1123
|
role: "listbox",
|
|
1124
1124
|
children: /* @__PURE__ */ n(
|
|
1125
1125
|
"button",
|
|
@@ -1137,21 +1137,21 @@ const qn = ({
|
|
|
1137
1137
|
/* @__PURE__ */ n(
|
|
1138
1138
|
"span",
|
|
1139
1139
|
{
|
|
1140
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1141
|
-
children:
|
|
1140
|
+
className: `ll-expanded__state ll-expanded__state--${b}`,
|
|
1141
|
+
children: b
|
|
1142
1142
|
}
|
|
1143
1143
|
)
|
|
1144
1144
|
] }),
|
|
1145
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ _("div", { className: "ll-expanded__header-actions", children: [
|
|
1146
1146
|
/* @__PURE__ */ n(
|
|
1147
1147
|
"button",
|
|
1148
1148
|
{
|
|
1149
1149
|
type: "button",
|
|
1150
1150
|
className: "ll-hbtn",
|
|
1151
|
-
onClick:
|
|
1151
|
+
onClick: Ue,
|
|
1152
1152
|
"aria-label": "Minimize widget",
|
|
1153
1153
|
title: "Minimize",
|
|
1154
|
-
children: /* @__PURE__ */ n(
|
|
1154
|
+
children: /* @__PURE__ */ n(Pt, {})
|
|
1155
1155
|
}
|
|
1156
1156
|
),
|
|
1157
1157
|
/* @__PURE__ */ n(
|
|
@@ -1162,23 +1162,23 @@ const qn = ({
|
|
|
1162
1162
|
onClick: Ae,
|
|
1163
1163
|
"aria-label": "End call",
|
|
1164
1164
|
title: "End call",
|
|
1165
|
-
children: /* @__PURE__ */ n(
|
|
1165
|
+
children: /* @__PURE__ */ n(Tt, {})
|
|
1166
1166
|
}
|
|
1167
1167
|
)
|
|
1168
1168
|
] })
|
|
1169
1169
|
] }) : (
|
|
1170
1170
|
// Idle-state header with Live Layer product name + minimize/close
|
|
1171
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ _("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1172
1172
|
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Ze }),
|
|
1173
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ _("div", { className: "ll-expanded__header-actions", children: [
|
|
1174
1174
|
/* @__PURE__ */ n(
|
|
1175
1175
|
"button",
|
|
1176
1176
|
{
|
|
1177
1177
|
type: "button",
|
|
1178
1178
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1179
|
-
onClick:
|
|
1179
|
+
onClick: Ue,
|
|
1180
1180
|
"aria-label": "Minimize widget",
|
|
1181
|
-
children: /* @__PURE__ */ n(
|
|
1181
|
+
children: /* @__PURE__ */ n(Pt, {})
|
|
1182
1182
|
}
|
|
1183
1183
|
),
|
|
1184
1184
|
/* @__PURE__ */ n(
|
|
@@ -1188,99 +1188,99 @@ const qn = ({
|
|
|
1188
1188
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1189
1189
|
onClick: Ae,
|
|
1190
1190
|
"aria-label": "Close widget",
|
|
1191
|
-
children: /* @__PURE__ */ n(
|
|
1191
|
+
children: /* @__PURE__ */ n(Tt, {})
|
|
1192
1192
|
}
|
|
1193
1193
|
)
|
|
1194
1194
|
] })
|
|
1195
1195
|
] })
|
|
1196
1196
|
),
|
|
1197
1197
|
V && /* @__PURE__ */ (() => {
|
|
1198
|
-
const
|
|
1199
|
-
return /* @__PURE__ */
|
|
1200
|
-
|
|
1198
|
+
const y = $ ? "Restart paused session" : R === "disconnected" ? "Reconnect to agent" : "Start video call", j = $ ? "Pick up where you left off" : null;
|
|
1199
|
+
return /* @__PURE__ */ _(Bt, { children: [
|
|
1200
|
+
R === "idle" && !$ && !H && /* @__PURE__ */ _(
|
|
1201
1201
|
"button",
|
|
1202
1202
|
{
|
|
1203
1203
|
type: "button",
|
|
1204
1204
|
className: "ll-expanded__play",
|
|
1205
1205
|
onClick: fe,
|
|
1206
|
-
"aria-label":
|
|
1206
|
+
"aria-label": y,
|
|
1207
1207
|
children: [
|
|
1208
1208
|
/* @__PURE__ */ n("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ n("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
1209
|
-
/* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children:
|
|
1209
|
+
/* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: y })
|
|
1210
1210
|
]
|
|
1211
1211
|
}
|
|
1212
1212
|
),
|
|
1213
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ _("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1214
1214
|
l && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: l }) }),
|
|
1215
|
-
|
|
1215
|
+
j && /* @__PURE__ */ n("p", { className: "ll-expanded__cta-sublabel", children: j }),
|
|
1216
1216
|
/* @__PURE__ */ n(
|
|
1217
1217
|
"button",
|
|
1218
1218
|
{
|
|
1219
1219
|
type: "button",
|
|
1220
1220
|
className: "ll-expanded__cta",
|
|
1221
1221
|
onClick: fe,
|
|
1222
|
-
"aria-label":
|
|
1223
|
-
children:
|
|
1222
|
+
"aria-label": y,
|
|
1223
|
+
children: y
|
|
1224
1224
|
}
|
|
1225
1225
|
)
|
|
1226
1226
|
] })
|
|
1227
1227
|
] });
|
|
1228
1228
|
})(),
|
|
1229
|
-
/* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ _(
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
1232
|
-
className: `ll-expanded__pip ${xe && (
|
|
1232
|
+
className: `ll-expanded__pip ${xe && (x || Q) ? "is-visible" : ""}`,
|
|
1233
1233
|
children: [
|
|
1234
1234
|
/* @__PURE__ */ n(
|
|
1235
1235
|
"div",
|
|
1236
1236
|
{
|
|
1237
|
-
ref:
|
|
1237
|
+
ref: ie,
|
|
1238
1238
|
className: Q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1239
1239
|
}
|
|
1240
1240
|
),
|
|
1241
1241
|
/* @__PURE__ */ n(
|
|
1242
1242
|
"div",
|
|
1243
1243
|
{
|
|
1244
|
-
ref:
|
|
1245
|
-
className: !Q &&
|
|
1244
|
+
ref: Ie,
|
|
1245
|
+
className: !Q && x ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1246
1246
|
}
|
|
1247
1247
|
)
|
|
1248
1248
|
]
|
|
1249
1249
|
}
|
|
1250
1250
|
),
|
|
1251
|
-
xe ? /* @__PURE__ */
|
|
1251
|
+
xe ? /* @__PURE__ */ _("div", { className: "ll-expanded__bottom", children: [
|
|
1252
1252
|
ke && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: ke }) }),
|
|
1253
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ _("div", { className: "ll-toolbar", onClick: (y) => y.stopPropagation(), children: [
|
|
1254
1254
|
Be && /* @__PURE__ */ n(
|
|
1255
1255
|
"button",
|
|
1256
1256
|
{
|
|
1257
1257
|
type: "button",
|
|
1258
1258
|
className: `ll-tool ${Q ? "is-on" : ""}`,
|
|
1259
|
-
onClick:
|
|
1259
|
+
onClick: W,
|
|
1260
1260
|
"aria-label": Q ? "Stop sharing screen" : "Share screen",
|
|
1261
1261
|
title: Q ? "Stop sharing" : "Share screen",
|
|
1262
|
-
children: /* @__PURE__ */ n(
|
|
1262
|
+
children: /* @__PURE__ */ n(Gn, {})
|
|
1263
1263
|
}
|
|
1264
1264
|
),
|
|
1265
|
-
qe && /* @__PURE__ */
|
|
1265
|
+
qe && /* @__PURE__ */ _("div", { className: "ll-tool-split", children: [
|
|
1266
1266
|
/* @__PURE__ */ n(
|
|
1267
1267
|
"button",
|
|
1268
1268
|
{
|
|
1269
1269
|
type: "button",
|
|
1270
|
-
className: `ll-tool ll-tool--left ${
|
|
1270
|
+
className: `ll-tool ll-tool--left ${x ? "is-on" : ""}`,
|
|
1271
1271
|
onClick: we,
|
|
1272
|
-
"aria-label":
|
|
1273
|
-
title:
|
|
1274
|
-
children: /* @__PURE__ */ n(
|
|
1272
|
+
"aria-label": x ? "Turn off camera" : "Turn on camera",
|
|
1273
|
+
title: x ? "Stop camera" : "Start camera",
|
|
1274
|
+
children: /* @__PURE__ */ n(Jn, {})
|
|
1275
1275
|
}
|
|
1276
1276
|
),
|
|
1277
1277
|
/* @__PURE__ */ n(
|
|
1278
1278
|
"button",
|
|
1279
1279
|
{
|
|
1280
1280
|
type: "button",
|
|
1281
|
-
className: `ll-tool ll-tool--right ${
|
|
1282
|
-
onClick: (
|
|
1283
|
-
|
|
1281
|
+
className: `ll-tool ll-tool--right ${x ? "is-on" : ""}`,
|
|
1282
|
+
onClick: (y) => {
|
|
1283
|
+
y.stopPropagation(), Y((j) => !j), ne(!1);
|
|
1284
1284
|
},
|
|
1285
1285
|
"aria-label": "Camera devices",
|
|
1286
1286
|
"aria-haspopup": "listbox",
|
|
@@ -1288,46 +1288,46 @@ const qn = ({
|
|
|
1288
1288
|
children: /* @__PURE__ */ n(Ye, {})
|
|
1289
1289
|
}
|
|
1290
1290
|
),
|
|
1291
|
-
le &&
|
|
1292
|
-
|
|
1291
|
+
le && X.length > 0 && /* @__PURE__ */ n(
|
|
1292
|
+
Dt,
|
|
1293
1293
|
{
|
|
1294
1294
|
label: "Camera",
|
|
1295
|
-
devices:
|
|
1295
|
+
devices: X,
|
|
1296
1296
|
activeId: de,
|
|
1297
|
-
onPick: (
|
|
1298
|
-
Y(!1), _e(
|
|
1297
|
+
onPick: (y) => {
|
|
1298
|
+
Y(!1), _e(y);
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
1301
|
)
|
|
1302
1302
|
] }),
|
|
1303
|
-
/* @__PURE__ */
|
|
1303
|
+
/* @__PURE__ */ _("div", { className: "ll-tool-split", children: [
|
|
1304
1304
|
/* @__PURE__ */ n(
|
|
1305
1305
|
"button",
|
|
1306
1306
|
{
|
|
1307
1307
|
type: "button",
|
|
1308
|
-
className: `ll-tool ll-tool--left ${
|
|
1308
|
+
className: `ll-tool ll-tool--left ${p ? "is-muted" : ""}`,
|
|
1309
1309
|
onClick: be,
|
|
1310
|
-
"aria-label":
|
|
1311
|
-
title:
|
|
1312
|
-
children: /* @__PURE__ */ n(
|
|
1310
|
+
"aria-label": p ? "Unmute microphone" : "Mute microphone",
|
|
1311
|
+
title: p ? "Unmute" : "Mute",
|
|
1312
|
+
children: /* @__PURE__ */ n(Kn, { muted: p })
|
|
1313
1313
|
}
|
|
1314
1314
|
),
|
|
1315
1315
|
/* @__PURE__ */ n(
|
|
1316
1316
|
"button",
|
|
1317
1317
|
{
|
|
1318
1318
|
type: "button",
|
|
1319
|
-
className: `ll-tool ll-tool--right ${
|
|
1320
|
-
onClick: (
|
|
1321
|
-
|
|
1319
|
+
className: `ll-tool ll-tool--right ${p ? "is-muted" : ""}`,
|
|
1320
|
+
onClick: (y) => {
|
|
1321
|
+
y.stopPropagation(), ne((j) => !j), Y(!1);
|
|
1322
1322
|
},
|
|
1323
1323
|
"aria-label": "Microphone devices",
|
|
1324
1324
|
"aria-haspopup": "listbox",
|
|
1325
|
-
"aria-expanded":
|
|
1325
|
+
"aria-expanded": J,
|
|
1326
1326
|
children: /* @__PURE__ */ n(Ye, {})
|
|
1327
1327
|
}
|
|
1328
1328
|
),
|
|
1329
|
-
|
|
1330
|
-
|
|
1329
|
+
J && E.length > 0 && /* @__PURE__ */ n(
|
|
1330
|
+
Dt,
|
|
1331
1331
|
{
|
|
1332
1332
|
label: "Microphone",
|
|
1333
1333
|
devices: E,
|
|
@@ -1344,29 +1344,29 @@ const qn = ({
|
|
|
1344
1344
|
onClick: Qe,
|
|
1345
1345
|
"aria-label": ue ? "Unmute speaker" : "Mute speaker",
|
|
1346
1346
|
title: ue ? "Unmute speaker" : "Mute speaker",
|
|
1347
|
-
children: /* @__PURE__ */ n(
|
|
1347
|
+
children: /* @__PURE__ */ n(Xn, { muted: ue })
|
|
1348
1348
|
}
|
|
1349
1349
|
)
|
|
1350
1350
|
] }),
|
|
1351
|
-
|
|
1351
|
+
We && /* @__PURE__ */ _("form", { className: "ll-message-input", onSubmit: Me, children: [
|
|
1352
1352
|
/* @__PURE__ */ n(
|
|
1353
1353
|
"input",
|
|
1354
1354
|
{
|
|
1355
1355
|
type: "text",
|
|
1356
1356
|
className: "ll-message-input__field",
|
|
1357
1357
|
placeholder: "Message...",
|
|
1358
|
-
value:
|
|
1359
|
-
onChange: (
|
|
1358
|
+
value: K,
|
|
1359
|
+
onChange: (y) => ae(y.target.value),
|
|
1360
1360
|
"aria-label": "Message the agent"
|
|
1361
1361
|
}
|
|
1362
1362
|
),
|
|
1363
|
-
|
|
1363
|
+
K.trim() && /* @__PURE__ */ n(
|
|
1364
1364
|
"button",
|
|
1365
1365
|
{
|
|
1366
1366
|
type: "submit",
|
|
1367
1367
|
className: "ll-message-input__send",
|
|
1368
1368
|
"aria-label": "Send message",
|
|
1369
|
-
children: /* @__PURE__ */ n(
|
|
1369
|
+
children: /* @__PURE__ */ n(Qn, {})
|
|
1370
1370
|
}
|
|
1371
1371
|
)
|
|
1372
1372
|
] }),
|
|
@@ -1381,31 +1381,31 @@ const qn = ({
|
|
|
1381
1381
|
)
|
|
1382
1382
|
] }) : null,
|
|
1383
1383
|
(() => {
|
|
1384
|
-
if (
|
|
1385
|
-
return /* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */ n("span", { children:
|
|
1384
|
+
if (g && R !== "error")
|
|
1385
|
+
return /* @__PURE__ */ _("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
1386
|
+
/* @__PURE__ */ n("span", { children: g }),
|
|
1387
1387
|
/* @__PURE__ */ n(
|
|
1388
1388
|
"button",
|
|
1389
1389
|
{
|
|
1390
1390
|
type: "button",
|
|
1391
1391
|
className: "ll-expanded__banner-x",
|
|
1392
|
-
onClick:
|
|
1392
|
+
onClick: Re,
|
|
1393
1393
|
"aria-label": "Dismiss",
|
|
1394
1394
|
children: "×"
|
|
1395
1395
|
}
|
|
1396
1396
|
)
|
|
1397
1397
|
] });
|
|
1398
|
-
if (!
|
|
1399
|
-
let
|
|
1400
|
-
return
|
|
1401
|
-
/* @__PURE__ */ n("span", { children:
|
|
1398
|
+
if (!H || R !== "error") return null;
|
|
1399
|
+
let y = "Failed to connect", j = "Try again";
|
|
1400
|
+
return H === "MIC_PERMISSION_DENIED" ? y = "Microphone blocked. Allow access to talk." : H === "MIC_NOT_FOUND" ? y = "No microphone found. Plug one in + retry." : H === "MIC_UNAVAILABLE" ? y = "Mic unavailable. Check other apps using it." : H === "AGENT_TIMEOUT" ? y = "Agent didn't pick up. Try again." : H === "CONNECT_FAILED" ? y = "Connection failed. Check your network." : H.length < 80 && (y = H), /* @__PURE__ */ _("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1401
|
+
/* @__PURE__ */ n("span", { children: y }),
|
|
1402
1402
|
/* @__PURE__ */ n(
|
|
1403
1403
|
"button",
|
|
1404
1404
|
{
|
|
1405
1405
|
type: "button",
|
|
1406
1406
|
className: "ll-expanded__banner-retry",
|
|
1407
1407
|
onClick: ye,
|
|
1408
|
-
children:
|
|
1408
|
+
children: j
|
|
1409
1409
|
}
|
|
1410
1410
|
)
|
|
1411
1411
|
] });
|
|
@@ -1417,94 +1417,94 @@ const qn = ({
|
|
|
1417
1417
|
function Ye() {
|
|
1418
1418
|
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" }) });
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1421
|
-
return /* @__PURE__ */
|
|
1420
|
+
function Tt() {
|
|
1421
|
+
return /* @__PURE__ */ _("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1422
1422
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1423
1423
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1424
1424
|
] });
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function Pt() {
|
|
1427
1427
|
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" }) });
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1430
|
-
return /* @__PURE__ */
|
|
1429
|
+
function Gn() {
|
|
1430
|
+
return /* @__PURE__ */ _("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: [
|
|
1431
1431
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1432
1432
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1433
1433
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1434
1434
|
] });
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1437
|
-
return /* @__PURE__ */
|
|
1436
|
+
function Jn() {
|
|
1437
|
+
return /* @__PURE__ */ _("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: [
|
|
1438
1438
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1439
1439
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1440
1440
|
] });
|
|
1441
1441
|
}
|
|
1442
|
-
function
|
|
1443
|
-
return /* @__PURE__ */
|
|
1442
|
+
function Kn({ muted: e }) {
|
|
1443
|
+
return /* @__PURE__ */ _("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: [
|
|
1444
1444
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1445
1445
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
1446
1446
|
/* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
1447
1447
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
1448
1448
|
] });
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return /* @__PURE__ */
|
|
1450
|
+
function Xn({ muted: e }) {
|
|
1451
|
+
return /* @__PURE__ */ _("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: [
|
|
1452
1452
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1453
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */
|
|
1453
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ _(Bt, { children: [
|
|
1454
1454
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1455
1455
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1456
1456
|
] })
|
|
1457
1457
|
] });
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1460
|
-
return /* @__PURE__ */
|
|
1459
|
+
function Qn() {
|
|
1460
|
+
return /* @__PURE__ */ _("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1461
1461
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1462
1462
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
1463
1463
|
] });
|
|
1464
1464
|
}
|
|
1465
|
-
const
|
|
1465
|
+
const Dt = ({ label: e, devices: t, activeId: r, onPick: o }) => /* @__PURE__ */ _(
|
|
1466
1466
|
"div",
|
|
1467
1467
|
{
|
|
1468
1468
|
className: "ll-device-menu",
|
|
1469
|
-
onClick: (
|
|
1469
|
+
onClick: (i) => i.stopPropagation(),
|
|
1470
1470
|
role: "listbox",
|
|
1471
1471
|
children: [
|
|
1472
1472
|
/* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
|
|
1473
|
-
t.map((
|
|
1474
|
-
const s = r ===
|
|
1475
|
-
return /* @__PURE__ */
|
|
1473
|
+
t.map((i, l) => {
|
|
1474
|
+
const s = r === i.deviceId;
|
|
1475
|
+
return /* @__PURE__ */ _(
|
|
1476
1476
|
"button",
|
|
1477
1477
|
{
|
|
1478
1478
|
type: "button",
|
|
1479
1479
|
className: `ll-device-menu__item ${s ? "is-active" : ""}`,
|
|
1480
|
-
onClick: () => i
|
|
1480
|
+
onClick: () => o(i.deviceId),
|
|
1481
1481
|
role: "option",
|
|
1482
1482
|
"aria-selected": s,
|
|
1483
1483
|
children: [
|
|
1484
1484
|
s && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
1485
|
-
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children:
|
|
1485
|
+
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: i.label || `${e} ${l + 1}` })
|
|
1486
1486
|
]
|
|
1487
1487
|
},
|
|
1488
|
-
|
|
1488
|
+
i.deviceId || l
|
|
1489
1489
|
);
|
|
1490
1490
|
})
|
|
1491
1491
|
]
|
|
1492
1492
|
}
|
|
1493
|
-
),
|
|
1493
|
+
), Zn = [
|
|
1494
1494
|
'[data-ll-private="true"]',
|
|
1495
1495
|
".ll-widget"
|
|
1496
1496
|
];
|
|
1497
|
-
function
|
|
1497
|
+
function st(e) {
|
|
1498
1498
|
let t = e;
|
|
1499
1499
|
for (; t; ) {
|
|
1500
|
-
for (const r of
|
|
1500
|
+
for (const r of Zn)
|
|
1501
1501
|
if (t.matches(r)) return !0;
|
|
1502
1502
|
t = t.parentElement;
|
|
1503
1503
|
}
|
|
1504
1504
|
return !1;
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1507
|
-
if (
|
|
1506
|
+
function Xe(e) {
|
|
1507
|
+
if (st(e)) return !1;
|
|
1508
1508
|
if (e instanceof HTMLInputElement) {
|
|
1509
1509
|
if (e.type === "password") return !1;
|
|
1510
1510
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -1512,7 +1512,7 @@ function Je(e) {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
return !0;
|
|
1514
1514
|
}
|
|
1515
|
-
const Ge = 4096,
|
|
1515
|
+
const Ge = 4096, er = 20, tr = 20, nr = 10, rr = 10, or = 30, $t = 500, ir = [
|
|
1516
1516
|
'[data-ll-private="true"]',
|
|
1517
1517
|
".ll-widget",
|
|
1518
1518
|
"script",
|
|
@@ -1524,7 +1524,7 @@ function He(e) {
|
|
|
1524
1524
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
1525
1525
|
let t = e;
|
|
1526
1526
|
for (; t; ) {
|
|
1527
|
-
for (const r of
|
|
1527
|
+
for (const r of ir)
|
|
1528
1528
|
if (t.matches(r)) return !0;
|
|
1529
1529
|
t = t.parentElement;
|
|
1530
1530
|
}
|
|
@@ -1534,10 +1534,10 @@ function Oe(e) {
|
|
|
1534
1534
|
if (typeof window > "u") return !0;
|
|
1535
1535
|
const t = e.getBoundingClientRect();
|
|
1536
1536
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
1537
|
-
const r = window.innerHeight || document.documentElement.clientHeight,
|
|
1538
|
-
return t.bottom > 0 && t.right > 0 && t.top < r && t.left <
|
|
1537
|
+
const r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
|
|
1538
|
+
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < o;
|
|
1539
1539
|
}
|
|
1540
|
-
function
|
|
1540
|
+
function zt(e) {
|
|
1541
1541
|
const t = e.getAttribute("id");
|
|
1542
1542
|
if (t) {
|
|
1543
1543
|
const l = document.querySelector(`label[for="${CSS.escape(t)}"]`);
|
|
@@ -1545,18 +1545,18 @@ function $t(e) {
|
|
|
1545
1545
|
}
|
|
1546
1546
|
const r = e.getAttribute("aria-label");
|
|
1547
1547
|
if (r) return r.trim();
|
|
1548
|
-
const
|
|
1549
|
-
if (
|
|
1550
|
-
const
|
|
1551
|
-
return
|
|
1548
|
+
const o = e.getAttribute("placeholder");
|
|
1549
|
+
if (o) return o.trim();
|
|
1550
|
+
const i = e.closest("label");
|
|
1551
|
+
return i != null && i.textContent ? i.textContent.trim() : "";
|
|
1552
1552
|
}
|
|
1553
1553
|
function me(e, t) {
|
|
1554
1554
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1556
|
+
function Se(e) {
|
|
1557
1557
|
return e.length;
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function lr(e, t = {}) {
|
|
1560
1560
|
const r = t.doc ?? (typeof document < "u" ? document : null);
|
|
1561
1561
|
if (!r)
|
|
1562
1562
|
return {
|
|
@@ -1570,161 +1570,206 @@ function rr(e, t = {}) {
|
|
|
1570
1570
|
forms: [],
|
|
1571
1571
|
extras: e
|
|
1572
1572
|
};
|
|
1573
|
-
const
|
|
1573
|
+
const o = typeof window < "u" && window.location.href || "", i = typeof window < "u" && window.location.pathname || "/", l = r.title || "", s = Array.from(
|
|
1574
1574
|
r.querySelectorAll("[data-ll-region]")
|
|
1575
1575
|
), d = [];
|
|
1576
|
-
for (const
|
|
1577
|
-
if (d.length >=
|
|
1578
|
-
if (He(
|
|
1579
|
-
const
|
|
1580
|
-
(
|
|
1581
|
-
|
|
1576
|
+
for (const p of s) {
|
|
1577
|
+
if (d.length >= nr) break;
|
|
1578
|
+
if (He(p) || !Oe(p)) continue;
|
|
1579
|
+
const g = p.getAttribute("data-ll-region") ?? "", E = p.getAttribute("data-ll-intent") ?? void 0, x = me(
|
|
1580
|
+
(p.innerText || p.textContent || "").trim(),
|
|
1581
|
+
$t * 2
|
|
1582
1582
|
);
|
|
1583
|
-
!
|
|
1583
|
+
!g || !x || d.push({ id: g, intent: E, text: x });
|
|
1584
1584
|
}
|
|
1585
|
-
const u = [],
|
|
1585
|
+
const u = [], h = ["H1", "H2", "H3", "H4", "H5", "H6"], m = Array.from(
|
|
1586
1586
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
1587
1587
|
);
|
|
1588
|
-
for (const
|
|
1589
|
-
if (He(
|
|
1590
|
-
const
|
|
1591
|
-
|
|
1588
|
+
for (const p of m) {
|
|
1589
|
+
if (He(p) || !Oe(p)) continue;
|
|
1590
|
+
const g = (p.textContent || "").trim();
|
|
1591
|
+
g && u.push(`${p.tagName}: ${me(g, 200)}`);
|
|
1592
1592
|
}
|
|
1593
1593
|
const a = Array.from(r.querySelectorAll("p, li"));
|
|
1594
|
-
for (const
|
|
1595
|
-
if (He(
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1594
|
+
for (const p of a) {
|
|
1595
|
+
if (He(p) || !Oe(p) || h.includes(p.tagName)) continue;
|
|
1596
|
+
const g = (p.textContent || "").trim();
|
|
1597
|
+
g.length > 10 && u.push(me(g, $t));
|
|
1598
1598
|
}
|
|
1599
1599
|
const c = u.join(`
|
|
1600
|
-
`),
|
|
1601
|
-
for (const
|
|
1602
|
-
if (
|
|
1603
|
-
if (He(
|
|
1604
|
-
const
|
|
1605
|
-
!
|
|
1600
|
+
`), A = [], C = Array.from(r.querySelectorAll("a[href]"));
|
|
1601
|
+
for (const p of C) {
|
|
1602
|
+
if (A.length >= er) break;
|
|
1603
|
+
if (He(p) || !Oe(p)) continue;
|
|
1604
|
+
const g = p.getAttribute("href") || "", E = (p.textContent || "").trim();
|
|
1605
|
+
!g || !E || A.push({ href: g, text: me(E, 100) });
|
|
1606
1606
|
}
|
|
1607
|
-
const
|
|
1607
|
+
const R = [], b = Array.from(
|
|
1608
1608
|
r.querySelectorAll(
|
|
1609
1609
|
"input, textarea, select"
|
|
1610
1610
|
)
|
|
1611
1611
|
);
|
|
1612
|
-
for (const
|
|
1613
|
-
if (
|
|
1614
|
-
if (He(
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1612
|
+
for (const p of b) {
|
|
1613
|
+
if (R.length >= tr) break;
|
|
1614
|
+
if (He(p) || !Xe(p) || !Oe(p)) continue;
|
|
1615
|
+
const g = zt(p), E = p instanceof HTMLInputElement ? p.type : p.tagName.toLowerCase();
|
|
1616
|
+
g && R.push({ label: me(g, 100), type: E });
|
|
1617
1617
|
}
|
|
1618
|
-
const
|
|
1618
|
+
const L = Array.from(
|
|
1619
1619
|
r.querySelectorAll("[data-ll-form]")
|
|
1620
1620
|
), $ = [];
|
|
1621
|
-
for (const
|
|
1622
|
-
if ($.length >=
|
|
1623
|
-
if (
|
|
1624
|
-
const
|
|
1625
|
-
if (!
|
|
1626
|
-
const E =
|
|
1627
|
-
|
|
1621
|
+
for (const p of L) {
|
|
1622
|
+
if ($.length >= rr) break;
|
|
1623
|
+
if (st(p)) continue;
|
|
1624
|
+
const g = p.getAttribute("data-ll-form") || "";
|
|
1625
|
+
if (!g) continue;
|
|
1626
|
+
const E = p.getAttribute("data-ll-intent") || void 0, x = Array.from(
|
|
1627
|
+
p.querySelectorAll(
|
|
1628
1628
|
"[data-ll-field]"
|
|
1629
1629
|
)
|
|
1630
|
-
),
|
|
1631
|
-
for (const
|
|
1632
|
-
if (
|
|
1633
|
-
if (!
|
|
1634
|
-
const de =
|
|
1630
|
+
), q = [];
|
|
1631
|
+
for (const X of x) {
|
|
1632
|
+
if (q.length >= or) break;
|
|
1633
|
+
if (!Xe(X)) continue;
|
|
1634
|
+
const de = X.getAttribute("data-ll-field") || "";
|
|
1635
1635
|
if (!de) continue;
|
|
1636
|
-
const Q =
|
|
1637
|
-
|
|
1636
|
+
const Q = zt(X) || de, Z = X instanceof HTMLInputElement ? X.type : X.tagName.toLowerCase();
|
|
1637
|
+
q.push({ name: de, label: me(Q, 100), type: Z });
|
|
1638
1638
|
}
|
|
1639
|
-
$.push({ id:
|
|
1639
|
+
$.push({ id: g, intent: E, fields: q });
|
|
1640
1640
|
}
|
|
1641
|
-
const
|
|
1642
|
-
url:
|
|
1641
|
+
const M = {
|
|
1642
|
+
url: o,
|
|
1643
1643
|
title: l,
|
|
1644
|
-
pathname:
|
|
1644
|
+
pathname: i,
|
|
1645
1645
|
regions: d,
|
|
1646
1646
|
visibleText: c,
|
|
1647
|
-
visibleLinks:
|
|
1648
|
-
visibleFields:
|
|
1647
|
+
visibleLinks: A,
|
|
1648
|
+
visibleFields: R,
|
|
1649
1649
|
forms: $,
|
|
1650
1650
|
extras: e
|
|
1651
1651
|
};
|
|
1652
|
-
let
|
|
1653
|
-
for (;
|
|
1654
|
-
|
|
1655
|
-
for (;
|
|
1656
|
-
|
|
1657
|
-
return
|
|
1652
|
+
let H = Se(JSON.stringify(M.regions)) + Se(M.visibleText) + Se(JSON.stringify(M.visibleLinks)) + Se(JSON.stringify(M.visibleFields));
|
|
1653
|
+
for (; H > Ge && M.visibleFields.length > 0; )
|
|
1654
|
+
M.visibleFields.pop(), H = Se(JSON.stringify(M.visibleFields));
|
|
1655
|
+
for (; H > Ge && M.visibleLinks.length > 0; )
|
|
1656
|
+
M.visibleLinks.pop(), H -= 80;
|
|
1657
|
+
return Se(M.visibleText) > Ge && (M.visibleText = me(M.visibleText, Ge - 100)), M;
|
|
1658
1658
|
}
|
|
1659
1659
|
let Ce = null;
|
|
1660
|
-
function
|
|
1661
|
-
const r = Date.now(),
|
|
1662
|
-
if (Ce && Ce.key ===
|
|
1660
|
+
function Ht(e, t = {}) {
|
|
1661
|
+
const r = Date.now(), i = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
1662
|
+
if (Ce && Ce.key === i && r - Ce.at < 1e3)
|
|
1663
1663
|
return Ce.ctx;
|
|
1664
|
-
const l =
|
|
1665
|
-
return Ce = { key:
|
|
1664
|
+
const l = lr(e, t);
|
|
1665
|
+
return Ce = { key: i, at: r, ctx: l }, l;
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1667
|
+
function ar() {
|
|
1668
1668
|
Ce = null;
|
|
1669
1669
|
}
|
|
1670
|
-
const
|
|
1671
|
-
function
|
|
1670
|
+
const cr = 200;
|
|
1671
|
+
function sr(e) {
|
|
1672
1672
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function dr(e) {
|
|
1675
1675
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
1676
1676
|
if (!t) return [];
|
|
1677
|
-
const r = typeof window < "u" && window.location.origin || "",
|
|
1677
|
+
const r = typeof window < "u" && window.location.origin || "", o = /* @__PURE__ */ new Set(), i = [], l = Array.from(t.querySelectorAll("a[href]"));
|
|
1678
1678
|
for (const s of l) {
|
|
1679
|
-
if (
|
|
1680
|
-
if (
|
|
1679
|
+
if (i.length >= cr) break;
|
|
1680
|
+
if (st(s)) continue;
|
|
1681
1681
|
const d = s.getAttribute("href") || "";
|
|
1682
|
-
if (!
|
|
1683
|
-
let u = d,
|
|
1682
|
+
if (!sr(d)) continue;
|
|
1683
|
+
let u = d, h = !0;
|
|
1684
1684
|
try {
|
|
1685
1685
|
if (typeof window < "u") {
|
|
1686
1686
|
const a = new URL(d, r);
|
|
1687
|
-
|
|
1687
|
+
h = a.origin === r, h && d.startsWith("http") && (u = a.pathname + a.search + a.hash);
|
|
1688
1688
|
}
|
|
1689
1689
|
} catch {
|
|
1690
1690
|
continue;
|
|
1691
1691
|
}
|
|
1692
|
-
if (
|
|
1693
|
-
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1692
|
+
if (o.has(u)) continue;
|
|
1693
|
+
o.add(u);
|
|
1694
|
+
const m = (s.textContent || "").trim().slice(0, 120);
|
|
1695
|
+
i.push({ href: u, text: m, internal: h });
|
|
1696
1696
|
}
|
|
1697
|
-
return
|
|
1697
|
+
return i;
|
|
1698
1698
|
}
|
|
1699
|
-
let
|
|
1700
|
-
const
|
|
1701
|
-
function
|
|
1699
|
+
let Ee = null;
|
|
1700
|
+
const ur = 5e3;
|
|
1701
|
+
function fr() {
|
|
1702
1702
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
1703
|
-
if (
|
|
1704
|
-
return
|
|
1705
|
-
const r =
|
|
1706
|
-
return
|
|
1703
|
+
if (Ee && Ee.pathname === t && e - Ee.at < ur)
|
|
1704
|
+
return Ee.routes;
|
|
1705
|
+
const r = dr();
|
|
1706
|
+
return Ee = { at: e, pathname: t, routes: r }, r;
|
|
1707
1707
|
}
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1708
|
+
function pr() {
|
|
1709
|
+
Ee = null;
|
|
1710
1710
|
}
|
|
1711
|
-
function
|
|
1712
|
-
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype,
|
|
1713
|
-
|
|
1711
|
+
function hr(e, t) {
|
|
1712
|
+
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, o = Object.getOwnPropertyDescriptor(r, "value"), i = o == null ? void 0 : o.set;
|
|
1713
|
+
i ? i.call(e, t) : e.value = t;
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1716
|
-
const
|
|
1715
|
+
function mr(e, t, r = {}) {
|
|
1716
|
+
const o = r.triggerInput ?? !0, i = r.triggerChange ?? !0;
|
|
1717
1717
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
1718
1718
|
const l = Object.getOwnPropertyDescriptor(
|
|
1719
1719
|
HTMLInputElement.prototype,
|
|
1720
1720
|
"checked"
|
|
1721
1721
|
), s = l == null ? void 0 : l.set, d = t === "true" || t === "1" || t === "on";
|
|
1722
|
-
s ? s.call(e, d) : e.checked = d,
|
|
1722
|
+
s ? s.call(e, d) : e.checked = d, o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1723
1723
|
return;
|
|
1724
1724
|
}
|
|
1725
|
-
|
|
1725
|
+
hr(e, t), o && e.dispatchEvent(new Event("input", { bubbles: !0 })), i && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1726
1726
|
}
|
|
1727
|
-
|
|
1727
|
+
function gr() {
|
|
1728
|
+
if (typeof window > "u" || typeof document > "u")
|
|
1729
|
+
return !1;
|
|
1730
|
+
const e = document.scrollingElement || document.documentElement;
|
|
1731
|
+
if (!e || e.scrollHeight <= e.clientHeight + 2) return !1;
|
|
1732
|
+
const t = window.getComputedStyle(e);
|
|
1733
|
+
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
1734
|
+
}
|
|
1735
|
+
function yr(e) {
|
|
1736
|
+
if (!(e instanceof HTMLElement)) return !1;
|
|
1737
|
+
const r = window.getComputedStyle(e).overflowY;
|
|
1738
|
+
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
1739
|
+
}
|
|
1740
|
+
function vr() {
|
|
1741
|
+
if (typeof document > "u") return null;
|
|
1742
|
+
const e = Array.from(
|
|
1743
|
+
document.querySelectorAll("body, body *")
|
|
1744
|
+
);
|
|
1745
|
+
let t = null, r = 0;
|
|
1746
|
+
for (const o of e) {
|
|
1747
|
+
if (!yr(o)) continue;
|
|
1748
|
+
const i = o.getBoundingClientRect();
|
|
1749
|
+
if (i.bottom <= 0 || i.top >= window.innerHeight || i.right <= 0 || i.left >= window.innerWidth || i.width <= 0 || i.height <= 0 || o.closest(".ll-widget")) continue;
|
|
1750
|
+
const l = i.width * i.height;
|
|
1751
|
+
l > r && (r = l, t = o);
|
|
1752
|
+
}
|
|
1753
|
+
return t;
|
|
1754
|
+
}
|
|
1755
|
+
function br() {
|
|
1756
|
+
if (typeof window > "u")
|
|
1757
|
+
return null;
|
|
1758
|
+
if (gr()) return window;
|
|
1759
|
+
const e = vr();
|
|
1760
|
+
return e || window;
|
|
1761
|
+
}
|
|
1762
|
+
function Ot(e) {
|
|
1763
|
+
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
1764
|
+
}
|
|
1765
|
+
function wr(e) {
|
|
1766
|
+
var t, r;
|
|
1767
|
+
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
1768
|
+
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
1769
|
+
((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
|
|
1770
|
+
) : e.scrollHeight - e.clientHeight;
|
|
1771
|
+
}
|
|
1772
|
+
const _r = /* @__PURE__ */ new Set([
|
|
1728
1773
|
"agent_state",
|
|
1729
1774
|
"avatar_stream_ready",
|
|
1730
1775
|
"avatar_active",
|
|
@@ -1747,42 +1792,42 @@ const pr = /* @__PURE__ */ new Set([
|
|
|
1747
1792
|
"submit_form",
|
|
1748
1793
|
"request_routes"
|
|
1749
1794
|
]);
|
|
1750
|
-
function
|
|
1751
|
-
var
|
|
1795
|
+
function xr(e) {
|
|
1796
|
+
var yt, vt, bt, wt, _t, xt, kt;
|
|
1752
1797
|
const {
|
|
1753
1798
|
agentId: t,
|
|
1754
1799
|
apiKey: r,
|
|
1755
|
-
baseUrl:
|
|
1756
|
-
sessionEndpoint:
|
|
1800
|
+
baseUrl: o = "https://app.livelayer.studio",
|
|
1801
|
+
sessionEndpoint: i,
|
|
1757
1802
|
sessionBody: l,
|
|
1758
1803
|
autoConnect: s = !1,
|
|
1759
1804
|
displayMode: d,
|
|
1760
1805
|
defaultDisplayMode: u = "expanded",
|
|
1761
|
-
onDisplayModeChange:
|
|
1762
|
-
position:
|
|
1806
|
+
onDisplayModeChange: h,
|
|
1807
|
+
position: m = "bottom-right",
|
|
1763
1808
|
mobileBreakpoint: a = 640,
|
|
1764
1809
|
persistKey: c = "ll-widget",
|
|
1765
|
-
disablePersistence:
|
|
1766
|
-
teamMembers:
|
|
1767
|
-
currentTeamMemberId:
|
|
1768
|
-
onTeamMemberChange:
|
|
1769
|
-
idleLoopUrl:
|
|
1810
|
+
disablePersistence: A = !1,
|
|
1811
|
+
teamMembers: C,
|
|
1812
|
+
currentTeamMemberId: R,
|
|
1813
|
+
onTeamMemberChange: b,
|
|
1814
|
+
idleLoopUrl: L,
|
|
1770
1815
|
greeting: $,
|
|
1771
|
-
avatarImageUrl:
|
|
1772
|
-
agentName:
|
|
1773
|
-
branding:
|
|
1774
|
-
allowCamera:
|
|
1816
|
+
avatarImageUrl: M,
|
|
1817
|
+
agentName: H,
|
|
1818
|
+
branding: p = {},
|
|
1819
|
+
allowCamera: g = !0,
|
|
1775
1820
|
allowScreenShare: E = !0,
|
|
1776
|
-
allowTyping:
|
|
1777
|
-
showOn:
|
|
1778
|
-
hideOn:
|
|
1821
|
+
allowTyping: x = !0,
|
|
1822
|
+
showOn: q,
|
|
1823
|
+
hideOn: X,
|
|
1779
1824
|
pathname: de,
|
|
1780
1825
|
onNavigate: Q,
|
|
1781
1826
|
onScrollToSelector: Z,
|
|
1782
1827
|
getPageContext: ue,
|
|
1783
1828
|
pageContextExtras: qe,
|
|
1784
1829
|
onScrollPage: Be,
|
|
1785
|
-
onClick:
|
|
1830
|
+
onClick: We,
|
|
1786
1831
|
capabilities: Ne,
|
|
1787
1832
|
onConnect: fe,
|
|
1788
1833
|
onDisconnect: ge,
|
|
@@ -1791,49 +1836,49 @@ function hr(e) {
|
|
|
1791
1836
|
onConnectionStateChange: be,
|
|
1792
1837
|
onAgentEvent: we,
|
|
1793
1838
|
onAgentCommand: _e,
|
|
1794
|
-
controlledSession:
|
|
1839
|
+
controlledSession: W,
|
|
1795
1840
|
className: Qe,
|
|
1796
1841
|
style: Fe,
|
|
1797
|
-
zIndex:
|
|
1798
|
-
} = e, Ae =
|
|
1842
|
+
zIndex: Ue = 2147483647
|
|
1843
|
+
} = e, Ae = An(de), Re = $n(Ae, q, X);
|
|
1799
1844
|
P(() => {
|
|
1800
|
-
|
|
1845
|
+
ar(), pr();
|
|
1801
1846
|
}, [Ae]);
|
|
1802
|
-
const
|
|
1803
|
-
var
|
|
1804
|
-
return
|
|
1805
|
-
}), ee =
|
|
1806
|
-
() => (
|
|
1807
|
-
[
|
|
1808
|
-
),
|
|
1847
|
+
const oe = R !== void 0, [pe, xe] = N(() => {
|
|
1848
|
+
var v;
|
|
1849
|
+
return R ?? ((v = C == null ? void 0 : C[0]) == null ? void 0 : v.id);
|
|
1850
|
+
}), ee = oe ? R : pe, V = Je(
|
|
1851
|
+
() => (C == null ? void 0 : C.find((v) => v.id === ee)) ?? null,
|
|
1852
|
+
[C, ee]
|
|
1853
|
+
), Ie = (V == null ? void 0 : V.agentId) ?? t, [ie, J] = Sn({
|
|
1809
1854
|
value: d,
|
|
1810
1855
|
defaultValue: u,
|
|
1811
|
-
onChange:
|
|
1856
|
+
onChange: h,
|
|
1812
1857
|
persistKey: c,
|
|
1813
|
-
disablePersistence:
|
|
1814
|
-
}), ne =
|
|
1815
|
-
tt.current = Q, nt.current = Z, rt.current = Be,
|
|
1816
|
-
function ce(
|
|
1817
|
-
const f =
|
|
1818
|
-
return f ? f.includes(
|
|
1858
|
+
disablePersistence: A
|
|
1859
|
+
}), ne = En(a), le = pn(), Y = hn(), K = gn(), ae = yn(), Me = vn(), [Ze, ke] = N(!1), [Te, Pe] = N(!1), [y, j] = N(!1), [dt, Ut] = N(!1), [et, jt] = N(!1), tt = I(Q), nt = I(Z), rt = I(Be), ot = I(We), ut = I(ue), ft = I(qe), it = I(Ne), te = I(null);
|
|
1860
|
+
tt.current = Q, nt.current = Z, rt.current = Be, ot.current = We, ut.current = ue, ft.current = qe, it.current = Ne;
|
|
1861
|
+
function ce(v) {
|
|
1862
|
+
const f = it.current;
|
|
1863
|
+
return f ? f.includes(v) : !0;
|
|
1819
1864
|
}
|
|
1820
|
-
function se(
|
|
1865
|
+
function se(v, f) {
|
|
1821
1866
|
console.warn(
|
|
1822
|
-
`[LiveLayer] Agent command "${
|
|
1867
|
+
`[LiveLayer] Agent command "${v}" blocked — capability "${f}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
1823
1868
|
);
|
|
1824
1869
|
}
|
|
1825
|
-
const De =
|
|
1826
|
-
(
|
|
1827
|
-
var G, je, Ve,
|
|
1828
|
-
const f =
|
|
1870
|
+
const De = S(
|
|
1871
|
+
(v) => {
|
|
1872
|
+
var G, je, Ve, Lt;
|
|
1873
|
+
const f = v;
|
|
1829
1874
|
if (!(!f.type || typeof f.type != "string")) {
|
|
1830
|
-
if (we == null || we({ eventName: f.type, data:
|
|
1875
|
+
if (we == null || we({ eventName: f.type, data: v }), f.type === "navigate") {
|
|
1831
1876
|
if (!ce("navigate")) {
|
|
1832
1877
|
se("navigate", "navigate");
|
|
1833
1878
|
return;
|
|
1834
1879
|
}
|
|
1835
|
-
const
|
|
1836
|
-
if (!
|
|
1880
|
+
const k = typeof f.href == "string" ? f.href : null;
|
|
1881
|
+
if (!k) {
|
|
1837
1882
|
console.warn(
|
|
1838
1883
|
`[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
|
|
1839
1884
|
);
|
|
@@ -1841,31 +1886,31 @@ function hr(e) {
|
|
|
1841
1886
|
}
|
|
1842
1887
|
if (tt.current) {
|
|
1843
1888
|
try {
|
|
1844
|
-
tt.current(
|
|
1845
|
-
} catch (
|
|
1889
|
+
tt.current(k);
|
|
1890
|
+
} catch (T) {
|
|
1846
1891
|
console.warn(
|
|
1847
|
-
`[LiveLayer] onNavigate threw for "${
|
|
1848
|
-
|
|
1892
|
+
`[LiveLayer] onNavigate threw for "${k}". Falling back. Error:`,
|
|
1893
|
+
T
|
|
1849
1894
|
);
|
|
1850
1895
|
}
|
|
1851
1896
|
return;
|
|
1852
1897
|
}
|
|
1853
1898
|
if (typeof document < "u") {
|
|
1854
|
-
const
|
|
1855
|
-
`a[href="${
|
|
1899
|
+
const T = document.querySelector(
|
|
1900
|
+
`a[href="${k.replace(/"/g, '\\"')}"]`
|
|
1856
1901
|
);
|
|
1857
|
-
if (
|
|
1858
|
-
|
|
1902
|
+
if (T) {
|
|
1903
|
+
T.click();
|
|
1859
1904
|
return;
|
|
1860
1905
|
}
|
|
1861
1906
|
}
|
|
1862
1907
|
if (typeof window < "u" && typeof history < "u")
|
|
1863
1908
|
try {
|
|
1864
|
-
history.pushState({}, "",
|
|
1865
|
-
} catch (
|
|
1909
|
+
history.pushState({}, "", k), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
1910
|
+
} catch (T) {
|
|
1866
1911
|
console.warn(
|
|
1867
|
-
`[LiveLayer] history.pushState fallback failed for "${
|
|
1868
|
-
|
|
1912
|
+
`[LiveLayer] history.pushState fallback failed for "${k}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
|
|
1913
|
+
T
|
|
1869
1914
|
);
|
|
1870
1915
|
}
|
|
1871
1916
|
return;
|
|
@@ -1875,38 +1920,38 @@ function hr(e) {
|
|
|
1875
1920
|
se("scroll_to", "scroll");
|
|
1876
1921
|
return;
|
|
1877
1922
|
}
|
|
1878
|
-
const
|
|
1879
|
-
if (!
|
|
1880
|
-
const
|
|
1923
|
+
const k = typeof f.selector == "string" ? f.selector : null;
|
|
1924
|
+
if (!k) return;
|
|
1925
|
+
const T = f.behavior === "instant" ? "instant" : "smooth";
|
|
1881
1926
|
if (nt.current) {
|
|
1882
1927
|
try {
|
|
1883
1928
|
nt.current(
|
|
1884
|
-
|
|
1885
|
-
|
|
1929
|
+
k,
|
|
1930
|
+
T
|
|
1886
1931
|
);
|
|
1887
|
-
} catch (
|
|
1888
|
-
console.warn("[LiveLayer] onScrollToSelector threw.",
|
|
1932
|
+
} catch (z) {
|
|
1933
|
+
console.warn("[LiveLayer] onScrollToSelector threw.", z);
|
|
1889
1934
|
}
|
|
1890
1935
|
return;
|
|
1891
1936
|
}
|
|
1892
1937
|
if (typeof document < "u") {
|
|
1893
|
-
let
|
|
1938
|
+
let z = null;
|
|
1894
1939
|
try {
|
|
1895
|
-
|
|
1940
|
+
z = document.querySelector(k);
|
|
1896
1941
|
} catch {
|
|
1897
1942
|
console.warn(
|
|
1898
|
-
`[LiveLayer] scroll_to: invalid selector "${
|
|
1943
|
+
`[LiveLayer] scroll_to: invalid selector "${k}".`
|
|
1899
1944
|
);
|
|
1900
1945
|
return;
|
|
1901
1946
|
}
|
|
1902
|
-
if (!
|
|
1947
|
+
if (!z) {
|
|
1903
1948
|
console.warn(
|
|
1904
|
-
`[LiveLayer] scroll_to: no element matched "${
|
|
1949
|
+
`[LiveLayer] scroll_to: no element matched "${k}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
|
|
1905
1950
|
);
|
|
1906
1951
|
return;
|
|
1907
1952
|
}
|
|
1908
|
-
|
|
1909
|
-
behavior:
|
|
1953
|
+
z.scrollIntoView({
|
|
1954
|
+
behavior: T,
|
|
1910
1955
|
block: "start"
|
|
1911
1956
|
});
|
|
1912
1957
|
}
|
|
@@ -1917,45 +1962,45 @@ function hr(e) {
|
|
|
1917
1962
|
se("request_page_context", "read_page");
|
|
1918
1963
|
return;
|
|
1919
1964
|
}
|
|
1920
|
-
const
|
|
1921
|
-
const
|
|
1965
|
+
const k = typeof f.requestId == "string" ? f.requestId : void 0, T = (G = te.current) == null ? void 0 : G.call(te), z = (F) => {
|
|
1966
|
+
const O = T, re = O == null ? void 0 : O.localParticipant;
|
|
1922
1967
|
if (re != null && re.publishData)
|
|
1923
1968
|
try {
|
|
1924
|
-
const he =
|
|
1969
|
+
const he = k ? { ...F, requestId: k } : F, Le = new TextEncoder().encode(JSON.stringify(he));
|
|
1925
1970
|
re.publishData(Le, { reliable: !0 });
|
|
1926
1971
|
} catch (he) {
|
|
1927
1972
|
console.warn("[LiveLayer] publishData failed.", he);
|
|
1928
1973
|
}
|
|
1929
|
-
},
|
|
1974
|
+
}, D = ft.current, B = ut.current;
|
|
1930
1975
|
try {
|
|
1931
1976
|
if (B) {
|
|
1932
|
-
const
|
|
1933
|
-
if (
|
|
1934
|
-
|
|
1977
|
+
const F = B(D);
|
|
1978
|
+
if (F instanceof Promise) {
|
|
1979
|
+
z({ type: "page_context_pending" }), F.then((O) => z({ type: "page_context", context: O })).catch((O) => {
|
|
1935
1980
|
console.warn(
|
|
1936
1981
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
1937
|
-
|
|
1938
|
-
),
|
|
1982
|
+
O
|
|
1983
|
+
), z({
|
|
1939
1984
|
type: "page_context",
|
|
1940
|
-
context:
|
|
1985
|
+
context: Ht(D)
|
|
1941
1986
|
});
|
|
1942
1987
|
});
|
|
1943
1988
|
return;
|
|
1944
1989
|
}
|
|
1945
|
-
|
|
1990
|
+
z({ type: "page_context", context: F });
|
|
1946
1991
|
return;
|
|
1947
1992
|
}
|
|
1948
|
-
|
|
1993
|
+
z({
|
|
1949
1994
|
type: "page_context",
|
|
1950
|
-
context:
|
|
1995
|
+
context: Ht(D)
|
|
1951
1996
|
});
|
|
1952
|
-
} catch (
|
|
1997
|
+
} catch (F) {
|
|
1953
1998
|
console.warn(
|
|
1954
1999
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
1955
|
-
|
|
1956
|
-
),
|
|
2000
|
+
F
|
|
2001
|
+
), z({
|
|
1957
2002
|
type: "page_context",
|
|
1958
|
-
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras:
|
|
2003
|
+
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: D }
|
|
1959
2004
|
});
|
|
1960
2005
|
}
|
|
1961
2006
|
return;
|
|
@@ -1965,28 +2010,32 @@ function hr(e) {
|
|
|
1965
2010
|
se("scroll_page", "scroll");
|
|
1966
2011
|
return;
|
|
1967
2012
|
}
|
|
1968
|
-
const
|
|
1969
|
-
if (
|
|
2013
|
+
const k = f.direction;
|
|
2014
|
+
if (k !== "up" && k !== "down" && k !== "top" && k !== "bottom") {
|
|
1970
2015
|
console.warn(
|
|
1971
|
-
`[LiveLayer] scroll_page: invalid direction "${String(
|
|
2016
|
+
`[LiveLayer] scroll_page: invalid direction "${String(k)}". Expected up | down | top | bottom.`
|
|
1972
2017
|
);
|
|
1973
2018
|
return;
|
|
1974
2019
|
}
|
|
1975
|
-
const
|
|
2020
|
+
const T = f.behavior === "instant" ? "instant" : "smooth";
|
|
1976
2021
|
if (rt.current) {
|
|
1977
2022
|
try {
|
|
1978
2023
|
rt.current(
|
|
1979
|
-
|
|
1980
|
-
|
|
2024
|
+
k,
|
|
2025
|
+
T
|
|
1981
2026
|
);
|
|
1982
|
-
} catch (
|
|
1983
|
-
console.warn("[LiveLayer] onScrollPage threw.",
|
|
2027
|
+
} catch (O) {
|
|
2028
|
+
console.warn("[LiveLayer] onScrollPage threw.", O);
|
|
1984
2029
|
}
|
|
1985
2030
|
return;
|
|
1986
2031
|
}
|
|
1987
2032
|
if (typeof window > "u") return;
|
|
1988
|
-
const
|
|
1989
|
-
|
|
2033
|
+
const z = { behavior: T }, D = br(), B = (O) => {
|
|
2034
|
+
D instanceof Window ? D.scrollBy({ top: O, ...z }) : D.scrollBy({ top: O, ...z });
|
|
2035
|
+
}, F = (O) => {
|
|
2036
|
+
D instanceof Window ? D.scrollTo({ top: O, ...z }) : D.scrollTo({ top: O, ...z });
|
|
2037
|
+
};
|
|
2038
|
+
k === "up" ? B(-Ot(D)) : k === "down" ? B(Ot(D)) : F(k === "top" ? 0 : wr(D));
|
|
1990
2039
|
return;
|
|
1991
2040
|
}
|
|
1992
2041
|
if (f.type === "click") {
|
|
@@ -1994,42 +2043,42 @@ function hr(e) {
|
|
|
1994
2043
|
se("click", "click");
|
|
1995
2044
|
return;
|
|
1996
2045
|
}
|
|
1997
|
-
const
|
|
1998
|
-
if (!
|
|
2046
|
+
const k = typeof f.selector == "string" ? f.selector : null;
|
|
2047
|
+
if (!k) {
|
|
1999
2048
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2000
2049
|
return;
|
|
2001
2050
|
}
|
|
2002
|
-
if (
|
|
2051
|
+
if (ot.current) {
|
|
2003
2052
|
try {
|
|
2004
|
-
|
|
2005
|
-
} catch (
|
|
2006
|
-
console.warn("[LiveLayer] onClick threw.",
|
|
2053
|
+
ot.current(k);
|
|
2054
|
+
} catch (z) {
|
|
2055
|
+
console.warn("[LiveLayer] onClick threw.", z);
|
|
2007
2056
|
}
|
|
2008
2057
|
return;
|
|
2009
2058
|
}
|
|
2010
2059
|
if (typeof document > "u") return;
|
|
2011
|
-
let
|
|
2060
|
+
let T = null;
|
|
2012
2061
|
try {
|
|
2013
|
-
|
|
2062
|
+
T = document.querySelector(k);
|
|
2014
2063
|
} catch {
|
|
2015
2064
|
console.warn(
|
|
2016
|
-
`[LiveLayer] click: invalid selector "${
|
|
2065
|
+
`[LiveLayer] click: invalid selector "${k}".`
|
|
2017
2066
|
);
|
|
2018
2067
|
return;
|
|
2019
2068
|
}
|
|
2020
|
-
if (!
|
|
2069
|
+
if (!T) {
|
|
2021
2070
|
console.warn(
|
|
2022
|
-
`[LiveLayer] click: no element matched "${
|
|
2071
|
+
`[LiveLayer] click: no element matched "${k}". See https://livelayer.studio/docs/errors/click-no-match`
|
|
2023
2072
|
);
|
|
2024
2073
|
return;
|
|
2025
2074
|
}
|
|
2026
|
-
if (
|
|
2075
|
+
if (T.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2027
2076
|
console.warn(
|
|
2028
2077
|
"[LiveLayer] click: refusing to click element inside a private subtree."
|
|
2029
2078
|
);
|
|
2030
2079
|
return;
|
|
2031
2080
|
}
|
|
2032
|
-
(je =
|
|
2081
|
+
(je = T.click) == null || je.call(T);
|
|
2033
2082
|
return;
|
|
2034
2083
|
}
|
|
2035
2084
|
if (f.type === "fill_form" || f.type === "focus_field") {
|
|
@@ -2038,74 +2087,74 @@ function hr(e) {
|
|
|
2038
2087
|
return;
|
|
2039
2088
|
}
|
|
2040
2089
|
if (typeof document > "u") return;
|
|
2041
|
-
const
|
|
2042
|
-
if (!
|
|
2090
|
+
const k = typeof f.formId == "string" ? f.formId : null;
|
|
2091
|
+
if (!k) {
|
|
2043
2092
|
console.warn(`[LiveLayer] ${f.type}: missing formId.`);
|
|
2044
2093
|
return;
|
|
2045
2094
|
}
|
|
2046
|
-
const
|
|
2047
|
-
`[data-ll-form="${
|
|
2095
|
+
const T = document.querySelector(
|
|
2096
|
+
`[data-ll-form="${k.replace(/"/g, '\\"')}"]`
|
|
2048
2097
|
);
|
|
2049
|
-
if (!
|
|
2098
|
+
if (!T) {
|
|
2050
2099
|
console.warn(
|
|
2051
|
-
`[LiveLayer] ${f.type}: no form with data-ll-form="${
|
|
2100
|
+
`[LiveLayer] ${f.type}: no form with data-ll-form="${k}". Tag your form with <LiveLayerForm id> or data-ll-form. See https://livelayer.studio/docs/react/forms`
|
|
2052
2101
|
);
|
|
2053
2102
|
return;
|
|
2054
2103
|
}
|
|
2055
|
-
if (
|
|
2104
|
+
if (T.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2056
2105
|
console.warn(
|
|
2057
2106
|
`[LiveLayer] ${f.type}: refusing to touch a form in a private subtree.`
|
|
2058
2107
|
);
|
|
2059
2108
|
return;
|
|
2060
2109
|
}
|
|
2061
2110
|
if (f.type === "focus_field") {
|
|
2062
|
-
const
|
|
2063
|
-
if (!
|
|
2111
|
+
const D = typeof f.fieldName == "string" ? f.fieldName : null;
|
|
2112
|
+
if (!D) {
|
|
2064
2113
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2065
2114
|
return;
|
|
2066
2115
|
}
|
|
2067
|
-
const B =
|
|
2116
|
+
const B = T.querySelector(`[data-ll-field="${D.replace(/"/g, '\\"')}"]`);
|
|
2068
2117
|
if (!B) {
|
|
2069
2118
|
console.warn(
|
|
2070
|
-
`[LiveLayer] focus_field: no field "${
|
|
2119
|
+
`[LiveLayer] focus_field: no field "${D}" in form "${k}".`
|
|
2071
2120
|
);
|
|
2072
2121
|
return;
|
|
2073
2122
|
}
|
|
2074
|
-
if (!
|
|
2123
|
+
if (!Xe(B)) {
|
|
2075
2124
|
console.warn(
|
|
2076
|
-
`[LiveLayer] focus_field: field "${
|
|
2125
|
+
`[LiveLayer] focus_field: field "${D}" is privacy-protected and not focusable.`
|
|
2077
2126
|
);
|
|
2078
2127
|
return;
|
|
2079
2128
|
}
|
|
2080
2129
|
B.focus();
|
|
2081
2130
|
return;
|
|
2082
2131
|
}
|
|
2083
|
-
const
|
|
2084
|
-
if (!
|
|
2132
|
+
const z = f.values && typeof f.values == "object" ? f.values : null;
|
|
2133
|
+
if (!z) {
|
|
2085
2134
|
console.warn("[LiveLayer] fill_form: missing or invalid values.");
|
|
2086
2135
|
return;
|
|
2087
2136
|
}
|
|
2088
|
-
for (const [
|
|
2137
|
+
for (const [D, B] of Object.entries(z)) {
|
|
2089
2138
|
if (typeof B != "string") continue;
|
|
2090
|
-
const
|
|
2091
|
-
if (!
|
|
2139
|
+
const F = T.querySelector(`[data-ll-field="${D.replace(/"/g, '\\"')}"]`);
|
|
2140
|
+
if (!F) {
|
|
2092
2141
|
console.warn(
|
|
2093
|
-
`[LiveLayer] fill_form: no field "${
|
|
2142
|
+
`[LiveLayer] fill_form: no field "${D}" in form "${k}". Skipping.`
|
|
2094
2143
|
);
|
|
2095
2144
|
continue;
|
|
2096
2145
|
}
|
|
2097
|
-
if (!
|
|
2146
|
+
if (!Xe(F)) {
|
|
2098
2147
|
console.warn(
|
|
2099
|
-
`[LiveLayer] fill_form: field "${
|
|
2148
|
+
`[LiveLayer] fill_form: field "${D}" is privacy-protected (password / cc-* / private). Skipping.`
|
|
2100
2149
|
);
|
|
2101
2150
|
continue;
|
|
2102
2151
|
}
|
|
2103
2152
|
try {
|
|
2104
|
-
|
|
2105
|
-
} catch (
|
|
2153
|
+
mr(F, B);
|
|
2154
|
+
} catch (O) {
|
|
2106
2155
|
console.warn(
|
|
2107
|
-
`[LiveLayer] fill_form: failed to set "${
|
|
2108
|
-
|
|
2156
|
+
`[LiveLayer] fill_form: failed to set "${D}".`,
|
|
2157
|
+
O
|
|
2109
2158
|
);
|
|
2110
2159
|
}
|
|
2111
2160
|
}
|
|
@@ -2117,54 +2166,54 @@ function hr(e) {
|
|
|
2117
2166
|
return;
|
|
2118
2167
|
}
|
|
2119
2168
|
if (typeof document > "u") return;
|
|
2120
|
-
const
|
|
2121
|
-
if (!
|
|
2169
|
+
const k = typeof f.formId == "string" ? f.formId : null;
|
|
2170
|
+
if (!k) {
|
|
2122
2171
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
2123
2172
|
return;
|
|
2124
2173
|
}
|
|
2125
|
-
const
|
|
2126
|
-
`[data-ll-form="${
|
|
2174
|
+
const T = document.querySelector(
|
|
2175
|
+
`[data-ll-form="${k.replace(/"/g, '\\"')}"]`
|
|
2127
2176
|
);
|
|
2128
|
-
if (!
|
|
2177
|
+
if (!T) {
|
|
2129
2178
|
console.warn(
|
|
2130
|
-
`[LiveLayer] submit_form: no form with data-ll-form="${
|
|
2179
|
+
`[LiveLayer] submit_form: no form with data-ll-form="${k}".`
|
|
2131
2180
|
);
|
|
2132
2181
|
return;
|
|
2133
2182
|
}
|
|
2134
|
-
if (
|
|
2183
|
+
if (T.closest('[data-ll-private="true"], .ll-widget')) {
|
|
2135
2184
|
console.warn(
|
|
2136
2185
|
"[LiveLayer] submit_form: refusing to submit a form in a private subtree."
|
|
2137
2186
|
);
|
|
2138
2187
|
return;
|
|
2139
2188
|
}
|
|
2140
|
-
const
|
|
2141
|
-
const he =
|
|
2189
|
+
const z = typeof f.requestId == "string" ? f.requestId : void 0, D = (Ve = te.current) == null ? void 0 : Ve.call(te), B = (re) => {
|
|
2190
|
+
const he = D, Le = he == null ? void 0 : he.localParticipant;
|
|
2142
2191
|
if (Le != null && Le.publishData)
|
|
2143
2192
|
try {
|
|
2144
|
-
const
|
|
2145
|
-
Le.publishData(
|
|
2193
|
+
const rn = z ? { ...re, requestId: z } : re, on = new TextEncoder().encode(JSON.stringify(rn));
|
|
2194
|
+
Le.publishData(on, { reliable: !0 });
|
|
2146
2195
|
} catch {
|
|
2147
2196
|
}
|
|
2148
2197
|
};
|
|
2149
|
-
let
|
|
2150
|
-
const
|
|
2151
|
-
|
|
2198
|
+
let F = !1;
|
|
2199
|
+
const O = () => {
|
|
2200
|
+
F = !0, B({ type: "form_submitted", formId: k });
|
|
2152
2201
|
};
|
|
2153
|
-
|
|
2202
|
+
T.addEventListener("submit", O, { once: !0 });
|
|
2154
2203
|
try {
|
|
2155
|
-
typeof
|
|
2204
|
+
typeof T.requestSubmit == "function" ? T.requestSubmit() : T.submit();
|
|
2156
2205
|
} catch (re) {
|
|
2157
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.", re),
|
|
2206
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", re), T.removeEventListener("submit", O), B({
|
|
2158
2207
|
type: "form_submit_blocked",
|
|
2159
|
-
formId:
|
|
2208
|
+
formId: k,
|
|
2160
2209
|
reason: "exception"
|
|
2161
2210
|
});
|
|
2162
2211
|
return;
|
|
2163
2212
|
}
|
|
2164
2213
|
setTimeout(() => {
|
|
2165
|
-
|
|
2214
|
+
F || (T.removeEventListener("submit", O), B({
|
|
2166
2215
|
type: "form_submit_blocked",
|
|
2167
|
-
formId:
|
|
2216
|
+
formId: k,
|
|
2168
2217
|
reason: "validation"
|
|
2169
2218
|
}));
|
|
2170
2219
|
}, 500);
|
|
@@ -2175,39 +2224,39 @@ function hr(e) {
|
|
|
2175
2224
|
se("request_routes", "read_page");
|
|
2176
2225
|
return;
|
|
2177
2226
|
}
|
|
2178
|
-
const
|
|
2179
|
-
if (!(
|
|
2227
|
+
const k = typeof f.requestId == "string" ? f.requestId : void 0, z = (Lt = te.current) == null ? void 0 : Lt.call(te), D = z == null ? void 0 : z.localParticipant;
|
|
2228
|
+
if (!(D != null && D.publishData)) return;
|
|
2180
2229
|
try {
|
|
2181
|
-
const B =
|
|
2182
|
-
|
|
2230
|
+
const B = fr(), F = k ? { type: "routes", routes: B, requestId: k } : { type: "routes", routes: B }, O = new TextEncoder().encode(JSON.stringify(F));
|
|
2231
|
+
D.publishData(O, { reliable: !0 });
|
|
2183
2232
|
} catch (B) {
|
|
2184
2233
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", B);
|
|
2185
2234
|
}
|
|
2186
2235
|
return;
|
|
2187
2236
|
}
|
|
2188
|
-
|
|
2237
|
+
_r.has(f.type) || _e == null || _e(f);
|
|
2189
2238
|
}
|
|
2190
2239
|
},
|
|
2191
2240
|
[_e, we]
|
|
2192
|
-
),
|
|
2193
|
-
agentId:
|
|
2194
|
-
baseUrl:
|
|
2241
|
+
), U = fn({
|
|
2242
|
+
agentId: W ? "__controlled__" : Ie,
|
|
2243
|
+
baseUrl: o,
|
|
2195
2244
|
apiKey: r,
|
|
2196
|
-
sessionEndpoint:
|
|
2245
|
+
sessionEndpoint: i,
|
|
2197
2246
|
sessionBody: l,
|
|
2198
|
-
onDataMessage:
|
|
2247
|
+
onDataMessage: W ? void 0 : De
|
|
2199
2248
|
});
|
|
2200
2249
|
P(() => {
|
|
2201
|
-
if (
|
|
2202
|
-
return
|
|
2203
|
-
}, [
|
|
2204
|
-
var
|
|
2205
|
-
return (
|
|
2250
|
+
if (W != null && W.subscribeToDataMessages)
|
|
2251
|
+
return W.subscribeToDataMessages(De);
|
|
2252
|
+
}, [W, De]), te.current = () => {
|
|
2253
|
+
var v;
|
|
2254
|
+
return (v = U.getRoom) == null ? void 0 : v.call(U);
|
|
2206
2255
|
}, P(() => {
|
|
2207
2256
|
var G;
|
|
2208
2257
|
if (typeof window > "u") return;
|
|
2209
|
-
const
|
|
2210
|
-
if (
|
|
2258
|
+
const v = ((G = window.location) == null ? void 0 : G.hostname) || "";
|
|
2259
|
+
if (v === "localhost" || v === "127.0.0.1" || v === "0.0.0.0" || v.endsWith(".local") || v.endsWith(".test"))
|
|
2211
2260
|
return window.__livelayerSimulateCommand = (je) => {
|
|
2212
2261
|
try {
|
|
2213
2262
|
De(je);
|
|
@@ -2218,219 +2267,219 @@ function hr(e) {
|
|
|
2218
2267
|
delete window.__livelayerSimulateCommand;
|
|
2219
2268
|
};
|
|
2220
2269
|
}, [De]);
|
|
2221
|
-
const
|
|
2222
|
-
connectionState:
|
|
2223
|
-
agentState:
|
|
2224
|
-
transcript:
|
|
2225
|
-
videoElement:
|
|
2226
|
-
audioElement:
|
|
2227
|
-
canResume:
|
|
2228
|
-
error:
|
|
2270
|
+
const w = Je(() => W ? {
|
|
2271
|
+
connectionState: W.connectionState,
|
|
2272
|
+
agentState: W.agentState,
|
|
2273
|
+
transcript: W.transcript,
|
|
2274
|
+
videoElement: W.videoElement,
|
|
2275
|
+
audioElement: W.audioElement,
|
|
2276
|
+
canResume: W.canResume,
|
|
2277
|
+
error: W.error,
|
|
2229
2278
|
agentConfig: null,
|
|
2230
2279
|
connect: async () => {
|
|
2231
|
-
await
|
|
2280
|
+
await W.onConnect();
|
|
2232
2281
|
},
|
|
2233
|
-
disconnect: () =>
|
|
2282
|
+
disconnect: () => W.onDisconnect(),
|
|
2234
2283
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
2235
2284
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
2236
2285
|
// so we reuse its reference for type consistency.
|
|
2237
|
-
getRoom:
|
|
2286
|
+
getRoom: U.getRoom,
|
|
2238
2287
|
isControlled: !0
|
|
2239
2288
|
} : {
|
|
2240
|
-
connectionState:
|
|
2241
|
-
agentState:
|
|
2242
|
-
transcript:
|
|
2243
|
-
videoElement:
|
|
2244
|
-
audioElement:
|
|
2245
|
-
canResume:
|
|
2246
|
-
error:
|
|
2247
|
-
agentConfig:
|
|
2248
|
-
connect:
|
|
2249
|
-
disconnect:
|
|
2250
|
-
getRoom:
|
|
2289
|
+
connectionState: U.connectionState,
|
|
2290
|
+
agentState: U.agentState,
|
|
2291
|
+
transcript: U.transcript,
|
|
2292
|
+
videoElement: U.videoElement,
|
|
2293
|
+
audioElement: U.audioElement,
|
|
2294
|
+
canResume: U.canResume,
|
|
2295
|
+
error: U.error,
|
|
2296
|
+
agentConfig: U.agentConfig,
|
|
2297
|
+
connect: U.connect,
|
|
2298
|
+
disconnect: U.disconnect,
|
|
2299
|
+
getRoom: U.getRoom,
|
|
2251
2300
|
isControlled: !1
|
|
2252
|
-
}, [
|
|
2301
|
+
}, [W, U]), pt = I(null);
|
|
2253
2302
|
P(() => {
|
|
2254
|
-
const
|
|
2255
|
-
if (!(!
|
|
2256
|
-
return f.appendChild(
|
|
2257
|
-
|
|
2303
|
+
const v = w.videoElement, f = pt.current;
|
|
2304
|
+
if (!(!v || !f))
|
|
2305
|
+
return f.appendChild(v), () => {
|
|
2306
|
+
v.parentNode === f && f.removeChild(v);
|
|
2258
2307
|
};
|
|
2259
|
-
}, [
|
|
2260
|
-
const
|
|
2261
|
-
if (!
|
|
2262
|
-
le.attach(
|
|
2263
|
-
const f =
|
|
2308
|
+
}, [w.videoElement]), P(() => {
|
|
2309
|
+
const v = w.audioElement;
|
|
2310
|
+
if (!v) return;
|
|
2311
|
+
le.attach(v);
|
|
2312
|
+
const f = v.play();
|
|
2264
2313
|
return f && typeof f.catch == "function" && f.catch((G) => {
|
|
2265
2314
|
(G == null ? void 0 : G.name) === "NotAllowedError" && ke(!0);
|
|
2266
2315
|
}), () => {
|
|
2267
2316
|
le.detach();
|
|
2268
2317
|
};
|
|
2269
|
-
}, [
|
|
2270
|
-
if (
|
|
2271
|
-
const
|
|
2272
|
-
if (
|
|
2273
|
-
return Y.setupMic(
|
|
2274
|
-
}),
|
|
2275
|
-
Y.teardownMic(),
|
|
2318
|
+
}, [w.audioElement]), P(() => {
|
|
2319
|
+
if (w.isControlled || w.connectionState !== "connected") return;
|
|
2320
|
+
const v = w.getRoom();
|
|
2321
|
+
if (v)
|
|
2322
|
+
return Y.setupMic(v).catch(() => {
|
|
2323
|
+
}), K.attachRoom(v), ae.attachRoom(v), Me.refresh(), () => {
|
|
2324
|
+
Y.teardownMic(), K.teardown(), ae.teardown();
|
|
2276
2325
|
};
|
|
2277
|
-
}, [
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2280
|
-
}, [
|
|
2281
|
-
const
|
|
2282
|
-
const f =
|
|
2326
|
+
}, [w.isControlled, w.connectionState]), P(() => {
|
|
2327
|
+
const v = w.audioElement;
|
|
2328
|
+
v && (v.muted = et);
|
|
2329
|
+
}, [w.audioElement, et]);
|
|
2330
|
+
const Vt = S((v) => {
|
|
2331
|
+
const f = w.getRoom();
|
|
2283
2332
|
if (f)
|
|
2284
2333
|
try {
|
|
2285
2334
|
const G = new TextEncoder().encode(
|
|
2286
|
-
JSON.stringify({ type: "user_message", text:
|
|
2335
|
+
JSON.stringify({ type: "user_message", text: v })
|
|
2287
2336
|
);
|
|
2288
2337
|
f.localParticipant.publishData(G, { reliable: !0 });
|
|
2289
2338
|
} catch {
|
|
2290
2339
|
}
|
|
2291
|
-
}, [
|
|
2292
|
-
|
|
2340
|
+
}, [w]), Yt = S(() => {
|
|
2341
|
+
jt((v) => !v);
|
|
2293
2342
|
}, []);
|
|
2294
2343
|
P(() => {
|
|
2295
|
-
be == null || be(
|
|
2296
|
-
}, [
|
|
2297
|
-
ye == null || ye(
|
|
2298
|
-
}, [
|
|
2299
|
-
ve == null || ve(
|
|
2300
|
-
}, [
|
|
2301
|
-
const
|
|
2344
|
+
be == null || be(w.connectionState), w.connectionState === "connected" ? fe == null || fe() : w.connectionState === "disconnected" && (ge == null || ge());
|
|
2345
|
+
}, [w.connectionState, fe, ge, be]), P(() => {
|
|
2346
|
+
ye == null || ye(w.transcript);
|
|
2347
|
+
}, [w.transcript, ye]), P(() => {
|
|
2348
|
+
ve == null || ve(w.agentState);
|
|
2349
|
+
}, [w.agentState, ve]);
|
|
2350
|
+
const ht = I(!1);
|
|
2302
2351
|
P(() => {
|
|
2303
|
-
|
|
2304
|
-
}, [s,
|
|
2305
|
-
const
|
|
2306
|
-
(
|
|
2307
|
-
const f =
|
|
2308
|
-
f && (
|
|
2352
|
+
w.isControlled || !s || ht.current || Re && w.connectionState === "idle" && (ht.current = !0, w.connect());
|
|
2353
|
+
}, [s, w.connectionState, w, Re]);
|
|
2354
|
+
const Gt = S(
|
|
2355
|
+
(v) => {
|
|
2356
|
+
const f = C == null ? void 0 : C.find((G) => G.id === v);
|
|
2357
|
+
f && (j(!1), v !== ee && (Pe(!0), w.disconnect(), oe || xe(v), b == null || b(f)));
|
|
2309
2358
|
},
|
|
2310
2359
|
[
|
|
2311
|
-
|
|
2360
|
+
C,
|
|
2312
2361
|
ee,
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2362
|
+
w,
|
|
2363
|
+
oe,
|
|
2364
|
+
b
|
|
2316
2365
|
]
|
|
2317
2366
|
);
|
|
2318
2367
|
P(() => {
|
|
2319
|
-
Te &&
|
|
2320
|
-
}, [
|
|
2321
|
-
if (!
|
|
2322
|
-
const
|
|
2323
|
-
f.key === "Escape" &&
|
|
2368
|
+
Te && w.connectionState === "connected" && Pe(!1);
|
|
2369
|
+
}, [w.connectionState, Te]), P(() => {
|
|
2370
|
+
if (!y) return;
|
|
2371
|
+
const v = (f) => {
|
|
2372
|
+
f.key === "Escape" && j(!1);
|
|
2324
2373
|
};
|
|
2325
|
-
return window.addEventListener("keydown",
|
|
2326
|
-
}, [
|
|
2327
|
-
const
|
|
2328
|
-
Ne === void 0 && ((
|
|
2329
|
-
const lt = (V == null ? void 0 : V.name) ??
|
|
2330
|
-
() =>
|
|
2331
|
-
[
|
|
2332
|
-
),
|
|
2333
|
-
|
|
2334
|
-
}, [
|
|
2335
|
-
const
|
|
2336
|
-
|
|
2374
|
+
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
2375
|
+
}, [y]);
|
|
2376
|
+
const Jt = !!M || !!(V != null && V.avatarImageUrl) || w.isControlled, $e = bn(Ie, o, Jt);
|
|
2377
|
+
Ne === void 0 && ((yt = $e.info) != null && yt.capabilities) && (it.current = $e.info.capabilities);
|
|
2378
|
+
const lt = (V == null ? void 0 : V.name) ?? H ?? ((vt = w.agentConfig) == null ? void 0 : vt.name) ?? ((bt = $e.info) == null ? void 0 : bt.name) ?? "Live Layer", mt = (V == null ? void 0 : V.avatarImageUrl) ?? M ?? ((wt = w.agentConfig) == null ? void 0 : wt.avatarImageUrl) ?? ((_t = $e.info) == null ? void 0 : _t.avatarImageUrl) ?? null, Kt = L ?? ((xt = w.agentConfig) == null ? void 0 : xt.idleLoopUrl) ?? ((kt = $e.info) == null ? void 0 : kt.idleLoopUrl) ?? null, Xt = $ ?? null, Qt = S(() => J("expanded"), [J]), Zt = S(
|
|
2379
|
+
() => J("minimized"),
|
|
2380
|
+
[J]
|
|
2381
|
+
), gt = S(() => {
|
|
2382
|
+
w.disconnect(), J("hidden");
|
|
2383
|
+
}, [w, J]), en = S(() => {
|
|
2384
|
+
const v = w.audioElement;
|
|
2385
|
+
v && v.play().then(() => ke(!1)).catch(() => {
|
|
2337
2386
|
});
|
|
2338
|
-
}, [
|
|
2339
|
-
ke(!1),
|
|
2340
|
-
}, [
|
|
2387
|
+
}, [w.audioElement]), tn = S(() => {
|
|
2388
|
+
ke(!1), w.connect();
|
|
2389
|
+
}, [w]), ze = {
|
|
2341
2390
|
...Fe,
|
|
2342
|
-
zIndex:
|
|
2391
|
+
zIndex: Ue
|
|
2343
2392
|
};
|
|
2344
|
-
|
|
2345
|
-
const
|
|
2393
|
+
p.primaryColor && (ze["--ll-color-primary"] = p.primaryColor), p.accentColor && (ze["--ll-color-accent"] = p.accentColor), p.backgroundColor && (ze["--ll-color-bg"] = p.backgroundColor), p.textColor && (ze["--ll-color-fg"] = p.textColor);
|
|
2394
|
+
const nn = [
|
|
2346
2395
|
"ll-widget",
|
|
2347
|
-
`ll-widget--${
|
|
2396
|
+
`ll-widget--${ie}`,
|
|
2348
2397
|
`ll-widget--${ne ? "mobile" : "desktop"}`,
|
|
2349
2398
|
Qe
|
|
2350
2399
|
].filter(Boolean).join(" ");
|
|
2351
|
-
return
|
|
2400
|
+
return Re ? /* @__PURE__ */ _(
|
|
2352
2401
|
"div",
|
|
2353
2402
|
{
|
|
2354
|
-
className:
|
|
2403
|
+
className: nn,
|
|
2355
2404
|
style: ze,
|
|
2356
|
-
"data-display-mode":
|
|
2357
|
-
"data-position":
|
|
2405
|
+
"data-display-mode": ie,
|
|
2406
|
+
"data-position": m,
|
|
2358
2407
|
children: [
|
|
2359
|
-
|
|
2360
|
-
|
|
2408
|
+
ie === "hidden" && /* @__PURE__ */ n(
|
|
2409
|
+
Fn,
|
|
2361
2410
|
{
|
|
2362
|
-
position:
|
|
2411
|
+
position: m,
|
|
2363
2412
|
isMobile: ne,
|
|
2364
|
-
isSpeaking:
|
|
2365
|
-
onExpand: () =>
|
|
2413
|
+
isSpeaking: w.agentState === "speaking",
|
|
2414
|
+
onExpand: () => J("expanded"),
|
|
2366
2415
|
label: `Open ${lt} widget`
|
|
2367
2416
|
}
|
|
2368
2417
|
),
|
|
2369
|
-
|
|
2370
|
-
|
|
2418
|
+
ie === "minimized" && /* @__PURE__ */ n(
|
|
2419
|
+
jn,
|
|
2371
2420
|
{
|
|
2372
|
-
position:
|
|
2421
|
+
position: m,
|
|
2373
2422
|
isMobile: ne,
|
|
2374
2423
|
agentName: lt,
|
|
2375
|
-
avatarImageUrl:
|
|
2376
|
-
agentState:
|
|
2424
|
+
avatarImageUrl: mt,
|
|
2425
|
+
agentState: w.agentState,
|
|
2377
2426
|
isMuted: Y.isMuted,
|
|
2378
2427
|
audioLevel: le,
|
|
2379
|
-
onExpand:
|
|
2428
|
+
onExpand: Qt,
|
|
2380
2429
|
onToggleMute: Y.toggleMute,
|
|
2381
|
-
onClose:
|
|
2430
|
+
onClose: gt
|
|
2382
2431
|
}
|
|
2383
2432
|
),
|
|
2384
|
-
|
|
2385
|
-
|
|
2433
|
+
ie === "expanded" && /* @__PURE__ */ n(
|
|
2434
|
+
Yn,
|
|
2386
2435
|
{
|
|
2387
|
-
position:
|
|
2436
|
+
position: m,
|
|
2388
2437
|
isMobile: ne,
|
|
2389
2438
|
agentName: lt,
|
|
2390
|
-
avatarImageUrl:
|
|
2391
|
-
idleLoopUrl:
|
|
2392
|
-
greeting:
|
|
2393
|
-
branding:
|
|
2394
|
-
teamMembers:
|
|
2439
|
+
avatarImageUrl: mt,
|
|
2440
|
+
idleLoopUrl: Kt,
|
|
2441
|
+
greeting: Xt,
|
|
2442
|
+
branding: p,
|
|
2443
|
+
teamMembers: C,
|
|
2395
2444
|
currentTeamMemberId: ee,
|
|
2396
2445
|
isSwitchingTeamMember: Te,
|
|
2397
|
-
teamSwitcherOpen:
|
|
2398
|
-
onToggleTeamSwitcher: () =>
|
|
2399
|
-
onSelectTeamMember:
|
|
2400
|
-
connectionState:
|
|
2401
|
-
agentState:
|
|
2402
|
-
transcript:
|
|
2446
|
+
teamSwitcherOpen: y,
|
|
2447
|
+
onToggleTeamSwitcher: () => j((v) => !v),
|
|
2448
|
+
onSelectTeamMember: Gt,
|
|
2449
|
+
connectionState: w.connectionState,
|
|
2450
|
+
agentState: w.agentState,
|
|
2451
|
+
transcript: w.transcript,
|
|
2403
2452
|
isMuted: Y.isMuted,
|
|
2404
|
-
micDevices:
|
|
2405
|
-
isCameraEnabled:
|
|
2406
|
-
cameraPreviewEl:
|
|
2407
|
-
cameraDevices:
|
|
2408
|
-
activeCameraId:
|
|
2453
|
+
micDevices: Me.mics,
|
|
2454
|
+
isCameraEnabled: K.isEnabled,
|
|
2455
|
+
cameraPreviewEl: K.previewEl,
|
|
2456
|
+
cameraDevices: Me.cameras,
|
|
2457
|
+
activeCameraId: K.activeDeviceId,
|
|
2409
2458
|
isScreenShareEnabled: ae.isEnabled,
|
|
2410
2459
|
screenPreviewEl: ae.previewEl,
|
|
2411
2460
|
isSpeakerMuted: et,
|
|
2412
|
-
allowCamera:
|
|
2461
|
+
allowCamera: g,
|
|
2413
2462
|
allowScreenShare: E,
|
|
2414
|
-
allowTyping:
|
|
2415
|
-
languageMenuOpen:
|
|
2416
|
-
onToggleLanguageMenu: () =>
|
|
2463
|
+
allowTyping: x,
|
|
2464
|
+
languageMenuOpen: dt,
|
|
2465
|
+
onToggleLanguageMenu: () => Ut((v) => !v),
|
|
2417
2466
|
needsUserGesture: Ze,
|
|
2418
|
-
canResume:
|
|
2467
|
+
canResume: w.canResume,
|
|
2419
2468
|
micError: Y.micError,
|
|
2420
|
-
error:
|
|
2421
|
-
avatarVideoContainerRef:
|
|
2422
|
-
onConnect: () => void
|
|
2423
|
-
onDisconnect: () =>
|
|
2424
|
-
onRetry:
|
|
2425
|
-
onResumeAudio:
|
|
2469
|
+
error: w.error,
|
|
2470
|
+
avatarVideoContainerRef: pt,
|
|
2471
|
+
onConnect: () => void w.connect(),
|
|
2472
|
+
onDisconnect: () => w.disconnect(),
|
|
2473
|
+
onRetry: tn,
|
|
2474
|
+
onResumeAudio: en,
|
|
2426
2475
|
onToggleMute: Y.toggleMute,
|
|
2427
|
-
onToggleCamera: () => void
|
|
2428
|
-
onSwitchCameraDevice: (
|
|
2476
|
+
onToggleCamera: () => void K.toggle(),
|
|
2477
|
+
onSwitchCameraDevice: (v) => void K.switchDevice(v),
|
|
2429
2478
|
onToggleScreenShare: () => void ae.toggle(),
|
|
2430
|
-
onToggleSpeaker:
|
|
2431
|
-
onSendMessage:
|
|
2432
|
-
onMinimize:
|
|
2433
|
-
onClose:
|
|
2479
|
+
onToggleSpeaker: Yt,
|
|
2480
|
+
onSendMessage: Vt,
|
|
2481
|
+
onMinimize: Zt,
|
|
2482
|
+
onClose: gt,
|
|
2434
2483
|
onClearMicError: Y.clearError
|
|
2435
2484
|
}
|
|
2436
2485
|
)
|
|
@@ -2438,68 +2487,68 @@ function hr(e) {
|
|
|
2438
2487
|
}
|
|
2439
2488
|
) : null;
|
|
2440
2489
|
}
|
|
2441
|
-
function
|
|
2442
|
-
return /* @__PURE__ */ n(
|
|
2490
|
+
function Rr(e) {
|
|
2491
|
+
return /* @__PURE__ */ n(un, { children: /* @__PURE__ */ n(xr, { ...e }) });
|
|
2443
2492
|
}
|
|
2444
|
-
const
|
|
2493
|
+
const Ir = ({
|
|
2445
2494
|
agentId: e,
|
|
2446
2495
|
baseUrl: t,
|
|
2447
2496
|
apiKey: r,
|
|
2448
|
-
mode:
|
|
2449
|
-
onAgentEvent:
|
|
2497
|
+
mode: o,
|
|
2498
|
+
onAgentEvent: i,
|
|
2450
2499
|
className: l,
|
|
2451
2500
|
style: s
|
|
2452
2501
|
}) => {
|
|
2453
|
-
const d =
|
|
2454
|
-
|
|
2455
|
-
const
|
|
2456
|
-
var
|
|
2502
|
+
const d = I(null), u = I(null), h = I(i);
|
|
2503
|
+
h.current = i;
|
|
2504
|
+
const m = S((a) => {
|
|
2505
|
+
var A;
|
|
2457
2506
|
const c = a.detail;
|
|
2458
|
-
(
|
|
2507
|
+
(A = h.current) == null || A.call(h, c);
|
|
2459
2508
|
}, []);
|
|
2460
2509
|
return P(() => {
|
|
2461
2510
|
const a = d.current;
|
|
2462
2511
|
if (!a) return;
|
|
2463
2512
|
const c = document.createElement("livelayer-widget");
|
|
2464
|
-
return c.setAttribute("agent-id", e), t && c.setAttribute("base-url", t), r && c.setAttribute("api-key", r),
|
|
2465
|
-
c.removeEventListener("agent-event",
|
|
2513
|
+
return c.setAttribute("agent-id", e), t && c.setAttribute("base-url", t), r && c.setAttribute("api-key", r), o && c.setAttribute("mode", o), c.addEventListener("agent-event", m), a.appendChild(c), u.current = c, () => {
|
|
2514
|
+
c.removeEventListener("agent-event", m), a.removeChild(c), u.current = null;
|
|
2466
2515
|
};
|
|
2467
2516
|
}, [e]), P(() => {
|
|
2468
|
-
u.current && (
|
|
2469
|
-
}, [
|
|
2470
|
-
},
|
|
2471
|
-
function({ id: t, intent: r, as:
|
|
2472
|
-
return
|
|
2473
|
-
|
|
2517
|
+
u.current && (o ? u.current.setAttribute("mode", o) : u.current.removeAttribute("mode"));
|
|
2518
|
+
}, [o]), /* @__PURE__ */ n("div", { ref: d, className: l, style: s });
|
|
2519
|
+
}, Mr = ct(
|
|
2520
|
+
function({ id: t, intent: r, as: o = "div", className: i, style: l, children: s }, d) {
|
|
2521
|
+
return an(
|
|
2522
|
+
o,
|
|
2474
2523
|
{
|
|
2475
2524
|
ref: d,
|
|
2476
2525
|
"data-ll-region": t,
|
|
2477
2526
|
"data-ll-intent": r,
|
|
2478
|
-
className:
|
|
2527
|
+
className: i,
|
|
2479
2528
|
style: l
|
|
2480
2529
|
},
|
|
2481
2530
|
s
|
|
2482
2531
|
);
|
|
2483
2532
|
}
|
|
2484
|
-
),
|
|
2485
|
-
function({ id: t, intent: r, children:
|
|
2533
|
+
), Tr = ct(
|
|
2534
|
+
function({ id: t, intent: r, children: o, ...i }, l) {
|
|
2486
2535
|
return /* @__PURE__ */ n(
|
|
2487
2536
|
"form",
|
|
2488
2537
|
{
|
|
2489
2538
|
ref: l,
|
|
2490
2539
|
"data-ll-form": t,
|
|
2491
2540
|
"data-ll-intent": r,
|
|
2492
|
-
...
|
|
2493
|
-
children:
|
|
2541
|
+
...i,
|
|
2542
|
+
children: o
|
|
2494
2543
|
}
|
|
2495
2544
|
);
|
|
2496
2545
|
}
|
|
2497
|
-
),
|
|
2546
|
+
), Pr = ct(
|
|
2498
2547
|
function(t, r) {
|
|
2499
|
-
const { name:
|
|
2548
|
+
const { name: o, label: i, labelClassName: l } = t, s = { name: o, "data-ll-field": o };
|
|
2500
2549
|
let d;
|
|
2501
2550
|
if ("as" in t && t.as === "textarea") {
|
|
2502
|
-
const { name: u, label:
|
|
2551
|
+
const { name: u, label: h, labelClassName: m, as: a, ...c } = t;
|
|
2503
2552
|
d = /* @__PURE__ */ n(
|
|
2504
2553
|
"textarea",
|
|
2505
2554
|
{
|
|
@@ -2509,18 +2558,18 @@ const _r = ({
|
|
|
2509
2558
|
}
|
|
2510
2559
|
);
|
|
2511
2560
|
} else if ("as" in t && t.as === "select") {
|
|
2512
|
-
const { name: u, label:
|
|
2561
|
+
const { name: u, label: h, labelClassName: m, as: a, children: c, ...A } = t;
|
|
2513
2562
|
d = /* @__PURE__ */ n(
|
|
2514
2563
|
"select",
|
|
2515
2564
|
{
|
|
2516
2565
|
ref: r,
|
|
2517
2566
|
...s,
|
|
2518
|
-
...
|
|
2567
|
+
...A,
|
|
2519
2568
|
children: c
|
|
2520
2569
|
}
|
|
2521
2570
|
);
|
|
2522
2571
|
} else {
|
|
2523
|
-
const { name: u, label:
|
|
2572
|
+
const { name: u, label: h, labelClassName: m, as: a, ...c } = t;
|
|
2524
2573
|
d = /* @__PURE__ */ n(
|
|
2525
2574
|
"input",
|
|
2526
2575
|
{
|
|
@@ -2530,56 +2579,390 @@ const _r = ({
|
|
|
2530
2579
|
}
|
|
2531
2580
|
);
|
|
2532
2581
|
}
|
|
2533
|
-
return
|
|
2534
|
-
|
|
2582
|
+
return i === void 0 ? d : /* @__PURE__ */ _("label", { className: l, children: [
|
|
2583
|
+
i,
|
|
2535
2584
|
d
|
|
2536
2585
|
] });
|
|
2537
2586
|
}
|
|
2538
2587
|
);
|
|
2539
|
-
|
|
2540
|
-
|
|
2588
|
+
let qt = 1;
|
|
2589
|
+
function Dr({
|
|
2590
|
+
onMount: e,
|
|
2591
|
+
defaultOpen: t = !1,
|
|
2592
|
+
storageKey: r = "ll-debug-open"
|
|
2593
|
+
}) {
|
|
2594
|
+
const [o, i] = N(t), [l, s] = N([]), [d, u] = N(""), [h, m] = N(!1), a = I(/* @__PURE__ */ new Set()), c = I([]), A = I(h);
|
|
2595
|
+
A.current = h, P(() => {
|
|
2596
|
+
try {
|
|
2597
|
+
const b = localStorage.getItem(r);
|
|
2598
|
+
b === "1" && i(!0), b === "0" && i(!1);
|
|
2599
|
+
} catch {
|
|
2600
|
+
}
|
|
2601
|
+
}, [r]), P(() => {
|
|
2602
|
+
try {
|
|
2603
|
+
localStorage.setItem(r, o ? "1" : "0");
|
|
2604
|
+
} catch {
|
|
2605
|
+
}
|
|
2606
|
+
}, [o, r]), P(() => {
|
|
2607
|
+
const b = (L) => {
|
|
2608
|
+
(L.metaKey || L.ctrlKey) && L.shiftKey && L.key.toLowerCase() === "l" && (L.preventDefault(), i(($) => !$));
|
|
2609
|
+
};
|
|
2610
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
2611
|
+
}, []), P(() => {
|
|
2612
|
+
const b = setInterval(() => {
|
|
2613
|
+
if (c.current.length === 0 || A.current) return;
|
|
2614
|
+
const L = c.current.splice(0, c.current.length);
|
|
2615
|
+
s(
|
|
2616
|
+
($) => [...L.reverse(), ...$].slice(0, 200)
|
|
2617
|
+
);
|
|
2618
|
+
}, 100);
|
|
2619
|
+
return () => clearInterval(b);
|
|
2620
|
+
}, []);
|
|
2621
|
+
const C = I(!1);
|
|
2622
|
+
if (P(() => {
|
|
2623
|
+
!e || C.current || (C.current = !0, e((b) => {
|
|
2624
|
+
c.current.push({
|
|
2625
|
+
id: qt++,
|
|
2626
|
+
ts: Date.now(),
|
|
2627
|
+
kind: "event",
|
|
2628
|
+
type: b.eventName,
|
|
2629
|
+
data: b.data
|
|
2630
|
+
});
|
|
2631
|
+
}));
|
|
2632
|
+
}, [e]), P(() => {
|
|
2633
|
+
const b = console.warn, L = console.log, $ = (M, H) => function(...p) {
|
|
2634
|
+
try {
|
|
2635
|
+
const g = typeof p[0] == "string" ? p[0] : "";
|
|
2636
|
+
g.startsWith("[LiveLayer]") && c.current.push({
|
|
2637
|
+
id: qt++,
|
|
2638
|
+
ts: Date.now(),
|
|
2639
|
+
kind: M,
|
|
2640
|
+
type: g.slice(0, 120),
|
|
2641
|
+
data: { args: p.slice(1).map((E) => Lr(E)) }
|
|
2642
|
+
});
|
|
2643
|
+
} catch {
|
|
2644
|
+
}
|
|
2645
|
+
return H.apply(this, p);
|
|
2646
|
+
};
|
|
2647
|
+
return console.warn = $("warn", b), console.log = $("log", L), () => {
|
|
2648
|
+
console.warn = b, console.log = L;
|
|
2649
|
+
};
|
|
2650
|
+
}, []), !o)
|
|
2651
|
+
return /* @__PURE__ */ n(
|
|
2652
|
+
"button",
|
|
2653
|
+
{
|
|
2654
|
+
type: "button",
|
|
2655
|
+
onClick: () => i(!0),
|
|
2656
|
+
title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
|
|
2657
|
+
"aria-label": "Open LiveLayer debug panel",
|
|
2658
|
+
style: {
|
|
2659
|
+
position: "fixed",
|
|
2660
|
+
left: 16,
|
|
2661
|
+
bottom: 16,
|
|
2662
|
+
zIndex: 2147483640,
|
|
2663
|
+
background: "#0d0d0d",
|
|
2664
|
+
color: "#fff",
|
|
2665
|
+
border: "1px solid rgba(255,255,255,0.18)",
|
|
2666
|
+
borderRadius: 999,
|
|
2667
|
+
padding: "6px 10px",
|
|
2668
|
+
font: "500 11px -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
2669
|
+
letterSpacing: "-0.1px",
|
|
2670
|
+
cursor: "pointer",
|
|
2671
|
+
boxShadow: "0 4px 12px rgba(0,0,0,0.35)",
|
|
2672
|
+
opacity: 0.85
|
|
2673
|
+
},
|
|
2674
|
+
children: "🛰 LL debug"
|
|
2675
|
+
}
|
|
2676
|
+
);
|
|
2677
|
+
const R = l.filter((b) => {
|
|
2678
|
+
if (!d) return !0;
|
|
2679
|
+
const L = d.toLowerCase();
|
|
2680
|
+
return b.type.toLowerCase().includes(L) || JSON.stringify(b.data || {}).toLowerCase().includes(L);
|
|
2681
|
+
});
|
|
2682
|
+
return /* @__PURE__ */ _(
|
|
2683
|
+
"div",
|
|
2684
|
+
{
|
|
2685
|
+
style: {
|
|
2686
|
+
position: "fixed",
|
|
2687
|
+
left: 16,
|
|
2688
|
+
bottom: 16,
|
|
2689
|
+
zIndex: 2147483640,
|
|
2690
|
+
width: 380,
|
|
2691
|
+
maxHeight: "60vh",
|
|
2692
|
+
background: "#0d0d0d",
|
|
2693
|
+
color: "#fff",
|
|
2694
|
+
border: "1px solid rgba(255,255,255,0.16)",
|
|
2695
|
+
borderRadius: 12,
|
|
2696
|
+
boxShadow: "0 16px 48px rgba(0,0,0,0.5)",
|
|
2697
|
+
font: "500 11px -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
2698
|
+
letterSpacing: "-0.1px",
|
|
2699
|
+
display: "flex",
|
|
2700
|
+
flexDirection: "column",
|
|
2701
|
+
overflow: "hidden"
|
|
2702
|
+
},
|
|
2703
|
+
children: [
|
|
2704
|
+
/* @__PURE__ */ _(
|
|
2705
|
+
"div",
|
|
2706
|
+
{
|
|
2707
|
+
style: {
|
|
2708
|
+
padding: "8px 10px",
|
|
2709
|
+
background: "rgba(255,255,255,0.04)",
|
|
2710
|
+
borderBottom: "1px solid rgba(255,255,255,0.1)",
|
|
2711
|
+
display: "flex",
|
|
2712
|
+
alignItems: "center",
|
|
2713
|
+
gap: 8
|
|
2714
|
+
},
|
|
2715
|
+
children: [
|
|
2716
|
+
/* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
2717
|
+
/* @__PURE__ */ _("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
2718
|
+
l.length,
|
|
2719
|
+
" event",
|
|
2720
|
+
l.length === 1 ? "" : "s"
|
|
2721
|
+
] }),
|
|
2722
|
+
/* @__PURE__ */ n("span", { style: { flex: 1 } }),
|
|
2723
|
+
/* @__PURE__ */ n(
|
|
2724
|
+
"button",
|
|
2725
|
+
{
|
|
2726
|
+
type: "button",
|
|
2727
|
+
onClick: () => m((b) => !b),
|
|
2728
|
+
style: at(h ? "#f59e0b" : "transparent"),
|
|
2729
|
+
title: "Pause / resume capture",
|
|
2730
|
+
children: h ? "▶ resume" : "⏸ pause"
|
|
2731
|
+
}
|
|
2732
|
+
),
|
|
2733
|
+
/* @__PURE__ */ n(
|
|
2734
|
+
"button",
|
|
2735
|
+
{
|
|
2736
|
+
type: "button",
|
|
2737
|
+
onClick: () => {
|
|
2738
|
+
s([]), c.current = [];
|
|
2739
|
+
},
|
|
2740
|
+
style: at("transparent"),
|
|
2741
|
+
title: "Clear buffer",
|
|
2742
|
+
children: "clear"
|
|
2743
|
+
}
|
|
2744
|
+
),
|
|
2745
|
+
/* @__PURE__ */ n(
|
|
2746
|
+
"button",
|
|
2747
|
+
{
|
|
2748
|
+
type: "button",
|
|
2749
|
+
onClick: () => i(!1),
|
|
2750
|
+
style: at("transparent"),
|
|
2751
|
+
"aria-label": "Close",
|
|
2752
|
+
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
2753
|
+
children: "✕"
|
|
2754
|
+
}
|
|
2755
|
+
)
|
|
2756
|
+
]
|
|
2757
|
+
}
|
|
2758
|
+
),
|
|
2759
|
+
/* @__PURE__ */ n(
|
|
2760
|
+
"input",
|
|
2761
|
+
{
|
|
2762
|
+
type: "text",
|
|
2763
|
+
value: d,
|
|
2764
|
+
onChange: (b) => u(b.target.value),
|
|
2765
|
+
placeholder: "filter by type or data…",
|
|
2766
|
+
style: {
|
|
2767
|
+
margin: 8,
|
|
2768
|
+
padding: "6px 8px",
|
|
2769
|
+
background: "rgba(255,255,255,0.06)",
|
|
2770
|
+
border: "1px solid rgba(255,255,255,0.1)",
|
|
2771
|
+
borderRadius: 6,
|
|
2772
|
+
color: "#fff",
|
|
2773
|
+
fontSize: 11,
|
|
2774
|
+
outline: "none"
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
),
|
|
2778
|
+
/* @__PURE__ */ n(
|
|
2779
|
+
"div",
|
|
2780
|
+
{
|
|
2781
|
+
style: {
|
|
2782
|
+
flex: 1,
|
|
2783
|
+
overflowY: "auto",
|
|
2784
|
+
padding: "0 8px 8px"
|
|
2785
|
+
},
|
|
2786
|
+
children: R.length === 0 ? /* @__PURE__ */ _(
|
|
2787
|
+
"div",
|
|
2788
|
+
{
|
|
2789
|
+
style: {
|
|
2790
|
+
padding: 14,
|
|
2791
|
+
fontSize: 11,
|
|
2792
|
+
color: "rgba(255,255,255,0.4)",
|
|
2793
|
+
lineHeight: 1.5
|
|
2794
|
+
},
|
|
2795
|
+
children: [
|
|
2796
|
+
"No events yet. Connect to the agent and trigger a tool call — the events will stream in here. You can also dispatch commands manually in DevTools:",
|
|
2797
|
+
/* @__PURE__ */ n(
|
|
2798
|
+
"pre",
|
|
2799
|
+
{
|
|
2800
|
+
style: {
|
|
2801
|
+
marginTop: 6,
|
|
2802
|
+
background: "rgba(255,255,255,0.04)",
|
|
2803
|
+
padding: 6,
|
|
2804
|
+
borderRadius: 4,
|
|
2805
|
+
fontSize: 10,
|
|
2806
|
+
whiteSpace: "pre-wrap"
|
|
2807
|
+
},
|
|
2808
|
+
children: `window.__livelayerSimulateCommand({
|
|
2809
|
+
type: "navigate",
|
|
2810
|
+
href: "/about"
|
|
2811
|
+
})`
|
|
2812
|
+
}
|
|
2813
|
+
)
|
|
2814
|
+
]
|
|
2815
|
+
}
|
|
2816
|
+
) : R.map((b) => /* @__PURE__ */ n(
|
|
2817
|
+
kr,
|
|
2818
|
+
{
|
|
2819
|
+
entry: b,
|
|
2820
|
+
expanded: a.current.has(b.id),
|
|
2821
|
+
onToggle: () => {
|
|
2822
|
+
a.current.has(b.id) ? a.current.delete(b.id) : a.current.add(b.id), s((L) => [...L]);
|
|
2823
|
+
}
|
|
2824
|
+
},
|
|
2825
|
+
b.id
|
|
2826
|
+
))
|
|
2827
|
+
}
|
|
2828
|
+
)
|
|
2829
|
+
]
|
|
2830
|
+
}
|
|
2831
|
+
);
|
|
2832
|
+
}
|
|
2833
|
+
function kr({
|
|
2834
|
+
entry: e,
|
|
2835
|
+
expanded: t,
|
|
2836
|
+
onToggle: r
|
|
2837
|
+
}) {
|
|
2838
|
+
const o = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", i = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
2839
|
+
hour12: !1
|
|
2840
|
+
});
|
|
2841
|
+
return /* @__PURE__ */ _(
|
|
2842
|
+
"button",
|
|
2843
|
+
{
|
|
2844
|
+
type: "button",
|
|
2845
|
+
onClick: r,
|
|
2846
|
+
style: {
|
|
2847
|
+
textAlign: "left",
|
|
2848
|
+
background: "transparent",
|
|
2849
|
+
border: 0,
|
|
2850
|
+
color: "#fff",
|
|
2851
|
+
width: "100%",
|
|
2852
|
+
padding: "6px 4px",
|
|
2853
|
+
cursor: "pointer",
|
|
2854
|
+
borderBottom: "1px solid rgba(255,255,255,0.04)",
|
|
2855
|
+
fontSize: 11,
|
|
2856
|
+
lineHeight: 1.4
|
|
2857
|
+
},
|
|
2858
|
+
children: [
|
|
2859
|
+
/* @__PURE__ */ _("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
2860
|
+
/* @__PURE__ */ n(
|
|
2861
|
+
"span",
|
|
2862
|
+
{
|
|
2863
|
+
style: {
|
|
2864
|
+
color: "rgba(255,255,255,0.4)",
|
|
2865
|
+
fontVariantNumeric: "tabular-nums",
|
|
2866
|
+
fontSize: 10
|
|
2867
|
+
},
|
|
2868
|
+
children: i
|
|
2869
|
+
}
|
|
2870
|
+
),
|
|
2871
|
+
/* @__PURE__ */ n(
|
|
2872
|
+
"span",
|
|
2873
|
+
{
|
|
2874
|
+
style: {
|
|
2875
|
+
color: o,
|
|
2876
|
+
fontWeight: 600,
|
|
2877
|
+
flexShrink: 0
|
|
2878
|
+
},
|
|
2879
|
+
children: e.type.length > 50 ? e.type.slice(0, 50) + "…" : e.type
|
|
2880
|
+
}
|
|
2881
|
+
)
|
|
2882
|
+
] }),
|
|
2883
|
+
t && e.data && /* @__PURE__ */ n(
|
|
2884
|
+
"pre",
|
|
2885
|
+
{
|
|
2886
|
+
style: {
|
|
2887
|
+
marginTop: 6,
|
|
2888
|
+
padding: 6,
|
|
2889
|
+
background: "rgba(255,255,255,0.04)",
|
|
2890
|
+
borderRadius: 4,
|
|
2891
|
+
fontSize: 10,
|
|
2892
|
+
overflowX: "auto",
|
|
2893
|
+
whiteSpace: "pre-wrap",
|
|
2894
|
+
wordBreak: "break-all"
|
|
2895
|
+
},
|
|
2896
|
+
children: JSON.stringify(e.data, null, 2)
|
|
2897
|
+
}
|
|
2898
|
+
)
|
|
2899
|
+
]
|
|
2900
|
+
}
|
|
2901
|
+
);
|
|
2902
|
+
}
|
|
2903
|
+
function at(e) {
|
|
2904
|
+
return {
|
|
2905
|
+
background: e,
|
|
2906
|
+
color: "#fff",
|
|
2907
|
+
border: "1px solid rgba(255,255,255,0.16)",
|
|
2908
|
+
borderRadius: 999,
|
|
2909
|
+
padding: "3px 8px",
|
|
2910
|
+
fontSize: 10,
|
|
2911
|
+
cursor: "pointer"
|
|
2912
|
+
};
|
|
2913
|
+
}
|
|
2914
|
+
function Lr(e) {
|
|
2915
|
+
try {
|
|
2916
|
+
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
2917
|
+
} catch {
|
|
2918
|
+
return String(e);
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
function $r() {
|
|
2922
|
+
const [e, t] = N([]), r = S((i) => {
|
|
2541
2923
|
t((l) => {
|
|
2542
|
-
const s = l.findIndex((d) => d.id ===
|
|
2924
|
+
const s = l.findIndex((d) => d.id === i.id);
|
|
2543
2925
|
if (s >= 0) {
|
|
2544
2926
|
const d = l.slice();
|
|
2545
|
-
return d[s] =
|
|
2927
|
+
return d[s] = i, d;
|
|
2546
2928
|
}
|
|
2547
|
-
return [...l,
|
|
2929
|
+
return [...l, i];
|
|
2548
2930
|
});
|
|
2549
|
-
}, []),
|
|
2931
|
+
}, []), o = S(() => t([]), []);
|
|
2550
2932
|
return {
|
|
2551
2933
|
entries: e,
|
|
2552
2934
|
pushSegment: r,
|
|
2553
|
-
clear:
|
|
2935
|
+
clear: o,
|
|
2554
2936
|
latest: e.length > 0 ? e[e.length - 1] : null
|
|
2555
2937
|
};
|
|
2556
2938
|
}
|
|
2557
2939
|
export {
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
pn as
|
|
2575
|
-
|
|
2576
|
-
xn as
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2940
|
+
Rr as AvatarWidget,
|
|
2941
|
+
un as ErrorBoundary,
|
|
2942
|
+
Dr as LiveLayerDebugPanel,
|
|
2943
|
+
Pr as LiveLayerField,
|
|
2944
|
+
Tr as LiveLayerForm,
|
|
2945
|
+
Mr as LiveLayerRegion,
|
|
2946
|
+
Ir as LiveLayerWidget,
|
|
2947
|
+
ar as clearPageContextCache,
|
|
2948
|
+
pr as clearRoutesCache,
|
|
2949
|
+
lr as extractPageContext,
|
|
2950
|
+
dr as extractRoutes,
|
|
2951
|
+
Ht as getCachedPageContext,
|
|
2952
|
+
fr as getCachedRoutes,
|
|
2953
|
+
Pn as matchesPattern,
|
|
2954
|
+
Dn as shouldRenderAtPath,
|
|
2955
|
+
bn as useAgentInfo,
|
|
2956
|
+
pn as useAudioLevel,
|
|
2957
|
+
gn as useCameraState,
|
|
2958
|
+
xn as useDisplayMode,
|
|
2959
|
+
Sn as useDisplayModePersistence,
|
|
2960
|
+
En as useIsMobile,
|
|
2961
|
+
fn as useLiveKitSession,
|
|
2962
|
+
vn as useMediaDevices,
|
|
2963
|
+
hn as useMicrophoneState,
|
|
2964
|
+
An as usePathname,
|
|
2965
|
+
$n as useRouteMatch,
|
|
2966
|
+
yn as useScreenShareState,
|
|
2967
|
+
$r as useTranscript
|
|
2585
2968
|
};
|