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