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