@livelayer/react 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +30 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +1146 -1106
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as w, jsx as n, Fragment as $e } from "react/jsx-runtime";
|
|
3
|
-
import { Component as Vn, useState as
|
|
3
|
+
import { Component as Vn, useState as S, useRef as A, useEffect as T, useCallback as C, useMemo as Xe, useLayoutEffect as xn, forwardRef as Dt, useImperativeHandle as Yn, createElement as Gn } from "react";
|
|
4
4
|
import { createPortal as Pt } from "react-dom";
|
|
5
5
|
import { LiveKitSession as Kn, registerFields as Jn } from "@livelayer/sdk";
|
|
6
|
-
import { clearFieldRegistry as
|
|
6
|
+
import { clearFieldRegistry as zi, getRegisteredFields as Hi, registerFields as Oi, setFieldValue as Bi } from "@livelayer/sdk";
|
|
7
7
|
import { createLocalAudioTrack as Xn, Track as kn, createLocalVideoTrack as Qn } from "livekit-client";
|
|
8
8
|
class Zn extends Vn {
|
|
9
9
|
constructor() {
|
|
@@ -15,8 +15,8 @@ class Zn extends Vn {
|
|
|
15
15
|
return { hasError: !0, error: t };
|
|
16
16
|
}
|
|
17
17
|
componentDidCatch(t, r) {
|
|
18
|
-
var
|
|
19
|
-
(
|
|
18
|
+
var i, a;
|
|
19
|
+
(a = (i = this.props).onError) == null || a.call(i, t, r);
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
var t;
|
|
@@ -36,22 +36,22 @@ class Zn extends Vn {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function er(e) {
|
|
39
|
-
const [t, r] =
|
|
40
|
-
|
|
39
|
+
const [t, r] = S("idle"), [i, a] = S("idle"), [o, s] = S([]), [l, c] = S(null), [p, v] = S(null), [f, d] = S(null), [R, L] = S(!1), [_, h] = S(null), b = A(null), N = A(e.onDataMessage);
|
|
40
|
+
N.current = e.onDataMessage, T(() => {
|
|
41
41
|
const g = {
|
|
42
|
-
onConnectionStateChange: (
|
|
43
|
-
r(
|
|
42
|
+
onConnectionStateChange: (O) => {
|
|
43
|
+
r(O), O === "connected" && h(null);
|
|
44
44
|
},
|
|
45
|
-
onAgentStateChange:
|
|
46
|
-
onTranscript: (
|
|
45
|
+
onAgentStateChange: a,
|
|
46
|
+
onTranscript: (O) => s([...O]),
|
|
47
47
|
onAgentConfig: c,
|
|
48
|
-
onAudioTrack: (
|
|
49
|
-
onVideoTrack: (
|
|
48
|
+
onAudioTrack: (O) => d(O),
|
|
49
|
+
onVideoTrack: (O) => v(O),
|
|
50
50
|
onVideoTrackRemoved: () => v(null),
|
|
51
|
-
onError: (
|
|
52
|
-
onDataMessage: (
|
|
53
|
-
var
|
|
54
|
-
(
|
|
51
|
+
onError: (O) => h(O),
|
|
52
|
+
onDataMessage: (O) => {
|
|
53
|
+
var q;
|
|
54
|
+
(q = N.current) == null || q.call(N, O);
|
|
55
55
|
},
|
|
56
56
|
onResumabilityChange: L
|
|
57
57
|
}, P = new Kn(
|
|
@@ -64,9 +64,9 @@ function er(e) {
|
|
|
64
64
|
},
|
|
65
65
|
g
|
|
66
66
|
);
|
|
67
|
-
return b.current = P, r("idle"),
|
|
68
|
-
var
|
|
69
|
-
(
|
|
67
|
+
return b.current = P, r("idle"), a("idle"), s([]), c(null), v(null), d(null), L(!1), h(null), () => {
|
|
68
|
+
var O;
|
|
69
|
+
(O = P.destroy) == null || O.call(P), b.current = null;
|
|
70
70
|
};
|
|
71
71
|
}, [
|
|
72
72
|
e.agentId,
|
|
@@ -75,7 +75,7 @@ function er(e) {
|
|
|
75
75
|
e.sessionEndpoint,
|
|
76
76
|
JSON.stringify(e.sessionBody ?? {})
|
|
77
77
|
]);
|
|
78
|
-
const
|
|
78
|
+
const M = C(async () => {
|
|
79
79
|
const g = b.current;
|
|
80
80
|
if (g)
|
|
81
81
|
try {
|
|
@@ -83,57 +83,57 @@ function er(e) {
|
|
|
83
83
|
} catch (P) {
|
|
84
84
|
throw h(P instanceof Error ? P.message : String(P)), P;
|
|
85
85
|
}
|
|
86
|
-
}, []),
|
|
86
|
+
}, []), I = C(() => {
|
|
87
87
|
const g = b.current;
|
|
88
88
|
g && g.disconnect();
|
|
89
|
-
}, []),
|
|
89
|
+
}, []), U = C(() => {
|
|
90
90
|
var g;
|
|
91
91
|
return ((g = b.current) == null ? void 0 : g.getRoom()) ?? null;
|
|
92
92
|
}, []);
|
|
93
93
|
return {
|
|
94
94
|
connectionState: t,
|
|
95
|
-
agentState:
|
|
96
|
-
transcript:
|
|
97
|
-
agentConfig:
|
|
95
|
+
agentState: i,
|
|
96
|
+
transcript: o,
|
|
97
|
+
agentConfig: l,
|
|
98
98
|
videoElement: p,
|
|
99
99
|
audioElement: f,
|
|
100
|
-
canResume:
|
|
100
|
+
canResume: R,
|
|
101
101
|
error: _,
|
|
102
|
-
connect:
|
|
103
|
-
disconnect:
|
|
104
|
-
getRoom:
|
|
102
|
+
connect: M,
|
|
103
|
+
disconnect: I,
|
|
104
|
+
getRoom: U,
|
|
105
105
|
session: b.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
function tr() {
|
|
109
|
-
const e =
|
|
109
|
+
const e = A(null), t = A(null), r = A(null), i = A(null), a = A(/* @__PURE__ */ new Set()), o = A(null), s = C(() => {
|
|
110
110
|
const f = t.current;
|
|
111
111
|
if (!f) {
|
|
112
|
-
|
|
112
|
+
i.current = null;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
(!
|
|
115
|
+
(!o.current || o.current.length !== f.frequencyBinCount) && (o.current = new Uint8Array(
|
|
116
116
|
new ArrayBuffer(f.frequencyBinCount)
|
|
117
117
|
));
|
|
118
|
-
const
|
|
119
|
-
f.getByteFrequencyData(
|
|
120
|
-
let
|
|
121
|
-
for (let _ = 0; _ <
|
|
122
|
-
const L =
|
|
123
|
-
for (const _ of
|
|
118
|
+
const d = o.current;
|
|
119
|
+
f.getByteFrequencyData(d);
|
|
120
|
+
let R = 0;
|
|
121
|
+
for (let _ = 0; _ < d.length; _++) R += d[_];
|
|
122
|
+
const L = R / d.length / 255;
|
|
123
|
+
for (const _ of a.current)
|
|
124
124
|
try {
|
|
125
125
|
_(L);
|
|
126
126
|
} catch (h) {
|
|
127
127
|
console.error("[useAudioLevel] subscriber threw:", h);
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
}, []),
|
|
129
|
+
i.current = requestAnimationFrame(s);
|
|
130
|
+
}, []), l = C(() => {
|
|
131
131
|
if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
|
|
132
|
-
const f = new AudioContext(),
|
|
133
|
-
|
|
132
|
+
const f = new AudioContext(), d = f.createAnalyser();
|
|
133
|
+
d.fftSize = 64, d.connect(f.destination), e.current = f, t.current = d;
|
|
134
134
|
}, []), c = C(
|
|
135
135
|
(f) => {
|
|
136
|
-
if (
|
|
136
|
+
if (l(), !(!e.current || !t.current)) {
|
|
137
137
|
if (r.current) {
|
|
138
138
|
try {
|
|
139
139
|
r.current.disconnect();
|
|
@@ -142,28 +142,28 @@ function tr() {
|
|
|
142
142
|
r.current = null;
|
|
143
143
|
}
|
|
144
144
|
try {
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
} catch (
|
|
148
|
-
console.warn("[useAudioLevel] createMediaElementSource failed:",
|
|
145
|
+
const d = e.current.createMediaElementSource(f);
|
|
146
|
+
d.connect(t.current), r.current = d;
|
|
147
|
+
} catch (d) {
|
|
148
|
+
console.warn("[useAudioLevel] createMediaElementSource failed:", d);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
i.current === null && (i.current = requestAnimationFrame(s));
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
|
-
[
|
|
154
|
+
[l, s]
|
|
155
155
|
), p = C(() => {
|
|
156
|
-
if (
|
|
156
|
+
if (i.current !== null && (cancelAnimationFrame(i.current), i.current = null), r.current) {
|
|
157
157
|
try {
|
|
158
158
|
r.current.disconnect();
|
|
159
159
|
} catch {
|
|
160
160
|
}
|
|
161
161
|
r.current = null;
|
|
162
162
|
}
|
|
163
|
-
}, []), v = C((f) => (
|
|
164
|
-
|
|
163
|
+
}, []), v = C((f) => (a.current.add(f), () => {
|
|
164
|
+
a.current.delete(f);
|
|
165
165
|
}), []);
|
|
166
|
-
return
|
|
166
|
+
return T(() => () => {
|
|
167
167
|
if (p(), t.current) {
|
|
168
168
|
try {
|
|
169
169
|
t.current.disconnect();
|
|
@@ -178,52 +178,52 @@ function tr() {
|
|
|
178
178
|
}
|
|
179
179
|
e.current = null;
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
a.current.clear(), o.current = null;
|
|
182
182
|
}, [p]), { attach: c, detach: p, subscribe: v };
|
|
183
183
|
}
|
|
184
184
|
function nr() {
|
|
185
|
-
const [e, t] =
|
|
185
|
+
const [e, t] = S(!1), [r, i] = S(""), [a, o] = S(null), s = A(null), l = A(null), c = C(async (L) => {
|
|
186
186
|
var _, h;
|
|
187
|
-
if (s.current &&
|
|
187
|
+
if (s.current && l.current) {
|
|
188
188
|
try {
|
|
189
|
-
await
|
|
189
|
+
await l.current.localParticipant.unpublishTrack(s.current);
|
|
190
190
|
} catch {
|
|
191
191
|
}
|
|
192
192
|
s.current.stop(), s.current = null;
|
|
193
193
|
}
|
|
194
|
-
|
|
194
|
+
l.current = L, o(null);
|
|
195
195
|
try {
|
|
196
196
|
const b = await Xn({
|
|
197
197
|
echoCancellation: !0,
|
|
198
198
|
noiseSuppression: !0
|
|
199
199
|
});
|
|
200
200
|
await L.localParticipant.publishTrack(b), s.current = b, t(b.isMuted);
|
|
201
|
-
const
|
|
202
|
-
|
|
201
|
+
const N = (h = (_ = b.mediaStreamTrack) == null ? void 0 : _.getSettings) == null ? void 0 : h.call(_);
|
|
202
|
+
N != null && N.deviceId && i(N.deviceId);
|
|
203
203
|
} catch (b) {
|
|
204
|
-
const
|
|
205
|
-
throw
|
|
204
|
+
const N = b instanceof Error && b.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
205
|
+
throw o(N), b;
|
|
206
206
|
}
|
|
207
207
|
}, []), p = C((L) => {
|
|
208
|
-
|
|
208
|
+
l.current = L;
|
|
209
209
|
}, []), v = C(async (L) => {
|
|
210
|
-
const _ =
|
|
210
|
+
const _ = l.current;
|
|
211
211
|
if (_)
|
|
212
212
|
try {
|
|
213
|
-
await _.switchActiveDevice("audioinput", L),
|
|
213
|
+
await _.switchActiveDevice("audioinput", L), i(L);
|
|
214
214
|
} catch (h) {
|
|
215
215
|
console.warn("[useMicrophoneState] switchDevice failed:", h);
|
|
216
216
|
}
|
|
217
217
|
}, []), f = C(async () => {
|
|
218
|
-
const L =
|
|
218
|
+
const L = l.current, _ = !e;
|
|
219
219
|
if (t(_), !!L)
|
|
220
220
|
try {
|
|
221
221
|
await L.localParticipant.setMicrophoneEnabled(!_);
|
|
222
222
|
} catch (h) {
|
|
223
223
|
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", h), t(!_);
|
|
224
224
|
}
|
|
225
|
-
}, [e]),
|
|
226
|
-
const L = s.current, _ =
|
|
225
|
+
}, [e]), d = C(() => {
|
|
226
|
+
const L = s.current, _ = l.current;
|
|
227
227
|
if (L && _) {
|
|
228
228
|
try {
|
|
229
229
|
_.localParticipant.unpublishTrack(L);
|
|
@@ -231,108 +231,108 @@ function nr() {
|
|
|
231
231
|
}
|
|
232
232
|
L.stop();
|
|
233
233
|
}
|
|
234
|
-
s.current = null,
|
|
235
|
-
}, []),
|
|
234
|
+
s.current = null, l.current = null, t(!1), i("");
|
|
235
|
+
}, []), R = C(() => o(null), []);
|
|
236
236
|
return {
|
|
237
237
|
isMuted: e,
|
|
238
238
|
activeDeviceId: r,
|
|
239
|
-
micError:
|
|
239
|
+
micError: a,
|
|
240
240
|
toggleMute: f,
|
|
241
241
|
setupMic: c,
|
|
242
242
|
attachRoom: p,
|
|
243
243
|
switchDevice: v,
|
|
244
|
-
teardownMic:
|
|
245
|
-
clearError:
|
|
244
|
+
teardownMic: d,
|
|
245
|
+
clearError: R
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
const rr = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
249
|
-
function
|
|
250
|
-
const [e, t] =
|
|
249
|
+
function ir() {
|
|
250
|
+
const [e, t] = S(!1), [r, i] = S(null), [a, o] = S(null), [s, l] = S(""), c = A(null), p = A(null), v = C((b) => {
|
|
251
251
|
c.current = b;
|
|
252
252
|
}, []), f = C(() => {
|
|
253
|
-
var
|
|
254
|
-
const b = c.current,
|
|
255
|
-
if (
|
|
256
|
-
const
|
|
253
|
+
var M;
|
|
254
|
+
const b = c.current, N = p.current;
|
|
255
|
+
if (N && b) {
|
|
256
|
+
const I = b.localParticipant.getTrackPublication(kn.Source.Camera), g = (I == null ? void 0 : I.track) ?? N;
|
|
257
257
|
try {
|
|
258
258
|
b.localParticipant.unpublishTrack(g);
|
|
259
259
|
} catch {
|
|
260
260
|
}
|
|
261
261
|
try {
|
|
262
|
-
(
|
|
262
|
+
(M = g.stop) == null || M.call(g);
|
|
263
263
|
} catch {
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
p.current = null,
|
|
267
|
-
}, []),
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
270
|
-
|
|
266
|
+
p.current = null, o(null), t(!1);
|
|
267
|
+
}, []), d = C(async (b) => {
|
|
268
|
+
const N = c.current;
|
|
269
|
+
if (N) {
|
|
270
|
+
i(null);
|
|
271
271
|
try {
|
|
272
|
-
const
|
|
273
|
-
b && (
|
|
274
|
-
const
|
|
275
|
-
await
|
|
276
|
-
const
|
|
277
|
-
|
|
272
|
+
const M = { ...rr };
|
|
273
|
+
b && (M.deviceId = b);
|
|
274
|
+
const I = await Qn(M);
|
|
275
|
+
await N.localParticipant.publishTrack(I), p.current = I;
|
|
276
|
+
const U = I.attach();
|
|
277
|
+
o(U), t(!0), b && l(b);
|
|
278
278
|
try {
|
|
279
|
-
|
|
279
|
+
N.localParticipant.publishData(
|
|
280
280
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
281
281
|
{ reliable: !0 }
|
|
282
282
|
);
|
|
283
283
|
} catch {
|
|
284
284
|
}
|
|
285
|
-
} catch (
|
|
286
|
-
const
|
|
287
|
-
|
|
285
|
+
} catch (M) {
|
|
286
|
+
const I = M instanceof Error && M.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
287
|
+
i(I);
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
}, []),
|
|
291
|
-
e ? f() : await
|
|
292
|
-
}, [e, s, f,
|
|
293
|
-
f(), await
|
|
294
|
-
}, [f,
|
|
295
|
-
f(), c.current = null,
|
|
296
|
-
}, [f]), h = C(() =>
|
|
297
|
-
return
|
|
290
|
+
}, []), R = C(async () => {
|
|
291
|
+
e ? f() : await d(s || void 0);
|
|
292
|
+
}, [e, s, f, d]), L = C(async (b) => {
|
|
293
|
+
f(), await d(b);
|
|
294
|
+
}, [f, d]), _ = C(() => {
|
|
295
|
+
f(), c.current = null, i(null), l("");
|
|
296
|
+
}, [f]), h = C(() => i(null), []);
|
|
297
|
+
return T(() => () => {
|
|
298
298
|
p.current && p.current.stop();
|
|
299
299
|
}, []), {
|
|
300
300
|
isEnabled: e,
|
|
301
301
|
error: r,
|
|
302
|
-
previewEl:
|
|
302
|
+
previewEl: a,
|
|
303
303
|
activeDeviceId: s,
|
|
304
|
-
toggle:
|
|
304
|
+
toggle: R,
|
|
305
305
|
switchDevice: L,
|
|
306
306
|
attachRoom: v,
|
|
307
307
|
teardown: _,
|
|
308
308
|
clearError: h
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const [e, t] =
|
|
313
|
-
s.current =
|
|
314
|
-
}, []), c = C(() =>
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
311
|
+
function or() {
|
|
312
|
+
const [e, t] = S(!1), [r, i] = S(null), [a, o] = S(null), s = A(null), l = C((d) => {
|
|
313
|
+
s.current = d;
|
|
314
|
+
}, []), c = C(() => o(null), []), p = C(async () => {
|
|
315
|
+
const d = s.current;
|
|
316
|
+
if (d) {
|
|
317
317
|
if (e) {
|
|
318
318
|
try {
|
|
319
|
-
await
|
|
319
|
+
await d.localParticipant.setScreenShareEnabled(!1);
|
|
320
320
|
} catch {
|
|
321
321
|
}
|
|
322
322
|
c(), t(!1);
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
i(null);
|
|
326
326
|
try {
|
|
327
|
-
await
|
|
328
|
-
let
|
|
327
|
+
await d.localParticipant.setScreenShareEnabled(!0);
|
|
328
|
+
let R = 0;
|
|
329
329
|
const L = () => {
|
|
330
|
-
const _ =
|
|
330
|
+
const _ = d.localParticipant.getTrackPublication(kn.Source.ScreenShare);
|
|
331
331
|
if (_ != null && _.track) {
|
|
332
332
|
const h = _.track.attach();
|
|
333
|
-
|
|
333
|
+
o(h), t(!0);
|
|
334
334
|
try {
|
|
335
|
-
|
|
335
|
+
d.localParticipant.publishData(
|
|
336
336
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
337
337
|
{ reliable: !0 }
|
|
338
338
|
);
|
|
@@ -340,43 +340,43 @@ function ir() {
|
|
|
340
340
|
}
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
R++ < 10 ? setTimeout(L, 100) : t(!0);
|
|
344
344
|
};
|
|
345
345
|
L();
|
|
346
|
-
} catch (
|
|
347
|
-
const L =
|
|
348
|
-
L !== "NotAllowedError" && L !== "AbortError" &&
|
|
346
|
+
} catch (R) {
|
|
347
|
+
const L = R instanceof Error ? R.name : "";
|
|
348
|
+
L !== "NotAllowedError" && L !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
}, [e, c]), v = C(() => {
|
|
352
|
-
const
|
|
353
|
-
if (
|
|
352
|
+
const d = s.current;
|
|
353
|
+
if (d && e)
|
|
354
354
|
try {
|
|
355
|
-
|
|
355
|
+
d.localParticipant.setScreenShareEnabled(!1);
|
|
356
356
|
} catch {
|
|
357
357
|
}
|
|
358
|
-
c(), t(!1),
|
|
359
|
-
}, [e, c]), f = C(() =>
|
|
360
|
-
return { isEnabled: e, error: r, previewEl:
|
|
358
|
+
c(), t(!1), i(null), s.current = null;
|
|
359
|
+
}, [e, c]), f = C(() => i(null), []);
|
|
360
|
+
return { isEnabled: e, error: r, previewEl: a, toggle: p, attachRoom: l, teardown: v, clearError: f };
|
|
361
361
|
}
|
|
362
362
|
function lr() {
|
|
363
|
-
const [e, t] =
|
|
363
|
+
const [e, t] = S([]), [r, i] = S([]), a = C(async () => {
|
|
364
364
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
365
365
|
try {
|
|
366
|
-
const
|
|
367
|
-
t(
|
|
366
|
+
const o = await navigator.mediaDevices.enumerateDevices();
|
|
367
|
+
t(o.filter((s) => s.kind === "audioinput")), i(o.filter((s) => s.kind === "videoinput"));
|
|
368
368
|
} catch {
|
|
369
369
|
}
|
|
370
370
|
}, []);
|
|
371
|
-
return
|
|
372
|
-
if (
|
|
373
|
-
const
|
|
374
|
-
return navigator.mediaDevices.addEventListener("devicechange",
|
|
375
|
-
}, [
|
|
371
|
+
return T(() => {
|
|
372
|
+
if (a(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
373
|
+
const o = () => void a();
|
|
374
|
+
return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
|
|
375
|
+
}, [a]), { mics: e, cameras: r, refresh: a };
|
|
376
376
|
}
|
|
377
377
|
function ar(e, t, r = !1) {
|
|
378
|
-
const [
|
|
379
|
-
return
|
|
378
|
+
const [i, a] = S(null), [o, s] = S(null), [l, c] = S(!r && !!e);
|
|
379
|
+
return T(() => {
|
|
380
380
|
if (r || !e) {
|
|
381
381
|
c(!1);
|
|
382
382
|
return;
|
|
@@ -386,16 +386,16 @@ function ar(e, t, r = !1) {
|
|
|
386
386
|
signal: p.signal
|
|
387
387
|
}).then(async (f) => {
|
|
388
388
|
if (!f.ok) {
|
|
389
|
-
const
|
|
390
|
-
throw new Error(
|
|
389
|
+
const d = await f.json().catch(() => ({}));
|
|
390
|
+
throw new Error(d.error || `HTTP ${f.status}`);
|
|
391
391
|
}
|
|
392
392
|
return f.json();
|
|
393
393
|
}).then((f) => {
|
|
394
|
-
p.signal.aborted || (
|
|
394
|
+
p.signal.aborted || (a(f), c(!1));
|
|
395
395
|
}).catch((f) => {
|
|
396
396
|
p.signal.aborted || (s(f instanceof Error ? f.message : "Agent lookup failed"), c(!1));
|
|
397
397
|
}), () => p.abort();
|
|
398
|
-
}, [e, t, r]), { info:
|
|
398
|
+
}, [e, t, r]), { info: i, error: o, loading: l };
|
|
399
399
|
}
|
|
400
400
|
function sr(e) {
|
|
401
401
|
if (typeof window > "u") return null;
|
|
@@ -412,56 +412,56 @@ function cr(e, t) {
|
|
|
412
412
|
} catch {
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function ur({
|
|
416
416
|
value: e,
|
|
417
417
|
defaultValue: t = "expanded",
|
|
418
418
|
onChange: r
|
|
419
419
|
} = {}) {
|
|
420
|
-
const
|
|
420
|
+
const i = e !== void 0, [a, o] = S(t), s = i ? e : a, l = C(
|
|
421
421
|
(c) => {
|
|
422
|
-
c !== s && (
|
|
422
|
+
c !== s && (i || o(c), r == null || r(c));
|
|
423
423
|
},
|
|
424
|
-
[s,
|
|
424
|
+
[s, i, r]
|
|
425
425
|
);
|
|
426
|
-
return [s,
|
|
426
|
+
return [s, l];
|
|
427
427
|
}
|
|
428
|
-
const
|
|
428
|
+
const dr = ["hidden", "minimized", "expanded"];
|
|
429
429
|
function fr(e) {
|
|
430
|
-
return e &&
|
|
430
|
+
return e && dr.includes(e) ? e : null;
|
|
431
431
|
}
|
|
432
432
|
function pr({
|
|
433
433
|
value: e,
|
|
434
434
|
defaultValue: t = "expanded",
|
|
435
435
|
onChange: r,
|
|
436
|
-
persistKey:
|
|
437
|
-
disablePersistence:
|
|
436
|
+
persistKey: i = "ll-widget",
|
|
437
|
+
disablePersistence: a = !1
|
|
438
438
|
} = {}) {
|
|
439
|
-
const
|
|
439
|
+
const o = `${i}:display-mode`, s = A(!1), [l, c] = ur({
|
|
440
440
|
value: e,
|
|
441
441
|
defaultValue: t,
|
|
442
442
|
onChange: (p) => {
|
|
443
|
-
e === void 0 && !
|
|
443
|
+
e === void 0 && !a && cr(o, p), r == null || r(p);
|
|
444
444
|
}
|
|
445
445
|
});
|
|
446
|
-
return
|
|
447
|
-
if (s.current || (s.current = !0,
|
|
448
|
-
const p = fr(sr(
|
|
449
|
-
p && p !==
|
|
450
|
-
}, []), [
|
|
446
|
+
return T(() => {
|
|
447
|
+
if (s.current || (s.current = !0, a || e !== void 0)) return;
|
|
448
|
+
const p = fr(sr(o));
|
|
449
|
+
p && p !== l && c(p);
|
|
450
|
+
}, []), [l, c];
|
|
451
451
|
}
|
|
452
452
|
const hr = 640;
|
|
453
453
|
function mr(e = hr) {
|
|
454
|
-
const [t, r] =
|
|
455
|
-
return
|
|
454
|
+
const [t, r] = S(!1);
|
|
455
|
+
return T(() => {
|
|
456
456
|
if (e === !1) {
|
|
457
457
|
r(!1);
|
|
458
458
|
return;
|
|
459
459
|
}
|
|
460
460
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
461
461
|
return;
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
|
|
462
|
+
const i = `(max-width: ${e - 1}px)`, a = window.matchMedia(i), o = () => r(a.matches);
|
|
463
|
+
return o(), typeof a.addEventListener == "function" ? (a.addEventListener("change", o), () => a.removeEventListener("change", o)) : (a.addListener(o), () => {
|
|
464
|
+
a.removeListener(o);
|
|
465
465
|
});
|
|
466
466
|
}, [e]), t;
|
|
467
467
|
}
|
|
@@ -470,26 +470,26 @@ function gr() {
|
|
|
470
470
|
if (typeof window > "u" || window.history[en]) return;
|
|
471
471
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
472
472
|
window.history.pushState = function(...r) {
|
|
473
|
-
const
|
|
474
|
-
return window.dispatchEvent(new Event(_t)),
|
|
473
|
+
const i = e.apply(this, r);
|
|
474
|
+
return window.dispatchEvent(new Event(_t)), i;
|
|
475
475
|
}, window.history.replaceState = function(...r) {
|
|
476
|
-
const
|
|
477
|
-
return window.dispatchEvent(new Event(_t)),
|
|
476
|
+
const i = t.apply(this, r);
|
|
477
|
+
return window.dispatchEvent(new Event(_t)), i;
|
|
478
478
|
}, window.history[en] = !0;
|
|
479
479
|
}
|
|
480
480
|
function tn() {
|
|
481
481
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
482
482
|
}
|
|
483
483
|
function yr(e) {
|
|
484
|
-
const [t, r] =
|
|
484
|
+
const [t, r] = S(
|
|
485
485
|
() => e ?? tn()
|
|
486
486
|
);
|
|
487
|
-
return
|
|
487
|
+
return T(() => {
|
|
488
488
|
if (e !== void 0) return;
|
|
489
489
|
gr();
|
|
490
|
-
const
|
|
491
|
-
return
|
|
492
|
-
window.removeEventListener("popstate",
|
|
490
|
+
const i = () => r(tn());
|
|
491
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(_t, i), () => {
|
|
492
|
+
window.removeEventListener("popstate", i), window.removeEventListener(_t, i);
|
|
493
493
|
};
|
|
494
494
|
}, [e]), e ?? t;
|
|
495
495
|
}
|
|
@@ -500,7 +500,7 @@ function br(e) {
|
|
|
500
500
|
function wr(e) {
|
|
501
501
|
const t = nn.get(e);
|
|
502
502
|
if (t) return t;
|
|
503
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e,
|
|
503
|
+
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", a = "", o = r.replace(/\*\*/g, i).replace(/\*/g, a), l = br(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(a, "g"), "[^/]+"), c = new RegExp(`^${l}\\/?$`);
|
|
504
504
|
return nn.set(e, c), c;
|
|
505
505
|
}
|
|
506
506
|
function _r(e, t) {
|
|
@@ -525,15 +525,15 @@ function Lr(e, t, r) {
|
|
|
525
525
|
[e, t, r]
|
|
526
526
|
);
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Er(e) {
|
|
529
529
|
return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
|
|
530
530
|
navigate: e.navigate !== !1,
|
|
531
531
|
thinking: e.thinking !== !1,
|
|
532
532
|
action: e.action !== !1
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
const t = Xe(() =>
|
|
535
|
+
function Cr(e) {
|
|
536
|
+
const t = Xe(() => Er(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), i = A(null), a = C(
|
|
537
537
|
(c) => {
|
|
538
538
|
try {
|
|
539
539
|
new Audio(`${r}${c}`).play().catch(() => {
|
|
@@ -542,52 +542,52 @@ function Er(e) {
|
|
|
542
542
|
}
|
|
543
543
|
},
|
|
544
544
|
[r]
|
|
545
|
-
),
|
|
546
|
-
t.navigate &&
|
|
547
|
-
}, [t.navigate,
|
|
548
|
-
t.action &&
|
|
549
|
-
}, [t.action,
|
|
545
|
+
), o = C(() => {
|
|
546
|
+
t.navigate && a("/audio/page-change-sound.mp3");
|
|
547
|
+
}, [t.navigate, a]), s = C(() => {
|
|
548
|
+
t.action && a("/audio/confirmation-sound.mp3");
|
|
549
|
+
}, [t.action, a]), l = C(
|
|
550
550
|
(c) => {
|
|
551
551
|
if (!t.thinking) {
|
|
552
|
-
if (
|
|
552
|
+
if (i.current) {
|
|
553
553
|
try {
|
|
554
|
-
|
|
554
|
+
i.current.pause();
|
|
555
555
|
} catch {
|
|
556
556
|
}
|
|
557
|
-
|
|
557
|
+
i.current = null;
|
|
558
558
|
}
|
|
559
559
|
return;
|
|
560
560
|
}
|
|
561
561
|
if (c) {
|
|
562
|
-
if (
|
|
562
|
+
if (i.current) return;
|
|
563
563
|
try {
|
|
564
564
|
const p = new Audio(`${r}/audio/thinking-sound.mp3`);
|
|
565
565
|
p.loop = !0, p.volume = 0.3, p.play().catch(() => {
|
|
566
|
-
|
|
567
|
-
}),
|
|
566
|
+
i.current = null;
|
|
567
|
+
}), i.current = p;
|
|
568
568
|
} catch {
|
|
569
569
|
}
|
|
570
|
-
} else if (
|
|
570
|
+
} else if (i.current) {
|
|
571
571
|
try {
|
|
572
|
-
|
|
572
|
+
i.current.pause();
|
|
573
573
|
} catch {
|
|
574
574
|
}
|
|
575
|
-
|
|
575
|
+
i.current = null;
|
|
576
576
|
}
|
|
577
577
|
},
|
|
578
578
|
[r, t.thinking]
|
|
579
579
|
);
|
|
580
|
-
return
|
|
581
|
-
if (
|
|
580
|
+
return T(() => () => {
|
|
581
|
+
if (i.current) {
|
|
582
582
|
try {
|
|
583
|
-
|
|
583
|
+
i.current.pause();
|
|
584
584
|
} catch {
|
|
585
585
|
}
|
|
586
|
-
|
|
586
|
+
i.current = null;
|
|
587
587
|
}
|
|
588
588
|
}, []), Xe(
|
|
589
|
-
() => ({ playPageChange:
|
|
590
|
-
[
|
|
589
|
+
() => ({ playPageChange: o, playConfirmation: s, setThinking: l }),
|
|
590
|
+
[o, s, l]
|
|
591
591
|
);
|
|
592
592
|
}
|
|
593
593
|
const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
|
|
@@ -705,113 +705,113 @@ function cn(e) {
|
|
|
705
705
|
} catch {
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
const
|
|
708
|
+
const Tr = ({
|
|
709
709
|
position: e,
|
|
710
710
|
isMobile: t,
|
|
711
711
|
isSpeaking: r,
|
|
712
|
-
onExpand:
|
|
713
|
-
label:
|
|
714
|
-
avatarImageUrl:
|
|
712
|
+
onExpand: i,
|
|
713
|
+
label: a = "Open widget",
|
|
714
|
+
avatarImageUrl: o,
|
|
715
715
|
agentName: s,
|
|
716
|
-
containerEl:
|
|
716
|
+
containerEl: l
|
|
717
717
|
}) => {
|
|
718
|
-
const c = Ar(e), p = c === "right" ? "left" : "right", v = t ? 80 : 72, f = !!
|
|
718
|
+
const c = Ar(e), p = c === "right" ? "left" : "right", v = t ? 80 : 72, f = !!o, d = !!l, [R, L] = S(null), [_, h] = S(!1), b = A(null), N = A(!1), M = C(
|
|
719
719
|
(B) => {
|
|
720
720
|
if (typeof window > "u") return B;
|
|
721
|
-
const
|
|
722
|
-
return
|
|
721
|
+
const j = v / 2, E = sn + j, Z = window.innerHeight - sn - j;
|
|
722
|
+
return Z < E ? Math.max(E, B) : Math.max(E, Math.min(Z, B));
|
|
723
723
|
},
|
|
724
724
|
[v]
|
|
725
725
|
);
|
|
726
|
-
|
|
727
|
-
if (
|
|
726
|
+
T(() => {
|
|
727
|
+
if (d) {
|
|
728
728
|
L(null);
|
|
729
729
|
return;
|
|
730
730
|
}
|
|
731
731
|
const B = Rr();
|
|
732
|
-
L(
|
|
733
|
-
const
|
|
734
|
-
L((
|
|
732
|
+
L(M(B ?? window.innerHeight / 2));
|
|
733
|
+
const j = () => {
|
|
734
|
+
L((E) => E === null ? null : M(E));
|
|
735
735
|
};
|
|
736
|
-
return window.addEventListener("resize",
|
|
737
|
-
}, [
|
|
738
|
-
const
|
|
736
|
+
return window.addEventListener("resize", j), () => window.removeEventListener("resize", j);
|
|
737
|
+
}, [M, d]);
|
|
738
|
+
const I = C(
|
|
739
739
|
(B) => {
|
|
740
|
-
if (!
|
|
740
|
+
if (!d && !(B.pointerType === "mouse" && B.button !== 0) && R !== null) {
|
|
741
741
|
try {
|
|
742
742
|
B.currentTarget.setPointerCapture(B.pointerId);
|
|
743
743
|
} catch {
|
|
744
744
|
}
|
|
745
745
|
b.current = {
|
|
746
746
|
startClientY: B.clientY,
|
|
747
|
-
startCenterY:
|
|
747
|
+
startCenterY: R,
|
|
748
748
|
moved: !1
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
751
|
},
|
|
752
|
-
[
|
|
753
|
-
),
|
|
752
|
+
[R, d]
|
|
753
|
+
), U = C(
|
|
754
754
|
(B) => {
|
|
755
|
-
const
|
|
756
|
-
if (!
|
|
757
|
-
const
|
|
758
|
-
!
|
|
755
|
+
const j = b.current;
|
|
756
|
+
if (!j) return;
|
|
757
|
+
const E = B.clientY - j.startClientY;
|
|
758
|
+
!j.moved && Math.abs(E) > Ir && (j.moved = !0, h(!0)), j.moved && L(M(j.startCenterY + E));
|
|
759
759
|
},
|
|
760
|
-
[
|
|
760
|
+
[M]
|
|
761
761
|
), g = C(
|
|
762
762
|
(B) => {
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
763
|
+
const j = b.current;
|
|
764
|
+
if (j) {
|
|
765
765
|
try {
|
|
766
766
|
B.currentTarget.releasePointerCapture(B.pointerId);
|
|
767
767
|
} catch {
|
|
768
768
|
}
|
|
769
|
-
b.current = null,
|
|
769
|
+
b.current = null, j.moved && (h(!1), N.current = !0, L((E) => (E !== null && cn(E), E)));
|
|
770
770
|
}
|
|
771
771
|
},
|
|
772
772
|
[]
|
|
773
773
|
), P = C(() => {
|
|
774
|
-
if (
|
|
775
|
-
|
|
774
|
+
if (N.current) {
|
|
775
|
+
N.current = !1;
|
|
776
776
|
return;
|
|
777
777
|
}
|
|
778
|
-
|
|
779
|
-
}, [
|
|
778
|
+
i();
|
|
779
|
+
}, [i]), O = C(
|
|
780
780
|
(B) => {
|
|
781
781
|
if (B.key === "ArrowUp" || B.key === "ArrowDown") {
|
|
782
782
|
B.preventDefault();
|
|
783
|
-
const
|
|
784
|
-
L((
|
|
785
|
-
if (
|
|
786
|
-
const
|
|
787
|
-
return cn(
|
|
783
|
+
const j = B.key === "ArrowUp" ? -8 : 8;
|
|
784
|
+
L((E) => {
|
|
785
|
+
if (E === null) return E;
|
|
786
|
+
const Z = M(E + j);
|
|
787
|
+
return cn(Z), Z;
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
790
|
},
|
|
791
|
-
[
|
|
792
|
-
),
|
|
791
|
+
[M]
|
|
792
|
+
), q = [
|
|
793
793
|
"ll-hidden",
|
|
794
794
|
`ll-hidden--${c}`,
|
|
795
795
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
796
796
|
r ? "ll-hidden--speaking" : null,
|
|
797
797
|
_ ? "is-dragging" : null,
|
|
798
798
|
f ? "ll-hidden--with-avatar" : null,
|
|
799
|
-
|
|
800
|
-
].filter(Boolean).join(" "),
|
|
799
|
+
d ? "ll-hidden--scoped" : null
|
|
800
|
+
].filter(Boolean).join(" "), ne = R === null ? void 0 : { top: `${R - v / 2}px`, transform: "none" };
|
|
801
801
|
return /* @__PURE__ */ n(
|
|
802
802
|
"button",
|
|
803
803
|
{
|
|
804
804
|
type: "button",
|
|
805
|
-
className:
|
|
806
|
-
onPointerDown:
|
|
807
|
-
onPointerMove:
|
|
805
|
+
className: q,
|
|
806
|
+
onPointerDown: I,
|
|
807
|
+
onPointerMove: U,
|
|
808
808
|
onPointerUp: g,
|
|
809
809
|
onPointerCancel: g,
|
|
810
810
|
onClick: P,
|
|
811
|
-
onKeyDown:
|
|
812
|
-
"aria-label":
|
|
811
|
+
onKeyDown: O,
|
|
812
|
+
"aria-label": a,
|
|
813
813
|
"data-position": e,
|
|
814
|
-
style:
|
|
814
|
+
style: ne,
|
|
815
815
|
children: f ? (
|
|
816
816
|
// Layout: tiny chevron flush against the inward edge (peeks out
|
|
817
817
|
// as the click affordance), then the circular avatar photo
|
|
@@ -828,7 +828,7 @@ const Mr = ({
|
|
|
828
828
|
/* @__PURE__ */ n(
|
|
829
829
|
"img",
|
|
830
830
|
{
|
|
831
|
-
src:
|
|
831
|
+
src: o,
|
|
832
832
|
alt: s ? `${s} avatar` : "Agent avatar",
|
|
833
833
|
className: "ll-hidden__avatar",
|
|
834
834
|
draggable: !1
|
|
@@ -844,35 +844,35 @@ const Mr = ({
|
|
|
844
844
|
)
|
|
845
845
|
}
|
|
846
846
|
);
|
|
847
|
-
},
|
|
847
|
+
}, Mr = ({
|
|
848
848
|
audioLevel: e,
|
|
849
849
|
bars: t = 20,
|
|
850
850
|
maxHeight: r = 20,
|
|
851
|
-
minHeight:
|
|
852
|
-
className:
|
|
853
|
-
barClassName:
|
|
851
|
+
minHeight: i = 4,
|
|
852
|
+
className: a,
|
|
853
|
+
barClassName: o
|
|
854
854
|
}) => {
|
|
855
|
-
const s =
|
|
855
|
+
const s = A(null), l = A([]), c = Xe(() => {
|
|
856
856
|
const v = (Math.sqrt(5) - 1) / 2;
|
|
857
|
-
return Array.from({ length: t }, (f,
|
|
857
|
+
return Array.from({ length: t }, (f, d) => 0.5 + d * v % 1 * 0.5);
|
|
858
858
|
}, [t]);
|
|
859
|
-
|
|
860
|
-
for (let
|
|
861
|
-
const
|
|
862
|
-
if (!
|
|
863
|
-
const L = Math.max(
|
|
864
|
-
|
|
859
|
+
T(() => e.subscribe((f) => {
|
|
860
|
+
for (let d = 0; d < t; d++) {
|
|
861
|
+
const R = l.current[d];
|
|
862
|
+
if (!R) continue;
|
|
863
|
+
const L = Math.max(i, f * r * c[d]);
|
|
864
|
+
R.style.height = `${L}px`;
|
|
865
865
|
}
|
|
866
|
-
}), [e, t, r,
|
|
867
|
-
const p = ["ll-waveform",
|
|
866
|
+
}), [e, t, r, i, c]);
|
|
867
|
+
const p = ["ll-waveform", a].filter(Boolean).join(" ");
|
|
868
868
|
return /* @__PURE__ */ n("div", { ref: s, className: p, "aria-hidden": "true", children: Array.from({ length: t }, (v, f) => /* @__PURE__ */ n(
|
|
869
869
|
"div",
|
|
870
870
|
{
|
|
871
|
-
ref: (
|
|
872
|
-
|
|
871
|
+
ref: (d) => {
|
|
872
|
+
l.current[f] = d;
|
|
873
873
|
},
|
|
874
|
-
className: ["ll-waveform__bar",
|
|
875
|
-
style: { height: `${
|
|
874
|
+
className: ["ll-waveform__bar", o].filter(Boolean).join(" "),
|
|
875
|
+
style: { height: `${i}px` }
|
|
876
876
|
},
|
|
877
877
|
f
|
|
878
878
|
)) });
|
|
@@ -880,11 +880,11 @@ const Mr = ({
|
|
|
880
880
|
position: e,
|
|
881
881
|
isMobile: t,
|
|
882
882
|
agentName: r,
|
|
883
|
-
avatarImageUrl:
|
|
884
|
-
agentState:
|
|
885
|
-
isMuted:
|
|
883
|
+
avatarImageUrl: i,
|
|
884
|
+
agentState: a,
|
|
885
|
+
isMuted: o,
|
|
886
886
|
audioLevel: s,
|
|
887
|
-
onExpand:
|
|
887
|
+
onExpand: l,
|
|
888
888
|
onToggleMute: c,
|
|
889
889
|
onClose: p
|
|
890
890
|
}) => t ? /* @__PURE__ */ n(
|
|
@@ -898,22 +898,22 @@ const Mr = ({
|
|
|
898
898
|
{
|
|
899
899
|
type: "button",
|
|
900
900
|
className: "ll-minimized__surface",
|
|
901
|
-
onClick:
|
|
901
|
+
onClick: l,
|
|
902
902
|
"aria-label": `Expand ${r} widget`,
|
|
903
903
|
children: [
|
|
904
|
-
|
|
904
|
+
i ? (
|
|
905
905
|
// eslint-disable-next-line @next/next/no-img-element
|
|
906
906
|
/* @__PURE__ */ n(
|
|
907
907
|
"img",
|
|
908
908
|
{
|
|
909
|
-
src:
|
|
909
|
+
src: i,
|
|
910
910
|
alt: r,
|
|
911
911
|
className: "ll-minimized__avatar"
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
915
915
|
/* @__PURE__ */ n(
|
|
916
|
-
|
|
916
|
+
Mr,
|
|
917
917
|
{
|
|
918
918
|
audioLevel: s,
|
|
919
919
|
bars: 16,
|
|
@@ -935,8 +935,8 @@ const Mr = ({
|
|
|
935
935
|
onKeyDown: (v) => {
|
|
936
936
|
(v.key === "Enter" || v.key === " ") && (v.stopPropagation(), v.preventDefault(), c());
|
|
937
937
|
},
|
|
938
|
-
"aria-label":
|
|
939
|
-
children: /* @__PURE__ */ n(on, { muted:
|
|
938
|
+
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
939
|
+
children: /* @__PURE__ */ n(on, { muted: o, className: "ll-minimized__icon" })
|
|
940
940
|
}
|
|
941
941
|
),
|
|
942
942
|
/* @__PURE__ */ n(ln, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
@@ -953,12 +953,12 @@ const Mr = ({
|
|
|
953
953
|
role: "region",
|
|
954
954
|
"aria-label": `${r} widget`,
|
|
955
955
|
children: /* @__PURE__ */ w("div", { className: "ll-minimized__surface", children: [
|
|
956
|
-
|
|
956
|
+
i ? (
|
|
957
957
|
// eslint-disable-next-line @next/next/no-img-element
|
|
958
958
|
/* @__PURE__ */ n(
|
|
959
959
|
"img",
|
|
960
960
|
{
|
|
961
|
-
src:
|
|
961
|
+
src: i,
|
|
962
962
|
alt: r,
|
|
963
963
|
className: "ll-minimized__avatar"
|
|
964
964
|
}
|
|
@@ -966,7 +966,7 @@ const Mr = ({
|
|
|
966
966
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
967
967
|
/* @__PURE__ */ w("div", { className: "ll-minimized__meta", children: [
|
|
968
968
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
969
|
-
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children:
|
|
969
|
+
/* @__PURE__ */ n("span", { className: "ll-minimized__state", children: a === "speaking" ? "Speaking" : a === "thinking" ? "Thinking" : "Listening" })
|
|
970
970
|
] }),
|
|
971
971
|
/* @__PURE__ */ w("div", { className: "ll-minimized__controls", children: [
|
|
972
972
|
/* @__PURE__ */ n(
|
|
@@ -975,8 +975,8 @@ const Mr = ({
|
|
|
975
975
|
type: "button",
|
|
976
976
|
className: "ll-minimized__btn",
|
|
977
977
|
onClick: c,
|
|
978
|
-
"aria-label":
|
|
979
|
-
children: /* @__PURE__ */ n(on, { muted:
|
|
978
|
+
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
979
|
+
children: /* @__PURE__ */ n(on, { muted: o, className: "ll-minimized__icon" })
|
|
980
980
|
}
|
|
981
981
|
),
|
|
982
982
|
/* @__PURE__ */ n(
|
|
@@ -984,7 +984,7 @@ const Mr = ({
|
|
|
984
984
|
{
|
|
985
985
|
type: "button",
|
|
986
986
|
className: "ll-minimized__btn",
|
|
987
|
-
onClick:
|
|
987
|
+
onClick: l,
|
|
988
988
|
"aria-label": `Expand ${r} widget`,
|
|
989
989
|
children: /* @__PURE__ */ n(ln, { className: "ll-minimized__icon" })
|
|
990
990
|
}
|
|
@@ -1006,12 +1006,12 @@ const Mr = ({
|
|
|
1006
1006
|
src: e,
|
|
1007
1007
|
alt: t,
|
|
1008
1008
|
preCannedPlaying: r = !1,
|
|
1009
|
-
className:
|
|
1010
|
-
style:
|
|
1009
|
+
className: i,
|
|
1010
|
+
style: a
|
|
1011
1011
|
}) => {
|
|
1012
|
-
const [
|
|
1013
|
-
if (
|
|
1014
|
-
|
|
1012
|
+
const [o, s] = S(!1), l = A(e);
|
|
1013
|
+
if (T(() => {
|
|
1014
|
+
l.current !== e && (l.current = e, s(!1));
|
|
1015
1015
|
}, [e]), !e) return null;
|
|
1016
1016
|
const c = {
|
|
1017
1017
|
position: "absolute",
|
|
@@ -1022,8 +1022,8 @@ const Mr = ({
|
|
|
1022
1022
|
objectPosition: "top",
|
|
1023
1023
|
transition: "opacity 500ms ease, transform 500ms ease",
|
|
1024
1024
|
transform: r ? "scale(1.02)" : "scale(1)",
|
|
1025
|
-
opacity:
|
|
1026
|
-
...
|
|
1025
|
+
opacity: o ? 1 : 0,
|
|
1026
|
+
...a
|
|
1027
1027
|
};
|
|
1028
1028
|
return (
|
|
1029
1029
|
// eslint-disable-next-line @next/next/no-img-element
|
|
@@ -1032,7 +1032,7 @@ const Mr = ({
|
|
|
1032
1032
|
{
|
|
1033
1033
|
src: e,
|
|
1034
1034
|
alt: t,
|
|
1035
|
-
className:
|
|
1035
|
+
className: i,
|
|
1036
1036
|
style: c,
|
|
1037
1037
|
loading: "eager",
|
|
1038
1038
|
fetchPriority: "high",
|
|
@@ -1040,78 +1040,78 @@ const Mr = ({
|
|
|
1040
1040
|
}
|
|
1041
1041
|
)
|
|
1042
1042
|
);
|
|
1043
|
-
}, $r = 8,
|
|
1043
|
+
}, $r = 8, un = 8, zr = ({
|
|
1044
1044
|
open: e,
|
|
1045
1045
|
onClose: t,
|
|
1046
1046
|
anchorRef: r,
|
|
1047
|
-
children:
|
|
1047
|
+
children: i
|
|
1048
1048
|
}) => {
|
|
1049
|
-
const
|
|
1049
|
+
const a = A(null), [o, s] = S(null);
|
|
1050
1050
|
return xn(() => {
|
|
1051
1051
|
if (!e) {
|
|
1052
1052
|
s(null);
|
|
1053
1053
|
return;
|
|
1054
1054
|
}
|
|
1055
|
-
const
|
|
1056
|
-
if (!
|
|
1055
|
+
const l = r.current;
|
|
1056
|
+
if (!l) return;
|
|
1057
1057
|
const c = () => {
|
|
1058
|
-
const p =
|
|
1058
|
+
const p = l.getBoundingClientRect(), v = {
|
|
1059
1059
|
top: p.top - $r,
|
|
1060
1060
|
left: p.left + p.width / 2
|
|
1061
|
-
}, f =
|
|
1062
|
-
v.left < f && (v.left = f), v.left >
|
|
1061
|
+
}, f = un + 90, d = window.innerWidth - un - 90;
|
|
1062
|
+
v.left < f && (v.left = f), v.left > d && (v.left = d), s(v);
|
|
1063
1063
|
};
|
|
1064
1064
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1065
1065
|
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
1066
1066
|
};
|
|
1067
|
-
}, [e, r]),
|
|
1067
|
+
}, [e, r]), T(() => {
|
|
1068
1068
|
if (!e) return;
|
|
1069
|
-
const
|
|
1070
|
-
const v = p.target, f =
|
|
1071
|
-
f && f.contains(v) ||
|
|
1069
|
+
const l = (p) => {
|
|
1070
|
+
const v = p.target, f = a.current, d = r.current;
|
|
1071
|
+
f && f.contains(v) || d && d.contains(v) || t();
|
|
1072
1072
|
}, c = (p) => {
|
|
1073
1073
|
p.key === "Escape" && (p.stopPropagation(), t());
|
|
1074
1074
|
};
|
|
1075
|
-
return document.addEventListener("mousedown",
|
|
1076
|
-
document.removeEventListener("mousedown",
|
|
1075
|
+
return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
|
|
1076
|
+
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
|
|
1077
1077
|
};
|
|
1078
|
-
}, [e, t, r]), !e ||
|
|
1078
|
+
}, [e, t, r]), !e || o === null || typeof document > "u" ? null : Pt(
|
|
1079
1079
|
/* @__PURE__ */ n(
|
|
1080
1080
|
"div",
|
|
1081
1081
|
{
|
|
1082
|
-
ref:
|
|
1082
|
+
ref: a,
|
|
1083
1083
|
className: "ll-overflow-popover",
|
|
1084
1084
|
role: "menu",
|
|
1085
1085
|
style: {
|
|
1086
1086
|
position: "fixed",
|
|
1087
1087
|
// Lift the popover above the anchor via translateY(-100%).
|
|
1088
1088
|
// top points to (anchorTop - GAP); transform pulls bottom up to there.
|
|
1089
|
-
top:
|
|
1090
|
-
left:
|
|
1089
|
+
top: o.top,
|
|
1090
|
+
left: o.left,
|
|
1091
1091
|
transform: "translate(-50%, -100%)"
|
|
1092
1092
|
},
|
|
1093
|
-
children:
|
|
1093
|
+
children: i
|
|
1094
1094
|
}
|
|
1095
1095
|
),
|
|
1096
1096
|
document.body
|
|
1097
1097
|
);
|
|
1098
|
-
},
|
|
1098
|
+
}, Hr = ({
|
|
1099
1099
|
isMuted: e,
|
|
1100
1100
|
onToggleMute: t,
|
|
1101
1101
|
isCameraEnabled: r,
|
|
1102
|
-
onToggleCamera:
|
|
1103
|
-
allowCamera:
|
|
1104
|
-
isScreenShareEnabled:
|
|
1102
|
+
onToggleCamera: i,
|
|
1103
|
+
allowCamera: a,
|
|
1104
|
+
isScreenShareEnabled: o,
|
|
1105
1105
|
onToggleScreenShare: s,
|
|
1106
|
-
allowScreenShare:
|
|
1106
|
+
allowScreenShare: l,
|
|
1107
1107
|
isSpeakerMuted: c,
|
|
1108
1108
|
onToggleSpeaker: p,
|
|
1109
1109
|
allowTyping: v,
|
|
1110
1110
|
isTypingOpen: f,
|
|
1111
|
-
onToggleTyping:
|
|
1112
|
-
onDisconnect:
|
|
1111
|
+
onToggleTyping: d,
|
|
1112
|
+
onDisconnect: R
|
|
1113
1113
|
}) => {
|
|
1114
|
-
const [L, _] =
|
|
1114
|
+
const [L, _] = S(!1), h = A(null);
|
|
1115
1115
|
return /* @__PURE__ */ w($e, { children: [
|
|
1116
1116
|
/* @__PURE__ */ w(
|
|
1117
1117
|
"div",
|
|
@@ -1140,7 +1140,7 @@ const Mr = ({
|
|
|
1140
1140
|
"aria-label": "More controls",
|
|
1141
1141
|
"aria-haspopup": "menu",
|
|
1142
1142
|
"aria-expanded": L,
|
|
1143
|
-
children: /* @__PURE__ */ n(
|
|
1143
|
+
children: /* @__PURE__ */ n(Or, {})
|
|
1144
1144
|
}
|
|
1145
1145
|
),
|
|
1146
1146
|
/* @__PURE__ */ n(
|
|
@@ -1148,7 +1148,7 @@ const Mr = ({
|
|
|
1148
1148
|
{
|
|
1149
1149
|
type: "button",
|
|
1150
1150
|
className: "ll-tool ll-tool--danger",
|
|
1151
|
-
onClick:
|
|
1151
|
+
onClick: R,
|
|
1152
1152
|
"aria-label": "End conversation",
|
|
1153
1153
|
children: /* @__PURE__ */ n(An, {})
|
|
1154
1154
|
}
|
|
@@ -1163,31 +1163,31 @@ const Mr = ({
|
|
|
1163
1163
|
onClose: () => _(!1),
|
|
1164
1164
|
anchorRef: h,
|
|
1165
1165
|
children: [
|
|
1166
|
-
|
|
1166
|
+
a && /* @__PURE__ */ w(
|
|
1167
1167
|
"button",
|
|
1168
1168
|
{
|
|
1169
1169
|
type: "button",
|
|
1170
1170
|
className: `ll-overflow-popover__item ${r ? "is-on" : ""}`,
|
|
1171
1171
|
onClick: () => {
|
|
1172
|
-
|
|
1172
|
+
i(), _(!1);
|
|
1173
1173
|
},
|
|
1174
1174
|
children: [
|
|
1175
|
-
/* @__PURE__ */ n(
|
|
1175
|
+
/* @__PURE__ */ n(Cn, {}),
|
|
1176
1176
|
/* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
|
|
1177
1177
|
]
|
|
1178
1178
|
}
|
|
1179
1179
|
),
|
|
1180
|
-
|
|
1180
|
+
l && /* @__PURE__ */ w(
|
|
1181
1181
|
"button",
|
|
1182
1182
|
{
|
|
1183
1183
|
type: "button",
|
|
1184
|
-
className: `ll-overflow-popover__item ${
|
|
1184
|
+
className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
|
|
1185
1185
|
onClick: () => {
|
|
1186
1186
|
s(), _(!1);
|
|
1187
1187
|
},
|
|
1188
1188
|
children: [
|
|
1189
|
-
/* @__PURE__ */ n(
|
|
1190
|
-
/* @__PURE__ */ n("span", { children:
|
|
1189
|
+
/* @__PURE__ */ n(En, {}),
|
|
1190
|
+
/* @__PURE__ */ n("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1191
1191
|
]
|
|
1192
1192
|
}
|
|
1193
1193
|
),
|
|
@@ -1211,7 +1211,7 @@ const Mr = ({
|
|
|
1211
1211
|
type: "button",
|
|
1212
1212
|
className: `ll-overflow-popover__item ${f ? "is-on" : ""}`,
|
|
1213
1213
|
onClick: () => {
|
|
1214
|
-
|
|
1214
|
+
d(), _(!1);
|
|
1215
1215
|
},
|
|
1216
1216
|
children: [
|
|
1217
1217
|
/* @__PURE__ */ n(Br, {}),
|
|
@@ -1237,7 +1237,7 @@ const Mr = ({
|
|
|
1237
1237
|
)
|
|
1238
1238
|
] });
|
|
1239
1239
|
};
|
|
1240
|
-
function
|
|
1240
|
+
function Or() {
|
|
1241
1241
|
return /* @__PURE__ */ w(
|
|
1242
1242
|
"svg",
|
|
1243
1243
|
{
|
|
@@ -1275,125 +1275,125 @@ const Wr = ({
|
|
|
1275
1275
|
position: e,
|
|
1276
1276
|
isMobile: t,
|
|
1277
1277
|
agentName: r,
|
|
1278
|
-
avatarImageUrl:
|
|
1279
|
-
idleLoopUrl:
|
|
1280
|
-
greeting:
|
|
1278
|
+
avatarImageUrl: i,
|
|
1279
|
+
idleLoopUrl: a,
|
|
1280
|
+
greeting: o,
|
|
1281
1281
|
branding: s,
|
|
1282
|
-
teamMembers:
|
|
1282
|
+
teamMembers: l,
|
|
1283
1283
|
currentTeamMemberId: c,
|
|
1284
1284
|
isSwitchingTeamMember: p,
|
|
1285
1285
|
teamSwitcherOpen: v,
|
|
1286
1286
|
onToggleTeamSwitcher: f,
|
|
1287
|
-
onSelectTeamMember:
|
|
1288
|
-
languageMenuOpen:
|
|
1287
|
+
onSelectTeamMember: d,
|
|
1288
|
+
languageMenuOpen: R,
|
|
1289
1289
|
onToggleLanguageMenu: L,
|
|
1290
1290
|
connectionState: _,
|
|
1291
1291
|
agentState: h,
|
|
1292
1292
|
transcript: b,
|
|
1293
|
-
canResume:
|
|
1294
|
-
needsUserGesture:
|
|
1295
|
-
error:
|
|
1296
|
-
isMuted:
|
|
1293
|
+
canResume: N,
|
|
1294
|
+
needsUserGesture: M,
|
|
1295
|
+
error: I,
|
|
1296
|
+
isMuted: U,
|
|
1297
1297
|
micError: g,
|
|
1298
1298
|
micDevices: P,
|
|
1299
|
-
activeMicId:
|
|
1300
|
-
isCameraEnabled:
|
|
1301
|
-
cameraPreviewEl:
|
|
1299
|
+
activeMicId: O,
|
|
1300
|
+
isCameraEnabled: q,
|
|
1301
|
+
cameraPreviewEl: ne,
|
|
1302
1302
|
cameraDevices: B,
|
|
1303
|
-
activeCameraId:
|
|
1304
|
-
isScreenShareEnabled:
|
|
1305
|
-
screenPreviewEl:
|
|
1306
|
-
isSpeakerMuted:
|
|
1307
|
-
allowCamera:
|
|
1303
|
+
activeCameraId: j,
|
|
1304
|
+
isScreenShareEnabled: E,
|
|
1305
|
+
screenPreviewEl: Z,
|
|
1306
|
+
isSpeakerMuted: _e,
|
|
1307
|
+
allowCamera: ce,
|
|
1308
1308
|
allowScreenShare: ze,
|
|
1309
|
-
allowTyping:
|
|
1310
|
-
showMinimize:
|
|
1311
|
-
showClose:
|
|
1312
|
-
chromeless:
|
|
1313
|
-
compactControls:
|
|
1314
|
-
transforming:
|
|
1315
|
-
transformingLabel:
|
|
1316
|
-
avatarVideoContainerRef:
|
|
1317
|
-
agentVideoEl:
|
|
1309
|
+
allowTyping: He,
|
|
1310
|
+
showMinimize: Q = !0,
|
|
1311
|
+
showClose: Se = !0,
|
|
1312
|
+
chromeless: xe = !1,
|
|
1313
|
+
compactControls: W = !1,
|
|
1314
|
+
transforming: ie,
|
|
1315
|
+
transformingLabel: Y,
|
|
1316
|
+
avatarVideoContainerRef: fe,
|
|
1317
|
+
agentVideoEl: K,
|
|
1318
1318
|
onConnect: Qe,
|
|
1319
1319
|
onDisconnect: Ze,
|
|
1320
1320
|
onRetry: ft,
|
|
1321
1321
|
onResumeAudio: et,
|
|
1322
1322
|
onToggleMute: Ne,
|
|
1323
|
-
onSwitchMicDevice:
|
|
1323
|
+
onSwitchMicDevice: Oe,
|
|
1324
1324
|
onToggleCamera: Ae,
|
|
1325
1325
|
onSwitchCameraDevice: Be,
|
|
1326
1326
|
onToggleScreenShare: Ie,
|
|
1327
1327
|
onToggleSpeaker: Re,
|
|
1328
|
-
onSendMessage:
|
|
1329
|
-
onMinimize:
|
|
1328
|
+
onSendMessage: Te,
|
|
1329
|
+
onMinimize: Me,
|
|
1330
1330
|
onClose: $,
|
|
1331
1331
|
onClearMicError: xt
|
|
1332
1332
|
}) => {
|
|
1333
1333
|
var mt;
|
|
1334
|
-
const De = ((
|
|
1335
|
-
|
|
1336
|
-
if (!
|
|
1334
|
+
const De = ((l == null ? void 0 : l.length) ?? 0) > 1, We = _ === "connecting" || _ === "connected", pe = _ === "connected", tt = _ === "idle" || _ === "disconnected" || _ === "error", [Pe, Fe] = S(!1);
|
|
1335
|
+
T(() => {
|
|
1336
|
+
if (!K) {
|
|
1337
1337
|
Fe(!1);
|
|
1338
1338
|
return;
|
|
1339
1339
|
}
|
|
1340
|
-
if (!
|
|
1340
|
+
if (!K.paused && K.readyState >= 2) {
|
|
1341
1341
|
Fe(!0);
|
|
1342
1342
|
return;
|
|
1343
1343
|
}
|
|
1344
1344
|
Fe(!1);
|
|
1345
1345
|
const m = () => Fe(!0);
|
|
1346
|
-
return
|
|
1347
|
-
|
|
1346
|
+
return K.addEventListener("playing", m), K.addEventListener("loadeddata", m), () => {
|
|
1347
|
+
K.removeEventListener("playing", m), K.removeEventListener("loadeddata", m);
|
|
1348
1348
|
};
|
|
1349
|
-
}, [
|
|
1350
|
-
const [kt,
|
|
1351
|
-
|
|
1352
|
-
if (!
|
|
1353
|
-
|
|
1349
|
+
}, [K]);
|
|
1350
|
+
const [kt, Le] = S(!1);
|
|
1351
|
+
T(() => {
|
|
1352
|
+
if (!pe) {
|
|
1353
|
+
Le(!1);
|
|
1354
1354
|
return;
|
|
1355
1355
|
}
|
|
1356
1356
|
if (Pe) return;
|
|
1357
|
-
const m = setTimeout(() =>
|
|
1357
|
+
const m = setTimeout(() => Le(!0), 8e3);
|
|
1358
1358
|
return () => clearTimeout(m);
|
|
1359
|
-
}, [
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1359
|
+
}, [pe, Pe]);
|
|
1360
|
+
const oe = _ === "connecting" || pe && !!i && !Pe && !kt, nt = A(null), me = A(null);
|
|
1361
|
+
T(() => {
|
|
1362
1362
|
const m = nt.current;
|
|
1363
|
-
m && (m.innerHTML = "",
|
|
1364
|
-
}, [
|
|
1365
|
-
const m =
|
|
1366
|
-
m && (m.innerHTML = "",
|
|
1367
|
-
}, [
|
|
1368
|
-
const [qe, Ue] =
|
|
1369
|
-
|
|
1370
|
-
if (!qe && !
|
|
1363
|
+
m && (m.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "cover", ne.style.transform = "scaleX(-1)", m.appendChild(ne)));
|
|
1364
|
+
}, [ne]), T(() => {
|
|
1365
|
+
const m = me.current;
|
|
1366
|
+
m && (m.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", m.appendChild(Z)));
|
|
1367
|
+
}, [Z]);
|
|
1368
|
+
const [qe, Ue] = S(!1), [le, ue] = S(!1), pt = A(null), ht = A(null);
|
|
1369
|
+
T(() => {
|
|
1370
|
+
if (!qe && !le && !R && !v) return;
|
|
1371
1371
|
const m = () => {
|
|
1372
|
-
Ue(!1),
|
|
1372
|
+
Ue(!1), ue(!1), R && L(), v && f();
|
|
1373
1373
|
};
|
|
1374
1374
|
return document.addEventListener("click", m), () => document.removeEventListener("click", m);
|
|
1375
1375
|
}, [
|
|
1376
1376
|
qe,
|
|
1377
|
-
|
|
1378
|
-
|
|
1377
|
+
le,
|
|
1378
|
+
R,
|
|
1379
1379
|
v,
|
|
1380
1380
|
L,
|
|
1381
1381
|
f
|
|
1382
1382
|
]);
|
|
1383
|
-
const [
|
|
1383
|
+
const [Ee, rt] = S(!1), se = C(() => rt((m) => !m), []), [de, Ce] = S(""), it = C(
|
|
1384
1384
|
(m) => {
|
|
1385
1385
|
m.preventDefault();
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1386
|
+
const J = de.trim();
|
|
1387
|
+
J && (Te(J), Ce(""));
|
|
1388
1388
|
},
|
|
1389
|
-
[
|
|
1389
|
+
[de, Te]
|
|
1390
1390
|
), Lt = s.productName || "Live Layer";
|
|
1391
|
-
let
|
|
1391
|
+
let ge = null, ye = null;
|
|
1392
1392
|
for (let m = b.length - 1; m >= 0; m--) {
|
|
1393
|
-
const
|
|
1394
|
-
if (!
|
|
1393
|
+
const J = b[m];
|
|
1394
|
+
if (!ge && J.role === "agent" ? ge = J : !ye && J.role === "user" && (ye = J), ge && ye) break;
|
|
1395
1395
|
}
|
|
1396
|
-
const
|
|
1396
|
+
const ot = pe ? (ge == null ? void 0 : ge.text) || null : o || null, je = pe && (ye == null ? void 0 : ye.text) || null, lt = [
|
|
1397
1397
|
"ll-expanded",
|
|
1398
1398
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1399
1399
|
].join(" ");
|
|
@@ -1402,24 +1402,24 @@ const Wr = ({
|
|
|
1402
1402
|
{
|
|
1403
1403
|
className: lt,
|
|
1404
1404
|
"data-position": e,
|
|
1405
|
-
"data-state":
|
|
1405
|
+
"data-state": pe ? "connected" : We ? "connecting" : "idle",
|
|
1406
1406
|
role: "dialog",
|
|
1407
1407
|
"aria-label": `${r} widget`,
|
|
1408
1408
|
children: [
|
|
1409
1409
|
/* @__PURE__ */ w("div", { className: "ll-expanded__bg", children: [
|
|
1410
|
-
|
|
1410
|
+
i ? /* @__PURE__ */ n(
|
|
1411
1411
|
Pr,
|
|
1412
1412
|
{
|
|
1413
|
-
src:
|
|
1413
|
+
src: i,
|
|
1414
1414
|
alt: r,
|
|
1415
1415
|
className: "ll-expanded__bg-img"
|
|
1416
1416
|
}
|
|
1417
1417
|
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((mt = r == null ? void 0 : r.charAt(0)) == null ? void 0 : mt.toUpperCase()) || "A" }) }),
|
|
1418
|
-
|
|
1418
|
+
a && !pe && /* @__PURE__ */ n(
|
|
1419
1419
|
"video",
|
|
1420
1420
|
{
|
|
1421
1421
|
className: "ll-expanded__bg-idle",
|
|
1422
|
-
src:
|
|
1422
|
+
src: a,
|
|
1423
1423
|
autoPlay: !0,
|
|
1424
1424
|
loop: !0,
|
|
1425
1425
|
muted: !0,
|
|
@@ -1427,12 +1427,12 @@ const Wr = ({
|
|
|
1427
1427
|
}
|
|
1428
1428
|
)
|
|
1429
1429
|
] }),
|
|
1430
|
-
/* @__PURE__ */ n("div", { ref:
|
|
1431
|
-
|
|
1430
|
+
/* @__PURE__ */ n("div", { ref: fe, className: "ll-expanded__video" }),
|
|
1431
|
+
oe && /* @__PURE__ */ w("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1432
1432
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1433
1433
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: p ? "Switching..." : "Connecting..." })
|
|
1434
1434
|
] }),
|
|
1435
|
-
|
|
1435
|
+
M && pe && /* @__PURE__ */ w(
|
|
1436
1436
|
"button",
|
|
1437
1437
|
{
|
|
1438
1438
|
type: "button",
|
|
@@ -1444,22 +1444,22 @@ const Wr = ({
|
|
|
1444
1444
|
]
|
|
1445
1445
|
}
|
|
1446
1446
|
),
|
|
1447
|
-
|
|
1447
|
+
ie && /* @__PURE__ */ w(
|
|
1448
1448
|
"div",
|
|
1449
1449
|
{
|
|
1450
1450
|
className: "ll-expanded__overlay ll-expanded__overlay--transforming",
|
|
1451
1451
|
role: "status",
|
|
1452
1452
|
"aria-live": "polite",
|
|
1453
|
-
"aria-label":
|
|
1453
|
+
"aria-label": Y,
|
|
1454
1454
|
children: [
|
|
1455
1455
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1456
|
-
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children:
|
|
1456
|
+
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: Y })
|
|
1457
1457
|
]
|
|
1458
1458
|
}
|
|
1459
1459
|
),
|
|
1460
1460
|
We ? /* @__PURE__ */ w($e, { children: [
|
|
1461
|
-
!
|
|
1462
|
-
!
|
|
1461
|
+
!W && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar", children: [
|
|
1462
|
+
!xe && /* @__PURE__ */ w("div", { className: "ll-expanded__topbar-left", children: [
|
|
1463
1463
|
/* @__PURE__ */ w("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1464
1464
|
/* @__PURE__ */ w(
|
|
1465
1465
|
"button",
|
|
@@ -1483,12 +1483,12 @@ const Wr = ({
|
|
|
1483
1483
|
className: "ll-hmenu",
|
|
1484
1484
|
onClick: (m) => m.stopPropagation(),
|
|
1485
1485
|
role: "listbox",
|
|
1486
|
-
children:
|
|
1486
|
+
children: l == null ? void 0 : l.map((m) => /* @__PURE__ */ w(
|
|
1487
1487
|
"button",
|
|
1488
1488
|
{
|
|
1489
1489
|
type: "button",
|
|
1490
1490
|
className: `ll-hmenu__item ${m.id === c ? "is-active" : ""}`,
|
|
1491
|
-
onClick: () =>
|
|
1491
|
+
onClick: () => d(m.id),
|
|
1492
1492
|
role: "option",
|
|
1493
1493
|
"aria-selected": m.id === c,
|
|
1494
1494
|
children: [
|
|
@@ -1519,7 +1519,7 @@ const Wr = ({
|
|
|
1519
1519
|
m.stopPropagation(), L();
|
|
1520
1520
|
},
|
|
1521
1521
|
"aria-haspopup": "listbox",
|
|
1522
|
-
"aria-expanded":
|
|
1522
|
+
"aria-expanded": R,
|
|
1523
1523
|
"aria-label": "Language: English",
|
|
1524
1524
|
title: "Language: English",
|
|
1525
1525
|
children: [
|
|
@@ -1528,7 +1528,7 @@ const Wr = ({
|
|
|
1528
1528
|
]
|
|
1529
1529
|
}
|
|
1530
1530
|
),
|
|
1531
|
-
|
|
1531
|
+
R && /* @__PURE__ */ n(
|
|
1532
1532
|
"div",
|
|
1533
1533
|
{
|
|
1534
1534
|
className: "ll-hmenu",
|
|
@@ -1556,18 +1556,18 @@ const Wr = ({
|
|
|
1556
1556
|
)
|
|
1557
1557
|
] }),
|
|
1558
1558
|
/* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
|
|
1559
|
-
|
|
1559
|
+
Q !== !1 && /* @__PURE__ */ n(
|
|
1560
1560
|
"button",
|
|
1561
1561
|
{
|
|
1562
1562
|
type: "button",
|
|
1563
1563
|
className: "ll-hbtn",
|
|
1564
|
-
onClick:
|
|
1564
|
+
onClick: Me,
|
|
1565
1565
|
"aria-label": "Minimize widget",
|
|
1566
1566
|
title: "Minimize",
|
|
1567
1567
|
children: /* @__PURE__ */ n(fn, {})
|
|
1568
1568
|
}
|
|
1569
1569
|
),
|
|
1570
|
-
|
|
1570
|
+
Se !== !1 && /* @__PURE__ */ n(
|
|
1571
1571
|
"button",
|
|
1572
1572
|
{
|
|
1573
1573
|
type: "button",
|
|
@@ -1575,12 +1575,12 @@ const Wr = ({
|
|
|
1575
1575
|
onClick: $,
|
|
1576
1576
|
"aria-label": "End call",
|
|
1577
1577
|
title: "End call",
|
|
1578
|
-
children: /* @__PURE__ */ n(
|
|
1578
|
+
children: /* @__PURE__ */ n(dn, {})
|
|
1579
1579
|
}
|
|
1580
1580
|
)
|
|
1581
1581
|
] })
|
|
1582
1582
|
] }),
|
|
1583
|
-
|
|
1583
|
+
W && /* @__PURE__ */ w("div", { className: "ll-compact-status", "data-state": h, children: [
|
|
1584
1584
|
/* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1585
1585
|
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: h })
|
|
1586
1586
|
] })
|
|
@@ -1589,36 +1589,36 @@ const Wr = ({
|
|
|
1589
1589
|
// Hidden in compact mode — on a 140×210 docked slot the brand pill
|
|
1590
1590
|
// and 40px buttons crowded out the central "Start video call"
|
|
1591
1591
|
// affordance. The user can dismiss by scrolling past the slot.
|
|
1592
|
-
!
|
|
1592
|
+
!W && /* @__PURE__ */ w("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1593
1593
|
/* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: Lt }),
|
|
1594
1594
|
/* @__PURE__ */ w("div", { className: "ll-expanded__header-actions", children: [
|
|
1595
|
-
|
|
1595
|
+
Q !== !1 && /* @__PURE__ */ n(
|
|
1596
1596
|
"button",
|
|
1597
1597
|
{
|
|
1598
1598
|
type: "button",
|
|
1599
1599
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1600
|
-
onClick:
|
|
1600
|
+
onClick: Me,
|
|
1601
1601
|
"aria-label": "Minimize widget",
|
|
1602
1602
|
children: /* @__PURE__ */ n(fn, {})
|
|
1603
1603
|
}
|
|
1604
1604
|
),
|
|
1605
|
-
|
|
1605
|
+
Se !== !1 && /* @__PURE__ */ n(
|
|
1606
1606
|
"button",
|
|
1607
1607
|
{
|
|
1608
1608
|
type: "button",
|
|
1609
1609
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1610
1610
|
onClick: $,
|
|
1611
1611
|
"aria-label": "Close widget",
|
|
1612
|
-
children: /* @__PURE__ */ n(
|
|
1612
|
+
children: /* @__PURE__ */ n(dn, {})
|
|
1613
1613
|
}
|
|
1614
1614
|
)
|
|
1615
1615
|
] })
|
|
1616
1616
|
] })
|
|
1617
1617
|
),
|
|
1618
1618
|
tt && /* @__PURE__ */ (() => {
|
|
1619
|
-
const m =
|
|
1619
|
+
const m = N ? "Resume session" : _ === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1620
1620
|
return /* @__PURE__ */ w($e, { children: [
|
|
1621
|
-
!
|
|
1621
|
+
!I && /* @__PURE__ */ w(
|
|
1622
1622
|
"button",
|
|
1623
1623
|
{
|
|
1624
1624
|
type: "button",
|
|
@@ -1627,12 +1627,12 @@ const Wr = ({
|
|
|
1627
1627
|
"aria-label": m,
|
|
1628
1628
|
children: [
|
|
1629
1629
|
/* @__PURE__ */ n("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ n("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
1630
|
-
|
|
1630
|
+
W && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: m })
|
|
1631
1631
|
]
|
|
1632
1632
|
}
|
|
1633
1633
|
),
|
|
1634
|
-
!
|
|
1635
|
-
|
|
1634
|
+
!W && /* @__PURE__ */ w("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1635
|
+
o && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: o }) }),
|
|
1636
1636
|
/* @__PURE__ */ n(
|
|
1637
1637
|
"button",
|
|
1638
1638
|
{
|
|
@@ -1649,35 +1649,35 @@ const Wr = ({
|
|
|
1649
1649
|
/* @__PURE__ */ w(
|
|
1650
1650
|
"div",
|
|
1651
1651
|
{
|
|
1652
|
-
className: `ll-expanded__pip ${We && (
|
|
1652
|
+
className: `ll-expanded__pip ${We && (q || E) ? "is-visible" : ""}`,
|
|
1653
1653
|
children: [
|
|
1654
1654
|
/* @__PURE__ */ n(
|
|
1655
1655
|
"div",
|
|
1656
1656
|
{
|
|
1657
|
-
ref:
|
|
1658
|
-
className:
|
|
1657
|
+
ref: me,
|
|
1658
|
+
className: E ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1659
1659
|
}
|
|
1660
1660
|
),
|
|
1661
1661
|
/* @__PURE__ */ n(
|
|
1662
1662
|
"div",
|
|
1663
1663
|
{
|
|
1664
1664
|
ref: nt,
|
|
1665
|
-
className: !
|
|
1665
|
+
className: !E && q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1666
1666
|
}
|
|
1667
1667
|
)
|
|
1668
1668
|
]
|
|
1669
1669
|
}
|
|
1670
1670
|
),
|
|
1671
1671
|
We ? /* @__PURE__ */ w("div", { className: "ll-expanded__bottom", children: [
|
|
1672
|
-
!
|
|
1672
|
+
!W && ot && /* @__PURE__ */ n(
|
|
1673
1673
|
"div",
|
|
1674
1674
|
{
|
|
1675
1675
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1676
1676
|
"data-role": "agent",
|
|
1677
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1677
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: ot })
|
|
1678
1678
|
}
|
|
1679
1679
|
),
|
|
1680
|
-
!
|
|
1680
|
+
!W && je && /* @__PURE__ */ n(
|
|
1681
1681
|
"div",
|
|
1682
1682
|
{
|
|
1683
1683
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
@@ -1685,28 +1685,28 @@ const Wr = ({
|
|
|
1685
1685
|
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: je })
|
|
1686
1686
|
}
|
|
1687
1687
|
),
|
|
1688
|
-
!
|
|
1688
|
+
!xe && !W && /* @__PURE__ */ w("div", { className: "ll-toolbar", onClick: (m) => m.stopPropagation(), children: [
|
|
1689
1689
|
ze && /* @__PURE__ */ n(
|
|
1690
1690
|
"button",
|
|
1691
1691
|
{
|
|
1692
1692
|
type: "button",
|
|
1693
|
-
className: `ll-tool ${
|
|
1693
|
+
className: `ll-tool ${E ? "is-on" : ""}`,
|
|
1694
1694
|
onClick: Ie,
|
|
1695
|
-
"aria-label":
|
|
1696
|
-
title:
|
|
1697
|
-
children: /* @__PURE__ */ n(
|
|
1695
|
+
"aria-label": E ? "Stop sharing screen" : "Share screen",
|
|
1696
|
+
title: E ? "Stop sharing" : "Share screen",
|
|
1697
|
+
children: /* @__PURE__ */ n(En, {})
|
|
1698
1698
|
}
|
|
1699
1699
|
),
|
|
1700
|
-
|
|
1700
|
+
ce && /* @__PURE__ */ w("div", { className: "ll-tool-split", children: [
|
|
1701
1701
|
/* @__PURE__ */ n(
|
|
1702
1702
|
"button",
|
|
1703
1703
|
{
|
|
1704
1704
|
type: "button",
|
|
1705
|
-
className: `ll-tool ll-tool--left ${
|
|
1705
|
+
className: `ll-tool ll-tool--left ${q ? "is-on" : ""}`,
|
|
1706
1706
|
onClick: Ae,
|
|
1707
|
-
"aria-label":
|
|
1708
|
-
title:
|
|
1709
|
-
children: /* @__PURE__ */ n(
|
|
1707
|
+
"aria-label": q ? "Turn off camera" : "Turn on camera",
|
|
1708
|
+
title: q ? "Stop camera" : "Start camera",
|
|
1709
|
+
children: /* @__PURE__ */ n(Cn, {})
|
|
1710
1710
|
}
|
|
1711
1711
|
),
|
|
1712
1712
|
/* @__PURE__ */ n(
|
|
@@ -1714,25 +1714,25 @@ const Wr = ({
|
|
|
1714
1714
|
{
|
|
1715
1715
|
ref: ht,
|
|
1716
1716
|
type: "button",
|
|
1717
|
-
className: `ll-tool ll-tool--right ${
|
|
1717
|
+
className: `ll-tool ll-tool--right ${q ? "is-on" : ""}`,
|
|
1718
1718
|
onClick: (m) => {
|
|
1719
|
-
m.stopPropagation(),
|
|
1719
|
+
m.stopPropagation(), ue((J) => !J), Ue(!1);
|
|
1720
1720
|
},
|
|
1721
1721
|
"aria-label": "Camera devices",
|
|
1722
1722
|
"aria-haspopup": "listbox",
|
|
1723
|
-
"aria-expanded":
|
|
1723
|
+
"aria-expanded": le,
|
|
1724
1724
|
children: /* @__PURE__ */ n(bt, {})
|
|
1725
1725
|
}
|
|
1726
1726
|
),
|
|
1727
|
-
|
|
1727
|
+
le && B.length > 0 && /* @__PURE__ */ n(
|
|
1728
1728
|
pn,
|
|
1729
1729
|
{
|
|
1730
1730
|
label: "Camera",
|
|
1731
1731
|
devices: B,
|
|
1732
|
-
activeId:
|
|
1732
|
+
activeId: j,
|
|
1733
1733
|
anchorRef: ht,
|
|
1734
1734
|
onPick: (m) => {
|
|
1735
|
-
|
|
1735
|
+
ue(!1), Be(m);
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
1738
|
)
|
|
@@ -1742,11 +1742,11 @@ const Wr = ({
|
|
|
1742
1742
|
"button",
|
|
1743
1743
|
{
|
|
1744
1744
|
type: "button",
|
|
1745
|
-
className: `ll-tool ll-tool--left ${
|
|
1745
|
+
className: `ll-tool ll-tool--left ${U ? "is-muted" : ""}`,
|
|
1746
1746
|
onClick: Ne,
|
|
1747
|
-
"aria-label":
|
|
1748
|
-
title:
|
|
1749
|
-
children: /* @__PURE__ */ n(Sn, { muted:
|
|
1747
|
+
"aria-label": U ? "Unmute microphone" : "Mute microphone",
|
|
1748
|
+
title: U ? "Unmute" : "Mute",
|
|
1749
|
+
children: /* @__PURE__ */ n(Sn, { muted: U })
|
|
1750
1750
|
}
|
|
1751
1751
|
),
|
|
1752
1752
|
/* @__PURE__ */ n(
|
|
@@ -1754,9 +1754,9 @@ const Wr = ({
|
|
|
1754
1754
|
{
|
|
1755
1755
|
ref: pt,
|
|
1756
1756
|
type: "button",
|
|
1757
|
-
className: `ll-tool ll-tool--right ${
|
|
1757
|
+
className: `ll-tool ll-tool--right ${U ? "is-muted" : ""}`,
|
|
1758
1758
|
onClick: (m) => {
|
|
1759
|
-
m.stopPropagation(), Ue((
|
|
1759
|
+
m.stopPropagation(), Ue((J) => !J), ue(!1);
|
|
1760
1760
|
},
|
|
1761
1761
|
"aria-label": "Microphone devices",
|
|
1762
1762
|
"aria-haspopup": "listbox",
|
|
@@ -1769,10 +1769,10 @@ const Wr = ({
|
|
|
1769
1769
|
{
|
|
1770
1770
|
label: "Microphone",
|
|
1771
1771
|
devices: P,
|
|
1772
|
-
activeId:
|
|
1772
|
+
activeId: O,
|
|
1773
1773
|
anchorRef: pt,
|
|
1774
1774
|
onPick: (m) => {
|
|
1775
|
-
Ue(!1),
|
|
1775
|
+
Ue(!1), Oe(m);
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
1778
|
)
|
|
@@ -1781,11 +1781,11 @@ const Wr = ({
|
|
|
1781
1781
|
"button",
|
|
1782
1782
|
{
|
|
1783
1783
|
type: "button",
|
|
1784
|
-
className: `ll-tool ${
|
|
1784
|
+
className: `ll-tool ${_e ? "is-muted" : ""}`,
|
|
1785
1785
|
onClick: Re,
|
|
1786
|
-
"aria-label":
|
|
1787
|
-
title:
|
|
1788
|
-
children: /* @__PURE__ */ n(Nn, { muted:
|
|
1786
|
+
"aria-label": _e ? "Unmute speaker" : "Mute speaker",
|
|
1787
|
+
title: _e ? "Unmute speaker" : "Mute speaker",
|
|
1788
|
+
children: /* @__PURE__ */ n(Nn, { muted: _e })
|
|
1789
1789
|
}
|
|
1790
1790
|
),
|
|
1791
1791
|
/* @__PURE__ */ n(
|
|
@@ -1800,38 +1800,38 @@ const Wr = ({
|
|
|
1800
1800
|
}
|
|
1801
1801
|
)
|
|
1802
1802
|
] }),
|
|
1803
|
-
!
|
|
1804
|
-
|
|
1803
|
+
!xe && W && /* @__PURE__ */ n(
|
|
1804
|
+
Hr,
|
|
1805
1805
|
{
|
|
1806
|
-
isMuted:
|
|
1806
|
+
isMuted: U,
|
|
1807
1807
|
onToggleMute: Ne,
|
|
1808
|
-
isCameraEnabled:
|
|
1808
|
+
isCameraEnabled: q,
|
|
1809
1809
|
onToggleCamera: Ae,
|
|
1810
|
-
allowCamera:
|
|
1811
|
-
isScreenShareEnabled:
|
|
1810
|
+
allowCamera: ce,
|
|
1811
|
+
isScreenShareEnabled: E,
|
|
1812
1812
|
onToggleScreenShare: Ie,
|
|
1813
1813
|
allowScreenShare: ze,
|
|
1814
|
-
isSpeakerMuted:
|
|
1814
|
+
isSpeakerMuted: _e,
|
|
1815
1815
|
onToggleSpeaker: Re,
|
|
1816
|
-
allowTyping:
|
|
1817
|
-
isTypingOpen:
|
|
1818
|
-
onToggleTyping:
|
|
1816
|
+
allowTyping: He,
|
|
1817
|
+
isTypingOpen: Ee,
|
|
1818
|
+
onToggleTyping: se,
|
|
1819
1819
|
onDisconnect: Ze
|
|
1820
1820
|
}
|
|
1821
1821
|
),
|
|
1822
|
-
!
|
|
1822
|
+
!xe && He && (W ? Ee : !0) && /* @__PURE__ */ w("form", { className: "ll-message-input", onSubmit: it, children: [
|
|
1823
1823
|
/* @__PURE__ */ n(
|
|
1824
1824
|
"input",
|
|
1825
1825
|
{
|
|
1826
1826
|
type: "text",
|
|
1827
1827
|
className: "ll-message-input__field",
|
|
1828
1828
|
placeholder: "Message...",
|
|
1829
|
-
value:
|
|
1829
|
+
value: de,
|
|
1830
1830
|
onChange: (m) => Ce(m.target.value),
|
|
1831
1831
|
"aria-label": "Message the agent"
|
|
1832
1832
|
}
|
|
1833
1833
|
),
|
|
1834
|
-
|
|
1834
|
+
de.trim() && /* @__PURE__ */ n(
|
|
1835
1835
|
"button",
|
|
1836
1836
|
{
|
|
1837
1837
|
type: "submit",
|
|
@@ -1857,9 +1857,9 @@ const Wr = ({
|
|
|
1857
1857
|
}
|
|
1858
1858
|
)
|
|
1859
1859
|
] });
|
|
1860
|
-
if (!
|
|
1861
|
-
let m = "Failed to connect",
|
|
1862
|
-
return
|
|
1860
|
+
if (!I || _ !== "error") return null;
|
|
1861
|
+
let m = "Failed to connect", J = "Try again";
|
|
1862
|
+
return I === "MIC_PERMISSION_DENIED" ? m = "Microphone blocked. Allow access to talk." : I === "MIC_NOT_FOUND" ? m = "No microphone found. Plug one in + retry." : I === "MIC_UNAVAILABLE" ? m = "Mic unavailable. Check other apps using it." : I === "AGENT_TIMEOUT" ? m = "Agent didn't pick up. Try again." : I === "CONNECT_FAILED" ? m = "Connection failed. Check your network." : I.length < 80 && (m = I), /* @__PURE__ */ w("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1863
1863
|
/* @__PURE__ */ n("span", { children: m }),
|
|
1864
1864
|
/* @__PURE__ */ n(
|
|
1865
1865
|
"button",
|
|
@@ -1867,7 +1867,7 @@ const Wr = ({
|
|
|
1867
1867
|
type: "button",
|
|
1868
1868
|
className: "ll-expanded__banner-retry",
|
|
1869
1869
|
onClick: ft,
|
|
1870
|
-
children:
|
|
1870
|
+
children: J
|
|
1871
1871
|
}
|
|
1872
1872
|
)
|
|
1873
1873
|
] });
|
|
@@ -1879,7 +1879,7 @@ const Wr = ({
|
|
|
1879
1879
|
function bt() {
|
|
1880
1880
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1881
1881
|
}
|
|
1882
|
-
function
|
|
1882
|
+
function dn() {
|
|
1883
1883
|
return /* @__PURE__ */ w("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1884
1884
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1885
1885
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
@@ -1888,14 +1888,14 @@ function un() {
|
|
|
1888
1888
|
function fn() {
|
|
1889
1889
|
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1890
1890
|
}
|
|
1891
|
-
function
|
|
1891
|
+
function En() {
|
|
1892
1892
|
return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1893
1893
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1894
1894
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1895
1895
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1896
1896
|
] });
|
|
1897
1897
|
}
|
|
1898
|
-
function
|
|
1898
|
+
function Cn() {
|
|
1899
1899
|
return /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1900
1900
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1901
1901
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
@@ -1937,55 +1937,55 @@ const pn = ({
|
|
|
1937
1937
|
label: e,
|
|
1938
1938
|
devices: t,
|
|
1939
1939
|
activeId: r,
|
|
1940
|
-
onPick:
|
|
1941
|
-
anchorRef:
|
|
1940
|
+
onPick: i,
|
|
1941
|
+
anchorRef: a
|
|
1942
1942
|
}) => {
|
|
1943
|
-
const [
|
|
1943
|
+
const [o, s] = S(null);
|
|
1944
1944
|
return xn(() => {
|
|
1945
|
-
const
|
|
1946
|
-
const c =
|
|
1945
|
+
const l = () => {
|
|
1946
|
+
const c = a.current;
|
|
1947
1947
|
if (!c) return;
|
|
1948
|
-
const p = c.getBoundingClientRect(), v = 126, f = window.innerWidth - 16 - 110,
|
|
1948
|
+
const p = c.getBoundingClientRect(), v = 126, f = window.innerWidth - 16 - 110, d = p.left + p.width / 2;
|
|
1949
1949
|
s({
|
|
1950
1950
|
top: p.top - 8,
|
|
1951
|
-
left: Math.max(v, Math.min(f,
|
|
1951
|
+
left: Math.max(v, Math.min(f, d))
|
|
1952
1952
|
});
|
|
1953
1953
|
};
|
|
1954
|
-
return
|
|
1955
|
-
window.removeEventListener("scroll",
|
|
1954
|
+
return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
|
|
1955
|
+
window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
1956
1956
|
};
|
|
1957
|
-
}, [
|
|
1957
|
+
}, [a]), o === null || typeof document > "u" ? null : Pt(
|
|
1958
1958
|
/* @__PURE__ */ w(
|
|
1959
1959
|
"div",
|
|
1960
1960
|
{
|
|
1961
1961
|
className: "ll-device-menu ll-device-menu--floating",
|
|
1962
|
-
onClick: (
|
|
1962
|
+
onClick: (l) => l.stopPropagation(),
|
|
1963
1963
|
role: "listbox",
|
|
1964
1964
|
style: {
|
|
1965
1965
|
position: "fixed",
|
|
1966
|
-
top:
|
|
1967
|
-
left:
|
|
1966
|
+
top: o.top,
|
|
1967
|
+
left: o.left,
|
|
1968
1968
|
// translate up by 100% so its BOTTOM edge sits at pos.top.
|
|
1969
1969
|
transform: "translate(-50%, -100%)"
|
|
1970
1970
|
},
|
|
1971
1971
|
children: [
|
|
1972
1972
|
/* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
|
|
1973
|
-
t.map((
|
|
1974
|
-
const p = r ===
|
|
1973
|
+
t.map((l, c) => {
|
|
1974
|
+
const p = r === l.deviceId;
|
|
1975
1975
|
return /* @__PURE__ */ w(
|
|
1976
1976
|
"button",
|
|
1977
1977
|
{
|
|
1978
1978
|
type: "button",
|
|
1979
1979
|
className: `ll-device-menu__item ${p ? "is-active" : ""}`,
|
|
1980
|
-
onClick: () =>
|
|
1980
|
+
onClick: () => i(l.deviceId),
|
|
1981
1981
|
role: "option",
|
|
1982
1982
|
"aria-selected": p,
|
|
1983
1983
|
children: [
|
|
1984
1984
|
p && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
1985
|
-
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children:
|
|
1985
|
+
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: l.label || `${e} ${c + 1}` })
|
|
1986
1986
|
]
|
|
1987
1987
|
},
|
|
1988
|
-
|
|
1988
|
+
l.deviceId || c
|
|
1989
1989
|
);
|
|
1990
1990
|
})
|
|
1991
1991
|
]
|
|
@@ -2010,7 +2010,7 @@ function $t(e) {
|
|
|
2010
2010
|
}
|
|
2011
2011
|
return !1;
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function Mt(e) {
|
|
2014
2014
|
if ($t(e)) return !1;
|
|
2015
2015
|
if (e instanceof HTMLInputElement) {
|
|
2016
2016
|
if (e.type === "password") return !1;
|
|
@@ -2027,7 +2027,7 @@ const wt = 4096, Ur = 20, jr = 20, Vr = 10, Yr = 10, Gr = 30, Kr = 20, hn = 500,
|
|
|
2027
2027
|
"noscript",
|
|
2028
2028
|
"iframe"
|
|
2029
2029
|
];
|
|
2030
|
-
function
|
|
2030
|
+
function ut(e) {
|
|
2031
2031
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2032
2032
|
let t = e;
|
|
2033
2033
|
for (; t; ) {
|
|
@@ -2037,27 +2037,41 @@ function dt(e) {
|
|
|
2037
2037
|
}
|
|
2038
2038
|
return !1;
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2040
|
+
function dt(e) {
|
|
2041
2041
|
if (typeof window > "u") return !0;
|
|
2042
2042
|
const t = e.getBoundingClientRect();
|
|
2043
2043
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
2044
|
-
const r = window.innerHeight || document.documentElement.clientHeight,
|
|
2045
|
-
return t.bottom > 0 && t.right > 0 && t.top < r && t.left <
|
|
2044
|
+
const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2045
|
+
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
|
|
2046
2046
|
}
|
|
2047
2047
|
function mn(e) {
|
|
2048
2048
|
const t = e.getAttribute("id");
|
|
2049
2049
|
if (t) {
|
|
2050
|
-
const
|
|
2050
|
+
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
|
|
2051
2051
|
if (s != null && s.textContent) return s.textContent.trim();
|
|
2052
2052
|
}
|
|
2053
2053
|
const r = e.getAttribute("aria-label");
|
|
2054
2054
|
if (r) return r.trim();
|
|
2055
|
-
const
|
|
2056
|
-
if (
|
|
2057
|
-
|
|
2058
|
-
|
|
2055
|
+
const i = e.closest("label");
|
|
2056
|
+
if (i) {
|
|
2057
|
+
const o = [];
|
|
2058
|
+
for (const l of Array.from(i.childNodes))
|
|
2059
|
+
if (l.nodeType === Node.TEXT_NODE) {
|
|
2060
|
+
const c = (l.textContent || "").trim();
|
|
2061
|
+
c && o.push(c);
|
|
2062
|
+
} else if (l instanceof HTMLElement) {
|
|
2063
|
+
if (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement || l instanceof HTMLButtonElement)
|
|
2064
|
+
continue;
|
|
2065
|
+
const c = (l.textContent || "").trim();
|
|
2066
|
+
c && o.push(c);
|
|
2067
|
+
}
|
|
2068
|
+
const s = o.join(" ").trim();
|
|
2069
|
+
if (s) return s;
|
|
2070
|
+
}
|
|
2071
|
+
const a = e.getAttribute("placeholder");
|
|
2072
|
+
return a ? a.trim() : "";
|
|
2059
2073
|
}
|
|
2060
|
-
function
|
|
2074
|
+
function re(e, t) {
|
|
2061
2075
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2062
2076
|
}
|
|
2063
2077
|
function Xr(e) {
|
|
@@ -2068,23 +2082,23 @@ function Qr(e) {
|
|
|
2068
2082
|
if (t) return t.trim().slice(0, 80);
|
|
2069
2083
|
const r = e.getAttribute("aria-labelledby");
|
|
2070
2084
|
if (r) {
|
|
2071
|
-
const
|
|
2072
|
-
if (
|
|
2085
|
+
const o = document.getElementById(r);
|
|
2086
|
+
if (o != null && o.textContent) return o.textContent.trim().slice(0, 80);
|
|
2073
2087
|
}
|
|
2074
|
-
const
|
|
2088
|
+
const i = e.querySelector(
|
|
2075
2089
|
'button[type="submit"], input[type="submit"], button:not([type])'
|
|
2076
2090
|
);
|
|
2077
|
-
if (
|
|
2078
|
-
const
|
|
2079
|
-
if (
|
|
2080
|
-
return
|
|
2091
|
+
if (i) {
|
|
2092
|
+
const o = i instanceof HTMLInputElement ? i.value : (i.textContent ?? "").trim();
|
|
2093
|
+
if (o && o.length < 60 && !/^(submit|ok|continue)$/i.test(o))
|
|
2094
|
+
return o;
|
|
2081
2095
|
}
|
|
2082
|
-
let
|
|
2083
|
-
for (let
|
|
2084
|
-
const s =
|
|
2096
|
+
let a = e.parentElement;
|
|
2097
|
+
for (let o = 0; a && o < 4; o++, a = a.parentElement) {
|
|
2098
|
+
const s = a.querySelector("h1, h2, h3, h4");
|
|
2085
2099
|
if (s != null && s.textContent) {
|
|
2086
|
-
const
|
|
2087
|
-
if (
|
|
2100
|
+
const l = s.textContent.trim();
|
|
2101
|
+
if (l && l.length < 80) return l;
|
|
2088
2102
|
}
|
|
2089
2103
|
}
|
|
2090
2104
|
return null;
|
|
@@ -2106,39 +2120,39 @@ function Zr(e, t = {}) {
|
|
|
2106
2120
|
forms: [],
|
|
2107
2121
|
extras: e
|
|
2108
2122
|
};
|
|
2109
|
-
const
|
|
2123
|
+
const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o = r.title || "", s = Array.from(
|
|
2110
2124
|
r.querySelectorAll("[data-ll-region]")
|
|
2111
|
-
),
|
|
2125
|
+
), l = [];
|
|
2112
2126
|
for (const g of s) {
|
|
2113
|
-
if (
|
|
2114
|
-
if (
|
|
2115
|
-
const P = g.getAttribute("data-ll-region") ?? "",
|
|
2127
|
+
if (l.length >= Vr) break;
|
|
2128
|
+
if (ut(g) || !dt(g)) continue;
|
|
2129
|
+
const P = g.getAttribute("data-ll-region") ?? "", O = g.getAttribute("data-ll-intent") ?? void 0, q = re(
|
|
2116
2130
|
(g.innerText || g.textContent || "").trim(),
|
|
2117
2131
|
hn * 2
|
|
2118
2132
|
);
|
|
2119
|
-
!P || !
|
|
2133
|
+
!P || !q || l.push({ id: P, intent: O, text: q });
|
|
2120
2134
|
}
|
|
2121
2135
|
const c = [], p = ["H1", "H2", "H3", "H4", "H5", "H6"], v = Array.from(
|
|
2122
2136
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2123
2137
|
);
|
|
2124
2138
|
for (const g of v) {
|
|
2125
|
-
if (
|
|
2139
|
+
if (ut(g) || !dt(g)) continue;
|
|
2126
2140
|
const P = (g.textContent || "").trim();
|
|
2127
|
-
P && c.push(`${g.tagName}: ${
|
|
2141
|
+
P && c.push(`${g.tagName}: ${re(P, 200)}`);
|
|
2128
2142
|
}
|
|
2129
2143
|
const f = Array.from(r.querySelectorAll("p, li"));
|
|
2130
2144
|
for (const g of f) {
|
|
2131
|
-
if (
|
|
2145
|
+
if (ut(g) || !dt(g) || p.includes(g.tagName)) continue;
|
|
2132
2146
|
const P = (g.textContent || "").trim();
|
|
2133
|
-
P.length > 10 && c.push(
|
|
2147
|
+
P.length > 10 && c.push(re(P, hn));
|
|
2134
2148
|
}
|
|
2135
|
-
const
|
|
2136
|
-
`),
|
|
2149
|
+
const d = c.join(`
|
|
2150
|
+
`), R = [], L = Array.from(r.querySelectorAll("a[href]"));
|
|
2137
2151
|
for (const g of L) {
|
|
2138
|
-
if (
|
|
2139
|
-
if (
|
|
2140
|
-
const P = g.getAttribute("href") || "",
|
|
2141
|
-
!P || !
|
|
2152
|
+
if (R.length >= Ur) break;
|
|
2153
|
+
if (ut(g) || !dt(g)) continue;
|
|
2154
|
+
const P = g.getAttribute("href") || "", O = (g.textContent || "").trim();
|
|
2155
|
+
!P || !O || R.push({ href: P, text: re(O, 100) });
|
|
2142
2156
|
}
|
|
2143
2157
|
const _ = [], h = Array.from(
|
|
2144
2158
|
r.querySelectorAll(
|
|
@@ -2147,83 +2161,109 @@ function Zr(e, t = {}) {
|
|
|
2147
2161
|
);
|
|
2148
2162
|
for (const g of h) {
|
|
2149
2163
|
if (_.length >= jr) break;
|
|
2150
|
-
if (
|
|
2151
|
-
const P = mn(g),
|
|
2152
|
-
P && _.push({ label:
|
|
2164
|
+
if (ut(g) || !Mt(g) || !dt(g)) continue;
|
|
2165
|
+
const P = mn(g), O = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
|
|
2166
|
+
P && _.push({ label: re(P, 100), type: O });
|
|
2153
2167
|
}
|
|
2154
|
-
const b = Array.from(r.querySelectorAll("form")),
|
|
2155
|
-
let
|
|
2168
|
+
const b = Array.from(r.querySelectorAll("form")), N = [];
|
|
2169
|
+
let M = 0;
|
|
2156
2170
|
for (const g of b) {
|
|
2157
|
-
if (
|
|
2171
|
+
if (N.length >= Yr) break;
|
|
2158
2172
|
if ($t(g) || g.matches(".ll-widget *, .ll-widget")) continue;
|
|
2159
|
-
const P = g.getAttribute("id") || g.getAttribute("name") || Xr(g.getAttribute("data-ll-intent")) || `form_${
|
|
2173
|
+
const P = g.getAttribute("id") || g.getAttribute("name") || Xr(g.getAttribute("data-ll-intent")) || `form_${M++}`, O = g.getAttribute("data-ll-intent") || Qr(g) || void 0, q = Array.from(
|
|
2160
2174
|
g.querySelectorAll(
|
|
2161
2175
|
"input, textarea, select"
|
|
2162
2176
|
)
|
|
2163
|
-
),
|
|
2177
|
+
), ne = [];
|
|
2164
2178
|
let B = 0;
|
|
2165
|
-
const
|
|
2166
|
-
for (const
|
|
2167
|
-
if (
|
|
2168
|
-
if (!
|
|
2169
|
-
if (
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2179
|
+
const j = /* @__PURE__ */ new Set();
|
|
2180
|
+
for (const E of q) {
|
|
2181
|
+
if (ne.length >= Gr) break;
|
|
2182
|
+
if (!Mt(E)) continue;
|
|
2183
|
+
if (E instanceof HTMLInputElement) {
|
|
2184
|
+
const W = E.type;
|
|
2185
|
+
if (W === "submit" || W === "button" || W === "reset" || W === "hidden" || W === "image" || W === "file") continue;
|
|
2172
2186
|
}
|
|
2173
|
-
const
|
|
2174
|
-
let
|
|
2175
|
-
|
|
2176
|
-
const ze = mn(
|
|
2177
|
-
name:
|
|
2178
|
-
label:
|
|
2179
|
-
type:
|
|
2187
|
+
const Z = E.getAttribute("name") || "", _e = E.getAttribute("id") || "";
|
|
2188
|
+
let ce = Z || _e || `field_${B}`;
|
|
2189
|
+
j.has(ce) && (ce = `${ce}__${B}`), j.add(ce), B++;
|
|
2190
|
+
const ze = mn(E) || ce, He = E instanceof HTMLInputElement ? E.type : E.tagName.toLowerCase(), Q = {
|
|
2191
|
+
name: ce,
|
|
2192
|
+
label: re(ze, 100),
|
|
2193
|
+
type: He
|
|
2180
2194
|
};
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
const
|
|
2187
|
-
!
|
|
2195
|
+
E.required === !0 && (Q.required = !0);
|
|
2196
|
+
const Se = E.getAttribute("placeholder");
|
|
2197
|
+
if (Se && (Q.placeholder = re(Se.trim(), 100)), E instanceof HTMLInputElement || E instanceof HTMLTextAreaElement) {
|
|
2198
|
+
const W = E.getAttribute("minlength");
|
|
2199
|
+
if (W !== null) {
|
|
2200
|
+
const Y = parseInt(W, 10);
|
|
2201
|
+
!Number.isNaN(Y) && Y >= 0 && (Q.minLength = Y);
|
|
2202
|
+
}
|
|
2203
|
+
const ie = E.getAttribute("maxlength");
|
|
2204
|
+
if (ie !== null) {
|
|
2205
|
+
const Y = parseInt(ie, 10);
|
|
2206
|
+
!Number.isNaN(Y) && Y >= 0 && (Q.maxLength = Y);
|
|
2188
2207
|
}
|
|
2189
|
-
Y.length > 0 && (ve.options = Y);
|
|
2190
2208
|
}
|
|
2191
|
-
|
|
2192
|
-
|
|
2209
|
+
if (E instanceof HTMLInputElement) {
|
|
2210
|
+
const W = E.getAttribute("min");
|
|
2211
|
+
W !== null && (Q.min = re(W, 50));
|
|
2212
|
+
const ie = E.getAttribute("max");
|
|
2213
|
+
ie !== null && (Q.max = re(ie, 50));
|
|
2214
|
+
const Y = E.getAttribute("step");
|
|
2215
|
+
Y !== null && (Q.step = re(Y, 20));
|
|
2216
|
+
const fe = E.getAttribute("pattern");
|
|
2217
|
+
fe !== null && (Q.pattern = re(fe, 200));
|
|
2218
|
+
const K = (E.getAttribute("autocomplete") || "").toLowerCase();
|
|
2219
|
+
K && K !== "off" && !K.startsWith("cc-") && (Q.autocomplete = re(K, 50));
|
|
2220
|
+
}
|
|
2221
|
+
if (E instanceof HTMLSelectElement) {
|
|
2222
|
+
const W = [];
|
|
2223
|
+
for (let ie = 0; ie < E.options.length && !(W.length >= Kr); ie++) {
|
|
2224
|
+
const Y = E.options[ie];
|
|
2225
|
+
if (!Y || Y.disabled) continue;
|
|
2226
|
+
const fe = Y.value || "", K = (Y.textContent || "").trim() || fe;
|
|
2227
|
+
!fe && !K || W.push({ value: fe, label: re(K, 60) });
|
|
2228
|
+
}
|
|
2229
|
+
W.length > 0 && (Q.options = W);
|
|
2230
|
+
}
|
|
2231
|
+
const xe = typeof E.validationMessage == "string" ? E.validationMessage : "";
|
|
2232
|
+
xe && (Q.validationMessage = re(xe, 200)), ne.push(Q);
|
|
2193
2233
|
}
|
|
2194
|
-
|
|
2234
|
+
N.push({ id: P, intent: O, fields: ne });
|
|
2195
2235
|
}
|
|
2196
|
-
const
|
|
2197
|
-
url:
|
|
2198
|
-
title:
|
|
2199
|
-
pathname:
|
|
2200
|
-
regions:
|
|
2201
|
-
visibleText:
|
|
2202
|
-
visibleLinks:
|
|
2236
|
+
const I = {
|
|
2237
|
+
url: i,
|
|
2238
|
+
title: o,
|
|
2239
|
+
pathname: a,
|
|
2240
|
+
regions: l,
|
|
2241
|
+
visibleText: d,
|
|
2242
|
+
visibleLinks: R,
|
|
2203
2243
|
visibleFields: _,
|
|
2204
|
-
forms:
|
|
2244
|
+
forms: N,
|
|
2205
2245
|
extras: e
|
|
2206
2246
|
};
|
|
2207
|
-
let
|
|
2208
|
-
for (;
|
|
2209
|
-
|
|
2210
|
-
for (;
|
|
2211
|
-
|
|
2212
|
-
return Ge(
|
|
2247
|
+
let U = Ge(JSON.stringify(I.regions)) + Ge(I.visibleText) + Ge(JSON.stringify(I.visibleLinks)) + Ge(JSON.stringify(I.visibleFields));
|
|
2248
|
+
for (; U > wt && I.visibleFields.length > 0; )
|
|
2249
|
+
I.visibleFields.pop(), U = Ge(JSON.stringify(I.visibleFields));
|
|
2250
|
+
for (; U > wt && I.visibleLinks.length > 0; )
|
|
2251
|
+
I.visibleLinks.pop(), U -= 80;
|
|
2252
|
+
return Ge(I.visibleText) > wt && (I.visibleText = re(I.visibleText, wt - 100)), I;
|
|
2213
2253
|
}
|
|
2214
2254
|
let Ke = null;
|
|
2215
2255
|
function gn(e, t = {}) {
|
|
2216
|
-
const r = Date.now(),
|
|
2217
|
-
if (Ke && Ke.key ===
|
|
2256
|
+
const r = Date.now(), a = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
2257
|
+
if (Ke && Ke.key === a && r - Ke.at < 1e3)
|
|
2218
2258
|
return Ke.ctx;
|
|
2219
|
-
const
|
|
2220
|
-
return Ke = { key:
|
|
2259
|
+
const o = Zr(e, t);
|
|
2260
|
+
return Ke = { key: a, at: r, ctx: o }, o;
|
|
2221
2261
|
}
|
|
2222
|
-
function
|
|
2262
|
+
function ei() {
|
|
2223
2263
|
Ke = null;
|
|
2224
2264
|
}
|
|
2225
|
-
const
|
|
2226
|
-
function
|
|
2265
|
+
const ti = 200;
|
|
2266
|
+
function ni(e) {
|
|
2227
2267
|
const t = String(e.href || "");
|
|
2228
2268
|
return {
|
|
2229
2269
|
href: t,
|
|
@@ -2233,44 +2273,44 @@ function no(e) {
|
|
|
2233
2273
|
description: e.description
|
|
2234
2274
|
};
|
|
2235
2275
|
}
|
|
2236
|
-
function
|
|
2276
|
+
function ri(e) {
|
|
2237
2277
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2238
2278
|
}
|
|
2239
|
-
function
|
|
2279
|
+
function ii(e) {
|
|
2240
2280
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2241
2281
|
if (!t) return [];
|
|
2242
|
-
const r = typeof window < "u" && window.location.origin || "",
|
|
2243
|
-
for (const s of
|
|
2244
|
-
if (
|
|
2282
|
+
const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [], o = Array.from(t.querySelectorAll("a[href]"));
|
|
2283
|
+
for (const s of o) {
|
|
2284
|
+
if (a.length >= ti) break;
|
|
2245
2285
|
if ($t(s)) continue;
|
|
2246
|
-
const
|
|
2247
|
-
if (!
|
|
2248
|
-
let c =
|
|
2286
|
+
const l = s.getAttribute("href") || "";
|
|
2287
|
+
if (!ri(l)) continue;
|
|
2288
|
+
let c = l, p = !0;
|
|
2249
2289
|
try {
|
|
2250
2290
|
if (typeof window < "u") {
|
|
2251
|
-
const f = new URL(
|
|
2252
|
-
p = f.origin === r, p &&
|
|
2291
|
+
const f = new URL(l, r);
|
|
2292
|
+
p = f.origin === r, p && l.startsWith("http") && (c = f.pathname + f.search + f.hash);
|
|
2253
2293
|
}
|
|
2254
2294
|
} catch {
|
|
2255
2295
|
continue;
|
|
2256
2296
|
}
|
|
2257
|
-
if (
|
|
2258
|
-
|
|
2297
|
+
if (i.has(c)) continue;
|
|
2298
|
+
i.add(c);
|
|
2259
2299
|
const v = (s.textContent || "").trim().slice(0, 120);
|
|
2260
|
-
|
|
2300
|
+
a.push({ href: c, text: v, internal: p });
|
|
2261
2301
|
}
|
|
2262
|
-
return
|
|
2302
|
+
return a;
|
|
2263
2303
|
}
|
|
2264
2304
|
let Je = null;
|
|
2265
|
-
const
|
|
2305
|
+
const oi = 5e3;
|
|
2266
2306
|
function Rt() {
|
|
2267
2307
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2268
|
-
if (Je && Je.pathname === t && e - Je.at <
|
|
2308
|
+
if (Je && Je.pathname === t && e - Je.at < oi)
|
|
2269
2309
|
return Je.routes;
|
|
2270
|
-
const r =
|
|
2310
|
+
const r = ii();
|
|
2271
2311
|
return Je = { at: e, pathname: t, routes: r }, r;
|
|
2272
2312
|
}
|
|
2273
|
-
function
|
|
2313
|
+
function li() {
|
|
2274
2314
|
Je = null;
|
|
2275
2315
|
}
|
|
2276
2316
|
function yn(e) {
|
|
@@ -2281,51 +2321,51 @@ function yn(e) {
|
|
|
2281
2321
|
}
|
|
2282
2322
|
return !0;
|
|
2283
2323
|
}
|
|
2284
|
-
function
|
|
2324
|
+
function ai(e, t) {
|
|
2285
2325
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2286
2326
|
}
|
|
2287
|
-
function
|
|
2327
|
+
function si(e, t) {
|
|
2288
2328
|
if (!t) return null;
|
|
2289
2329
|
try {
|
|
2290
|
-
const
|
|
2330
|
+
const o = e.querySelector(
|
|
2291
2331
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2292
2332
|
);
|
|
2293
|
-
if (
|
|
2333
|
+
if (o && yn(o)) return o;
|
|
2294
2334
|
} catch {
|
|
2295
2335
|
}
|
|
2296
2336
|
const r = Array.from(
|
|
2297
2337
|
e.querySelectorAll("input, textarea, select")
|
|
2298
2338
|
);
|
|
2299
|
-
let
|
|
2300
|
-
const
|
|
2301
|
-
for (const
|
|
2302
|
-
if (!yn(
|
|
2303
|
-
const s =
|
|
2304
|
-
let
|
|
2305
|
-
if (
|
|
2306
|
-
|
|
2339
|
+
let i = 0;
|
|
2340
|
+
const a = /* @__PURE__ */ new Map();
|
|
2341
|
+
for (const o of r) {
|
|
2342
|
+
if (!yn(o)) continue;
|
|
2343
|
+
const s = ai(o, i);
|
|
2344
|
+
let l = s;
|
|
2345
|
+
if (a.has(s) && (l = `${s}__${i}`), l === t) return o;
|
|
2346
|
+
a.set(s, o), i++;
|
|
2307
2347
|
}
|
|
2308
2348
|
return null;
|
|
2309
2349
|
}
|
|
2310
2350
|
function vn(e, t) {
|
|
2311
|
-
const r =
|
|
2312
|
-
return r ?
|
|
2351
|
+
const r = si(e, t);
|
|
2352
|
+
return r ? Mt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2313
2353
|
}
|
|
2314
|
-
function
|
|
2315
|
-
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype,
|
|
2316
|
-
|
|
2354
|
+
function ci(e, t) {
|
|
2355
|
+
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(r, "value"), a = i == null ? void 0 : i.set;
|
|
2356
|
+
a ? a.call(e, t) : e.value = t;
|
|
2317
2357
|
}
|
|
2318
|
-
function
|
|
2319
|
-
const
|
|
2358
|
+
function ui(e, t, r = {}) {
|
|
2359
|
+
const i = r.triggerInput ?? !0, a = r.triggerChange ?? !0;
|
|
2320
2360
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2321
|
-
const
|
|
2361
|
+
const o = Object.getOwnPropertyDescriptor(
|
|
2322
2362
|
HTMLInputElement.prototype,
|
|
2323
2363
|
"checked"
|
|
2324
|
-
), s =
|
|
2325
|
-
s ? s.call(e,
|
|
2364
|
+
), s = o == null ? void 0 : o.set, l = t === "true" || t === "1" || t === "on";
|
|
2365
|
+
s ? s.call(e, l) : e.checked = l, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2326
2366
|
return;
|
|
2327
2367
|
}
|
|
2328
|
-
|
|
2368
|
+
ci(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2329
2369
|
}
|
|
2330
2370
|
function bn(e, t) {
|
|
2331
2371
|
if (!t) return null;
|
|
@@ -2337,34 +2377,34 @@ function bn(e, t) {
|
|
|
2337
2377
|
if (s) return s;
|
|
2338
2378
|
} catch {
|
|
2339
2379
|
}
|
|
2340
|
-
const
|
|
2380
|
+
const i = e.querySelector(
|
|
2341
2381
|
`form[name="${r}"]`
|
|
2342
2382
|
);
|
|
2343
|
-
if (
|
|
2344
|
-
const
|
|
2383
|
+
if (i) return i;
|
|
2384
|
+
const a = e.querySelector(
|
|
2345
2385
|
`form[data-ll-intent="${r}"]`
|
|
2346
2386
|
);
|
|
2347
|
-
if (
|
|
2348
|
-
const
|
|
2349
|
-
for (const s of
|
|
2350
|
-
const
|
|
2351
|
-
if (
|
|
2387
|
+
if (a) return a;
|
|
2388
|
+
const o = Array.from(e.querySelectorAll("form"));
|
|
2389
|
+
for (const s of o) {
|
|
2390
|
+
const l = s.getAttribute("data-ll-intent");
|
|
2391
|
+
if (l && di(l) === t) return s;
|
|
2352
2392
|
}
|
|
2353
2393
|
if (/^form_\d+$/.test(t)) {
|
|
2354
2394
|
const s = parseInt(t.slice(5), 10);
|
|
2355
|
-
let
|
|
2356
|
-
for (const c of
|
|
2395
|
+
let l = 0;
|
|
2396
|
+
for (const c of o)
|
|
2357
2397
|
if (!(c.id || c.getAttribute("name") || c.getAttribute("data-ll-intent"))) {
|
|
2358
|
-
if (
|
|
2359
|
-
|
|
2398
|
+
if (l === s) return c;
|
|
2399
|
+
l++;
|
|
2360
2400
|
}
|
|
2361
2401
|
}
|
|
2362
2402
|
return null;
|
|
2363
2403
|
}
|
|
2364
|
-
function
|
|
2404
|
+
function di(e) {
|
|
2365
2405
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2366
2406
|
}
|
|
2367
|
-
function
|
|
2407
|
+
function fi() {
|
|
2368
2408
|
if (typeof window > "u" || typeof document > "u")
|
|
2369
2409
|
return !1;
|
|
2370
2410
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2372,44 +2412,44 @@ function po() {
|
|
|
2372
2412
|
const t = window.getComputedStyle(e);
|
|
2373
2413
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2374
2414
|
}
|
|
2375
|
-
function
|
|
2415
|
+
function pi(e) {
|
|
2376
2416
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2377
2417
|
const r = window.getComputedStyle(e).overflowY;
|
|
2378
2418
|
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2379
2419
|
}
|
|
2380
|
-
function
|
|
2420
|
+
function hi() {
|
|
2381
2421
|
if (typeof document > "u") return null;
|
|
2382
2422
|
const e = Array.from(
|
|
2383
2423
|
document.querySelectorAll("body, body *")
|
|
2384
2424
|
);
|
|
2385
2425
|
let t = null, r = 0;
|
|
2386
|
-
for (const
|
|
2387
|
-
if (!
|
|
2388
|
-
const
|
|
2389
|
-
if (
|
|
2390
|
-
const
|
|
2391
|
-
|
|
2426
|
+
for (const i of e) {
|
|
2427
|
+
if (!pi(i)) continue;
|
|
2428
|
+
const a = i.getBoundingClientRect();
|
|
2429
|
+
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;
|
|
2430
|
+
const o = a.width * a.height;
|
|
2431
|
+
o > r && (r = o, t = i);
|
|
2392
2432
|
}
|
|
2393
2433
|
return t;
|
|
2394
2434
|
}
|
|
2395
|
-
function
|
|
2435
|
+
function mi() {
|
|
2396
2436
|
if (typeof window > "u")
|
|
2397
2437
|
return null;
|
|
2398
|
-
if (
|
|
2399
|
-
const e =
|
|
2438
|
+
if (fi()) return window;
|
|
2439
|
+
const e = hi();
|
|
2400
2440
|
return e || window;
|
|
2401
2441
|
}
|
|
2402
2442
|
function wn(e) {
|
|
2403
2443
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2404
2444
|
}
|
|
2405
|
-
function
|
|
2445
|
+
function gi(e) {
|
|
2406
2446
|
var t, r;
|
|
2407
2447
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2408
2448
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2409
2449
|
((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
|
|
2410
2450
|
) : e.scrollHeight - e.clientHeight;
|
|
2411
2451
|
}
|
|
2412
|
-
const
|
|
2452
|
+
const yi = /* @__PURE__ */ new Set([
|
|
2413
2453
|
"agent_state",
|
|
2414
2454
|
"avatar_stream_ready",
|
|
2415
2455
|
"avatar_active",
|
|
@@ -2443,112 +2483,112 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2443
2483
|
function(t, r) {
|
|
2444
2484
|
var Yt, Gt, Kt, Jt, Xt, Qt, Zt;
|
|
2445
2485
|
const {
|
|
2446
|
-
agentId:
|
|
2447
|
-
apiKey:
|
|
2448
|
-
baseUrl:
|
|
2486
|
+
agentId: i,
|
|
2487
|
+
apiKey: a,
|
|
2488
|
+
baseUrl: o = "https://app.livelayer.studio",
|
|
2449
2489
|
sessionEndpoint: s,
|
|
2450
|
-
sessionBody:
|
|
2490
|
+
sessionBody: l,
|
|
2451
2491
|
soundEffects: c,
|
|
2452
2492
|
experienceMode: p = "WIDGET",
|
|
2453
2493
|
autoConnect: v = !1,
|
|
2454
2494
|
displayMode: f,
|
|
2455
|
-
defaultDisplayMode:
|
|
2456
|
-
onDisplayModeChange:
|
|
2495
|
+
defaultDisplayMode: d = "expanded",
|
|
2496
|
+
onDisplayModeChange: R,
|
|
2457
2497
|
position: L = "bottom-right",
|
|
2458
2498
|
mobileBreakpoint: _ = 640,
|
|
2459
2499
|
persistKey: h = "ll-widget",
|
|
2460
2500
|
disablePersistence: b = !1,
|
|
2461
|
-
teamMembers:
|
|
2462
|
-
currentTeamMemberId:
|
|
2463
|
-
onTeamMemberChange:
|
|
2464
|
-
idleLoopUrl:
|
|
2501
|
+
teamMembers: N,
|
|
2502
|
+
currentTeamMemberId: M,
|
|
2503
|
+
onTeamMemberChange: I,
|
|
2504
|
+
idleLoopUrl: U,
|
|
2465
2505
|
greeting: g,
|
|
2466
2506
|
avatarImageUrl: P,
|
|
2467
|
-
agentName:
|
|
2468
|
-
branding:
|
|
2469
|
-
allowCamera:
|
|
2507
|
+
agentName: O,
|
|
2508
|
+
branding: q = {},
|
|
2509
|
+
allowCamera: ne = !0,
|
|
2470
2510
|
allowScreenShare: B = !0,
|
|
2471
|
-
allowTyping:
|
|
2472
|
-
showMinimize:
|
|
2473
|
-
showClose:
|
|
2474
|
-
chromeless:
|
|
2475
|
-
floatingChromeContainer:
|
|
2511
|
+
allowTyping: j = !0,
|
|
2512
|
+
showMinimize: E,
|
|
2513
|
+
showClose: Z,
|
|
2514
|
+
chromeless: _e = !1,
|
|
2515
|
+
floatingChromeContainer: ce = null,
|
|
2476
2516
|
compactControls: ze = !1,
|
|
2477
|
-
transforming:
|
|
2478
|
-
transformingLabel:
|
|
2479
|
-
showOn:
|
|
2480
|
-
hideOn:
|
|
2481
|
-
pathname:
|
|
2482
|
-
onNavigate:
|
|
2483
|
-
onScrollToSelector:
|
|
2484
|
-
getPageContext:
|
|
2485
|
-
pageContextExtras:
|
|
2517
|
+
transforming: He = !1,
|
|
2518
|
+
transformingLabel: Q = "Transforming…",
|
|
2519
|
+
showOn: Se,
|
|
2520
|
+
hideOn: xe,
|
|
2521
|
+
pathname: W,
|
|
2522
|
+
onNavigate: ie,
|
|
2523
|
+
onScrollToSelector: Y,
|
|
2524
|
+
getPageContext: fe,
|
|
2525
|
+
pageContextExtras: K,
|
|
2486
2526
|
getRoutes: Qe,
|
|
2487
2527
|
onScrollPage: Ze,
|
|
2488
2528
|
onClick: ft,
|
|
2489
2529
|
capabilities: et,
|
|
2490
2530
|
onConnect: Ne,
|
|
2491
|
-
onDisconnect:
|
|
2531
|
+
onDisconnect: Oe,
|
|
2492
2532
|
onTranscript: Ae,
|
|
2493
2533
|
onAgentState: Be,
|
|
2494
2534
|
onConnectionStateChange: Ie,
|
|
2495
2535
|
onAgentEvent: Re,
|
|
2496
|
-
onAgentCommand:
|
|
2497
|
-
onCollect:
|
|
2536
|
+
onAgentCommand: Te,
|
|
2537
|
+
onCollect: Me,
|
|
2498
2538
|
controlledSession: $,
|
|
2499
2539
|
className: xt,
|
|
2500
2540
|
style: De,
|
|
2501
2541
|
zIndex: We = 2147483647
|
|
2502
|
-
} = t,
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
}, [
|
|
2506
|
-
const Pe =
|
|
2542
|
+
} = t, pe = yr(W), tt = Lr(pe, Se, xe);
|
|
2543
|
+
T(() => {
|
|
2544
|
+
ei(), li();
|
|
2545
|
+
}, [pe]);
|
|
2546
|
+
const Pe = M !== void 0, [Fe, kt] = S(() => {
|
|
2507
2547
|
var y;
|
|
2508
|
-
return
|
|
2509
|
-
}),
|
|
2510
|
-
() => (
|
|
2511
|
-
[
|
|
2512
|
-
), nt = (
|
|
2548
|
+
return M ?? ((y = N == null ? void 0 : N[0]) == null ? void 0 : y.id);
|
|
2549
|
+
}), Le = Pe ? M : Fe, oe = Xe(
|
|
2550
|
+
() => (N == null ? void 0 : N.find((y) => y.id === Le)) ?? null,
|
|
2551
|
+
[N, Le]
|
|
2552
|
+
), nt = (oe == null ? void 0 : oe.agentId) ?? i, me = p === "EMBEDDED", [qe, Ue] = pr({
|
|
2513
2553
|
value: f,
|
|
2514
|
-
defaultValue:
|
|
2515
|
-
onChange:
|
|
2554
|
+
defaultValue: d,
|
|
2555
|
+
onChange: R,
|
|
2516
2556
|
persistKey: h,
|
|
2517
|
-
disablePersistence:
|
|
2518
|
-
}),
|
|
2519
|
-
} : Ue, pt =
|
|
2557
|
+
disablePersistence: me || b
|
|
2558
|
+
}), le = me ? "expanded" : qe, ue = me ? () => {
|
|
2559
|
+
} : Ue, pt = E ?? !me, ht = Z ?? !me, Ee = mr(_), rt = tr(), se = nr(), de = ir(), Ce = or(), it = lr(), [Lt, ge] = S(!1), [ye, ot] = S(!1), [je, lt] = S(!1), [mt, m] = S(!1), [J, Rn] = S(!1), gt = Cr({ baseUrl: o, config: c }), yt = A(gt);
|
|
2520
2560
|
yt.current = gt;
|
|
2521
|
-
const
|
|
2522
|
-
|
|
2523
|
-
function
|
|
2524
|
-
const
|
|
2525
|
-
return
|
|
2561
|
+
const Et = A(ie), Ct = A(Y), St = A(Ze), Nt = A(ft), zt = A(fe), Ht = A(K), Ot = A(Qe), At = A(et), ve = A(null);
|
|
2562
|
+
Et.current = ie, Ct.current = Y, St.current = Ze, Nt.current = ft, zt.current = fe, Ht.current = K, Ot.current = Qe, At.current = et;
|
|
2563
|
+
function be(y) {
|
|
2564
|
+
const u = At.current;
|
|
2565
|
+
return u ? u.includes(y) : !0;
|
|
2526
2566
|
}
|
|
2527
|
-
function
|
|
2567
|
+
function we(y, u) {
|
|
2528
2568
|
console.warn(
|
|
2529
|
-
`[LiveLayer] Agent command "${y}" blocked — capability "${
|
|
2569
|
+
`[LiveLayer] Agent command "${y}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2530
2570
|
);
|
|
2531
2571
|
}
|
|
2532
2572
|
const at = C(
|
|
2533
2573
|
(y) => {
|
|
2534
|
-
var
|
|
2535
|
-
const
|
|
2536
|
-
if (!(!
|
|
2537
|
-
if (Re == null || Re({ eventName:
|
|
2538
|
-
if (!
|
|
2539
|
-
|
|
2574
|
+
var X, he, ke, ct;
|
|
2575
|
+
const u = y;
|
|
2576
|
+
if (!(!u.type || typeof u.type != "string")) {
|
|
2577
|
+
if (Re == null || Re({ eventName: u.type, data: y }), u.type === "navigate") {
|
|
2578
|
+
if (!be("navigate")) {
|
|
2579
|
+
we("navigate", "navigate");
|
|
2540
2580
|
return;
|
|
2541
2581
|
}
|
|
2542
|
-
const x = typeof
|
|
2582
|
+
const x = typeof u.href == "string" ? u.href : null;
|
|
2543
2583
|
if (!x) {
|
|
2544
2584
|
console.warn(
|
|
2545
2585
|
`[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
|
|
2546
2586
|
);
|
|
2547
2587
|
return;
|
|
2548
2588
|
}
|
|
2549
|
-
if (yt.current.playPageChange(),
|
|
2589
|
+
if (yt.current.playPageChange(), Et.current) {
|
|
2550
2590
|
try {
|
|
2551
|
-
|
|
2591
|
+
Et.current(x);
|
|
2552
2592
|
} catch (D) {
|
|
2553
2593
|
console.warn(
|
|
2554
2594
|
`[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
|
|
@@ -2577,109 +2617,109 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2577
2617
|
}
|
|
2578
2618
|
return;
|
|
2579
2619
|
}
|
|
2580
|
-
if (
|
|
2581
|
-
if (!
|
|
2582
|
-
|
|
2620
|
+
if (u.type === "scroll_to") {
|
|
2621
|
+
if (!be("scroll")) {
|
|
2622
|
+
we("scroll_to", "scroll");
|
|
2583
2623
|
return;
|
|
2584
2624
|
}
|
|
2585
|
-
const x = typeof
|
|
2625
|
+
const x = typeof u.selector == "string" ? u.selector : null;
|
|
2586
2626
|
if (!x) return;
|
|
2587
|
-
const D =
|
|
2588
|
-
if (
|
|
2627
|
+
const D = u.behavior === "instant" ? "instant" : "smooth";
|
|
2628
|
+
if (Ct.current) {
|
|
2589
2629
|
try {
|
|
2590
|
-
|
|
2630
|
+
Ct.current(
|
|
2591
2631
|
x,
|
|
2592
2632
|
D
|
|
2593
2633
|
);
|
|
2594
|
-
} catch (
|
|
2595
|
-
console.warn("[LiveLayer] onScrollToSelector threw.",
|
|
2634
|
+
} catch (F) {
|
|
2635
|
+
console.warn("[LiveLayer] onScrollToSelector threw.", F);
|
|
2596
2636
|
}
|
|
2597
2637
|
return;
|
|
2598
2638
|
}
|
|
2599
2639
|
if (typeof document < "u") {
|
|
2600
|
-
let
|
|
2640
|
+
let F = null;
|
|
2601
2641
|
try {
|
|
2602
|
-
|
|
2642
|
+
F = document.querySelector(x);
|
|
2603
2643
|
} catch {
|
|
2604
2644
|
console.warn(
|
|
2605
2645
|
`[LiveLayer] scroll_to: invalid selector "${x}".`
|
|
2606
2646
|
);
|
|
2607
2647
|
return;
|
|
2608
2648
|
}
|
|
2609
|
-
if (!
|
|
2649
|
+
if (!F) {
|
|
2610
2650
|
console.warn(
|
|
2611
2651
|
`[LiveLayer] scroll_to: no element matched "${x}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
|
|
2612
2652
|
);
|
|
2613
2653
|
return;
|
|
2614
2654
|
}
|
|
2615
|
-
|
|
2655
|
+
F.scrollIntoView({
|
|
2616
2656
|
behavior: D,
|
|
2617
2657
|
block: "start"
|
|
2618
2658
|
});
|
|
2619
2659
|
}
|
|
2620
2660
|
return;
|
|
2621
2661
|
}
|
|
2622
|
-
if (
|
|
2623
|
-
if (!
|
|
2624
|
-
|
|
2662
|
+
if (u.type === "request_page_context") {
|
|
2663
|
+
if (!be("read_page")) {
|
|
2664
|
+
we("request_page_context", "read_page");
|
|
2625
2665
|
return;
|
|
2626
2666
|
}
|
|
2627
|
-
const x = typeof
|
|
2628
|
-
const z = D,
|
|
2629
|
-
if (
|
|
2667
|
+
const x = typeof u.requestId == "string" ? u.requestId : void 0, D = (X = ve.current) == null ? void 0 : X.call(ve), F = (G) => {
|
|
2668
|
+
const z = D, te = z == null ? void 0 : z.localParticipant;
|
|
2669
|
+
if (te != null && te.publishData)
|
|
2630
2670
|
try {
|
|
2631
|
-
const
|
|
2632
|
-
|
|
2633
|
-
} catch (
|
|
2634
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2671
|
+
const ae = x ? { ...G, requestId: x } : G, Ye = new TextEncoder().encode(JSON.stringify(ae));
|
|
2672
|
+
te.publishData(Ye, { reliable: !0 });
|
|
2673
|
+
} catch (ae) {
|
|
2674
|
+
console.warn("[LiveLayer] publishData failed.", ae);
|
|
2635
2675
|
}
|
|
2636
|
-
},
|
|
2676
|
+
}, H = Ht.current, V = zt.current;
|
|
2637
2677
|
try {
|
|
2638
|
-
if (
|
|
2639
|
-
const
|
|
2640
|
-
if (
|
|
2641
|
-
|
|
2678
|
+
if (V) {
|
|
2679
|
+
const G = V(H);
|
|
2680
|
+
if (G instanceof Promise) {
|
|
2681
|
+
F({ type: "page_context_pending" }), G.then((z) => F({ type: "page_context", context: z })).catch((z) => {
|
|
2642
2682
|
console.warn(
|
|
2643
2683
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
2644
2684
|
z
|
|
2645
|
-
),
|
|
2685
|
+
), F({
|
|
2646
2686
|
type: "page_context",
|
|
2647
|
-
context: gn(
|
|
2687
|
+
context: gn(H)
|
|
2648
2688
|
});
|
|
2649
2689
|
});
|
|
2650
2690
|
return;
|
|
2651
2691
|
}
|
|
2652
|
-
|
|
2692
|
+
F({ type: "page_context", context: G });
|
|
2653
2693
|
return;
|
|
2654
2694
|
}
|
|
2655
|
-
|
|
2695
|
+
F({
|
|
2656
2696
|
type: "page_context",
|
|
2657
|
-
context: gn(
|
|
2697
|
+
context: gn(H)
|
|
2658
2698
|
});
|
|
2659
|
-
} catch (
|
|
2699
|
+
} catch (G) {
|
|
2660
2700
|
console.warn(
|
|
2661
2701
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
2662
|
-
|
|
2663
|
-
),
|
|
2702
|
+
G
|
|
2703
|
+
), F({
|
|
2664
2704
|
type: "page_context",
|
|
2665
|
-
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras:
|
|
2705
|
+
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: H }
|
|
2666
2706
|
});
|
|
2667
2707
|
}
|
|
2668
2708
|
return;
|
|
2669
2709
|
}
|
|
2670
|
-
if (
|
|
2671
|
-
if (!
|
|
2672
|
-
|
|
2710
|
+
if (u.type === "scroll_page") {
|
|
2711
|
+
if (!be("scroll")) {
|
|
2712
|
+
we("scroll_page", "scroll");
|
|
2673
2713
|
return;
|
|
2674
2714
|
}
|
|
2675
|
-
const x =
|
|
2715
|
+
const x = u.direction;
|
|
2676
2716
|
if (x !== "up" && x !== "down" && x !== "top" && x !== "bottom") {
|
|
2677
2717
|
console.warn(
|
|
2678
2718
|
`[LiveLayer] scroll_page: invalid direction "${String(x)}". Expected up | down | top | bottom.`
|
|
2679
2719
|
);
|
|
2680
2720
|
return;
|
|
2681
2721
|
}
|
|
2682
|
-
const D =
|
|
2722
|
+
const D = u.behavior === "instant" ? "instant" : "smooth";
|
|
2683
2723
|
if (St.current) {
|
|
2684
2724
|
try {
|
|
2685
2725
|
St.current(
|
|
@@ -2692,20 +2732,20 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2692
2732
|
return;
|
|
2693
2733
|
}
|
|
2694
2734
|
if (typeof window > "u") return;
|
|
2695
|
-
const
|
|
2696
|
-
|
|
2697
|
-
},
|
|
2698
|
-
|
|
2735
|
+
const F = { behavior: D }, H = mi(), V = (z) => {
|
|
2736
|
+
H instanceof Window ? H.scrollBy({ top: z, ...F }) : H.scrollBy({ top: z, ...F });
|
|
2737
|
+
}, G = (z) => {
|
|
2738
|
+
H instanceof Window ? H.scrollTo({ top: z, ...F }) : H.scrollTo({ top: z, ...F });
|
|
2699
2739
|
};
|
|
2700
|
-
x === "up" ?
|
|
2740
|
+
x === "up" ? V(-wn(H)) : x === "down" ? V(wn(H)) : G(x === "top" ? 0 : gi(H));
|
|
2701
2741
|
return;
|
|
2702
2742
|
}
|
|
2703
|
-
if (
|
|
2704
|
-
if (!
|
|
2705
|
-
|
|
2743
|
+
if (u.type === "click") {
|
|
2744
|
+
if (!be("click")) {
|
|
2745
|
+
we("click", "click");
|
|
2706
2746
|
return;
|
|
2707
2747
|
}
|
|
2708
|
-
const x = typeof
|
|
2748
|
+
const x = typeof u.selector == "string" ? u.selector : null;
|
|
2709
2749
|
if (!x) {
|
|
2710
2750
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2711
2751
|
return;
|
|
@@ -2713,8 +2753,8 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2713
2753
|
if (Nt.current) {
|
|
2714
2754
|
try {
|
|
2715
2755
|
Nt.current(x);
|
|
2716
|
-
} catch (
|
|
2717
|
-
console.warn("[LiveLayer] onClick threw.",
|
|
2756
|
+
} catch (F) {
|
|
2757
|
+
console.warn("[LiveLayer] onClick threw.", F);
|
|
2718
2758
|
}
|
|
2719
2759
|
return;
|
|
2720
2760
|
}
|
|
@@ -2740,86 +2780,86 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2740
2780
|
);
|
|
2741
2781
|
return;
|
|
2742
2782
|
}
|
|
2743
|
-
(
|
|
2783
|
+
(he = D.click) == null || he.call(D);
|
|
2744
2784
|
return;
|
|
2745
2785
|
}
|
|
2746
|
-
if (
|
|
2747
|
-
if (!
|
|
2748
|
-
|
|
2786
|
+
if (u.type === "fill_form" || u.type === "focus_field") {
|
|
2787
|
+
if (!be("fill_forms")) {
|
|
2788
|
+
we(u.type, "fill_forms");
|
|
2749
2789
|
return;
|
|
2750
2790
|
}
|
|
2751
2791
|
if (typeof document > "u") return;
|
|
2752
|
-
|
|
2753
|
-
const x = typeof
|
|
2792
|
+
u.type === "fill_form" && yt.current.playConfirmation();
|
|
2793
|
+
const x = typeof u.formId == "string" ? u.formId : null;
|
|
2754
2794
|
if (!x) {
|
|
2755
|
-
console.warn(`[LiveLayer] ${
|
|
2795
|
+
console.warn(`[LiveLayer] ${u.type}: missing formId.`);
|
|
2756
2796
|
return;
|
|
2757
2797
|
}
|
|
2758
2798
|
const D = bn(document, x);
|
|
2759
2799
|
if (!D) {
|
|
2760
2800
|
console.warn(
|
|
2761
|
-
`[LiveLayer] ${
|
|
2801
|
+
`[LiveLayer] ${u.type}: no <form> matched id="${x}" (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.`
|
|
2762
2802
|
);
|
|
2763
2803
|
return;
|
|
2764
2804
|
}
|
|
2765
2805
|
if (D.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
|
|
2766
2806
|
console.warn(
|
|
2767
|
-
`[LiveLayer] ${
|
|
2807
|
+
`[LiveLayer] ${u.type}: refusing to touch a form in a private / opted-out subtree.`
|
|
2768
2808
|
);
|
|
2769
2809
|
return;
|
|
2770
2810
|
}
|
|
2771
|
-
if (
|
|
2772
|
-
const
|
|
2773
|
-
if (!
|
|
2811
|
+
if (u.type === "focus_field") {
|
|
2812
|
+
const H = typeof u.fieldName == "string" ? u.fieldName : null;
|
|
2813
|
+
if (!H) {
|
|
2774
2814
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2775
2815
|
return;
|
|
2776
2816
|
}
|
|
2777
|
-
const
|
|
2778
|
-
if (
|
|
2779
|
-
|
|
2780
|
-
`[LiveLayer] focus_field: field "${
|
|
2817
|
+
const V = vn(D, H);
|
|
2818
|
+
if (V.el === null) {
|
|
2819
|
+
V.reason === "private" ? console.warn(
|
|
2820
|
+
`[LiveLayer] focus_field: field "${H}" is privacy-protected and not focusable.`
|
|
2781
2821
|
) : console.warn(
|
|
2782
|
-
`[LiveLayer] focus_field: no input matching key="${
|
|
2822
|
+
`[LiveLayer] focus_field: no input matching key="${H}" in form "${x}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
|
|
2783
2823
|
);
|
|
2784
2824
|
return;
|
|
2785
2825
|
}
|
|
2786
|
-
|
|
2826
|
+
V.el.focus();
|
|
2787
2827
|
return;
|
|
2788
2828
|
}
|
|
2789
|
-
const
|
|
2790
|
-
if (!
|
|
2829
|
+
const F = u.values && typeof u.values == "object" ? u.values : null;
|
|
2830
|
+
if (!F) {
|
|
2791
2831
|
console.warn("[LiveLayer] fill_form: missing or invalid values.");
|
|
2792
2832
|
return;
|
|
2793
2833
|
}
|
|
2794
|
-
for (const [
|
|
2795
|
-
if (typeof
|
|
2796
|
-
const
|
|
2797
|
-
if (
|
|
2798
|
-
|
|
2799
|
-
`[LiveLayer] fill_form: field "${
|
|
2834
|
+
for (const [H, V] of Object.entries(F)) {
|
|
2835
|
+
if (typeof V != "string") continue;
|
|
2836
|
+
const G = vn(D, H);
|
|
2837
|
+
if (G.el === null) {
|
|
2838
|
+
G.reason === "private" ? console.warn(
|
|
2839
|
+
`[LiveLayer] fill_form: field "${H}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
2800
2840
|
) : console.warn(
|
|
2801
|
-
`[LiveLayer] fill_form: no input matching key="${
|
|
2841
|
+
`[LiveLayer] fill_form: no input matching key="${H}" in form "${x}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
|
|
2802
2842
|
);
|
|
2803
2843
|
continue;
|
|
2804
2844
|
}
|
|
2805
2845
|
try {
|
|
2806
|
-
|
|
2846
|
+
ui(G.el, V);
|
|
2807
2847
|
} catch (z) {
|
|
2808
2848
|
console.warn(
|
|
2809
|
-
`[LiveLayer] fill_form: failed to set "${
|
|
2849
|
+
`[LiveLayer] fill_form: failed to set "${H}".`,
|
|
2810
2850
|
z
|
|
2811
2851
|
);
|
|
2812
2852
|
}
|
|
2813
2853
|
}
|
|
2814
2854
|
return;
|
|
2815
2855
|
}
|
|
2816
|
-
if (
|
|
2817
|
-
if (!
|
|
2818
|
-
|
|
2856
|
+
if (u.type === "submit_form") {
|
|
2857
|
+
if (!be("submit_forms")) {
|
|
2858
|
+
we("submit_form", "submit_forms");
|
|
2819
2859
|
return;
|
|
2820
2860
|
}
|
|
2821
2861
|
if (typeof document > "u") return;
|
|
2822
|
-
const x = typeof
|
|
2862
|
+
const x = typeof u.formId == "string" ? u.formId : null;
|
|
2823
2863
|
if (!x) {
|
|
2824
2864
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
2825
2865
|
return;
|
|
@@ -2838,24 +2878,24 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2838
2878
|
);
|
|
2839
2879
|
return;
|
|
2840
2880
|
}
|
|
2841
|
-
const
|
|
2842
|
-
const
|
|
2881
|
+
const F = typeof u.requestId == "string" ? u.requestId : void 0, H = (ke = ve.current) == null ? void 0 : ke.call(ve), V = (te) => {
|
|
2882
|
+
const ae = H, Ye = ae == null ? void 0 : ae.localParticipant;
|
|
2843
2883
|
if (Ye != null && Ye.publishData)
|
|
2844
2884
|
try {
|
|
2845
|
-
const Un =
|
|
2885
|
+
const Un = F ? { ...te, requestId: F } : te, jn = new TextEncoder().encode(JSON.stringify(Un));
|
|
2846
2886
|
Ye.publishData(jn, { reliable: !0 });
|
|
2847
2887
|
} catch {
|
|
2848
2888
|
}
|
|
2849
2889
|
};
|
|
2850
|
-
let
|
|
2890
|
+
let G = !1;
|
|
2851
2891
|
const z = () => {
|
|
2852
|
-
|
|
2892
|
+
G = !0, V({ type: "form_submitted", formId: x });
|
|
2853
2893
|
};
|
|
2854
2894
|
D.addEventListener("submit", z, { once: !0 });
|
|
2855
2895
|
try {
|
|
2856
2896
|
typeof D.requestSubmit == "function" ? D.requestSubmit() : D.submit();
|
|
2857
|
-
} catch (
|
|
2858
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.",
|
|
2897
|
+
} catch (te) {
|
|
2898
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", te), D.removeEventListener("submit", z), V({
|
|
2859
2899
|
type: "form_submit_blocked",
|
|
2860
2900
|
formId: x,
|
|
2861
2901
|
reason: "exception"
|
|
@@ -2863,7 +2903,7 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2863
2903
|
return;
|
|
2864
2904
|
}
|
|
2865
2905
|
setTimeout(() => {
|
|
2866
|
-
|
|
2906
|
+
G || (D.removeEventListener("submit", z), V({
|
|
2867
2907
|
type: "form_submit_blocked",
|
|
2868
2908
|
formId: x,
|
|
2869
2909
|
reason: "validation"
|
|
@@ -2871,65 +2911,65 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2871
2911
|
}, 500);
|
|
2872
2912
|
return;
|
|
2873
2913
|
}
|
|
2874
|
-
if (
|
|
2875
|
-
if (!
|
|
2876
|
-
|
|
2914
|
+
if (u.type === "request_routes") {
|
|
2915
|
+
if (!be("read_page")) {
|
|
2916
|
+
we("request_routes", "read_page");
|
|
2877
2917
|
return;
|
|
2878
2918
|
}
|
|
2879
|
-
const x = typeof
|
|
2880
|
-
if (!(
|
|
2881
|
-
const
|
|
2919
|
+
const x = typeof u.requestId == "string" ? u.requestId : void 0, F = (ct = ve.current) == null ? void 0 : ct.call(ve), H = F == null ? void 0 : F.localParticipant;
|
|
2920
|
+
if (!(H != null && H.publishData)) return;
|
|
2921
|
+
const V = (z) => {
|
|
2882
2922
|
try {
|
|
2883
|
-
const
|
|
2884
|
-
|
|
2885
|
-
} catch (
|
|
2886
|
-
console.warn("[LiveLayer] request_routes: publishData failed.",
|
|
2923
|
+
const te = x ? { type: "routes", routes: z, requestId: x } : { type: "routes", routes: z }, ae = new TextEncoder().encode(JSON.stringify(te));
|
|
2924
|
+
H.publishData(ae, { reliable: !0 });
|
|
2925
|
+
} catch (te) {
|
|
2926
|
+
console.warn("[LiveLayer] request_routes: publishData failed.", te);
|
|
2887
2927
|
}
|
|
2888
|
-
},
|
|
2889
|
-
if (
|
|
2928
|
+
}, G = Ot.current;
|
|
2929
|
+
if (G) {
|
|
2890
2930
|
try {
|
|
2891
|
-
const z =
|
|
2892
|
-
if (!Array.isArray(
|
|
2893
|
-
|
|
2931
|
+
const z = G(), te = (ae) => {
|
|
2932
|
+
if (!Array.isArray(ae)) {
|
|
2933
|
+
V([]);
|
|
2894
2934
|
return;
|
|
2895
2935
|
}
|
|
2896
|
-
|
|
2936
|
+
V(ae.map(ni).slice(0, 200));
|
|
2897
2937
|
};
|
|
2898
|
-
z instanceof Promise ? z.then(
|
|
2938
|
+
z instanceof Promise ? z.then(te).catch((ae) => {
|
|
2899
2939
|
console.warn(
|
|
2900
2940
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
2901
|
-
|
|
2902
|
-
),
|
|
2903
|
-
}) :
|
|
2941
|
+
ae
|
|
2942
|
+
), V(Rt());
|
|
2943
|
+
}) : te(z);
|
|
2904
2944
|
} catch (z) {
|
|
2905
2945
|
console.warn(
|
|
2906
2946
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
2907
2947
|
z
|
|
2908
|
-
),
|
|
2948
|
+
), V(Rt());
|
|
2909
2949
|
}
|
|
2910
2950
|
return;
|
|
2911
2951
|
}
|
|
2912
2952
|
try {
|
|
2913
|
-
|
|
2953
|
+
V(Rt());
|
|
2914
2954
|
} catch (z) {
|
|
2915
2955
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", z);
|
|
2916
2956
|
}
|
|
2917
2957
|
return;
|
|
2918
2958
|
}
|
|
2919
|
-
if (
|
|
2920
|
-
if (!
|
|
2921
|
-
|
|
2959
|
+
if (u.type === "task_field_updated") {
|
|
2960
|
+
if (!be("collect_data")) {
|
|
2961
|
+
we("task_field_updated", "collect_data");
|
|
2922
2962
|
return;
|
|
2923
2963
|
}
|
|
2924
2964
|
const x = {
|
|
2925
2965
|
phase: "field",
|
|
2926
|
-
fieldId: typeof
|
|
2927
|
-
fieldName: typeof
|
|
2928
|
-
value: typeof
|
|
2929
|
-
kind: typeof
|
|
2930
|
-
source:
|
|
2931
|
-
...typeof
|
|
2932
|
-
...typeof
|
|
2966
|
+
fieldId: typeof u.fieldId == "string" ? u.fieldId : "",
|
|
2967
|
+
fieldName: typeof u.fieldName == "string" ? u.fieldName : typeof u.fieldId == "string" ? u.fieldId : "",
|
|
2968
|
+
value: typeof u.value == "string" ? u.value : "",
|
|
2969
|
+
kind: typeof u.kind == "string" ? u.kind : "text",
|
|
2970
|
+
source: u.source === "slide" ? "slide" : u.source === "page" ? "page" : "agent",
|
|
2971
|
+
...typeof u.slideId == "string" ? { slideId: u.slideId } : {},
|
|
2972
|
+
...typeof u.formId == "string" ? { formId: u.formId } : {}
|
|
2933
2973
|
};
|
|
2934
2974
|
if (typeof document < "u")
|
|
2935
2975
|
try {
|
|
@@ -2940,12 +2980,12 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2940
2980
|
}
|
|
2941
2981
|
return;
|
|
2942
2982
|
}
|
|
2943
|
-
if (
|
|
2944
|
-
if (!
|
|
2945
|
-
|
|
2983
|
+
if (u.type === "task_completed") {
|
|
2984
|
+
if (!be("collect_data")) {
|
|
2985
|
+
we("task_completed", "collect_data");
|
|
2946
2986
|
return;
|
|
2947
2987
|
}
|
|
2948
|
-
const x =
|
|
2988
|
+
const x = u.result;
|
|
2949
2989
|
if (!x || typeof x != "object") {
|
|
2950
2990
|
console.warn(
|
|
2951
2991
|
"[LiveLayer] task_completed missing `result` payload."
|
|
@@ -2962,7 +3002,7 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2962
3002
|
} catch {
|
|
2963
3003
|
}
|
|
2964
3004
|
try {
|
|
2965
|
-
|
|
3005
|
+
Me == null || Me(
|
|
2966
3006
|
x
|
|
2967
3007
|
);
|
|
2968
3008
|
} catch (D) {
|
|
@@ -2970,34 +3010,34 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2970
3010
|
}
|
|
2971
3011
|
return;
|
|
2972
3012
|
}
|
|
2973
|
-
|
|
3013
|
+
yi.has(u.type) || Te == null || Te(u);
|
|
2974
3014
|
}
|
|
2975
3015
|
},
|
|
2976
|
-
[
|
|
2977
|
-
),
|
|
3016
|
+
[Te, Re, Me]
|
|
3017
|
+
), ee = er({
|
|
2978
3018
|
agentId: $ ? "__controlled__" : nt,
|
|
2979
|
-
baseUrl:
|
|
2980
|
-
apiKey:
|
|
3019
|
+
baseUrl: o,
|
|
3020
|
+
apiKey: a,
|
|
2981
3021
|
sessionEndpoint: s,
|
|
2982
|
-
sessionBody:
|
|
3022
|
+
sessionBody: l,
|
|
2983
3023
|
onDataMessage: $ ? void 0 : at
|
|
2984
3024
|
});
|
|
2985
|
-
|
|
3025
|
+
T(() => {
|
|
2986
3026
|
if ($ != null && $.subscribeToDataMessages)
|
|
2987
3027
|
return $.subscribeToDataMessages(at);
|
|
2988
|
-
}, [$, at]),
|
|
3028
|
+
}, [$, at]), ve.current = () => {
|
|
2989
3029
|
var y;
|
|
2990
|
-
return (y =
|
|
2991
|
-
},
|
|
2992
|
-
var
|
|
3030
|
+
return (y = ee.getRoom) == null ? void 0 : y.call(ee);
|
|
3031
|
+
}, T(() => {
|
|
3032
|
+
var X;
|
|
2993
3033
|
if (typeof window > "u") return;
|
|
2994
|
-
const y = ((
|
|
3034
|
+
const y = ((X = window.location) == null ? void 0 : X.hostname) || "";
|
|
2995
3035
|
if (y === "localhost" || y === "127.0.0.1" || y === "0.0.0.0" || y.endsWith(".local") || y.endsWith(".test"))
|
|
2996
|
-
return window.__livelayerSimulateCommand = (
|
|
3036
|
+
return window.__livelayerSimulateCommand = (he) => {
|
|
2997
3037
|
try {
|
|
2998
|
-
at(
|
|
2999
|
-
} catch (
|
|
3000
|
-
console.warn("[LiveLayer] simulate-command threw:",
|
|
3038
|
+
at(he);
|
|
3039
|
+
} catch (ke) {
|
|
3040
|
+
console.warn("[LiveLayer] simulate-command threw:", ke);
|
|
3001
3041
|
}
|
|
3002
3042
|
}, () => {
|
|
3003
3043
|
delete window.__livelayerSimulateCommand;
|
|
@@ -3019,43 +3059,43 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3019
3059
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
3020
3060
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
3021
3061
|
// so we reuse its reference for type consistency.
|
|
3022
|
-
getRoom:
|
|
3062
|
+
getRoom: ee.getRoom,
|
|
3023
3063
|
isControlled: !0
|
|
3024
3064
|
} : {
|
|
3025
|
-
connectionState:
|
|
3026
|
-
agentState:
|
|
3027
|
-
transcript:
|
|
3028
|
-
videoElement:
|
|
3029
|
-
audioElement:
|
|
3030
|
-
canResume:
|
|
3031
|
-
error:
|
|
3032
|
-
agentConfig:
|
|
3033
|
-
connect:
|
|
3034
|
-
disconnect:
|
|
3035
|
-
getRoom:
|
|
3065
|
+
connectionState: ee.connectionState,
|
|
3066
|
+
agentState: ee.agentState,
|
|
3067
|
+
transcript: ee.transcript,
|
|
3068
|
+
videoElement: ee.videoElement,
|
|
3069
|
+
audioElement: ee.audioElement,
|
|
3070
|
+
canResume: ee.canResume,
|
|
3071
|
+
error: ee.error,
|
|
3072
|
+
agentConfig: ee.agentConfig,
|
|
3073
|
+
connect: ee.connect,
|
|
3074
|
+
disconnect: ee.disconnect,
|
|
3075
|
+
getRoom: ee.getRoom,
|
|
3036
3076
|
isControlled: !1
|
|
3037
|
-
}, [$,
|
|
3077
|
+
}, [$, ee]), Bt = A(k);
|
|
3038
3078
|
Bt.current = k;
|
|
3039
|
-
const Wt =
|
|
3079
|
+
const Wt = A($);
|
|
3040
3080
|
Wt.current = $, Yn(
|
|
3041
3081
|
r,
|
|
3042
3082
|
() => ({
|
|
3043
3083
|
sendData: async (y) => {
|
|
3044
|
-
var
|
|
3045
|
-
const
|
|
3046
|
-
if (
|
|
3084
|
+
var ke, ct;
|
|
3085
|
+
const u = Wt.current;
|
|
3086
|
+
if (u != null && u.publishData) {
|
|
3047
3087
|
try {
|
|
3048
|
-
await
|
|
3088
|
+
await u.publishData(y);
|
|
3049
3089
|
} catch (x) {
|
|
3050
3090
|
console.warn("[AvatarWidget] sendData (controlled) failed:", x);
|
|
3051
3091
|
}
|
|
3052
3092
|
return;
|
|
3053
3093
|
}
|
|
3054
|
-
const
|
|
3055
|
-
if (
|
|
3094
|
+
const X = (ct = (ke = Bt.current) == null ? void 0 : ke.getRoom) == null ? void 0 : ct.call(ke), he = X == null ? void 0 : X.localParticipant;
|
|
3095
|
+
if (he != null && he.publishData)
|
|
3056
3096
|
try {
|
|
3057
3097
|
const x = new TextEncoder().encode(JSON.stringify(y));
|
|
3058
|
-
await
|
|
3098
|
+
await he.publishData(x, { reliable: !0 });
|
|
3059
3099
|
} catch (x) {
|
|
3060
3100
|
console.warn("[AvatarWidget] sendData failed:", x);
|
|
3061
3101
|
}
|
|
@@ -3063,119 +3103,119 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3063
3103
|
}),
|
|
3064
3104
|
[]
|
|
3065
3105
|
);
|
|
3066
|
-
const Ft =
|
|
3067
|
-
|
|
3068
|
-
const y = k.videoElement,
|
|
3069
|
-
if (!(!y || !
|
|
3070
|
-
return
|
|
3071
|
-
y.parentNode ===
|
|
3106
|
+
const Ft = A(null);
|
|
3107
|
+
T(() => {
|
|
3108
|
+
const y = k.videoElement, u = Ft.current;
|
|
3109
|
+
if (!(!y || !u))
|
|
3110
|
+
return u.appendChild(y), () => {
|
|
3111
|
+
y.parentNode === u && u.removeChild(y);
|
|
3072
3112
|
};
|
|
3073
|
-
}, [k.videoElement]),
|
|
3113
|
+
}, [k.videoElement]), T(() => {
|
|
3074
3114
|
const y = k.audioElement;
|
|
3075
3115
|
if (!y) return;
|
|
3076
3116
|
rt.attach(y);
|
|
3077
|
-
const
|
|
3078
|
-
return
|
|
3079
|
-
(
|
|
3117
|
+
const u = y.play();
|
|
3118
|
+
return u && typeof u.catch == "function" && u.catch((X) => {
|
|
3119
|
+
(X == null ? void 0 : X.name) === "NotAllowedError" && ge(!0);
|
|
3080
3120
|
}), () => {
|
|
3081
3121
|
rt.detach();
|
|
3082
3122
|
};
|
|
3083
|
-
}, [k.audioElement]),
|
|
3123
|
+
}, [k.audioElement]), T(() => {
|
|
3084
3124
|
if (k.isControlled || k.connectionState !== "connected") return;
|
|
3085
3125
|
const y = k.getRoom();
|
|
3086
3126
|
if (y)
|
|
3087
|
-
return
|
|
3127
|
+
return se.setupMic(y).catch(() => {
|
|
3088
3128
|
}), () => {
|
|
3089
|
-
|
|
3129
|
+
se.teardownMic();
|
|
3090
3130
|
};
|
|
3091
|
-
}, [k.isControlled, k.connectionState]),
|
|
3092
|
-
var
|
|
3131
|
+
}, [k.isControlled, k.connectionState]), T(() => {
|
|
3132
|
+
var u;
|
|
3093
3133
|
if (k.connectionState !== "connected") return;
|
|
3094
|
-
const y = k.isControlled ? (
|
|
3134
|
+
const y = k.isControlled ? (u = $ == null ? void 0 : $.getRoom) == null ? void 0 : u.call($) : k.getRoom();
|
|
3095
3135
|
if (y)
|
|
3096
|
-
return
|
|
3097
|
-
|
|
3136
|
+
return de.attachRoom(y), Ce.attachRoom(y), k.isControlled && se.attachRoom(y), it.refresh(), () => {
|
|
3137
|
+
de.teardown(), Ce.teardown();
|
|
3098
3138
|
};
|
|
3099
|
-
}, [k.isControlled, k.connectionState, $]),
|
|
3139
|
+
}, [k.isControlled, k.connectionState, $]), T(() => {
|
|
3100
3140
|
const y = k.audioElement;
|
|
3101
|
-
y && (y.muted =
|
|
3102
|
-
}, [k.audioElement,
|
|
3103
|
-
const
|
|
3104
|
-
const
|
|
3141
|
+
y && (y.muted = J);
|
|
3142
|
+
}, [k.audioElement, J]);
|
|
3143
|
+
const Tn = C((y) => {
|
|
3144
|
+
const u = { type: "user_message", text: y };
|
|
3105
3145
|
if ($ != null && $.publishData) {
|
|
3106
3146
|
try {
|
|
3107
|
-
$.publishData(
|
|
3147
|
+
$.publishData(u);
|
|
3108
3148
|
} catch {
|
|
3109
3149
|
}
|
|
3110
3150
|
return;
|
|
3111
3151
|
}
|
|
3112
|
-
const
|
|
3113
|
-
if (
|
|
3152
|
+
const X = k.getRoom();
|
|
3153
|
+
if (X)
|
|
3114
3154
|
try {
|
|
3115
|
-
const
|
|
3116
|
-
|
|
3155
|
+
const he = new TextEncoder().encode(JSON.stringify(u));
|
|
3156
|
+
X.localParticipant.publishData(he, { reliable: !0 });
|
|
3117
3157
|
} catch {
|
|
3118
3158
|
}
|
|
3119
|
-
}, [k, $]),
|
|
3159
|
+
}, [k, $]), Mn = C(() => {
|
|
3120
3160
|
Rn((y) => !y);
|
|
3121
3161
|
}, []);
|
|
3122
|
-
|
|
3123
|
-
Ie == null || Ie(k.connectionState), k.connectionState === "connected" ? Ne == null || Ne() : k.connectionState === "disconnected" && (
|
|
3124
|
-
}, [k.connectionState, Ne,
|
|
3162
|
+
T(() => {
|
|
3163
|
+
Ie == null || Ie(k.connectionState), k.connectionState === "connected" ? Ne == null || Ne() : k.connectionState === "disconnected" && (Oe == null || Oe());
|
|
3164
|
+
}, [k.connectionState, Ne, Oe, Ie]), T(() => {
|
|
3125
3165
|
Ae == null || Ae(k.transcript);
|
|
3126
|
-
}, [k.transcript, Ae]),
|
|
3166
|
+
}, [k.transcript, Ae]), T(() => {
|
|
3127
3167
|
Be == null || Be(k.agentState);
|
|
3128
|
-
}, [k.agentState, Be]),
|
|
3168
|
+
}, [k.agentState, Be]), T(() => {
|
|
3129
3169
|
gt.setThinking(k.agentState === "thinking");
|
|
3130
3170
|
}, [k.agentState, gt]);
|
|
3131
|
-
const qt =
|
|
3132
|
-
|
|
3171
|
+
const qt = A(!1);
|
|
3172
|
+
T(() => {
|
|
3133
3173
|
!v || qt.current || tt && k.connectionState === "idle" && (qt.current = !0, k.connect());
|
|
3134
3174
|
}, [v, k.connectionState, k, tt]);
|
|
3135
3175
|
const Dn = C(
|
|
3136
3176
|
(y) => {
|
|
3137
|
-
const
|
|
3138
|
-
|
|
3177
|
+
const u = N == null ? void 0 : N.find((X) => X.id === y);
|
|
3178
|
+
u && (lt(!1), y !== Le && (ot(!0), k.disconnect(), Pe || kt(y), I == null || I(u)));
|
|
3139
3179
|
},
|
|
3140
3180
|
[
|
|
3141
|
-
|
|
3142
|
-
|
|
3181
|
+
N,
|
|
3182
|
+
Le,
|
|
3143
3183
|
k,
|
|
3144
3184
|
Pe,
|
|
3145
|
-
|
|
3185
|
+
I
|
|
3146
3186
|
]
|
|
3147
3187
|
);
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
}, [k.connectionState,
|
|
3188
|
+
T(() => {
|
|
3189
|
+
ye && k.connectionState === "connected" && ot(!1);
|
|
3190
|
+
}, [k.connectionState, ye]), T(() => {
|
|
3151
3191
|
if (!je) return;
|
|
3152
|
-
const y = (
|
|
3153
|
-
|
|
3192
|
+
const y = (u) => {
|
|
3193
|
+
u.key === "Escape" && lt(!1);
|
|
3154
3194
|
};
|
|
3155
3195
|
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
3156
3196
|
}, [je]);
|
|
3157
|
-
const Pn = !!P || !!(
|
|
3197
|
+
const Pn = !!P || !!(oe != null && oe.avatarImageUrl) || k.isControlled, st = ar(nt, o, Pn);
|
|
3158
3198
|
et === void 0 && ((Yt = st.info) != null && Yt.capabilities) && (At.current = st.info.capabilities);
|
|
3159
|
-
const vt = (
|
|
3160
|
-
() =>
|
|
3161
|
-
[
|
|
3199
|
+
const vt = (oe == null ? void 0 : oe.name) ?? O ?? ((Gt = k.agentConfig) == null ? void 0 : Gt.name) ?? ((Kt = st.info) == null ? void 0 : Kt.name) ?? "Live Layer", It = (oe == null ? void 0 : oe.avatarImageUrl) ?? P ?? ((Jt = k.agentConfig) == null ? void 0 : Jt.avatarImageUrl) ?? ((Xt = st.info) == null ? void 0 : Xt.avatarImageUrl) ?? null, $n = U ?? ((Qt = k.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((Zt = st.info) == null ? void 0 : Zt.idleLoopUrl) ?? null, zn = g ?? null, Hn = C(() => ue("expanded"), [ue]), On = C(
|
|
3200
|
+
() => ue("minimized"),
|
|
3201
|
+
[ue]
|
|
3162
3202
|
), Ut = C(() => {
|
|
3163
|
-
k.disconnect(),
|
|
3164
|
-
}, [k,
|
|
3203
|
+
k.disconnect(), ue("hidden");
|
|
3204
|
+
}, [k, ue]), Bn = C(() => {
|
|
3165
3205
|
const y = k.audioElement;
|
|
3166
|
-
y && y.play().then(() =>
|
|
3206
|
+
y && y.play().then(() => ge(!1)).catch(() => {
|
|
3167
3207
|
});
|
|
3168
3208
|
}, [k.audioElement]), Wn = C(() => {
|
|
3169
|
-
|
|
3209
|
+
ge(!1), k.connect();
|
|
3170
3210
|
}, [k]), Ve = {
|
|
3171
3211
|
...De,
|
|
3172
|
-
...
|
|
3212
|
+
...me ? {} : { zIndex: We }
|
|
3173
3213
|
};
|
|
3174
|
-
|
|
3214
|
+
q.primaryColor && (Ve["--ll-color-primary"] = q.primaryColor), q.accentColor && (Ve["--ll-color-accent"] = q.accentColor), q.backgroundColor && (Ve["--ll-color-bg"] = q.backgroundColor), q.textColor && (Ve["--ll-color-fg"] = q.textColor);
|
|
3175
3215
|
const Fn = [
|
|
3176
3216
|
"ll-widget",
|
|
3177
|
-
`ll-widget--${
|
|
3178
|
-
`ll-widget--${
|
|
3217
|
+
`ll-widget--${le}`,
|
|
3218
|
+
`ll-widget--${Ee ? "mobile" : "desktop"}`,
|
|
3179
3219
|
xt
|
|
3180
3220
|
].filter(Boolean).join(" ");
|
|
3181
3221
|
if (!tt) return null;
|
|
@@ -3184,52 +3224,52 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3184
3224
|
{
|
|
3185
3225
|
className: Fn,
|
|
3186
3226
|
style: Ve,
|
|
3187
|
-
"data-display-mode":
|
|
3227
|
+
"data-display-mode": le,
|
|
3188
3228
|
"data-position": L,
|
|
3189
3229
|
"data-experience-mode": p === "EMBEDDED" ? "embedded" : "widget",
|
|
3190
|
-
children:
|
|
3230
|
+
children: le === "expanded" && /* @__PURE__ */ n(
|
|
3191
3231
|
Wr,
|
|
3192
3232
|
{
|
|
3193
3233
|
position: L,
|
|
3194
|
-
isMobile:
|
|
3234
|
+
isMobile: Ee,
|
|
3195
3235
|
agentName: vt,
|
|
3196
3236
|
avatarImageUrl: It,
|
|
3197
3237
|
idleLoopUrl: $n,
|
|
3198
3238
|
greeting: zn,
|
|
3199
|
-
branding:
|
|
3200
|
-
teamMembers:
|
|
3201
|
-
currentTeamMemberId:
|
|
3202
|
-
isSwitchingTeamMember:
|
|
3239
|
+
branding: q,
|
|
3240
|
+
teamMembers: N,
|
|
3241
|
+
currentTeamMemberId: Le,
|
|
3242
|
+
isSwitchingTeamMember: ye,
|
|
3203
3243
|
teamSwitcherOpen: je,
|
|
3204
3244
|
onToggleTeamSwitcher: () => lt((y) => !y),
|
|
3205
3245
|
onSelectTeamMember: Dn,
|
|
3206
3246
|
connectionState: k.connectionState,
|
|
3207
3247
|
agentState: k.agentState,
|
|
3208
3248
|
transcript: k.transcript,
|
|
3209
|
-
isMuted:
|
|
3210
|
-
micDevices:
|
|
3211
|
-
activeMicId:
|
|
3212
|
-
isCameraEnabled:
|
|
3213
|
-
cameraPreviewEl:
|
|
3214
|
-
cameraDevices:
|
|
3215
|
-
activeCameraId:
|
|
3249
|
+
isMuted: se.isMuted,
|
|
3250
|
+
micDevices: it.mics,
|
|
3251
|
+
activeMicId: se.activeDeviceId,
|
|
3252
|
+
isCameraEnabled: de.isEnabled,
|
|
3253
|
+
cameraPreviewEl: de.previewEl,
|
|
3254
|
+
cameraDevices: it.cameras,
|
|
3255
|
+
activeCameraId: de.activeDeviceId,
|
|
3216
3256
|
isScreenShareEnabled: Ce.isEnabled,
|
|
3217
3257
|
screenPreviewEl: Ce.previewEl,
|
|
3218
|
-
isSpeakerMuted:
|
|
3219
|
-
allowCamera:
|
|
3258
|
+
isSpeakerMuted: J,
|
|
3259
|
+
allowCamera: ne,
|
|
3220
3260
|
allowScreenShare: B,
|
|
3221
|
-
allowTyping:
|
|
3261
|
+
allowTyping: j,
|
|
3222
3262
|
showMinimize: pt,
|
|
3223
3263
|
showClose: ht,
|
|
3224
|
-
chromeless:
|
|
3264
|
+
chromeless: _e,
|
|
3225
3265
|
compactControls: ze,
|
|
3226
|
-
transforming:
|
|
3227
|
-
transformingLabel:
|
|
3266
|
+
transforming: He,
|
|
3267
|
+
transformingLabel: Q,
|
|
3228
3268
|
languageMenuOpen: mt,
|
|
3229
3269
|
onToggleLanguageMenu: () => m((y) => !y),
|
|
3230
3270
|
needsUserGesture: Lt,
|
|
3231
3271
|
canResume: k.canResume,
|
|
3232
|
-
micError:
|
|
3272
|
+
micError: se.micError,
|
|
3233
3273
|
error: k.error,
|
|
3234
3274
|
avatarVideoContainerRef: Ft,
|
|
3235
3275
|
agentVideoEl: k.videoElement,
|
|
@@ -3237,63 +3277,63 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3237
3277
|
onDisconnect: () => k.disconnect(),
|
|
3238
3278
|
onRetry: Wn,
|
|
3239
3279
|
onResumeAudio: Bn,
|
|
3240
|
-
onToggleMute:
|
|
3241
|
-
onSwitchMicDevice: (y) => void
|
|
3242
|
-
onToggleCamera: () => void
|
|
3243
|
-
onSwitchCameraDevice: (y) => void
|
|
3280
|
+
onToggleMute: se.toggleMute,
|
|
3281
|
+
onSwitchMicDevice: (y) => void se.switchDevice(y),
|
|
3282
|
+
onToggleCamera: () => void de.toggle(),
|
|
3283
|
+
onSwitchCameraDevice: (y) => void de.switchDevice(y),
|
|
3244
3284
|
onToggleScreenShare: () => void Ce.toggle(),
|
|
3245
|
-
onToggleSpeaker:
|
|
3246
|
-
onSendMessage:
|
|
3247
|
-
onMinimize:
|
|
3285
|
+
onToggleSpeaker: Mn,
|
|
3286
|
+
onSendMessage: Tn,
|
|
3287
|
+
onMinimize: On,
|
|
3248
3288
|
onClose: Ut,
|
|
3249
|
-
onClearMicError:
|
|
3289
|
+
onClearMicError: se.clearError
|
|
3250
3290
|
}
|
|
3251
3291
|
)
|
|
3252
3292
|
}
|
|
3253
|
-
), jt = !
|
|
3293
|
+
), jt = !me && (le === "hidden" || le === "minimized") ? /* @__PURE__ */ w(
|
|
3254
3294
|
"div",
|
|
3255
3295
|
{
|
|
3256
3296
|
className: [
|
|
3257
3297
|
"ll-widget",
|
|
3258
3298
|
"ll-widget--floating",
|
|
3259
|
-
`ll-widget--${
|
|
3260
|
-
`ll-widget--${
|
|
3299
|
+
`ll-widget--${le}`,
|
|
3300
|
+
`ll-widget--${Ee ? "mobile" : "desktop"}`
|
|
3261
3301
|
].join(" "),
|
|
3262
3302
|
style: Ve,
|
|
3263
|
-
"data-display-mode":
|
|
3303
|
+
"data-display-mode": le,
|
|
3264
3304
|
"data-position": L,
|
|
3265
3305
|
children: [
|
|
3266
|
-
|
|
3267
|
-
|
|
3306
|
+
le === "hidden" && /* @__PURE__ */ n(
|
|
3307
|
+
Tr,
|
|
3268
3308
|
{
|
|
3269
3309
|
position: L,
|
|
3270
|
-
isMobile:
|
|
3310
|
+
isMobile: Ee,
|
|
3271
3311
|
isSpeaking: k.agentState === "speaking",
|
|
3272
|
-
onExpand: () =>
|
|
3312
|
+
onExpand: () => ue("expanded"),
|
|
3273
3313
|
label: `Open ${vt} widget`,
|
|
3274
3314
|
avatarImageUrl: It,
|
|
3275
3315
|
agentName: vt,
|
|
3276
|
-
containerEl:
|
|
3316
|
+
containerEl: ce
|
|
3277
3317
|
}
|
|
3278
3318
|
),
|
|
3279
|
-
|
|
3319
|
+
le === "minimized" && /* @__PURE__ */ n(
|
|
3280
3320
|
Dr,
|
|
3281
3321
|
{
|
|
3282
3322
|
position: L,
|
|
3283
|
-
isMobile:
|
|
3323
|
+
isMobile: Ee,
|
|
3284
3324
|
agentName: vt,
|
|
3285
3325
|
avatarImageUrl: It,
|
|
3286
3326
|
agentState: k.agentState,
|
|
3287
|
-
isMuted:
|
|
3327
|
+
isMuted: se.isMuted,
|
|
3288
3328
|
audioLevel: rt,
|
|
3289
|
-
onExpand:
|
|
3290
|
-
onToggleMute:
|
|
3329
|
+
onExpand: Hn,
|
|
3330
|
+
onToggleMute: se.toggleMute,
|
|
3291
3331
|
onClose: Ut
|
|
3292
3332
|
}
|
|
3293
3333
|
)
|
|
3294
3334
|
]
|
|
3295
3335
|
}
|
|
3296
|
-
) : null, Vt =
|
|
3336
|
+
) : null, Vt = ce ?? (typeof document < "u" ? document.body : null);
|
|
3297
3337
|
return /* @__PURE__ */ w($e, { children: [
|
|
3298
3338
|
qn,
|
|
3299
3339
|
jt && Vt && Pt(jt, Vt)
|
|
@@ -3301,133 +3341,133 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3301
3341
|
}
|
|
3302
3342
|
);
|
|
3303
3343
|
In.displayName = "AvatarWidgetInner";
|
|
3304
|
-
const
|
|
3344
|
+
const vi = Dt(
|
|
3305
3345
|
function(t, r) {
|
|
3306
3346
|
return /* @__PURE__ */ n(Zn, { children: /* @__PURE__ */ n(In, { ...t, ref: r }) });
|
|
3307
3347
|
}
|
|
3308
3348
|
);
|
|
3309
|
-
|
|
3310
|
-
const
|
|
3349
|
+
vi.displayName = "AvatarWidget";
|
|
3350
|
+
const Ai = ({
|
|
3311
3351
|
agentId: e,
|
|
3312
3352
|
baseUrl: t,
|
|
3313
3353
|
apiKey: r,
|
|
3314
|
-
mode:
|
|
3315
|
-
onAgentEvent:
|
|
3316
|
-
className:
|
|
3354
|
+
mode: i,
|
|
3355
|
+
onAgentEvent: a,
|
|
3356
|
+
className: o,
|
|
3317
3357
|
style: s
|
|
3318
3358
|
}) => {
|
|
3319
|
-
const
|
|
3320
|
-
p.current =
|
|
3359
|
+
const l = A(null), c = A(null), p = A(a);
|
|
3360
|
+
p.current = a;
|
|
3321
3361
|
const v = C((f) => {
|
|
3322
|
-
var
|
|
3323
|
-
const
|
|
3324
|
-
(
|
|
3362
|
+
var R;
|
|
3363
|
+
const d = f.detail;
|
|
3364
|
+
(R = p.current) == null || R.call(p, d);
|
|
3325
3365
|
}, []);
|
|
3326
|
-
return
|
|
3327
|
-
const f =
|
|
3366
|
+
return T(() => {
|
|
3367
|
+
const f = l.current;
|
|
3328
3368
|
if (!f) return;
|
|
3329
|
-
const
|
|
3330
|
-
return
|
|
3331
|
-
|
|
3369
|
+
const d = document.createElement("livelayer-widget");
|
|
3370
|
+
return d.setAttribute("agent-id", e), t && d.setAttribute("base-url", t), r && d.setAttribute("api-key", r), i && d.setAttribute("mode", i), d.addEventListener("agent-event", v), f.appendChild(d), c.current = d, () => {
|
|
3371
|
+
d.removeEventListener("agent-event", v), f.removeChild(d), c.current = null;
|
|
3332
3372
|
};
|
|
3333
|
-
}, [e]),
|
|
3334
|
-
c.current && (
|
|
3335
|
-
}, [
|
|
3336
|
-
},
|
|
3337
|
-
function({ id: t, intent: r, as:
|
|
3373
|
+
}, [e]), T(() => {
|
|
3374
|
+
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
3375
|
+
}, [i]), /* @__PURE__ */ n("div", { ref: l, className: o, style: s });
|
|
3376
|
+
}, Ii = Dt(
|
|
3377
|
+
function({ id: t, intent: r, as: i = "div", className: a, style: o, children: s }, l) {
|
|
3338
3378
|
return Gn(
|
|
3339
|
-
|
|
3379
|
+
i,
|
|
3340
3380
|
{
|
|
3341
|
-
ref:
|
|
3381
|
+
ref: l,
|
|
3342
3382
|
"data-ll-region": t,
|
|
3343
3383
|
"data-ll-intent": r,
|
|
3344
|
-
className:
|
|
3345
|
-
style:
|
|
3384
|
+
className: a,
|
|
3385
|
+
style: o
|
|
3346
3386
|
},
|
|
3347
3387
|
s
|
|
3348
3388
|
);
|
|
3349
3389
|
}
|
|
3350
3390
|
);
|
|
3351
|
-
function
|
|
3352
|
-
const { onFieldUpdate: t, onComplete: r, source:
|
|
3353
|
-
|
|
3354
|
-
v.current = t, f.current = r,
|
|
3355
|
-
}, [t, r,
|
|
3356
|
-
const
|
|
3357
|
-
|
|
3391
|
+
function Ri(e = {}) {
|
|
3392
|
+
const { onFieldUpdate: t, onComplete: r, source: i = "all" } = e, [a, o] = S({}), [s, l] = S(!1), [c, p] = S(null), v = A(t), f = A(r), d = A(i);
|
|
3393
|
+
T(() => {
|
|
3394
|
+
v.current = t, f.current = r, d.current = i;
|
|
3395
|
+
}, [t, r, i]);
|
|
3396
|
+
const R = C(() => {
|
|
3397
|
+
o({}), l(!1);
|
|
3358
3398
|
}, []);
|
|
3359
|
-
return
|
|
3399
|
+
return T(() => {
|
|
3360
3400
|
if (typeof window > "u") return;
|
|
3361
3401
|
const L = (_) => {
|
|
3362
|
-
var b,
|
|
3402
|
+
var b, N;
|
|
3363
3403
|
const h = _.detail;
|
|
3364
3404
|
if (h) {
|
|
3365
3405
|
if (h.phase === "field") {
|
|
3366
|
-
if (
|
|
3406
|
+
if (d.current !== "all" && h.source !== d.current)
|
|
3367
3407
|
return;
|
|
3368
|
-
|
|
3369
|
-
(
|
|
3408
|
+
l(!0), o(
|
|
3409
|
+
(M) => M[h.fieldName] === h.value ? M : { ...M, [h.fieldName]: h.value }
|
|
3370
3410
|
);
|
|
3371
3411
|
try {
|
|
3372
3412
|
(b = v.current) == null || b.call(v, h);
|
|
3373
|
-
} catch (
|
|
3374
|
-
console.warn("[LiveLayer] useCollect onFieldUpdate threw.",
|
|
3413
|
+
} catch (M) {
|
|
3414
|
+
console.warn("[LiveLayer] useCollect onFieldUpdate threw.", M);
|
|
3375
3415
|
}
|
|
3376
3416
|
return;
|
|
3377
3417
|
}
|
|
3378
3418
|
if (h.phase === "complete") {
|
|
3379
|
-
const
|
|
3380
|
-
if (
|
|
3419
|
+
const M = h.result;
|
|
3420
|
+
if (d.current !== "all" && M.source !== d.current)
|
|
3381
3421
|
return;
|
|
3382
|
-
p(
|
|
3422
|
+
p(M), l(!1);
|
|
3383
3423
|
try {
|
|
3384
|
-
(
|
|
3385
|
-
} catch (
|
|
3386
|
-
console.warn("[LiveLayer] useCollect onComplete threw.",
|
|
3424
|
+
(N = f.current) == null || N.call(f, M);
|
|
3425
|
+
} catch (I) {
|
|
3426
|
+
console.warn("[LiveLayer] useCollect onComplete threw.", I);
|
|
3387
3427
|
}
|
|
3388
3428
|
}
|
|
3389
3429
|
}
|
|
3390
3430
|
};
|
|
3391
3431
|
return document.addEventListener("ll-collected", L), () => document.removeEventListener("ll-collected", L);
|
|
3392
|
-
}, []), { fields:
|
|
3432
|
+
}, []), { fields: a, isCollecting: s, lastResult: c, reset: R };
|
|
3393
3433
|
}
|
|
3394
3434
|
let _n = 1;
|
|
3395
|
-
function
|
|
3435
|
+
function Ti({
|
|
3396
3436
|
onMount: e,
|
|
3397
3437
|
defaultOpen: t = !1,
|
|
3398
3438
|
storageKey: r = "ll-debug-open"
|
|
3399
3439
|
}) {
|
|
3400
|
-
const [
|
|
3401
|
-
|
|
3440
|
+
const [i, a] = S(t), [o, s] = S([]), [l, c] = S(""), [p, v] = S(!1), f = A(/* @__PURE__ */ new Set()), d = A([]), R = A(p);
|
|
3441
|
+
R.current = p, T(() => {
|
|
3402
3442
|
try {
|
|
3403
3443
|
const h = localStorage.getItem(r);
|
|
3404
|
-
h === "1" &&
|
|
3444
|
+
h === "1" && a(!0), h === "0" && a(!1);
|
|
3405
3445
|
} catch {
|
|
3406
3446
|
}
|
|
3407
|
-
}, [r]),
|
|
3447
|
+
}, [r]), T(() => {
|
|
3408
3448
|
try {
|
|
3409
|
-
localStorage.setItem(r,
|
|
3449
|
+
localStorage.setItem(r, i ? "1" : "0");
|
|
3410
3450
|
} catch {
|
|
3411
3451
|
}
|
|
3412
|
-
}, [
|
|
3452
|
+
}, [i, r]), T(() => {
|
|
3413
3453
|
const h = (b) => {
|
|
3414
|
-
(b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(),
|
|
3454
|
+
(b.metaKey || b.ctrlKey) && b.shiftKey && b.key.toLowerCase() === "l" && (b.preventDefault(), a((N) => !N));
|
|
3415
3455
|
};
|
|
3416
3456
|
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
3417
|
-
}, []),
|
|
3457
|
+
}, []), T(() => {
|
|
3418
3458
|
const h = setInterval(() => {
|
|
3419
|
-
if (
|
|
3420
|
-
const b =
|
|
3459
|
+
if (d.current.length === 0 || R.current) return;
|
|
3460
|
+
const b = d.current.splice(0, d.current.length);
|
|
3421
3461
|
s(
|
|
3422
|
-
(
|
|
3462
|
+
(N) => [...b.reverse(), ...N].slice(0, 200)
|
|
3423
3463
|
);
|
|
3424
3464
|
}, 100);
|
|
3425
3465
|
return () => clearInterval(h);
|
|
3426
3466
|
}, []);
|
|
3427
|
-
const L =
|
|
3428
|
-
if (
|
|
3467
|
+
const L = A(!1);
|
|
3468
|
+
if (T(() => {
|
|
3429
3469
|
!e || L.current || (L.current = !0, e((h) => {
|
|
3430
|
-
|
|
3470
|
+
d.current.push({
|
|
3431
3471
|
id: _n++,
|
|
3432
3472
|
ts: Date.now(),
|
|
3433
3473
|
kind: "event",
|
|
@@ -3435,30 +3475,30 @@ function To({
|
|
|
3435
3475
|
data: h.data
|
|
3436
3476
|
});
|
|
3437
3477
|
}));
|
|
3438
|
-
}, [e]),
|
|
3439
|
-
const h = console.warn, b = console.log,
|
|
3478
|
+
}, [e]), T(() => {
|
|
3479
|
+
const h = console.warn, b = console.log, N = (M, I) => function(...U) {
|
|
3440
3480
|
try {
|
|
3441
|
-
const g = typeof
|
|
3442
|
-
g.startsWith("[LiveLayer]") &&
|
|
3481
|
+
const g = typeof U[0] == "string" ? U[0] : "";
|
|
3482
|
+
g.startsWith("[LiveLayer]") && d.current.push({
|
|
3443
3483
|
id: _n++,
|
|
3444
3484
|
ts: Date.now(),
|
|
3445
|
-
kind:
|
|
3485
|
+
kind: M,
|
|
3446
3486
|
type: g.slice(0, 120),
|
|
3447
|
-
data: { args:
|
|
3487
|
+
data: { args: U.slice(1).map((P) => wi(P)) }
|
|
3448
3488
|
});
|
|
3449
3489
|
} catch {
|
|
3450
3490
|
}
|
|
3451
|
-
return
|
|
3491
|
+
return I.apply(this, U);
|
|
3452
3492
|
};
|
|
3453
|
-
return console.warn =
|
|
3493
|
+
return console.warn = N("warn", h), console.log = N("log", b), () => {
|
|
3454
3494
|
console.warn = h, console.log = b;
|
|
3455
3495
|
};
|
|
3456
|
-
}, []), !
|
|
3496
|
+
}, []), !i)
|
|
3457
3497
|
return /* @__PURE__ */ n(
|
|
3458
3498
|
"button",
|
|
3459
3499
|
{
|
|
3460
3500
|
type: "button",
|
|
3461
|
-
onClick: () =>
|
|
3501
|
+
onClick: () => a(!0),
|
|
3462
3502
|
title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
|
|
3463
3503
|
"aria-label": "Open LiveLayer debug panel",
|
|
3464
3504
|
style: {
|
|
@@ -3480,9 +3520,9 @@ function To({
|
|
|
3480
3520
|
children: "🛰 LL debug"
|
|
3481
3521
|
}
|
|
3482
3522
|
);
|
|
3483
|
-
const _ =
|
|
3484
|
-
if (!
|
|
3485
|
-
const b =
|
|
3523
|
+
const _ = o.filter((h) => {
|
|
3524
|
+
if (!l) return !0;
|
|
3525
|
+
const b = l.toLowerCase();
|
|
3486
3526
|
return h.type.toLowerCase().includes(b) || JSON.stringify(h.data || {}).toLowerCase().includes(b);
|
|
3487
3527
|
});
|
|
3488
3528
|
return /* @__PURE__ */ w(
|
|
@@ -3521,9 +3561,9 @@ function To({
|
|
|
3521
3561
|
children: [
|
|
3522
3562
|
/* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
3523
3563
|
/* @__PURE__ */ w("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
3524
|
-
|
|
3564
|
+
o.length,
|
|
3525
3565
|
" event",
|
|
3526
|
-
|
|
3566
|
+
o.length === 1 ? "" : "s"
|
|
3527
3567
|
] }),
|
|
3528
3568
|
/* @__PURE__ */ n("span", { style: { flex: 1 } }),
|
|
3529
3569
|
/* @__PURE__ */ n(
|
|
@@ -3531,7 +3571,7 @@ function To({
|
|
|
3531
3571
|
{
|
|
3532
3572
|
type: "button",
|
|
3533
3573
|
onClick: () => v((h) => !h),
|
|
3534
|
-
style:
|
|
3574
|
+
style: Tt(p ? "#f59e0b" : "transparent"),
|
|
3535
3575
|
title: "Pause / resume capture",
|
|
3536
3576
|
children: p ? "▶ resume" : "⏸ pause"
|
|
3537
3577
|
}
|
|
@@ -3541,9 +3581,9 @@ function To({
|
|
|
3541
3581
|
{
|
|
3542
3582
|
type: "button",
|
|
3543
3583
|
onClick: () => {
|
|
3544
|
-
s([]),
|
|
3584
|
+
s([]), d.current = [];
|
|
3545
3585
|
},
|
|
3546
|
-
style:
|
|
3586
|
+
style: Tt("transparent"),
|
|
3547
3587
|
title: "Clear buffer",
|
|
3548
3588
|
children: "clear"
|
|
3549
3589
|
}
|
|
@@ -3552,8 +3592,8 @@ function To({
|
|
|
3552
3592
|
"button",
|
|
3553
3593
|
{
|
|
3554
3594
|
type: "button",
|
|
3555
|
-
onClick: () =>
|
|
3556
|
-
style:
|
|
3595
|
+
onClick: () => a(!1),
|
|
3596
|
+
style: Tt("transparent"),
|
|
3557
3597
|
"aria-label": "Close",
|
|
3558
3598
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
3559
3599
|
children: "✕"
|
|
@@ -3566,7 +3606,7 @@ function To({
|
|
|
3566
3606
|
"input",
|
|
3567
3607
|
{
|
|
3568
3608
|
type: "text",
|
|
3569
|
-
value:
|
|
3609
|
+
value: l,
|
|
3570
3610
|
onChange: (h) => c(h.target.value),
|
|
3571
3611
|
placeholder: "filter by type or data…",
|
|
3572
3612
|
style: {
|
|
@@ -3620,7 +3660,7 @@ function To({
|
|
|
3620
3660
|
]
|
|
3621
3661
|
}
|
|
3622
3662
|
) : _.map((h) => /* @__PURE__ */ n(
|
|
3623
|
-
|
|
3663
|
+
bi,
|
|
3624
3664
|
{
|
|
3625
3665
|
entry: h,
|
|
3626
3666
|
expanded: f.current.has(h.id),
|
|
@@ -3636,12 +3676,12 @@ function To({
|
|
|
3636
3676
|
}
|
|
3637
3677
|
);
|
|
3638
3678
|
}
|
|
3639
|
-
function
|
|
3679
|
+
function bi({
|
|
3640
3680
|
entry: e,
|
|
3641
3681
|
expanded: t,
|
|
3642
3682
|
onToggle: r
|
|
3643
3683
|
}) {
|
|
3644
|
-
const
|
|
3684
|
+
const i = e.kind === "warn" ? "#f59e0b" : e.type.startsWith("[LiveLayer]") ? "#94a3b8" : e.type === "navigate" || e.type === "scroll_page" || e.type === "scroll_to" || e.type === "click" ? "#22c55e" : e.type === "fill_form" || e.type === "submit_form" || e.type === "focus_field" ? "#a78bfa" : e.type === "request_page_context" || e.type === "request_routes" ? "#38bdf8" : e.type === "agent_state" ? "#facc15" : "#cbd5e1", a = new Date(e.ts).toLocaleTimeString("en-US", {
|
|
3645
3685
|
hour12: !1
|
|
3646
3686
|
});
|
|
3647
3687
|
return /* @__PURE__ */ w(
|
|
@@ -3671,14 +3711,14 @@ function wo({
|
|
|
3671
3711
|
fontVariantNumeric: "tabular-nums",
|
|
3672
3712
|
fontSize: 10
|
|
3673
3713
|
},
|
|
3674
|
-
children:
|
|
3714
|
+
children: a
|
|
3675
3715
|
}
|
|
3676
3716
|
),
|
|
3677
3717
|
/* @__PURE__ */ n(
|
|
3678
3718
|
"span",
|
|
3679
3719
|
{
|
|
3680
3720
|
style: {
|
|
3681
|
-
color:
|
|
3721
|
+
color: i,
|
|
3682
3722
|
fontWeight: 600,
|
|
3683
3723
|
flexShrink: 0
|
|
3684
3724
|
},
|
|
@@ -3706,7 +3746,7 @@ function wo({
|
|
|
3706
3746
|
}
|
|
3707
3747
|
);
|
|
3708
3748
|
}
|
|
3709
|
-
function
|
|
3749
|
+
function Tt(e) {
|
|
3710
3750
|
return {
|
|
3711
3751
|
background: e,
|
|
3712
3752
|
color: "#fff",
|
|
@@ -3717,71 +3757,71 @@ function Mt(e) {
|
|
|
3717
3757
|
cursor: "pointer"
|
|
3718
3758
|
};
|
|
3719
3759
|
}
|
|
3720
|
-
function
|
|
3760
|
+
function wi(e) {
|
|
3721
3761
|
try {
|
|
3722
3762
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
3723
3763
|
} catch {
|
|
3724
3764
|
return String(e);
|
|
3725
3765
|
}
|
|
3726
3766
|
}
|
|
3727
|
-
function
|
|
3767
|
+
function _i(e) {
|
|
3728
3768
|
const t = JSON.stringify(e);
|
|
3729
|
-
|
|
3769
|
+
T(() => Jn(e), [t]);
|
|
3730
3770
|
}
|
|
3731
|
-
function
|
|
3732
|
-
return
|
|
3771
|
+
function Mi({ fields: e, children: t }) {
|
|
3772
|
+
return _i(e), /* @__PURE__ */ n($e, { children: t });
|
|
3733
3773
|
}
|
|
3734
|
-
function
|
|
3735
|
-
const [e, t] =
|
|
3736
|
-
t((
|
|
3737
|
-
const s =
|
|
3774
|
+
function Di() {
|
|
3775
|
+
const [e, t] = S([]), r = C((a) => {
|
|
3776
|
+
t((o) => {
|
|
3777
|
+
const s = o.findIndex((l) => l.id === a.id);
|
|
3738
3778
|
if (s >= 0) {
|
|
3739
|
-
const
|
|
3740
|
-
return
|
|
3779
|
+
const l = o.slice();
|
|
3780
|
+
return l[s] = a, l;
|
|
3741
3781
|
}
|
|
3742
|
-
return [...
|
|
3782
|
+
return [...o, a];
|
|
3743
3783
|
});
|
|
3744
|
-
}, []),
|
|
3784
|
+
}, []), i = C(() => t([]), []);
|
|
3745
3785
|
return {
|
|
3746
3786
|
entries: e,
|
|
3747
3787
|
pushSegment: r,
|
|
3748
|
-
clear:
|
|
3788
|
+
clear: i,
|
|
3749
3789
|
latest: e.length > 0 ? e[e.length - 1] : null
|
|
3750
3790
|
};
|
|
3751
3791
|
}
|
|
3752
3792
|
export {
|
|
3753
|
-
|
|
3793
|
+
vi as AvatarWidget,
|
|
3754
3794
|
Zn as ErrorBoundary,
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3795
|
+
Mi as FieldProvider,
|
|
3796
|
+
Ti as LiveLayerDebugPanel,
|
|
3797
|
+
Ii as LiveLayerRegion,
|
|
3798
|
+
Ai as LiveLayerWidget,
|
|
3799
|
+
zi as clearFieldRegistry,
|
|
3800
|
+
ei as clearPageContextCache,
|
|
3801
|
+
li as clearRoutesCache,
|
|
3762
3802
|
Zr as extractPageContext,
|
|
3763
|
-
|
|
3803
|
+
ii as extractRoutes,
|
|
3764
3804
|
gn as getCachedPageContext,
|
|
3765
3805
|
Rt as getCachedRoutes,
|
|
3766
|
-
|
|
3806
|
+
Hi as getRegisteredFields,
|
|
3767
3807
|
xr as matchesPattern,
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3808
|
+
ni as normalizeRouteInput,
|
|
3809
|
+
Oi as registerFields,
|
|
3810
|
+
Bi as setFieldValue,
|
|
3771
3811
|
kr as shouldRenderAtPath,
|
|
3772
3812
|
ar as useAgentInfo,
|
|
3773
3813
|
tr as useAudioLevel,
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3814
|
+
ir as useCameraState,
|
|
3815
|
+
Ri as useCollect,
|
|
3816
|
+
ur as useDisplayMode,
|
|
3777
3817
|
pr as useDisplayModePersistence,
|
|
3778
3818
|
mr as useIsMobile,
|
|
3779
3819
|
er as useLiveKitSession,
|
|
3780
3820
|
lr as useMediaDevices,
|
|
3781
3821
|
nr as useMicrophoneState,
|
|
3782
3822
|
yr as usePathname,
|
|
3783
|
-
|
|
3823
|
+
_i as useRegisterFields,
|
|
3784
3824
|
Lr as useRouteMatch,
|
|
3785
|
-
|
|
3786
|
-
|
|
3825
|
+
or as useScreenShareState,
|
|
3826
|
+
Di as useTranscript
|
|
3787
3827
|
};
|