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