@livelayer/react 0.14.0 → 0.15.0
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 +1424 -1328
- package/dist/styles.css +39 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Component as Vn, useState as
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import { jsxs as b, jsx as n, Fragment as $e } from "react/jsx-runtime";
|
|
3
|
+
import { Component as Vn, useState as S, useRef as A, useEffect as M, useCallback as E, useMemo as Ze, useLayoutEffect as Ln, forwardRef as Pt, useImperativeHandle as Yn, createElement as Gn } from "react";
|
|
4
|
+
import { createPortal as $t } from "react-dom";
|
|
5
5
|
import { LiveKitSession as Kn, registerFields as Jn } from "@livelayer/sdk";
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as Xn, Track as kn, createLocalVideoTrack as
|
|
8
|
-
class
|
|
6
|
+
import { clearFieldRegistry as Oi, getRegisteredFields as Bi, registerFields as Wi, setFieldValue as Fi } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as Xn, Track as kn, createLocalVideoTrack as Zn } from "livekit-client";
|
|
8
|
+
class Qn extends Vn {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -15,12 +15,12 @@ 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;
|
|
23
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
23
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ b("div", { className: "ll-error-boundary", role: "alert", children: [
|
|
24
24
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__title", children: "Widget crashed" }),
|
|
25
25
|
/* @__PURE__ */ n("p", { className: "ll-error-boundary__message", children: ((t = this.state.error) == null ? void 0 : t.message) || "Something went wrong." }),
|
|
26
26
|
/* @__PURE__ */ n(
|
|
@@ -36,24 +36,24 @@ 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, u] = S(null), [R, k] = S(!1), [_, m] = S(null), w = A(null), N = A(e.onDataMessage);
|
|
40
|
+
N.current = e.onDataMessage, M(() => {
|
|
41
41
|
const g = {
|
|
42
|
-
onConnectionStateChange: (
|
|
43
|
-
r(
|
|
42
|
+
onConnectionStateChange: (O) => {
|
|
43
|
+
r(O), O === "connected" && m(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) => u(O),
|
|
49
|
+
onVideoTrack: (O) => v(O),
|
|
50
50
|
onVideoTrackRemoved: () => v(null),
|
|
51
|
-
onError: (
|
|
52
|
-
onDataMessage: (
|
|
53
|
-
var
|
|
54
|
-
(
|
|
51
|
+
onError: (O) => m(O),
|
|
52
|
+
onDataMessage: (O) => {
|
|
53
|
+
var q;
|
|
54
|
+
(q = N.current) == null || q.call(N, O);
|
|
55
55
|
},
|
|
56
|
-
onResumabilityChange:
|
|
56
|
+
onResumabilityChange: k
|
|
57
57
|
}, P = new Kn(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
@@ -64,9 +64,9 @@ function er(e) {
|
|
|
64
64
|
},
|
|
65
65
|
g
|
|
66
66
|
);
|
|
67
|
-
return
|
|
68
|
-
var
|
|
69
|
-
(
|
|
67
|
+
return w.current = P, r("idle"), a("idle"), s([]), c(null), v(null), u(null), k(!1), m(null), () => {
|
|
68
|
+
var O;
|
|
69
|
+
(O = P.destroy) == null || O.call(P), w.current = null;
|
|
70
70
|
};
|
|
71
71
|
}, [
|
|
72
72
|
e.agentId,
|
|
@@ -75,65 +75,65 @@ function er(e) {
|
|
|
75
75
|
e.sessionEndpoint,
|
|
76
76
|
JSON.stringify(e.sessionBody ?? {})
|
|
77
77
|
]);
|
|
78
|
-
const T =
|
|
79
|
-
const g =
|
|
78
|
+
const T = E(async () => {
|
|
79
|
+
const g = w.current;
|
|
80
80
|
if (g)
|
|
81
81
|
try {
|
|
82
82
|
await g.connect();
|
|
83
83
|
} catch (P) {
|
|
84
|
-
throw
|
|
84
|
+
throw m(P instanceof Error ? P.message : String(P)), P;
|
|
85
85
|
}
|
|
86
|
-
}, []),
|
|
87
|
-
const g =
|
|
86
|
+
}, []), I = E(() => {
|
|
87
|
+
const g = w.current;
|
|
88
88
|
g && g.disconnect();
|
|
89
|
-
}, []),
|
|
89
|
+
}, []), U = E(() => {
|
|
90
90
|
var g;
|
|
91
|
-
return ((g =
|
|
91
|
+
return ((g = w.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
102
|
connect: T,
|
|
103
|
-
disconnect:
|
|
104
|
-
getRoom:
|
|
105
|
-
session:
|
|
103
|
+
disconnect: I,
|
|
104
|
+
getRoom: U,
|
|
105
|
+
session: w.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 = E(() => {
|
|
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 u =
|
|
118
|
+
const u = o.current;
|
|
119
119
|
f.getByteFrequencyData(u);
|
|
120
|
-
let
|
|
121
|
-
for (let _ = 0; _ < u.length; _++)
|
|
122
|
-
const
|
|
123
|
-
for (const _ of
|
|
120
|
+
let R = 0;
|
|
121
|
+
for (let _ = 0; _ < u.length; _++) R += u[_];
|
|
122
|
+
const k = R / u.length / 255;
|
|
123
|
+
for (const _ of a.current)
|
|
124
124
|
try {
|
|
125
|
-
_(
|
|
126
|
-
} catch (
|
|
127
|
-
console.error("[useAudioLevel] subscriber threw:",
|
|
125
|
+
_(k);
|
|
126
|
+
} catch (m) {
|
|
127
|
+
console.error("[useAudioLevel] subscriber threw:", m);
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
}, []),
|
|
129
|
+
i.current = requestAnimationFrame(s);
|
|
130
|
+
}, []), l = E(() => {
|
|
131
131
|
if (e.current || typeof window > "u" || typeof AudioContext > "u") return;
|
|
132
132
|
const f = new AudioContext(), u = f.createAnalyser();
|
|
133
133
|
u.fftSize = 64, u.connect(f.destination), e.current = f, t.current = u;
|
|
134
|
-
}, []), c =
|
|
134
|
+
}, []), c = E(
|
|
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();
|
|
@@ -148,22 +148,22 @@ function tr() {
|
|
|
148
148
|
console.warn("[useAudioLevel] createMediaElementSource failed:", u);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
i.current === null && (i.current = requestAnimationFrame(s));
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
|
-
[
|
|
155
|
-
), p =
|
|
156
|
-
if (
|
|
154
|
+
[l, s]
|
|
155
|
+
), p = E(() => {
|
|
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 =
|
|
164
|
-
|
|
163
|
+
}, []), v = E((f) => (a.current.add(f), () => {
|
|
164
|
+
a.current.delete(f);
|
|
165
165
|
}), []);
|
|
166
|
-
return
|
|
166
|
+
return M(() => () => {
|
|
167
167
|
if (p(), t.current) {
|
|
168
168
|
try {
|
|
169
169
|
t.current.disconnect();
|
|
@@ -178,84 +178,84 @@ 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] =
|
|
186
|
-
var _,
|
|
187
|
-
if (s.current &&
|
|
185
|
+
const [e, t] = S(!1), [r, i] = S(""), [a, o] = S(null), s = A(null), l = A(null), c = E(async (k) => {
|
|
186
|
+
var _, m;
|
|
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 = k, o(null);
|
|
195
195
|
try {
|
|
196
|
-
const
|
|
196
|
+
const w = await Xn({
|
|
197
197
|
echoCancellation: !0,
|
|
198
198
|
noiseSuppression: !0
|
|
199
199
|
});
|
|
200
|
-
await
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
} catch (
|
|
204
|
-
const
|
|
205
|
-
throw
|
|
200
|
+
await k.localParticipant.publishTrack(w), s.current = w, t(w.isMuted);
|
|
201
|
+
const N = (m = (_ = w.mediaStreamTrack) == null ? void 0 : _.getSettings) == null ? void 0 : m.call(_);
|
|
202
|
+
N != null && N.deviceId && i(N.deviceId);
|
|
203
|
+
} catch (w) {
|
|
204
|
+
const N = w instanceof Error && w.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
205
|
+
throw o(N), w;
|
|
206
206
|
}
|
|
207
|
-
}, []), p =
|
|
208
|
-
|
|
209
|
-
}, []), v =
|
|
210
|
-
const _ =
|
|
207
|
+
}, []), p = E((k) => {
|
|
208
|
+
l.current = k;
|
|
209
|
+
}, []), v = E(async (k) => {
|
|
210
|
+
const _ = l.current;
|
|
211
211
|
if (_)
|
|
212
212
|
try {
|
|
213
|
-
await _.switchActiveDevice("audioinput",
|
|
214
|
-
} catch (
|
|
215
|
-
console.warn("[useMicrophoneState] switchDevice failed:",
|
|
213
|
+
await _.switchActiveDevice("audioinput", k), i(k);
|
|
214
|
+
} catch (m) {
|
|
215
|
+
console.warn("[useMicrophoneState] switchDevice failed:", m);
|
|
216
216
|
}
|
|
217
|
-
}, []), f =
|
|
218
|
-
const
|
|
219
|
-
if (t(_), !!
|
|
217
|
+
}, []), f = E(async () => {
|
|
218
|
+
const k = l.current, _ = !e;
|
|
219
|
+
if (t(_), !!k)
|
|
220
220
|
try {
|
|
221
|
-
await
|
|
222
|
-
} catch (
|
|
223
|
-
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:",
|
|
221
|
+
await k.localParticipant.setMicrophoneEnabled(!_);
|
|
222
|
+
} catch (m) {
|
|
223
|
+
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", m), t(!_);
|
|
224
224
|
}
|
|
225
|
-
}, [e]), u =
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
225
|
+
}, [e]), u = E(() => {
|
|
226
|
+
const k = s.current, _ = l.current;
|
|
227
|
+
if (k && _) {
|
|
228
228
|
try {
|
|
229
|
-
_.localParticipant.unpublishTrack(
|
|
229
|
+
_.localParticipant.unpublishTrack(k);
|
|
230
230
|
} catch {
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
k.stop();
|
|
233
233
|
}
|
|
234
|
-
s.current = null,
|
|
235
|
-
}, []),
|
|
234
|
+
s.current = null, l.current = null, t(!1), i("");
|
|
235
|
+
}, []), R = E(() => 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
244
|
teardownMic: u,
|
|
245
|
-
clearError:
|
|
245
|
+
clearError: R
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
const rr = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
249
|
-
function
|
|
250
|
-
const [e, t] =
|
|
251
|
-
c.current =
|
|
252
|
-
}, []), f =
|
|
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 = E((w) => {
|
|
251
|
+
c.current = w;
|
|
252
|
+
}, []), f = E(() => {
|
|
253
253
|
var T;
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
const
|
|
254
|
+
const w = c.current, N = p.current;
|
|
255
|
+
if (N && w) {
|
|
256
|
+
const I = w.localParticipant.getTrackPublication(kn.Source.Camera), g = (I == null ? void 0 : I.track) ?? N;
|
|
257
257
|
try {
|
|
258
|
-
|
|
258
|
+
w.localParticipant.unpublishTrack(g);
|
|
259
259
|
} catch {
|
|
260
260
|
}
|
|
261
261
|
try {
|
|
@@ -263,55 +263,55 @@ function or() {
|
|
|
263
263
|
} catch {
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
p.current = null,
|
|
267
|
-
}, []), u =
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
270
|
-
|
|
266
|
+
p.current = null, o(null), t(!1);
|
|
267
|
+
}, []), u = E(async (w) => {
|
|
268
|
+
const N = c.current;
|
|
269
|
+
if (N) {
|
|
270
|
+
i(null);
|
|
271
271
|
try {
|
|
272
272
|
const T = { ...rr };
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
await
|
|
276
|
-
const
|
|
277
|
-
|
|
273
|
+
w && (T.deviceId = w);
|
|
274
|
+
const I = await Zn(T);
|
|
275
|
+
await N.localParticipant.publishTrack(I), p.current = I;
|
|
276
|
+
const U = I.attach();
|
|
277
|
+
o(U), t(!0), w && l(w);
|
|
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
285
|
} catch (T) {
|
|
286
|
-
const
|
|
287
|
-
|
|
286
|
+
const I = T instanceof Error && T.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
|
-
}, []),
|
|
290
|
+
}, []), R = E(async () => {
|
|
291
291
|
e ? f() : await u(s || void 0);
|
|
292
|
-
}, [e, s, f, u]),
|
|
293
|
-
f(), await u(
|
|
294
|
-
}, [f, u]), _ =
|
|
295
|
-
f(), c.current = null,
|
|
296
|
-
}, [f]),
|
|
297
|
-
return
|
|
292
|
+
}, [e, s, f, u]), k = E(async (w) => {
|
|
293
|
+
f(), await u(w);
|
|
294
|
+
}, [f, u]), _ = E(() => {
|
|
295
|
+
f(), c.current = null, i(null), l("");
|
|
296
|
+
}, [f]), m = E(() => i(null), []);
|
|
297
|
+
return M(() => () => {
|
|
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:
|
|
305
|
-
switchDevice:
|
|
304
|
+
toggle: R,
|
|
305
|
+
switchDevice: k,
|
|
306
306
|
attachRoom: v,
|
|
307
307
|
teardown: _,
|
|
308
|
-
clearError:
|
|
308
|
+
clearError: m
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const [e, t] =
|
|
311
|
+
function or() {
|
|
312
|
+
const [e, t] = S(!1), [r, i] = S(null), [a, o] = S(null), s = A(null), l = E((u) => {
|
|
313
313
|
s.current = u;
|
|
314
|
-
}, []), c =
|
|
314
|
+
}, []), c = E(() => o(null), []), p = E(async () => {
|
|
315
315
|
const u = s.current;
|
|
316
316
|
if (u) {
|
|
317
317
|
if (e) {
|
|
@@ -322,15 +322,15 @@ function ir() {
|
|
|
322
322
|
c(), t(!1);
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
i(null);
|
|
326
326
|
try {
|
|
327
327
|
await u.localParticipant.setScreenShareEnabled(!0);
|
|
328
|
-
let
|
|
329
|
-
const
|
|
328
|
+
let R = 0;
|
|
329
|
+
const k = () => {
|
|
330
330
|
const _ = u.localParticipant.getTrackPublication(kn.Source.ScreenShare);
|
|
331
331
|
if (_ != null && _.track) {
|
|
332
|
-
const
|
|
333
|
-
|
|
332
|
+
const m = _.track.attach();
|
|
333
|
+
o(m), t(!0);
|
|
334
334
|
try {
|
|
335
335
|
u.localParticipant.publishData(
|
|
336
336
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
@@ -340,43 +340,43 @@ function ir() {
|
|
|
340
340
|
}
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
R++ < 10 ? setTimeout(k, 100) : t(!0);
|
|
344
344
|
};
|
|
345
|
-
|
|
346
|
-
} catch (
|
|
347
|
-
const
|
|
348
|
-
|
|
345
|
+
k();
|
|
346
|
+
} catch (R) {
|
|
347
|
+
const k = R instanceof Error ? R.name : "";
|
|
348
|
+
k !== "NotAllowedError" && k !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
}, [e, c]), v =
|
|
351
|
+
}, [e, c]), v = E(() => {
|
|
352
352
|
const u = s.current;
|
|
353
353
|
if (u && e)
|
|
354
354
|
try {
|
|
355
355
|
u.localParticipant.setScreenShareEnabled(!1);
|
|
356
356
|
} catch {
|
|
357
357
|
}
|
|
358
|
-
c(), t(!1),
|
|
359
|
-
}, [e, c]), f =
|
|
360
|
-
return { isEnabled: e, error: r, previewEl:
|
|
358
|
+
c(), t(!1), i(null), s.current = null;
|
|
359
|
+
}, [e, c]), f = E(() => 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 = E(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 M(() => {
|
|
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 M(() => {
|
|
380
380
|
if (r || !e) {
|
|
381
381
|
c(!1);
|
|
382
382
|
return;
|
|
@@ -391,11 +391,11 @@ function ar(e, t, r = !1) {
|
|
|
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;
|
|
@@ -417,13 +417,13 @@ function dr({
|
|
|
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 = E(
|
|
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
428
|
const ur = ["hidden", "minimized", "expanded"];
|
|
429
429
|
function fr(e) {
|
|
@@ -433,75 +433,75 @@ 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] = dr({
|
|
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 M(() => {
|
|
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 M(() => {
|
|
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
|
}
|
|
468
|
-
const
|
|
468
|
+
const tn = "__llHistoryPatched", xt = "ll:pathname";
|
|
469
469
|
function gr() {
|
|
470
|
-
if (typeof window > "u" || window.history[
|
|
470
|
+
if (typeof window > "u" || window.history[tn]) 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(
|
|
473
|
+
const i = e.apply(this, r);
|
|
474
|
+
return window.dispatchEvent(new Event(xt)), i;
|
|
475
475
|
}, window.history.replaceState = function(...r) {
|
|
476
|
-
const
|
|
477
|
-
return window.dispatchEvent(new Event(
|
|
478
|
-
}, window.history[
|
|
476
|
+
const i = t.apply(this, r);
|
|
477
|
+
return window.dispatchEvent(new Event(xt)), i;
|
|
478
|
+
}, window.history[tn] = !0;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function nn() {
|
|
481
481
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
482
482
|
}
|
|
483
483
|
function yr(e) {
|
|
484
|
-
const [t, r] =
|
|
485
|
-
() => e ??
|
|
484
|
+
const [t, r] = S(
|
|
485
|
+
() => e ?? nn()
|
|
486
486
|
);
|
|
487
|
-
return
|
|
487
|
+
return M(() => {
|
|
488
488
|
if (e !== void 0) return;
|
|
489
489
|
gr();
|
|
490
|
-
const
|
|
491
|
-
return
|
|
492
|
-
window.removeEventListener("popstate",
|
|
490
|
+
const i = () => r(nn());
|
|
491
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(xt, i), () => {
|
|
492
|
+
window.removeEventListener("popstate", i), window.removeEventListener(xt, i);
|
|
493
493
|
};
|
|
494
494
|
}, [e]), e ?? t;
|
|
495
495
|
}
|
|
496
|
-
const
|
|
496
|
+
const rn = /* @__PURE__ */ new Map(), vr = /[\\^$+?.()|{}[\]]/g;
|
|
497
497
|
function br(e) {
|
|
498
498
|
return e.replace(vr, "\\$&");
|
|
499
499
|
}
|
|
500
500
|
function wr(e) {
|
|
501
|
-
const t =
|
|
501
|
+
const t = rn.get(e);
|
|
502
502
|
if (t) return t;
|
|
503
|
-
const r = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e,
|
|
504
|
-
return
|
|
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
|
+
return rn.set(e, c), c;
|
|
505
505
|
}
|
|
506
506
|
function _r(e, t) {
|
|
507
507
|
const r = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
@@ -510,18 +510,18 @@ function _r(e, t) {
|
|
|
510
510
|
function xr(e, t) {
|
|
511
511
|
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : _r(e, t);
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function on(e, t) {
|
|
514
514
|
if (!e || e.length === 0) return !1;
|
|
515
515
|
for (const r of e)
|
|
516
516
|
if (xr(r, t)) return !0;
|
|
517
517
|
return !1;
|
|
518
518
|
}
|
|
519
|
-
function kr(e, t, r) {
|
|
520
|
-
return e === void 0 ? !0 : rn(r, e) ? !1 : t && t.length > 0 ? rn(t, e) : !0;
|
|
521
|
-
}
|
|
522
519
|
function Lr(e, t, r) {
|
|
523
|
-
return
|
|
524
|
-
|
|
520
|
+
return e === void 0 ? !0 : on(r, e) ? !1 : t && t.length > 0 ? on(t, e) : !0;
|
|
521
|
+
}
|
|
522
|
+
function kr(e, t, r) {
|
|
523
|
+
return Ze(
|
|
524
|
+
() => Lr(e, t, r),
|
|
525
525
|
[e, t, r]
|
|
526
526
|
);
|
|
527
527
|
}
|
|
@@ -533,7 +533,7 @@ function Cr(e) {
|
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
535
|
function Er(e) {
|
|
536
|
-
const t =
|
|
536
|
+
const t = Ze(() => Cr(e.config), [e.config]), r = e.baseUrl.replace(/\/+$/, ""), i = A(null), a = E(
|
|
537
537
|
(c) => {
|
|
538
538
|
try {
|
|
539
539
|
new Audio(`${r}${c}`).play().catch(() => {
|
|
@@ -542,55 +542,55 @@ 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 = E(() => {
|
|
546
|
+
t.navigate && a("/audio/page-change-sound.mp3");
|
|
547
|
+
}, [t.navigate, a]), s = E(() => {
|
|
548
|
+
t.action && a("/audio/confirmation-sound.mp3");
|
|
549
|
+
}, [t.action, a]), l = E(
|
|
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 M(() => () => {
|
|
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
|
-
}, []),
|
|
589
|
-
() => ({ playPageChange:
|
|
590
|
-
[
|
|
588
|
+
}, []), Ze(
|
|
589
|
+
() => ({ playPageChange: o, playConfirmation: s, setThinking: l }),
|
|
590
|
+
[o, s, l]
|
|
591
591
|
);
|
|
592
592
|
}
|
|
593
|
-
const
|
|
593
|
+
const ln = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ b(
|
|
594
594
|
"svg",
|
|
595
595
|
{
|
|
596
596
|
className: t,
|
|
@@ -636,7 +636,7 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
|
|
|
636
636
|
}
|
|
637
637
|
)
|
|
638
638
|
}
|
|
639
|
-
),
|
|
639
|
+
), an = ({ className: e }) => /* @__PURE__ */ n(
|
|
640
640
|
"svg",
|
|
641
641
|
{
|
|
642
642
|
className: e,
|
|
@@ -670,7 +670,7 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
|
|
|
670
670
|
right: 0,
|
|
671
671
|
up: -90,
|
|
672
672
|
down: 90
|
|
673
|
-
},
|
|
673
|
+
}, sn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ n(
|
|
674
674
|
"svg",
|
|
675
675
|
{
|
|
676
676
|
className: t,
|
|
@@ -686,11 +686,11 @@ const on = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ w(
|
|
|
686
686
|
function Ar(e) {
|
|
687
687
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
688
688
|
}
|
|
689
|
-
const
|
|
689
|
+
const Cn = "ll-hidden-tab-center-y", Ir = 5, cn = 16;
|
|
690
690
|
function Rr() {
|
|
691
691
|
if (typeof window > "u") return null;
|
|
692
692
|
try {
|
|
693
|
-
const e = window.localStorage.getItem(
|
|
693
|
+
const e = window.localStorage.getItem(Cn);
|
|
694
694
|
if (!e) return null;
|
|
695
695
|
const t = Number.parseFloat(e);
|
|
696
696
|
return Number.isFinite(t) ? t : null;
|
|
@@ -698,10 +698,10 @@ function Rr() {
|
|
|
698
698
|
return null;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function dn(e) {
|
|
702
702
|
if (!(typeof window > "u"))
|
|
703
703
|
try {
|
|
704
|
-
window.localStorage.setItem(
|
|
704
|
+
window.localStorage.setItem(Cn, String(e));
|
|
705
705
|
} catch {
|
|
706
706
|
}
|
|
707
707
|
}
|
|
@@ -709,87 +709,87 @@ const Mr = ({
|
|
|
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, u = !!l, [R, k] = S(null), [_, m] = S(!1), w = A(null), N = A(!1), T = E(
|
|
719
719
|
(B) => {
|
|
720
720
|
if (typeof window > "u") return B;
|
|
721
|
-
const
|
|
722
|
-
return
|
|
721
|
+
const j = v / 2, C = cn + j, Z = window.innerHeight - cn - j;
|
|
722
|
+
return Z < C ? Math.max(C, B) : Math.max(C, Math.min(Z, B));
|
|
723
723
|
},
|
|
724
724
|
[v]
|
|
725
725
|
);
|
|
726
|
-
|
|
726
|
+
M(() => {
|
|
727
727
|
if (u) {
|
|
728
|
-
|
|
728
|
+
k(null);
|
|
729
729
|
return;
|
|
730
730
|
}
|
|
731
731
|
const B = Rr();
|
|
732
|
-
|
|
733
|
-
const
|
|
734
|
-
|
|
732
|
+
k(T(B ?? window.innerHeight / 2));
|
|
733
|
+
const j = () => {
|
|
734
|
+
k((C) => C === null ? null : T(C));
|
|
735
735
|
};
|
|
736
|
-
return window.addEventListener("resize",
|
|
736
|
+
return window.addEventListener("resize", j), () => window.removeEventListener("resize", j);
|
|
737
737
|
}, [T, u]);
|
|
738
|
-
const
|
|
738
|
+
const I = E(
|
|
739
739
|
(B) => {
|
|
740
|
-
if (!u && !(B.pointerType === "mouse" && B.button !== 0) &&
|
|
740
|
+
if (!u && !(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
|
+
w.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, u]
|
|
753
|
+
), U = E(
|
|
754
754
|
(B) => {
|
|
755
|
-
const
|
|
756
|
-
if (!
|
|
757
|
-
const
|
|
758
|
-
!
|
|
755
|
+
const j = w.current;
|
|
756
|
+
if (!j) return;
|
|
757
|
+
const C = B.clientY - j.startClientY;
|
|
758
|
+
!j.moved && Math.abs(C) > Ir && (j.moved = !0, m(!0)), j.moved && k(T(j.startCenterY + C));
|
|
759
759
|
},
|
|
760
760
|
[T]
|
|
761
|
-
), g =
|
|
761
|
+
), g = E(
|
|
762
762
|
(B) => {
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
763
|
+
const j = w.current;
|
|
764
|
+
if (j) {
|
|
765
765
|
try {
|
|
766
766
|
B.currentTarget.releasePointerCapture(B.pointerId);
|
|
767
767
|
} catch {
|
|
768
768
|
}
|
|
769
|
-
|
|
769
|
+
w.current = null, j.moved && (m(!1), N.current = !0, k((C) => (C !== null && dn(C), C)));
|
|
770
770
|
}
|
|
771
771
|
},
|
|
772
772
|
[]
|
|
773
|
-
), P =
|
|
774
|
-
if (
|
|
775
|
-
|
|
773
|
+
), P = E(() => {
|
|
774
|
+
if (N.current) {
|
|
775
|
+
N.current = !1;
|
|
776
776
|
return;
|
|
777
777
|
}
|
|
778
|
-
|
|
779
|
-
}, [
|
|
778
|
+
i();
|
|
779
|
+
}, [i]), O = E(
|
|
780
780
|
(B) => {
|
|
781
781
|
if (B.key === "ArrowUp" || B.key === "ArrowDown") {
|
|
782
782
|
B.preventDefault();
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
if (
|
|
786
|
-
const
|
|
787
|
-
return
|
|
783
|
+
const j = B.key === "ArrowUp" ? -8 : 8;
|
|
784
|
+
k((C) => {
|
|
785
|
+
if (C === null) return C;
|
|
786
|
+
const Z = T(C + j);
|
|
787
|
+
return dn(Z), Z;
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
790
|
},
|
|
791
791
|
[T]
|
|
792
|
-
),
|
|
792
|
+
), q = [
|
|
793
793
|
"ll-hidden",
|
|
794
794
|
`ll-hidden--${c}`,
|
|
795
795
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
@@ -797,29 +797,29 @@ const Mr = ({
|
|
|
797
797
|
_ ? "is-dragging" : null,
|
|
798
798
|
f ? "ll-hidden--with-avatar" : null,
|
|
799
799
|
u ? "ll-hidden--scoped" : null
|
|
800
|
-
].filter(Boolean).join(" "),
|
|
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
|
|
818
818
|
// taking the rest of the tab. Reinforces "this is an
|
|
819
819
|
// avatar-based experience" even when collapsed.
|
|
820
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ b($e, { children: [
|
|
821
821
|
/* @__PURE__ */ n(
|
|
822
|
-
|
|
822
|
+
sn,
|
|
823
823
|
{
|
|
824
824
|
direction: p,
|
|
825
825
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -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
|
|
@@ -836,7 +836,7 @@ const Mr = ({
|
|
|
836
836
|
)
|
|
837
837
|
] })
|
|
838
838
|
) : /* @__PURE__ */ n(
|
|
839
|
-
|
|
839
|
+
sn,
|
|
840
840
|
{
|
|
841
841
|
direction: p,
|
|
842
842
|
className: "ll-hidden__chevron"
|
|
@@ -848,31 +848,31 @@ const 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 = Ze(() => {
|
|
856
856
|
const v = (Math.sqrt(5) - 1) / 2;
|
|
857
857
|
return Array.from({ length: t }, (f, u) => 0.5 + u * v % 1 * 0.5);
|
|
858
858
|
}, [t]);
|
|
859
|
-
|
|
859
|
+
M(() => e.subscribe((f) => {
|
|
860
860
|
for (let u = 0; u < t; u++) {
|
|
861
|
-
const
|
|
862
|
-
if (!
|
|
863
|
-
const
|
|
864
|
-
|
|
861
|
+
const R = l.current[u];
|
|
862
|
+
if (!R) continue;
|
|
863
|
+
const k = Math.max(i, f * r * c[u]);
|
|
864
|
+
R.style.height = `${k}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
871
|
ref: (u) => {
|
|
872
|
-
|
|
872
|
+
l.current[f] = u;
|
|
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(
|
|
@@ -893,20 +893,20 @@ const Mr = ({
|
|
|
893
893
|
className: "ll-minimized ll-minimized--mobile",
|
|
894
894
|
role: "region",
|
|
895
895
|
"aria-label": `${r} widget`,
|
|
896
|
-
children: /* @__PURE__ */
|
|
896
|
+
children: /* @__PURE__ */ b(
|
|
897
897
|
"button",
|
|
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
|
}
|
|
@@ -922,7 +922,7 @@ const Mr = ({
|
|
|
922
922
|
}
|
|
923
923
|
),
|
|
924
924
|
/* @__PURE__ */ n("span", { className: "ll-minimized__name", children: r }),
|
|
925
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ b("div", { className: "ll-minimized__controls", children: [
|
|
926
926
|
/* @__PURE__ */ n(
|
|
927
927
|
"span",
|
|
928
928
|
{
|
|
@@ -935,11 +935,11 @@ 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(
|
|
938
|
+
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
939
|
+
children: /* @__PURE__ */ n(ln, { muted: o, className: "ll-minimized__icon" })
|
|
940
940
|
}
|
|
941
941
|
),
|
|
942
|
-
/* @__PURE__ */ n(
|
|
942
|
+
/* @__PURE__ */ n(an, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
943
943
|
] })
|
|
944
944
|
]
|
|
945
945
|
}
|
|
@@ -952,31 +952,31 @@ const Mr = ({
|
|
|
952
952
|
"data-position": e,
|
|
953
953
|
role: "region",
|
|
954
954
|
"aria-label": `${r} widget`,
|
|
955
|
-
children: /* @__PURE__ */
|
|
956
|
-
|
|
955
|
+
children: /* @__PURE__ */ b("div", { className: "ll-minimized__surface", children: [
|
|
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
|
}
|
|
965
965
|
)
|
|
966
966
|
) : /* @__PURE__ */ n("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
967
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ b("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
|
-
/* @__PURE__ */
|
|
971
|
+
/* @__PURE__ */ b("div", { className: "ll-minimized__controls", children: [
|
|
972
972
|
/* @__PURE__ */ n(
|
|
973
973
|
"button",
|
|
974
974
|
{
|
|
975
975
|
type: "button",
|
|
976
976
|
className: "ll-minimized__btn",
|
|
977
977
|
onClick: c,
|
|
978
|
-
"aria-label":
|
|
979
|
-
children: /* @__PURE__ */ n(
|
|
978
|
+
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
979
|
+
children: /* @__PURE__ */ n(ln, { muted: o, className: "ll-minimized__icon" })
|
|
980
980
|
}
|
|
981
981
|
),
|
|
982
982
|
/* @__PURE__ */ n(
|
|
@@ -984,9 +984,9 @@ 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
|
-
children: /* @__PURE__ */ n(
|
|
989
|
+
children: /* @__PURE__ */ n(an, { className: "ll-minimized__icon" })
|
|
990
990
|
}
|
|
991
991
|
),
|
|
992
992
|
/* @__PURE__ */ n(
|
|
@@ -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 (M(() => {
|
|
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,85 +1040,127 @@ const Mr = ({
|
|
|
1040
1040
|
}
|
|
1041
1041
|
)
|
|
1042
1042
|
);
|
|
1043
|
-
}, $r =
|
|
1043
|
+
}, $r = "#E06540";
|
|
1044
|
+
function zr({
|
|
1045
|
+
size: e = 14,
|
|
1046
|
+
className: t,
|
|
1047
|
+
fill: r = $r
|
|
1048
|
+
}) {
|
|
1049
|
+
return /* @__PURE__ */ b(
|
|
1050
|
+
"svg",
|
|
1051
|
+
{
|
|
1052
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1053
|
+
width: e,
|
|
1054
|
+
height: e,
|
|
1055
|
+
viewBox: "0 0 52 52",
|
|
1056
|
+
fill: "none",
|
|
1057
|
+
className: t,
|
|
1058
|
+
"aria-hidden": !0,
|
|
1059
|
+
children: [
|
|
1060
|
+
/* @__PURE__ */ n(
|
|
1061
|
+
"path",
|
|
1062
|
+
{
|
|
1063
|
+
d: "M44.5714 26C44.5714 23.5612 44.0908 21.146 43.1575 18.8928C42.2242 16.6397 40.8565 14.5924 39.132 12.868C37.4076 11.1435 35.3603 9.77577 33.1072 8.84247C30.854 7.90917 28.4388 7.42857 26 7.42857C23.5612 7.42857 21.146 7.90916 18.8928 8.84247C16.6397 9.77577 14.5924 11.1435 12.868 12.868C11.1435 14.5924 9.77577 16.6397 8.84247 18.8928C7.90917 21.146 7.42857 23.5612 7.42857 26C7.42857 28.4388 7.90916 30.854 8.84247 33.1072C9.77577 35.3603 11.1435 37.4076 12.868 39.132C14.5924 40.8565 16.6397 42.2242 18.8928 43.1575C21.146 44.0908 23.5612 44.5714 26 44.5714H48.2857C50.3371 44.5714 52 46.2344 52 48.2857C52 50.3371 50.3371 52 48.2857 52H26C22.5857 52 19.2049 51.3275 16.0505 50.021C12.896 48.7144 10.0293 46.7993 7.61501 44.385C5.20069 41.9707 3.28564 39.104 1.97902 35.9495C0.67247 32.7951 -3.54212e-07 29.4143 0 26C-1.68163e-07 22.5857 0.672469 19.2049 1.97902 16.0505C3.28564 12.896 5.20069 10.0293 7.61501 7.61501C10.0293 5.20069 12.896 3.28564 16.0505 1.97902C19.2049 0.67247 22.5857 0 26 0C29.4143 1.86048e-07 32.7951 0.67247 35.9495 1.97902C39.104 3.28564 41.9707 5.20069 44.385 7.61501C46.7993 10.0293 48.7144 12.896 50.021 16.0505C51.3275 19.2049 52 22.5857 52 26C52 28.0513 50.3371 29.7143 48.2857 29.7143C46.2344 29.7143 44.5714 28.0513 44.5714 26Z",
|
|
1064
|
+
fill: r
|
|
1065
|
+
}
|
|
1066
|
+
),
|
|
1067
|
+
/* @__PURE__ */ n(
|
|
1068
|
+
"path",
|
|
1069
|
+
{
|
|
1070
|
+
d: "M28.9717 23.7714C28.9717 21.3098 30.9672 19.3143 33.4288 19.3143C35.8904 19.3143 37.886 21.3098 37.886 23.7714C37.886 26.233 35.8904 28.2286 33.4288 28.2286C30.9672 28.2286 28.9717 26.233 28.9717 23.7714Z",
|
|
1071
|
+
fill: r
|
|
1072
|
+
}
|
|
1073
|
+
),
|
|
1074
|
+
/* @__PURE__ */ n(
|
|
1075
|
+
"path",
|
|
1076
|
+
{
|
|
1077
|
+
d: "M18.5714 19.3143C16.1098 19.3143 14.1143 21.3098 14.1143 23.7714C14.1143 26.233 16.1098 28.2286 18.5714 28.2286C21.033 28.2286 23.0285 26.233 23.0285 23.7714C23.0285 21.3098 21.033 19.3143 18.5714 19.3143Z",
|
|
1078
|
+
fill: r
|
|
1079
|
+
}
|
|
1080
|
+
)
|
|
1081
|
+
]
|
|
1082
|
+
}
|
|
1083
|
+
);
|
|
1084
|
+
}
|
|
1085
|
+
const Hr = 8, un = 8, Or = ({
|
|
1044
1086
|
open: e,
|
|
1045
1087
|
onClose: t,
|
|
1046
1088
|
anchorRef: r,
|
|
1047
|
-
children:
|
|
1089
|
+
children: i
|
|
1048
1090
|
}) => {
|
|
1049
|
-
const
|
|
1050
|
-
return
|
|
1091
|
+
const a = A(null), [o, s] = S(null);
|
|
1092
|
+
return Ln(() => {
|
|
1051
1093
|
if (!e) {
|
|
1052
1094
|
s(null);
|
|
1053
1095
|
return;
|
|
1054
1096
|
}
|
|
1055
|
-
const
|
|
1056
|
-
if (!
|
|
1097
|
+
const l = r.current;
|
|
1098
|
+
if (!l) return;
|
|
1057
1099
|
const c = () => {
|
|
1058
|
-
const p =
|
|
1059
|
-
top: p.top -
|
|
1100
|
+
const p = l.getBoundingClientRect(), v = {
|
|
1101
|
+
top: p.top - Hr,
|
|
1060
1102
|
left: p.left + p.width / 2
|
|
1061
|
-
}, f =
|
|
1103
|
+
}, f = un + 90, u = window.innerWidth - un - 90;
|
|
1062
1104
|
v.left < f && (v.left = f), v.left > u && (v.left = u), s(v);
|
|
1063
1105
|
};
|
|
1064
1106
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1065
1107
|
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
1066
1108
|
};
|
|
1067
|
-
}, [e, r]),
|
|
1109
|
+
}, [e, r]), M(() => {
|
|
1068
1110
|
if (!e) return;
|
|
1069
|
-
const
|
|
1070
|
-
const v = p.target, f =
|
|
1111
|
+
const l = (p) => {
|
|
1112
|
+
const v = p.target, f = a.current, u = r.current;
|
|
1071
1113
|
f && f.contains(v) || u && u.contains(v) || t();
|
|
1072
1114
|
}, c = (p) => {
|
|
1073
1115
|
p.key === "Escape" && (p.stopPropagation(), t());
|
|
1074
1116
|
};
|
|
1075
|
-
return document.addEventListener("mousedown",
|
|
1076
|
-
document.removeEventListener("mousedown",
|
|
1117
|
+
return document.addEventListener("mousedown", l), document.addEventListener("keydown", c), () => {
|
|
1118
|
+
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", c);
|
|
1077
1119
|
};
|
|
1078
|
-
}, [e, t, r]), !e ||
|
|
1120
|
+
}, [e, t, r]), !e || o === null || typeof document > "u" ? null : $t(
|
|
1079
1121
|
/* @__PURE__ */ n(
|
|
1080
1122
|
"div",
|
|
1081
1123
|
{
|
|
1082
|
-
ref:
|
|
1124
|
+
ref: a,
|
|
1083
1125
|
className: "ll-overflow-popover",
|
|
1084
1126
|
role: "menu",
|
|
1085
1127
|
style: {
|
|
1086
1128
|
position: "fixed",
|
|
1087
1129
|
// Lift the popover above the anchor via translateY(-100%).
|
|
1088
1130
|
// top points to (anchorTop - GAP); transform pulls bottom up to there.
|
|
1089
|
-
top:
|
|
1090
|
-
left:
|
|
1131
|
+
top: o.top,
|
|
1132
|
+
left: o.left,
|
|
1091
1133
|
transform: "translate(-50%, -100%)"
|
|
1092
1134
|
},
|
|
1093
|
-
children:
|
|
1135
|
+
children: i
|
|
1094
1136
|
}
|
|
1095
1137
|
),
|
|
1096
1138
|
document.body
|
|
1097
1139
|
);
|
|
1098
|
-
},
|
|
1140
|
+
}, Br = ({
|
|
1099
1141
|
isMuted: e,
|
|
1100
1142
|
onToggleMute: t,
|
|
1101
1143
|
isCameraEnabled: r,
|
|
1102
|
-
onToggleCamera:
|
|
1103
|
-
allowCamera:
|
|
1104
|
-
isScreenShareEnabled:
|
|
1144
|
+
onToggleCamera: i,
|
|
1145
|
+
allowCamera: a,
|
|
1146
|
+
isScreenShareEnabled: o,
|
|
1105
1147
|
onToggleScreenShare: s,
|
|
1106
|
-
allowScreenShare:
|
|
1148
|
+
allowScreenShare: l,
|
|
1107
1149
|
isSpeakerMuted: c,
|
|
1108
1150
|
onToggleSpeaker: p,
|
|
1109
1151
|
allowTyping: v,
|
|
1110
1152
|
isTypingOpen: f,
|
|
1111
1153
|
onToggleTyping: u,
|
|
1112
|
-
onDisconnect:
|
|
1154
|
+
onDisconnect: R
|
|
1113
1155
|
}) => {
|
|
1114
|
-
const [
|
|
1115
|
-
return /* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1156
|
+
const [k, _] = S(!1), m = A(null);
|
|
1157
|
+
return /* @__PURE__ */ b($e, { children: [
|
|
1158
|
+
/* @__PURE__ */ b(
|
|
1117
1159
|
"div",
|
|
1118
1160
|
{
|
|
1119
1161
|
className: "ll-toolbar ll-toolbar--compact",
|
|
1120
1162
|
"data-testid": "compact-toolbar",
|
|
1121
|
-
onClick: (
|
|
1163
|
+
onClick: (w) => w.stopPropagation(),
|
|
1122
1164
|
children: [
|
|
1123
1165
|
/* @__PURE__ */ n(
|
|
1124
1166
|
"button",
|
|
@@ -1127,20 +1169,20 @@ const Mr = ({
|
|
|
1127
1169
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1128
1170
|
onClick: t,
|
|
1129
1171
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1130
|
-
children: /* @__PURE__ */ n(
|
|
1172
|
+
children: /* @__PURE__ */ n(Nn, { muted: e })
|
|
1131
1173
|
}
|
|
1132
1174
|
),
|
|
1133
1175
|
/* @__PURE__ */ n(
|
|
1134
1176
|
"button",
|
|
1135
1177
|
{
|
|
1136
|
-
ref:
|
|
1178
|
+
ref: m,
|
|
1137
1179
|
type: "button",
|
|
1138
|
-
className: `ll-tool ${
|
|
1139
|
-
onClick: () => _((
|
|
1180
|
+
className: `ll-tool ${k ? "is-on" : ""}`,
|
|
1181
|
+
onClick: () => _((w) => !w),
|
|
1140
1182
|
"aria-label": "More controls",
|
|
1141
1183
|
"aria-haspopup": "menu",
|
|
1142
|
-
"aria-expanded":
|
|
1143
|
-
children: /* @__PURE__ */ n(
|
|
1184
|
+
"aria-expanded": k,
|
|
1185
|
+
children: /* @__PURE__ */ n(Wr, {})
|
|
1144
1186
|
}
|
|
1145
1187
|
),
|
|
1146
1188
|
/* @__PURE__ */ n(
|
|
@@ -1148,50 +1190,50 @@ const Mr = ({
|
|
|
1148
1190
|
{
|
|
1149
1191
|
type: "button",
|
|
1150
1192
|
className: "ll-tool ll-tool--danger",
|
|
1151
|
-
onClick:
|
|
1193
|
+
onClick: R,
|
|
1152
1194
|
"aria-label": "End conversation",
|
|
1153
|
-
children: /* @__PURE__ */ n(
|
|
1195
|
+
children: /* @__PURE__ */ n(In, {})
|
|
1154
1196
|
}
|
|
1155
1197
|
)
|
|
1156
1198
|
]
|
|
1157
1199
|
}
|
|
1158
1200
|
),
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
|
|
1201
|
+
/* @__PURE__ */ b(
|
|
1202
|
+
Or,
|
|
1161
1203
|
{
|
|
1162
|
-
open:
|
|
1204
|
+
open: k,
|
|
1163
1205
|
onClose: () => _(!1),
|
|
1164
|
-
anchorRef:
|
|
1206
|
+
anchorRef: m,
|
|
1165
1207
|
children: [
|
|
1166
|
-
|
|
1208
|
+
a && /* @__PURE__ */ b(
|
|
1167
1209
|
"button",
|
|
1168
1210
|
{
|
|
1169
1211
|
type: "button",
|
|
1170
1212
|
className: `ll-overflow-popover__item ${r ? "is-on" : ""}`,
|
|
1171
1213
|
onClick: () => {
|
|
1172
|
-
|
|
1214
|
+
i(), _(!1);
|
|
1173
1215
|
},
|
|
1174
1216
|
children: [
|
|
1175
|
-
/* @__PURE__ */ n(
|
|
1217
|
+
/* @__PURE__ */ n(Sn, {}),
|
|
1176
1218
|
/* @__PURE__ */ n("span", { children: r ? "Stop camera" : "Start camera" })
|
|
1177
1219
|
]
|
|
1178
1220
|
}
|
|
1179
1221
|
),
|
|
1180
|
-
|
|
1222
|
+
l && /* @__PURE__ */ b(
|
|
1181
1223
|
"button",
|
|
1182
1224
|
{
|
|
1183
1225
|
type: "button",
|
|
1184
|
-
className: `ll-overflow-popover__item ${
|
|
1226
|
+
className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
|
|
1185
1227
|
onClick: () => {
|
|
1186
1228
|
s(), _(!1);
|
|
1187
1229
|
},
|
|
1188
1230
|
children: [
|
|
1189
|
-
/* @__PURE__ */ n(
|
|
1190
|
-
/* @__PURE__ */ n("span", { children:
|
|
1231
|
+
/* @__PURE__ */ n(En, {}),
|
|
1232
|
+
/* @__PURE__ */ n("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1191
1233
|
]
|
|
1192
1234
|
}
|
|
1193
1235
|
),
|
|
1194
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ b(
|
|
1195
1237
|
"button",
|
|
1196
1238
|
{
|
|
1197
1239
|
type: "button",
|
|
@@ -1200,12 +1242,12 @@ const Mr = ({
|
|
|
1200
1242
|
p(), _(!1);
|
|
1201
1243
|
},
|
|
1202
1244
|
children: [
|
|
1203
|
-
/* @__PURE__ */ n(
|
|
1245
|
+
/* @__PURE__ */ n(An, { muted: c }),
|
|
1204
1246
|
/* @__PURE__ */ n("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1205
1247
|
]
|
|
1206
1248
|
}
|
|
1207
1249
|
),
|
|
1208
|
-
v && /* @__PURE__ */
|
|
1250
|
+
v && /* @__PURE__ */ b(
|
|
1209
1251
|
"button",
|
|
1210
1252
|
{
|
|
1211
1253
|
type: "button",
|
|
@@ -1214,12 +1256,12 @@ const Mr = ({
|
|
|
1214
1256
|
u(), _(!1);
|
|
1215
1257
|
},
|
|
1216
1258
|
children: [
|
|
1217
|
-
/* @__PURE__ */ n(
|
|
1259
|
+
/* @__PURE__ */ n(Fr, {}),
|
|
1218
1260
|
/* @__PURE__ */ n("span", { children: f ? "Hide typing" : "Type a message" })
|
|
1219
1261
|
]
|
|
1220
1262
|
}
|
|
1221
1263
|
),
|
|
1222
|
-
/* @__PURE__ */
|
|
1264
|
+
/* @__PURE__ */ b(
|
|
1223
1265
|
"button",
|
|
1224
1266
|
{
|
|
1225
1267
|
type: "button",
|
|
@@ -1237,8 +1279,8 @@ const Mr = ({
|
|
|
1237
1279
|
)
|
|
1238
1280
|
] });
|
|
1239
1281
|
};
|
|
1240
|
-
function
|
|
1241
|
-
return /* @__PURE__ */
|
|
1282
|
+
function Wr() {
|
|
1283
|
+
return /* @__PURE__ */ b(
|
|
1242
1284
|
"svg",
|
|
1243
1285
|
{
|
|
1244
1286
|
width: "16",
|
|
@@ -1254,7 +1296,7 @@ function Hr() {
|
|
|
1254
1296
|
}
|
|
1255
1297
|
);
|
|
1256
1298
|
}
|
|
1257
|
-
function
|
|
1299
|
+
function Fr() {
|
|
1258
1300
|
return /* @__PURE__ */ n(
|
|
1259
1301
|
"svg",
|
|
1260
1302
|
{
|
|
@@ -1271,56 +1313,56 @@ function Br() {
|
|
|
1271
1313
|
}
|
|
1272
1314
|
);
|
|
1273
1315
|
}
|
|
1274
|
-
const
|
|
1316
|
+
const qr = ({
|
|
1275
1317
|
position: e,
|
|
1276
1318
|
isMobile: t,
|
|
1277
1319
|
agentName: r,
|
|
1278
|
-
avatarImageUrl:
|
|
1279
|
-
idleLoopUrl:
|
|
1280
|
-
greeting:
|
|
1320
|
+
avatarImageUrl: i,
|
|
1321
|
+
idleLoopUrl: a,
|
|
1322
|
+
greeting: o,
|
|
1281
1323
|
branding: s,
|
|
1282
|
-
teamMembers:
|
|
1324
|
+
teamMembers: l,
|
|
1283
1325
|
currentTeamMemberId: c,
|
|
1284
1326
|
isSwitchingTeamMember: p,
|
|
1285
1327
|
teamSwitcherOpen: v,
|
|
1286
1328
|
onToggleTeamSwitcher: f,
|
|
1287
1329
|
onSelectTeamMember: u,
|
|
1288
|
-
languageMenuOpen:
|
|
1289
|
-
onToggleLanguageMenu:
|
|
1330
|
+
languageMenuOpen: R,
|
|
1331
|
+
onToggleLanguageMenu: k,
|
|
1290
1332
|
connectionState: _,
|
|
1291
|
-
agentState:
|
|
1292
|
-
transcript:
|
|
1293
|
-
canResume:
|
|
1333
|
+
agentState: m,
|
|
1334
|
+
transcript: w,
|
|
1335
|
+
canResume: N,
|
|
1294
1336
|
needsUserGesture: T,
|
|
1295
|
-
error:
|
|
1296
|
-
isMuted:
|
|
1337
|
+
error: I,
|
|
1338
|
+
isMuted: U,
|
|
1297
1339
|
micError: g,
|
|
1298
1340
|
micDevices: P,
|
|
1299
|
-
activeMicId:
|
|
1300
|
-
isCameraEnabled:
|
|
1301
|
-
cameraPreviewEl:
|
|
1341
|
+
activeMicId: O,
|
|
1342
|
+
isCameraEnabled: q,
|
|
1343
|
+
cameraPreviewEl: ne,
|
|
1302
1344
|
cameraDevices: B,
|
|
1303
|
-
activeCameraId:
|
|
1304
|
-
isScreenShareEnabled:
|
|
1305
|
-
screenPreviewEl:
|
|
1306
|
-
isSpeakerMuted:
|
|
1307
|
-
allowCamera:
|
|
1345
|
+
activeCameraId: j,
|
|
1346
|
+
isScreenShareEnabled: C,
|
|
1347
|
+
screenPreviewEl: Z,
|
|
1348
|
+
isSpeakerMuted: we,
|
|
1349
|
+
allowCamera: ce,
|
|
1308
1350
|
allowScreenShare: ze,
|
|
1309
|
-
allowTyping:
|
|
1310
|
-
showMinimize:
|
|
1311
|
-
showClose:
|
|
1312
|
-
chromeless:
|
|
1313
|
-
compactControls:
|
|
1314
|
-
transforming:
|
|
1315
|
-
transformingLabel:
|
|
1316
|
-
avatarVideoContainerRef:
|
|
1317
|
-
agentVideoEl:
|
|
1351
|
+
allowTyping: He,
|
|
1352
|
+
showMinimize: X = !0,
|
|
1353
|
+
showClose: Se = !0,
|
|
1354
|
+
chromeless: _e = !1,
|
|
1355
|
+
compactControls: W = !1,
|
|
1356
|
+
transforming: ie,
|
|
1357
|
+
transformingLabel: Y,
|
|
1358
|
+
avatarVideoContainerRef: fe,
|
|
1359
|
+
agentVideoEl: K,
|
|
1318
1360
|
onConnect: Qe,
|
|
1319
|
-
onDisconnect:
|
|
1361
|
+
onDisconnect: et,
|
|
1320
1362
|
onRetry: ft,
|
|
1321
|
-
onResumeAudio:
|
|
1363
|
+
onResumeAudio: tt,
|
|
1322
1364
|
onToggleMute: Ne,
|
|
1323
|
-
onSwitchMicDevice:
|
|
1365
|
+
onSwitchMicDevice: Oe,
|
|
1324
1366
|
onToggleCamera: Ae,
|
|
1325
1367
|
onSwitchCameraDevice: Be,
|
|
1326
1368
|
onToggleScreenShare: Ie,
|
|
@@ -1328,98 +1370,98 @@ const Wr = ({
|
|
|
1328
1370
|
onSendMessage: Me,
|
|
1329
1371
|
onMinimize: Te,
|
|
1330
1372
|
onClose: $,
|
|
1331
|
-
onClearMicError:
|
|
1373
|
+
onClearMicError: Lt
|
|
1332
1374
|
}) => {
|
|
1333
|
-
var
|
|
1334
|
-
const De = ((
|
|
1335
|
-
|
|
1336
|
-
if (!
|
|
1375
|
+
var gt;
|
|
1376
|
+
const De = ((l == null ? void 0 : l.length) ?? 0) > 1, We = _ === "connecting" || _ === "connected", pe = _ === "connected", nt = _ === "idle" || _ === "disconnected" || _ === "error", [Pe, Fe] = S(!1);
|
|
1377
|
+
M(() => {
|
|
1378
|
+
if (!K) {
|
|
1337
1379
|
Fe(!1);
|
|
1338
1380
|
return;
|
|
1339
1381
|
}
|
|
1340
|
-
if (!
|
|
1382
|
+
if (!K.paused && K.readyState >= 2) {
|
|
1341
1383
|
Fe(!0);
|
|
1342
1384
|
return;
|
|
1343
1385
|
}
|
|
1344
1386
|
Fe(!1);
|
|
1345
|
-
const
|
|
1346
|
-
return
|
|
1347
|
-
|
|
1387
|
+
const h = () => Fe(!0);
|
|
1388
|
+
return K.addEventListener("playing", h), K.addEventListener("loadeddata", h), () => {
|
|
1389
|
+
K.removeEventListener("playing", h), K.removeEventListener("loadeddata", h);
|
|
1348
1390
|
};
|
|
1349
|
-
}, [
|
|
1350
|
-
const [kt, ke] =
|
|
1351
|
-
|
|
1352
|
-
if (!
|
|
1391
|
+
}, [K]);
|
|
1392
|
+
const [kt, ke] = S(!1);
|
|
1393
|
+
M(() => {
|
|
1394
|
+
if (!pe) {
|
|
1353
1395
|
ke(!1);
|
|
1354
1396
|
return;
|
|
1355
1397
|
}
|
|
1356
1398
|
if (Pe) return;
|
|
1357
|
-
const
|
|
1358
|
-
return () => clearTimeout(
|
|
1359
|
-
}, [
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1364
|
-
}, [
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1367
|
-
}, [
|
|
1368
|
-
const [qe, Ue] =
|
|
1369
|
-
|
|
1370
|
-
if (!qe && !
|
|
1371
|
-
const
|
|
1372
|
-
Ue(!1),
|
|
1399
|
+
const h = setTimeout(() => ke(!0), 8e3);
|
|
1400
|
+
return () => clearTimeout(h);
|
|
1401
|
+
}, [pe, Pe]);
|
|
1402
|
+
const oe = _ === "connecting" || pe && !!i && !Pe && !kt, rt = A(null), me = A(null);
|
|
1403
|
+
M(() => {
|
|
1404
|
+
const h = rt.current;
|
|
1405
|
+
h && (h.innerHTML = "", ne && (ne.style.width = "100%", ne.style.height = "100%", ne.style.objectFit = "cover", ne.style.transform = "scaleX(-1)", h.appendChild(ne)));
|
|
1406
|
+
}, [ne]), M(() => {
|
|
1407
|
+
const h = me.current;
|
|
1408
|
+
h && (h.innerHTML = "", Z && (Z.style.width = "100%", Z.style.height = "100%", Z.style.objectFit = "contain", h.appendChild(Z)));
|
|
1409
|
+
}, [Z]);
|
|
1410
|
+
const [qe, Ue] = S(!1), [le, de] = S(!1), pt = A(null), ht = A(null);
|
|
1411
|
+
M(() => {
|
|
1412
|
+
if (!qe && !le && !R && !v) return;
|
|
1413
|
+
const h = () => {
|
|
1414
|
+
Ue(!1), de(!1), R && k(), v && f();
|
|
1373
1415
|
};
|
|
1374
|
-
return document.addEventListener("click",
|
|
1416
|
+
return document.addEventListener("click", h), () => document.removeEventListener("click", h);
|
|
1375
1417
|
}, [
|
|
1376
1418
|
qe,
|
|
1377
|
-
|
|
1378
|
-
|
|
1419
|
+
le,
|
|
1420
|
+
R,
|
|
1379
1421
|
v,
|
|
1380
|
-
|
|
1422
|
+
k,
|
|
1381
1423
|
f
|
|
1382
1424
|
]);
|
|
1383
|
-
const [
|
|
1384
|
-
(
|
|
1385
|
-
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1425
|
+
const [Ce, it] = S(!1), se = E(() => it((h) => !h), []), [ue, Ee] = S(""), ot = E(
|
|
1426
|
+
(h) => {
|
|
1427
|
+
h.preventDefault();
|
|
1428
|
+
const Q = ue.trim();
|
|
1429
|
+
Q && (Me(Q), Ee(""));
|
|
1388
1430
|
},
|
|
1389
|
-
[
|
|
1390
|
-
),
|
|
1391
|
-
let
|
|
1392
|
-
for (let
|
|
1393
|
-
const
|
|
1394
|
-
if (!
|
|
1431
|
+
[ue, Me]
|
|
1432
|
+
), mt = s.productName || "Live Layer", lt = !s.productName;
|
|
1433
|
+
let ge = null, xe = null;
|
|
1434
|
+
for (let h = w.length - 1; h >= 0; h--) {
|
|
1435
|
+
const Q = w[h];
|
|
1436
|
+
if (!ge && Q.role === "agent" ? ge = Q : !xe && Q.role === "user" && (xe = Q), ge && xe) break;
|
|
1395
1437
|
}
|
|
1396
|
-
const
|
|
1438
|
+
const je = pe ? (ge == null ? void 0 : ge.text) || null : o || null, Ve = pe && (xe == null ? void 0 : xe.text) || null, Ct = [
|
|
1397
1439
|
"ll-expanded",
|
|
1398
1440
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1399
1441
|
].join(" ");
|
|
1400
|
-
return /* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ b(
|
|
1401
1443
|
"div",
|
|
1402
1444
|
{
|
|
1403
|
-
className:
|
|
1445
|
+
className: Ct,
|
|
1404
1446
|
"data-position": e,
|
|
1405
|
-
"data-state":
|
|
1447
|
+
"data-state": pe ? "connected" : We ? "connecting" : "idle",
|
|
1406
1448
|
role: "dialog",
|
|
1407
1449
|
"aria-label": `${r} widget`,
|
|
1408
1450
|
children: [
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
|
|
1451
|
+
/* @__PURE__ */ b("div", { className: "ll-expanded__bg", children: [
|
|
1452
|
+
i ? /* @__PURE__ */ n(
|
|
1411
1453
|
Pr,
|
|
1412
1454
|
{
|
|
1413
|
-
src:
|
|
1455
|
+
src: i,
|
|
1414
1456
|
alt: r,
|
|
1415
1457
|
className: "ll-expanded__bg-img"
|
|
1416
1458
|
}
|
|
1417
|
-
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1418
|
-
|
|
1459
|
+
) : /* @__PURE__ */ n("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ n("span", { className: "ll-expanded__bg-initial", children: ((gt = r == null ? void 0 : r.charAt(0)) == null ? void 0 : gt.toUpperCase()) || "A" }) }),
|
|
1460
|
+
a && !pe && /* @__PURE__ */ n(
|
|
1419
1461
|
"video",
|
|
1420
1462
|
{
|
|
1421
1463
|
className: "ll-expanded__bg-idle",
|
|
1422
|
-
src:
|
|
1464
|
+
src: a,
|
|
1423
1465
|
autoPlay: !0,
|
|
1424
1466
|
loop: !0,
|
|
1425
1467
|
muted: !0,
|
|
@@ -1427,53 +1469,53 @@ const Wr = ({
|
|
|
1427
1469
|
}
|
|
1428
1470
|
)
|
|
1429
1471
|
] }),
|
|
1430
|
-
/* @__PURE__ */ n("div", { ref:
|
|
1431
|
-
|
|
1472
|
+
/* @__PURE__ */ n("div", { ref: fe, className: "ll-expanded__video" }),
|
|
1473
|
+
oe && /* @__PURE__ */ b("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1432
1474
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1433
1475
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: p ? "Switching..." : "Connecting..." })
|
|
1434
1476
|
] }),
|
|
1435
|
-
T &&
|
|
1477
|
+
T && pe && /* @__PURE__ */ b(
|
|
1436
1478
|
"button",
|
|
1437
1479
|
{
|
|
1438
1480
|
type: "button",
|
|
1439
1481
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1440
|
-
onClick:
|
|
1482
|
+
onClick: tt,
|
|
1441
1483
|
children: [
|
|
1442
1484
|
/* @__PURE__ */ n("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ n("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1443
1485
|
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
1444
1486
|
]
|
|
1445
1487
|
}
|
|
1446
1488
|
),
|
|
1447
|
-
|
|
1489
|
+
ie && /* @__PURE__ */ b(
|
|
1448
1490
|
"div",
|
|
1449
1491
|
{
|
|
1450
1492
|
className: "ll-expanded__overlay ll-expanded__overlay--transforming",
|
|
1451
1493
|
role: "status",
|
|
1452
1494
|
"aria-live": "polite",
|
|
1453
|
-
"aria-label":
|
|
1495
|
+
"aria-label": Y,
|
|
1454
1496
|
children: [
|
|
1455
1497
|
/* @__PURE__ */ n("div", { className: "ll-expanded__spinner" }),
|
|
1456
|
-
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children:
|
|
1498
|
+
/* @__PURE__ */ n("p", { className: "ll-expanded__overlay-text", children: Y })
|
|
1457
1499
|
]
|
|
1458
1500
|
}
|
|
1459
1501
|
),
|
|
1460
|
-
We ? /* @__PURE__ */
|
|
1461
|
-
!
|
|
1462
|
-
!
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1502
|
+
We ? /* @__PURE__ */ b($e, { children: [
|
|
1503
|
+
!W && /* @__PURE__ */ b("div", { className: "ll-expanded__topbar", children: [
|
|
1504
|
+
!_e && /* @__PURE__ */ b("div", { className: "ll-expanded__topbar-left", children: [
|
|
1505
|
+
/* @__PURE__ */ b("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1506
|
+
/* @__PURE__ */ b(
|
|
1465
1507
|
"button",
|
|
1466
1508
|
{
|
|
1467
1509
|
type: "button",
|
|
1468
1510
|
className: "ll-hpill",
|
|
1469
|
-
onClick: (
|
|
1470
|
-
De && (
|
|
1511
|
+
onClick: (h) => {
|
|
1512
|
+
De && (h.stopPropagation(), f());
|
|
1471
1513
|
},
|
|
1472
1514
|
"aria-haspopup": De ? "listbox" : void 0,
|
|
1473
1515
|
"aria-expanded": De ? v : void 0,
|
|
1474
1516
|
children: [
|
|
1475
1517
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: r }),
|
|
1476
|
-
De && /* @__PURE__ */ n(
|
|
1518
|
+
De && /* @__PURE__ */ n(wt, {})
|
|
1477
1519
|
]
|
|
1478
1520
|
}
|
|
1479
1521
|
),
|
|
@@ -1481,58 +1523,58 @@ const Wr = ({
|
|
|
1481
1523
|
"div",
|
|
1482
1524
|
{
|
|
1483
1525
|
className: "ll-hmenu",
|
|
1484
|
-
onClick: (
|
|
1526
|
+
onClick: (h) => h.stopPropagation(),
|
|
1485
1527
|
role: "listbox",
|
|
1486
|
-
children:
|
|
1528
|
+
children: l == null ? void 0 : l.map((h) => /* @__PURE__ */ b(
|
|
1487
1529
|
"button",
|
|
1488
1530
|
{
|
|
1489
1531
|
type: "button",
|
|
1490
|
-
className: `ll-hmenu__item ${
|
|
1491
|
-
onClick: () => u(
|
|
1532
|
+
className: `ll-hmenu__item ${h.id === c ? "is-active" : ""}`,
|
|
1533
|
+
onClick: () => u(h.id),
|
|
1492
1534
|
role: "option",
|
|
1493
|
-
"aria-selected":
|
|
1535
|
+
"aria-selected": h.id === c,
|
|
1494
1536
|
children: [
|
|
1495
|
-
|
|
1537
|
+
h.avatarImageUrl && /* @__PURE__ */ n(
|
|
1496
1538
|
"img",
|
|
1497
1539
|
{
|
|
1498
|
-
src:
|
|
1540
|
+
src: h.avatarImageUrl,
|
|
1499
1541
|
alt: "",
|
|
1500
1542
|
className: "ll-hmenu__avatar"
|
|
1501
1543
|
}
|
|
1502
1544
|
),
|
|
1503
|
-
/* @__PURE__ */ n("span", { className: "ll-hmenu__name", children:
|
|
1504
|
-
|
|
1545
|
+
/* @__PURE__ */ n("span", { className: "ll-hmenu__name", children: h.name }),
|
|
1546
|
+
h.role && /* @__PURE__ */ n("span", { className: "ll-hmenu__role", children: h.role })
|
|
1505
1547
|
]
|
|
1506
1548
|
},
|
|
1507
|
-
|
|
1549
|
+
h.id
|
|
1508
1550
|
))
|
|
1509
1551
|
}
|
|
1510
1552
|
)
|
|
1511
1553
|
] }),
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
/* @__PURE__ */
|
|
1554
|
+
/* @__PURE__ */ b("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1555
|
+
/* @__PURE__ */ b(
|
|
1514
1556
|
"button",
|
|
1515
1557
|
{
|
|
1516
1558
|
type: "button",
|
|
1517
1559
|
className: "ll-hpill ll-hpill--compact",
|
|
1518
|
-
onClick: (
|
|
1519
|
-
|
|
1560
|
+
onClick: (h) => {
|
|
1561
|
+
h.stopPropagation(), k();
|
|
1520
1562
|
},
|
|
1521
1563
|
"aria-haspopup": "listbox",
|
|
1522
|
-
"aria-expanded":
|
|
1564
|
+
"aria-expanded": R,
|
|
1523
1565
|
"aria-label": "Language: English",
|
|
1524
1566
|
title: "Language: English",
|
|
1525
1567
|
children: [
|
|
1526
1568
|
/* @__PURE__ */ n("span", { className: "ll-hpill__label", children: "EN" }),
|
|
1527
|
-
/* @__PURE__ */ n(
|
|
1569
|
+
/* @__PURE__ */ n(wt, {})
|
|
1528
1570
|
]
|
|
1529
1571
|
}
|
|
1530
1572
|
),
|
|
1531
|
-
|
|
1573
|
+
R && /* @__PURE__ */ n(
|
|
1532
1574
|
"div",
|
|
1533
1575
|
{
|
|
1534
1576
|
className: "ll-hmenu",
|
|
1535
|
-
onClick: (
|
|
1577
|
+
onClick: (h) => h.stopPropagation(),
|
|
1536
1578
|
role: "listbox",
|
|
1537
1579
|
children: /* @__PURE__ */ n(
|
|
1538
1580
|
"button",
|
|
@@ -1550,13 +1592,13 @@ const Wr = ({
|
|
|
1550
1592
|
/* @__PURE__ */ n(
|
|
1551
1593
|
"span",
|
|
1552
1594
|
{
|
|
1553
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1554
|
-
children:
|
|
1595
|
+
className: `ll-expanded__state ll-expanded__state--${m}`,
|
|
1596
|
+
children: m
|
|
1555
1597
|
}
|
|
1556
1598
|
)
|
|
1557
1599
|
] }),
|
|
1558
|
-
/* @__PURE__ */
|
|
1559
|
-
|
|
1600
|
+
/* @__PURE__ */ b("div", { className: "ll-expanded__header-actions", children: [
|
|
1601
|
+
X !== !1 && /* @__PURE__ */ n(
|
|
1560
1602
|
"button",
|
|
1561
1603
|
{
|
|
1562
1604
|
type: "button",
|
|
@@ -1564,10 +1606,10 @@ const Wr = ({
|
|
|
1564
1606
|
onClick: Te,
|
|
1565
1607
|
"aria-label": "Minimize widget",
|
|
1566
1608
|
title: "Minimize",
|
|
1567
|
-
children: /* @__PURE__ */ n(
|
|
1609
|
+
children: /* @__PURE__ */ n(pn, {})
|
|
1568
1610
|
}
|
|
1569
1611
|
),
|
|
1570
|
-
|
|
1612
|
+
Se !== !1 && /* @__PURE__ */ n(
|
|
1571
1613
|
"button",
|
|
1572
1614
|
{
|
|
1573
1615
|
type: "button",
|
|
@@ -1575,138 +1617,152 @@ const Wr = ({
|
|
|
1575
1617
|
onClick: $,
|
|
1576
1618
|
"aria-label": "End call",
|
|
1577
1619
|
title: "End call",
|
|
1578
|
-
children: /* @__PURE__ */ n(
|
|
1620
|
+
children: /* @__PURE__ */ n(fn, {})
|
|
1579
1621
|
}
|
|
1580
1622
|
)
|
|
1581
1623
|
] })
|
|
1582
1624
|
] }),
|
|
1583
|
-
|
|
1625
|
+
W && /* @__PURE__ */ b("div", { className: "ll-compact-status", "data-state": m, children: [
|
|
1584
1626
|
/* @__PURE__ */ n("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1585
|
-
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children:
|
|
1627
|
+
/* @__PURE__ */ n("span", { className: "ll-compact-status__label", children: m })
|
|
1586
1628
|
] })
|
|
1587
1629
|
] }) : (
|
|
1588
1630
|
// Idle-state header with Live Layer product name + minimize/close.
|
|
1589
1631
|
// Hidden in compact mode — on a 140×210 docked slot the brand pill
|
|
1590
1632
|
// and 40px buttons crowded out the central "Start video call"
|
|
1591
1633
|
// affordance. The user can dismiss by scrolling past the slot.
|
|
1592
|
-
!
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
|
|
1595
|
-
|
|
1634
|
+
!W && /* @__PURE__ */ b("div", { className: "ll-expanded__header ll-expanded__header--idle", children: [
|
|
1635
|
+
lt ? /* @__PURE__ */ b(
|
|
1636
|
+
"a",
|
|
1637
|
+
{
|
|
1638
|
+
className: "ll-expanded__brand ll-expanded__brand--link",
|
|
1639
|
+
href: "https://livelayer.studio?utm_source=widget&utm_medium=brand-badge",
|
|
1640
|
+
target: "_blank",
|
|
1641
|
+
rel: "noopener noreferrer",
|
|
1642
|
+
"aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
|
|
1643
|
+
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1644
|
+
children: [
|
|
1645
|
+
/* @__PURE__ */ n(zr, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1646
|
+
/* @__PURE__ */ n("span", { children: mt })
|
|
1647
|
+
]
|
|
1648
|
+
}
|
|
1649
|
+
) : /* @__PURE__ */ n("span", { className: "ll-expanded__brand", children: mt }),
|
|
1650
|
+
/* @__PURE__ */ b("div", { className: "ll-expanded__header-actions", children: [
|
|
1651
|
+
X !== !1 && /* @__PURE__ */ n(
|
|
1596
1652
|
"button",
|
|
1597
1653
|
{
|
|
1598
1654
|
type: "button",
|
|
1599
1655
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1600
1656
|
onClick: Te,
|
|
1601
1657
|
"aria-label": "Minimize widget",
|
|
1602
|
-
children: /* @__PURE__ */ n(
|
|
1658
|
+
children: /* @__PURE__ */ n(pn, {})
|
|
1603
1659
|
}
|
|
1604
1660
|
),
|
|
1605
|
-
|
|
1661
|
+
Se !== !1 && /* @__PURE__ */ n(
|
|
1606
1662
|
"button",
|
|
1607
1663
|
{
|
|
1608
1664
|
type: "button",
|
|
1609
1665
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1610
1666
|
onClick: $,
|
|
1611
1667
|
"aria-label": "Close widget",
|
|
1612
|
-
children: /* @__PURE__ */ n(
|
|
1668
|
+
children: /* @__PURE__ */ n(fn, {})
|
|
1613
1669
|
}
|
|
1614
1670
|
)
|
|
1615
1671
|
] })
|
|
1616
1672
|
] })
|
|
1617
1673
|
),
|
|
1618
|
-
|
|
1619
|
-
const
|
|
1620
|
-
return /* @__PURE__ */
|
|
1621
|
-
!
|
|
1674
|
+
nt && /* @__PURE__ */ (() => {
|
|
1675
|
+
const h = N ? "Resume session" : _ === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1676
|
+
return /* @__PURE__ */ b($e, { children: [
|
|
1677
|
+
!I && /* @__PURE__ */ b(
|
|
1622
1678
|
"button",
|
|
1623
1679
|
{
|
|
1624
1680
|
type: "button",
|
|
1625
1681
|
className: "ll-expanded__play",
|
|
1626
1682
|
onClick: Qe,
|
|
1627
|
-
"aria-label":
|
|
1683
|
+
"aria-label": h,
|
|
1628
1684
|
children: [
|
|
1629
1685
|
/* @__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
|
-
|
|
1686
|
+
W && /* @__PURE__ */ n("span", { className: "ll-expanded__play-label", children: h })
|
|
1631
1687
|
]
|
|
1632
1688
|
}
|
|
1633
1689
|
),
|
|
1634
|
-
!
|
|
1635
|
-
|
|
1690
|
+
!W && /* @__PURE__ */ b("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
1691
|
+
o && /* @__PURE__ */ n("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: o }) }),
|
|
1636
1692
|
/* @__PURE__ */ n(
|
|
1637
1693
|
"button",
|
|
1638
1694
|
{
|
|
1639
1695
|
type: "button",
|
|
1640
1696
|
className: "ll-expanded__cta",
|
|
1641
1697
|
onClick: Qe,
|
|
1642
|
-
"aria-label":
|
|
1643
|
-
children:
|
|
1698
|
+
"aria-label": h,
|
|
1699
|
+
children: h
|
|
1644
1700
|
}
|
|
1645
1701
|
)
|
|
1646
1702
|
] })
|
|
1647
1703
|
] });
|
|
1648
1704
|
})(),
|
|
1649
|
-
/* @__PURE__ */
|
|
1705
|
+
/* @__PURE__ */ b(
|
|
1650
1706
|
"div",
|
|
1651
1707
|
{
|
|
1652
|
-
className: `ll-expanded__pip ${We && (
|
|
1708
|
+
className: `ll-expanded__pip ${We && (q || C) ? "is-visible" : ""}`,
|
|
1653
1709
|
children: [
|
|
1654
1710
|
/* @__PURE__ */ n(
|
|
1655
1711
|
"div",
|
|
1656
1712
|
{
|
|
1657
|
-
ref:
|
|
1658
|
-
className:
|
|
1713
|
+
ref: me,
|
|
1714
|
+
className: C ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1659
1715
|
}
|
|
1660
1716
|
),
|
|
1661
1717
|
/* @__PURE__ */ n(
|
|
1662
1718
|
"div",
|
|
1663
1719
|
{
|
|
1664
|
-
ref:
|
|
1665
|
-
className: !
|
|
1720
|
+
ref: rt,
|
|
1721
|
+
className: !C && q ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
1666
1722
|
}
|
|
1667
1723
|
)
|
|
1668
1724
|
]
|
|
1669
1725
|
}
|
|
1670
1726
|
),
|
|
1671
|
-
We ? /* @__PURE__ */
|
|
1672
|
-
!
|
|
1727
|
+
We ? /* @__PURE__ */ b("div", { className: "ll-expanded__bottom", children: [
|
|
1728
|
+
!W && je && /* @__PURE__ */ n(
|
|
1673
1729
|
"div",
|
|
1674
1730
|
{
|
|
1675
1731
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
1676
1732
|
"data-role": "agent",
|
|
1677
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1733
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: je })
|
|
1678
1734
|
}
|
|
1679
1735
|
),
|
|
1680
|
-
!
|
|
1736
|
+
!W && Ve && /* @__PURE__ */ n(
|
|
1681
1737
|
"div",
|
|
1682
1738
|
{
|
|
1683
1739
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
1684
1740
|
"data-role": "user",
|
|
1685
|
-
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children:
|
|
1741
|
+
children: /* @__PURE__ */ n("p", { className: "ll-expanded__transcript-text", children: Ve })
|
|
1686
1742
|
}
|
|
1687
1743
|
),
|
|
1688
|
-
!
|
|
1744
|
+
!_e && !W && /* @__PURE__ */ b("div", { className: "ll-toolbar", onClick: (h) => h.stopPropagation(), children: [
|
|
1689
1745
|
ze && /* @__PURE__ */ n(
|
|
1690
1746
|
"button",
|
|
1691
1747
|
{
|
|
1692
1748
|
type: "button",
|
|
1693
|
-
className: `ll-tool ${
|
|
1749
|
+
className: `ll-tool ${C ? "is-on" : ""}`,
|
|
1694
1750
|
onClick: Ie,
|
|
1695
|
-
"aria-label":
|
|
1696
|
-
title:
|
|
1697
|
-
children: /* @__PURE__ */ n(
|
|
1751
|
+
"aria-label": C ? "Stop sharing screen" : "Share screen",
|
|
1752
|
+
title: C ? "Stop sharing" : "Share screen",
|
|
1753
|
+
children: /* @__PURE__ */ n(En, {})
|
|
1698
1754
|
}
|
|
1699
1755
|
),
|
|
1700
|
-
|
|
1756
|
+
ce && /* @__PURE__ */ b("div", { className: "ll-tool-split", children: [
|
|
1701
1757
|
/* @__PURE__ */ n(
|
|
1702
1758
|
"button",
|
|
1703
1759
|
{
|
|
1704
1760
|
type: "button",
|
|
1705
|
-
className: `ll-tool ll-tool--left ${
|
|
1761
|
+
className: `ll-tool ll-tool--left ${q ? "is-on" : ""}`,
|
|
1706
1762
|
onClick: Ae,
|
|
1707
|
-
"aria-label":
|
|
1708
|
-
title:
|
|
1709
|
-
children: /* @__PURE__ */ n(
|
|
1763
|
+
"aria-label": q ? "Turn off camera" : "Turn on camera",
|
|
1764
|
+
title: q ? "Stop camera" : "Start camera",
|
|
1765
|
+
children: /* @__PURE__ */ n(Sn, {})
|
|
1710
1766
|
}
|
|
1711
1767
|
),
|
|
1712
1768
|
/* @__PURE__ */ n(
|
|
@@ -1714,39 +1770,39 @@ const Wr = ({
|
|
|
1714
1770
|
{
|
|
1715
1771
|
ref: ht,
|
|
1716
1772
|
type: "button",
|
|
1717
|
-
className: `ll-tool ll-tool--right ${
|
|
1718
|
-
onClick: (
|
|
1719
|
-
|
|
1773
|
+
className: `ll-tool ll-tool--right ${q ? "is-on" : ""}`,
|
|
1774
|
+
onClick: (h) => {
|
|
1775
|
+
h.stopPropagation(), de((Q) => !Q), Ue(!1);
|
|
1720
1776
|
},
|
|
1721
1777
|
"aria-label": "Camera devices",
|
|
1722
1778
|
"aria-haspopup": "listbox",
|
|
1723
|
-
"aria-expanded":
|
|
1724
|
-
children: /* @__PURE__ */ n(
|
|
1779
|
+
"aria-expanded": le,
|
|
1780
|
+
children: /* @__PURE__ */ n(wt, {})
|
|
1725
1781
|
}
|
|
1726
1782
|
),
|
|
1727
|
-
|
|
1728
|
-
|
|
1783
|
+
le && B.length > 0 && /* @__PURE__ */ n(
|
|
1784
|
+
hn,
|
|
1729
1785
|
{
|
|
1730
1786
|
label: "Camera",
|
|
1731
1787
|
devices: B,
|
|
1732
|
-
activeId:
|
|
1788
|
+
activeId: j,
|
|
1733
1789
|
anchorRef: ht,
|
|
1734
|
-
onPick: (
|
|
1735
|
-
|
|
1790
|
+
onPick: (h) => {
|
|
1791
|
+
de(!1), Be(h);
|
|
1736
1792
|
}
|
|
1737
1793
|
}
|
|
1738
1794
|
)
|
|
1739
1795
|
] }),
|
|
1740
|
-
/* @__PURE__ */
|
|
1796
|
+
/* @__PURE__ */ b("div", { className: "ll-tool-split", children: [
|
|
1741
1797
|
/* @__PURE__ */ n(
|
|
1742
1798
|
"button",
|
|
1743
1799
|
{
|
|
1744
1800
|
type: "button",
|
|
1745
|
-
className: `ll-tool ll-tool--left ${
|
|
1801
|
+
className: `ll-tool ll-tool--left ${U ? "is-muted" : ""}`,
|
|
1746
1802
|
onClick: Ne,
|
|
1747
|
-
"aria-label":
|
|
1748
|
-
title:
|
|
1749
|
-
children: /* @__PURE__ */ n(
|
|
1803
|
+
"aria-label": U ? "Unmute microphone" : "Mute microphone",
|
|
1804
|
+
title: U ? "Unmute" : "Mute",
|
|
1805
|
+
children: /* @__PURE__ */ n(Nn, { muted: U })
|
|
1750
1806
|
}
|
|
1751
1807
|
),
|
|
1752
1808
|
/* @__PURE__ */ n(
|
|
@@ -1754,25 +1810,25 @@ const Wr = ({
|
|
|
1754
1810
|
{
|
|
1755
1811
|
ref: pt,
|
|
1756
1812
|
type: "button",
|
|
1757
|
-
className: `ll-tool ll-tool--right ${
|
|
1758
|
-
onClick: (
|
|
1759
|
-
|
|
1813
|
+
className: `ll-tool ll-tool--right ${U ? "is-muted" : ""}`,
|
|
1814
|
+
onClick: (h) => {
|
|
1815
|
+
h.stopPropagation(), Ue((Q) => !Q), de(!1);
|
|
1760
1816
|
},
|
|
1761
1817
|
"aria-label": "Microphone devices",
|
|
1762
1818
|
"aria-haspopup": "listbox",
|
|
1763
1819
|
"aria-expanded": qe,
|
|
1764
|
-
children: /* @__PURE__ */ n(
|
|
1820
|
+
children: /* @__PURE__ */ n(wt, {})
|
|
1765
1821
|
}
|
|
1766
1822
|
),
|
|
1767
1823
|
qe && P.length > 0 && /* @__PURE__ */ n(
|
|
1768
|
-
|
|
1824
|
+
hn,
|
|
1769
1825
|
{
|
|
1770
1826
|
label: "Microphone",
|
|
1771
1827
|
devices: P,
|
|
1772
|
-
activeId:
|
|
1828
|
+
activeId: O,
|
|
1773
1829
|
anchorRef: pt,
|
|
1774
|
-
onPick: (
|
|
1775
|
-
Ue(!1),
|
|
1830
|
+
onPick: (h) => {
|
|
1831
|
+
Ue(!1), Oe(h);
|
|
1776
1832
|
}
|
|
1777
1833
|
}
|
|
1778
1834
|
)
|
|
@@ -1781,11 +1837,11 @@ const Wr = ({
|
|
|
1781
1837
|
"button",
|
|
1782
1838
|
{
|
|
1783
1839
|
type: "button",
|
|
1784
|
-
className: `ll-tool ${
|
|
1840
|
+
className: `ll-tool ${we ? "is-muted" : ""}`,
|
|
1785
1841
|
onClick: Re,
|
|
1786
|
-
"aria-label":
|
|
1787
|
-
title:
|
|
1788
|
-
children: /* @__PURE__ */ n(
|
|
1842
|
+
"aria-label": we ? "Unmute speaker" : "Mute speaker",
|
|
1843
|
+
title: we ? "Unmute speaker" : "Mute speaker",
|
|
1844
|
+
children: /* @__PURE__ */ n(An, { muted: we })
|
|
1789
1845
|
}
|
|
1790
1846
|
),
|
|
1791
1847
|
/* @__PURE__ */ n(
|
|
@@ -1793,81 +1849,81 @@ const Wr = ({
|
|
|
1793
1849
|
{
|
|
1794
1850
|
type: "button",
|
|
1795
1851
|
className: "ll-tool ll-tool--danger",
|
|
1796
|
-
onClick:
|
|
1852
|
+
onClick: et,
|
|
1797
1853
|
"aria-label": "End conversation",
|
|
1798
1854
|
title: "End conversation",
|
|
1799
|
-
children: /* @__PURE__ */ n(
|
|
1855
|
+
children: /* @__PURE__ */ n(In, {})
|
|
1800
1856
|
}
|
|
1801
1857
|
)
|
|
1802
1858
|
] }),
|
|
1803
|
-
!
|
|
1804
|
-
|
|
1859
|
+
!_e && W && /* @__PURE__ */ n(
|
|
1860
|
+
Br,
|
|
1805
1861
|
{
|
|
1806
|
-
isMuted:
|
|
1862
|
+
isMuted: U,
|
|
1807
1863
|
onToggleMute: Ne,
|
|
1808
|
-
isCameraEnabled:
|
|
1864
|
+
isCameraEnabled: q,
|
|
1809
1865
|
onToggleCamera: Ae,
|
|
1810
|
-
allowCamera:
|
|
1811
|
-
isScreenShareEnabled:
|
|
1866
|
+
allowCamera: ce,
|
|
1867
|
+
isScreenShareEnabled: C,
|
|
1812
1868
|
onToggleScreenShare: Ie,
|
|
1813
1869
|
allowScreenShare: ze,
|
|
1814
|
-
isSpeakerMuted:
|
|
1870
|
+
isSpeakerMuted: we,
|
|
1815
1871
|
onToggleSpeaker: Re,
|
|
1816
|
-
allowTyping:
|
|
1817
|
-
isTypingOpen:
|
|
1818
|
-
onToggleTyping:
|
|
1819
|
-
onDisconnect:
|
|
1872
|
+
allowTyping: He,
|
|
1873
|
+
isTypingOpen: Ce,
|
|
1874
|
+
onToggleTyping: se,
|
|
1875
|
+
onDisconnect: et
|
|
1820
1876
|
}
|
|
1821
1877
|
),
|
|
1822
|
-
!
|
|
1878
|
+
!_e && He && (W ? Ce : !0) && /* @__PURE__ */ b("form", { className: "ll-message-input", onSubmit: ot, children: [
|
|
1823
1879
|
/* @__PURE__ */ n(
|
|
1824
1880
|
"input",
|
|
1825
1881
|
{
|
|
1826
1882
|
type: "text",
|
|
1827
1883
|
className: "ll-message-input__field",
|
|
1828
1884
|
placeholder: "Message...",
|
|
1829
|
-
value:
|
|
1830
|
-
onChange: (
|
|
1885
|
+
value: ue,
|
|
1886
|
+
onChange: (h) => Ee(h.target.value),
|
|
1831
1887
|
"aria-label": "Message the agent"
|
|
1832
1888
|
}
|
|
1833
1889
|
),
|
|
1834
|
-
|
|
1890
|
+
ue.trim() && /* @__PURE__ */ n(
|
|
1835
1891
|
"button",
|
|
1836
1892
|
{
|
|
1837
1893
|
type: "submit",
|
|
1838
1894
|
className: "ll-message-input__send",
|
|
1839
1895
|
"aria-label": "Send message",
|
|
1840
|
-
children: /* @__PURE__ */ n(
|
|
1896
|
+
children: /* @__PURE__ */ n(Ur, {})
|
|
1841
1897
|
}
|
|
1842
1898
|
)
|
|
1843
1899
|
] })
|
|
1844
1900
|
] }) : null,
|
|
1845
1901
|
(() => {
|
|
1846
1902
|
if (g && _ !== "error")
|
|
1847
|
-
return /* @__PURE__ */
|
|
1903
|
+
return /* @__PURE__ */ b("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
1848
1904
|
/* @__PURE__ */ n("span", { children: g }),
|
|
1849
1905
|
/* @__PURE__ */ n(
|
|
1850
1906
|
"button",
|
|
1851
1907
|
{
|
|
1852
1908
|
type: "button",
|
|
1853
1909
|
className: "ll-expanded__banner-x",
|
|
1854
|
-
onClick:
|
|
1910
|
+
onClick: Lt,
|
|
1855
1911
|
"aria-label": "Dismiss",
|
|
1856
1912
|
children: "×"
|
|
1857
1913
|
}
|
|
1858
1914
|
)
|
|
1859
1915
|
] });
|
|
1860
|
-
if (!
|
|
1861
|
-
let
|
|
1862
|
-
return
|
|
1863
|
-
/* @__PURE__ */ n("span", { children:
|
|
1916
|
+
if (!I || _ !== "error") return null;
|
|
1917
|
+
let h = "Failed to connect", Q = "Try again";
|
|
1918
|
+
return I === "MIC_PERMISSION_DENIED" ? h = "Microphone blocked. Allow access to talk." : I === "MIC_NOT_FOUND" ? h = "No microphone found. Plug one in + retry." : I === "MIC_UNAVAILABLE" ? h = "Mic unavailable. Check other apps using it." : I === "AGENT_TIMEOUT" ? h = "Agent didn't pick up. Try again." : I === "CONNECT_FAILED" ? h = "Connection failed. Check your network." : I.length < 80 && (h = I), /* @__PURE__ */ b("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
1919
|
+
/* @__PURE__ */ n("span", { children: h }),
|
|
1864
1920
|
/* @__PURE__ */ n(
|
|
1865
1921
|
"button",
|
|
1866
1922
|
{
|
|
1867
1923
|
type: "button",
|
|
1868
1924
|
className: "ll-expanded__banner-retry",
|
|
1869
1925
|
onClick: ft,
|
|
1870
|
-
children:
|
|
1926
|
+
children: Q
|
|
1871
1927
|
}
|
|
1872
1928
|
)
|
|
1873
1929
|
] });
|
|
@@ -1876,55 +1932,55 @@ const Wr = ({
|
|
|
1876
1932
|
}
|
|
1877
1933
|
);
|
|
1878
1934
|
};
|
|
1879
|
-
function
|
|
1935
|
+
function wt() {
|
|
1880
1936
|
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
1937
|
}
|
|
1882
|
-
function
|
|
1883
|
-
return /* @__PURE__ */
|
|
1938
|
+
function fn() {
|
|
1939
|
+
return /* @__PURE__ */ b("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
1884
1940
|
/* @__PURE__ */ n("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1885
1941
|
/* @__PURE__ */ n("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1886
1942
|
] });
|
|
1887
1943
|
}
|
|
1888
|
-
function
|
|
1944
|
+
function pn() {
|
|
1889
1945
|
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
1946
|
}
|
|
1891
|
-
function
|
|
1892
|
-
return /* @__PURE__ */
|
|
1947
|
+
function En() {
|
|
1948
|
+
return /* @__PURE__ */ b("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
1949
|
/* @__PURE__ */ n("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
1894
1950
|
/* @__PURE__ */ n("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
1895
1951
|
/* @__PURE__ */ n("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
1896
1952
|
] });
|
|
1897
1953
|
}
|
|
1898
|
-
function
|
|
1899
|
-
return /* @__PURE__ */
|
|
1954
|
+
function Sn() {
|
|
1955
|
+
return /* @__PURE__ */ b("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
1956
|
/* @__PURE__ */ n("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
1901
1957
|
/* @__PURE__ */ n("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
1902
1958
|
] });
|
|
1903
1959
|
}
|
|
1904
|
-
function
|
|
1905
|
-
return /* @__PURE__ */
|
|
1960
|
+
function Nn({ muted: e }) {
|
|
1961
|
+
return /* @__PURE__ */ b("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: [
|
|
1906
1962
|
/* @__PURE__ */ n("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
1907
1963
|
/* @__PURE__ */ n("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
1908
1964
|
/* @__PURE__ */ n("line", { x1: "12", y1: "19", x2: "12", y2: "23" }),
|
|
1909
1965
|
e && /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
1910
1966
|
] });
|
|
1911
1967
|
}
|
|
1912
|
-
function
|
|
1913
|
-
return /* @__PURE__ */
|
|
1968
|
+
function An({ muted: e }) {
|
|
1969
|
+
return /* @__PURE__ */ b("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: [
|
|
1914
1970
|
/* @__PURE__ */ n("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
1915
|
-
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */
|
|
1971
|
+
e ? /* @__PURE__ */ n("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ b($e, { children: [
|
|
1916
1972
|
/* @__PURE__ */ n("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
1917
1973
|
/* @__PURE__ */ n("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
1918
1974
|
] })
|
|
1919
1975
|
] });
|
|
1920
1976
|
}
|
|
1921
|
-
function
|
|
1922
|
-
return /* @__PURE__ */
|
|
1977
|
+
function Ur() {
|
|
1978
|
+
return /* @__PURE__ */ b("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
1923
1979
|
/* @__PURE__ */ n("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1924
1980
|
/* @__PURE__ */ n("polyline", { points: "12 5 19 12 12 19" })
|
|
1925
1981
|
] });
|
|
1926
1982
|
}
|
|
1927
|
-
function
|
|
1983
|
+
function In() {
|
|
1928
1984
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ n(
|
|
1929
1985
|
"path",
|
|
1930
1986
|
{
|
|
@@ -1933,17 +1989,17 @@ function An() {
|
|
|
1933
1989
|
}
|
|
1934
1990
|
) });
|
|
1935
1991
|
}
|
|
1936
|
-
const
|
|
1992
|
+
const hn = ({
|
|
1937
1993
|
label: e,
|
|
1938
1994
|
devices: t,
|
|
1939
1995
|
activeId: r,
|
|
1940
|
-
onPick:
|
|
1941
|
-
anchorRef:
|
|
1996
|
+
onPick: i,
|
|
1997
|
+
anchorRef: a
|
|
1942
1998
|
}) => {
|
|
1943
|
-
const [
|
|
1944
|
-
return
|
|
1945
|
-
const
|
|
1946
|
-
const c =
|
|
1999
|
+
const [o, s] = S(null);
|
|
2000
|
+
return Ln(() => {
|
|
2001
|
+
const l = () => {
|
|
2002
|
+
const c = a.current;
|
|
1947
2003
|
if (!c) return;
|
|
1948
2004
|
const p = c.getBoundingClientRect(), v = 126, f = window.innerWidth - 16 - 110, u = p.left + p.width / 2;
|
|
1949
2005
|
s({
|
|
@@ -1951,41 +2007,41 @@ const pn = ({
|
|
|
1951
2007
|
left: Math.max(v, Math.min(f, u))
|
|
1952
2008
|
});
|
|
1953
2009
|
};
|
|
1954
|
-
return
|
|
1955
|
-
window.removeEventListener("scroll",
|
|
2010
|
+
return l(), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l), () => {
|
|
2011
|
+
window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l);
|
|
1956
2012
|
};
|
|
1957
|
-
}, [
|
|
1958
|
-
/* @__PURE__ */
|
|
2013
|
+
}, [a]), o === null || typeof document > "u" ? null : $t(
|
|
2014
|
+
/* @__PURE__ */ b(
|
|
1959
2015
|
"div",
|
|
1960
2016
|
{
|
|
1961
2017
|
className: "ll-device-menu ll-device-menu--floating",
|
|
1962
|
-
onClick: (
|
|
2018
|
+
onClick: (l) => l.stopPropagation(),
|
|
1963
2019
|
role: "listbox",
|
|
1964
2020
|
style: {
|
|
1965
2021
|
position: "fixed",
|
|
1966
|
-
top:
|
|
1967
|
-
left:
|
|
2022
|
+
top: o.top,
|
|
2023
|
+
left: o.left,
|
|
1968
2024
|
// translate up by 100% so its BOTTOM edge sits at pos.top.
|
|
1969
2025
|
transform: "translate(-50%, -100%)"
|
|
1970
2026
|
},
|
|
1971
2027
|
children: [
|
|
1972
2028
|
/* @__PURE__ */ n("p", { className: "ll-device-menu__label", children: e }),
|
|
1973
|
-
t.map((
|
|
1974
|
-
const p = r ===
|
|
1975
|
-
return /* @__PURE__ */
|
|
2029
|
+
t.map((l, c) => {
|
|
2030
|
+
const p = r === l.deviceId;
|
|
2031
|
+
return /* @__PURE__ */ b(
|
|
1976
2032
|
"button",
|
|
1977
2033
|
{
|
|
1978
2034
|
type: "button",
|
|
1979
2035
|
className: `ll-device-menu__item ${p ? "is-active" : ""}`,
|
|
1980
|
-
onClick: () =>
|
|
2036
|
+
onClick: () => i(l.deviceId),
|
|
1981
2037
|
role: "option",
|
|
1982
2038
|
"aria-selected": p,
|
|
1983
2039
|
children: [
|
|
1984
2040
|
p && /* @__PURE__ */ n("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
1985
|
-
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children:
|
|
2041
|
+
/* @__PURE__ */ n("span", { className: "ll-device-menu__name", children: l.label || `${e} ${c + 1}` })
|
|
1986
2042
|
]
|
|
1987
2043
|
},
|
|
1988
|
-
|
|
2044
|
+
l.deviceId || c
|
|
1989
2045
|
);
|
|
1990
2046
|
})
|
|
1991
2047
|
]
|
|
@@ -1993,7 +2049,7 @@ const pn = ({
|
|
|
1993
2049
|
),
|
|
1994
2050
|
document.body
|
|
1995
2051
|
);
|
|
1996
|
-
},
|
|
2052
|
+
}, jr = [
|
|
1997
2053
|
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
1998
2054
|
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
1999
2055
|
// is the recommended spelling; "true" is preserved for back-compat.
|
|
@@ -2001,17 +2057,17 @@ const pn = ({
|
|
|
2001
2057
|
"[data-ll-skip]",
|
|
2002
2058
|
".ll-widget"
|
|
2003
2059
|
];
|
|
2004
|
-
function
|
|
2060
|
+
function zt(e) {
|
|
2005
2061
|
let t = e;
|
|
2006
2062
|
for (; t; ) {
|
|
2007
|
-
for (const r of
|
|
2063
|
+
for (const r of jr)
|
|
2008
2064
|
if (t.matches(r)) return !0;
|
|
2009
2065
|
t = t.parentElement;
|
|
2010
2066
|
}
|
|
2011
2067
|
return !1;
|
|
2012
2068
|
}
|
|
2013
|
-
function
|
|
2014
|
-
if (
|
|
2069
|
+
function Dt(e) {
|
|
2070
|
+
if (zt(e)) return !1;
|
|
2015
2071
|
if (e instanceof HTMLInputElement) {
|
|
2016
2072
|
if (e.type === "password") return !1;
|
|
2017
2073
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2019,7 +2075,7 @@ function Tt(e) {
|
|
|
2019
2075
|
}
|
|
2020
2076
|
return !0;
|
|
2021
2077
|
}
|
|
2022
|
-
const
|
|
2078
|
+
const _t = 4096, Vr = 20, Yr = 20, Gr = 10, Kr = 10, Jr = 30, Xr = 20, mn = 500, Zr = [
|
|
2023
2079
|
'[data-ll-private="true"]',
|
|
2024
2080
|
".ll-widget",
|
|
2025
2081
|
"script",
|
|
@@ -2031,7 +2087,7 @@ function dt(e) {
|
|
|
2031
2087
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2032
2088
|
let t = e;
|
|
2033
2089
|
for (; t; ) {
|
|
2034
|
-
for (const r of
|
|
2090
|
+
for (const r of Zr)
|
|
2035
2091
|
if (t.matches(r)) return !0;
|
|
2036
2092
|
t = t.parentElement;
|
|
2037
2093
|
}
|
|
@@ -2041,58 +2097,72 @@ function ut(e) {
|
|
|
2041
2097
|
if (typeof window > "u") return !0;
|
|
2042
2098
|
const t = e.getBoundingClientRect();
|
|
2043
2099
|
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 <
|
|
2100
|
+
const r = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2101
|
+
return t.bottom > 0 && t.right > 0 && t.top < r && t.left < i;
|
|
2046
2102
|
}
|
|
2047
|
-
function
|
|
2103
|
+
function gn(e) {
|
|
2048
2104
|
const t = e.getAttribute("id");
|
|
2049
2105
|
if (t) {
|
|
2050
|
-
const
|
|
2106
|
+
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
|
|
2051
2107
|
if (s != null && s.textContent) return s.textContent.trim();
|
|
2052
2108
|
}
|
|
2053
2109
|
const r = e.getAttribute("aria-label");
|
|
2054
2110
|
if (r) return r.trim();
|
|
2055
|
-
const
|
|
2056
|
-
if (
|
|
2057
|
-
|
|
2058
|
-
|
|
2111
|
+
const i = e.closest("label");
|
|
2112
|
+
if (i) {
|
|
2113
|
+
const o = [];
|
|
2114
|
+
for (const l of Array.from(i.childNodes))
|
|
2115
|
+
if (l.nodeType === Node.TEXT_NODE) {
|
|
2116
|
+
const c = (l.textContent || "").trim();
|
|
2117
|
+
c && o.push(c);
|
|
2118
|
+
} else if (l instanceof HTMLElement) {
|
|
2119
|
+
if (l instanceof HTMLInputElement || l instanceof HTMLTextAreaElement || l instanceof HTMLSelectElement || l instanceof HTMLButtonElement)
|
|
2120
|
+
continue;
|
|
2121
|
+
const c = (l.textContent || "").trim();
|
|
2122
|
+
c && o.push(c);
|
|
2123
|
+
}
|
|
2124
|
+
const s = o.join(" ").trim();
|
|
2125
|
+
if (s) return s;
|
|
2126
|
+
}
|
|
2127
|
+
const a = e.getAttribute("placeholder");
|
|
2128
|
+
return a ? a.trim() : "";
|
|
2059
2129
|
}
|
|
2060
|
-
function
|
|
2130
|
+
function re(e, t) {
|
|
2061
2131
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2062
2132
|
}
|
|
2063
|
-
function
|
|
2133
|
+
function Qr(e) {
|
|
2064
2134
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2065
2135
|
}
|
|
2066
|
-
function
|
|
2136
|
+
function ei(e) {
|
|
2067
2137
|
const t = e.getAttribute("aria-label");
|
|
2068
2138
|
if (t) return t.trim().slice(0, 80);
|
|
2069
2139
|
const r = e.getAttribute("aria-labelledby");
|
|
2070
2140
|
if (r) {
|
|
2071
|
-
const
|
|
2072
|
-
if (
|
|
2141
|
+
const o = document.getElementById(r);
|
|
2142
|
+
if (o != null && o.textContent) return o.textContent.trim().slice(0, 80);
|
|
2073
2143
|
}
|
|
2074
|
-
const
|
|
2144
|
+
const i = e.querySelector(
|
|
2075
2145
|
'button[type="submit"], input[type="submit"], button:not([type])'
|
|
2076
2146
|
);
|
|
2077
|
-
if (
|
|
2078
|
-
const
|
|
2079
|
-
if (
|
|
2080
|
-
return
|
|
2147
|
+
if (i) {
|
|
2148
|
+
const o = i instanceof HTMLInputElement ? i.value : (i.textContent ?? "").trim();
|
|
2149
|
+
if (o && o.length < 60 && !/^(submit|ok|continue)$/i.test(o))
|
|
2150
|
+
return o;
|
|
2081
2151
|
}
|
|
2082
|
-
let
|
|
2083
|
-
for (let
|
|
2084
|
-
const s =
|
|
2152
|
+
let a = e.parentElement;
|
|
2153
|
+
for (let o = 0; a && o < 4; o++, a = a.parentElement) {
|
|
2154
|
+
const s = a.querySelector("h1, h2, h3, h4");
|
|
2085
2155
|
if (s != null && s.textContent) {
|
|
2086
|
-
const
|
|
2087
|
-
if (
|
|
2156
|
+
const l = s.textContent.trim();
|
|
2157
|
+
if (l && l.length < 80) return l;
|
|
2088
2158
|
}
|
|
2089
2159
|
}
|
|
2090
2160
|
return null;
|
|
2091
2161
|
}
|
|
2092
|
-
function
|
|
2162
|
+
function Ke(e) {
|
|
2093
2163
|
return e.length;
|
|
2094
2164
|
}
|
|
2095
|
-
function
|
|
2165
|
+
function ti(e, t = {}) {
|
|
2096
2166
|
const r = t.doc ?? (typeof document < "u" ? document : null);
|
|
2097
2167
|
if (!r)
|
|
2098
2168
|
return {
|
|
@@ -2106,17 +2176,17 @@ function Zr(e, t = {}) {
|
|
|
2106
2176
|
forms: [],
|
|
2107
2177
|
extras: e
|
|
2108
2178
|
};
|
|
2109
|
-
const
|
|
2179
|
+
const i = typeof window < "u" && window.location.href || "", a = typeof window < "u" && window.location.pathname || "/", o = r.title || "", s = Array.from(
|
|
2110
2180
|
r.querySelectorAll("[data-ll-region]")
|
|
2111
|
-
),
|
|
2181
|
+
), l = [];
|
|
2112
2182
|
for (const g of s) {
|
|
2113
|
-
if (
|
|
2183
|
+
if (l.length >= Gr) break;
|
|
2114
2184
|
if (dt(g) || !ut(g)) continue;
|
|
2115
|
-
const P = g.getAttribute("data-ll-region") ?? "",
|
|
2185
|
+
const P = g.getAttribute("data-ll-region") ?? "", O = g.getAttribute("data-ll-intent") ?? void 0, q = re(
|
|
2116
2186
|
(g.innerText || g.textContent || "").trim(),
|
|
2117
|
-
|
|
2187
|
+
mn * 2
|
|
2118
2188
|
);
|
|
2119
|
-
!P || !
|
|
2189
|
+
!P || !q || l.push({ id: P, intent: O, text: q });
|
|
2120
2190
|
}
|
|
2121
2191
|
const c = [], p = ["H1", "H2", "H3", "H4", "H5", "H6"], v = Array.from(
|
|
2122
2192
|
r.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
@@ -2124,106 +2194,132 @@ function Zr(e, t = {}) {
|
|
|
2124
2194
|
for (const g of v) {
|
|
2125
2195
|
if (dt(g) || !ut(g)) continue;
|
|
2126
2196
|
const P = (g.textContent || "").trim();
|
|
2127
|
-
P && c.push(`${g.tagName}: ${
|
|
2197
|
+
P && c.push(`${g.tagName}: ${re(P, 200)}`);
|
|
2128
2198
|
}
|
|
2129
2199
|
const f = Array.from(r.querySelectorAll("p, li"));
|
|
2130
2200
|
for (const g of f) {
|
|
2131
2201
|
if (dt(g) || !ut(g) || p.includes(g.tagName)) continue;
|
|
2132
2202
|
const P = (g.textContent || "").trim();
|
|
2133
|
-
P.length > 10 && c.push(
|
|
2203
|
+
P.length > 10 && c.push(re(P, mn));
|
|
2134
2204
|
}
|
|
2135
2205
|
const u = c.join(`
|
|
2136
|
-
`),
|
|
2137
|
-
for (const g of
|
|
2138
|
-
if (
|
|
2206
|
+
`), R = [], k = Array.from(r.querySelectorAll("a[href]"));
|
|
2207
|
+
for (const g of k) {
|
|
2208
|
+
if (R.length >= Vr) break;
|
|
2139
2209
|
if (dt(g) || !ut(g)) continue;
|
|
2140
|
-
const P = g.getAttribute("href") || "",
|
|
2141
|
-
!P || !
|
|
2210
|
+
const P = g.getAttribute("href") || "", O = (g.textContent || "").trim();
|
|
2211
|
+
!P || !O || R.push({ href: P, text: re(O, 100) });
|
|
2142
2212
|
}
|
|
2143
|
-
const _ = [],
|
|
2213
|
+
const _ = [], m = Array.from(
|
|
2144
2214
|
r.querySelectorAll(
|
|
2145
2215
|
"input, textarea, select"
|
|
2146
2216
|
)
|
|
2147
2217
|
);
|
|
2148
|
-
for (const g of
|
|
2149
|
-
if (_.length >=
|
|
2150
|
-
if (dt(g) || !
|
|
2151
|
-
const P =
|
|
2152
|
-
P && _.push({ label:
|
|
2218
|
+
for (const g of m) {
|
|
2219
|
+
if (_.length >= Yr) break;
|
|
2220
|
+
if (dt(g) || !Dt(g) || !ut(g)) continue;
|
|
2221
|
+
const P = gn(g), O = g instanceof HTMLInputElement ? g.type : g.tagName.toLowerCase();
|
|
2222
|
+
P && _.push({ label: re(P, 100), type: O });
|
|
2153
2223
|
}
|
|
2154
|
-
const
|
|
2224
|
+
const w = Array.from(r.querySelectorAll("form")), N = [];
|
|
2155
2225
|
let T = 0;
|
|
2156
|
-
for (const g of
|
|
2157
|
-
if (
|
|
2158
|
-
if (
|
|
2159
|
-
const P = g.getAttribute("id") || g.getAttribute("name") ||
|
|
2226
|
+
for (const g of w) {
|
|
2227
|
+
if (N.length >= Kr) break;
|
|
2228
|
+
if (zt(g) || g.matches(".ll-widget *, .ll-widget")) continue;
|
|
2229
|
+
const P = g.getAttribute("id") || g.getAttribute("name") || Qr(g.getAttribute("data-ll-intent")) || `form_${T++}`, O = g.getAttribute("data-ll-intent") || ei(g) || void 0, q = Array.from(
|
|
2160
2230
|
g.querySelectorAll(
|
|
2161
2231
|
"input, textarea, select"
|
|
2162
2232
|
)
|
|
2163
|
-
),
|
|
2233
|
+
), ne = [];
|
|
2164
2234
|
let B = 0;
|
|
2165
|
-
const
|
|
2166
|
-
for (const
|
|
2167
|
-
if (
|
|
2168
|
-
if (!
|
|
2169
|
-
if (
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2235
|
+
const j = /* @__PURE__ */ new Set();
|
|
2236
|
+
for (const C of q) {
|
|
2237
|
+
if (ne.length >= Jr) break;
|
|
2238
|
+
if (!Dt(C)) continue;
|
|
2239
|
+
if (C instanceof HTMLInputElement) {
|
|
2240
|
+
const W = C.type;
|
|
2241
|
+
if (W === "submit" || W === "button" || W === "reset" || W === "hidden" || W === "image" || W === "file") continue;
|
|
2172
2242
|
}
|
|
2173
|
-
const
|
|
2174
|
-
let
|
|
2175
|
-
|
|
2176
|
-
const ze =
|
|
2177
|
-
name:
|
|
2178
|
-
label:
|
|
2179
|
-
type:
|
|
2243
|
+
const Z = C.getAttribute("name") || "", we = C.getAttribute("id") || "";
|
|
2244
|
+
let ce = Z || we || `field_${B}`;
|
|
2245
|
+
j.has(ce) && (ce = `${ce}__${B}`), j.add(ce), B++;
|
|
2246
|
+
const ze = gn(C) || ce, He = C instanceof HTMLInputElement ? C.type : C.tagName.toLowerCase(), X = {
|
|
2247
|
+
name: ce,
|
|
2248
|
+
label: re(ze, 100),
|
|
2249
|
+
type: He
|
|
2180
2250
|
};
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
const
|
|
2187
|
-
!
|
|
2251
|
+
C.required === !0 && (X.required = !0);
|
|
2252
|
+
const Se = C.getAttribute("placeholder");
|
|
2253
|
+
if (Se && (X.placeholder = re(Se.trim(), 100)), C instanceof HTMLInputElement || C instanceof HTMLTextAreaElement) {
|
|
2254
|
+
const W = C.getAttribute("minlength");
|
|
2255
|
+
if (W !== null) {
|
|
2256
|
+
const Y = parseInt(W, 10);
|
|
2257
|
+
!Number.isNaN(Y) && Y >= 0 && (X.minLength = Y);
|
|
2258
|
+
}
|
|
2259
|
+
const ie = C.getAttribute("maxlength");
|
|
2260
|
+
if (ie !== null) {
|
|
2261
|
+
const Y = parseInt(ie, 10);
|
|
2262
|
+
!Number.isNaN(Y) && Y >= 0 && (X.maxLength = Y);
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
if (C instanceof HTMLInputElement) {
|
|
2266
|
+
const W = C.getAttribute("min");
|
|
2267
|
+
W !== null && (X.min = re(W, 50));
|
|
2268
|
+
const ie = C.getAttribute("max");
|
|
2269
|
+
ie !== null && (X.max = re(ie, 50));
|
|
2270
|
+
const Y = C.getAttribute("step");
|
|
2271
|
+
Y !== null && (X.step = re(Y, 20));
|
|
2272
|
+
const fe = C.getAttribute("pattern");
|
|
2273
|
+
fe !== null && (X.pattern = re(fe, 200));
|
|
2274
|
+
const K = (C.getAttribute("autocomplete") || "").toLowerCase();
|
|
2275
|
+
K && K !== "off" && !K.startsWith("cc-") && (X.autocomplete = re(K, 50));
|
|
2276
|
+
}
|
|
2277
|
+
if (C instanceof HTMLSelectElement) {
|
|
2278
|
+
const W = [];
|
|
2279
|
+
for (let ie = 0; ie < C.options.length && !(W.length >= Xr); ie++) {
|
|
2280
|
+
const Y = C.options[ie];
|
|
2281
|
+
if (!Y || Y.disabled) continue;
|
|
2282
|
+
const fe = Y.value || "", K = (Y.textContent || "").trim() || fe;
|
|
2283
|
+
!fe && !K || W.push({ value: fe, label: re(K, 60) });
|
|
2188
2284
|
}
|
|
2189
|
-
|
|
2285
|
+
W.length > 0 && (X.options = W);
|
|
2190
2286
|
}
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2287
|
+
const _e = typeof C.validationMessage == "string" ? C.validationMessage : "";
|
|
2288
|
+
_e && (X.validationMessage = re(_e, 200)), ne.push(X);
|
|
2193
2289
|
}
|
|
2194
|
-
|
|
2290
|
+
N.push({ id: P, intent: O, fields: ne });
|
|
2195
2291
|
}
|
|
2196
|
-
const
|
|
2197
|
-
url:
|
|
2198
|
-
title:
|
|
2199
|
-
pathname:
|
|
2200
|
-
regions:
|
|
2292
|
+
const I = {
|
|
2293
|
+
url: i,
|
|
2294
|
+
title: o,
|
|
2295
|
+
pathname: a,
|
|
2296
|
+
regions: l,
|
|
2201
2297
|
visibleText: u,
|
|
2202
|
-
visibleLinks:
|
|
2298
|
+
visibleLinks: R,
|
|
2203
2299
|
visibleFields: _,
|
|
2204
|
-
forms:
|
|
2300
|
+
forms: N,
|
|
2205
2301
|
extras: e
|
|
2206
2302
|
};
|
|
2207
|
-
let
|
|
2208
|
-
for (;
|
|
2209
|
-
|
|
2210
|
-
for (;
|
|
2211
|
-
|
|
2212
|
-
return
|
|
2213
|
-
}
|
|
2214
|
-
let
|
|
2215
|
-
function
|
|
2216
|
-
const r = Date.now(),
|
|
2217
|
-
if (
|
|
2218
|
-
return
|
|
2219
|
-
const
|
|
2220
|
-
return
|
|
2221
|
-
}
|
|
2222
|
-
function
|
|
2223
|
-
|
|
2224
|
-
}
|
|
2225
|
-
const
|
|
2226
|
-
function
|
|
2303
|
+
let U = Ke(JSON.stringify(I.regions)) + Ke(I.visibleText) + Ke(JSON.stringify(I.visibleLinks)) + Ke(JSON.stringify(I.visibleFields));
|
|
2304
|
+
for (; U > _t && I.visibleFields.length > 0; )
|
|
2305
|
+
I.visibleFields.pop(), U = Ke(JSON.stringify(I.visibleFields));
|
|
2306
|
+
for (; U > _t && I.visibleLinks.length > 0; )
|
|
2307
|
+
I.visibleLinks.pop(), U -= 80;
|
|
2308
|
+
return Ke(I.visibleText) > _t && (I.visibleText = re(I.visibleText, _t - 100)), I;
|
|
2309
|
+
}
|
|
2310
|
+
let Je = null;
|
|
2311
|
+
function yn(e, t = {}) {
|
|
2312
|
+
const r = Date.now(), a = `${typeof window < "u" && window.location.pathname || "/"}::${typeof window < "u" ? window.scrollY : 0}`;
|
|
2313
|
+
if (Je && Je.key === a && r - Je.at < 1e3)
|
|
2314
|
+
return Je.ctx;
|
|
2315
|
+
const o = ti(e, t);
|
|
2316
|
+
return Je = { key: a, at: r, ctx: o }, o;
|
|
2317
|
+
}
|
|
2318
|
+
function ni() {
|
|
2319
|
+
Je = null;
|
|
2320
|
+
}
|
|
2321
|
+
const ri = 200;
|
|
2322
|
+
function ii(e) {
|
|
2227
2323
|
const t = String(e.href || "");
|
|
2228
2324
|
return {
|
|
2229
2325
|
href: t,
|
|
@@ -2233,47 +2329,47 @@ function no(e) {
|
|
|
2233
2329
|
description: e.description
|
|
2234
2330
|
};
|
|
2235
2331
|
}
|
|
2236
|
-
function
|
|
2332
|
+
function oi(e) {
|
|
2237
2333
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2238
2334
|
}
|
|
2239
|
-
function
|
|
2335
|
+
function li(e) {
|
|
2240
2336
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2241
2337
|
if (!t) return [];
|
|
2242
|
-
const r = typeof window < "u" && window.location.origin || "",
|
|
2243
|
-
for (const s of
|
|
2244
|
-
if (
|
|
2245
|
-
if (
|
|
2246
|
-
const
|
|
2247
|
-
if (!
|
|
2248
|
-
let c =
|
|
2338
|
+
const r = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), a = [], o = Array.from(t.querySelectorAll("a[href]"));
|
|
2339
|
+
for (const s of o) {
|
|
2340
|
+
if (a.length >= ri) break;
|
|
2341
|
+
if (zt(s)) continue;
|
|
2342
|
+
const l = s.getAttribute("href") || "";
|
|
2343
|
+
if (!oi(l)) continue;
|
|
2344
|
+
let c = l, p = !0;
|
|
2249
2345
|
try {
|
|
2250
2346
|
if (typeof window < "u") {
|
|
2251
|
-
const f = new URL(
|
|
2252
|
-
p = f.origin === r, p &&
|
|
2347
|
+
const f = new URL(l, r);
|
|
2348
|
+
p = f.origin === r, p && l.startsWith("http") && (c = f.pathname + f.search + f.hash);
|
|
2253
2349
|
}
|
|
2254
2350
|
} catch {
|
|
2255
2351
|
continue;
|
|
2256
2352
|
}
|
|
2257
|
-
if (
|
|
2258
|
-
|
|
2353
|
+
if (i.has(c)) continue;
|
|
2354
|
+
i.add(c);
|
|
2259
2355
|
const v = (s.textContent || "").trim().slice(0, 120);
|
|
2260
|
-
|
|
2356
|
+
a.push({ href: c, text: v, internal: p });
|
|
2261
2357
|
}
|
|
2262
|
-
return
|
|
2358
|
+
return a;
|
|
2263
2359
|
}
|
|
2264
|
-
let
|
|
2265
|
-
const
|
|
2266
|
-
function
|
|
2360
|
+
let Xe = null;
|
|
2361
|
+
const ai = 5e3;
|
|
2362
|
+
function Mt() {
|
|
2267
2363
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2268
|
-
if (
|
|
2269
|
-
return
|
|
2270
|
-
const r =
|
|
2271
|
-
return
|
|
2364
|
+
if (Xe && Xe.pathname === t && e - Xe.at < ai)
|
|
2365
|
+
return Xe.routes;
|
|
2366
|
+
const r = li();
|
|
2367
|
+
return Xe = { at: e, pathname: t, routes: r }, r;
|
|
2272
2368
|
}
|
|
2273
|
-
function
|
|
2274
|
-
|
|
2369
|
+
function si() {
|
|
2370
|
+
Xe = null;
|
|
2275
2371
|
}
|
|
2276
|
-
function
|
|
2372
|
+
function vn(e) {
|
|
2277
2373
|
if (e instanceof HTMLInputElement) {
|
|
2278
2374
|
const t = e.type;
|
|
2279
2375
|
if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
|
|
@@ -2281,53 +2377,53 @@ function yn(e) {
|
|
|
2281
2377
|
}
|
|
2282
2378
|
return !0;
|
|
2283
2379
|
}
|
|
2284
|
-
function
|
|
2380
|
+
function ci(e, t) {
|
|
2285
2381
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2286
2382
|
}
|
|
2287
|
-
function
|
|
2383
|
+
function di(e, t) {
|
|
2288
2384
|
if (!t) return null;
|
|
2289
2385
|
try {
|
|
2290
|
-
const
|
|
2386
|
+
const o = e.querySelector(
|
|
2291
2387
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2292
2388
|
);
|
|
2293
|
-
if (
|
|
2389
|
+
if (o && vn(o)) return o;
|
|
2294
2390
|
} catch {
|
|
2295
2391
|
}
|
|
2296
2392
|
const r = Array.from(
|
|
2297
2393
|
e.querySelectorAll("input, textarea, select")
|
|
2298
2394
|
);
|
|
2299
|
-
let
|
|
2300
|
-
const
|
|
2301
|
-
for (const
|
|
2302
|
-
if (!
|
|
2303
|
-
const s =
|
|
2304
|
-
let
|
|
2305
|
-
if (
|
|
2306
|
-
|
|
2395
|
+
let i = 0;
|
|
2396
|
+
const a = /* @__PURE__ */ new Map();
|
|
2397
|
+
for (const o of r) {
|
|
2398
|
+
if (!vn(o)) continue;
|
|
2399
|
+
const s = ci(o, i);
|
|
2400
|
+
let l = s;
|
|
2401
|
+
if (a.has(s) && (l = `${s}__${i}`), l === t) return o;
|
|
2402
|
+
a.set(s, o), i++;
|
|
2307
2403
|
}
|
|
2308
2404
|
return null;
|
|
2309
2405
|
}
|
|
2310
|
-
function
|
|
2311
|
-
const r =
|
|
2312
|
-
return r ?
|
|
2406
|
+
function bn(e, t) {
|
|
2407
|
+
const r = di(e, t);
|
|
2408
|
+
return r ? Dt(r) ? { el: r } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2313
2409
|
}
|
|
2314
|
-
function
|
|
2315
|
-
const r = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype,
|
|
2316
|
-
|
|
2410
|
+
function ui(e, t) {
|
|
2411
|
+
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;
|
|
2412
|
+
a ? a.call(e, t) : e.value = t;
|
|
2317
2413
|
}
|
|
2318
|
-
function
|
|
2319
|
-
const
|
|
2414
|
+
function fi(e, t, r = {}) {
|
|
2415
|
+
const i = r.triggerInput ?? !0, a = r.triggerChange ?? !0;
|
|
2320
2416
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2321
|
-
const
|
|
2417
|
+
const o = Object.getOwnPropertyDescriptor(
|
|
2322
2418
|
HTMLInputElement.prototype,
|
|
2323
2419
|
"checked"
|
|
2324
|
-
), s =
|
|
2325
|
-
s ? s.call(e,
|
|
2420
|
+
), s = o == null ? void 0 : o.set, l = t === "true" || t === "1" || t === "on";
|
|
2421
|
+
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
2422
|
return;
|
|
2327
2423
|
}
|
|
2328
|
-
|
|
2424
|
+
ui(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), a && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2329
2425
|
}
|
|
2330
|
-
function
|
|
2426
|
+
function wn(e, t) {
|
|
2331
2427
|
if (!t) return null;
|
|
2332
2428
|
const r = t.replace(/"/g, '\\"');
|
|
2333
2429
|
try {
|
|
@@ -2337,34 +2433,34 @@ function bn(e, t) {
|
|
|
2337
2433
|
if (s) return s;
|
|
2338
2434
|
} catch {
|
|
2339
2435
|
}
|
|
2340
|
-
const
|
|
2436
|
+
const i = e.querySelector(
|
|
2341
2437
|
`form[name="${r}"]`
|
|
2342
2438
|
);
|
|
2343
|
-
if (
|
|
2344
|
-
const
|
|
2439
|
+
if (i) return i;
|
|
2440
|
+
const a = e.querySelector(
|
|
2345
2441
|
`form[data-ll-intent="${r}"]`
|
|
2346
2442
|
);
|
|
2347
|
-
if (
|
|
2348
|
-
const
|
|
2349
|
-
for (const s of
|
|
2350
|
-
const
|
|
2351
|
-
if (
|
|
2443
|
+
if (a) return a;
|
|
2444
|
+
const o = Array.from(e.querySelectorAll("form"));
|
|
2445
|
+
for (const s of o) {
|
|
2446
|
+
const l = s.getAttribute("data-ll-intent");
|
|
2447
|
+
if (l && pi(l) === t) return s;
|
|
2352
2448
|
}
|
|
2353
2449
|
if (/^form_\d+$/.test(t)) {
|
|
2354
2450
|
const s = parseInt(t.slice(5), 10);
|
|
2355
|
-
let
|
|
2356
|
-
for (const c of
|
|
2451
|
+
let l = 0;
|
|
2452
|
+
for (const c of o)
|
|
2357
2453
|
if (!(c.id || c.getAttribute("name") || c.getAttribute("data-ll-intent"))) {
|
|
2358
|
-
if (
|
|
2359
|
-
|
|
2454
|
+
if (l === s) return c;
|
|
2455
|
+
l++;
|
|
2360
2456
|
}
|
|
2361
2457
|
}
|
|
2362
2458
|
return null;
|
|
2363
2459
|
}
|
|
2364
|
-
function
|
|
2460
|
+
function pi(e) {
|
|
2365
2461
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2366
2462
|
}
|
|
2367
|
-
function
|
|
2463
|
+
function hi() {
|
|
2368
2464
|
if (typeof window > "u" || typeof document > "u")
|
|
2369
2465
|
return !1;
|
|
2370
2466
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2372,44 +2468,44 @@ function po() {
|
|
|
2372
2468
|
const t = window.getComputedStyle(e);
|
|
2373
2469
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2374
2470
|
}
|
|
2375
|
-
function
|
|
2471
|
+
function mi(e) {
|
|
2376
2472
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2377
2473
|
const r = window.getComputedStyle(e).overflowY;
|
|
2378
2474
|
return !(r !== "auto" && r !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2379
2475
|
}
|
|
2380
|
-
function
|
|
2476
|
+
function gi() {
|
|
2381
2477
|
if (typeof document > "u") return null;
|
|
2382
2478
|
const e = Array.from(
|
|
2383
2479
|
document.querySelectorAll("body, body *")
|
|
2384
2480
|
);
|
|
2385
2481
|
let t = null, r = 0;
|
|
2386
|
-
for (const
|
|
2387
|
-
if (!
|
|
2388
|
-
const
|
|
2389
|
-
if (
|
|
2390
|
-
const
|
|
2391
|
-
|
|
2482
|
+
for (const i of e) {
|
|
2483
|
+
if (!mi(i)) continue;
|
|
2484
|
+
const a = i.getBoundingClientRect();
|
|
2485
|
+
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;
|
|
2486
|
+
const o = a.width * a.height;
|
|
2487
|
+
o > r && (r = o, t = i);
|
|
2392
2488
|
}
|
|
2393
2489
|
return t;
|
|
2394
2490
|
}
|
|
2395
|
-
function
|
|
2491
|
+
function yi() {
|
|
2396
2492
|
if (typeof window > "u")
|
|
2397
2493
|
return null;
|
|
2398
|
-
if (
|
|
2399
|
-
const e =
|
|
2494
|
+
if (hi()) return window;
|
|
2495
|
+
const e = gi();
|
|
2400
2496
|
return e || window;
|
|
2401
2497
|
}
|
|
2402
|
-
function
|
|
2498
|
+
function _n(e) {
|
|
2403
2499
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2404
2500
|
}
|
|
2405
|
-
function
|
|
2501
|
+
function vi(e) {
|
|
2406
2502
|
var t, r;
|
|
2407
2503
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2408
2504
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2409
2505
|
((r = document.documentElement) == null ? void 0 : r.scrollHeight) ?? 0
|
|
2410
2506
|
) : e.scrollHeight - e.clientHeight;
|
|
2411
2507
|
}
|
|
2412
|
-
const
|
|
2508
|
+
const bi = /* @__PURE__ */ new Set([
|
|
2413
2509
|
"agent_state",
|
|
2414
2510
|
"avatar_stream_ready",
|
|
2415
2511
|
"avatar_active",
|
|
@@ -2439,56 +2535,56 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2439
2535
|
// to onAgentCommand.
|
|
2440
2536
|
"task_field_updated",
|
|
2441
2537
|
"task_completed"
|
|
2442
|
-
]),
|
|
2538
|
+
]), Rn = Pt(
|
|
2443
2539
|
function(t, r) {
|
|
2444
|
-
var
|
|
2540
|
+
var Gt, Kt, Jt, Xt, Zt, Qt, en;
|
|
2445
2541
|
const {
|
|
2446
|
-
agentId:
|
|
2447
|
-
apiKey:
|
|
2448
|
-
baseUrl:
|
|
2542
|
+
agentId: i,
|
|
2543
|
+
apiKey: a,
|
|
2544
|
+
baseUrl: o = "https://app.livelayer.studio",
|
|
2449
2545
|
sessionEndpoint: s,
|
|
2450
|
-
sessionBody:
|
|
2546
|
+
sessionBody: l,
|
|
2451
2547
|
soundEffects: c,
|
|
2452
2548
|
experienceMode: p = "WIDGET",
|
|
2453
2549
|
autoConnect: v = !1,
|
|
2454
2550
|
displayMode: f,
|
|
2455
2551
|
defaultDisplayMode: u = "expanded",
|
|
2456
|
-
onDisplayModeChange:
|
|
2457
|
-
position:
|
|
2552
|
+
onDisplayModeChange: R,
|
|
2553
|
+
position: k = "bottom-right",
|
|
2458
2554
|
mobileBreakpoint: _ = 640,
|
|
2459
|
-
persistKey:
|
|
2460
|
-
disablePersistence:
|
|
2461
|
-
teamMembers:
|
|
2555
|
+
persistKey: m = "ll-widget",
|
|
2556
|
+
disablePersistence: w = !1,
|
|
2557
|
+
teamMembers: N,
|
|
2462
2558
|
currentTeamMemberId: T,
|
|
2463
|
-
onTeamMemberChange:
|
|
2464
|
-
idleLoopUrl:
|
|
2559
|
+
onTeamMemberChange: I,
|
|
2560
|
+
idleLoopUrl: U,
|
|
2465
2561
|
greeting: g,
|
|
2466
2562
|
avatarImageUrl: P,
|
|
2467
|
-
agentName:
|
|
2468
|
-
branding:
|
|
2469
|
-
allowCamera:
|
|
2563
|
+
agentName: O,
|
|
2564
|
+
branding: q = {},
|
|
2565
|
+
allowCamera: ne = !0,
|
|
2470
2566
|
allowScreenShare: B = !0,
|
|
2471
|
-
allowTyping:
|
|
2472
|
-
showMinimize:
|
|
2473
|
-
showClose:
|
|
2474
|
-
chromeless:
|
|
2475
|
-
floatingChromeContainer:
|
|
2567
|
+
allowTyping: j = !0,
|
|
2568
|
+
showMinimize: C,
|
|
2569
|
+
showClose: Z,
|
|
2570
|
+
chromeless: we = !1,
|
|
2571
|
+
floatingChromeContainer: ce = null,
|
|
2476
2572
|
compactControls: ze = !1,
|
|
2477
|
-
transforming:
|
|
2478
|
-
transformingLabel:
|
|
2479
|
-
showOn:
|
|
2480
|
-
hideOn:
|
|
2481
|
-
pathname:
|
|
2482
|
-
onNavigate:
|
|
2483
|
-
onScrollToSelector:
|
|
2484
|
-
getPageContext:
|
|
2485
|
-
pageContextExtras:
|
|
2573
|
+
transforming: He = !1,
|
|
2574
|
+
transformingLabel: X = "Transforming…",
|
|
2575
|
+
showOn: Se,
|
|
2576
|
+
hideOn: _e,
|
|
2577
|
+
pathname: W,
|
|
2578
|
+
onNavigate: ie,
|
|
2579
|
+
onScrollToSelector: Y,
|
|
2580
|
+
getPageContext: fe,
|
|
2581
|
+
pageContextExtras: K,
|
|
2486
2582
|
getRoutes: Qe,
|
|
2487
|
-
onScrollPage:
|
|
2583
|
+
onScrollPage: et,
|
|
2488
2584
|
onClick: ft,
|
|
2489
|
-
capabilities:
|
|
2585
|
+
capabilities: tt,
|
|
2490
2586
|
onConnect: Ne,
|
|
2491
|
-
onDisconnect:
|
|
2587
|
+
onDisconnect: Oe,
|
|
2492
2588
|
onTranscript: Ae,
|
|
2493
2589
|
onAgentState: Be,
|
|
2494
2590
|
onConnectionStateChange: Ie,
|
|
@@ -2496,47 +2592,47 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2496
2592
|
onAgentCommand: Me,
|
|
2497
2593
|
onCollect: Te,
|
|
2498
2594
|
controlledSession: $,
|
|
2499
|
-
className:
|
|
2595
|
+
className: Lt,
|
|
2500
2596
|
style: De,
|
|
2501
2597
|
zIndex: We = 2147483647
|
|
2502
|
-
} = t,
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
}, [
|
|
2506
|
-
const Pe = T !== void 0, [Fe, kt] =
|
|
2598
|
+
} = t, pe = yr(W), nt = kr(pe, Se, _e);
|
|
2599
|
+
M(() => {
|
|
2600
|
+
ni(), si();
|
|
2601
|
+
}, [pe]);
|
|
2602
|
+
const Pe = T !== void 0, [Fe, kt] = S(() => {
|
|
2507
2603
|
var y;
|
|
2508
|
-
return T ?? ((y =
|
|
2509
|
-
}), ke = Pe ? T : Fe,
|
|
2510
|
-
() => (
|
|
2511
|
-
[
|
|
2512
|
-
),
|
|
2604
|
+
return T ?? ((y = N == null ? void 0 : N[0]) == null ? void 0 : y.id);
|
|
2605
|
+
}), ke = Pe ? T : Fe, oe = Ze(
|
|
2606
|
+
() => (N == null ? void 0 : N.find((y) => y.id === ke)) ?? null,
|
|
2607
|
+
[N, ke]
|
|
2608
|
+
), rt = (oe == null ? void 0 : oe.agentId) ?? i, me = p === "EMBEDDED", [qe, Ue] = pr({
|
|
2513
2609
|
value: f,
|
|
2514
2610
|
defaultValue: u,
|
|
2515
|
-
onChange:
|
|
2516
|
-
persistKey:
|
|
2517
|
-
disablePersistence:
|
|
2518
|
-
}),
|
|
2519
|
-
} : Ue, pt =
|
|
2520
|
-
|
|
2521
|
-
const
|
|
2522
|
-
|
|
2523
|
-
function
|
|
2524
|
-
const d =
|
|
2611
|
+
onChange: R,
|
|
2612
|
+
persistKey: m,
|
|
2613
|
+
disablePersistence: me || w
|
|
2614
|
+
}), le = me ? "expanded" : qe, de = me ? () => {
|
|
2615
|
+
} : Ue, pt = C ?? !me, ht = Z ?? !me, Ce = mr(_), it = tr(), se = nr(), ue = ir(), Ee = or(), ot = lr(), [mt, lt] = S(!1), [ge, xe] = S(!1), [je, Ve] = S(!1), [Ct, gt] = S(!1), [h, Q] = S(!1), yt = Er({ baseUrl: o, config: c }), vt = A(yt);
|
|
2616
|
+
vt.current = yt;
|
|
2617
|
+
const Et = A(ie), St = A(Y), Nt = A(et), At = A(ft), Ht = A(fe), Ot = A(K), Bt = A(Qe), It = A(tt), ye = A(null);
|
|
2618
|
+
Et.current = ie, St.current = Y, Nt.current = et, At.current = ft, Ht.current = fe, Ot.current = K, Bt.current = Qe, It.current = tt;
|
|
2619
|
+
function ve(y) {
|
|
2620
|
+
const d = It.current;
|
|
2525
2621
|
return d ? d.includes(y) : !0;
|
|
2526
2622
|
}
|
|
2527
|
-
function
|
|
2623
|
+
function be(y, d) {
|
|
2528
2624
|
console.warn(
|
|
2529
2625
|
`[LiveLayer] Agent command "${y}" blocked — capability "${d}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
2530
2626
|
);
|
|
2531
2627
|
}
|
|
2532
|
-
const at =
|
|
2628
|
+
const at = E(
|
|
2533
2629
|
(y) => {
|
|
2534
|
-
var
|
|
2630
|
+
var J, he, Le, ct;
|
|
2535
2631
|
const d = y;
|
|
2536
2632
|
if (!(!d.type || typeof d.type != "string")) {
|
|
2537
2633
|
if (Re == null || Re({ eventName: d.type, data: y }), d.type === "navigate") {
|
|
2538
|
-
if (!
|
|
2539
|
-
|
|
2634
|
+
if (!ve("navigate")) {
|
|
2635
|
+
be("navigate", "navigate");
|
|
2540
2636
|
return;
|
|
2541
2637
|
}
|
|
2542
2638
|
const x = typeof d.href == "string" ? d.href : null;
|
|
@@ -2546,9 +2642,9 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2546
2642
|
);
|
|
2547
2643
|
return;
|
|
2548
2644
|
}
|
|
2549
|
-
if (
|
|
2645
|
+
if (vt.current.playPageChange(), Et.current) {
|
|
2550
2646
|
try {
|
|
2551
|
-
|
|
2647
|
+
Et.current(x);
|
|
2552
2648
|
} catch (D) {
|
|
2553
2649
|
console.warn(
|
|
2554
2650
|
`[LiveLayer] onNavigate threw for "${x}". Falling back. Error:`,
|
|
@@ -2578,41 +2674,41 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2578
2674
|
return;
|
|
2579
2675
|
}
|
|
2580
2676
|
if (d.type === "scroll_to") {
|
|
2581
|
-
if (!
|
|
2582
|
-
|
|
2677
|
+
if (!ve("scroll")) {
|
|
2678
|
+
be("scroll_to", "scroll");
|
|
2583
2679
|
return;
|
|
2584
2680
|
}
|
|
2585
2681
|
const x = typeof d.selector == "string" ? d.selector : null;
|
|
2586
2682
|
if (!x) return;
|
|
2587
2683
|
const D = d.behavior === "instant" ? "instant" : "smooth";
|
|
2588
|
-
if (
|
|
2684
|
+
if (St.current) {
|
|
2589
2685
|
try {
|
|
2590
|
-
|
|
2686
|
+
St.current(
|
|
2591
2687
|
x,
|
|
2592
2688
|
D
|
|
2593
2689
|
);
|
|
2594
|
-
} catch (
|
|
2595
|
-
console.warn("[LiveLayer] onScrollToSelector threw.",
|
|
2690
|
+
} catch (F) {
|
|
2691
|
+
console.warn("[LiveLayer] onScrollToSelector threw.", F);
|
|
2596
2692
|
}
|
|
2597
2693
|
return;
|
|
2598
2694
|
}
|
|
2599
2695
|
if (typeof document < "u") {
|
|
2600
|
-
let
|
|
2696
|
+
let F = null;
|
|
2601
2697
|
try {
|
|
2602
|
-
|
|
2698
|
+
F = document.querySelector(x);
|
|
2603
2699
|
} catch {
|
|
2604
2700
|
console.warn(
|
|
2605
2701
|
`[LiveLayer] scroll_to: invalid selector "${x}".`
|
|
2606
2702
|
);
|
|
2607
2703
|
return;
|
|
2608
2704
|
}
|
|
2609
|
-
if (!
|
|
2705
|
+
if (!F) {
|
|
2610
2706
|
console.warn(
|
|
2611
2707
|
`[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
2708
|
);
|
|
2613
2709
|
return;
|
|
2614
2710
|
}
|
|
2615
|
-
|
|
2711
|
+
F.scrollIntoView({
|
|
2616
2712
|
behavior: D,
|
|
2617
2713
|
block: "start"
|
|
2618
2714
|
});
|
|
@@ -2620,56 +2716,56 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2620
2716
|
return;
|
|
2621
2717
|
}
|
|
2622
2718
|
if (d.type === "request_page_context") {
|
|
2623
|
-
if (!
|
|
2624
|
-
|
|
2719
|
+
if (!ve("read_page")) {
|
|
2720
|
+
be("request_page_context", "read_page");
|
|
2625
2721
|
return;
|
|
2626
2722
|
}
|
|
2627
|
-
const x = typeof d.requestId == "string" ? d.requestId : void 0, D = (
|
|
2628
|
-
const z = D,
|
|
2629
|
-
if (
|
|
2723
|
+
const x = typeof d.requestId == "string" ? d.requestId : void 0, D = (J = ye.current) == null ? void 0 : J.call(ye), F = (G) => {
|
|
2724
|
+
const z = D, te = z == null ? void 0 : z.localParticipant;
|
|
2725
|
+
if (te != null && te.publishData)
|
|
2630
2726
|
try {
|
|
2631
|
-
const
|
|
2632
|
-
|
|
2633
|
-
} catch (
|
|
2634
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
2727
|
+
const ae = x ? { ...G, requestId: x } : G, Ge = new TextEncoder().encode(JSON.stringify(ae));
|
|
2728
|
+
te.publishData(Ge, { reliable: !0 });
|
|
2729
|
+
} catch (ae) {
|
|
2730
|
+
console.warn("[LiveLayer] publishData failed.", ae);
|
|
2635
2731
|
}
|
|
2636
|
-
},
|
|
2732
|
+
}, H = Ot.current, V = Ht.current;
|
|
2637
2733
|
try {
|
|
2638
|
-
if (
|
|
2639
|
-
const
|
|
2640
|
-
if (
|
|
2641
|
-
|
|
2734
|
+
if (V) {
|
|
2735
|
+
const G = V(H);
|
|
2736
|
+
if (G instanceof Promise) {
|
|
2737
|
+
F({ type: "page_context_pending" }), G.then((z) => F({ type: "page_context", context: z })).catch((z) => {
|
|
2642
2738
|
console.warn(
|
|
2643
2739
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
2644
2740
|
z
|
|
2645
|
-
),
|
|
2741
|
+
), F({
|
|
2646
2742
|
type: "page_context",
|
|
2647
|
-
context:
|
|
2743
|
+
context: yn(H)
|
|
2648
2744
|
});
|
|
2649
2745
|
});
|
|
2650
2746
|
return;
|
|
2651
2747
|
}
|
|
2652
|
-
|
|
2748
|
+
F({ type: "page_context", context: G });
|
|
2653
2749
|
return;
|
|
2654
2750
|
}
|
|
2655
|
-
|
|
2751
|
+
F({
|
|
2656
2752
|
type: "page_context",
|
|
2657
|
-
context:
|
|
2753
|
+
context: yn(H)
|
|
2658
2754
|
});
|
|
2659
|
-
} catch (
|
|
2755
|
+
} catch (G) {
|
|
2660
2756
|
console.warn(
|
|
2661
2757
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
2662
|
-
|
|
2663
|
-
),
|
|
2758
|
+
G
|
|
2759
|
+
), F({
|
|
2664
2760
|
type: "page_context",
|
|
2665
|
-
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras:
|
|
2761
|
+
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: H }
|
|
2666
2762
|
});
|
|
2667
2763
|
}
|
|
2668
2764
|
return;
|
|
2669
2765
|
}
|
|
2670
2766
|
if (d.type === "scroll_page") {
|
|
2671
|
-
if (!
|
|
2672
|
-
|
|
2767
|
+
if (!ve("scroll")) {
|
|
2768
|
+
be("scroll_page", "scroll");
|
|
2673
2769
|
return;
|
|
2674
2770
|
}
|
|
2675
2771
|
const x = d.direction;
|
|
@@ -2680,9 +2776,9 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2680
2776
|
return;
|
|
2681
2777
|
}
|
|
2682
2778
|
const D = d.behavior === "instant" ? "instant" : "smooth";
|
|
2683
|
-
if (
|
|
2779
|
+
if (Nt.current) {
|
|
2684
2780
|
try {
|
|
2685
|
-
|
|
2781
|
+
Nt.current(
|
|
2686
2782
|
x,
|
|
2687
2783
|
D
|
|
2688
2784
|
);
|
|
@@ -2692,17 +2788,17 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2692
2788
|
return;
|
|
2693
2789
|
}
|
|
2694
2790
|
if (typeof window > "u") return;
|
|
2695
|
-
const
|
|
2696
|
-
|
|
2697
|
-
},
|
|
2698
|
-
|
|
2791
|
+
const F = { behavior: D }, H = yi(), V = (z) => {
|
|
2792
|
+
H instanceof Window ? H.scrollBy({ top: z, ...F }) : H.scrollBy({ top: z, ...F });
|
|
2793
|
+
}, G = (z) => {
|
|
2794
|
+
H instanceof Window ? H.scrollTo({ top: z, ...F }) : H.scrollTo({ top: z, ...F });
|
|
2699
2795
|
};
|
|
2700
|
-
x === "up" ?
|
|
2796
|
+
x === "up" ? V(-_n(H)) : x === "down" ? V(_n(H)) : G(x === "top" ? 0 : vi(H));
|
|
2701
2797
|
return;
|
|
2702
2798
|
}
|
|
2703
2799
|
if (d.type === "click") {
|
|
2704
|
-
if (!
|
|
2705
|
-
|
|
2800
|
+
if (!ve("click")) {
|
|
2801
|
+
be("click", "click");
|
|
2706
2802
|
return;
|
|
2707
2803
|
}
|
|
2708
2804
|
const x = typeof d.selector == "string" ? d.selector : null;
|
|
@@ -2710,11 +2806,11 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2710
2806
|
console.warn("[LiveLayer] click: missing selector.");
|
|
2711
2807
|
return;
|
|
2712
2808
|
}
|
|
2713
|
-
if (
|
|
2809
|
+
if (At.current) {
|
|
2714
2810
|
try {
|
|
2715
|
-
|
|
2716
|
-
} catch (
|
|
2717
|
-
console.warn("[LiveLayer] onClick threw.",
|
|
2811
|
+
At.current(x);
|
|
2812
|
+
} catch (F) {
|
|
2813
|
+
console.warn("[LiveLayer] onClick threw.", F);
|
|
2718
2814
|
}
|
|
2719
2815
|
return;
|
|
2720
2816
|
}
|
|
@@ -2740,22 +2836,22 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2740
2836
|
);
|
|
2741
2837
|
return;
|
|
2742
2838
|
}
|
|
2743
|
-
(
|
|
2839
|
+
(he = D.click) == null || he.call(D);
|
|
2744
2840
|
return;
|
|
2745
2841
|
}
|
|
2746
2842
|
if (d.type === "fill_form" || d.type === "focus_field") {
|
|
2747
|
-
if (!
|
|
2748
|
-
|
|
2843
|
+
if (!ve("fill_forms")) {
|
|
2844
|
+
be(d.type, "fill_forms");
|
|
2749
2845
|
return;
|
|
2750
2846
|
}
|
|
2751
2847
|
if (typeof document > "u") return;
|
|
2752
|
-
d.type === "fill_form" &&
|
|
2848
|
+
d.type === "fill_form" && vt.current.playConfirmation();
|
|
2753
2849
|
const x = typeof d.formId == "string" ? d.formId : null;
|
|
2754
2850
|
if (!x) {
|
|
2755
2851
|
console.warn(`[LiveLayer] ${d.type}: missing formId.`);
|
|
2756
2852
|
return;
|
|
2757
2853
|
}
|
|
2758
|
-
const D =
|
|
2854
|
+
const D = wn(document, x);
|
|
2759
2855
|
if (!D) {
|
|
2760
2856
|
console.warn(
|
|
2761
2857
|
`[LiveLayer] ${d.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.`
|
|
@@ -2769,44 +2865,44 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2769
2865
|
return;
|
|
2770
2866
|
}
|
|
2771
2867
|
if (d.type === "focus_field") {
|
|
2772
|
-
const
|
|
2773
|
-
if (!
|
|
2868
|
+
const H = typeof d.fieldName == "string" ? d.fieldName : null;
|
|
2869
|
+
if (!H) {
|
|
2774
2870
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
2775
2871
|
return;
|
|
2776
2872
|
}
|
|
2777
|
-
const
|
|
2778
|
-
if (
|
|
2779
|
-
|
|
2780
|
-
`[LiveLayer] focus_field: field "${
|
|
2873
|
+
const V = bn(D, H);
|
|
2874
|
+
if (V.el === null) {
|
|
2875
|
+
V.reason === "private" ? console.warn(
|
|
2876
|
+
`[LiveLayer] focus_field: field "${H}" is privacy-protected and not focusable.`
|
|
2781
2877
|
) : console.warn(
|
|
2782
|
-
`[LiveLayer] focus_field: no input matching key="${
|
|
2878
|
+
`[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
2879
|
);
|
|
2784
2880
|
return;
|
|
2785
2881
|
}
|
|
2786
|
-
|
|
2882
|
+
V.el.focus();
|
|
2787
2883
|
return;
|
|
2788
2884
|
}
|
|
2789
|
-
const
|
|
2790
|
-
if (!
|
|
2885
|
+
const F = d.values && typeof d.values == "object" ? d.values : null;
|
|
2886
|
+
if (!F) {
|
|
2791
2887
|
console.warn("[LiveLayer] fill_form: missing or invalid values.");
|
|
2792
2888
|
return;
|
|
2793
2889
|
}
|
|
2794
|
-
for (const [
|
|
2795
|
-
if (typeof
|
|
2796
|
-
const
|
|
2797
|
-
if (
|
|
2798
|
-
|
|
2799
|
-
`[LiveLayer] fill_form: field "${
|
|
2890
|
+
for (const [H, V] of Object.entries(F)) {
|
|
2891
|
+
if (typeof V != "string") continue;
|
|
2892
|
+
const G = bn(D, H);
|
|
2893
|
+
if (G.el === null) {
|
|
2894
|
+
G.reason === "private" ? console.warn(
|
|
2895
|
+
`[LiveLayer] fill_form: field "${H}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
2800
2896
|
) : console.warn(
|
|
2801
|
-
`[LiveLayer] fill_form: no input matching key="${
|
|
2897
|
+
`[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
2898
|
);
|
|
2803
2899
|
continue;
|
|
2804
2900
|
}
|
|
2805
2901
|
try {
|
|
2806
|
-
|
|
2902
|
+
fi(G.el, V);
|
|
2807
2903
|
} catch (z) {
|
|
2808
2904
|
console.warn(
|
|
2809
|
-
`[LiveLayer] fill_form: failed to set "${
|
|
2905
|
+
`[LiveLayer] fill_form: failed to set "${H}".`,
|
|
2810
2906
|
z
|
|
2811
2907
|
);
|
|
2812
2908
|
}
|
|
@@ -2814,8 +2910,8 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2814
2910
|
return;
|
|
2815
2911
|
}
|
|
2816
2912
|
if (d.type === "submit_form") {
|
|
2817
|
-
if (!
|
|
2818
|
-
|
|
2913
|
+
if (!ve("submit_forms")) {
|
|
2914
|
+
be("submit_form", "submit_forms");
|
|
2819
2915
|
return;
|
|
2820
2916
|
}
|
|
2821
2917
|
if (typeof document > "u") return;
|
|
@@ -2824,8 +2920,8 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2824
2920
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
2825
2921
|
return;
|
|
2826
2922
|
}
|
|
2827
|
-
|
|
2828
|
-
const D =
|
|
2923
|
+
vt.current.playConfirmation();
|
|
2924
|
+
const D = wn(document, x);
|
|
2829
2925
|
if (!D) {
|
|
2830
2926
|
console.warn(
|
|
2831
2927
|
`[LiveLayer] submit_form: no <form> matched id="${x}" (or matching name / data-ll-intent slug).`
|
|
@@ -2838,24 +2934,24 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2838
2934
|
);
|
|
2839
2935
|
return;
|
|
2840
2936
|
}
|
|
2841
|
-
const
|
|
2842
|
-
const
|
|
2843
|
-
if (
|
|
2937
|
+
const F = typeof d.requestId == "string" ? d.requestId : void 0, H = (Le = ye.current) == null ? void 0 : Le.call(ye), V = (te) => {
|
|
2938
|
+
const ae = H, Ge = ae == null ? void 0 : ae.localParticipant;
|
|
2939
|
+
if (Ge != null && Ge.publishData)
|
|
2844
2940
|
try {
|
|
2845
|
-
const Un =
|
|
2846
|
-
|
|
2941
|
+
const Un = F ? { ...te, requestId: F } : te, jn = new TextEncoder().encode(JSON.stringify(Un));
|
|
2942
|
+
Ge.publishData(jn, { reliable: !0 });
|
|
2847
2943
|
} catch {
|
|
2848
2944
|
}
|
|
2849
2945
|
};
|
|
2850
|
-
let
|
|
2946
|
+
let G = !1;
|
|
2851
2947
|
const z = () => {
|
|
2852
|
-
|
|
2948
|
+
G = !0, V({ type: "form_submitted", formId: x });
|
|
2853
2949
|
};
|
|
2854
2950
|
D.addEventListener("submit", z, { once: !0 });
|
|
2855
2951
|
try {
|
|
2856
2952
|
typeof D.requestSubmit == "function" ? D.requestSubmit() : D.submit();
|
|
2857
|
-
} catch (
|
|
2858
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.",
|
|
2953
|
+
} catch (te) {
|
|
2954
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", te), D.removeEventListener("submit", z), V({
|
|
2859
2955
|
type: "form_submit_blocked",
|
|
2860
2956
|
formId: x,
|
|
2861
2957
|
reason: "exception"
|
|
@@ -2863,7 +2959,7 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2863
2959
|
return;
|
|
2864
2960
|
}
|
|
2865
2961
|
setTimeout(() => {
|
|
2866
|
-
|
|
2962
|
+
G || (D.removeEventListener("submit", z), V({
|
|
2867
2963
|
type: "form_submit_blocked",
|
|
2868
2964
|
formId: x,
|
|
2869
2965
|
reason: "validation"
|
|
@@ -2872,53 +2968,53 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2872
2968
|
return;
|
|
2873
2969
|
}
|
|
2874
2970
|
if (d.type === "request_routes") {
|
|
2875
|
-
if (!
|
|
2876
|
-
|
|
2971
|
+
if (!ve("read_page")) {
|
|
2972
|
+
be("request_routes", "read_page");
|
|
2877
2973
|
return;
|
|
2878
2974
|
}
|
|
2879
|
-
const x = typeof d.requestId == "string" ? d.requestId : void 0,
|
|
2880
|
-
if (!(
|
|
2881
|
-
const
|
|
2975
|
+
const x = typeof d.requestId == "string" ? d.requestId : void 0, F = (ct = ye.current) == null ? void 0 : ct.call(ye), H = F == null ? void 0 : F.localParticipant;
|
|
2976
|
+
if (!(H != null && H.publishData)) return;
|
|
2977
|
+
const V = (z) => {
|
|
2882
2978
|
try {
|
|
2883
|
-
const
|
|
2884
|
-
|
|
2885
|
-
} catch (
|
|
2886
|
-
console.warn("[LiveLayer] request_routes: publishData failed.",
|
|
2979
|
+
const te = x ? { type: "routes", routes: z, requestId: x } : { type: "routes", routes: z }, ae = new TextEncoder().encode(JSON.stringify(te));
|
|
2980
|
+
H.publishData(ae, { reliable: !0 });
|
|
2981
|
+
} catch (te) {
|
|
2982
|
+
console.warn("[LiveLayer] request_routes: publishData failed.", te);
|
|
2887
2983
|
}
|
|
2888
|
-
},
|
|
2889
|
-
if (
|
|
2984
|
+
}, G = Bt.current;
|
|
2985
|
+
if (G) {
|
|
2890
2986
|
try {
|
|
2891
|
-
const z =
|
|
2892
|
-
if (!Array.isArray(
|
|
2893
|
-
|
|
2987
|
+
const z = G(), te = (ae) => {
|
|
2988
|
+
if (!Array.isArray(ae)) {
|
|
2989
|
+
V([]);
|
|
2894
2990
|
return;
|
|
2895
2991
|
}
|
|
2896
|
-
|
|
2992
|
+
V(ae.map(ii).slice(0, 200));
|
|
2897
2993
|
};
|
|
2898
|
-
z instanceof Promise ? z.then(
|
|
2994
|
+
z instanceof Promise ? z.then(te).catch((ae) => {
|
|
2899
2995
|
console.warn(
|
|
2900
2996
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
2901
|
-
|
|
2902
|
-
),
|
|
2903
|
-
}) :
|
|
2997
|
+
ae
|
|
2998
|
+
), V(Mt());
|
|
2999
|
+
}) : te(z);
|
|
2904
3000
|
} catch (z) {
|
|
2905
3001
|
console.warn(
|
|
2906
3002
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
2907
3003
|
z
|
|
2908
|
-
),
|
|
3004
|
+
), V(Mt());
|
|
2909
3005
|
}
|
|
2910
3006
|
return;
|
|
2911
3007
|
}
|
|
2912
3008
|
try {
|
|
2913
|
-
|
|
3009
|
+
V(Mt());
|
|
2914
3010
|
} catch (z) {
|
|
2915
3011
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", z);
|
|
2916
3012
|
}
|
|
2917
3013
|
return;
|
|
2918
3014
|
}
|
|
2919
3015
|
if (d.type === "task_field_updated") {
|
|
2920
|
-
if (!
|
|
2921
|
-
|
|
3016
|
+
if (!ve("collect_data")) {
|
|
3017
|
+
be("task_field_updated", "collect_data");
|
|
2922
3018
|
return;
|
|
2923
3019
|
}
|
|
2924
3020
|
const x = {
|
|
@@ -2941,8 +3037,8 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2941
3037
|
return;
|
|
2942
3038
|
}
|
|
2943
3039
|
if (d.type === "task_completed") {
|
|
2944
|
-
if (!
|
|
2945
|
-
|
|
3040
|
+
if (!ve("collect_data")) {
|
|
3041
|
+
be("task_completed", "collect_data");
|
|
2946
3042
|
return;
|
|
2947
3043
|
}
|
|
2948
3044
|
const x = d.result;
|
|
@@ -2970,40 +3066,40 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
2970
3066
|
}
|
|
2971
3067
|
return;
|
|
2972
3068
|
}
|
|
2973
|
-
|
|
3069
|
+
bi.has(d.type) || Me == null || Me(d);
|
|
2974
3070
|
}
|
|
2975
3071
|
},
|
|
2976
3072
|
[Me, Re, Te]
|
|
2977
|
-
),
|
|
2978
|
-
agentId: $ ? "__controlled__" :
|
|
2979
|
-
baseUrl:
|
|
2980
|
-
apiKey:
|
|
3073
|
+
), ee = er({
|
|
3074
|
+
agentId: $ ? "__controlled__" : rt,
|
|
3075
|
+
baseUrl: o,
|
|
3076
|
+
apiKey: a,
|
|
2981
3077
|
sessionEndpoint: s,
|
|
2982
|
-
sessionBody:
|
|
3078
|
+
sessionBody: l,
|
|
2983
3079
|
onDataMessage: $ ? void 0 : at
|
|
2984
3080
|
});
|
|
2985
|
-
|
|
3081
|
+
M(() => {
|
|
2986
3082
|
if ($ != null && $.subscribeToDataMessages)
|
|
2987
3083
|
return $.subscribeToDataMessages(at);
|
|
2988
|
-
}, [$, at]),
|
|
3084
|
+
}, [$, at]), ye.current = () => {
|
|
2989
3085
|
var y;
|
|
2990
|
-
return (y =
|
|
2991
|
-
},
|
|
2992
|
-
var
|
|
3086
|
+
return (y = ee.getRoom) == null ? void 0 : y.call(ee);
|
|
3087
|
+
}, M(() => {
|
|
3088
|
+
var J;
|
|
2993
3089
|
if (typeof window > "u") return;
|
|
2994
|
-
const y = ((
|
|
3090
|
+
const y = ((J = window.location) == null ? void 0 : J.hostname) || "";
|
|
2995
3091
|
if (y === "localhost" || y === "127.0.0.1" || y === "0.0.0.0" || y.endsWith(".local") || y.endsWith(".test"))
|
|
2996
|
-
return window.__livelayerSimulateCommand = (
|
|
3092
|
+
return window.__livelayerSimulateCommand = (he) => {
|
|
2997
3093
|
try {
|
|
2998
|
-
at(
|
|
2999
|
-
} catch (
|
|
3000
|
-
console.warn("[LiveLayer] simulate-command threw:",
|
|
3094
|
+
at(he);
|
|
3095
|
+
} catch (Le) {
|
|
3096
|
+
console.warn("[LiveLayer] simulate-command threw:", Le);
|
|
3001
3097
|
}
|
|
3002
3098
|
}, () => {
|
|
3003
3099
|
delete window.__livelayerSimulateCommand;
|
|
3004
3100
|
};
|
|
3005
3101
|
}, [at]);
|
|
3006
|
-
const
|
|
3102
|
+
const L = Ze(() => $ ? {
|
|
3007
3103
|
connectionState: $.connectionState,
|
|
3008
3104
|
agentState: $.agentState,
|
|
3009
3105
|
transcript: $.transcript,
|
|
@@ -3019,30 +3115,30 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3019
3115
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
3020
3116
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
3021
3117
|
// so we reuse its reference for type consistency.
|
|
3022
|
-
getRoom:
|
|
3118
|
+
getRoom: ee.getRoom,
|
|
3023
3119
|
isControlled: !0
|
|
3024
3120
|
} : {
|
|
3025
|
-
connectionState:
|
|
3026
|
-
agentState:
|
|
3027
|
-
transcript:
|
|
3028
|
-
videoElement:
|
|
3029
|
-
audioElement:
|
|
3030
|
-
canResume:
|
|
3031
|
-
error:
|
|
3032
|
-
agentConfig:
|
|
3033
|
-
connect:
|
|
3034
|
-
disconnect:
|
|
3035
|
-
getRoom:
|
|
3121
|
+
connectionState: ee.connectionState,
|
|
3122
|
+
agentState: ee.agentState,
|
|
3123
|
+
transcript: ee.transcript,
|
|
3124
|
+
videoElement: ee.videoElement,
|
|
3125
|
+
audioElement: ee.audioElement,
|
|
3126
|
+
canResume: ee.canResume,
|
|
3127
|
+
error: ee.error,
|
|
3128
|
+
agentConfig: ee.agentConfig,
|
|
3129
|
+
connect: ee.connect,
|
|
3130
|
+
disconnect: ee.disconnect,
|
|
3131
|
+
getRoom: ee.getRoom,
|
|
3036
3132
|
isControlled: !1
|
|
3037
|
-
}, [$,
|
|
3038
|
-
|
|
3039
|
-
const
|
|
3040
|
-
|
|
3133
|
+
}, [$, ee]), Wt = A(L);
|
|
3134
|
+
Wt.current = L;
|
|
3135
|
+
const Ft = A($);
|
|
3136
|
+
Ft.current = $, Yn(
|
|
3041
3137
|
r,
|
|
3042
3138
|
() => ({
|
|
3043
3139
|
sendData: async (y) => {
|
|
3044
|
-
var
|
|
3045
|
-
const d =
|
|
3140
|
+
var Le, ct;
|
|
3141
|
+
const d = Ft.current;
|
|
3046
3142
|
if (d != null && d.publishData) {
|
|
3047
3143
|
try {
|
|
3048
3144
|
await d.publishData(y);
|
|
@@ -3051,11 +3147,11 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3051
3147
|
}
|
|
3052
3148
|
return;
|
|
3053
3149
|
}
|
|
3054
|
-
const
|
|
3055
|
-
if (
|
|
3150
|
+
const J = (ct = (Le = Wt.current) == null ? void 0 : Le.getRoom) == null ? void 0 : ct.call(Le), he = J == null ? void 0 : J.localParticipant;
|
|
3151
|
+
if (he != null && he.publishData)
|
|
3056
3152
|
try {
|
|
3057
3153
|
const x = new TextEncoder().encode(JSON.stringify(y));
|
|
3058
|
-
await
|
|
3154
|
+
await he.publishData(x, { reliable: !0 });
|
|
3059
3155
|
} catch (x) {
|
|
3060
3156
|
console.warn("[AvatarWidget] sendData failed:", x);
|
|
3061
3157
|
}
|
|
@@ -3063,44 +3159,44 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3063
3159
|
}),
|
|
3064
3160
|
[]
|
|
3065
3161
|
);
|
|
3066
|
-
const
|
|
3067
|
-
|
|
3068
|
-
const y =
|
|
3162
|
+
const qt = A(null);
|
|
3163
|
+
M(() => {
|
|
3164
|
+
const y = L.videoElement, d = qt.current;
|
|
3069
3165
|
if (!(!y || !d))
|
|
3070
3166
|
return d.appendChild(y), () => {
|
|
3071
3167
|
y.parentNode === d && d.removeChild(y);
|
|
3072
3168
|
};
|
|
3073
|
-
}, [
|
|
3074
|
-
const y =
|
|
3169
|
+
}, [L.videoElement]), M(() => {
|
|
3170
|
+
const y = L.audioElement;
|
|
3075
3171
|
if (!y) return;
|
|
3076
|
-
|
|
3172
|
+
it.attach(y);
|
|
3077
3173
|
const d = y.play();
|
|
3078
|
-
return d && typeof d.catch == "function" && d.catch((
|
|
3079
|
-
(
|
|
3174
|
+
return d && typeof d.catch == "function" && d.catch((J) => {
|
|
3175
|
+
(J == null ? void 0 : J.name) === "NotAllowedError" && lt(!0);
|
|
3080
3176
|
}), () => {
|
|
3081
|
-
|
|
3177
|
+
it.detach();
|
|
3082
3178
|
};
|
|
3083
|
-
}, [
|
|
3084
|
-
if (
|
|
3085
|
-
const y =
|
|
3179
|
+
}, [L.audioElement]), M(() => {
|
|
3180
|
+
if (L.isControlled || L.connectionState !== "connected") return;
|
|
3181
|
+
const y = L.getRoom();
|
|
3086
3182
|
if (y)
|
|
3087
|
-
return
|
|
3183
|
+
return se.setupMic(y).catch(() => {
|
|
3088
3184
|
}), () => {
|
|
3089
|
-
|
|
3185
|
+
se.teardownMic();
|
|
3090
3186
|
};
|
|
3091
|
-
}, [
|
|
3187
|
+
}, [L.isControlled, L.connectionState]), M(() => {
|
|
3092
3188
|
var d;
|
|
3093
|
-
if (
|
|
3094
|
-
const y =
|
|
3189
|
+
if (L.connectionState !== "connected") return;
|
|
3190
|
+
const y = L.isControlled ? (d = $ == null ? void 0 : $.getRoom) == null ? void 0 : d.call($) : L.getRoom();
|
|
3095
3191
|
if (y)
|
|
3096
|
-
return
|
|
3097
|
-
|
|
3192
|
+
return ue.attachRoom(y), Ee.attachRoom(y), L.isControlled && se.attachRoom(y), ot.refresh(), () => {
|
|
3193
|
+
ue.teardown(), Ee.teardown();
|
|
3098
3194
|
};
|
|
3099
|
-
}, [
|
|
3100
|
-
const y =
|
|
3101
|
-
y && (y.muted =
|
|
3102
|
-
}, [
|
|
3103
|
-
const Mn =
|
|
3195
|
+
}, [L.isControlled, L.connectionState, $]), M(() => {
|
|
3196
|
+
const y = L.audioElement;
|
|
3197
|
+
y && (y.muted = h);
|
|
3198
|
+
}, [L.audioElement, h]);
|
|
3199
|
+
const Mn = E((y) => {
|
|
3104
3200
|
const d = { type: "user_message", text: y };
|
|
3105
3201
|
if ($ != null && $.publishData) {
|
|
3106
3202
|
try {
|
|
@@ -3109,356 +3205,356 @@ const vo = /* @__PURE__ */ new Set([
|
|
|
3109
3205
|
}
|
|
3110
3206
|
return;
|
|
3111
3207
|
}
|
|
3112
|
-
const
|
|
3113
|
-
if (
|
|
3208
|
+
const J = L.getRoom();
|
|
3209
|
+
if (J)
|
|
3114
3210
|
try {
|
|
3115
|
-
const
|
|
3116
|
-
|
|
3211
|
+
const he = new TextEncoder().encode(JSON.stringify(d));
|
|
3212
|
+
J.localParticipant.publishData(he, { reliable: !0 });
|
|
3117
3213
|
} catch {
|
|
3118
3214
|
}
|
|
3119
|
-
}, [
|
|
3120
|
-
|
|
3215
|
+
}, [L, $]), Tn = E(() => {
|
|
3216
|
+
Q((y) => !y);
|
|
3121
3217
|
}, []);
|
|
3122
|
-
|
|
3123
|
-
Ie == null || Ie(
|
|
3124
|
-
}, [
|
|
3125
|
-
Ae == null || Ae(
|
|
3126
|
-
}, [
|
|
3127
|
-
Be == null || Be(
|
|
3128
|
-
}, [
|
|
3129
|
-
|
|
3130
|
-
}, [
|
|
3131
|
-
const
|
|
3132
|
-
|
|
3133
|
-
!v ||
|
|
3134
|
-
}, [v,
|
|
3135
|
-
const Dn =
|
|
3218
|
+
M(() => {
|
|
3219
|
+
Ie == null || Ie(L.connectionState), L.connectionState === "connected" ? Ne == null || Ne() : L.connectionState === "disconnected" && (Oe == null || Oe());
|
|
3220
|
+
}, [L.connectionState, Ne, Oe, Ie]), M(() => {
|
|
3221
|
+
Ae == null || Ae(L.transcript);
|
|
3222
|
+
}, [L.transcript, Ae]), M(() => {
|
|
3223
|
+
Be == null || Be(L.agentState);
|
|
3224
|
+
}, [L.agentState, Be]), M(() => {
|
|
3225
|
+
yt.setThinking(L.agentState === "thinking");
|
|
3226
|
+
}, [L.agentState, yt]);
|
|
3227
|
+
const Ut = A(!1);
|
|
3228
|
+
M(() => {
|
|
3229
|
+
!v || Ut.current || nt && L.connectionState === "idle" && (Ut.current = !0, L.connect());
|
|
3230
|
+
}, [v, L.connectionState, L, nt]);
|
|
3231
|
+
const Dn = E(
|
|
3136
3232
|
(y) => {
|
|
3137
|
-
const d =
|
|
3138
|
-
d && (
|
|
3233
|
+
const d = N == null ? void 0 : N.find((J) => J.id === y);
|
|
3234
|
+
d && (Ve(!1), y !== ke && (xe(!0), L.disconnect(), Pe || kt(y), I == null || I(d)));
|
|
3139
3235
|
},
|
|
3140
3236
|
[
|
|
3141
|
-
|
|
3237
|
+
N,
|
|
3142
3238
|
ke,
|
|
3143
|
-
|
|
3239
|
+
L,
|
|
3144
3240
|
Pe,
|
|
3145
|
-
|
|
3241
|
+
I
|
|
3146
3242
|
]
|
|
3147
3243
|
);
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
}, [
|
|
3244
|
+
M(() => {
|
|
3245
|
+
ge && L.connectionState === "connected" && xe(!1);
|
|
3246
|
+
}, [L.connectionState, ge]), M(() => {
|
|
3151
3247
|
if (!je) return;
|
|
3152
3248
|
const y = (d) => {
|
|
3153
|
-
d.key === "Escape" &&
|
|
3249
|
+
d.key === "Escape" && Ve(!1);
|
|
3154
3250
|
};
|
|
3155
3251
|
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
3156
3252
|
}, [je]);
|
|
3157
|
-
const Pn = !!P || !!(
|
|
3158
|
-
|
|
3159
|
-
const
|
|
3160
|
-
() =>
|
|
3161
|
-
[
|
|
3162
|
-
),
|
|
3163
|
-
|
|
3164
|
-
}, [
|
|
3165
|
-
const y =
|
|
3166
|
-
y && y.play().then(() =>
|
|
3253
|
+
const Pn = !!P || !!(oe != null && oe.avatarImageUrl) || L.isControlled, st = ar(rt, o, Pn);
|
|
3254
|
+
tt === void 0 && ((Gt = st.info) != null && Gt.capabilities) && (It.current = st.info.capabilities);
|
|
3255
|
+
const bt = (oe == null ? void 0 : oe.name) ?? O ?? ((Kt = L.agentConfig) == null ? void 0 : Kt.name) ?? ((Jt = st.info) == null ? void 0 : Jt.name) ?? "Live Layer", Rt = (oe == null ? void 0 : oe.avatarImageUrl) ?? P ?? ((Xt = L.agentConfig) == null ? void 0 : Xt.avatarImageUrl) ?? ((Zt = st.info) == null ? void 0 : Zt.avatarImageUrl) ?? null, $n = U ?? ((Qt = L.agentConfig) == null ? void 0 : Qt.idleLoopUrl) ?? ((en = st.info) == null ? void 0 : en.idleLoopUrl) ?? null, zn = g ?? null, Hn = E(() => de("expanded"), [de]), On = E(
|
|
3256
|
+
() => de("minimized"),
|
|
3257
|
+
[de]
|
|
3258
|
+
), jt = E(() => {
|
|
3259
|
+
L.disconnect(), de("hidden");
|
|
3260
|
+
}, [L, de]), Bn = E(() => {
|
|
3261
|
+
const y = L.audioElement;
|
|
3262
|
+
y && y.play().then(() => lt(!1)).catch(() => {
|
|
3167
3263
|
});
|
|
3168
|
-
}, [
|
|
3169
|
-
|
|
3170
|
-
}, [
|
|
3264
|
+
}, [L.audioElement]), Wn = E(() => {
|
|
3265
|
+
lt(!1), L.connect();
|
|
3266
|
+
}, [L]), Ye = {
|
|
3171
3267
|
...De,
|
|
3172
|
-
...
|
|
3268
|
+
...me ? {} : { zIndex: We }
|
|
3173
3269
|
};
|
|
3174
|
-
|
|
3270
|
+
q.primaryColor && (Ye["--ll-color-primary"] = q.primaryColor), q.accentColor && (Ye["--ll-color-accent"] = q.accentColor), q.backgroundColor && (Ye["--ll-color-bg"] = q.backgroundColor), q.textColor && (Ye["--ll-color-fg"] = q.textColor);
|
|
3175
3271
|
const Fn = [
|
|
3176
3272
|
"ll-widget",
|
|
3177
|
-
`ll-widget--${
|
|
3178
|
-
`ll-widget--${
|
|
3179
|
-
|
|
3273
|
+
`ll-widget--${le}`,
|
|
3274
|
+
`ll-widget--${Ce ? "mobile" : "desktop"}`,
|
|
3275
|
+
Lt
|
|
3180
3276
|
].filter(Boolean).join(" ");
|
|
3181
|
-
if (!
|
|
3277
|
+
if (!nt) return null;
|
|
3182
3278
|
const qn = /* @__PURE__ */ n(
|
|
3183
3279
|
"div",
|
|
3184
3280
|
{
|
|
3185
3281
|
className: Fn,
|
|
3186
|
-
style:
|
|
3187
|
-
"data-display-mode":
|
|
3188
|
-
"data-position":
|
|
3282
|
+
style: Ye,
|
|
3283
|
+
"data-display-mode": le,
|
|
3284
|
+
"data-position": k,
|
|
3189
3285
|
"data-experience-mode": p === "EMBEDDED" ? "embedded" : "widget",
|
|
3190
|
-
children:
|
|
3191
|
-
|
|
3286
|
+
children: le === "expanded" && /* @__PURE__ */ n(
|
|
3287
|
+
qr,
|
|
3192
3288
|
{
|
|
3193
|
-
position:
|
|
3194
|
-
isMobile:
|
|
3195
|
-
agentName:
|
|
3196
|
-
avatarImageUrl:
|
|
3289
|
+
position: k,
|
|
3290
|
+
isMobile: Ce,
|
|
3291
|
+
agentName: bt,
|
|
3292
|
+
avatarImageUrl: Rt,
|
|
3197
3293
|
idleLoopUrl: $n,
|
|
3198
3294
|
greeting: zn,
|
|
3199
|
-
branding:
|
|
3200
|
-
teamMembers:
|
|
3295
|
+
branding: q,
|
|
3296
|
+
teamMembers: N,
|
|
3201
3297
|
currentTeamMemberId: ke,
|
|
3202
|
-
isSwitchingTeamMember:
|
|
3298
|
+
isSwitchingTeamMember: ge,
|
|
3203
3299
|
teamSwitcherOpen: je,
|
|
3204
|
-
onToggleTeamSwitcher: () =>
|
|
3300
|
+
onToggleTeamSwitcher: () => Ve((y) => !y),
|
|
3205
3301
|
onSelectTeamMember: Dn,
|
|
3206
|
-
connectionState:
|
|
3207
|
-
agentState:
|
|
3208
|
-
transcript:
|
|
3209
|
-
isMuted:
|
|
3302
|
+
connectionState: L.connectionState,
|
|
3303
|
+
agentState: L.agentState,
|
|
3304
|
+
transcript: L.transcript,
|
|
3305
|
+
isMuted: se.isMuted,
|
|
3210
3306
|
micDevices: ot.mics,
|
|
3211
|
-
activeMicId:
|
|
3212
|
-
isCameraEnabled:
|
|
3213
|
-
cameraPreviewEl:
|
|
3307
|
+
activeMicId: se.activeDeviceId,
|
|
3308
|
+
isCameraEnabled: ue.isEnabled,
|
|
3309
|
+
cameraPreviewEl: ue.previewEl,
|
|
3214
3310
|
cameraDevices: ot.cameras,
|
|
3215
|
-
activeCameraId:
|
|
3216
|
-
isScreenShareEnabled:
|
|
3217
|
-
screenPreviewEl:
|
|
3218
|
-
isSpeakerMuted:
|
|
3219
|
-
allowCamera:
|
|
3311
|
+
activeCameraId: ue.activeDeviceId,
|
|
3312
|
+
isScreenShareEnabled: Ee.isEnabled,
|
|
3313
|
+
screenPreviewEl: Ee.previewEl,
|
|
3314
|
+
isSpeakerMuted: h,
|
|
3315
|
+
allowCamera: ne,
|
|
3220
3316
|
allowScreenShare: B,
|
|
3221
|
-
allowTyping:
|
|
3317
|
+
allowTyping: j,
|
|
3222
3318
|
showMinimize: pt,
|
|
3223
3319
|
showClose: ht,
|
|
3224
|
-
chromeless:
|
|
3320
|
+
chromeless: we,
|
|
3225
3321
|
compactControls: ze,
|
|
3226
|
-
transforming:
|
|
3227
|
-
transformingLabel:
|
|
3228
|
-
languageMenuOpen:
|
|
3229
|
-
onToggleLanguageMenu: () =>
|
|
3230
|
-
needsUserGesture:
|
|
3231
|
-
canResume:
|
|
3232
|
-
micError:
|
|
3233
|
-
error:
|
|
3234
|
-
avatarVideoContainerRef:
|
|
3235
|
-
agentVideoEl:
|
|
3236
|
-
onConnect: () => void
|
|
3237
|
-
onDisconnect: () =>
|
|
3322
|
+
transforming: He,
|
|
3323
|
+
transformingLabel: X,
|
|
3324
|
+
languageMenuOpen: Ct,
|
|
3325
|
+
onToggleLanguageMenu: () => gt((y) => !y),
|
|
3326
|
+
needsUserGesture: mt,
|
|
3327
|
+
canResume: L.canResume,
|
|
3328
|
+
micError: se.micError,
|
|
3329
|
+
error: L.error,
|
|
3330
|
+
avatarVideoContainerRef: qt,
|
|
3331
|
+
agentVideoEl: L.videoElement,
|
|
3332
|
+
onConnect: () => void L.connect(),
|
|
3333
|
+
onDisconnect: () => L.disconnect(),
|
|
3238
3334
|
onRetry: Wn,
|
|
3239
3335
|
onResumeAudio: Bn,
|
|
3240
|
-
onToggleMute:
|
|
3241
|
-
onSwitchMicDevice: (y) => void
|
|
3242
|
-
onToggleCamera: () => void
|
|
3243
|
-
onSwitchCameraDevice: (y) => void
|
|
3244
|
-
onToggleScreenShare: () => void
|
|
3336
|
+
onToggleMute: se.toggleMute,
|
|
3337
|
+
onSwitchMicDevice: (y) => void se.switchDevice(y),
|
|
3338
|
+
onToggleCamera: () => void ue.toggle(),
|
|
3339
|
+
onSwitchCameraDevice: (y) => void ue.switchDevice(y),
|
|
3340
|
+
onToggleScreenShare: () => void Ee.toggle(),
|
|
3245
3341
|
onToggleSpeaker: Tn,
|
|
3246
3342
|
onSendMessage: Mn,
|
|
3247
|
-
onMinimize:
|
|
3248
|
-
onClose:
|
|
3249
|
-
onClearMicError:
|
|
3343
|
+
onMinimize: On,
|
|
3344
|
+
onClose: jt,
|
|
3345
|
+
onClearMicError: se.clearError
|
|
3250
3346
|
}
|
|
3251
3347
|
)
|
|
3252
3348
|
}
|
|
3253
|
-
),
|
|
3349
|
+
), Vt = !me && (le === "hidden" || le === "minimized") ? /* @__PURE__ */ b(
|
|
3254
3350
|
"div",
|
|
3255
3351
|
{
|
|
3256
3352
|
className: [
|
|
3257
3353
|
"ll-widget",
|
|
3258
3354
|
"ll-widget--floating",
|
|
3259
|
-
`ll-widget--${
|
|
3260
|
-
`ll-widget--${
|
|
3355
|
+
`ll-widget--${le}`,
|
|
3356
|
+
`ll-widget--${Ce ? "mobile" : "desktop"}`
|
|
3261
3357
|
].join(" "),
|
|
3262
|
-
style:
|
|
3263
|
-
"data-display-mode":
|
|
3264
|
-
"data-position":
|
|
3358
|
+
style: Ye,
|
|
3359
|
+
"data-display-mode": le,
|
|
3360
|
+
"data-position": k,
|
|
3265
3361
|
children: [
|
|
3266
|
-
|
|
3362
|
+
le === "hidden" && /* @__PURE__ */ n(
|
|
3267
3363
|
Mr,
|
|
3268
3364
|
{
|
|
3269
|
-
position:
|
|
3270
|
-
isMobile:
|
|
3271
|
-
isSpeaking:
|
|
3272
|
-
onExpand: () =>
|
|
3273
|
-
label: `Open ${
|
|
3274
|
-
avatarImageUrl:
|
|
3275
|
-
agentName:
|
|
3276
|
-
containerEl:
|
|
3365
|
+
position: k,
|
|
3366
|
+
isMobile: Ce,
|
|
3367
|
+
isSpeaking: L.agentState === "speaking",
|
|
3368
|
+
onExpand: () => de("expanded"),
|
|
3369
|
+
label: `Open ${bt} widget`,
|
|
3370
|
+
avatarImageUrl: Rt,
|
|
3371
|
+
agentName: bt,
|
|
3372
|
+
containerEl: ce
|
|
3277
3373
|
}
|
|
3278
3374
|
),
|
|
3279
|
-
|
|
3375
|
+
le === "minimized" && /* @__PURE__ */ n(
|
|
3280
3376
|
Dr,
|
|
3281
3377
|
{
|
|
3282
|
-
position:
|
|
3283
|
-
isMobile:
|
|
3284
|
-
agentName:
|
|
3285
|
-
avatarImageUrl:
|
|
3286
|
-
agentState:
|
|
3287
|
-
isMuted:
|
|
3288
|
-
audioLevel:
|
|
3289
|
-
onExpand:
|
|
3290
|
-
onToggleMute:
|
|
3291
|
-
onClose:
|
|
3378
|
+
position: k,
|
|
3379
|
+
isMobile: Ce,
|
|
3380
|
+
agentName: bt,
|
|
3381
|
+
avatarImageUrl: Rt,
|
|
3382
|
+
agentState: L.agentState,
|
|
3383
|
+
isMuted: se.isMuted,
|
|
3384
|
+
audioLevel: it,
|
|
3385
|
+
onExpand: Hn,
|
|
3386
|
+
onToggleMute: se.toggleMute,
|
|
3387
|
+
onClose: jt
|
|
3292
3388
|
}
|
|
3293
3389
|
)
|
|
3294
3390
|
]
|
|
3295
3391
|
}
|
|
3296
|
-
) : null,
|
|
3297
|
-
return /* @__PURE__ */
|
|
3392
|
+
) : null, Yt = ce ?? (typeof document < "u" ? document.body : null);
|
|
3393
|
+
return /* @__PURE__ */ b($e, { children: [
|
|
3298
3394
|
qn,
|
|
3299
|
-
|
|
3395
|
+
Vt && Yt && $t(Vt, Yt)
|
|
3300
3396
|
] });
|
|
3301
3397
|
}
|
|
3302
3398
|
);
|
|
3303
|
-
|
|
3304
|
-
const
|
|
3399
|
+
Rn.displayName = "AvatarWidgetInner";
|
|
3400
|
+
const wi = Pt(
|
|
3305
3401
|
function(t, r) {
|
|
3306
|
-
return /* @__PURE__ */ n(
|
|
3402
|
+
return /* @__PURE__ */ n(Qn, { children: /* @__PURE__ */ n(Rn, { ...t, ref: r }) });
|
|
3307
3403
|
}
|
|
3308
3404
|
);
|
|
3309
|
-
|
|
3310
|
-
const
|
|
3405
|
+
wi.displayName = "AvatarWidget";
|
|
3406
|
+
const Ri = ({
|
|
3311
3407
|
agentId: e,
|
|
3312
3408
|
baseUrl: t,
|
|
3313
3409
|
apiKey: r,
|
|
3314
|
-
mode:
|
|
3315
|
-
onAgentEvent:
|
|
3316
|
-
className:
|
|
3410
|
+
mode: i,
|
|
3411
|
+
onAgentEvent: a,
|
|
3412
|
+
className: o,
|
|
3317
3413
|
style: s
|
|
3318
3414
|
}) => {
|
|
3319
|
-
const
|
|
3320
|
-
p.current =
|
|
3321
|
-
const v =
|
|
3322
|
-
var
|
|
3415
|
+
const l = A(null), c = A(null), p = A(a);
|
|
3416
|
+
p.current = a;
|
|
3417
|
+
const v = E((f) => {
|
|
3418
|
+
var R;
|
|
3323
3419
|
const u = f.detail;
|
|
3324
|
-
(
|
|
3420
|
+
(R = p.current) == null || R.call(p, u);
|
|
3325
3421
|
}, []);
|
|
3326
|
-
return
|
|
3327
|
-
const f =
|
|
3422
|
+
return M(() => {
|
|
3423
|
+
const f = l.current;
|
|
3328
3424
|
if (!f) return;
|
|
3329
3425
|
const u = document.createElement("livelayer-widget");
|
|
3330
|
-
return u.setAttribute("agent-id", e), t && u.setAttribute("base-url", t), r && u.setAttribute("api-key", r),
|
|
3426
|
+
return u.setAttribute("agent-id", e), t && u.setAttribute("base-url", t), r && u.setAttribute("api-key", r), i && u.setAttribute("mode", i), u.addEventListener("agent-event", v), f.appendChild(u), c.current = u, () => {
|
|
3331
3427
|
u.removeEventListener("agent-event", v), f.removeChild(u), c.current = null;
|
|
3332
3428
|
};
|
|
3333
|
-
}, [e]),
|
|
3334
|
-
c.current && (
|
|
3335
|
-
}, [
|
|
3336
|
-
},
|
|
3337
|
-
function({ id: t, intent: r, as:
|
|
3429
|
+
}, [e]), M(() => {
|
|
3430
|
+
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
3431
|
+
}, [i]), /* @__PURE__ */ n("div", { ref: l, className: o, style: s });
|
|
3432
|
+
}, Mi = Pt(
|
|
3433
|
+
function({ id: t, intent: r, as: i = "div", className: a, style: o, children: s }, l) {
|
|
3338
3434
|
return Gn(
|
|
3339
|
-
|
|
3435
|
+
i,
|
|
3340
3436
|
{
|
|
3341
|
-
ref:
|
|
3437
|
+
ref: l,
|
|
3342
3438
|
"data-ll-region": t,
|
|
3343
3439
|
"data-ll-intent": r,
|
|
3344
|
-
className:
|
|
3345
|
-
style:
|
|
3440
|
+
className: a,
|
|
3441
|
+
style: o
|
|
3346
3442
|
},
|
|
3347
3443
|
s
|
|
3348
3444
|
);
|
|
3349
3445
|
}
|
|
3350
3446
|
);
|
|
3351
|
-
function
|
|
3352
|
-
const { onFieldUpdate: t, onComplete: r, source:
|
|
3353
|
-
|
|
3354
|
-
v.current = t, f.current = r, u.current =
|
|
3355
|
-
}, [t, r,
|
|
3356
|
-
const
|
|
3357
|
-
|
|
3447
|
+
function Ti(e = {}) {
|
|
3448
|
+
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), u = A(i);
|
|
3449
|
+
M(() => {
|
|
3450
|
+
v.current = t, f.current = r, u.current = i;
|
|
3451
|
+
}, [t, r, i]);
|
|
3452
|
+
const R = E(() => {
|
|
3453
|
+
o({}), l(!1);
|
|
3358
3454
|
}, []);
|
|
3359
|
-
return
|
|
3455
|
+
return M(() => {
|
|
3360
3456
|
if (typeof window > "u") return;
|
|
3361
|
-
const
|
|
3362
|
-
var
|
|
3363
|
-
const
|
|
3364
|
-
if (
|
|
3365
|
-
if (
|
|
3366
|
-
if (u.current !== "all" &&
|
|
3457
|
+
const k = (_) => {
|
|
3458
|
+
var w, N;
|
|
3459
|
+
const m = _.detail;
|
|
3460
|
+
if (m) {
|
|
3461
|
+
if (m.phase === "field") {
|
|
3462
|
+
if (u.current !== "all" && m.source !== u.current)
|
|
3367
3463
|
return;
|
|
3368
|
-
|
|
3369
|
-
(T) => T[
|
|
3464
|
+
l(!0), o(
|
|
3465
|
+
(T) => T[m.fieldName] === m.value ? T : { ...T, [m.fieldName]: m.value }
|
|
3370
3466
|
);
|
|
3371
3467
|
try {
|
|
3372
|
-
(
|
|
3468
|
+
(w = v.current) == null || w.call(v, m);
|
|
3373
3469
|
} catch (T) {
|
|
3374
3470
|
console.warn("[LiveLayer] useCollect onFieldUpdate threw.", T);
|
|
3375
3471
|
}
|
|
3376
3472
|
return;
|
|
3377
3473
|
}
|
|
3378
|
-
if (
|
|
3379
|
-
const T =
|
|
3474
|
+
if (m.phase === "complete") {
|
|
3475
|
+
const T = m.result;
|
|
3380
3476
|
if (u.current !== "all" && T.source !== u.current)
|
|
3381
3477
|
return;
|
|
3382
|
-
p(T),
|
|
3478
|
+
p(T), l(!1);
|
|
3383
3479
|
try {
|
|
3384
|
-
(
|
|
3385
|
-
} catch (
|
|
3386
|
-
console.warn("[LiveLayer] useCollect onComplete threw.",
|
|
3480
|
+
(N = f.current) == null || N.call(f, T);
|
|
3481
|
+
} catch (I) {
|
|
3482
|
+
console.warn("[LiveLayer] useCollect onComplete threw.", I);
|
|
3387
3483
|
}
|
|
3388
3484
|
}
|
|
3389
3485
|
}
|
|
3390
3486
|
};
|
|
3391
|
-
return document.addEventListener("ll-collected",
|
|
3392
|
-
}, []), { fields:
|
|
3487
|
+
return document.addEventListener("ll-collected", k), () => document.removeEventListener("ll-collected", k);
|
|
3488
|
+
}, []), { fields: a, isCollecting: s, lastResult: c, reset: R };
|
|
3393
3489
|
}
|
|
3394
|
-
let
|
|
3395
|
-
function
|
|
3490
|
+
let xn = 1;
|
|
3491
|
+
function Di({
|
|
3396
3492
|
onMount: e,
|
|
3397
3493
|
defaultOpen: t = !1,
|
|
3398
3494
|
storageKey: r = "ll-debug-open"
|
|
3399
3495
|
}) {
|
|
3400
|
-
const [
|
|
3401
|
-
|
|
3496
|
+
const [i, a] = S(t), [o, s] = S([]), [l, c] = S(""), [p, v] = S(!1), f = A(/* @__PURE__ */ new Set()), u = A([]), R = A(p);
|
|
3497
|
+
R.current = p, M(() => {
|
|
3402
3498
|
try {
|
|
3403
|
-
const
|
|
3404
|
-
|
|
3499
|
+
const m = localStorage.getItem(r);
|
|
3500
|
+
m === "1" && a(!0), m === "0" && a(!1);
|
|
3405
3501
|
} catch {
|
|
3406
3502
|
}
|
|
3407
|
-
}, [r]),
|
|
3503
|
+
}, [r]), M(() => {
|
|
3408
3504
|
try {
|
|
3409
|
-
localStorage.setItem(r,
|
|
3505
|
+
localStorage.setItem(r, i ? "1" : "0");
|
|
3410
3506
|
} catch {
|
|
3411
3507
|
}
|
|
3412
|
-
}, [
|
|
3413
|
-
const
|
|
3414
|
-
(
|
|
3508
|
+
}, [i, r]), M(() => {
|
|
3509
|
+
const m = (w) => {
|
|
3510
|
+
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), a((N) => !N));
|
|
3415
3511
|
};
|
|
3416
|
-
return window.addEventListener("keydown",
|
|
3417
|
-
}, []),
|
|
3418
|
-
const
|
|
3419
|
-
if (u.current.length === 0 ||
|
|
3420
|
-
const
|
|
3512
|
+
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
3513
|
+
}, []), M(() => {
|
|
3514
|
+
const m = setInterval(() => {
|
|
3515
|
+
if (u.current.length === 0 || R.current) return;
|
|
3516
|
+
const w = u.current.splice(0, u.current.length);
|
|
3421
3517
|
s(
|
|
3422
|
-
(
|
|
3518
|
+
(N) => [...w.reverse(), ...N].slice(0, 200)
|
|
3423
3519
|
);
|
|
3424
3520
|
}, 100);
|
|
3425
|
-
return () => clearInterval(
|
|
3521
|
+
return () => clearInterval(m);
|
|
3426
3522
|
}, []);
|
|
3427
|
-
const
|
|
3428
|
-
if (
|
|
3429
|
-
!e ||
|
|
3523
|
+
const k = A(!1);
|
|
3524
|
+
if (M(() => {
|
|
3525
|
+
!e || k.current || (k.current = !0, e((m) => {
|
|
3430
3526
|
u.current.push({
|
|
3431
|
-
id:
|
|
3527
|
+
id: xn++,
|
|
3432
3528
|
ts: Date.now(),
|
|
3433
3529
|
kind: "event",
|
|
3434
|
-
type:
|
|
3435
|
-
data:
|
|
3530
|
+
type: m.eventName,
|
|
3531
|
+
data: m.data
|
|
3436
3532
|
});
|
|
3437
3533
|
}));
|
|
3438
|
-
}, [e]),
|
|
3439
|
-
const
|
|
3534
|
+
}, [e]), M(() => {
|
|
3535
|
+
const m = console.warn, w = console.log, N = (T, I) => function(...U) {
|
|
3440
3536
|
try {
|
|
3441
|
-
const g = typeof
|
|
3537
|
+
const g = typeof U[0] == "string" ? U[0] : "";
|
|
3442
3538
|
g.startsWith("[LiveLayer]") && u.current.push({
|
|
3443
|
-
id:
|
|
3539
|
+
id: xn++,
|
|
3444
3540
|
ts: Date.now(),
|
|
3445
3541
|
kind: T,
|
|
3446
3542
|
type: g.slice(0, 120),
|
|
3447
|
-
data: { args:
|
|
3543
|
+
data: { args: U.slice(1).map((P) => xi(P)) }
|
|
3448
3544
|
});
|
|
3449
3545
|
} catch {
|
|
3450
3546
|
}
|
|
3451
|
-
return
|
|
3547
|
+
return I.apply(this, U);
|
|
3452
3548
|
};
|
|
3453
|
-
return console.warn =
|
|
3454
|
-
console.warn =
|
|
3549
|
+
return console.warn = N("warn", m), console.log = N("log", w), () => {
|
|
3550
|
+
console.warn = m, console.log = w;
|
|
3455
3551
|
};
|
|
3456
|
-
}, []), !
|
|
3552
|
+
}, []), !i)
|
|
3457
3553
|
return /* @__PURE__ */ n(
|
|
3458
3554
|
"button",
|
|
3459
3555
|
{
|
|
3460
3556
|
type: "button",
|
|
3461
|
-
onClick: () =>
|
|
3557
|
+
onClick: () => a(!0),
|
|
3462
3558
|
title: "Open LiveLayer debug panel (Cmd/Ctrl + Shift + L)",
|
|
3463
3559
|
"aria-label": "Open LiveLayer debug panel",
|
|
3464
3560
|
style: {
|
|
@@ -3480,12 +3576,12 @@ function To({
|
|
|
3480
3576
|
children: "🛰 LL debug"
|
|
3481
3577
|
}
|
|
3482
3578
|
);
|
|
3483
|
-
const _ =
|
|
3484
|
-
if (!
|
|
3485
|
-
const
|
|
3486
|
-
return
|
|
3579
|
+
const _ = o.filter((m) => {
|
|
3580
|
+
if (!l) return !0;
|
|
3581
|
+
const w = l.toLowerCase();
|
|
3582
|
+
return m.type.toLowerCase().includes(w) || JSON.stringify(m.data || {}).toLowerCase().includes(w);
|
|
3487
3583
|
});
|
|
3488
|
-
return /* @__PURE__ */
|
|
3584
|
+
return /* @__PURE__ */ b(
|
|
3489
3585
|
"div",
|
|
3490
3586
|
{
|
|
3491
3587
|
style: {
|
|
@@ -3507,7 +3603,7 @@ function To({
|
|
|
3507
3603
|
overflow: "hidden"
|
|
3508
3604
|
},
|
|
3509
3605
|
children: [
|
|
3510
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ b(
|
|
3511
3607
|
"div",
|
|
3512
3608
|
{
|
|
3513
3609
|
style: {
|
|
@@ -3520,18 +3616,18 @@ function To({
|
|
|
3520
3616
|
},
|
|
3521
3617
|
children: [
|
|
3522
3618
|
/* @__PURE__ */ n("span", { style: { fontWeight: 600, fontSize: 12 }, children: "LiveLayer debug" }),
|
|
3523
|
-
/* @__PURE__ */
|
|
3524
|
-
|
|
3619
|
+
/* @__PURE__ */ b("span", { style: { fontSize: 10, color: "rgba(255,255,255,0.4)" }, children: [
|
|
3620
|
+
o.length,
|
|
3525
3621
|
" event",
|
|
3526
|
-
|
|
3622
|
+
o.length === 1 ? "" : "s"
|
|
3527
3623
|
] }),
|
|
3528
3624
|
/* @__PURE__ */ n("span", { style: { flex: 1 } }),
|
|
3529
3625
|
/* @__PURE__ */ n(
|
|
3530
3626
|
"button",
|
|
3531
3627
|
{
|
|
3532
3628
|
type: "button",
|
|
3533
|
-
onClick: () => v((
|
|
3534
|
-
style:
|
|
3629
|
+
onClick: () => v((m) => !m),
|
|
3630
|
+
style: Tt(p ? "#f59e0b" : "transparent"),
|
|
3535
3631
|
title: "Pause / resume capture",
|
|
3536
3632
|
children: p ? "▶ resume" : "⏸ pause"
|
|
3537
3633
|
}
|
|
@@ -3543,7 +3639,7 @@ function To({
|
|
|
3543
3639
|
onClick: () => {
|
|
3544
3640
|
s([]), u.current = [];
|
|
3545
3641
|
},
|
|
3546
|
-
style:
|
|
3642
|
+
style: Tt("transparent"),
|
|
3547
3643
|
title: "Clear buffer",
|
|
3548
3644
|
children: "clear"
|
|
3549
3645
|
}
|
|
@@ -3552,8 +3648,8 @@ function To({
|
|
|
3552
3648
|
"button",
|
|
3553
3649
|
{
|
|
3554
3650
|
type: "button",
|
|
3555
|
-
onClick: () =>
|
|
3556
|
-
style:
|
|
3651
|
+
onClick: () => a(!1),
|
|
3652
|
+
style: Tt("transparent"),
|
|
3557
3653
|
"aria-label": "Close",
|
|
3558
3654
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
3559
3655
|
children: "✕"
|
|
@@ -3566,8 +3662,8 @@ function To({
|
|
|
3566
3662
|
"input",
|
|
3567
3663
|
{
|
|
3568
3664
|
type: "text",
|
|
3569
|
-
value:
|
|
3570
|
-
onChange: (
|
|
3665
|
+
value: l,
|
|
3666
|
+
onChange: (m) => c(m.target.value),
|
|
3571
3667
|
placeholder: "filter by type or data…",
|
|
3572
3668
|
style: {
|
|
3573
3669
|
margin: 8,
|
|
@@ -3589,7 +3685,7 @@ function To({
|
|
|
3589
3685
|
overflowY: "auto",
|
|
3590
3686
|
padding: "0 8px 8px"
|
|
3591
3687
|
},
|
|
3592
|
-
children: _.length === 0 ? /* @__PURE__ */
|
|
3688
|
+
children: _.length === 0 ? /* @__PURE__ */ b(
|
|
3593
3689
|
"div",
|
|
3594
3690
|
{
|
|
3595
3691
|
style: {
|
|
@@ -3619,16 +3715,16 @@ function To({
|
|
|
3619
3715
|
)
|
|
3620
3716
|
]
|
|
3621
3717
|
}
|
|
3622
|
-
) : _.map((
|
|
3623
|
-
|
|
3718
|
+
) : _.map((m) => /* @__PURE__ */ n(
|
|
3719
|
+
_i,
|
|
3624
3720
|
{
|
|
3625
|
-
entry:
|
|
3626
|
-
expanded: f.current.has(
|
|
3721
|
+
entry: m,
|
|
3722
|
+
expanded: f.current.has(m.id),
|
|
3627
3723
|
onToggle: () => {
|
|
3628
|
-
f.current.has(
|
|
3724
|
+
f.current.has(m.id) ? f.current.delete(m.id) : f.current.add(m.id), s((w) => [...w]);
|
|
3629
3725
|
}
|
|
3630
3726
|
},
|
|
3631
|
-
|
|
3727
|
+
m.id
|
|
3632
3728
|
))
|
|
3633
3729
|
}
|
|
3634
3730
|
)
|
|
@@ -3636,15 +3732,15 @@ function To({
|
|
|
3636
3732
|
}
|
|
3637
3733
|
);
|
|
3638
3734
|
}
|
|
3639
|
-
function
|
|
3735
|
+
function _i({
|
|
3640
3736
|
entry: e,
|
|
3641
3737
|
expanded: t,
|
|
3642
3738
|
onToggle: r
|
|
3643
3739
|
}) {
|
|
3644
|
-
const
|
|
3740
|
+
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
3741
|
hour12: !1
|
|
3646
3742
|
});
|
|
3647
|
-
return /* @__PURE__ */
|
|
3743
|
+
return /* @__PURE__ */ b(
|
|
3648
3744
|
"button",
|
|
3649
3745
|
{
|
|
3650
3746
|
type: "button",
|
|
@@ -3662,7 +3758,7 @@ function wo({
|
|
|
3662
3758
|
lineHeight: 1.4
|
|
3663
3759
|
},
|
|
3664
3760
|
children: [
|
|
3665
|
-
/* @__PURE__ */
|
|
3761
|
+
/* @__PURE__ */ b("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
3666
3762
|
/* @__PURE__ */ n(
|
|
3667
3763
|
"span",
|
|
3668
3764
|
{
|
|
@@ -3671,14 +3767,14 @@ function wo({
|
|
|
3671
3767
|
fontVariantNumeric: "tabular-nums",
|
|
3672
3768
|
fontSize: 10
|
|
3673
3769
|
},
|
|
3674
|
-
children:
|
|
3770
|
+
children: a
|
|
3675
3771
|
}
|
|
3676
3772
|
),
|
|
3677
3773
|
/* @__PURE__ */ n(
|
|
3678
3774
|
"span",
|
|
3679
3775
|
{
|
|
3680
3776
|
style: {
|
|
3681
|
-
color:
|
|
3777
|
+
color: i,
|
|
3682
3778
|
fontWeight: 600,
|
|
3683
3779
|
flexShrink: 0
|
|
3684
3780
|
},
|
|
@@ -3706,7 +3802,7 @@ function wo({
|
|
|
3706
3802
|
}
|
|
3707
3803
|
);
|
|
3708
3804
|
}
|
|
3709
|
-
function
|
|
3805
|
+
function Tt(e) {
|
|
3710
3806
|
return {
|
|
3711
3807
|
background: e,
|
|
3712
3808
|
color: "#fff",
|
|
@@ -3717,62 +3813,62 @@ function Mt(e) {
|
|
|
3717
3813
|
cursor: "pointer"
|
|
3718
3814
|
};
|
|
3719
3815
|
}
|
|
3720
|
-
function
|
|
3816
|
+
function xi(e) {
|
|
3721
3817
|
try {
|
|
3722
3818
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
3723
3819
|
} catch {
|
|
3724
3820
|
return String(e);
|
|
3725
3821
|
}
|
|
3726
3822
|
}
|
|
3727
|
-
function
|
|
3823
|
+
function Li(e) {
|
|
3728
3824
|
const t = JSON.stringify(e);
|
|
3729
|
-
|
|
3825
|
+
M(() => Jn(e), [t]);
|
|
3730
3826
|
}
|
|
3731
|
-
function
|
|
3732
|
-
return
|
|
3827
|
+
function Pi({ fields: e, children: t }) {
|
|
3828
|
+
return Li(e), /* @__PURE__ */ n($e, { children: t });
|
|
3733
3829
|
}
|
|
3734
|
-
function
|
|
3735
|
-
const [e, t] =
|
|
3736
|
-
t((
|
|
3737
|
-
const s =
|
|
3830
|
+
function $i() {
|
|
3831
|
+
const [e, t] = S([]), r = E((a) => {
|
|
3832
|
+
t((o) => {
|
|
3833
|
+
const s = o.findIndex((l) => l.id === a.id);
|
|
3738
3834
|
if (s >= 0) {
|
|
3739
|
-
const
|
|
3740
|
-
return
|
|
3835
|
+
const l = o.slice();
|
|
3836
|
+
return l[s] = a, l;
|
|
3741
3837
|
}
|
|
3742
|
-
return [...
|
|
3838
|
+
return [...o, a];
|
|
3743
3839
|
});
|
|
3744
|
-
}, []),
|
|
3840
|
+
}, []), i = E(() => t([]), []);
|
|
3745
3841
|
return {
|
|
3746
3842
|
entries: e,
|
|
3747
3843
|
pushSegment: r,
|
|
3748
|
-
clear:
|
|
3844
|
+
clear: i,
|
|
3749
3845
|
latest: e.length > 0 ? e[e.length - 1] : null
|
|
3750
3846
|
};
|
|
3751
3847
|
}
|
|
3752
3848
|
export {
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3849
|
+
wi as AvatarWidget,
|
|
3850
|
+
Qn as ErrorBoundary,
|
|
3851
|
+
Pi as FieldProvider,
|
|
3852
|
+
Di as LiveLayerDebugPanel,
|
|
3853
|
+
Mi as LiveLayerRegion,
|
|
3854
|
+
Ri as LiveLayerWidget,
|
|
3855
|
+
Oi as clearFieldRegistry,
|
|
3856
|
+
ni as clearPageContextCache,
|
|
3857
|
+
si as clearRoutesCache,
|
|
3858
|
+
ti as extractPageContext,
|
|
3859
|
+
li as extractRoutes,
|
|
3860
|
+
yn as getCachedPageContext,
|
|
3861
|
+
Mt as getCachedRoutes,
|
|
3862
|
+
Bi as getRegisteredFields,
|
|
3767
3863
|
xr as matchesPattern,
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3864
|
+
ii as normalizeRouteInput,
|
|
3865
|
+
Wi as registerFields,
|
|
3866
|
+
Fi as setFieldValue,
|
|
3867
|
+
Lr as shouldRenderAtPath,
|
|
3772
3868
|
ar as useAgentInfo,
|
|
3773
3869
|
tr as useAudioLevel,
|
|
3774
|
-
|
|
3775
|
-
|
|
3870
|
+
ir as useCameraState,
|
|
3871
|
+
Ti as useCollect,
|
|
3776
3872
|
dr as useDisplayMode,
|
|
3777
3873
|
pr as useDisplayModePersistence,
|
|
3778
3874
|
mr as useIsMobile,
|
|
@@ -3780,8 +3876,8 @@ export {
|
|
|
3780
3876
|
lr as useMediaDevices,
|
|
3781
3877
|
nr as useMicrophoneState,
|
|
3782
3878
|
yr as usePathname,
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3879
|
+
Li as useRegisterFields,
|
|
3880
|
+
kr as useRouteMatch,
|
|
3881
|
+
or as useScreenShareState,
|
|
3882
|
+
$i as useTranscript
|
|
3787
3883
|
};
|