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