@livelayer/react 0.23.2 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.mjs +1228 -1213
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as S, jsx as r, Fragment as Ve } from "react/jsx-runtime";
|
|
3
|
-
import { Component as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as
|
|
8
|
-
class
|
|
3
|
+
import { Component as Er, useState as M, useRef as R, useEffect as I, useCallback as L, useMemo as at, useLayoutEffect as er, forwardRef as on, useImperativeHandle as Ar, createElement as Nr } from "react";
|
|
4
|
+
import { createPortal as ln } from "react-dom";
|
|
5
|
+
import { LiveKitSession as Mr, registerFields as Ir } from "@livelayer/sdk";
|
|
6
|
+
import { clearFieldRegistry as Wo, getRegisteredFields as qo, registerFields as Uo, setFieldValue as jo } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as Rr, Track as tr, createLocalVideoTrack as Tr } from "livekit-client";
|
|
8
|
+
class Pr extends Er {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -36,25 +36,25 @@ class Rr extends Sr {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
function Dr(e) {
|
|
39
|
-
const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [
|
|
40
|
-
|
|
41
|
-
const
|
|
39
|
+
const [t, n] = M("idle"), [i, l] = M("idle"), [o, s] = M([]), [a, c] = M(null), [d, g] = M(null), [p, m] = M(null), [D, x] = M(!1), [C, y] = M(null), w = R(null), P = R(e.onDataMessage);
|
|
40
|
+
P.current = e.onDataMessage, I(() => {
|
|
41
|
+
const v = {
|
|
42
42
|
onConnectionStateChange: (B) => {
|
|
43
|
-
n(B), B === "connected" &&
|
|
43
|
+
n(B), B === "connected" && y(null);
|
|
44
44
|
},
|
|
45
45
|
onAgentStateChange: l,
|
|
46
46
|
onTranscript: (B) => s([...B]),
|
|
47
47
|
onAgentConfig: c,
|
|
48
|
-
onAudioTrack: (B) =>
|
|
49
|
-
onVideoTrack: (B) =>
|
|
50
|
-
onVideoTrackRemoved: () =>
|
|
51
|
-
onError: (B) =>
|
|
48
|
+
onAudioTrack: (B) => m(B),
|
|
49
|
+
onVideoTrack: (B) => g(B),
|
|
50
|
+
onVideoTrackRemoved: () => g(null),
|
|
51
|
+
onError: (B) => y(B),
|
|
52
52
|
onDataMessage: (B) => {
|
|
53
53
|
var J;
|
|
54
|
-
(J =
|
|
54
|
+
(J = P.current) == null || J.call(P, B);
|
|
55
55
|
},
|
|
56
|
-
onResumabilityChange:
|
|
57
|
-
}, z = new
|
|
56
|
+
onResumabilityChange: x
|
|
57
|
+
}, z = new Mr(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
60
60
|
baseUrl: e.baseUrl,
|
|
@@ -62,9 +62,9 @@ function Dr(e) {
|
|
|
62
62
|
sessionEndpoint: e.sessionEndpoint,
|
|
63
63
|
sessionBody: e.sessionBody
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
v
|
|
66
66
|
);
|
|
67
|
-
return w.current = z, n("idle"), l("idle"), s([]), c(null),
|
|
67
|
+
return w.current = z, n("idle"), l("idle"), s([]), c(null), g(null), m(null), x(!1), y(null), () => {
|
|
68
68
|
var B;
|
|
69
69
|
(B = z.destroy) == null || B.call(z), w.current = null;
|
|
70
70
|
};
|
|
@@ -75,139 +75,139 @@ function Dr(e) {
|
|
|
75
75
|
e.sessionEndpoint,
|
|
76
76
|
JSON.stringify(e.sessionBody ?? {})
|
|
77
77
|
]);
|
|
78
|
-
const E =
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
78
|
+
const E = L(async () => {
|
|
79
|
+
const v = w.current;
|
|
80
|
+
if (v)
|
|
81
81
|
try {
|
|
82
|
-
await
|
|
82
|
+
await v.connect();
|
|
83
83
|
} catch (z) {
|
|
84
|
-
throw
|
|
84
|
+
throw y(z instanceof Error ? z.message : String(z)), z;
|
|
85
85
|
}
|
|
86
|
-
}, []),
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
}, []), O =
|
|
90
|
-
var
|
|
91
|
-
return ((
|
|
86
|
+
}, []), b = L(() => {
|
|
87
|
+
const v = w.current;
|
|
88
|
+
v && v.disconnect();
|
|
89
|
+
}, []), O = L(() => {
|
|
90
|
+
var v;
|
|
91
|
+
return ((v = w.current) == null ? void 0 : v.getRoom()) ?? null;
|
|
92
92
|
}, []);
|
|
93
93
|
return {
|
|
94
94
|
connectionState: t,
|
|
95
95
|
agentState: i,
|
|
96
96
|
transcript: o,
|
|
97
97
|
agentConfig: a,
|
|
98
|
-
videoElement:
|
|
98
|
+
videoElement: d,
|
|
99
99
|
audioElement: p,
|
|
100
|
-
canResume:
|
|
101
|
-
error:
|
|
100
|
+
canResume: D,
|
|
101
|
+
error: C,
|
|
102
102
|
connect: E,
|
|
103
|
-
disconnect:
|
|
103
|
+
disconnect: b,
|
|
104
104
|
getRoom: O,
|
|
105
105
|
session: w.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const e =
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
108
|
+
function zr() {
|
|
109
|
+
const e = R(null), t = R(/* @__PURE__ */ new Map()), n = R(null), i = R(/* @__PURE__ */ new Set()), l = L(() => {
|
|
110
|
+
const x = t.current;
|
|
111
|
+
if (x.size === 0) {
|
|
112
112
|
n.current = null;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
let
|
|
116
|
-
for (const { analyser:
|
|
117
|
-
|
|
118
|
-
let
|
|
119
|
-
for (let
|
|
120
|
-
const E =
|
|
121
|
-
E >
|
|
115
|
+
let C = 0;
|
|
116
|
+
for (const { analyser: y, buffer: w } of x.values()) {
|
|
117
|
+
y.getByteFrequencyData(w);
|
|
118
|
+
let P = 0;
|
|
119
|
+
for (let b = 0; b < w.length; b++) P += w[b];
|
|
120
|
+
const E = P / w.length / 255;
|
|
121
|
+
E > C && (C = E);
|
|
122
122
|
}
|
|
123
|
-
for (const
|
|
123
|
+
for (const y of i.current)
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
y(C);
|
|
126
126
|
} catch (w) {
|
|
127
127
|
console.error("[useAudioLevel] subscriber threw:", w);
|
|
128
128
|
}
|
|
129
129
|
n.current = requestAnimationFrame(l);
|
|
130
|
-
}, []), o =
|
|
130
|
+
}, []), o = L(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = L(() => {
|
|
131
131
|
n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(l));
|
|
132
|
-
}, [l]), a =
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
132
|
+
}, [l]), a = L((x) => {
|
|
133
|
+
const C = t.current.get(x);
|
|
134
|
+
if (C) {
|
|
135
135
|
try {
|
|
136
|
-
|
|
136
|
+
C.node.disconnect();
|
|
137
137
|
} catch {
|
|
138
138
|
}
|
|
139
139
|
try {
|
|
140
|
-
|
|
140
|
+
C.analyser.disconnect();
|
|
141
141
|
} catch {
|
|
142
142
|
}
|
|
143
|
-
t.current.delete(
|
|
143
|
+
t.current.delete(x);
|
|
144
144
|
}
|
|
145
|
-
}, []), c =
|
|
146
|
-
(
|
|
147
|
-
const
|
|
148
|
-
if (!
|
|
149
|
-
a(
|
|
150
|
-
const w =
|
|
145
|
+
}, []), c = L(
|
|
146
|
+
(x, C) => {
|
|
147
|
+
const y = o();
|
|
148
|
+
if (!y) return;
|
|
149
|
+
a(x);
|
|
150
|
+
const w = C(y);
|
|
151
151
|
if (!w) return;
|
|
152
|
-
const
|
|
153
|
-
|
|
152
|
+
const P = y.createAnalyser();
|
|
153
|
+
P.fftSize = 64;
|
|
154
154
|
try {
|
|
155
|
-
w.connect(
|
|
155
|
+
w.connect(P);
|
|
156
156
|
} catch (E) {
|
|
157
|
-
console.warn("[useAudioLevel] connect failed for slot",
|
|
157
|
+
console.warn("[useAudioLevel] connect failed for slot", x, E);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
t.current.set(
|
|
161
|
-
analyser:
|
|
160
|
+
t.current.set(x, {
|
|
161
|
+
analyser: P,
|
|
162
162
|
node: w,
|
|
163
|
-
buffer: new Uint8Array(new ArrayBuffer(
|
|
163
|
+
buffer: new Uint8Array(new ArrayBuffer(P.frequencyBinCount))
|
|
164
164
|
}), s();
|
|
165
165
|
},
|
|
166
166
|
[a, o, s]
|
|
167
|
-
),
|
|
168
|
-
(
|
|
169
|
-
c(
|
|
167
|
+
), d = L(
|
|
168
|
+
(x, C = "agent") => {
|
|
169
|
+
c(C, (y) => {
|
|
170
170
|
try {
|
|
171
|
-
return
|
|
171
|
+
return y.createMediaElementSource(x);
|
|
172
172
|
} catch (w) {
|
|
173
173
|
return console.warn(
|
|
174
174
|
"[useAudioLevel] createMediaElementSource failed for slot",
|
|
175
|
-
|
|
175
|
+
C,
|
|
176
176
|
w
|
|
177
177
|
), null;
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
},
|
|
181
181
|
[c]
|
|
182
|
-
),
|
|
183
|
-
(
|
|
184
|
-
c(
|
|
182
|
+
), g = L(
|
|
183
|
+
(x, C = "mic") => {
|
|
184
|
+
c(C, (y) => {
|
|
185
185
|
try {
|
|
186
|
-
return
|
|
186
|
+
return y.createMediaStreamSource(x);
|
|
187
187
|
} catch (w) {
|
|
188
188
|
return console.warn(
|
|
189
189
|
"[useAudioLevel] createMediaStreamSource failed for slot",
|
|
190
|
-
|
|
190
|
+
C,
|
|
191
191
|
w
|
|
192
192
|
), null;
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
},
|
|
196
196
|
[c]
|
|
197
|
-
), p =
|
|
198
|
-
(
|
|
199
|
-
a(
|
|
197
|
+
), p = L(
|
|
198
|
+
(x) => {
|
|
199
|
+
a(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
200
200
|
},
|
|
201
201
|
[a]
|
|
202
|
-
),
|
|
202
|
+
), m = L(() => {
|
|
203
203
|
n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
204
|
-
for (const
|
|
205
|
-
a(
|
|
206
|
-
}, [a]),
|
|
207
|
-
i.current.delete(
|
|
204
|
+
for (const x of Array.from(t.current.keys()))
|
|
205
|
+
a(x);
|
|
206
|
+
}, [a]), D = L((x) => (i.current.add(x), () => {
|
|
207
|
+
i.current.delete(x);
|
|
208
208
|
}), []);
|
|
209
209
|
return I(() => () => {
|
|
210
|
-
if (
|
|
210
|
+
if (m(), e.current) {
|
|
211
211
|
try {
|
|
212
212
|
e.current.close();
|
|
213
213
|
} catch {
|
|
@@ -215,162 +215,162 @@ function Pr() {
|
|
|
215
215
|
e.current = null;
|
|
216
216
|
}
|
|
217
217
|
i.current.clear();
|
|
218
|
-
}, [
|
|
218
|
+
}, [m]), { attach: d, attachStream: g, detach: m, detachSlot: p, subscribe: D };
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function $r(e) {
|
|
221
221
|
const t = e == null ? void 0 : e.mediaStreamTrack;
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, l] = M(t), [o, s] = M(""), [a, c] = M(null),
|
|
224
|
+
function Hr(e = {}) {
|
|
225
|
+
const t = e.gateUntilAgentReady ?? !1, n = e.agentState ?? null, [i, l] = M(t), [o, s] = M(""), [a, c] = M(null), d = R(null), g = R(null), p = R({
|
|
226
226
|
active: t,
|
|
227
227
|
lastAutoIntent: null
|
|
228
|
-
}),
|
|
229
|
-
var
|
|
230
|
-
if (
|
|
228
|
+
}), m = L(async (E) => {
|
|
229
|
+
var b, O;
|
|
230
|
+
if (d.current && g.current) {
|
|
231
231
|
try {
|
|
232
|
-
await
|
|
232
|
+
await g.current.localParticipant.unpublishTrack(d.current);
|
|
233
233
|
} catch {
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
d.current.stop(), d.current = null;
|
|
236
236
|
}
|
|
237
|
-
|
|
237
|
+
g.current = E, c(null);
|
|
238
238
|
try {
|
|
239
|
-
const
|
|
239
|
+
const v = await Rr({
|
|
240
240
|
echoCancellation: !0,
|
|
241
241
|
noiseSuppression: !0
|
|
242
242
|
});
|
|
243
|
-
await E.localParticipant.publishTrack(
|
|
244
|
-
const z = (O = (
|
|
243
|
+
await E.localParticipant.publishTrack(v), d.current = v, p.current.active ? (await E.localParticipant.setMicrophoneEnabled(!1), p.current.lastAutoIntent = !1, l(!0)) : l(v.isMuted);
|
|
244
|
+
const z = (O = (b = v.mediaStreamTrack) == null ? void 0 : b.getSettings) == null ? void 0 : O.call(b);
|
|
245
245
|
z != null && z.deviceId && s(z.deviceId);
|
|
246
|
-
} catch (
|
|
247
|
-
const z =
|
|
248
|
-
throw c(z),
|
|
246
|
+
} catch (v) {
|
|
247
|
+
const z = v instanceof Error && v.name === "NotAllowedError" ? "Enable your microphone to talk with the agent." : "Microphone unavailable. Check browser permissions and try again.";
|
|
248
|
+
throw c(z), v;
|
|
249
249
|
}
|
|
250
|
-
}, []),
|
|
251
|
-
|
|
252
|
-
}, []),
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
250
|
+
}, []), D = L((E) => {
|
|
251
|
+
g.current = E;
|
|
252
|
+
}, []), x = L(async (E) => {
|
|
253
|
+
const b = g.current;
|
|
254
|
+
if (b)
|
|
255
255
|
try {
|
|
256
|
-
await
|
|
256
|
+
await b.switchActiveDevice("audioinput", E), s(E);
|
|
257
257
|
} catch (O) {
|
|
258
258
|
console.warn("[useMicrophoneState] switchDevice failed:", O);
|
|
259
259
|
}
|
|
260
|
-
}, []),
|
|
261
|
-
const E =
|
|
262
|
-
if (l(
|
|
260
|
+
}, []), C = L(async () => {
|
|
261
|
+
const E = g.current, b = !i;
|
|
262
|
+
if (l(b), p.current.active = !1, !!E)
|
|
263
263
|
try {
|
|
264
|
-
await E.localParticipant.setMicrophoneEnabled(!
|
|
264
|
+
await E.localParticipant.setMicrophoneEnabled(!b);
|
|
265
265
|
} catch (O) {
|
|
266
|
-
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), l(!
|
|
266
|
+
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), l(!b);
|
|
267
267
|
}
|
|
268
268
|
}, [i]);
|
|
269
269
|
I(() => {
|
|
270
270
|
if (!p.current.active || n !== "listening") return;
|
|
271
|
-
const E =
|
|
272
|
-
if (!
|
|
271
|
+
const E = g.current, b = E == null ? void 0 : E.localParticipant;
|
|
272
|
+
if (!b) {
|
|
273
273
|
p.current.active = !1;
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
b.isMicrophoneEnabled === p.current.lastAutoIntent && (b.setMicrophoneEnabled(!0), p.current.lastAutoIntent = !0, l(!1)), p.current.active = !1;
|
|
277
277
|
}, [n]);
|
|
278
|
-
const
|
|
279
|
-
const E =
|
|
280
|
-
if (E &&
|
|
278
|
+
const y = L(() => {
|
|
279
|
+
const E = d.current, b = g.current;
|
|
280
|
+
if (E && b) {
|
|
281
281
|
try {
|
|
282
|
-
|
|
282
|
+
b.localParticipant.unpublishTrack(E);
|
|
283
283
|
} catch {
|
|
284
284
|
}
|
|
285
285
|
E.stop();
|
|
286
286
|
}
|
|
287
|
-
|
|
288
|
-
}, [t]), w =
|
|
287
|
+
d.current = null, g.current = null, p.current = { active: t, lastAutoIntent: null }, l(t), s("");
|
|
288
|
+
}, [t]), w = L(() => c(null), []), P = L(() => $r(d.current), []);
|
|
289
289
|
return {
|
|
290
290
|
isMuted: i,
|
|
291
291
|
activeDeviceId: o,
|
|
292
292
|
micError: a,
|
|
293
|
-
toggleMute:
|
|
294
|
-
setupMic:
|
|
295
|
-
attachRoom:
|
|
296
|
-
switchDevice:
|
|
297
|
-
teardownMic:
|
|
293
|
+
toggleMute: C,
|
|
294
|
+
setupMic: m,
|
|
295
|
+
attachRoom: D,
|
|
296
|
+
switchDevice: x,
|
|
297
|
+
teardownMic: y,
|
|
298
298
|
clearError: w,
|
|
299
|
-
getMicStream:
|
|
299
|
+
getMicStream: P
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
function
|
|
304
|
-
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c =
|
|
302
|
+
const Or = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
303
|
+
function Fr() {
|
|
304
|
+
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c = R(null), d = R(null), g = L((w) => {
|
|
305
305
|
c.current = w;
|
|
306
|
-
}, []), p =
|
|
306
|
+
}, []), p = L(() => {
|
|
307
307
|
var E;
|
|
308
|
-
const w = c.current,
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
308
|
+
const w = c.current, P = d.current;
|
|
309
|
+
if (P && w) {
|
|
310
|
+
const b = w.localParticipant.getTrackPublication(tr.Source.Camera), v = (b == null ? void 0 : b.track) ?? P;
|
|
311
311
|
try {
|
|
312
|
-
w.localParticipant.unpublishTrack(
|
|
312
|
+
w.localParticipant.unpublishTrack(v);
|
|
313
313
|
} catch {
|
|
314
314
|
}
|
|
315
315
|
try {
|
|
316
|
-
(E =
|
|
316
|
+
(E = v.stop) == null || E.call(v);
|
|
317
317
|
} catch {
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
|
|
321
|
-
}, []),
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
320
|
+
d.current = null, o(null), t(!1);
|
|
321
|
+
}, []), m = L(async (w) => {
|
|
322
|
+
const P = c.current;
|
|
323
|
+
if (P) {
|
|
324
324
|
i(null);
|
|
325
325
|
try {
|
|
326
|
-
const E = { ...
|
|
326
|
+
const E = { ...Or };
|
|
327
327
|
w && (E.deviceId = w);
|
|
328
|
-
const
|
|
329
|
-
await
|
|
330
|
-
const O =
|
|
328
|
+
const b = await Tr(E);
|
|
329
|
+
await P.localParticipant.publishTrack(b), d.current = b;
|
|
330
|
+
const O = b.attach();
|
|
331
331
|
o(O), t(!0), w && a(w);
|
|
332
332
|
try {
|
|
333
|
-
|
|
333
|
+
P.localParticipant.publishData(
|
|
334
334
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
335
335
|
{ reliable: !0 }
|
|
336
336
|
);
|
|
337
337
|
} catch {
|
|
338
338
|
}
|
|
339
339
|
} catch (E) {
|
|
340
|
-
const
|
|
341
|
-
i(
|
|
340
|
+
const b = E instanceof Error && E.name === "NotAllowedError" ? "Enable your camera in the browser to share video." : "Camera unavailable. Check permissions and try again.";
|
|
341
|
+
i(b);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
}, []),
|
|
345
|
-
e ? p() : await
|
|
346
|
-
}, [e, s, p,
|
|
347
|
-
p(), await
|
|
348
|
-
}, [p,
|
|
344
|
+
}, []), D = L(async () => {
|
|
345
|
+
e ? p() : await m(s || void 0);
|
|
346
|
+
}, [e, s, p, m]), x = L(async (w) => {
|
|
347
|
+
p(), await m(w);
|
|
348
|
+
}, [p, m]), C = L(() => {
|
|
349
349
|
p(), c.current = null, i(null), a("");
|
|
350
|
-
}, [p]),
|
|
350
|
+
}, [p]), y = L(() => i(null), []);
|
|
351
351
|
return I(() => () => {
|
|
352
|
-
|
|
352
|
+
d.current && d.current.stop();
|
|
353
353
|
}, []), {
|
|
354
354
|
isEnabled: e,
|
|
355
355
|
error: n,
|
|
356
356
|
previewEl: l,
|
|
357
357
|
activeDeviceId: s,
|
|
358
|
-
toggle:
|
|
359
|
-
switchDevice:
|
|
360
|
-
attachRoom:
|
|
361
|
-
teardown:
|
|
362
|
-
clearError:
|
|
358
|
+
toggle: D,
|
|
359
|
+
switchDevice: x,
|
|
360
|
+
attachRoom: g,
|
|
361
|
+
teardown: C,
|
|
362
|
+
clearError: y
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s =
|
|
367
|
-
s.current =
|
|
368
|
-
}, []), c =
|
|
369
|
-
const
|
|
370
|
-
if (
|
|
365
|
+
function Br() {
|
|
366
|
+
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = R(null), a = L((m) => {
|
|
367
|
+
s.current = m;
|
|
368
|
+
}, []), c = L(() => o(null), []), d = L(async () => {
|
|
369
|
+
const m = s.current;
|
|
370
|
+
if (m) {
|
|
371
371
|
if (e) {
|
|
372
372
|
try {
|
|
373
|
-
await
|
|
373
|
+
await m.localParticipant.setScreenShareEnabled(!1);
|
|
374
374
|
} catch {
|
|
375
375
|
}
|
|
376
376
|
c(), t(!1);
|
|
@@ -378,15 +378,15 @@ function Fr() {
|
|
|
378
378
|
}
|
|
379
379
|
i(null);
|
|
380
380
|
try {
|
|
381
|
-
await
|
|
382
|
-
let
|
|
383
|
-
const
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
const
|
|
387
|
-
o(
|
|
381
|
+
await m.localParticipant.setScreenShareEnabled(!0);
|
|
382
|
+
let D = 0;
|
|
383
|
+
const x = () => {
|
|
384
|
+
const C = m.localParticipant.getTrackPublication(tr.Source.ScreenShare);
|
|
385
|
+
if (C != null && C.track) {
|
|
386
|
+
const y = C.track.attach();
|
|
387
|
+
o(y), t(!0);
|
|
388
388
|
try {
|
|
389
|
-
|
|
389
|
+
m.localParticipant.publishData(
|
|
390
390
|
new TextEncoder().encode(JSON.stringify({ type: "user_screen_share_on" })),
|
|
391
391
|
{ reliable: !0 }
|
|
392
392
|
);
|
|
@@ -394,27 +394,27 @@ function Fr() {
|
|
|
394
394
|
}
|
|
395
395
|
return;
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
D++ < 10 ? setTimeout(x, 100) : t(!0);
|
|
398
398
|
};
|
|
399
|
-
|
|
400
|
-
} catch (
|
|
401
|
-
const
|
|
402
|
-
|
|
399
|
+
x();
|
|
400
|
+
} catch (D) {
|
|
401
|
+
const x = D instanceof Error ? D.name : "";
|
|
402
|
+
x !== "NotAllowedError" && x !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
}, [e, c]),
|
|
406
|
-
const
|
|
407
|
-
if (
|
|
405
|
+
}, [e, c]), g = L(() => {
|
|
406
|
+
const m = s.current;
|
|
407
|
+
if (m && e)
|
|
408
408
|
try {
|
|
409
|
-
|
|
409
|
+
m.localParticipant.setScreenShareEnabled(!1);
|
|
410
410
|
} catch {
|
|
411
411
|
}
|
|
412
412
|
c(), t(!1), i(null), s.current = null;
|
|
413
|
-
}, [e, c]), p =
|
|
414
|
-
return { isEnabled: e, error: n, previewEl: l, toggle:
|
|
413
|
+
}, [e, c]), p = L(() => i(null), []);
|
|
414
|
+
return { isEnabled: e, error: n, previewEl: l, toggle: d, attachRoom: a, teardown: g, clearError: p };
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
const [e, t] = M([]), [n, i] = M([]), l =
|
|
416
|
+
function Wr() {
|
|
417
|
+
const [e, t] = M([]), [n, i] = M([]), l = L(async () => {
|
|
418
418
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
419
419
|
try {
|
|
420
420
|
const o = await navigator.mediaDevices.enumerateDevices();
|
|
@@ -428,30 +428,30 @@ function Br() {
|
|
|
428
428
|
return navigator.mediaDevices.addEventListener("devicechange", o), () => navigator.mediaDevices.removeEventListener("devicechange", o);
|
|
429
429
|
}, [l]), { mics: e, cameras: n, refresh: l };
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function qr(e, t, n = !1) {
|
|
432
432
|
const [i, l] = M(null), [o, s] = M(null), [a, c] = M(!n && !!e);
|
|
433
433
|
return I(() => {
|
|
434
434
|
if (n || !e) {
|
|
435
435
|
c(!1);
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
438
|
-
const
|
|
439
|
-
return c(!0), s(null), fetch(`${
|
|
440
|
-
signal:
|
|
438
|
+
const d = new AbortController(), g = t || "https://app.livelayer.studio";
|
|
439
|
+
return c(!0), s(null), fetch(`${g}/api/widget/agent/${encodeURIComponent(e)}`, {
|
|
440
|
+
signal: d.signal
|
|
441
441
|
}).then(async (p) => {
|
|
442
442
|
if (!p.ok) {
|
|
443
|
-
const
|
|
444
|
-
throw new Error(
|
|
443
|
+
const m = await p.json().catch(() => ({}));
|
|
444
|
+
throw new Error(m.error || `HTTP ${p.status}`);
|
|
445
445
|
}
|
|
446
446
|
return p.json();
|
|
447
447
|
}).then((p) => {
|
|
448
|
-
|
|
448
|
+
d.signal.aborted || (l(p), c(!1));
|
|
449
449
|
}).catch((p) => {
|
|
450
|
-
|
|
451
|
-
}), () =>
|
|
450
|
+
d.signal.aborted || (s(p instanceof Error ? p.message : "Agent lookup failed"), c(!1));
|
|
451
|
+
}), () => d.abort();
|
|
452
452
|
}, [e, t, n]), { info: i, error: o, loading: a };
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function nr(e) {
|
|
455
455
|
if (typeof window > "u") return null;
|
|
456
456
|
try {
|
|
457
457
|
return window.localStorage.getItem(e);
|
|
@@ -459,26 +459,26 @@ function tr(e) {
|
|
|
459
459
|
return null;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function rr(e, t) {
|
|
463
463
|
if (!(typeof window > "u"))
|
|
464
464
|
try {
|
|
465
465
|
window.localStorage.setItem(e, t);
|
|
466
466
|
} catch {
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Ur(e) {
|
|
470
470
|
if (!(typeof window > "u"))
|
|
471
471
|
try {
|
|
472
472
|
window.localStorage.removeItem(e);
|
|
473
473
|
} catch {
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function jr({
|
|
477
477
|
value: e,
|
|
478
478
|
defaultValue: t = "expanded",
|
|
479
479
|
onChange: n
|
|
480
480
|
} = {}) {
|
|
481
|
-
const i = e !== void 0, [l, o] = M(t), s = i ? e : l, a =
|
|
481
|
+
const i = e !== void 0, [l, o] = M(t), s = i ? e : l, a = L(
|
|
482
482
|
(c) => {
|
|
483
483
|
c !== s && (i || o(c), n == null || n(c));
|
|
484
484
|
},
|
|
@@ -486,32 +486,32 @@ function Ur({
|
|
|
486
486
|
);
|
|
487
487
|
return [s, a];
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
function
|
|
491
|
-
return e &&
|
|
489
|
+
const Vr = ["hidden", "minimized", "expanded"];
|
|
490
|
+
function Yr(e) {
|
|
491
|
+
return e && Vr.includes(e) ? e : null;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Gr({
|
|
494
494
|
value: e,
|
|
495
495
|
defaultValue: t = "expanded",
|
|
496
496
|
onChange: n,
|
|
497
497
|
persistKey: i = "ll-widget",
|
|
498
498
|
disablePersistence: l = !1
|
|
499
499
|
} = {}) {
|
|
500
|
-
const o = `${i}:display-mode`, s =
|
|
500
|
+
const o = `${i}:display-mode`, s = R(!1), [a, c] = jr({
|
|
501
501
|
value: e,
|
|
502
502
|
defaultValue: t,
|
|
503
|
-
onChange: (
|
|
504
|
-
e === void 0 && !l &&
|
|
503
|
+
onChange: (d) => {
|
|
504
|
+
e === void 0 && !l && rr(o, d), n == null || n(d);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
507
|
return I(() => {
|
|
508
508
|
if (s.current || (s.current = !0, l || e !== void 0)) return;
|
|
509
|
-
const
|
|
510
|
-
|
|
509
|
+
const d = Yr(nr(o));
|
|
510
|
+
d && d !== a && c(d);
|
|
511
511
|
}, []), [a, c];
|
|
512
512
|
}
|
|
513
|
-
const
|
|
514
|
-
function
|
|
513
|
+
const Xr = 640;
|
|
514
|
+
function Kr(e = Xr) {
|
|
515
515
|
const [t, n] = M(!1);
|
|
516
516
|
return I(() => {
|
|
517
517
|
if (e === !1) {
|
|
@@ -526,11 +526,11 @@ function Xr(e = Gr) {
|
|
|
526
526
|
});
|
|
527
527
|
}, [e]), t;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
function
|
|
529
|
+
const Jr = 280, Zr = 380, Qr = 8, ei = 4;
|
|
530
|
+
function Kt(e) {
|
|
531
531
|
return `${e}:geometry`;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function ti(e) {
|
|
534
534
|
if (!e) return null;
|
|
535
535
|
let t;
|
|
536
536
|
try {
|
|
@@ -542,69 +542,69 @@ function ei(e) {
|
|
|
542
542
|
const n = t, { top: i, left: l, width: o, height: s } = n;
|
|
543
543
|
return typeof i != "number" || typeof l != "number" || typeof o != "number" || typeof s != "number" || !Number.isFinite(i) || !Number.isFinite(l) || !Number.isFinite(o) || !Number.isFinite(s) ? null : { top: i, left: l, width: o, height: s };
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function Ht() {
|
|
546
546
|
return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
const { minWidth: i, minHeight: l, edgeMargin: o, vw: s, vh: a } = n, c = Math.max(i, s - o * 2),
|
|
548
|
+
function Jt(e, t, n) {
|
|
549
|
+
const { minWidth: i, minHeight: l, edgeMargin: o, vw: s, vh: a } = n, c = Math.max(i, s - o * 2), d = Math.max(l, a - o * 2);
|
|
550
550
|
return {
|
|
551
551
|
width: Math.max(i, Math.min(c, e)),
|
|
552
|
-
height: Math.max(l, Math.min(
|
|
552
|
+
height: Math.max(l, Math.min(d, t))
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
const { edgeMargin: o, vw: s, vh: a } = l, c = o,
|
|
555
|
+
function Zt(e, t, n, i, l) {
|
|
556
|
+
const { edgeMargin: o, vw: s, vh: a } = l, c = o, d = o, g = Math.max(c, s - n - o), p = Math.max(d, a - i - o);
|
|
557
557
|
return {
|
|
558
|
-
top: Math.max(
|
|
559
|
-
left: Math.max(c, Math.min(
|
|
558
|
+
top: Math.max(d, Math.min(p, e)),
|
|
559
|
+
left: Math.max(c, Math.min(g, t))
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function ni(e) {
|
|
563
563
|
const {
|
|
564
564
|
draggable: t,
|
|
565
565
|
resizable: n,
|
|
566
566
|
persistKey: i,
|
|
567
567
|
disablePersistence: l,
|
|
568
|
-
minWidth: o =
|
|
569
|
-
minHeight: s =
|
|
570
|
-
edgeMargin: a =
|
|
571
|
-
} = e, [c,
|
|
568
|
+
minWidth: o = Jr,
|
|
569
|
+
minHeight: s = Zr,
|
|
570
|
+
edgeMargin: a = Qr
|
|
571
|
+
} = e, [c, d] = M(null), [g, p] = M(!1), [m, D] = M(!1), x = R(null), C = R(null), y = R(!1), w = R(null);
|
|
572
572
|
w.current = c;
|
|
573
|
-
const
|
|
573
|
+
const P = L(
|
|
574
574
|
(f) => {
|
|
575
|
-
l || (f === null ?
|
|
575
|
+
l || (f === null ? Ur(Kt(i)) : rr(Kt(i), JSON.stringify(f)));
|
|
576
576
|
},
|
|
577
577
|
[l, i]
|
|
578
578
|
);
|
|
579
579
|
I(() => {
|
|
580
|
-
if (
|
|
581
|
-
const f =
|
|
580
|
+
if (y.current || (y.current = !0, l)) return;
|
|
581
|
+
const f = ti(nr(Kt(i)));
|
|
582
582
|
if (!f) return;
|
|
583
|
-
const { vw: A, vh: $ } =
|
|
583
|
+
const { vw: A, vh: $ } = Ht(), q = Jt(f.width, f.height, {
|
|
584
584
|
minWidth: o,
|
|
585
585
|
minHeight: s,
|
|
586
586
|
edgeMargin: a,
|
|
587
587
|
vw: A,
|
|
588
588
|
vh: $
|
|
589
|
-
}), X =
|
|
589
|
+
}), X = Zt(f.top, f.left, q.width, q.height, {
|
|
590
590
|
edgeMargin: a,
|
|
591
591
|
vw: A,
|
|
592
592
|
vh: $
|
|
593
593
|
});
|
|
594
|
-
|
|
594
|
+
d({ ...X, ...q });
|
|
595
595
|
}, []), I(() => {
|
|
596
596
|
if (typeof window > "u") return;
|
|
597
597
|
const f = () => {
|
|
598
|
-
|
|
598
|
+
d((A) => {
|
|
599
599
|
if (A === null) return null;
|
|
600
|
-
const { vw: $, vh: q } =
|
|
600
|
+
const { vw: $, vh: q } = Ht(), X = Jt(A.width, A.height, {
|
|
601
601
|
minWidth: o,
|
|
602
602
|
minHeight: s,
|
|
603
603
|
edgeMargin: a,
|
|
604
604
|
vw: $,
|
|
605
605
|
vh: q
|
|
606
606
|
});
|
|
607
|
-
return { ...
|
|
607
|
+
return { ...Zt(A.top, A.left, X.width, X.height, {
|
|
608
608
|
edgeMargin: a,
|
|
609
609
|
vw: $,
|
|
610
610
|
vh: q
|
|
@@ -613,120 +613,120 @@ function ti(e) {
|
|
|
613
613
|
};
|
|
614
614
|
return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
|
|
615
615
|
}, [o, s, a]);
|
|
616
|
-
const E =
|
|
616
|
+
const E = L(
|
|
617
617
|
(f) => {
|
|
618
618
|
if (!t || f.pointerType === "mouse" && f.button !== 0) return;
|
|
619
619
|
const A = f.target;
|
|
620
620
|
if (A && typeof A.closest == "function" && A.closest('button, a, input, select, textarea, [role="listbox"], [role="option"], [data-ll-no-drag]'))
|
|
621
621
|
return;
|
|
622
|
-
let $, q, X,
|
|
622
|
+
let $, q, X, te;
|
|
623
623
|
const W = w.current;
|
|
624
624
|
if (W)
|
|
625
|
-
({ top: $, left: q, width: X, height:
|
|
625
|
+
({ top: $, left: q, width: X, height: te } = W);
|
|
626
626
|
else {
|
|
627
|
-
const
|
|
627
|
+
const ne = f.currentTarget.closest(".ll-widget"), ie = ne == null ? void 0 : ne.getBoundingClientRect();
|
|
628
628
|
if (!ie) return;
|
|
629
|
-
$ = ie.top, q = ie.left, X = ie.width,
|
|
629
|
+
$ = ie.top, q = ie.left, X = ie.width, te = ie.height;
|
|
630
630
|
}
|
|
631
631
|
try {
|
|
632
632
|
f.currentTarget.setPointerCapture(f.pointerId);
|
|
633
633
|
} catch {
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
x.current = {
|
|
636
636
|
startClientX: f.clientX,
|
|
637
637
|
startClientY: f.clientY,
|
|
638
638
|
startTop: $,
|
|
639
639
|
startLeft: q,
|
|
640
640
|
width: X,
|
|
641
|
-
height:
|
|
641
|
+
height: te,
|
|
642
642
|
moved: !1
|
|
643
643
|
};
|
|
644
644
|
},
|
|
645
645
|
[t]
|
|
646
|
-
),
|
|
646
|
+
), b = L(
|
|
647
647
|
(f) => {
|
|
648
|
-
const A =
|
|
648
|
+
const A = x.current;
|
|
649
649
|
if (!A) return;
|
|
650
650
|
const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY;
|
|
651
|
-
if (!A.moved && Math.abs($) + Math.abs(q) >
|
|
652
|
-
const { vw: X, vh:
|
|
651
|
+
if (!A.moved && Math.abs($) + Math.abs(q) > ei && (A.moved = !0, p(!0)), !A.moved) return;
|
|
652
|
+
const { vw: X, vh: te } = Ht(), W = Zt(
|
|
653
653
|
A.startTop + q,
|
|
654
654
|
A.startLeft + $,
|
|
655
655
|
A.width,
|
|
656
656
|
A.height,
|
|
657
|
-
{ edgeMargin: a, vw: X, vh:
|
|
657
|
+
{ edgeMargin: a, vw: X, vh: te }
|
|
658
658
|
);
|
|
659
|
-
|
|
659
|
+
d({ ...W, width: A.width, height: A.height });
|
|
660
660
|
},
|
|
661
661
|
[a]
|
|
662
|
-
), O =
|
|
662
|
+
), O = L(
|
|
663
663
|
(f) => {
|
|
664
|
-
const A =
|
|
664
|
+
const A = x.current;
|
|
665
665
|
if (A) {
|
|
666
666
|
try {
|
|
667
667
|
f.currentTarget.releasePointerCapture(f.pointerId);
|
|
668
668
|
} catch {
|
|
669
669
|
}
|
|
670
|
-
|
|
670
|
+
x.current = null, A.moved && (p(!1), d(($) => ($ && P($), $)));
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
|
-
[
|
|
674
|
-
),
|
|
675
|
-
|
|
676
|
-
}, [
|
|
673
|
+
[P]
|
|
674
|
+
), v = L(() => {
|
|
675
|
+
x.current = null, C.current = null, p(!1), D(!1), d(null), P(null);
|
|
676
|
+
}, [P]), z = L(
|
|
677
677
|
(f) => {
|
|
678
678
|
if (!n || f.pointerType === "mouse" && f.button !== 0) return;
|
|
679
679
|
f.stopPropagation();
|
|
680
680
|
let A, $, q, X;
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
683
|
-
({ top: A, left: $, width: q, height: X } =
|
|
681
|
+
const te = w.current;
|
|
682
|
+
if (te)
|
|
683
|
+
({ top: A, left: $, width: q, height: X } = te);
|
|
684
684
|
else {
|
|
685
|
-
const W = f.currentTarget.closest(".ll-widget"),
|
|
686
|
-
if (!
|
|
687
|
-
A =
|
|
685
|
+
const W = f.currentTarget.closest(".ll-widget"), ne = W == null ? void 0 : W.getBoundingClientRect();
|
|
686
|
+
if (!ne) return;
|
|
687
|
+
A = ne.top, $ = ne.left, q = ne.width, X = ne.height;
|
|
688
688
|
}
|
|
689
689
|
try {
|
|
690
690
|
f.currentTarget.setPointerCapture(f.pointerId);
|
|
691
691
|
} catch {
|
|
692
692
|
}
|
|
693
|
-
|
|
693
|
+
C.current = {
|
|
694
694
|
startClientX: f.clientX,
|
|
695
695
|
startClientY: f.clientY,
|
|
696
696
|
startWidth: q,
|
|
697
697
|
startHeight: X,
|
|
698
698
|
top: A,
|
|
699
699
|
left: $
|
|
700
|
-
},
|
|
700
|
+
}, D(!0);
|
|
701
701
|
},
|
|
702
702
|
[n]
|
|
703
|
-
), B =
|
|
703
|
+
), B = L(
|
|
704
704
|
(f) => {
|
|
705
|
-
const A =
|
|
705
|
+
const A = C.current;
|
|
706
706
|
if (!A) return;
|
|
707
|
-
const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY, { vw: X, vh:
|
|
707
|
+
const $ = f.clientX - A.startClientX, q = f.clientY - A.startClientY, { vw: X, vh: te } = Ht(), W = X - A.left - a, ne = te - A.top - a, ie = Jt(A.startWidth + $, A.startHeight + q, {
|
|
708
708
|
minWidth: o,
|
|
709
709
|
minHeight: s,
|
|
710
710
|
edgeMargin: a,
|
|
711
711
|
// Clamp the available viewport to the room from the anchored corner
|
|
712
712
|
// so the widget can't grow past the bottom/right edge.
|
|
713
713
|
vw: Math.min(X, A.left + W + a),
|
|
714
|
-
vh: Math.min(
|
|
714
|
+
vh: Math.min(te, A.top + ne + a)
|
|
715
715
|
});
|
|
716
|
-
|
|
716
|
+
d({ top: A.top, left: A.left, ...ie });
|
|
717
717
|
},
|
|
718
718
|
[a, o, s]
|
|
719
|
-
), J =
|
|
719
|
+
), J = L(
|
|
720
720
|
(f) => {
|
|
721
|
-
if (
|
|
721
|
+
if (C.current) {
|
|
722
722
|
try {
|
|
723
723
|
f.currentTarget.releasePointerCapture(f.pointerId);
|
|
724
724
|
} catch {
|
|
725
725
|
}
|
|
726
|
-
|
|
726
|
+
C.current = null, D(!1), d(($) => ($ && P($), $));
|
|
727
727
|
}
|
|
728
728
|
},
|
|
729
|
-
[
|
|
729
|
+
[P]
|
|
730
730
|
);
|
|
731
731
|
return {
|
|
732
732
|
style: c === null ? {} : {
|
|
@@ -739,14 +739,14 @@ function ti(e) {
|
|
|
739
739
|
height: `${c.height}px`
|
|
740
740
|
},
|
|
741
741
|
hasGeometry: c !== null,
|
|
742
|
-
isDragging:
|
|
743
|
-
isResizing:
|
|
742
|
+
isDragging: g,
|
|
743
|
+
isResizing: m,
|
|
744
744
|
dragHandleProps: {
|
|
745
745
|
onPointerDown: E,
|
|
746
|
-
onPointerMove:
|
|
746
|
+
onPointerMove: b,
|
|
747
747
|
onPointerUp: O,
|
|
748
748
|
onPointerCancel: O,
|
|
749
|
-
onDoubleClick:
|
|
749
|
+
onDoubleClick: v,
|
|
750
750
|
"data-ll-drag-handle": t ? "" : void 0
|
|
751
751
|
},
|
|
752
752
|
resizeHandleProps: {
|
|
@@ -756,78 +756,78 @@ function ti(e) {
|
|
|
756
756
|
onPointerCancel: J,
|
|
757
757
|
"data-ll-resize-handle": n ? "" : void 0
|
|
758
758
|
},
|
|
759
|
-
reset:
|
|
759
|
+
reset: v
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
function
|
|
764
|
-
if (typeof window > "u" || window.history[
|
|
762
|
+
const Mn = "__llHistoryPatched", Bt = "ll:pathname";
|
|
763
|
+
function ri() {
|
|
764
|
+
if (typeof window > "u" || window.history[Mn]) return;
|
|
765
765
|
const e = window.history.pushState, t = window.history.replaceState;
|
|
766
766
|
window.history.pushState = function(...n) {
|
|
767
767
|
const i = e.apply(this, n);
|
|
768
|
-
return window.dispatchEvent(new Event(
|
|
768
|
+
return window.dispatchEvent(new Event(Bt)), i;
|
|
769
769
|
}, window.history.replaceState = function(...n) {
|
|
770
770
|
const i = t.apply(this, n);
|
|
771
|
-
return window.dispatchEvent(new Event(
|
|
772
|
-
}, window.history[
|
|
771
|
+
return window.dispatchEvent(new Event(Bt)), i;
|
|
772
|
+
}, window.history[Mn] = !0;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function In() {
|
|
775
775
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function ii(e) {
|
|
778
778
|
const [t, n] = M(
|
|
779
|
-
() => e ??
|
|
779
|
+
() => e ?? In()
|
|
780
780
|
);
|
|
781
781
|
return I(() => {
|
|
782
782
|
if (e !== void 0) return;
|
|
783
|
-
|
|
784
|
-
const i = () => n(
|
|
785
|
-
return i(), window.addEventListener("popstate", i), window.addEventListener(
|
|
786
|
-
window.removeEventListener("popstate", i), window.removeEventListener(
|
|
783
|
+
ri();
|
|
784
|
+
const i = () => n(In());
|
|
785
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(Bt, i), () => {
|
|
786
|
+
window.removeEventListener("popstate", i), window.removeEventListener(Bt, i);
|
|
787
787
|
};
|
|
788
788
|
}, [e]), e ?? t;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
791
|
-
function oi(e) {
|
|
792
|
-
return e.replace(ii, "\\$&");
|
|
793
|
-
}
|
|
790
|
+
const Rn = /* @__PURE__ */ new Map(), oi = /[\\^$+?.()|{}[\]]/g;
|
|
794
791
|
function li(e) {
|
|
795
|
-
|
|
792
|
+
return e.replace(oi, "\\$&");
|
|
793
|
+
}
|
|
794
|
+
function ai(e) {
|
|
795
|
+
const t = Rn.get(e);
|
|
796
796
|
if (t) return t;
|
|
797
|
-
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", l = "", o = n.replace(/\*\*/g, i).replace(/\*/g, l), a =
|
|
798
|
-
return
|
|
797
|
+
const n = e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e, i = "", l = "", o = n.replace(/\*\*/g, i).replace(/\*/g, l), a = li(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
|
|
798
|
+
return Rn.set(e, c), c;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function si(e, t) {
|
|
801
801
|
const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
802
|
-
return
|
|
802
|
+
return ai(e).test(n);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
804
|
+
function ci(e, t) {
|
|
805
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : si(e, t);
|
|
806
806
|
}
|
|
807
807
|
function Tn(e, t) {
|
|
808
808
|
if (!e || e.length === 0) return !1;
|
|
809
809
|
for (const n of e)
|
|
810
|
-
if (
|
|
810
|
+
if (ci(n, t)) return !0;
|
|
811
811
|
return !1;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function ui(e, t, n) {
|
|
814
814
|
return e === void 0 ? !0 : Tn(n, e) ? !1 : t && t.length > 0 ? Tn(t, e) : !0;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function di(e, t, n) {
|
|
817
817
|
return at(
|
|
818
|
-
() =>
|
|
818
|
+
() => ui(e, t, n),
|
|
819
819
|
[e, t, n]
|
|
820
820
|
);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function fi(e) {
|
|
823
823
|
return e === !1 ? { navigate: !1, thinking: !1, action: !1 } : e === void 0 || e === !0 ? { navigate: !0, thinking: !0, action: !0 } : {
|
|
824
824
|
navigate: e.navigate !== !1,
|
|
825
825
|
thinking: e.thinking !== !1,
|
|
826
826
|
action: e.action !== !1
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
const t = at(() =>
|
|
829
|
+
function pi(e) {
|
|
830
|
+
const t = at(() => fi(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = R(null), l = L(
|
|
831
831
|
(c) => {
|
|
832
832
|
try {
|
|
833
833
|
new Audio(`${n}${c}`).play().catch(() => {
|
|
@@ -836,11 +836,11 @@ function fi(e) {
|
|
|
836
836
|
}
|
|
837
837
|
},
|
|
838
838
|
[n]
|
|
839
|
-
), o =
|
|
839
|
+
), o = L(() => {
|
|
840
840
|
t.navigate && l("/audio/page-change-sound.mp3");
|
|
841
|
-
}, [t.navigate, l]), s =
|
|
841
|
+
}, [t.navigate, l]), s = L(() => {
|
|
842
842
|
t.action && l("/audio/confirmation-sound.mp3");
|
|
843
|
-
}, [t.action, l]), a =
|
|
843
|
+
}, [t.action, l]), a = L(
|
|
844
844
|
(c) => {
|
|
845
845
|
if (!t.thinking) {
|
|
846
846
|
if (i.current) {
|
|
@@ -855,10 +855,10 @@ function fi(e) {
|
|
|
855
855
|
if (c) {
|
|
856
856
|
if (i.current) return;
|
|
857
857
|
try {
|
|
858
|
-
const
|
|
859
|
-
|
|
858
|
+
const d = new Audio(`${n}/audio/thinking-sound.mp3`);
|
|
859
|
+
d.loop = !0, d.volume = 0.3, d.play().catch(() => {
|
|
860
860
|
i.current = null;
|
|
861
|
-
}), i.current =
|
|
861
|
+
}), i.current = d;
|
|
862
862
|
} catch {
|
|
863
863
|
}
|
|
864
864
|
} else if (i.current) {
|
|
@@ -884,7 +884,7 @@ function fi(e) {
|
|
|
884
884
|
[o, s, a]
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
|
-
const
|
|
887
|
+
const Pn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
888
888
|
"svg",
|
|
889
889
|
{
|
|
890
890
|
className: t,
|
|
@@ -948,7 +948,7 @@ const Rn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
948
948
|
}
|
|
949
949
|
)
|
|
950
950
|
}
|
|
951
|
-
),
|
|
951
|
+
), hi = ({ className: e }) => /* @__PURE__ */ r(
|
|
952
952
|
"svg",
|
|
953
953
|
{
|
|
954
954
|
className: e,
|
|
@@ -959,12 +959,12 @@ const Rn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
959
959
|
"aria-hidden": "true",
|
|
960
960
|
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
961
961
|
}
|
|
962
|
-
),
|
|
962
|
+
), mi = {
|
|
963
963
|
left: 180,
|
|
964
964
|
right: 0,
|
|
965
965
|
up: -90,
|
|
966
966
|
down: 90
|
|
967
|
-
},
|
|
967
|
+
}, zn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
|
|
968
968
|
"svg",
|
|
969
969
|
{
|
|
970
970
|
className: t,
|
|
@@ -972,19 +972,19 @@ const Rn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
972
972
|
viewBox: "0 0 24 24",
|
|
973
973
|
stroke: "currentColor",
|
|
974
974
|
strokeWidth: 2,
|
|
975
|
-
style: { transform: `rotate(${
|
|
975
|
+
style: { transform: `rotate(${mi[e]}deg)` },
|
|
976
976
|
"aria-hidden": "true",
|
|
977
977
|
children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" })
|
|
978
978
|
}
|
|
979
979
|
);
|
|
980
|
-
function
|
|
980
|
+
function gi(e) {
|
|
981
981
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
982
982
|
}
|
|
983
|
-
const
|
|
984
|
-
function
|
|
983
|
+
const ir = "ll-hidden-tab-center-y", yi = 5, $n = 16;
|
|
984
|
+
function vi() {
|
|
985
985
|
if (typeof window > "u") return null;
|
|
986
986
|
try {
|
|
987
|
-
const e = window.localStorage.getItem(
|
|
987
|
+
const e = window.localStorage.getItem(ir);
|
|
988
988
|
if (!e) return null;
|
|
989
989
|
const t = Number.parseFloat(e);
|
|
990
990
|
return Number.isFinite(t) ? t : null;
|
|
@@ -992,14 +992,14 @@ function yi() {
|
|
|
992
992
|
return null;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function Hn(e) {
|
|
996
996
|
if (!(typeof window > "u"))
|
|
997
997
|
try {
|
|
998
|
-
window.localStorage.setItem(
|
|
998
|
+
window.localStorage.setItem(ir, String(e));
|
|
999
999
|
} catch {
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1002
|
+
const bi = ({
|
|
1003
1003
|
position: e,
|
|
1004
1004
|
isMobile: t,
|
|
1005
1005
|
isSpeaking: n,
|
|
@@ -1009,50 +1009,50 @@ const vi = ({
|
|
|
1009
1009
|
agentName: s,
|
|
1010
1010
|
containerEl: a
|
|
1011
1011
|
}) => {
|
|
1012
|
-
const c =
|
|
1012
|
+
const c = gi(e), d = c === "right" ? "left" : "right", g = t ? 80 : 72, p = !!o, m = !!a, [D, x] = M(null), [C, y] = M(!1), w = R(null), P = R(!1), E = L(
|
|
1013
1013
|
(H) => {
|
|
1014
1014
|
if (typeof window > "u") return H;
|
|
1015
|
-
const G =
|
|
1015
|
+
const G = g / 2, f = $n + G, A = window.innerHeight - $n - G;
|
|
1016
1016
|
return A < f ? Math.max(f, H) : Math.max(f, Math.min(A, H));
|
|
1017
1017
|
},
|
|
1018
|
-
[
|
|
1018
|
+
[g]
|
|
1019
1019
|
);
|
|
1020
1020
|
I(() => {
|
|
1021
|
-
if (
|
|
1022
|
-
|
|
1021
|
+
if (m) {
|
|
1022
|
+
x(null);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
|
-
const H =
|
|
1026
|
-
|
|
1025
|
+
const H = vi();
|
|
1026
|
+
x(E(H ?? window.innerHeight / 2));
|
|
1027
1027
|
const G = () => {
|
|
1028
|
-
|
|
1028
|
+
x((f) => f === null ? null : E(f));
|
|
1029
1029
|
};
|
|
1030
1030
|
return window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
|
|
1031
|
-
}, [E,
|
|
1032
|
-
const
|
|
1031
|
+
}, [E, m]);
|
|
1032
|
+
const b = L(
|
|
1033
1033
|
(H) => {
|
|
1034
|
-
if (!
|
|
1034
|
+
if (!m && !(H.pointerType === "mouse" && H.button !== 0) && D !== null) {
|
|
1035
1035
|
try {
|
|
1036
1036
|
H.currentTarget.setPointerCapture(H.pointerId);
|
|
1037
1037
|
} catch {
|
|
1038
1038
|
}
|
|
1039
1039
|
w.current = {
|
|
1040
1040
|
startClientY: H.clientY,
|
|
1041
|
-
startCenterY:
|
|
1041
|
+
startCenterY: D,
|
|
1042
1042
|
moved: !1
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
1045
|
},
|
|
1046
|
-
[
|
|
1047
|
-
), O =
|
|
1046
|
+
[D, m]
|
|
1047
|
+
), O = L(
|
|
1048
1048
|
(H) => {
|
|
1049
1049
|
const G = w.current;
|
|
1050
1050
|
if (!G) return;
|
|
1051
1051
|
const f = H.clientY - G.startClientY;
|
|
1052
|
-
!G.moved && Math.abs(f) >
|
|
1052
|
+
!G.moved && Math.abs(f) > yi && (G.moved = !0, y(!0)), G.moved && x(E(G.startCenterY + f));
|
|
1053
1053
|
},
|
|
1054
1054
|
[E]
|
|
1055
|
-
),
|
|
1055
|
+
), v = L(
|
|
1056
1056
|
(H) => {
|
|
1057
1057
|
const G = w.current;
|
|
1058
1058
|
if (G) {
|
|
@@ -1060,25 +1060,25 @@ const vi = ({
|
|
|
1060
1060
|
H.currentTarget.releasePointerCapture(H.pointerId);
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
}
|
|
1063
|
-
w.current = null, G.moved && (
|
|
1063
|
+
w.current = null, G.moved && (y(!1), P.current = !0, x((f) => (f !== null && Hn(f), f)));
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
[]
|
|
1067
|
-
), z =
|
|
1068
|
-
if (
|
|
1069
|
-
|
|
1067
|
+
), z = L(() => {
|
|
1068
|
+
if (P.current) {
|
|
1069
|
+
P.current = !1;
|
|
1070
1070
|
return;
|
|
1071
1071
|
}
|
|
1072
1072
|
i();
|
|
1073
|
-
}, [i]), B =
|
|
1073
|
+
}, [i]), B = L(
|
|
1074
1074
|
(H) => {
|
|
1075
1075
|
if (H.key === "ArrowUp" || H.key === "ArrowDown") {
|
|
1076
1076
|
H.preventDefault();
|
|
1077
1077
|
const G = H.key === "ArrowUp" ? -8 : 8;
|
|
1078
|
-
|
|
1078
|
+
x((f) => {
|
|
1079
1079
|
if (f === null) return f;
|
|
1080
1080
|
const A = E(f + G);
|
|
1081
|
-
return
|
|
1081
|
+
return Hn(A), A;
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
},
|
|
@@ -1088,19 +1088,19 @@ const vi = ({
|
|
|
1088
1088
|
`ll-hidden--${c}`,
|
|
1089
1089
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
1090
1090
|
n ? "ll-hidden--speaking" : null,
|
|
1091
|
-
|
|
1091
|
+
C ? "is-dragging" : null,
|
|
1092
1092
|
p ? "ll-hidden--with-avatar" : null,
|
|
1093
|
-
|
|
1094
|
-
].filter(Boolean).join(" "), le =
|
|
1093
|
+
m ? "ll-hidden--scoped" : null
|
|
1094
|
+
].filter(Boolean).join(" "), le = D === null ? void 0 : { top: `${D - g / 2}px`, transform: "none" };
|
|
1095
1095
|
return /* @__PURE__ */ r(
|
|
1096
1096
|
"button",
|
|
1097
1097
|
{
|
|
1098
1098
|
type: "button",
|
|
1099
1099
|
className: J,
|
|
1100
|
-
onPointerDown:
|
|
1100
|
+
onPointerDown: b,
|
|
1101
1101
|
onPointerMove: O,
|
|
1102
|
-
onPointerUp:
|
|
1103
|
-
onPointerCancel:
|
|
1102
|
+
onPointerUp: v,
|
|
1103
|
+
onPointerCancel: v,
|
|
1104
1104
|
onClick: z,
|
|
1105
1105
|
onKeyDown: B,
|
|
1106
1106
|
"aria-label": l,
|
|
@@ -1113,9 +1113,9 @@ const vi = ({
|
|
|
1113
1113
|
// avatar-based experience" even when collapsed.
|
|
1114
1114
|
/* @__PURE__ */ S(Ve, { children: [
|
|
1115
1115
|
/* @__PURE__ */ r(
|
|
1116
|
-
|
|
1116
|
+
zn,
|
|
1117
1117
|
{
|
|
1118
|
-
direction:
|
|
1118
|
+
direction: d,
|
|
1119
1119
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
1120
1120
|
}
|
|
1121
1121
|
),
|
|
@@ -1130,15 +1130,15 @@ const vi = ({
|
|
|
1130
1130
|
)
|
|
1131
1131
|
] })
|
|
1132
1132
|
) : /* @__PURE__ */ r(
|
|
1133
|
-
|
|
1133
|
+
zn,
|
|
1134
1134
|
{
|
|
1135
|
-
direction:
|
|
1135
|
+
direction: d,
|
|
1136
1136
|
className: "ll-hidden__chevron"
|
|
1137
1137
|
}
|
|
1138
1138
|
)
|
|
1139
1139
|
}
|
|
1140
1140
|
);
|
|
1141
|
-
},
|
|
1141
|
+
}, wi = ({
|
|
1142
1142
|
audioLevel: e,
|
|
1143
1143
|
bars: t = 20,
|
|
1144
1144
|
maxHeight: n = 20,
|
|
@@ -1146,31 +1146,31 @@ const vi = ({
|
|
|
1146
1146
|
className: l,
|
|
1147
1147
|
barClassName: o
|
|
1148
1148
|
}) => {
|
|
1149
|
-
const s =
|
|
1150
|
-
const
|
|
1151
|
-
return Array.from({ length: t }, (p,
|
|
1149
|
+
const s = R(null), a = R([]), c = at(() => {
|
|
1150
|
+
const g = (Math.sqrt(5) - 1) / 2;
|
|
1151
|
+
return Array.from({ length: t }, (p, m) => 0.5 + m * g % 1 * 0.5);
|
|
1152
1152
|
}, [t]);
|
|
1153
1153
|
I(() => e.subscribe((p) => {
|
|
1154
|
-
for (let
|
|
1155
|
-
const
|
|
1156
|
-
if (!
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1154
|
+
for (let m = 0; m < t; m++) {
|
|
1155
|
+
const D = a.current[m];
|
|
1156
|
+
if (!D) continue;
|
|
1157
|
+
const x = Math.max(i, p * n * c[m]);
|
|
1158
|
+
D.style.height = `${x}px`;
|
|
1159
1159
|
}
|
|
1160
1160
|
}), [e, t, n, i, c]);
|
|
1161
|
-
const
|
|
1162
|
-
return /* @__PURE__ */ r("div", { ref: s, className:
|
|
1161
|
+
const d = ["ll-waveform", l].filter(Boolean).join(" ");
|
|
1162
|
+
return /* @__PURE__ */ r("div", { ref: s, className: d, "aria-hidden": "true", children: Array.from({ length: t }, (g, p) => /* @__PURE__ */ r(
|
|
1163
1163
|
"div",
|
|
1164
1164
|
{
|
|
1165
|
-
ref: (
|
|
1166
|
-
a.current[p] =
|
|
1165
|
+
ref: (m) => {
|
|
1166
|
+
a.current[p] = m;
|
|
1167
1167
|
},
|
|
1168
1168
|
className: ["ll-waveform__bar", o].filter(Boolean).join(" "),
|
|
1169
1169
|
style: { height: `${i}px` }
|
|
1170
1170
|
},
|
|
1171
1171
|
p
|
|
1172
1172
|
)) });
|
|
1173
|
-
},
|
|
1173
|
+
}, _i = ({
|
|
1174
1174
|
position: e,
|
|
1175
1175
|
isMobile: t,
|
|
1176
1176
|
agentName: n,
|
|
@@ -1180,7 +1180,7 @@ const vi = ({
|
|
|
1180
1180
|
audioLevel: s,
|
|
1181
1181
|
onExpand: a,
|
|
1182
1182
|
onToggleMute: c,
|
|
1183
|
-
onClose:
|
|
1183
|
+
onClose: d
|
|
1184
1184
|
}) => t ? /* @__PURE__ */ r(
|
|
1185
1185
|
"div",
|
|
1186
1186
|
{
|
|
@@ -1207,7 +1207,7 @@ const vi = ({
|
|
|
1207
1207
|
)
|
|
1208
1208
|
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1209
1209
|
/* @__PURE__ */ r(
|
|
1210
|
-
|
|
1210
|
+
wi,
|
|
1211
1211
|
{
|
|
1212
1212
|
audioLevel: s,
|
|
1213
1213
|
bars: 16,
|
|
@@ -1223,14 +1223,14 @@ const vi = ({
|
|
|
1223
1223
|
className: "ll-minimized__btn",
|
|
1224
1224
|
role: "button",
|
|
1225
1225
|
tabIndex: 0,
|
|
1226
|
-
onClick: (
|
|
1227
|
-
|
|
1226
|
+
onClick: (g) => {
|
|
1227
|
+
g.stopPropagation(), c();
|
|
1228
1228
|
},
|
|
1229
|
-
onKeyDown: (
|
|
1230
|
-
(
|
|
1229
|
+
onKeyDown: (g) => {
|
|
1230
|
+
(g.key === "Enter" || g.key === " ") && (g.stopPropagation(), g.preventDefault(), c());
|
|
1231
1231
|
},
|
|
1232
1232
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1233
|
-
children: /* @__PURE__ */ r(
|
|
1233
|
+
children: /* @__PURE__ */ r(Pn, { muted: o, className: "ll-minimized__icon" })
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
1236
|
/* @__PURE__ */ r(Dn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
@@ -1270,7 +1270,7 @@ const vi = ({
|
|
|
1270
1270
|
className: "ll-minimized__btn",
|
|
1271
1271
|
onClick: c,
|
|
1272
1272
|
"aria-label": o ? "Unmute microphone" : "Mute microphone",
|
|
1273
|
-
children: /* @__PURE__ */ r(
|
|
1273
|
+
children: /* @__PURE__ */ r(Pn, { muted: o, className: "ll-minimized__icon" })
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
1276
|
/* @__PURE__ */ r(
|
|
@@ -1288,22 +1288,22 @@ const vi = ({
|
|
|
1288
1288
|
{
|
|
1289
1289
|
type: "button",
|
|
1290
1290
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
1291
|
-
onClick:
|
|
1291
|
+
onClick: d,
|
|
1292
1292
|
"aria-label": "Close widget",
|
|
1293
|
-
children: /* @__PURE__ */ r(
|
|
1293
|
+
children: /* @__PURE__ */ r(hi, { className: "ll-minimized__icon" })
|
|
1294
1294
|
}
|
|
1295
1295
|
)
|
|
1296
1296
|
] })
|
|
1297
1297
|
] })
|
|
1298
1298
|
}
|
|
1299
|
-
),
|
|
1299
|
+
), xi = ({
|
|
1300
1300
|
src: e,
|
|
1301
1301
|
alt: t,
|
|
1302
1302
|
preCannedPlaying: n = !1,
|
|
1303
1303
|
className: i,
|
|
1304
1304
|
style: l
|
|
1305
1305
|
}) => {
|
|
1306
|
-
const [o, s] = M(!1), a =
|
|
1306
|
+
const [o, s] = M(!1), a = R(e);
|
|
1307
1307
|
if (I(() => {
|
|
1308
1308
|
a.current !== e && (a.current = e, s(!1));
|
|
1309
1309
|
}, [e]), !e) return null;
|
|
@@ -1334,11 +1334,11 @@ const vi = ({
|
|
|
1334
1334
|
}
|
|
1335
1335
|
)
|
|
1336
1336
|
);
|
|
1337
|
-
},
|
|
1337
|
+
}, ki = "#E06540";
|
|
1338
1338
|
function Li({
|
|
1339
1339
|
size: e = 14,
|
|
1340
1340
|
className: t,
|
|
1341
|
-
fill: n =
|
|
1341
|
+
fill: n = ki
|
|
1342
1342
|
}) {
|
|
1343
1343
|
return /* @__PURE__ */ S(
|
|
1344
1344
|
"svg",
|
|
@@ -1376,14 +1376,14 @@ function Li({
|
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
|
-
const Ci = 8,
|
|
1379
|
+
const Ci = 8, On = 8, Si = ({
|
|
1380
1380
|
open: e,
|
|
1381
1381
|
onClose: t,
|
|
1382
1382
|
anchorRef: n,
|
|
1383
1383
|
children: i
|
|
1384
1384
|
}) => {
|
|
1385
|
-
const l =
|
|
1386
|
-
return
|
|
1385
|
+
const l = R(null), [o, s] = M(null);
|
|
1386
|
+
return er(() => {
|
|
1387
1387
|
if (!e) {
|
|
1388
1388
|
s(null);
|
|
1389
1389
|
return;
|
|
@@ -1391,27 +1391,27 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1391
1391
|
const a = n.current;
|
|
1392
1392
|
if (!a) return;
|
|
1393
1393
|
const c = () => {
|
|
1394
|
-
const
|
|
1395
|
-
top:
|
|
1396
|
-
left:
|
|
1397
|
-
}, p =
|
|
1398
|
-
|
|
1394
|
+
const d = a.getBoundingClientRect(), g = {
|
|
1395
|
+
top: d.top - Ci,
|
|
1396
|
+
left: d.left + d.width / 2
|
|
1397
|
+
}, p = On + 90, m = window.innerWidth - On - 90;
|
|
1398
|
+
g.left < p && (g.left = p), g.left > m && (g.left = m), s(g);
|
|
1399
1399
|
};
|
|
1400
1400
|
return c(), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1401
1401
|
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
1402
1402
|
};
|
|
1403
1403
|
}, [e, n]), I(() => {
|
|
1404
1404
|
if (!e) return;
|
|
1405
|
-
const a = (
|
|
1406
|
-
const
|
|
1407
|
-
p && p.contains(
|
|
1408
|
-
}, c = (
|
|
1409
|
-
|
|
1405
|
+
const a = (d) => {
|
|
1406
|
+
const g = d.target, p = l.current, m = n.current;
|
|
1407
|
+
p && p.contains(g) || m && m.contains(g) || t();
|
|
1408
|
+
}, c = (d) => {
|
|
1409
|
+
d.key === "Escape" && (d.stopPropagation(), t());
|
|
1410
1410
|
};
|
|
1411
1411
|
return document.addEventListener("mousedown", a), document.addEventListener("keydown", c), () => {
|
|
1412
1412
|
document.removeEventListener("mousedown", a), document.removeEventListener("keydown", c);
|
|
1413
1413
|
};
|
|
1414
|
-
}, [e, t, n]), !e || o === null || typeof document > "u" ? null :
|
|
1414
|
+
}, [e, t, n]), !e || o === null || typeof document > "u" ? null : ln(
|
|
1415
1415
|
/* @__PURE__ */ r(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
@@ -1431,7 +1431,7 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1431
1431
|
),
|
|
1432
1432
|
document.body
|
|
1433
1433
|
);
|
|
1434
|
-
},
|
|
1434
|
+
}, Ei = ({
|
|
1435
1435
|
isMuted: e,
|
|
1436
1436
|
onToggleMute: t,
|
|
1437
1437
|
isCameraEnabled: n,
|
|
@@ -1441,13 +1441,13 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1441
1441
|
onToggleScreenShare: s,
|
|
1442
1442
|
allowScreenShare: a,
|
|
1443
1443
|
isSpeakerMuted: c,
|
|
1444
|
-
onToggleSpeaker:
|
|
1445
|
-
allowTyping:
|
|
1444
|
+
onToggleSpeaker: d,
|
|
1445
|
+
allowTyping: g,
|
|
1446
1446
|
isTypingOpen: p,
|
|
1447
|
-
onToggleTyping:
|
|
1448
|
-
onDisconnect:
|
|
1447
|
+
onToggleTyping: m,
|
|
1448
|
+
onDisconnect: D
|
|
1449
1449
|
}) => {
|
|
1450
|
-
const [
|
|
1450
|
+
const [x, C] = M(!1), y = R(null);
|
|
1451
1451
|
return /* @__PURE__ */ S(Ve, { children: [
|
|
1452
1452
|
/* @__PURE__ */ S(
|
|
1453
1453
|
"div",
|
|
@@ -1463,20 +1463,20 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1463
1463
|
className: `ll-tool ${e ? "is-muted" : ""}`,
|
|
1464
1464
|
onClick: t,
|
|
1465
1465
|
"aria-label": e ? "Unmute microphone" : "Mute microphone",
|
|
1466
|
-
children: /* @__PURE__ */ r(
|
|
1466
|
+
children: /* @__PURE__ */ r(ar, { muted: e })
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
1469
|
/* @__PURE__ */ r(
|
|
1470
1470
|
"button",
|
|
1471
1471
|
{
|
|
1472
|
-
ref:
|
|
1472
|
+
ref: y,
|
|
1473
1473
|
type: "button",
|
|
1474
|
-
className: `ll-tool ${
|
|
1475
|
-
onClick: () =>
|
|
1474
|
+
className: `ll-tool ${x ? "is-on" : ""}`,
|
|
1475
|
+
onClick: () => C((w) => !w),
|
|
1476
1476
|
"aria-label": "More controls",
|
|
1477
1477
|
"aria-haspopup": "menu",
|
|
1478
|
-
"aria-expanded":
|
|
1479
|
-
children: /* @__PURE__ */ r(
|
|
1478
|
+
"aria-expanded": x,
|
|
1479
|
+
children: /* @__PURE__ */ r(Ai, {})
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
1482
1482
|
/* @__PURE__ */ r(
|
|
@@ -1484,20 +1484,20 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1484
1484
|
{
|
|
1485
1485
|
type: "button",
|
|
1486
1486
|
className: "ll-tool ll-tool--danger",
|
|
1487
|
-
onClick:
|
|
1487
|
+
onClick: D,
|
|
1488
1488
|
"aria-label": "End conversation",
|
|
1489
|
-
children: /* @__PURE__ */ r(
|
|
1489
|
+
children: /* @__PURE__ */ r(cr, {})
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
1492
|
]
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
1495
|
/* @__PURE__ */ S(
|
|
1496
|
-
|
|
1496
|
+
Si,
|
|
1497
1497
|
{
|
|
1498
|
-
open:
|
|
1499
|
-
onClose: () =>
|
|
1500
|
-
anchorRef:
|
|
1498
|
+
open: x,
|
|
1499
|
+
onClose: () => C(!1),
|
|
1500
|
+
anchorRef: y,
|
|
1501
1501
|
children: [
|
|
1502
1502
|
l && /* @__PURE__ */ S(
|
|
1503
1503
|
"button",
|
|
@@ -1505,10 +1505,10 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1505
1505
|
type: "button",
|
|
1506
1506
|
className: `ll-overflow-popover__item ${n ? "is-on" : ""}`,
|
|
1507
1507
|
onClick: () => {
|
|
1508
|
-
i(),
|
|
1508
|
+
i(), C(!1);
|
|
1509
1509
|
},
|
|
1510
1510
|
children: [
|
|
1511
|
-
/* @__PURE__ */ r(
|
|
1511
|
+
/* @__PURE__ */ r(lr, {}),
|
|
1512
1512
|
/* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
@@ -1519,10 +1519,10 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1519
1519
|
type: "button",
|
|
1520
1520
|
className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
|
|
1521
1521
|
onClick: () => {
|
|
1522
|
-
s(),
|
|
1522
|
+
s(), C(!1);
|
|
1523
1523
|
},
|
|
1524
1524
|
children: [
|
|
1525
|
-
/* @__PURE__ */ r(
|
|
1525
|
+
/* @__PURE__ */ r(or, {}),
|
|
1526
1526
|
/* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
@@ -1533,24 +1533,24 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1533
1533
|
type: "button",
|
|
1534
1534
|
className: `ll-overflow-popover__item ${c ? "is-on" : ""}`,
|
|
1535
1535
|
onClick: () => {
|
|
1536
|
-
|
|
1536
|
+
d(), C(!1);
|
|
1537
1537
|
},
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */ r(
|
|
1539
|
+
/* @__PURE__ */ r(sr, { muted: c }),
|
|
1540
1540
|
/* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1541
1541
|
]
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
|
|
1544
|
+
g && /* @__PURE__ */ S(
|
|
1545
1545
|
"button",
|
|
1546
1546
|
{
|
|
1547
1547
|
type: "button",
|
|
1548
1548
|
className: `ll-overflow-popover__item ${p ? "is-on" : ""}`,
|
|
1549
1549
|
onClick: () => {
|
|
1550
|
-
|
|
1550
|
+
m(), C(!1);
|
|
1551
1551
|
},
|
|
1552
1552
|
children: [
|
|
1553
|
-
/* @__PURE__ */ r(
|
|
1553
|
+
/* @__PURE__ */ r(Ni, {}),
|
|
1554
1554
|
/* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
|
|
1555
1555
|
]
|
|
1556
1556
|
}
|
|
@@ -1573,7 +1573,7 @@ const Ci = 8, Hn = 8, ki = ({
|
|
|
1573
1573
|
)
|
|
1574
1574
|
] });
|
|
1575
1575
|
};
|
|
1576
|
-
function
|
|
1576
|
+
function Ai() {
|
|
1577
1577
|
return /* @__PURE__ */ S(
|
|
1578
1578
|
"svg",
|
|
1579
1579
|
{
|
|
@@ -1590,7 +1590,7 @@ function Ei() {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function Ni() {
|
|
1594
1594
|
return /* @__PURE__ */ r(
|
|
1595
1595
|
"svg",
|
|
1596
1596
|
{
|
|
@@ -1607,7 +1607,7 @@ function Ai() {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1610
|
+
const Mi = ({
|
|
1611
1611
|
position: e,
|
|
1612
1612
|
isMobile: t,
|
|
1613
1613
|
agentName: n,
|
|
@@ -1617,20 +1617,20 @@ const Ni = ({
|
|
|
1617
1617
|
branding: s,
|
|
1618
1618
|
teamMembers: a,
|
|
1619
1619
|
currentTeamMemberId: c,
|
|
1620
|
-
isSwitchingTeamMember:
|
|
1621
|
-
teamSwitcherOpen:
|
|
1620
|
+
isSwitchingTeamMember: d,
|
|
1621
|
+
teamSwitcherOpen: g,
|
|
1622
1622
|
onToggleTeamSwitcher: p,
|
|
1623
|
-
onSelectTeamMember:
|
|
1624
|
-
languageMenuOpen:
|
|
1625
|
-
onToggleLanguageMenu:
|
|
1626
|
-
connectionState:
|
|
1627
|
-
agentState:
|
|
1623
|
+
onSelectTeamMember: m,
|
|
1624
|
+
languageMenuOpen: D,
|
|
1625
|
+
onToggleLanguageMenu: x,
|
|
1626
|
+
connectionState: C,
|
|
1627
|
+
agentState: y,
|
|
1628
1628
|
transcript: w,
|
|
1629
|
-
canResume:
|
|
1629
|
+
canResume: P,
|
|
1630
1630
|
needsUserGesture: E,
|
|
1631
|
-
error:
|
|
1631
|
+
error: b,
|
|
1632
1632
|
isMuted: O,
|
|
1633
|
-
micError:
|
|
1633
|
+
micError: v,
|
|
1634
1634
|
micDevices: z,
|
|
1635
1635
|
activeMicId: B,
|
|
1636
1636
|
isCameraEnabled: J,
|
|
@@ -1642,21 +1642,21 @@ const Ni = ({
|
|
|
1642
1642
|
isSpeakerMuted: $,
|
|
1643
1643
|
allowCamera: q,
|
|
1644
1644
|
allowScreenShare: X,
|
|
1645
|
-
allowTyping:
|
|
1645
|
+
allowTyping: te,
|
|
1646
1646
|
showMinimize: W = !0,
|
|
1647
|
-
showClose:
|
|
1647
|
+
showClose: ne = !0,
|
|
1648
1648
|
chromeless: ie = !1,
|
|
1649
1649
|
compactControls: U = !1,
|
|
1650
1650
|
transforming: ge,
|
|
1651
1651
|
transformingLabel: Z,
|
|
1652
|
-
avatarVideoContainerRef:
|
|
1653
|
-
agentVideoEl:
|
|
1652
|
+
avatarVideoContainerRef: Le,
|
|
1653
|
+
agentVideoEl: re,
|
|
1654
1654
|
onConnect: Me,
|
|
1655
1655
|
onDisconnect: st,
|
|
1656
1656
|
onRetry: _t,
|
|
1657
1657
|
onResumeAudio: xt,
|
|
1658
1658
|
onToggleMute: ct,
|
|
1659
|
-
onSwitchMicDevice:
|
|
1659
|
+
onSwitchMicDevice: kt,
|
|
1660
1660
|
onToggleCamera: Ye,
|
|
1661
1661
|
onSwitchCameraDevice: Ge,
|
|
1662
1662
|
onToggleScreenShare: $e,
|
|
@@ -1669,75 +1669,75 @@ const Ni = ({
|
|
|
1669
1669
|
resizeHandleProps: F
|
|
1670
1670
|
}) => {
|
|
1671
1671
|
var et;
|
|
1672
|
-
const qe = ((a == null ? void 0 : a.length) ?? 0) > 1, Ke =
|
|
1672
|
+
const qe = ((a == null ? void 0 : a.length) ?? 0) > 1, Ke = C === "connecting" || C === "connected", Ce = C === "connected", Lt = C === "idle" || C === "disconnected" || C === "error", [ut, Ie] = M(!1);
|
|
1673
1673
|
I(() => {
|
|
1674
|
-
if (!
|
|
1674
|
+
if (!re) {
|
|
1675
1675
|
Ie(!1);
|
|
1676
1676
|
return;
|
|
1677
1677
|
}
|
|
1678
|
-
if (!
|
|
1678
|
+
if (!re.paused && re.readyState >= 2) {
|
|
1679
1679
|
Ie(!0);
|
|
1680
1680
|
return;
|
|
1681
1681
|
}
|
|
1682
1682
|
Ie(!1);
|
|
1683
|
-
const
|
|
1684
|
-
return
|
|
1685
|
-
|
|
1683
|
+
const k = () => Ie(!0);
|
|
1684
|
+
return re.addEventListener("playing", k), re.addEventListener("loadeddata", k), () => {
|
|
1685
|
+
re.removeEventListener("playing", k), re.removeEventListener("loadeddata", k);
|
|
1686
1686
|
};
|
|
1687
|
-
}, [
|
|
1688
|
-
const [dt,
|
|
1687
|
+
}, [re]);
|
|
1688
|
+
const [dt, Ct] = M(!1);
|
|
1689
1689
|
I(() => {
|
|
1690
|
-
|
|
1691
|
-
}, [
|
|
1692
|
-
(
|
|
1693
|
-
}, [
|
|
1690
|
+
y === "speaking" && Ct(!0);
|
|
1691
|
+
}, [y]), I(() => {
|
|
1692
|
+
(C === "disconnected" || C === "idle") && Ct(!1);
|
|
1693
|
+
}, [C]);
|
|
1694
1694
|
const [Ue, ue] = M(!1);
|
|
1695
1695
|
I(() => {
|
|
1696
|
-
if (!
|
|
1696
|
+
if (!Ce) {
|
|
1697
1697
|
ue(!1);
|
|
1698
1698
|
return;
|
|
1699
1699
|
}
|
|
1700
1700
|
if (dt) return;
|
|
1701
|
-
const
|
|
1702
|
-
return () => clearTimeout(
|
|
1703
|
-
}, [
|
|
1704
|
-
const St =
|
|
1701
|
+
const k = setTimeout(() => ue(!0), 12e3);
|
|
1702
|
+
return () => clearTimeout(k);
|
|
1703
|
+
}, [Ce, dt]);
|
|
1704
|
+
const St = C === "connecting" || Ce && !dt && !Ue, de = R(null), ve = R(null);
|
|
1705
1705
|
I(() => {
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1706
|
+
const k = de.current;
|
|
1707
|
+
k && (k.innerHTML = "", le && (le.style.width = "100%", le.style.height = "100%", le.style.objectFit = "cover", le.style.transform = "scaleX(-1)", k.appendChild(le)));
|
|
1708
1708
|
}, [le]), I(() => {
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1709
|
+
const k = ve.current;
|
|
1710
|
+
k && (k.innerHTML = "", A && (A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "contain", k.appendChild(A)));
|
|
1711
1711
|
}, [A]);
|
|
1712
|
-
const [Je, Ze] = M(!1), [pe, be] = M(!1), Et =
|
|
1712
|
+
const [Je, Ze] = M(!1), [pe, be] = M(!1), Et = R(null), At = R(null);
|
|
1713
1713
|
I(() => {
|
|
1714
|
-
if (!Je && !pe && !
|
|
1715
|
-
const
|
|
1716
|
-
Ze(!1), be(!1),
|
|
1714
|
+
if (!Je && !pe && !D && !g) return;
|
|
1715
|
+
const k = () => {
|
|
1716
|
+
Ze(!1), be(!1), D && x(), g && p();
|
|
1717
1717
|
};
|
|
1718
|
-
return document.addEventListener("click",
|
|
1718
|
+
return document.addEventListener("click", k), () => document.removeEventListener("click", k);
|
|
1719
1719
|
}, [
|
|
1720
1720
|
Je,
|
|
1721
1721
|
pe,
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1722
|
+
D,
|
|
1723
|
+
g,
|
|
1724
|
+
x,
|
|
1725
1725
|
p
|
|
1726
1726
|
]);
|
|
1727
|
-
const [Nt,
|
|
1728
|
-
(
|
|
1729
|
-
|
|
1727
|
+
const [Nt, an] = M(!1), sn = L(() => an((k) => !k), []), [_e, Re] = M(""), Ae = L(
|
|
1728
|
+
(k) => {
|
|
1729
|
+
k.preventDefault();
|
|
1730
1730
|
const ae = _e.trim();
|
|
1731
|
-
ae && (Oe(ae),
|
|
1731
|
+
ae && (Oe(ae), Re(""));
|
|
1732
1732
|
},
|
|
1733
1733
|
[_e, Oe]
|
|
1734
|
-
),
|
|
1735
|
-
let
|
|
1736
|
-
for (let
|
|
1737
|
-
const ae = w[
|
|
1738
|
-
if (!
|
|
1734
|
+
), Te = s.productName || "Live Layer", ft = !s.productName;
|
|
1735
|
+
let Pe = null, Se = null;
|
|
1736
|
+
for (let k = w.length - 1; k >= 0; k--) {
|
|
1737
|
+
const ae = w[k];
|
|
1738
|
+
if (!Pe && ae.role === "agent" ? Pe = ae : !Se && ae.role === "user" && (Se = ae), Pe && Se) break;
|
|
1739
1739
|
}
|
|
1740
|
-
const Qe =
|
|
1740
|
+
const Qe = Ce ? (Pe == null ? void 0 : Pe.text) || null : o || null, pt = Ce && (Se == null ? void 0 : Se.text) || null, ht = [
|
|
1741
1741
|
"ll-expanded",
|
|
1742
1742
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1743
1743
|
].join(" ");
|
|
@@ -1746,20 +1746,20 @@ const Ni = ({
|
|
|
1746
1746
|
{
|
|
1747
1747
|
className: ht,
|
|
1748
1748
|
"data-position": e,
|
|
1749
|
-
"data-state":
|
|
1749
|
+
"data-state": Ce ? "connected" : Ke ? "connecting" : "idle",
|
|
1750
1750
|
role: "dialog",
|
|
1751
1751
|
"aria-label": `${n} widget`,
|
|
1752
1752
|
children: [
|
|
1753
1753
|
/* @__PURE__ */ S("div", { className: "ll-expanded__bg", children: [
|
|
1754
1754
|
i ? /* @__PURE__ */ r(
|
|
1755
|
-
|
|
1755
|
+
xi,
|
|
1756
1756
|
{
|
|
1757
1757
|
src: i,
|
|
1758
1758
|
alt: n,
|
|
1759
1759
|
className: "ll-expanded__bg-img"
|
|
1760
1760
|
}
|
|
1761
1761
|
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((et = n == null ? void 0 : n.charAt(0)) == null ? void 0 : et.toUpperCase()) || "A" }) }),
|
|
1762
|
-
l && !
|
|
1762
|
+
l && !Ce && /* @__PURE__ */ r(
|
|
1763
1763
|
"video",
|
|
1764
1764
|
{
|
|
1765
1765
|
className: "ll-expanded__bg-idle",
|
|
@@ -1774,16 +1774,16 @@ const Ni = ({
|
|
|
1774
1774
|
/* @__PURE__ */ r(
|
|
1775
1775
|
"div",
|
|
1776
1776
|
{
|
|
1777
|
-
ref:
|
|
1777
|
+
ref: Le,
|
|
1778
1778
|
className: "ll-expanded__video",
|
|
1779
1779
|
"data-ready": ut
|
|
1780
1780
|
}
|
|
1781
1781
|
),
|
|
1782
1782
|
St && /* @__PURE__ */ S("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1783
1783
|
/* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
|
|
1784
|
-
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children:
|
|
1784
|
+
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: d ? "Switching..." : "Connecting..." })
|
|
1785
1785
|
] }),
|
|
1786
|
-
E &&
|
|
1786
|
+
E && Ce && /* @__PURE__ */ S(
|
|
1787
1787
|
"button",
|
|
1788
1788
|
{
|
|
1789
1789
|
type: "button",
|
|
@@ -1817,45 +1817,45 @@ const Ni = ({
|
|
|
1817
1817
|
{
|
|
1818
1818
|
type: "button",
|
|
1819
1819
|
className: "ll-hpill",
|
|
1820
|
-
onClick: (
|
|
1821
|
-
qe && (
|
|
1820
|
+
onClick: (k) => {
|
|
1821
|
+
qe && (k.stopPropagation(), p());
|
|
1822
1822
|
},
|
|
1823
1823
|
"aria-haspopup": qe ? "listbox" : void 0,
|
|
1824
|
-
"aria-expanded": qe ?
|
|
1824
|
+
"aria-expanded": qe ? g : void 0,
|
|
1825
1825
|
children: [
|
|
1826
1826
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
|
|
1827
|
-
qe && /* @__PURE__ */ r(
|
|
1827
|
+
qe && /* @__PURE__ */ r(Ot, {})
|
|
1828
1828
|
]
|
|
1829
1829
|
}
|
|
1830
1830
|
),
|
|
1831
|
-
qe &&
|
|
1831
|
+
qe && g && /* @__PURE__ */ r(
|
|
1832
1832
|
"div",
|
|
1833
1833
|
{
|
|
1834
1834
|
className: "ll-hmenu",
|
|
1835
|
-
onClick: (
|
|
1835
|
+
onClick: (k) => k.stopPropagation(),
|
|
1836
1836
|
role: "listbox",
|
|
1837
|
-
children: a == null ? void 0 : a.map((
|
|
1837
|
+
children: a == null ? void 0 : a.map((k) => /* @__PURE__ */ S(
|
|
1838
1838
|
"button",
|
|
1839
1839
|
{
|
|
1840
1840
|
type: "button",
|
|
1841
|
-
className: `ll-hmenu__item ${
|
|
1842
|
-
onClick: () =>
|
|
1841
|
+
className: `ll-hmenu__item ${k.id === c ? "is-active" : ""}`,
|
|
1842
|
+
onClick: () => m(k.id),
|
|
1843
1843
|
role: "option",
|
|
1844
|
-
"aria-selected":
|
|
1844
|
+
"aria-selected": k.id === c,
|
|
1845
1845
|
children: [
|
|
1846
|
-
|
|
1846
|
+
k.avatarImageUrl && /* @__PURE__ */ r(
|
|
1847
1847
|
"img",
|
|
1848
1848
|
{
|
|
1849
|
-
src:
|
|
1849
|
+
src: k.avatarImageUrl,
|
|
1850
1850
|
alt: "",
|
|
1851
1851
|
className: "ll-hmenu__avatar"
|
|
1852
1852
|
}
|
|
1853
1853
|
),
|
|
1854
|
-
/* @__PURE__ */ r("span", { className: "ll-hmenu__name", children:
|
|
1855
|
-
|
|
1854
|
+
/* @__PURE__ */ r("span", { className: "ll-hmenu__name", children: k.name }),
|
|
1855
|
+
k.role && /* @__PURE__ */ r("span", { className: "ll-hmenu__role", children: k.role })
|
|
1856
1856
|
]
|
|
1857
1857
|
},
|
|
1858
|
-
|
|
1858
|
+
k.id
|
|
1859
1859
|
))
|
|
1860
1860
|
}
|
|
1861
1861
|
)
|
|
@@ -1866,24 +1866,24 @@ const Ni = ({
|
|
|
1866
1866
|
{
|
|
1867
1867
|
type: "button",
|
|
1868
1868
|
className: "ll-hpill ll-hpill--compact",
|
|
1869
|
-
onClick: (
|
|
1870
|
-
|
|
1869
|
+
onClick: (k) => {
|
|
1870
|
+
k.stopPropagation(), x();
|
|
1871
1871
|
},
|
|
1872
1872
|
"aria-haspopup": "listbox",
|
|
1873
|
-
"aria-expanded":
|
|
1873
|
+
"aria-expanded": D,
|
|
1874
1874
|
"aria-label": "Language: English",
|
|
1875
1875
|
title: "Language: English",
|
|
1876
1876
|
children: [
|
|
1877
1877
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: "EN" }),
|
|
1878
|
-
/* @__PURE__ */ r(
|
|
1878
|
+
/* @__PURE__ */ r(Ot, {})
|
|
1879
1879
|
]
|
|
1880
1880
|
}
|
|
1881
1881
|
),
|
|
1882
|
-
|
|
1882
|
+
D && /* @__PURE__ */ r(
|
|
1883
1883
|
"div",
|
|
1884
1884
|
{
|
|
1885
1885
|
className: "ll-hmenu",
|
|
1886
|
-
onClick: (
|
|
1886
|
+
onClick: (k) => k.stopPropagation(),
|
|
1887
1887
|
role: "listbox",
|
|
1888
1888
|
children: /* @__PURE__ */ r(
|
|
1889
1889
|
"button",
|
|
@@ -1901,8 +1901,8 @@ const Ni = ({
|
|
|
1901
1901
|
/* @__PURE__ */ r(
|
|
1902
1902
|
"span",
|
|
1903
1903
|
{
|
|
1904
|
-
className: `ll-expanded__state ll-expanded__state--${
|
|
1905
|
-
children:
|
|
1904
|
+
className: `ll-expanded__state ll-expanded__state--${y}`,
|
|
1905
|
+
children: y
|
|
1906
1906
|
}
|
|
1907
1907
|
)
|
|
1908
1908
|
] }),
|
|
@@ -1915,10 +1915,10 @@ const Ni = ({
|
|
|
1915
1915
|
onClick: Fe,
|
|
1916
1916
|
"aria-label": "Minimize widget",
|
|
1917
1917
|
title: "Minimize",
|
|
1918
|
-
children: /* @__PURE__ */ r(
|
|
1918
|
+
children: /* @__PURE__ */ r(Bn, {})
|
|
1919
1919
|
}
|
|
1920
1920
|
),
|
|
1921
|
-
|
|
1921
|
+
ne !== !1 && /* @__PURE__ */ r(
|
|
1922
1922
|
"button",
|
|
1923
1923
|
{
|
|
1924
1924
|
type: "button",
|
|
@@ -1926,14 +1926,14 @@ const Ni = ({
|
|
|
1926
1926
|
onClick: Be,
|
|
1927
1927
|
"aria-label": "End call",
|
|
1928
1928
|
title: "End call",
|
|
1929
|
-
children: /* @__PURE__ */ r(
|
|
1929
|
+
children: /* @__PURE__ */ r(Fn, {})
|
|
1930
1930
|
}
|
|
1931
1931
|
)
|
|
1932
1932
|
] })
|
|
1933
1933
|
] }),
|
|
1934
|
-
U && /* @__PURE__ */ S("div", { className: "ll-compact-status", "data-state":
|
|
1934
|
+
U && /* @__PURE__ */ S("div", { className: "ll-compact-status", "data-state": y, children: [
|
|
1935
1935
|
/* @__PURE__ */ r("span", { className: "ll-compact-status__dot", "aria-hidden": !0 }),
|
|
1936
|
-
/* @__PURE__ */ r("span", { className: "ll-compact-status__label", children:
|
|
1936
|
+
/* @__PURE__ */ r("span", { className: "ll-compact-status__label", children: y })
|
|
1937
1937
|
] })
|
|
1938
1938
|
] }) : (
|
|
1939
1939
|
// Idle-state header. In compactControls mode (mobile WIDGET +
|
|
@@ -1956,10 +1956,10 @@ const Ni = ({
|
|
|
1956
1956
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1957
1957
|
children: [
|
|
1958
1958
|
/* @__PURE__ */ r(Li, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1959
|
-
/* @__PURE__ */ r("span", { children:
|
|
1959
|
+
/* @__PURE__ */ r("span", { children: Te })
|
|
1960
1960
|
]
|
|
1961
1961
|
}
|
|
1962
|
-
) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children:
|
|
1962
|
+
) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children: Te })),
|
|
1963
1963
|
/* @__PURE__ */ S("div", { className: "ll-expanded__header-actions", children: [
|
|
1964
1964
|
!U && W !== !1 && /* @__PURE__ */ r(
|
|
1965
1965
|
"button",
|
|
@@ -1968,35 +1968,35 @@ const Ni = ({
|
|
|
1968
1968
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1969
1969
|
onClick: Fe,
|
|
1970
1970
|
"aria-label": "Minimize widget",
|
|
1971
|
-
children: /* @__PURE__ */ r(
|
|
1971
|
+
children: /* @__PURE__ */ r(Bn, {})
|
|
1972
1972
|
}
|
|
1973
1973
|
),
|
|
1974
|
-
|
|
1974
|
+
ne !== !1 && /* @__PURE__ */ r(
|
|
1975
1975
|
"button",
|
|
1976
1976
|
{
|
|
1977
1977
|
type: "button",
|
|
1978
1978
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1979
1979
|
onClick: Be,
|
|
1980
1980
|
"aria-label": "Close widget",
|
|
1981
|
-
children: /* @__PURE__ */ r(
|
|
1981
|
+
children: /* @__PURE__ */ r(Fn, {})
|
|
1982
1982
|
}
|
|
1983
1983
|
)
|
|
1984
1984
|
] })
|
|
1985
1985
|
] })
|
|
1986
1986
|
),
|
|
1987
|
-
|
|
1988
|
-
const
|
|
1987
|
+
Lt && /* @__PURE__ */ (() => {
|
|
1988
|
+
const k = P ? "Resume session" : C === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1989
1989
|
return /* @__PURE__ */ S(Ve, { children: [
|
|
1990
|
-
!
|
|
1990
|
+
!b && /* @__PURE__ */ S(
|
|
1991
1991
|
"button",
|
|
1992
1992
|
{
|
|
1993
1993
|
type: "button",
|
|
1994
1994
|
className: "ll-expanded__play",
|
|
1995
1995
|
onClick: Me,
|
|
1996
|
-
"aria-label":
|
|
1996
|
+
"aria-label": k,
|
|
1997
1997
|
children: [
|
|
1998
1998
|
/* @__PURE__ */ r("div", { className: "ll-expanded__play-circle", children: /* @__PURE__ */ r("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("polygon", { points: "6 3 20 12 6 21 6 3" }) }) }),
|
|
1999
|
-
U && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children:
|
|
1999
|
+
U && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children: k })
|
|
2000
2000
|
]
|
|
2001
2001
|
}
|
|
2002
2002
|
),
|
|
@@ -2008,8 +2008,8 @@ const Ni = ({
|
|
|
2008
2008
|
type: "button",
|
|
2009
2009
|
className: "ll-expanded__cta",
|
|
2010
2010
|
onClick: Me,
|
|
2011
|
-
"aria-label":
|
|
2012
|
-
children:
|
|
2011
|
+
"aria-label": k,
|
|
2012
|
+
children: k
|
|
2013
2013
|
}
|
|
2014
2014
|
)
|
|
2015
2015
|
] })
|
|
@@ -2054,7 +2054,7 @@ const Ni = ({
|
|
|
2054
2054
|
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: pt })
|
|
2055
2055
|
}
|
|
2056
2056
|
),
|
|
2057
|
-
!ie && !U && /* @__PURE__ */ S("div", { className: "ll-toolbar", onClick: (
|
|
2057
|
+
!ie && !U && /* @__PURE__ */ S("div", { className: "ll-toolbar", onClick: (k) => k.stopPropagation(), children: [
|
|
2058
2058
|
X && /* @__PURE__ */ r(
|
|
2059
2059
|
"button",
|
|
2060
2060
|
{
|
|
@@ -2063,7 +2063,7 @@ const Ni = ({
|
|
|
2063
2063
|
onClick: $e,
|
|
2064
2064
|
"aria-label": f ? "Stop sharing screen" : "Share screen",
|
|
2065
2065
|
title: f ? "Stop sharing" : "Share screen",
|
|
2066
|
-
children: /* @__PURE__ */ r(
|
|
2066
|
+
children: /* @__PURE__ */ r(or, {})
|
|
2067
2067
|
}
|
|
2068
2068
|
),
|
|
2069
2069
|
q && /* @__PURE__ */ S("div", { className: "ll-tool-split", children: [
|
|
@@ -2075,7 +2075,7 @@ const Ni = ({
|
|
|
2075
2075
|
onClick: Ye,
|
|
2076
2076
|
"aria-label": J ? "Turn off camera" : "Turn on camera",
|
|
2077
2077
|
title: J ? "Stop camera" : "Start camera",
|
|
2078
|
-
children: /* @__PURE__ */ r(
|
|
2078
|
+
children: /* @__PURE__ */ r(lr, {})
|
|
2079
2079
|
}
|
|
2080
2080
|
),
|
|
2081
2081
|
/* @__PURE__ */ r(
|
|
@@ -2084,24 +2084,24 @@ const Ni = ({
|
|
|
2084
2084
|
ref: At,
|
|
2085
2085
|
type: "button",
|
|
2086
2086
|
className: `ll-tool ll-tool--right ${J ? "is-on" : ""}`,
|
|
2087
|
-
onClick: (
|
|
2088
|
-
|
|
2087
|
+
onClick: (k) => {
|
|
2088
|
+
k.stopPropagation(), be((ae) => !ae), Ze(!1);
|
|
2089
2089
|
},
|
|
2090
2090
|
"aria-label": "Camera devices",
|
|
2091
2091
|
"aria-haspopup": "listbox",
|
|
2092
2092
|
"aria-expanded": pe,
|
|
2093
|
-
children: /* @__PURE__ */ r(
|
|
2093
|
+
children: /* @__PURE__ */ r(Ot, {})
|
|
2094
2094
|
}
|
|
2095
2095
|
),
|
|
2096
2096
|
pe && H.length > 0 && /* @__PURE__ */ r(
|
|
2097
|
-
|
|
2097
|
+
Wn,
|
|
2098
2098
|
{
|
|
2099
2099
|
label: "Camera",
|
|
2100
2100
|
devices: H,
|
|
2101
2101
|
activeId: G,
|
|
2102
2102
|
anchorRef: At,
|
|
2103
|
-
onPick: (
|
|
2104
|
-
be(!1), Ge(
|
|
2103
|
+
onPick: (k) => {
|
|
2104
|
+
be(!1), Ge(k);
|
|
2105
2105
|
}
|
|
2106
2106
|
}
|
|
2107
2107
|
)
|
|
@@ -2115,7 +2115,7 @@ const Ni = ({
|
|
|
2115
2115
|
onClick: ct,
|
|
2116
2116
|
"aria-label": O ? "Unmute microphone" : "Mute microphone",
|
|
2117
2117
|
title: O ? "Unmute" : "Mute",
|
|
2118
|
-
children: /* @__PURE__ */ r(
|
|
2118
|
+
children: /* @__PURE__ */ r(ar, { muted: O })
|
|
2119
2119
|
}
|
|
2120
2120
|
),
|
|
2121
2121
|
/* @__PURE__ */ r(
|
|
@@ -2124,24 +2124,24 @@ const Ni = ({
|
|
|
2124
2124
|
ref: Et,
|
|
2125
2125
|
type: "button",
|
|
2126
2126
|
className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
|
|
2127
|
-
onClick: (
|
|
2128
|
-
|
|
2127
|
+
onClick: (k) => {
|
|
2128
|
+
k.stopPropagation(), Ze((ae) => !ae), be(!1);
|
|
2129
2129
|
},
|
|
2130
2130
|
"aria-label": "Microphone devices",
|
|
2131
2131
|
"aria-haspopup": "listbox",
|
|
2132
2132
|
"aria-expanded": Je,
|
|
2133
|
-
children: /* @__PURE__ */ r(
|
|
2133
|
+
children: /* @__PURE__ */ r(Ot, {})
|
|
2134
2134
|
}
|
|
2135
2135
|
),
|
|
2136
2136
|
Je && z.length > 0 && /* @__PURE__ */ r(
|
|
2137
|
-
|
|
2137
|
+
Wn,
|
|
2138
2138
|
{
|
|
2139
2139
|
label: "Microphone",
|
|
2140
2140
|
devices: z,
|
|
2141
2141
|
activeId: B,
|
|
2142
2142
|
anchorRef: Et,
|
|
2143
|
-
onPick: (
|
|
2144
|
-
Ze(!1),
|
|
2143
|
+
onPick: (k) => {
|
|
2144
|
+
Ze(!1), kt(k);
|
|
2145
2145
|
}
|
|
2146
2146
|
}
|
|
2147
2147
|
)
|
|
@@ -2154,7 +2154,7 @@ const Ni = ({
|
|
|
2154
2154
|
onClick: He,
|
|
2155
2155
|
"aria-label": $ ? "Unmute speaker" : "Mute speaker",
|
|
2156
2156
|
title: $ ? "Unmute speaker" : "Mute speaker",
|
|
2157
|
-
children: /* @__PURE__ */ r(
|
|
2157
|
+
children: /* @__PURE__ */ r(sr, { muted: $ })
|
|
2158
2158
|
}
|
|
2159
2159
|
),
|
|
2160
2160
|
/* @__PURE__ */ r(
|
|
@@ -2165,12 +2165,12 @@ const Ni = ({
|
|
|
2165
2165
|
onClick: st,
|
|
2166
2166
|
"aria-label": "End conversation",
|
|
2167
2167
|
title: "End conversation",
|
|
2168
|
-
children: /* @__PURE__ */ r(
|
|
2168
|
+
children: /* @__PURE__ */ r(cr, {})
|
|
2169
2169
|
}
|
|
2170
2170
|
)
|
|
2171
2171
|
] }),
|
|
2172
2172
|
!ie && U && /* @__PURE__ */ r(
|
|
2173
|
-
|
|
2173
|
+
Ei,
|
|
2174
2174
|
{
|
|
2175
2175
|
isMuted: O,
|
|
2176
2176
|
onToggleMute: ct,
|
|
@@ -2182,13 +2182,13 @@ const Ni = ({
|
|
|
2182
2182
|
allowScreenShare: X,
|
|
2183
2183
|
isSpeakerMuted: $,
|
|
2184
2184
|
onToggleSpeaker: He,
|
|
2185
|
-
allowTyping:
|
|
2185
|
+
allowTyping: te,
|
|
2186
2186
|
isTypingOpen: Nt,
|
|
2187
|
-
onToggleTyping:
|
|
2187
|
+
onToggleTyping: sn,
|
|
2188
2188
|
onDisconnect: st
|
|
2189
2189
|
}
|
|
2190
2190
|
),
|
|
2191
|
-
!ie &&
|
|
2191
|
+
!ie && te && (U ? Nt : !0) && /* @__PURE__ */ S("form", { className: "ll-message-input", onSubmit: Ae, children: [
|
|
2192
2192
|
/* @__PURE__ */ r(
|
|
2193
2193
|
"input",
|
|
2194
2194
|
{
|
|
@@ -2196,7 +2196,7 @@ const Ni = ({
|
|
|
2196
2196
|
className: "ll-message-input__field",
|
|
2197
2197
|
placeholder: "Message...",
|
|
2198
2198
|
value: _e,
|
|
2199
|
-
onChange: (
|
|
2199
|
+
onChange: (k) => Re(k.target.value),
|
|
2200
2200
|
"aria-label": "Message the agent"
|
|
2201
2201
|
}
|
|
2202
2202
|
),
|
|
@@ -2206,15 +2206,15 @@ const Ni = ({
|
|
|
2206
2206
|
type: "submit",
|
|
2207
2207
|
className: "ll-message-input__send",
|
|
2208
2208
|
"aria-label": "Send message",
|
|
2209
|
-
children: /* @__PURE__ */ r(
|
|
2209
|
+
children: /* @__PURE__ */ r(Ii, {})
|
|
2210
2210
|
}
|
|
2211
2211
|
)
|
|
2212
2212
|
] })
|
|
2213
2213
|
] }) : null,
|
|
2214
2214
|
(() => {
|
|
2215
|
-
if (
|
|
2215
|
+
if (v && C !== "error")
|
|
2216
2216
|
return /* @__PURE__ */ S("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
2217
|
-
/* @__PURE__ */ r("span", { children:
|
|
2217
|
+
/* @__PURE__ */ r("span", { children: v }),
|
|
2218
2218
|
/* @__PURE__ */ r(
|
|
2219
2219
|
"button",
|
|
2220
2220
|
{
|
|
@@ -2226,10 +2226,10 @@ const Ni = ({
|
|
|
2226
2226
|
}
|
|
2227
2227
|
)
|
|
2228
2228
|
] });
|
|
2229
|
-
if (!
|
|
2230
|
-
let
|
|
2231
|
-
return
|
|
2232
|
-
/* @__PURE__ */ r("span", { children:
|
|
2229
|
+
if (!b || C !== "error") return null;
|
|
2230
|
+
let k = "Failed to connect", ae = "Try again";
|
|
2231
|
+
return b === "MIC_PERMISSION_DENIED" ? k = "Microphone blocked. Allow access to talk." : b === "MIC_NOT_FOUND" ? k = "No microphone found. Plug one in + retry." : b === "MIC_UNAVAILABLE" ? k = "Mic unavailable. Check other apps using it." : b === "AGENT_TIMEOUT" ? k = "Agent didn't pick up. Try again." : b === "CONNECT_FAILED" ? k = "Connection failed. Check your network." : b.length < 80 && (k = b), /* @__PURE__ */ S("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
2232
|
+
/* @__PURE__ */ r("span", { children: k }),
|
|
2233
2233
|
/* @__PURE__ */ r(
|
|
2234
2234
|
"button",
|
|
2235
2235
|
{
|
|
@@ -2257,32 +2257,32 @@ const Ni = ({
|
|
|
2257
2257
|
}
|
|
2258
2258
|
);
|
|
2259
2259
|
};
|
|
2260
|
-
function
|
|
2260
|
+
function Ot() {
|
|
2261
2261
|
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" }) });
|
|
2262
2262
|
}
|
|
2263
|
-
function
|
|
2263
|
+
function Fn() {
|
|
2264
2264
|
return /* @__PURE__ */ S("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: [
|
|
2265
2265
|
/* @__PURE__ */ r("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2266
2266
|
/* @__PURE__ */ r("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2267
2267
|
] });
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2269
|
+
function Bn() {
|
|
2270
2270
|
return /* @__PURE__ */ r("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": !0, children: /* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function or() {
|
|
2273
2273
|
return /* @__PURE__ */ S("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2274
2274
|
/* @__PURE__ */ r("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
2275
2275
|
/* @__PURE__ */ r("line", { x1: "8", y1: "21", x2: "16", y2: "21" }),
|
|
2276
2276
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12", y2: "21" })
|
|
2277
2277
|
] });
|
|
2278
2278
|
}
|
|
2279
|
-
function
|
|
2279
|
+
function lr() {
|
|
2280
2280
|
return /* @__PURE__ */ S("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: [
|
|
2281
2281
|
/* @__PURE__ */ r("path", { d: "M23 7l-7 5 7 5V7z" }),
|
|
2282
2282
|
/* @__PURE__ */ r("rect", { x: "1", y: "5", width: "15", height: "14", rx: "2" })
|
|
2283
2283
|
] });
|
|
2284
2284
|
}
|
|
2285
|
-
function
|
|
2285
|
+
function ar({ muted: e }) {
|
|
2286
2286
|
return /* @__PURE__ */ S("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: [
|
|
2287
2287
|
/* @__PURE__ */ r("path", { d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }),
|
|
2288
2288
|
/* @__PURE__ */ r("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
@@ -2290,7 +2290,7 @@ function lr({ muted: e }) {
|
|
|
2290
2290
|
e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2291
2291
|
] });
|
|
2292
2292
|
}
|
|
2293
|
-
function
|
|
2293
|
+
function sr({ muted: e }) {
|
|
2294
2294
|
return /* @__PURE__ */ S("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: [
|
|
2295
2295
|
/* @__PURE__ */ r("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
|
|
2296
2296
|
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ S(Ve, { children: [
|
|
@@ -2299,13 +2299,13 @@ function ar({ muted: e }) {
|
|
|
2299
2299
|
] })
|
|
2300
2300
|
] });
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2302
|
+
function Ii() {
|
|
2303
2303
|
return /* @__PURE__ */ S("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: [
|
|
2304
2304
|
/* @__PURE__ */ r("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
2305
2305
|
/* @__PURE__ */ r("polyline", { points: "12 5 19 12 12 19" })
|
|
2306
2306
|
] });
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2308
|
+
function cr() {
|
|
2309
2309
|
return /* @__PURE__ */ r("svg", { width: "16", height: "16", viewBox: "-4 -4 32 32", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": !0, children: /* @__PURE__ */ r(
|
|
2310
2310
|
"path",
|
|
2311
2311
|
{
|
|
@@ -2314,7 +2314,7 @@ function sr() {
|
|
|
2314
2314
|
}
|
|
2315
2315
|
) });
|
|
2316
2316
|
}
|
|
2317
|
-
const
|
|
2317
|
+
const Wn = ({
|
|
2318
2318
|
label: e,
|
|
2319
2319
|
devices: t,
|
|
2320
2320
|
activeId: n,
|
|
@@ -2322,20 +2322,20 @@ const Bn = ({
|
|
|
2322
2322
|
anchorRef: l
|
|
2323
2323
|
}) => {
|
|
2324
2324
|
const [o, s] = M(null);
|
|
2325
|
-
return
|
|
2325
|
+
return er(() => {
|
|
2326
2326
|
const a = () => {
|
|
2327
2327
|
const c = l.current;
|
|
2328
2328
|
if (!c) return;
|
|
2329
|
-
const
|
|
2329
|
+
const d = c.getBoundingClientRect(), g = 126, p = window.innerWidth - 16 - 110, m = d.left + d.width / 2;
|
|
2330
2330
|
s({
|
|
2331
|
-
top:
|
|
2332
|
-
left: Math.max(
|
|
2331
|
+
top: d.top - 8,
|
|
2332
|
+
left: Math.max(g, Math.min(p, m))
|
|
2333
2333
|
});
|
|
2334
2334
|
};
|
|
2335
2335
|
return a(), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
2336
2336
|
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
2337
2337
|
};
|
|
2338
|
-
}, [l]), o === null || typeof document > "u" ? null :
|
|
2338
|
+
}, [l]), o === null || typeof document > "u" ? null : ln(
|
|
2339
2339
|
/* @__PURE__ */ S(
|
|
2340
2340
|
"div",
|
|
2341
2341
|
{
|
|
@@ -2352,17 +2352,17 @@ const Bn = ({
|
|
|
2352
2352
|
children: [
|
|
2353
2353
|
/* @__PURE__ */ r("p", { className: "ll-device-menu__label", children: e }),
|
|
2354
2354
|
t.map((a, c) => {
|
|
2355
|
-
const
|
|
2355
|
+
const d = n === a.deviceId;
|
|
2356
2356
|
return /* @__PURE__ */ S(
|
|
2357
2357
|
"button",
|
|
2358
2358
|
{
|
|
2359
2359
|
type: "button",
|
|
2360
|
-
className: `ll-device-menu__item ${
|
|
2360
|
+
className: `ll-device-menu__item ${d ? "is-active" : ""}`,
|
|
2361
2361
|
onClick: () => i(a.deviceId),
|
|
2362
2362
|
role: "option",
|
|
2363
|
-
"aria-selected":
|
|
2363
|
+
"aria-selected": d,
|
|
2364
2364
|
children: [
|
|
2365
|
-
|
|
2365
|
+
d && /* @__PURE__ */ r("span", { className: "ll-device-menu__dot", children: "●" }),
|
|
2366
2366
|
/* @__PURE__ */ r("span", { className: "ll-device-menu__name", children: a.label || `${e} ${c + 1}` })
|
|
2367
2367
|
]
|
|
2368
2368
|
},
|
|
@@ -2374,7 +2374,7 @@ const Bn = ({
|
|
|
2374
2374
|
),
|
|
2375
2375
|
document.body
|
|
2376
2376
|
);
|
|
2377
|
-
},
|
|
2377
|
+
}, Ri = [
|
|
2378
2378
|
// Accept any value (or empty) — `<input data-ll-private />` and
|
|
2379
2379
|
// `<input data-ll-private="true" />` both opt out. The bare attribute
|
|
2380
2380
|
// is the recommended spelling; "true" is preserved for back-compat.
|
|
@@ -2382,17 +2382,17 @@ const Bn = ({
|
|
|
2382
2382
|
"[data-ll-skip]",
|
|
2383
2383
|
".ll-widget"
|
|
2384
2384
|
];
|
|
2385
|
-
function
|
|
2385
|
+
function Wt(e) {
|
|
2386
2386
|
let t = e;
|
|
2387
2387
|
for (; t; ) {
|
|
2388
|
-
for (const n of
|
|
2388
|
+
for (const n of Ri)
|
|
2389
2389
|
if (t.matches(n)) return !0;
|
|
2390
2390
|
t = t.parentElement;
|
|
2391
2391
|
}
|
|
2392
2392
|
return !1;
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2395
|
-
if (
|
|
2394
|
+
function nn(e) {
|
|
2395
|
+
if (Wt(e)) return !1;
|
|
2396
2396
|
if (e instanceof HTMLInputElement) {
|
|
2397
2397
|
if (e.type === "password") return !1;
|
|
2398
2398
|
const t = (e.getAttribute("autocomplete") || "").toLowerCase();
|
|
@@ -2400,66 +2400,66 @@ function tn(e) {
|
|
|
2400
2400
|
}
|
|
2401
2401
|
return !0;
|
|
2402
2402
|
}
|
|
2403
|
-
const Ti = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i,
|
|
2404
|
-
function
|
|
2403
|
+
const Ti = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i, qn = /\b(back|previous|prev|go\s*back)\b|←|‹/i, Pi = /\b(submit|finish|done|complete|send)\b/i, wt = /* @__PURE__ */ new Map();
|
|
2404
|
+
function Un(e) {
|
|
2405
2405
|
const t = wt.get(e);
|
|
2406
2406
|
return t && t.isConnected ? t : null;
|
|
2407
2407
|
}
|
|
2408
2408
|
function it(e) {
|
|
2409
|
-
if (
|
|
2409
|
+
if (Wt(e) || e.hidden || e.getAttribute("aria-hidden") === "true") return !0;
|
|
2410
2410
|
const t = typeof window < "u" && window.getComputedStyle ? window.getComputedStyle(e) : null;
|
|
2411
2411
|
return !!(t && (t.display === "none" || t.visibility === "hidden"));
|
|
2412
2412
|
}
|
|
2413
2413
|
function Di(e) {
|
|
2414
2414
|
return !!(e.disabled || e.getAttribute("aria-disabled") === "true");
|
|
2415
2415
|
}
|
|
2416
|
-
function
|
|
2416
|
+
function zi(e) {
|
|
2417
2417
|
return (e.innerText || e.textContent || e.getAttribute("aria-label") || e.value || "").trim();
|
|
2418
2418
|
}
|
|
2419
|
-
function
|
|
2419
|
+
function $i(e) {
|
|
2420
2420
|
return Array.from(e.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"]')).filter(
|
|
2421
2421
|
(n) => !it(n) && !Di(n)
|
|
2422
2422
|
);
|
|
2423
2423
|
}
|
|
2424
|
-
function
|
|
2424
|
+
function ur(e) {
|
|
2425
2425
|
wt.clear();
|
|
2426
|
-
const t =
|
|
2426
|
+
const t = $i(e);
|
|
2427
2427
|
let n, i, l;
|
|
2428
2428
|
for (const a of t) {
|
|
2429
|
-
const c =
|
|
2429
|
+
const c = zi(a);
|
|
2430
2430
|
if (!c || c.length > 40) continue;
|
|
2431
|
-
const
|
|
2432
|
-
!n && Ti.test(c) && !
|
|
2431
|
+
const d = a.getAttribute("type") === "submit" || a.tagName === "BUTTON" && !a.getAttribute("type") && !!a.closest("form");
|
|
2432
|
+
!n && Ti.test(c) && !qn.test(c) ? (n = { id: "ll-advance", label: c }, wt.set("ll-advance", a)) : !i && qn.test(c) ? (i = { id: "ll-back", label: c }, wt.set("ll-back", a)) : !l && (Pi.test(c) || d) && (l = { id: "ll-submit", label: c }, wt.set("ll-submit", a));
|
|
2433
2433
|
}
|
|
2434
|
-
const o =
|
|
2434
|
+
const o = Ui(e);
|
|
2435
2435
|
return { kind: n || o.totalSteps ? "multi-step" : "single-page", advance: n, back: i, submit: l, ...o };
|
|
2436
2436
|
}
|
|
2437
|
-
const
|
|
2438
|
-
function
|
|
2439
|
-
return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0,
|
|
2437
|
+
const Hi = 60;
|
|
2438
|
+
function dr(e) {
|
|
2439
|
+
return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0, Hi);
|
|
2440
2440
|
}
|
|
2441
|
-
function
|
|
2441
|
+
function Oi(e) {
|
|
2442
2442
|
const t = e.getAttribute("class");
|
|
2443
2443
|
return t ? t.toLowerCase() : "";
|
|
2444
2444
|
}
|
|
2445
|
-
const
|
|
2446
|
-
function
|
|
2447
|
-
return
|
|
2445
|
+
const Fi = /stepper|wizard|ant-steps|step-indicator/;
|
|
2446
|
+
function Bi(e) {
|
|
2447
|
+
return Fi.test(Oi(e));
|
|
2448
2448
|
}
|
|
2449
|
-
function
|
|
2449
|
+
function jn(e) {
|
|
2450
2450
|
const t = e.getAttribute("aria-current");
|
|
2451
2451
|
return t === "step" || t === "true" ? !0 : Array.from(e.classList).some(
|
|
2452
2452
|
(n) => /(^|[-_])(active|current|selected)([-_]|$)/i.test(n)
|
|
2453
2453
|
);
|
|
2454
2454
|
}
|
|
2455
|
-
const
|
|
2456
|
-
function
|
|
2457
|
-
return
|
|
2458
|
-
|
|
2455
|
+
const Wi = '[aria-current="step"],[aria-current="true"],[class*="active"],[class*="Active"],[class*="current"],[class*="Current"],[class*="selected"],[class*="Selected"]';
|
|
2456
|
+
function qi(e) {
|
|
2457
|
+
return jn(e) ? !0 : Array.from(e.querySelectorAll(Wi)).some(
|
|
2458
|
+
jn
|
|
2459
2459
|
);
|
|
2460
2460
|
}
|
|
2461
|
-
function
|
|
2462
|
-
const n =
|
|
2461
|
+
function Vn(e, t) {
|
|
2462
|
+
const n = dr(
|
|
2463
2463
|
e[t].innerText || e[t].textContent || ""
|
|
2464
2464
|
);
|
|
2465
2465
|
return {
|
|
@@ -2468,13 +2468,13 @@ function jn(e, t) {
|
|
|
2468
2468
|
...n ? { stepLabel: n } : {}
|
|
2469
2469
|
};
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2471
|
+
function Ui(e) {
|
|
2472
2472
|
const t = e.querySelector('[aria-current="step"]');
|
|
2473
2473
|
if (t && t.parentElement && !it(t)) {
|
|
2474
2474
|
const l = Array.from(t.parentElement.children).filter(
|
|
2475
2475
|
(s) => s.tagName === t.tagName && !it(s)
|
|
2476
2476
|
), o = l.indexOf(t);
|
|
2477
|
-
if (o >= 0 && l.length >= 2) return
|
|
2477
|
+
if (o >= 0 && l.length >= 2) return Vn(l, o);
|
|
2478
2478
|
}
|
|
2479
2479
|
const n = e.querySelector('[role="progressbar"]');
|
|
2480
2480
|
if (n && !it(n)) {
|
|
@@ -2484,7 +2484,7 @@ function qi(e) {
|
|
|
2484
2484
|
return {
|
|
2485
2485
|
totalSteps: o,
|
|
2486
2486
|
currentStep: l,
|
|
2487
|
-
...s ? { stepLabel:
|
|
2487
|
+
...s ? { stepLabel: dr(s) } : {}
|
|
2488
2488
|
};
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
@@ -2492,19 +2492,19 @@ function qi(e) {
|
|
|
2492
2492
|
e.querySelectorAll(
|
|
2493
2493
|
'[class*="step"], [class*="Step"], [class*="wizard"], [class*="Wizard"]'
|
|
2494
2494
|
)
|
|
2495
|
-
).filter((l) => !it(l) &&
|
|
2495
|
+
).filter((l) => !it(l) && Bi(l));
|
|
2496
2496
|
for (const l of i) {
|
|
2497
2497
|
const o = Array.from(l.children).filter(
|
|
2498
2498
|
(a) => !it(a) && (a.textContent || "").trim().length > 0
|
|
2499
2499
|
);
|
|
2500
2500
|
if (o.length < 2 || o.length > 12) continue;
|
|
2501
|
-
const s = o.findIndex(
|
|
2501
|
+
const s = o.findIndex(qi);
|
|
2502
2502
|
if (!(s < 0))
|
|
2503
|
-
return
|
|
2503
|
+
return Vn(o, s);
|
|
2504
2504
|
}
|
|
2505
2505
|
return {};
|
|
2506
2506
|
}
|
|
2507
|
-
const
|
|
2507
|
+
const Ft = 4096, ji = 20, Vi = 20, Yi = 10, Gi = 10, Xi = 30, Ki = 20, Yn = 500, Ji = [
|
|
2508
2508
|
'[data-ll-private="true"]',
|
|
2509
2509
|
".ll-widget",
|
|
2510
2510
|
"script",
|
|
@@ -2516,7 +2516,7 @@ function vt(e) {
|
|
|
2516
2516
|
if (e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden")) return !0;
|
|
2517
2517
|
let t = e;
|
|
2518
2518
|
for (; t; ) {
|
|
2519
|
-
for (const n of
|
|
2519
|
+
for (const n of Ji)
|
|
2520
2520
|
if (t.matches(n)) return !0;
|
|
2521
2521
|
t = t.parentElement;
|
|
2522
2522
|
}
|
|
@@ -2529,7 +2529,7 @@ function bt(e) {
|
|
|
2529
2529
|
const n = window.innerHeight || document.documentElement.clientHeight, i = window.innerWidth || document.documentElement.clientWidth;
|
|
2530
2530
|
return t.bottom > 0 && t.right > 0 && t.top < n && t.left < i;
|
|
2531
2531
|
}
|
|
2532
|
-
function
|
|
2532
|
+
function Gn(e) {
|
|
2533
2533
|
const t = e.getAttribute("id");
|
|
2534
2534
|
if (t) {
|
|
2535
2535
|
const o = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/"/g, '\\"'), s = document.querySelector(`label[for="${o}"]`);
|
|
@@ -2559,10 +2559,10 @@ function Yn(e) {
|
|
|
2559
2559
|
function ce(e, t) {
|
|
2560
2560
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2561
2561
|
}
|
|
2562
|
-
function
|
|
2562
|
+
function Zi(e) {
|
|
2563
2563
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2564
2564
|
}
|
|
2565
|
-
function
|
|
2565
|
+
function Qi(e) {
|
|
2566
2566
|
const t = e.getAttribute("aria-label");
|
|
2567
2567
|
if (t) return t.trim().slice(0, 80);
|
|
2568
2568
|
const n = e.getAttribute("aria-labelledby");
|
|
@@ -2591,7 +2591,7 @@ function Zi(e) {
|
|
|
2591
2591
|
function rt(e) {
|
|
2592
2592
|
return e.length;
|
|
2593
2593
|
}
|
|
2594
|
-
function
|
|
2594
|
+
function eo(e, t = {}) {
|
|
2595
2595
|
const n = t.doc ?? (typeof document < "u" ? document : null);
|
|
2596
2596
|
if (!n)
|
|
2597
2597
|
return {
|
|
@@ -2608,63 +2608,63 @@ function Qi(e, t = {}) {
|
|
|
2608
2608
|
const i = typeof window < "u" && window.location.href || "", l = typeof window < "u" && window.location.pathname || "/", o = n.title || "", s = Array.from(
|
|
2609
2609
|
n.querySelectorAll("[data-ll-region]")
|
|
2610
2610
|
), a = [];
|
|
2611
|
-
for (const
|
|
2612
|
-
if (a.length >=
|
|
2613
|
-
if (vt(
|
|
2614
|
-
const z =
|
|
2615
|
-
(
|
|
2616
|
-
|
|
2611
|
+
for (const v of s) {
|
|
2612
|
+
if (a.length >= Yi) break;
|
|
2613
|
+
if (vt(v) || !bt(v)) continue;
|
|
2614
|
+
const z = v.getAttribute("data-ll-region") ?? "", B = v.getAttribute("data-ll-intent") ?? void 0, J = ce(
|
|
2615
|
+
(v.innerText || v.textContent || "").trim(),
|
|
2616
|
+
Yn * 2
|
|
2617
2617
|
);
|
|
2618
2618
|
!z || !J || a.push({ id: z, intent: B, text: J });
|
|
2619
2619
|
}
|
|
2620
|
-
const c = [],
|
|
2620
|
+
const c = [], d = ["H1", "H2", "H3", "H4", "H5", "H6"], g = Array.from(
|
|
2621
2621
|
n.querySelectorAll("h1, h2, h3, h4, h5, h6")
|
|
2622
2622
|
);
|
|
2623
|
-
for (const
|
|
2624
|
-
if (vt(
|
|
2625
|
-
const z = (
|
|
2626
|
-
z && c.push(`${
|
|
2623
|
+
for (const v of g) {
|
|
2624
|
+
if (vt(v) || !bt(v)) continue;
|
|
2625
|
+
const z = (v.textContent || "").trim();
|
|
2626
|
+
z && c.push(`${v.tagName}: ${ce(z, 200)}`);
|
|
2627
2627
|
}
|
|
2628
2628
|
const p = Array.from(n.querySelectorAll("p, li"));
|
|
2629
|
-
for (const
|
|
2630
|
-
if (vt(
|
|
2631
|
-
const z = (
|
|
2632
|
-
z.length > 10 && c.push(ce(z,
|
|
2629
|
+
for (const v of p) {
|
|
2630
|
+
if (vt(v) || !bt(v) || d.includes(v.tagName)) continue;
|
|
2631
|
+
const z = (v.textContent || "").trim();
|
|
2632
|
+
z.length > 10 && c.push(ce(z, Yn));
|
|
2633
2633
|
}
|
|
2634
|
-
const
|
|
2635
|
-
`),
|
|
2636
|
-
for (const
|
|
2637
|
-
if (
|
|
2638
|
-
if (vt(
|
|
2639
|
-
const z =
|
|
2640
|
-
!z || !B ||
|
|
2634
|
+
const m = c.join(`
|
|
2635
|
+
`), D = [], x = Array.from(n.querySelectorAll("a[href]"));
|
|
2636
|
+
for (const v of x) {
|
|
2637
|
+
if (D.length >= ji) break;
|
|
2638
|
+
if (vt(v) || !bt(v)) continue;
|
|
2639
|
+
const z = v.getAttribute("href") || "", B = (v.textContent || "").trim();
|
|
2640
|
+
!z || !B || D.push({ href: z, text: ce(B, 100) });
|
|
2641
2641
|
}
|
|
2642
|
-
const
|
|
2642
|
+
const C = [], y = Array.from(
|
|
2643
2643
|
n.querySelectorAll(
|
|
2644
2644
|
"input, textarea, select"
|
|
2645
2645
|
)
|
|
2646
2646
|
);
|
|
2647
|
-
for (const
|
|
2648
|
-
if (
|
|
2649
|
-
if (vt(
|
|
2650
|
-
const z =
|
|
2651
|
-
z &&
|
|
2647
|
+
for (const v of y) {
|
|
2648
|
+
if (C.length >= Vi) break;
|
|
2649
|
+
if (vt(v) || !nn(v) || !bt(v)) continue;
|
|
2650
|
+
const z = Gn(v), B = v instanceof HTMLInputElement ? v.type : v.tagName.toLowerCase();
|
|
2651
|
+
z && C.push({ label: ce(z, 100), type: B });
|
|
2652
2652
|
}
|
|
2653
|
-
const w = Array.from(n.querySelectorAll("form")),
|
|
2653
|
+
const w = Array.from(n.querySelectorAll("form")), P = [];
|
|
2654
2654
|
let E = 0;
|
|
2655
|
-
for (const
|
|
2656
|
-
if (
|
|
2657
|
-
if (
|
|
2658
|
-
const z =
|
|
2659
|
-
|
|
2655
|
+
for (const v of w) {
|
|
2656
|
+
if (P.length >= Gi) break;
|
|
2657
|
+
if (Wt(v) || v.matches(".ll-widget *, .ll-widget")) continue;
|
|
2658
|
+
const z = v.getAttribute("id") || v.getAttribute("name") || Zi(v.getAttribute("data-ll-intent")) || `form_${E++}`, B = v.getAttribute("data-ll-intent") || Qi(v) || void 0, J = Array.from(
|
|
2659
|
+
v.querySelectorAll(
|
|
2660
2660
|
"input, textarea, select"
|
|
2661
2661
|
)
|
|
2662
2662
|
), le = [];
|
|
2663
2663
|
let H = 0;
|
|
2664
2664
|
const G = /* @__PURE__ */ new Set();
|
|
2665
2665
|
for (const f of J) {
|
|
2666
|
-
if (le.length >=
|
|
2667
|
-
if (!
|
|
2666
|
+
if (le.length >= Xi) break;
|
|
2667
|
+
if (!nn(f)) continue;
|
|
2668
2668
|
if (f instanceof HTMLInputElement) {
|
|
2669
2669
|
const U = f.type;
|
|
2670
2670
|
if (U === "submit" || U === "button" || U === "reset" || U === "hidden" || U === "image" || U === "file") continue;
|
|
@@ -2672,14 +2672,14 @@ function Qi(e, t = {}) {
|
|
|
2672
2672
|
const A = f.getAttribute("name") || "", $ = f.getAttribute("id") || "";
|
|
2673
2673
|
let q = A || $ || `field_${H}`;
|
|
2674
2674
|
G.has(q) && (q = `${q}__${H}`), G.add(q), H++;
|
|
2675
|
-
const X =
|
|
2675
|
+
const X = Gn(f) || q, te = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), W = {
|
|
2676
2676
|
name: q,
|
|
2677
2677
|
label: ce(X, 100),
|
|
2678
|
-
type:
|
|
2678
|
+
type: te
|
|
2679
2679
|
};
|
|
2680
2680
|
f.required === !0 && (W.required = !0);
|
|
2681
|
-
const
|
|
2682
|
-
if (
|
|
2681
|
+
const ne = f.getAttribute("placeholder");
|
|
2682
|
+
if (ne && (W.placeholder = ce(ne.trim(), 100)), f instanceof HTMLInputElement || f instanceof HTMLTextAreaElement) {
|
|
2683
2683
|
const U = f.getAttribute("minlength");
|
|
2684
2684
|
if (U !== null) {
|
|
2685
2685
|
const Z = parseInt(U, 10);
|
|
@@ -2698,10 +2698,10 @@ function Qi(e, t = {}) {
|
|
|
2698
2698
|
ge !== null && (W.max = ce(ge, 50));
|
|
2699
2699
|
const Z = f.getAttribute("step");
|
|
2700
2700
|
Z !== null && (W.step = ce(Z, 20));
|
|
2701
|
-
const
|
|
2702
|
-
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2701
|
+
const Le = f.getAttribute("pattern");
|
|
2702
|
+
Le !== null && (W.pattern = ce(Le, 200));
|
|
2703
|
+
const re = (f.getAttribute("autocomplete") || "").toLowerCase();
|
|
2704
|
+
re && re !== "off" && !re.startsWith("cc-") && (W.autocomplete = ce(re, 50));
|
|
2705
2705
|
}
|
|
2706
2706
|
if (f instanceof HTMLSelectElement) {
|
|
2707
2707
|
const U = [];
|
|
@@ -2712,56 +2712,56 @@ function Qi(e, t = {}) {
|
|
|
2712
2712
|
const Me = (Z.textContent || "").trim();
|
|
2713
2713
|
if (Me && !W.placeholderOption && (W.placeholderOption = ce(Me, 60)), W.hasEmptyOption = !0, Z.disabled) continue;
|
|
2714
2714
|
}
|
|
2715
|
-
if (U.length >=
|
|
2716
|
-
const
|
|
2717
|
-
!
|
|
2715
|
+
if (U.length >= Ki) break;
|
|
2716
|
+
const Le = Z.value || "", re = (Z.textContent || "").trim() || Le;
|
|
2717
|
+
!Le && !re || U.push({ value: Le, label: ce(re, 60) });
|
|
2718
2718
|
}
|
|
2719
2719
|
U.length > 0 && (W.options = U);
|
|
2720
2720
|
}
|
|
2721
2721
|
const ie = typeof f.validationMessage == "string" ? f.validationMessage : "";
|
|
2722
2722
|
ie && (W.validationMessage = ce(ie, 200)), le.push(W);
|
|
2723
2723
|
}
|
|
2724
|
-
|
|
2724
|
+
P.push({ id: z, intent: B, fields: le });
|
|
2725
2725
|
}
|
|
2726
|
-
const
|
|
2726
|
+
const b = {
|
|
2727
2727
|
url: i,
|
|
2728
2728
|
title: o,
|
|
2729
2729
|
pathname: l,
|
|
2730
2730
|
regions: a,
|
|
2731
|
-
visibleText:
|
|
2732
|
-
visibleLinks:
|
|
2733
|
-
visibleFields:
|
|
2734
|
-
forms:
|
|
2735
|
-
flow:
|
|
2731
|
+
visibleText: m,
|
|
2732
|
+
visibleLinks: D,
|
|
2733
|
+
visibleFields: C,
|
|
2734
|
+
forms: P,
|
|
2735
|
+
flow: ur(n),
|
|
2736
2736
|
extras: e
|
|
2737
2737
|
};
|
|
2738
|
-
let O = rt(JSON.stringify(
|
|
2739
|
-
for (; O >
|
|
2740
|
-
|
|
2741
|
-
for (; O >
|
|
2742
|
-
|
|
2743
|
-
return rt(
|
|
2738
|
+
let O = rt(JSON.stringify(b.regions)) + rt(b.visibleText) + rt(JSON.stringify(b.visibleLinks)) + rt(JSON.stringify(b.visibleFields));
|
|
2739
|
+
for (; O > Ft && b.visibleFields.length > 0; )
|
|
2740
|
+
b.visibleFields.pop(), O = rt(JSON.stringify(b.visibleFields));
|
|
2741
|
+
for (; O > Ft && b.visibleLinks.length > 0; )
|
|
2742
|
+
b.visibleLinks.pop(), O -= 80;
|
|
2743
|
+
return rt(b.visibleText) > Ft && (b.visibleText = ce(b.visibleText, Ft - 100)), b;
|
|
2744
2744
|
}
|
|
2745
2745
|
let ot = null;
|
|
2746
|
-
function
|
|
2746
|
+
function to(e) {
|
|
2747
2747
|
const t = e.querySelectorAll("form");
|
|
2748
2748
|
let n = `f${t.length}`;
|
|
2749
2749
|
return t.forEach((i) => {
|
|
2750
2750
|
n += `|${i.id || i.getAttribute("name") || ""}:${i.querySelectorAll("input,select,textarea").length}`;
|
|
2751
2751
|
}), n;
|
|
2752
2752
|
}
|
|
2753
|
-
function
|
|
2754
|
-
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), l = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${l}::${o}::${i ?
|
|
2753
|
+
function Xn(e, t = {}) {
|
|
2754
|
+
const n = Date.now(), i = t.doc ?? (typeof document < "u" ? document : null), l = typeof window < "u" && window.location.pathname || "/", o = typeof window < "u" ? window.scrollY : 0, s = `${l}::${o}::${i ? to(i) : ""}`;
|
|
2755
2755
|
if (ot && ot.key === s && n - ot.at < 1e3)
|
|
2756
2756
|
return ot.ctx;
|
|
2757
|
-
const a =
|
|
2757
|
+
const a = eo(e, t);
|
|
2758
2758
|
return ot = { key: s, at: n, ctx: a }, a;
|
|
2759
2759
|
}
|
|
2760
|
-
function
|
|
2760
|
+
function no() {
|
|
2761
2761
|
ot = null;
|
|
2762
2762
|
}
|
|
2763
|
-
const
|
|
2764
|
-
function
|
|
2763
|
+
const ro = 200;
|
|
2764
|
+
function io(e) {
|
|
2765
2765
|
const t = String(e.href || "");
|
|
2766
2766
|
return {
|
|
2767
2767
|
href: t,
|
|
@@ -2771,47 +2771,47 @@ function ro(e) {
|
|
|
2771
2771
|
description: e.description
|
|
2772
2772
|
};
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function oo(e) {
|
|
2775
2775
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2776
2776
|
}
|
|
2777
|
-
function
|
|
2777
|
+
function lo(e) {
|
|
2778
2778
|
const t = e ?? (typeof document < "u" ? document : null);
|
|
2779
2779
|
if (!t) return [];
|
|
2780
2780
|
const n = typeof window < "u" && window.location.origin || "", i = /* @__PURE__ */ new Set(), l = [], o = Array.from(t.querySelectorAll("a[href]"));
|
|
2781
2781
|
for (const s of o) {
|
|
2782
|
-
if (l.length >=
|
|
2783
|
-
if (
|
|
2782
|
+
if (l.length >= ro) break;
|
|
2783
|
+
if (Wt(s)) continue;
|
|
2784
2784
|
const a = s.getAttribute("href") || "";
|
|
2785
|
-
if (!
|
|
2786
|
-
let c = a,
|
|
2785
|
+
if (!oo(a)) continue;
|
|
2786
|
+
let c = a, d = !0;
|
|
2787
2787
|
try {
|
|
2788
2788
|
if (typeof window < "u") {
|
|
2789
2789
|
const p = new URL(a, n);
|
|
2790
|
-
|
|
2790
|
+
d = p.origin === n, d && a.startsWith("http") && (c = p.pathname + p.search + p.hash);
|
|
2791
2791
|
}
|
|
2792
2792
|
} catch {
|
|
2793
2793
|
continue;
|
|
2794
2794
|
}
|
|
2795
2795
|
if (i.has(c)) continue;
|
|
2796
2796
|
i.add(c);
|
|
2797
|
-
const
|
|
2798
|
-
l.push({ href: c, text:
|
|
2797
|
+
const g = (s.textContent || "").trim().slice(0, 120);
|
|
2798
|
+
l.push({ href: c, text: g, internal: d });
|
|
2799
2799
|
}
|
|
2800
2800
|
return l;
|
|
2801
2801
|
}
|
|
2802
2802
|
let lt = null;
|
|
2803
|
-
const
|
|
2804
|
-
function
|
|
2803
|
+
const ao = 5e3;
|
|
2804
|
+
function Qt() {
|
|
2805
2805
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2806
|
-
if (lt && lt.pathname === t && e - lt.at <
|
|
2806
|
+
if (lt && lt.pathname === t && e - lt.at < ao)
|
|
2807
2807
|
return lt.routes;
|
|
2808
|
-
const n =
|
|
2808
|
+
const n = lo();
|
|
2809
2809
|
return lt = { at: e, pathname: t, routes: n }, n;
|
|
2810
2810
|
}
|
|
2811
|
-
function
|
|
2811
|
+
function so() {
|
|
2812
2812
|
lt = null;
|
|
2813
2813
|
}
|
|
2814
|
-
function
|
|
2814
|
+
function rn(e) {
|
|
2815
2815
|
if (e instanceof HTMLInputElement) {
|
|
2816
2816
|
const t = e.type;
|
|
2817
2817
|
if (t === "submit" || t === "button" || t === "reset" || t === "hidden" || t === "image" || t === "file")
|
|
@@ -2819,17 +2819,17 @@ function nn(e) {
|
|
|
2819
2819
|
}
|
|
2820
2820
|
return !0;
|
|
2821
2821
|
}
|
|
2822
|
-
function
|
|
2822
|
+
function co(e, t) {
|
|
2823
2823
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2824
2824
|
}
|
|
2825
2825
|
function ze(e) {
|
|
2826
2826
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2827
2827
|
}
|
|
2828
|
-
function
|
|
2828
|
+
function en(e) {
|
|
2829
2829
|
const t = e.lastIndexOf(".");
|
|
2830
2830
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
2831
2831
|
}
|
|
2832
|
-
function
|
|
2832
|
+
function uo(e) {
|
|
2833
2833
|
var i;
|
|
2834
2834
|
const t = e.getAttribute("id");
|
|
2835
2835
|
if (t)
|
|
@@ -2843,36 +2843,36 @@ function co(e) {
|
|
|
2843
2843
|
const n = e.closest("label");
|
|
2844
2844
|
return n != null && n.textContent ? n.textContent : e.getAttribute("aria-label") || e.getAttribute("placeholder") || "";
|
|
2845
2845
|
}
|
|
2846
|
-
function
|
|
2846
|
+
function fo(e, t) {
|
|
2847
2847
|
const n = ze(t);
|
|
2848
2848
|
if (n.length < 2) return null;
|
|
2849
2849
|
let i = null, l = 0;
|
|
2850
2850
|
for (const o of Array.from(
|
|
2851
2851
|
e.querySelectorAll("input, textarea, select")
|
|
2852
2852
|
)) {
|
|
2853
|
-
if (!
|
|
2853
|
+
if (!rn(o)) continue;
|
|
2854
2854
|
const s = o.getAttribute("name") || "", a = o.getAttribute("id") || "", c = [
|
|
2855
|
-
ze(
|
|
2856
|
-
ze(
|
|
2855
|
+
ze(en(s)),
|
|
2856
|
+
ze(en(a)),
|
|
2857
2857
|
ze(s),
|
|
2858
2858
|
ze(a)
|
|
2859
2859
|
];
|
|
2860
|
-
let
|
|
2861
|
-
c.some((
|
|
2860
|
+
let d = 0;
|
|
2861
|
+
c.some((g) => g.length >= 2 && g === n) ? d = 4 : [
|
|
2862
2862
|
ze(s),
|
|
2863
|
-
ze(
|
|
2864
|
-
ze(
|
|
2865
|
-
].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (
|
|
2863
|
+
ze(en(s)),
|
|
2864
|
+
ze(uo(o))
|
|
2865
|
+
].some((p) => p.length >= 3 && (p.includes(n) || n.includes(p))) && (d = 2), d > l && (l = d, i = o);
|
|
2866
2866
|
}
|
|
2867
2867
|
return l >= 2 ? i : null;
|
|
2868
2868
|
}
|
|
2869
|
-
function
|
|
2869
|
+
function po(e, t) {
|
|
2870
2870
|
if (!t) return null;
|
|
2871
2871
|
try {
|
|
2872
2872
|
const o = e.querySelector(
|
|
2873
2873
|
`[name="${t.replace(/"/g, '\\"')}"]`
|
|
2874
2874
|
);
|
|
2875
|
-
if (o &&
|
|
2875
|
+
if (o && rn(o)) return o;
|
|
2876
2876
|
} catch {
|
|
2877
2877
|
}
|
|
2878
2878
|
const n = Array.from(
|
|
@@ -2881,23 +2881,23 @@ function fo(e, t) {
|
|
|
2881
2881
|
let i = 0;
|
|
2882
2882
|
const l = /* @__PURE__ */ new Map();
|
|
2883
2883
|
for (const o of n) {
|
|
2884
|
-
if (!
|
|
2885
|
-
const s =
|
|
2884
|
+
if (!rn(o)) continue;
|
|
2885
|
+
const s = co(o, i);
|
|
2886
2886
|
let a = s;
|
|
2887
2887
|
if (l.has(s) && (a = `${s}__${i}`), a === t) return o;
|
|
2888
2888
|
l.set(s, o), i++;
|
|
2889
2889
|
}
|
|
2890
|
-
return
|
|
2890
|
+
return fo(e, t);
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2893
|
-
const n =
|
|
2894
|
-
return n ?
|
|
2892
|
+
function Kn(e, t) {
|
|
2893
|
+
const n = po(e, t);
|
|
2894
|
+
return n ? nn(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2895
2895
|
}
|
|
2896
|
-
function
|
|
2896
|
+
function ho(e, t) {
|
|
2897
2897
|
const n = e instanceof HTMLInputElement ? HTMLInputElement.prototype : e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLSelectElement.prototype, i = Object.getOwnPropertyDescriptor(n, "value"), l = i == null ? void 0 : i.set;
|
|
2898
2898
|
l ? l.call(e, t) : e.value = t;
|
|
2899
2899
|
}
|
|
2900
|
-
function
|
|
2900
|
+
function mo(e, t, n = {}) {
|
|
2901
2901
|
const i = n.triggerInput ?? !0, l = n.triggerChange ?? !0;
|
|
2902
2902
|
if (e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio")) {
|
|
2903
2903
|
const o = Object.getOwnPropertyDescriptor(
|
|
@@ -2907,9 +2907,9 @@ function ho(e, t, n = {}) {
|
|
|
2907
2907
|
s ? s.call(e, a) : e.checked = a, i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2908
2908
|
return;
|
|
2909
2909
|
}
|
|
2910
|
-
|
|
2910
|
+
ho(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2911
2911
|
}
|
|
2912
|
-
function
|
|
2912
|
+
function Jn(e, t) {
|
|
2913
2913
|
if (!t) return null;
|
|
2914
2914
|
const n = t.replace(/"/g, '\\"'), i = (a) => a.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget') !== null;
|
|
2915
2915
|
try {
|
|
@@ -2932,23 +2932,23 @@ function Kn(e, t) {
|
|
|
2932
2932
|
).filter((a) => !i(a));
|
|
2933
2933
|
for (const a of s) {
|
|
2934
2934
|
const c = a.getAttribute("data-ll-intent");
|
|
2935
|
-
if (c &&
|
|
2935
|
+
if (c && go(c) === t) return a;
|
|
2936
2936
|
}
|
|
2937
2937
|
if (/^form_\d+$/.test(t)) {
|
|
2938
2938
|
const a = parseInt(t.slice(5), 10);
|
|
2939
2939
|
let c = 0;
|
|
2940
|
-
for (const
|
|
2941
|
-
if (!(
|
|
2942
|
-
if (c === a) return
|
|
2940
|
+
for (const d of s)
|
|
2941
|
+
if (!(d.id || d.getAttribute("name") || d.getAttribute("data-ll-intent"))) {
|
|
2942
|
+
if (c === a) return d;
|
|
2943
2943
|
c++;
|
|
2944
2944
|
}
|
|
2945
2945
|
}
|
|
2946
2946
|
return s.length === 1 ? s[0] : null;
|
|
2947
2947
|
}
|
|
2948
|
-
function
|
|
2948
|
+
function go(e) {
|
|
2949
2949
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2950
2950
|
}
|
|
2951
|
-
function
|
|
2951
|
+
function yo() {
|
|
2952
2952
|
if (typeof window > "u" || typeof document > "u")
|
|
2953
2953
|
return !1;
|
|
2954
2954
|
const e = document.scrollingElement || document.documentElement;
|
|
@@ -2956,19 +2956,19 @@ function go() {
|
|
|
2956
2956
|
const t = window.getComputedStyle(e);
|
|
2957
2957
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2958
2958
|
}
|
|
2959
|
-
function
|
|
2959
|
+
function vo(e) {
|
|
2960
2960
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2961
2961
|
const n = window.getComputedStyle(e).overflowY;
|
|
2962
2962
|
return !(n !== "auto" && n !== "scroll" || e.scrollHeight <= e.clientHeight + 2);
|
|
2963
2963
|
}
|
|
2964
|
-
function
|
|
2964
|
+
function bo() {
|
|
2965
2965
|
if (typeof document > "u") return null;
|
|
2966
2966
|
const e = Array.from(
|
|
2967
2967
|
document.querySelectorAll("body, body *")
|
|
2968
2968
|
);
|
|
2969
2969
|
let t = null, n = 0;
|
|
2970
2970
|
for (const i of e) {
|
|
2971
|
-
if (!
|
|
2971
|
+
if (!vo(i)) continue;
|
|
2972
2972
|
const l = i.getBoundingClientRect();
|
|
2973
2973
|
if (l.bottom <= 0 || l.top >= window.innerHeight || l.right <= 0 || l.left >= window.innerWidth || l.width <= 0 || l.height <= 0 || i.closest(".ll-widget")) continue;
|
|
2974
2974
|
const o = l.width * l.height;
|
|
@@ -2976,24 +2976,24 @@ function vo() {
|
|
|
2976
2976
|
}
|
|
2977
2977
|
return t;
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2979
|
+
function wo() {
|
|
2980
2980
|
if (typeof window > "u")
|
|
2981
2981
|
return null;
|
|
2982
|
-
if (
|
|
2983
|
-
const e =
|
|
2982
|
+
if (yo()) return window;
|
|
2983
|
+
const e = bo();
|
|
2984
2984
|
return e || window;
|
|
2985
2985
|
}
|
|
2986
|
-
function
|
|
2986
|
+
function Zn(e) {
|
|
2987
2987
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2988
2988
|
}
|
|
2989
|
-
function
|
|
2989
|
+
function _o(e) {
|
|
2990
2990
|
var t, n;
|
|
2991
2991
|
return e instanceof Window ? typeof document > "u" ? 0 : Math.max(
|
|
2992
2992
|
((t = document.body) == null ? void 0 : t.scrollHeight) ?? 0,
|
|
2993
2993
|
((n = document.documentElement) == null ? void 0 : n.scrollHeight) ?? 0
|
|
2994
2994
|
) : e.scrollHeight - e.clientHeight;
|
|
2995
2995
|
}
|
|
2996
|
-
const
|
|
2996
|
+
const xo = /* @__PURE__ */ new Set([
|
|
2997
2997
|
"agent_state",
|
|
2998
2998
|
"avatar_stream_ready",
|
|
2999
2999
|
"avatar_active",
|
|
@@ -3028,9 +3028,9 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3028
3028
|
// to onAgentCommand.
|
|
3029
3029
|
"task_field_updated",
|
|
3030
3030
|
"task_completed"
|
|
3031
|
-
]),
|
|
3031
|
+
]), fr = on(
|
|
3032
3032
|
function(t, n) {
|
|
3033
|
-
var
|
|
3033
|
+
var bn, wn, _n, xn, kn, Ln, Cn;
|
|
3034
3034
|
const {
|
|
3035
3035
|
agentId: i,
|
|
3036
3036
|
apiKey: l,
|
|
@@ -3038,8 +3038,8 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3038
3038
|
sessionEndpoint: s,
|
|
3039
3039
|
sessionBody: a,
|
|
3040
3040
|
soundEffects: c,
|
|
3041
|
-
experienceMode:
|
|
3042
|
-
autoConnect:
|
|
3041
|
+
experienceMode: d = "WIDGET",
|
|
3042
|
+
autoConnect: g = !1,
|
|
3043
3043
|
displayMode: p,
|
|
3044
3044
|
// Initial display mode. Mobile gets a smaller card layout (not the
|
|
3045
3045
|
// full-screen sheet) so "expanded" is the right default on every
|
|
@@ -3048,17 +3048,17 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3048
3048
|
// expanded widget but card-sized, not the bottom bar that
|
|
3049
3049
|
// minimized produced). The card sizing now lives in CSS — see
|
|
3050
3050
|
// .ll-expanded--mobile in styles.css.
|
|
3051
|
-
defaultDisplayMode:
|
|
3052
|
-
onDisplayModeChange:
|
|
3053
|
-
position:
|
|
3054
|
-
mobileBreakpoint:
|
|
3055
|
-
draggable:
|
|
3051
|
+
defaultDisplayMode: m = "expanded",
|
|
3052
|
+
onDisplayModeChange: D,
|
|
3053
|
+
position: x = "bottom-right",
|
|
3054
|
+
mobileBreakpoint: C = 640,
|
|
3055
|
+
draggable: y,
|
|
3056
3056
|
resizable: w,
|
|
3057
|
-
persistKey:
|
|
3057
|
+
persistKey: P = "ll-widget",
|
|
3058
3058
|
disablePersistence: E = !1,
|
|
3059
|
-
teamMembers:
|
|
3059
|
+
teamMembers: b,
|
|
3060
3060
|
currentTeamMemberId: O,
|
|
3061
|
-
onTeamMemberChange:
|
|
3061
|
+
onTeamMemberChange: v,
|
|
3062
3062
|
idleLoopUrl: z,
|
|
3063
3063
|
greeting: B,
|
|
3064
3064
|
avatarImageUrl: J,
|
|
@@ -3070,21 +3070,21 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3070
3070
|
blurUntilFirstSpeech: $ = !0,
|
|
3071
3071
|
showMinimize: q,
|
|
3072
3072
|
showClose: X,
|
|
3073
|
-
chromeless:
|
|
3073
|
+
chromeless: te = !1,
|
|
3074
3074
|
floatingChromeContainer: W = null,
|
|
3075
|
-
compactControls:
|
|
3075
|
+
compactControls: ne = !1,
|
|
3076
3076
|
transforming: ie = !1,
|
|
3077
3077
|
transformingLabel: U = "Transforming…",
|
|
3078
3078
|
showOn: ge,
|
|
3079
3079
|
hideOn: Z,
|
|
3080
|
-
pathname:
|
|
3081
|
-
onNavigate:
|
|
3080
|
+
pathname: Le,
|
|
3081
|
+
onNavigate: re,
|
|
3082
3082
|
onScrollToSelector: Me,
|
|
3083
3083
|
getPageContext: st,
|
|
3084
3084
|
pageContextExtras: _t,
|
|
3085
3085
|
getRoutes: xt,
|
|
3086
3086
|
onScrollPage: ct,
|
|
3087
|
-
onClick:
|
|
3087
|
+
onClick: kt,
|
|
3088
3088
|
capabilities: Ye,
|
|
3089
3089
|
onConnect: Ge,
|
|
3090
3090
|
onDisconnect: $e,
|
|
@@ -3097,103 +3097,103 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3097
3097
|
controlledSession: F,
|
|
3098
3098
|
className: qe,
|
|
3099
3099
|
style: Ke,
|
|
3100
|
-
zIndex:
|
|
3101
|
-
} = t,
|
|
3100
|
+
zIndex: Ce = 2147483647
|
|
3101
|
+
} = t, Lt = ii(Le), ut = di(Lt, ge, Z);
|
|
3102
3102
|
I(() => {
|
|
3103
|
-
|
|
3104
|
-
}, [
|
|
3105
|
-
const Ie = O !== void 0, [dt,
|
|
3106
|
-
var
|
|
3107
|
-
return O ?? ((
|
|
3103
|
+
no(), so();
|
|
3104
|
+
}, [Lt]);
|
|
3105
|
+
const Ie = O !== void 0, [dt, Ct] = M(() => {
|
|
3106
|
+
var h;
|
|
3107
|
+
return O ?? ((h = b == null ? void 0 : b[0]) == null ? void 0 : h.id);
|
|
3108
3108
|
}), Ue = Ie ? O : dt, ue = at(
|
|
3109
|
-
() => (
|
|
3110
|
-
[
|
|
3111
|
-
), St = (ue == null ? void 0 : ue.agentId) ?? i, de =
|
|
3109
|
+
() => (b == null ? void 0 : b.find((h) => h.id === Ue)) ?? null,
|
|
3110
|
+
[b, Ue]
|
|
3111
|
+
), St = (ue == null ? void 0 : ue.agentId) ?? i, de = d === "EMBEDDED", ve = Kr(C), [Je, Ze] = Gr({
|
|
3112
3112
|
value: p,
|
|
3113
|
-
defaultValue:
|
|
3114
|
-
onChange:
|
|
3115
|
-
persistKey:
|
|
3113
|
+
defaultValue: m,
|
|
3114
|
+
onChange: D,
|
|
3115
|
+
persistKey: P,
|
|
3116
3116
|
disablePersistence: de || E
|
|
3117
3117
|
}), pe = de ? "expanded" : Je, be = de ? () => {
|
|
3118
|
-
} : Ze, Et = q ?? !de, At = X ?? !de, Nt =
|
|
3119
|
-
draggable: !de && (
|
|
3118
|
+
} : Ze, Et = q ?? !de, At = X ?? !de, Nt = ne || !de && ve, _e = ni({
|
|
3119
|
+
draggable: !de && (y ?? !ve),
|
|
3120
3120
|
resizable: !de && (w ?? !ve),
|
|
3121
|
-
persistKey:
|
|
3121
|
+
persistKey: P,
|
|
3122
3122
|
disablePersistence: de || E
|
|
3123
|
-
}),
|
|
3123
|
+
}), Re = zr(), Ae = Fr(), Te = Br(), ft = Wr(), [Pe, Se] = M(!1), [Qe, pt] = M(!1), [ht, et] = M(!1), [k, ae] = M(!1), [qt, pr] = M(!1), Mt = pi({ baseUrl: o, config: c }), It = R(Mt);
|
|
3124
3124
|
It.current = Mt;
|
|
3125
|
-
const
|
|
3126
|
-
|
|
3127
|
-
function xe(
|
|
3128
|
-
const
|
|
3129
|
-
return
|
|
3125
|
+
const Ut = R(re), jt = R(Me), Vt = R(ct), Yt = R(kt), cn = R(st), un = R(_t), dn = R(xt), Gt = R(Ye), Ee = R(null);
|
|
3126
|
+
Ut.current = re, jt.current = Me, Vt.current = ct, Yt.current = kt, cn.current = st, un.current = _t, dn.current = xt, Gt.current = Ye;
|
|
3127
|
+
function xe(h) {
|
|
3128
|
+
const u = Gt.current;
|
|
3129
|
+
return u ? u.includes(h) : !0;
|
|
3130
3130
|
}
|
|
3131
|
-
function
|
|
3131
|
+
function ke(h, u) {
|
|
3132
3132
|
console.warn(
|
|
3133
|
-
`[LiveLayer] Agent command "${
|
|
3133
|
+
`[LiveLayer] Agent command "${h}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
3134
3134
|
);
|
|
3135
3135
|
}
|
|
3136
|
-
const mt =
|
|
3137
|
-
(
|
|
3138
|
-
var
|
|
3139
|
-
const
|
|
3140
|
-
if (!(!
|
|
3141
|
-
if (Be == null || Be({ eventName:
|
|
3136
|
+
const mt = L(
|
|
3137
|
+
(h) => {
|
|
3138
|
+
var Q, fe, Ne, yt, De, Sn;
|
|
3139
|
+
const u = h;
|
|
3140
|
+
if (!(!u.type || typeof u.type != "string")) {
|
|
3141
|
+
if (Be == null || Be({ eventName: u.type, data: h }), u.type === "navigate") {
|
|
3142
3142
|
if (!xe("navigate")) {
|
|
3143
|
-
|
|
3143
|
+
ke("navigate", "navigate");
|
|
3144
3144
|
return;
|
|
3145
3145
|
}
|
|
3146
|
-
const N = typeof
|
|
3146
|
+
const N = typeof u.href == "string" ? u.href : null;
|
|
3147
3147
|
if (!N) {
|
|
3148
3148
|
console.warn(
|
|
3149
3149
|
`[LiveLayer] Agent emitted "navigate" without href. Skipping. Check your agent's tool schema. See https://livelayer.studio/docs/errors/navigate-missing-href`
|
|
3150
3150
|
);
|
|
3151
3151
|
return;
|
|
3152
3152
|
}
|
|
3153
|
-
if (It.current.playPageChange(),
|
|
3153
|
+
if (It.current.playPageChange(), Ut.current) {
|
|
3154
3154
|
try {
|
|
3155
|
-
|
|
3156
|
-
} catch (
|
|
3155
|
+
Ut.current(N);
|
|
3156
|
+
} catch (T) {
|
|
3157
3157
|
console.warn(
|
|
3158
3158
|
`[LiveLayer] onNavigate threw for "${N}". Falling back. Error:`,
|
|
3159
|
-
|
|
3159
|
+
T
|
|
3160
3160
|
);
|
|
3161
3161
|
}
|
|
3162
3162
|
return;
|
|
3163
3163
|
}
|
|
3164
3164
|
if (typeof document < "u") {
|
|
3165
|
-
const
|
|
3165
|
+
const T = document.querySelector(
|
|
3166
3166
|
`a[href="${N.replace(/"/g, '\\"')}"]`
|
|
3167
3167
|
);
|
|
3168
|
-
if (
|
|
3169
|
-
|
|
3168
|
+
if (T) {
|
|
3169
|
+
T.click();
|
|
3170
3170
|
return;
|
|
3171
3171
|
}
|
|
3172
3172
|
}
|
|
3173
3173
|
if (typeof window < "u" && typeof history < "u")
|
|
3174
3174
|
try {
|
|
3175
3175
|
history.pushState({}, "", N), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
3176
|
-
} catch (
|
|
3176
|
+
} catch (T) {
|
|
3177
3177
|
console.warn(
|
|
3178
3178
|
`[LiveLayer] history.pushState fallback failed for "${N}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
|
|
3179
|
-
|
|
3179
|
+
T
|
|
3180
3180
|
);
|
|
3181
3181
|
}
|
|
3182
3182
|
return;
|
|
3183
3183
|
}
|
|
3184
|
-
if (
|
|
3184
|
+
if (u.type === "scroll_to") {
|
|
3185
3185
|
if (!xe("scroll")) {
|
|
3186
|
-
|
|
3186
|
+
ke("scroll_to", "scroll");
|
|
3187
3187
|
return;
|
|
3188
3188
|
}
|
|
3189
|
-
const N = typeof
|
|
3189
|
+
const N = typeof u.selector == "string" ? u.selector : null;
|
|
3190
3190
|
if (!N) return;
|
|
3191
|
-
const
|
|
3192
|
-
if (
|
|
3191
|
+
const T = u.behavior === "instant" ? "instant" : "smooth";
|
|
3192
|
+
if (jt.current) {
|
|
3193
3193
|
try {
|
|
3194
|
-
|
|
3194
|
+
jt.current(
|
|
3195
3195
|
N,
|
|
3196
|
-
|
|
3196
|
+
T
|
|
3197
3197
|
);
|
|
3198
3198
|
} catch (Y) {
|
|
3199
3199
|
console.warn("[LiveLayer] onScrollToSelector threw.", Y);
|
|
@@ -3217,53 +3217,53 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3217
3217
|
return;
|
|
3218
3218
|
}
|
|
3219
3219
|
Y.scrollIntoView({
|
|
3220
|
-
behavior:
|
|
3220
|
+
behavior: T,
|
|
3221
3221
|
block: "start"
|
|
3222
3222
|
});
|
|
3223
3223
|
}
|
|
3224
3224
|
return;
|
|
3225
3225
|
}
|
|
3226
|
-
if (
|
|
3226
|
+
if (u.type === "request_page_context") {
|
|
3227
3227
|
if (!xe("read_page")) {
|
|
3228
|
-
|
|
3228
|
+
ke("request_page_context", "read_page");
|
|
3229
3229
|
return;
|
|
3230
3230
|
}
|
|
3231
|
-
const N = typeof
|
|
3232
|
-
const V =
|
|
3231
|
+
const N = typeof u.requestId == "string" ? u.requestId : void 0, T = (Q = Ee.current) == null ? void 0 : Q.call(Ee), Y = (ee) => {
|
|
3232
|
+
const V = T, he = V == null ? void 0 : V.localParticipant;
|
|
3233
3233
|
if (he != null && he.publishData)
|
|
3234
3234
|
try {
|
|
3235
|
-
const me = N ? { ...
|
|
3235
|
+
const me = N ? { ...ee, requestId: N } : ee, oe = new TextEncoder().encode(JSON.stringify(me));
|
|
3236
3236
|
he.publishData(oe, { reliable: !0 });
|
|
3237
3237
|
} catch (me) {
|
|
3238
3238
|
console.warn("[LiveLayer] publishData failed.", me);
|
|
3239
3239
|
}
|
|
3240
|
-
}, j =
|
|
3240
|
+
}, j = un.current, K = cn.current;
|
|
3241
3241
|
try {
|
|
3242
3242
|
if (K) {
|
|
3243
|
-
const
|
|
3244
|
-
if (
|
|
3245
|
-
Y({ type: "page_context_pending" }),
|
|
3243
|
+
const ee = K(j);
|
|
3244
|
+
if (ee instanceof Promise) {
|
|
3245
|
+
Y({ type: "page_context_pending" }), ee.then((V) => Y({ type: "page_context", context: V })).catch((V) => {
|
|
3246
3246
|
console.warn(
|
|
3247
3247
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
3248
3248
|
V
|
|
3249
3249
|
), Y({
|
|
3250
3250
|
type: "page_context",
|
|
3251
|
-
context:
|
|
3251
|
+
context: Xn(j)
|
|
3252
3252
|
});
|
|
3253
3253
|
});
|
|
3254
3254
|
return;
|
|
3255
3255
|
}
|
|
3256
|
-
Y({ type: "page_context", context:
|
|
3256
|
+
Y({ type: "page_context", context: ee });
|
|
3257
3257
|
return;
|
|
3258
3258
|
}
|
|
3259
3259
|
Y({
|
|
3260
3260
|
type: "page_context",
|
|
3261
|
-
context:
|
|
3261
|
+
context: Xn(j)
|
|
3262
3262
|
});
|
|
3263
|
-
} catch (
|
|
3263
|
+
} catch (ee) {
|
|
3264
3264
|
console.warn(
|
|
3265
3265
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
3266
|
-
|
|
3266
|
+
ee
|
|
3267
3267
|
), Y({
|
|
3268
3268
|
type: "page_context",
|
|
3269
3269
|
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: j }
|
|
@@ -3271,24 +3271,24 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3271
3271
|
}
|
|
3272
3272
|
return;
|
|
3273
3273
|
}
|
|
3274
|
-
if (
|
|
3274
|
+
if (u.type === "scroll_page") {
|
|
3275
3275
|
if (!xe("scroll")) {
|
|
3276
|
-
|
|
3276
|
+
ke("scroll_page", "scroll");
|
|
3277
3277
|
return;
|
|
3278
3278
|
}
|
|
3279
|
-
const N =
|
|
3279
|
+
const N = u.direction;
|
|
3280
3280
|
if (N !== "up" && N !== "down" && N !== "top" && N !== "bottom") {
|
|
3281
3281
|
console.warn(
|
|
3282
3282
|
`[LiveLayer] scroll_page: invalid direction "${String(N)}". Expected up | down | top | bottom.`
|
|
3283
3283
|
);
|
|
3284
3284
|
return;
|
|
3285
3285
|
}
|
|
3286
|
-
const
|
|
3287
|
-
if (
|
|
3286
|
+
const T = u.behavior === "instant" ? "instant" : "smooth";
|
|
3287
|
+
if (Vt.current) {
|
|
3288
3288
|
try {
|
|
3289
|
-
|
|
3289
|
+
Vt.current(
|
|
3290
3290
|
N,
|
|
3291
|
-
|
|
3291
|
+
T
|
|
3292
3292
|
);
|
|
3293
3293
|
} catch (V) {
|
|
3294
3294
|
console.warn("[LiveLayer] onScrollPage threw.", V);
|
|
@@ -3296,104 +3296,104 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3296
3296
|
return;
|
|
3297
3297
|
}
|
|
3298
3298
|
if (typeof window > "u") return;
|
|
3299
|
-
const Y = { behavior:
|
|
3299
|
+
const Y = { behavior: T }, j = wo(), K = (V) => {
|
|
3300
3300
|
j instanceof Window ? j.scrollBy({ top: V, ...Y }) : j.scrollBy({ top: V, ...Y });
|
|
3301
|
-
},
|
|
3301
|
+
}, ee = (V) => {
|
|
3302
3302
|
j instanceof Window ? j.scrollTo({ top: V, ...Y }) : j.scrollTo({ top: V, ...Y });
|
|
3303
3303
|
};
|
|
3304
|
-
N === "up" ? K(-
|
|
3304
|
+
N === "up" ? K(-Zn(j)) : N === "down" ? K(Zn(j)) : ee(N === "top" ? 0 : _o(j));
|
|
3305
3305
|
return;
|
|
3306
3306
|
}
|
|
3307
|
-
if (
|
|
3307
|
+
if (u.type === "click") {
|
|
3308
3308
|
if (!xe("click")) {
|
|
3309
|
-
|
|
3309
|
+
ke("click", "click");
|
|
3310
3310
|
return;
|
|
3311
3311
|
}
|
|
3312
|
-
const N = typeof
|
|
3312
|
+
const N = typeof u.selector == "string" ? u.selector : null;
|
|
3313
3313
|
if (!N) {
|
|
3314
3314
|
console.warn("[LiveLayer] click: missing selector.");
|
|
3315
3315
|
return;
|
|
3316
3316
|
}
|
|
3317
|
-
if (
|
|
3317
|
+
if (Yt.current) {
|
|
3318
3318
|
try {
|
|
3319
|
-
|
|
3319
|
+
Yt.current(N);
|
|
3320
3320
|
} catch (Y) {
|
|
3321
3321
|
console.warn("[LiveLayer] onClick threw.", Y);
|
|
3322
3322
|
}
|
|
3323
3323
|
return;
|
|
3324
3324
|
}
|
|
3325
3325
|
if (typeof document > "u") return;
|
|
3326
|
-
let
|
|
3326
|
+
let T = null;
|
|
3327
3327
|
try {
|
|
3328
|
-
|
|
3328
|
+
T = document.querySelector(N);
|
|
3329
3329
|
} catch {
|
|
3330
3330
|
console.warn(
|
|
3331
3331
|
`[LiveLayer] click: invalid selector "${N}".`
|
|
3332
3332
|
);
|
|
3333
3333
|
return;
|
|
3334
3334
|
}
|
|
3335
|
-
if (!
|
|
3335
|
+
if (!T) {
|
|
3336
3336
|
console.warn(
|
|
3337
3337
|
`[LiveLayer] click: no element matched "${N}". See https://livelayer.studio/docs/errors/click-no-match`
|
|
3338
3338
|
);
|
|
3339
3339
|
return;
|
|
3340
3340
|
}
|
|
3341
|
-
if (
|
|
3341
|
+
if (T.closest('[data-ll-private="true"], .ll-widget')) {
|
|
3342
3342
|
console.warn(
|
|
3343
3343
|
"[LiveLayer] click: refusing to click element inside a private subtree."
|
|
3344
3344
|
);
|
|
3345
3345
|
return;
|
|
3346
3346
|
}
|
|
3347
|
-
(fe =
|
|
3347
|
+
(fe = T.click) == null || fe.call(T);
|
|
3348
3348
|
return;
|
|
3349
3349
|
}
|
|
3350
|
-
if (
|
|
3350
|
+
if (u.type === "advance_step" || u.type === "go_back" || u.type === "submit_flow") {
|
|
3351
3351
|
if (!xe("click")) {
|
|
3352
|
-
|
|
3352
|
+
ke(u.type, "click");
|
|
3353
3353
|
return;
|
|
3354
3354
|
}
|
|
3355
3355
|
if (typeof document > "u") return;
|
|
3356
|
-
const N =
|
|
3357
|
-
let
|
|
3358
|
-
if (
|
|
3359
|
-
console.warn(`[LiveLayer] ${
|
|
3356
|
+
const N = u.type === "advance_step" ? "ll-advance" : u.type === "go_back" ? "ll-back" : "ll-submit";
|
|
3357
|
+
let T = Un(N);
|
|
3358
|
+
if (T || (ur(document), T = Un(N)), !T) {
|
|
3359
|
+
console.warn(`[LiveLayer] ${u.type}: no "${N}" control found.`);
|
|
3360
3360
|
return;
|
|
3361
3361
|
}
|
|
3362
|
-
(Ne =
|
|
3362
|
+
(Ne = T.click) == null || Ne.call(T);
|
|
3363
3363
|
return;
|
|
3364
3364
|
}
|
|
3365
|
-
if (
|
|
3365
|
+
if (u.type === "fill_form" || u.type === "focus_field") {
|
|
3366
3366
|
if (!xe("fill_forms")) {
|
|
3367
|
-
|
|
3367
|
+
ke(u.type, "fill_forms");
|
|
3368
3368
|
return;
|
|
3369
3369
|
}
|
|
3370
3370
|
if (typeof document > "u") return;
|
|
3371
|
-
|
|
3372
|
-
const N = typeof
|
|
3371
|
+
u.type === "fill_form" && It.current.playConfirmation();
|
|
3372
|
+
const N = typeof u.formId == "string" ? u.formId : null;
|
|
3373
3373
|
if (!N) {
|
|
3374
|
-
console.warn(`[LiveLayer] ${
|
|
3374
|
+
console.warn(`[LiveLayer] ${u.type}: missing formId.`);
|
|
3375
3375
|
return;
|
|
3376
3376
|
}
|
|
3377
|
-
const
|
|
3378
|
-
if (!
|
|
3377
|
+
const T = Jn(document, N);
|
|
3378
|
+
if (!T) {
|
|
3379
3379
|
console.warn(
|
|
3380
|
-
`[LiveLayer] ${
|
|
3380
|
+
`[LiveLayer] ${u.type}: no <form> matched id="${N}" (or matching name / data-ll-intent slug). Forms are auto-discovered — make sure the form has an \`id\`, \`name\`, or \`data-ll-intent\` attribute the agent observed in PageContext.forms.`
|
|
3381
3381
|
);
|
|
3382
3382
|
return;
|
|
3383
3383
|
}
|
|
3384
|
-
if (
|
|
3384
|
+
if (T.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
|
|
3385
3385
|
console.warn(
|
|
3386
|
-
`[LiveLayer] ${
|
|
3386
|
+
`[LiveLayer] ${u.type}: refusing to touch a form in a private / opted-out subtree.`
|
|
3387
3387
|
);
|
|
3388
3388
|
return;
|
|
3389
3389
|
}
|
|
3390
|
-
if (
|
|
3391
|
-
const j = typeof
|
|
3390
|
+
if (u.type === "focus_field") {
|
|
3391
|
+
const j = typeof u.fieldName == "string" ? u.fieldName : null;
|
|
3392
3392
|
if (!j) {
|
|
3393
3393
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
3394
3394
|
return;
|
|
3395
3395
|
}
|
|
3396
|
-
const K =
|
|
3396
|
+
const K = Kn(T, j);
|
|
3397
3397
|
if (K.el === null) {
|
|
3398
3398
|
K.reason === "private" ? console.warn(
|
|
3399
3399
|
`[LiveLayer] focus_field: field "${j}" is privacy-protected and not focusable.`
|
|
@@ -3405,16 +3405,16 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3405
3405
|
K.el.focus();
|
|
3406
3406
|
return;
|
|
3407
3407
|
}
|
|
3408
|
-
const Y =
|
|
3408
|
+
const Y = u.values && typeof u.values == "object" ? u.values : null;
|
|
3409
3409
|
if (!Y) {
|
|
3410
3410
|
console.warn("[LiveLayer] fill_form: missing or invalid values.");
|
|
3411
3411
|
return;
|
|
3412
3412
|
}
|
|
3413
3413
|
for (const [j, K] of Object.entries(Y)) {
|
|
3414
3414
|
if (typeof K != "string") continue;
|
|
3415
|
-
const
|
|
3416
|
-
if (
|
|
3417
|
-
|
|
3415
|
+
const ee = Kn(T, j);
|
|
3416
|
+
if (ee.el === null) {
|
|
3417
|
+
ee.reason === "private" ? console.warn(
|
|
3418
3418
|
`[LiveLayer] fill_form: field "${j}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
3419
3419
|
) : console.warn(
|
|
3420
3420
|
`[LiveLayer] fill_form: no input matching key="${j}" in form "${N}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
|
|
@@ -3422,7 +3422,7 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3422
3422
|
continue;
|
|
3423
3423
|
}
|
|
3424
3424
|
try {
|
|
3425
|
-
|
|
3425
|
+
mo(ee.el, K);
|
|
3426
3426
|
} catch (V) {
|
|
3427
3427
|
console.warn(
|
|
3428
3428
|
`[LiveLayer] fill_form: failed to set "${j}".`,
|
|
@@ -3432,61 +3432,61 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3432
3432
|
}
|
|
3433
3433
|
return;
|
|
3434
3434
|
}
|
|
3435
|
-
if (
|
|
3435
|
+
if (u.type === "submit_form") {
|
|
3436
3436
|
if (!xe("submit_forms")) {
|
|
3437
|
-
|
|
3437
|
+
ke("submit_form", "submit_forms");
|
|
3438
3438
|
return;
|
|
3439
3439
|
}
|
|
3440
3440
|
if (typeof document > "u") return;
|
|
3441
|
-
const N = typeof
|
|
3441
|
+
const N = typeof u.formId == "string" ? u.formId : null;
|
|
3442
3442
|
if (!N) {
|
|
3443
3443
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
3444
3444
|
return;
|
|
3445
3445
|
}
|
|
3446
3446
|
It.current.playConfirmation();
|
|
3447
|
-
const
|
|
3448
|
-
if (!
|
|
3447
|
+
const T = Jn(document, N);
|
|
3448
|
+
if (!T) {
|
|
3449
3449
|
console.warn(
|
|
3450
3450
|
`[LiveLayer] submit_form: no <form> matched id="${N}" (or matching name / data-ll-intent slug).`
|
|
3451
3451
|
);
|
|
3452
3452
|
return;
|
|
3453
3453
|
}
|
|
3454
|
-
if (
|
|
3454
|
+
if (T.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
|
|
3455
3455
|
console.warn(
|
|
3456
3456
|
"[LiveLayer] submit_form: refusing to submit a form in a private / opted-out subtree."
|
|
3457
3457
|
);
|
|
3458
3458
|
return;
|
|
3459
3459
|
}
|
|
3460
|
-
const Y = typeof
|
|
3460
|
+
const Y = typeof u.requestId == "string" ? u.requestId : void 0, j = (yt = Ee.current) == null ? void 0 : yt.call(Ee), K = (oe) => {
|
|
3461
3461
|
const ye = j, je = ye == null ? void 0 : ye.localParticipant;
|
|
3462
3462
|
if (je != null && je.publishData)
|
|
3463
3463
|
try {
|
|
3464
|
-
const Dt = Y ? { ...oe, requestId: Y } : oe,
|
|
3465
|
-
je.publishData(
|
|
3464
|
+
const Dt = Y ? { ...oe, requestId: Y } : oe, zt = new TextEncoder().encode(JSON.stringify(Dt));
|
|
3465
|
+
je.publishData(zt, { reliable: !0 });
|
|
3466
3466
|
} catch {
|
|
3467
3467
|
}
|
|
3468
|
-
},
|
|
3469
|
-
var
|
|
3470
|
-
const ye = oe, je = (
|
|
3468
|
+
}, ee = (oe) => {
|
|
3469
|
+
var zt, En, An, Nn;
|
|
3470
|
+
const ye = oe, je = (zt = ye.getAttribute) == null ? void 0 : zt.call(ye, "aria-label");
|
|
3471
3471
|
if (je) return je;
|
|
3472
3472
|
const Dt = ye.id;
|
|
3473
3473
|
if (Dt) {
|
|
3474
|
-
const
|
|
3475
|
-
if ((
|
|
3474
|
+
const $t = (En = T.ownerDocument) == null ? void 0 : En.querySelector(`label[for="${Dt}"]`);
|
|
3475
|
+
if ((An = $t == null ? void 0 : $t.textContent) != null && An.trim()) return $t.textContent.trim();
|
|
3476
3476
|
}
|
|
3477
|
-
return ((
|
|
3477
|
+
return ((Nn = ye.getAttribute) == null ? void 0 : Nn.call(ye, "name")) || ye.id || ye.type || "field";
|
|
3478
3478
|
}, V = () => {
|
|
3479
3479
|
try {
|
|
3480
|
-
return Array.from(
|
|
3480
|
+
return Array.from(T.elements).filter(
|
|
3481
3481
|
(oe) => "willValidate" in oe && oe.willValidate && !oe.checkValidity()
|
|
3482
|
-
).map((oe) => `${
|
|
3482
|
+
).map((oe) => `${ee(oe)}: ${oe.validationMessage}`);
|
|
3483
3483
|
} catch {
|
|
3484
3484
|
return [];
|
|
3485
3485
|
}
|
|
3486
3486
|
};
|
|
3487
|
-
if (typeof
|
|
3487
|
+
if (typeof T.checkValidity == "function" && !T.checkValidity()) {
|
|
3488
3488
|
try {
|
|
3489
|
-
(
|
|
3489
|
+
(De = T.reportValidity) == null || De.call(T);
|
|
3490
3490
|
} catch {
|
|
3491
3491
|
}
|
|
3492
3492
|
K({
|
|
@@ -3503,11 +3503,11 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3503
3503
|
oe.defaultPrevented ? K({ type: "form_submit_uncertain", formId: N, reason: "spa_prevented" }) : K({ type: "form_submitted", formId: N });
|
|
3504
3504
|
});
|
|
3505
3505
|
};
|
|
3506
|
-
|
|
3506
|
+
T.addEventListener("submit", me, { once: !0 });
|
|
3507
3507
|
try {
|
|
3508
|
-
typeof
|
|
3508
|
+
typeof T.requestSubmit == "function" ? T.requestSubmit() : T.submit();
|
|
3509
3509
|
} catch (oe) {
|
|
3510
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.", oe),
|
|
3510
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", oe), T.removeEventListener("submit", me), K({
|
|
3511
3511
|
type: "form_submit_blocked",
|
|
3512
3512
|
formId: N,
|
|
3513
3513
|
reason: "exception"
|
|
@@ -3515,7 +3515,7 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3515
3515
|
return;
|
|
3516
3516
|
}
|
|
3517
3517
|
setTimeout(() => {
|
|
3518
|
-
he || (
|
|
3518
|
+
he || (T.removeEventListener("submit", me), K({
|
|
3519
3519
|
type: "form_submit_blocked",
|
|
3520
3520
|
formId: N,
|
|
3521
3521
|
reason: "validation",
|
|
@@ -3524,12 +3524,12 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3524
3524
|
}, 500);
|
|
3525
3525
|
return;
|
|
3526
3526
|
}
|
|
3527
|
-
if (
|
|
3527
|
+
if (u.type === "request_routes") {
|
|
3528
3528
|
if (!xe("read_page")) {
|
|
3529
|
-
|
|
3529
|
+
ke("request_routes", "read_page");
|
|
3530
3530
|
return;
|
|
3531
3531
|
}
|
|
3532
|
-
const N = typeof
|
|
3532
|
+
const N = typeof u.requestId == "string" ? u.requestId : void 0, Y = (Sn = Ee.current) == null ? void 0 : Sn.call(Ee), j = Y == null ? void 0 : Y.localParticipant;
|
|
3533
3533
|
if (!(j != null && j.publishData)) return;
|
|
3534
3534
|
const K = (V) => {
|
|
3535
3535
|
try {
|
|
@@ -3538,51 +3538,51 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3538
3538
|
} catch (he) {
|
|
3539
3539
|
console.warn("[LiveLayer] request_routes: publishData failed.", he);
|
|
3540
3540
|
}
|
|
3541
|
-
},
|
|
3542
|
-
if (
|
|
3541
|
+
}, ee = dn.current;
|
|
3542
|
+
if (ee) {
|
|
3543
3543
|
try {
|
|
3544
|
-
const V =
|
|
3544
|
+
const V = ee(), he = (me) => {
|
|
3545
3545
|
if (!Array.isArray(me)) {
|
|
3546
3546
|
K([]);
|
|
3547
3547
|
return;
|
|
3548
3548
|
}
|
|
3549
|
-
K(me.map(
|
|
3549
|
+
K(me.map(io).slice(0, 200));
|
|
3550
3550
|
};
|
|
3551
3551
|
V instanceof Promise ? V.then(he).catch((me) => {
|
|
3552
3552
|
console.warn(
|
|
3553
3553
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
3554
3554
|
me
|
|
3555
|
-
), K(
|
|
3555
|
+
), K(Qt());
|
|
3556
3556
|
}) : he(V);
|
|
3557
3557
|
} catch (V) {
|
|
3558
3558
|
console.warn(
|
|
3559
3559
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
3560
3560
|
V
|
|
3561
|
-
), K(
|
|
3561
|
+
), K(Qt());
|
|
3562
3562
|
}
|
|
3563
3563
|
return;
|
|
3564
3564
|
}
|
|
3565
3565
|
try {
|
|
3566
|
-
K(
|
|
3566
|
+
K(Qt());
|
|
3567
3567
|
} catch (V) {
|
|
3568
3568
|
console.warn("[LiveLayer] request_routes: extractRoutes threw.", V);
|
|
3569
3569
|
}
|
|
3570
3570
|
return;
|
|
3571
3571
|
}
|
|
3572
|
-
if (
|
|
3572
|
+
if (u.type === "task_field_updated") {
|
|
3573
3573
|
if (!xe("collect_data")) {
|
|
3574
|
-
|
|
3574
|
+
ke("task_field_updated", "collect_data");
|
|
3575
3575
|
return;
|
|
3576
3576
|
}
|
|
3577
3577
|
const N = {
|
|
3578
3578
|
phase: "field",
|
|
3579
|
-
fieldId: typeof
|
|
3580
|
-
fieldName: typeof
|
|
3581
|
-
value: typeof
|
|
3582
|
-
kind: typeof
|
|
3583
|
-
source:
|
|
3584
|
-
...typeof
|
|
3585
|
-
...typeof
|
|
3579
|
+
fieldId: typeof u.fieldId == "string" ? u.fieldId : "",
|
|
3580
|
+
fieldName: typeof u.fieldName == "string" ? u.fieldName : typeof u.fieldId == "string" ? u.fieldId : "",
|
|
3581
|
+
value: typeof u.value == "string" ? u.value : "",
|
|
3582
|
+
kind: typeof u.kind == "string" ? u.kind : "text",
|
|
3583
|
+
source: u.source === "slide" ? "slide" : u.source === "page" ? "page" : "agent",
|
|
3584
|
+
...typeof u.slideId == "string" ? { slideId: u.slideId } : {},
|
|
3585
|
+
...typeof u.formId == "string" ? { formId: u.formId } : {}
|
|
3586
3586
|
};
|
|
3587
3587
|
if (typeof document < "u")
|
|
3588
3588
|
try {
|
|
@@ -3593,12 +3593,12 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3593
3593
|
}
|
|
3594
3594
|
return;
|
|
3595
3595
|
}
|
|
3596
|
-
if (
|
|
3596
|
+
if (u.type === "task_completed") {
|
|
3597
3597
|
if (!xe("collect_data")) {
|
|
3598
|
-
|
|
3598
|
+
ke("task_completed", "collect_data");
|
|
3599
3599
|
return;
|
|
3600
3600
|
}
|
|
3601
|
-
const N =
|
|
3601
|
+
const N = u.result;
|
|
3602
3602
|
if (!N || typeof N != "object") {
|
|
3603
3603
|
console.warn(
|
|
3604
3604
|
"[LiveLayer] task_completed missing `result` payload."
|
|
@@ -3618,12 +3618,12 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3618
3618
|
We == null || We(
|
|
3619
3619
|
N
|
|
3620
3620
|
);
|
|
3621
|
-
} catch (
|
|
3622
|
-
console.warn("[LiveLayer] onCollect threw.",
|
|
3621
|
+
} catch (T) {
|
|
3622
|
+
console.warn("[LiveLayer] onCollect threw.", T);
|
|
3623
3623
|
}
|
|
3624
3624
|
return;
|
|
3625
3625
|
}
|
|
3626
|
-
|
|
3626
|
+
xo.has(u.type) || Xe == null || Xe(u);
|
|
3627
3627
|
}
|
|
3628
3628
|
},
|
|
3629
3629
|
[Xe, Be, We]
|
|
@@ -3639,13 +3639,13 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3639
3639
|
if (F != null && F.subscribeToDataMessages)
|
|
3640
3640
|
return F.subscribeToDataMessages(mt);
|
|
3641
3641
|
}, [F, mt]), Ee.current = () => {
|
|
3642
|
-
var
|
|
3643
|
-
return (
|
|
3642
|
+
var h;
|
|
3643
|
+
return (h = se.getRoom) == null ? void 0 : h.call(se);
|
|
3644
3644
|
}, I(() => {
|
|
3645
|
-
var
|
|
3645
|
+
var Q;
|
|
3646
3646
|
if (typeof window > "u") return;
|
|
3647
|
-
const
|
|
3648
|
-
if (
|
|
3647
|
+
const h = ((Q = window.location) == null ? void 0 : Q.hostname) || "";
|
|
3648
|
+
if (h === "localhost" || h === "127.0.0.1" || h === "0.0.0.0" || h.endsWith(".local") || h.endsWith(".test"))
|
|
3649
3649
|
return window.__livelayerSimulateCommand = (fe) => {
|
|
3650
3650
|
try {
|
|
3651
3651
|
mt(fe);
|
|
@@ -3656,7 +3656,7 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3656
3656
|
delete window.__livelayerSimulateCommand;
|
|
3657
3657
|
};
|
|
3658
3658
|
}, [mt]);
|
|
3659
|
-
const
|
|
3659
|
+
const _ = at(() => F ? {
|
|
3660
3660
|
connectionState: F.connectionState,
|
|
3661
3661
|
agentState: F.agentState,
|
|
3662
3662
|
transcript: F.transcript,
|
|
@@ -3687,176 +3687,184 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3687
3687
|
disconnect: se.disconnect,
|
|
3688
3688
|
getRoom: se.getRoom,
|
|
3689
3689
|
isControlled: !1
|
|
3690
|
-
}, [F, se]),
|
|
3691
|
-
|
|
3692
|
-
const
|
|
3693
|
-
|
|
3690
|
+
}, [F, se]), fn = R(_);
|
|
3691
|
+
fn.current = _;
|
|
3692
|
+
const pn = R(F);
|
|
3693
|
+
pn.current = F, Ar(
|
|
3694
3694
|
n,
|
|
3695
3695
|
() => ({
|
|
3696
|
-
sendData: async (
|
|
3696
|
+
sendData: async (h) => {
|
|
3697
3697
|
var Ne, yt;
|
|
3698
|
-
const
|
|
3699
|
-
if (
|
|
3698
|
+
const u = pn.current;
|
|
3699
|
+
if (u != null && u.publishData) {
|
|
3700
3700
|
try {
|
|
3701
|
-
await
|
|
3702
|
-
} catch (
|
|
3703
|
-
console.warn("[AvatarWidget] sendData (controlled) failed:",
|
|
3701
|
+
await u.publishData(h);
|
|
3702
|
+
} catch (De) {
|
|
3703
|
+
console.warn("[AvatarWidget] sendData (controlled) failed:", De);
|
|
3704
3704
|
}
|
|
3705
3705
|
return;
|
|
3706
3706
|
}
|
|
3707
|
-
const
|
|
3707
|
+
const Q = (yt = (Ne = fn.current) == null ? void 0 : Ne.getRoom) == null ? void 0 : yt.call(Ne), fe = Q == null ? void 0 : Q.localParticipant;
|
|
3708
3708
|
if (fe != null && fe.publishData)
|
|
3709
3709
|
try {
|
|
3710
|
-
const
|
|
3711
|
-
await fe.publishData(
|
|
3712
|
-
} catch (
|
|
3713
|
-
console.warn("[AvatarWidget] sendData failed:",
|
|
3710
|
+
const De = new TextEncoder().encode(JSON.stringify(h));
|
|
3711
|
+
await fe.publishData(De, { reliable: !0 });
|
|
3712
|
+
} catch (De) {
|
|
3713
|
+
console.warn("[AvatarWidget] sendData failed:", De);
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
3716
3716
|
}),
|
|
3717
3717
|
[]
|
|
3718
3718
|
);
|
|
3719
|
-
const
|
|
3719
|
+
const hn = R(null);
|
|
3720
3720
|
I(() => {
|
|
3721
|
-
const
|
|
3722
|
-
if (!(!
|
|
3723
|
-
return
|
|
3724
|
-
|
|
3721
|
+
const h = _.videoElement, u = hn.current;
|
|
3722
|
+
if (!(!h || !u))
|
|
3723
|
+
return u.appendChild(h), () => {
|
|
3724
|
+
h.parentNode === u && u.removeChild(h);
|
|
3725
3725
|
};
|
|
3726
|
-
}, [
|
|
3727
|
-
const [tt,
|
|
3726
|
+
}, [_.videoElement]);
|
|
3727
|
+
const [tt, Rt] = M(!1);
|
|
3728
3728
|
I(() => {
|
|
3729
3729
|
if (!$) {
|
|
3730
|
-
|
|
3730
|
+
Rt(!0);
|
|
3731
3731
|
return;
|
|
3732
3732
|
}
|
|
3733
|
-
|
|
3734
|
-
}, [$,
|
|
3733
|
+
_.agentState === "speaking" && !tt && Rt(!0);
|
|
3734
|
+
}, [$, _.agentState, tt]), I(() => {
|
|
3735
3735
|
if (!$) return;
|
|
3736
|
-
const
|
|
3737
|
-
(
|
|
3738
|
-
}, [$,
|
|
3739
|
-
if (!$ || !
|
|
3740
|
-
const
|
|
3741
|
-
return () => clearTimeout(
|
|
3742
|
-
}, [$,
|
|
3743
|
-
const
|
|
3744
|
-
if (
|
|
3736
|
+
const h = _.connectionState;
|
|
3737
|
+
(h === "disconnected" || h === "idle") && Rt(!1);
|
|
3738
|
+
}, [$, _.connectionState]), I(() => {
|
|
3739
|
+
if (!$ || !_.videoElement || tt) return;
|
|
3740
|
+
const h = setTimeout(() => Rt(!0), 5e3);
|
|
3741
|
+
return () => clearTimeout(h);
|
|
3742
|
+
}, [$, _.videoElement, tt]), I(() => {
|
|
3743
|
+
const h = _.videoElement;
|
|
3744
|
+
if (h) {
|
|
3745
3745
|
if (!$) {
|
|
3746
|
-
|
|
3746
|
+
h.style.filter = "";
|
|
3747
3747
|
return;
|
|
3748
3748
|
}
|
|
3749
|
-
|
|
3749
|
+
h.style.transition = "filter 500ms ease-out", h.style.filter = tt ? "" : "blur(8px)";
|
|
3750
3750
|
}
|
|
3751
|
-
}, [$,
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
const
|
|
3755
|
-
|
|
3756
|
-
const
|
|
3757
|
-
|
|
3751
|
+
}, [$, _.videoElement, tt]);
|
|
3752
|
+
const Tt = R(/* @__PURE__ */ new Map());
|
|
3753
|
+
I(() => {
|
|
3754
|
+
const h = _.audioElement;
|
|
3755
|
+
if (!h || Tt.current.has(h)) return;
|
|
3756
|
+
const u = document.createElement("div");
|
|
3757
|
+
u.className = "ll-audio-sink", u.setAttribute("aria-hidden", "true"), u.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);pointer-events:none;", u.appendChild(h), document.body.appendChild(u), Tt.current.set(h, u), Re.attach(h);
|
|
3758
|
+
const Q = h.play();
|
|
3759
|
+
Q && typeof Q.catch == "function" && Q.catch((fe) => {
|
|
3758
3760
|
(fe == null ? void 0 : fe.name) === "NotAllowedError" && Se(!0);
|
|
3759
|
-
})
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3761
|
+
});
|
|
3762
|
+
}, [_.audioElement]), I(() => {
|
|
3763
|
+
const h = _.connectionState;
|
|
3764
|
+
if (!(h !== "disconnected" && h !== "idle" && h !== "error")) {
|
|
3765
|
+
Re.detach();
|
|
3766
|
+
for (const [u, Q] of Tt.current)
|
|
3767
|
+
u.parentNode === Q && Q.removeChild(u), Q.parentNode === document.body && document.body.removeChild(Q);
|
|
3768
|
+
Tt.current.clear();
|
|
3769
|
+
}
|
|
3770
|
+
}, [_.connectionState]);
|
|
3771
|
+
const we = Hr({
|
|
3764
3772
|
gateUntilAgentReady: !0,
|
|
3765
|
-
agentState:
|
|
3773
|
+
agentState: _.agentState
|
|
3766
3774
|
});
|
|
3767
3775
|
I(() => {
|
|
3768
|
-
if (
|
|
3769
|
-
const
|
|
3770
|
-
if (
|
|
3771
|
-
return we.setupMic(
|
|
3772
|
-
const
|
|
3773
|
-
|
|
3776
|
+
if (_.isControlled || _.connectionState !== "connected") return;
|
|
3777
|
+
const h = _.getRoom();
|
|
3778
|
+
if (h)
|
|
3779
|
+
return we.setupMic(h).then(() => {
|
|
3780
|
+
const u = we.getMicStream();
|
|
3781
|
+
u && Re.attachStream(u, "mic");
|
|
3774
3782
|
}).catch(() => {
|
|
3775
3783
|
}), () => {
|
|
3776
|
-
|
|
3784
|
+
Re.detachSlot("mic"), we.teardownMic();
|
|
3777
3785
|
};
|
|
3778
|
-
}, [
|
|
3779
|
-
var
|
|
3780
|
-
if (
|
|
3781
|
-
const
|
|
3782
|
-
if (
|
|
3783
|
-
return Ae.attachRoom(
|
|
3784
|
-
Ae.teardown(),
|
|
3786
|
+
}, [_.isControlled, _.connectionState]), I(() => {
|
|
3787
|
+
var u;
|
|
3788
|
+
if (_.connectionState !== "connected") return;
|
|
3789
|
+
const h = _.isControlled ? (u = F == null ? void 0 : F.getRoom) == null ? void 0 : u.call(F) : _.getRoom();
|
|
3790
|
+
if (h)
|
|
3791
|
+
return Ae.attachRoom(h), Te.attachRoom(h), _.isControlled && we.attachRoom(h), ft.refresh(), () => {
|
|
3792
|
+
Ae.teardown(), Te.teardown();
|
|
3785
3793
|
};
|
|
3786
|
-
}, [
|
|
3787
|
-
const
|
|
3788
|
-
|
|
3789
|
-
}, [
|
|
3790
|
-
const
|
|
3791
|
-
const
|
|
3794
|
+
}, [_.isControlled, _.connectionState, F]), I(() => {
|
|
3795
|
+
const h = _.audioElement;
|
|
3796
|
+
h && (h.muted = qt);
|
|
3797
|
+
}, [_.audioElement, qt]);
|
|
3798
|
+
const hr = L((h) => {
|
|
3799
|
+
const u = { type: "user_message", text: h };
|
|
3792
3800
|
if (F != null && F.publishData) {
|
|
3793
3801
|
try {
|
|
3794
|
-
F.publishData(
|
|
3802
|
+
F.publishData(u);
|
|
3795
3803
|
} catch {
|
|
3796
3804
|
}
|
|
3797
3805
|
return;
|
|
3798
3806
|
}
|
|
3799
|
-
const
|
|
3800
|
-
if (
|
|
3807
|
+
const Q = _.getRoom();
|
|
3808
|
+
if (Q)
|
|
3801
3809
|
try {
|
|
3802
|
-
const fe = new TextEncoder().encode(JSON.stringify(
|
|
3803
|
-
|
|
3810
|
+
const fe = new TextEncoder().encode(JSON.stringify(u));
|
|
3811
|
+
Q.localParticipant.publishData(fe, { reliable: !0 });
|
|
3804
3812
|
} catch {
|
|
3805
3813
|
}
|
|
3806
|
-
}, [
|
|
3807
|
-
|
|
3814
|
+
}, [_, F]), mr = L(() => {
|
|
3815
|
+
pr((h) => !h);
|
|
3808
3816
|
}, []);
|
|
3809
3817
|
I(() => {
|
|
3810
|
-
Fe == null || Fe(
|
|
3811
|
-
}, [
|
|
3812
|
-
He == null || He(
|
|
3813
|
-
}, [
|
|
3814
|
-
Oe == null || Oe(
|
|
3815
|
-
}, [
|
|
3816
|
-
Mt.setThinking(
|
|
3817
|
-
}, [
|
|
3818
|
-
const
|
|
3818
|
+
Fe == null || Fe(_.connectionState), _.connectionState === "connected" ? Ge == null || Ge() : _.connectionState === "disconnected" && ($e == null || $e());
|
|
3819
|
+
}, [_.connectionState, Ge, $e, Fe]), I(() => {
|
|
3820
|
+
He == null || He(_.transcript);
|
|
3821
|
+
}, [_.transcript, He]), I(() => {
|
|
3822
|
+
Oe == null || Oe(_.agentState);
|
|
3823
|
+
}, [_.agentState, Oe]), I(() => {
|
|
3824
|
+
Mt.setThinking(_.agentState === "thinking");
|
|
3825
|
+
}, [_.agentState, Mt]);
|
|
3826
|
+
const mn = R(!1);
|
|
3819
3827
|
I(() => {
|
|
3820
|
-
!
|
|
3821
|
-
}, [
|
|
3822
|
-
const
|
|
3823
|
-
(
|
|
3824
|
-
const
|
|
3825
|
-
|
|
3828
|
+
!g || mn.current || ut && _.connectionState === "idle" && (mn.current = !0, _.connect());
|
|
3829
|
+
}, [g, _.connectionState, _, ut]);
|
|
3830
|
+
const gr = L(
|
|
3831
|
+
(h) => {
|
|
3832
|
+
const u = b == null ? void 0 : b.find((Q) => Q.id === h);
|
|
3833
|
+
u && (et(!1), h !== Ue && (pt(!0), _.disconnect(), Ie || Ct(h), v == null || v(u)));
|
|
3826
3834
|
},
|
|
3827
3835
|
[
|
|
3828
|
-
|
|
3836
|
+
b,
|
|
3829
3837
|
Ue,
|
|
3830
|
-
|
|
3838
|
+
_,
|
|
3831
3839
|
Ie,
|
|
3832
|
-
|
|
3840
|
+
v
|
|
3833
3841
|
]
|
|
3834
3842
|
);
|
|
3835
3843
|
I(() => {
|
|
3836
|
-
Qe &&
|
|
3837
|
-
}, [
|
|
3844
|
+
Qe && _.connectionState === "connected" && pt(!1);
|
|
3845
|
+
}, [_.connectionState, Qe]), I(() => {
|
|
3838
3846
|
if (!ht) return;
|
|
3839
|
-
const
|
|
3840
|
-
|
|
3847
|
+
const h = (u) => {
|
|
3848
|
+
u.key === "Escape" && et(!1);
|
|
3841
3849
|
};
|
|
3842
|
-
return window.addEventListener("keydown",
|
|
3850
|
+
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
3843
3851
|
}, [ht]);
|
|
3844
|
-
const
|
|
3845
|
-
Ye === void 0 && ((
|
|
3846
|
-
const
|
|
3852
|
+
const yr = !!J || !!(ue != null && ue.avatarImageUrl) || _.isControlled, gt = qr(St, o, yr);
|
|
3853
|
+
Ye === void 0 && ((bn = gt.info) != null && bn.capabilities) && (Gt.current = gt.info.capabilities);
|
|
3854
|
+
const Pt = (ue == null ? void 0 : ue.name) ?? le ?? ((wn = _.agentConfig) == null ? void 0 : wn.name) ?? ((_n = gt.info) == null ? void 0 : _n.name) ?? "Live Layer", Xt = (ue == null ? void 0 : ue.avatarImageUrl) ?? J ?? ((xn = _.agentConfig) == null ? void 0 : xn.avatarImageUrl) ?? ((kn = gt.info) == null ? void 0 : kn.avatarImageUrl) ?? null, vr = z ?? ((Ln = _.agentConfig) == null ? void 0 : Ln.idleLoopUrl) ?? ((Cn = gt.info) == null ? void 0 : Cn.idleLoopUrl) ?? null, br = B ?? null, wr = L(() => be("expanded"), [be]), _r = L(
|
|
3847
3855
|
() => be("minimized"),
|
|
3848
3856
|
[be]
|
|
3849
|
-
),
|
|
3850
|
-
|
|
3851
|
-
}, [
|
|
3852
|
-
const
|
|
3853
|
-
|
|
3857
|
+
), gn = L(() => {
|
|
3858
|
+
_.disconnect(), be("hidden");
|
|
3859
|
+
}, [_, be]), xr = L(() => {
|
|
3860
|
+
const h = _.audioElement;
|
|
3861
|
+
h && h.play().then(() => Se(!1)).catch(() => {
|
|
3854
3862
|
});
|
|
3855
|
-
}, [
|
|
3856
|
-
Se(!1),
|
|
3857
|
-
}, [
|
|
3863
|
+
}, [_.audioElement]), kr = L(() => {
|
|
3864
|
+
Se(!1), _.connect();
|
|
3865
|
+
}, [_]), nt = {
|
|
3858
3866
|
...Ke,
|
|
3859
|
-
...de ? {} : { zIndex:
|
|
3867
|
+
...de ? {} : { zIndex: Ce }
|
|
3860
3868
|
};
|
|
3861
3869
|
H.primaryColor && (nt["--ll-color-primary"] = H.primaryColor), H.accentColor && (nt["--ll-color-accent"] = H.accentColor), H.backgroundColor && (nt["--ll-color-bg"] = H.backgroundColor), H.textColor && (nt["--ll-color-fg"] = H.textColor);
|
|
3862
3870
|
const Lr = {
|
|
@@ -3872,33 +3880,33 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3872
3880
|
qe
|
|
3873
3881
|
].filter(Boolean).join(" ");
|
|
3874
3882
|
if (!ut) return null;
|
|
3875
|
-
const
|
|
3883
|
+
const Sr = /* @__PURE__ */ r(
|
|
3876
3884
|
"div",
|
|
3877
3885
|
{
|
|
3878
3886
|
className: Cr,
|
|
3879
3887
|
style: Lr,
|
|
3880
3888
|
"data-display-mode": pe,
|
|
3881
|
-
"data-position":
|
|
3882
|
-
"data-experience-mode":
|
|
3889
|
+
"data-position": x,
|
|
3890
|
+
"data-experience-mode": d === "EMBEDDED" ? "embedded" : "widget",
|
|
3883
3891
|
children: pe === "expanded" && /* @__PURE__ */ r(
|
|
3884
|
-
|
|
3892
|
+
Mi,
|
|
3885
3893
|
{
|
|
3886
|
-
position:
|
|
3894
|
+
position: x,
|
|
3887
3895
|
isMobile: ve,
|
|
3888
|
-
agentName:
|
|
3889
|
-
avatarImageUrl:
|
|
3890
|
-
idleLoopUrl:
|
|
3891
|
-
greeting:
|
|
3896
|
+
agentName: Pt,
|
|
3897
|
+
avatarImageUrl: Xt,
|
|
3898
|
+
idleLoopUrl: vr,
|
|
3899
|
+
greeting: br,
|
|
3892
3900
|
branding: H,
|
|
3893
|
-
teamMembers:
|
|
3901
|
+
teamMembers: b,
|
|
3894
3902
|
currentTeamMemberId: Ue,
|
|
3895
3903
|
isSwitchingTeamMember: Qe,
|
|
3896
3904
|
teamSwitcherOpen: ht,
|
|
3897
|
-
onToggleTeamSwitcher: () => et((
|
|
3898
|
-
onSelectTeamMember:
|
|
3899
|
-
connectionState:
|
|
3900
|
-
agentState:
|
|
3901
|
-
transcript:
|
|
3905
|
+
onToggleTeamSwitcher: () => et((h) => !h),
|
|
3906
|
+
onSelectTeamMember: gr,
|
|
3907
|
+
connectionState: _.connectionState,
|
|
3908
|
+
agentState: _.agentState,
|
|
3909
|
+
transcript: _.transcript,
|
|
3902
3910
|
isMuted: we.isMuted,
|
|
3903
3911
|
micDevices: ft.mics,
|
|
3904
3912
|
activeMicId: we.activeDeviceId,
|
|
@@ -3906,46 +3914,53 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3906
3914
|
cameraPreviewEl: Ae.previewEl,
|
|
3907
3915
|
cameraDevices: ft.cameras,
|
|
3908
3916
|
activeCameraId: Ae.activeDeviceId,
|
|
3909
|
-
isScreenShareEnabled:
|
|
3910
|
-
screenPreviewEl:
|
|
3911
|
-
isSpeakerMuted:
|
|
3917
|
+
isScreenShareEnabled: Te.isEnabled,
|
|
3918
|
+
screenPreviewEl: Te.previewEl,
|
|
3919
|
+
isSpeakerMuted: qt,
|
|
3912
3920
|
allowCamera: G,
|
|
3913
3921
|
allowScreenShare: f,
|
|
3914
3922
|
allowTyping: A,
|
|
3915
3923
|
showMinimize: ve && !de ? !1 : Et,
|
|
3916
3924
|
showClose: At,
|
|
3917
|
-
chromeless:
|
|
3925
|
+
chromeless: te,
|
|
3918
3926
|
compactControls: Nt,
|
|
3919
3927
|
transforming: ie,
|
|
3920
3928
|
transformingLabel: U,
|
|
3921
|
-
languageMenuOpen:
|
|
3922
|
-
onToggleLanguageMenu: () => ae((
|
|
3923
|
-
needsUserGesture:
|
|
3924
|
-
canResume:
|
|
3929
|
+
languageMenuOpen: k,
|
|
3930
|
+
onToggleLanguageMenu: () => ae((h) => !h),
|
|
3931
|
+
needsUserGesture: Pe,
|
|
3932
|
+
canResume: _.canResume,
|
|
3925
3933
|
micError: we.micError,
|
|
3926
|
-
error:
|
|
3927
|
-
avatarVideoContainerRef:
|
|
3928
|
-
agentVideoEl:
|
|
3929
|
-
onConnect: () =>
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3934
|
+
error: _.error,
|
|
3935
|
+
avatarVideoContainerRef: hn,
|
|
3936
|
+
agentVideoEl: _.videoElement,
|
|
3937
|
+
onConnect: () => {
|
|
3938
|
+
Promise.resolve(_.connect()).then(() => {
|
|
3939
|
+
var u;
|
|
3940
|
+
const h = (u = _.getRoom) == null ? void 0 : u.call(_);
|
|
3941
|
+
h != null && h.startAudio && h.canPlaybackAudio === !1 && h.startAudio().catch(() => {
|
|
3942
|
+
});
|
|
3943
|
+
});
|
|
3944
|
+
},
|
|
3945
|
+
onDisconnect: () => _.disconnect(),
|
|
3946
|
+
onRetry: kr,
|
|
3947
|
+
onResumeAudio: xr,
|
|
3933
3948
|
onToggleMute: we.toggleMute,
|
|
3934
|
-
onSwitchMicDevice: (
|
|
3949
|
+
onSwitchMicDevice: (h) => void we.switchDevice(h),
|
|
3935
3950
|
onToggleCamera: () => void Ae.toggle(),
|
|
3936
|
-
onSwitchCameraDevice: (
|
|
3937
|
-
onToggleScreenShare: () => void
|
|
3938
|
-
onToggleSpeaker:
|
|
3939
|
-
onSendMessage:
|
|
3940
|
-
onMinimize:
|
|
3941
|
-
onClose:
|
|
3951
|
+
onSwitchCameraDevice: (h) => void Ae.switchDevice(h),
|
|
3952
|
+
onToggleScreenShare: () => void Te.toggle(),
|
|
3953
|
+
onToggleSpeaker: mr,
|
|
3954
|
+
onSendMessage: hr,
|
|
3955
|
+
onMinimize: _r,
|
|
3956
|
+
onClose: gn,
|
|
3942
3957
|
onClearMicError: we.clearError,
|
|
3943
3958
|
dragHandleProps: _e.dragHandleProps,
|
|
3944
3959
|
resizeHandleProps: _e.resizeHandleProps
|
|
3945
3960
|
}
|
|
3946
3961
|
)
|
|
3947
3962
|
}
|
|
3948
|
-
),
|
|
3963
|
+
), yn = !de && (pe === "hidden" || pe === "minimized") ? /* @__PURE__ */ S(
|
|
3949
3964
|
"div",
|
|
3950
3965
|
{
|
|
3951
3966
|
className: [
|
|
@@ -3956,53 +3971,53 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3956
3971
|
].join(" "),
|
|
3957
3972
|
style: nt,
|
|
3958
3973
|
"data-display-mode": pe,
|
|
3959
|
-
"data-position":
|
|
3974
|
+
"data-position": x,
|
|
3960
3975
|
children: [
|
|
3961
3976
|
pe === "hidden" && /* @__PURE__ */ r(
|
|
3962
|
-
|
|
3977
|
+
bi,
|
|
3963
3978
|
{
|
|
3964
|
-
position:
|
|
3979
|
+
position: x,
|
|
3965
3980
|
isMobile: ve,
|
|
3966
|
-
isSpeaking:
|
|
3981
|
+
isSpeaking: _.agentState === "speaking",
|
|
3967
3982
|
onExpand: () => be("expanded"),
|
|
3968
|
-
label: `Open ${
|
|
3969
|
-
avatarImageUrl:
|
|
3970
|
-
agentName:
|
|
3983
|
+
label: `Open ${Pt} widget`,
|
|
3984
|
+
avatarImageUrl: Xt,
|
|
3985
|
+
agentName: Pt,
|
|
3971
3986
|
containerEl: W
|
|
3972
3987
|
}
|
|
3973
3988
|
),
|
|
3974
3989
|
pe === "minimized" && /* @__PURE__ */ r(
|
|
3975
|
-
|
|
3990
|
+
_i,
|
|
3976
3991
|
{
|
|
3977
|
-
position:
|
|
3992
|
+
position: x,
|
|
3978
3993
|
isMobile: ve,
|
|
3979
|
-
agentName:
|
|
3980
|
-
avatarImageUrl:
|
|
3981
|
-
agentState:
|
|
3994
|
+
agentName: Pt,
|
|
3995
|
+
avatarImageUrl: Xt,
|
|
3996
|
+
agentState: _.agentState,
|
|
3982
3997
|
isMuted: we.isMuted,
|
|
3983
|
-
audioLevel:
|
|
3984
|
-
onExpand:
|
|
3998
|
+
audioLevel: Re,
|
|
3999
|
+
onExpand: wr,
|
|
3985
4000
|
onToggleMute: we.toggleMute,
|
|
3986
|
-
onClose:
|
|
4001
|
+
onClose: gn
|
|
3987
4002
|
}
|
|
3988
4003
|
)
|
|
3989
4004
|
]
|
|
3990
4005
|
}
|
|
3991
|
-
) : null,
|
|
4006
|
+
) : null, vn = W ?? (typeof document < "u" ? document.body : null);
|
|
3992
4007
|
return /* @__PURE__ */ S(Ve, { children: [
|
|
3993
|
-
|
|
3994
|
-
|
|
4008
|
+
Sr,
|
|
4009
|
+
yn && vn && ln(yn, vn)
|
|
3995
4010
|
] });
|
|
3996
4011
|
}
|
|
3997
4012
|
);
|
|
3998
|
-
|
|
3999
|
-
const
|
|
4013
|
+
fr.displayName = "AvatarWidgetInner";
|
|
4014
|
+
const ko = on(
|
|
4000
4015
|
function(t, n) {
|
|
4001
|
-
return /* @__PURE__ */ r(
|
|
4016
|
+
return /* @__PURE__ */ r(Pr, { children: /* @__PURE__ */ r(fr, { ...t, ref: n }) });
|
|
4002
4017
|
}
|
|
4003
4018
|
);
|
|
4004
|
-
|
|
4005
|
-
const
|
|
4019
|
+
ko.displayName = "AvatarWidget";
|
|
4020
|
+
const Po = ({
|
|
4006
4021
|
agentId: e,
|
|
4007
4022
|
baseUrl: t,
|
|
4008
4023
|
apiKey: n,
|
|
@@ -4011,26 +4026,26 @@ const Ro = ({
|
|
|
4011
4026
|
className: o,
|
|
4012
4027
|
style: s
|
|
4013
4028
|
}) => {
|
|
4014
|
-
const a =
|
|
4015
|
-
|
|
4016
|
-
const
|
|
4017
|
-
var
|
|
4018
|
-
const
|
|
4019
|
-
(
|
|
4029
|
+
const a = R(null), c = R(null), d = R(l);
|
|
4030
|
+
d.current = l;
|
|
4031
|
+
const g = L((p) => {
|
|
4032
|
+
var D;
|
|
4033
|
+
const m = p.detail;
|
|
4034
|
+
(D = d.current) == null || D.call(d, m);
|
|
4020
4035
|
}, []);
|
|
4021
4036
|
return I(() => {
|
|
4022
4037
|
const p = a.current;
|
|
4023
4038
|
if (!p) return;
|
|
4024
|
-
const
|
|
4025
|
-
return
|
|
4026
|
-
|
|
4039
|
+
const m = document.createElement("livelayer-widget");
|
|
4040
|
+
return m.setAttribute("agent-id", e), t && m.setAttribute("base-url", t), n && m.setAttribute("api-key", n), i && m.setAttribute("mode", i), m.addEventListener("agent-event", g), p.appendChild(m), c.current = m, () => {
|
|
4041
|
+
m.removeEventListener("agent-event", g), p.removeChild(m), c.current = null;
|
|
4027
4042
|
};
|
|
4028
4043
|
}, [e]), I(() => {
|
|
4029
4044
|
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
4030
4045
|
}, [i]), /* @__PURE__ */ r("div", { ref: a, className: o, style: s });
|
|
4031
|
-
}, Do =
|
|
4046
|
+
}, Do = on(
|
|
4032
4047
|
function({ id: t, intent: n, as: i = "div", className: l, style: o, children: s }, a) {
|
|
4033
|
-
return
|
|
4048
|
+
return Nr(
|
|
4034
4049
|
i,
|
|
4035
4050
|
{
|
|
4036
4051
|
ref: a,
|
|
@@ -4043,60 +4058,60 @@ const Ro = ({
|
|
|
4043
4058
|
);
|
|
4044
4059
|
}
|
|
4045
4060
|
);
|
|
4046
|
-
function
|
|
4047
|
-
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [l, o] = M({}), [s, a] = M(!1), [c,
|
|
4061
|
+
function zo(e = {}) {
|
|
4062
|
+
const { onFieldUpdate: t, onComplete: n, source: i = "all" } = e, [l, o] = M({}), [s, a] = M(!1), [c, d] = M(null), g = R(t), p = R(n), m = R(i);
|
|
4048
4063
|
I(() => {
|
|
4049
|
-
|
|
4064
|
+
g.current = t, p.current = n, m.current = i;
|
|
4050
4065
|
}, [t, n, i]);
|
|
4051
|
-
const
|
|
4066
|
+
const D = L(() => {
|
|
4052
4067
|
o({}), a(!1);
|
|
4053
4068
|
}, []);
|
|
4054
4069
|
return I(() => {
|
|
4055
4070
|
if (typeof window > "u") return;
|
|
4056
|
-
const
|
|
4057
|
-
var w,
|
|
4058
|
-
const
|
|
4059
|
-
if (
|
|
4060
|
-
if (
|
|
4061
|
-
if (
|
|
4071
|
+
const x = (C) => {
|
|
4072
|
+
var w, P;
|
|
4073
|
+
const y = C.detail;
|
|
4074
|
+
if (y) {
|
|
4075
|
+
if (y.phase === "field") {
|
|
4076
|
+
if (m.current !== "all" && y.source !== m.current)
|
|
4062
4077
|
return;
|
|
4063
4078
|
a(!0), o(
|
|
4064
|
-
(E) => E[
|
|
4079
|
+
(E) => E[y.fieldName] === y.value ? E : { ...E, [y.fieldName]: y.value }
|
|
4065
4080
|
);
|
|
4066
4081
|
try {
|
|
4067
|
-
(w =
|
|
4082
|
+
(w = g.current) == null || w.call(g, y);
|
|
4068
4083
|
} catch (E) {
|
|
4069
4084
|
console.warn("[LiveLayer] useCollect onFieldUpdate threw.", E);
|
|
4070
4085
|
}
|
|
4071
4086
|
return;
|
|
4072
4087
|
}
|
|
4073
|
-
if (
|
|
4074
|
-
const E =
|
|
4075
|
-
if (
|
|
4088
|
+
if (y.phase === "complete") {
|
|
4089
|
+
const E = y.result;
|
|
4090
|
+
if (m.current !== "all" && E.source !== m.current)
|
|
4076
4091
|
return;
|
|
4077
|
-
|
|
4092
|
+
d(E), a(!1);
|
|
4078
4093
|
try {
|
|
4079
|
-
(
|
|
4080
|
-
} catch (
|
|
4081
|
-
console.warn("[LiveLayer] useCollect onComplete threw.",
|
|
4094
|
+
(P = p.current) == null || P.call(p, E);
|
|
4095
|
+
} catch (b) {
|
|
4096
|
+
console.warn("[LiveLayer] useCollect onComplete threw.", b);
|
|
4082
4097
|
}
|
|
4083
4098
|
}
|
|
4084
4099
|
}
|
|
4085
4100
|
};
|
|
4086
|
-
return document.addEventListener("ll-collected",
|
|
4087
|
-
}, []), { fields: l, isCollecting: s, lastResult: c, reset:
|
|
4101
|
+
return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
|
|
4102
|
+
}, []), { fields: l, isCollecting: s, lastResult: c, reset: D };
|
|
4088
4103
|
}
|
|
4089
|
-
let
|
|
4090
|
-
function
|
|
4104
|
+
let Qn = 1;
|
|
4105
|
+
function $o({
|
|
4091
4106
|
onMount: e,
|
|
4092
4107
|
defaultOpen: t = !1,
|
|
4093
4108
|
storageKey: n = "ll-debug-open"
|
|
4094
4109
|
}) {
|
|
4095
|
-
const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [
|
|
4096
|
-
|
|
4110
|
+
const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [d, g] = M(!1), p = R(/* @__PURE__ */ new Set()), m = R([]), D = R(d);
|
|
4111
|
+
D.current = d, I(() => {
|
|
4097
4112
|
try {
|
|
4098
|
-
const
|
|
4099
|
-
|
|
4113
|
+
const y = localStorage.getItem(n);
|
|
4114
|
+
y === "1" && l(!0), y === "0" && l(!1);
|
|
4100
4115
|
} catch {
|
|
4101
4116
|
}
|
|
4102
4117
|
}, [n]), I(() => {
|
|
@@ -4105,48 +4120,48 @@ function zo({
|
|
|
4105
4120
|
} catch {
|
|
4106
4121
|
}
|
|
4107
4122
|
}, [i, n]), I(() => {
|
|
4108
|
-
const
|
|
4109
|
-
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((
|
|
4123
|
+
const y = (w) => {
|
|
4124
|
+
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((P) => !P));
|
|
4110
4125
|
};
|
|
4111
|
-
return window.addEventListener("keydown",
|
|
4126
|
+
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
4112
4127
|
}, []), I(() => {
|
|
4113
|
-
const
|
|
4114
|
-
if (
|
|
4115
|
-
const w =
|
|
4128
|
+
const y = setInterval(() => {
|
|
4129
|
+
if (m.current.length === 0 || D.current) return;
|
|
4130
|
+
const w = m.current.splice(0, m.current.length);
|
|
4116
4131
|
s(
|
|
4117
|
-
(
|
|
4132
|
+
(P) => [...w.reverse(), ...P].slice(0, 200)
|
|
4118
4133
|
);
|
|
4119
4134
|
}, 100);
|
|
4120
|
-
return () => clearInterval(
|
|
4135
|
+
return () => clearInterval(y);
|
|
4121
4136
|
}, []);
|
|
4122
|
-
const
|
|
4137
|
+
const x = R(!1);
|
|
4123
4138
|
if (I(() => {
|
|
4124
|
-
!e ||
|
|
4125
|
-
|
|
4126
|
-
id:
|
|
4139
|
+
!e || x.current || (x.current = !0, e((y) => {
|
|
4140
|
+
m.current.push({
|
|
4141
|
+
id: Qn++,
|
|
4127
4142
|
ts: Date.now(),
|
|
4128
4143
|
kind: "event",
|
|
4129
|
-
type:
|
|
4130
|
-
data:
|
|
4144
|
+
type: y.eventName,
|
|
4145
|
+
data: y.data
|
|
4131
4146
|
});
|
|
4132
4147
|
}));
|
|
4133
4148
|
}, [e]), I(() => {
|
|
4134
|
-
const
|
|
4149
|
+
const y = console.warn, w = console.log, P = (E, b) => function(...O) {
|
|
4135
4150
|
try {
|
|
4136
|
-
const
|
|
4137
|
-
|
|
4138
|
-
id:
|
|
4151
|
+
const v = typeof O[0] == "string" ? O[0] : "";
|
|
4152
|
+
v.startsWith("[LiveLayer]") && m.current.push({
|
|
4153
|
+
id: Qn++,
|
|
4139
4154
|
ts: Date.now(),
|
|
4140
4155
|
kind: E,
|
|
4141
|
-
type:
|
|
4156
|
+
type: v.slice(0, 120),
|
|
4142
4157
|
data: { args: O.slice(1).map((z) => Co(z)) }
|
|
4143
4158
|
});
|
|
4144
4159
|
} catch {
|
|
4145
4160
|
}
|
|
4146
|
-
return
|
|
4161
|
+
return b.apply(this, O);
|
|
4147
4162
|
};
|
|
4148
|
-
return console.warn =
|
|
4149
|
-
console.warn =
|
|
4163
|
+
return console.warn = P("warn", y), console.log = P("log", w), () => {
|
|
4164
|
+
console.warn = y, console.log = w;
|
|
4150
4165
|
};
|
|
4151
4166
|
}, []), !i)
|
|
4152
4167
|
return /* @__PURE__ */ r(
|
|
@@ -4175,10 +4190,10 @@ function zo({
|
|
|
4175
4190
|
children: "🛰 LL debug"
|
|
4176
4191
|
}
|
|
4177
4192
|
);
|
|
4178
|
-
const
|
|
4193
|
+
const C = o.filter((y) => {
|
|
4179
4194
|
if (!a) return !0;
|
|
4180
4195
|
const w = a.toLowerCase();
|
|
4181
|
-
return
|
|
4196
|
+
return y.type.toLowerCase().includes(w) || JSON.stringify(y.data || {}).toLowerCase().includes(w);
|
|
4182
4197
|
});
|
|
4183
4198
|
return /* @__PURE__ */ S(
|
|
4184
4199
|
"div",
|
|
@@ -4225,10 +4240,10 @@ function zo({
|
|
|
4225
4240
|
"button",
|
|
4226
4241
|
{
|
|
4227
4242
|
type: "button",
|
|
4228
|
-
onClick: () =>
|
|
4229
|
-
style:
|
|
4243
|
+
onClick: () => g((y) => !y),
|
|
4244
|
+
style: tn(d ? "#f59e0b" : "transparent"),
|
|
4230
4245
|
title: "Pause / resume capture",
|
|
4231
|
-
children:
|
|
4246
|
+
children: d ? "▶ resume" : "⏸ pause"
|
|
4232
4247
|
}
|
|
4233
4248
|
),
|
|
4234
4249
|
/* @__PURE__ */ r(
|
|
@@ -4236,9 +4251,9 @@ function zo({
|
|
|
4236
4251
|
{
|
|
4237
4252
|
type: "button",
|
|
4238
4253
|
onClick: () => {
|
|
4239
|
-
s([]),
|
|
4254
|
+
s([]), m.current = [];
|
|
4240
4255
|
},
|
|
4241
|
-
style:
|
|
4256
|
+
style: tn("transparent"),
|
|
4242
4257
|
title: "Clear buffer",
|
|
4243
4258
|
children: "clear"
|
|
4244
4259
|
}
|
|
@@ -4248,7 +4263,7 @@ function zo({
|
|
|
4248
4263
|
{
|
|
4249
4264
|
type: "button",
|
|
4250
4265
|
onClick: () => l(!1),
|
|
4251
|
-
style:
|
|
4266
|
+
style: tn("transparent"),
|
|
4252
4267
|
"aria-label": "Close",
|
|
4253
4268
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
4254
4269
|
children: "✕"
|
|
@@ -4262,7 +4277,7 @@ function zo({
|
|
|
4262
4277
|
{
|
|
4263
4278
|
type: "text",
|
|
4264
4279
|
value: a,
|
|
4265
|
-
onChange: (
|
|
4280
|
+
onChange: (y) => c(y.target.value),
|
|
4266
4281
|
placeholder: "filter by type or data…",
|
|
4267
4282
|
style: {
|
|
4268
4283
|
margin: 8,
|
|
@@ -4284,7 +4299,7 @@ function zo({
|
|
|
4284
4299
|
overflowY: "auto",
|
|
4285
4300
|
padding: "0 8px 8px"
|
|
4286
4301
|
},
|
|
4287
|
-
children:
|
|
4302
|
+
children: C.length === 0 ? /* @__PURE__ */ S(
|
|
4288
4303
|
"div",
|
|
4289
4304
|
{
|
|
4290
4305
|
style: {
|
|
@@ -4314,16 +4329,16 @@ function zo({
|
|
|
4314
4329
|
)
|
|
4315
4330
|
]
|
|
4316
4331
|
}
|
|
4317
|
-
) :
|
|
4332
|
+
) : C.map((y) => /* @__PURE__ */ r(
|
|
4318
4333
|
Lo,
|
|
4319
4334
|
{
|
|
4320
|
-
entry:
|
|
4321
|
-
expanded: p.current.has(
|
|
4335
|
+
entry: y,
|
|
4336
|
+
expanded: p.current.has(y.id),
|
|
4322
4337
|
onToggle: () => {
|
|
4323
|
-
p.current.has(
|
|
4338
|
+
p.current.has(y.id) ? p.current.delete(y.id) : p.current.add(y.id), s((w) => [...w]);
|
|
4324
4339
|
}
|
|
4325
4340
|
},
|
|
4326
|
-
|
|
4341
|
+
y.id
|
|
4327
4342
|
))
|
|
4328
4343
|
}
|
|
4329
4344
|
)
|
|
@@ -4401,7 +4416,7 @@ function Lo({
|
|
|
4401
4416
|
}
|
|
4402
4417
|
);
|
|
4403
4418
|
}
|
|
4404
|
-
function
|
|
4419
|
+
function tn(e) {
|
|
4405
4420
|
return {
|
|
4406
4421
|
background: e,
|
|
4407
4422
|
color: "#fff",
|
|
@@ -4419,15 +4434,15 @@ function Co(e) {
|
|
|
4419
4434
|
return String(e);
|
|
4420
4435
|
}
|
|
4421
4436
|
}
|
|
4422
|
-
function
|
|
4437
|
+
function So(e) {
|
|
4423
4438
|
const t = JSON.stringify(e);
|
|
4424
|
-
I(() =>
|
|
4439
|
+
I(() => Ir(e), [t]);
|
|
4425
4440
|
}
|
|
4426
|
-
function
|
|
4427
|
-
return
|
|
4441
|
+
function Ho({ fields: e, children: t }) {
|
|
4442
|
+
return So(e), /* @__PURE__ */ r(Ve, { children: t });
|
|
4428
4443
|
}
|
|
4429
|
-
function
|
|
4430
|
-
const [e, t] = M([]), n =
|
|
4444
|
+
function Oo() {
|
|
4445
|
+
const [e, t] = M([]), n = L((l) => {
|
|
4431
4446
|
t((o) => {
|
|
4432
4447
|
const s = o.findIndex((a) => a.id === l.id);
|
|
4433
4448
|
if (s >= 0) {
|
|
@@ -4436,7 +4451,7 @@ function Ho() {
|
|
|
4436
4451
|
}
|
|
4437
4452
|
return [...o, l];
|
|
4438
4453
|
});
|
|
4439
|
-
}, []), i =
|
|
4454
|
+
}, []), i = L(() => t([]), []);
|
|
4440
4455
|
return {
|
|
4441
4456
|
entries: e,
|
|
4442
4457
|
pushSegment: n,
|
|
@@ -4445,38 +4460,38 @@ function Ho() {
|
|
|
4445
4460
|
};
|
|
4446
4461
|
}
|
|
4447
4462
|
export {
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4463
|
+
ko as AvatarWidget,
|
|
4464
|
+
Pr as ErrorBoundary,
|
|
4465
|
+
Ho as FieldProvider,
|
|
4466
|
+
$o as LiveLayerDebugPanel,
|
|
4452
4467
|
Do as LiveLayerRegion,
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4468
|
+
Po as LiveLayerWidget,
|
|
4469
|
+
Wo as clearFieldRegistry,
|
|
4470
|
+
no as clearPageContextCache,
|
|
4471
|
+
so as clearRoutesCache,
|
|
4472
|
+
eo as extractPageContext,
|
|
4473
|
+
lo as extractRoutes,
|
|
4474
|
+
Xn as getCachedPageContext,
|
|
4475
|
+
Qt as getCachedRoutes,
|
|
4476
|
+
qo as getRegisteredFields,
|
|
4477
|
+
ci as matchesPattern,
|
|
4478
|
+
io as normalizeRouteInput,
|
|
4479
|
+
Uo as registerFields,
|
|
4480
|
+
jo as setFieldValue,
|
|
4481
|
+
ui as shouldRenderAtPath,
|
|
4482
|
+
qr as useAgentInfo,
|
|
4483
|
+
zr as useAudioLevel,
|
|
4484
|
+
Fr as useCameraState,
|
|
4485
|
+
zo as useCollect,
|
|
4486
|
+
jr as useDisplayMode,
|
|
4487
|
+
Gr as useDisplayModePersistence,
|
|
4488
|
+
Kr as useIsMobile,
|
|
4474
4489
|
Dr as useLiveKitSession,
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4490
|
+
Wr as useMediaDevices,
|
|
4491
|
+
Hr as useMicrophoneState,
|
|
4492
|
+
ii as usePathname,
|
|
4493
|
+
So as useRegisterFields,
|
|
4494
|
+
di as useRouteMatch,
|
|
4495
|
+
Br as useScreenShareState,
|
|
4496
|
+
Oo as useTranscript
|
|
4482
4497
|
};
|