@livelayer/react 0.21.3 → 0.21.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.mjs +1037 -993
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as k, jsx as r, Fragment as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as
|
|
8
|
-
class
|
|
2
|
+
import { jsxs as k, jsx as r, Fragment as We } from "react/jsx-runtime";
|
|
3
|
+
import { Component as ur, useState as M, useRef as I, useEffect as T, useCallback as C, useMemo as tt, useLayoutEffect as Dn, forwardRef as Gt, useImperativeHandle as dr, createElement as fr } from "react";
|
|
4
|
+
import { createPortal as Xt } from "react-dom";
|
|
5
|
+
import { LiveKitSession as pr, registerFields as hr } from "@livelayer/sdk";
|
|
6
|
+
import { clearFieldRegistry as po, getRegisteredFields as ho, registerFields as mo, setFieldValue as go } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as mr, Track as zn, createLocalVideoTrack as gr } from "livekit-client";
|
|
8
|
+
class yr extends ur {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -35,26 +35,26 @@ class mr extends sr {
|
|
|
35
35
|
] }) : this.props.children;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const [t, n] = M("idle"), [i, a] = M("idle"), [
|
|
38
|
+
function vr(e) {
|
|
39
|
+
const [t, n] = M("idle"), [i, a] = M("idle"), [o, s] = M([]), [l, c] = M(null), [u, m] = M(null), [p, h] = M(null), [P, x] = M(!1), [E, y] = M(null), w = I(null), R = I(e.onDataMessage);
|
|
40
40
|
R.current = e.onDataMessage, T(() => {
|
|
41
|
-
const
|
|
41
|
+
const g = {
|
|
42
42
|
onConnectionStateChange: (W) => {
|
|
43
|
-
n(W), W === "connected" &&
|
|
43
|
+
n(W), W === "connected" && y(null);
|
|
44
44
|
},
|
|
45
45
|
onAgentStateChange: a,
|
|
46
46
|
onTranscript: (W) => s([...W]),
|
|
47
47
|
onAgentConfig: c,
|
|
48
48
|
onAudioTrack: (W) => h(W),
|
|
49
|
-
onVideoTrack: (W) =>
|
|
50
|
-
onVideoTrackRemoved: () =>
|
|
51
|
-
onError: (W) =>
|
|
49
|
+
onVideoTrack: (W) => m(W),
|
|
50
|
+
onVideoTrackRemoved: () => m(null),
|
|
51
|
+
onError: (W) => y(W),
|
|
52
52
|
onDataMessage: (W) => {
|
|
53
53
|
var K;
|
|
54
54
|
(K = R.current) == null || K.call(R, W);
|
|
55
55
|
},
|
|
56
56
|
onResumabilityChange: x
|
|
57
|
-
}, D = new
|
|
57
|
+
}, D = new pr(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
60
60
|
baseUrl: e.baseUrl,
|
|
@@ -62,9 +62,9 @@ function gr(e) {
|
|
|
62
62
|
sessionEndpoint: e.sessionEndpoint,
|
|
63
63
|
sessionBody: e.sessionBody
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
g
|
|
66
66
|
);
|
|
67
|
-
return w.current = D, n("idle"), a("idle"), s([]), c(null),
|
|
67
|
+
return w.current = D, n("idle"), a("idle"), s([]), c(null), m(null), h(null), x(!1), y(null), () => {
|
|
68
68
|
var W;
|
|
69
69
|
(W = D.destroy) == null || W.call(D), w.current = null;
|
|
70
70
|
};
|
|
@@ -76,36 +76,36 @@ function gr(e) {
|
|
|
76
76
|
JSON.stringify(e.sessionBody ?? {})
|
|
77
77
|
]);
|
|
78
78
|
const S = C(async () => {
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
79
|
+
const g = w.current;
|
|
80
|
+
if (g)
|
|
81
81
|
try {
|
|
82
|
-
await
|
|
82
|
+
await g.connect();
|
|
83
83
|
} catch (D) {
|
|
84
|
-
throw
|
|
84
|
+
throw y(D instanceof Error ? D.message : String(D)), D;
|
|
85
85
|
}
|
|
86
|
-
}, []),
|
|
87
|
-
const
|
|
88
|
-
|
|
86
|
+
}, []), v = C(() => {
|
|
87
|
+
const g = w.current;
|
|
88
|
+
g && g.disconnect();
|
|
89
89
|
}, []), O = C(() => {
|
|
90
|
-
var
|
|
91
|
-
return ((
|
|
90
|
+
var g;
|
|
91
|
+
return ((g = w.current) == null ? void 0 : g.getRoom()) ?? null;
|
|
92
92
|
}, []);
|
|
93
93
|
return {
|
|
94
94
|
connectionState: t,
|
|
95
95
|
agentState: i,
|
|
96
|
-
transcript:
|
|
97
|
-
agentConfig:
|
|
96
|
+
transcript: o,
|
|
97
|
+
agentConfig: l,
|
|
98
98
|
videoElement: u,
|
|
99
99
|
audioElement: p,
|
|
100
100
|
canResume: P,
|
|
101
101
|
error: E,
|
|
102
102
|
connect: S,
|
|
103
|
-
disconnect:
|
|
103
|
+
disconnect: v,
|
|
104
104
|
getRoom: O,
|
|
105
105
|
session: w.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function br() {
|
|
109
109
|
const e = I(null), t = I(/* @__PURE__ */ new Map()), n = I(null), i = I(/* @__PURE__ */ new Set()), a = C(() => {
|
|
110
110
|
const x = t.current;
|
|
111
111
|
if (x.size === 0) {
|
|
@@ -113,23 +113,23 @@ function yr() {
|
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
let E = 0;
|
|
116
|
-
for (const { analyser:
|
|
117
|
-
|
|
116
|
+
for (const { analyser: y, buffer: w } of x.values()) {
|
|
117
|
+
y.getByteFrequencyData(w);
|
|
118
118
|
let R = 0;
|
|
119
|
-
for (let
|
|
119
|
+
for (let v = 0; v < w.length; v++) R += w[v];
|
|
120
120
|
const S = R / w.length / 255;
|
|
121
121
|
S > E && (E = S);
|
|
122
122
|
}
|
|
123
|
-
for (const
|
|
123
|
+
for (const y of i.current)
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
y(E);
|
|
126
126
|
} catch (w) {
|
|
127
127
|
console.error("[useAudioLevel] subscriber threw:", w);
|
|
128
128
|
}
|
|
129
129
|
n.current = requestAnimationFrame(a);
|
|
130
|
-
}, []),
|
|
130
|
+
}, []), o = C(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = C(() => {
|
|
131
131
|
n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(a));
|
|
132
|
-
}, [a]),
|
|
132
|
+
}, [a]), l = C((x) => {
|
|
133
133
|
const E = t.current.get(x);
|
|
134
134
|
if (E) {
|
|
135
135
|
try {
|
|
@@ -144,12 +144,12 @@ function yr() {
|
|
|
144
144
|
}
|
|
145
145
|
}, []), c = C(
|
|
146
146
|
(x, E) => {
|
|
147
|
-
const
|
|
148
|
-
if (!
|
|
149
|
-
|
|
150
|
-
const w = E(
|
|
147
|
+
const y = o();
|
|
148
|
+
if (!y) return;
|
|
149
|
+
l(x);
|
|
150
|
+
const w = E(y);
|
|
151
151
|
if (!w) return;
|
|
152
|
-
const R =
|
|
152
|
+
const R = y.createAnalyser();
|
|
153
153
|
R.fftSize = 64;
|
|
154
154
|
try {
|
|
155
155
|
w.connect(R);
|
|
@@ -163,12 +163,12 @@ function yr() {
|
|
|
163
163
|
buffer: new Uint8Array(new ArrayBuffer(R.frequencyBinCount))
|
|
164
164
|
}), s();
|
|
165
165
|
},
|
|
166
|
-
[
|
|
166
|
+
[l, o, s]
|
|
167
167
|
), u = C(
|
|
168
168
|
(x, E = "agent") => {
|
|
169
|
-
c(E, (
|
|
169
|
+
c(E, (y) => {
|
|
170
170
|
try {
|
|
171
|
-
return
|
|
171
|
+
return y.createMediaElementSource(x);
|
|
172
172
|
} catch (w) {
|
|
173
173
|
return console.warn(
|
|
174
174
|
"[useAudioLevel] createMediaElementSource failed for slot",
|
|
@@ -179,11 +179,11 @@ function yr() {
|
|
|
179
179
|
});
|
|
180
180
|
},
|
|
181
181
|
[c]
|
|
182
|
-
),
|
|
182
|
+
), m = C(
|
|
183
183
|
(x, E = "mic") => {
|
|
184
|
-
c(E, (
|
|
184
|
+
c(E, (y) => {
|
|
185
185
|
try {
|
|
186
|
-
return
|
|
186
|
+
return y.createMediaStreamSource(x);
|
|
187
187
|
} catch (w) {
|
|
188
188
|
return console.warn(
|
|
189
189
|
"[useAudioLevel] createMediaStreamSource failed for slot",
|
|
@@ -196,14 +196,14 @@ function yr() {
|
|
|
196
196
|
[c]
|
|
197
197
|
), p = C(
|
|
198
198
|
(x) => {
|
|
199
|
-
|
|
199
|
+
l(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
200
200
|
},
|
|
201
|
-
[
|
|
201
|
+
[l]
|
|
202
202
|
), h = C(() => {
|
|
203
203
|
n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
204
204
|
for (const x of Array.from(t.current.keys()))
|
|
205
|
-
|
|
206
|
-
}, [
|
|
205
|
+
l(x);
|
|
206
|
+
}, [l]), P = C((x) => (i.current.add(x), () => {
|
|
207
207
|
i.current.delete(x);
|
|
208
208
|
}), []);
|
|
209
209
|
return T(() => () => {
|
|
@@ -215,120 +215,120 @@ function yr() {
|
|
|
215
215
|
e.current = null;
|
|
216
216
|
}
|
|
217
217
|
i.current.clear();
|
|
218
|
-
}, [h]), { attach: u, attachStream:
|
|
218
|
+
}, [h]), { attach: u, attachStream: m, detach: h, detachSlot: p, subscribe: P };
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function wr(e) {
|
|
221
221
|
const t = e == null ? void 0 : e.mediaStreamTrack;
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, a] = M(t), [
|
|
224
|
+
function _r(e = {}) {
|
|
225
|
+
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, a] = M(t), [o, s] = M(""), [l, c] = M(null), u = I(null), m = I(null), p = I({
|
|
226
226
|
active: t,
|
|
227
227
|
lastAutoIntent: null
|
|
228
228
|
}), h = C(async (S) => {
|
|
229
|
-
var
|
|
230
|
-
if (u.current &&
|
|
229
|
+
var v, O;
|
|
230
|
+
if (u.current && m.current) {
|
|
231
231
|
try {
|
|
232
|
-
await
|
|
232
|
+
await m.current.localParticipant.unpublishTrack(u.current);
|
|
233
233
|
} catch {
|
|
234
234
|
}
|
|
235
235
|
u.current.stop(), u.current = null;
|
|
236
236
|
}
|
|
237
|
-
|
|
237
|
+
m.current = S, c(null);
|
|
238
238
|
try {
|
|
239
|
-
const
|
|
239
|
+
const g = await mr({
|
|
240
240
|
echoCancellation: !0,
|
|
241
241
|
noiseSuppression: !0
|
|
242
242
|
});
|
|
243
|
-
await S.localParticipant.publishTrack(
|
|
244
|
-
const D = (O = (
|
|
243
|
+
await S.localParticipant.publishTrack(g), u.current = g, p.current.active ? (await S.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, a(!0)) : a(g.isMuted);
|
|
244
|
+
const D = (O = (v = g.mediaStreamTrack) == null ? void 0 : v.getSettings) == null ? void 0 : O.call(v);
|
|
245
245
|
D != null && D.deviceId && s(D.deviceId);
|
|
246
|
-
} catch (
|
|
247
|
-
const D =
|
|
248
|
-
throw c(D),
|
|
246
|
+
} catch (g) {
|
|
247
|
+
const D = g instanceof Error && g.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
248
|
+
throw c(D), g;
|
|
249
249
|
}
|
|
250
250
|
}, []), P = C((S) => {
|
|
251
|
-
|
|
251
|
+
m.current = S;
|
|
252
252
|
}, []), x = C(async (S) => {
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
253
|
+
const v = m.current;
|
|
254
|
+
if (v)
|
|
255
255
|
try {
|
|
256
|
-
await
|
|
256
|
+
await v.switchActiveDevice("audioinput", S), s(S);
|
|
257
257
|
} catch (O) {
|
|
258
258
|
console.warn("[useMicrophoneState] switchDevice failed:", O);
|
|
259
259
|
}
|
|
260
260
|
}, []), E = C(async () => {
|
|
261
|
-
const S =
|
|
262
|
-
if (a(
|
|
261
|
+
const S = m.current, v = !i;
|
|
262
|
+
if (a(v), p.current.active = !1, !!S)
|
|
263
263
|
try {
|
|
264
|
-
await S.localParticipant.setMicrophoneEnabled(!
|
|
264
|
+
await S.localParticipant.setMicrophoneEnabled(!v);
|
|
265
265
|
} catch (O) {
|
|
266
|
-
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), a(!
|
|
266
|
+
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), a(!v);
|
|
267
267
|
}
|
|
268
268
|
}, [i]);
|
|
269
269
|
T(() => {
|
|
270
270
|
if (!p.current.active || n !== "listening") return;
|
|
271
|
-
const S =
|
|
272
|
-
if (!
|
|
271
|
+
const S = m.current, v = S == null ? void 0 : S.localParticipant;
|
|
272
|
+
if (!v) {
|
|
273
273
|
p.current.active = !1;
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
v.isMicrophoneEnabled === p.current.lastAutoIntent && (v.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, a(!1)), p.current.active = !1;
|
|
277
277
|
}, [n]);
|
|
278
|
-
const
|
|
279
|
-
const S = u.current,
|
|
280
|
-
if (S &&
|
|
278
|
+
const y = C(() => {
|
|
279
|
+
const S = u.current, v = m.current;
|
|
280
|
+
if (S && v) {
|
|
281
281
|
try {
|
|
282
|
-
|
|
282
|
+
v.localParticipant.unpublishTrack(S);
|
|
283
283
|
} catch {
|
|
284
284
|
}
|
|
285
285
|
S.stop();
|
|
286
286
|
}
|
|
287
|
-
u.current = null,
|
|
288
|
-
}, [t]), w = C(() => c(null), []), R = C(() =>
|
|
287
|
+
u.current = null, m.current = null, p.current = { active: t, lastAutoIntent: null }, a(t), s("");
|
|
288
|
+
}, [t]), w = C(() => c(null), []), R = C(() => wr(u.current), []);
|
|
289
289
|
return {
|
|
290
290
|
isMuted: i,
|
|
291
|
-
activeDeviceId:
|
|
292
|
-
micError:
|
|
291
|
+
activeDeviceId: o,
|
|
292
|
+
micError: l,
|
|
293
293
|
toggleMute: E,
|
|
294
294
|
setupMic: h,
|
|
295
295
|
attachRoom: P,
|
|
296
296
|
switchDevice: x,
|
|
297
|
-
teardownMic:
|
|
297
|
+
teardownMic: y,
|
|
298
298
|
clearError: w,
|
|
299
299
|
getMicStream: R
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
304
|
-
const [e, t] = M(!1), [n, i] = M(null), [a,
|
|
302
|
+
const xr = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
303
|
+
function Lr() {
|
|
304
|
+
const [e, t] = M(!1), [n, i] = M(null), [a, o] = M(null), [s, l] = M(""), c = I(null), u = I(null), m = C((w) => {
|
|
305
305
|
c.current = w;
|
|
306
306
|
}, []), p = C(() => {
|
|
307
307
|
var S;
|
|
308
308
|
const w = c.current, R = u.current;
|
|
309
309
|
if (R && w) {
|
|
310
|
-
const
|
|
310
|
+
const v = w.localParticipant.getTrackPublication(zn.Source.Camera), g = (v == null ? void 0 : v.track) ?? R;
|
|
311
311
|
try {
|
|
312
|
-
w.localParticipant.unpublishTrack(
|
|
312
|
+
w.localParticipant.unpublishTrack(g);
|
|
313
313
|
} catch {
|
|
314
314
|
}
|
|
315
315
|
try {
|
|
316
|
-
(S =
|
|
316
|
+
(S = g.stop) == null || S.call(g);
|
|
317
317
|
} catch {
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
u.current = null,
|
|
320
|
+
u.current = null, o(null), t(!1);
|
|
321
321
|
}, []), h = C(async (w) => {
|
|
322
322
|
const R = c.current;
|
|
323
323
|
if (R) {
|
|
324
324
|
i(null);
|
|
325
325
|
try {
|
|
326
|
-
const S = { ...
|
|
326
|
+
const S = { ...xr };
|
|
327
327
|
w && (S.deviceId = w);
|
|
328
|
-
const
|
|
329
|
-
await R.localParticipant.publishTrack(
|
|
330
|
-
const O =
|
|
331
|
-
|
|
328
|
+
const v = await gr(S);
|
|
329
|
+
await R.localParticipant.publishTrack(v), u.current = v;
|
|
330
|
+
const O = v.attach();
|
|
331
|
+
o(O), t(!0), w && l(w);
|
|
332
332
|
try {
|
|
333
333
|
R.localParticipant.publishData(
|
|
334
334
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
@@ -337,8 +337,8 @@ function _r() {
|
|
|
337
337
|
} catch {
|
|
338
338
|
}
|
|
339
339
|
} catch (S) {
|
|
340
|
-
const
|
|
341
|
-
i(
|
|
340
|
+
const v = S instanceof Error && S.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
341
|
+
i(v);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
}, []), P = C(async () => {
|
|
@@ -346,8 +346,8 @@ function _r() {
|
|
|
346
346
|
}, [e, s, p, h]), x = C(async (w) => {
|
|
347
347
|
p(), await h(w);
|
|
348
348
|
}, [p, h]), E = C(() => {
|
|
349
|
-
p(), c.current = null, i(null),
|
|
350
|
-
}, [p]),
|
|
349
|
+
p(), c.current = null, i(null), l("");
|
|
350
|
+
}, [p]), y = C(() => i(null), []);
|
|
351
351
|
return T(() => () => {
|
|
352
352
|
u.current && u.current.stop();
|
|
353
353
|
}, []), {
|
|
@@ -357,15 +357,15 @@ function _r() {
|
|
|
357
357
|
activeDeviceId: s,
|
|
358
358
|
toggle: P,
|
|
359
359
|
switchDevice: x,
|
|
360
|
-
attachRoom:
|
|
360
|
+
attachRoom: m,
|
|
361
361
|
teardown: E,
|
|
362
|
-
clearError:
|
|
362
|
+
clearError: y
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
const [e, t] = M(!1), [n, i] = M(null), [a,
|
|
365
|
+
function Cr() {
|
|
366
|
+
const [e, t] = M(!1), [n, i] = M(null), [a, o] = M(null), s = I(null), l = C((h) => {
|
|
367
367
|
s.current = h;
|
|
368
|
-
}, []), c = C(() =>
|
|
368
|
+
}, []), c = C(() => o(null), []), u = C(async () => {
|
|
369
369
|
const h = s.current;
|
|
370
370
|
if (h) {
|
|
371
371
|
if (e) {
|
|
@@ -381,10 +381,10 @@ function xr() {
|
|
|
381
381
|
await h.localParticipant.setScreenShareEnabled(!0);
|
|
382
382
|
let P = 0;
|
|
383
383
|
const x = () => {
|
|
384
|
-
const E = h.localParticipant.getTrackPublication(
|
|
384
|
+
const E = h.localParticipant.getTrackPublication(zn.Source.ScreenShare);
|
|
385
385
|
if (E != null && E.track) {
|
|
386
|
-
const
|
|
387
|
-
|
|
386
|
+
const y = E.track.attach();
|
|
387
|
+
o(y), t(!0);
|
|
388
388
|
try {
|
|
389
389
|
h.localParticipant.publishData(
|
|
390
390
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
@@ -402,7 +402,7 @@ function xr() {
|
|
|
402
402
|
x !== "NotAllowedError" && x !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
}, [e, c]),
|
|
405
|
+
}, [e, c]), m = C(() => {
|
|
406
406
|
const h = s.current;
|
|
407
407
|
if (h && e)
|
|
408
408
|
try {
|
|
@@ -411,32 +411,32 @@ function xr() {
|
|
|
411
411
|
}
|
|
412
412
|
c(), t(!1), i(null), s.current = null;
|
|
413
413
|
}, [e, c]), p = C(() => i(null), []);
|
|
414
|
-
return { isEnabled: e, error: n, previewEl: a, toggle: u, attachRoom:
|
|
414
|
+
return { isEnabled: e, error: n, previewEl: a, toggle: u, attachRoom: l, teardown: m, clearError: p };
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function kr() {
|
|
417
417
|
const [e, t] = M([]), [n, i] = M([]), a = C(async () => {
|
|
418
418
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
419
419
|
try {
|
|
420
|
-
const
|
|
421
|
-
t(
|
|
420
|
+
const o = await navigator.mediaDevices.enumerateDevices();
|
|
421
|
+
t(o.filter((s) => s.kind === "audioinput")), i(o.filter((s) => s.kind === "videoinput"));
|
|
422
422
|
} catch {
|
|
423
423
|
}
|
|
424
424
|
}, []);
|
|
425
425
|
return T(() => {
|
|
426
426
|
if (a(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
427
|
-
const
|
|
428
|
-
return navigator.mediaDevices.addEventListener("devicechange",
|
|
427
|
+
const o = () => void a();
|
|
428
|
+
return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
|
|
429
429
|
}, [a]), { mics: e, cameras: n, refresh: a };
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
const [i, a] = M(null), [
|
|
431
|
+
function Sr(e, t, n = !1) {
|
|
432
|
+
const [i, a] = M(null), [o, s] = M(null), [l, c] = M(!n && !!e);
|
|
433
433
|
return T(() => {
|
|
434
434
|
if (n || !e) {
|
|
435
435
|
c(!1);
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
438
|
-
const u = new AbortController(),
|
|
439
|
-
return c(!0), s(null), fetch(`${
|
|
438
|
+
const u = new AbortController(), m = t || "https://app.livelayer.studio";
|
|
439
|
+
return c(!0), s(null), fetch(`${m}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
440
440
|
signal: u.signal
|
|
441
441
|
}).then(async (p) => {
|
|
442
442
|
if (!p.ok) {
|
|
@@ -449,9 +449,9 @@ function Cr(e, t, n = !1) {
|
|
|
449
449
|
}).catch((p) => {
|
|
450
450
|
u.signal.aborted || (s(p instanceof Error ? p.message : "Agent lookup failed"), c(!1));
|
|
451
451
|
}), () => u.abort();
|
|
452
|
-
}, [e, t, n]), { info: i, error:
|
|
452
|
+
}, [e, t, n]), { info: i, error: o, loading: l };
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function $n(e) {
|
|
455
455
|
if (typeof window > "u") return null;
|
|
456
456
|
try {
|
|
457
457
|
return window.localStorage.getItem(e);
|
|
@@ -459,59 +459,59 @@ function Dn(e) {
|
|
|
459
459
|
return null;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Hn(e, t) {
|
|
463
463
|
if (!(typeof window > "u"))
|
|
464
464
|
try {
|
|
465
465
|
window.localStorage.setItem(e, t);
|
|
466
466
|
} catch {
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Er(e) {
|
|
470
470
|
if (!(typeof window > "u"))
|
|
471
471
|
try {
|
|
472
472
|
window.localStorage.removeItem(e);
|
|
473
473
|
} catch {
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Nr({
|
|
477
477
|
value: e,
|
|
478
478
|
defaultValue: t = "expanded",
|
|
479
479
|
onChange: n
|
|
480
480
|
} = {}) {
|
|
481
|
-
const i = e !== void 0, [a,
|
|
481
|
+
const i = e !== void 0, [a, o] = M(t), s = i ? e : a, l = C(
|
|
482
482
|
(c) => {
|
|
483
|
-
c !== s && (i ||
|
|
483
|
+
c !== s && (i || o(c), n == null || n(c));
|
|
484
484
|
},
|
|
485
485
|
[s, i, n]
|
|
486
486
|
);
|
|
487
|
-
return [s,
|
|
487
|
+
return [s, l];
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
function
|
|
491
|
-
return e &&
|
|
489
|
+
const Ar = ["hidden", "minimized", "expanded"];
|
|
490
|
+
function Mr(e) {
|
|
491
|
+
return e && Ar.includes(e) ? e : null;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Ir({
|
|
494
494
|
value: e,
|
|
495
495
|
defaultValue: t = "expanded",
|
|
496
496
|
onChange: n,
|
|
497
497
|
persistKey: i = "ll-widget",
|
|
498
498
|
disablePersistence: a = !1
|
|
499
499
|
} = {}) {
|
|
500
|
-
const
|
|
500
|
+
const o = `${i}:display-mode`, s = I(!1), [l, c] = Nr({
|
|
501
501
|
value: e,
|
|
502
502
|
defaultValue: t,
|
|
503
503
|
onChange: (u) => {
|
|
504
|
-
e === void 0 && !a &&
|
|
504
|
+
e === void 0 && !a && Hn(o, u), n == null || n(u);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
return T(() => {
|
|
508
508
|
if (s.current || (s.current = !0, a || e !== void 0)) return;
|
|
509
|
-
const u =
|
|
510
|
-
u && u !==
|
|
511
|
-
}, []), [
|
|
509
|
+
const u = Mr($n(o));
|
|
510
|
+
u && u !== l && c(u);
|
|
511
|
+
}, []), [l, c];
|
|
512
512
|
}
|
|
513
|
-
const
|
|
514
|
-
function
|
|
513
|
+
const Rr = 640;
|
|
514
|
+
function Tr(e = Rr) {
|
|
515
515
|
const [t, n] = M(!1);
|
|
516
516
|
return T(() => {
|
|
517
517
|
if (e === !1) {
|
|
@@ -520,17 +520,17 @@ function Ir(e = Mr) {
|
|
|
520
520
|
}
|
|
521
521
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
522
522
|
return;
|
|
523
|
-
const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i),
|
|
524
|
-
return
|
|
525
|
-
a.removeListener(
|
|
523
|
+
const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i), o = () => n(a.matches);
|
|
524
|
+
return o(), typeof a.addEventListener == "function" ? (a.addEventListener("change", o), () => a.removeEventListener("change", o)) : (a.addListener(o), () => {
|
|
525
|
+
a.removeListener(o);
|
|
526
526
|
});
|
|
527
527
|
}, [e]), t;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
function
|
|
529
|
+
const Pr = 280, Dr = 380, zr = 8, $r = 4;
|
|
530
|
+
function Ft(e) {
|
|
531
531
|
return `${e}:geometry`;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function Hr(e) {
|
|
534
534
|
if (!e) return null;
|
|
535
535
|
let t;
|
|
536
536
|
try {
|
|
@@ -539,55 +539,55 @@ function zr(e) {
|
|
|
539
539
|
return null;
|
|
540
540
|
}
|
|
541
541
|
if (typeof t != "object" || t === null) return null;
|
|
542
|
-
const n = t, { top: i, left: a, width:
|
|
543
|
-
return typeof i != "number" || typeof a != "number" || typeof
|
|
542
|
+
const n = t, { top: i, left: a, width: o, height: s } = n;
|
|
543
|
+
return typeof i != "number" || typeof a != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: a, width: o, height: s };
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function kt() {
|
|
546
546
|
return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
const { minWidth: i, minHeight: a, edgeMargin:
|
|
548
|
+
function Wt(e, t, n) {
|
|
549
|
+
const { minWidth: i, minHeight: a, edgeMargin: o, vw: s, vh: l } = n, c = Math.max(i, s - o * 2), u = Math.max(a, l - o * 2);
|
|
550
550
|
return {
|
|
551
551
|
width: Math.max(i, Math.min(c, e)),
|
|
552
552
|
height: Math.max(a, Math.min(u, t))
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
const { edgeMargin:
|
|
555
|
+
function Bt(e, t, n, i, a) {
|
|
556
|
+
const { edgeMargin: o, vw: s, vh: l } = a, c = o, u = o, m = Math.max(c, s - n - o), p = Math.max(u, l - i - o);
|
|
557
557
|
return {
|
|
558
558
|
top: Math.max(u, Math.min(p, e)),
|
|
559
|
-
left: Math.max(c, Math.min(
|
|
559
|
+
left: Math.max(c, Math.min(m, t))
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Or(e) {
|
|
563
563
|
const {
|
|
564
564
|
draggable: t,
|
|
565
565
|
resizable: n,
|
|
566
566
|
persistKey: i,
|
|
567
567
|
disablePersistence: a,
|
|
568
|
-
minWidth:
|
|
569
|
-
minHeight: s =
|
|
570
|
-
edgeMargin:
|
|
571
|
-
} = e, [c, u] = M(null), [
|
|
568
|
+
minWidth: o = Pr,
|
|
569
|
+
minHeight: s = Dr,
|
|
570
|
+
edgeMargin: l = zr
|
|
571
|
+
} = e, [c, u] = M(null), [m, p] = M(!1), [h, P] = M(!1), x = I(null), E = I(null), y = I(!1), w = I(null);
|
|
572
572
|
w.current = c;
|
|
573
573
|
const R = C(
|
|
574
574
|
(f) => {
|
|
575
|
-
a || (f === null ?
|
|
575
|
+
a || (f === null ? Er(Ft(i)) : Hn(Ft(i), JSON.stringify(f)));
|
|
576
576
|
},
|
|
577
577
|
[a, i]
|
|
578
578
|
);
|
|
579
579
|
T(() => {
|
|
580
|
-
if (
|
|
581
|
-
const f =
|
|
580
|
+
if (y.current || (y.current = !0, a)) return;
|
|
581
|
+
const f = Hr($n(Ft(i)));
|
|
582
582
|
if (!f) return;
|
|
583
|
-
const { vw: N, vh: z } =
|
|
584
|
-
minWidth:
|
|
583
|
+
const { vw: N, vh: z } = kt(), q = Wt(f.width, f.height, {
|
|
584
|
+
minWidth: o,
|
|
585
585
|
minHeight: s,
|
|
586
|
-
edgeMargin:
|
|
586
|
+
edgeMargin: l,
|
|
587
587
|
vw: N,
|
|
588
588
|
vh: z
|
|
589
|
-
}), X =
|
|
590
|
-
edgeMargin:
|
|
589
|
+
}), X = Bt(f.top, f.left, q.width, q.height, {
|
|
590
|
+
edgeMargin: l,
|
|
591
591
|
vw: N,
|
|
592
592
|
vh: z
|
|
593
593
|
});
|
|
@@ -597,22 +597,22 @@ function $r(e) {
|
|
|
597
597
|
const f = () => {
|
|
598
598
|
u((N) => {
|
|
599
599
|
if (N === null) return null;
|
|
600
|
-
const { vw: z, vh: q } =
|
|
601
|
-
minWidth:
|
|
600
|
+
const { vw: z, vh: q } = kt(), X = Wt(N.width, N.height, {
|
|
601
|
+
minWidth: o,
|
|
602
602
|
minHeight: s,
|
|
603
|
-
edgeMargin:
|
|
603
|
+
edgeMargin: l,
|
|
604
604
|
vw: z,
|
|
605
605
|
vh: q
|
|
606
606
|
});
|
|
607
|
-
return { ...
|
|
608
|
-
edgeMargin:
|
|
607
|
+
return { ...Bt(N.top, N.left, X.width, X.height, {
|
|
608
|
+
edgeMargin: l,
|
|
609
609
|
vw: z,
|
|
610
610
|
vh: q
|
|
611
611
|
}), ...X };
|
|
612
612
|
});
|
|
613
613
|
};
|
|
614
614
|
return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
|
|
615
|
-
}, [
|
|
615
|
+
}, [o, s, l]);
|
|
616
616
|
const S = C(
|
|
617
617
|
(f) => {
|
|
618
618
|
if (!t || f.pointerType === "mouse" && f.button !== 0) return;
|
|
@@ -643,22 +643,22 @@ function $r(e) {
|
|
|
643
643
|
};
|
|
644
644
|
},
|
|
645
645
|
[t]
|
|
646
|
-
),
|
|
646
|
+
), v = C(
|
|
647
647
|
(f) => {
|
|
648
648
|
const N = x.current;
|
|
649
649
|
if (!N) return;
|
|
650
650
|
const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY;
|
|
651
|
-
if (!N.moved && Math.abs(z) + Math.abs(q) >
|
|
652
|
-
const { vw: X, vh: ee } =
|
|
651
|
+
if (!N.moved && Math.abs(z) + Math.abs(q) > $r && (N.moved = !0, p(!0)), !N.moved) return;
|
|
652
|
+
const { vw: X, vh: ee } = kt(), V = Bt(
|
|
653
653
|
N.startTop + q,
|
|
654
654
|
N.startLeft + z,
|
|
655
655
|
N.width,
|
|
656
656
|
N.height,
|
|
657
|
-
{ edgeMargin:
|
|
657
|
+
{ edgeMargin: l, vw: X, vh: ee }
|
|
658
658
|
);
|
|
659
659
|
u({ ...V, width: N.width, height: N.height });
|
|
660
660
|
},
|
|
661
|
-
[
|
|
661
|
+
[l]
|
|
662
662
|
), O = C(
|
|
663
663
|
(f) => {
|
|
664
664
|
const N = x.current;
|
|
@@ -671,7 +671,7 @@ function $r(e) {
|
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
673
|
[R]
|
|
674
|
-
),
|
|
674
|
+
), g = C(() => {
|
|
675
675
|
x.current = null, E.current = null, p(!1), P(!1), u(null), R(null);
|
|
676
676
|
}, [R]), D = C(
|
|
677
677
|
(f) => {
|
|
@@ -704,18 +704,18 @@ function $r(e) {
|
|
|
704
704
|
(f) => {
|
|
705
705
|
const N = E.current;
|
|
706
706
|
if (!N) return;
|
|
707
|
-
const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY, { vw: X, vh: ee } =
|
|
708
|
-
minWidth:
|
|
707
|
+
const z = f.clientX - N.startClientX, q = f.clientY - N.startClientY, { vw: X, vh: ee } = kt(), V = X - N.left - l, te = ee - N.top - l, oe = Wt(N.startWidth + z, N.startHeight + q, {
|
|
708
|
+
minWidth: o,
|
|
709
709
|
minHeight: s,
|
|
710
|
-
edgeMargin:
|
|
710
|
+
edgeMargin: l,
|
|
711
711
|
// Clamp the available viewport to the room from the anchored corner
|
|
712
712
|
// so the widget can't grow past the bottom/right edge.
|
|
713
|
-
vw: Math.min(X, N.left + V +
|
|
714
|
-
vh: Math.min(ee, N.top + te +
|
|
713
|
+
vw: Math.min(X, N.left + V + l),
|
|
714
|
+
vh: Math.min(ee, N.top + te + l)
|
|
715
715
|
});
|
|
716
716
|
u({ top: N.top, left: N.left, ...oe });
|
|
717
717
|
},
|
|
718
|
-
[
|
|
718
|
+
[l, o, s]
|
|
719
719
|
), K = C(
|
|
720
720
|
(f) => {
|
|
721
721
|
if (E.current) {
|
|
@@ -739,14 +739,14 @@ function $r(e) {
|
|
|
739
739
|
height: `${c.height}px`
|
|
740
740
|
},
|
|
741
741
|
hasGeometry: c !== null,
|
|
742
|
-
isDragging:
|
|
742
|
+
isDragging: m,
|
|
743
743
|
isResizing: h,
|
|
744
744
|
dragHandleProps: {
|
|
745
745
|
onPointerDown: S,
|
|
746
|
-
onPointerMove:
|
|
746
|
+
onPointerMove: v,
|
|
747
747
|
onPointerUp: O,
|
|
748
748
|
onPointerCancel: O,
|
|
749
|
-
onDoubleClick:
|
|
749
|
+
onDoubleClick: g,
|
|
750
750
|
"data-ll-drag-handle": t ? "" : void 0
|
|
751
751
|
},
|
|
752
752
|
resizeHandleProps: {
|
|
@@ -756,78 +756,78 @@ function $r(e) {
|
|
|
756
756
|
onPointerCancel: K,
|
|
757
757
|
"data-ll-resize-handle": n ? "" : void 0
|
|
758
758
|
},
|
|
759
|
-
reset:
|
|
759
|
+
reset: g
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
function
|
|
764
|
-
if (typeof window > "u" || window.history[
|
|
762
|
+
const mn = "__llHistoryPatched", Nt = "ll:pathname";
|
|
763
|
+
function Fr() {
|
|
764
|
+
if (typeof window > "u" || window.history[mn]) return;
|
|
765
765
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
766
766
|
window.history.pushState = function(...n) {
|
|
767
767
|
const i = e.apply(this, n);
|
|
768
|
-
return window.dispatchEvent(new Event(
|
|
768
|
+
return window.dispatchEvent(new Event(Nt)), i;
|
|
769
769
|
}, window.history.replaceState = function(...n) {
|
|
770
770
|
const i = t.apply(this, n);
|
|
771
|
-
return window.dispatchEvent(new Event(
|
|
772
|
-
}, window.history[
|
|
771
|
+
return window.dispatchEvent(new Event(Nt)), i;
|
|
772
|
+
}, window.history[mn] = !0;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function gn() {
|
|
775
775
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Wr(e) {
|
|
778
778
|
const [t, n] = M(
|
|
779
|
-
() => e ??
|
|
779
|
+
() => e ?? gn()
|
|
780
780
|
);
|
|
781
781
|
return T(() => {
|
|
782
782
|
if (e !== void 0) return;
|
|
783
|
-
|
|
784
|
-
const i = () => n(
|
|
785
|
-
return i(), window.addEventListener("popstate", i), window.addEventListener(
|
|
786
|
-
window.removeEventListener("popstate", i), window.removeEventListener(
|
|
783
|
+
Fr();
|
|
784
|
+
const i = () => n(gn());
|
|
785
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(Nt, i), () => {
|
|
786
|
+
window.removeEventListener("popstate", i), window.removeEventListener(Nt, i);
|
|
787
787
|
};
|
|
788
788
|
}, [e]), e ?? t;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
791
|
-
function
|
|
792
|
-
return e.replace(
|
|
790
|
+
const yn = /* @__PURE__ */ new Map(), Br = /[\\^$+?.()|{}[\]]/g;
|
|
791
|
+
function qr(e) {
|
|
792
|
+
return e.replace(Br, "\\$&");
|
|
793
793
|
}
|
|
794
|
-
function
|
|
795
|
-
const t =
|
|
794
|
+
function Ur(e) {
|
|
795
|
+
const t = yn.get(e);
|
|
796
796
|
if (t) return t;
|
|
797
|
-
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", a = "",
|
|
798
|
-
return
|
|
797
|
+
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", a = "", o = n.replace(/\*\*/g, i).replace(/\*/g, a), l = qr(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
|
|
798
|
+
return yn.set(e, c), c;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function jr(e, t) {
|
|
801
801
|
const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
802
|
-
return
|
|
802
|
+
return Ur(e).test(n);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
804
|
+
function Vr(e, t) {
|
|
805
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : jr(e, t);
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function vn(e, t) {
|
|
808
808
|
if (!e || e.length === 0) return !1;
|
|
809
809
|
for (const n of e)
|
|
810
|
-
if (
|
|
810
|
+
if (Vr(n, t)) return !0;
|
|
811
811
|
return !1;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
return e === void 0 ? !0 :
|
|
813
|
+
function Yr(e, t, n) {
|
|
814
|
+
return e === void 0 ? !0 : vn(n, e) ? !1 : t && t.length > 0 ? vn(t, e) : !0;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
818
|
-
() =>
|
|
816
|
+
function Gr(e, t, n) {
|
|
817
|
+
return tt(
|
|
818
|
+
() => Yr(e, t, n),
|
|
819
819
|
[e, t, n]
|
|
820
820
|
);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function Xr(e) {
|
|
823
823
|
return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
|
|
824
824
|
navigate: e.navigate !== !1,
|
|
825
825
|
thinking: e.thinking !== !1,
|
|
826
826
|
action: e.action !== !1
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
const t =
|
|
829
|
+
function Kr(e) {
|
|
830
|
+
const t = tt(() => Xr(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = I(null), a = C(
|
|
831
831
|
(c) => {
|
|
832
832
|
try {
|
|
833
833
|
new Audio(`${n}${c}`).play().catch(() => {
|
|
@@ -836,11 +836,11 @@ function Gr(e) {
|
|
|
836
836
|
}
|
|
837
837
|
},
|
|
838
838
|
[n]
|
|
839
|
-
),
|
|
839
|
+
), o = C(() => {
|
|
840
840
|
t.navigate && a("/audio/page-change-sound.mp3");
|
|
841
841
|
}, [t.navigate, a]), s = C(() => {
|
|
842
842
|
t.action && a("/audio/confirmation-sound.mp3");
|
|
843
|
-
}, [t.action, a]),
|
|
843
|
+
}, [t.action, a]), l = C(
|
|
844
844
|
(c) => {
|
|
845
845
|
if (!t.thinking) {
|
|
846
846
|
if (i.current) {
|
|
@@ -879,12 +879,12 @@ function Gr(e) {
|
|
|
879
879
|
}
|
|
880
880
|
i.current = null;
|
|
881
881
|
}
|
|
882
|
-
}, []),
|
|
883
|
-
() => ({ playPageChange:
|
|
884
|
-
[
|
|
882
|
+
}, []), tt(
|
|
883
|
+
() => ({ playPageChange: o, playConfirmation: s, setThinking: l }),
|
|
884
|
+
[o, s, l]
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
|
-
const
|
|
887
|
+
const bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
888
888
|
"svg",
|
|
889
889
|
{
|
|
890
890
|
className: t,
|
|
@@ -930,7 +930,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
930
930
|
}
|
|
931
931
|
)
|
|
932
932
|
}
|
|
933
|
-
),
|
|
933
|
+
), wn = ({ className: e }) => /* @__PURE__ */ r(
|
|
934
934
|
"svg",
|
|
935
935
|
{
|
|
936
936
|
className: e,
|
|
@@ -948,7 +948,7 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
948
948
|
}
|
|
949
949
|
)
|
|
950
950
|
}
|
|
951
|
-
),
|
|
951
|
+
), Jr = ({ className: e }) => /* @__PURE__ */ r(
|
|
952
952
|
"svg",
|
|
953
953
|
{
|
|
954
954
|
className: e,
|
|
@@ -959,12 +959,12 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
959
959
|
"aria-hidden": "true",
|
|
960
960
|
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
961
961
|
}
|
|
962
|
-
),
|
|
962
|
+
), Zr = {
|
|
963
963
|
left: 180,
|
|
964
964
|
right: 0,
|
|
965
965
|
up: -90,
|
|
966
966
|
down: 90
|
|
967
|
-
},
|
|
967
|
+
}, _n = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
|
|
968
968
|
"svg",
|
|
969
969
|
{
|
|
970
970
|
className: t,
|
|
@@ -972,19 +972,19 @@ const gn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ k(
|
|
|
972
972
|
viewBox: "0 0 24 24",
|
|
973
973
|
stroke: "currentColor",
|
|
974
974
|
strokeWidth: 2,
|
|
975
|
-
style: { transform: `rotate(${
|
|
975
|
+
style: { transform: `rotate(${Zr[e]}deg)` },
|
|
976
976
|
"aria-hidden": "true",
|
|
977
977
|
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
978
978
|
}
|
|
979
979
|
);
|
|
980
|
-
function
|
|
980
|
+
function Qr(e) {
|
|
981
981
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
982
982
|
}
|
|
983
|
-
const
|
|
984
|
-
function
|
|
983
|
+
const On = "ll-hidden-tab-center-y", ei = 5, xn = 16;
|
|
984
|
+
function ti() {
|
|
985
985
|
if (typeof window > "u") return null;
|
|
986
986
|
try {
|
|
987
|
-
const e = window.localStorage.getItem(
|
|
987
|
+
const e = window.localStorage.getItem(On);
|
|
988
988
|
if (!e) return null;
|
|
989
989
|
const t = Number.parseFloat(e);
|
|
990
990
|
return Number.isFinite(t) ? t : null;
|
|
@@ -992,44 +992,44 @@ function Qr() {
|
|
|
992
992
|
return null;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Ln(e) {
|
|
996
996
|
if (!(typeof window > "u"))
|
|
997
997
|
try {
|
|
998
|
-
window.localStorage.setItem(
|
|
998
|
+
window.localStorage.setItem(On, String(e));
|
|
999
999
|
} catch {
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1002
|
+
const ni = ({
|
|
1003
1003
|
position: e,
|
|
1004
1004
|
isMobile: t,
|
|
1005
1005
|
isSpeaking: n,
|
|
1006
1006
|
onExpand: i,
|
|
1007
1007
|
label: a = "Open widget",
|
|
1008
|
-
avatarImageUrl:
|
|
1008
|
+
avatarImageUrl: o,
|
|
1009
1009
|
agentName: s,
|
|
1010
|
-
containerEl:
|
|
1010
|
+
containerEl: l
|
|
1011
1011
|
}) => {
|
|
1012
|
-
const c =
|
|
1012
|
+
const c = Qr(e), u = c === "right" ? "left" : "right", m = t ? 80 : 72, p = !!o, h = !!l, [P, x] = M(null), [E, y] = M(!1), w = I(null), R = I(!1), S = C(
|
|
1013
1013
|
($) => {
|
|
1014
1014
|
if (typeof window > "u") return $;
|
|
1015
|
-
const G =
|
|
1015
|
+
const G = m / 2, f = xn + G, N = window.innerHeight - xn - G;
|
|
1016
1016
|
return N < f ? Math.max(f, $) : Math.max(f, Math.min(N, $));
|
|
1017
1017
|
},
|
|
1018
|
-
[
|
|
1018
|
+
[m]
|
|
1019
1019
|
);
|
|
1020
1020
|
T(() => {
|
|
1021
1021
|
if (h) {
|
|
1022
1022
|
x(null);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
|
-
const $ =
|
|
1025
|
+
const $ = ti();
|
|
1026
1026
|
x(S($ ?? window.innerHeight / 2));
|
|
1027
1027
|
const G = () => {
|
|
1028
1028
|
x((f) => f === null ? null : S(f));
|
|
1029
1029
|
};
|
|
1030
1030
|
return window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
|
|
1031
1031
|
}, [S, h]);
|
|
1032
|
-
const
|
|
1032
|
+
const v = C(
|
|
1033
1033
|
($) => {
|
|
1034
1034
|
if (!h && !($.pointerType === "mouse" && $.button !== 0) && P !== null) {
|
|
1035
1035
|
try {
|
|
@@ -1049,10 +1049,10 @@ const ei = ({
|
|
|
1049
1049
|
const G = w.current;
|
|
1050
1050
|
if (!G) return;
|
|
1051
1051
|
const f = $.clientY - G.startClientY;
|
|
1052
|
-
!G.moved && Math.abs(f) >
|
|
1052
|
+
!G.moved && Math.abs(f) > ei && (G.moved = !0, y(!0)), G.moved && x(S(G.startCenterY + f));
|
|
1053
1053
|
},
|
|
1054
1054
|
[S]
|
|
1055
|
-
),
|
|
1055
|
+
), g = C(
|
|
1056
1056
|
($) => {
|
|
1057
1057
|
const G = w.current;
|
|
1058
1058
|
if (G) {
|
|
@@ -1060,7 +1060,7 @@ const ei = ({
|
|
|
1060
1060
|
$.currentTarget.releasePointerCapture($.pointerId);
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
}
|
|
1063
|
-
w.current = null, G.moved && (
|
|
1063
|
+
w.current = null, G.moved && (y(!1), R.current = !0, x((f) => (f !== null && Ln(f), f)));
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
[]
|
|
@@ -1078,7 +1078,7 @@ const ei = ({
|
|
|
1078
1078
|
x((f) => {
|
|
1079
1079
|
if (f === null) return f;
|
|
1080
1080
|
const N = S(f + G);
|
|
1081
|
-
return
|
|
1081
|
+
return Ln(N), N;
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
},
|
|
@@ -1091,16 +1091,16 @@ const ei = ({
|
|
|
1091
1091
|
E ? "is-dragging" : null,
|
|
1092
1092
|
p ? "ll-hidden--with-avatar" : null,
|
|
1093
1093
|
h ? "ll-hidden--scoped" : null
|
|
1094
|
-
].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P -
|
|
1094
|
+
].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P - m / 2}px`, transform: "none" };
|
|
1095
1095
|
return /* @__PURE__ */ r(
|
|
1096
1096
|
"button",
|
|
1097
1097
|
{
|
|
1098
1098
|
type: "button",
|
|
1099
1099
|
className: K,
|
|
1100
|
-
onPointerDown:
|
|
1100
|
+
onPointerDown: v,
|
|
1101
1101
|
onPointerMove: O,
|
|
1102
|
-
onPointerUp:
|
|
1103
|
-
onPointerCancel:
|
|
1102
|
+
onPointerUp: g,
|
|
1103
|
+
onPointerCancel: g,
|
|
1104
1104
|
onClick: D,
|
|
1105
1105
|
onKeyDown: W,
|
|
1106
1106
|
"aria-label": a,
|
|
@@ -1111,9 +1111,9 @@ const ei = ({
|
|
|
1111
1111
|
// as the click affordance), then the circular avatar photo
|
|
1112
1112
|
// taking the rest of the tab. Reinforces "this is an
|
|
1113
1113
|
// avatar-based experience" even when collapsed.
|
|
1114
|
-
/* @__PURE__ */ k(
|
|
1114
|
+
/* @__PURE__ */ k(We, { children: [
|
|
1115
1115
|
/* @__PURE__ */ r(
|
|
1116
|
-
|
|
1116
|
+
_n,
|
|
1117
1117
|
{
|
|
1118
1118
|
direction: u,
|
|
1119
1119
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -1122,7 +1122,7 @@ const ei = ({
|
|
|
1122
1122
|
/* @__PURE__ */ r(
|
|
1123
1123
|
"img",
|
|
1124
1124
|
{
|
|
1125
|
-
src:
|
|
1125
|
+
src: o,
|
|
1126
1126
|
alt: s ? `${s} avatar` : "Agent avatar",
|
|
1127
1127
|
className: "ll-hidden__avatar",
|
|
1128
1128
|
draggable: !1
|
|
@@ -1130,7 +1130,7 @@ const ei = ({
|
|
|
1130
1130
|
)
|
|
1131
1131
|
] })
|
|
1132
1132
|
) : /* @__PURE__ */ r(
|
|
1133
|
-
|
|
1133
|
+
_n,
|
|
1134
1134
|
{
|
|
1135
1135
|
direction: u,
|
|
1136
1136
|
className: "ll-hidden__chevron"
|
|
@@ -1138,47 +1138,47 @@ const ei = ({
|
|
|
1138
1138
|
)
|
|
1139
1139
|
}
|
|
1140
1140
|
);
|
|
1141
|
-
},
|
|
1141
|
+
}, ri = ({
|
|
1142
1142
|
audioLevel: e,
|
|
1143
1143
|
bars: t = 20,
|
|
1144
1144
|
maxHeight: n = 20,
|
|
1145
1145
|
minHeight: i = 4,
|
|
1146
1146
|
className: a,
|
|
1147
|
-
barClassName:
|
|
1147
|
+
barClassName: o
|
|
1148
1148
|
}) => {
|
|
1149
|
-
const s = I(null),
|
|
1150
|
-
const
|
|
1151
|
-
return Array.from({ length: t }, (p, h) => 0.5 + h *
|
|
1149
|
+
const s = I(null), l = I([]), c = tt(() => {
|
|
1150
|
+
const m = (Math.sqrt(5) - 1) / 2;
|
|
1151
|
+
return Array.from({ length: t }, (p, h) => 0.5 + h * m % 1 * 0.5);
|
|
1152
1152
|
}, [t]);
|
|
1153
1153
|
T(() => e.subscribe((p) => {
|
|
1154
1154
|
for (let h = 0; h < t; h++) {
|
|
1155
|
-
const P =
|
|
1155
|
+
const P = l.current[h];
|
|
1156
1156
|
if (!P) continue;
|
|
1157
1157
|
const x = Math.max(i, p * n * c[h]);
|
|
1158
1158
|
P.style.height = `${x}px`;
|
|
1159
1159
|
}
|
|
1160
1160
|
}), [e, t, n, i, c]);
|
|
1161
1161
|
const u = ["ll-waveform", a].filter(Boolean).join(" ");
|
|
1162
|
-
return /* @__PURE__ */ r("div", { ref: s, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (
|
|
1162
|
+
return /* @__PURE__ */ r("div", { ref: s, className: u, "aria-hidden": "true", children: Array.from({ length: t }, (m, p) => /* @__PURE__ */ r(
|
|
1163
1163
|
"div",
|
|
1164
1164
|
{
|
|
1165
1165
|
ref: (h) => {
|
|
1166
|
-
|
|
1166
|
+
l.current[p] = h;
|
|
1167
1167
|
},
|
|
1168
|
-
className: ["ll-waveform__bar",
|
|
1168
|
+
className: ["ll-waveform__bar", o].filter(Boolean).join(" "),
|
|
1169
1169
|
style: { height: `${i}px` }
|
|
1170
1170
|
},
|
|
1171
1171
|
p
|
|
1172
1172
|
)) });
|
|
1173
|
-
},
|
|
1173
|
+
}, ii = ({
|
|
1174
1174
|
position: e,
|
|
1175
1175
|
isMobile: t,
|
|
1176
1176
|
agentName: n,
|
|
1177
1177
|
avatarImageUrl: i,
|
|
1178
1178
|
agentState: a,
|
|
1179
|
-
isMuted:
|
|
1179
|
+
isMuted: o,
|
|
1180
1180
|
audioLevel: s,
|
|
1181
|
-
onExpand:
|
|
1181
|
+
onExpand: l,
|
|
1182
1182
|
onToggleMute: c,
|
|
1183
1183
|
onClose: u
|
|
1184
1184
|
}) => t ? /* @__PURE__ */ r(
|
|
@@ -1192,7 +1192,7 @@ const ei = ({
|
|
|
1192
1192
|
{
|
|
1193
1193
|
type: "button",
|
|
1194
1194
|
className: "ll-minimized__surface",
|
|
1195
|
-
onClick:
|
|
1195
|
+
onClick: l,
|
|
1196
1196
|
"aria-label": `Expand ${n} widget`,
|
|
1197
1197
|
children: [
|
|
1198
1198
|
i ? (
|
|
@@ -1207,7 +1207,7 @@ const ei = ({
|
|
|
1207
1207
|
)
|
|
1208
1208
|
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1209
1209
|
/* @__PURE__ */ r(
|
|
1210
|
-
|
|
1210
|
+
ri,
|
|
1211
1211
|
{
|
|
1212
1212
|
audioLevel: s,
|
|
1213
1213
|
bars: 16,
|
|
@@ -1223,17 +1223,17 @@ const ei = ({
|
|
|
1223
1223
|
className: "ll-minimized__btn",
|
|
1224
1224
|
role: "button",
|
|
1225
1225
|
tabIndex: 0,
|
|
1226
|
-
onClick: (
|
|
1227
|
-
|
|
1226
|
+
onClick: (m) => {
|
|
1227
|
+
m.stopPropagation(), c();
|
|
1228
1228
|
},
|
|
1229
|
-
onKeyDown: (
|
|
1230
|
-
(
|
|
1229
|
+
onKeyDown: (m) => {
|
|
1230
|
+
(m.key === "Enter" || m.key === " ") && (m.stopPropagation(), m.preventDefault(), c());
|
|
1231
1231
|
},
|
|
1232
|
-
"aria-label":
|
|
1233
|
-
children: /* @__PURE__ */ r(
|
|
1232
|
+
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1233
|
+
children: /* @__PURE__ */ r(bn, { muted: o, className: "ll-minimized__icon" })
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
|
-
/* @__PURE__ */ r(
|
|
1236
|
+
/* @__PURE__ */ r(wn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
1237
1237
|
] })
|
|
1238
1238
|
]
|
|
1239
1239
|
}
|
|
@@ -1269,8 +1269,8 @@ const ei = ({
|
|
|
1269
1269
|
type: "button",
|
|
1270
1270
|
className: "ll-minimized__btn",
|
|
1271
1271
|
onClick: c,
|
|
1272
|
-
"aria-label":
|
|
1273
|
-
children: /* @__PURE__ */ r(
|
|
1272
|
+
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1273
|
+
children: /* @__PURE__ */ r(bn, { muted: o, className: "ll-minimized__icon" })
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
1276
|
/* @__PURE__ */ r(
|
|
@@ -1278,9 +1278,9 @@ const ei = ({
|
|
|
1278
1278
|
{
|
|
1279
1279
|
type: "button",
|
|
1280
1280
|
className: "ll-minimized__btn",
|
|
1281
|
-
onClick:
|
|
1281
|
+
onClick: l,
|
|
1282
1282
|
"aria-label": `Expand ${n} widget`,
|
|
1283
|
-
children: /* @__PURE__ */ r(
|
|
1283
|
+
children: /* @__PURE__ */ r(wn, { className: "ll-minimized__icon" })
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
1286
|
/* @__PURE__ */ r(
|
|
@@ -1290,22 +1290,22 @@ const ei = ({
|
|
|
1290
1290
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
1291
1291
|
onClick: u,
|
|
1292
1292
|
"aria-label": "Close widget",
|
|
1293
|
-
children: /* @__PURE__ */ r(
|
|
1293
|
+
children: /* @__PURE__ */ r(Jr, { className: "ll-minimized__icon" })
|
|
1294
1294
|
}
|
|
1295
1295
|
)
|
|
1296
1296
|
] })
|
|
1297
1297
|
] })
|
|
1298
1298
|
}
|
|
1299
|
-
),
|
|
1299
|
+
), oi = ({
|
|
1300
1300
|
src: e,
|
|
1301
1301
|
alt: t,
|
|
1302
1302
|
preCannedPlaying: n = !1,
|
|
1303
1303
|
className: i,
|
|
1304
1304
|
style: a
|
|
1305
1305
|
}) => {
|
|
1306
|
-
const [
|
|
1306
|
+
const [o, s] = M(!1), l = I(e);
|
|
1307
1307
|
if (T(() => {
|
|
1308
|
-
|
|
1308
|
+
l.current !== e && (l.current = e, s(!1));
|
|
1309
1309
|
}, [e]), !e) return null;
|
|
1310
1310
|
const c = {
|
|
1311
1311
|
position: "absolute",
|
|
@@ -1316,7 +1316,7 @@ const ei = ({
|
|
|
1316
1316
|
objectPosition: "top",
|
|
1317
1317
|
transition: "opacity 500ms ease, transform 500ms ease",
|
|
1318
1318
|
transform: n ? "scale(1.02)" : "scale(1)",
|
|
1319
|
-
opacity:
|
|
1319
|
+
opacity: o ? 1 : 0,
|
|
1320
1320
|
...a
|
|
1321
1321
|
};
|
|
1322
1322
|
return (
|
|
@@ -1334,11 +1334,11 @@ const ei = ({
|
|
|
1334
1334
|
}
|
|
1335
1335
|
)
|
|
1336
1336
|
);
|
|
1337
|
-
},
|
|
1338
|
-
function
|
|
1337
|
+
}, li = "#E06540";
|
|
1338
|
+
function ai({
|
|
1339
1339
|
size: e = 14,
|
|
1340
1340
|
className: t,
|
|
1341
|
-
fill: n =
|
|
1341
|
+
fill: n = li
|
|
1342
1342
|
}) {
|
|
1343
1343
|
return /* @__PURE__ */ k(
|
|
1344
1344
|
"svg",
|
|
@@ -1376,42 +1376,42 @@ function oi({
|
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
|
-
const
|
|
1379
|
+
const si = 8, Cn = 8, ci = ({
|
|
1380
1380
|
open: e,
|
|
1381
1381
|
onClose: t,
|
|
1382
1382
|
anchorRef: n,
|
|
1383
1383
|
children: i
|
|
1384
1384
|
}) => {
|
|
1385
|
-
const a = I(null), [
|
|
1386
|
-
return
|
|
1385
|
+
const a = I(null), [o, s] = M(null);
|
|
1386
|
+
return Dn(() => {
|
|
1387
1387
|
if (!e) {
|
|
1388
1388
|
s(null);
|
|
1389
1389
|
return;
|
|
1390
1390
|
}
|
|
1391
|
-
const
|
|
1392
|
-
if (!
|
|
1391
|
+
const l = n.current;
|
|
1392
|
+
if (!l) return;
|
|
1393
1393
|
const c = () => {
|
|
1394
|
-
const u =
|
|
1395
|
-
top: u.top -
|
|
1394
|
+
const u = l.getBoundingClientRect(), m = {
|
|
1395
|
+
top: u.top - si,
|
|
1396
1396
|
left: u.left + u.width / 2
|
|
1397
|
-
}, p =
|
|
1398
|
-
|
|
1397
|
+
}, p = Cn + 90, h = window.innerWidth - Cn - 90;
|
|
1398
|
+
m.left < p && (m.left = p), m.left > h && (m.left = h), s(m);
|
|
1399
1399
|
};
|
|
1400
1400
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1401
1401
|
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
1402
1402
|
};
|
|
1403
1403
|
}, [e, n]), T(() => {
|
|
1404
1404
|
if (!e) return;
|
|
1405
|
-
const
|
|
1406
|
-
const
|
|
1407
|
-
p && p.contains(
|
|
1405
|
+
const l = (u) => {
|
|
1406
|
+
const m = u.target, p = a.current, h = n.current;
|
|
1407
|
+
p && p.contains(m) || h && h.contains(m) || t();
|
|
1408
1408
|
}, c = (u) => {
|
|
1409
1409
|
u.key === "Escape" && (u.stopPropagation(), t());
|
|
1410
1410
|
};
|
|
1411
|
-
return document.addEventListener("mousedown",
|
|
1412
|
-
document.removeEventListener("mousedown",
|
|
1411
|
+
return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
|
|
1412
|
+
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
|
|
1413
1413
|
};
|
|
1414
|
-
}, [e, t, n]), !e ||
|
|
1414
|
+
}, [e, t, n]), !e || o === null || typeof document > "u" ? null : Xt(
|
|
1415
1415
|
/* @__PURE__ */ r(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
@@ -1422,8 +1422,8 @@ const li = 8, _n = 8, ai = ({
|
|
|
1422
1422
|
position: "fixed",
|
|
1423
1423
|
// Lift the popover above the anchor via translateY(-100%).
|
|
1424
1424
|
// top points to (anchorTop - GAP); transform pulls bottom up to there.
|
|
1425
|
-
top:
|
|
1426
|
-
left:
|
|
1425
|
+
top: o.top,
|
|
1426
|
+
left: o.left,
|
|
1427
1427
|
transform: "translate(-50%, -100%)"
|
|
1428
1428
|
},
|
|
1429
1429
|
children: i
|
|
@@ -1431,24 +1431,24 @@ const li = 8, _n = 8, ai = ({
|
|
|
1431
1431
|
),
|
|
1432
1432
|
document.body
|
|
1433
1433
|
);
|
|
1434
|
-
},
|
|
1434
|
+
}, ui = ({
|
|
1435
1435
|
isMuted: e,
|
|
1436
1436
|
onToggleMute: t,
|
|
1437
1437
|
isCameraEnabled: n,
|
|
1438
1438
|
onToggleCamera: i,
|
|
1439
1439
|
allowCamera: a,
|
|
1440
|
-
isScreenShareEnabled:
|
|
1440
|
+
isScreenShareEnabled: o,
|
|
1441
1441
|
onToggleScreenShare: s,
|
|
1442
|
-
allowScreenShare:
|
|
1442
|
+
allowScreenShare: l,
|
|
1443
1443
|
isSpeakerMuted: c,
|
|
1444
1444
|
onToggleSpeaker: u,
|
|
1445
|
-
allowTyping:
|
|
1445
|
+
allowTyping: m,
|
|
1446
1446
|
isTypingOpen: p,
|
|
1447
1447
|
onToggleTyping: h,
|
|
1448
1448
|
onDisconnect: P
|
|
1449
1449
|
}) => {
|
|
1450
|
-
const [x, E] = M(!1),
|
|
1451
|
-
return /* @__PURE__ */ k(
|
|
1450
|
+
const [x, E] = M(!1), y = I(null);
|
|
1451
|
+
return /* @__PURE__ */ k(We, { children: [
|
|
1452
1452
|
/* @__PURE__ */ k(
|
|
1453
1453
|
"div",
|
|
1454
1454
|
{
|
|
@@ -1463,20 +1463,20 @@ const li = 8, _n = 8, ai = ({
|
|
|
1463
1463
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1464
1464
|
onClick: t,
|
|
1465
1465
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1466
|
-
children: /* @__PURE__ */ r(
|
|
1466
|
+
children: /* @__PURE__ */ r(Bn, { muted: e })
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
1469
|
/* @__PURE__ */ r(
|
|
1470
1470
|
"button",
|
|
1471
1471
|
{
|
|
1472
|
-
ref:
|
|
1472
|
+
ref: y,
|
|
1473
1473
|
type: "button",
|
|
1474
1474
|
className: `ll-tool ${x ? "is-on" : ""}`,
|
|
1475
1475
|
onClick: () => E((w) => !w),
|
|
1476
1476
|
"aria-label": "More controls",
|
|
1477
1477
|
"aria-haspopup": "menu",
|
|
1478
1478
|
"aria-expanded": x,
|
|
1479
|
-
children: /* @__PURE__ */ r(
|
|
1479
|
+
children: /* @__PURE__ */ r(di, {})
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
1482
1482
|
/* @__PURE__ */ r(
|
|
@@ -1486,18 +1486,18 @@ const li = 8, _n = 8, ai = ({
|
|
|
1486
1486
|
className: "ll-tool ll-tool--danger",
|
|
1487
1487
|
onClick: P,
|
|
1488
1488
|
"aria-label": "End conversation",
|
|
1489
|
-
children: /* @__PURE__ */ r(
|
|
1489
|
+
children: /* @__PURE__ */ r(Un, {})
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
1492
|
]
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
1495
|
/* @__PURE__ */ k(
|
|
1496
|
-
|
|
1496
|
+
ci,
|
|
1497
1497
|
{
|
|
1498
1498
|
open: x,
|
|
1499
1499
|
onClose: () => E(!1),
|
|
1500
|
-
anchorRef:
|
|
1500
|
+
anchorRef: y,
|
|
1501
1501
|
children: [
|
|
1502
1502
|
a && /* @__PURE__ */ k(
|
|
1503
1503
|
"button",
|
|
@@ -1508,22 +1508,22 @@ const li = 8, _n = 8, ai = ({
|
|
|
1508
1508
|
i(), E(!1);
|
|
1509
1509
|
},
|
|
1510
1510
|
children: [
|
|
1511
|
-
/* @__PURE__ */ r(
|
|
1511
|
+
/* @__PURE__ */ r(Wn, {}),
|
|
1512
1512
|
/* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
1515
1515
|
),
|
|
1516
|
-
|
|
1516
|
+
l && /* @__PURE__ */ k(
|
|
1517
1517
|
"button",
|
|
1518
1518
|
{
|
|
1519
1519
|
type: "button",
|
|
1520
|
-
className: `ll-overflow-popover__item ${
|
|
1520
|
+
className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
|
|
1521
1521
|
onClick: () => {
|
|
1522
1522
|
s(), E(!1);
|
|
1523
1523
|
},
|
|
1524
1524
|
children: [
|
|
1525
|
-
/* @__PURE__ */ r(
|
|
1526
|
-
/* @__PURE__ */ r("span", { children:
|
|
1525
|
+
/* @__PURE__ */ r(Fn, {}),
|
|
1526
|
+
/* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
1529
1529
|
),
|
|
@@ -1536,12 +1536,12 @@ const li = 8, _n = 8, ai = ({
|
|
|
1536
1536
|
u(), E(!1);
|
|
1537
1537
|
},
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */ r(
|
|
1539
|
+
/* @__PURE__ */ r(qn, { muted: c }),
|
|
1540
1540
|
/* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1541
1541
|
]
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
|
|
1544
|
+
m && /* @__PURE__ */ k(
|
|
1545
1545
|
"button",
|
|
1546
1546
|
{
|
|
1547
1547
|
type: "button",
|
|
@@ -1550,7 +1550,7 @@ const li = 8, _n = 8, ai = ({
|
|
|
1550
1550
|
h(), E(!1);
|
|
1551
1551
|
},
|
|
1552
1552
|
children: [
|
|
1553
|
-
/* @__PURE__ */ r(
|
|
1553
|
+
/* @__PURE__ */ r(fi, {}),
|
|
1554
1554
|
/* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
|
|
1555
1555
|
]
|
|
1556
1556
|
}
|
|
@@ -1573,7 +1573,7 @@ const li = 8, _n = 8, ai = ({
|
|
|
1573
1573
|
)
|
|
1574
1574
|
] });
|
|
1575
1575
|
};
|
|
1576
|
-
function
|
|
1576
|
+
function di() {
|
|
1577
1577
|
return /* @__PURE__ */ k(
|
|
1578
1578
|
"svg",
|
|
1579
1579
|
{
|
|
@@ -1590,7 +1590,7 @@ function ci() {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function fi() {
|
|
1594
1594
|
return /* @__PURE__ */ r(
|
|
1595
1595
|
"svg",
|
|
1596
1596
|
{
|
|
@@ -1607,30 +1607,30 @@ function ui() {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1610
|
+
const pi = ({
|
|
1611
1611
|
position: e,
|
|
1612
1612
|
isMobile: t,
|
|
1613
1613
|
agentName: n,
|
|
1614
1614
|
avatarImageUrl: i,
|
|
1615
1615
|
idleLoopUrl: a,
|
|
1616
|
-
greeting:
|
|
1616
|
+
greeting: o,
|
|
1617
1617
|
branding: s,
|
|
1618
|
-
teamMembers:
|
|
1618
|
+
teamMembers: l,
|
|
1619
1619
|
currentTeamMemberId: c,
|
|
1620
1620
|
isSwitchingTeamMember: u,
|
|
1621
|
-
teamSwitcherOpen:
|
|
1621
|
+
teamSwitcherOpen: m,
|
|
1622
1622
|
onToggleTeamSwitcher: p,
|
|
1623
1623
|
onSelectTeamMember: h,
|
|
1624
1624
|
languageMenuOpen: P,
|
|
1625
1625
|
onToggleLanguageMenu: x,
|
|
1626
1626
|
connectionState: E,
|
|
1627
|
-
agentState:
|
|
1627
|
+
agentState: y,
|
|
1628
1628
|
transcript: w,
|
|
1629
1629
|
canResume: R,
|
|
1630
1630
|
needsUserGesture: S,
|
|
1631
|
-
error:
|
|
1631
|
+
error: v,
|
|
1632
1632
|
isMuted: O,
|
|
1633
|
-
micError:
|
|
1633
|
+
micError: g,
|
|
1634
1634
|
micDevices: D,
|
|
1635
1635
|
activeMicId: W,
|
|
1636
1636
|
isCameraEnabled: K,
|
|
@@ -1651,25 +1651,25 @@ const di = ({
|
|
|
1651
1651
|
transformingLabel: Q,
|
|
1652
1652
|
avatarVideoContainerRef: be,
|
|
1653
1653
|
agentVideoEl: ne,
|
|
1654
|
-
onConnect:
|
|
1655
|
-
onDisconnect:
|
|
1656
|
-
onRetry:
|
|
1657
|
-
onResumeAudio:
|
|
1658
|
-
onToggleMute:
|
|
1659
|
-
onSwitchMicDevice:
|
|
1660
|
-
onToggleCamera:
|
|
1661
|
-
onSwitchCameraDevice:
|
|
1662
|
-
onToggleScreenShare:
|
|
1663
|
-
onToggleSpeaker:
|
|
1664
|
-
onSendMessage:
|
|
1665
|
-
onMinimize:
|
|
1666
|
-
onClose:
|
|
1667
|
-
onClearMicError:
|
|
1668
|
-
dragHandleProps:
|
|
1654
|
+
onConnect: nt,
|
|
1655
|
+
onDisconnect: rt,
|
|
1656
|
+
onRetry: ht,
|
|
1657
|
+
onResumeAudio: mt,
|
|
1658
|
+
onToggleMute: it,
|
|
1659
|
+
onSwitchMicDevice: gt,
|
|
1660
|
+
onToggleCamera: Be,
|
|
1661
|
+
onSwitchCameraDevice: qe,
|
|
1662
|
+
onToggleScreenShare: Re,
|
|
1663
|
+
onToggleSpeaker: Te,
|
|
1664
|
+
onSendMessage: Pe,
|
|
1665
|
+
onMinimize: De,
|
|
1666
|
+
onClose: ze,
|
|
1667
|
+
onClearMicError: Ue,
|
|
1668
|
+
dragHandleProps: $e,
|
|
1669
1669
|
resizeHandleProps: F
|
|
1670
1670
|
}) => {
|
|
1671
|
-
var
|
|
1672
|
-
const
|
|
1671
|
+
var st;
|
|
1672
|
+
const He = ((l == null ? void 0 : l.length) ?? 0) > 1, je = E === "connecting" || E === "connected", we = E === "connected", yt = E === "idle" || E === "disconnected" || E === "error", [Oe, Ne] = M(!1);
|
|
1673
1673
|
T(() => {
|
|
1674
1674
|
if (!ne) {
|
|
1675
1675
|
Ne(!1);
|
|
@@ -1685,74 +1685,74 @@ const di = ({
|
|
|
1685
1685
|
ne.removeEventListener("playing", _), ne.removeEventListener("loadeddata", _);
|
|
1686
1686
|
};
|
|
1687
1687
|
}, [ne]);
|
|
1688
|
-
const [
|
|
1688
|
+
const [At, vt] = M(!1);
|
|
1689
1689
|
T(() => {
|
|
1690
1690
|
if (!we) {
|
|
1691
|
-
|
|
1691
|
+
vt(!1);
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
1694
|
-
if (
|
|
1695
|
-
const _ = setTimeout(() =>
|
|
1694
|
+
if (Oe) return;
|
|
1695
|
+
const _ = setTimeout(() => vt(!0), 8e3);
|
|
1696
1696
|
return () => clearTimeout(_);
|
|
1697
|
-
}, [we,
|
|
1698
|
-
const
|
|
1697
|
+
}, [we, Oe]);
|
|
1698
|
+
const Fe = E === "connecting" || we && !!i && !Oe && !At, ue = I(null), ot = I(null);
|
|
1699
1699
|
T(() => {
|
|
1700
1700
|
const _ = ue.current;
|
|
1701
1701
|
_ && (_.innerHTML = "", ae && (ae.style.width = "100%", ae.style.height = "100%", ae.style.objectFit = "cover", ae.style.transform = "scaleX(-1)", _.appendChild(ae)));
|
|
1702
1702
|
}, [ae]), T(() => {
|
|
1703
|
-
const _ =
|
|
1703
|
+
const _ = ot.current;
|
|
1704
1704
|
_ && (_.innerHTML = "", N && (N.style.width = "100%", N.style.height = "100%", N.style.objectFit = "contain", _.appendChild(N)));
|
|
1705
1705
|
}, [N]);
|
|
1706
|
-
const [le, pe] = M(!1), [
|
|
1706
|
+
const [le, pe] = M(!1), [Ve, Ye] = M(!1), ge = I(null), _e = I(null);
|
|
1707
1707
|
T(() => {
|
|
1708
|
-
if (!le && !
|
|
1708
|
+
if (!le && !Ve && !P && !m) return;
|
|
1709
1709
|
const _ = () => {
|
|
1710
|
-
pe(!1),
|
|
1710
|
+
pe(!1), Ye(!1), P && x(), m && p();
|
|
1711
1711
|
};
|
|
1712
1712
|
return document.addEventListener("click", _), () => document.removeEventListener("click", _);
|
|
1713
1713
|
}, [
|
|
1714
1714
|
le,
|
|
1715
|
-
|
|
1715
|
+
Ve,
|
|
1716
1716
|
P,
|
|
1717
|
-
|
|
1717
|
+
m,
|
|
1718
1718
|
x,
|
|
1719
1719
|
p
|
|
1720
1720
|
]);
|
|
1721
|
-
const [
|
|
1721
|
+
const [bt, Mt] = M(!1), It = C(() => Mt((_) => !_), []), [lt, Rt] = M(""), Ae = C(
|
|
1722
1722
|
(_) => {
|
|
1723
1723
|
_.preventDefault();
|
|
1724
|
-
const re =
|
|
1725
|
-
re && (
|
|
1724
|
+
const re = lt.trim();
|
|
1725
|
+
re && (Pe(re), Rt(""));
|
|
1726
1726
|
},
|
|
1727
|
-
[
|
|
1727
|
+
[lt, Pe]
|
|
1728
1728
|
), Me = s.productName || "Live Layer", Se = !s.productName;
|
|
1729
1729
|
let ye = null, xe = null;
|
|
1730
1730
|
for (let _ = w.length - 1; _ >= 0; _--) {
|
|
1731
1731
|
const re = w[_];
|
|
1732
1732
|
if (!ye && re.role === "agent" ? ye = re : !xe && re.role === "user" && (xe = re), ye && xe) break;
|
|
1733
1733
|
}
|
|
1734
|
-
const
|
|
1734
|
+
const wt = we ? (ye == null ? void 0 : ye.text) || null : o || null, Ge = we && (xe == null ? void 0 : xe.text) || null, at = [
|
|
1735
1735
|
"ll-expanded",
|
|
1736
1736
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1737
1737
|
].join(" ");
|
|
1738
1738
|
return /* @__PURE__ */ k(
|
|
1739
1739
|
"div",
|
|
1740
1740
|
{
|
|
1741
|
-
className:
|
|
1741
|
+
className: at,
|
|
1742
1742
|
"data-position": e,
|
|
1743
|
-
"data-state": we ? "connected" :
|
|
1743
|
+
"data-state": we ? "connected" : je ? "connecting" : "idle",
|
|
1744
1744
|
role: "dialog",
|
|
1745
1745
|
"aria-label": `${n} widget`,
|
|
1746
1746
|
children: [
|
|
1747
1747
|
/* @__PURE__ */ k("div", { className: "ll-expanded__bg", children: [
|
|
1748
1748
|
i ? /* @__PURE__ */ r(
|
|
1749
|
-
|
|
1749
|
+
oi,
|
|
1750
1750
|
{
|
|
1751
1751
|
src: i,
|
|
1752
1752
|
alt: n,
|
|
1753
1753
|
className: "ll-expanded__bg-img"
|
|
1754
1754
|
}
|
|
1755
|
-
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1755
|
+
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((st = n == null ? void 0 : n.charAt(0)) == null ? void 0 : st.toUpperCase()) || "A" }) }),
|
|
1756
1756
|
a && !we && /* @__PURE__ */ r(
|
|
1757
1757
|
"video",
|
|
1758
1758
|
{
|
|
@@ -1766,7 +1766,7 @@ const di = ({
|
|
|
1766
1766
|
)
|
|
1767
1767
|
] }),
|
|
1768
1768
|
/* @__PURE__ */ r("div", { ref: be, className: "ll-expanded__video" }),
|
|
1769
|
-
|
|
1769
|
+
Fe && /* @__PURE__ */ k("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1770
1770
|
/* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
|
|
1771
1771
|
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: u ? "Switching..." : "Connecting..." })
|
|
1772
1772
|
] }),
|
|
@@ -1775,7 +1775,7 @@ const di = ({
|
|
|
1775
1775
|
{
|
|
1776
1776
|
type: "button",
|
|
1777
1777
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1778
|
-
onClick:
|
|
1778
|
+
onClick: mt,
|
|
1779
1779
|
children: [
|
|
1780
1780
|
/* @__PURE__ */ r("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1781
1781
|
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
@@ -1795,8 +1795,8 @@ const di = ({
|
|
|
1795
1795
|
]
|
|
1796
1796
|
}
|
|
1797
1797
|
),
|
|
1798
|
-
|
|
1799
|
-
!U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar",
|
|
1798
|
+
je ? /* @__PURE__ */ k(We, { children: [
|
|
1799
|
+
!U && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar", ...$e, children: [
|
|
1800
1800
|
!oe && /* @__PURE__ */ k("div", { className: "ll-expanded__topbar-left", children: [
|
|
1801
1801
|
/* @__PURE__ */ k("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1802
1802
|
/* @__PURE__ */ k(
|
|
@@ -1805,23 +1805,23 @@ const di = ({
|
|
|
1805
1805
|
type: "button",
|
|
1806
1806
|
className: "ll-hpill",
|
|
1807
1807
|
onClick: (_) => {
|
|
1808
|
-
|
|
1808
|
+
He && (_.stopPropagation(), p());
|
|
1809
1809
|
},
|
|
1810
|
-
"aria-haspopup":
|
|
1811
|
-
"aria-expanded":
|
|
1810
|
+
"aria-haspopup": He ? "listbox" : void 0,
|
|
1811
|
+
"aria-expanded": He ? m : void 0,
|
|
1812
1812
|
children: [
|
|
1813
1813
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
|
|
1814
|
-
|
|
1814
|
+
He && /* @__PURE__ */ r(St, {})
|
|
1815
1815
|
]
|
|
1816
1816
|
}
|
|
1817
1817
|
),
|
|
1818
|
-
|
|
1818
|
+
He && m && /* @__PURE__ */ r(
|
|
1819
1819
|
"div",
|
|
1820
1820
|
{
|
|
1821
1821
|
className: "ll-hmenu",
|
|
1822
1822
|
onClick: (_) => _.stopPropagation(),
|
|
1823
1823
|
role: "listbox",
|
|
1824
|
-
children:
|
|
1824
|
+
children: l == null ? void 0 : l.map((_) => /* @__PURE__ */ k(
|
|
1825
1825
|
"button",
|
|
1826
1826
|
{
|
|
1827
1827
|
type: "button",
|
|
@@ -1862,7 +1862,7 @@ const di = ({
|
|
|
1862
1862
|
title: "Language: English",
|
|
1863
1863
|
children: [
|
|
1864
1864
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: "EN" }),
|
|
1865
|
-
/* @__PURE__ */ r(
|
|
1865
|
+
/* @__PURE__ */ r(St, {})
|
|
1866
1866
|
]
|
|
1867
1867
|
}
|
|
1868
1868
|
),
|
|
@@ -1888,8 +1888,8 @@ const di = ({
|
|
|
1888
1888
|
/* @__PURE__ */ r(
|
|
1889
1889
|
"span",
|
|
1890
1890
|
{
|
|
1891
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1892
|
-
children:
|
|
1891
|
+
className: `ll-expanded__state ll-expanded__state--${y}`,
|
|
1892
|
+
children: y
|
|
1893
1893
|
}
|
|
1894
1894
|
)
|
|
1895
1895
|
] }),
|
|
@@ -1899,10 +1899,10 @@ const di = ({
|
|
|
1899
1899
|
{
|
|
1900
1900
|
type: "button",
|
|
1901
1901
|
className: "ll-hbtn",
|
|
1902
|
-
onClick:
|
|
1902
|
+
onClick: De,
|
|
1903
1903
|
"aria-label": "Minimize widget",
|
|
1904
1904
|
title: "Minimize",
|
|
1905
|
-
children: /* @__PURE__ */ r(
|
|
1905
|
+
children: /* @__PURE__ */ r(Sn, {})
|
|
1906
1906
|
}
|
|
1907
1907
|
),
|
|
1908
1908
|
te !== !1 && /* @__PURE__ */ r(
|
|
@@ -1910,17 +1910,17 @@ const di = ({
|
|
|
1910
1910
|
{
|
|
1911
1911
|
type: "button",
|
|
1912
1912
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1913
|
-
onClick:
|
|
1913
|
+
onClick: ze,
|
|
1914
1914
|
"aria-label": "End call",
|
|
1915
1915
|
title: "End call",
|
|
1916
|
-
children: /* @__PURE__ */ r(
|
|
1916
|
+
children: /* @__PURE__ */ r(kn, {})
|
|
1917
1917
|
}
|
|
1918
1918
|
)
|
|
1919
1919
|
] })
|
|
1920
1920
|
] }),
|
|
1921
|
-
U && /* @__PURE__ */ k("div", { className: "ll-compact-status", "data-state":
|
|
1921
|
+
U && /* @__PURE__ */ k("div", { className: "ll-compact-status", "data-state": y, children: [
|
|
1922
1922
|
/* @__PURE__ */ r("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1923
|
-
/* @__PURE__ */ r("span", { className: "ll-compact-status__label", children:
|
|
1923
|
+
/* @__PURE__ */ r("span", { className: "ll-compact-status__label", children: y })
|
|
1924
1924
|
] })
|
|
1925
1925
|
] }) : (
|
|
1926
1926
|
// Idle-state header. In compactControls mode (mobile WIDGET +
|
|
@@ -1931,7 +1931,7 @@ const di = ({
|
|
|
1931
1931
|
// can always dismiss; making the whole header disappear (the
|
|
1932
1932
|
// pre-0.18.0 behavior) left users no way out short of scrolling
|
|
1933
1933
|
// the page itself.
|
|
1934
|
-
/* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle",
|
|
1934
|
+
/* @__PURE__ */ k("div", { className: "ll-expanded__header ll-expanded__header--idle", ...$e, children: [
|
|
1935
1935
|
!U && (Se ? /* @__PURE__ */ k(
|
|
1936
1936
|
"a",
|
|
1937
1937
|
{
|
|
@@ -1942,7 +1942,7 @@ const di = ({
|
|
|
1942
1942
|
"aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
|
|
1943
1943
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1944
1944
|
children: [
|
|
1945
|
-
/* @__PURE__ */ r(
|
|
1945
|
+
/* @__PURE__ */ r(ai, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1946
1946
|
/* @__PURE__ */ r("span", { children: Me })
|
|
1947
1947
|
]
|
|
1948
1948
|
}
|
|
@@ -1953,9 +1953,9 @@ const di = ({
|
|
|
1953
1953
|
{
|
|
1954
1954
|
type: "button",
|
|
1955
1955
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1956
|
-
onClick:
|
|
1956
|
+
onClick: De,
|
|
1957
1957
|
"aria-label": "Minimize widget",
|
|
1958
|
-
children: /* @__PURE__ */ r(
|
|
1958
|
+
children: /* @__PURE__ */ r(Sn, {})
|
|
1959
1959
|
}
|
|
1960
1960
|
),
|
|
1961
1961
|
te !== !1 && /* @__PURE__ */ r(
|
|
@@ -1963,23 +1963,23 @@ const di = ({
|
|
|
1963
1963
|
{
|
|
1964
1964
|
type: "button",
|
|
1965
1965
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1966
|
-
onClick:
|
|
1966
|
+
onClick: ze,
|
|
1967
1967
|
"aria-label": "Close widget",
|
|
1968
|
-
children: /* @__PURE__ */ r(
|
|
1968
|
+
children: /* @__PURE__ */ r(kn, {})
|
|
1969
1969
|
}
|
|
1970
1970
|
)
|
|
1971
1971
|
] })
|
|
1972
1972
|
] })
|
|
1973
1973
|
),
|
|
1974
|
-
|
|
1974
|
+
yt && /* @__PURE__ */ (() => {
|
|
1975
1975
|
const _ = R ? "Resume session" : E === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1976
|
-
return /* @__PURE__ */ k(
|
|
1977
|
-
!
|
|
1976
|
+
return /* @__PURE__ */ k(We, { children: [
|
|
1977
|
+
!v && /* @__PURE__ */ k(
|
|
1978
1978
|
"button",
|
|
1979
1979
|
{
|
|
1980
1980
|
type: "button",
|
|
1981
1981
|
className: "ll-expanded__play",
|
|
1982
|
-
onClick:
|
|
1982
|
+
onClick: nt,
|
|
1983
1983
|
"aria-label": _,
|
|
1984
1984
|
children: [
|
|
1985
1985
|
/* @__PURE__ */ r("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ r("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
@@ -1988,13 +1988,13 @@ const di = ({
|
|
|
1988
1988
|
}
|
|
1989
1989
|
),
|
|
1990
1990
|
!U && /* @__PURE__ */ k("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1991
|
-
|
|
1991
|
+
o && /* @__PURE__ */ r("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: o }) }),
|
|
1992
1992
|
/* @__PURE__ */ r(
|
|
1993
1993
|
"button",
|
|
1994
1994
|
{
|
|
1995
1995
|
type: "button",
|
|
1996
1996
|
className: "ll-expanded__cta",
|
|
1997
|
-
onClick:
|
|
1997
|
+
onClick: nt,
|
|
1998
1998
|
"aria-label": _,
|
|
1999
1999
|
children: _
|
|
2000
2000
|
}
|
|
@@ -2005,12 +2005,12 @@ const di = ({
|
|
|
2005
2005
|
/* @__PURE__ */ k(
|
|
2006
2006
|
"div",
|
|
2007
2007
|
{
|
|
2008
|
-
className: `ll-expanded__pip ${
|
|
2008
|
+
className: `ll-expanded__pip ${je && (K || f) ? "is-visible" : ""}`,
|
|
2009
2009
|
children: [
|
|
2010
2010
|
/* @__PURE__ */ r(
|
|
2011
2011
|
"div",
|
|
2012
2012
|
{
|
|
2013
|
-
ref:
|
|
2013
|
+
ref: ot,
|
|
2014
2014
|
className: f ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
2015
2015
|
}
|
|
2016
2016
|
),
|
|
@@ -2024,21 +2024,21 @@ const di = ({
|
|
|
2024
2024
|
]
|
|
2025
2025
|
}
|
|
2026
2026
|
),
|
|
2027
|
-
|
|
2028
|
-
!U &&
|
|
2027
|
+
je ? /* @__PURE__ */ k("div", { className: "ll-expanded__bottom", children: [
|
|
2028
|
+
!U && wt && /* @__PURE__ */ r(
|
|
2029
2029
|
"div",
|
|
2030
2030
|
{
|
|
2031
2031
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
2032
2032
|
"data-role": "agent",
|
|
2033
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2033
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: wt })
|
|
2034
2034
|
}
|
|
2035
2035
|
),
|
|
2036
|
-
!U &&
|
|
2036
|
+
!U && Ge && /* @__PURE__ */ r(
|
|
2037
2037
|
"div",
|
|
2038
2038
|
{
|
|
2039
2039
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
2040
2040
|
"data-role": "user",
|
|
2041
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2041
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: Ge })
|
|
2042
2042
|
}
|
|
2043
2043
|
),
|
|
2044
2044
|
!oe && !U && /* @__PURE__ */ k("div", { className: "ll-toolbar", onClick: (_) => _.stopPropagation(), children: [
|
|
@@ -2047,10 +2047,10 @@ const di = ({
|
|
|
2047
2047
|
{
|
|
2048
2048
|
type: "button",
|
|
2049
2049
|
className: `ll-tool ${f ? "is-on" : ""}`,
|
|
2050
|
-
onClick:
|
|
2050
|
+
onClick: Re,
|
|
2051
2051
|
"aria-label": f ? "Stop sharing screen" : "Share screen",
|
|
2052
2052
|
title: f ? "Stop sharing" : "Share screen",
|
|
2053
|
-
children: /* @__PURE__ */ r(
|
|
2053
|
+
children: /* @__PURE__ */ r(Fn, {})
|
|
2054
2054
|
}
|
|
2055
2055
|
),
|
|
2056
2056
|
q && /* @__PURE__ */ k("div", { className: "ll-tool-split", children: [
|
|
@@ -2059,10 +2059,10 @@ const di = ({
|
|
|
2059
2059
|
{
|
|
2060
2060
|
type: "button",
|
|
2061
2061
|
className: `ll-tool ll-tool--left ${K ? "is-on" : ""}`,
|
|
2062
|
-
onClick:
|
|
2062
|
+
onClick: Be,
|
|
2063
2063
|
"aria-label": K ? "Turn off camera" : "Turn on camera",
|
|
2064
2064
|
title: K ? "Stop camera" : "Start camera",
|
|
2065
|
-
children: /* @__PURE__ */ r(
|
|
2065
|
+
children: /* @__PURE__ */ r(Wn, {})
|
|
2066
2066
|
}
|
|
2067
2067
|
),
|
|
2068
2068
|
/* @__PURE__ */ r(
|
|
@@ -2072,23 +2072,23 @@ const di = ({
|
|
|
2072
2072
|
type: "button",
|
|
2073
2073
|
className: `ll-tool ll-tool--right ${K ? "is-on" : ""}`,
|
|
2074
2074
|
onClick: (_) => {
|
|
2075
|
-
_.stopPropagation(),
|
|
2075
|
+
_.stopPropagation(), Ye((re) => !re), pe(!1);
|
|
2076
2076
|
},
|
|
2077
2077
|
"aria-label": "Camera devices",
|
|
2078
2078
|
"aria-haspopup": "listbox",
|
|
2079
|
-
"aria-expanded":
|
|
2080
|
-
children: /* @__PURE__ */ r(
|
|
2079
|
+
"aria-expanded": Ve,
|
|
2080
|
+
children: /* @__PURE__ */ r(St, {})
|
|
2081
2081
|
}
|
|
2082
2082
|
),
|
|
2083
|
-
|
|
2084
|
-
|
|
2083
|
+
Ve && $.length > 0 && /* @__PURE__ */ r(
|
|
2084
|
+
En,
|
|
2085
2085
|
{
|
|
2086
2086
|
label: "Camera",
|
|
2087
2087
|
devices: $,
|
|
2088
2088
|
activeId: G,
|
|
2089
2089
|
anchorRef: _e,
|
|
2090
2090
|
onPick: (_) => {
|
|
2091
|
-
|
|
2091
|
+
Ye(!1), qe(_);
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
2094
2094
|
)
|
|
@@ -2099,10 +2099,10 @@ const di = ({
|
|
|
2099
2099
|
{
|
|
2100
2100
|
type: "button",
|
|
2101
2101
|
className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
|
|
2102
|
-
onClick:
|
|
2102
|
+
onClick: it,
|
|
2103
2103
|
"aria-label": O ? "Unmute microphone" : "Mute microphone",
|
|
2104
2104
|
title: O ? "Unmute" : "Mute",
|
|
2105
|
-
children: /* @__PURE__ */ r(
|
|
2105
|
+
children: /* @__PURE__ */ r(Bn, { muted: O })
|
|
2106
2106
|
}
|
|
2107
2107
|
),
|
|
2108
2108
|
/* @__PURE__ */ r(
|
|
@@ -2112,23 +2112,23 @@ const di = ({
|
|
|
2112
2112
|
type: "button",
|
|
2113
2113
|
className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
|
|
2114
2114
|
onClick: (_) => {
|
|
2115
|
-
_.stopPropagation(), pe((re) => !re),
|
|
2115
|
+
_.stopPropagation(), pe((re) => !re), Ye(!1);
|
|
2116
2116
|
},
|
|
2117
2117
|
"aria-label": "Microphone devices",
|
|
2118
2118
|
"aria-haspopup": "listbox",
|
|
2119
2119
|
"aria-expanded": le,
|
|
2120
|
-
children: /* @__PURE__ */ r(
|
|
2120
|
+
children: /* @__PURE__ */ r(St, {})
|
|
2121
2121
|
}
|
|
2122
2122
|
),
|
|
2123
2123
|
le && D.length > 0 && /* @__PURE__ */ r(
|
|
2124
|
-
|
|
2124
|
+
En,
|
|
2125
2125
|
{
|
|
2126
2126
|
label: "Microphone",
|
|
2127
2127
|
devices: D,
|
|
2128
2128
|
activeId: W,
|
|
2129
2129
|
anchorRef: ge,
|
|
2130
2130
|
onPick: (_) => {
|
|
2131
|
-
pe(!1),
|
|
2131
|
+
pe(!1), gt(_);
|
|
2132
2132
|
}
|
|
2133
2133
|
}
|
|
2134
2134
|
)
|
|
@@ -2138,10 +2138,10 @@ const di = ({
|
|
|
2138
2138
|
{
|
|
2139
2139
|
type: "button",
|
|
2140
2140
|
className: `ll-tool ${z ? "is-muted" : ""}`,
|
|
2141
|
-
onClick:
|
|
2141
|
+
onClick: Te,
|
|
2142
2142
|
"aria-label": z ? "Unmute speaker" : "Mute speaker",
|
|
2143
2143
|
title: z ? "Unmute speaker" : "Mute speaker",
|
|
2144
|
-
children: /* @__PURE__ */ r(
|
|
2144
|
+
children: /* @__PURE__ */ r(qn, { muted: z })
|
|
2145
2145
|
}
|
|
2146
2146
|
),
|
|
2147
2147
|
/* @__PURE__ */ r(
|
|
@@ -2149,80 +2149,80 @@ const di = ({
|
|
|
2149
2149
|
{
|
|
2150
2150
|
type: "button",
|
|
2151
2151
|
className: "ll-tool ll-tool--danger",
|
|
2152
|
-
onClick:
|
|
2152
|
+
onClick: rt,
|
|
2153
2153
|
"aria-label": "End conversation",
|
|
2154
2154
|
title: "End conversation",
|
|
2155
|
-
children: /* @__PURE__ */ r(
|
|
2155
|
+
children: /* @__PURE__ */ r(Un, {})
|
|
2156
2156
|
}
|
|
2157
2157
|
)
|
|
2158
2158
|
] }),
|
|
2159
2159
|
!oe && U && /* @__PURE__ */ r(
|
|
2160
|
-
|
|
2160
|
+
ui,
|
|
2161
2161
|
{
|
|
2162
2162
|
isMuted: O,
|
|
2163
|
-
onToggleMute:
|
|
2163
|
+
onToggleMute: it,
|
|
2164
2164
|
isCameraEnabled: K,
|
|
2165
|
-
onToggleCamera:
|
|
2165
|
+
onToggleCamera: Be,
|
|
2166
2166
|
allowCamera: q,
|
|
2167
2167
|
isScreenShareEnabled: f,
|
|
2168
|
-
onToggleScreenShare:
|
|
2168
|
+
onToggleScreenShare: Re,
|
|
2169
2169
|
allowScreenShare: X,
|
|
2170
2170
|
isSpeakerMuted: z,
|
|
2171
|
-
onToggleSpeaker:
|
|
2171
|
+
onToggleSpeaker: Te,
|
|
2172
2172
|
allowTyping: ee,
|
|
2173
|
-
isTypingOpen:
|
|
2174
|
-
onToggleTyping:
|
|
2175
|
-
onDisconnect:
|
|
2173
|
+
isTypingOpen: bt,
|
|
2174
|
+
onToggleTyping: It,
|
|
2175
|
+
onDisconnect: rt
|
|
2176
2176
|
}
|
|
2177
2177
|
),
|
|
2178
|
-
!oe && ee && (U ?
|
|
2178
|
+
!oe && ee && (U ? bt : !0) && /* @__PURE__ */ k("form", { className: "ll-message-input", onSubmit: Ae, children: [
|
|
2179
2179
|
/* @__PURE__ */ r(
|
|
2180
2180
|
"input",
|
|
2181
2181
|
{
|
|
2182
2182
|
type: "text",
|
|
2183
2183
|
className: "ll-message-input__field",
|
|
2184
2184
|
placeholder: "Message...",
|
|
2185
|
-
value:
|
|
2186
|
-
onChange: (_) =>
|
|
2185
|
+
value: lt,
|
|
2186
|
+
onChange: (_) => Rt(_.target.value),
|
|
2187
2187
|
"aria-label": "Message the agent"
|
|
2188
2188
|
}
|
|
2189
2189
|
),
|
|
2190
|
-
|
|
2190
|
+
lt.trim() && /* @__PURE__ */ r(
|
|
2191
2191
|
"button",
|
|
2192
2192
|
{
|
|
2193
2193
|
type: "submit",
|
|
2194
2194
|
className: "ll-message-input__send",
|
|
2195
2195
|
"aria-label": "Send message",
|
|
2196
|
-
children: /* @__PURE__ */ r(
|
|
2196
|
+
children: /* @__PURE__ */ r(hi, {})
|
|
2197
2197
|
}
|
|
2198
2198
|
)
|
|
2199
2199
|
] })
|
|
2200
2200
|
] }) : null,
|
|
2201
2201
|
(() => {
|
|
2202
|
-
if (
|
|
2202
|
+
if (g && E !== "error")
|
|
2203
2203
|
return /* @__PURE__ */ k("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
2204
|
-
/* @__PURE__ */ r("span", { children:
|
|
2204
|
+
/* @__PURE__ */ r("span", { children: g }),
|
|
2205
2205
|
/* @__PURE__ */ r(
|
|
2206
2206
|
"button",
|
|
2207
2207
|
{
|
|
2208
2208
|
type: "button",
|
|
2209
2209
|
className: "ll-expanded__banner-x",
|
|
2210
|
-
onClick:
|
|
2210
|
+
onClick: Ue,
|
|
2211
2211
|
"aria-label": "Dismiss",
|
|
2212
2212
|
children: "×"
|
|
2213
2213
|
}
|
|
2214
2214
|
)
|
|
2215
2215
|
] });
|
|
2216
|
-
if (!
|
|
2216
|
+
if (!v || E !== "error") return null;
|
|
2217
2217
|
let _ = "Failed to connect", re = "Try again";
|
|
2218
|
-
return
|
|
2218
|
+
return v === "MIC_PERMISSION_DENIED" ? _ = "Microphone blocked. Allow access to talk." : v === "MIC_NOT_FOUND" ? _ = "No microphone found. Plug one in + retry." : v === "MIC_UNAVAILABLE" ? _ = "Mic unavailable. Check other apps using it." : v === "AGENT_TIMEOUT" ? _ = "Agent didn't pick up. Try again." : v === "CONNECT_FAILED" ? _ = "Connection failed. Check your network." : v.length < 80 && (_ = v), /* @__PURE__ */ k("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
2219
2219
|
/* @__PURE__ */ r("span", { children: _ }),
|
|
2220
2220
|
/* @__PURE__ */ r(
|
|
2221
2221
|
"button",
|
|
2222
2222
|
{
|
|
2223
2223
|
type: "button",
|
|
2224
2224
|
className: "ll-expanded__banner-retry",
|
|
2225
|
-
onClick:
|
|
2225
|
+
onClick: ht,
|
|
2226
2226
|
children: re
|
|
2227
2227
|
}
|
|
2228
2228
|
)
|
|
@@ -2244,32 +2244,32 @@ const di = ({
|
|
|
2244
2244
|
}
|
|
2245
2245
|
);
|
|
2246
2246
|
};
|
|
2247
|
-
function
|
|
2247
|
+
function St() {
|
|
2248
2248
|
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" }) });
|
|
2249
2249
|
}
|
|
2250
|
-
function
|
|
2250
|
+
function kn() {
|
|
2251
2251
|
return /* @__PURE__ */ k("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
2252
2252
|
/* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2253
2253
|
/* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2254
2254
|
] });
|
|
2255
2255
|
}
|
|
2256
|
-
function
|
|
2256
|
+
function Sn() {
|
|
2257
2257
|
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
2258
2258
|
}
|
|
2259
|
-
function
|
|
2259
|
+
function Fn() {
|
|
2260
2260
|
return /* @__PURE__ */ k("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: [
|
|
2261
2261
|
/* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
2262
2262
|
/* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
2263
2263
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
2264
2264
|
] });
|
|
2265
2265
|
}
|
|
2266
|
-
function
|
|
2266
|
+
function Wn() {
|
|
2267
2267
|
return /* @__PURE__ */ k("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: [
|
|
2268
2268
|
/* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
2269
2269
|
/* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
2270
2270
|
] });
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function Bn({ muted: e }) {
|
|
2273
2273
|
return /* @__PURE__ */ k("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: [
|
|
2274
2274
|
/* @__PURE__ */ r("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
2275
2275
|
/* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -2277,22 +2277,22 @@ function Fn({ muted: e }) {
|
|
|
2277
2277
|
e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2278
2278
|
] });
|
|
2279
2279
|
}
|
|
2280
|
-
function
|
|
2280
|
+
function qn({ muted: e }) {
|
|
2281
2281
|
return /* @__PURE__ */ k("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: [
|
|
2282
2282
|
/* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
2283
|
-
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ k(
|
|
2283
|
+
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ k(We, { children: [
|
|
2284
2284
|
/* @__PURE__ */ r("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
2285
2285
|
/* @__PURE__ */ r("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
2286
2286
|
] })
|
|
2287
2287
|
] });
|
|
2288
2288
|
}
|
|
2289
|
-
function
|
|
2289
|
+
function hi() {
|
|
2290
2290
|
return /* @__PURE__ */ k("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2291
2291
|
/* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
2292
2292
|
/* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
|
|
2293
2293
|
] });
|
|
2294
2294
|
}
|
|
2295
|
-
function
|
|
2295
|
+
function Un() {
|
|
2296
2296
|
return /* @__PURE__ */ r("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ r(
|
|
2297
2297
|
"path",
|
|
2298
2298
|
{
|
|
@@ -2301,59 +2301,59 @@ function Bn() {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
) });
|
|
2303
2303
|
}
|
|
2304
|
-
const
|
|
2304
|
+
const En = ({
|
|
2305
2305
|
label: e,
|
|
2306
2306
|
devices: t,
|
|
2307
2307
|
activeId: n,
|
|
2308
2308
|
onPick: i,
|
|
2309
2309
|
anchorRef: a
|
|
2310
2310
|
}) => {
|
|
2311
|
-
const [
|
|
2312
|
-
return
|
|
2313
|
-
const
|
|
2311
|
+
const [o, s] = M(null);
|
|
2312
|
+
return Dn(() => {
|
|
2313
|
+
const l = () => {
|
|
2314
2314
|
const c = a.current;
|
|
2315
2315
|
if (!c) return;
|
|
2316
|
-
const u = c.getBoundingClientRect(),
|
|
2316
|
+
const u = c.getBoundingClientRect(), m = 126, p = window.innerWidth - 16 - 110, h = u.left + u.width / 2;
|
|
2317
2317
|
s({
|
|
2318
2318
|
top: u.top - 8,
|
|
2319
|
-
left: Math.max(
|
|
2319
|
+
left: Math.max(m, Math.min(p, h))
|
|
2320
2320
|
});
|
|
2321
2321
|
};
|
|
2322
|
-
return
|
|
2323
|
-
window.removeEventListener("scroll",
|
|
2322
|
+
return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
|
|
2323
|
+
window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
2324
2324
|
};
|
|
2325
|
-
}, [a]),
|
|
2325
|
+
}, [a]), o === null || typeof document > "u" ? null : Xt(
|
|
2326
2326
|
/* @__PURE__ */ k(
|
|
2327
2327
|
"div",
|
|
2328
2328
|
{
|
|
2329
2329
|
className: "ll-device-menu ll-device-menu--floating",
|
|
2330
|
-
onClick: (
|
|
2330
|
+
onClick: (l) => l.stopPropagation(),
|
|
2331
2331
|
role: "listbox",
|
|
2332
2332
|
style: {
|
|
2333
2333
|
position: "fixed",
|
|
2334
|
-
top:
|
|
2335
|
-
left:
|
|
2334
|
+
top: o.top,
|
|
2335
|
+
left: o.left,
|
|
2336
2336
|
// translate up by 100% so its BOTTOM edge sits at pos.top.
|
|
2337
2337
|
transform: "translate(-50%, -100%)"
|
|
2338
2338
|
},
|
|
2339
2339
|
children: [
|
|
2340
2340
|
/* @__PURE__ */ r("p", { className: "ll-device-menu__label", children: e }),
|
|
2341
|
-
t.map((
|
|
2342
|
-
const u = n ===
|
|
2341
|
+
t.map((l, c) => {
|
|
2342
|
+
const u = n === l.deviceId;
|
|
2343
2343
|
return /* @__PURE__ */ k(
|
|
2344
2344
|
"button",
|
|
2345
2345
|
{
|
|
2346
2346
|
type: "button",
|
|
2347
2347
|
className: `ll-device-menu__item ${u ? "is-active" : ""}`,
|
|
2348
|
-
onClick: () => i(
|
|
2348
|
+
onClick: () => i(l.deviceId),
|
|
2349
2349
|
role: "option",
|
|
2350
2350
|
"aria-selected": u,
|
|
2351
2351
|
children: [
|
|
2352
2352
|
u && /* @__PURE__ */ r("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
2353
|
-
/* @__PURE__ */ r("span", { className: "ll-device-menu__name", children:
|
|
2353
|
+
/* @__PURE__ */ r("span", { className: "ll-device-menu__name", children: l.label || `${e} ${c + 1}` })
|
|
2354
2354
|
]
|
|
2355
2355
|
},
|
|
2356
|
-
|
|
2356
|
+
l.deviceId || c
|
|
2357
2357
|
);
|
|
2358
2358
|
})
|
|
2359
2359
|
]
|
|
@@ -2361,7 +2361,7 @@ const Cn = ({
|
|
|
2361
2361
|
),
|
|
2362
2362
|
document.body
|
|
2363
2363
|
);
|
|
2364
|
-
},
|
|
2364
|
+
}, mi = [
|
|
2365
2365
|
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
2366
2366
|
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
2367
2367
|
// is the recommended spelling; "true" is preserved for back-compat.
|
|
@@ -2369,17 +2369,17 @@ const Cn = ({
|
|
|
2369
2369
|
"[data-ll-skip]",
|
|
2370
2370
|
".ll-widget"
|
|
2371
2371
|
];
|
|
2372
|
-
function
|
|
2372
|
+
function Kt(e) {
|
|
2373
2373
|
let t = e;
|
|
2374
2374
|
for (; t; ) {
|
|
2375
|
-
for (const n of
|
|
2375
|
+
for (const n of mi)
|
|
2376
2376
|
if (t.matches(n)) return !0;
|
|
2377
2377
|
t = t.parentElement;
|
|
2378
2378
|
}
|
|
2379
2379
|
return !1;
|
|
2380
2380
|
}
|
|
2381
|
-
function
|
|
2382
|
-
if (
|
|
2381
|
+
function Vt(e) {
|
|
2382
|
+
if (Kt(e)) return !1;
|
|
2383
2383
|
if (e instanceof HTMLInputElement) {
|
|
2384
2384
|
if (e.type === "password") return !1;
|
|
2385
2385
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2387,7 +2387,7 @@ function Ut(e) {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
return !0;
|
|
2389
2389
|
}
|
|
2390
|
-
const
|
|
2390
|
+
const Et = 4096, gi = 20, yi = 20, vi = 10, bi = 10, wi = 30, _i = 20, Nn = 500, xi = [
|
|
2391
2391
|
'[data-ll-private="true"]',
|
|
2392
2392
|
".ll-widget",
|
|
2393
2393
|
"script",
|
|
@@ -2395,45 +2395,45 @@ const St = 4096, hi = 20, mi = 20, gi = 10, yi = 10, vi = 30, bi = 20, kn = 500,
|
|
|
2395
2395
|
"noscript",
|
|
2396
2396
|
"iframe"
|
|
2397
2397
|
];
|
|
2398
|
-
function
|
|
2398
|
+
function ft(e) {
|
|
2399
2399
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2400
2400
|
let t = e;
|
|
2401
2401
|
for (; t; ) {
|
|
2402
|
-
for (const n of
|
|
2402
|
+
for (const n of xi)
|
|
2403
2403
|
if (t.matches(n)) return !0;
|
|
2404
2404
|
t = t.parentElement;
|
|
2405
2405
|
}
|
|
2406
2406
|
return !1;
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2408
|
+
function pt(e) {
|
|
2409
2409
|
if (typeof window > "u") return !0;
|
|
2410
2410
|
const t = e.getBoundingClientRect();
|
|
2411
2411
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
2412
2412
|
const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2413
2413
|
return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
|
|
2414
2414
|
}
|
|
2415
|
-
function
|
|
2415
|
+
function An(e) {
|
|
2416
2416
|
const t = e.getAttribute("id");
|
|
2417
2417
|
if (t) {
|
|
2418
|
-
const
|
|
2418
|
+
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
|
|
2419
2419
|
if (s != null && s.textContent) return s.textContent.trim();
|
|
2420
2420
|
}
|
|
2421
2421
|
const n = e.getAttribute("aria-label");
|
|
2422
2422
|
if (n) return n.trim();
|
|
2423
2423
|
const i = e.closest("label");
|
|
2424
2424
|
if (i) {
|
|
2425
|
-
const
|
|
2426
|
-
for (const
|
|
2427
|
-
if (
|
|
2428
|
-
const c = (
|
|
2429
|
-
c &&
|
|
2430
|
-
} else if (
|
|
2431
|
-
if (
|
|
2425
|
+
const o = [];
|
|
2426
|
+
for (const l of Array.from(i.childNodes))
|
|
2427
|
+
if (l.nodeType === Node.TEXT_NODE) {
|
|
2428
|
+
const c = (l.textContent || "").trim();
|
|
2429
|
+
c && o.push(c);
|
|
2430
|
+
} else if (l instanceof HTMLElement) {
|
|
2431
|
+
if (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement || l instanceof HTMLButtonElement)
|
|
2432
2432
|
continue;
|
|
2433
|
-
const c = (
|
|
2434
|
-
c &&
|
|
2433
|
+
const c = (l.textContent || "").trim();
|
|
2434
|
+
c && o.push(c);
|
|
2435
2435
|
}
|
|
2436
|
-
const s =
|
|
2436
|
+
const s = o.join(" ").trim();
|
|
2437
2437
|
if (s) return s;
|
|
2438
2438
|
}
|
|
2439
2439
|
const a = e.getAttribute("placeholder");
|
|
@@ -2442,39 +2442,39 @@ function Sn(e) {
|
|
|
2442
2442
|
function fe(e, t) {
|
|
2443
2443
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2444
2444
|
}
|
|
2445
|
-
function
|
|
2445
|
+
function Li(e) {
|
|
2446
2446
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2447
2447
|
}
|
|
2448
|
-
function
|
|
2448
|
+
function Ci(e) {
|
|
2449
2449
|
const t = e.getAttribute("aria-label");
|
|
2450
2450
|
if (t) return t.trim().slice(0, 80);
|
|
2451
2451
|
const n = e.getAttribute("aria-labelledby");
|
|
2452
2452
|
if (n) {
|
|
2453
|
-
const
|
|
2454
|
-
if (
|
|
2453
|
+
const o = document.getElementById(n);
|
|
2454
|
+
if (o != null && o.textContent) return o.textContent.trim().slice(0, 80);
|
|
2455
2455
|
}
|
|
2456
2456
|
const i = e.querySelector(
|
|
2457
2457
|
'button[type="submit"], input[type="submit"], button:not([type])'
|
|
2458
2458
|
);
|
|
2459
2459
|
if (i) {
|
|
2460
|
-
const
|
|
2461
|
-
if (
|
|
2462
|
-
return
|
|
2460
|
+
const o = i instanceof HTMLInputElement ? i.value : (i.textContent ?? "").trim();
|
|
2461
|
+
if (o && o.length < 60 && !/^(submit|ok|continue)$/i.test(o))
|
|
2462
|
+
return o;
|
|
2463
2463
|
}
|
|
2464
2464
|
let a = e.parentElement;
|
|
2465
|
-
for (let
|
|
2465
|
+
for (let o = 0; a && o < 4; o++, a = a.parentElement) {
|
|
2466
2466
|
const s = a.querySelector("h1, h2, h3, h4");
|
|
2467
2467
|
if (s != null && s.textContent) {
|
|
2468
|
-
const
|
|
2469
|
-
if (
|
|
2468
|
+
const l = s.textContent.trim();
|
|
2469
|
+
if (l && l.length < 80) return l;
|
|
2470
2470
|
}
|
|
2471
2471
|
}
|
|
2472
2472
|
return null;
|
|
2473
2473
|
}
|
|
2474
|
-
function
|
|
2474
|
+
function Ze(e) {
|
|
2475
2475
|
return e.length;
|
|
2476
2476
|
}
|
|
2477
|
-
function
|
|
2477
|
+
function ki(e, t = {}) {
|
|
2478
2478
|
const n = t.doc ?? (typeof document < "u" ? document : null);
|
|
2479
2479
|
if (!n)
|
|
2480
2480
|
return {
|
|
@@ -2488,66 +2488,66 @@ function Li(e, t = {}) {
|
|
|
2488
2488
|
forms: [],
|
|
2489
2489
|
extras: e
|
|
2490
2490
|
};
|
|
2491
|
-
const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/",
|
|
2491
|
+
const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o = n.title || "", s = Array.from(
|
|
2492
2492
|
n.querySelectorAll("[data-ll-region]")
|
|
2493
|
-
),
|
|
2494
|
-
for (const
|
|
2495
|
-
if (
|
|
2496
|
-
if (
|
|
2497
|
-
const D =
|
|
2498
|
-
(
|
|
2499
|
-
|
|
2493
|
+
), l = [];
|
|
2494
|
+
for (const g of s) {
|
|
2495
|
+
if (l.length >= vi) break;
|
|
2496
|
+
if (ft(g) || !pt(g)) continue;
|
|
2497
|
+
const D = g.getAttribute("data-ll-region") ?? "", W = g.getAttribute("data-ll-intent") ?? void 0, K = fe(
|
|
2498
|
+
(g.innerText || g.textContent || "").trim(),
|
|
2499
|
+
Nn * 2
|
|
2500
2500
|
);
|
|
2501
|
-
!D || !K ||
|
|
2501
|
+
!D || !K || l.push({ id: D, intent: W, text: K });
|
|
2502
2502
|
}
|
|
2503
|
-
const c = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"],
|
|
2503
|
+
const c = [], u = ["H1", "H2", "H3", "H4", "H5", "H6"], m = Array.from(
|
|
2504
2504
|
n.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2505
2505
|
);
|
|
2506
|
-
for (const
|
|
2507
|
-
if (
|
|
2508
|
-
const D = (
|
|
2509
|
-
D && c.push(`${
|
|
2506
|
+
for (const g of m) {
|
|
2507
|
+
if (ft(g) || !pt(g)) continue;
|
|
2508
|
+
const D = (g.textContent || "").trim();
|
|
2509
|
+
D && c.push(`${g.tagName}: ${fe(D, 200)}`);
|
|
2510
2510
|
}
|
|
2511
2511
|
const p = Array.from(n.querySelectorAll("p, li"));
|
|
2512
|
-
for (const
|
|
2513
|
-
if (
|
|
2514
|
-
const D = (
|
|
2515
|
-
D.length > 10 && c.push(fe(D,
|
|
2512
|
+
for (const g of p) {
|
|
2513
|
+
if (ft(g) || !pt(g) || u.includes(g.tagName)) continue;
|
|
2514
|
+
const D = (g.textContent || "").trim();
|
|
2515
|
+
D.length > 10 && c.push(fe(D, Nn));
|
|
2516
2516
|
}
|
|
2517
2517
|
const h = c.join(`
|
|
2518
2518
|
`), P = [], x = Array.from(n.querySelectorAll("a[href]"));
|
|
2519
|
-
for (const
|
|
2520
|
-
if (P.length >=
|
|
2521
|
-
if (
|
|
2522
|
-
const D =
|
|
2519
|
+
for (const g of x) {
|
|
2520
|
+
if (P.length >= gi) break;
|
|
2521
|
+
if (ft(g) || !pt(g)) continue;
|
|
2522
|
+
const D = g.getAttribute("href") || "", W = (g.textContent || "").trim();
|
|
2523
2523
|
!D || !W || P.push({ href: D, text: fe(W, 100) });
|
|
2524
2524
|
}
|
|
2525
|
-
const E = [],
|
|
2525
|
+
const E = [], y = Array.from(
|
|
2526
2526
|
n.querySelectorAll(
|
|
2527
2527
|
"input, textarea, select"
|
|
2528
2528
|
)
|
|
2529
2529
|
);
|
|
2530
|
-
for (const
|
|
2531
|
-
if (E.length >=
|
|
2532
|
-
if (
|
|
2533
|
-
const D =
|
|
2530
|
+
for (const g of y) {
|
|
2531
|
+
if (E.length >= yi) break;
|
|
2532
|
+
if (ft(g) || !Vt(g) || !pt(g)) continue;
|
|
2533
|
+
const D = An(g), W = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
|
|
2534
2534
|
D && E.push({ label: fe(D, 100), type: W });
|
|
2535
2535
|
}
|
|
2536
2536
|
const w = Array.from(n.querySelectorAll("form")), R = [];
|
|
2537
2537
|
let S = 0;
|
|
2538
|
-
for (const
|
|
2539
|
-
if (R.length >=
|
|
2540
|
-
if (
|
|
2541
|
-
const D =
|
|
2542
|
-
|
|
2538
|
+
for (const g of w) {
|
|
2539
|
+
if (R.length >= bi) break;
|
|
2540
|
+
if (Kt(g) || g.matches(".ll-widget *, .ll-widget")) continue;
|
|
2541
|
+
const D = g.getAttribute("id") || g.getAttribute("name") || Li(g.getAttribute("data-ll-intent")) || `form_${S++}`, W = g.getAttribute("data-ll-intent") || Ci(g) || void 0, K = Array.from(
|
|
2542
|
+
g.querySelectorAll(
|
|
2543
2543
|
"input, textarea, select"
|
|
2544
2544
|
)
|
|
2545
2545
|
), ae = [];
|
|
2546
2546
|
let $ = 0;
|
|
2547
2547
|
const G = /* @__PURE__ */ new Set();
|
|
2548
2548
|
for (const f of K) {
|
|
2549
|
-
if (ae.length >=
|
|
2550
|
-
if (!
|
|
2549
|
+
if (ae.length >= wi) break;
|
|
2550
|
+
if (!Vt(f)) continue;
|
|
2551
2551
|
if (f instanceof HTMLInputElement) {
|
|
2552
2552
|
const U = f.type;
|
|
2553
2553
|
if (U === "submit" || U === "button" || U === "reset" || U === "hidden" || U === "image" || U === "file") continue;
|
|
@@ -2555,7 +2555,7 @@ function Li(e, t = {}) {
|
|
|
2555
2555
|
const N = f.getAttribute("name") || "", z = f.getAttribute("id") || "";
|
|
2556
2556
|
let q = N || z || `field_${$}`;
|
|
2557
2557
|
G.has(q) && (q = `${q}__${$}`), G.add(q), $++;
|
|
2558
|
-
const X =
|
|
2558
|
+
const X = An(f) || q, ee = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), V = {
|
|
2559
2559
|
name: q,
|
|
2560
2560
|
label: fe(X, 100),
|
|
2561
2561
|
type: ee
|
|
@@ -2588,7 +2588,7 @@ function Li(e, t = {}) {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
if (f instanceof HTMLSelectElement) {
|
|
2590
2590
|
const U = [];
|
|
2591
|
-
for (let me = 0; me < f.options.length && !(U.length >=
|
|
2591
|
+
for (let me = 0; me < f.options.length && !(U.length >= _i); me++) {
|
|
2592
2592
|
const Q = f.options[me];
|
|
2593
2593
|
if (!Q || Q.disabled) continue;
|
|
2594
2594
|
const be = Q.value || "", ne = (Q.textContent || "").trim() || be;
|
|
@@ -2601,44 +2601,44 @@ function Li(e, t = {}) {
|
|
|
2601
2601
|
}
|
|
2602
2602
|
R.push({ id: D, intent: W, fields: ae });
|
|
2603
2603
|
}
|
|
2604
|
-
const
|
|
2604
|
+
const v = {
|
|
2605
2605
|
url: i,
|
|
2606
|
-
title:
|
|
2606
|
+
title: o,
|
|
2607
2607
|
pathname: a,
|
|
2608
|
-
regions:
|
|
2608
|
+
regions: l,
|
|
2609
2609
|
visibleText: h,
|
|
2610
2610
|
visibleLinks: P,
|
|
2611
2611
|
visibleFields: E,
|
|
2612
2612
|
forms: R,
|
|
2613
2613
|
extras: e
|
|
2614
2614
|
};
|
|
2615
|
-
let O =
|
|
2616
|
-
for (; O >
|
|
2617
|
-
|
|
2618
|
-
for (; O >
|
|
2619
|
-
|
|
2620
|
-
return
|
|
2615
|
+
let O = Ze(JSON.stringify(v.regions)) + Ze(v.visibleText) + Ze(JSON.stringify(v.visibleLinks)) + Ze(JSON.stringify(v.visibleFields));
|
|
2616
|
+
for (; O > Et && v.visibleFields.length > 0; )
|
|
2617
|
+
v.visibleFields.pop(), O = Ze(JSON.stringify(v.visibleFields));
|
|
2618
|
+
for (; O > Et && v.visibleLinks.length > 0; )
|
|
2619
|
+
v.visibleLinks.pop(), O -= 80;
|
|
2620
|
+
return Ze(v.visibleText) > Et && (v.visibleText = fe(v.visibleText, Et - 100)), v;
|
|
2621
2621
|
}
|
|
2622
|
-
let
|
|
2623
|
-
function
|
|
2622
|
+
let Qe = null;
|
|
2623
|
+
function Si(e) {
|
|
2624
2624
|
const t = e.querySelectorAll("form");
|
|
2625
2625
|
let n = `f${t.length}`;
|
|
2626
2626
|
return t.forEach((i) => {
|
|
2627
2627
|
n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
|
|
2628
2628
|
}), n;
|
|
2629
2629
|
}
|
|
2630
|
-
function
|
|
2631
|
-
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), a = typeof window < "u" && window.location.pathname || "/",
|
|
2632
|
-
if (
|
|
2633
|
-
return
|
|
2634
|
-
const
|
|
2635
|
-
return
|
|
2630
|
+
function Mn(e, t = {}) {
|
|
2631
|
+
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), a = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${a}::${o}::${i ? Si(i) : ""}`;
|
|
2632
|
+
if (Qe && Qe.key === s && n - Qe.at < 1e3)
|
|
2633
|
+
return Qe.ctx;
|
|
2634
|
+
const l = ki(e, t);
|
|
2635
|
+
return Qe = { key: s, at: n, ctx: l }, l;
|
|
2636
2636
|
}
|
|
2637
|
-
function
|
|
2638
|
-
|
|
2637
|
+
function Ei() {
|
|
2638
|
+
Qe = null;
|
|
2639
2639
|
}
|
|
2640
|
-
const
|
|
2641
|
-
function
|
|
2640
|
+
const Ni = 200;
|
|
2641
|
+
function Ai(e) {
|
|
2642
2642
|
const t = String(e.href || "");
|
|
2643
2643
|
return {
|
|
2644
2644
|
href: t,
|
|
@@ -2648,47 +2648,47 @@ function Ei(e) {
|
|
|
2648
2648
|
description: e.description
|
|
2649
2649
|
};
|
|
2650
2650
|
}
|
|
2651
|
-
function
|
|
2651
|
+
function Mi(e) {
|
|
2652
2652
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2653
2653
|
}
|
|
2654
|
-
function
|
|
2654
|
+
function Ii(e) {
|
|
2655
2655
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2656
2656
|
if (!t) return [];
|
|
2657
|
-
const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [],
|
|
2658
|
-
for (const s of
|
|
2659
|
-
if (a.length >=
|
|
2660
|
-
if (
|
|
2661
|
-
const
|
|
2662
|
-
if (!
|
|
2663
|
-
let c =
|
|
2657
|
+
const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [], o = Array.from(t.querySelectorAll("a[href]"));
|
|
2658
|
+
for (const s of o) {
|
|
2659
|
+
if (a.length >= Ni) break;
|
|
2660
|
+
if (Kt(s)) continue;
|
|
2661
|
+
const l = s.getAttribute("href") || "";
|
|
2662
|
+
if (!Mi(l)) continue;
|
|
2663
|
+
let c = l, u = !0;
|
|
2664
2664
|
try {
|
|
2665
2665
|
if (typeof window < "u") {
|
|
2666
|
-
const p = new URL(
|
|
2667
|
-
u = p.origin === n, u &&
|
|
2666
|
+
const p = new URL(l, n);
|
|
2667
|
+
u = p.origin === n, u && l.startsWith("http") && (c = p.pathname + p.search + p.hash);
|
|
2668
2668
|
}
|
|
2669
2669
|
} catch {
|
|
2670
2670
|
continue;
|
|
2671
2671
|
}
|
|
2672
2672
|
if (i.has(c)) continue;
|
|
2673
2673
|
i.add(c);
|
|
2674
|
-
const
|
|
2675
|
-
a.push({ href: c, text:
|
|
2674
|
+
const m = (s.textContent || "").trim().slice(0, 120);
|
|
2675
|
+
a.push({ href: c, text: m, internal: u });
|
|
2676
2676
|
}
|
|
2677
2677
|
return a;
|
|
2678
2678
|
}
|
|
2679
|
-
let
|
|
2680
|
-
const
|
|
2681
|
-
function
|
|
2679
|
+
let et = null;
|
|
2680
|
+
const Ri = 5e3;
|
|
2681
|
+
function qt() {
|
|
2682
2682
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2683
|
-
if (
|
|
2684
|
-
return
|
|
2685
|
-
const n =
|
|
2686
|
-
return
|
|
2683
|
+
if (et && et.pathname === t && e - et.at < Ri)
|
|
2684
|
+
return et.routes;
|
|
2685
|
+
const n = Ii();
|
|
2686
|
+
return et = { at: e, pathname: t, routes: n }, n;
|
|
2687
2687
|
}
|
|
2688
|
-
function
|
|
2689
|
-
|
|
2688
|
+
function Ti() {
|
|
2689
|
+
et = null;
|
|
2690
2690
|
}
|
|
2691
|
-
function
|
|
2691
|
+
function Yt(e) {
|
|
2692
2692
|
if (e instanceof HTMLInputElement) {
|
|
2693
2693
|
const t = e.type;
|
|
2694
2694
|
if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
|
|
@@ -2696,16 +2696,60 @@ function Nn(e) {
|
|
|
2696
2696
|
}
|
|
2697
2697
|
return !0;
|
|
2698
2698
|
}
|
|
2699
|
-
function
|
|
2699
|
+
function Pi(e, t) {
|
|
2700
2700
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2701
2701
|
}
|
|
2702
|
-
function
|
|
2702
|
+
function Ie(e) {
|
|
2703
|
+
return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2704
|
+
}
|
|
2705
|
+
function Ut(e) {
|
|
2706
|
+
const t = e.lastIndexOf(".");
|
|
2707
|
+
return t >= 0 ? e.slice(t + 1) : e;
|
|
2708
|
+
}
|
|
2709
|
+
function Di(e) {
|
|
2710
|
+
var i;
|
|
2711
|
+
const t = e.getAttribute("id");
|
|
2712
|
+
if (t)
|
|
2713
|
+
try {
|
|
2714
|
+
const a = (i = e.ownerDocument) == null ? void 0 : i.querySelector(
|
|
2715
|
+
`label[for="${t.replace(/"/g, '\\"')}"]`
|
|
2716
|
+
);
|
|
2717
|
+
if (a != null && a.textContent) return a.textContent;
|
|
2718
|
+
} catch {
|
|
2719
|
+
}
|
|
2720
|
+
const n = e.closest("label");
|
|
2721
|
+
return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
|
|
2722
|
+
}
|
|
2723
|
+
function zi(e, t) {
|
|
2724
|
+
const n = Ie(t);
|
|
2725
|
+
if (n.length < 2) return null;
|
|
2726
|
+
let i = null, a = 0;
|
|
2727
|
+
for (const o of Array.from(
|
|
2728
|
+
e.querySelectorAll("input, textarea, select")
|
|
2729
|
+
)) {
|
|
2730
|
+
if (!Yt(o)) continue;
|
|
2731
|
+
const s = o.getAttribute("name") || "", l = o.getAttribute("id") || "", c = [
|
|
2732
|
+
Ie(Ut(s)),
|
|
2733
|
+
Ie(Ut(l)),
|
|
2734
|
+
Ie(s),
|
|
2735
|
+
Ie(l)
|
|
2736
|
+
];
|
|
2737
|
+
let u = 0;
|
|
2738
|
+
c.some((m) => m.length >= 2 && m === n) ? u = 4 : [
|
|
2739
|
+
Ie(s),
|
|
2740
|
+
Ie(Ut(s)),
|
|
2741
|
+
Ie(Di(o))
|
|
2742
|
+
].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (u = 2), u > a && (a = u, i = o);
|
|
2743
|
+
}
|
|
2744
|
+
return a >= 2 ? i : null;
|
|
2745
|
+
}
|
|
2746
|
+
function $i(e, t) {
|
|
2703
2747
|
if (!t) return null;
|
|
2704
2748
|
try {
|
|
2705
|
-
const
|
|
2749
|
+
const o = e.querySelector(
|
|
2706
2750
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2707
2751
|
);
|
|
2708
|
-
if (
|
|
2752
|
+
if (o && Yt(o)) return o;
|
|
2709
2753
|
} catch {
|
|
2710
2754
|
}
|
|
2711
2755
|
const n = Array.from(
|
|
@@ -2713,75 +2757,75 @@ function Ti(e, t) {
|
|
|
2713
2757
|
);
|
|
2714
2758
|
let i = 0;
|
|
2715
2759
|
const a = /* @__PURE__ */ new Map();
|
|
2716
|
-
for (const
|
|
2717
|
-
if (!
|
|
2718
|
-
const s =
|
|
2719
|
-
let
|
|
2720
|
-
if (a.has(s) && (
|
|
2721
|
-
a.set(s,
|
|
2760
|
+
for (const o of n) {
|
|
2761
|
+
if (!Yt(o)) continue;
|
|
2762
|
+
const s = Pi(o, i);
|
|
2763
|
+
let l = s;
|
|
2764
|
+
if (a.has(s) && (l = `${s}__${i}`), l === t) return o;
|
|
2765
|
+
a.set(s, o), i++;
|
|
2722
2766
|
}
|
|
2723
|
-
return
|
|
2767
|
+
return zi(e, t);
|
|
2724
2768
|
}
|
|
2725
|
-
function
|
|
2726
|
-
const n =
|
|
2727
|
-
return n ?
|
|
2769
|
+
function In(e, t) {
|
|
2770
|
+
const n = $i(e, t);
|
|
2771
|
+
return n ? Vt(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2728
2772
|
}
|
|
2729
|
-
function
|
|
2773
|
+
function Hi(e, t) {
|
|
2730
2774
|
const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), a = i == null ? void 0 : i.set;
|
|
2731
2775
|
a ? a.call(e, t) : e.value = t;
|
|
2732
2776
|
}
|
|
2733
|
-
function
|
|
2777
|
+
function Oi(e, t, n = {}) {
|
|
2734
2778
|
const i = n.triggerInput ?? !0, a = n.triggerChange ?? !0;
|
|
2735
2779
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2736
|
-
const
|
|
2780
|
+
const o = Object.getOwnPropertyDescriptor(
|
|
2737
2781
|
HTMLInputElement.prototype,
|
|
2738
2782
|
"checked"
|
|
2739
|
-
), s =
|
|
2740
|
-
s ? s.call(e,
|
|
2783
|
+
), s = o == null ? void 0 : o.set, l = t === "true" || t === "1" || t === "on";
|
|
2784
|
+
s ? s.call(e, l) : e.checked = l, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2741
2785
|
return;
|
|
2742
2786
|
}
|
|
2743
|
-
|
|
2787
|
+
Hi(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2744
2788
|
}
|
|
2745
|
-
function
|
|
2789
|
+
function Rn(e, t) {
|
|
2746
2790
|
if (!t) return null;
|
|
2747
|
-
const n = t.replace(/"/g, '\\"'), i = (
|
|
2791
|
+
const n = t.replace(/"/g, '\\"'), i = (l) => l.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
|
|
2748
2792
|
try {
|
|
2749
|
-
const
|
|
2793
|
+
const l = e.querySelector(
|
|
2750
2794
|
`form#${CSS.escape(t)}`
|
|
2751
2795
|
);
|
|
2752
|
-
if (
|
|
2796
|
+
if (l && !i(l)) return l;
|
|
2753
2797
|
} catch {
|
|
2754
2798
|
}
|
|
2755
2799
|
const a = e.querySelector(
|
|
2756
2800
|
`form[name="${n}"]`
|
|
2757
2801
|
);
|
|
2758
2802
|
if (a && !i(a)) return a;
|
|
2759
|
-
const
|
|
2803
|
+
const o = e.querySelector(
|
|
2760
2804
|
`form[data-ll-intent="${n}"]`
|
|
2761
2805
|
);
|
|
2762
|
-
if (
|
|
2806
|
+
if (o && !i(o)) return o;
|
|
2763
2807
|
const s = Array.from(
|
|
2764
2808
|
e.querySelectorAll("form")
|
|
2765
|
-
).filter((
|
|
2766
|
-
for (const
|
|
2767
|
-
const c =
|
|
2768
|
-
if (c &&
|
|
2809
|
+
).filter((l) => !i(l));
|
|
2810
|
+
for (const l of s) {
|
|
2811
|
+
const c = l.getAttribute("data-ll-intent");
|
|
2812
|
+
if (c && Fi(c) === t) return l;
|
|
2769
2813
|
}
|
|
2770
2814
|
if (/^form_\d+$/.test(t)) {
|
|
2771
|
-
const
|
|
2815
|
+
const l = parseInt(t.slice(5), 10);
|
|
2772
2816
|
let c = 0;
|
|
2773
2817
|
for (const u of s)
|
|
2774
2818
|
if (!(u.id || u.getAttribute("name") || u.getAttribute("data-ll-intent"))) {
|
|
2775
|
-
if (c ===
|
|
2819
|
+
if (c === l) return u;
|
|
2776
2820
|
c++;
|
|
2777
2821
|
}
|
|
2778
2822
|
}
|
|
2779
2823
|
return s.length === 1 ? s[0] : null;
|
|
2780
2824
|
}
|
|
2781
|
-
function
|
|
2825
|
+
function Fi(e) {
|
|
2782
2826
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2783
2827
|
}
|
|
2784
|
-
function
|
|
2828
|
+
function Wi() {
|
|
2785
2829
|
if (typeof window > "u" || typeof document > "u")
|
|
2786
2830
|
return !1;
|
|
2787
2831
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2789,44 +2833,44 @@ function $i() {
|
|
|
2789
2833
|
const t = window.getComputedStyle(e);
|
|
2790
2834
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2791
2835
|
}
|
|
2792
|
-
function
|
|
2836
|
+
function Bi(e) {
|
|
2793
2837
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2794
2838
|
const n = window.getComputedStyle(e).overflowY;
|
|
2795
2839
|
return !(n !== "auto" && n !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2796
2840
|
}
|
|
2797
|
-
function
|
|
2841
|
+
function qi() {
|
|
2798
2842
|
if (typeof document > "u") return null;
|
|
2799
2843
|
const e = Array.from(
|
|
2800
2844
|
document.querySelectorAll("body, body *")
|
|
2801
2845
|
);
|
|
2802
2846
|
let t = null, n = 0;
|
|
2803
2847
|
for (const i of e) {
|
|
2804
|
-
if (!
|
|
2848
|
+
if (!Bi(i)) continue;
|
|
2805
2849
|
const a = i.getBoundingClientRect();
|
|
2806
2850
|
if (a.bottom <= 0 || a.top >= window.innerHeight || a.right <= 0 || a.left >= window.innerWidth || a.width <= 0 || a.height <= 0 || i.closest(".ll-widget")) continue;
|
|
2807
|
-
const
|
|
2808
|
-
|
|
2851
|
+
const o = a.width * a.height;
|
|
2852
|
+
o > n && (n = o, t = i);
|
|
2809
2853
|
}
|
|
2810
2854
|
return t;
|
|
2811
2855
|
}
|
|
2812
|
-
function
|
|
2856
|
+
function Ui() {
|
|
2813
2857
|
if (typeof window > "u")
|
|
2814
2858
|
return null;
|
|
2815
|
-
if (
|
|
2816
|
-
const e =
|
|
2859
|
+
if (Wi()) return window;
|
|
2860
|
+
const e = qi();
|
|
2817
2861
|
return e || window;
|
|
2818
2862
|
}
|
|
2819
|
-
function
|
|
2863
|
+
function Tn(e) {
|
|
2820
2864
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2821
2865
|
}
|
|
2822
|
-
function
|
|
2866
|
+
function ji(e) {
|
|
2823
2867
|
var t, n;
|
|
2824
2868
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2825
2869
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2826
2870
|
((n = document.documentElement) == null ? void 0 : n.scrollHeight) ?? 0
|
|
2827
2871
|
) : e.scrollHeight - e.clientHeight;
|
|
2828
2872
|
}
|
|
2829
|
-
const
|
|
2873
|
+
const Vi = /* @__PURE__ */ new Set([
|
|
2830
2874
|
"agent_state",
|
|
2831
2875
|
"avatar_stream_ready",
|
|
2832
2876
|
"avatar_active",
|
|
@@ -2856,18 +2900,18 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
2856
2900
|
// to onAgentCommand.
|
|
2857
2901
|
"task_field_updated",
|
|
2858
2902
|
"task_completed"
|
|
2859
|
-
]),
|
|
2903
|
+
]), jn = Gt(
|
|
2860
2904
|
function(t, n) {
|
|
2861
|
-
var
|
|
2905
|
+
var sn, cn, un, dn, fn, pn, hn;
|
|
2862
2906
|
const {
|
|
2863
2907
|
agentId: i,
|
|
2864
2908
|
apiKey: a,
|
|
2865
|
-
baseUrl:
|
|
2909
|
+
baseUrl: o = "https://app.livelayer.studio",
|
|
2866
2910
|
sessionEndpoint: s,
|
|
2867
|
-
sessionBody:
|
|
2911
|
+
sessionBody: l,
|
|
2868
2912
|
soundEffects: c,
|
|
2869
2913
|
experienceMode: u = "WIDGET",
|
|
2870
|
-
autoConnect:
|
|
2914
|
+
autoConnect: m = !1,
|
|
2871
2915
|
displayMode: p,
|
|
2872
2916
|
// Initial display mode. Mobile gets a smaller card layout (not the
|
|
2873
2917
|
// full-screen sheet) so "expanded" is the right default on every
|
|
@@ -2880,13 +2924,13 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
2880
2924
|
onDisplayModeChange: P,
|
|
2881
2925
|
position: x = "bottom-right",
|
|
2882
2926
|
mobileBreakpoint: E = 640,
|
|
2883
|
-
draggable:
|
|
2927
|
+
draggable: y,
|
|
2884
2928
|
resizable: w,
|
|
2885
2929
|
persistKey: R = "ll-widget",
|
|
2886
2930
|
disablePersistence: S = !1,
|
|
2887
|
-
teamMembers:
|
|
2931
|
+
teamMembers: v,
|
|
2888
2932
|
currentTeamMemberId: O,
|
|
2889
|
-
onTeamMemberChange:
|
|
2933
|
+
onTeamMemberChange: g,
|
|
2890
2934
|
idleLoopUrl: D,
|
|
2891
2935
|
greeting: W,
|
|
2892
2936
|
avatarImageUrl: K,
|
|
@@ -2907,66 +2951,66 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
2907
2951
|
hideOn: Q,
|
|
2908
2952
|
pathname: be,
|
|
2909
2953
|
onNavigate: ne,
|
|
2910
|
-
onScrollToSelector:
|
|
2911
|
-
getPageContext:
|
|
2912
|
-
pageContextExtras:
|
|
2913
|
-
getRoutes:
|
|
2914
|
-
onScrollPage:
|
|
2915
|
-
onClick:
|
|
2916
|
-
capabilities:
|
|
2917
|
-
onConnect:
|
|
2918
|
-
onDisconnect:
|
|
2919
|
-
onTranscript:
|
|
2920
|
-
onAgentState:
|
|
2921
|
-
onConnectionStateChange:
|
|
2922
|
-
onAgentEvent:
|
|
2923
|
-
onAgentCommand:
|
|
2924
|
-
onCollect:
|
|
2954
|
+
onScrollToSelector: nt,
|
|
2955
|
+
getPageContext: rt,
|
|
2956
|
+
pageContextExtras: ht,
|
|
2957
|
+
getRoutes: mt,
|
|
2958
|
+
onScrollPage: it,
|
|
2959
|
+
onClick: gt,
|
|
2960
|
+
capabilities: Be,
|
|
2961
|
+
onConnect: qe,
|
|
2962
|
+
onDisconnect: Re,
|
|
2963
|
+
onTranscript: Te,
|
|
2964
|
+
onAgentState: Pe,
|
|
2965
|
+
onConnectionStateChange: De,
|
|
2966
|
+
onAgentEvent: ze,
|
|
2967
|
+
onAgentCommand: Ue,
|
|
2968
|
+
onCollect: $e,
|
|
2925
2969
|
controlledSession: F,
|
|
2926
|
-
className:
|
|
2927
|
-
style:
|
|
2970
|
+
className: He,
|
|
2971
|
+
style: je,
|
|
2928
2972
|
zIndex: we = 2147483647
|
|
2929
|
-
} = t,
|
|
2973
|
+
} = t, yt = Wr(be), Oe = Gr(yt, me, Q);
|
|
2930
2974
|
T(() => {
|
|
2931
|
-
|
|
2932
|
-
}, [
|
|
2933
|
-
const Ne = O !== void 0, [
|
|
2934
|
-
var
|
|
2935
|
-
return O ?? ((
|
|
2936
|
-
}),
|
|
2937
|
-
() => (
|
|
2938
|
-
[
|
|
2939
|
-
),
|
|
2975
|
+
Ei(), Ti();
|
|
2976
|
+
}, [yt]);
|
|
2977
|
+
const Ne = O !== void 0, [At, vt] = M(() => {
|
|
2978
|
+
var b;
|
|
2979
|
+
return O ?? ((b = v == null ? void 0 : v[0]) == null ? void 0 : b.id);
|
|
2980
|
+
}), Fe = Ne ? O : At, ue = tt(
|
|
2981
|
+
() => (v == null ? void 0 : v.find((b) => b.id === Fe)) ?? null,
|
|
2982
|
+
[v, Fe]
|
|
2983
|
+
), ot = (ue == null ? void 0 : ue.agentId) ?? i, le = u === "EMBEDDED", pe = Tr(E), [Ve, Ye] = Ir({
|
|
2940
2984
|
value: p,
|
|
2941
2985
|
defaultValue: h,
|
|
2942
2986
|
onChange: P,
|
|
2943
2987
|
persistKey: R,
|
|
2944
2988
|
disablePersistence: le || S
|
|
2945
|
-
}), ge = le ? "expanded" :
|
|
2946
|
-
} :
|
|
2947
|
-
draggable: !le && (
|
|
2989
|
+
}), ge = le ? "expanded" : Ve, _e = le ? () => {
|
|
2990
|
+
} : Ye, bt = q ?? !le, Mt = X ?? !le, It = te || !le && pe, Ae = Or({
|
|
2991
|
+
draggable: !le && (y ?? !pe),
|
|
2948
2992
|
resizable: !le && (w ?? !pe),
|
|
2949
2993
|
persistKey: R,
|
|
2950
2994
|
disablePersistence: le || S
|
|
2951
|
-
}), Me =
|
|
2952
|
-
|
|
2953
|
-
const
|
|
2954
|
-
|
|
2955
|
-
function Ce(
|
|
2956
|
-
const d =
|
|
2957
|
-
return d ? d.includes(
|
|
2995
|
+
}), Me = br(), Se = Lr(), ye = Cr(), xe = kr(), [wt, Ge] = M(!1), [at, st] = M(!1), [_, re] = M(!1), [Vn, Yn] = M(!1), [Tt, Gn] = M(!1), _t = Kr({ baseUrl: o, config: c }), xt = I(_t);
|
|
2996
|
+
xt.current = _t;
|
|
2997
|
+
const Pt = I(ne), Dt = I(nt), zt = I(it), $t = I(gt), Jt = I(rt), Zt = I(ht), Qt = I(mt), Ht = I(Be), Le = I(null);
|
|
2998
|
+
Pt.current = ne, Dt.current = nt, zt.current = it, $t.current = gt, Jt.current = rt, Zt.current = ht, Qt.current = mt, Ht.current = Be;
|
|
2999
|
+
function Ce(b) {
|
|
3000
|
+
const d = Ht.current;
|
|
3001
|
+
return d ? d.includes(b) : !0;
|
|
2958
3002
|
}
|
|
2959
|
-
function ke(
|
|
3003
|
+
function ke(b, d) {
|
|
2960
3004
|
console.warn(
|
|
2961
|
-
`[LiveLayer] Agent command "${
|
|
3005
|
+
`[LiveLayer] Agent command "${b}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2962
3006
|
);
|
|
2963
3007
|
}
|
|
2964
|
-
const
|
|
2965
|
-
(
|
|
2966
|
-
var ie, de, Ee,
|
|
2967
|
-
const d =
|
|
3008
|
+
const ct = C(
|
|
3009
|
+
(b) => {
|
|
3010
|
+
var ie, de, Ee, dt;
|
|
3011
|
+
const d = b;
|
|
2968
3012
|
if (!(!d.type || typeof d.type != "string")) {
|
|
2969
|
-
if (
|
|
3013
|
+
if (ze == null || ze({ eventName: d.type, data: b }), d.type === "navigate") {
|
|
2970
3014
|
if (!Ce("navigate")) {
|
|
2971
3015
|
ke("navigate", "navigate");
|
|
2972
3016
|
return;
|
|
@@ -2978,9 +3022,9 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
2978
3022
|
);
|
|
2979
3023
|
return;
|
|
2980
3024
|
}
|
|
2981
|
-
if (
|
|
3025
|
+
if (xt.current.playPageChange(), Pt.current) {
|
|
2982
3026
|
try {
|
|
2983
|
-
|
|
3027
|
+
Pt.current(A);
|
|
2984
3028
|
} catch (H) {
|
|
2985
3029
|
console.warn(
|
|
2986
3030
|
`[LiveLayer] onNavigate threw for "${A}". Falling back. Error:`,
|
|
@@ -3017,9 +3061,9 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3017
3061
|
const A = typeof d.selector == "string" ? d.selector : null;
|
|
3018
3062
|
if (!A) return;
|
|
3019
3063
|
const H = d.behavior === "instant" ? "instant" : "smooth";
|
|
3020
|
-
if (
|
|
3064
|
+
if (Dt.current) {
|
|
3021
3065
|
try {
|
|
3022
|
-
|
|
3066
|
+
Dt.current(
|
|
3023
3067
|
A,
|
|
3024
3068
|
H
|
|
3025
3069
|
);
|
|
@@ -3060,12 +3104,12 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3060
3104
|
const B = H, ce = B == null ? void 0 : B.localParticipant;
|
|
3061
3105
|
if (ce != null && ce.publishData)
|
|
3062
3106
|
try {
|
|
3063
|
-
const he = A ? { ...Z, requestId: A } : Z,
|
|
3064
|
-
ce.publishData(
|
|
3107
|
+
const he = A ? { ...Z, requestId: A } : Z, Je = new TextEncoder().encode(JSON.stringify(he));
|
|
3108
|
+
ce.publishData(Je, { reliable: !0 });
|
|
3065
3109
|
} catch (he) {
|
|
3066
3110
|
console.warn("[LiveLayer] publishData failed.", he);
|
|
3067
3111
|
}
|
|
3068
|
-
}, j =
|
|
3112
|
+
}, j = Zt.current, J = Jt.current;
|
|
3069
3113
|
try {
|
|
3070
3114
|
if (J) {
|
|
3071
3115
|
const Z = J(j);
|
|
@@ -3076,7 +3120,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3076
3120
|
B
|
|
3077
3121
|
), Y({
|
|
3078
3122
|
type: "page_context",
|
|
3079
|
-
context:
|
|
3123
|
+
context: Mn(j)
|
|
3080
3124
|
});
|
|
3081
3125
|
});
|
|
3082
3126
|
return;
|
|
@@ -3086,7 +3130,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3086
3130
|
}
|
|
3087
3131
|
Y({
|
|
3088
3132
|
type: "page_context",
|
|
3089
|
-
context:
|
|
3133
|
+
context: Mn(j)
|
|
3090
3134
|
});
|
|
3091
3135
|
} catch (Z) {
|
|
3092
3136
|
console.warn(
|
|
@@ -3112,9 +3156,9 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3112
3156
|
return;
|
|
3113
3157
|
}
|
|
3114
3158
|
const H = d.behavior === "instant" ? "instant" : "smooth";
|
|
3115
|
-
if (
|
|
3159
|
+
if (zt.current) {
|
|
3116
3160
|
try {
|
|
3117
|
-
|
|
3161
|
+
zt.current(
|
|
3118
3162
|
A,
|
|
3119
3163
|
H
|
|
3120
3164
|
);
|
|
@@ -3124,12 +3168,12 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3124
3168
|
return;
|
|
3125
3169
|
}
|
|
3126
3170
|
if (typeof window > "u") return;
|
|
3127
|
-
const Y = { behavior: H }, j =
|
|
3171
|
+
const Y = { behavior: H }, j = Ui(), J = (B) => {
|
|
3128
3172
|
j instanceof Window ? j.scrollBy({ top: B, ...Y }) : j.scrollBy({ top: B, ...Y });
|
|
3129
3173
|
}, Z = (B) => {
|
|
3130
3174
|
j instanceof Window ? j.scrollTo({ top: B, ...Y }) : j.scrollTo({ top: B, ...Y });
|
|
3131
3175
|
};
|
|
3132
|
-
A === "up" ? J(-
|
|
3176
|
+
A === "up" ? J(-Tn(j)) : A === "down" ? J(Tn(j)) : Z(A === "top" ? 0 : ji(j));
|
|
3133
3177
|
return;
|
|
3134
3178
|
}
|
|
3135
3179
|
if (d.type === "click") {
|
|
@@ -3142,9 +3186,9 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3142
3186
|
console.warn("[LiveLayer] click: missing selector.");
|
|
3143
3187
|
return;
|
|
3144
3188
|
}
|
|
3145
|
-
if (
|
|
3189
|
+
if ($t.current) {
|
|
3146
3190
|
try {
|
|
3147
|
-
|
|
3191
|
+
$t.current(A);
|
|
3148
3192
|
} catch (Y) {
|
|
3149
3193
|
console.warn("[LiveLayer] onClick threw.", Y);
|
|
3150
3194
|
}
|
|
@@ -3181,13 +3225,13 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3181
3225
|
return;
|
|
3182
3226
|
}
|
|
3183
3227
|
if (typeof document > "u") return;
|
|
3184
|
-
d.type === "fill_form" &&
|
|
3228
|
+
d.type === "fill_form" && xt.current.playConfirmation();
|
|
3185
3229
|
const A = typeof d.formId == "string" ? d.formId : null;
|
|
3186
3230
|
if (!A) {
|
|
3187
3231
|
console.warn(`[LiveLayer] ${d.type}: missing formId.`);
|
|
3188
3232
|
return;
|
|
3189
3233
|
}
|
|
3190
|
-
const H =
|
|
3234
|
+
const H = Rn(document, A);
|
|
3191
3235
|
if (!H) {
|
|
3192
3236
|
console.warn(
|
|
3193
3237
|
`[LiveLayer] ${d.type}: no <form> matched id="${A}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
|
|
@@ -3206,7 +3250,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3206
3250
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
3207
3251
|
return;
|
|
3208
3252
|
}
|
|
3209
|
-
const J =
|
|
3253
|
+
const J = In(H, j);
|
|
3210
3254
|
if (J.el === null) {
|
|
3211
3255
|
J.reason === "private" ? console.warn(
|
|
3212
3256
|
`[LiveLayer] focus_field: field "${j}" is privacy-protected and not focusable.`
|
|
@@ -3225,7 +3269,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3225
3269
|
}
|
|
3226
3270
|
for (const [j, J] of Object.entries(Y)) {
|
|
3227
3271
|
if (typeof J != "string") continue;
|
|
3228
|
-
const Z =
|
|
3272
|
+
const Z = In(H, j);
|
|
3229
3273
|
if (Z.el === null) {
|
|
3230
3274
|
Z.reason === "private" ? console.warn(
|
|
3231
3275
|
`[LiveLayer] fill_form: field "${j}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
@@ -3235,7 +3279,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3235
3279
|
continue;
|
|
3236
3280
|
}
|
|
3237
3281
|
try {
|
|
3238
|
-
|
|
3282
|
+
Oi(Z.el, J);
|
|
3239
3283
|
} catch (B) {
|
|
3240
3284
|
console.warn(
|
|
3241
3285
|
`[LiveLayer] fill_form: failed to set "${j}".`,
|
|
@@ -3256,8 +3300,8 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3256
3300
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
3257
3301
|
return;
|
|
3258
3302
|
}
|
|
3259
|
-
|
|
3260
|
-
const H =
|
|
3303
|
+
xt.current.playConfirmation();
|
|
3304
|
+
const H = Rn(document, A);
|
|
3261
3305
|
if (!H) {
|
|
3262
3306
|
console.warn(
|
|
3263
3307
|
`[LiveLayer] submit_form: no <form> matched id="${A}" (or matching name / data-ll-intent slug).`
|
|
@@ -3271,11 +3315,11 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3271
3315
|
return;
|
|
3272
3316
|
}
|
|
3273
3317
|
const Y = typeof d.requestId == "string" ? d.requestId : void 0, j = (Ee = Le.current) == null ? void 0 : Ee.call(Le), J = (ce) => {
|
|
3274
|
-
const he = j,
|
|
3275
|
-
if (
|
|
3318
|
+
const he = j, Je = he == null ? void 0 : he.localParticipant;
|
|
3319
|
+
if (Je != null && Je.publishData)
|
|
3276
3320
|
try {
|
|
3277
|
-
const
|
|
3278
|
-
|
|
3321
|
+
const sr = Y ? { ...ce, requestId: Y } : ce, cr = new TextEncoder().encode(JSON.stringify(sr));
|
|
3322
|
+
Je.publishData(cr, { reliable: !0 });
|
|
3279
3323
|
} catch {
|
|
3280
3324
|
}
|
|
3281
3325
|
};
|
|
@@ -3308,7 +3352,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3308
3352
|
ke("request_routes", "read_page");
|
|
3309
3353
|
return;
|
|
3310
3354
|
}
|
|
3311
|
-
const A = typeof d.requestId == "string" ? d.requestId : void 0, Y = (
|
|
3355
|
+
const A = typeof d.requestId == "string" ? d.requestId : void 0, Y = (dt = Le.current) == null ? void 0 : dt.call(Le), j = Y == null ? void 0 : Y.localParticipant;
|
|
3312
3356
|
if (!(j != null && j.publishData)) return;
|
|
3313
3357
|
const J = (B) => {
|
|
3314
3358
|
try {
|
|
@@ -3317,7 +3361,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3317
3361
|
} catch (ce) {
|
|
3318
3362
|
console.warn("[LiveLayer] request_routes: publishData failed.", ce);
|
|
3319
3363
|
}
|
|
3320
|
-
}, Z =
|
|
3364
|
+
}, Z = Qt.current;
|
|
3321
3365
|
if (Z) {
|
|
3322
3366
|
try {
|
|
3323
3367
|
const B = Z(), ce = (he) => {
|
|
@@ -3325,24 +3369,24 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3325
3369
|
J([]);
|
|
3326
3370
|
return;
|
|
3327
3371
|
}
|
|
3328
|
-
J(he.map(
|
|
3372
|
+
J(he.map(Ai).slice(0, 200));
|
|
3329
3373
|
};
|
|
3330
3374
|
B instanceof Promise ? B.then(ce).catch((he) => {
|
|
3331
3375
|
console.warn(
|
|
3332
3376
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
3333
3377
|
he
|
|
3334
|
-
), J(
|
|
3378
|
+
), J(qt());
|
|
3335
3379
|
}) : ce(B);
|
|
3336
3380
|
} catch (B) {
|
|
3337
3381
|
console.warn(
|
|
3338
3382
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
3339
3383
|
B
|
|
3340
|
-
), J(
|
|
3384
|
+
), J(qt());
|
|
3341
3385
|
}
|
|
3342
3386
|
return;
|
|
3343
3387
|
}
|
|
3344
3388
|
try {
|
|
3345
|
-
J(
|
|
3389
|
+
J(qt());
|
|
3346
3390
|
} catch (B) {
|
|
3347
3391
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", B);
|
|
3348
3392
|
}
|
|
@@ -3394,7 +3438,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3394
3438
|
} catch {
|
|
3395
3439
|
}
|
|
3396
3440
|
try {
|
|
3397
|
-
|
|
3441
|
+
$e == null || $e(
|
|
3398
3442
|
A
|
|
3399
3443
|
);
|
|
3400
3444
|
} catch (H) {
|
|
@@ -3402,40 +3446,40 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3402
3446
|
}
|
|
3403
3447
|
return;
|
|
3404
3448
|
}
|
|
3405
|
-
|
|
3449
|
+
Vi.has(d.type) || Ue == null || Ue(d);
|
|
3406
3450
|
}
|
|
3407
3451
|
},
|
|
3408
|
-
[
|
|
3409
|
-
), se =
|
|
3410
|
-
agentId: F ? "__controlled__" :
|
|
3411
|
-
baseUrl:
|
|
3452
|
+
[Ue, ze, $e]
|
|
3453
|
+
), se = vr({
|
|
3454
|
+
agentId: F ? "__controlled__" : ot,
|
|
3455
|
+
baseUrl: o,
|
|
3412
3456
|
apiKey: a,
|
|
3413
3457
|
sessionEndpoint: s,
|
|
3414
|
-
sessionBody:
|
|
3415
|
-
onDataMessage: F ? void 0 :
|
|
3458
|
+
sessionBody: l,
|
|
3459
|
+
onDataMessage: F ? void 0 : ct
|
|
3416
3460
|
});
|
|
3417
3461
|
T(() => {
|
|
3418
3462
|
if (F != null && F.subscribeToDataMessages)
|
|
3419
|
-
return F.subscribeToDataMessages(
|
|
3420
|
-
}, [F,
|
|
3421
|
-
var
|
|
3422
|
-
return (
|
|
3463
|
+
return F.subscribeToDataMessages(ct);
|
|
3464
|
+
}, [F, ct]), Le.current = () => {
|
|
3465
|
+
var b;
|
|
3466
|
+
return (b = se.getRoom) == null ? void 0 : b.call(se);
|
|
3423
3467
|
}, T(() => {
|
|
3424
3468
|
var ie;
|
|
3425
3469
|
if (typeof window > "u") return;
|
|
3426
|
-
const
|
|
3427
|
-
if (
|
|
3470
|
+
const b = ((ie = window.location) == null ? void 0 : ie.hostname) || "";
|
|
3471
|
+
if (b === "localhost" || b === "127.0.0.1" || b === "0.0.0.0" || b.endsWith(".local") || b.endsWith(".test"))
|
|
3428
3472
|
return window.__livelayerSimulateCommand = (de) => {
|
|
3429
3473
|
try {
|
|
3430
|
-
|
|
3474
|
+
ct(de);
|
|
3431
3475
|
} catch (Ee) {
|
|
3432
3476
|
console.warn("[LiveLayer] simulate-command threw:", Ee);
|
|
3433
3477
|
}
|
|
3434
3478
|
}, () => {
|
|
3435
3479
|
delete window.__livelayerSimulateCommand;
|
|
3436
3480
|
};
|
|
3437
|
-
}, [
|
|
3438
|
-
const L =
|
|
3481
|
+
}, [ct]);
|
|
3482
|
+
const L = tt(() => F ? {
|
|
3439
3483
|
connectionState: F.connectionState,
|
|
3440
3484
|
agentState: F.agentState,
|
|
3441
3485
|
transcript: F.transcript,
|
|
@@ -3466,27 +3510,27 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3466
3510
|
disconnect: se.disconnect,
|
|
3467
3511
|
getRoom: se.getRoom,
|
|
3468
3512
|
isControlled: !1
|
|
3469
|
-
}, [F, se]),
|
|
3470
|
-
|
|
3471
|
-
const
|
|
3472
|
-
|
|
3513
|
+
}, [F, se]), en = I(L);
|
|
3514
|
+
en.current = L;
|
|
3515
|
+
const tn = I(F);
|
|
3516
|
+
tn.current = F, dr(
|
|
3473
3517
|
n,
|
|
3474
3518
|
() => ({
|
|
3475
|
-
sendData: async (
|
|
3476
|
-
var Ee,
|
|
3477
|
-
const d =
|
|
3519
|
+
sendData: async (b) => {
|
|
3520
|
+
var Ee, dt;
|
|
3521
|
+
const d = tn.current;
|
|
3478
3522
|
if (d != null && d.publishData) {
|
|
3479
3523
|
try {
|
|
3480
|
-
await d.publishData(
|
|
3524
|
+
await d.publishData(b);
|
|
3481
3525
|
} catch (A) {
|
|
3482
3526
|
console.warn("[AvatarWidget] sendData (controlled) failed:", A);
|
|
3483
3527
|
}
|
|
3484
3528
|
return;
|
|
3485
3529
|
}
|
|
3486
|
-
const ie = (
|
|
3530
|
+
const ie = (dt = (Ee = en.current) == null ? void 0 : Ee.getRoom) == null ? void 0 : dt.call(Ee), de = ie == null ? void 0 : ie.localParticipant;
|
|
3487
3531
|
if (de != null && de.publishData)
|
|
3488
3532
|
try {
|
|
3489
|
-
const A = new TextEncoder().encode(JSON.stringify(
|
|
3533
|
+
const A = new TextEncoder().encode(JSON.stringify(b));
|
|
3490
3534
|
await de.publishData(A, { reliable: !0 });
|
|
3491
3535
|
} catch (A) {
|
|
3492
3536
|
console.warn("[AvatarWidget] sendData failed:", A);
|
|
@@ -3495,59 +3539,59 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3495
3539
|
}),
|
|
3496
3540
|
[]
|
|
3497
3541
|
);
|
|
3498
|
-
const
|
|
3542
|
+
const nn = I(null);
|
|
3499
3543
|
T(() => {
|
|
3500
|
-
const
|
|
3501
|
-
if (!(!
|
|
3502
|
-
return d.appendChild(
|
|
3503
|
-
|
|
3544
|
+
const b = L.videoElement, d = nn.current;
|
|
3545
|
+
if (!(!b || !d))
|
|
3546
|
+
return d.appendChild(b), () => {
|
|
3547
|
+
b.parentNode === d && d.removeChild(b);
|
|
3504
3548
|
};
|
|
3505
3549
|
}, [L.videoElement]);
|
|
3506
|
-
const [
|
|
3550
|
+
const [Xe, Lt] = M(!1);
|
|
3507
3551
|
T(() => {
|
|
3508
3552
|
if (!z) {
|
|
3509
|
-
|
|
3553
|
+
Lt(!0);
|
|
3510
3554
|
return;
|
|
3511
3555
|
}
|
|
3512
|
-
L.agentState === "speaking" && !
|
|
3513
|
-
}, [z, L.agentState,
|
|
3556
|
+
L.agentState === "speaking" && !Xe && Lt(!0);
|
|
3557
|
+
}, [z, L.agentState, Xe]), T(() => {
|
|
3514
3558
|
if (!z) return;
|
|
3515
|
-
const
|
|
3516
|
-
(
|
|
3559
|
+
const b = L.connectionState;
|
|
3560
|
+
(b === "disconnected" || b === "idle") && Lt(!1);
|
|
3517
3561
|
}, [z, L.connectionState]), T(() => {
|
|
3518
|
-
if (!z || !L.videoElement ||
|
|
3519
|
-
const
|
|
3520
|
-
return () => clearTimeout(
|
|
3521
|
-
}, [z, L.videoElement,
|
|
3522
|
-
const
|
|
3523
|
-
if (
|
|
3562
|
+
if (!z || !L.videoElement || Xe) return;
|
|
3563
|
+
const b = setTimeout(() => Lt(!0), 5e3);
|
|
3564
|
+
return () => clearTimeout(b);
|
|
3565
|
+
}, [z, L.videoElement, Xe]), T(() => {
|
|
3566
|
+
const b = L.videoElement;
|
|
3567
|
+
if (b) {
|
|
3524
3568
|
if (!z) {
|
|
3525
|
-
|
|
3569
|
+
b.style.filter = "";
|
|
3526
3570
|
return;
|
|
3527
3571
|
}
|
|
3528
|
-
|
|
3572
|
+
b.style.transition = "filter 500ms ease-out", b.style.filter = Xe ? "" : "blur(8px)";
|
|
3529
3573
|
}
|
|
3530
|
-
}, [z, L.videoElement,
|
|
3531
|
-
const
|
|
3532
|
-
if (!
|
|
3574
|
+
}, [z, L.videoElement, Xe]), T(() => {
|
|
3575
|
+
const b = L.audioElement;
|
|
3576
|
+
if (!b) return;
|
|
3533
3577
|
const d = document.createElement("div");
|
|
3534
|
-
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(
|
|
3535
|
-
const ie =
|
|
3578
|
+
d.className = "ll-audio-sink", d.setAttribute("aria-hidden", "true"), d.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", d.appendChild(b), document.body.appendChild(d), Me.attach(b);
|
|
3579
|
+
const ie = b.play();
|
|
3536
3580
|
return ie && typeof ie.catch == "function" && ie.catch((de) => {
|
|
3537
|
-
(de == null ? void 0 : de.name) === "NotAllowedError" &&
|
|
3581
|
+
(de == null ? void 0 : de.name) === "NotAllowedError" && Ge(!0);
|
|
3538
3582
|
}), () => {
|
|
3539
|
-
Me.detach(),
|
|
3583
|
+
Me.detach(), b.parentNode === d && d.removeChild(b), d.parentNode === document.body && document.body.removeChild(d);
|
|
3540
3584
|
};
|
|
3541
3585
|
}, [L.audioElement]);
|
|
3542
|
-
const ve =
|
|
3586
|
+
const ve = _r({
|
|
3543
3587
|
gateUntilAgentReady: !0,
|
|
3544
3588
|
agentState: L.agentState
|
|
3545
3589
|
});
|
|
3546
3590
|
T(() => {
|
|
3547
3591
|
if (L.isControlled || L.connectionState !== "connected") return;
|
|
3548
|
-
const
|
|
3549
|
-
if (
|
|
3550
|
-
return ve.setupMic(
|
|
3592
|
+
const b = L.getRoom();
|
|
3593
|
+
if (b)
|
|
3594
|
+
return ve.setupMic(b).then(() => {
|
|
3551
3595
|
const d = ve.getMicStream();
|
|
3552
3596
|
d && Me.attachStream(d, "mic");
|
|
3553
3597
|
}).catch(() => {
|
|
@@ -3557,17 +3601,17 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3557
3601
|
}, [L.isControlled, L.connectionState]), T(() => {
|
|
3558
3602
|
var d;
|
|
3559
3603
|
if (L.connectionState !== "connected") return;
|
|
3560
|
-
const
|
|
3561
|
-
if (
|
|
3562
|
-
return Se.attachRoom(
|
|
3604
|
+
const b = L.isControlled ? (d = F == null ? void 0 : F.getRoom) == null ? void 0 : d.call(F) : L.getRoom();
|
|
3605
|
+
if (b)
|
|
3606
|
+
return Se.attachRoom(b), ye.attachRoom(b), L.isControlled && ve.attachRoom(b), xe.refresh(), () => {
|
|
3563
3607
|
Se.teardown(), ye.teardown();
|
|
3564
3608
|
};
|
|
3565
3609
|
}, [L.isControlled, L.connectionState, F]), T(() => {
|
|
3566
|
-
const
|
|
3567
|
-
|
|
3568
|
-
}, [L.audioElement,
|
|
3569
|
-
const
|
|
3570
|
-
const d = { type: "user_message", text:
|
|
3610
|
+
const b = L.audioElement;
|
|
3611
|
+
b && (b.muted = Tt);
|
|
3612
|
+
}, [L.audioElement, Tt]);
|
|
3613
|
+
const Xn = C((b) => {
|
|
3614
|
+
const d = { type: "user_message", text: b };
|
|
3571
3615
|
if (F != null && F.publishData) {
|
|
3572
3616
|
try {
|
|
3573
3617
|
F.publishData(d);
|
|
@@ -3582,99 +3626,99 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3582
3626
|
ie.localParticipant.publishData(de, { reliable: !0 });
|
|
3583
3627
|
} catch {
|
|
3584
3628
|
}
|
|
3585
|
-
}, [L, F]),
|
|
3586
|
-
|
|
3629
|
+
}, [L, F]), Kn = C(() => {
|
|
3630
|
+
Gn((b) => !b);
|
|
3587
3631
|
}, []);
|
|
3588
3632
|
T(() => {
|
|
3589
|
-
|
|
3590
|
-
}, [L.connectionState,
|
|
3591
|
-
|
|
3592
|
-
}, [L.transcript,
|
|
3593
|
-
|
|
3594
|
-
}, [L.agentState,
|
|
3595
|
-
|
|
3596
|
-
}, [L.agentState,
|
|
3597
|
-
const
|
|
3633
|
+
De == null || De(L.connectionState), L.connectionState === "connected" ? qe == null || qe() : L.connectionState === "disconnected" && (Re == null || Re());
|
|
3634
|
+
}, [L.connectionState, qe, Re, De]), T(() => {
|
|
3635
|
+
Te == null || Te(L.transcript);
|
|
3636
|
+
}, [L.transcript, Te]), T(() => {
|
|
3637
|
+
Pe == null || Pe(L.agentState);
|
|
3638
|
+
}, [L.agentState, Pe]), T(() => {
|
|
3639
|
+
_t.setThinking(L.agentState === "thinking");
|
|
3640
|
+
}, [L.agentState, _t]);
|
|
3641
|
+
const rn = I(!1);
|
|
3598
3642
|
T(() => {
|
|
3599
|
-
!
|
|
3600
|
-
}, [
|
|
3601
|
-
const
|
|
3602
|
-
(
|
|
3603
|
-
const d =
|
|
3604
|
-
d && (re(!1),
|
|
3643
|
+
!m || rn.current || Oe && L.connectionState === "idle" && (rn.current = !0, L.connect());
|
|
3644
|
+
}, [m, L.connectionState, L, Oe]);
|
|
3645
|
+
const Jn = C(
|
|
3646
|
+
(b) => {
|
|
3647
|
+
const d = v == null ? void 0 : v.find((ie) => ie.id === b);
|
|
3648
|
+
d && (re(!1), b !== Fe && (st(!0), L.disconnect(), Ne || vt(b), g == null || g(d)));
|
|
3605
3649
|
},
|
|
3606
3650
|
[
|
|
3607
|
-
|
|
3608
|
-
|
|
3651
|
+
v,
|
|
3652
|
+
Fe,
|
|
3609
3653
|
L,
|
|
3610
3654
|
Ne,
|
|
3611
|
-
|
|
3655
|
+
g
|
|
3612
3656
|
]
|
|
3613
3657
|
);
|
|
3614
3658
|
T(() => {
|
|
3615
|
-
|
|
3616
|
-
}, [L.connectionState,
|
|
3659
|
+
at && L.connectionState === "connected" && st(!1);
|
|
3660
|
+
}, [L.connectionState, at]), T(() => {
|
|
3617
3661
|
if (!_) return;
|
|
3618
|
-
const
|
|
3662
|
+
const b = (d) => {
|
|
3619
3663
|
d.key === "Escape" && re(!1);
|
|
3620
3664
|
};
|
|
3621
|
-
return window.addEventListener("keydown",
|
|
3665
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3622
3666
|
}, [_]);
|
|
3623
|
-
const
|
|
3624
|
-
|
|
3625
|
-
const
|
|
3667
|
+
const Zn = !!K || !!(ue != null && ue.avatarImageUrl) || L.isControlled, ut = Sr(ot, o, Zn);
|
|
3668
|
+
Be === void 0 && ((sn = ut.info) != null && sn.capabilities) && (Ht.current = ut.info.capabilities);
|
|
3669
|
+
const Ct = (ue == null ? void 0 : ue.name) ?? ae ?? ((cn = L.agentConfig) == null ? void 0 : cn.name) ?? ((un = ut.info) == null ? void 0 : un.name) ?? "Live Layer", Ot = (ue == null ? void 0 : ue.avatarImageUrl) ?? K ?? ((dn = L.agentConfig) == null ? void 0 : dn.avatarImageUrl) ?? ((fn = ut.info) == null ? void 0 : fn.avatarImageUrl) ?? null, Qn = D ?? ((pn = L.agentConfig) == null ? void 0 : pn.idleLoopUrl) ?? ((hn = ut.info) == null ? void 0 : hn.idleLoopUrl) ?? null, er = W ?? null, tr = C(() => _e("expanded"), [_e]), nr = C(
|
|
3626
3670
|
() => _e("minimized"),
|
|
3627
3671
|
[_e]
|
|
3628
|
-
),
|
|
3672
|
+
), on = C(() => {
|
|
3629
3673
|
L.disconnect(), _e("hidden");
|
|
3630
|
-
}, [L, _e]),
|
|
3631
|
-
const
|
|
3632
|
-
|
|
3674
|
+
}, [L, _e]), rr = C(() => {
|
|
3675
|
+
const b = L.audioElement;
|
|
3676
|
+
b && b.play().then(() => Ge(!1)).catch(() => {
|
|
3633
3677
|
});
|
|
3634
|
-
}, [L.audioElement]),
|
|
3635
|
-
|
|
3636
|
-
}, [L]),
|
|
3637
|
-
...
|
|
3678
|
+
}, [L.audioElement]), ir = C(() => {
|
|
3679
|
+
Ge(!1), L.connect();
|
|
3680
|
+
}, [L]), Ke = {
|
|
3681
|
+
...je,
|
|
3638
3682
|
...le ? {} : { zIndex: we }
|
|
3639
3683
|
};
|
|
3640
|
-
$.primaryColor && (
|
|
3641
|
-
const
|
|
3642
|
-
...
|
|
3684
|
+
$.primaryColor && (Ke["--ll-color-primary"] = $.primaryColor), $.accentColor && (Ke["--ll-color-accent"] = $.accentColor), $.backgroundColor && (Ke["--ll-color-bg"] = $.backgroundColor), $.textColor && (Ke["--ll-color-fg"] = $.textColor);
|
|
3685
|
+
const or = {
|
|
3686
|
+
...Ke,
|
|
3643
3687
|
...Ae.style
|
|
3644
|
-
},
|
|
3688
|
+
}, lr = [
|
|
3645
3689
|
"ll-widget",
|
|
3646
3690
|
`ll-widget--${ge}`,
|
|
3647
3691
|
`ll-widget--${pe ? "mobile" : "desktop"}`,
|
|
3648
3692
|
Ae.hasGeometry ? "ll-widget--has-geometry" : null,
|
|
3649
3693
|
Ae.isDragging ? "is-dragging" : null,
|
|
3650
3694
|
Ae.isResizing ? "is-resizing" : null,
|
|
3651
|
-
|
|
3695
|
+
He
|
|
3652
3696
|
].filter(Boolean).join(" ");
|
|
3653
|
-
if (!
|
|
3654
|
-
const
|
|
3697
|
+
if (!Oe) return null;
|
|
3698
|
+
const ar = /* @__PURE__ */ r(
|
|
3655
3699
|
"div",
|
|
3656
3700
|
{
|
|
3657
|
-
className:
|
|
3658
|
-
style:
|
|
3701
|
+
className: lr,
|
|
3702
|
+
style: or,
|
|
3659
3703
|
"data-display-mode": ge,
|
|
3660
3704
|
"data-position": x,
|
|
3661
3705
|
"data-experience-mode": u === "EMBEDDED" ? "embedded" : "widget",
|
|
3662
3706
|
children: ge === "expanded" && /* @__PURE__ */ r(
|
|
3663
|
-
|
|
3707
|
+
pi,
|
|
3664
3708
|
{
|
|
3665
3709
|
position: x,
|
|
3666
3710
|
isMobile: pe,
|
|
3667
|
-
agentName:
|
|
3668
|
-
avatarImageUrl:
|
|
3669
|
-
idleLoopUrl:
|
|
3670
|
-
greeting:
|
|
3711
|
+
agentName: Ct,
|
|
3712
|
+
avatarImageUrl: Ot,
|
|
3713
|
+
idleLoopUrl: Qn,
|
|
3714
|
+
greeting: er,
|
|
3671
3715
|
branding: $,
|
|
3672
|
-
teamMembers:
|
|
3673
|
-
currentTeamMemberId:
|
|
3674
|
-
isSwitchingTeamMember:
|
|
3716
|
+
teamMembers: v,
|
|
3717
|
+
currentTeamMemberId: Fe,
|
|
3718
|
+
isSwitchingTeamMember: at,
|
|
3675
3719
|
teamSwitcherOpen: _,
|
|
3676
|
-
onToggleTeamSwitcher: () => re((
|
|
3677
|
-
onSelectTeamMember:
|
|
3720
|
+
onToggleTeamSwitcher: () => re((b) => !b),
|
|
3721
|
+
onSelectTeamMember: Jn,
|
|
3678
3722
|
connectionState: L.connectionState,
|
|
3679
3723
|
agentState: L.agentState,
|
|
3680
3724
|
transcript: L.transcript,
|
|
@@ -3687,44 +3731,44 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3687
3731
|
activeCameraId: Se.activeDeviceId,
|
|
3688
3732
|
isScreenShareEnabled: ye.isEnabled,
|
|
3689
3733
|
screenPreviewEl: ye.previewEl,
|
|
3690
|
-
isSpeakerMuted:
|
|
3734
|
+
isSpeakerMuted: Tt,
|
|
3691
3735
|
allowCamera: G,
|
|
3692
3736
|
allowScreenShare: f,
|
|
3693
3737
|
allowTyping: N,
|
|
3694
|
-
showMinimize: pe && !le ? !1 :
|
|
3695
|
-
showClose:
|
|
3738
|
+
showMinimize: pe && !le ? !1 : bt,
|
|
3739
|
+
showClose: Mt,
|
|
3696
3740
|
chromeless: ee,
|
|
3697
|
-
compactControls:
|
|
3741
|
+
compactControls: It,
|
|
3698
3742
|
transforming: oe,
|
|
3699
3743
|
transformingLabel: U,
|
|
3700
|
-
languageMenuOpen:
|
|
3701
|
-
onToggleLanguageMenu: () =>
|
|
3702
|
-
needsUserGesture:
|
|
3744
|
+
languageMenuOpen: Vn,
|
|
3745
|
+
onToggleLanguageMenu: () => Yn((b) => !b),
|
|
3746
|
+
needsUserGesture: wt,
|
|
3703
3747
|
canResume: L.canResume,
|
|
3704
3748
|
micError: ve.micError,
|
|
3705
3749
|
error: L.error,
|
|
3706
|
-
avatarVideoContainerRef:
|
|
3750
|
+
avatarVideoContainerRef: nn,
|
|
3707
3751
|
agentVideoEl: L.videoElement,
|
|
3708
3752
|
onConnect: () => void L.connect(),
|
|
3709
3753
|
onDisconnect: () => L.disconnect(),
|
|
3710
|
-
onRetry:
|
|
3711
|
-
onResumeAudio:
|
|
3754
|
+
onRetry: ir,
|
|
3755
|
+
onResumeAudio: rr,
|
|
3712
3756
|
onToggleMute: ve.toggleMute,
|
|
3713
|
-
onSwitchMicDevice: (
|
|
3757
|
+
onSwitchMicDevice: (b) => void ve.switchDevice(b),
|
|
3714
3758
|
onToggleCamera: () => void Se.toggle(),
|
|
3715
|
-
onSwitchCameraDevice: (
|
|
3759
|
+
onSwitchCameraDevice: (b) => void Se.switchDevice(b),
|
|
3716
3760
|
onToggleScreenShare: () => void ye.toggle(),
|
|
3717
|
-
onToggleSpeaker:
|
|
3718
|
-
onSendMessage:
|
|
3719
|
-
onMinimize:
|
|
3720
|
-
onClose:
|
|
3761
|
+
onToggleSpeaker: Kn,
|
|
3762
|
+
onSendMessage: Xn,
|
|
3763
|
+
onMinimize: nr,
|
|
3764
|
+
onClose: on,
|
|
3721
3765
|
onClearMicError: ve.clearError,
|
|
3722
3766
|
dragHandleProps: Ae.dragHandleProps,
|
|
3723
3767
|
resizeHandleProps: Ae.resizeHandleProps
|
|
3724
3768
|
}
|
|
3725
3769
|
)
|
|
3726
3770
|
}
|
|
3727
|
-
),
|
|
3771
|
+
), ln = !le && (ge === "hidden" || ge === "minimized") ? /* @__PURE__ */ k(
|
|
3728
3772
|
"div",
|
|
3729
3773
|
{
|
|
3730
3774
|
className: [
|
|
@@ -3733,131 +3777,131 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
3733
3777
|
`ll-widget--${ge}`,
|
|
3734
3778
|
`ll-widget--${pe ? "mobile" : "desktop"}`
|
|
3735
3779
|
].join(" "),
|
|
3736
|
-
style:
|
|
3780
|
+
style: Ke,
|
|
3737
3781
|
"data-display-mode": ge,
|
|
3738
3782
|
"data-position": x,
|
|
3739
3783
|
children: [
|
|
3740
3784
|
ge === "hidden" && /* @__PURE__ */ r(
|
|
3741
|
-
|
|
3785
|
+
ni,
|
|
3742
3786
|
{
|
|
3743
3787
|
position: x,
|
|
3744
3788
|
isMobile: pe,
|
|
3745
3789
|
isSpeaking: L.agentState === "speaking",
|
|
3746
3790
|
onExpand: () => _e("expanded"),
|
|
3747
|
-
label: `Open ${
|
|
3748
|
-
avatarImageUrl:
|
|
3749
|
-
agentName:
|
|
3791
|
+
label: `Open ${Ct} widget`,
|
|
3792
|
+
avatarImageUrl: Ot,
|
|
3793
|
+
agentName: Ct,
|
|
3750
3794
|
containerEl: V
|
|
3751
3795
|
}
|
|
3752
3796
|
),
|
|
3753
3797
|
ge === "minimized" && /* @__PURE__ */ r(
|
|
3754
|
-
|
|
3798
|
+
ii,
|
|
3755
3799
|
{
|
|
3756
3800
|
position: x,
|
|
3757
3801
|
isMobile: pe,
|
|
3758
|
-
agentName:
|
|
3759
|
-
avatarImageUrl:
|
|
3802
|
+
agentName: Ct,
|
|
3803
|
+
avatarImageUrl: Ot,
|
|
3760
3804
|
agentState: L.agentState,
|
|
3761
3805
|
isMuted: ve.isMuted,
|
|
3762
3806
|
audioLevel: Me,
|
|
3763
|
-
onExpand:
|
|
3807
|
+
onExpand: tr,
|
|
3764
3808
|
onToggleMute: ve.toggleMute,
|
|
3765
|
-
onClose:
|
|
3809
|
+
onClose: on
|
|
3766
3810
|
}
|
|
3767
3811
|
)
|
|
3768
3812
|
]
|
|
3769
3813
|
}
|
|
3770
|
-
) : null,
|
|
3771
|
-
return /* @__PURE__ */ k(
|
|
3772
|
-
|
|
3773
|
-
|
|
3814
|
+
) : null, an = V ?? (typeof document < "u" ? document.body : null);
|
|
3815
|
+
return /* @__PURE__ */ k(We, { children: [
|
|
3816
|
+
ar,
|
|
3817
|
+
ln && an && Xt(ln, an)
|
|
3774
3818
|
] });
|
|
3775
3819
|
}
|
|
3776
3820
|
);
|
|
3777
|
-
|
|
3778
|
-
const
|
|
3821
|
+
jn.displayName = "AvatarWidgetInner";
|
|
3822
|
+
const Yi = Gt(
|
|
3779
3823
|
function(t, n) {
|
|
3780
|
-
return /* @__PURE__ */ r(
|
|
3824
|
+
return /* @__PURE__ */ r(yr, { children: /* @__PURE__ */ r(jn, { ...t, ref: n }) });
|
|
3781
3825
|
}
|
|
3782
3826
|
);
|
|
3783
|
-
|
|
3784
|
-
const
|
|
3827
|
+
Yi.displayName = "AvatarWidget";
|
|
3828
|
+
const io = ({
|
|
3785
3829
|
agentId: e,
|
|
3786
3830
|
baseUrl: t,
|
|
3787
3831
|
apiKey: n,
|
|
3788
3832
|
mode: i,
|
|
3789
3833
|
onAgentEvent: a,
|
|
3790
|
-
className:
|
|
3834
|
+
className: o,
|
|
3791
3835
|
style: s
|
|
3792
3836
|
}) => {
|
|
3793
|
-
const
|
|
3837
|
+
const l = I(null), c = I(null), u = I(a);
|
|
3794
3838
|
u.current = a;
|
|
3795
|
-
const
|
|
3839
|
+
const m = C((p) => {
|
|
3796
3840
|
var P;
|
|
3797
3841
|
const h = p.detail;
|
|
3798
3842
|
(P = u.current) == null || P.call(u, h);
|
|
3799
3843
|
}, []);
|
|
3800
3844
|
return T(() => {
|
|
3801
|
-
const p =
|
|
3845
|
+
const p = l.current;
|
|
3802
3846
|
if (!p) return;
|
|
3803
3847
|
const h = document.createElement("livelayer-widget");
|
|
3804
|
-
return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t), n && h.setAttribute("api-key", n), i && h.setAttribute("mode", i), h.addEventListener("agent-event",
|
|
3805
|
-
h.removeEventListener("agent-event",
|
|
3848
|
+
return h.setAttribute("agent-id", e), t && h.setAttribute("base-url", t), n && h.setAttribute("api-key", n), i && h.setAttribute("mode", i), h.addEventListener("agent-event", m), p.appendChild(h), c.current = h, () => {
|
|
3849
|
+
h.removeEventListener("agent-event", m), p.removeChild(h), c.current = null;
|
|
3806
3850
|
};
|
|
3807
3851
|
}, [e]), T(() => {
|
|
3808
3852
|
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
3809
|
-
}, [i]), /* @__PURE__ */ r("div", { ref:
|
|
3810
|
-
},
|
|
3811
|
-
function({ id: t, intent: n, as: i = "div", className: a, style:
|
|
3812
|
-
return
|
|
3853
|
+
}, [i]), /* @__PURE__ */ r("div", { ref: l, className: o, style: s });
|
|
3854
|
+
}, oo = Gt(
|
|
3855
|
+
function({ id: t, intent: n, as: i = "div", className: a, style: o, children: s }, l) {
|
|
3856
|
+
return fr(
|
|
3813
3857
|
i,
|
|
3814
3858
|
{
|
|
3815
|
-
ref:
|
|
3859
|
+
ref: l,
|
|
3816
3860
|
"data-ll-region": t,
|
|
3817
3861
|
"data-ll-intent": n,
|
|
3818
3862
|
className: a,
|
|
3819
|
-
style:
|
|
3863
|
+
style: o
|
|
3820
3864
|
},
|
|
3821
3865
|
s
|
|
3822
3866
|
);
|
|
3823
3867
|
}
|
|
3824
3868
|
);
|
|
3825
|
-
function
|
|
3826
|
-
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [a,
|
|
3869
|
+
function lo(e = {}) {
|
|
3870
|
+
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [a, o] = M({}), [s, l] = M(!1), [c, u] = M(null), m = I(t), p = I(n), h = I(i);
|
|
3827
3871
|
T(() => {
|
|
3828
|
-
|
|
3872
|
+
m.current = t, p.current = n, h.current = i;
|
|
3829
3873
|
}, [t, n, i]);
|
|
3830
3874
|
const P = C(() => {
|
|
3831
|
-
|
|
3875
|
+
o({}), l(!1);
|
|
3832
3876
|
}, []);
|
|
3833
3877
|
return T(() => {
|
|
3834
3878
|
if (typeof window > "u") return;
|
|
3835
3879
|
const x = (E) => {
|
|
3836
3880
|
var w, R;
|
|
3837
|
-
const
|
|
3838
|
-
if (
|
|
3839
|
-
if (
|
|
3840
|
-
if (h.current !== "all" &&
|
|
3881
|
+
const y = E.detail;
|
|
3882
|
+
if (y) {
|
|
3883
|
+
if (y.phase === "field") {
|
|
3884
|
+
if (h.current !== "all" && y.source !== h.current)
|
|
3841
3885
|
return;
|
|
3842
|
-
|
|
3843
|
-
(S) => S[
|
|
3886
|
+
l(!0), o(
|
|
3887
|
+
(S) => S[y.fieldName] === y.value ? S : { ...S, [y.fieldName]: y.value }
|
|
3844
3888
|
);
|
|
3845
3889
|
try {
|
|
3846
|
-
(w =
|
|
3890
|
+
(w = m.current) == null || w.call(m, y);
|
|
3847
3891
|
} catch (S) {
|
|
3848
3892
|
console.warn("[LiveLayer] useCollect onFieldUpdate threw.", S);
|
|
3849
3893
|
}
|
|
3850
3894
|
return;
|
|
3851
3895
|
}
|
|
3852
|
-
if (
|
|
3853
|
-
const S =
|
|
3896
|
+
if (y.phase === "complete") {
|
|
3897
|
+
const S = y.result;
|
|
3854
3898
|
if (h.current !== "all" && S.source !== h.current)
|
|
3855
3899
|
return;
|
|
3856
|
-
u(S),
|
|
3900
|
+
u(S), l(!1);
|
|
3857
3901
|
try {
|
|
3858
3902
|
(R = p.current) == null || R.call(p, S);
|
|
3859
|
-
} catch (
|
|
3860
|
-
console.warn("[LiveLayer] useCollect onComplete threw.",
|
|
3903
|
+
} catch (v) {
|
|
3904
|
+
console.warn("[LiveLayer] useCollect onComplete threw.", v);
|
|
3861
3905
|
}
|
|
3862
3906
|
}
|
|
3863
3907
|
}
|
|
@@ -3865,17 +3909,17 @@ function no(e = {}) {
|
|
|
3865
3909
|
return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
|
|
3866
3910
|
}, []), { fields: a, isCollecting: s, lastResult: c, reset: P };
|
|
3867
3911
|
}
|
|
3868
|
-
let
|
|
3869
|
-
function
|
|
3912
|
+
let Pn = 1;
|
|
3913
|
+
function ao({
|
|
3870
3914
|
onMount: e,
|
|
3871
3915
|
defaultOpen: t = !1,
|
|
3872
3916
|
storageKey: n = "ll-debug-open"
|
|
3873
3917
|
}) {
|
|
3874
|
-
const [i, a] = M(t), [
|
|
3918
|
+
const [i, a] = M(t), [o, s] = M([]), [l, c] = M(""), [u, m] = M(!1), p = I(/* @__PURE__ */ new Set()), h = I([]), P = I(u);
|
|
3875
3919
|
P.current = u, T(() => {
|
|
3876
3920
|
try {
|
|
3877
|
-
const
|
|
3878
|
-
|
|
3921
|
+
const y = localStorage.getItem(n);
|
|
3922
|
+
y === "1" && a(!0), y === "0" && a(!1);
|
|
3879
3923
|
} catch {
|
|
3880
3924
|
}
|
|
3881
3925
|
}, [n]), T(() => {
|
|
@@ -3884,48 +3928,48 @@ function ro({
|
|
|
3884
3928
|
} catch {
|
|
3885
3929
|
}
|
|
3886
3930
|
}, [i, n]), T(() => {
|
|
3887
|
-
const
|
|
3931
|
+
const y = (w) => {
|
|
3888
3932
|
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), a((R) => !R));
|
|
3889
3933
|
};
|
|
3890
|
-
return window.addEventListener("keydown",
|
|
3934
|
+
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
3891
3935
|
}, []), T(() => {
|
|
3892
|
-
const
|
|
3936
|
+
const y = setInterval(() => {
|
|
3893
3937
|
if (h.current.length === 0 || P.current) return;
|
|
3894
3938
|
const w = h.current.splice(0, h.current.length);
|
|
3895
3939
|
s(
|
|
3896
3940
|
(R) => [...w.reverse(), ...R].slice(0, 200)
|
|
3897
3941
|
);
|
|
3898
3942
|
}, 100);
|
|
3899
|
-
return () => clearInterval(
|
|
3943
|
+
return () => clearInterval(y);
|
|
3900
3944
|
}, []);
|
|
3901
3945
|
const x = I(!1);
|
|
3902
3946
|
if (T(() => {
|
|
3903
|
-
!e || x.current || (x.current = !0, e((
|
|
3947
|
+
!e || x.current || (x.current = !0, e((y) => {
|
|
3904
3948
|
h.current.push({
|
|
3905
|
-
id:
|
|
3949
|
+
id: Pn++,
|
|
3906
3950
|
ts: Date.now(),
|
|
3907
3951
|
kind: "event",
|
|
3908
|
-
type:
|
|
3909
|
-
data:
|
|
3952
|
+
type: y.eventName,
|
|
3953
|
+
data: y.data
|
|
3910
3954
|
});
|
|
3911
3955
|
}));
|
|
3912
3956
|
}, [e]), T(() => {
|
|
3913
|
-
const
|
|
3957
|
+
const y = console.warn, w = console.log, R = (S, v) => function(...O) {
|
|
3914
3958
|
try {
|
|
3915
|
-
const
|
|
3916
|
-
|
|
3917
|
-
id:
|
|
3959
|
+
const g = typeof O[0] == "string" ? O[0] : "";
|
|
3960
|
+
g.startsWith("[LiveLayer]") && h.current.push({
|
|
3961
|
+
id: Pn++,
|
|
3918
3962
|
ts: Date.now(),
|
|
3919
3963
|
kind: S,
|
|
3920
|
-
type:
|
|
3921
|
-
data: { args: O.slice(1).map((D) =>
|
|
3964
|
+
type: g.slice(0, 120),
|
|
3965
|
+
data: { args: O.slice(1).map((D) => Xi(D)) }
|
|
3922
3966
|
});
|
|
3923
3967
|
} catch {
|
|
3924
3968
|
}
|
|
3925
|
-
return
|
|
3969
|
+
return v.apply(this, O);
|
|
3926
3970
|
};
|
|
3927
|
-
return console.warn = R("warn",
|
|
3928
|
-
console.warn =
|
|
3971
|
+
return console.warn = R("warn", y), console.log = R("log", w), () => {
|
|
3972
|
+
console.warn = y, console.log = w;
|
|
3929
3973
|
};
|
|
3930
3974
|
}, []), !i)
|
|
3931
3975
|
return /* @__PURE__ */ r(
|
|
@@ -3954,10 +3998,10 @@ function ro({
|
|
|
3954
3998
|
children: "🛰 LL debug"
|
|
3955
3999
|
}
|
|
3956
4000
|
);
|
|
3957
|
-
const E =
|
|
3958
|
-
if (!
|
|
3959
|
-
const w =
|
|
3960
|
-
return
|
|
4001
|
+
const E = o.filter((y) => {
|
|
4002
|
+
if (!l) return !0;
|
|
4003
|
+
const w = l.toLowerCase();
|
|
4004
|
+
return y.type.toLowerCase().includes(w) || JSON.stringify(y.data || {}).toLowerCase().includes(w);
|
|
3961
4005
|
});
|
|
3962
4006
|
return /* @__PURE__ */ k(
|
|
3963
4007
|
"div",
|
|
@@ -3995,17 +4039,17 @@ function ro({
|
|
|
3995
4039
|
children: [
|
|
3996
4040
|
/* @__PURE__ */ r("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
3997
4041
|
/* @__PURE__ */ k("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
3998
|
-
|
|
4042
|
+
o.length,
|
|
3999
4043
|
" event",
|
|
4000
|
-
|
|
4044
|
+
o.length === 1 ? "" : "s"
|
|
4001
4045
|
] }),
|
|
4002
4046
|
/* @__PURE__ */ r("span", { style: { flex: 1 } }),
|
|
4003
4047
|
/* @__PURE__ */ r(
|
|
4004
4048
|
"button",
|
|
4005
4049
|
{
|
|
4006
4050
|
type: "button",
|
|
4007
|
-
onClick: () =>
|
|
4008
|
-
style:
|
|
4051
|
+
onClick: () => m((y) => !y),
|
|
4052
|
+
style: jt(u ? "#f59e0b" : "transparent"),
|
|
4009
4053
|
title: "Pause / resume capture",
|
|
4010
4054
|
children: u ? "▶ resume" : "⏸ pause"
|
|
4011
4055
|
}
|
|
@@ -4017,7 +4061,7 @@ function ro({
|
|
|
4017
4061
|
onClick: () => {
|
|
4018
4062
|
s([]), h.current = [];
|
|
4019
4063
|
},
|
|
4020
|
-
style:
|
|
4064
|
+
style: jt("transparent"),
|
|
4021
4065
|
title: "Clear buffer",
|
|
4022
4066
|
children: "clear"
|
|
4023
4067
|
}
|
|
@@ -4027,7 +4071,7 @@ function ro({
|
|
|
4027
4071
|
{
|
|
4028
4072
|
type: "button",
|
|
4029
4073
|
onClick: () => a(!1),
|
|
4030
|
-
style:
|
|
4074
|
+
style: jt("transparent"),
|
|
4031
4075
|
"aria-label": "Close",
|
|
4032
4076
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
4033
4077
|
children: "✕"
|
|
@@ -4040,8 +4084,8 @@ function ro({
|
|
|
4040
4084
|
"input",
|
|
4041
4085
|
{
|
|
4042
4086
|
type: "text",
|
|
4043
|
-
value:
|
|
4044
|
-
onChange: (
|
|
4087
|
+
value: l,
|
|
4088
|
+
onChange: (y) => c(y.target.value),
|
|
4045
4089
|
placeholder: "filter by type or data…",
|
|
4046
4090
|
style: {
|
|
4047
4091
|
margin: 8,
|
|
@@ -4093,16 +4137,16 @@ function ro({
|
|
|
4093
4137
|
)
|
|
4094
4138
|
]
|
|
4095
4139
|
}
|
|
4096
|
-
) : E.map((
|
|
4097
|
-
|
|
4140
|
+
) : E.map((y) => /* @__PURE__ */ r(
|
|
4141
|
+
Gi,
|
|
4098
4142
|
{
|
|
4099
|
-
entry:
|
|
4100
|
-
expanded: p.current.has(
|
|
4143
|
+
entry: y,
|
|
4144
|
+
expanded: p.current.has(y.id),
|
|
4101
4145
|
onToggle: () => {
|
|
4102
|
-
p.current.has(
|
|
4146
|
+
p.current.has(y.id) ? p.current.delete(y.id) : p.current.add(y.id), s((w) => [...w]);
|
|
4103
4147
|
}
|
|
4104
4148
|
},
|
|
4105
|
-
|
|
4149
|
+
y.id
|
|
4106
4150
|
))
|
|
4107
4151
|
}
|
|
4108
4152
|
)
|
|
@@ -4110,7 +4154,7 @@ function ro({
|
|
|
4110
4154
|
}
|
|
4111
4155
|
);
|
|
4112
4156
|
}
|
|
4113
|
-
function
|
|
4157
|
+
function Gi({
|
|
4114
4158
|
entry: e,
|
|
4115
4159
|
expanded: t,
|
|
4116
4160
|
onToggle: n
|
|
@@ -4180,7 +4224,7 @@ function Ui({
|
|
|
4180
4224
|
}
|
|
4181
4225
|
);
|
|
4182
4226
|
}
|
|
4183
|
-
function
|
|
4227
|
+
function jt(e) {
|
|
4184
4228
|
return {
|
|
4185
4229
|
background: e,
|
|
4186
4230
|
color: "#fff",
|
|
@@ -4191,29 +4235,29 @@ function qt(e) {
|
|
|
4191
4235
|
cursor: "pointer"
|
|
4192
4236
|
};
|
|
4193
4237
|
}
|
|
4194
|
-
function
|
|
4238
|
+
function Xi(e) {
|
|
4195
4239
|
try {
|
|
4196
4240
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
4197
4241
|
} catch {
|
|
4198
4242
|
return String(e);
|
|
4199
4243
|
}
|
|
4200
4244
|
}
|
|
4201
|
-
function
|
|
4245
|
+
function Ki(e) {
|
|
4202
4246
|
const t = JSON.stringify(e);
|
|
4203
|
-
T(() =>
|
|
4247
|
+
T(() => hr(e), [t]);
|
|
4204
4248
|
}
|
|
4205
|
-
function
|
|
4206
|
-
return
|
|
4249
|
+
function so({ fields: e, children: t }) {
|
|
4250
|
+
return Ki(e), /* @__PURE__ */ r(We, { children: t });
|
|
4207
4251
|
}
|
|
4208
|
-
function
|
|
4252
|
+
function co() {
|
|
4209
4253
|
const [e, t] = M([]), n = C((a) => {
|
|
4210
|
-
t((
|
|
4211
|
-
const s =
|
|
4254
|
+
t((o) => {
|
|
4255
|
+
const s = o.findIndex((l) => l.id === a.id);
|
|
4212
4256
|
if (s >= 0) {
|
|
4213
|
-
const
|
|
4214
|
-
return
|
|
4257
|
+
const l = o.slice();
|
|
4258
|
+
return l[s] = a, l;
|
|
4215
4259
|
}
|
|
4216
|
-
return [...
|
|
4260
|
+
return [...o, a];
|
|
4217
4261
|
});
|
|
4218
4262
|
}, []), i = C(() => t([]), []);
|
|
4219
4263
|
return {
|
|
@@ -4224,38 +4268,38 @@ function oo() {
|
|
|
4224
4268
|
};
|
|
4225
4269
|
}
|
|
4226
4270
|
export {
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4271
|
+
Yi as AvatarWidget,
|
|
4272
|
+
yr as ErrorBoundary,
|
|
4273
|
+
so as FieldProvider,
|
|
4274
|
+
ao as LiveLayerDebugPanel,
|
|
4275
|
+
oo as LiveLayerRegion,
|
|
4276
|
+
io as LiveLayerWidget,
|
|
4277
|
+
po as clearFieldRegistry,
|
|
4278
|
+
Ei as clearPageContextCache,
|
|
4279
|
+
Ti as clearRoutesCache,
|
|
4280
|
+
ki as extractPageContext,
|
|
4281
|
+
Ii as extractRoutes,
|
|
4282
|
+
Mn as getCachedPageContext,
|
|
4283
|
+
qt as getCachedRoutes,
|
|
4284
|
+
ho as getRegisteredFields,
|
|
4285
|
+
Vr as matchesPattern,
|
|
4286
|
+
Ai as normalizeRouteInput,
|
|
4287
|
+
mo as registerFields,
|
|
4288
|
+
go as setFieldValue,
|
|
4289
|
+
Yr as shouldRenderAtPath,
|
|
4290
|
+
Sr as useAgentInfo,
|
|
4291
|
+
br as useAudioLevel,
|
|
4292
|
+
Lr as useCameraState,
|
|
4293
|
+
lo as useCollect,
|
|
4294
|
+
Nr as useDisplayMode,
|
|
4295
|
+
Ir as useDisplayModePersistence,
|
|
4296
|
+
Tr as useIsMobile,
|
|
4297
|
+
vr as useLiveKitSession,
|
|
4298
|
+
kr as useMediaDevices,
|
|
4299
|
+
_r as useMicrophoneState,
|
|
4300
|
+
Wr as usePathname,
|
|
4301
|
+
Ki as useRegisterFields,
|
|
4302
|
+
Gr as useRouteMatch,
|
|
4303
|
+
Cr as useScreenShareState,
|
|
4304
|
+
co as useTranscript
|
|
4261
4305
|
};
|