@livelayer/react 0.23.3 → 0.23.5
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 +1360 -1321
- package/dist/styles.css +14 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as S, jsx as r, Fragment as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { LiveKitSession as
|
|
6
|
-
import { clearFieldRegistry as
|
|
7
|
-
import { createLocalAudioTrack as
|
|
8
|
-
class
|
|
2
|
+
import { jsxs as S, jsx as r, Fragment as Xe } from "react/jsx-runtime";
|
|
3
|
+
import { Component as zr, useState as M, useRef as R, useEffect as T, useCallback as k, useMemo as ut, useLayoutEffect as ar, forwardRef as un, useImperativeHandle as $r, createElement as Hr } from "react";
|
|
4
|
+
import { createPortal as dn } from "react-dom";
|
|
5
|
+
import { LiveKitSession as Or, registerFields as Fr } from "@livelayer/sdk";
|
|
6
|
+
import { clearFieldRegistry as Jo, getRegisteredFields as Zo, registerFields as Qo, setFieldValue as el } from "@livelayer/sdk";
|
|
7
|
+
import { createLocalAudioTrack as Br, Track as sr, createLocalVideoTrack as Wr } from "livekit-client";
|
|
8
|
+
class qr extends zr {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments), this.state = { hasError: !1, error: null }, this.reset = () => {
|
|
11
11
|
this.setState({ hasError: !1, error: null });
|
|
@@ -35,9 +35,9 @@ class Pr extends Er {
|
|
|
35
35
|
] }) : this.props.children;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
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), [
|
|
40
|
-
|
|
38
|
+
function Ur(e) {
|
|
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), [P, x] = M(!1), [L, y] = M(null), w = R(null), D = R(e.onDataMessage);
|
|
40
|
+
D.current = e.onDataMessage, T(() => {
|
|
41
41
|
const v = {
|
|
42
42
|
onConnectionStateChange: (B) => {
|
|
43
43
|
n(B), B === "connected" && y(null);
|
|
@@ -50,11 +50,11 @@ function Dr(e) {
|
|
|
50
50
|
onVideoTrackRemoved: () => g(null),
|
|
51
51
|
onError: (B) => y(B),
|
|
52
52
|
onDataMessage: (B) => {
|
|
53
|
-
var
|
|
54
|
-
(
|
|
53
|
+
var Z;
|
|
54
|
+
(Z = D.current) == null || Z.call(D, B);
|
|
55
55
|
},
|
|
56
56
|
onResumabilityChange: x
|
|
57
|
-
}, z = new
|
|
57
|
+
}, z = new Or(
|
|
58
58
|
{
|
|
59
59
|
agentId: e.agentId,
|
|
60
60
|
baseUrl: e.baseUrl,
|
|
@@ -75,7 +75,7 @@ function Dr(e) {
|
|
|
75
75
|
e.sessionEndpoint,
|
|
76
76
|
JSON.stringify(e.sessionBody ?? {})
|
|
77
77
|
]);
|
|
78
|
-
const E =
|
|
78
|
+
const E = k(async () => {
|
|
79
79
|
const v = w.current;
|
|
80
80
|
if (v)
|
|
81
81
|
try {
|
|
@@ -83,10 +83,10 @@ function Dr(e) {
|
|
|
83
83
|
} catch (z) {
|
|
84
84
|
throw y(z instanceof Error ? z.message : String(z)), z;
|
|
85
85
|
}
|
|
86
|
-
}, []), b =
|
|
86
|
+
}, []), b = k(() => {
|
|
87
87
|
const v = w.current;
|
|
88
88
|
v && v.disconnect();
|
|
89
|
-
}, []), O =
|
|
89
|
+
}, []), O = k(() => {
|
|
90
90
|
var v;
|
|
91
91
|
return ((v = w.current) == null ? void 0 : v.getRoom()) ?? null;
|
|
92
92
|
}, []);
|
|
@@ -97,116 +97,116 @@ function Dr(e) {
|
|
|
97
97
|
agentConfig: a,
|
|
98
98
|
videoElement: d,
|
|
99
99
|
audioElement: p,
|
|
100
|
-
canResume:
|
|
101
|
-
error:
|
|
100
|
+
canResume: P,
|
|
101
|
+
error: L,
|
|
102
102
|
connect: E,
|
|
103
103
|
disconnect: b,
|
|
104
104
|
getRoom: O,
|
|
105
105
|
session: w.current
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const e = R(null), t = R(/* @__PURE__ */ new Map()), n = R(null), i = R(/* @__PURE__ */ new Set()), l =
|
|
108
|
+
function jr() {
|
|
109
|
+
const e = R(null), t = R(/* @__PURE__ */ new Map()), n = R(null), i = R(/* @__PURE__ */ new Set()), l = k(() => {
|
|
110
110
|
const x = t.current;
|
|
111
111
|
if (x.size === 0) {
|
|
112
112
|
n.current = null;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
let
|
|
115
|
+
let L = 0;
|
|
116
116
|
for (const { analyser: y, buffer: w } of x.values()) {
|
|
117
117
|
y.getByteFrequencyData(w);
|
|
118
|
-
let
|
|
119
|
-
for (let b = 0; b < w.length; b++)
|
|
120
|
-
const E =
|
|
121
|
-
E >
|
|
118
|
+
let D = 0;
|
|
119
|
+
for (let b = 0; b < w.length; b++) D += w[b];
|
|
120
|
+
const E = D / w.length / 255;
|
|
121
|
+
E > L && (L = E);
|
|
122
122
|
}
|
|
123
123
|
for (const y of i.current)
|
|
124
124
|
try {
|
|
125
|
-
y(
|
|
125
|
+
y(L);
|
|
126
126
|
} catch (w) {
|
|
127
127
|
console.error("[useAudioLevel] subscriber threw:", w);
|
|
128
128
|
}
|
|
129
129
|
n.current = requestAnimationFrame(l);
|
|
130
|
-
}, []), o =
|
|
130
|
+
}, []), o = k(() => e.current ? e.current : typeof window > "u" || typeof AudioContext > "u" ? null : (e.current = new AudioContext(), e.current), []), s = k(() => {
|
|
131
131
|
n.current === null && t.current.size > 0 && (n.current = requestAnimationFrame(l));
|
|
132
|
-
}, [l]), a =
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
132
|
+
}, [l]), a = k((x) => {
|
|
133
|
+
const L = t.current.get(x);
|
|
134
|
+
if (L) {
|
|
135
135
|
try {
|
|
136
|
-
|
|
136
|
+
L.node.disconnect();
|
|
137
137
|
} catch {
|
|
138
138
|
}
|
|
139
139
|
try {
|
|
140
|
-
|
|
140
|
+
L.analyser.disconnect();
|
|
141
141
|
} catch {
|
|
142
142
|
}
|
|
143
143
|
t.current.delete(x);
|
|
144
144
|
}
|
|
145
|
-
}, []), c =
|
|
146
|
-
(x,
|
|
145
|
+
}, []), c = k(
|
|
146
|
+
(x, L) => {
|
|
147
147
|
const y = o();
|
|
148
148
|
if (!y) return;
|
|
149
149
|
a(x);
|
|
150
|
-
const w =
|
|
150
|
+
const w = L(y);
|
|
151
151
|
if (!w) return;
|
|
152
|
-
const
|
|
153
|
-
|
|
152
|
+
const D = y.createAnalyser();
|
|
153
|
+
D.fftSize = 64;
|
|
154
154
|
try {
|
|
155
|
-
w.connect(
|
|
155
|
+
w.connect(D);
|
|
156
156
|
} catch (E) {
|
|
157
157
|
console.warn("[useAudioLevel] connect failed for slot", x, E);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
t.current.set(x, {
|
|
161
|
-
analyser:
|
|
161
|
+
analyser: D,
|
|
162
162
|
node: w,
|
|
163
|
-
buffer: new Uint8Array(new ArrayBuffer(
|
|
163
|
+
buffer: new Uint8Array(new ArrayBuffer(D.frequencyBinCount))
|
|
164
164
|
}), s();
|
|
165
165
|
},
|
|
166
166
|
[a, o, s]
|
|
167
|
-
), d =
|
|
168
|
-
(x,
|
|
169
|
-
c(
|
|
167
|
+
), d = k(
|
|
168
|
+
(x, L = "agent") => {
|
|
169
|
+
c(L, (y) => {
|
|
170
170
|
try {
|
|
171
171
|
return y.createMediaElementSource(x);
|
|
172
172
|
} catch (w) {
|
|
173
173
|
return console.warn(
|
|
174
174
|
"[useAudioLevel] createMediaElementSource failed for slot",
|
|
175
|
-
|
|
175
|
+
L,
|
|
176
176
|
w
|
|
177
177
|
), null;
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
},
|
|
181
181
|
[c]
|
|
182
|
-
), g =
|
|
183
|
-
(x,
|
|
184
|
-
c(
|
|
182
|
+
), g = k(
|
|
183
|
+
(x, L = "mic") => {
|
|
184
|
+
c(L, (y) => {
|
|
185
185
|
try {
|
|
186
186
|
return y.createMediaStreamSource(x);
|
|
187
187
|
} catch (w) {
|
|
188
188
|
return console.warn(
|
|
189
189
|
"[useAudioLevel] createMediaStreamSource failed for slot",
|
|
190
|
-
|
|
190
|
+
L,
|
|
191
191
|
w
|
|
192
192
|
), null;
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
},
|
|
196
196
|
[c]
|
|
197
|
-
), p =
|
|
197
|
+
), p = k(
|
|
198
198
|
(x) => {
|
|
199
199
|
a(x), t.current.size === 0 && n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
200
200
|
},
|
|
201
201
|
[a]
|
|
202
|
-
), m =
|
|
202
|
+
), m = k(() => {
|
|
203
203
|
n.current !== null && (cancelAnimationFrame(n.current), n.current = null);
|
|
204
204
|
for (const x of Array.from(t.current.keys()))
|
|
205
205
|
a(x);
|
|
206
|
-
}, [a]),
|
|
206
|
+
}, [a]), P = k((x) => (i.current.add(x), () => {
|
|
207
207
|
i.current.delete(x);
|
|
208
208
|
}), []);
|
|
209
|
-
return
|
|
209
|
+
return T(() => () => {
|
|
210
210
|
if (m(), e.current) {
|
|
211
211
|
try {
|
|
212
212
|
e.current.close();
|
|
@@ -215,17 +215,17 @@ function zr() {
|
|
|
215
215
|
e.current = null;
|
|
216
216
|
}
|
|
217
217
|
i.current.clear();
|
|
218
|
-
}, [m]), { attach: d, attachStream: g, detach: m, detachSlot: p, subscribe:
|
|
218
|
+
}, [m]), { attach: d, attachStream: g, detach: m, detachSlot: p, subscribe: P };
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Vr(e) {
|
|
221
221
|
const t = e == null ? void 0 : e.mediaStreamTrack;
|
|
222
222
|
return t ? new MediaStream([t]) : null;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Yr(e = {}) {
|
|
225
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
|
-
}), m =
|
|
228
|
+
}), m = k(async (E) => {
|
|
229
229
|
var b, O;
|
|
230
230
|
if (d.current && g.current) {
|
|
231
231
|
try {
|
|
@@ -236,7 +236,7 @@ function Hr(e = {}) {
|
|
|
236
236
|
}
|
|
237
237
|
g.current = E, c(null);
|
|
238
238
|
try {
|
|
239
|
-
const v = await
|
|
239
|
+
const v = await Br({
|
|
240
240
|
echoCancellation: !0,
|
|
241
241
|
noiseSuppression: !0
|
|
242
242
|
});
|
|
@@ -247,9 +247,9 @@ function Hr(e = {}) {
|
|
|
247
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
248
|
throw c(z), v;
|
|
249
249
|
}
|
|
250
|
-
}, []),
|
|
250
|
+
}, []), P = k((E) => {
|
|
251
251
|
g.current = E;
|
|
252
|
-
}, []), x =
|
|
252
|
+
}, []), x = k(async (E) => {
|
|
253
253
|
const b = g.current;
|
|
254
254
|
if (b)
|
|
255
255
|
try {
|
|
@@ -257,7 +257,7 @@ function Hr(e = {}) {
|
|
|
257
257
|
} catch (O) {
|
|
258
258
|
console.warn("[useMicrophoneState] switchDevice failed:", O);
|
|
259
259
|
}
|
|
260
|
-
}, []),
|
|
260
|
+
}, []), L = k(async () => {
|
|
261
261
|
const E = g.current, b = !i;
|
|
262
262
|
if (l(b), p.current.active = !1, !!E)
|
|
263
263
|
try {
|
|
@@ -266,7 +266,7 @@ function Hr(e = {}) {
|
|
|
266
266
|
console.warn("[useMicrophoneState] setMicrophoneEnabled failed:", O), l(!b);
|
|
267
267
|
}
|
|
268
268
|
}, [i]);
|
|
269
|
-
|
|
269
|
+
T(() => {
|
|
270
270
|
if (!p.current.active || n !== "listening") return;
|
|
271
271
|
const E = g.current, b = E == null ? void 0 : E.localParticipant;
|
|
272
272
|
if (!b) {
|
|
@@ -275,7 +275,7 @@ function Hr(e = {}) {
|
|
|
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 y =
|
|
278
|
+
const y = k(() => {
|
|
279
279
|
const E = d.current, b = g.current;
|
|
280
280
|
if (E && b) {
|
|
281
281
|
try {
|
|
@@ -285,29 +285,29 @@ function Hr(e = {}) {
|
|
|
285
285
|
E.stop();
|
|
286
286
|
}
|
|
287
287
|
d.current = null, g.current = null, p.current = { active: t, lastAutoIntent: null }, l(t), s("");
|
|
288
|
-
}, [t]), w =
|
|
288
|
+
}, [t]), w = k(() => c(null), []), D = k(() => Vr(d.current), []);
|
|
289
289
|
return {
|
|
290
290
|
isMuted: i,
|
|
291
291
|
activeDeviceId: o,
|
|
292
292
|
micError: a,
|
|
293
|
-
toggleMute:
|
|
293
|
+
toggleMute: L,
|
|
294
294
|
setupMic: m,
|
|
295
|
-
attachRoom:
|
|
295
|
+
attachRoom: P,
|
|
296
296
|
switchDevice: x,
|
|
297
297
|
teardownMic: y,
|
|
298
298
|
clearError: w,
|
|
299
|
-
getMicStream:
|
|
299
|
+
getMicStream: D
|
|
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 = R(null), d = R(null), g =
|
|
302
|
+
const Gr = { resolution: { width: 640, height: 480, frameRate: 24 } };
|
|
303
|
+
function Xr() {
|
|
304
|
+
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), [s, a] = M(""), c = R(null), d = R(null), g = k((w) => {
|
|
305
305
|
c.current = w;
|
|
306
|
-
}, []), p =
|
|
306
|
+
}, []), p = k(() => {
|
|
307
307
|
var E;
|
|
308
|
-
const w = c.current,
|
|
309
|
-
if (
|
|
310
|
-
const b = w.localParticipant.getTrackPublication(
|
|
308
|
+
const w = c.current, D = d.current;
|
|
309
|
+
if (D && w) {
|
|
310
|
+
const b = w.localParticipant.getTrackPublication(sr.Source.Camera), v = (b == null ? void 0 : b.track) ?? D;
|
|
311
311
|
try {
|
|
312
312
|
w.localParticipant.unpublishTrack(v);
|
|
313
313
|
} catch {
|
|
@@ -318,19 +318,19 @@ function Fr() {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
d.current = null, o(null), t(!1);
|
|
321
|
-
}, []), m =
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
321
|
+
}, []), m = k(async (w) => {
|
|
322
|
+
const D = c.current;
|
|
323
|
+
if (D) {
|
|
324
324
|
i(null);
|
|
325
325
|
try {
|
|
326
|
-
const E = { ...
|
|
326
|
+
const E = { ...Gr };
|
|
327
327
|
w && (E.deviceId = w);
|
|
328
|
-
const b = await
|
|
329
|
-
await
|
|
328
|
+
const b = await Wr(E);
|
|
329
|
+
await D.localParticipant.publishTrack(b), d.current = b;
|
|
330
330
|
const O = b.attach();
|
|
331
331
|
o(O), t(!0), w && a(w);
|
|
332
332
|
try {
|
|
333
|
-
|
|
333
|
+
D.localParticipant.publishData(
|
|
334
334
|
new TextEncoder().encode(JSON.stringify({ type: "user_camera_on" })),
|
|
335
335
|
{ reliable: !0 }
|
|
336
336
|
);
|
|
@@ -341,31 +341,31 @@ function Fr() {
|
|
|
341
341
|
i(b);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
}, []),
|
|
344
|
+
}, []), P = k(async () => {
|
|
345
345
|
e ? p() : await m(s || void 0);
|
|
346
|
-
}, [e, s, p, m]), x =
|
|
346
|
+
}, [e, s, p, m]), x = k(async (w) => {
|
|
347
347
|
p(), await m(w);
|
|
348
|
-
}, [p, m]),
|
|
348
|
+
}, [p, m]), L = k(() => {
|
|
349
349
|
p(), c.current = null, i(null), a("");
|
|
350
|
-
}, [p]), y =
|
|
351
|
-
return
|
|
350
|
+
}, [p]), y = k(() => i(null), []);
|
|
351
|
+
return T(() => () => {
|
|
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:
|
|
358
|
+
toggle: P,
|
|
359
359
|
switchDevice: x,
|
|
360
360
|
attachRoom: g,
|
|
361
|
-
teardown:
|
|
361
|
+
teardown: L,
|
|
362
362
|
clearError: y
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = R(null), a =
|
|
365
|
+
function Kr() {
|
|
366
|
+
const [e, t] = M(!1), [n, i] = M(null), [l, o] = M(null), s = R(null), a = k((m) => {
|
|
367
367
|
s.current = m;
|
|
368
|
-
}, []), c =
|
|
368
|
+
}, []), c = k(() => o(null), []), d = k(async () => {
|
|
369
369
|
const m = s.current;
|
|
370
370
|
if (m) {
|
|
371
371
|
if (e) {
|
|
@@ -379,11 +379,11 @@ function Br() {
|
|
|
379
379
|
i(null);
|
|
380
380
|
try {
|
|
381
381
|
await m.localParticipant.setScreenShareEnabled(!0);
|
|
382
|
-
let
|
|
382
|
+
let P = 0;
|
|
383
383
|
const x = () => {
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
const y =
|
|
384
|
+
const L = m.localParticipant.getTrackPublication(sr.Source.ScreenShare);
|
|
385
|
+
if (L != null && L.track) {
|
|
386
|
+
const y = L.track.attach();
|
|
387
387
|
o(y), t(!0);
|
|
388
388
|
try {
|
|
389
389
|
m.localParticipant.publishData(
|
|
@@ -394,15 +394,15 @@ function Br() {
|
|
|
394
394
|
}
|
|
395
395
|
return;
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
P++ < 10 ? setTimeout(x, 100) : t(!0);
|
|
398
398
|
};
|
|
399
399
|
x();
|
|
400
|
-
} catch (
|
|
401
|
-
const x =
|
|
400
|
+
} catch (P) {
|
|
401
|
+
const x = P instanceof Error ? P.name : "";
|
|
402
402
|
x !== "NotAllowedError" && x !== "AbortError" && i("Screen share unavailable. Try again."), t(!1);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
}, [e, c]), g =
|
|
405
|
+
}, [e, c]), g = k(() => {
|
|
406
406
|
const m = s.current;
|
|
407
407
|
if (m && e)
|
|
408
408
|
try {
|
|
@@ -410,11 +410,11 @@ function Br() {
|
|
|
410
410
|
} catch {
|
|
411
411
|
}
|
|
412
412
|
c(), t(!1), i(null), s.current = null;
|
|
413
|
-
}, [e, c]), p =
|
|
413
|
+
}, [e, c]), p = k(() => i(null), []);
|
|
414
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 Jr() {
|
|
417
|
+
const [e, t] = M([]), [n, i] = M([]), l = k(async () => {
|
|
418
418
|
if (!(typeof navigator > "u" || !navigator.mediaDevices))
|
|
419
419
|
try {
|
|
420
420
|
const o = await navigator.mediaDevices.enumerateDevices();
|
|
@@ -422,15 +422,15 @@ function Wr() {
|
|
|
422
422
|
} catch {
|
|
423
423
|
}
|
|
424
424
|
}, []);
|
|
425
|
-
return
|
|
425
|
+
return T(() => {
|
|
426
426
|
if (l(), typeof navigator > "u" || !navigator.mediaDevices) return;
|
|
427
427
|
const o = () => void l();
|
|
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 Zr(e, t, n = !1) {
|
|
432
432
|
const [i, l] = M(null), [o, s] = M(null), [a, c] = M(!n && !!e);
|
|
433
|
-
return
|
|
433
|
+
return T(() => {
|
|
434
434
|
if (n || !e) {
|
|
435
435
|
c(!1);
|
|
436
436
|
return;
|
|
@@ -451,7 +451,7 @@ function qr(e, t, n = !1) {
|
|
|
451
451
|
}), () => d.abort();
|
|
452
452
|
}, [e, t, n]), { info: i, error: o, loading: a };
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function cr(e) {
|
|
455
455
|
if (typeof window > "u") return null;
|
|
456
456
|
try {
|
|
457
457
|
return window.localStorage.getItem(e);
|
|
@@ -459,26 +459,26 @@ function nr(e) {
|
|
|
459
459
|
return null;
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function ur(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 Qr(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 ei({
|
|
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 = k(
|
|
482
482
|
(c) => {
|
|
483
483
|
c !== s && (i || o(c), n == null || n(c));
|
|
484
484
|
},
|
|
@@ -486,34 +486,34 @@ function jr({
|
|
|
486
486
|
);
|
|
487
487
|
return [s, a];
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
function
|
|
491
|
-
return e &&
|
|
489
|
+
const ti = ["hidden", "minimized", "expanded"];
|
|
490
|
+
function ni(e) {
|
|
491
|
+
return e && ti.includes(e) ? e : null;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function ri({
|
|
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 = R(!1), [a, c] =
|
|
500
|
+
const o = `${i}:display-mode`, s = R(!1), [a, c] = ei({
|
|
501
501
|
value: e,
|
|
502
502
|
defaultValue: t,
|
|
503
503
|
onChange: (d) => {
|
|
504
|
-
e === void 0 && !l &&
|
|
504
|
+
e === void 0 && !l && ur(o, d), n == null || n(d);
|
|
505
505
|
}
|
|
506
506
|
});
|
|
507
|
-
return
|
|
507
|
+
return T(() => {
|
|
508
508
|
if (s.current || (s.current = !0, l || e !== void 0)) return;
|
|
509
|
-
const d =
|
|
509
|
+
const d = ni(cr(o));
|
|
510
510
|
d && d !== a && c(d);
|
|
511
511
|
}, []), [a, c];
|
|
512
512
|
}
|
|
513
|
-
const
|
|
514
|
-
function
|
|
513
|
+
const ii = 640;
|
|
514
|
+
function oi(e = ii) {
|
|
515
515
|
const [t, n] = M(!1);
|
|
516
|
-
return
|
|
516
|
+
return T(() => {
|
|
517
517
|
if (e === !1) {
|
|
518
518
|
n(!1);
|
|
519
519
|
return;
|
|
@@ -526,11 +526,11 @@ function Kr(e = Xr) {
|
|
|
526
526
|
});
|
|
527
527
|
}, [e]), t;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
function
|
|
529
|
+
const li = 280, ai = 380, si = 8, ci = 4;
|
|
530
|
+
function tn(e) {
|
|
531
531
|
return `${e}:geometry`;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function ui(e) {
|
|
534
534
|
if (!e) return null;
|
|
535
535
|
let t;
|
|
536
536
|
try {
|
|
@@ -542,91 +542,91 @@ function ti(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 Wt() {
|
|
546
546
|
return typeof window > "u" ? { vw: 0, vh: 0 } : { vw: window.innerWidth, vh: window.innerHeight };
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function nn(e, t, n) {
|
|
549
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
552
|
height: Math.max(l, Math.min(d, t))
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function rn(e, t, n, i, l) {
|
|
556
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
558
|
top: Math.max(d, Math.min(p, e)),
|
|
559
559
|
left: Math.max(c, Math.min(g, t))
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function di(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, d] = M(null), [g, p] = M(!1), [m,
|
|
568
|
+
minWidth: o = li,
|
|
569
|
+
minHeight: s = ai,
|
|
570
|
+
edgeMargin: a = si
|
|
571
|
+
} = e, [c, d] = M(null), [g, p] = M(!1), [m, P] = M(!1), x = R(null), L = R(null), y = R(!1), w = R(null);
|
|
572
572
|
w.current = c;
|
|
573
|
-
const
|
|
573
|
+
const D = k(
|
|
574
574
|
(f) => {
|
|
575
|
-
l || (f === null ?
|
|
575
|
+
l || (f === null ? Qr(tn(i)) : ur(tn(i), JSON.stringify(f)));
|
|
576
576
|
},
|
|
577
577
|
[l, i]
|
|
578
578
|
);
|
|
579
|
-
|
|
579
|
+
T(() => {
|
|
580
580
|
if (y.current || (y.current = !0, l)) return;
|
|
581
|
-
const f =
|
|
581
|
+
const f = ui(cr(tn(i)));
|
|
582
582
|
if (!f) return;
|
|
583
|
-
const { vw:
|
|
583
|
+
const { vw: N, vh: $ } = Wt(), U = nn(f.width, f.height, {
|
|
584
584
|
minWidth: o,
|
|
585
585
|
minHeight: s,
|
|
586
586
|
edgeMargin: a,
|
|
587
|
-
vw:
|
|
587
|
+
vw: N,
|
|
588
588
|
vh: $
|
|
589
|
-
}),
|
|
589
|
+
}), K = rn(f.top, f.left, U.width, U.height, {
|
|
590
590
|
edgeMargin: a,
|
|
591
|
-
vw:
|
|
591
|
+
vw: N,
|
|
592
592
|
vh: $
|
|
593
593
|
});
|
|
594
|
-
d({ ...
|
|
595
|
-
}, []),
|
|
594
|
+
d({ ...K, ...U });
|
|
595
|
+
}, []), T(() => {
|
|
596
596
|
if (typeof window > "u") return;
|
|
597
597
|
const f = () => {
|
|
598
|
-
d((
|
|
599
|
-
if (
|
|
600
|
-
const { vw: $, vh:
|
|
598
|
+
d((N) => {
|
|
599
|
+
if (N === null) return null;
|
|
600
|
+
const { vw: $, vh: U } = Wt(), K = nn(N.width, N.height, {
|
|
601
601
|
minWidth: o,
|
|
602
602
|
minHeight: s,
|
|
603
603
|
edgeMargin: a,
|
|
604
604
|
vw: $,
|
|
605
|
-
vh:
|
|
605
|
+
vh: U
|
|
606
606
|
});
|
|
607
|
-
return { ...
|
|
607
|
+
return { ...rn(N.top, N.left, K.width, K.height, {
|
|
608
608
|
edgeMargin: a,
|
|
609
609
|
vw: $,
|
|
610
|
-
vh:
|
|
611
|
-
}), ...
|
|
610
|
+
vh: U
|
|
611
|
+
}), ...K };
|
|
612
612
|
});
|
|
613
613
|
};
|
|
614
614
|
return window.addEventListener("resize", f), () => window.removeEventListener("resize", f);
|
|
615
615
|
}, [o, s, a]);
|
|
616
|
-
const E =
|
|
616
|
+
const E = k(
|
|
617
617
|
(f) => {
|
|
618
618
|
if (!t || f.pointerType === "mouse" && f.button !== 0) return;
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
619
|
+
const N = f.target;
|
|
620
|
+
if (N && typeof N.closest == "function" && N.closest('button, a, input, select, textarea, [role="listbox"], [role="option"], [data-ll-no-drag]'))
|
|
621
621
|
return;
|
|
622
|
-
let $,
|
|
622
|
+
let $, U, K, re;
|
|
623
623
|
const W = w.current;
|
|
624
624
|
if (W)
|
|
625
|
-
({ top: $, left:
|
|
625
|
+
({ top: $, left: U, width: K, height: re } = W);
|
|
626
626
|
else {
|
|
627
|
-
const
|
|
628
|
-
if (!
|
|
629
|
-
$ =
|
|
627
|
+
const ie = f.currentTarget.closest(".ll-widget"), le = ie == null ? void 0 : ie.getBoundingClientRect();
|
|
628
|
+
if (!le) return;
|
|
629
|
+
$ = le.top, U = le.left, K = le.width, re = le.height;
|
|
630
630
|
}
|
|
631
631
|
try {
|
|
632
632
|
f.currentTarget.setPointerCapture(f.pointerId);
|
|
@@ -636,97 +636,97 @@ function ni(e) {
|
|
|
636
636
|
startClientX: f.clientX,
|
|
637
637
|
startClientY: f.clientY,
|
|
638
638
|
startTop: $,
|
|
639
|
-
startLeft:
|
|
640
|
-
width:
|
|
641
|
-
height:
|
|
639
|
+
startLeft: U,
|
|
640
|
+
width: K,
|
|
641
|
+
height: re,
|
|
642
642
|
moved: !1
|
|
643
643
|
};
|
|
644
644
|
},
|
|
645
645
|
[t]
|
|
646
|
-
), b =
|
|
646
|
+
), b = k(
|
|
647
647
|
(f) => {
|
|
648
|
-
const
|
|
649
|
-
if (!
|
|
650
|
-
const $ = f.clientX -
|
|
651
|
-
if (!
|
|
652
|
-
const { vw:
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
{ edgeMargin: a, vw:
|
|
648
|
+
const N = x.current;
|
|
649
|
+
if (!N) return;
|
|
650
|
+
const $ = f.clientX - N.startClientX, U = f.clientY - N.startClientY;
|
|
651
|
+
if (!N.moved && Math.abs($) + Math.abs(U) > ci && (N.moved = !0, p(!0)), !N.moved) return;
|
|
652
|
+
const { vw: K, vh: re } = Wt(), W = rn(
|
|
653
|
+
N.startTop + U,
|
|
654
|
+
N.startLeft + $,
|
|
655
|
+
N.width,
|
|
656
|
+
N.height,
|
|
657
|
+
{ edgeMargin: a, vw: K, vh: re }
|
|
658
658
|
);
|
|
659
|
-
d({ ...W, width:
|
|
659
|
+
d({ ...W, width: N.width, height: N.height });
|
|
660
660
|
},
|
|
661
661
|
[a]
|
|
662
|
-
), O =
|
|
662
|
+
), O = k(
|
|
663
663
|
(f) => {
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
664
|
+
const N = x.current;
|
|
665
|
+
if (N) {
|
|
666
666
|
try {
|
|
667
667
|
f.currentTarget.releasePointerCapture(f.pointerId);
|
|
668
668
|
} catch {
|
|
669
669
|
}
|
|
670
|
-
x.current = null,
|
|
670
|
+
x.current = null, N.moved && (p(!1), d(($) => ($ && D($), $)));
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
|
-
[
|
|
674
|
-
), v =
|
|
675
|
-
x.current = null,
|
|
676
|
-
}, [
|
|
673
|
+
[D]
|
|
674
|
+
), v = k(() => {
|
|
675
|
+
x.current = null, L.current = null, p(!1), P(!1), d(null), D(null);
|
|
676
|
+
}, [D]), z = k(
|
|
677
677
|
(f) => {
|
|
678
678
|
if (!n || f.pointerType === "mouse" && f.button !== 0) return;
|
|
679
679
|
f.stopPropagation();
|
|
680
|
-
let
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
683
|
-
({ top:
|
|
680
|
+
let N, $, U, K;
|
|
681
|
+
const re = w.current;
|
|
682
|
+
if (re)
|
|
683
|
+
({ top: N, left: $, width: U, height: K } = re);
|
|
684
684
|
else {
|
|
685
|
-
const W = f.currentTarget.closest(".ll-widget"),
|
|
686
|
-
if (!
|
|
687
|
-
|
|
685
|
+
const W = f.currentTarget.closest(".ll-widget"), ie = W == null ? void 0 : W.getBoundingClientRect();
|
|
686
|
+
if (!ie) return;
|
|
687
|
+
N = ie.top, $ = ie.left, U = ie.width, K = ie.height;
|
|
688
688
|
}
|
|
689
689
|
try {
|
|
690
690
|
f.currentTarget.setPointerCapture(f.pointerId);
|
|
691
691
|
} catch {
|
|
692
692
|
}
|
|
693
|
-
|
|
693
|
+
L.current = {
|
|
694
694
|
startClientX: f.clientX,
|
|
695
695
|
startClientY: f.clientY,
|
|
696
|
-
startWidth:
|
|
697
|
-
startHeight:
|
|
698
|
-
top:
|
|
696
|
+
startWidth: U,
|
|
697
|
+
startHeight: K,
|
|
698
|
+
top: N,
|
|
699
699
|
left: $
|
|
700
|
-
},
|
|
700
|
+
}, P(!0);
|
|
701
701
|
},
|
|
702
702
|
[n]
|
|
703
|
-
), B =
|
|
703
|
+
), B = k(
|
|
704
704
|
(f) => {
|
|
705
|
-
const
|
|
706
|
-
if (!
|
|
707
|
-
const $ = f.clientX -
|
|
705
|
+
const N = L.current;
|
|
706
|
+
if (!N) return;
|
|
707
|
+
const $ = f.clientX - N.startClientX, U = f.clientY - N.startClientY, { vw: K, vh: re } = Wt(), W = K - N.left - a, ie = re - N.top - a, le = nn(N.startWidth + $, N.startHeight + U, {
|
|
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
|
-
vw: Math.min(
|
|
714
|
-
vh: Math.min(
|
|
713
|
+
vw: Math.min(K, N.left + W + a),
|
|
714
|
+
vh: Math.min(re, N.top + ie + a)
|
|
715
715
|
});
|
|
716
|
-
d({ top:
|
|
716
|
+
d({ top: N.top, left: N.left, ...le });
|
|
717
717
|
},
|
|
718
718
|
[a, o, s]
|
|
719
|
-
),
|
|
719
|
+
), Z = k(
|
|
720
720
|
(f) => {
|
|
721
|
-
if (
|
|
721
|
+
if (L.current) {
|
|
722
722
|
try {
|
|
723
723
|
f.currentTarget.releasePointerCapture(f.pointerId);
|
|
724
724
|
} catch {
|
|
725
725
|
}
|
|
726
|
-
|
|
726
|
+
L.current = null, P(!1), d(($) => ($ && D($), $));
|
|
727
727
|
}
|
|
728
728
|
},
|
|
729
|
-
[
|
|
729
|
+
[D]
|
|
730
730
|
);
|
|
731
731
|
return {
|
|
732
732
|
style: c === null ? {} : {
|
|
@@ -752,82 +752,82 @@ function ni(e) {
|
|
|
752
752
|
resizeHandleProps: {
|
|
753
753
|
onPointerDown: z,
|
|
754
754
|
onPointerMove: B,
|
|
755
|
-
onPointerUp:
|
|
756
|
-
onPointerCancel:
|
|
755
|
+
onPointerUp: Z,
|
|
756
|
+
onPointerCancel: Z,
|
|
757
757
|
"data-ll-resize-handle": n ? "" : void 0
|
|
758
758
|
},
|
|
759
759
|
reset: v
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
function
|
|
764
|
-
if (typeof window > "u" || window.history[
|
|
762
|
+
const $n = "__llHistoryPatched", jt = "ll:pathname";
|
|
763
|
+
function fi() {
|
|
764
|
+
if (typeof window > "u" || window.history[$n]) 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(jt)), 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(jt)), i;
|
|
772
|
+
}, window.history[$n] = !0;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function Hn() {
|
|
775
775
|
return typeof window > "u" ? "/" : window.location.pathname || "/";
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function pi(e) {
|
|
778
778
|
const [t, n] = M(
|
|
779
|
-
() => e ??
|
|
779
|
+
() => e ?? Hn()
|
|
780
780
|
);
|
|
781
|
-
return
|
|
781
|
+
return T(() => {
|
|
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
|
+
fi();
|
|
784
|
+
const i = () => n(Hn());
|
|
785
|
+
return i(), window.addEventListener("popstate", i), window.addEventListener(jt, i), () => {
|
|
786
|
+
window.removeEventListener("popstate", i), window.removeEventListener(jt, i);
|
|
787
787
|
};
|
|
788
788
|
}, [e]), e ?? t;
|
|
789
789
|
}
|
|
790
|
-
const
|
|
791
|
-
function
|
|
792
|
-
return e.replace(
|
|
790
|
+
const On = /* @__PURE__ */ new Map(), hi = /[\\^$+?.()|{}[\]]/g;
|
|
791
|
+
function mi(e) {
|
|
792
|
+
return e.replace(hi, "\\$&");
|
|
793
793
|
}
|
|
794
|
-
function
|
|
795
|
-
const t =
|
|
794
|
+
function gi(e) {
|
|
795
|
+
const t = On.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 = mi(o).replace(new RegExp(`\\/${i}`, "g"), "(?:\\/.*)?").replace(new RegExp(i, "g"), ".*").replace(new RegExp(l, "g"), "[^/]+"), c = new RegExp(`^${a}\\/?$`);
|
|
798
|
+
return On.set(e, c), c;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function yi(e, t) {
|
|
801
801
|
const n = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
802
|
-
return
|
|
802
|
+
return gi(e).test(n);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) :
|
|
804
|
+
function vi(e, t) {
|
|
805
|
+
return typeof e == "function" ? e(t) : e instanceof RegExp ? e.test(t) : yi(e, t);
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function Fn(e, t) {
|
|
808
808
|
if (!e || e.length === 0) return !1;
|
|
809
809
|
for (const n of e)
|
|
810
|
-
if (
|
|
810
|
+
if (vi(n, t)) return !0;
|
|
811
811
|
return !1;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
return e === void 0 ? !0 :
|
|
813
|
+
function bi(e, t, n) {
|
|
814
|
+
return e === void 0 ? !0 : Fn(n, e) ? !1 : t && t.length > 0 ? Fn(t, e) : !0;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
818
|
-
() =>
|
|
816
|
+
function wi(e, t, n) {
|
|
817
|
+
return ut(
|
|
818
|
+
() => bi(e, t, n),
|
|
819
819
|
[e, t, n]
|
|
820
820
|
);
|
|
821
821
|
}
|
|
822
|
-
function
|
|
822
|
+
function _i(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 =
|
|
829
|
+
function xi(e) {
|
|
830
|
+
const t = ut(() => _i(e.config), [e.config]), n = e.baseUrl.replace(/\/+$/, ""), i = R(null), l = k(
|
|
831
831
|
(c) => {
|
|
832
832
|
try {
|
|
833
833
|
new Audio(`${n}${c}`).play().catch(() => {
|
|
@@ -836,11 +836,11 @@ function pi(e) {
|
|
|
836
836
|
}
|
|
837
837
|
},
|
|
838
838
|
[n]
|
|
839
|
-
), o =
|
|
839
|
+
), o = k(() => {
|
|
840
840
|
t.navigate && l("/audio/page-change-sound.mp3");
|
|
841
|
-
}, [t.navigate, l]), s =
|
|
841
|
+
}, [t.navigate, l]), s = k(() => {
|
|
842
842
|
t.action && l("/audio/confirmation-sound.mp3");
|
|
843
|
-
}, [t.action, l]), a =
|
|
843
|
+
}, [t.action, l]), a = k(
|
|
844
844
|
(c) => {
|
|
845
845
|
if (!t.thinking) {
|
|
846
846
|
if (i.current) {
|
|
@@ -871,7 +871,7 @@ function pi(e) {
|
|
|
871
871
|
},
|
|
872
872
|
[n, t.thinking]
|
|
873
873
|
);
|
|
874
|
-
return
|
|
874
|
+
return T(() => () => {
|
|
875
875
|
if (i.current) {
|
|
876
876
|
try {
|
|
877
877
|
i.current.pause();
|
|
@@ -879,12 +879,12 @@ function pi(e) {
|
|
|
879
879
|
}
|
|
880
880
|
i.current = null;
|
|
881
881
|
}
|
|
882
|
-
}, []),
|
|
882
|
+
}, []), ut(
|
|
883
883
|
() => ({ playPageChange: o, playConfirmation: s, setThinking: a }),
|
|
884
884
|
[o, s, a]
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
|
-
const
|
|
887
|
+
const Bn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
888
888
|
"svg",
|
|
889
889
|
{
|
|
890
890
|
className: t,
|
|
@@ -930,7 +930,7 @@ const Pn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
930
930
|
}
|
|
931
931
|
)
|
|
932
932
|
}
|
|
933
|
-
),
|
|
933
|
+
), Wn = ({ className: e }) => /* @__PURE__ */ r(
|
|
934
934
|
"svg",
|
|
935
935
|
{
|
|
936
936
|
className: e,
|
|
@@ -948,7 +948,7 @@ const Pn = ({ muted: e = !1, className: t }) => e ? /* @__PURE__ */ S(
|
|
|
948
948
|
}
|
|
949
949
|
)
|
|
950
950
|
}
|
|
951
|
-
),
|
|
951
|
+
), Ci = ({ className: e }) => /* @__PURE__ */ r(
|
|
952
952
|
"svg",
|
|
953
953
|
{
|
|
954
954
|
className: e,
|
|
@@ -959,12 +959,12 @@ const Pn = ({ 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
|
+
), ki = {
|
|
963
963
|
left: 180,
|
|
964
964
|
right: 0,
|
|
965
965
|
up: -90,
|
|
966
966
|
down: 90
|
|
967
|
-
},
|
|
967
|
+
}, qn = ({ direction: e = "right", className: t }) => /* @__PURE__ */ r(
|
|
968
968
|
"svg",
|
|
969
969
|
{
|
|
970
970
|
className: t,
|
|
@@ -972,19 +972,19 @@ const Pn = ({ 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(${ki[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 Li(e) {
|
|
981
981
|
return e === "top-left" || e === "bottom-left" ? "left" : "right";
|
|
982
982
|
}
|
|
983
|
-
const
|
|
984
|
-
function
|
|
983
|
+
const dr = "ll-hidden-tab-center-y", Si = 5, Un = 16;
|
|
984
|
+
function Ei() {
|
|
985
985
|
if (typeof window > "u") return null;
|
|
986
986
|
try {
|
|
987
|
-
const e = window.localStorage.getItem(
|
|
987
|
+
const e = window.localStorage.getItem(dr);
|
|
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 vi() {
|
|
|
992
992
|
return null;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function jn(e) {
|
|
996
996
|
if (!(typeof window > "u"))
|
|
997
997
|
try {
|
|
998
|
-
window.localStorage.setItem(
|
|
998
|
+
window.localStorage.setItem(dr, String(e));
|
|
999
999
|
} catch {
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1002
|
+
const Ai = ({
|
|
1003
1003
|
position: e,
|
|
1004
1004
|
isMobile: t,
|
|
1005
1005
|
isSpeaking: n,
|
|
@@ -1009,94 +1009,94 @@ const bi = ({
|
|
|
1009
1009
|
agentName: s,
|
|
1010
1010
|
containerEl: a
|
|
1011
1011
|
}) => {
|
|
1012
|
-
const c =
|
|
1012
|
+
const c = Li(e), d = c === "right" ? "left" : "right", g = t ? 80 : 72, p = !!o, m = !!a, [P, x] = M(null), [L, y] = M(!1), w = R(null), D = R(!1), E = k(
|
|
1013
1013
|
(H) => {
|
|
1014
1014
|
if (typeof window > "u") return H;
|
|
1015
|
-
const
|
|
1016
|
-
return
|
|
1015
|
+
const X = g / 2, f = Un + X, N = window.innerHeight - Un - X;
|
|
1016
|
+
return N < f ? Math.max(f, H) : Math.max(f, Math.min(N, H));
|
|
1017
1017
|
},
|
|
1018
1018
|
[g]
|
|
1019
1019
|
);
|
|
1020
|
-
|
|
1020
|
+
T(() => {
|
|
1021
1021
|
if (m) {
|
|
1022
1022
|
x(null);
|
|
1023
1023
|
return;
|
|
1024
1024
|
}
|
|
1025
|
-
const H =
|
|
1025
|
+
const H = Ei();
|
|
1026
1026
|
x(E(H ?? window.innerHeight / 2));
|
|
1027
|
-
const
|
|
1027
|
+
const X = () => {
|
|
1028
1028
|
x((f) => f === null ? null : E(f));
|
|
1029
1029
|
};
|
|
1030
|
-
return window.addEventListener("resize",
|
|
1030
|
+
return window.addEventListener("resize", X), () => window.removeEventListener("resize", X);
|
|
1031
1031
|
}, [E, m]);
|
|
1032
|
-
const b =
|
|
1032
|
+
const b = k(
|
|
1033
1033
|
(H) => {
|
|
1034
|
-
if (!m && !(H.pointerType === "mouse" && H.button !== 0) &&
|
|
1034
|
+
if (!m && !(H.pointerType === "mouse" && H.button !== 0) && P !== 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: P,
|
|
1042
1042
|
moved: !1
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
1045
|
},
|
|
1046
|
-
[
|
|
1047
|
-
), O =
|
|
1046
|
+
[P, m]
|
|
1047
|
+
), O = k(
|
|
1048
1048
|
(H) => {
|
|
1049
|
-
const
|
|
1050
|
-
if (!
|
|
1051
|
-
const f = H.clientY -
|
|
1052
|
-
!
|
|
1049
|
+
const X = w.current;
|
|
1050
|
+
if (!X) return;
|
|
1051
|
+
const f = H.clientY - X.startClientY;
|
|
1052
|
+
!X.moved && Math.abs(f) > Si && (X.moved = !0, y(!0)), X.moved && x(E(X.startCenterY + f));
|
|
1053
1053
|
},
|
|
1054
1054
|
[E]
|
|
1055
|
-
), v =
|
|
1055
|
+
), v = k(
|
|
1056
1056
|
(H) => {
|
|
1057
|
-
const
|
|
1058
|
-
if (
|
|
1057
|
+
const X = w.current;
|
|
1058
|
+
if (X) {
|
|
1059
1059
|
try {
|
|
1060
1060
|
H.currentTarget.releasePointerCapture(H.pointerId);
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
}
|
|
1063
|
-
w.current = null,
|
|
1063
|
+
w.current = null, X.moved && (y(!1), D.current = !0, x((f) => (f !== null && jn(f), f)));
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
[]
|
|
1067
|
-
), z =
|
|
1068
|
-
if (
|
|
1069
|
-
|
|
1067
|
+
), z = k(() => {
|
|
1068
|
+
if (D.current) {
|
|
1069
|
+
D.current = !1;
|
|
1070
1070
|
return;
|
|
1071
1071
|
}
|
|
1072
1072
|
i();
|
|
1073
|
-
}, [i]), B =
|
|
1073
|
+
}, [i]), B = k(
|
|
1074
1074
|
(H) => {
|
|
1075
1075
|
if (H.key === "ArrowUp" || H.key === "ArrowDown") {
|
|
1076
1076
|
H.preventDefault();
|
|
1077
|
-
const
|
|
1077
|
+
const X = H.key === "ArrowUp" ? -8 : 8;
|
|
1078
1078
|
x((f) => {
|
|
1079
1079
|
if (f === null) return f;
|
|
1080
|
-
const
|
|
1081
|
-
return
|
|
1080
|
+
const N = E(f + X);
|
|
1081
|
+
return jn(N), N;
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
},
|
|
1085
1085
|
[E]
|
|
1086
|
-
),
|
|
1086
|
+
), Z = [
|
|
1087
1087
|
"ll-hidden",
|
|
1088
1088
|
`ll-hidden--${c}`,
|
|
1089
1089
|
t ? "ll-hidden--mobile" : "ll-hidden--desktop",
|
|
1090
1090
|
n ? "ll-hidden--speaking" : null,
|
|
1091
|
-
|
|
1091
|
+
L ? "is-dragging" : null,
|
|
1092
1092
|
p ? "ll-hidden--with-avatar" : null,
|
|
1093
1093
|
m ? "ll-hidden--scoped" : null
|
|
1094
|
-
].filter(Boolean).join(" "),
|
|
1094
|
+
].filter(Boolean).join(" "), ae = P === null ? void 0 : { top: `${P - g / 2}px`, transform: "none" };
|
|
1095
1095
|
return /* @__PURE__ */ r(
|
|
1096
1096
|
"button",
|
|
1097
1097
|
{
|
|
1098
1098
|
type: "button",
|
|
1099
|
-
className:
|
|
1099
|
+
className: Z,
|
|
1100
1100
|
onPointerDown: b,
|
|
1101
1101
|
onPointerMove: O,
|
|
1102
1102
|
onPointerUp: v,
|
|
@@ -1105,15 +1105,15 @@ const bi = ({
|
|
|
1105
1105
|
onKeyDown: B,
|
|
1106
1106
|
"aria-label": l,
|
|
1107
1107
|
"data-position": e,
|
|
1108
|
-
style:
|
|
1108
|
+
style: ae,
|
|
1109
1109
|
children: p ? (
|
|
1110
1110
|
// Layout: tiny chevron flush against the inward edge (peeks out
|
|
1111
1111
|
// as the click affordance), then the circular avatar photo
|
|
1112
1112
|
// taking the rest of the tab. Reinforces "this is an
|
|
1113
1113
|
// avatar-based experience" even when collapsed.
|
|
1114
|
-
/* @__PURE__ */ S(
|
|
1114
|
+
/* @__PURE__ */ S(Xe, { children: [
|
|
1115
1115
|
/* @__PURE__ */ r(
|
|
1116
|
-
|
|
1116
|
+
qn,
|
|
1117
1117
|
{
|
|
1118
1118
|
direction: d,
|
|
1119
1119
|
className: "ll-hidden__chevron ll-hidden__chevron--mini"
|
|
@@ -1130,7 +1130,7 @@ const bi = ({
|
|
|
1130
1130
|
)
|
|
1131
1131
|
] })
|
|
1132
1132
|
) : /* @__PURE__ */ r(
|
|
1133
|
-
|
|
1133
|
+
qn,
|
|
1134
1134
|
{
|
|
1135
1135
|
direction: d,
|
|
1136
1136
|
className: "ll-hidden__chevron"
|
|
@@ -1138,7 +1138,7 @@ const bi = ({
|
|
|
1138
1138
|
)
|
|
1139
1139
|
}
|
|
1140
1140
|
);
|
|
1141
|
-
},
|
|
1141
|
+
}, Ni = ({
|
|
1142
1142
|
audioLevel: e,
|
|
1143
1143
|
bars: t = 20,
|
|
1144
1144
|
maxHeight: n = 20,
|
|
@@ -1146,16 +1146,16 @@ const bi = ({
|
|
|
1146
1146
|
className: l,
|
|
1147
1147
|
barClassName: o
|
|
1148
1148
|
}) => {
|
|
1149
|
-
const s = R(null), a = R([]), c =
|
|
1149
|
+
const s = R(null), a = R([]), c = ut(() => {
|
|
1150
1150
|
const g = (Math.sqrt(5) - 1) / 2;
|
|
1151
1151
|
return Array.from({ length: t }, (p, m) => 0.5 + m * g % 1 * 0.5);
|
|
1152
1152
|
}, [t]);
|
|
1153
|
-
|
|
1153
|
+
T(() => e.subscribe((p) => {
|
|
1154
1154
|
for (let m = 0; m < t; m++) {
|
|
1155
|
-
const
|
|
1156
|
-
if (!
|
|
1155
|
+
const P = a.current[m];
|
|
1156
|
+
if (!P) continue;
|
|
1157
1157
|
const x = Math.max(i, p * n * c[m]);
|
|
1158
|
-
|
|
1158
|
+
P.style.height = `${x}px`;
|
|
1159
1159
|
}
|
|
1160
1160
|
}), [e, t, n, i, c]);
|
|
1161
1161
|
const d = ["ll-waveform", l].filter(Boolean).join(" ");
|
|
@@ -1170,7 +1170,7 @@ const bi = ({
|
|
|
1170
1170
|
},
|
|
1171
1171
|
p
|
|
1172
1172
|
)) });
|
|
1173
|
-
},
|
|
1173
|
+
}, Mi = ({
|
|
1174
1174
|
position: e,
|
|
1175
1175
|
isMobile: t,
|
|
1176
1176
|
agentName: n,
|
|
@@ -1207,7 +1207,7 @@ const bi = ({
|
|
|
1207
1207
|
)
|
|
1208
1208
|
) : /* @__PURE__ */ r("div", { className: "ll-minimized__avatar ll-minimized__avatar--placeholder" }),
|
|
1209
1209
|
/* @__PURE__ */ r(
|
|
1210
|
-
|
|
1210
|
+
Ni,
|
|
1211
1211
|
{
|
|
1212
1212
|
audioLevel: s,
|
|
1213
1213
|
bars: 16,
|
|
@@ -1230,10 +1230,10 @@ const bi = ({
|
|
|
1230
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(Bn, { muted: o, className: "ll-minimized__icon" })
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
|
-
/* @__PURE__ */ r(
|
|
1236
|
+
/* @__PURE__ */ r(Wn, { className: "ll-minimized__icon ll-minimized__icon--expand" })
|
|
1237
1237
|
] })
|
|
1238
1238
|
]
|
|
1239
1239
|
}
|
|
@@ -1270,7 +1270,7 @@ const bi = ({
|
|
|
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(Bn, { muted: o, className: "ll-minimized__icon" })
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
1276
|
/* @__PURE__ */ r(
|
|
@@ -1280,7 +1280,7 @@ const bi = ({
|
|
|
1280
1280
|
className: "ll-minimized__btn",
|
|
1281
1281
|
onClick: a,
|
|
1282
1282
|
"aria-label": `Expand ${n} widget`,
|
|
1283
|
-
children: /* @__PURE__ */ r(
|
|
1283
|
+
children: /* @__PURE__ */ r(Wn, { className: "ll-minimized__icon" })
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
1286
|
/* @__PURE__ */ r(
|
|
@@ -1290,13 +1290,13 @@ const bi = ({
|
|
|
1290
1290
|
className: "ll-minimized__btn ll-minimized__btn--close",
|
|
1291
1291
|
onClick: d,
|
|
1292
1292
|
"aria-label": "Close widget",
|
|
1293
|
-
children: /* @__PURE__ */ r(
|
|
1293
|
+
children: /* @__PURE__ */ r(Ci, { className: "ll-minimized__icon" })
|
|
1294
1294
|
}
|
|
1295
1295
|
)
|
|
1296
1296
|
] })
|
|
1297
1297
|
] })
|
|
1298
1298
|
}
|
|
1299
|
-
),
|
|
1299
|
+
), Ii = ({
|
|
1300
1300
|
src: e,
|
|
1301
1301
|
alt: t,
|
|
1302
1302
|
preCannedPlaying: n = !1,
|
|
@@ -1304,7 +1304,7 @@ const bi = ({
|
|
|
1304
1304
|
style: l
|
|
1305
1305
|
}) => {
|
|
1306
1306
|
const [o, s] = M(!1), a = R(e);
|
|
1307
|
-
if (
|
|
1307
|
+
if (T(() => {
|
|
1308
1308
|
a.current !== e && (a.current = e, s(!1));
|
|
1309
1309
|
}, [e]), !e) return null;
|
|
1310
1310
|
const c = {
|
|
@@ -1334,11 +1334,11 @@ const bi = ({
|
|
|
1334
1334
|
}
|
|
1335
1335
|
)
|
|
1336
1336
|
);
|
|
1337
|
-
},
|
|
1338
|
-
function
|
|
1337
|
+
}, Ti = "#E06540";
|
|
1338
|
+
function Ri({
|
|
1339
1339
|
size: e = 14,
|
|
1340
1340
|
className: t,
|
|
1341
|
-
fill: n =
|
|
1341
|
+
fill: n = Ti
|
|
1342
1342
|
}) {
|
|
1343
1343
|
return /* @__PURE__ */ S(
|
|
1344
1344
|
"svg",
|
|
@@ -1376,14 +1376,14 @@ function Li({
|
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
|
-
const
|
|
1379
|
+
const Di = 8, Vn = 8, Pi = ({
|
|
1380
1380
|
open: e,
|
|
1381
1381
|
onClose: t,
|
|
1382
1382
|
anchorRef: n,
|
|
1383
1383
|
children: i
|
|
1384
1384
|
}) => {
|
|
1385
1385
|
const l = R(null), [o, s] = M(null);
|
|
1386
|
-
return
|
|
1386
|
+
return ar(() => {
|
|
1387
1387
|
if (!e) {
|
|
1388
1388
|
s(null);
|
|
1389
1389
|
return;
|
|
@@ -1392,15 +1392,15 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1392
1392
|
if (!a) return;
|
|
1393
1393
|
const c = () => {
|
|
1394
1394
|
const d = a.getBoundingClientRect(), g = {
|
|
1395
|
-
top: d.top -
|
|
1395
|
+
top: d.top - Di,
|
|
1396
1396
|
left: d.left + d.width / 2
|
|
1397
|
-
}, p =
|
|
1397
|
+
}, p = Vn + 90, m = window.innerWidth - Vn - 90;
|
|
1398
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
|
-
}, [e, n]),
|
|
1403
|
+
}, [e, n]), T(() => {
|
|
1404
1404
|
if (!e) return;
|
|
1405
1405
|
const a = (d) => {
|
|
1406
1406
|
const g = d.target, p = l.current, m = n.current;
|
|
@@ -1411,7 +1411,7 @@ const Ci = 8, On = 8, Si = ({
|
|
|
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 : dn(
|
|
1415
1415
|
/* @__PURE__ */ r(
|
|
1416
1416
|
"div",
|
|
1417
1417
|
{
|
|
@@ -1431,7 +1431,7 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1431
1431
|
),
|
|
1432
1432
|
document.body
|
|
1433
1433
|
);
|
|
1434
|
-
},
|
|
1434
|
+
}, zi = ({
|
|
1435
1435
|
isMuted: e,
|
|
1436
1436
|
onToggleMute: t,
|
|
1437
1437
|
isCameraEnabled: n,
|
|
@@ -1445,10 +1445,10 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1445
1445
|
allowTyping: g,
|
|
1446
1446
|
isTypingOpen: p,
|
|
1447
1447
|
onToggleTyping: m,
|
|
1448
|
-
onDisconnect:
|
|
1448
|
+
onDisconnect: P
|
|
1449
1449
|
}) => {
|
|
1450
|
-
const [x,
|
|
1451
|
-
return /* @__PURE__ */ S(
|
|
1450
|
+
const [x, L] = M(!1), y = R(null);
|
|
1451
|
+
return /* @__PURE__ */ S(Xe, { children: [
|
|
1452
1452
|
/* @__PURE__ */ S(
|
|
1453
1453
|
"div",
|
|
1454
1454
|
{
|
|
@@ -1463,7 +1463,7 @@ const Ci = 8, On = 8, Si = ({
|
|
|
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(hr, { muted: e })
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
1469
|
/* @__PURE__ */ r(
|
|
@@ -1472,11 +1472,11 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1472
1472
|
ref: y,
|
|
1473
1473
|
type: "button",
|
|
1474
1474
|
className: `ll-tool ${x ? "is-on" : ""}`,
|
|
1475
|
-
onClick: () =>
|
|
1475
|
+
onClick: () => L((w) => !w),
|
|
1476
1476
|
"aria-label": "More controls",
|
|
1477
1477
|
"aria-haspopup": "menu",
|
|
1478
1478
|
"aria-expanded": x,
|
|
1479
|
-
children: /* @__PURE__ */ r(
|
|
1479
|
+
children: /* @__PURE__ */ r($i, {})
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
1482
1482
|
/* @__PURE__ */ r(
|
|
@@ -1484,19 +1484,19 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1484
1484
|
{
|
|
1485
1485
|
type: "button",
|
|
1486
1486
|
className: "ll-tool ll-tool--danger",
|
|
1487
|
-
onClick:
|
|
1487
|
+
onClick: P,
|
|
1488
1488
|
"aria-label": "End conversation",
|
|
1489
|
-
children: /* @__PURE__ */ r(
|
|
1489
|
+
children: /* @__PURE__ */ r(gr, {})
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
1492
|
]
|
|
1493
1493
|
}
|
|
1494
1494
|
),
|
|
1495
1495
|
/* @__PURE__ */ S(
|
|
1496
|
-
|
|
1496
|
+
Pi,
|
|
1497
1497
|
{
|
|
1498
1498
|
open: x,
|
|
1499
|
-
onClose: () =>
|
|
1499
|
+
onClose: () => L(!1),
|
|
1500
1500
|
anchorRef: y,
|
|
1501
1501
|
children: [
|
|
1502
1502
|
l && /* @__PURE__ */ S(
|
|
@@ -1505,10 +1505,10 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1505
1505
|
type: "button",
|
|
1506
1506
|
className: `ll-overflow-popover__item ${n ? "is-on" : ""}`,
|
|
1507
1507
|
onClick: () => {
|
|
1508
|
-
i(),
|
|
1508
|
+
i(), L(!1);
|
|
1509
1509
|
},
|
|
1510
1510
|
children: [
|
|
1511
|
-
/* @__PURE__ */ r(
|
|
1511
|
+
/* @__PURE__ */ r(pr, {}),
|
|
1512
1512
|
/* @__PURE__ */ r("span", { children: n ? "Stop camera" : "Start camera" })
|
|
1513
1513
|
]
|
|
1514
1514
|
}
|
|
@@ -1519,10 +1519,10 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1519
1519
|
type: "button",
|
|
1520
1520
|
className: `ll-overflow-popover__item ${o ? "is-on" : ""}`,
|
|
1521
1521
|
onClick: () => {
|
|
1522
|
-
s(),
|
|
1522
|
+
s(), L(!1);
|
|
1523
1523
|
},
|
|
1524
1524
|
children: [
|
|
1525
|
-
/* @__PURE__ */ r(
|
|
1525
|
+
/* @__PURE__ */ r(fr, {}),
|
|
1526
1526
|
/* @__PURE__ */ r("span", { children: o ? "Stop sharing" : "Share screen" })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
@@ -1533,10 +1533,10 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1533
1533
|
type: "button",
|
|
1534
1534
|
className: `ll-overflow-popover__item ${c ? "is-on" : ""}`,
|
|
1535
1535
|
onClick: () => {
|
|
1536
|
-
d(),
|
|
1536
|
+
d(), L(!1);
|
|
1537
1537
|
},
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */ r(
|
|
1539
|
+
/* @__PURE__ */ r(mr, { muted: c }),
|
|
1540
1540
|
/* @__PURE__ */ r("span", { children: c ? "Unmute speaker" : "Mute speaker" })
|
|
1541
1541
|
]
|
|
1542
1542
|
}
|
|
@@ -1547,10 +1547,10 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1547
1547
|
type: "button",
|
|
1548
1548
|
className: `ll-overflow-popover__item ${p ? "is-on" : ""}`,
|
|
1549
1549
|
onClick: () => {
|
|
1550
|
-
m(),
|
|
1550
|
+
m(), L(!1);
|
|
1551
1551
|
},
|
|
1552
1552
|
children: [
|
|
1553
|
-
/* @__PURE__ */ r(
|
|
1553
|
+
/* @__PURE__ */ r(Hi, {}),
|
|
1554
1554
|
/* @__PURE__ */ r("span", { children: p ? "Hide typing" : "Type a message" })
|
|
1555
1555
|
]
|
|
1556
1556
|
}
|
|
@@ -1573,7 +1573,7 @@ const Ci = 8, On = 8, Si = ({
|
|
|
1573
1573
|
)
|
|
1574
1574
|
] });
|
|
1575
1575
|
};
|
|
1576
|
-
function
|
|
1576
|
+
function $i() {
|
|
1577
1577
|
return /* @__PURE__ */ S(
|
|
1578
1578
|
"svg",
|
|
1579
1579
|
{
|
|
@@ -1590,7 +1590,7 @@ function Ai() {
|
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function Hi() {
|
|
1594
1594
|
return /* @__PURE__ */ r(
|
|
1595
1595
|
"svg",
|
|
1596
1596
|
{
|
|
@@ -1607,7 +1607,7 @@ function Ni() {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
);
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1610
|
+
const Oi = ({
|
|
1611
1611
|
position: e,
|
|
1612
1612
|
isMobile: t,
|
|
1613
1613
|
agentName: n,
|
|
@@ -1621,145 +1621,145 @@ const Mi = ({
|
|
|
1621
1621
|
teamSwitcherOpen: g,
|
|
1622
1622
|
onToggleTeamSwitcher: p,
|
|
1623
1623
|
onSelectTeamMember: m,
|
|
1624
|
-
languageMenuOpen:
|
|
1624
|
+
languageMenuOpen: P,
|
|
1625
1625
|
onToggleLanguageMenu: x,
|
|
1626
|
-
connectionState:
|
|
1626
|
+
connectionState: L,
|
|
1627
1627
|
agentState: y,
|
|
1628
1628
|
transcript: w,
|
|
1629
|
-
canResume:
|
|
1629
|
+
canResume: D,
|
|
1630
1630
|
needsUserGesture: E,
|
|
1631
1631
|
error: b,
|
|
1632
1632
|
isMuted: O,
|
|
1633
1633
|
micError: v,
|
|
1634
1634
|
micDevices: z,
|
|
1635
1635
|
activeMicId: B,
|
|
1636
|
-
isCameraEnabled:
|
|
1637
|
-
cameraPreviewEl:
|
|
1636
|
+
isCameraEnabled: Z,
|
|
1637
|
+
cameraPreviewEl: ae,
|
|
1638
1638
|
cameraDevices: H,
|
|
1639
|
-
activeCameraId:
|
|
1639
|
+
activeCameraId: X,
|
|
1640
1640
|
isScreenShareEnabled: f,
|
|
1641
|
-
screenPreviewEl:
|
|
1641
|
+
screenPreviewEl: N,
|
|
1642
1642
|
isSpeakerMuted: $,
|
|
1643
|
-
allowCamera:
|
|
1644
|
-
allowScreenShare:
|
|
1645
|
-
allowTyping:
|
|
1643
|
+
allowCamera: U,
|
|
1644
|
+
allowScreenShare: K,
|
|
1645
|
+
allowTyping: re,
|
|
1646
1646
|
showMinimize: W = !0,
|
|
1647
|
-
showClose:
|
|
1648
|
-
chromeless:
|
|
1649
|
-
compactControls:
|
|
1647
|
+
showClose: ie = !0,
|
|
1648
|
+
chromeless: le = !1,
|
|
1649
|
+
compactControls: j = !1,
|
|
1650
1650
|
transforming: ge,
|
|
1651
|
-
transformingLabel:
|
|
1651
|
+
transformingLabel: Q,
|
|
1652
1652
|
avatarVideoContainerRef: Le,
|
|
1653
|
-
agentVideoEl:
|
|
1654
|
-
onConnect:
|
|
1655
|
-
onDisconnect:
|
|
1656
|
-
onRetry:
|
|
1657
|
-
onResumeAudio:
|
|
1658
|
-
onToggleMute:
|
|
1659
|
-
onSwitchMicDevice:
|
|
1660
|
-
onToggleCamera:
|
|
1661
|
-
onSwitchCameraDevice:
|
|
1662
|
-
onToggleScreenShare:
|
|
1663
|
-
onToggleSpeaker:
|
|
1664
|
-
onSendMessage:
|
|
1665
|
-
onMinimize:
|
|
1666
|
-
onClose:
|
|
1667
|
-
onClearMicError:
|
|
1668
|
-
dragHandleProps:
|
|
1653
|
+
agentVideoEl: oe,
|
|
1654
|
+
onConnect: Ie,
|
|
1655
|
+
onDisconnect: dt,
|
|
1656
|
+
onRetry: kt,
|
|
1657
|
+
onResumeAudio: Lt,
|
|
1658
|
+
onToggleMute: ft,
|
|
1659
|
+
onSwitchMicDevice: St,
|
|
1660
|
+
onToggleCamera: Ke,
|
|
1661
|
+
onSwitchCameraDevice: Je,
|
|
1662
|
+
onToggleScreenShare: Fe,
|
|
1663
|
+
onToggleSpeaker: Be,
|
|
1664
|
+
onSendMessage: We,
|
|
1665
|
+
onMinimize: qe,
|
|
1666
|
+
onClose: Ue,
|
|
1667
|
+
onClearMicError: Ze,
|
|
1668
|
+
dragHandleProps: je,
|
|
1669
1669
|
resizeHandleProps: F
|
|
1670
1670
|
}) => {
|
|
1671
|
-
var
|
|
1672
|
-
const
|
|
1673
|
-
|
|
1674
|
-
if (!
|
|
1675
|
-
|
|
1671
|
+
var rt;
|
|
1672
|
+
const Ve = ((a == null ? void 0 : a.length) ?? 0) > 1, Qe = L === "connecting" || L === "connected", Se = L === "connected", Et = L === "idle" || L === "disconnected" || L === "error", [pt, Te] = M(!1);
|
|
1673
|
+
T(() => {
|
|
1674
|
+
if (!oe) {
|
|
1675
|
+
Te(!1);
|
|
1676
1676
|
return;
|
|
1677
1677
|
}
|
|
1678
|
-
if (!
|
|
1679
|
-
|
|
1678
|
+
if (!oe.paused && oe.readyState >= 2) {
|
|
1679
|
+
Te(!0);
|
|
1680
1680
|
return;
|
|
1681
1681
|
}
|
|
1682
|
-
|
|
1683
|
-
const
|
|
1684
|
-
return
|
|
1685
|
-
|
|
1682
|
+
Te(!1);
|
|
1683
|
+
const C = () => Te(!0);
|
|
1684
|
+
return oe.addEventListener("playing", C), oe.addEventListener("loadeddata", C), () => {
|
|
1685
|
+
oe.removeEventListener("playing", C), oe.removeEventListener("loadeddata", C);
|
|
1686
1686
|
};
|
|
1687
|
-
}, [
|
|
1688
|
-
const [
|
|
1689
|
-
|
|
1690
|
-
y === "speaking" &&
|
|
1691
|
-
}, [y]),
|
|
1692
|
-
(
|
|
1693
|
-
}, [
|
|
1694
|
-
const [
|
|
1695
|
-
|
|
1696
|
-
if (!
|
|
1697
|
-
|
|
1687
|
+
}, [oe]);
|
|
1688
|
+
const [ht, At] = M(!1);
|
|
1689
|
+
T(() => {
|
|
1690
|
+
y === "speaking" && At(!0);
|
|
1691
|
+
}, [y]), T(() => {
|
|
1692
|
+
(L === "disconnected" || L === "idle") && At(!1);
|
|
1693
|
+
}, [L]);
|
|
1694
|
+
const [Ye, fe] = M(!1);
|
|
1695
|
+
T(() => {
|
|
1696
|
+
if (!Se) {
|
|
1697
|
+
fe(!1);
|
|
1698
1698
|
return;
|
|
1699
1699
|
}
|
|
1700
|
-
if (
|
|
1701
|
-
const
|
|
1702
|
-
return () => clearTimeout(
|
|
1703
|
-
}, [
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1708
|
-
}, [
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1711
|
-
}, [
|
|
1712
|
-
const [
|
|
1713
|
-
|
|
1714
|
-
if (!
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1700
|
+
if (ht) return;
|
|
1701
|
+
const C = setTimeout(() => fe(!0), 12e3);
|
|
1702
|
+
return () => clearTimeout(C);
|
|
1703
|
+
}, [Se, ht]);
|
|
1704
|
+
const Nt = L === "connecting" || Se && !ht && !Ye, pe = R(null), be = R(null);
|
|
1705
|
+
T(() => {
|
|
1706
|
+
const C = pe.current;
|
|
1707
|
+
C && (C.innerHTML = "", ae && (ae.style.width = "100%", ae.style.height = "100%", ae.style.objectFit = "cover", ae.style.transform = "scaleX(-1)", C.appendChild(ae)));
|
|
1708
|
+
}, [ae]), T(() => {
|
|
1709
|
+
const C = be.current;
|
|
1710
|
+
C && (C.innerHTML = "", N && (N.style.width = "100%", N.style.height = "100%", N.style.objectFit = "contain", C.appendChild(N)));
|
|
1711
|
+
}, [N]);
|
|
1712
|
+
const [et, tt] = M(!1), [me, we] = M(!1), Mt = R(null), It = R(null);
|
|
1713
|
+
T(() => {
|
|
1714
|
+
if (!et && !me && !P && !g) return;
|
|
1715
|
+
const C = () => {
|
|
1716
|
+
tt(!1), we(!1), P && x(), g && p();
|
|
1717
1717
|
};
|
|
1718
|
-
return document.addEventListener("click",
|
|
1718
|
+
return document.addEventListener("click", C), () => document.removeEventListener("click", C);
|
|
1719
1719
|
}, [
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1720
|
+
et,
|
|
1721
|
+
me,
|
|
1722
|
+
P,
|
|
1723
1723
|
g,
|
|
1724
1724
|
x,
|
|
1725
1725
|
p
|
|
1726
1726
|
]);
|
|
1727
|
-
const [
|
|
1728
|
-
(
|
|
1729
|
-
|
|
1730
|
-
const
|
|
1731
|
-
|
|
1727
|
+
const [Tt, fn] = M(!1), pn = k(() => fn((C) => !C), []), [xe, Re] = M(""), Ne = k(
|
|
1728
|
+
(C) => {
|
|
1729
|
+
C.preventDefault();
|
|
1730
|
+
const se = xe.trim();
|
|
1731
|
+
se && (We(se), Re(""));
|
|
1732
1732
|
},
|
|
1733
|
-
[
|
|
1734
|
-
),
|
|
1735
|
-
let Pe = null,
|
|
1736
|
-
for (let
|
|
1737
|
-
const
|
|
1738
|
-
if (!Pe &&
|
|
1733
|
+
[xe, We]
|
|
1734
|
+
), De = s.productName || "Live Layer", mt = !s.productName;
|
|
1735
|
+
let Pe = null, Ee = null;
|
|
1736
|
+
for (let C = w.length - 1; C >= 0; C--) {
|
|
1737
|
+
const se = w[C];
|
|
1738
|
+
if (!Pe && se.role === "agent" ? Pe = se : !Ee && se.role === "user" && (Ee = se), Pe && Ee) break;
|
|
1739
1739
|
}
|
|
1740
|
-
const
|
|
1740
|
+
const nt = Se ? (Pe == null ? void 0 : Pe.text) || null : o || null, gt = Se && (Ee == null ? void 0 : Ee.text) || null, yt = [
|
|
1741
1741
|
"ll-expanded",
|
|
1742
1742
|
t ? "ll-expanded--mobile" : "ll-expanded--desktop"
|
|
1743
1743
|
].join(" ");
|
|
1744
1744
|
return /* @__PURE__ */ S(
|
|
1745
1745
|
"div",
|
|
1746
1746
|
{
|
|
1747
|
-
className:
|
|
1747
|
+
className: yt,
|
|
1748
1748
|
"data-position": e,
|
|
1749
|
-
"data-state":
|
|
1749
|
+
"data-state": Se ? "connected" : Qe ? "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
|
+
Ii,
|
|
1756
1756
|
{
|
|
1757
1757
|
src: i,
|
|
1758
1758
|
alt: n,
|
|
1759
1759
|
className: "ll-expanded__bg-img"
|
|
1760
1760
|
}
|
|
1761
|
-
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((
|
|
1762
|
-
l && !
|
|
1761
|
+
) : /* @__PURE__ */ r("div", { className: "ll-expanded__bg-fallback", children: /* @__PURE__ */ r("span", { className: "ll-expanded__bg-initial", children: ((rt = n == null ? void 0 : n.charAt(0)) == null ? void 0 : rt.toUpperCase()) || "A" }) }),
|
|
1762
|
+
l && !Se && /* @__PURE__ */ r(
|
|
1763
1763
|
"video",
|
|
1764
1764
|
{
|
|
1765
1765
|
className: "ll-expanded__bg-idle",
|
|
@@ -1776,19 +1776,19 @@ const Mi = ({
|
|
|
1776
1776
|
{
|
|
1777
1777
|
ref: Le,
|
|
1778
1778
|
className: "ll-expanded__video",
|
|
1779
|
-
"data-ready":
|
|
1779
|
+
"data-ready": pt
|
|
1780
1780
|
}
|
|
1781
1781
|
),
|
|
1782
|
-
|
|
1782
|
+
Nt && /* @__PURE__ */ S("div", { className: "ll-expanded__overlay ll-expanded__overlay--connecting", children: [
|
|
1783
1783
|
/* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
|
|
1784
1784
|
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: d ? "Switching..." : "Connecting..." })
|
|
1785
1785
|
] }),
|
|
1786
|
-
E &&
|
|
1786
|
+
E && Se && /* @__PURE__ */ S(
|
|
1787
1787
|
"button",
|
|
1788
1788
|
{
|
|
1789
1789
|
type: "button",
|
|
1790
1790
|
className: "ll-expanded__overlay ll-expanded__overlay--gesture",
|
|
1791
|
-
onClick:
|
|
1791
|
+
onClick: Lt,
|
|
1792
1792
|
children: [
|
|
1793
1793
|
/* @__PURE__ */ r("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": !0, children: /* @__PURE__ */ r("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.54.12a5 5 0 0 1 0 5.76l-1.41-1.41a3 3 0 0 0 0-2.94L16.54 9.12z" }) }),
|
|
1794
1794
|
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: "Tap to enable audio" })
|
|
@@ -1801,61 +1801,61 @@ const Mi = ({
|
|
|
1801
1801
|
className: "ll-expanded__overlay ll-expanded__overlay--transforming",
|
|
1802
1802
|
role: "status",
|
|
1803
1803
|
"aria-live": "polite",
|
|
1804
|
-
"aria-label":
|
|
1804
|
+
"aria-label": Q,
|
|
1805
1805
|
children: [
|
|
1806
1806
|
/* @__PURE__ */ r("div", { className: "ll-expanded__spinner" }),
|
|
1807
|
-
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children:
|
|
1807
|
+
/* @__PURE__ */ r("p", { className: "ll-expanded__overlay-text", children: Q })
|
|
1808
1808
|
]
|
|
1809
1809
|
}
|
|
1810
1810
|
),
|
|
1811
|
-
|
|
1812
|
-
!
|
|
1813
|
-
!
|
|
1811
|
+
Qe ? /* @__PURE__ */ S(Xe, { children: [
|
|
1812
|
+
!j && /* @__PURE__ */ S("div", { className: "ll-expanded__topbar", ...je, children: [
|
|
1813
|
+
!le && /* @__PURE__ */ S("div", { className: "ll-expanded__topbar-left", children: [
|
|
1814
1814
|
/* @__PURE__ */ S("div", { className: "ll-expanded__pill-wrap", children: [
|
|
1815
1815
|
/* @__PURE__ */ S(
|
|
1816
1816
|
"button",
|
|
1817
1817
|
{
|
|
1818
1818
|
type: "button",
|
|
1819
1819
|
className: "ll-hpill",
|
|
1820
|
-
onClick: (
|
|
1821
|
-
|
|
1820
|
+
onClick: (C) => {
|
|
1821
|
+
Ve && (C.stopPropagation(), p());
|
|
1822
1822
|
},
|
|
1823
|
-
"aria-haspopup":
|
|
1824
|
-
"aria-expanded":
|
|
1823
|
+
"aria-haspopup": Ve ? "listbox" : void 0,
|
|
1824
|
+
"aria-expanded": Ve ? g : void 0,
|
|
1825
1825
|
children: [
|
|
1826
1826
|
/* @__PURE__ */ r("span", { className: "ll-hpill__label", children: n }),
|
|
1827
|
-
|
|
1827
|
+
Ve && /* @__PURE__ */ r(qt, {})
|
|
1828
1828
|
]
|
|
1829
1829
|
}
|
|
1830
1830
|
),
|
|
1831
|
-
|
|
1831
|
+
Ve && g && /* @__PURE__ */ r(
|
|
1832
1832
|
"div",
|
|
1833
1833
|
{
|
|
1834
1834
|
className: "ll-hmenu",
|
|
1835
|
-
onClick: (
|
|
1835
|
+
onClick: (C) => C.stopPropagation(),
|
|
1836
1836
|
role: "listbox",
|
|
1837
|
-
children: a == null ? void 0 : a.map((
|
|
1837
|
+
children: a == null ? void 0 : a.map((C) => /* @__PURE__ */ S(
|
|
1838
1838
|
"button",
|
|
1839
1839
|
{
|
|
1840
1840
|
type: "button",
|
|
1841
|
-
className: `ll-hmenu__item ${
|
|
1842
|
-
onClick: () => m(
|
|
1841
|
+
className: `ll-hmenu__item ${C.id === c ? "is-active" : ""}`,
|
|
1842
|
+
onClick: () => m(C.id),
|
|
1843
1843
|
role: "option",
|
|
1844
|
-
"aria-selected":
|
|
1844
|
+
"aria-selected": C.id === c,
|
|
1845
1845
|
children: [
|
|
1846
|
-
|
|
1846
|
+
C.avatarImageUrl && /* @__PURE__ */ r(
|
|
1847
1847
|
"img",
|
|
1848
1848
|
{
|
|
1849
|
-
src:
|
|
1849
|
+
src: C.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: C.name }),
|
|
1855
|
+
C.role && /* @__PURE__ */ r("span", { className: "ll-hmenu__role", children: C.role })
|
|
1856
1856
|
]
|
|
1857
1857
|
},
|
|
1858
|
-
|
|
1858
|
+
C.id
|
|
1859
1859
|
))
|
|
1860
1860
|
}
|
|
1861
1861
|
)
|
|
@@ -1866,24 +1866,24 @@ const Mi = ({
|
|
|
1866
1866
|
{
|
|
1867
1867
|
type: "button",
|
|
1868
1868
|
className: "ll-hpill ll-hpill--compact",
|
|
1869
|
-
onClick: (
|
|
1870
|
-
|
|
1869
|
+
onClick: (C) => {
|
|
1870
|
+
C.stopPropagation(), x();
|
|
1871
1871
|
},
|
|
1872
1872
|
"aria-haspopup": "listbox",
|
|
1873
|
-
"aria-expanded":
|
|
1873
|
+
"aria-expanded": P,
|
|
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(qt, {})
|
|
1879
1879
|
]
|
|
1880
1880
|
}
|
|
1881
1881
|
),
|
|
1882
|
-
|
|
1882
|
+
P && /* @__PURE__ */ r(
|
|
1883
1883
|
"div",
|
|
1884
1884
|
{
|
|
1885
1885
|
className: "ll-hmenu",
|
|
1886
|
-
onClick: (
|
|
1886
|
+
onClick: (C) => C.stopPropagation(),
|
|
1887
1887
|
role: "listbox",
|
|
1888
1888
|
children: /* @__PURE__ */ r(
|
|
1889
1889
|
"button",
|
|
@@ -1912,26 +1912,26 @@ const Mi = ({
|
|
|
1912
1912
|
{
|
|
1913
1913
|
type: "button",
|
|
1914
1914
|
className: "ll-hbtn",
|
|
1915
|
-
onClick:
|
|
1915
|
+
onClick: qe,
|
|
1916
1916
|
"aria-label": "Minimize widget",
|
|
1917
1917
|
title: "Minimize",
|
|
1918
|
-
children: /* @__PURE__ */ r(
|
|
1918
|
+
children: /* @__PURE__ */ r(Gn, {})
|
|
1919
1919
|
}
|
|
1920
1920
|
),
|
|
1921
|
-
|
|
1921
|
+
ie !== !1 && /* @__PURE__ */ r(
|
|
1922
1922
|
"button",
|
|
1923
1923
|
{
|
|
1924
1924
|
type: "button",
|
|
1925
1925
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1926
|
-
onClick:
|
|
1926
|
+
onClick: Ue,
|
|
1927
1927
|
"aria-label": "End call",
|
|
1928
1928
|
title: "End call",
|
|
1929
|
-
children: /* @__PURE__ */ r(
|
|
1929
|
+
children: /* @__PURE__ */ r(Yn, {})
|
|
1930
1930
|
}
|
|
1931
1931
|
)
|
|
1932
1932
|
] })
|
|
1933
1933
|
] }),
|
|
1934
|
-
|
|
1934
|
+
j && /* @__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
1936
|
/* @__PURE__ */ r("span", { className: "ll-compact-status__label", children: y })
|
|
1937
1937
|
] })
|
|
@@ -1944,8 +1944,8 @@ const Mi = ({
|
|
|
1944
1944
|
// can always dismiss; making the whole header disappear (the
|
|
1945
1945
|
// pre-0.18.0 behavior) left users no way out short of scrolling
|
|
1946
1946
|
// the page itself.
|
|
1947
|
-
/* @__PURE__ */ S("div", { className: "ll-expanded__header ll-expanded__header--idle", ...
|
|
1948
|
-
!
|
|
1947
|
+
/* @__PURE__ */ S("div", { className: "ll-expanded__header ll-expanded__header--idle", ...je, children: [
|
|
1948
|
+
!j && (mt ? /* @__PURE__ */ S(
|
|
1949
1949
|
"a",
|
|
1950
1950
|
{
|
|
1951
1951
|
className: "ll-expanded__brand ll-expanded__brand--link",
|
|
@@ -1955,61 +1955,61 @@ const Mi = ({
|
|
|
1955
1955
|
"aria-label": "Powered by LiveLayer — opens livelayer.studio in a new tab",
|
|
1956
1956
|
title: "Powered by LiveLayer — visit livelayer.studio",
|
|
1957
1957
|
children: [
|
|
1958
|
-
/* @__PURE__ */ r(
|
|
1959
|
-
/* @__PURE__ */ r("span", { children:
|
|
1958
|
+
/* @__PURE__ */ r(Ri, { size: 14, className: "ll-expanded__brand-mark" }),
|
|
1959
|
+
/* @__PURE__ */ r("span", { children: De })
|
|
1960
1960
|
]
|
|
1961
1961
|
}
|
|
1962
|
-
) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children:
|
|
1962
|
+
) : /* @__PURE__ */ r("span", { className: "ll-expanded__brand", children: De })),
|
|
1963
1963
|
/* @__PURE__ */ S("div", { className: "ll-expanded__header-actions", children: [
|
|
1964
|
-
!
|
|
1964
|
+
!j && W !== !1 && /* @__PURE__ */ r(
|
|
1965
1965
|
"button",
|
|
1966
1966
|
{
|
|
1967
1967
|
type: "button",
|
|
1968
1968
|
className: "ll-hbtn ll-hbtn--ghost",
|
|
1969
|
-
onClick:
|
|
1969
|
+
onClick: qe,
|
|
1970
1970
|
"aria-label": "Minimize widget",
|
|
1971
|
-
children: /* @__PURE__ */ r(
|
|
1971
|
+
children: /* @__PURE__ */ r(Gn, {})
|
|
1972
1972
|
}
|
|
1973
1973
|
),
|
|
1974
|
-
|
|
1974
|
+
ie !== !1 && /* @__PURE__ */ r(
|
|
1975
1975
|
"button",
|
|
1976
1976
|
{
|
|
1977
1977
|
type: "button",
|
|
1978
1978
|
className: "ll-hbtn ll-hbtn--danger",
|
|
1979
|
-
onClick:
|
|
1979
|
+
onClick: Ue,
|
|
1980
1980
|
"aria-label": "Close widget",
|
|
1981
|
-
children: /* @__PURE__ */ r(
|
|
1981
|
+
children: /* @__PURE__ */ r(Yn, {})
|
|
1982
1982
|
}
|
|
1983
1983
|
)
|
|
1984
1984
|
] })
|
|
1985
1985
|
] })
|
|
1986
1986
|
),
|
|
1987
|
-
|
|
1988
|
-
const
|
|
1989
|
-
return /* @__PURE__ */ S(
|
|
1987
|
+
Et && /* @__PURE__ */ (() => {
|
|
1988
|
+
const C = D ? "Resume session" : L === "disconnected" ? "Reconnect to agent" : "Start video call";
|
|
1989
|
+
return /* @__PURE__ */ S(Xe, { children: [
|
|
1990
1990
|
!b && /* @__PURE__ */ S(
|
|
1991
1991
|
"button",
|
|
1992
1992
|
{
|
|
1993
1993
|
type: "button",
|
|
1994
1994
|
className: "ll-expanded__play",
|
|
1995
|
-
onClick:
|
|
1996
|
-
"aria-label":
|
|
1995
|
+
onClick: Ie,
|
|
1996
|
+
"aria-label": C,
|
|
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
|
-
|
|
1999
|
+
j && /* @__PURE__ */ r("span", { className: "ll-expanded__play-label", children: C })
|
|
2000
2000
|
]
|
|
2001
2001
|
}
|
|
2002
2002
|
),
|
|
2003
|
-
!
|
|
2003
|
+
!j && /* @__PURE__ */ S("div", { className: "ll-expanded__bottom ll-expanded__bottom--idle", children: [
|
|
2004
2004
|
o && /* @__PURE__ */ r("div", { className: "ll-expanded__transcript", children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: o }) }),
|
|
2005
2005
|
/* @__PURE__ */ r(
|
|
2006
2006
|
"button",
|
|
2007
2007
|
{
|
|
2008
2008
|
type: "button",
|
|
2009
2009
|
className: "ll-expanded__cta",
|
|
2010
|
-
onClick:
|
|
2011
|
-
"aria-label":
|
|
2012
|
-
children:
|
|
2010
|
+
onClick: Ie,
|
|
2011
|
+
"aria-label": C,
|
|
2012
|
+
children: C
|
|
2013
2013
|
}
|
|
2014
2014
|
)
|
|
2015
2015
|
] })
|
|
@@ -2018,90 +2018,90 @@ const Mi = ({
|
|
|
2018
2018
|
/* @__PURE__ */ S(
|
|
2019
2019
|
"div",
|
|
2020
2020
|
{
|
|
2021
|
-
className: `ll-expanded__pip ${
|
|
2021
|
+
className: `ll-expanded__pip ${Qe && (Z || f) ? "is-visible" : ""}`,
|
|
2022
2022
|
children: [
|
|
2023
2023
|
/* @__PURE__ */ r(
|
|
2024
2024
|
"div",
|
|
2025
2025
|
{
|
|
2026
|
-
ref:
|
|
2026
|
+
ref: be,
|
|
2027
2027
|
className: f ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
2028
2028
|
}
|
|
2029
2029
|
),
|
|
2030
2030
|
/* @__PURE__ */ r(
|
|
2031
2031
|
"div",
|
|
2032
2032
|
{
|
|
2033
|
-
ref:
|
|
2034
|
-
className: !f &&
|
|
2033
|
+
ref: pe,
|
|
2034
|
+
className: !f && Z ? "ll-expanded__pip-host" : "ll-expanded__pip-host is-hidden"
|
|
2035
2035
|
}
|
|
2036
2036
|
)
|
|
2037
2037
|
]
|
|
2038
2038
|
}
|
|
2039
2039
|
),
|
|
2040
|
-
|
|
2041
|
-
!
|
|
2040
|
+
Qe ? /* @__PURE__ */ S("div", { className: "ll-expanded__bottom", children: [
|
|
2041
|
+
!j && nt && /* @__PURE__ */ r(
|
|
2042
2042
|
"div",
|
|
2043
2043
|
{
|
|
2044
2044
|
className: "ll-expanded__transcript ll-expanded__transcript--agent",
|
|
2045
2045
|
"data-role": "agent",
|
|
2046
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2046
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: nt })
|
|
2047
2047
|
}
|
|
2048
2048
|
),
|
|
2049
|
-
!
|
|
2049
|
+
!j && gt && /* @__PURE__ */ r(
|
|
2050
2050
|
"div",
|
|
2051
2051
|
{
|
|
2052
2052
|
className: "ll-expanded__transcript ll-expanded__transcript--user",
|
|
2053
2053
|
"data-role": "user",
|
|
2054
|
-
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children:
|
|
2054
|
+
children: /* @__PURE__ */ r("p", { className: "ll-expanded__transcript-text", children: gt })
|
|
2055
2055
|
}
|
|
2056
2056
|
),
|
|
2057
|
-
!
|
|
2058
|
-
|
|
2057
|
+
!le && !j && /* @__PURE__ */ S("div", { className: "ll-toolbar", onClick: (C) => C.stopPropagation(), children: [
|
|
2058
|
+
K && /* @__PURE__ */ r(
|
|
2059
2059
|
"button",
|
|
2060
2060
|
{
|
|
2061
2061
|
type: "button",
|
|
2062
2062
|
className: `ll-tool ${f ? "is-on" : ""}`,
|
|
2063
|
-
onClick:
|
|
2063
|
+
onClick: Fe,
|
|
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(fr, {})
|
|
2067
2067
|
}
|
|
2068
2068
|
),
|
|
2069
|
-
|
|
2069
|
+
U && /* @__PURE__ */ S("div", { className: "ll-tool-split", children: [
|
|
2070
2070
|
/* @__PURE__ */ r(
|
|
2071
2071
|
"button",
|
|
2072
2072
|
{
|
|
2073
2073
|
type: "button",
|
|
2074
|
-
className: `ll-tool ll-tool--left ${
|
|
2075
|
-
onClick:
|
|
2076
|
-
"aria-label":
|
|
2077
|
-
title:
|
|
2078
|
-
children: /* @__PURE__ */ r(
|
|
2074
|
+
className: `ll-tool ll-tool--left ${Z ? "is-on" : ""}`,
|
|
2075
|
+
onClick: Ke,
|
|
2076
|
+
"aria-label": Z ? "Turn off camera" : "Turn on camera",
|
|
2077
|
+
title: Z ? "Stop camera" : "Start camera",
|
|
2078
|
+
children: /* @__PURE__ */ r(pr, {})
|
|
2079
2079
|
}
|
|
2080
2080
|
),
|
|
2081
2081
|
/* @__PURE__ */ r(
|
|
2082
2082
|
"button",
|
|
2083
2083
|
{
|
|
2084
|
-
ref:
|
|
2084
|
+
ref: It,
|
|
2085
2085
|
type: "button",
|
|
2086
|
-
className: `ll-tool ll-tool--right ${
|
|
2087
|
-
onClick: (
|
|
2088
|
-
|
|
2086
|
+
className: `ll-tool ll-tool--right ${Z ? "is-on" : ""}`,
|
|
2087
|
+
onClick: (C) => {
|
|
2088
|
+
C.stopPropagation(), we((se) => !se), tt(!1);
|
|
2089
2089
|
},
|
|
2090
2090
|
"aria-label": "Camera devices",
|
|
2091
2091
|
"aria-haspopup": "listbox",
|
|
2092
|
-
"aria-expanded":
|
|
2093
|
-
children: /* @__PURE__ */ r(
|
|
2092
|
+
"aria-expanded": me,
|
|
2093
|
+
children: /* @__PURE__ */ r(qt, {})
|
|
2094
2094
|
}
|
|
2095
2095
|
),
|
|
2096
|
-
|
|
2097
|
-
|
|
2096
|
+
me && H.length > 0 && /* @__PURE__ */ r(
|
|
2097
|
+
Xn,
|
|
2098
2098
|
{
|
|
2099
2099
|
label: "Camera",
|
|
2100
2100
|
devices: H,
|
|
2101
|
-
activeId:
|
|
2102
|
-
anchorRef:
|
|
2103
|
-
onPick: (
|
|
2104
|
-
|
|
2101
|
+
activeId: X,
|
|
2102
|
+
anchorRef: It,
|
|
2103
|
+
onPick: (C) => {
|
|
2104
|
+
we(!1), Je(C);
|
|
2105
2105
|
}
|
|
2106
2106
|
}
|
|
2107
2107
|
)
|
|
@@ -2112,36 +2112,36 @@ const Mi = ({
|
|
|
2112
2112
|
{
|
|
2113
2113
|
type: "button",
|
|
2114
2114
|
className: `ll-tool ll-tool--left ${O ? "is-muted" : ""}`,
|
|
2115
|
-
onClick:
|
|
2115
|
+
onClick: ft,
|
|
2116
2116
|
"aria-label": O ? "Unmute microphone" : "Mute microphone",
|
|
2117
2117
|
title: O ? "Unmute" : "Mute",
|
|
2118
|
-
children: /* @__PURE__ */ r(
|
|
2118
|
+
children: /* @__PURE__ */ r(hr, { muted: O })
|
|
2119
2119
|
}
|
|
2120
2120
|
),
|
|
2121
2121
|
/* @__PURE__ */ r(
|
|
2122
2122
|
"button",
|
|
2123
2123
|
{
|
|
2124
|
-
ref:
|
|
2124
|
+
ref: Mt,
|
|
2125
2125
|
type: "button",
|
|
2126
2126
|
className: `ll-tool ll-tool--right ${O ? "is-muted" : ""}`,
|
|
2127
|
-
onClick: (
|
|
2128
|
-
|
|
2127
|
+
onClick: (C) => {
|
|
2128
|
+
C.stopPropagation(), tt((se) => !se), we(!1);
|
|
2129
2129
|
},
|
|
2130
2130
|
"aria-label": "Microphone devices",
|
|
2131
2131
|
"aria-haspopup": "listbox",
|
|
2132
|
-
"aria-expanded":
|
|
2133
|
-
children: /* @__PURE__ */ r(
|
|
2132
|
+
"aria-expanded": et,
|
|
2133
|
+
children: /* @__PURE__ */ r(qt, {})
|
|
2134
2134
|
}
|
|
2135
2135
|
),
|
|
2136
|
-
|
|
2137
|
-
|
|
2136
|
+
et && z.length > 0 && /* @__PURE__ */ r(
|
|
2137
|
+
Xn,
|
|
2138
2138
|
{
|
|
2139
2139
|
label: "Microphone",
|
|
2140
2140
|
devices: z,
|
|
2141
2141
|
activeId: B,
|
|
2142
|
-
anchorRef:
|
|
2143
|
-
onPick: (
|
|
2144
|
-
|
|
2142
|
+
anchorRef: Mt,
|
|
2143
|
+
onPick: (C) => {
|
|
2144
|
+
tt(!1), St(C);
|
|
2145
2145
|
}
|
|
2146
2146
|
}
|
|
2147
2147
|
)
|
|
@@ -2151,10 +2151,10 @@ const Mi = ({
|
|
|
2151
2151
|
{
|
|
2152
2152
|
type: "button",
|
|
2153
2153
|
className: `ll-tool ${$ ? "is-muted" : ""}`,
|
|
2154
|
-
onClick:
|
|
2154
|
+
onClick: Be,
|
|
2155
2155
|
"aria-label": $ ? "Unmute speaker" : "Mute speaker",
|
|
2156
2156
|
title: $ ? "Unmute speaker" : "Mute speaker",
|
|
2157
|
-
children: /* @__PURE__ */ r(
|
|
2157
|
+
children: /* @__PURE__ */ r(mr, { muted: $ })
|
|
2158
2158
|
}
|
|
2159
2159
|
),
|
|
2160
2160
|
/* @__PURE__ */ r(
|
|
@@ -2162,57 +2162,57 @@ const Mi = ({
|
|
|
2162
2162
|
{
|
|
2163
2163
|
type: "button",
|
|
2164
2164
|
className: "ll-tool ll-tool--danger",
|
|
2165
|
-
onClick:
|
|
2165
|
+
onClick: dt,
|
|
2166
2166
|
"aria-label": "End conversation",
|
|
2167
2167
|
title: "End conversation",
|
|
2168
|
-
children: /* @__PURE__ */ r(
|
|
2168
|
+
children: /* @__PURE__ */ r(gr, {})
|
|
2169
2169
|
}
|
|
2170
2170
|
)
|
|
2171
2171
|
] }),
|
|
2172
|
-
!
|
|
2173
|
-
|
|
2172
|
+
!le && j && /* @__PURE__ */ r(
|
|
2173
|
+
zi,
|
|
2174
2174
|
{
|
|
2175
2175
|
isMuted: O,
|
|
2176
|
-
onToggleMute:
|
|
2177
|
-
isCameraEnabled:
|
|
2178
|
-
onToggleCamera:
|
|
2179
|
-
allowCamera:
|
|
2176
|
+
onToggleMute: ft,
|
|
2177
|
+
isCameraEnabled: Z,
|
|
2178
|
+
onToggleCamera: Ke,
|
|
2179
|
+
allowCamera: U,
|
|
2180
2180
|
isScreenShareEnabled: f,
|
|
2181
|
-
onToggleScreenShare:
|
|
2182
|
-
allowScreenShare:
|
|
2181
|
+
onToggleScreenShare: Fe,
|
|
2182
|
+
allowScreenShare: K,
|
|
2183
2183
|
isSpeakerMuted: $,
|
|
2184
|
-
onToggleSpeaker:
|
|
2185
|
-
allowTyping:
|
|
2186
|
-
isTypingOpen:
|
|
2187
|
-
onToggleTyping:
|
|
2188
|
-
onDisconnect:
|
|
2184
|
+
onToggleSpeaker: Be,
|
|
2185
|
+
allowTyping: re,
|
|
2186
|
+
isTypingOpen: Tt,
|
|
2187
|
+
onToggleTyping: pn,
|
|
2188
|
+
onDisconnect: dt
|
|
2189
2189
|
}
|
|
2190
2190
|
),
|
|
2191
|
-
!
|
|
2191
|
+
!le && re && (j ? Tt : !0) && /* @__PURE__ */ S("form", { className: "ll-message-input", onSubmit: Ne, children: [
|
|
2192
2192
|
/* @__PURE__ */ r(
|
|
2193
2193
|
"input",
|
|
2194
2194
|
{
|
|
2195
2195
|
type: "text",
|
|
2196
2196
|
className: "ll-message-input__field",
|
|
2197
2197
|
placeholder: "Message...",
|
|
2198
|
-
value:
|
|
2199
|
-
onChange: (
|
|
2198
|
+
value: xe,
|
|
2199
|
+
onChange: (C) => Re(C.target.value),
|
|
2200
2200
|
"aria-label": "Message the agent"
|
|
2201
2201
|
}
|
|
2202
2202
|
),
|
|
2203
|
-
|
|
2203
|
+
xe.trim() && /* @__PURE__ */ r(
|
|
2204
2204
|
"button",
|
|
2205
2205
|
{
|
|
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(Fi, {})
|
|
2210
2210
|
}
|
|
2211
2211
|
)
|
|
2212
2212
|
] })
|
|
2213
2213
|
] }) : null,
|
|
2214
2214
|
(() => {
|
|
2215
|
-
if (v &&
|
|
2215
|
+
if (v && L !== "error")
|
|
2216
2216
|
return /* @__PURE__ */ S("div", { className: "ll-expanded__banner", role: "alert", children: [
|
|
2217
2217
|
/* @__PURE__ */ r("span", { children: v }),
|
|
2218
2218
|
/* @__PURE__ */ r(
|
|
@@ -2220,23 +2220,23 @@ const Mi = ({
|
|
|
2220
2220
|
{
|
|
2221
2221
|
type: "button",
|
|
2222
2222
|
className: "ll-expanded__banner-x",
|
|
2223
|
-
onClick:
|
|
2223
|
+
onClick: Ze,
|
|
2224
2224
|
"aria-label": "Dismiss",
|
|
2225
2225
|
children: "×"
|
|
2226
2226
|
}
|
|
2227
2227
|
)
|
|
2228
2228
|
] });
|
|
2229
|
-
if (!b ||
|
|
2230
|
-
let
|
|
2231
|
-
return b === "MIC_PERMISSION_DENIED" ?
|
|
2232
|
-
/* @__PURE__ */ r("span", { children:
|
|
2229
|
+
if (!b || L !== "error") return null;
|
|
2230
|
+
let C = "Failed to connect", se = "Try again";
|
|
2231
|
+
return b === "MIC_PERMISSION_DENIED" ? C = "Microphone blocked. Allow access to talk." : b === "MIC_NOT_FOUND" ? C = "No microphone found. Plug one in + retry." : b === "MIC_UNAVAILABLE" ? C = "Mic unavailable. Check other apps using it." : b === "AGENT_TIMEOUT" ? C = "Agent didn't pick up. Try again." : b === "CONNECT_FAILED" ? C = "Connection failed. Check your network." : b.length < 80 && (C = b), /* @__PURE__ */ S("div", { className: "ll-expanded__banner ll-expanded__banner--error", role: "alert", children: [
|
|
2232
|
+
/* @__PURE__ */ r("span", { children: C }),
|
|
2233
2233
|
/* @__PURE__ */ r(
|
|
2234
2234
|
"button",
|
|
2235
2235
|
{
|
|
2236
2236
|
type: "button",
|
|
2237
2237
|
className: "ll-expanded__banner-retry",
|
|
2238
|
-
onClick:
|
|
2239
|
-
children:
|
|
2238
|
+
onClick: kt,
|
|
2239
|
+
children: se
|
|
2240
2240
|
}
|
|
2241
2241
|
)
|
|
2242
2242
|
] });
|
|
@@ -2257,32 +2257,32 @@ const Mi = ({
|
|
|
2257
2257
|
}
|
|
2258
2258
|
);
|
|
2259
2259
|
};
|
|
2260
|
-
function
|
|
2260
|
+
function qt() {
|
|
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 Yn() {
|
|
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 Gn() {
|
|
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 fr() {
|
|
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 pr() {
|
|
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 hr({ 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,22 +2290,22 @@ function ar({ muted: e }) {
|
|
|
2290
2290
|
e && /* @__PURE__ */ r("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2291
2291
|
] });
|
|
2292
2292
|
}
|
|
2293
|
-
function
|
|
2293
|
+
function mr({ 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
|
-
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ S(
|
|
2296
|
+
e ? /* @__PURE__ */ r("line", { x1: "23", y1: "9", x2: "17", y2: "15" }) : /* @__PURE__ */ S(Xe, { children: [
|
|
2297
2297
|
/* @__PURE__ */ r("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" }),
|
|
2298
2298
|
/* @__PURE__ */ r("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" })
|
|
2299
2299
|
] })
|
|
2300
2300
|
] });
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2302
|
+
function Fi() {
|
|
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 gr() {
|
|
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 cr() {
|
|
|
2314
2314
|
}
|
|
2315
2315
|
) });
|
|
2316
2316
|
}
|
|
2317
|
-
const
|
|
2317
|
+
const Xn = ({
|
|
2318
2318
|
label: e,
|
|
2319
2319
|
devices: t,
|
|
2320
2320
|
activeId: n,
|
|
@@ -2322,7 +2322,7 @@ const Wn = ({
|
|
|
2322
2322
|
anchorRef: l
|
|
2323
2323
|
}) => {
|
|
2324
2324
|
const [o, s] = M(null);
|
|
2325
|
-
return
|
|
2325
|
+
return ar(() => {
|
|
2326
2326
|
const a = () => {
|
|
2327
2327
|
const c = l.current;
|
|
2328
2328
|
if (!c) return;
|
|
@@ -2335,7 +2335,7 @@ const Wn = ({
|
|
|
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 : dn(
|
|
2339
2339
|
/* @__PURE__ */ S(
|
|
2340
2340
|
"div",
|
|
2341
2341
|
{
|
|
@@ -2374,7 +2374,7 @@ const Wn = ({
|
|
|
2374
2374
|
),
|
|
2375
2375
|
document.body
|
|
2376
2376
|
);
|
|
2377
|
-
},
|
|
2377
|
+
}, Bi = [
|
|
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 Wn = ({
|
|
|
2382
2382
|
"[data-ll-skip]",
|
|
2383
2383
|
".ll-widget"
|
|
2384
2384
|
];
|
|
2385
|
-
function
|
|
2385
|
+
function Vt(e) {
|
|
2386
2386
|
let t = e;
|
|
2387
2387
|
for (; t; ) {
|
|
2388
|
-
for (const n of
|
|
2388
|
+
for (const n of Bi)
|
|
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 sn(e) {
|
|
2395
|
+
if (Vt(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 nn(e) {
|
|
|
2400
2400
|
}
|
|
2401
2401
|
return !0;
|
|
2402
2402
|
}
|
|
2403
|
-
const
|
|
2404
|
-
function
|
|
2405
|
-
const t =
|
|
2403
|
+
const Wi = /\b(continue|next|proceed|move\s*on|forward)\b|→|›/i, Kn = /\b(back|previous|prev|go\s*back)\b|←|‹/i, qi = /\b(submit|finish|done|complete|send)\b/i, Ct = /* @__PURE__ */ new Map();
|
|
2404
|
+
function Jn(e) {
|
|
2405
|
+
const t = Ct.get(e);
|
|
2406
2406
|
return t && t.isConnected ? t : null;
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2409
|
-
if (
|
|
2408
|
+
function at(e) {
|
|
2409
|
+
if (Vt(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
|
-
function
|
|
2413
|
+
function Ui(e) {
|
|
2414
2414
|
return !!(e.disabled || e.getAttribute("aria-disabled") === "true");
|
|
2415
2415
|
}
|
|
2416
|
-
function
|
|
2416
|
+
function ji(e) {
|
|
2417
2417
|
return (e.innerText || e.textContent || e.getAttribute("aria-label") || e.value || "").trim();
|
|
2418
2418
|
}
|
|
2419
|
-
function
|
|
2419
|
+
function Vi(e) {
|
|
2420
2420
|
return Array.from(e.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"]')).filter(
|
|
2421
|
-
(n) => !
|
|
2421
|
+
(n) => !at(n) && !Ui(n)
|
|
2422
2422
|
);
|
|
2423
2423
|
}
|
|
2424
|
-
function
|
|
2425
|
-
|
|
2426
|
-
const t =
|
|
2424
|
+
function yr(e) {
|
|
2425
|
+
Ct.clear();
|
|
2426
|
+
const t = Vi(e);
|
|
2427
2427
|
let n, i, l;
|
|
2428
2428
|
for (const a of t) {
|
|
2429
|
-
const c =
|
|
2429
|
+
const c = ji(a);
|
|
2430
2430
|
if (!c || c.length > 40) continue;
|
|
2431
2431
|
const d = a.getAttribute("type") === "submit" || a.tagName === "BUTTON" && !a.getAttribute("type") && !!a.closest("form");
|
|
2432
|
-
!n &&
|
|
2432
|
+
!n && Wi.test(c) && !Kn.test(c) ? (n = { id: "ll-advance", label: c }, Ct.set("ll-advance", a)) : !i && Kn.test(c) ? (i = { id: "ll-back", label: c }, Ct.set("ll-back", a)) : !l && (qi.test(c) || d) && (l = { id: "ll-submit", label: c }, Ct.set("ll-submit", a));
|
|
2433
2433
|
}
|
|
2434
|
-
const o =
|
|
2434
|
+
const o = Qi(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 Yi = 60;
|
|
2438
|
+
function vr(e) {
|
|
2439
|
+
return e.replace(/^\s*(step\s+)?\d{1,2}(?:[.):\-]+\s*|\s+)/i, "").replace(/\s+/g, " ").trim().slice(0, Yi);
|
|
2440
2440
|
}
|
|
2441
|
-
function
|
|
2441
|
+
function Gi(e) {
|
|
2442
2442
|
const t = e.getAttribute("class");
|
|
2443
2443
|
return t ? t.toLowerCase() : "";
|
|
2444
2444
|
}
|
|
2445
|
-
const
|
|
2446
|
-
function
|
|
2447
|
-
return
|
|
2445
|
+
const Xi = /stepper|wizard|ant-steps|step-indicator/;
|
|
2446
|
+
function Ki(e) {
|
|
2447
|
+
return Xi.test(Gi(e));
|
|
2448
2448
|
}
|
|
2449
|
-
function
|
|
2449
|
+
function Zn(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 Ji = '[aria-current="step"],[aria-current="true"],[class*="active"],[class*="Active"],[class*="current"],[class*="Current"],[class*="selected"],[class*="Selected"]';
|
|
2456
|
+
function Zi(e) {
|
|
2457
|
+
return Zn(e) ? !0 : Array.from(e.querySelectorAll(Ji)).some(
|
|
2458
|
+
Zn
|
|
2459
2459
|
);
|
|
2460
2460
|
}
|
|
2461
|
-
function
|
|
2462
|
-
const n =
|
|
2461
|
+
function Qn(e, t) {
|
|
2462
|
+
const n = vr(
|
|
2463
2463
|
e[t].innerText || e[t].textContent || ""
|
|
2464
2464
|
);
|
|
2465
2465
|
return {
|
|
@@ -2468,23 +2468,23 @@ function Vn(e, t) {
|
|
|
2468
2468
|
...n ? { stepLabel: n } : {}
|
|
2469
2469
|
};
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2471
|
+
function Qi(e) {
|
|
2472
2472
|
const t = e.querySelector('[aria-current="step"]');
|
|
2473
|
-
if (t && t.parentElement && !
|
|
2473
|
+
if (t && t.parentElement && !at(t)) {
|
|
2474
2474
|
const l = Array.from(t.parentElement.children).filter(
|
|
2475
|
-
(s) => s.tagName === t.tagName && !
|
|
2475
|
+
(s) => s.tagName === t.tagName && !at(s)
|
|
2476
2476
|
), o = l.indexOf(t);
|
|
2477
|
-
if (o >= 0 && l.length >= 2) return
|
|
2477
|
+
if (o >= 0 && l.length >= 2) return Qn(l, o);
|
|
2478
2478
|
}
|
|
2479
2479
|
const n = e.querySelector('[role="progressbar"]');
|
|
2480
|
-
if (n && !
|
|
2480
|
+
if (n && !at(n)) {
|
|
2481
2481
|
const l = Number(n.getAttribute("aria-valuenow")), o = Number(n.getAttribute("aria-valuemax"));
|
|
2482
2482
|
if (Number.isFinite(l) && Number.isFinite(o) && o >= 2) {
|
|
2483
2483
|
const s = (n.getAttribute("aria-valuetext") || "").trim();
|
|
2484
2484
|
return {
|
|
2485
2485
|
totalSteps: o,
|
|
2486
2486
|
currentStep: l,
|
|
2487
|
-
...s ? { stepLabel:
|
|
2487
|
+
...s ? { stepLabel: vr(s) } : {}
|
|
2488
2488
|
};
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
@@ -2492,19 +2492,19 @@ function Ui(e) {
|
|
|
2492
2492
|
e.querySelectorAll(
|
|
2493
2493
|
'[class*="step"], [class*="Step"], [class*="wizard"], [class*="Wizard"]'
|
|
2494
2494
|
)
|
|
2495
|
-
).filter((l) => !
|
|
2495
|
+
).filter((l) => !at(l) && Ki(l));
|
|
2496
2496
|
for (const l of i) {
|
|
2497
2497
|
const o = Array.from(l.children).filter(
|
|
2498
|
-
(a) => !
|
|
2498
|
+
(a) => !at(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(Zi);
|
|
2502
2502
|
if (!(s < 0))
|
|
2503
|
-
return
|
|
2503
|
+
return Qn(o, s);
|
|
2504
2504
|
}
|
|
2505
2505
|
return {};
|
|
2506
2506
|
}
|
|
2507
|
-
const
|
|
2507
|
+
const Ut = 4096, eo = 20, to = 20, no = 10, ro = 10, io = 30, oo = 20, er = 500, lo = [
|
|
2508
2508
|
'[data-ll-private="true"]',
|
|
2509
2509
|
".ll-widget",
|
|
2510
2510
|
"script",
|
|
@@ -2512,24 +2512,24 @@ const Ft = 4096, ji = 20, Vi = 20, Yi = 10, Gi = 10, Xi = 30, Ki = 20, Yn = 500,
|
|
|
2512
2512
|
"noscript",
|
|
2513
2513
|
"iframe"
|
|
2514
2514
|
];
|
|
2515
|
-
function
|
|
2515
|
+
function _t(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 lo)
|
|
2520
2520
|
if (t.matches(n)) return !0;
|
|
2521
2521
|
t = t.parentElement;
|
|
2522
2522
|
}
|
|
2523
2523
|
return !1;
|
|
2524
2524
|
}
|
|
2525
|
-
function
|
|
2525
|
+
function xt(e) {
|
|
2526
2526
|
if (typeof window > "u") return !0;
|
|
2527
2527
|
const t = e.getBoundingClientRect();
|
|
2528
2528
|
if (t.width <= 0 || t.height <= 0) return !1;
|
|
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 tr(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}"]`);
|
|
@@ -2556,13 +2556,13 @@ function Gn(e) {
|
|
|
2556
2556
|
const l = e.getAttribute("placeholder");
|
|
2557
2557
|
return l ? l.trim() : "";
|
|
2558
2558
|
}
|
|
2559
|
-
function
|
|
2559
|
+
function de(e, t) {
|
|
2560
2560
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2561
2561
|
}
|
|
2562
|
-
function
|
|
2562
|
+
function ao(e) {
|
|
2563
2563
|
return e && e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2564
2564
|
}
|
|
2565
|
-
function
|
|
2565
|
+
function so(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");
|
|
@@ -2588,10 +2588,10 @@ function Qi(e) {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
return null;
|
|
2590
2590
|
}
|
|
2591
|
-
function
|
|
2591
|
+
function lt(e) {
|
|
2592
2592
|
return e.length;
|
|
2593
2593
|
}
|
|
2594
|
-
function
|
|
2594
|
+
function co(e, t = {}) {
|
|
2595
2595
|
const n = t.doc ?? (typeof document < "u" ? document : null);
|
|
2596
2596
|
if (!n)
|
|
2597
2597
|
return {
|
|
@@ -2609,119 +2609,119 @@ function eo(e, t = {}) {
|
|
|
2609
2609
|
n.querySelectorAll("[data-ll-region]")
|
|
2610
2610
|
), a = [];
|
|
2611
2611
|
for (const v of s) {
|
|
2612
|
-
if (a.length >=
|
|
2613
|
-
if (
|
|
2614
|
-
const z = v.getAttribute("data-ll-region") ?? "", B = v.getAttribute("data-ll-intent") ?? void 0,
|
|
2612
|
+
if (a.length >= no) break;
|
|
2613
|
+
if (_t(v) || !xt(v)) continue;
|
|
2614
|
+
const z = v.getAttribute("data-ll-region") ?? "", B = v.getAttribute("data-ll-intent") ?? void 0, Z = de(
|
|
2615
2615
|
(v.innerText || v.textContent || "").trim(),
|
|
2616
|
-
|
|
2616
|
+
er * 2
|
|
2617
2617
|
);
|
|
2618
|
-
!z || !
|
|
2618
|
+
!z || !Z || a.push({ id: z, intent: B, text: Z });
|
|
2619
2619
|
}
|
|
2620
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
2623
|
for (const v of g) {
|
|
2624
|
-
if (
|
|
2624
|
+
if (_t(v) || !xt(v)) continue;
|
|
2625
2625
|
const z = (v.textContent || "").trim();
|
|
2626
|
-
z && c.push(`${v.tagName}: ${
|
|
2626
|
+
z && c.push(`${v.tagName}: ${de(z, 200)}`);
|
|
2627
2627
|
}
|
|
2628
2628
|
const p = Array.from(n.querySelectorAll("p, li"));
|
|
2629
2629
|
for (const v of p) {
|
|
2630
|
-
if (
|
|
2630
|
+
if (_t(v) || !xt(v) || d.includes(v.tagName)) continue;
|
|
2631
2631
|
const z = (v.textContent || "").trim();
|
|
2632
|
-
z.length > 10 && c.push(
|
|
2632
|
+
z.length > 10 && c.push(de(z, er));
|
|
2633
2633
|
}
|
|
2634
2634
|
const m = c.join(`
|
|
2635
|
-
`),
|
|
2635
|
+
`), P = [], x = Array.from(n.querySelectorAll("a[href]"));
|
|
2636
2636
|
for (const v of x) {
|
|
2637
|
-
if (
|
|
2638
|
-
if (
|
|
2637
|
+
if (P.length >= eo) break;
|
|
2638
|
+
if (_t(v) || !xt(v)) continue;
|
|
2639
2639
|
const z = v.getAttribute("href") || "", B = (v.textContent || "").trim();
|
|
2640
|
-
!z || !B ||
|
|
2640
|
+
!z || !B || P.push({ href: z, text: de(B, 100) });
|
|
2641
2641
|
}
|
|
2642
|
-
const
|
|
2642
|
+
const L = [], y = Array.from(
|
|
2643
2643
|
n.querySelectorAll(
|
|
2644
2644
|
"input, textarea, select"
|
|
2645
2645
|
)
|
|
2646
2646
|
);
|
|
2647
2647
|
for (const v of y) {
|
|
2648
|
-
if (
|
|
2649
|
-
if (
|
|
2650
|
-
const z =
|
|
2651
|
-
z &&
|
|
2648
|
+
if (L.length >= to) break;
|
|
2649
|
+
if (_t(v) || !sn(v) || !xt(v)) continue;
|
|
2650
|
+
const z = tr(v), B = v instanceof HTMLInputElement ? v.type : v.tagName.toLowerCase();
|
|
2651
|
+
z && L.push({ label: de(z, 100), type: B });
|
|
2652
2652
|
}
|
|
2653
|
-
const w = Array.from(n.querySelectorAll("form")),
|
|
2653
|
+
const w = Array.from(n.querySelectorAll("form")), D = [];
|
|
2654
2654
|
let E = 0;
|
|
2655
2655
|
for (const v of w) {
|
|
2656
|
-
if (
|
|
2657
|
-
if (
|
|
2658
|
-
const z = v.getAttribute("id") || v.getAttribute("name") ||
|
|
2656
|
+
if (D.length >= ro) break;
|
|
2657
|
+
if (Vt(v) || v.matches(".ll-widget *, .ll-widget")) continue;
|
|
2658
|
+
const z = v.getAttribute("id") || v.getAttribute("name") || ao(v.getAttribute("data-ll-intent")) || `form_${E++}`, B = v.getAttribute("data-ll-intent") || so(v) || void 0, Z = Array.from(
|
|
2659
2659
|
v.querySelectorAll(
|
|
2660
2660
|
"input, textarea, select"
|
|
2661
2661
|
)
|
|
2662
|
-
),
|
|
2662
|
+
), ae = [];
|
|
2663
2663
|
let H = 0;
|
|
2664
|
-
const
|
|
2665
|
-
for (const f of
|
|
2666
|
-
if (
|
|
2667
|
-
if (!
|
|
2664
|
+
const X = /* @__PURE__ */ new Set();
|
|
2665
|
+
for (const f of Z) {
|
|
2666
|
+
if (ae.length >= io) break;
|
|
2667
|
+
if (!sn(f)) continue;
|
|
2668
2668
|
if (f instanceof HTMLInputElement) {
|
|
2669
|
-
const
|
|
2670
|
-
if (
|
|
2669
|
+
const j = f.type;
|
|
2670
|
+
if (j === "submit" || j === "button" || j === "reset" || j === "hidden" || j === "image" || j === "file") continue;
|
|
2671
2671
|
}
|
|
2672
|
-
const
|
|
2673
|
-
let
|
|
2674
|
-
|
|
2675
|
-
const
|
|
2676
|
-
name:
|
|
2677
|
-
label:
|
|
2678
|
-
type:
|
|
2672
|
+
const N = f.getAttribute("name") || "", $ = f.getAttribute("id") || "";
|
|
2673
|
+
let U = N || $ || `field_${H}`;
|
|
2674
|
+
X.has(U) && (U = `${U}__${H}`), X.add(U), H++;
|
|
2675
|
+
const K = tr(f) || U, re = f instanceof HTMLInputElement ? f.type : f.tagName.toLowerCase(), W = {
|
|
2676
|
+
name: U,
|
|
2677
|
+
label: de(K, 100),
|
|
2678
|
+
type: re
|
|
2679
2679
|
};
|
|
2680
2680
|
f.required === !0 && (W.required = !0);
|
|
2681
|
-
const
|
|
2682
|
-
if (
|
|
2683
|
-
const
|
|
2684
|
-
if (
|
|
2685
|
-
const
|
|
2686
|
-
!Number.isNaN(
|
|
2681
|
+
const ie = f.getAttribute("placeholder");
|
|
2682
|
+
if (ie && (W.placeholder = de(ie.trim(), 100)), f instanceof HTMLInputElement || f instanceof HTMLTextAreaElement) {
|
|
2683
|
+
const j = f.getAttribute("minlength");
|
|
2684
|
+
if (j !== null) {
|
|
2685
|
+
const Q = parseInt(j, 10);
|
|
2686
|
+
!Number.isNaN(Q) && Q >= 0 && (W.minLength = Q);
|
|
2687
2687
|
}
|
|
2688
2688
|
const ge = f.getAttribute("maxlength");
|
|
2689
2689
|
if (ge !== null) {
|
|
2690
|
-
const
|
|
2691
|
-
!Number.isNaN(
|
|
2690
|
+
const Q = parseInt(ge, 10);
|
|
2691
|
+
!Number.isNaN(Q) && Q >= 0 && (W.maxLength = Q);
|
|
2692
2692
|
}
|
|
2693
2693
|
}
|
|
2694
2694
|
if (f instanceof HTMLInputElement) {
|
|
2695
|
-
const
|
|
2696
|
-
|
|
2695
|
+
const j = f.getAttribute("min");
|
|
2696
|
+
j !== null && (W.min = de(j, 50));
|
|
2697
2697
|
const ge = f.getAttribute("max");
|
|
2698
|
-
ge !== null && (W.max =
|
|
2699
|
-
const
|
|
2700
|
-
|
|
2698
|
+
ge !== null && (W.max = de(ge, 50));
|
|
2699
|
+
const Q = f.getAttribute("step");
|
|
2700
|
+
Q !== null && (W.step = de(Q, 20));
|
|
2701
2701
|
const Le = f.getAttribute("pattern");
|
|
2702
|
-
Le !== null && (W.pattern =
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2702
|
+
Le !== null && (W.pattern = de(Le, 200));
|
|
2703
|
+
const oe = (f.getAttribute("autocomplete") || "").toLowerCase();
|
|
2704
|
+
oe && oe !== "off" && !oe.startsWith("cc-") && (W.autocomplete = de(oe, 50));
|
|
2705
2705
|
}
|
|
2706
2706
|
if (f instanceof HTMLSelectElement) {
|
|
2707
|
-
const
|
|
2707
|
+
const j = [];
|
|
2708
2708
|
for (let ge = 0; ge < f.options.length; ge++) {
|
|
2709
|
-
const
|
|
2710
|
-
if (!
|
|
2711
|
-
if (
|
|
2712
|
-
const
|
|
2713
|
-
if (
|
|
2709
|
+
const Q = f.options[ge];
|
|
2710
|
+
if (!Q) continue;
|
|
2711
|
+
if (Q.value === "" || Q.disabled) {
|
|
2712
|
+
const Ie = (Q.textContent || "").trim();
|
|
2713
|
+
if (Ie && !W.placeholderOption && (W.placeholderOption = de(Ie, 60)), W.hasEmptyOption = !0, Q.disabled) continue;
|
|
2714
2714
|
}
|
|
2715
|
-
if (
|
|
2716
|
-
const Le =
|
|
2717
|
-
!Le && !
|
|
2715
|
+
if (j.length >= oo) break;
|
|
2716
|
+
const Le = Q.value || "", oe = (Q.textContent || "").trim() || Le;
|
|
2717
|
+
!Le && !oe || j.push({ value: Le, label: de(oe, 60) });
|
|
2718
2718
|
}
|
|
2719
|
-
|
|
2719
|
+
j.length > 0 && (W.options = j);
|
|
2720
2720
|
}
|
|
2721
|
-
const
|
|
2722
|
-
|
|
2721
|
+
const le = typeof f.validationMessage == "string" ? f.validationMessage : "";
|
|
2722
|
+
le && (W.validationMessage = de(le, 200)), ae.push(W);
|
|
2723
2723
|
}
|
|
2724
|
-
|
|
2724
|
+
D.push({ id: z, intent: B, fields: ae });
|
|
2725
2725
|
}
|
|
2726
2726
|
const b = {
|
|
2727
2727
|
url: i,
|
|
@@ -2729,39 +2729,39 @@ function eo(e, t = {}) {
|
|
|
2729
2729
|
pathname: l,
|
|
2730
2730
|
regions: a,
|
|
2731
2731
|
visibleText: m,
|
|
2732
|
-
visibleLinks:
|
|
2733
|
-
visibleFields:
|
|
2734
|
-
forms:
|
|
2735
|
-
flow:
|
|
2732
|
+
visibleLinks: P,
|
|
2733
|
+
visibleFields: L,
|
|
2734
|
+
forms: D,
|
|
2735
|
+
flow: yr(n),
|
|
2736
2736
|
extras: e
|
|
2737
2737
|
};
|
|
2738
|
-
let O =
|
|
2739
|
-
for (; O >
|
|
2740
|
-
b.visibleFields.pop(), O =
|
|
2741
|
-
for (; O >
|
|
2738
|
+
let O = lt(JSON.stringify(b.regions)) + lt(b.visibleText) + lt(JSON.stringify(b.visibleLinks)) + lt(JSON.stringify(b.visibleFields));
|
|
2739
|
+
for (; O > Ut && b.visibleFields.length > 0; )
|
|
2740
|
+
b.visibleFields.pop(), O = lt(JSON.stringify(b.visibleFields));
|
|
2741
|
+
for (; O > Ut && b.visibleLinks.length > 0; )
|
|
2742
2742
|
b.visibleLinks.pop(), O -= 80;
|
|
2743
|
-
return
|
|
2743
|
+
return lt(b.visibleText) > Ut && (b.visibleText = de(b.visibleText, Ut - 100)), b;
|
|
2744
2744
|
}
|
|
2745
|
-
let
|
|
2746
|
-
function
|
|
2745
|
+
let st = null;
|
|
2746
|
+
function uo(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 ?
|
|
2755
|
-
if (
|
|
2756
|
-
return
|
|
2757
|
-
const a =
|
|
2758
|
-
return
|
|
2753
|
+
function nr(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 ? uo(i) : ""}`;
|
|
2755
|
+
if (st && st.key === s && n - st.at < 1e3)
|
|
2756
|
+
return st.ctx;
|
|
2757
|
+
const a = co(e, t);
|
|
2758
|
+
return st = { key: s, at: n, ctx: a }, a;
|
|
2759
2759
|
}
|
|
2760
|
-
function
|
|
2761
|
-
|
|
2760
|
+
function fo() {
|
|
2761
|
+
st = null;
|
|
2762
2762
|
}
|
|
2763
|
-
const
|
|
2764
|
-
function
|
|
2763
|
+
const po = 200;
|
|
2764
|
+
function ho(e) {
|
|
2765
2765
|
const t = String(e.href || "");
|
|
2766
2766
|
return {
|
|
2767
2767
|
href: t,
|
|
@@ -2771,18 +2771,18 @@ function io(e) {
|
|
|
2771
2771
|
description: e.description
|
|
2772
2772
|
};
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function mo(e) {
|
|
2775
2775
|
return !(!e || e.startsWith("#") || e.startsWith("javascript:") || e.startsWith("mailto:") || e.startsWith("tel:"));
|
|
2776
2776
|
}
|
|
2777
|
-
function
|
|
2777
|
+
function go(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 >= po) break;
|
|
2783
|
+
if (Vt(s)) continue;
|
|
2784
2784
|
const a = s.getAttribute("href") || "";
|
|
2785
|
-
if (!
|
|
2785
|
+
if (!mo(a)) continue;
|
|
2786
2786
|
let c = a, d = !0;
|
|
2787
2787
|
try {
|
|
2788
2788
|
if (typeof window < "u") {
|
|
@@ -2799,19 +2799,19 @@ function lo(e) {
|
|
|
2799
2799
|
}
|
|
2800
2800
|
return l;
|
|
2801
2801
|
}
|
|
2802
|
-
let
|
|
2803
|
-
const
|
|
2804
|
-
function
|
|
2802
|
+
let ct = null;
|
|
2803
|
+
const yo = 5e3;
|
|
2804
|
+
function on() {
|
|
2805
2805
|
const e = Date.now(), t = typeof window < "u" && window.location.pathname || "/";
|
|
2806
|
-
if (
|
|
2807
|
-
return
|
|
2808
|
-
const n =
|
|
2809
|
-
return
|
|
2806
|
+
if (ct && ct.pathname === t && e - ct.at < yo)
|
|
2807
|
+
return ct.routes;
|
|
2808
|
+
const n = go();
|
|
2809
|
+
return ct = { at: e, pathname: t, routes: n }, n;
|
|
2810
2810
|
}
|
|
2811
|
-
function
|
|
2812
|
-
|
|
2811
|
+
function vo() {
|
|
2812
|
+
ct = null;
|
|
2813
2813
|
}
|
|
2814
|
-
function
|
|
2814
|
+
function cn(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 rn(e) {
|
|
|
2819
2819
|
}
|
|
2820
2820
|
return !0;
|
|
2821
2821
|
}
|
|
2822
|
-
function
|
|
2822
|
+
function bo(e, t) {
|
|
2823
2823
|
return e.getAttribute("name") || e.getAttribute("id") || `field_${t}`;
|
|
2824
2824
|
}
|
|
2825
|
-
function
|
|
2825
|
+
function Oe(e) {
|
|
2826
2826
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2827
2827
|
}
|
|
2828
|
-
function
|
|
2828
|
+
function ln(e) {
|
|
2829
2829
|
const t = e.lastIndexOf(".");
|
|
2830
2830
|
return t >= 0 ? e.slice(t + 1) : e;
|
|
2831
2831
|
}
|
|
2832
|
-
function
|
|
2832
|
+
function wo(e) {
|
|
2833
2833
|
var i;
|
|
2834
2834
|
const t = e.getAttribute("id");
|
|
2835
2835
|
if (t)
|
|
@@ -2843,36 +2843,36 @@ function uo(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
|
|
2847
|
-
const n =
|
|
2846
|
+
function _o(e, t) {
|
|
2847
|
+
const n = Oe(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 (!cn(o)) continue;
|
|
2854
2854
|
const s = o.getAttribute("name") || "", a = o.getAttribute("id") || "", c = [
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2855
|
+
Oe(ln(s)),
|
|
2856
|
+
Oe(ln(a)),
|
|
2857
|
+
Oe(s),
|
|
2858
|
+
Oe(a)
|
|
2859
2859
|
];
|
|
2860
2860
|
let d = 0;
|
|
2861
2861
|
c.some((g) => g.length >= 2 && g === n) ? d = 4 : [
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2862
|
+
Oe(s),
|
|
2863
|
+
Oe(ln(s)),
|
|
2864
|
+
Oe(wo(o))
|
|
2865
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 xo(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 && cn(o)) return o;
|
|
2876
2876
|
} catch {
|
|
2877
2877
|
}
|
|
2878
2878
|
const n = Array.from(
|
|
@@ -2881,23 +2881,23 @@ function po(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 (!cn(o)) continue;
|
|
2885
|
+
const s = bo(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 _o(e, t);
|
|
2891
2891
|
}
|
|
2892
|
-
function
|
|
2893
|
-
const n =
|
|
2894
|
-
return n ?
|
|
2892
|
+
function rr(e, t) {
|
|
2893
|
+
const n = xo(e, t);
|
|
2894
|
+
return n ? sn(n) ? { el: n } : { el: null, reason: "private" } : { el: null, reason: "not_found" };
|
|
2895
2895
|
}
|
|
2896
|
-
function
|
|
2896
|
+
function Co(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 ko(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 mo(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
|
+
Co(e, t), i && e.dispatchEvent(new Event("input", { bubbles: !0 })), l && e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
2911
2911
|
}
|
|
2912
|
-
function
|
|
2912
|
+
function ir(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,7 +2932,7 @@ function Jn(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 && Lo(c) === t) return a;
|
|
2936
2936
|
}
|
|
2937
2937
|
if (/^form_\d+$/.test(t)) {
|
|
2938
2938
|
const a = parseInt(t.slice(5), 10);
|
|
@@ -2945,10 +2945,10 @@ function Jn(e, t) {
|
|
|
2945
2945
|
}
|
|
2946
2946
|
return s.length === 1 ? s[0] : null;
|
|
2947
2947
|
}
|
|
2948
|
-
function
|
|
2948
|
+
function Lo(e) {
|
|
2949
2949
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || null;
|
|
2950
2950
|
}
|
|
2951
|
-
function
|
|
2951
|
+
function So() {
|
|
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 yo() {
|
|
|
2956
2956
|
const t = window.getComputedStyle(e);
|
|
2957
2957
|
return !(t.overflowY === "hidden" || t.overflowY === "clip");
|
|
2958
2958
|
}
|
|
2959
|
-
function
|
|
2959
|
+
function Eo(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 Ao() {
|
|
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 (!Eo(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 bo() {
|
|
|
2976
2976
|
}
|
|
2977
2977
|
return t;
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2979
|
+
function No() {
|
|
2980
2980
|
if (typeof window > "u")
|
|
2981
2981
|
return null;
|
|
2982
|
-
if (
|
|
2983
|
-
const e =
|
|
2982
|
+
if (So()) return window;
|
|
2983
|
+
const e = Ao();
|
|
2984
2984
|
return e || window;
|
|
2985
2985
|
}
|
|
2986
|
-
function
|
|
2986
|
+
function or(e) {
|
|
2987
2987
|
return e instanceof Window ? e.innerHeight || 0 : e.clientHeight || 0;
|
|
2988
2988
|
}
|
|
2989
|
-
function
|
|
2989
|
+
function Mo(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 Io = /* @__PURE__ */ new Set([
|
|
2997
2997
|
"agent_state",
|
|
2998
2998
|
"avatar_stream_ready",
|
|
2999
2999
|
"avatar_active",
|
|
@@ -3028,9 +3028,9 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3028
3028
|
// to onAgentCommand.
|
|
3029
3029
|
"task_field_updated",
|
|
3030
3030
|
"task_completed"
|
|
3031
|
-
]),
|
|
3031
|
+
]), br = un(
|
|
3032
3032
|
function(t, n) {
|
|
3033
|
-
var
|
|
3033
|
+
var kn, Ln, Sn, En, An, Nn, Mn;
|
|
3034
3034
|
const {
|
|
3035
3035
|
agentId: i,
|
|
3036
3036
|
apiKey: l,
|
|
@@ -3049,83 +3049,83 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3049
3049
|
// minimized produced). The card sizing now lives in CSS — see
|
|
3050
3050
|
// .ll-expanded--mobile in styles.css.
|
|
3051
3051
|
defaultDisplayMode: m = "expanded",
|
|
3052
|
-
onDisplayModeChange:
|
|
3052
|
+
onDisplayModeChange: P,
|
|
3053
3053
|
position: x = "bottom-right",
|
|
3054
|
-
mobileBreakpoint:
|
|
3054
|
+
mobileBreakpoint: L = 640,
|
|
3055
3055
|
draggable: y,
|
|
3056
3056
|
resizable: w,
|
|
3057
|
-
persistKey:
|
|
3057
|
+
persistKey: D = "ll-widget",
|
|
3058
3058
|
disablePersistence: E = !1,
|
|
3059
3059
|
teamMembers: b,
|
|
3060
3060
|
currentTeamMemberId: O,
|
|
3061
3061
|
onTeamMemberChange: v,
|
|
3062
3062
|
idleLoopUrl: z,
|
|
3063
3063
|
greeting: B,
|
|
3064
|
-
avatarImageUrl:
|
|
3065
|
-
agentName:
|
|
3064
|
+
avatarImageUrl: Z,
|
|
3065
|
+
agentName: ae,
|
|
3066
3066
|
branding: H = {},
|
|
3067
|
-
allowCamera:
|
|
3067
|
+
allowCamera: X = !0,
|
|
3068
3068
|
allowScreenShare: f = !0,
|
|
3069
|
-
allowTyping:
|
|
3069
|
+
allowTyping: N = !0,
|
|
3070
3070
|
blurUntilFirstSpeech: $ = !0,
|
|
3071
|
-
showMinimize:
|
|
3072
|
-
showClose:
|
|
3073
|
-
chromeless:
|
|
3071
|
+
showMinimize: U,
|
|
3072
|
+
showClose: K,
|
|
3073
|
+
chromeless: re = !1,
|
|
3074
3074
|
floatingChromeContainer: W = null,
|
|
3075
|
-
compactControls:
|
|
3076
|
-
transforming:
|
|
3077
|
-
transformingLabel:
|
|
3075
|
+
compactControls: ie = !1,
|
|
3076
|
+
transforming: le = !1,
|
|
3077
|
+
transformingLabel: j = "Transforming…",
|
|
3078
3078
|
showOn: ge,
|
|
3079
|
-
hideOn:
|
|
3079
|
+
hideOn: Q,
|
|
3080
3080
|
pathname: Le,
|
|
3081
|
-
onNavigate:
|
|
3082
|
-
onScrollToSelector:
|
|
3083
|
-
getPageContext:
|
|
3084
|
-
pageContextExtras:
|
|
3085
|
-
getRoutes:
|
|
3086
|
-
onScrollPage:
|
|
3087
|
-
onClick:
|
|
3088
|
-
capabilities:
|
|
3089
|
-
onConnect:
|
|
3090
|
-
onDisconnect:
|
|
3091
|
-
onTranscript:
|
|
3092
|
-
onAgentState:
|
|
3093
|
-
onConnectionStateChange:
|
|
3094
|
-
onAgentEvent:
|
|
3095
|
-
onAgentCommand:
|
|
3096
|
-
onCollect:
|
|
3081
|
+
onNavigate: oe,
|
|
3082
|
+
onScrollToSelector: Ie,
|
|
3083
|
+
getPageContext: dt,
|
|
3084
|
+
pageContextExtras: kt,
|
|
3085
|
+
getRoutes: Lt,
|
|
3086
|
+
onScrollPage: ft,
|
|
3087
|
+
onClick: St,
|
|
3088
|
+
capabilities: Ke,
|
|
3089
|
+
onConnect: Je,
|
|
3090
|
+
onDisconnect: Fe,
|
|
3091
|
+
onTranscript: Be,
|
|
3092
|
+
onAgentState: We,
|
|
3093
|
+
onConnectionStateChange: qe,
|
|
3094
|
+
onAgentEvent: Ue,
|
|
3095
|
+
onAgentCommand: Ze,
|
|
3096
|
+
onCollect: je,
|
|
3097
3097
|
controlledSession: F,
|
|
3098
|
-
className:
|
|
3099
|
-
style:
|
|
3100
|
-
zIndex:
|
|
3101
|
-
} = t,
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
}, [
|
|
3105
|
-
const
|
|
3098
|
+
className: Ve,
|
|
3099
|
+
style: Qe,
|
|
3100
|
+
zIndex: Se = 2147483647
|
|
3101
|
+
} = t, Et = pi(Le), pt = wi(Et, ge, Q);
|
|
3102
|
+
T(() => {
|
|
3103
|
+
fo(), vo();
|
|
3104
|
+
}, [Et]);
|
|
3105
|
+
const Te = O !== void 0, [ht, At] = M(() => {
|
|
3106
3106
|
var h;
|
|
3107
3107
|
return O ?? ((h = b == null ? void 0 : b[0]) == null ? void 0 : h.id);
|
|
3108
|
-
}),
|
|
3109
|
-
() => (b == null ? void 0 : b.find((h) => h.id ===
|
|
3110
|
-
[b,
|
|
3111
|
-
),
|
|
3108
|
+
}), Ye = Te ? O : ht, fe = ut(
|
|
3109
|
+
() => (b == null ? void 0 : b.find((h) => h.id === Ye)) ?? null,
|
|
3110
|
+
[b, Ye]
|
|
3111
|
+
), Nt = (fe == null ? void 0 : fe.agentId) ?? i, pe = d === "EMBEDDED", be = oi(L), [et, tt] = ri({
|
|
3112
3112
|
value: p,
|
|
3113
3113
|
defaultValue: m,
|
|
3114
|
-
onChange:
|
|
3115
|
-
persistKey:
|
|
3116
|
-
disablePersistence:
|
|
3117
|
-
}),
|
|
3118
|
-
} :
|
|
3119
|
-
draggable: !
|
|
3120
|
-
resizable: !
|
|
3121
|
-
persistKey:
|
|
3122
|
-
disablePersistence:
|
|
3123
|
-
}), Re =
|
|
3124
|
-
|
|
3125
|
-
const
|
|
3126
|
-
|
|
3127
|
-
function
|
|
3128
|
-
const u =
|
|
3114
|
+
onChange: P,
|
|
3115
|
+
persistKey: D,
|
|
3116
|
+
disablePersistence: pe || E
|
|
3117
|
+
}), me = pe ? "expanded" : et, we = pe ? () => {
|
|
3118
|
+
} : tt, Mt = U ?? !pe, It = K ?? !pe, Tt = ie || !pe && be, xe = di({
|
|
3119
|
+
draggable: !pe && (y ?? !be),
|
|
3120
|
+
resizable: !pe && (w ?? !be),
|
|
3121
|
+
persistKey: D,
|
|
3122
|
+
disablePersistence: pe || E
|
|
3123
|
+
}), Re = jr(), Ne = Xr(), De = Kr(), mt = Jr(), [Pe, Ee] = M(!1), [nt, gt] = M(!1), [yt, rt] = M(!1), [C, se] = M(!1), [Yt, wr] = M(!1), Rt = xi({ baseUrl: o, config: c }), Dt = R(Rt);
|
|
3124
|
+
Dt.current = Rt;
|
|
3125
|
+
const Gt = R(oe), Xt = R(Ie), Kt = R(ft), Jt = R(St), hn = R(dt), mn = R(kt), gn = R(Lt), Zt = R(Ke), Ae = R(null);
|
|
3126
|
+
Gt.current = oe, Xt.current = Ie, Kt.current = ft, Jt.current = St, hn.current = dt, mn.current = kt, gn.current = Lt, Zt.current = Ke;
|
|
3127
|
+
function Ce(h) {
|
|
3128
|
+
const u = Zt.current;
|
|
3129
3129
|
return u ? u.includes(h) : !0;
|
|
3130
3130
|
}
|
|
3131
3131
|
function ke(h, u) {
|
|
@@ -3133,67 +3133,67 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3133
3133
|
`[LiveLayer] Agent command "${h}" blocked — capability "${u}" not in allowlist. See https://livelayer.studio/docs/react/capabilities`
|
|
3134
3134
|
);
|
|
3135
3135
|
}
|
|
3136
|
-
const
|
|
3136
|
+
const vt = k(
|
|
3137
3137
|
(h) => {
|
|
3138
|
-
var
|
|
3138
|
+
var ee, he, Me, wt, ze, In, Tn;
|
|
3139
3139
|
const u = h;
|
|
3140
3140
|
if (!(!u.type || typeof u.type != "string")) {
|
|
3141
|
-
if (
|
|
3142
|
-
if (!
|
|
3141
|
+
if (Ue == null || Ue({ eventName: u.type, data: h }), u.type === "navigate") {
|
|
3142
|
+
if (!Ce("navigate")) {
|
|
3143
3143
|
ke("navigate", "navigate");
|
|
3144
3144
|
return;
|
|
3145
3145
|
}
|
|
3146
|
-
const
|
|
3147
|
-
if (!
|
|
3146
|
+
const A = typeof u.href == "string" ? u.href : null;
|
|
3147
|
+
if (!A) {
|
|
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 (
|
|
3153
|
+
if (Dt.current.playPageChange(), Gt.current) {
|
|
3154
3154
|
try {
|
|
3155
|
-
|
|
3156
|
-
} catch (
|
|
3155
|
+
Gt.current(A);
|
|
3156
|
+
} catch (I) {
|
|
3157
3157
|
console.warn(
|
|
3158
|
-
`[LiveLayer] onNavigate threw for "${
|
|
3159
|
-
|
|
3158
|
+
`[LiveLayer] onNavigate threw for "${A}". Falling back. Error:`,
|
|
3159
|
+
I
|
|
3160
3160
|
);
|
|
3161
3161
|
}
|
|
3162
3162
|
return;
|
|
3163
3163
|
}
|
|
3164
3164
|
if (typeof document < "u") {
|
|
3165
|
-
const
|
|
3166
|
-
`a[href="${
|
|
3165
|
+
const I = document.querySelector(
|
|
3166
|
+
`a[href="${A.replace(/"/g, '\\"')}"]`
|
|
3167
3167
|
);
|
|
3168
|
-
if (
|
|
3169
|
-
|
|
3168
|
+
if (I) {
|
|
3169
|
+
I.click();
|
|
3170
3170
|
return;
|
|
3171
3171
|
}
|
|
3172
3172
|
}
|
|
3173
3173
|
if (typeof window < "u" && typeof history < "u")
|
|
3174
3174
|
try {
|
|
3175
|
-
history.pushState({}, "",
|
|
3176
|
-
} catch (
|
|
3175
|
+
history.pushState({}, "", A), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
3176
|
+
} catch (I) {
|
|
3177
3177
|
console.warn(
|
|
3178
|
-
`[LiveLayer] history.pushState fallback failed for "${
|
|
3179
|
-
|
|
3178
|
+
`[LiveLayer] history.pushState fallback failed for "${A}". Pass an onNavigate prop to use your router directly. See https://livelayer.studio/docs/react/navigation`,
|
|
3179
|
+
I
|
|
3180
3180
|
);
|
|
3181
3181
|
}
|
|
3182
3182
|
return;
|
|
3183
3183
|
}
|
|
3184
3184
|
if (u.type === "scroll_to") {
|
|
3185
|
-
if (!
|
|
3185
|
+
if (!Ce("scroll")) {
|
|
3186
3186
|
ke("scroll_to", "scroll");
|
|
3187
3187
|
return;
|
|
3188
3188
|
}
|
|
3189
|
-
const
|
|
3190
|
-
if (!
|
|
3191
|
-
const
|
|
3192
|
-
if (
|
|
3189
|
+
const A = typeof u.selector == "string" ? u.selector : null;
|
|
3190
|
+
if (!A) return;
|
|
3191
|
+
const I = u.behavior === "instant" ? "instant" : "smooth";
|
|
3192
|
+
if (Xt.current) {
|
|
3193
3193
|
try {
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3194
|
+
Xt.current(
|
|
3195
|
+
A,
|
|
3196
|
+
I
|
|
3197
3197
|
);
|
|
3198
3198
|
} catch (Y) {
|
|
3199
3199
|
console.warn("[LiveLayer] onScrollToSelector threw.", Y);
|
|
@@ -3203,206 +3203,206 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3203
3203
|
if (typeof document < "u") {
|
|
3204
3204
|
let Y = null;
|
|
3205
3205
|
try {
|
|
3206
|
-
Y = document.querySelector(
|
|
3206
|
+
Y = document.querySelector(A);
|
|
3207
3207
|
} catch {
|
|
3208
3208
|
console.warn(
|
|
3209
|
-
`[LiveLayer] scroll_to: invalid selector "${
|
|
3209
|
+
`[LiveLayer] scroll_to: invalid selector "${A}".`
|
|
3210
3210
|
);
|
|
3211
3211
|
return;
|
|
3212
3212
|
}
|
|
3213
3213
|
if (!Y) {
|
|
3214
3214
|
console.warn(
|
|
3215
|
-
`[LiveLayer] scroll_to: no element matched "${
|
|
3215
|
+
`[LiveLayer] scroll_to: no element matched "${A}". The user may be on a different page. See https://livelayer.studio/docs/errors/scroll-no-match`
|
|
3216
3216
|
);
|
|
3217
3217
|
return;
|
|
3218
3218
|
}
|
|
3219
3219
|
Y.scrollIntoView({
|
|
3220
|
-
behavior:
|
|
3220
|
+
behavior: I,
|
|
3221
3221
|
block: "start"
|
|
3222
3222
|
});
|
|
3223
3223
|
}
|
|
3224
3224
|
return;
|
|
3225
3225
|
}
|
|
3226
3226
|
if (u.type === "request_page_context") {
|
|
3227
|
-
if (!
|
|
3227
|
+
if (!Ce("read_page")) {
|
|
3228
3228
|
ke("request_page_context", "read_page");
|
|
3229
3229
|
return;
|
|
3230
3230
|
}
|
|
3231
|
-
const
|
|
3232
|
-
const
|
|
3233
|
-
if (
|
|
3231
|
+
const A = typeof u.requestId == "string" ? u.requestId : void 0, I = (ee = Ae.current) == null ? void 0 : ee.call(Ae), Y = (ne) => {
|
|
3232
|
+
const q = I, ye = q == null ? void 0 : q.localParticipant;
|
|
3233
|
+
if (ye != null && ye.publishData)
|
|
3234
3234
|
try {
|
|
3235
|
-
const
|
|
3236
|
-
|
|
3237
|
-
} catch (
|
|
3238
|
-
console.warn("[LiveLayer] publishData failed.",
|
|
3235
|
+
const ve = A ? { ...ne, requestId: A } : ne, Ht = new TextEncoder().encode(JSON.stringify(ve));
|
|
3236
|
+
ye.publishData(Ht, { reliable: !0 });
|
|
3237
|
+
} catch (ve) {
|
|
3238
|
+
console.warn("[LiveLayer] publishData failed.", ve);
|
|
3239
3239
|
}
|
|
3240
|
-
},
|
|
3240
|
+
}, V = mn.current, te = hn.current;
|
|
3241
3241
|
try {
|
|
3242
|
-
if (
|
|
3243
|
-
const
|
|
3244
|
-
if (
|
|
3245
|
-
Y({ type: "page_context_pending" }),
|
|
3242
|
+
if (te) {
|
|
3243
|
+
const ne = te(V);
|
|
3244
|
+
if (ne instanceof Promise) {
|
|
3245
|
+
Y({ type: "page_context_pending" }), ne.then((q) => Y({ type: "page_context", context: q })).catch((q) => {
|
|
3246
3246
|
console.warn(
|
|
3247
3247
|
"[LiveLayer] getPageContext rejected; falling back to default walker.",
|
|
3248
|
-
|
|
3248
|
+
q
|
|
3249
3249
|
), Y({
|
|
3250
3250
|
type: "page_context",
|
|
3251
|
-
context:
|
|
3251
|
+
context: nr(V)
|
|
3252
3252
|
});
|
|
3253
3253
|
});
|
|
3254
3254
|
return;
|
|
3255
3255
|
}
|
|
3256
|
-
Y({ type: "page_context", context:
|
|
3256
|
+
Y({ type: "page_context", context: ne });
|
|
3257
3257
|
return;
|
|
3258
3258
|
}
|
|
3259
3259
|
Y({
|
|
3260
3260
|
type: "page_context",
|
|
3261
|
-
context:
|
|
3261
|
+
context: nr(V)
|
|
3262
3262
|
});
|
|
3263
|
-
} catch (
|
|
3263
|
+
} catch (ne) {
|
|
3264
3264
|
console.warn(
|
|
3265
3265
|
"[LiveLayer] page-context extraction threw. Sending empty context.",
|
|
3266
|
-
|
|
3266
|
+
ne
|
|
3267
3267
|
), Y({
|
|
3268
3268
|
type: "page_context",
|
|
3269
|
-
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras:
|
|
3269
|
+
context: { url: "", title: "", pathname: "/", regions: [], visibleText: "", visibleLinks: [], visibleFields: [], forms: [], extras: V }
|
|
3270
3270
|
});
|
|
3271
3271
|
}
|
|
3272
3272
|
return;
|
|
3273
3273
|
}
|
|
3274
3274
|
if (u.type === "scroll_page") {
|
|
3275
|
-
if (!
|
|
3275
|
+
if (!Ce("scroll")) {
|
|
3276
3276
|
ke("scroll_page", "scroll");
|
|
3277
3277
|
return;
|
|
3278
3278
|
}
|
|
3279
|
-
const
|
|
3280
|
-
if (
|
|
3279
|
+
const A = u.direction;
|
|
3280
|
+
if (A !== "up" && A !== "down" && A !== "top" && A !== "bottom") {
|
|
3281
3281
|
console.warn(
|
|
3282
|
-
`[LiveLayer] scroll_page: invalid direction "${String(
|
|
3282
|
+
`[LiveLayer] scroll_page: invalid direction "${String(A)}". Expected up | down | top | bottom.`
|
|
3283
3283
|
);
|
|
3284
3284
|
return;
|
|
3285
3285
|
}
|
|
3286
|
-
const
|
|
3287
|
-
if (
|
|
3286
|
+
const I = u.behavior === "instant" ? "instant" : "smooth";
|
|
3287
|
+
if (Kt.current) {
|
|
3288
3288
|
try {
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3289
|
+
Kt.current(
|
|
3290
|
+
A,
|
|
3291
|
+
I
|
|
3292
3292
|
);
|
|
3293
|
-
} catch (
|
|
3294
|
-
console.warn("[LiveLayer] onScrollPage threw.",
|
|
3293
|
+
} catch (q) {
|
|
3294
|
+
console.warn("[LiveLayer] onScrollPage threw.", q);
|
|
3295
3295
|
}
|
|
3296
3296
|
return;
|
|
3297
3297
|
}
|
|
3298
3298
|
if (typeof window > "u") return;
|
|
3299
|
-
const Y = { behavior:
|
|
3300
|
-
|
|
3301
|
-
},
|
|
3302
|
-
|
|
3299
|
+
const Y = { behavior: I }, V = No(), te = (q) => {
|
|
3300
|
+
V instanceof Window ? V.scrollBy({ top: q, ...Y }) : V.scrollBy({ top: q, ...Y });
|
|
3301
|
+
}, ne = (q) => {
|
|
3302
|
+
V instanceof Window ? V.scrollTo({ top: q, ...Y }) : V.scrollTo({ top: q, ...Y });
|
|
3303
3303
|
};
|
|
3304
|
-
|
|
3304
|
+
A === "up" ? te(-or(V)) : A === "down" ? te(or(V)) : ne(A === "top" ? 0 : Mo(V));
|
|
3305
3305
|
return;
|
|
3306
3306
|
}
|
|
3307
3307
|
if (u.type === "click") {
|
|
3308
|
-
if (!
|
|
3308
|
+
if (!Ce("click")) {
|
|
3309
3309
|
ke("click", "click");
|
|
3310
3310
|
return;
|
|
3311
3311
|
}
|
|
3312
|
-
const
|
|
3313
|
-
if (!
|
|
3312
|
+
const A = typeof u.selector == "string" ? u.selector : null;
|
|
3313
|
+
if (!A) {
|
|
3314
3314
|
console.warn("[LiveLayer] click: missing selector.");
|
|
3315
3315
|
return;
|
|
3316
3316
|
}
|
|
3317
|
-
if (
|
|
3317
|
+
if (Jt.current) {
|
|
3318
3318
|
try {
|
|
3319
|
-
|
|
3319
|
+
Jt.current(A);
|
|
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 I = null;
|
|
3327
3327
|
try {
|
|
3328
|
-
|
|
3328
|
+
I = document.querySelector(A);
|
|
3329
3329
|
} catch {
|
|
3330
3330
|
console.warn(
|
|
3331
|
-
`[LiveLayer] click: invalid selector "${
|
|
3331
|
+
`[LiveLayer] click: invalid selector "${A}".`
|
|
3332
3332
|
);
|
|
3333
3333
|
return;
|
|
3334
3334
|
}
|
|
3335
|
-
if (!
|
|
3335
|
+
if (!I) {
|
|
3336
3336
|
console.warn(
|
|
3337
|
-
`[LiveLayer] click: no element matched "${
|
|
3337
|
+
`[LiveLayer] click: no element matched "${A}". See https://livelayer.studio/docs/errors/click-no-match`
|
|
3338
3338
|
);
|
|
3339
3339
|
return;
|
|
3340
3340
|
}
|
|
3341
|
-
if (
|
|
3341
|
+
if (I.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
|
-
(
|
|
3347
|
+
(he = I.click) == null || he.call(I);
|
|
3348
3348
|
return;
|
|
3349
3349
|
}
|
|
3350
3350
|
if (u.type === "advance_step" || u.type === "go_back" || u.type === "submit_flow") {
|
|
3351
|
-
if (!
|
|
3351
|
+
if (!Ce("click")) {
|
|
3352
3352
|
ke(u.type, "click");
|
|
3353
3353
|
return;
|
|
3354
3354
|
}
|
|
3355
3355
|
if (typeof document > "u") return;
|
|
3356
|
-
const
|
|
3357
|
-
let
|
|
3358
|
-
if (
|
|
3359
|
-
console.warn(`[LiveLayer] ${u.type}: no "${
|
|
3356
|
+
const A = u.type === "advance_step" ? "ll-advance" : u.type === "go_back" ? "ll-back" : "ll-submit";
|
|
3357
|
+
let I = Jn(A);
|
|
3358
|
+
if (I || (yr(document), I = Jn(A)), !I) {
|
|
3359
|
+
console.warn(`[LiveLayer] ${u.type}: no "${A}" control found.`);
|
|
3360
3360
|
return;
|
|
3361
3361
|
}
|
|
3362
|
-
(
|
|
3362
|
+
(Me = I.click) == null || Me.call(I);
|
|
3363
3363
|
return;
|
|
3364
3364
|
}
|
|
3365
3365
|
if (u.type === "fill_form" || u.type === "focus_field") {
|
|
3366
|
-
if (!
|
|
3366
|
+
if (!Ce("fill_forms")) {
|
|
3367
3367
|
ke(u.type, "fill_forms");
|
|
3368
3368
|
return;
|
|
3369
3369
|
}
|
|
3370
3370
|
if (typeof document > "u") return;
|
|
3371
|
-
u.type === "fill_form" &&
|
|
3372
|
-
const
|
|
3373
|
-
if (!
|
|
3371
|
+
u.type === "fill_form" && Dt.current.playConfirmation();
|
|
3372
|
+
const A = typeof u.formId == "string" ? u.formId : null;
|
|
3373
|
+
if (!A) {
|
|
3374
3374
|
console.warn(`[LiveLayer] ${u.type}: missing formId.`);
|
|
3375
3375
|
return;
|
|
3376
3376
|
}
|
|
3377
|
-
const
|
|
3378
|
-
if (!
|
|
3377
|
+
const I = ir(document, A);
|
|
3378
|
+
if (!I) {
|
|
3379
3379
|
console.warn(
|
|
3380
|
-
`[LiveLayer] ${u.type}: no <form> matched id="${
|
|
3380
|
+
`[LiveLayer] ${u.type}: no <form> matched id="${A}" (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 (I.closest('[data-ll-private="true"], [data-ll-skip], .ll-widget')) {
|
|
3385
3385
|
console.warn(
|
|
3386
3386
|
`[LiveLayer] ${u.type}: refusing to touch a form in a private / opted-out subtree.`
|
|
3387
3387
|
);
|
|
3388
3388
|
return;
|
|
3389
3389
|
}
|
|
3390
3390
|
if (u.type === "focus_field") {
|
|
3391
|
-
const
|
|
3392
|
-
if (!
|
|
3391
|
+
const V = typeof u.fieldName == "string" ? u.fieldName : null;
|
|
3392
|
+
if (!V) {
|
|
3393
3393
|
console.warn("[LiveLayer] focus_field: missing fieldName.");
|
|
3394
3394
|
return;
|
|
3395
3395
|
}
|
|
3396
|
-
const
|
|
3397
|
-
if (
|
|
3398
|
-
|
|
3399
|
-
`[LiveLayer] focus_field: field "${
|
|
3396
|
+
const te = rr(I, V);
|
|
3397
|
+
if (te.el === null) {
|
|
3398
|
+
te.reason === "private" ? console.warn(
|
|
3399
|
+
`[LiveLayer] focus_field: field "${V}" is privacy-protected and not focusable.`
|
|
3400
3400
|
) : console.warn(
|
|
3401
|
-
`[LiveLayer] focus_field: no input matching key="${
|
|
3401
|
+
`[LiveLayer] focus_field: no input matching key="${V}" in form "${A}". The agent should use the field.name it observed in PageContext.forms[].fields[].`
|
|
3402
3402
|
);
|
|
3403
3403
|
return;
|
|
3404
3404
|
}
|
|
3405
|
-
|
|
3405
|
+
te.el.focus();
|
|
3406
3406
|
return;
|
|
3407
3407
|
}
|
|
3408
3408
|
const Y = u.values && typeof u.values == "object" ? u.values : null;
|
|
@@ -3410,171 +3410,210 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3410
3410
|
console.warn("[LiveLayer] fill_form: missing or invalid values.");
|
|
3411
3411
|
return;
|
|
3412
3412
|
}
|
|
3413
|
-
for (const [
|
|
3414
|
-
if (typeof
|
|
3415
|
-
const
|
|
3416
|
-
if (
|
|
3417
|
-
|
|
3418
|
-
`[LiveLayer] fill_form: field "${
|
|
3413
|
+
for (const [V, te] of Object.entries(Y)) {
|
|
3414
|
+
if (typeof te != "string") continue;
|
|
3415
|
+
const ne = rr(I, V);
|
|
3416
|
+
if (ne.el === null) {
|
|
3417
|
+
ne.reason === "private" ? console.warn(
|
|
3418
|
+
`[LiveLayer] fill_form: field "${V}" is privacy-protected (password / cc-* / data-ll-private). Skipping.`
|
|
3419
3419
|
) : console.warn(
|
|
3420
|
-
`[LiveLayer] fill_form: no input matching key="${
|
|
3420
|
+
`[LiveLayer] fill_form: no input matching key="${V}" in form "${A}". The agent should use the field.name it observed in PageContext.forms[].fields[]. Skipping.`
|
|
3421
3421
|
);
|
|
3422
3422
|
continue;
|
|
3423
3423
|
}
|
|
3424
3424
|
try {
|
|
3425
|
-
|
|
3426
|
-
} catch (
|
|
3425
|
+
ko(ne.el, te);
|
|
3426
|
+
} catch (q) {
|
|
3427
3427
|
console.warn(
|
|
3428
|
-
`[LiveLayer] fill_form: failed to set "${
|
|
3429
|
-
|
|
3428
|
+
`[LiveLayer] fill_form: failed to set "${V}".`,
|
|
3429
|
+
q
|
|
3430
3430
|
);
|
|
3431
3431
|
}
|
|
3432
3432
|
}
|
|
3433
3433
|
return;
|
|
3434
3434
|
}
|
|
3435
3435
|
if (u.type === "submit_form") {
|
|
3436
|
-
if (!
|
|
3436
|
+
if (!Ce("submit_forms")) {
|
|
3437
3437
|
ke("submit_form", "submit_forms");
|
|
3438
3438
|
return;
|
|
3439
3439
|
}
|
|
3440
3440
|
if (typeof document > "u") return;
|
|
3441
|
-
const
|
|
3442
|
-
if (!
|
|
3441
|
+
const A = typeof u.formId == "string" ? u.formId : null;
|
|
3442
|
+
if (!A) {
|
|
3443
3443
|
console.warn("[LiveLayer] submit_form: missing formId.");
|
|
3444
3444
|
return;
|
|
3445
3445
|
}
|
|
3446
|
-
|
|
3447
|
-
const
|
|
3448
|
-
if (!
|
|
3446
|
+
Dt.current.playConfirmation();
|
|
3447
|
+
const I = ir(document, A);
|
|
3448
|
+
if (!I) {
|
|
3449
3449
|
console.warn(
|
|
3450
|
-
`[LiveLayer] submit_form: no <form> matched id="${
|
|
3450
|
+
`[LiveLayer] submit_form: no <form> matched id="${A}" (or matching name / data-ll-intent slug).`
|
|
3451
3451
|
);
|
|
3452
3452
|
return;
|
|
3453
3453
|
}
|
|
3454
|
-
if (
|
|
3454
|
+
if (I.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 u.requestId == "string" ? u.requestId : void 0,
|
|
3461
|
-
const
|
|
3462
|
-
if (
|
|
3460
|
+
const Y = typeof u.requestId == "string" ? u.requestId : void 0, V = (wt = Ae.current) == null ? void 0 : wt.call(Ae), te = (G) => {
|
|
3461
|
+
const J = V, ue = J == null ? void 0 : J.localParticipant;
|
|
3462
|
+
if (ue != null && ue.publishData)
|
|
3463
3463
|
try {
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3464
|
+
const He = Y ? { ...G, requestId: Y } : G, Ge = new TextEncoder().encode(JSON.stringify(He));
|
|
3465
|
+
ue.publishData(Ge, { reliable: !0 });
|
|
3466
3466
|
} catch {
|
|
3467
3467
|
}
|
|
3468
|
-
},
|
|
3469
|
-
var
|
|
3470
|
-
const
|
|
3471
|
-
if (
|
|
3472
|
-
const
|
|
3473
|
-
if (
|
|
3474
|
-
const
|
|
3475
|
-
if ((
|
|
3468
|
+
}, ne = (G) => {
|
|
3469
|
+
var Ge, Ft, Pn, zn;
|
|
3470
|
+
const J = G, ue = (Ge = J.getAttribute) == null ? void 0 : Ge.call(J, "aria-label");
|
|
3471
|
+
if (ue) return ue;
|
|
3472
|
+
const He = J.id;
|
|
3473
|
+
if (He) {
|
|
3474
|
+
const Bt = (Ft = I.ownerDocument) == null ? void 0 : Ft.querySelector(`label[for="${He}"]`);
|
|
3475
|
+
if ((Pn = Bt == null ? void 0 : Bt.textContent) != null && Pn.trim()) return Bt.textContent.trim();
|
|
3476
3476
|
}
|
|
3477
|
-
return ((
|
|
3478
|
-
},
|
|
3477
|
+
return ((zn = J.getAttribute) == null ? void 0 : zn.call(J, "name")) || J.id || J.type || "field";
|
|
3478
|
+
}, q = () => {
|
|
3479
3479
|
try {
|
|
3480
|
-
return Array.from(
|
|
3481
|
-
(
|
|
3482
|
-
).map((
|
|
3480
|
+
return Array.from(I.elements).filter(
|
|
3481
|
+
(G) => "willValidate" in G && G.willValidate && !G.checkValidity()
|
|
3482
|
+
).map((G) => `${ne(G)}: ${G.validationMessage}`);
|
|
3483
3483
|
} catch {
|
|
3484
3484
|
return [];
|
|
3485
3485
|
}
|
|
3486
3486
|
};
|
|
3487
|
-
if (typeof
|
|
3487
|
+
if (typeof I.checkValidity == "function" && !I.checkValidity()) {
|
|
3488
3488
|
try {
|
|
3489
|
-
(
|
|
3489
|
+
(ze = I.reportValidity) == null || ze.call(I);
|
|
3490
3490
|
} catch {
|
|
3491
3491
|
}
|
|
3492
|
-
|
|
3492
|
+
te({
|
|
3493
3493
|
type: "form_submit_blocked",
|
|
3494
|
-
formId:
|
|
3494
|
+
formId: A,
|
|
3495
3495
|
reason: "validation",
|
|
3496
|
-
invalidFields:
|
|
3496
|
+
invalidFields: q()
|
|
3497
3497
|
});
|
|
3498
3498
|
return;
|
|
3499
3499
|
}
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3500
|
+
const ye = (G) => {
|
|
3501
|
+
var ue;
|
|
3502
|
+
const J = (ue = G.tagName) == null ? void 0 : ue.toLowerCase();
|
|
3503
|
+
if (J === "textarea" || J === "select") return !0;
|
|
3504
|
+
if (J === "input") {
|
|
3505
|
+
const He = (G.type || "text").toLowerCase();
|
|
3506
|
+
return !["hidden", "submit", "button", "reset", "file", "image"].includes(He);
|
|
3507
|
+
}
|
|
3508
|
+
return !1;
|
|
3509
|
+
}, ve = (G) => {
|
|
3510
|
+
var ue;
|
|
3511
|
+
const J = G;
|
|
3512
|
+
return ((ue = G.tagName) == null ? void 0 : ue.toLowerCase()) === "input" && (J.type === "checkbox" || J.type === "radio") ? J.checked ? "on" : "" : (J.value || "").trim();
|
|
3513
|
+
}, Ht = Array.from(I.elements).filter(
|
|
3514
|
+
(G) => ye(G) && ve(G).length > 0
|
|
3515
|
+
), Rn = /(thank you|thanks|we'?ll be in touch|message sent|message has been sent|successfully|submission received|got your message|we received|talk soon|be in touch)/i, Dr = (((In = I.parentElement) == null ? void 0 : In.textContent) || "").toLowerCase();
|
|
3516
|
+
let Dn = !1, Ot = !1;
|
|
3517
|
+
const $e = (G) => {
|
|
3518
|
+
Ot || (Ot = !0, te(G));
|
|
3519
|
+
}, Pr = () => {
|
|
3520
|
+
const G = Date.now(), J = () => {
|
|
3521
|
+
var Ge;
|
|
3522
|
+
if (Ot) return;
|
|
3523
|
+
const ue = q();
|
|
3524
|
+
if (ue.length > 0) {
|
|
3525
|
+
$e({ type: "form_submit_blocked", formId: A, reason: "validation", invalidFields: ue });
|
|
3526
|
+
return;
|
|
3527
|
+
}
|
|
3528
|
+
if (!I.isConnected) {
|
|
3529
|
+
$e({ type: "form_submitted", formId: A, reason: "form_removed" });
|
|
3530
|
+
return;
|
|
3531
|
+
}
|
|
3532
|
+
if (Ht.length > 0 && Ht.every((Ft) => ve(Ft).length === 0)) {
|
|
3533
|
+
$e({ type: "form_submitted", formId: A, reason: "form_reset" });
|
|
3534
|
+
return;
|
|
3535
|
+
}
|
|
3536
|
+
const He = (((Ge = I.parentElement) == null ? void 0 : Ge.textContent) || "").toLowerCase();
|
|
3537
|
+
if (Rn.test(He) && !Rn.test(Dr)) {
|
|
3538
|
+
$e({ type: "form_submitted", formId: A, reason: "success_text" });
|
|
3539
|
+
return;
|
|
3540
|
+
}
|
|
3541
|
+
Date.now() - G < 2e3 ? setTimeout(J, 250) : $e({ type: "form_submit_uncertain", formId: A, reason: "spa_prevented" });
|
|
3542
|
+
};
|
|
3543
|
+
setTimeout(J, 200);
|
|
3544
|
+
}, en = (G) => {
|
|
3545
|
+
Dn = !0, queueMicrotask(() => {
|
|
3546
|
+
G.defaultPrevented ? Pr() : $e({ type: "form_submitted", formId: A });
|
|
3504
3547
|
});
|
|
3505
3548
|
};
|
|
3506
|
-
|
|
3549
|
+
I.addEventListener("submit", en, { once: !0 });
|
|
3507
3550
|
try {
|
|
3508
|
-
typeof
|
|
3509
|
-
} catch (
|
|
3510
|
-
console.warn("[LiveLayer] submit_form: requestSubmit threw.",
|
|
3511
|
-
type: "form_submit_blocked",
|
|
3512
|
-
formId: N,
|
|
3513
|
-
reason: "exception"
|
|
3514
|
-
});
|
|
3551
|
+
typeof I.requestSubmit == "function" ? I.requestSubmit() : I.submit();
|
|
3552
|
+
} catch (G) {
|
|
3553
|
+
console.warn("[LiveLayer] submit_form: requestSubmit threw.", G), I.removeEventListener("submit", en), $e({ type: "form_submit_blocked", formId: A, reason: "exception" });
|
|
3515
3554
|
return;
|
|
3516
3555
|
}
|
|
3517
3556
|
setTimeout(() => {
|
|
3518
|
-
|
|
3557
|
+
!Dn && !Ot && (I.removeEventListener("submit", en), $e({
|
|
3519
3558
|
type: "form_submit_blocked",
|
|
3520
|
-
formId:
|
|
3559
|
+
formId: A,
|
|
3521
3560
|
reason: "validation",
|
|
3522
|
-
invalidFields:
|
|
3561
|
+
invalidFields: q()
|
|
3523
3562
|
}));
|
|
3524
3563
|
}, 500);
|
|
3525
3564
|
return;
|
|
3526
3565
|
}
|
|
3527
3566
|
if (u.type === "request_routes") {
|
|
3528
|
-
if (!
|
|
3567
|
+
if (!Ce("read_page")) {
|
|
3529
3568
|
ke("request_routes", "read_page");
|
|
3530
3569
|
return;
|
|
3531
3570
|
}
|
|
3532
|
-
const
|
|
3533
|
-
if (!(
|
|
3534
|
-
const
|
|
3571
|
+
const A = typeof u.requestId == "string" ? u.requestId : void 0, Y = (Tn = Ae.current) == null ? void 0 : Tn.call(Ae), V = Y == null ? void 0 : Y.localParticipant;
|
|
3572
|
+
if (!(V != null && V.publishData)) return;
|
|
3573
|
+
const te = (q) => {
|
|
3535
3574
|
try {
|
|
3536
|
-
const
|
|
3537
|
-
|
|
3538
|
-
} catch (
|
|
3539
|
-
console.warn("[LiveLayer] request_routes: publishData failed.",
|
|
3575
|
+
const ye = A ? { type: "routes", routes: q, requestId: A } : { type: "routes", routes: q }, ve = new TextEncoder().encode(JSON.stringify(ye));
|
|
3576
|
+
V.publishData(ve, { reliable: !0 });
|
|
3577
|
+
} catch (ye) {
|
|
3578
|
+
console.warn("[LiveLayer] request_routes: publishData failed.", ye);
|
|
3540
3579
|
}
|
|
3541
|
-
},
|
|
3542
|
-
if (
|
|
3580
|
+
}, ne = gn.current;
|
|
3581
|
+
if (ne) {
|
|
3543
3582
|
try {
|
|
3544
|
-
const
|
|
3545
|
-
if (!Array.isArray(
|
|
3546
|
-
|
|
3583
|
+
const q = ne(), ye = (ve) => {
|
|
3584
|
+
if (!Array.isArray(ve)) {
|
|
3585
|
+
te([]);
|
|
3547
3586
|
return;
|
|
3548
3587
|
}
|
|
3549
|
-
|
|
3588
|
+
te(ve.map(ho).slice(0, 200));
|
|
3550
3589
|
};
|
|
3551
|
-
|
|
3590
|
+
q instanceof Promise ? q.then(ye).catch((ve) => {
|
|
3552
3591
|
console.warn(
|
|
3553
3592
|
"[LiveLayer] getRoutes rejected; falling back to DOM walker.",
|
|
3554
|
-
|
|
3555
|
-
),
|
|
3556
|
-
}) :
|
|
3557
|
-
} catch (
|
|
3593
|
+
ve
|
|
3594
|
+
), te(on());
|
|
3595
|
+
}) : ye(q);
|
|
3596
|
+
} catch (q) {
|
|
3558
3597
|
console.warn(
|
|
3559
3598
|
"[LiveLayer] getRoutes threw; falling back to DOM walker.",
|
|
3560
|
-
|
|
3561
|
-
),
|
|
3599
|
+
q
|
|
3600
|
+
), te(on());
|
|
3562
3601
|
}
|
|
3563
3602
|
return;
|
|
3564
3603
|
}
|
|
3565
3604
|
try {
|
|
3566
|
-
|
|
3567
|
-
} catch (
|
|
3568
|
-
console.warn("[LiveLayer] request_routes: extractRoutes threw.",
|
|
3605
|
+
te(on());
|
|
3606
|
+
} catch (q) {
|
|
3607
|
+
console.warn("[LiveLayer] request_routes: extractRoutes threw.", q);
|
|
3569
3608
|
}
|
|
3570
3609
|
return;
|
|
3571
3610
|
}
|
|
3572
3611
|
if (u.type === "task_field_updated") {
|
|
3573
|
-
if (!
|
|
3612
|
+
if (!Ce("collect_data")) {
|
|
3574
3613
|
ke("task_field_updated", "collect_data");
|
|
3575
3614
|
return;
|
|
3576
3615
|
}
|
|
3577
|
-
const
|
|
3616
|
+
const A = {
|
|
3578
3617
|
phase: "field",
|
|
3579
3618
|
fieldId: typeof u.fieldId == "string" ? u.fieldId : "",
|
|
3580
3619
|
fieldName: typeof u.fieldName == "string" ? u.fieldName : typeof u.fieldId == "string" ? u.fieldId : "",
|
|
@@ -3587,19 +3626,19 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3587
3626
|
if (typeof document < "u")
|
|
3588
3627
|
try {
|
|
3589
3628
|
document.dispatchEvent(
|
|
3590
|
-
new CustomEvent("ll-collected", { detail:
|
|
3629
|
+
new CustomEvent("ll-collected", { detail: A })
|
|
3591
3630
|
);
|
|
3592
3631
|
} catch {
|
|
3593
3632
|
}
|
|
3594
3633
|
return;
|
|
3595
3634
|
}
|
|
3596
3635
|
if (u.type === "task_completed") {
|
|
3597
|
-
if (!
|
|
3636
|
+
if (!Ce("collect_data")) {
|
|
3598
3637
|
ke("task_completed", "collect_data");
|
|
3599
3638
|
return;
|
|
3600
3639
|
}
|
|
3601
|
-
const
|
|
3602
|
-
if (!
|
|
3640
|
+
const A = u.result;
|
|
3641
|
+
if (!A || typeof A != "object") {
|
|
3603
3642
|
console.warn(
|
|
3604
3643
|
"[LiveLayer] task_completed missing `result` payload."
|
|
3605
3644
|
);
|
|
@@ -3609,54 +3648,54 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3609
3648
|
try {
|
|
3610
3649
|
document.dispatchEvent(
|
|
3611
3650
|
new CustomEvent("ll-collected", {
|
|
3612
|
-
detail: { phase: "complete", result:
|
|
3651
|
+
detail: { phase: "complete", result: A }
|
|
3613
3652
|
})
|
|
3614
3653
|
);
|
|
3615
3654
|
} catch {
|
|
3616
3655
|
}
|
|
3617
3656
|
try {
|
|
3618
|
-
|
|
3619
|
-
|
|
3657
|
+
je == null || je(
|
|
3658
|
+
A
|
|
3620
3659
|
);
|
|
3621
|
-
} catch (
|
|
3622
|
-
console.warn("[LiveLayer] onCollect threw.",
|
|
3660
|
+
} catch (I) {
|
|
3661
|
+
console.warn("[LiveLayer] onCollect threw.", I);
|
|
3623
3662
|
}
|
|
3624
3663
|
return;
|
|
3625
3664
|
}
|
|
3626
|
-
|
|
3665
|
+
Io.has(u.type) || Ze == null || Ze(u);
|
|
3627
3666
|
}
|
|
3628
3667
|
},
|
|
3629
|
-
[
|
|
3630
|
-
),
|
|
3631
|
-
agentId: F ? "__controlled__" :
|
|
3668
|
+
[Ze, Ue, je]
|
|
3669
|
+
), ce = Ur({
|
|
3670
|
+
agentId: F ? "__controlled__" : Nt,
|
|
3632
3671
|
baseUrl: o,
|
|
3633
3672
|
apiKey: l,
|
|
3634
3673
|
sessionEndpoint: s,
|
|
3635
3674
|
sessionBody: a,
|
|
3636
|
-
onDataMessage: F ? void 0 :
|
|
3675
|
+
onDataMessage: F ? void 0 : vt
|
|
3637
3676
|
});
|
|
3638
|
-
|
|
3677
|
+
T(() => {
|
|
3639
3678
|
if (F != null && F.subscribeToDataMessages)
|
|
3640
|
-
return F.subscribeToDataMessages(
|
|
3641
|
-
}, [F,
|
|
3679
|
+
return F.subscribeToDataMessages(vt);
|
|
3680
|
+
}, [F, vt]), Ae.current = () => {
|
|
3642
3681
|
var h;
|
|
3643
|
-
return (h =
|
|
3644
|
-
},
|
|
3645
|
-
var
|
|
3682
|
+
return (h = ce.getRoom) == null ? void 0 : h.call(ce);
|
|
3683
|
+
}, T(() => {
|
|
3684
|
+
var ee;
|
|
3646
3685
|
if (typeof window > "u") return;
|
|
3647
|
-
const h = ((
|
|
3686
|
+
const h = ((ee = window.location) == null ? void 0 : ee.hostname) || "";
|
|
3648
3687
|
if (h === "localhost" || h === "127.0.0.1" || h === "0.0.0.0" || h.endsWith(".local") || h.endsWith(".test"))
|
|
3649
|
-
return window.__livelayerSimulateCommand = (
|
|
3688
|
+
return window.__livelayerSimulateCommand = (he) => {
|
|
3650
3689
|
try {
|
|
3651
|
-
|
|
3652
|
-
} catch (
|
|
3653
|
-
console.warn("[LiveLayer] simulate-command threw:",
|
|
3690
|
+
vt(he);
|
|
3691
|
+
} catch (Me) {
|
|
3692
|
+
console.warn("[LiveLayer] simulate-command threw:", Me);
|
|
3654
3693
|
}
|
|
3655
3694
|
}, () => {
|
|
3656
3695
|
delete window.__livelayerSimulateCommand;
|
|
3657
3696
|
};
|
|
3658
|
-
}, [
|
|
3659
|
-
const _ =
|
|
3697
|
+
}, [vt]);
|
|
3698
|
+
const _ = ut(() => F ? {
|
|
3660
3699
|
connectionState: F.connectionState,
|
|
3661
3700
|
agentState: F.agentState,
|
|
3662
3701
|
transcript: F.transcript,
|
|
@@ -3672,130 +3711,130 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3672
3711
|
// Dummy getRoom for shape compatibility — controlled consumers own the Room.
|
|
3673
3712
|
// Internal session's getRoom returns null when no real connect has happened,
|
|
3674
3713
|
// so we reuse its reference for type consistency.
|
|
3675
|
-
getRoom:
|
|
3714
|
+
getRoom: ce.getRoom,
|
|
3676
3715
|
isControlled: !0
|
|
3677
3716
|
} : {
|
|
3678
|
-
connectionState:
|
|
3679
|
-
agentState:
|
|
3680
|
-
transcript:
|
|
3681
|
-
videoElement:
|
|
3682
|
-
audioElement:
|
|
3683
|
-
canResume:
|
|
3684
|
-
error:
|
|
3685
|
-
agentConfig:
|
|
3686
|
-
connect:
|
|
3687
|
-
disconnect:
|
|
3688
|
-
getRoom:
|
|
3717
|
+
connectionState: ce.connectionState,
|
|
3718
|
+
agentState: ce.agentState,
|
|
3719
|
+
transcript: ce.transcript,
|
|
3720
|
+
videoElement: ce.videoElement,
|
|
3721
|
+
audioElement: ce.audioElement,
|
|
3722
|
+
canResume: ce.canResume,
|
|
3723
|
+
error: ce.error,
|
|
3724
|
+
agentConfig: ce.agentConfig,
|
|
3725
|
+
connect: ce.connect,
|
|
3726
|
+
disconnect: ce.disconnect,
|
|
3727
|
+
getRoom: ce.getRoom,
|
|
3689
3728
|
isControlled: !1
|
|
3690
|
-
}, [F,
|
|
3691
|
-
|
|
3692
|
-
const
|
|
3693
|
-
|
|
3729
|
+
}, [F, ce]), yn = R(_);
|
|
3730
|
+
yn.current = _;
|
|
3731
|
+
const vn = R(F);
|
|
3732
|
+
vn.current = F, $r(
|
|
3694
3733
|
n,
|
|
3695
3734
|
() => ({
|
|
3696
3735
|
sendData: async (h) => {
|
|
3697
|
-
var
|
|
3698
|
-
const u =
|
|
3736
|
+
var Me, wt;
|
|
3737
|
+
const u = vn.current;
|
|
3699
3738
|
if (u != null && u.publishData) {
|
|
3700
3739
|
try {
|
|
3701
3740
|
await u.publishData(h);
|
|
3702
|
-
} catch (
|
|
3703
|
-
console.warn("[AvatarWidget] sendData (controlled) failed:",
|
|
3741
|
+
} catch (ze) {
|
|
3742
|
+
console.warn("[AvatarWidget] sendData (controlled) failed:", ze);
|
|
3704
3743
|
}
|
|
3705
3744
|
return;
|
|
3706
3745
|
}
|
|
3707
|
-
const
|
|
3708
|
-
if (
|
|
3746
|
+
const ee = (wt = (Me = yn.current) == null ? void 0 : Me.getRoom) == null ? void 0 : wt.call(Me), he = ee == null ? void 0 : ee.localParticipant;
|
|
3747
|
+
if (he != null && he.publishData)
|
|
3709
3748
|
try {
|
|
3710
|
-
const
|
|
3711
|
-
await
|
|
3712
|
-
} catch (
|
|
3713
|
-
console.warn("[AvatarWidget] sendData failed:",
|
|
3749
|
+
const ze = new TextEncoder().encode(JSON.stringify(h));
|
|
3750
|
+
await he.publishData(ze, { reliable: !0 });
|
|
3751
|
+
} catch (ze) {
|
|
3752
|
+
console.warn("[AvatarWidget] sendData failed:", ze);
|
|
3714
3753
|
}
|
|
3715
3754
|
}
|
|
3716
3755
|
}),
|
|
3717
3756
|
[]
|
|
3718
3757
|
);
|
|
3719
|
-
const
|
|
3720
|
-
|
|
3721
|
-
const h = _.videoElement, u =
|
|
3758
|
+
const bn = R(null);
|
|
3759
|
+
T(() => {
|
|
3760
|
+
const h = _.videoElement, u = bn.current;
|
|
3722
3761
|
if (!(!h || !u))
|
|
3723
3762
|
return u.appendChild(h), () => {
|
|
3724
3763
|
h.parentNode === u && u.removeChild(h);
|
|
3725
3764
|
};
|
|
3726
3765
|
}, [_.videoElement]);
|
|
3727
|
-
const [
|
|
3728
|
-
|
|
3766
|
+
const [it, Pt] = M(!1);
|
|
3767
|
+
T(() => {
|
|
3729
3768
|
if (!$) {
|
|
3730
|
-
|
|
3769
|
+
Pt(!0);
|
|
3731
3770
|
return;
|
|
3732
3771
|
}
|
|
3733
|
-
_.agentState === "speaking" && !
|
|
3734
|
-
}, [$, _.agentState,
|
|
3772
|
+
_.agentState === "speaking" && !it && Pt(!0);
|
|
3773
|
+
}, [$, _.agentState, it]), T(() => {
|
|
3735
3774
|
if (!$) return;
|
|
3736
3775
|
const h = _.connectionState;
|
|
3737
|
-
(h === "disconnected" || h === "idle") &&
|
|
3738
|
-
}, [$, _.connectionState]),
|
|
3739
|
-
if (!$ || !_.videoElement ||
|
|
3740
|
-
const h = setTimeout(() =>
|
|
3776
|
+
(h === "disconnected" || h === "idle") && Pt(!1);
|
|
3777
|
+
}, [$, _.connectionState]), T(() => {
|
|
3778
|
+
if (!$ || !_.videoElement || it) return;
|
|
3779
|
+
const h = setTimeout(() => Pt(!0), 5e3);
|
|
3741
3780
|
return () => clearTimeout(h);
|
|
3742
|
-
}, [$, _.videoElement,
|
|
3781
|
+
}, [$, _.videoElement, it]), T(() => {
|
|
3743
3782
|
const h = _.videoElement;
|
|
3744
3783
|
if (h) {
|
|
3745
3784
|
if (!$) {
|
|
3746
3785
|
h.style.filter = "";
|
|
3747
3786
|
return;
|
|
3748
3787
|
}
|
|
3749
|
-
h.style.transition = "filter 500ms ease-out", h.style.filter =
|
|
3788
|
+
h.style.transition = "filter 500ms ease-out", h.style.filter = it ? "" : "blur(8px)";
|
|
3750
3789
|
}
|
|
3751
|
-
}, [$, _.videoElement,
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3790
|
+
}, [$, _.videoElement, it]);
|
|
3791
|
+
const zt = R(/* @__PURE__ */ new Map());
|
|
3792
|
+
T(() => {
|
|
3754
3793
|
const h = _.audioElement;
|
|
3755
|
-
if (!h ||
|
|
3794
|
+
if (!h || zt.current.has(h)) return;
|
|
3756
3795
|
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),
|
|
3758
|
-
const
|
|
3759
|
-
|
|
3760
|
-
(
|
|
3796
|
+
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), zt.current.set(h, u), Re.attach(h);
|
|
3797
|
+
const ee = h.play();
|
|
3798
|
+
ee && typeof ee.catch == "function" && ee.catch((he) => {
|
|
3799
|
+
(he == null ? void 0 : he.name) === "NotAllowedError" && Ee(!0);
|
|
3761
3800
|
});
|
|
3762
|
-
}, [_.audioElement]),
|
|
3801
|
+
}, [_.audioElement]), T(() => {
|
|
3763
3802
|
const h = _.connectionState;
|
|
3764
3803
|
if (!(h !== "disconnected" && h !== "idle" && h !== "error")) {
|
|
3765
3804
|
Re.detach();
|
|
3766
|
-
for (const [u,
|
|
3767
|
-
u.parentNode ===
|
|
3768
|
-
|
|
3805
|
+
for (const [u, ee] of zt.current)
|
|
3806
|
+
u.parentNode === ee && ee.removeChild(u), ee.parentNode === document.body && document.body.removeChild(ee);
|
|
3807
|
+
zt.current.clear();
|
|
3769
3808
|
}
|
|
3770
3809
|
}, [_.connectionState]);
|
|
3771
|
-
const
|
|
3810
|
+
const _e = Yr({
|
|
3772
3811
|
gateUntilAgentReady: !0,
|
|
3773
3812
|
agentState: _.agentState
|
|
3774
3813
|
});
|
|
3775
|
-
|
|
3814
|
+
T(() => {
|
|
3776
3815
|
if (_.isControlled || _.connectionState !== "connected") return;
|
|
3777
3816
|
const h = _.getRoom();
|
|
3778
3817
|
if (h)
|
|
3779
|
-
return
|
|
3780
|
-
const u =
|
|
3818
|
+
return _e.setupMic(h).then(() => {
|
|
3819
|
+
const u = _e.getMicStream();
|
|
3781
3820
|
u && Re.attachStream(u, "mic");
|
|
3782
3821
|
}).catch(() => {
|
|
3783
3822
|
}), () => {
|
|
3784
|
-
Re.detachSlot("mic"),
|
|
3823
|
+
Re.detachSlot("mic"), _e.teardownMic();
|
|
3785
3824
|
};
|
|
3786
|
-
}, [_.isControlled, _.connectionState]),
|
|
3825
|
+
}, [_.isControlled, _.connectionState]), T(() => {
|
|
3787
3826
|
var u;
|
|
3788
3827
|
if (_.connectionState !== "connected") return;
|
|
3789
3828
|
const h = _.isControlled ? (u = F == null ? void 0 : F.getRoom) == null ? void 0 : u.call(F) : _.getRoom();
|
|
3790
3829
|
if (h)
|
|
3791
|
-
return
|
|
3792
|
-
|
|
3830
|
+
return Ne.attachRoom(h), De.attachRoom(h), _.isControlled && _e.attachRoom(h), mt.refresh(), () => {
|
|
3831
|
+
Ne.teardown(), De.teardown();
|
|
3793
3832
|
};
|
|
3794
|
-
}, [_.isControlled, _.connectionState, F]),
|
|
3833
|
+
}, [_.isControlled, _.connectionState, F]), T(() => {
|
|
3795
3834
|
const h = _.audioElement;
|
|
3796
|
-
h && (h.muted =
|
|
3797
|
-
}, [_.audioElement,
|
|
3798
|
-
const
|
|
3835
|
+
h && (h.muted = Yt);
|
|
3836
|
+
}, [_.audioElement, Yt]);
|
|
3837
|
+
const _r = k((h) => {
|
|
3799
3838
|
const u = { type: "user_message", text: h };
|
|
3800
3839
|
if (F != null && F.publishData) {
|
|
3801
3840
|
try {
|
|
@@ -3804,135 +3843,135 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3804
3843
|
}
|
|
3805
3844
|
return;
|
|
3806
3845
|
}
|
|
3807
|
-
const
|
|
3808
|
-
if (
|
|
3846
|
+
const ee = _.getRoom();
|
|
3847
|
+
if (ee)
|
|
3809
3848
|
try {
|
|
3810
|
-
const
|
|
3811
|
-
|
|
3849
|
+
const he = new TextEncoder().encode(JSON.stringify(u));
|
|
3850
|
+
ee.localParticipant.publishData(he, { reliable: !0 });
|
|
3812
3851
|
} catch {
|
|
3813
3852
|
}
|
|
3814
|
-
}, [_, F]),
|
|
3815
|
-
|
|
3853
|
+
}, [_, F]), xr = k(() => {
|
|
3854
|
+
wr((h) => !h);
|
|
3816
3855
|
}, []);
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
}, [_.connectionState,
|
|
3820
|
-
|
|
3821
|
-
}, [_.transcript,
|
|
3822
|
-
|
|
3823
|
-
}, [_.agentState,
|
|
3824
|
-
|
|
3825
|
-
}, [_.agentState,
|
|
3826
|
-
const
|
|
3827
|
-
|
|
3828
|
-
!g ||
|
|
3829
|
-
}, [g, _.connectionState, _,
|
|
3830
|
-
const
|
|
3856
|
+
T(() => {
|
|
3857
|
+
qe == null || qe(_.connectionState), _.connectionState === "connected" ? Je == null || Je() : _.connectionState === "disconnected" && (Fe == null || Fe());
|
|
3858
|
+
}, [_.connectionState, Je, Fe, qe]), T(() => {
|
|
3859
|
+
Be == null || Be(_.transcript);
|
|
3860
|
+
}, [_.transcript, Be]), T(() => {
|
|
3861
|
+
We == null || We(_.agentState);
|
|
3862
|
+
}, [_.agentState, We]), T(() => {
|
|
3863
|
+
Rt.setThinking(_.agentState === "thinking");
|
|
3864
|
+
}, [_.agentState, Rt]);
|
|
3865
|
+
const wn = R(!1);
|
|
3866
|
+
T(() => {
|
|
3867
|
+
!g || wn.current || pt && _.connectionState === "idle" && (wn.current = !0, _.connect());
|
|
3868
|
+
}, [g, _.connectionState, _, pt]);
|
|
3869
|
+
const Cr = k(
|
|
3831
3870
|
(h) => {
|
|
3832
|
-
const u = b == null ? void 0 : b.find((
|
|
3833
|
-
u && (
|
|
3871
|
+
const u = b == null ? void 0 : b.find((ee) => ee.id === h);
|
|
3872
|
+
u && (rt(!1), h !== Ye && (gt(!0), _.disconnect(), Te || At(h), v == null || v(u)));
|
|
3834
3873
|
},
|
|
3835
3874
|
[
|
|
3836
3875
|
b,
|
|
3837
|
-
|
|
3876
|
+
Ye,
|
|
3838
3877
|
_,
|
|
3839
|
-
|
|
3878
|
+
Te,
|
|
3840
3879
|
v
|
|
3841
3880
|
]
|
|
3842
3881
|
);
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
}, [_.connectionState,
|
|
3846
|
-
if (!
|
|
3882
|
+
T(() => {
|
|
3883
|
+
nt && _.connectionState === "connected" && gt(!1);
|
|
3884
|
+
}, [_.connectionState, nt]), T(() => {
|
|
3885
|
+
if (!yt) return;
|
|
3847
3886
|
const h = (u) => {
|
|
3848
|
-
u.key === "Escape" &&
|
|
3887
|
+
u.key === "Escape" && rt(!1);
|
|
3849
3888
|
};
|
|
3850
3889
|
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
3851
|
-
}, [
|
|
3852
|
-
const
|
|
3853
|
-
|
|
3854
|
-
const
|
|
3855
|
-
() =>
|
|
3856
|
-
[
|
|
3857
|
-
),
|
|
3858
|
-
_.disconnect(),
|
|
3859
|
-
}, [_,
|
|
3890
|
+
}, [yt]);
|
|
3891
|
+
const kr = !!Z || !!(fe != null && fe.avatarImageUrl) || _.isControlled, bt = Zr(Nt, o, kr);
|
|
3892
|
+
Ke === void 0 && ((kn = bt.info) != null && kn.capabilities) && (Zt.current = bt.info.capabilities);
|
|
3893
|
+
const $t = (fe == null ? void 0 : fe.name) ?? ae ?? ((Ln = _.agentConfig) == null ? void 0 : Ln.name) ?? ((Sn = bt.info) == null ? void 0 : Sn.name) ?? "Live Layer", Qt = (fe == null ? void 0 : fe.avatarImageUrl) ?? Z ?? ((En = _.agentConfig) == null ? void 0 : En.avatarImageUrl) ?? ((An = bt.info) == null ? void 0 : An.avatarImageUrl) ?? null, Lr = z ?? ((Nn = _.agentConfig) == null ? void 0 : Nn.idleLoopUrl) ?? ((Mn = bt.info) == null ? void 0 : Mn.idleLoopUrl) ?? null, Sr = B ?? null, Er = k(() => we("expanded"), [we]), Ar = k(
|
|
3894
|
+
() => we("minimized"),
|
|
3895
|
+
[we]
|
|
3896
|
+
), _n = k(() => {
|
|
3897
|
+
_.disconnect(), we("hidden");
|
|
3898
|
+
}, [_, we]), Nr = k(() => {
|
|
3860
3899
|
const h = _.audioElement;
|
|
3861
|
-
h && h.play().then(() =>
|
|
3900
|
+
h && h.play().then(() => Ee(!1)).catch(() => {
|
|
3862
3901
|
});
|
|
3863
|
-
}, [_.audioElement]),
|
|
3864
|
-
|
|
3865
|
-
}, [_]),
|
|
3866
|
-
...
|
|
3867
|
-
...
|
|
3902
|
+
}, [_.audioElement]), Mr = k(() => {
|
|
3903
|
+
Ee(!1), _.connect();
|
|
3904
|
+
}, [_]), ot = {
|
|
3905
|
+
...Qe,
|
|
3906
|
+
...pe ? {} : { zIndex: Se }
|
|
3868
3907
|
};
|
|
3869
|
-
H.primaryColor && (
|
|
3870
|
-
const
|
|
3871
|
-
...
|
|
3872
|
-
...
|
|
3873
|
-
},
|
|
3908
|
+
H.primaryColor && (ot["--ll-color-primary"] = H.primaryColor), H.accentColor && (ot["--ll-color-accent"] = H.accentColor), H.backgroundColor && (ot["--ll-color-bg"] = H.backgroundColor), H.textColor && (ot["--ll-color-fg"] = H.textColor);
|
|
3909
|
+
const Ir = {
|
|
3910
|
+
...ot,
|
|
3911
|
+
...xe.style
|
|
3912
|
+
}, Tr = [
|
|
3874
3913
|
"ll-widget",
|
|
3875
|
-
`ll-widget--${
|
|
3876
|
-
`ll-widget--${
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3914
|
+
`ll-widget--${me}`,
|
|
3915
|
+
`ll-widget--${be ? "mobile" : "desktop"}`,
|
|
3916
|
+
xe.hasGeometry ? "ll-widget--has-geometry" : null,
|
|
3917
|
+
xe.isDragging ? "is-dragging" : null,
|
|
3918
|
+
xe.isResizing ? "is-resizing" : null,
|
|
3919
|
+
Ve
|
|
3881
3920
|
].filter(Boolean).join(" ");
|
|
3882
|
-
if (!
|
|
3883
|
-
const
|
|
3921
|
+
if (!pt) return null;
|
|
3922
|
+
const Rr = /* @__PURE__ */ r(
|
|
3884
3923
|
"div",
|
|
3885
3924
|
{
|
|
3886
|
-
className:
|
|
3887
|
-
style:
|
|
3888
|
-
"data-display-mode":
|
|
3925
|
+
className: Tr,
|
|
3926
|
+
style: Ir,
|
|
3927
|
+
"data-display-mode": me,
|
|
3889
3928
|
"data-position": x,
|
|
3890
3929
|
"data-experience-mode": d === "EMBEDDED" ? "embedded" : "widget",
|
|
3891
|
-
children:
|
|
3892
|
-
|
|
3930
|
+
children: me === "expanded" && /* @__PURE__ */ r(
|
|
3931
|
+
Oi,
|
|
3893
3932
|
{
|
|
3894
3933
|
position: x,
|
|
3895
|
-
isMobile:
|
|
3896
|
-
agentName:
|
|
3897
|
-
avatarImageUrl:
|
|
3898
|
-
idleLoopUrl:
|
|
3899
|
-
greeting:
|
|
3934
|
+
isMobile: be,
|
|
3935
|
+
agentName: $t,
|
|
3936
|
+
avatarImageUrl: Qt,
|
|
3937
|
+
idleLoopUrl: Lr,
|
|
3938
|
+
greeting: Sr,
|
|
3900
3939
|
branding: H,
|
|
3901
3940
|
teamMembers: b,
|
|
3902
|
-
currentTeamMemberId:
|
|
3903
|
-
isSwitchingTeamMember:
|
|
3904
|
-
teamSwitcherOpen:
|
|
3905
|
-
onToggleTeamSwitcher: () =>
|
|
3906
|
-
onSelectTeamMember:
|
|
3941
|
+
currentTeamMemberId: Ye,
|
|
3942
|
+
isSwitchingTeamMember: nt,
|
|
3943
|
+
teamSwitcherOpen: yt,
|
|
3944
|
+
onToggleTeamSwitcher: () => rt((h) => !h),
|
|
3945
|
+
onSelectTeamMember: Cr,
|
|
3907
3946
|
connectionState: _.connectionState,
|
|
3908
3947
|
agentState: _.agentState,
|
|
3909
3948
|
transcript: _.transcript,
|
|
3910
|
-
isMuted:
|
|
3911
|
-
micDevices:
|
|
3912
|
-
activeMicId:
|
|
3913
|
-
isCameraEnabled:
|
|
3914
|
-
cameraPreviewEl:
|
|
3915
|
-
cameraDevices:
|
|
3916
|
-
activeCameraId:
|
|
3917
|
-
isScreenShareEnabled:
|
|
3918
|
-
screenPreviewEl:
|
|
3919
|
-
isSpeakerMuted:
|
|
3920
|
-
allowCamera:
|
|
3949
|
+
isMuted: _e.isMuted,
|
|
3950
|
+
micDevices: mt.mics,
|
|
3951
|
+
activeMicId: _e.activeDeviceId,
|
|
3952
|
+
isCameraEnabled: Ne.isEnabled,
|
|
3953
|
+
cameraPreviewEl: Ne.previewEl,
|
|
3954
|
+
cameraDevices: mt.cameras,
|
|
3955
|
+
activeCameraId: Ne.activeDeviceId,
|
|
3956
|
+
isScreenShareEnabled: De.isEnabled,
|
|
3957
|
+
screenPreviewEl: De.previewEl,
|
|
3958
|
+
isSpeakerMuted: Yt,
|
|
3959
|
+
allowCamera: X,
|
|
3921
3960
|
allowScreenShare: f,
|
|
3922
|
-
allowTyping:
|
|
3923
|
-
showMinimize:
|
|
3924
|
-
showClose:
|
|
3925
|
-
chromeless:
|
|
3926
|
-
compactControls:
|
|
3927
|
-
transforming:
|
|
3928
|
-
transformingLabel:
|
|
3929
|
-
languageMenuOpen:
|
|
3930
|
-
onToggleLanguageMenu: () =>
|
|
3961
|
+
allowTyping: N,
|
|
3962
|
+
showMinimize: be && !pe ? !1 : Mt,
|
|
3963
|
+
showClose: It,
|
|
3964
|
+
chromeless: re,
|
|
3965
|
+
compactControls: Tt,
|
|
3966
|
+
transforming: le,
|
|
3967
|
+
transformingLabel: j,
|
|
3968
|
+
languageMenuOpen: C,
|
|
3969
|
+
onToggleLanguageMenu: () => se((h) => !h),
|
|
3931
3970
|
needsUserGesture: Pe,
|
|
3932
3971
|
canResume: _.canResume,
|
|
3933
|
-
micError:
|
|
3972
|
+
micError: _e.micError,
|
|
3934
3973
|
error: _.error,
|
|
3935
|
-
avatarVideoContainerRef:
|
|
3974
|
+
avatarVideoContainerRef: bn,
|
|
3936
3975
|
agentVideoEl: _.videoElement,
|
|
3937
3976
|
onConnect: () => {
|
|
3938
3977
|
Promise.resolve(_.connect()).then(() => {
|
|
@@ -3943,81 +3982,81 @@ const xo = /* @__PURE__ */ new Set([
|
|
|
3943
3982
|
});
|
|
3944
3983
|
},
|
|
3945
3984
|
onDisconnect: () => _.disconnect(),
|
|
3946
|
-
onRetry:
|
|
3947
|
-
onResumeAudio:
|
|
3948
|
-
onToggleMute:
|
|
3949
|
-
onSwitchMicDevice: (h) => void
|
|
3950
|
-
onToggleCamera: () => void
|
|
3951
|
-
onSwitchCameraDevice: (h) => void
|
|
3952
|
-
onToggleScreenShare: () => void
|
|
3953
|
-
onToggleSpeaker:
|
|
3954
|
-
onSendMessage:
|
|
3955
|
-
onMinimize:
|
|
3956
|
-
onClose:
|
|
3957
|
-
onClearMicError:
|
|
3958
|
-
dragHandleProps:
|
|
3959
|
-
resizeHandleProps:
|
|
3985
|
+
onRetry: Mr,
|
|
3986
|
+
onResumeAudio: Nr,
|
|
3987
|
+
onToggleMute: _e.toggleMute,
|
|
3988
|
+
onSwitchMicDevice: (h) => void _e.switchDevice(h),
|
|
3989
|
+
onToggleCamera: () => void Ne.toggle(),
|
|
3990
|
+
onSwitchCameraDevice: (h) => void Ne.switchDevice(h),
|
|
3991
|
+
onToggleScreenShare: () => void De.toggle(),
|
|
3992
|
+
onToggleSpeaker: xr,
|
|
3993
|
+
onSendMessage: _r,
|
|
3994
|
+
onMinimize: Ar,
|
|
3995
|
+
onClose: _n,
|
|
3996
|
+
onClearMicError: _e.clearError,
|
|
3997
|
+
dragHandleProps: xe.dragHandleProps,
|
|
3998
|
+
resizeHandleProps: xe.resizeHandleProps
|
|
3960
3999
|
}
|
|
3961
4000
|
)
|
|
3962
4001
|
}
|
|
3963
|
-
),
|
|
4002
|
+
), xn = !pe && (me === "hidden" || me === "minimized") ? /* @__PURE__ */ S(
|
|
3964
4003
|
"div",
|
|
3965
4004
|
{
|
|
3966
4005
|
className: [
|
|
3967
4006
|
"ll-widget",
|
|
3968
4007
|
"ll-widget--floating",
|
|
3969
|
-
`ll-widget--${
|
|
3970
|
-
`ll-widget--${
|
|
4008
|
+
`ll-widget--${me}`,
|
|
4009
|
+
`ll-widget--${be ? "mobile" : "desktop"}`
|
|
3971
4010
|
].join(" "),
|
|
3972
|
-
style:
|
|
3973
|
-
"data-display-mode":
|
|
4011
|
+
style: ot,
|
|
4012
|
+
"data-display-mode": me,
|
|
3974
4013
|
"data-position": x,
|
|
3975
4014
|
children: [
|
|
3976
|
-
|
|
3977
|
-
|
|
4015
|
+
me === "hidden" && /* @__PURE__ */ r(
|
|
4016
|
+
Ai,
|
|
3978
4017
|
{
|
|
3979
4018
|
position: x,
|
|
3980
|
-
isMobile:
|
|
4019
|
+
isMobile: be,
|
|
3981
4020
|
isSpeaking: _.agentState === "speaking",
|
|
3982
|
-
onExpand: () =>
|
|
3983
|
-
label: `Open ${
|
|
3984
|
-
avatarImageUrl:
|
|
3985
|
-
agentName:
|
|
4021
|
+
onExpand: () => we("expanded"),
|
|
4022
|
+
label: `Open ${$t} widget`,
|
|
4023
|
+
avatarImageUrl: Qt,
|
|
4024
|
+
agentName: $t,
|
|
3986
4025
|
containerEl: W
|
|
3987
4026
|
}
|
|
3988
4027
|
),
|
|
3989
|
-
|
|
3990
|
-
|
|
4028
|
+
me === "minimized" && /* @__PURE__ */ r(
|
|
4029
|
+
Mi,
|
|
3991
4030
|
{
|
|
3992
4031
|
position: x,
|
|
3993
|
-
isMobile:
|
|
3994
|
-
agentName:
|
|
3995
|
-
avatarImageUrl:
|
|
4032
|
+
isMobile: be,
|
|
4033
|
+
agentName: $t,
|
|
4034
|
+
avatarImageUrl: Qt,
|
|
3996
4035
|
agentState: _.agentState,
|
|
3997
|
-
isMuted:
|
|
4036
|
+
isMuted: _e.isMuted,
|
|
3998
4037
|
audioLevel: Re,
|
|
3999
|
-
onExpand:
|
|
4000
|
-
onToggleMute:
|
|
4001
|
-
onClose:
|
|
4038
|
+
onExpand: Er,
|
|
4039
|
+
onToggleMute: _e.toggleMute,
|
|
4040
|
+
onClose: _n
|
|
4002
4041
|
}
|
|
4003
4042
|
)
|
|
4004
4043
|
]
|
|
4005
4044
|
}
|
|
4006
|
-
) : null,
|
|
4007
|
-
return /* @__PURE__ */ S(
|
|
4008
|
-
|
|
4009
|
-
|
|
4045
|
+
) : null, Cn = W ?? (typeof document < "u" ? document.body : null);
|
|
4046
|
+
return /* @__PURE__ */ S(Xe, { children: [
|
|
4047
|
+
Rr,
|
|
4048
|
+
xn && Cn && dn(xn, Cn)
|
|
4010
4049
|
] });
|
|
4011
4050
|
}
|
|
4012
4051
|
);
|
|
4013
|
-
|
|
4014
|
-
const
|
|
4052
|
+
br.displayName = "AvatarWidgetInner";
|
|
4053
|
+
const To = un(
|
|
4015
4054
|
function(t, n) {
|
|
4016
|
-
return /* @__PURE__ */ r(
|
|
4055
|
+
return /* @__PURE__ */ r(qr, { children: /* @__PURE__ */ r(br, { ...t, ref: n }) });
|
|
4017
4056
|
}
|
|
4018
4057
|
);
|
|
4019
|
-
|
|
4020
|
-
const
|
|
4058
|
+
To.displayName = "AvatarWidget";
|
|
4059
|
+
const qo = ({
|
|
4021
4060
|
agentId: e,
|
|
4022
4061
|
baseUrl: t,
|
|
4023
4062
|
apiKey: n,
|
|
@@ -4028,24 +4067,24 @@ const Po = ({
|
|
|
4028
4067
|
}) => {
|
|
4029
4068
|
const a = R(null), c = R(null), d = R(l);
|
|
4030
4069
|
d.current = l;
|
|
4031
|
-
const g =
|
|
4032
|
-
var
|
|
4070
|
+
const g = k((p) => {
|
|
4071
|
+
var P;
|
|
4033
4072
|
const m = p.detail;
|
|
4034
|
-
(
|
|
4073
|
+
(P = d.current) == null || P.call(d, m);
|
|
4035
4074
|
}, []);
|
|
4036
|
-
return
|
|
4075
|
+
return T(() => {
|
|
4037
4076
|
const p = a.current;
|
|
4038
4077
|
if (!p) return;
|
|
4039
4078
|
const m = document.createElement("livelayer-widget");
|
|
4040
4079
|
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
4080
|
m.removeEventListener("agent-event", g), p.removeChild(m), c.current = null;
|
|
4042
4081
|
};
|
|
4043
|
-
}, [e]),
|
|
4082
|
+
}, [e]), T(() => {
|
|
4044
4083
|
c.current && (i ? c.current.setAttribute("mode", i) : c.current.removeAttribute("mode"));
|
|
4045
4084
|
}, [i]), /* @__PURE__ */ r("div", { ref: a, className: o, style: s });
|
|
4046
|
-
},
|
|
4085
|
+
}, Uo = un(
|
|
4047
4086
|
function({ id: t, intent: n, as: i = "div", className: l, style: o, children: s }, a) {
|
|
4048
|
-
return
|
|
4087
|
+
return Hr(
|
|
4049
4088
|
i,
|
|
4050
4089
|
{
|
|
4051
4090
|
ref: a,
|
|
@@ -4058,19 +4097,19 @@ const Po = ({
|
|
|
4058
4097
|
);
|
|
4059
4098
|
}
|
|
4060
4099
|
);
|
|
4061
|
-
function
|
|
4100
|
+
function jo(e = {}) {
|
|
4062
4101
|
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);
|
|
4063
|
-
|
|
4102
|
+
T(() => {
|
|
4064
4103
|
g.current = t, p.current = n, m.current = i;
|
|
4065
4104
|
}, [t, n, i]);
|
|
4066
|
-
const
|
|
4105
|
+
const P = k(() => {
|
|
4067
4106
|
o({}), a(!1);
|
|
4068
4107
|
}, []);
|
|
4069
|
-
return
|
|
4108
|
+
return T(() => {
|
|
4070
4109
|
if (typeof window > "u") return;
|
|
4071
|
-
const x = (
|
|
4072
|
-
var w,
|
|
4073
|
-
const y =
|
|
4110
|
+
const x = (L) => {
|
|
4111
|
+
var w, D;
|
|
4112
|
+
const y = L.detail;
|
|
4074
4113
|
if (y) {
|
|
4075
4114
|
if (y.phase === "field") {
|
|
4076
4115
|
if (m.current !== "all" && y.source !== m.current)
|
|
@@ -4091,7 +4130,7 @@ function zo(e = {}) {
|
|
|
4091
4130
|
return;
|
|
4092
4131
|
d(E), a(!1);
|
|
4093
4132
|
try {
|
|
4094
|
-
(
|
|
4133
|
+
(D = p.current) == null || D.call(p, E);
|
|
4095
4134
|
} catch (b) {
|
|
4096
4135
|
console.warn("[LiveLayer] useCollect onComplete threw.", b);
|
|
4097
4136
|
}
|
|
@@ -4099,68 +4138,68 @@ function zo(e = {}) {
|
|
|
4099
4138
|
}
|
|
4100
4139
|
};
|
|
4101
4140
|
return document.addEventListener("ll-collected", x), () => document.removeEventListener("ll-collected", x);
|
|
4102
|
-
}, []), { fields: l, isCollecting: s, lastResult: c, reset:
|
|
4141
|
+
}, []), { fields: l, isCollecting: s, lastResult: c, reset: P };
|
|
4103
4142
|
}
|
|
4104
|
-
let
|
|
4105
|
-
function
|
|
4143
|
+
let lr = 1;
|
|
4144
|
+
function Vo({
|
|
4106
4145
|
onMount: e,
|
|
4107
4146
|
defaultOpen: t = !1,
|
|
4108
4147
|
storageKey: n = "ll-debug-open"
|
|
4109
4148
|
}) {
|
|
4110
|
-
const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [d, g] = M(!1), p = R(/* @__PURE__ */ new Set()), m = R([]),
|
|
4111
|
-
|
|
4149
|
+
const [i, l] = M(t), [o, s] = M([]), [a, c] = M(""), [d, g] = M(!1), p = R(/* @__PURE__ */ new Set()), m = R([]), P = R(d);
|
|
4150
|
+
P.current = d, T(() => {
|
|
4112
4151
|
try {
|
|
4113
4152
|
const y = localStorage.getItem(n);
|
|
4114
4153
|
y === "1" && l(!0), y === "0" && l(!1);
|
|
4115
4154
|
} catch {
|
|
4116
4155
|
}
|
|
4117
|
-
}, [n]),
|
|
4156
|
+
}, [n]), T(() => {
|
|
4118
4157
|
try {
|
|
4119
4158
|
localStorage.setItem(n, i ? "1" : "0");
|
|
4120
4159
|
} catch {
|
|
4121
4160
|
}
|
|
4122
|
-
}, [i, n]),
|
|
4161
|
+
}, [i, n]), T(() => {
|
|
4123
4162
|
const y = (w) => {
|
|
4124
|
-
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((
|
|
4163
|
+
(w.metaKey || w.ctrlKey) && w.shiftKey && w.key.toLowerCase() === "l" && (w.preventDefault(), l((D) => !D));
|
|
4125
4164
|
};
|
|
4126
4165
|
return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
|
|
4127
|
-
}, []),
|
|
4166
|
+
}, []), T(() => {
|
|
4128
4167
|
const y = setInterval(() => {
|
|
4129
|
-
if (m.current.length === 0 ||
|
|
4168
|
+
if (m.current.length === 0 || P.current) return;
|
|
4130
4169
|
const w = m.current.splice(0, m.current.length);
|
|
4131
4170
|
s(
|
|
4132
|
-
(
|
|
4171
|
+
(D) => [...w.reverse(), ...D].slice(0, 200)
|
|
4133
4172
|
);
|
|
4134
4173
|
}, 100);
|
|
4135
4174
|
return () => clearInterval(y);
|
|
4136
4175
|
}, []);
|
|
4137
4176
|
const x = R(!1);
|
|
4138
|
-
if (
|
|
4177
|
+
if (T(() => {
|
|
4139
4178
|
!e || x.current || (x.current = !0, e((y) => {
|
|
4140
4179
|
m.current.push({
|
|
4141
|
-
id:
|
|
4180
|
+
id: lr++,
|
|
4142
4181
|
ts: Date.now(),
|
|
4143
4182
|
kind: "event",
|
|
4144
4183
|
type: y.eventName,
|
|
4145
4184
|
data: y.data
|
|
4146
4185
|
});
|
|
4147
4186
|
}));
|
|
4148
|
-
}, [e]),
|
|
4149
|
-
const y = console.warn, w = console.log,
|
|
4187
|
+
}, [e]), T(() => {
|
|
4188
|
+
const y = console.warn, w = console.log, D = (E, b) => function(...O) {
|
|
4150
4189
|
try {
|
|
4151
4190
|
const v = typeof O[0] == "string" ? O[0] : "";
|
|
4152
4191
|
v.startsWith("[LiveLayer]") && m.current.push({
|
|
4153
|
-
id:
|
|
4192
|
+
id: lr++,
|
|
4154
4193
|
ts: Date.now(),
|
|
4155
4194
|
kind: E,
|
|
4156
4195
|
type: v.slice(0, 120),
|
|
4157
|
-
data: { args: O.slice(1).map((z) =>
|
|
4196
|
+
data: { args: O.slice(1).map((z) => Do(z)) }
|
|
4158
4197
|
});
|
|
4159
4198
|
} catch {
|
|
4160
4199
|
}
|
|
4161
4200
|
return b.apply(this, O);
|
|
4162
4201
|
};
|
|
4163
|
-
return console.warn =
|
|
4202
|
+
return console.warn = D("warn", y), console.log = D("log", w), () => {
|
|
4164
4203
|
console.warn = y, console.log = w;
|
|
4165
4204
|
};
|
|
4166
4205
|
}, []), !i)
|
|
@@ -4190,7 +4229,7 @@ function $o({
|
|
|
4190
4229
|
children: "🛰 LL debug"
|
|
4191
4230
|
}
|
|
4192
4231
|
);
|
|
4193
|
-
const
|
|
4232
|
+
const L = o.filter((y) => {
|
|
4194
4233
|
if (!a) return !0;
|
|
4195
4234
|
const w = a.toLowerCase();
|
|
4196
4235
|
return y.type.toLowerCase().includes(w) || JSON.stringify(y.data || {}).toLowerCase().includes(w);
|
|
@@ -4241,7 +4280,7 @@ function $o({
|
|
|
4241
4280
|
{
|
|
4242
4281
|
type: "button",
|
|
4243
4282
|
onClick: () => g((y) => !y),
|
|
4244
|
-
style:
|
|
4283
|
+
style: an(d ? "#f59e0b" : "transparent"),
|
|
4245
4284
|
title: "Pause / resume capture",
|
|
4246
4285
|
children: d ? "▶ resume" : "⏸ pause"
|
|
4247
4286
|
}
|
|
@@ -4253,7 +4292,7 @@ function $o({
|
|
|
4253
4292
|
onClick: () => {
|
|
4254
4293
|
s([]), m.current = [];
|
|
4255
4294
|
},
|
|
4256
|
-
style:
|
|
4295
|
+
style: an("transparent"),
|
|
4257
4296
|
title: "Clear buffer",
|
|
4258
4297
|
children: "clear"
|
|
4259
4298
|
}
|
|
@@ -4263,7 +4302,7 @@ function $o({
|
|
|
4263
4302
|
{
|
|
4264
4303
|
type: "button",
|
|
4265
4304
|
onClick: () => l(!1),
|
|
4266
|
-
style:
|
|
4305
|
+
style: an("transparent"),
|
|
4267
4306
|
"aria-label": "Close",
|
|
4268
4307
|
title: "Close (Cmd/Ctrl + Shift + L)",
|
|
4269
4308
|
children: "✕"
|
|
@@ -4299,7 +4338,7 @@ function $o({
|
|
|
4299
4338
|
overflowY: "auto",
|
|
4300
4339
|
padding: "0 8px 8px"
|
|
4301
4340
|
},
|
|
4302
|
-
children:
|
|
4341
|
+
children: L.length === 0 ? /* @__PURE__ */ S(
|
|
4303
4342
|
"div",
|
|
4304
4343
|
{
|
|
4305
4344
|
style: {
|
|
@@ -4329,8 +4368,8 @@ function $o({
|
|
|
4329
4368
|
)
|
|
4330
4369
|
]
|
|
4331
4370
|
}
|
|
4332
|
-
) :
|
|
4333
|
-
|
|
4371
|
+
) : L.map((y) => /* @__PURE__ */ r(
|
|
4372
|
+
Ro,
|
|
4334
4373
|
{
|
|
4335
4374
|
entry: y,
|
|
4336
4375
|
expanded: p.current.has(y.id),
|
|
@@ -4346,7 +4385,7 @@ function $o({
|
|
|
4346
4385
|
}
|
|
4347
4386
|
);
|
|
4348
4387
|
}
|
|
4349
|
-
function
|
|
4388
|
+
function Ro({
|
|
4350
4389
|
entry: e,
|
|
4351
4390
|
expanded: t,
|
|
4352
4391
|
onToggle: n
|
|
@@ -4416,7 +4455,7 @@ function Lo({
|
|
|
4416
4455
|
}
|
|
4417
4456
|
);
|
|
4418
4457
|
}
|
|
4419
|
-
function
|
|
4458
|
+
function an(e) {
|
|
4420
4459
|
return {
|
|
4421
4460
|
background: e,
|
|
4422
4461
|
color: "#fff",
|
|
@@ -4427,22 +4466,22 @@ function tn(e) {
|
|
|
4427
4466
|
cursor: "pointer"
|
|
4428
4467
|
};
|
|
4429
4468
|
}
|
|
4430
|
-
function
|
|
4469
|
+
function Do(e) {
|
|
4431
4470
|
try {
|
|
4432
4471
|
return e instanceof Error ? { message: e.message, stack: e.stack } : (JSON.stringify(e), e);
|
|
4433
4472
|
} catch {
|
|
4434
4473
|
return String(e);
|
|
4435
4474
|
}
|
|
4436
4475
|
}
|
|
4437
|
-
function
|
|
4476
|
+
function Po(e) {
|
|
4438
4477
|
const t = JSON.stringify(e);
|
|
4439
|
-
|
|
4478
|
+
T(() => Fr(e), [t]);
|
|
4440
4479
|
}
|
|
4441
|
-
function
|
|
4442
|
-
return
|
|
4480
|
+
function Yo({ fields: e, children: t }) {
|
|
4481
|
+
return Po(e), /* @__PURE__ */ r(Xe, { children: t });
|
|
4443
4482
|
}
|
|
4444
|
-
function
|
|
4445
|
-
const [e, t] = M([]), n =
|
|
4483
|
+
function Go() {
|
|
4484
|
+
const [e, t] = M([]), n = k((l) => {
|
|
4446
4485
|
t((o) => {
|
|
4447
4486
|
const s = o.findIndex((a) => a.id === l.id);
|
|
4448
4487
|
if (s >= 0) {
|
|
@@ -4451,7 +4490,7 @@ function Oo() {
|
|
|
4451
4490
|
}
|
|
4452
4491
|
return [...o, l];
|
|
4453
4492
|
});
|
|
4454
|
-
}, []), i =
|
|
4493
|
+
}, []), i = k(() => t([]), []);
|
|
4455
4494
|
return {
|
|
4456
4495
|
entries: e,
|
|
4457
4496
|
pushSegment: n,
|
|
@@ -4460,38 +4499,38 @@ function Oo() {
|
|
|
4460
4499
|
};
|
|
4461
4500
|
}
|
|
4462
4501
|
export {
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4502
|
+
To as AvatarWidget,
|
|
4503
|
+
qr as ErrorBoundary,
|
|
4504
|
+
Yo as FieldProvider,
|
|
4505
|
+
Vo as LiveLayerDebugPanel,
|
|
4506
|
+
Uo as LiveLayerRegion,
|
|
4507
|
+
qo as LiveLayerWidget,
|
|
4508
|
+
Jo as clearFieldRegistry,
|
|
4509
|
+
fo as clearPageContextCache,
|
|
4510
|
+
vo as clearRoutesCache,
|
|
4511
|
+
co as extractPageContext,
|
|
4512
|
+
go as extractRoutes,
|
|
4513
|
+
nr as getCachedPageContext,
|
|
4514
|
+
on as getCachedRoutes,
|
|
4515
|
+
Zo as getRegisteredFields,
|
|
4516
|
+
vi as matchesPattern,
|
|
4517
|
+
ho as normalizeRouteInput,
|
|
4518
|
+
Qo as registerFields,
|
|
4519
|
+
el as setFieldValue,
|
|
4520
|
+
bi as shouldRenderAtPath,
|
|
4521
|
+
Zr as useAgentInfo,
|
|
4522
|
+
jr as useAudioLevel,
|
|
4523
|
+
Xr as useCameraState,
|
|
4524
|
+
jo as useCollect,
|
|
4525
|
+
ei as useDisplayMode,
|
|
4526
|
+
ri as useDisplayModePersistence,
|
|
4527
|
+
oi as useIsMobile,
|
|
4528
|
+
Ur as useLiveKitSession,
|
|
4529
|
+
Jr as useMediaDevices,
|
|
4530
|
+
Yr as useMicrophoneState,
|
|
4531
|
+
pi as usePathname,
|
|
4532
|
+
Po as useRegisterFields,
|
|
4533
|
+
wi as useRouteMatch,
|
|
4534
|
+
Kr as useScreenShareState,
|
|
4535
|
+
Go as useTranscript
|
|
4497
4536
|
};
|