@_solaris/messenger-widget 0.6.5 → 0.6.6
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/iframe/iframe.css +1 -1
- package/dist/iframe/iframe.js +4 -4
- package/dist/messenger.cjs +2 -2
- package/dist/messenger.js +397 -425
- package/dist/snippet.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -137,7 +137,7 @@ function tt(e) {
|
|
|
137
137
|
return t.lastBootstrap = V, await k(), typeof document < "u" && (t.visibilityHandler = _, document.addEventListener(
|
|
138
138
|
"visibilitychange",
|
|
139
139
|
t.visibilityHandler
|
|
140
|
-
)),
|
|
140
|
+
)), m(), V;
|
|
141
141
|
}
|
|
142
142
|
async function k() {
|
|
143
143
|
try {
|
|
@@ -277,7 +277,7 @@ function tt(e) {
|
|
|
277
277
|
}
|
|
278
278
|
function ye(u) {
|
|
279
279
|
const g = t.panelOpen;
|
|
280
|
-
t.panelOpen = !!u, t.panelOpen ? (clearTimeout(t.burstTimer), Q()) : te(), g !== t.panelOpen &&
|
|
280
|
+
t.panelOpen = !!u, t.panelOpen ? (clearTimeout(t.burstTimer), Q()) : te(), g !== t.panelOpen && m();
|
|
281
281
|
}
|
|
282
282
|
async function pe() {
|
|
283
283
|
try {
|
|
@@ -290,29 +290,29 @@ function tt(e) {
|
|
|
290
290
|
console.error("[transport] poll failed", u);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
if (
|
|
293
|
+
function m() {
|
|
294
|
+
if (h(), typeof document < "u" && document.hidden) return;
|
|
295
295
|
const u = t.panelOpen ? Qe : Xe;
|
|
296
296
|
t.pollTimer = setInterval(pe, u);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function h() {
|
|
299
299
|
t.pollTimer && (clearInterval(t.pollTimer), t.pollTimer = null);
|
|
300
300
|
}
|
|
301
301
|
function _() {
|
|
302
302
|
if (document.hidden)
|
|
303
303
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = setTimeout(() => {
|
|
304
|
-
t.hiddenGraceTimer = null, document.hidden && (
|
|
304
|
+
t.hiddenGraceTimer = null, document.hidden && (h(), Z(), i("paused"));
|
|
305
305
|
}, et);
|
|
306
306
|
else {
|
|
307
307
|
if (t.hiddenGraceTimer) {
|
|
308
308
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null;
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
|
-
i("idle"),
|
|
311
|
+
i("idle"), m(), t.panelOpen && Q();
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
function w() {
|
|
315
|
-
|
|
315
|
+
h(), clearTimeout(t.burstTimer), clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null, Z(), t.visibilityHandler && (document.removeEventListener(
|
|
316
316
|
"visibilitychange",
|
|
317
317
|
t.visibilityHandler
|
|
318
318
|
), t.visibilityHandler = null), t.started = !1;
|
|
@@ -407,48 +407,48 @@ function it(e) {
|
|
|
407
407
|
connection: "idle"
|
|
408
408
|
}), s = [];
|
|
409
409
|
s.push(
|
|
410
|
-
e.on("connection", (
|
|
411
|
-
t.connection =
|
|
410
|
+
e.on("connection", (m) => {
|
|
411
|
+
t.connection = m;
|
|
412
412
|
})
|
|
413
413
|
), s.push(
|
|
414
|
-
e.on("message", (
|
|
415
|
-
const
|
|
416
|
-
!
|
|
414
|
+
e.on("message", (m) => {
|
|
415
|
+
const h = m == null ? void 0 : m.conversation_id, _ = m == null ? void 0 : m.message;
|
|
416
|
+
!h || !(_ != null && _.id) || (X(h, _), _.client_msg_id && delete t.streamingByMsgId[_.client_msg_id], Z(h, _.created_at));
|
|
417
417
|
})
|
|
418
418
|
), s.push(
|
|
419
|
-
e.on("message_stream", (
|
|
420
|
-
const
|
|
421
|
-
!
|
|
419
|
+
e.on("message_stream", (m) => {
|
|
420
|
+
const h = m == null ? void 0 : m.message_id, _ = m == null ? void 0 : m.token;
|
|
421
|
+
!h || typeof _ != "string" || (t.streamingByMsgId[h] = (t.streamingByMsgId[h] || "") + _);
|
|
422
422
|
})
|
|
423
423
|
), s.push(
|
|
424
|
-
e.on("conversation_updated", (
|
|
425
|
-
const
|
|
426
|
-
if (!
|
|
427
|
-
const w = t.conversations.findIndex((A) => A.id ===
|
|
424
|
+
e.on("conversation_updated", (m) => {
|
|
425
|
+
const h = m == null ? void 0 : m.conversation_id, _ = m == null ? void 0 : m.changes;
|
|
426
|
+
if (!h || !_) return;
|
|
427
|
+
const w = t.conversations.findIndex((A) => A.id === h);
|
|
428
428
|
w !== -1 && (t.conversations[w] = {
|
|
429
429
|
...t.conversations[w],
|
|
430
430
|
..._
|
|
431
431
|
});
|
|
432
432
|
})
|
|
433
433
|
), s.push(
|
|
434
|
-
e.on("config_updated", (
|
|
435
|
-
|
|
434
|
+
e.on("config_updated", (m) => {
|
|
435
|
+
m != null && m.config && (t.config = m.config);
|
|
436
436
|
})
|
|
437
437
|
), s.push(
|
|
438
|
-
e.on("action_status", (
|
|
439
|
-
const
|
|
440
|
-
if (!
|
|
441
|
-
const A = t.runningActionsByConv[
|
|
442
|
-
|
|
438
|
+
e.on("action_status", (m) => {
|
|
439
|
+
const h = m == null ? void 0 : m.conversation_id, _ = m == null ? void 0 : m.action_id, w = m == null ? void 0 : m.action_name;
|
|
440
|
+
if (!h || !_) return;
|
|
441
|
+
const A = t.runningActionsByConv[h] || {};
|
|
442
|
+
m.state === "running" ? (A[_] = w || _, t.runningActionsByConv[h] = { ...A }) : m.state === "done" && (delete A[_], t.runningActionsByConv[h] = { ...A });
|
|
443
443
|
})
|
|
444
444
|
), s.push(
|
|
445
|
-
e.on("activity", (
|
|
446
|
-
Array.isArray(
|
|
445
|
+
e.on("activity", (m) => {
|
|
446
|
+
Array.isArray(m == null ? void 0 : m.conversations) && (t.conversations = m.conversations);
|
|
447
447
|
})
|
|
448
448
|
);
|
|
449
|
-
async function r(
|
|
449
|
+
async function r(m) {
|
|
450
450
|
try {
|
|
451
|
-
const
|
|
451
|
+
const h = new Promise(
|
|
452
452
|
(w, A) => setTimeout(
|
|
453
453
|
() => A(
|
|
454
454
|
new Error(
|
|
@@ -458,61 +458,61 @@ function it(e) {
|
|
|
458
458
|
15e3
|
|
459
459
|
)
|
|
460
460
|
), _ = await Promise.race([
|
|
461
|
-
e.start(
|
|
462
|
-
|
|
461
|
+
e.start(m),
|
|
462
|
+
h
|
|
463
463
|
]);
|
|
464
464
|
t.config = _.config, t.customer = _.customer, t.conversations = await Promise.race([
|
|
465
465
|
e.listConversations(),
|
|
466
|
-
|
|
466
|
+
h
|
|
467
467
|
]), t.ready = !0;
|
|
468
|
-
} catch (
|
|
469
|
-
console.error("[store] start failed",
|
|
468
|
+
} catch (h) {
|
|
469
|
+
console.error("[store] start failed", h), t.error = (h == null ? void 0 : h.message) || String(h);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
function i() {
|
|
473
|
-
for (const
|
|
473
|
+
for (const m of s)
|
|
474
474
|
try {
|
|
475
|
-
|
|
475
|
+
m();
|
|
476
476
|
} catch {
|
|
477
477
|
}
|
|
478
478
|
e.stop();
|
|
479
479
|
}
|
|
480
|
-
async function n(
|
|
481
|
-
const
|
|
482
|
-
if (!
|
|
480
|
+
async function n(m) {
|
|
481
|
+
const h = ye(m);
|
|
482
|
+
if (!h) return t.customer;
|
|
483
483
|
try {
|
|
484
|
-
const _ = await e.patchCustomer(
|
|
484
|
+
const _ = await e.patchCustomer(h);
|
|
485
485
|
_ && (t.customer = _);
|
|
486
486
|
} catch (_) {
|
|
487
487
|
console.error("[store] applyCustomer failed", _);
|
|
488
488
|
}
|
|
489
489
|
return t.customer;
|
|
490
490
|
}
|
|
491
|
-
async function a(
|
|
492
|
-
const
|
|
493
|
-
return _ === -1 ? t.conversations = [
|
|
491
|
+
async function a(m = {}) {
|
|
492
|
+
const h = await e.createConversation(m), _ = t.conversations.findIndex((w) => w.id === h.id);
|
|
493
|
+
return _ === -1 ? t.conversations = [h, ...t.conversations] : t.conversations[_] = h, h;
|
|
494
494
|
}
|
|
495
495
|
const o = 50;
|
|
496
|
-
async function f(
|
|
497
|
-
const
|
|
498
|
-
if (!(
|
|
499
|
-
y(
|
|
496
|
+
async function f(m) {
|
|
497
|
+
const h = t.paginationByConv[m];
|
|
498
|
+
if (!(h != null && h.loaded || h != null && h.loading)) {
|
|
499
|
+
y(m, { nextCursor: null, loading: !0, loaded: !1 });
|
|
500
500
|
try {
|
|
501
|
-
const _ = await e.listMessages(
|
|
501
|
+
const _ = await e.listMessages(m, {
|
|
502
502
|
limit: o
|
|
503
|
-
}), w = (_ == null ? void 0 : _.messages) ?? [], A = t.messagesByConv[
|
|
503
|
+
}), w = (_ == null ? void 0 : _.messages) ?? [], A = t.messagesByConv[m] || [], C = /* @__PURE__ */ new Set();
|
|
504
504
|
for (const g of w)
|
|
505
505
|
(g == null ? void 0 : g.id) != null && C.add(`id:${String(g.id)}`), g != null && g.client_msg_id && C.add(`c:${g.client_msg_id}`);
|
|
506
506
|
const u = A.filter((g) => !((g == null ? void 0 : g.id) != null && C.has(`id:${String(g.id)}`) || g != null && g.client_msg_id && C.has(`c:${g.client_msg_id}`)));
|
|
507
|
-
t.messagesByConv[
|
|
507
|
+
t.messagesByConv[m] = [...w, ...u].sort(
|
|
508
508
|
te
|
|
509
|
-
), y(
|
|
509
|
+
), y(m, {
|
|
510
510
|
nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
|
|
511
511
|
loading: !1,
|
|
512
512
|
loaded: !0
|
|
513
513
|
});
|
|
514
514
|
} catch (_) {
|
|
515
|
-
console.error("[store] openConversation failed", _), y(
|
|
515
|
+
console.error("[store] openConversation failed", _), y(m, {
|
|
516
516
|
nextCursor: null,
|
|
517
517
|
loading: !1,
|
|
518
518
|
loaded: !1
|
|
@@ -520,67 +520,67 @@ function it(e) {
|
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
async function k(
|
|
523
|
+
async function k(m) {
|
|
524
524
|
var A;
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
527
|
-
const w = (A = (t.messagesByConv[
|
|
525
|
+
const h = t.paginationByConv[m];
|
|
526
|
+
if (!h || h.loading || !h.nextCursor) return;
|
|
527
|
+
const w = (A = (t.messagesByConv[m] || []).find((C) => C == null ? void 0 : C.created_at)) == null ? void 0 : A.created_at;
|
|
528
528
|
if (w) {
|
|
529
|
-
y(
|
|
529
|
+
y(m, { ...h, loading: !0 });
|
|
530
530
|
try {
|
|
531
|
-
const C = await e.listMessages(
|
|
531
|
+
const C = await e.listMessages(m, {
|
|
532
532
|
before: w,
|
|
533
533
|
limit: o
|
|
534
|
-
}), u = (C == null ? void 0 : C.messages) ?? [], g = t.messagesByConv[
|
|
534
|
+
}), u = (C == null ? void 0 : C.messages) ?? [], g = t.messagesByConv[m] || [], p = /* @__PURE__ */ new Set();
|
|
535
535
|
for (const O of g)
|
|
536
536
|
(O == null ? void 0 : O.id) != null && p.add(`id:${String(O.id)}`), O != null && O.client_msg_id && p.add(`c:${O.client_msg_id}`);
|
|
537
537
|
const L = u.filter((O) => !((O == null ? void 0 : O.id) != null && p.has(`id:${String(O.id)}`) || O != null && O.client_msg_id && p.has(`c:${O.client_msg_id}`)));
|
|
538
|
-
t.messagesByConv[
|
|
538
|
+
t.messagesByConv[m] = [...L, ...g], y(m, {
|
|
539
539
|
nextCursor: (C == null ? void 0 : C.next_cursor) ?? null,
|
|
540
540
|
loading: !1,
|
|
541
541
|
loaded: !0
|
|
542
542
|
});
|
|
543
543
|
} catch (C) {
|
|
544
|
-
console.error("[store] loadMore failed", C), y(
|
|
544
|
+
console.error("[store] loadMore failed", C), y(m, { ...h, loading: !1 });
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
function y(
|
|
549
|
-
t.paginationByConv = { ...t.paginationByConv, [
|
|
548
|
+
function y(m, h) {
|
|
549
|
+
t.paginationByConv = { ...t.paginationByConv, [m]: h };
|
|
550
550
|
}
|
|
551
|
-
async function T(
|
|
552
|
-
const _ = await e.patchConversation(
|
|
551
|
+
async function T(m, h) {
|
|
552
|
+
const _ = await e.patchConversation(m, h), w = t.conversations.findIndex((A) => A.id === m);
|
|
553
553
|
w !== -1 && (t.conversations[w] = _);
|
|
554
554
|
}
|
|
555
|
-
async function I(
|
|
556
|
-
if (!
|
|
557
|
-
const
|
|
555
|
+
async function I(m) {
|
|
556
|
+
if (!m) return [];
|
|
557
|
+
const h = t.messagesByConv[m] || [];
|
|
558
558
|
let _ = "";
|
|
559
|
-
for (const w of
|
|
559
|
+
for (const w of h)
|
|
560
560
|
w != null && w.created_at && w.created_at > _ && (_ = w.created_at);
|
|
561
561
|
try {
|
|
562
562
|
const w = await e.listMessages(
|
|
563
|
-
|
|
563
|
+
m,
|
|
564
564
|
_ ? { since: _ } : {}
|
|
565
565
|
), A = (w == null ? void 0 : w.messages) || [];
|
|
566
566
|
if (!A.length) return [];
|
|
567
567
|
const C = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
568
|
-
for (const p of
|
|
568
|
+
for (const p of h)
|
|
569
569
|
(p == null ? void 0 : p.id) != null && C.add(String(p.id)), p != null && p.client_msg_id && u.add(p.client_msg_id);
|
|
570
570
|
const g = [];
|
|
571
571
|
for (const p of A) {
|
|
572
572
|
const L = (p == null ? void 0 : p.id) != null && C.has(String(p.id)) || (p == null ? void 0 : p.client_msg_id) && u.has(p.client_msg_id);
|
|
573
|
-
X(
|
|
573
|
+
X(m, p), L || g.push(p);
|
|
574
574
|
}
|
|
575
575
|
return g;
|
|
576
576
|
} catch (w) {
|
|
577
577
|
return console.error("[store] fetchSinceLast failed", w), [];
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
async function S(
|
|
581
|
-
if (!(!
|
|
580
|
+
async function S(m, h) {
|
|
581
|
+
if (!(!m || h == null))
|
|
582
582
|
try {
|
|
583
|
-
const _ = await e.markConversationRead(
|
|
583
|
+
const _ = await e.markConversationRead(m, h), w = (_ == null ? void 0 : _.last_read_message_id) ?? h, A = t.conversations.findIndex((C) => (C == null ? void 0 : C.id) === m);
|
|
584
584
|
A !== -1 && (t.conversations[A] = {
|
|
585
585
|
...t.conversations[A],
|
|
586
586
|
last_read_message_id: w
|
|
@@ -589,14 +589,14 @@ function it(e) {
|
|
|
589
589
|
console.error("[store] markConversationRead failed", _);
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
async function z(
|
|
592
|
+
async function z(m, h, { attachments: _, metadata: w } = {}) {
|
|
593
593
|
var L;
|
|
594
|
-
const A = (
|
|
595
|
-
if (!
|
|
596
|
-
const u = rt(), g = pe(
|
|
594
|
+
const A = (h || "").trim(), C = Array.isArray(_) && _.length > 0;
|
|
595
|
+
if (!m || !A && !C) return;
|
|
596
|
+
const u = rt(), g = pe(m), p = {
|
|
597
597
|
id: u,
|
|
598
598
|
client_msg_id: u,
|
|
599
|
-
conversation_id:
|
|
599
|
+
conversation_id: m,
|
|
600
600
|
type: "content",
|
|
601
601
|
text_md: A,
|
|
602
602
|
author: {
|
|
@@ -609,9 +609,9 @@ function it(e) {
|
|
|
609
609
|
...C ? { payload: { type: "content", attachments: _ } } : {},
|
|
610
610
|
...w && typeof w == "object" ? { metadata: w } : {}
|
|
611
611
|
};
|
|
612
|
-
X(
|
|
612
|
+
X(m, p);
|
|
613
613
|
try {
|
|
614
|
-
await e.postMessage(
|
|
614
|
+
await e.postMessage(m, {
|
|
615
615
|
client_msg_id: u,
|
|
616
616
|
text_md: A,
|
|
617
617
|
created_at: g,
|
|
@@ -619,32 +619,32 @@ function it(e) {
|
|
|
619
619
|
...w && typeof w == "object" ? { metadata: w } : {}
|
|
620
620
|
});
|
|
621
621
|
} catch (O) {
|
|
622
|
-
console.error("[store] send failed", O), oe(
|
|
622
|
+
console.error("[store] send failed", O), oe(m, u, {
|
|
623
623
|
_failed: !0,
|
|
624
624
|
_pending: !1
|
|
625
625
|
});
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
|
-
async function M(
|
|
629
|
-
|
|
628
|
+
async function M(m, h, _) {
|
|
629
|
+
m != null && (t.awaitingCallback[m] = !0);
|
|
630
630
|
try {
|
|
631
|
-
await e.postCallback(
|
|
631
|
+
await e.postCallback(m, h, _);
|
|
632
632
|
} catch (w) {
|
|
633
|
-
console.error("[store] callback failed", w),
|
|
633
|
+
console.error("[store] callback failed", w), m != null && delete t.awaitingCallback[m];
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
const D = /* @__PURE__ */ new Map();
|
|
637
|
-
async function x(
|
|
638
|
-
if (!
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
641
|
-
const _ =
|
|
642
|
-
if (!_ || _ - Date.now() > 6e4) return
|
|
637
|
+
async function x(m) {
|
|
638
|
+
if (!m) return null;
|
|
639
|
+
const h = D.get(m);
|
|
640
|
+
if (h != null && h.url) {
|
|
641
|
+
const _ = h.expires_at ? Date.parse(h.expires_at) : 0;
|
|
642
|
+
if (!_ || _ - Date.now() > 6e4) return h.url;
|
|
643
643
|
}
|
|
644
644
|
try {
|
|
645
|
-
const _ = await e.signAttachment(
|
|
645
|
+
const _ = await e.signAttachment(m);
|
|
646
646
|
if (_ != null && _.signed_url)
|
|
647
|
-
return D.set(
|
|
647
|
+
return D.set(m, {
|
|
648
648
|
url: _.signed_url,
|
|
649
649
|
expires_at: _.expires_at
|
|
650
650
|
}), _.signed_url;
|
|
@@ -653,22 +653,22 @@ function it(e) {
|
|
|
653
653
|
}
|
|
654
654
|
return null;
|
|
655
655
|
}
|
|
656
|
-
async function q(
|
|
657
|
-
const w = t.conversations.find((u) => u.id ===
|
|
656
|
+
async function q(m, { rating: h, comment: _ } = {}) {
|
|
657
|
+
const w = t.conversations.find((u) => u.id === m), C = {
|
|
658
658
|
...(w == null ? void 0 : w.metadata) || {},
|
|
659
659
|
feedback: {
|
|
660
|
-
rating:
|
|
660
|
+
rating: h,
|
|
661
661
|
comment: _ || null,
|
|
662
662
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
663
663
|
}
|
|
664
664
|
};
|
|
665
|
-
await T(
|
|
665
|
+
await T(m, { metadata: C });
|
|
666
666
|
}
|
|
667
|
-
function J(
|
|
667
|
+
function J(m) {
|
|
668
668
|
var _, w;
|
|
669
|
-
const
|
|
670
|
-
for (let A =
|
|
671
|
-
const C =
|
|
669
|
+
const h = t.messagesByConv[m] || [];
|
|
670
|
+
for (let A = h.length - 1; A >= 0; A--) {
|
|
671
|
+
const C = h[A];
|
|
672
672
|
if (((_ = C == null ? void 0 : C.author) == null ? void 0 : _.type) === "user" || (C == null ? void 0 : C.type) === "action" && ((w = C == null ? void 0 : C.payload) == null ? void 0 : w.state) === "pending")
|
|
673
673
|
return null;
|
|
674
674
|
const u = Array.isArray(C == null ? void 0 : C.callbacks) ? C.callbacks.find((g) => (g == null ? void 0 : g.intent) === "submit_form") : null;
|
|
@@ -685,19 +685,19 @@ function it(e) {
|
|
|
685
685
|
}
|
|
686
686
|
return null;
|
|
687
687
|
}
|
|
688
|
-
function ie(
|
|
689
|
-
const
|
|
690
|
-
if (!
|
|
691
|
-
const _ = Object.keys(
|
|
688
|
+
function ie(m) {
|
|
689
|
+
const h = t.runningActionsByConv[m];
|
|
690
|
+
if (!h) return null;
|
|
691
|
+
const _ = Object.keys(h);
|
|
692
692
|
if (_.length === 0) return null;
|
|
693
693
|
const w = _[0];
|
|
694
|
-
return { id: w, payload: { name:
|
|
694
|
+
return { id: w, payload: { name: h[w] } };
|
|
695
695
|
}
|
|
696
|
-
function ae(
|
|
696
|
+
function ae(m) {
|
|
697
697
|
var _, w, A;
|
|
698
|
-
const
|
|
699
|
-
for (let C =
|
|
700
|
-
const u =
|
|
698
|
+
const h = t.messagesByConv[m] || [];
|
|
699
|
+
for (let C = h.length - 1; C >= 0; C--) {
|
|
700
|
+
const u = h[C];
|
|
701
701
|
if (((_ = u == null ? void 0 : u.author) == null ? void 0 : _.type) === "user") return [];
|
|
702
702
|
if ((u == null ? void 0 : u.type) === "action" && ((w = u == null ? void 0 : u.payload) == null ? void 0 : w.state) === "pending")
|
|
703
703
|
return [];
|
|
@@ -711,57 +711,57 @@ function it(e) {
|
|
|
711
711
|
}
|
|
712
712
|
return [];
|
|
713
713
|
}
|
|
714
|
-
function X(
|
|
714
|
+
function X(m, h) {
|
|
715
715
|
var C;
|
|
716
|
-
const _ = t.messagesByConv[
|
|
716
|
+
const _ = t.messagesByConv[m] || [];
|
|
717
717
|
let w = -1;
|
|
718
|
-
|
|
719
|
-
(u) => (u == null ? void 0 : u.client_msg_id) && u.client_msg_id ===
|
|
720
|
-
)), w === -1 && (
|
|
718
|
+
h != null && h.client_msg_id && (w = _.findIndex(
|
|
719
|
+
(u) => (u == null ? void 0 : u.client_msg_id) && u.client_msg_id === h.client_msg_id
|
|
720
|
+
)), w === -1 && (h == null ? void 0 : h.id) !== void 0 && (h == null ? void 0 : h.id) !== null && (w = _.findIndex((u) => Q(u == null ? void 0 : u.id, h.id)));
|
|
721
721
|
let A;
|
|
722
|
-
w === -1 ? A = [..._,
|
|
722
|
+
w === -1 ? A = [..._, h].sort(te) : (A = _.slice(), A[w] = {
|
|
723
723
|
..._[w],
|
|
724
|
-
...
|
|
724
|
+
...h,
|
|
725
725
|
_pending: !1,
|
|
726
726
|
_failed: !1
|
|
727
|
-
}), t.messagesByConv[
|
|
727
|
+
}), t.messagesByConv[m] = A, (h == null ? void 0 : h.type) === "action" && ((C = h == null ? void 0 : h.payload) != null && C.state) && h.payload.state !== "pending" && (h == null ? void 0 : h.id) != null && t.awaitingCallback[h.id] && delete t.awaitingCallback[h.id];
|
|
728
728
|
}
|
|
729
|
-
function Q(
|
|
730
|
-
return
|
|
729
|
+
function Q(m, h) {
|
|
730
|
+
return m === h ? !0 : m == null || h == null ? !1 : String(m) === String(h);
|
|
731
731
|
}
|
|
732
|
-
function oe(
|
|
733
|
-
const w = t.messagesByConv[
|
|
732
|
+
function oe(m, h, _) {
|
|
733
|
+
const w = t.messagesByConv[m];
|
|
734
734
|
if (!w) return;
|
|
735
|
-
const A = w.findIndex((u) => u.id ===
|
|
735
|
+
const A = w.findIndex((u) => u.id === h);
|
|
736
736
|
if (A === -1) return;
|
|
737
737
|
const C = w.slice();
|
|
738
|
-
C[A] = { ...w[A], ..._ }, t.messagesByConv[
|
|
738
|
+
C[A] = { ...w[A], ..._ }, t.messagesByConv[m] = C;
|
|
739
739
|
}
|
|
740
|
-
function Z(
|
|
741
|
-
const _ = t.conversations.findIndex((A) => A.id ===
|
|
740
|
+
function Z(m, h) {
|
|
741
|
+
const _ = t.conversations.findIndex((A) => A.id === m);
|
|
742
742
|
if (_ === -1) return;
|
|
743
743
|
const w = t.conversations[_];
|
|
744
|
-
if (
|
|
744
|
+
if (h && (!w.last_message_at || h > w.last_message_at)) {
|
|
745
745
|
const A = t.conversations.slice();
|
|
746
|
-
A[_] = { ...w, last_message_at:
|
|
746
|
+
A[_] = { ...w, last_message_at: h }, A.sort(
|
|
747
747
|
(C, u) => (u.last_message_at || "").localeCompare(C.last_message_at || "")
|
|
748
748
|
), t.conversations = A;
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
function te(
|
|
752
|
-
return (
|
|
751
|
+
function te(m, h) {
|
|
752
|
+
return (m.created_at || "").localeCompare(h.created_at || "");
|
|
753
753
|
}
|
|
754
|
-
function ye(
|
|
755
|
-
if (!
|
|
756
|
-
const
|
|
757
|
-
for (const [w, A] of Object.entries(
|
|
758
|
-
A !== void 0 && (w === "name" || w === "email" || w === "language" ? A != null && String(A).trim() !== "" && (
|
|
759
|
-
return Object.keys(_).length && (
|
|
754
|
+
function ye(m) {
|
|
755
|
+
if (!m || typeof m != "object") return null;
|
|
756
|
+
const h = {}, _ = {};
|
|
757
|
+
for (const [w, A] of Object.entries(m))
|
|
758
|
+
A !== void 0 && (w === "name" || w === "email" || w === "language" ? A != null && String(A).trim() !== "" && (h[w] = A) : (w === "values" || w === "metadata") && A && typeof A == "object" ? Object.assign(_, A) : _[w] = A);
|
|
759
|
+
return Object.keys(_).length && (h.values = _), Object.keys(h).length ? h : null;
|
|
760
760
|
}
|
|
761
|
-
function pe(
|
|
762
|
-
const
|
|
761
|
+
function pe(m) {
|
|
762
|
+
const h = t.messagesByConv[m] || [];
|
|
763
763
|
let _ = "";
|
|
764
|
-
for (const C of
|
|
764
|
+
for (const C of h)
|
|
765
765
|
C != null && C.created_at && C.created_at > _ && (_ = C.created_at);
|
|
766
766
|
const w = (/* @__PURE__ */ new Date()).toISOString();
|
|
767
767
|
return !_ || w > _ ? w : new Date(Date.parse(_) + 1).toISOString();
|
|
@@ -882,7 +882,7 @@ function Ee(e) {
|
|
|
882
882
|
}
|
|
883
883
|
return t.protocol === "https:" || t.protocol === "http:" || t.protocol === "data:" && /^data:image\//i.test(e) ? e : null;
|
|
884
884
|
}
|
|
885
|
-
const ue = "fr",
|
|
885
|
+
const ue = "fr", mt = ["fr", "en"], Be = { fr: "fr-FR", en: "en-US" }, ke = {
|
|
886
886
|
fr: {
|
|
887
887
|
// ── Common ───────────────────────────────────────────────────────
|
|
888
888
|
"common.newConversation": "Nouvelle conversation",
|
|
@@ -1159,7 +1159,7 @@ I reply within seconds.`,
|
|
|
1159
1159
|
function Re(e) {
|
|
1160
1160
|
if (typeof e != "string") return ue;
|
|
1161
1161
|
const t = e.trim().toLowerCase().slice(0, 2);
|
|
1162
|
-
return
|
|
1162
|
+
return mt.includes(t) ? t : ue;
|
|
1163
1163
|
}
|
|
1164
1164
|
function re(e) {
|
|
1165
1165
|
return Be[Re(e)] || Be[ue];
|
|
@@ -1182,7 +1182,7 @@ function Pe(e, t) {
|
|
|
1182
1182
|
function ze(e, t, s) {
|
|
1183
1183
|
return Array.isArray(t) ? t.map((r) => Pe(e, String(r))).join(", ") : typeof t == "boolean" ? s(t ? "common.yes" : "common.no") : Pe(e, String(t));
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1185
|
+
function ht(e, t, s = H()) {
|
|
1186
1186
|
if (!e || !t) return "";
|
|
1187
1187
|
const r = Array.isArray(e.fields) ? e.fields : [], i = [];
|
|
1188
1188
|
for (const n of r) {
|
|
@@ -1306,7 +1306,7 @@ function _t(e) {
|
|
|
1306
1306
|
}
|
|
1307
1307
|
return i;
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1309
|
+
function me(e) {
|
|
1310
1310
|
var s;
|
|
1311
1311
|
const t = (s = e == null ? void 0 : e.author) == null ? void 0 : s.type;
|
|
1312
1312
|
return t === "agent_ia" || t === "agent_human";
|
|
@@ -1477,7 +1477,7 @@ const wt = {
|
|
|
1477
1477
|
// panel or switched threads during the typing dwell.
|
|
1478
1478
|
onMessageRevealed(e, t) {
|
|
1479
1479
|
var i;
|
|
1480
|
-
if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !
|
|
1480
|
+
if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !me(e)) return;
|
|
1481
1481
|
const s = typeof document < "u" && document.hidden;
|
|
1482
1482
|
this.isOpen && !s && ((i = this.currentConv) == null ? void 0 : i.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, e));
|
|
1483
1483
|
},
|
|
@@ -1707,7 +1707,7 @@ const wt = {
|
|
|
1707
1707
|
const s = Date.now(), r = { ...this.revealedAt };
|
|
1708
1708
|
for (const n of e) {
|
|
1709
1709
|
if ((n == null ? void 0 : n.id) == null || r[n.id] !== void 0) continue;
|
|
1710
|
-
if (!
|
|
1710
|
+
if (!me(n)) {
|
|
1711
1711
|
r[n.id] = s;
|
|
1712
1712
|
continue;
|
|
1713
1713
|
}
|
|
@@ -1743,7 +1743,7 @@ const wt = {
|
|
|
1743
1743
|
paceLiveMessage(e, t) {
|
|
1744
1744
|
var o;
|
|
1745
1745
|
if (!(e != null && e.id) || this.revealedAt[e.id] !== void 0) return;
|
|
1746
|
-
if (!
|
|
1746
|
+
if (!me(e)) {
|
|
1747
1747
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1748
1748
|
return;
|
|
1749
1749
|
}
|
|
@@ -2089,7 +2089,7 @@ function Gt(e, t, s, r, i, n) {
|
|
|
2089
2089
|
], 6)
|
|
2090
2090
|
], 6);
|
|
2091
2091
|
}
|
|
2092
|
-
const
|
|
2092
|
+
const he = /* @__PURE__ */ U(Vt, [["render", Gt], ["__scopeId", "data-v-6f7f685d"]]), Yt = {
|
|
2093
2093
|
name: "WmTeamAvatars",
|
|
2094
2094
|
props: {
|
|
2095
2095
|
members: { type: Array, default: () => [] },
|
|
@@ -2145,7 +2145,7 @@ function en(e, t, s, r, i, n) {
|
|
|
2145
2145
|
}
|
|
2146
2146
|
const tn = /* @__PURE__ */ U(Yt, [["render", en], ["__scopeId", "data-v-e49a9063"]]), nn = {
|
|
2147
2147
|
name: "WmHeader",
|
|
2148
|
-
components: { AIAvatar:
|
|
2148
|
+
components: { AIAvatar: he, TeamAvatars: tn },
|
|
2149
2149
|
inject: {
|
|
2150
2150
|
// Translator shared by the Messenger shell. Falls back to a French
|
|
2151
2151
|
// translator when the component is used standalone (no provider).
|
|
@@ -2188,7 +2188,7 @@ const tn = /* @__PURE__ */ U(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
|
|
|
2188
2188
|
}, on = { class: "wm-header__avatar" }, ln = { class: "wm-header__main" }, cn = { class: "wm-header__title" }, dn = {
|
|
2189
2189
|
key: 3,
|
|
2190
2190
|
class: "wm-header__fill"
|
|
2191
|
-
}, un = { class: "wm-header__actions" },
|
|
2191
|
+
}, un = { class: "wm-header__actions" }, mn = ["aria-label", "title"], hn = ["aria-label", "title"];
|
|
2192
2192
|
function fn(e, t, s, r, i, n) {
|
|
2193
2193
|
const a = P("AIAvatar"), o = P("TeamAvatars");
|
|
2194
2194
|
return c(), d("div", sn, [
|
|
@@ -2262,7 +2262,7 @@ function fn(e, t, s, r, i, n) {
|
|
|
2262
2262
|
r: "1.6"
|
|
2263
2263
|
})
|
|
2264
2264
|
], -1)
|
|
2265
|
-
])], 10,
|
|
2265
|
+
])], 10, mn)) : b("", !0),
|
|
2266
2266
|
s.showClose ? (c(), d("button", {
|
|
2267
2267
|
key: 1,
|
|
2268
2268
|
type: "button",
|
|
@@ -2284,7 +2284,7 @@ function fn(e, t, s, r, i, n) {
|
|
|
2284
2284
|
}, [
|
|
2285
2285
|
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
2286
2286
|
], -1)
|
|
2287
|
-
])], 8,
|
|
2287
|
+
])], 8, hn)) : b("", !0)
|
|
2288
2288
|
])
|
|
2289
2289
|
]);
|
|
2290
2290
|
}
|
|
@@ -2296,7 +2296,7 @@ const _n = /* @__PURE__ */ U(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2296
2296
|
link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
|
|
2297
2297
|
}, gn = {
|
|
2298
2298
|
name: "WmOnboarding",
|
|
2299
|
-
components: { AIAvatar:
|
|
2299
|
+
components: { AIAvatar: he, HumanAvatar: ve },
|
|
2300
2300
|
inject: {
|
|
2301
2301
|
// Translator + resolved-language getter shared by the Messenger
|
|
2302
2302
|
// shell. The language getter feeds `formatTs` (relative date
|
|
@@ -2356,13 +2356,12 @@ const _n = /* @__PURE__ */ U(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
|
|
|
2356
2356
|
methods: {
|
|
2357
2357
|
// Open a conversation seeded with the typed first message. The
|
|
2358
2358
|
// parent (`startConv` + send) handles draft creation and the
|
|
2359
|
-
// screen
|
|
2360
|
-
//
|
|
2361
|
-
// chat" animation from exactly where the user was typing.
|
|
2359
|
+
// home→chat screen crossfade; we just hand it the text and clear
|
|
2360
|
+
// the field.
|
|
2362
2361
|
submitStarter() {
|
|
2363
2362
|
if (!this.canStart) return;
|
|
2364
|
-
const e = this.starterText.trim()
|
|
2365
|
-
this.starterText = "", this.$emit("start",
|
|
2363
|
+
const e = this.starterText.trim();
|
|
2364
|
+
this.starterText = "", this.$emit("start", e);
|
|
2366
2365
|
},
|
|
2367
2366
|
iconPath(e) {
|
|
2368
2367
|
return Ne[e] || Ne.link;
|
|
@@ -2615,7 +2614,6 @@ function Qn(e, t, s, r, i, n) {
|
|
|
2615
2614
|
])) : b("", !0),
|
|
2616
2615
|
l("div", Pn, [
|
|
2617
2616
|
l("form", {
|
|
2618
|
-
ref: "starterForm",
|
|
2619
2617
|
class: R(["wm-onb__starter", { "is-active": !!i.starterText.trim() }]),
|
|
2620
2618
|
onSubmit: t[1] || (t[1] = G((...o) => n.submitStarter && n.submitStarter(...o), ["prevent"]))
|
|
2621
2619
|
}, [
|
|
@@ -2699,9 +2697,9 @@ function Qn(e, t, s, r, i, n) {
|
|
|
2699
2697
|
])
|
|
2700
2698
|
]);
|
|
2701
2699
|
}
|
|
2702
|
-
const Zn = /* @__PURE__ */ U(gn, [["render", Qn], ["__scopeId", "data-v-
|
|
2700
|
+
const Zn = /* @__PURE__ */ U(gn, [["render", Qn], ["__scopeId", "data-v-c754e832"]]), es = {
|
|
2703
2701
|
name: "WmHistory",
|
|
2704
|
-
components: { AIAvatar:
|
|
2702
|
+
components: { AIAvatar: he, HumanAvatar: ve },
|
|
2705
2703
|
inject: {
|
|
2706
2704
|
t: { default: () => H() },
|
|
2707
2705
|
wmLocale: { default: () => () => "fr" }
|
|
@@ -2771,10 +2769,10 @@ const Zn = /* @__PURE__ */ U(gn, [["render", Qn], ["__scopeId", "data-v-37e69356
|
|
|
2771
2769
|
}, ts = { class: "wm-hist" }, ns = { class: "wm-hist__search" }, ss = ["placeholder", "aria-label"], rs = { class: "wm-hist__list" }, is = ["onClick"], as = {
|
|
2772
2770
|
key: 0,
|
|
2773
2771
|
class: "wm-hist__defaultAvatar"
|
|
2774
|
-
}, os = ["aria-label"], ls = { class: "wm-hist__thread-body" }, cs = { class: "wm-hist__thread-title" }, ds = ["innerHTML"], us = { class: "wm-hist__thread-meta" },
|
|
2772
|
+
}, os = ["aria-label"], ls = { class: "wm-hist__thread-body" }, cs = { class: "wm-hist__thread-title" }, ds = ["innerHTML"], us = { class: "wm-hist__thread-meta" }, ms = {
|
|
2775
2773
|
key: 0,
|
|
2776
2774
|
class: "wm-hist__thread-time"
|
|
2777
|
-
},
|
|
2775
|
+
}, hs = {
|
|
2778
2776
|
key: 0,
|
|
2779
2777
|
class: "wm-hist__empty"
|
|
2780
2778
|
};
|
|
@@ -2847,7 +2845,7 @@ function fs(e, t, s, r, i, n) {
|
|
|
2847
2845
|
}, null, 8, ds)
|
|
2848
2846
|
]),
|
|
2849
2847
|
l("span", us, [
|
|
2850
|
-
n.formatTs(a._ts) ? (c(), d("span",
|
|
2848
|
+
n.formatTs(a._ts) ? (c(), d("span", ms, v(n.formatTs(a._ts)), 1)) : b("", !0),
|
|
2851
2849
|
t[3] || (t[3] = l("svg", {
|
|
2852
2850
|
width: "14",
|
|
2853
2851
|
height: "14",
|
|
@@ -2864,7 +2862,7 @@ function fs(e, t, s, r, i, n) {
|
|
|
2864
2862
|
], -1))
|
|
2865
2863
|
])
|
|
2866
2864
|
], 10, is))), 128)),
|
|
2867
|
-
n.filteredThreads.length ? b("", !0) : (c(), d("div",
|
|
2865
|
+
n.filteredThreads.length ? b("", !0) : (c(), d("div", hs, v(i.query ? n.t("onboarding.noResults", { query: i.query }) : n.t("onboarding.noConversations")), 1))
|
|
2868
2866
|
])
|
|
2869
2867
|
]);
|
|
2870
2868
|
}
|
|
@@ -3300,7 +3298,7 @@ const dr = /* @__PURE__ */ U(Xs, [["render", cr], ["__scopeId", "data-v-5f30c914
|
|
|
3300
3298
|
form_response: Us,
|
|
3301
3299
|
info_card: Ys,
|
|
3302
3300
|
ticket: dr
|
|
3303
|
-
},
|
|
3301
|
+
}, mr = {
|
|
3304
3302
|
name: "WmArtifactRenderer",
|
|
3305
3303
|
props: {
|
|
3306
3304
|
// Forme : { kind: string, data: any } (le `data` est validé
|
|
@@ -3315,13 +3313,13 @@ const dr = /* @__PURE__ */ U(Xs, [["render", cr], ["__scopeId", "data-v-5f30c914
|
|
|
3315
3313
|
}
|
|
3316
3314
|
}
|
|
3317
3315
|
};
|
|
3318
|
-
function
|
|
3316
|
+
function hr(e, t, s, r, i, n) {
|
|
3319
3317
|
return n.component ? (c(), B(Te(n.component), {
|
|
3320
3318
|
key: 0,
|
|
3321
3319
|
data: s.artifact.data
|
|
3322
3320
|
}, null, 8, ["data"])) : b("", !0);
|
|
3323
3321
|
}
|
|
3324
|
-
const fr = /* @__PURE__ */ U(
|
|
3322
|
+
const fr = /* @__PURE__ */ U(mr, [["render", hr]]), _r = {
|
|
3325
3323
|
name: "WmAttachmentPreview",
|
|
3326
3324
|
inject: {
|
|
3327
3325
|
signAttachmentFn: { default: null },
|
|
@@ -3502,7 +3500,7 @@ const Pr = {
|
|
|
3502
3500
|
}, Ur = 80, Dr = 200, Nr = {
|
|
3503
3501
|
name: "WmMessageList",
|
|
3504
3502
|
components: {
|
|
3505
|
-
AIAvatar:
|
|
3503
|
+
AIAvatar: he,
|
|
3506
3504
|
HumanAvatar: ve,
|
|
3507
3505
|
Bubble: Rr,
|
|
3508
3506
|
Typing: Br,
|
|
@@ -4329,7 +4327,7 @@ function Ke({ audio: e }) {
|
|
|
4329
4327
|
systemAudio: e ? "include" : "exclude"
|
|
4330
4328
|
};
|
|
4331
4329
|
}
|
|
4332
|
-
function
|
|
4330
|
+
function yo(e) {
|
|
4333
4331
|
return e ? e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "file" : "file";
|
|
4334
4332
|
}
|
|
4335
4333
|
async function ci() {
|
|
@@ -4430,7 +4428,7 @@ async function ui(e = {}) {
|
|
|
4430
4428
|
}
|
|
4431
4429
|
};
|
|
4432
4430
|
}
|
|
4433
|
-
const
|
|
4431
|
+
const mi = [
|
|
4434
4432
|
{
|
|
4435
4433
|
action: "file",
|
|
4436
4434
|
labelKey: "composer.attachFile",
|
|
@@ -4446,7 +4444,7 @@ const hi = [
|
|
|
4446
4444
|
labelKey: "composer.recordScreen",
|
|
4447
4445
|
path: "M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"
|
|
4448
4446
|
}
|
|
4449
|
-
],
|
|
4447
|
+
], hi = {
|
|
4450
4448
|
name: "WmComposer",
|
|
4451
4449
|
inject: {
|
|
4452
4450
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -4480,7 +4478,7 @@ const hi = [
|
|
|
4480
4478
|
return !this.disabled && !!this.local.trim();
|
|
4481
4479
|
},
|
|
4482
4480
|
attachItems() {
|
|
4483
|
-
return
|
|
4481
|
+
return mi.map((e) => ({
|
|
4484
4482
|
...e,
|
|
4485
4483
|
label: this.t(e.labelKey),
|
|
4486
4484
|
disabled: e.action === "screenshot" && !ge || e.action === "record" && (!ge || !Le)
|
|
@@ -4730,7 +4728,7 @@ function Si(e, t, s, r, i, n) {
|
|
|
4730
4728
|
], 34)
|
|
4731
4729
|
], 6);
|
|
4732
4730
|
}
|
|
4733
|
-
const Ti = /* @__PURE__ */ U(
|
|
4731
|
+
const Ti = /* @__PURE__ */ U(hi, [["render", Si], ["__scopeId", "data-v-bba29b9c"]]), Mi = {
|
|
4734
4732
|
name: "WmInlineCallbacks",
|
|
4735
4733
|
props: {
|
|
4736
4734
|
// Array d'items `{ id?, label, style?, ... }`. Pour les suggestions,
|
|
@@ -4808,7 +4806,7 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
4808
4806
|
"date"
|
|
4809
4807
|
]), Pi = {
|
|
4810
4808
|
name: "WmFormCard",
|
|
4811
|
-
components: { AIAvatar:
|
|
4809
|
+
components: { AIAvatar: he },
|
|
4812
4810
|
inject: {
|
|
4813
4811
|
// Translator shared by the Messenger shell; French fallback when
|
|
4814
4812
|
// the component is used standalone.
|
|
@@ -5087,7 +5085,7 @@ const aa = /* @__PURE__ */ U(Pi, [["render", ia], ["__scopeId", "data-v-fe65cc56
|
|
|
5087
5085
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
5088
5086
|
}
|
|
5089
5087
|
}
|
|
5090
|
-
}, la = { class: "wm-fb" }, ca = { class: "wm-fb__title" }, da = { class: "wm-fb__sub" }, ua = { class: "wm-fb__row" },
|
|
5088
|
+
}, la = { class: "wm-fb" }, ca = { class: "wm-fb__title" }, da = { class: "wm-fb__sub" }, ua = { class: "wm-fb__row" }, ma = ["onClick"], ha = { class: "wm-fb__emoji" }, fa = { class: "wm-fb__label" }, _a = ["disabled"], ga = {
|
|
5091
5089
|
key: 1,
|
|
5092
5090
|
class: "wm-fb__done"
|
|
5093
5091
|
}, va = { class: "wm-fb__doneTitle" }, ya = { class: "wm-fb__doneSub" };
|
|
@@ -5121,9 +5119,9 @@ function pa(e, t, s, r, i, n) {
|
|
|
5121
5119
|
class: R(["wm-fb__opt", { "is-selected": i.sel === a.v }]),
|
|
5122
5120
|
onClick: (o) => i.sel = a.v
|
|
5123
5121
|
}, [
|
|
5124
|
-
l("span",
|
|
5122
|
+
l("span", ha, v(a.e), 1),
|
|
5125
5123
|
l("span", fa, v(a.l), 1)
|
|
5126
|
-
], 10,
|
|
5124
|
+
], 10, ma))), 128))
|
|
5127
5125
|
]),
|
|
5128
5126
|
l("button", {
|
|
5129
5127
|
type: "button",
|
|
@@ -5519,11 +5517,6 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5519
5517
|
// PJ, formulaire, quick-link sans URL). Évite de polluer la liste
|
|
5520
5518
|
// côté serveur avec des fils vides abandonnés.
|
|
5521
5519
|
draftConv: null,
|
|
5522
|
-
// Transient ghost-bubble descriptor for the home→chat launch
|
|
5523
|
-
// animation: { text, rect } captured from the onboarding starter
|
|
5524
|
-
// input. Non-null only while the fly-up animation plays; cleared
|
|
5525
|
-
// on `animationend`. See `onOnboardingStart` / `launchStyle`.
|
|
5526
|
-
launch: null,
|
|
5527
5520
|
// convId → true quand l'utilisateur a cliqué "Rouvrir" sur une conv
|
|
5528
5521
|
// fermée : débloque le composer localement le temps qu'un message la
|
|
5529
5522
|
// réactive côté serveur. Reset au reload (non persisté, volontaire).
|
|
@@ -5602,20 +5595,6 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5602
5595
|
isEmbedded() {
|
|
5603
5596
|
return this.displayMode === "embedded";
|
|
5604
5597
|
},
|
|
5605
|
-
// Fixed-position box for the launch ghost bubble, matching the home
|
|
5606
|
-
// starter input's viewport rect so the bubble lifts off exactly
|
|
5607
|
-
// where the user was typing. Right-aligned content inside makes it
|
|
5608
|
-
// read as an outgoing message before it flies up.
|
|
5609
|
-
launchStyle() {
|
|
5610
|
-
var t;
|
|
5611
|
-
const e = (t = this.launch) == null ? void 0 : t.rect;
|
|
5612
|
-
return e ? {
|
|
5613
|
-
left: `${e.left}px`,
|
|
5614
|
-
top: `${e.top}px`,
|
|
5615
|
-
width: `${e.width}px`,
|
|
5616
|
-
height: `${e.height}px`
|
|
5617
|
-
} : null;
|
|
5618
|
-
},
|
|
5619
5598
|
// Language set on the authenticated customer. Checked both as a
|
|
5620
5599
|
// top-level column and as a named variable (`values.language`).
|
|
5621
5600
|
// Falls back to the consumer-supplied `context.customer.language`
|
|
@@ -5917,7 +5896,7 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5917
5896
|
}
|
|
5918
5897
|
const s = this.revealedAt, r = (this.s.messagesByConv[e.id] || []).filter((a) => {
|
|
5919
5898
|
var o, f, k, y, T;
|
|
5920
|
-
return (a == null ? void 0 : a.type) === "action" && ((o = a == null ? void 0 : a.payload) == null ? void 0 : o.state) === "pending" ||
|
|
5899
|
+
return (a == null ? void 0 : a.type) === "action" && ((o = a == null ? void 0 : a.payload) == null ? void 0 : o.state) === "pending" || me(a) && !(s[a.id] > 0) ? !1 : (a == null ? void 0 : a.type) === "action" || (a == null ? void 0 : a.type) === "system" || ((f = a == null ? void 0 : a.payload) == null ? void 0 : f.type) === "system" || Array.isArray((k = a == null ? void 0 : a.payload) == null ? void 0 : k.attachments) && a.payload.attachments.length || (y = a == null ? void 0 : a.metadata) != null && y.artifact || (T = a == null ? void 0 : a.metadata) != null && T.form || Array.isArray(a == null ? void 0 : a.callbacks) && a.callbacks.some((I) => (I == null ? void 0 : I.intent) === "submit_form") ? !0 : typeof (a == null ? void 0 : a.text_md) == "string" && a.text_md.trim().length > 0;
|
|
5921
5900
|
});
|
|
5922
5901
|
return t.length ? [...t, ...r] : r;
|
|
5923
5902
|
},
|
|
@@ -5929,7 +5908,7 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5929
5908
|
var s, r, i;
|
|
5930
5909
|
const e = this.currentConv;
|
|
5931
5910
|
return e ? Object.keys(((s = this.s) == null ? void 0 : s.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : this.widgetWelcomeMessage && this.welcomeRevealedAt[e.id] === 0 ? !0 : (((i = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : i[e.id]) || []).some(
|
|
5932
|
-
(n) =>
|
|
5911
|
+
(n) => me(n) && !(this.revealedAt[n.id] > 0)
|
|
5933
5912
|
) : !1;
|
|
5934
5913
|
},
|
|
5935
5914
|
// Internal: the raw persisted list for the current conversation. We
|
|
@@ -6390,15 +6369,13 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
6390
6369
|
// quick-link without URL), so users who open the chat and walk away
|
|
6391
6370
|
// don't leave empty threads behind.
|
|
6392
6371
|
// Home-screen starter input → open a conversation already seeded
|
|
6393
|
-
// with the user's first message.
|
|
6394
|
-
//
|
|
6395
|
-
//
|
|
6396
|
-
//
|
|
6397
|
-
// fades in via the `wm-convEnter` transition) ; `onSend` then
|
|
6398
|
-
// materializes the draft server-side and posts the text.
|
|
6372
|
+
// with the user's first message. Entering draft mode swaps the
|
|
6373
|
+
// home screen for the conversation view, which crossfades in via
|
|
6374
|
+
// the `wm-screen` transition ; `onSend` then materializes the
|
|
6375
|
+
// draft server-side and posts the text.
|
|
6399
6376
|
onOnboardingStart(e) {
|
|
6400
|
-
const t = (
|
|
6401
|
-
|
|
6377
|
+
const t = (e || "").trim();
|
|
6378
|
+
this.startConv(), t && this.$nextTick(() => this.onSend(t));
|
|
6402
6379
|
},
|
|
6403
6380
|
startConv() {
|
|
6404
6381
|
this.draftConv = {
|
|
@@ -6628,7 +6605,7 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
6628
6605
|
async onFormSubmit({ values: e }) {
|
|
6629
6606
|
const t = this.pendingForm;
|
|
6630
6607
|
if (!(t != null && t.form)) return;
|
|
6631
|
-
const s =
|
|
6608
|
+
const s = ht(t.form, e, this.translator);
|
|
6632
6609
|
if (!s) return;
|
|
6633
6610
|
let r = this.currentConv;
|
|
6634
6611
|
r && (r._draft && (r = await this.ensureRealConv(), !r) || await this.store.send(r.id, s, {
|
|
@@ -6746,34 +6723,37 @@ const Wa = /* @__PURE__ */ U(Pa, [["render", Ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
6746
6723
|
class: "wm-loading",
|
|
6747
6724
|
"aria-busy": "true",
|
|
6748
6725
|
"aria-live": "polite"
|
|
6749
|
-
}, Ya = ["aria-label"], Ja = {
|
|
6750
|
-
key:
|
|
6751
|
-
class: "wm-state"
|
|
6752
|
-
},
|
|
6726
|
+
}, Ya = ["aria-label"], Ja = { class: "wm-screens" }, Xa = {
|
|
6727
|
+
key: "error",
|
|
6728
|
+
class: "wm-screen wm-state"
|
|
6729
|
+
}, Qa = { class: "wm-state__err" }, Za = { class: "wm-state__errTitle" }, eo = { class: "wm-state__errSub" }, to = {
|
|
6730
|
+
key: "chat",
|
|
6731
|
+
class: "wm-screen wm-screen--chat"
|
|
6732
|
+
}, no = { class: "wm-bottom" }, so = {
|
|
6753
6733
|
key: 0,
|
|
6754
6734
|
ref: "floatEl",
|
|
6755
6735
|
class: "wm-float"
|
|
6756
|
-
},
|
|
6736
|
+
}, ro = {
|
|
6757
6737
|
key: 1,
|
|
6758
6738
|
class: "wm-actionWait",
|
|
6759
6739
|
role: "status",
|
|
6760
6740
|
"aria-live": "polite"
|
|
6761
|
-
},
|
|
6741
|
+
}, io = { class: "wm-actionWait__lbl" }, ao = {
|
|
6762
6742
|
key: 2,
|
|
6763
6743
|
class: "wm-attached"
|
|
6764
|
-
},
|
|
6744
|
+
}, oo = ["src", "alt"], lo = {
|
|
6765
6745
|
key: 1,
|
|
6766
6746
|
class: "wm-attached__file"
|
|
6767
|
-
},
|
|
6747
|
+
}, co = { class: "wm-attached__fileMeta" }, uo = { class: "wm-attached__fileName" }, mo = {
|
|
6768
6748
|
key: 0,
|
|
6769
6749
|
class: "wm-attached__fileSize"
|
|
6770
|
-
},
|
|
6750
|
+
}, ho = ["aria-label", "onClick"], fo = {
|
|
6771
6751
|
key: 3,
|
|
6772
6752
|
class: "wm-ended",
|
|
6773
6753
|
role: "status",
|
|
6774
6754
|
"aria-live": "polite"
|
|
6775
|
-
},
|
|
6776
|
-
function
|
|
6755
|
+
}, _o = { class: "wm-ended__lbl" };
|
|
6756
|
+
function go(e, t, s, r, i, n) {
|
|
6777
6757
|
const a = P("Launcher"), o = P("Header"), f = P("History"), k = P("Onboarding"), y = P("MessageList"), T = P("InlineCallbacks"), I = P("FormCard"), S = P("Feedback"), z = P("Composer"), M = P("MoreMenu"), D = P("RenameDialog");
|
|
6778
6758
|
return c(), d("div", {
|
|
6779
6759
|
class: R(["wm-root", `wm-root--${s.displayMode}`]),
|
|
@@ -6806,7 +6786,7 @@ function _o(e, t, s, r, i, n) {
|
|
|
6806
6786
|
class: "wm-loading__close",
|
|
6807
6787
|
"aria-label": n.t("loading.minimize"),
|
|
6808
6788
|
onClick: t[0] || (t[0] = (...x) => n.close && n.close(...x))
|
|
6809
|
-
}, [...t[
|
|
6789
|
+
}, [...t[8] || (t[8] = [
|
|
6810
6790
|
l("svg", {
|
|
6811
6791
|
width: "13",
|
|
6812
6792
|
height: "13",
|
|
@@ -6821,7 +6801,7 @@ function _o(e, t, s, r, i, n) {
|
|
|
6821
6801
|
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6822
6802
|
], -1)
|
|
6823
6803
|
])], 8, Ya)),
|
|
6824
|
-
t[
|
|
6804
|
+
t[9] || (t[9] = l("div", {
|
|
6825
6805
|
class: "wm-loading__spinner",
|
|
6826
6806
|
"aria-hidden": "true"
|
|
6827
6807
|
}, null, -1))
|
|
@@ -6840,203 +6820,204 @@ function _o(e, t, s, r, i, n) {
|
|
|
6840
6820
|
onMore: n.toggleMore,
|
|
6841
6821
|
onClose: n.close
|
|
6842
6822
|
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "agent-name", "agent-avatar-url", "onBack", "onMore", "onClose"]),
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
t[11] || (t[11] = l("div", { class: "wm-state__errIcon" }, [
|
|
6846
|
-
l("svg", {
|
|
6847
|
-
width: "14",
|
|
6848
|
-
height: "14",
|
|
6849
|
-
viewBox: "0 0 24 24",
|
|
6850
|
-
fill: "none",
|
|
6851
|
-
stroke: "currentColor",
|
|
6852
|
-
"stroke-width": "2",
|
|
6853
|
-
"stroke-linecap": "round",
|
|
6854
|
-
"stroke-linejoin": "round",
|
|
6855
|
-
"aria-hidden": "true"
|
|
6856
|
-
}, [
|
|
6857
|
-
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6858
|
-
])
|
|
6859
|
-
], -1)),
|
|
6860
|
-
l("div", null, [
|
|
6861
|
-
l("div", Qa, v(n.t("error.connectionFailed")), 1),
|
|
6862
|
-
l("div", Za, v(n.error), 1)
|
|
6863
|
-
])
|
|
6864
|
-
])
|
|
6865
|
-
])) : !n.currentConv && i.showHistory ? (c(), B(f, {
|
|
6866
|
-
key: 1,
|
|
6867
|
-
threads: n.openThreads,
|
|
6868
|
-
onResume: n.onDrawerPick
|
|
6869
|
-
}, null, 8, ["threads", "onResume"])) : n.currentConv ? (c(), d(E, { key: 3 }, [
|
|
6870
|
-
K(Ae, {
|
|
6871
|
-
appear: "",
|
|
6872
|
-
name: "wm-convEnter"
|
|
6873
|
-
}, {
|
|
6823
|
+
l("div", Ja, [
|
|
6824
|
+
K(Ae, { name: "wm-screen" }, {
|
|
6874
6825
|
default: Se(() => [
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
"streaming-active": n.streamingActive,
|
|
6879
|
-
"date-label": n.dateLabel,
|
|
6880
|
-
"conversation-id": n.currentConv ? n.currentConv.id : null,
|
|
6881
|
-
"loading-more": n.paginationState.loading,
|
|
6882
|
-
"has-more": n.paginationState.hasMore,
|
|
6883
|
-
"unread-anchor-id": e.unreadAnchorId,
|
|
6884
|
-
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
6885
|
-
"ai-agent-name": n.agentName,
|
|
6886
|
-
"ai-agent-avatar-url": n.agentAvatarUrl,
|
|
6887
|
-
onLoadMore: n.onLoadMore
|
|
6888
|
-
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "ai-agent-name", "ai-agent-avatar-url", "onLoadMore"])
|
|
6889
|
-
]),
|
|
6890
|
-
_: 1
|
|
6891
|
-
}),
|
|
6892
|
-
l("div", eo, [
|
|
6893
|
-
n.floatVisible ? (c(), d("div", to, [
|
|
6894
|
-
n.pendingApproval ? (c(), B(T, {
|
|
6895
|
-
key: `appr-${n.pendingApproval.id}`,
|
|
6896
|
-
variant: "buttons",
|
|
6897
|
-
items: n.approvalCallbacks,
|
|
6898
|
-
onSelect: n.onApprovalSelect
|
|
6899
|
-
}, null, 8, ["items", "onSelect"])) : n.pendingResolution ? (c(), B(T, {
|
|
6900
|
-
key: `res-${n.pendingResolution.id}`,
|
|
6901
|
-
variant: "buttons",
|
|
6902
|
-
items: n.resolutionCallbacks,
|
|
6903
|
-
onSelect: n.onResolutionSelect
|
|
6904
|
-
}, null, 8, ["items", "onSelect"])) : n.pendingForm ? (c(), B(I, {
|
|
6905
|
-
key: n.pendingForm.message && n.pendingForm.message.id,
|
|
6906
|
-
form: n.pendingForm.form,
|
|
6907
|
-
"agent-name": n.agentName,
|
|
6908
|
-
"agent-avatar-url": n.agentAvatarUrl,
|
|
6909
|
-
onSubmit: n.onFormSubmit
|
|
6910
|
-
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : n.showFeedback ? (c(), B(S, {
|
|
6911
|
-
key: 3,
|
|
6912
|
-
busy: i.feedbackBusy,
|
|
6913
|
-
done: !!(n.currentConv && i.feedbackDone[n.currentConv.id]),
|
|
6914
|
-
onSubmit: n.onFeedback
|
|
6915
|
-
}, null, 8, ["busy", "done", "onSubmit"])) : (c(), B(T, {
|
|
6916
|
-
key: 4,
|
|
6917
|
-
items: n.suggestions,
|
|
6918
|
-
onSelect: n.onSuggestion
|
|
6919
|
-
}, null, 8, ["items", "onSelect"]))
|
|
6920
|
-
], 512)) : b("", !0),
|
|
6921
|
-
n.actionInFlight ? (c(), d("div", no, [
|
|
6922
|
-
t[12] || (t[12] = l("span", {
|
|
6923
|
-
class: "wm-actionWait__spinner",
|
|
6924
|
-
"aria-hidden": "true"
|
|
6925
|
-
}, null, -1)),
|
|
6926
|
-
l("span", so, v(n.t("action.inProgress", {
|
|
6927
|
-
name: n.actionInFlightName
|
|
6928
|
-
})), 1)
|
|
6929
|
-
])) : b("", !0),
|
|
6930
|
-
i.pendingAttachments.length ? (c(), d("div", ro, [
|
|
6931
|
-
(c(!0), d(E, null, N(i.pendingAttachments, (x, q) => (c(), d("div", {
|
|
6932
|
-
key: x.path || q,
|
|
6933
|
-
class: "wm-attached__item"
|
|
6934
|
-
}, [
|
|
6935
|
-
x.previewUrl ? (c(), d("img", {
|
|
6936
|
-
key: 0,
|
|
6937
|
-
class: "wm-attached__thumb",
|
|
6938
|
-
src: x.previewUrl,
|
|
6939
|
-
alt: x.name
|
|
6940
|
-
}, null, 8, io)) : (c(), d("div", ao, [
|
|
6941
|
-
t[13] || (t[13] = l("span", { class: "wm-attached__fileIcon" }, [
|
|
6826
|
+
n.error ? (c(), d("div", Xa, [
|
|
6827
|
+
l("div", Qa, [
|
|
6828
|
+
t[10] || (t[10] = l("div", { class: "wm-state__errIcon" }, [
|
|
6942
6829
|
l("svg", {
|
|
6943
|
-
width: "
|
|
6944
|
-
height: "
|
|
6830
|
+
width: "14",
|
|
6831
|
+
height: "14",
|
|
6945
6832
|
viewBox: "0 0 24 24",
|
|
6946
6833
|
fill: "none",
|
|
6947
6834
|
stroke: "currentColor",
|
|
6948
|
-
"stroke-width": "
|
|
6835
|
+
"stroke-width": "2",
|
|
6949
6836
|
"stroke-linecap": "round",
|
|
6950
6837
|
"stroke-linejoin": "round",
|
|
6951
6838
|
"aria-hidden": "true"
|
|
6952
6839
|
}, [
|
|
6953
|
-
l("path", { d: "
|
|
6954
|
-
l("path", { d: "M14 2v6h6" })
|
|
6840
|
+
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6955
6841
|
])
|
|
6956
6842
|
], -1)),
|
|
6957
|
-
l("
|
|
6958
|
-
l("
|
|
6959
|
-
|
|
6960
|
-
x.size_bytes
|
|
6961
|
-
)), 1)) : b("", !0)
|
|
6843
|
+
l("div", null, [
|
|
6844
|
+
l("div", Za, v(n.t("error.connectionFailed")), 1),
|
|
6845
|
+
l("div", eo, v(n.error), 1)
|
|
6962
6846
|
])
|
|
6963
|
-
])
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
6847
|
+
])
|
|
6848
|
+
])) : !n.currentConv && i.showHistory ? (c(), B(f, {
|
|
6849
|
+
key: "history",
|
|
6850
|
+
class: "wm-screen",
|
|
6851
|
+
threads: n.openThreads,
|
|
6852
|
+
onResume: n.onDrawerPick
|
|
6853
|
+
}, null, 8, ["threads", "onResume"])) : n.currentConv ? (c(), d("div", to, [
|
|
6854
|
+
K(y, {
|
|
6855
|
+
ref: "messageList",
|
|
6856
|
+
messages: n.displayedMessages,
|
|
6857
|
+
"streaming-active": n.streamingActive,
|
|
6858
|
+
"date-label": n.dateLabel,
|
|
6859
|
+
"conversation-id": n.currentConv ? n.currentConv.id : null,
|
|
6860
|
+
"loading-more": n.paginationState.loading,
|
|
6861
|
+
"has-more": n.paginationState.hasMore,
|
|
6862
|
+
"unread-anchor-id": e.unreadAnchorId,
|
|
6863
|
+
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
6864
|
+
"ai-agent-name": n.agentName,
|
|
6865
|
+
"ai-agent-avatar-url": n.agentAvatarUrl,
|
|
6866
|
+
onLoadMore: n.onLoadMore
|
|
6867
|
+
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "ai-agent-name", "ai-agent-avatar-url", "onLoadMore"]),
|
|
6868
|
+
l("div", no, [
|
|
6869
|
+
n.floatVisible ? (c(), d("div", so, [
|
|
6870
|
+
n.pendingApproval ? (c(), B(T, {
|
|
6871
|
+
key: `appr-${n.pendingApproval.id}`,
|
|
6872
|
+
variant: "buttons",
|
|
6873
|
+
items: n.approvalCallbacks,
|
|
6874
|
+
onSelect: n.onApprovalSelect
|
|
6875
|
+
}, null, 8, ["items", "onSelect"])) : n.pendingResolution ? (c(), B(T, {
|
|
6876
|
+
key: `res-${n.pendingResolution.id}`,
|
|
6877
|
+
variant: "buttons",
|
|
6878
|
+
items: n.resolutionCallbacks,
|
|
6879
|
+
onSelect: n.onResolutionSelect
|
|
6880
|
+
}, null, 8, ["items", "onSelect"])) : n.pendingForm ? (c(), B(I, {
|
|
6881
|
+
key: n.pendingForm.message && n.pendingForm.message.id,
|
|
6882
|
+
form: n.pendingForm.form,
|
|
6883
|
+
"agent-name": n.agentName,
|
|
6884
|
+
"agent-avatar-url": n.agentAvatarUrl,
|
|
6885
|
+
onSubmit: n.onFormSubmit
|
|
6886
|
+
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : n.showFeedback ? (c(), B(S, {
|
|
6887
|
+
key: 3,
|
|
6888
|
+
busy: i.feedbackBusy,
|
|
6889
|
+
done: !!(n.currentConv && i.feedbackDone[n.currentConv.id]),
|
|
6890
|
+
onSubmit: n.onFeedback
|
|
6891
|
+
}, null, 8, ["busy", "done", "onSubmit"])) : (c(), B(T, {
|
|
6892
|
+
key: 4,
|
|
6893
|
+
items: n.suggestions,
|
|
6894
|
+
onSelect: n.onSuggestion
|
|
6895
|
+
}, null, 8, ["items", "onSelect"]))
|
|
6896
|
+
], 512)) : b("", !0),
|
|
6897
|
+
n.actionInFlight ? (c(), d("div", ro, [
|
|
6898
|
+
t[11] || (t[11] = l("span", {
|
|
6899
|
+
class: "wm-actionWait__spinner",
|
|
6900
|
+
"aria-hidden": "true"
|
|
6901
|
+
}, null, -1)),
|
|
6902
|
+
l("span", io, v(n.t("action.inProgress", {
|
|
6903
|
+
name: n.actionInFlightName
|
|
6904
|
+
})), 1)
|
|
6905
|
+
])) : b("", !0),
|
|
6906
|
+
i.pendingAttachments.length ? (c(), d("div", ao, [
|
|
6907
|
+
(c(!0), d(E, null, N(i.pendingAttachments, (x, q) => (c(), d("div", {
|
|
6908
|
+
key: x.path || q,
|
|
6909
|
+
class: "wm-attached__item"
|
|
6910
|
+
}, [
|
|
6911
|
+
x.previewUrl ? (c(), d("img", {
|
|
6912
|
+
key: 0,
|
|
6913
|
+
class: "wm-attached__thumb",
|
|
6914
|
+
src: x.previewUrl,
|
|
6915
|
+
alt: x.name
|
|
6916
|
+
}, null, 8, oo)) : (c(), d("div", lo, [
|
|
6917
|
+
t[12] || (t[12] = l("span", { class: "wm-attached__fileIcon" }, [
|
|
6918
|
+
l("svg", {
|
|
6919
|
+
width: "16",
|
|
6920
|
+
height: "16",
|
|
6921
|
+
viewBox: "0 0 24 24",
|
|
6922
|
+
fill: "none",
|
|
6923
|
+
stroke: "currentColor",
|
|
6924
|
+
"stroke-width": "1.7",
|
|
6925
|
+
"stroke-linecap": "round",
|
|
6926
|
+
"stroke-linejoin": "round",
|
|
6927
|
+
"aria-hidden": "true"
|
|
6928
|
+
}, [
|
|
6929
|
+
l("path", { d: "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" }),
|
|
6930
|
+
l("path", { d: "M14 2v6h6" })
|
|
6931
|
+
])
|
|
6932
|
+
], -1)),
|
|
6933
|
+
l("span", co, [
|
|
6934
|
+
l("span", uo, v(x.name), 1),
|
|
6935
|
+
n.formatAttachmentSize(x.size_bytes) ? (c(), d("span", mo, v(n.formatAttachmentSize(
|
|
6936
|
+
x.size_bytes
|
|
6937
|
+
)), 1)) : b("", !0)
|
|
6938
|
+
])
|
|
6939
|
+
])),
|
|
6940
|
+
l("button", {
|
|
6941
|
+
type: "button",
|
|
6942
|
+
class: "wm-attached__remove",
|
|
6943
|
+
"aria-label": n.t("attachment.remove"),
|
|
6944
|
+
onClick: (J) => n.removePendingAttachment(q)
|
|
6945
|
+
}, [...t[13] || (t[13] = [
|
|
6946
|
+
l("svg", {
|
|
6947
|
+
width: "10",
|
|
6948
|
+
height: "10",
|
|
6949
|
+
viewBox: "0 0 24 24",
|
|
6950
|
+
fill: "none",
|
|
6951
|
+
stroke: "currentColor",
|
|
6952
|
+
"stroke-width": "2.4",
|
|
6953
|
+
"stroke-linecap": "round",
|
|
6954
|
+
"stroke-linejoin": "round",
|
|
6955
|
+
"aria-hidden": "true"
|
|
6956
|
+
}, [
|
|
6957
|
+
l("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6958
|
+
], -1)
|
|
6959
|
+
])], 8, ho)
|
|
6960
|
+
]))), 128))
|
|
6961
|
+
])) : b("", !0),
|
|
6962
|
+
n.endedBlockVisible ? (c(), d("div", fo, [
|
|
6963
|
+
l("span", _o, v(n.isClosed ? n.t("composer.conversationClosed") : n.t("composer.conversationEnded")), 1),
|
|
6964
|
+
l("button", {
|
|
6965
|
+
type: "button",
|
|
6966
|
+
class: "wm-ended__btn",
|
|
6967
|
+
onClick: t[2] || (t[2] = (x) => n.isClosed ? n.onReopen() : n.startConv())
|
|
6968
|
+
}, v(n.isClosed ? n.t("composer.reopen") : n.t("composer.newConversation")), 1)
|
|
6969
|
+
])) : n.actionInFlight ? b("", !0) : (c(), B(z, {
|
|
6970
|
+
key: 4,
|
|
6971
|
+
ref: "composer",
|
|
6972
|
+
modelValue: i.draft,
|
|
6973
|
+
"onUpdate:modelValue": t[3] || (t[3] = (x) => i.draft = x),
|
|
6974
|
+
placeholder: n.composerPlaceholder,
|
|
6975
|
+
"attach-label": n.t("composer.attachFile"),
|
|
6976
|
+
"display-mode": s.displayMode,
|
|
6977
|
+
onSend: n.onSend,
|
|
6978
|
+
onAttach: n.onAttach
|
|
6979
|
+
}, null, 8, ["modelValue", "placeholder", "attach-label", "display-mode", "onSend", "onAttach"]))
|
|
6980
|
+
]),
|
|
6981
|
+
i.moreOpen ? (c(), B(M, {
|
|
6982
|
+
key: 0,
|
|
6983
|
+
"can-rename": !!n.currentConv && !n.currentConv._draft,
|
|
6984
|
+
"can-export": !!n.currentConv && !n.currentConv._draft,
|
|
6985
|
+
"sound-enabled": e.soundEnabled,
|
|
6986
|
+
"status-url": n.statusUrl,
|
|
6987
|
+
"help-url": n.helpUrl,
|
|
6988
|
+
onClose: t[4] || (t[4] = (x) => i.moreOpen = !1),
|
|
6989
|
+
onSoundToggle: e.onSoundToggle,
|
|
6990
|
+
onAction: n.onMoreAction
|
|
6991
|
+
}, null, 8, ["can-rename", "can-export", "sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0),
|
|
6992
|
+
i.renameDialogOpen && n.currentConv && !n.currentConv._draft ? (c(), B(D, {
|
|
6993
|
+
key: 1,
|
|
6994
|
+
"initial-value": n.currentConv.name || "",
|
|
6995
|
+
title: n.t("rename.dialogTitle"),
|
|
6996
|
+
onClose: t[5] || (t[5] = (x) => i.renameDialogOpen = !1),
|
|
6997
|
+
onSubmit: n.onRenameSubmit
|
|
6998
|
+
}, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0)
|
|
6999
|
+
])) : (c(), B(k, {
|
|
7000
|
+
key: "home",
|
|
7001
|
+
class: "wm-screen",
|
|
7002
|
+
title: n.widgetTitle,
|
|
7003
|
+
subtitle: n.widgetSubtitle,
|
|
7004
|
+
"agent-name": n.agentName,
|
|
7005
|
+
"default-icon-url": n.defaultIconUrl,
|
|
7006
|
+
"cover-image-url": n.coverImageUrl,
|
|
7007
|
+
"quick-links": n.quickLinks,
|
|
7008
|
+
"open-threads": n.openThreads,
|
|
7009
|
+
busy: i.busy,
|
|
7010
|
+
onStart: n.onOnboardingStart,
|
|
7011
|
+
onSelect: n.onQuickLink,
|
|
7012
|
+
onResume: n.onDrawerPick,
|
|
7013
|
+
onViewHistory: t[1] || (t[1] = (x) => i.showHistory = !0)
|
|
7014
|
+
}, null, 8, ["title", "subtitle", "agent-name", "default-icon-url", "cover-image-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"]))
|
|
7015
|
+
]),
|
|
7016
|
+
_: 1
|
|
7017
|
+
})
|
|
7018
|
+
]),
|
|
7038
7019
|
i.moreOpen && !n.currentConv ? (c(), B(M, {
|
|
7039
|
-
key:
|
|
7020
|
+
key: 0,
|
|
7040
7021
|
"can-rename": !1,
|
|
7041
7022
|
"can-export": !1,
|
|
7042
7023
|
"sound-enabled": e.soundEnabled,
|
|
@@ -7047,21 +7028,12 @@ function _o(e, t, s, r, i, n) {
|
|
|
7047
7028
|
onAction: n.onMoreAction
|
|
7048
7029
|
}, null, 8, ["sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0)
|
|
7049
7030
|
], 64))
|
|
7050
|
-
], 6)) : b("", !0)
|
|
7051
|
-
i.launch ? (c(), d("div", {
|
|
7052
|
-
key: 2,
|
|
7053
|
-
class: "wm-launch",
|
|
7054
|
-
style: F(n.launchStyle),
|
|
7055
|
-
"aria-hidden": "true",
|
|
7056
|
-
onAnimationend: t[8] || (t[8] = (x) => i.launch = null)
|
|
7057
|
-
}, [
|
|
7058
|
-
l("div", fo, v(i.launch.text), 1)
|
|
7059
|
-
], 36)) : b("", !0)
|
|
7031
|
+
], 6)) : b("", !0)
|
|
7060
7032
|
], 6);
|
|
7061
7033
|
}
|
|
7062
|
-
const
|
|
7034
|
+
const po = /* @__PURE__ */ U($a, [["render", go], ["__scopeId", "data-v-92685b04"]]), wo = "0.6.6";
|
|
7063
7035
|
export {
|
|
7064
|
-
|
|
7036
|
+
he as AIAvatar,
|
|
7065
7037
|
be as AVATAR_COLORS,
|
|
7066
7038
|
Ms as ActionResult,
|
|
7067
7039
|
Us as ArtifactFormResponse,
|
|
@@ -7081,14 +7053,14 @@ export {
|
|
|
7081
7053
|
qt as Launcher,
|
|
7082
7054
|
Le as MEDIA_RECORDER_SUPPORTED,
|
|
7083
7055
|
oi as MessageList,
|
|
7084
|
-
|
|
7056
|
+
po as Messenger,
|
|
7085
7057
|
Ba as MoreMenu,
|
|
7086
7058
|
Zn as Onboarding,
|
|
7087
7059
|
ge as SCREEN_CAPTURE_SUPPORTED,
|
|
7088
|
-
|
|
7060
|
+
mt as SUPPORTED_LANGUAGES,
|
|
7089
7061
|
tn as TeamAvatars,
|
|
7090
7062
|
Br as Typing,
|
|
7091
|
-
|
|
7063
|
+
wo as VERSION,
|
|
7092
7064
|
xe as avatarColor,
|
|
7093
7065
|
Oe as avatarInitials,
|
|
7094
7066
|
ci as captureScreenshotFile,
|
|
@@ -7097,9 +7069,9 @@ export {
|
|
|
7097
7069
|
H as createTranslator,
|
|
7098
7070
|
tt as createTransport,
|
|
7099
7071
|
re as dateLocale,
|
|
7100
|
-
|
|
7072
|
+
po as default,
|
|
7101
7073
|
Ce as formatTime,
|
|
7102
|
-
|
|
7074
|
+
yo as guessAttachmentKind,
|
|
7103
7075
|
li as pickRecorderMime,
|
|
7104
7076
|
Ve as renderInlineMarkdown,
|
|
7105
7077
|
_t as renderMarkdown,
|