@_solaris/messenger-widget 0.4.4 → 0.4.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/messenger.cjs +4 -4
- package/dist/messenger.embed.js +8 -8
- package/dist/messenger.js +780 -738
- package/dist/style.css +1 -1
- package/dist/types/core/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as Fe, openBlock as c, createElementBlock as u, normalizeStyle as K, normalizeClass as x, toDisplayString as v, resolveComponent as
|
|
1
|
+
import { reactive as Fe, openBlock as c, createElementBlock as u, normalizeStyle as K, normalizeClass as x, toDisplayString as v, resolveComponent as L, createVNode as q, Transition as je, withCtx as Ue, Fragment as I, renderList as j, withKeys as ue, withModifiers as X, createElementVNode as o, createCommentVNode as b, createBlock as R, withDirectives as V, vModelText as ee, createTextVNode as ge, resolveDynamicComponent as Pe, renderSlot as De, vModelCheckbox as $e, vModelSelect as He, markRaw as ye } from "vue";
|
|
2
2
|
const qe = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -75,7 +75,7 @@ function We(e) {
|
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
async function
|
|
78
|
+
async function p() {
|
|
79
79
|
const [d, f] = await Promise.all([
|
|
80
80
|
// Public — no HMAC required.
|
|
81
81
|
fetch(
|
|
@@ -135,7 +135,7 @@ function We(e) {
|
|
|
135
135
|
{ message_id: f }
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
|
-
async function
|
|
138
|
+
async function P(d, f = {}) {
|
|
139
139
|
const _ = new URLSearchParams();
|
|
140
140
|
f.before && _.set("before", f.before), f.since && _.set("since", f.since), f.limit && _.set("limit", String(f.limit));
|
|
141
141
|
const y = _.toString() ? `?${_.toString()}` : "";
|
|
@@ -235,7 +235,7 @@ function We(e) {
|
|
|
235
235
|
t.panelOpen || Q();
|
|
236
236
|
}, Ve));
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function he(d) {
|
|
239
239
|
t.panelOpen = !!d, t.panelOpen ? (clearTimeout(t.burstTimer), G()) : z();
|
|
240
240
|
}
|
|
241
241
|
async function ce() {
|
|
@@ -255,7 +255,7 @@ function We(e) {
|
|
|
255
255
|
function se() {
|
|
256
256
|
t.pollTimer && (clearInterval(t.pollTimer), t.pollTimer = null);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function m() {
|
|
259
259
|
if (document.hidden)
|
|
260
260
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = setTimeout(() => {
|
|
261
261
|
t.hiddenGraceTimer = null, document.hidden && (se(), Q(), r("paused"));
|
|
@@ -268,10 +268,10 @@ function We(e) {
|
|
|
268
268
|
r("idle"), de(), t.panelOpen && G();
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
async function
|
|
271
|
+
async function h() {
|
|
272
272
|
if (t.started) return t.lastBootstrap;
|
|
273
273
|
t.started = !0;
|
|
274
|
-
const d = await
|
|
274
|
+
const d = await p();
|
|
275
275
|
t.lastBootstrap = d;
|
|
276
276
|
try {
|
|
277
277
|
const f = await T();
|
|
@@ -282,12 +282,12 @@ function We(e) {
|
|
|
282
282
|
} catch (f) {
|
|
283
283
|
console.error("[transport] initial /conversations failed", f);
|
|
284
284
|
}
|
|
285
|
-
return typeof document < "u" && (t.visibilityHandler =
|
|
285
|
+
return typeof document < "u" && (t.visibilityHandler = m, document.addEventListener(
|
|
286
286
|
"visibilitychange",
|
|
287
287
|
t.visibilityHandler
|
|
288
288
|
)), de(), d;
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function g() {
|
|
291
291
|
se(), clearTimeout(t.burstTimer), clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null, Q(), t.visibilityHandler && (document.removeEventListener(
|
|
292
292
|
"visibilitychange",
|
|
293
293
|
t.visibilityHandler
|
|
@@ -295,11 +295,11 @@ function We(e) {
|
|
|
295
295
|
}
|
|
296
296
|
return {
|
|
297
297
|
on: n,
|
|
298
|
-
start:
|
|
299
|
-
stop:
|
|
300
|
-
setPanelOpen:
|
|
298
|
+
start: h,
|
|
299
|
+
stop: g,
|
|
300
|
+
setPanelOpen: he,
|
|
301
301
|
// REST
|
|
302
|
-
bootstrap:
|
|
302
|
+
bootstrap: p,
|
|
303
303
|
getCustomer: C,
|
|
304
304
|
patchCustomer: k,
|
|
305
305
|
listConversations: T,
|
|
@@ -307,7 +307,7 @@ function We(e) {
|
|
|
307
307
|
getConversation: A,
|
|
308
308
|
patchConversation: H,
|
|
309
309
|
markConversationRead: M,
|
|
310
|
-
listMessages:
|
|
310
|
+
listMessages: P,
|
|
311
311
|
postMessage: N,
|
|
312
312
|
postCallback: $,
|
|
313
313
|
uploadAttachment: W,
|
|
@@ -369,49 +369,49 @@ function Xe(e) {
|
|
|
369
369
|
connection: "idle"
|
|
370
370
|
}), n = [];
|
|
371
371
|
n.push(
|
|
372
|
-
e.on("connection", (
|
|
373
|
-
t.connection =
|
|
372
|
+
e.on("connection", (m) => {
|
|
373
|
+
t.connection = m;
|
|
374
374
|
})
|
|
375
375
|
), n.push(
|
|
376
|
-
e.on("message", (
|
|
377
|
-
const
|
|
378
|
-
!
|
|
376
|
+
e.on("message", (m) => {
|
|
377
|
+
const h = m == null ? void 0 : m.conversation_id, g = m == null ? void 0 : m.message;
|
|
378
|
+
!h || !(g != null && g.id) || (Y(h, g), g.client_msg_id && delete t.streamingByMsgId[g.client_msg_id], he(h, g.created_at));
|
|
379
379
|
})
|
|
380
380
|
), n.push(
|
|
381
|
-
e.on("message_stream", (
|
|
382
|
-
const
|
|
383
|
-
!
|
|
381
|
+
e.on("message_stream", (m) => {
|
|
382
|
+
const h = m == null ? void 0 : m.message_id, g = m == null ? void 0 : m.token;
|
|
383
|
+
!h || typeof g != "string" || (t.streamingByMsgId[h] = (t.streamingByMsgId[h] || "") + g);
|
|
384
384
|
})
|
|
385
385
|
), n.push(
|
|
386
|
-
e.on("conversation_updated", (
|
|
387
|
-
const
|
|
388
|
-
if (!
|
|
389
|
-
const d = t.conversations.findIndex((f) => f.id ===
|
|
386
|
+
e.on("conversation_updated", (m) => {
|
|
387
|
+
const h = m == null ? void 0 : m.conversation_id, g = m == null ? void 0 : m.changes;
|
|
388
|
+
if (!h || !g) return;
|
|
389
|
+
const d = t.conversations.findIndex((f) => f.id === h);
|
|
390
390
|
d !== -1 && (t.conversations[d] = {
|
|
391
391
|
...t.conversations[d],
|
|
392
|
-
...
|
|
392
|
+
...g
|
|
393
393
|
});
|
|
394
394
|
})
|
|
395
395
|
), n.push(
|
|
396
|
-
e.on("config_updated", (
|
|
397
|
-
|
|
396
|
+
e.on("config_updated", (m) => {
|
|
397
|
+
m != null && m.config && (t.config = m.config);
|
|
398
398
|
})
|
|
399
399
|
), n.push(
|
|
400
|
-
e.on("action_status", (
|
|
401
|
-
const
|
|
402
|
-
if (!
|
|
403
|
-
const f = t.runningActionsByConv[
|
|
404
|
-
|
|
400
|
+
e.on("action_status", (m) => {
|
|
401
|
+
const h = m == null ? void 0 : m.conversation_id, g = m == null ? void 0 : m.action_id, d = m == null ? void 0 : m.action_name;
|
|
402
|
+
if (!h || !g) return;
|
|
403
|
+
const f = t.runningActionsByConv[h] || {};
|
|
404
|
+
m.state === "running" ? (f[g] = d || g, t.runningActionsByConv[h] = { ...f }) : m.state === "done" && (delete f[g], t.runningActionsByConv[h] = { ...f });
|
|
405
405
|
})
|
|
406
406
|
), n.push(
|
|
407
|
-
e.on("activity", (
|
|
408
|
-
Array.isArray(
|
|
407
|
+
e.on("activity", (m) => {
|
|
408
|
+
Array.isArray(m == null ? void 0 : m.conversations) && (t.conversations = m.conversations);
|
|
409
409
|
})
|
|
410
410
|
);
|
|
411
411
|
async function i() {
|
|
412
412
|
try {
|
|
413
|
-
const
|
|
414
|
-
(
|
|
413
|
+
const m = new Promise(
|
|
414
|
+
(g, d) => setTimeout(
|
|
415
415
|
() => d(
|
|
416
416
|
new Error(
|
|
417
417
|
"bootstrap timeout (15s) — check baseUrl, CORS, and network"
|
|
@@ -419,59 +419,59 @@ function Xe(e) {
|
|
|
419
419
|
),
|
|
420
420
|
15e3
|
|
421
421
|
)
|
|
422
|
-
),
|
|
423
|
-
t.config =
|
|
422
|
+
), h = await Promise.race([e.start(), m]);
|
|
423
|
+
t.config = h.config, t.customer = h.customer, t.conversations = await Promise.race([
|
|
424
424
|
e.listConversations(),
|
|
425
|
-
|
|
425
|
+
m
|
|
426
426
|
]), t.ready = !0;
|
|
427
|
-
} catch (
|
|
428
|
-
console.error("[store] start failed",
|
|
427
|
+
} catch (m) {
|
|
428
|
+
console.error("[store] start failed", m), t.error = (m == null ? void 0 : m.message) || String(m);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
function r() {
|
|
432
|
-
for (const
|
|
432
|
+
for (const m of n)
|
|
433
433
|
try {
|
|
434
|
-
|
|
434
|
+
m();
|
|
435
435
|
} catch {
|
|
436
436
|
}
|
|
437
437
|
e.stop();
|
|
438
438
|
}
|
|
439
|
-
async function s(
|
|
440
|
-
const
|
|
441
|
-
if (!
|
|
439
|
+
async function s(m) {
|
|
440
|
+
const h = de(m);
|
|
441
|
+
if (!h) return t.customer;
|
|
442
442
|
try {
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
} catch (
|
|
446
|
-
console.error("[store] applyCustomer failed",
|
|
443
|
+
const g = await e.patchCustomer(h);
|
|
444
|
+
g && (t.customer = g);
|
|
445
|
+
} catch (g) {
|
|
446
|
+
console.error("[store] applyCustomer failed", g);
|
|
447
447
|
}
|
|
448
448
|
return t.customer;
|
|
449
449
|
}
|
|
450
|
-
async function a(
|
|
451
|
-
const
|
|
452
|
-
return
|
|
450
|
+
async function a(m = {}) {
|
|
451
|
+
const h = await e.createConversation(m), g = t.conversations.findIndex((d) => d.id === h.id);
|
|
452
|
+
return g === -1 ? t.conversations = [h, ...t.conversations] : t.conversations[g] = h, h;
|
|
453
453
|
}
|
|
454
454
|
const l = 50;
|
|
455
|
-
async function
|
|
456
|
-
const
|
|
457
|
-
if (!(
|
|
458
|
-
k(
|
|
455
|
+
async function p(m) {
|
|
456
|
+
const h = t.paginationByConv[m];
|
|
457
|
+
if (!(h != null && h.loaded || h != null && h.loading)) {
|
|
458
|
+
k(m, { nextCursor: null, loading: !0, loaded: !1 });
|
|
459
459
|
try {
|
|
460
|
-
const
|
|
460
|
+
const g = await e.listMessages(m, {
|
|
461
461
|
limit: l
|
|
462
|
-
}), d = (
|
|
462
|
+
}), d = (g == null ? void 0 : g.messages) ?? [], f = t.messagesByConv[m] || [], _ = /* @__PURE__ */ new Set();
|
|
463
463
|
for (const w of d)
|
|
464
464
|
(w == null ? void 0 : w.id) != null && _.add(`id:${String(w.id)}`), w != null && w.client_msg_id && _.add(`c:${w.client_msg_id}`);
|
|
465
465
|
const y = f.filter((w) => !((w == null ? void 0 : w.id) != null && _.has(`id:${String(w.id)}`) || w != null && w.client_msg_id && _.has(`c:${w.client_msg_id}`)));
|
|
466
|
-
t.messagesByConv[
|
|
466
|
+
t.messagesByConv[m] = [...d, ...y].sort(
|
|
467
467
|
ce
|
|
468
|
-
), k(
|
|
469
|
-
nextCursor: (
|
|
468
|
+
), k(m, {
|
|
469
|
+
nextCursor: (g == null ? void 0 : g.next_cursor) ?? null,
|
|
470
470
|
loading: !1,
|
|
471
471
|
loaded: !0
|
|
472
472
|
});
|
|
473
|
-
} catch (
|
|
474
|
-
console.error("[store] openConversation failed",
|
|
473
|
+
} catch (g) {
|
|
474
|
+
console.error("[store] openConversation failed", g), k(m, {
|
|
475
475
|
nextCursor: null,
|
|
476
476
|
loading: !1,
|
|
477
477
|
loaded: !1
|
|
@@ -479,83 +479,83 @@ function Xe(e) {
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
async function C(
|
|
482
|
+
async function C(m) {
|
|
483
483
|
var f;
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
const d = (f = (t.messagesByConv[
|
|
484
|
+
const h = t.paginationByConv[m];
|
|
485
|
+
if (!h || h.loading || !h.nextCursor) return;
|
|
486
|
+
const d = (f = (t.messagesByConv[m] || []).find((_) => _ == null ? void 0 : _.created_at)) == null ? void 0 : f.created_at;
|
|
487
487
|
if (d) {
|
|
488
|
-
k(
|
|
488
|
+
k(m, { ...h, loading: !0 });
|
|
489
489
|
try {
|
|
490
|
-
const _ = await e.listMessages(
|
|
490
|
+
const _ = await e.listMessages(m, {
|
|
491
491
|
before: d,
|
|
492
492
|
limit: l
|
|
493
|
-
}), y = (_ == null ? void 0 : _.messages) ?? [], w = t.messagesByConv[
|
|
493
|
+
}), y = (_ == null ? void 0 : _.messages) ?? [], w = t.messagesByConv[m] || [], S = /* @__PURE__ */ new Set();
|
|
494
494
|
for (const O of w)
|
|
495
495
|
(O == null ? void 0 : O.id) != null && S.add(`id:${String(O.id)}`), O != null && O.client_msg_id && S.add(`c:${O.client_msg_id}`);
|
|
496
496
|
const F = y.filter((O) => !((O == null ? void 0 : O.id) != null && S.has(`id:${String(O.id)}`) || O != null && O.client_msg_id && S.has(`c:${O.client_msg_id}`)));
|
|
497
|
-
t.messagesByConv[
|
|
497
|
+
t.messagesByConv[m] = [...F, ...w], k(m, {
|
|
498
498
|
nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
|
|
499
499
|
loading: !1,
|
|
500
500
|
loaded: !0
|
|
501
501
|
});
|
|
502
502
|
} catch (_) {
|
|
503
|
-
console.error("[store] loadMore failed", _), k(
|
|
503
|
+
console.error("[store] loadMore failed", _), k(m, { ...h, loading: !1 });
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
function k(
|
|
508
|
-
t.paginationByConv = { ...t.paginationByConv, [
|
|
507
|
+
function k(m, h) {
|
|
508
|
+
t.paginationByConv = { ...t.paginationByConv, [m]: h };
|
|
509
509
|
}
|
|
510
|
-
async function T(
|
|
511
|
-
const
|
|
512
|
-
d !== -1 && (t.conversations[d] =
|
|
510
|
+
async function T(m, h) {
|
|
511
|
+
const g = await e.patchConversation(m, h), d = t.conversations.findIndex((f) => f.id === m);
|
|
512
|
+
d !== -1 && (t.conversations[d] = g);
|
|
513
513
|
}
|
|
514
|
-
async function E(
|
|
515
|
-
if (!
|
|
516
|
-
const
|
|
517
|
-
let
|
|
518
|
-
for (const d of
|
|
519
|
-
d != null && d.created_at && d.created_at >
|
|
514
|
+
async function E(m) {
|
|
515
|
+
if (!m) return [];
|
|
516
|
+
const h = t.messagesByConv[m] || [];
|
|
517
|
+
let g = "";
|
|
518
|
+
for (const d of h)
|
|
519
|
+
d != null && d.created_at && d.created_at > g && (g = d.created_at);
|
|
520
520
|
try {
|
|
521
521
|
const d = await e.listMessages(
|
|
522
|
-
|
|
523
|
-
|
|
522
|
+
m,
|
|
523
|
+
g ? { since: g } : {}
|
|
524
524
|
), f = (d == null ? void 0 : d.messages) || [];
|
|
525
525
|
if (!f.length) return [];
|
|
526
526
|
const _ = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set();
|
|
527
|
-
for (const S of
|
|
527
|
+
for (const S of h)
|
|
528
528
|
(S == null ? void 0 : S.id) != null && _.add(String(S.id)), S != null && S.client_msg_id && y.add(S.client_msg_id);
|
|
529
529
|
const w = [];
|
|
530
530
|
for (const S of f) {
|
|
531
531
|
const F = (S == null ? void 0 : S.id) != null && _.has(String(S.id)) || (S == null ? void 0 : S.client_msg_id) && y.has(S.client_msg_id);
|
|
532
|
-
Y(
|
|
532
|
+
Y(m, S), F || w.push(S);
|
|
533
533
|
}
|
|
534
534
|
return w;
|
|
535
535
|
} catch (d) {
|
|
536
536
|
return console.error("[store] fetchSinceLast failed", d), [];
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
async function A(
|
|
540
|
-
if (!(!
|
|
539
|
+
async function A(m, h) {
|
|
540
|
+
if (!(!m || h == null))
|
|
541
541
|
try {
|
|
542
|
-
const
|
|
542
|
+
const g = await e.markConversationRead(m, h), d = (g == null ? void 0 : g.last_read_message_id) ?? h, f = t.conversations.findIndex((_) => (_ == null ? void 0 : _.id) === m);
|
|
543
543
|
f !== -1 && (t.conversations[f] = {
|
|
544
544
|
...t.conversations[f],
|
|
545
545
|
last_read_message_id: d
|
|
546
546
|
});
|
|
547
|
-
} catch (
|
|
548
|
-
console.error("[store] markConversationRead failed",
|
|
547
|
+
} catch (g) {
|
|
548
|
+
console.error("[store] markConversationRead failed", g);
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
async function H(
|
|
551
|
+
async function H(m, h, { attachments: g, metadata: d } = {}) {
|
|
552
552
|
var F;
|
|
553
|
-
const f = (
|
|
554
|
-
if (!
|
|
555
|
-
const y = Qe(), w = se(
|
|
553
|
+
const f = (h || "").trim(), _ = Array.isArray(g) && g.length > 0;
|
|
554
|
+
if (!m || !f && !_) return;
|
|
555
|
+
const y = Qe(), w = se(m), S = {
|
|
556
556
|
id: y,
|
|
557
557
|
client_msg_id: y,
|
|
558
|
-
conversation_id:
|
|
558
|
+
conversation_id: m,
|
|
559
559
|
type: "content",
|
|
560
560
|
text_md: f,
|
|
561
561
|
author: {
|
|
@@ -565,80 +565,80 @@ function Xe(e) {
|
|
|
565
565
|
created_at: w,
|
|
566
566
|
// Local-only flag — UI may render dimmed until the SSE echo lands.
|
|
567
567
|
_pending: !0,
|
|
568
|
-
..._ ? { payload: { type: "content", attachments:
|
|
568
|
+
..._ ? { payload: { type: "content", attachments: g } } : {},
|
|
569
569
|
...d && typeof d == "object" ? { metadata: d } : {}
|
|
570
570
|
};
|
|
571
|
-
Y(
|
|
571
|
+
Y(m, S);
|
|
572
572
|
try {
|
|
573
|
-
await e.postMessage(
|
|
573
|
+
await e.postMessage(m, {
|
|
574
574
|
client_msg_id: y,
|
|
575
575
|
text_md: f,
|
|
576
576
|
created_at: w,
|
|
577
|
-
..._ ? { attachments:
|
|
577
|
+
..._ ? { attachments: g } : {},
|
|
578
578
|
...d && typeof d == "object" ? { metadata: d } : {}
|
|
579
579
|
});
|
|
580
580
|
} catch (O) {
|
|
581
|
-
console.error("[store] send failed", O), z(
|
|
581
|
+
console.error("[store] send failed", O), z(m, y, {
|
|
582
582
|
_failed: !0,
|
|
583
583
|
_pending: !1
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
async function M(
|
|
588
|
-
|
|
587
|
+
async function M(m, h, g) {
|
|
588
|
+
m != null && (t.awaitingCallback[m] = !0);
|
|
589
589
|
try {
|
|
590
|
-
await e.postCallback(
|
|
590
|
+
await e.postCallback(m, h, g);
|
|
591
591
|
} catch (d) {
|
|
592
|
-
console.error("[store] callback failed", d),
|
|
592
|
+
console.error("[store] callback failed", d), m != null && delete t.awaitingCallback[m];
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
const
|
|
596
|
-
async function N(
|
|
597
|
-
if (!
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
600
|
-
const
|
|
601
|
-
if (!
|
|
595
|
+
const P = /* @__PURE__ */ new Map();
|
|
596
|
+
async function N(m) {
|
|
597
|
+
if (!m) return null;
|
|
598
|
+
const h = P.get(m);
|
|
599
|
+
if (h != null && h.url) {
|
|
600
|
+
const g = h.expires_at ? Date.parse(h.expires_at) : 0;
|
|
601
|
+
if (!g || g - Date.now() > 6e4) return h.url;
|
|
602
602
|
}
|
|
603
603
|
try {
|
|
604
|
-
const
|
|
605
|
-
if (
|
|
606
|
-
return
|
|
607
|
-
url:
|
|
608
|
-
expires_at:
|
|
609
|
-
}),
|
|
610
|
-
} catch (
|
|
611
|
-
console.error("[store] sign attachment failed",
|
|
604
|
+
const g = await e.signAttachment(m);
|
|
605
|
+
if (g != null && g.signed_url)
|
|
606
|
+
return P.set(m, {
|
|
607
|
+
url: g.signed_url,
|
|
608
|
+
expires_at: g.expires_at
|
|
609
|
+
}), g.signed_url;
|
|
610
|
+
} catch (g) {
|
|
611
|
+
console.error("[store] sign attachment failed", g);
|
|
612
612
|
}
|
|
613
613
|
return null;
|
|
614
614
|
}
|
|
615
|
-
async function $(
|
|
616
|
-
const d = t.conversations.find((y) => y.id ===
|
|
615
|
+
async function $(m, { rating: h, comment: g } = {}) {
|
|
616
|
+
const d = t.conversations.find((y) => y.id === m), _ = {
|
|
617
617
|
...(d == null ? void 0 : d.metadata) || {},
|
|
618
618
|
feedback: {
|
|
619
|
-
rating:
|
|
620
|
-
comment:
|
|
619
|
+
rating: h,
|
|
620
|
+
comment: g || null,
|
|
621
621
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
|
-
await T(
|
|
624
|
+
await T(m, { metadata: _ });
|
|
625
625
|
}
|
|
626
|
-
function W(
|
|
627
|
-
var
|
|
628
|
-
const
|
|
629
|
-
for (let f =
|
|
630
|
-
const _ =
|
|
631
|
-
if ((_ == null ? void 0 : _.type) === "action" && ((
|
|
626
|
+
function W(m) {
|
|
627
|
+
var g, d;
|
|
628
|
+
const h = t.messagesByConv[m] || [];
|
|
629
|
+
for (let f = h.length - 1; f >= 0; f--) {
|
|
630
|
+
const _ = h[f];
|
|
631
|
+
if ((_ == null ? void 0 : _.type) === "action" && ((g = _ == null ? void 0 : _.payload) == null ? void 0 : g.type) === "action" && ((d = _ == null ? void 0 : _.payload) == null ? void 0 : d.state) === "pending" && Array.isArray(_ == null ? void 0 : _.callbacks) && _.callbacks.length > 0 && !t.awaitingCallback[_.id])
|
|
632
632
|
return _;
|
|
633
633
|
}
|
|
634
634
|
return null;
|
|
635
635
|
}
|
|
636
|
-
function te(
|
|
637
|
-
var
|
|
638
|
-
const
|
|
639
|
-
for (let _ =
|
|
640
|
-
const y =
|
|
641
|
-
if (((
|
|
636
|
+
function te(m) {
|
|
637
|
+
var g, d, f;
|
|
638
|
+
const h = t.messagesByConv[m] || [];
|
|
639
|
+
for (let _ = h.length - 1; _ >= 0; _--) {
|
|
640
|
+
const y = h[_];
|
|
641
|
+
if (((g = y == null ? void 0 : y.author) == null ? void 0 : g.type) === "user" || (y == null ? void 0 : y.type) === "action" && ((d = y == null ? void 0 : y.payload) == null ? void 0 : d.state) === "pending")
|
|
642
642
|
return null;
|
|
643
643
|
const w = (f = y == null ? void 0 : y.metadata) == null ? void 0 : f.form;
|
|
644
644
|
if (w && Array.isArray(w.fields) && w.fields.length > 0)
|
|
@@ -646,20 +646,20 @@ function Xe(e) {
|
|
|
646
646
|
}
|
|
647
647
|
return null;
|
|
648
648
|
}
|
|
649
|
-
function ne(
|
|
650
|
-
const
|
|
651
|
-
if (!
|
|
652
|
-
const
|
|
653
|
-
if (
|
|
654
|
-
const d =
|
|
655
|
-
return { id: d, payload: { name:
|
|
649
|
+
function ne(m) {
|
|
650
|
+
const h = t.runningActionsByConv[m];
|
|
651
|
+
if (!h) return null;
|
|
652
|
+
const g = Object.keys(h);
|
|
653
|
+
if (g.length === 0) return null;
|
|
654
|
+
const d = g[0];
|
|
655
|
+
return { id: d, payload: { name: h[d] } };
|
|
656
656
|
}
|
|
657
|
-
function G(
|
|
658
|
-
var
|
|
659
|
-
const
|
|
660
|
-
for (let y =
|
|
661
|
-
const w =
|
|
662
|
-
if (((
|
|
657
|
+
function G(m) {
|
|
658
|
+
var g, d, f, _;
|
|
659
|
+
const h = t.messagesByConv[m] || [];
|
|
660
|
+
for (let y = h.length - 1; y >= 0; y--) {
|
|
661
|
+
const w = h[y];
|
|
662
|
+
if (((g = w == null ? void 0 : w.author) == null ? void 0 : g.type) === "user") return [];
|
|
663
663
|
if ((w == null ? void 0 : w.type) === "action" && ((d = w == null ? void 0 : w.payload) == null ? void 0 : d.state) === "pending")
|
|
664
664
|
return [];
|
|
665
665
|
if (((f = w == null ? void 0 : w.author) == null ? void 0 : f.type) !== "agent_ia") continue;
|
|
@@ -680,60 +680,60 @@ function Xe(e) {
|
|
|
680
680
|
}
|
|
681
681
|
return [];
|
|
682
682
|
}
|
|
683
|
-
function Y(
|
|
683
|
+
function Y(m, h) {
|
|
684
684
|
var _;
|
|
685
|
-
const
|
|
685
|
+
const g = t.messagesByConv[m] || [];
|
|
686
686
|
let d = -1;
|
|
687
|
-
|
|
688
|
-
(y) => (y == null ? void 0 : y.client_msg_id) && y.client_msg_id ===
|
|
689
|
-
)), d === -1 && (
|
|
687
|
+
h != null && h.client_msg_id && (d = g.findIndex(
|
|
688
|
+
(y) => (y == null ? void 0 : y.client_msg_id) && y.client_msg_id === h.client_msg_id
|
|
689
|
+
)), d === -1 && (h == null ? void 0 : h.id) !== void 0 && (h == null ? void 0 : h.id) !== null && (d = g.findIndex((y) => Q(y == null ? void 0 : y.id, h.id)));
|
|
690
690
|
let f;
|
|
691
|
-
d === -1 ? f = [...
|
|
692
|
-
...
|
|
693
|
-
...
|
|
691
|
+
d === -1 ? f = [...g, h].sort(ce) : (f = g.slice(), f[d] = {
|
|
692
|
+
...g[d],
|
|
693
|
+
...h,
|
|
694
694
|
_pending: !1,
|
|
695
695
|
_failed: !1
|
|
696
|
-
}), t.messagesByConv[
|
|
696
|
+
}), t.messagesByConv[m] = f, (h == null ? void 0 : h.type) === "action" && ((_ = h == null ? void 0 : h.payload) != null && _.state) && h.payload.state !== "pending" && (h == null ? void 0 : h.id) != null && t.awaitingCallback[h.id] && delete t.awaitingCallback[h.id];
|
|
697
697
|
}
|
|
698
|
-
function Q(
|
|
699
|
-
return
|
|
698
|
+
function Q(m, h) {
|
|
699
|
+
return m === h ? !0 : m == null || h == null ? !1 : String(m) === String(h);
|
|
700
700
|
}
|
|
701
|
-
function z(
|
|
702
|
-
const d = t.messagesByConv[
|
|
701
|
+
function z(m, h, g) {
|
|
702
|
+
const d = t.messagesByConv[m];
|
|
703
703
|
if (!d) return;
|
|
704
|
-
const f = d.findIndex((y) => y.id ===
|
|
704
|
+
const f = d.findIndex((y) => y.id === h);
|
|
705
705
|
if (f === -1) return;
|
|
706
706
|
const _ = d.slice();
|
|
707
|
-
_[f] = { ...d[f], ...
|
|
707
|
+
_[f] = { ...d[f], ...g }, t.messagesByConv[m] = _;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
const
|
|
711
|
-
if (
|
|
712
|
-
const d = t.conversations[
|
|
713
|
-
if (
|
|
709
|
+
function he(m, h) {
|
|
710
|
+
const g = t.conversations.findIndex((f) => f.id === m);
|
|
711
|
+
if (g === -1) return;
|
|
712
|
+
const d = t.conversations[g];
|
|
713
|
+
if (h && (!d.last_message_at || h > d.last_message_at)) {
|
|
714
714
|
const f = t.conversations.slice();
|
|
715
|
-
f[
|
|
715
|
+
f[g] = { ...d, last_message_at: h }, f.sort(
|
|
716
716
|
(_, y) => (y.last_message_at || "").localeCompare(_.last_message_at || "")
|
|
717
717
|
), t.conversations = f;
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
|
-
function ce(
|
|
721
|
-
return (
|
|
720
|
+
function ce(m, h) {
|
|
721
|
+
return (m.created_at || "").localeCompare(h.created_at || "");
|
|
722
722
|
}
|
|
723
|
-
function de(
|
|
724
|
-
if (!
|
|
725
|
-
const
|
|
726
|
-
for (const [d, f] of Object.entries(
|
|
727
|
-
f !== void 0 && (d === "name" || d === "email" ? f != null && String(f).trim() !== "" && (
|
|
728
|
-
return Object.keys(
|
|
723
|
+
function de(m) {
|
|
724
|
+
if (!m || typeof m != "object") return null;
|
|
725
|
+
const h = {}, g = {};
|
|
726
|
+
for (const [d, f] of Object.entries(m))
|
|
727
|
+
f !== void 0 && (d === "name" || d === "email" ? f != null && String(f).trim() !== "" && (h[d] = f) : (d === "values" || d === "metadata") && f && typeof f == "object" ? Object.assign(g, f) : g[d] = f);
|
|
728
|
+
return Object.keys(g).length && (h.values = g), Object.keys(h).length ? h : null;
|
|
729
729
|
}
|
|
730
|
-
function se(
|
|
731
|
-
const
|
|
732
|
-
let
|
|
733
|
-
for (const _ of
|
|
734
|
-
_ != null && _.created_at && _.created_at >
|
|
730
|
+
function se(m) {
|
|
731
|
+
const h = t.messagesByConv[m] || [];
|
|
732
|
+
let g = "";
|
|
733
|
+
for (const _ of h)
|
|
734
|
+
_ != null && _.created_at && _.created_at > g && (g = _.created_at);
|
|
735
735
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
736
|
-
return !
|
|
736
|
+
return !g || d > g ? d : new Date(Date.parse(g) + 1).toISOString();
|
|
737
737
|
}
|
|
738
738
|
return {
|
|
739
739
|
state: t,
|
|
@@ -741,7 +741,7 @@ function Xe(e) {
|
|
|
741
741
|
destroy: r,
|
|
742
742
|
applyCustomer: s,
|
|
743
743
|
createConversation: a,
|
|
744
|
-
openConversation:
|
|
744
|
+
openConversation: p,
|
|
745
745
|
loadMore: C,
|
|
746
746
|
fetchSinceLast: E,
|
|
747
747
|
patchConversation: T,
|
|
@@ -758,7 +758,7 @@ function Xe(e) {
|
|
|
758
758
|
setPanelOpen: e.setPanelOpen
|
|
759
759
|
};
|
|
760
760
|
}
|
|
761
|
-
const
|
|
761
|
+
const D = {
|
|
762
762
|
w: "#ffffff",
|
|
763
763
|
g50: "#F9F9F7",
|
|
764
764
|
g100: "#F2F1EE",
|
|
@@ -788,7 +788,7 @@ function xe(e = "") {
|
|
|
788
788
|
function Oe(e = "") {
|
|
789
789
|
return e.split(" ").map((t) => t[0] || "").join("").toUpperCase().slice(0, 2);
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Ie(e = /* @__PURE__ */ new Date(), t = "fr-FR") {
|
|
792
792
|
return e.toLocaleTimeString(t, { hour: "2-digit", minute: "2-digit" });
|
|
793
793
|
}
|
|
794
794
|
const Je = `
|
|
@@ -797,21 +797,21 @@ const Je = `
|
|
|
797
797
|
.wm-root {
|
|
798
798
|
--wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
799
799
|
--wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
800
|
-
--wm-w: ${
|
|
801
|
-
--wm-g50: ${
|
|
802
|
-
--wm-g100: ${
|
|
803
|
-
--wm-g150: ${
|
|
804
|
-
--wm-g200: ${
|
|
805
|
-
--wm-g300: ${
|
|
806
|
-
--wm-g400: ${
|
|
807
|
-
--wm-g500: ${
|
|
808
|
-
--wm-g700: ${
|
|
809
|
-
--wm-g900: ${
|
|
810
|
-
--wm-a: ${
|
|
811
|
-
--wm-al: ${
|
|
812
|
-
--wm-green: ${
|
|
813
|
-
--wm-red: ${
|
|
814
|
-
--wm-redBg: ${
|
|
800
|
+
--wm-w: ${D.w};
|
|
801
|
+
--wm-g50: ${D.g50};
|
|
802
|
+
--wm-g100: ${D.g100};
|
|
803
|
+
--wm-g150: ${D.g150};
|
|
804
|
+
--wm-g200: ${D.g200};
|
|
805
|
+
--wm-g300: ${D.g300};
|
|
806
|
+
--wm-g400: ${D.g400};
|
|
807
|
+
--wm-g500: ${D.g500};
|
|
808
|
+
--wm-g700: ${D.g700};
|
|
809
|
+
--wm-g900: ${D.g900};
|
|
810
|
+
--wm-a: ${D.accent};
|
|
811
|
+
--wm-al: ${D.accentLight};
|
|
812
|
+
--wm-green: ${D.green};
|
|
813
|
+
--wm-red: ${D.red};
|
|
814
|
+
--wm-redBg: ${D.redBg};
|
|
815
815
|
--wm-sh1: 0 1px 3px rgba(0,0,0,.06);
|
|
816
816
|
--wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
|
|
817
817
|
--wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
|
|
@@ -1079,21 +1079,21 @@ I reply within seconds.`,
|
|
|
1079
1079
|
"export.createdOn": "Created on: {date}"
|
|
1080
1080
|
}
|
|
1081
1081
|
};
|
|
1082
|
-
function
|
|
1082
|
+
function pe(e) {
|
|
1083
1083
|
if (typeof e != "string") return ie;
|
|
1084
1084
|
const t = e.trim().toLowerCase().slice(0, 2);
|
|
1085
1085
|
return et.includes(t) ? t : ie;
|
|
1086
1086
|
}
|
|
1087
1087
|
function oe(e) {
|
|
1088
|
-
return we[
|
|
1088
|
+
return we[pe(e)] || we[ie];
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const t =
|
|
1090
|
+
function U(e) {
|
|
1091
|
+
const t = pe(e), n = _e[t] || _e[ie], i = _e[ie];
|
|
1092
1092
|
return function(s, a) {
|
|
1093
1093
|
let l = n[s];
|
|
1094
1094
|
return l == null && (l = i[s]), l == null ? s : (a && (l = l.replace(
|
|
1095
1095
|
/\{(\w+)\}/g,
|
|
1096
|
-
(
|
|
1096
|
+
(p, C) => a[C] != null ? String(a[C]) : p
|
|
1097
1097
|
)), l);
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
@@ -1102,17 +1102,17 @@ function ke(e, t) {
|
|
|
1102
1102
|
const n = e.options.find((i) => (i == null ? void 0 : i.value) === t);
|
|
1103
1103
|
return (n == null ? void 0 : n.label) || t;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function Le(e, t, n) {
|
|
1106
1106
|
return Array.isArray(t) ? t.map((i) => ke(e, String(i))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : ke(e, String(t));
|
|
1107
1107
|
}
|
|
1108
|
-
function tt(e, t, n =
|
|
1108
|
+
function tt(e, t, n = U()) {
|
|
1109
1109
|
if (!e || !t) return "";
|
|
1110
1110
|
const i = Array.isArray(e.fields) ? e.fields : [], r = [];
|
|
1111
1111
|
for (const s of i) {
|
|
1112
1112
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
1113
1113
|
const a = t[s.key];
|
|
1114
1114
|
if (a == null || a === "") continue;
|
|
1115
|
-
const l =
|
|
1115
|
+
const l = Le(s, a, n);
|
|
1116
1116
|
l && r.push(`${s.label} :
|
|
1117
1117
|
${l}`);
|
|
1118
1118
|
}
|
|
@@ -1120,17 +1120,17 @@ ${l}`);
|
|
|
1120
1120
|
|
|
1121
1121
|
`);
|
|
1122
1122
|
}
|
|
1123
|
-
function nt(e, t, n =
|
|
1123
|
+
function nt(e, t, n = U()) {
|
|
1124
1124
|
const i = [], r = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
1125
1125
|
for (const s of r) {
|
|
1126
1126
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
1127
1127
|
const a = t == null ? void 0 : t[s.key];
|
|
1128
1128
|
if (a == null || a === "") continue;
|
|
1129
|
-
const l =
|
|
1129
|
+
const l = Le(s, a, n);
|
|
1130
1130
|
if (!l) continue;
|
|
1131
|
-
const
|
|
1131
|
+
const p = s.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
|
|
1132
1132
|
`));
|
|
1133
|
-
i.push({ label: s.label, value: l, multiline:
|
|
1133
|
+
i.push({ label: s.label, value: l, multiline: p });
|
|
1134
1134
|
}
|
|
1135
1135
|
return {
|
|
1136
1136
|
kind: "form_response",
|
|
@@ -1164,8 +1164,8 @@ function st(e, t) {
|
|
|
1164
1164
|
const l = typeof a.text_md == "string" ? a.text_md.trim() : "";
|
|
1165
1165
|
if (l)
|
|
1166
1166
|
return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
|
|
1167
|
-
const
|
|
1168
|
-
if (Array.isArray(
|
|
1167
|
+
const p = (i = a.payload) == null ? void 0 : i.attachments;
|
|
1168
|
+
if (Array.isArray(p) && p.length) return "📎 Pièce jointe";
|
|
1169
1169
|
}
|
|
1170
1170
|
return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((r = e == null ? void 0 : e.metadata) == null ? void 0 : r.last_preview) || "";
|
|
1171
1171
|
}
|
|
@@ -1184,13 +1184,13 @@ function it(e, t, n, i) {
|
|
|
1184
1184
|
if (!s) continue;
|
|
1185
1185
|
const a = (s.text_md || "").trim();
|
|
1186
1186
|
if (!a) continue;
|
|
1187
|
-
const l = rt(s.author, n),
|
|
1188
|
-
r.push(`[${
|
|
1187
|
+
const l = rt(s.author, n), p = s.created_at ? new Date(s.created_at).toLocaleString(i) : "";
|
|
1188
|
+
r.push(`[${p}] ${l} :`), r.push(a), r.push("");
|
|
1189
1189
|
}
|
|
1190
1190
|
return r.join(`
|
|
1191
1191
|
`);
|
|
1192
1192
|
}
|
|
1193
|
-
function at(e, t, n =
|
|
1193
|
+
function at(e, t, n = U(), i) {
|
|
1194
1194
|
if (!e) return;
|
|
1195
1195
|
const r = it(e, t || [], n, oe(i)), s = new Blob([r], { type: "text/plain;charset=utf-8" });
|
|
1196
1196
|
try {
|
|
@@ -1336,29 +1336,29 @@ const ot = {
|
|
|
1336
1336
|
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
1337
1337
|
const n = t == null ? void 0 : t.author, i = !n || n.type === "agent_ia", s = ((n == null ? void 0 : n.name) || (i ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), a = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = a ? a.slice(0, 140) : this.t("notification.youHaveNewMessage");
|
|
1338
1338
|
try {
|
|
1339
|
-
const
|
|
1339
|
+
const p = new Notification(s, {
|
|
1340
1340
|
body: l,
|
|
1341
1341
|
tag: `wm-${e}`,
|
|
1342
1342
|
renotify: !1,
|
|
1343
1343
|
silent: !0
|
|
1344
1344
|
});
|
|
1345
|
-
|
|
1345
|
+
p.onclick = () => {
|
|
1346
1346
|
try {
|
|
1347
1347
|
window.focus();
|
|
1348
1348
|
} catch {
|
|
1349
1349
|
}
|
|
1350
1350
|
this.draftConv = null, this.showOnboarding = !1, this.activeConvId = e, this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
|
|
1351
1351
|
try {
|
|
1352
|
-
|
|
1352
|
+
p.close();
|
|
1353
1353
|
} catch {
|
|
1354
1354
|
}
|
|
1355
1355
|
};
|
|
1356
|
-
} catch (
|
|
1357
|
-
console.warn("[ww-messenger] notification failed",
|
|
1356
|
+
} catch (p) {
|
|
1357
|
+
console.warn("[ww-messenger] notification failed", p);
|
|
1358
1358
|
}
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
-
}, lt = 450, ct = 50, dt = 900, ut = 12e3,
|
|
1361
|
+
}, lt = 450, ct = 50, dt = 900, ut = 12e3, mt = 300, ht = {
|
|
1362
1362
|
data() {
|
|
1363
1363
|
return {
|
|
1364
1364
|
// Map: messageId → ms timestamp once shown.
|
|
@@ -1442,8 +1442,8 @@ const ot = {
|
|
|
1442
1442
|
if (!(a != null && a.id)) continue;
|
|
1443
1443
|
const l = a.last_message_at || "";
|
|
1444
1444
|
if (!l) continue;
|
|
1445
|
-
const
|
|
1446
|
-
l >
|
|
1445
|
+
const p = n.get(a.id) || "";
|
|
1446
|
+
l > p && i.push(a.id);
|
|
1447
1447
|
}
|
|
1448
1448
|
this._liveRevealConvSnapshot = new Map(
|
|
1449
1449
|
t.map((a) => [a.id, (a == null ? void 0 : a.last_message_at) || ""])
|
|
@@ -1452,7 +1452,7 @@ const ot = {
|
|
|
1452
1452
|
try {
|
|
1453
1453
|
const l = await ((s = (r = this.store).fetchSinceLast) == null ? void 0 : s.call(r, a));
|
|
1454
1454
|
if (!Array.isArray(l)) continue;
|
|
1455
|
-
for (const
|
|
1455
|
+
for (const p of l) this.paceLiveMessage(p, a);
|
|
1456
1456
|
} catch (l) {
|
|
1457
1457
|
console.error(
|
|
1458
1458
|
"[ww-messenger] activity delta fetch failed",
|
|
@@ -1471,11 +1471,11 @@ const ot = {
|
|
|
1471
1471
|
Math.max(dt, i * ct)
|
|
1472
1472
|
), a = Math.max(
|
|
1473
1473
|
n + lt,
|
|
1474
|
-
this.nextRevealAt +
|
|
1474
|
+
this.nextRevealAt + mt
|
|
1475
1475
|
) + r;
|
|
1476
1476
|
this.nextRevealAt = a;
|
|
1477
|
-
const l = Math.max(0, a - n),
|
|
1478
|
-
this.revealedAt = { ...this.revealedAt, [
|
|
1477
|
+
const l = Math.max(0, a - n), p = e.id, C = setTimeout(() => {
|
|
1478
|
+
this.revealedAt = { ...this.revealedAt, [p]: Date.now() }, this.revealTimers = this.revealTimers.filter((k) => k !== C), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
|
|
1479
1479
|
}, l);
|
|
1480
1480
|
this.revealTimers.push(C);
|
|
1481
1481
|
},
|
|
@@ -1499,8 +1499,8 @@ const ot = {
|
|
|
1499
1499
|
i[s.id] = n;
|
|
1500
1500
|
continue;
|
|
1501
1501
|
}
|
|
1502
|
-
const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0,
|
|
1503
|
-
if (!l && !
|
|
1502
|
+
const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, p = Array.isArray((r = s == null ? void 0 : s.payload) == null ? void 0 : r.attachments) && s.payload.attachments.length > 0;
|
|
1503
|
+
if (!l && !p) {
|
|
1504
1504
|
i[s.id] = n;
|
|
1505
1505
|
continue;
|
|
1506
1506
|
}
|
|
@@ -1563,7 +1563,7 @@ const ot = {
|
|
|
1563
1563
|
}, e);
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
|
-
}, _t = 300,
|
|
1566
|
+
}, _t = 300, gt = {
|
|
1567
1567
|
data() {
|
|
1568
1568
|
return {
|
|
1569
1569
|
// Numeric message id snapshot frozen the moment the user
|
|
@@ -1594,7 +1594,7 @@ const ot = {
|
|
|
1594
1594
|
markConvRead(e) {
|
|
1595
1595
|
var s, a;
|
|
1596
1596
|
if (!(e != null && e.id) || e._draft || !this.store) return;
|
|
1597
|
-
const t = ((a = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : a[e.id]) || [], n =
|
|
1597
|
+
const t = ((a = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : a[e.id]) || [], n = pt(t);
|
|
1598
1598
|
if (n == null) return;
|
|
1599
1599
|
const i = J(e.last_read_message_id), r = J(n);
|
|
1600
1600
|
r != null && (i != null && r <= i || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
|
|
@@ -1607,7 +1607,7 @@ const ot = {
|
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
1609
1609
|
};
|
|
1610
|
-
function
|
|
1610
|
+
function pt(e) {
|
|
1611
1611
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
1612
1612
|
const n = e[t];
|
|
1613
1613
|
if (!(!n || n._pending) && J(n.id) != null)
|
|
@@ -1667,7 +1667,7 @@ const Be = /* @__PURE__ */ B(vt, [["render", bt], ["__scopeId", "data-v-14e10c0d
|
|
|
1667
1667
|
inject: {
|
|
1668
1668
|
// Translator shared by the Messenger shell; French fallback when
|
|
1669
1669
|
// the component is used standalone.
|
|
1670
|
-
t: { default: () =>
|
|
1670
|
+
t: { default: () => U() }
|
|
1671
1671
|
},
|
|
1672
1672
|
props: {
|
|
1673
1673
|
// Nombre de conversations non lues — pilote la pastille.
|
|
@@ -1687,22 +1687,22 @@ const Be = /* @__PURE__ */ B(vt, [["render", bt], ["__scopeId", "data-v-14e10c0d
|
|
|
1687
1687
|
return this.peeks.slice(0, wt).reverse();
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
1690
|
-
}, Ct = { class: "wm-launcherWrap" }, At = ["aria-label", "onClick", "onKeydown"], St = ["aria-label", "onClick"], Mt = { class: "wm-peek__avatar" }, Tt = ["aria-label"], xt = { class: "wm-peek__body" }, Ot = { class: "wm-peek__head" },
|
|
1690
|
+
}, Ct = { class: "wm-launcherWrap" }, At = ["aria-label", "onClick", "onKeydown"], St = ["aria-label", "onClick"], Mt = { class: "wm-peek__avatar" }, Tt = ["aria-label"], xt = { class: "wm-peek__body" }, Ot = { class: "wm-peek__head" }, It = { class: "wm-peek__name" }, Lt = { class: "wm-peek__action" }, Bt = { class: "wm-peek__text" }, Et = ["onClick"], Rt = ["aria-label"], Nt = ["aria-label"];
|
|
1691
1691
|
function Ft(e, t, n, i, r, s) {
|
|
1692
|
-
const a =
|
|
1692
|
+
const a = L("HumanAvatar");
|
|
1693
1693
|
return c(), u("div", Ct, [
|
|
1694
1694
|
q(je, { name: "wm-peek" }, {
|
|
1695
|
-
default:
|
|
1695
|
+
default: Ue(() => [
|
|
1696
1696
|
s.visiblePeeks.length ? (c(), u("div", {
|
|
1697
1697
|
key: 0,
|
|
1698
1698
|
class: x(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
|
|
1699
1699
|
}, [
|
|
1700
|
-
(c(!0), u(
|
|
1700
|
+
(c(!0), u(I, null, j(s.visiblePeeks, (l, p) => (c(), u("div", {
|
|
1701
1701
|
key: l.convId,
|
|
1702
1702
|
class: "wm-peek",
|
|
1703
1703
|
style: K({
|
|
1704
|
-
"--depth": s.visiblePeeks.length - 1 -
|
|
1705
|
-
zIndex:
|
|
1704
|
+
"--depth": s.visiblePeeks.length - 1 - p,
|
|
1705
|
+
zIndex: p + 1
|
|
1706
1706
|
}),
|
|
1707
1707
|
role: "button",
|
|
1708
1708
|
tabindex: "0",
|
|
@@ -1749,8 +1749,8 @@ function Ft(e, t, n, i, r, s) {
|
|
|
1749
1749
|
]),
|
|
1750
1750
|
o("div", xt, [
|
|
1751
1751
|
o("div", Ot, [
|
|
1752
|
-
o("span",
|
|
1753
|
-
o("span",
|
|
1752
|
+
o("span", It, v(l.senderName || s.t("common.agent")), 1),
|
|
1753
|
+
o("span", Lt, v(s.t("launcher.repliedToYou")), 1)
|
|
1754
1754
|
]),
|
|
1755
1755
|
o("p", Bt, v(l.preview), 1)
|
|
1756
1756
|
]),
|
|
@@ -1795,7 +1795,7 @@ function Ft(e, t, n, i, r, s) {
|
|
|
1795
1795
|
], 8, Rt)
|
|
1796
1796
|
]);
|
|
1797
1797
|
}
|
|
1798
|
-
const jt = /* @__PURE__ */ B(kt, [["render", Ft], ["__scopeId", "data-v-5193a529"]]),
|
|
1798
|
+
const jt = /* @__PURE__ */ B(kt, [["render", Ft], ["__scopeId", "data-v-5193a529"]]), Ut = {
|
|
1799
1799
|
name: "WmAIAvatar",
|
|
1800
1800
|
props: {
|
|
1801
1801
|
size: { type: Number, default: 26 },
|
|
@@ -1805,13 +1805,17 @@ const jt = /* @__PURE__ */ B(kt, [["render", Ft], ["__scopeId", "data-v-5193a529
|
|
|
1805
1805
|
// l'avatar est posé à côté de messages dans le fil. Ailleurs
|
|
1806
1806
|
// (Header, Onboarding, ApprovalCard, FormCard…) → laissé à false
|
|
1807
1807
|
// pour garder l'avatar pleinement arrondi.
|
|
1808
|
-
tail: { type: Boolean, default: !1 }
|
|
1808
|
+
tail: { type: Boolean, default: !1 },
|
|
1809
|
+
// Image distante (avatar de l'agent ou `default_icon_url` du
|
|
1810
|
+
// widget). Quand renseignée, remplace l'étoile par l'image dans
|
|
1811
|
+
// le même container arrondi.
|
|
1812
|
+
imageUrl: { type: String, default: null }
|
|
1809
1813
|
}
|
|
1810
|
-
},
|
|
1814
|
+
}, Pt = {
|
|
1811
1815
|
key: 0,
|
|
1812
1816
|
class: "wm-aiav__pulse"
|
|
1813
|
-
},
|
|
1814
|
-
function
|
|
1817
|
+
}, Dt = ["src"], $t = ["width", "height"];
|
|
1818
|
+
function Ht(e, t, n, i, r, s) {
|
|
1815
1819
|
return c(), u("div", {
|
|
1816
1820
|
class: x(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
1817
1821
|
style: K({
|
|
@@ -1820,11 +1824,19 @@ function $t(e, t, n, i, r, s) {
|
|
|
1820
1824
|
"--wm-avr": n.size * 0.32 + "px"
|
|
1821
1825
|
})
|
|
1822
1826
|
}, [
|
|
1823
|
-
n.pulse ? (c(), u("div",
|
|
1827
|
+
n.pulse ? (c(), u("div", Pt)) : b("", !0),
|
|
1824
1828
|
o("div", {
|
|
1825
|
-
class: x(["wm-aiav__inner", {
|
|
1829
|
+
class: x(["wm-aiav__inner", {
|
|
1830
|
+
"wm-aiav__inner--glow": n.pulse,
|
|
1831
|
+
"wm-aiav__inner--img": !!n.imageUrl
|
|
1832
|
+
}])
|
|
1826
1833
|
}, [
|
|
1827
|
-
(c(), u("
|
|
1834
|
+
n.imageUrl ? (c(), u("img", {
|
|
1835
|
+
key: 0,
|
|
1836
|
+
src: n.imageUrl,
|
|
1837
|
+
alt: ""
|
|
1838
|
+
}, null, 8, Dt)) : (c(), u("svg", {
|
|
1839
|
+
key: 1,
|
|
1828
1840
|
width: n.size * 0.5,
|
|
1829
1841
|
height: n.size * 0.5,
|
|
1830
1842
|
viewBox: "0 0 24 24",
|
|
@@ -1850,11 +1862,11 @@ function $t(e, t, n, i, r, s) {
|
|
|
1850
1862
|
fill: "white",
|
|
1851
1863
|
opacity: "0.38"
|
|
1852
1864
|
}, null, -1)
|
|
1853
|
-
])], 8,
|
|
1865
|
+
])], 8, $t))
|
|
1854
1866
|
], 2)
|
|
1855
1867
|
], 6);
|
|
1856
1868
|
}
|
|
1857
|
-
const le = /* @__PURE__ */ B(
|
|
1869
|
+
const le = /* @__PURE__ */ B(Ut, [["render", Ht], ["__scopeId", "data-v-99d8093a"]]), qt = {
|
|
1858
1870
|
name: "WmTeamAvatars",
|
|
1859
1871
|
props: {
|
|
1860
1872
|
members: { type: Array, default: () => [] },
|
|
@@ -1876,20 +1888,20 @@ const le = /* @__PURE__ */ B(Pt, [["render", $t], ["__scopeId", "data-v-d621a129
|
|
|
1876
1888
|
return Oe(e.name || "");
|
|
1877
1889
|
}
|
|
1878
1890
|
}
|
|
1879
|
-
},
|
|
1891
|
+
}, zt = {
|
|
1880
1892
|
key: 0,
|
|
1881
1893
|
class: "wm-team"
|
|
1882
|
-
},
|
|
1894
|
+
}, Vt = ["src", "alt"], Kt = { key: 1 }, Wt = {
|
|
1883
1895
|
key: 0,
|
|
1884
1896
|
class: "wm-team__label"
|
|
1885
1897
|
};
|
|
1886
|
-
function
|
|
1887
|
-
return s.visible ? (c(), u("div",
|
|
1898
|
+
function Gt(e, t, n, i, r, s) {
|
|
1899
|
+
return s.visible ? (c(), u("div", zt, [
|
|
1888
1900
|
o("div", {
|
|
1889
1901
|
class: "wm-team__stack",
|
|
1890
1902
|
style: K({ width: s.stackWidth + "px" })
|
|
1891
1903
|
}, [
|
|
1892
|
-
(c(!0), u(
|
|
1904
|
+
(c(!0), u(I, null, j(n.members.slice(0, 3), (a, l) => (c(), u("div", {
|
|
1893
1905
|
key: l,
|
|
1894
1906
|
class: "wm-team__pill",
|
|
1895
1907
|
style: K({
|
|
@@ -1902,19 +1914,19 @@ function Wt(e, t, n, i, r, s) {
|
|
|
1902
1914
|
key: 0,
|
|
1903
1915
|
src: a.avatar_url,
|
|
1904
1916
|
alt: a.name || ""
|
|
1905
|
-
}, null, 8,
|
|
1917
|
+
}, null, 8, Vt)) : (c(), u("span", Kt, v(s.initialsFor(a)), 1))
|
|
1906
1918
|
], 4))), 128))
|
|
1907
1919
|
], 4),
|
|
1908
|
-
n.responseLabel ? (c(), u("span",
|
|
1920
|
+
n.responseLabel ? (c(), u("span", Wt, v(n.responseLabel), 1)) : b("", !0)
|
|
1909
1921
|
])) : b("", !0);
|
|
1910
1922
|
}
|
|
1911
|
-
const
|
|
1923
|
+
const Yt = /* @__PURE__ */ B(qt, [["render", Gt], ["__scopeId", "data-v-e49a9063"]]), Qt = {
|
|
1912
1924
|
name: "WmHeader",
|
|
1913
|
-
components: { AIAvatar: le, TeamAvatars:
|
|
1925
|
+
components: { AIAvatar: le, TeamAvatars: Yt },
|
|
1914
1926
|
inject: {
|
|
1915
1927
|
// Translator shared by the Messenger shell. Falls back to a French
|
|
1916
1928
|
// translator when the component is used standalone (no provider).
|
|
1917
|
-
t: { default: () =>
|
|
1929
|
+
t: { default: () => U() }
|
|
1918
1930
|
},
|
|
1919
1931
|
props: {
|
|
1920
1932
|
title: { type: String, default: "Nouvelle conversation" },
|
|
@@ -1926,7 +1938,8 @@ const Gt = /* @__PURE__ */ B(Ht, [["render", Wt], ["__scopeId", "data-v-e49a9063
|
|
|
1926
1938
|
moreActive: { type: Boolean, default: !1 },
|
|
1927
1939
|
// When false (welcome / no conversation) the avatar + title + status
|
|
1928
1940
|
// block is hidden so the header stays a minimal action bar.
|
|
1929
|
-
showIdentity: { type: Boolean, default: !0 }
|
|
1941
|
+
showIdentity: { type: Boolean, default: !0 },
|
|
1942
|
+
agentAvatarUrl: { type: String, default: null }
|
|
1930
1943
|
},
|
|
1931
1944
|
emits: ["back", "close", "more"],
|
|
1932
1945
|
computed: {
|
|
@@ -1945,22 +1958,22 @@ const Gt = /* @__PURE__ */ B(Ht, [["render", Wt], ["__scopeId", "data-v-e49a9063
|
|
|
1945
1958
|
return n;
|
|
1946
1959
|
}
|
|
1947
1960
|
}
|
|
1948
|
-
},
|
|
1961
|
+
}, Xt = { class: "wm-header" }, Jt = ["aria-label"], Zt = {
|
|
1949
1962
|
key: 1,
|
|
1950
1963
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
1951
|
-
},
|
|
1964
|
+
}, en = { class: "wm-header__avatar" }, tn = { class: "wm-header__main" }, nn = { class: "wm-header__title" }, sn = {
|
|
1952
1965
|
key: 3,
|
|
1953
1966
|
class: "wm-header__fill"
|
|
1954
|
-
},
|
|
1955
|
-
function
|
|
1956
|
-
const a =
|
|
1957
|
-
return c(), u("div",
|
|
1967
|
+
}, rn = { class: "wm-header__actions" }, an = ["aria-label", "title"], on = ["aria-label", "title"];
|
|
1968
|
+
function ln(e, t, n, i, r, s) {
|
|
1969
|
+
const a = L("AIAvatar"), l = L("TeamAvatars");
|
|
1970
|
+
return c(), u("div", Xt, [
|
|
1958
1971
|
n.showBack ? (c(), u("button", {
|
|
1959
1972
|
key: 0,
|
|
1960
1973
|
type: "button",
|
|
1961
1974
|
class: "wm-header__icon",
|
|
1962
1975
|
"aria-label": s.t("header.backToHome"),
|
|
1963
|
-
onClick: t[0] || (t[0] = (
|
|
1976
|
+
onClick: t[0] || (t[0] = (p) => e.$emit("back"))
|
|
1964
1977
|
}, [...t[3] || (t[3] = [
|
|
1965
1978
|
o("svg", {
|
|
1966
1979
|
width: "13",
|
|
@@ -1975,28 +1988,31 @@ function on(e, t, n, i, r, s) {
|
|
|
1975
1988
|
}, [
|
|
1976
1989
|
o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
1977
1990
|
], -1)
|
|
1978
|
-
])], 8,
|
|
1979
|
-
n.showIdentity ? (c(), u(
|
|
1980
|
-
o("div", Zt, [
|
|
1981
|
-
q(a, { size: 30 })
|
|
1982
|
-
]),
|
|
1991
|
+
])], 8, Jt)) : (c(), u("div", Zt)),
|
|
1992
|
+
n.showIdentity ? (c(), u(I, { key: 2 }, [
|
|
1983
1993
|
o("div", en, [
|
|
1984
|
-
|
|
1994
|
+
q(a, {
|
|
1995
|
+
size: 30,
|
|
1996
|
+
"image-url": n.agentAvatarUrl
|
|
1997
|
+
}, null, 8, ["image-url"])
|
|
1998
|
+
]),
|
|
1999
|
+
o("div", tn, [
|
|
2000
|
+
o("div", nn, v(n.title), 1)
|
|
1985
2001
|
]),
|
|
1986
2002
|
s.hasTeam ? (c(), R(l, {
|
|
1987
2003
|
key: 0,
|
|
1988
2004
|
members: s.displayedTeamMembers,
|
|
1989
2005
|
"response-label": ""
|
|
1990
2006
|
}, null, 8, ["members"])) : b("", !0)
|
|
1991
|
-
], 64)) : (c(), u("div",
|
|
1992
|
-
o("div",
|
|
2007
|
+
], 64)) : (c(), u("div", sn)),
|
|
2008
|
+
o("div", rn, [
|
|
1993
2009
|
n.showMore ? (c(), u("button", {
|
|
1994
2010
|
key: 0,
|
|
1995
2011
|
type: "button",
|
|
1996
2012
|
class: x(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
|
|
1997
2013
|
"aria-label": s.t("header.moreOptions"),
|
|
1998
2014
|
title: s.t("header.moreOptions"),
|
|
1999
|
-
onClick: t[1] || (t[1] = (
|
|
2015
|
+
onClick: t[1] || (t[1] = (p) => e.$emit("more"))
|
|
2000
2016
|
}, [...t[4] || (t[4] = [
|
|
2001
2017
|
o("svg", {
|
|
2002
2018
|
width: "13",
|
|
@@ -2021,14 +2037,14 @@ function on(e, t, n, i, r, s) {
|
|
|
2021
2037
|
r: "1.6"
|
|
2022
2038
|
})
|
|
2023
2039
|
], -1)
|
|
2024
|
-
])], 10,
|
|
2040
|
+
])], 10, an)) : b("", !0),
|
|
2025
2041
|
n.showClose ? (c(), u("button", {
|
|
2026
2042
|
key: 1,
|
|
2027
2043
|
type: "button",
|
|
2028
2044
|
class: "wm-header__icon",
|
|
2029
2045
|
"aria-label": s.t("header.closeWidget"),
|
|
2030
2046
|
title: s.t("header.closeWidget"),
|
|
2031
|
-
onClick: t[2] || (t[2] = (
|
|
2047
|
+
onClick: t[2] || (t[2] = (p) => e.$emit("close"))
|
|
2032
2048
|
}, [...t[5] || (t[5] = [
|
|
2033
2049
|
o("svg", {
|
|
2034
2050
|
width: "13",
|
|
@@ -2043,15 +2059,15 @@ function on(e, t, n, i, r, s) {
|
|
|
2043
2059
|
}, [
|
|
2044
2060
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
2045
2061
|
], -1)
|
|
2046
|
-
])], 8,
|
|
2062
|
+
])], 8, on)) : b("", !0)
|
|
2047
2063
|
])
|
|
2048
2064
|
]);
|
|
2049
2065
|
}
|
|
2050
|
-
const
|
|
2066
|
+
const cn = /* @__PURE__ */ B(Qt, [["render", ln], ["__scopeId", "data-v-a94f9284"]]);
|
|
2051
2067
|
function Ee(e) {
|
|
2052
2068
|
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2053
2069
|
}
|
|
2054
|
-
function
|
|
2070
|
+
function dn(e) {
|
|
2055
2071
|
return /^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim());
|
|
2056
2072
|
}
|
|
2057
2073
|
const Ae = "";
|
|
@@ -2061,14 +2077,14 @@ function re(e) {
|
|
|
2061
2077
|
return t = t.replace(/`([^`\n]+)`/g, (i, r) => {
|
|
2062
2078
|
const s = n.length;
|
|
2063
2079
|
return n.push(r), `${Ae}CODE${s}${Ae}`;
|
|
2064
|
-
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, r, s) =>
|
|
2080
|
+
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, r, s) => dn(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (i, r) => `<code class="wm-md-code">${n[+r]}</code>`), t;
|
|
2065
2081
|
}
|
|
2066
|
-
function
|
|
2082
|
+
function un(e) {
|
|
2067
2083
|
if (!e) return "";
|
|
2068
2084
|
const t = String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g, "$1");
|
|
2069
2085
|
return re(Ee(t));
|
|
2070
2086
|
}
|
|
2071
|
-
function
|
|
2087
|
+
function mn(e) {
|
|
2072
2088
|
if (!e) return "";
|
|
2073
2089
|
const t = Ee(e).split(`
|
|
2074
2090
|
`), n = [];
|
|
@@ -2116,12 +2132,12 @@ function un(e) {
|
|
|
2116
2132
|
});
|
|
2117
2133
|
continue;
|
|
2118
2134
|
}
|
|
2119
|
-
const
|
|
2120
|
-
if (
|
|
2121
|
-
const C =
|
|
2135
|
+
const p = /^(#{1,6})\s+(.*)$/.exec(s);
|
|
2136
|
+
if (p) {
|
|
2137
|
+
const C = p[1].length;
|
|
2122
2138
|
n.push({
|
|
2123
2139
|
type: "block",
|
|
2124
|
-
html: `<h${C} class="wm-md-h wm-md-h${C}">${re(
|
|
2140
|
+
html: `<h${C} class="wm-md-h wm-md-h${C}">${re(p[2])}</h${C}>`
|
|
2125
2141
|
}), i++;
|
|
2126
2142
|
continue;
|
|
2127
2143
|
}
|
|
@@ -2149,12 +2165,14 @@ const Se = {
|
|
|
2149
2165
|
inject: {
|
|
2150
2166
|
// Translator + resolved-language getter shared by the Messenger
|
|
2151
2167
|
// shell. Fall back to French wording when used standalone.
|
|
2152
|
-
t: { default: () =>
|
|
2168
|
+
t: { default: () => U() },
|
|
2153
2169
|
wmLocale: { default: () => () => "fr" }
|
|
2154
2170
|
},
|
|
2155
2171
|
props: {
|
|
2156
2172
|
welcomeMessage: { type: String, default: "" },
|
|
2173
|
+
subtitle: { type: String, default: "" },
|
|
2157
2174
|
agentName: { type: String, default: "" },
|
|
2175
|
+
defaultIconUrl: { type: String, default: null },
|
|
2158
2176
|
quickLinks: { type: Array, default: () => [] },
|
|
2159
2177
|
openThreads: { type: Array, default: () => [] },
|
|
2160
2178
|
busy: { type: Boolean, default: !1 }
|
|
@@ -2168,7 +2186,7 @@ const Se = {
|
|
|
2168
2186
|
return this.welcomeMessage ? this.welcomeMessage : this.agentName ? this.t("onboarding.greetingNamed", { name: this.agentName }) : this.t("onboarding.greeting");
|
|
2169
2187
|
},
|
|
2170
2188
|
heroSub() {
|
|
2171
|
-
return this.t("onboarding.heroSub");
|
|
2189
|
+
return this.subtitle || this.t("onboarding.heroSub");
|
|
2172
2190
|
},
|
|
2173
2191
|
isOddQuickLinks() {
|
|
2174
2192
|
return this.quickLinks.length % 2 === 1;
|
|
@@ -2188,7 +2206,7 @@ const Se = {
|
|
|
2188
2206
|
return Se[e] || Se.link;
|
|
2189
2207
|
},
|
|
2190
2208
|
renderPreview(e) {
|
|
2191
|
-
return
|
|
2209
|
+
return un(e);
|
|
2192
2210
|
},
|
|
2193
2211
|
formatTs(e) {
|
|
2194
2212
|
if (!e) return "";
|
|
@@ -2210,10 +2228,10 @@ const Se = {
|
|
|
2210
2228
|
});
|
|
2211
2229
|
}
|
|
2212
2230
|
}
|
|
2213
|
-
},
|
|
2231
|
+
}, fn = { class: "wm-onb" }, _n = { class: "wm-onb__hero" }, gn = { class: "wm-onb__title" }, pn = { class: "wm-onb__sub" }, vn = { class: "wm-onb__cta" }, yn = ["disabled"], bn = {
|
|
2214
2232
|
key: 0,
|
|
2215
2233
|
class: "wm-onb__section"
|
|
2216
|
-
},
|
|
2234
|
+
}, wn = { class: "wm-onb__section-title" }, kn = ["onClick"], Cn = { class: "wm-onb__card-icon" }, An = {
|
|
2217
2235
|
width: "16",
|
|
2218
2236
|
height: "16",
|
|
2219
2237
|
viewBox: "0 0 24 24",
|
|
@@ -2223,31 +2241,32 @@ const Se = {
|
|
|
2223
2241
|
"stroke-linecap": "round",
|
|
2224
2242
|
"stroke-linejoin": "round",
|
|
2225
2243
|
"aria-hidden": "true"
|
|
2226
|
-
},
|
|
2244
|
+
}, Sn = ["d"], Mn = { class: "wm-onb__card-body" }, Tn = { class: "wm-onb__card-title" }, xn = {
|
|
2227
2245
|
key: 0,
|
|
2228
2246
|
class: "wm-onb__card-sub"
|
|
2229
|
-
},
|
|
2247
|
+
}, On = {
|
|
2230
2248
|
key: 1,
|
|
2231
2249
|
class: "wm-onb__section"
|
|
2232
|
-
},
|
|
2250
|
+
}, In = { class: "wm-onb__section-title" }, Ln = { class: "wm-onb__search" }, Bn = ["placeholder", "aria-label"], En = { class: "wm-onb__list" }, Rn = ["onClick"], Nn = ["aria-label"], Fn = { class: "wm-onb__thread-body" }, jn = { class: "wm-onb__thread-title" }, Un = ["innerHTML"], Pn = { class: "wm-onb__thread-meta" }, Dn = {
|
|
2233
2251
|
key: 0,
|
|
2234
2252
|
class: "wm-onb__thread-time"
|
|
2235
|
-
},
|
|
2253
|
+
}, $n = {
|
|
2236
2254
|
key: 0,
|
|
2237
2255
|
class: "wm-onb__empty"
|
|
2238
2256
|
};
|
|
2239
|
-
function
|
|
2240
|
-
const a =
|
|
2241
|
-
return c(), u("div",
|
|
2242
|
-
o("div",
|
|
2257
|
+
function Hn(e, t, n, i, r, s) {
|
|
2258
|
+
const a = L("AIAvatar");
|
|
2259
|
+
return c(), u("div", fn, [
|
|
2260
|
+
o("div", _n, [
|
|
2243
2261
|
q(a, {
|
|
2244
2262
|
size: 56,
|
|
2245
|
-
pulse: !0
|
|
2246
|
-
|
|
2247
|
-
|
|
2263
|
+
pulse: !0,
|
|
2264
|
+
"image-url": n.defaultIconUrl
|
|
2265
|
+
}, null, 8, ["image-url"]),
|
|
2266
|
+
o("div", gn, v(s.heroTitle), 1),
|
|
2248
2267
|
o("div", pn, v(s.heroSub), 1)
|
|
2249
2268
|
]),
|
|
2250
|
-
o("div",
|
|
2269
|
+
o("div", vn, [
|
|
2251
2270
|
o("button", {
|
|
2252
2271
|
type: "button",
|
|
2253
2272
|
class: "wm-onb__startBtn",
|
|
@@ -2270,35 +2289,35 @@ function $n(e, t, n, i, r, s) {
|
|
|
2270
2289
|
])
|
|
2271
2290
|
], -1)),
|
|
2272
2291
|
o("span", null, v(n.busy ? "…" : s.t("onboarding.start")), 1)
|
|
2273
|
-
], 8,
|
|
2292
|
+
], 8, yn)
|
|
2274
2293
|
]),
|
|
2275
|
-
n.quickLinks.length ? (c(), u("div",
|
|
2276
|
-
o("div",
|
|
2294
|
+
n.quickLinks.length ? (c(), u("div", bn, [
|
|
2295
|
+
o("div", wn, v(s.t("onboarding.quickAccess")), 1),
|
|
2277
2296
|
o("div", {
|
|
2278
2297
|
class: x(s.quickLinksLayout)
|
|
2279
2298
|
}, [
|
|
2280
|
-
(c(!0), u(
|
|
2281
|
-
key:
|
|
2299
|
+
(c(!0), u(I, null, j(n.quickLinks, (l, p) => (c(), u("button", {
|
|
2300
|
+
key: p,
|
|
2282
2301
|
type: "button",
|
|
2283
2302
|
class: x(["wm-onb__card", { "wm-onb__card--row": s.isOddQuickLinks }]),
|
|
2284
2303
|
onClick: (C) => e.$emit("select", l)
|
|
2285
2304
|
}, [
|
|
2286
|
-
o("span",
|
|
2287
|
-
(c(), u("svg",
|
|
2305
|
+
o("span", Cn, [
|
|
2306
|
+
(c(), u("svg", An, [
|
|
2288
2307
|
o("path", {
|
|
2289
2308
|
d: s.iconPath(l.icon)
|
|
2290
|
-
}, null, 8,
|
|
2309
|
+
}, null, 8, Sn)
|
|
2291
2310
|
]))
|
|
2292
2311
|
]),
|
|
2293
|
-
o("span",
|
|
2294
|
-
o("span",
|
|
2295
|
-
l.description ? (c(), u("span",
|
|
2312
|
+
o("span", Mn, [
|
|
2313
|
+
o("span", Tn, v(l.label), 1),
|
|
2314
|
+
l.description ? (c(), u("span", xn, v(l.description), 1)) : b("", !0)
|
|
2296
2315
|
])
|
|
2297
|
-
], 10,
|
|
2316
|
+
], 10, kn))), 128))
|
|
2298
2317
|
], 2)
|
|
2299
2318
|
])) : b("", !0),
|
|
2300
|
-
n.openThreads.length ? (c(), u("div",
|
|
2301
|
-
o("div",
|
|
2319
|
+
n.openThreads.length ? (c(), u("div", On, [
|
|
2320
|
+
o("div", In, v(s.t("onboarding.recentConversations")), 1),
|
|
2302
2321
|
o("div", Ln, [
|
|
2303
2322
|
t[3] || (t[3] = o("span", { class: "wm-onb__searchIcon" }, [
|
|
2304
2323
|
o("svg", {
|
|
@@ -2320,16 +2339,16 @@ function $n(e, t, n, i, r, s) {
|
|
|
2320
2339
|
type: "text",
|
|
2321
2340
|
placeholder: s.t("onboarding.search"),
|
|
2322
2341
|
"aria-label": s.t("onboarding.search")
|
|
2323
|
-
}, null, 8,
|
|
2342
|
+
}, null, 8, Bn), [
|
|
2324
2343
|
[ee, r.query]
|
|
2325
2344
|
])
|
|
2326
2345
|
]),
|
|
2327
|
-
o("div",
|
|
2328
|
-
(c(!0), u(
|
|
2346
|
+
o("div", En, [
|
|
2347
|
+
(c(!0), u(I, null, j(s.filteredThreads, (l) => (c(), u("button", {
|
|
2329
2348
|
key: l.id,
|
|
2330
2349
|
type: "button",
|
|
2331
2350
|
class: "wm-onb__thread",
|
|
2332
|
-
onClick: (
|
|
2351
|
+
onClick: (p) => e.$emit("resume", l)
|
|
2333
2352
|
}, [
|
|
2334
2353
|
o("span", {
|
|
2335
2354
|
class: x(["wm-onb__thread-icon", { "wm-onb__thread-icon--inverted": !l.unread }])
|
|
@@ -2351,14 +2370,14 @@ function $n(e, t, n, i, r, s) {
|
|
|
2351
2370
|
key: 0,
|
|
2352
2371
|
class: "wm-onb__thread-dot",
|
|
2353
2372
|
"aria-label": s.t("onboarding.unread")
|
|
2354
|
-
}, null, 8,
|
|
2373
|
+
}, null, 8, Nn)) : b("", !0)
|
|
2355
2374
|
], 2),
|
|
2356
|
-
o("span",
|
|
2357
|
-
o("span",
|
|
2375
|
+
o("span", Fn, [
|
|
2376
|
+
o("span", jn, v(l.title), 1),
|
|
2358
2377
|
o("span", {
|
|
2359
2378
|
class: "wm-onb__thread-preview",
|
|
2360
2379
|
innerHTML: s.renderPreview(l.preview)
|
|
2361
|
-
}, null, 8,
|
|
2380
|
+
}, null, 8, Un)
|
|
2362
2381
|
]),
|
|
2363
2382
|
o("span", Pn, [
|
|
2364
2383
|
s.formatTs(l._ts) ? (c(), u("span", Dn, v(s.formatTs(l._ts)), 1)) : b("", !0),
|
|
@@ -2377,17 +2396,17 @@ function $n(e, t, n, i, r, s) {
|
|
|
2377
2396
|
o("path", { d: "M5 12h14M13 5l7 7-7 7" })
|
|
2378
2397
|
], -1))
|
|
2379
2398
|
])
|
|
2380
|
-
], 8,
|
|
2381
|
-
s.filteredThreads.length ? b("", !0) : (c(), u("div",
|
|
2399
|
+
], 8, Rn))), 128)),
|
|
2400
|
+
s.filteredThreads.length ? b("", !0) : (c(), u("div", $n, v(s.t("onboarding.noResults", { query: r.query })), 1))
|
|
2382
2401
|
])
|
|
2383
2402
|
])) : b("", !0)
|
|
2384
2403
|
]);
|
|
2385
2404
|
}
|
|
2386
|
-
const
|
|
2387
|
-
function
|
|
2405
|
+
const qn = /* @__PURE__ */ B(hn, [["render", Hn], ["__scopeId", "data-v-286413a5"]]);
|
|
2406
|
+
function zn(e) {
|
|
2388
2407
|
return typeof e != "string" ? "" : e.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
|
|
2389
2408
|
}
|
|
2390
|
-
const
|
|
2409
|
+
const Vn = {
|
|
2391
2410
|
name: "WmActionResult",
|
|
2392
2411
|
props: {
|
|
2393
2412
|
state: { type: String, default: "success" },
|
|
@@ -2397,13 +2416,13 @@ const zn = {
|
|
|
2397
2416
|
},
|
|
2398
2417
|
computed: {
|
|
2399
2418
|
detailText() {
|
|
2400
|
-
return
|
|
2419
|
+
return zn(this.detail);
|
|
2401
2420
|
}
|
|
2402
2421
|
}
|
|
2403
|
-
},
|
|
2422
|
+
}, Kn = {
|
|
2404
2423
|
class: "wm-result__icon",
|
|
2405
2424
|
"aria-hidden": "true"
|
|
2406
|
-
},
|
|
2425
|
+
}, Wn = {
|
|
2407
2426
|
key: 0,
|
|
2408
2427
|
width: "11",
|
|
2409
2428
|
height: "11",
|
|
@@ -2413,7 +2432,7 @@ const zn = {
|
|
|
2413
2432
|
"stroke-width": "2.8",
|
|
2414
2433
|
"stroke-linecap": "round",
|
|
2415
2434
|
"stroke-linejoin": "round"
|
|
2416
|
-
},
|
|
2435
|
+
}, Gn = {
|
|
2417
2436
|
key: 1,
|
|
2418
2437
|
width: "11",
|
|
2419
2438
|
height: "11",
|
|
@@ -2423,7 +2442,7 @@ const zn = {
|
|
|
2423
2442
|
"stroke-width": "2.6",
|
|
2424
2443
|
"stroke-linecap": "round",
|
|
2425
2444
|
"stroke-linejoin": "round"
|
|
2426
|
-
},
|
|
2445
|
+
}, Yn = {
|
|
2427
2446
|
key: 2,
|
|
2428
2447
|
width: "11",
|
|
2429
2448
|
height: "11",
|
|
@@ -2433,7 +2452,7 @@ const zn = {
|
|
|
2433
2452
|
"stroke-width": "2.4",
|
|
2434
2453
|
"stroke-linecap": "round",
|
|
2435
2454
|
"stroke-linejoin": "round"
|
|
2436
|
-
},
|
|
2455
|
+
}, Qn = {
|
|
2437
2456
|
key: 3,
|
|
2438
2457
|
width: "12",
|
|
2439
2458
|
height: "12",
|
|
@@ -2443,24 +2462,24 @@ const zn = {
|
|
|
2443
2462
|
"stroke-width": "2.2",
|
|
2444
2463
|
"stroke-linecap": "round",
|
|
2445
2464
|
"stroke-linejoin": "round"
|
|
2446
|
-
},
|
|
2447
|
-
function
|
|
2465
|
+
}, Xn = { class: "wm-result__body" }, Jn = { class: "wm-result__label" }, Zn = { class: "wm-result__detail" };
|
|
2466
|
+
function es(e, t, n, i, r, s) {
|
|
2448
2467
|
return c(), u("div", {
|
|
2449
2468
|
class: x(["wm-result", `wm-result--${n.state}`])
|
|
2450
2469
|
}, [
|
|
2451
|
-
o("span",
|
|
2452
|
-
n.state === "success" ? (c(), u("svg",
|
|
2470
|
+
o("span", Kn, [
|
|
2471
|
+
n.state === "success" ? (c(), u("svg", Wn, [...t[0] || (t[0] = [
|
|
2453
2472
|
o("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
2454
|
-
])])) : n.state === "rejected" ? (c(), u("svg",
|
|
2473
|
+
])])) : n.state === "rejected" ? (c(), u("svg", Gn, [...t[1] || (t[1] = [
|
|
2455
2474
|
o("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
2456
|
-
])])) : n.state === "awaiting" ? (c(), u("svg",
|
|
2475
|
+
])])) : n.state === "awaiting" ? (c(), u("svg", Yn, [...t[2] || (t[2] = [
|
|
2457
2476
|
o("circle", {
|
|
2458
2477
|
cx: "12",
|
|
2459
2478
|
cy: "12",
|
|
2460
2479
|
r: "10"
|
|
2461
2480
|
}, null, -1),
|
|
2462
2481
|
o("polyline", { points: "12 7 12 12 15 14" }, null, -1)
|
|
2463
|
-
])])) : (c(), u("svg",
|
|
2482
|
+
])])) : (c(), u("svg", Qn, [...t[3] || (t[3] = [
|
|
2464
2483
|
o("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }, null, -1),
|
|
2465
2484
|
o("line", {
|
|
2466
2485
|
x1: "12",
|
|
@@ -2476,24 +2495,24 @@ function Zn(e, t, n, i, r, s) {
|
|
|
2476
2495
|
}, null, -1)
|
|
2477
2496
|
])]))
|
|
2478
2497
|
]),
|
|
2479
|
-
o("span",
|
|
2480
|
-
o("span",
|
|
2481
|
-
s.detailText ? (c(), u(
|
|
2498
|
+
o("span", Xn, [
|
|
2499
|
+
o("span", Jn, v(n.label), 1),
|
|
2500
|
+
s.detailText ? (c(), u(I, { key: 0 }, [
|
|
2482
2501
|
t[4] || (t[4] = o("span", {
|
|
2483
2502
|
class: "wm-result__sep",
|
|
2484
2503
|
"aria-hidden": "true"
|
|
2485
2504
|
}, " · ", -1)),
|
|
2486
|
-
o("span",
|
|
2505
|
+
o("span", Zn, v(s.detailText), 1)
|
|
2487
2506
|
], 64)) : b("", !0)
|
|
2488
2507
|
])
|
|
2489
2508
|
], 2);
|
|
2490
2509
|
}
|
|
2491
|
-
const
|
|
2510
|
+
const ts = /* @__PURE__ */ B(Vn, [["render", es], ["__scopeId", "data-v-7284acd0"]]), ns = {
|
|
2492
2511
|
name: "WmArtifactFormResponse",
|
|
2493
2512
|
inject: {
|
|
2494
2513
|
// Translator shared by the Messenger shell; French fallback when
|
|
2495
2514
|
// the component is used standalone.
|
|
2496
|
-
t: { default: () =>
|
|
2515
|
+
t: { default: () => U() }
|
|
2497
2516
|
},
|
|
2498
2517
|
props: {
|
|
2499
2518
|
data: { type: Object, required: !0 }
|
|
@@ -2504,12 +2523,12 @@ const es = /* @__PURE__ */ B(zn, [["render", Zn], ["__scopeId", "data-v-7284acd0
|
|
|
2504
2523
|
return Array.isArray((e = this.data) == null ? void 0 : e.fields) ? this.data.fields : [];
|
|
2505
2524
|
}
|
|
2506
2525
|
}
|
|
2507
|
-
},
|
|
2508
|
-
function
|
|
2509
|
-
return c(), u("div",
|
|
2510
|
-
o("div",
|
|
2511
|
-
o("div",
|
|
2512
|
-
o("span",
|
|
2526
|
+
}, ss = { class: "wm-art wm-art--formResponse" }, rs = { class: "wm-art__head" }, is = { class: "wm-art__title" }, as = { class: "wm-art__badge wm-art__badge--success" }, os = { class: "wm-art__body" }, ls = { class: "wm-art__fieldLabel" };
|
|
2527
|
+
function cs(e, t, n, i, r, s) {
|
|
2528
|
+
return c(), u("div", ss, [
|
|
2529
|
+
o("div", rs, [
|
|
2530
|
+
o("div", is, v(n.data.title || s.t("form.title")), 1),
|
|
2531
|
+
o("span", as, [
|
|
2513
2532
|
t[0] || (t[0] = o("svg", {
|
|
2514
2533
|
width: "11",
|
|
2515
2534
|
height: "11",
|
|
@@ -2523,15 +2542,15 @@ function ls(e, t, n, i, r, s) {
|
|
|
2523
2542
|
}, [
|
|
2524
2543
|
o("polyline", { points: "20 6 9 17 4 12" })
|
|
2525
2544
|
], -1)),
|
|
2526
|
-
|
|
2545
|
+
ge(" " + v(s.t("form.sent")), 1)
|
|
2527
2546
|
])
|
|
2528
2547
|
]),
|
|
2529
|
-
o("div",
|
|
2530
|
-
(c(!0), u(
|
|
2548
|
+
o("div", os, [
|
|
2549
|
+
(c(!0), u(I, null, j(s.fields, (a, l) => (c(), u("div", {
|
|
2531
2550
|
key: l,
|
|
2532
2551
|
class: "wm-art__field"
|
|
2533
2552
|
}, [
|
|
2534
|
-
o("div",
|
|
2553
|
+
o("div", ls, v(a.label), 1),
|
|
2535
2554
|
o("div", {
|
|
2536
2555
|
class: x([
|
|
2537
2556
|
"wm-art__fieldValue",
|
|
@@ -2542,7 +2561,7 @@ function ls(e, t, n, i, r, s) {
|
|
|
2542
2561
|
])
|
|
2543
2562
|
]);
|
|
2544
2563
|
}
|
|
2545
|
-
const
|
|
2564
|
+
const ds = /* @__PURE__ */ B(ns, [["render", cs], ["__scopeId", "data-v-713aecf1"]]), us = {
|
|
2546
2565
|
name: "WmArtifactInfoCard",
|
|
2547
2566
|
props: {
|
|
2548
2567
|
data: { type: Object, required: !0 }
|
|
@@ -2557,32 +2576,32 @@ const cs = /* @__PURE__ */ B(ts, [["render", ls], ["__scopeId", "data-v-713aecf1
|
|
|
2557
2576
|
return !!((e = this.data) != null && e.body) || this.fields.length > 0;
|
|
2558
2577
|
}
|
|
2559
2578
|
}
|
|
2560
|
-
},
|
|
2579
|
+
}, ms = { class: "wm-art wm-art--infoCard" }, hs = {
|
|
2561
2580
|
key: 0,
|
|
2562
2581
|
class: "wm-art__image"
|
|
2563
|
-
},
|
|
2582
|
+
}, fs = ["src", "alt"], _s = { class: "wm-art__head" }, gs = { class: "wm-art__headMain" }, ps = { class: "wm-art__title" }, vs = {
|
|
2564
2583
|
key: 0,
|
|
2565
2584
|
class: "wm-art__subtitle"
|
|
2566
|
-
},
|
|
2585
|
+
}, ys = {
|
|
2567
2586
|
key: 1,
|
|
2568
2587
|
class: "wm-art__body"
|
|
2569
|
-
},
|
|
2588
|
+
}, bs = {
|
|
2570
2589
|
key: 0,
|
|
2571
2590
|
class: "wm-art__text"
|
|
2572
|
-
},
|
|
2573
|
-
function
|
|
2574
|
-
return c(), u("div",
|
|
2591
|
+
}, ws = { class: "wm-art__fieldLabel" };
|
|
2592
|
+
function ks(e, t, n, i, r, s) {
|
|
2593
|
+
return c(), u("div", ms, [
|
|
2575
2594
|
n.data.image_url ? (c(), u("figure", hs, [
|
|
2576
2595
|
o("img", {
|
|
2577
2596
|
src: n.data.image_url,
|
|
2578
2597
|
alt: n.data.title || "",
|
|
2579
2598
|
loading: "lazy"
|
|
2580
|
-
}, null, 8,
|
|
2599
|
+
}, null, 8, fs)
|
|
2581
2600
|
])) : b("", !0),
|
|
2582
|
-
o("div",
|
|
2583
|
-
o("div",
|
|
2601
|
+
o("div", _s, [
|
|
2602
|
+
o("div", gs, [
|
|
2584
2603
|
o("div", ps, v(n.data.title), 1),
|
|
2585
|
-
n.data.subtitle ? (c(), u("div",
|
|
2604
|
+
n.data.subtitle ? (c(), u("div", vs, v(n.data.subtitle), 1)) : b("", !0)
|
|
2586
2605
|
]),
|
|
2587
2606
|
n.data.badge && n.data.badge.label ? (c(), u("span", {
|
|
2588
2607
|
key: 0,
|
|
@@ -2592,13 +2611,13 @@ function ws(e, t, n, i, r, s) {
|
|
|
2592
2611
|
])
|
|
2593
2612
|
}, v(n.data.badge.label), 3)) : b("", !0)
|
|
2594
2613
|
]),
|
|
2595
|
-
s.hasBody ? (c(), u("div",
|
|
2596
|
-
n.data.body ? (c(), u("div",
|
|
2597
|
-
s.fields.length ? (c(!0), u(
|
|
2614
|
+
s.hasBody ? (c(), u("div", ys, [
|
|
2615
|
+
n.data.body ? (c(), u("div", bs, v(n.data.body), 1)) : b("", !0),
|
|
2616
|
+
s.fields.length ? (c(!0), u(I, { key: 1 }, j(s.fields, (a, l) => (c(), u("div", {
|
|
2598
2617
|
key: l,
|
|
2599
2618
|
class: "wm-art__field"
|
|
2600
2619
|
}, [
|
|
2601
|
-
o("div",
|
|
2620
|
+
o("div", ws, v(a.label), 1),
|
|
2602
2621
|
o("div", {
|
|
2603
2622
|
class: x([
|
|
2604
2623
|
"wm-art__fieldValue",
|
|
@@ -2609,8 +2628,8 @@ function ws(e, t, n, i, r, s) {
|
|
|
2609
2628
|
])) : b("", !0)
|
|
2610
2629
|
]);
|
|
2611
2630
|
}
|
|
2612
|
-
const
|
|
2613
|
-
function
|
|
2631
|
+
const Cs = /* @__PURE__ */ B(us, [["render", ks], ["__scopeId", "data-v-7eae0e4a"]]);
|
|
2632
|
+
function As(e, t, n) {
|
|
2614
2633
|
if (!e) return "";
|
|
2615
2634
|
const i = new Date(e);
|
|
2616
2635
|
if (Number.isNaN(i.getTime())) return e;
|
|
@@ -2624,12 +2643,12 @@ function Cs(e, t, n) {
|
|
|
2624
2643
|
});
|
|
2625
2644
|
return `${r}${n}${s}`;
|
|
2626
2645
|
}
|
|
2627
|
-
const
|
|
2646
|
+
const Ss = {
|
|
2628
2647
|
name: "WmArtifactTicket",
|
|
2629
2648
|
inject: {
|
|
2630
2649
|
// Translator + resolved-language getter shared by the Messenger
|
|
2631
2650
|
// shell. Fall back to French wording when used standalone.
|
|
2632
|
-
t: { default: () =>
|
|
2651
|
+
t: { default: () => U() },
|
|
2633
2652
|
wmLocale: { default: () => () => "fr" }
|
|
2634
2653
|
},
|
|
2635
2654
|
props: {
|
|
@@ -2642,7 +2661,7 @@ const As = {
|
|
|
2642
2661
|
},
|
|
2643
2662
|
formattedDate() {
|
|
2644
2663
|
var e;
|
|
2645
|
-
return
|
|
2664
|
+
return As(
|
|
2646
2665
|
(e = this.data) == null ? void 0 : e.created_at,
|
|
2647
2666
|
oe(this.wmLocale()),
|
|
2648
2667
|
this.t("ticket.dateAt")
|
|
@@ -2670,13 +2689,13 @@ const As = {
|
|
|
2670
2689
|
return /high|haute|élev|elev|critic|critiq|urgent/.test(t) ? 3 : /low|basse|faible|minor/.test(t) ? 1 : 2;
|
|
2671
2690
|
}
|
|
2672
2691
|
}
|
|
2673
|
-
},
|
|
2692
|
+
}, Ms = { class: "wm-art wm-art--ticket" }, Ts = { class: "wm-art__head wm-tk__head" }, xs = { class: "wm-art__title wm-tk__title" }, Os = { class: "wm-tk__sub" }, Is = { class: "wm-tk__ref" }, Ls = {
|
|
2674
2693
|
key: 0,
|
|
2675
2694
|
class: "wm-tk__text"
|
|
2676
|
-
},
|
|
2695
|
+
}, Bs = {
|
|
2677
2696
|
key: 0,
|
|
2678
2697
|
class: "wm-art__body"
|
|
2679
|
-
},
|
|
2698
|
+
}, Es = { class: "wm-art__fieldLabel" }, Rs = ["data-level"], Ns = {
|
|
2680
2699
|
key: 1,
|
|
2681
2700
|
class: "wm-tk__date",
|
|
2682
2701
|
width: "12",
|
|
@@ -2688,16 +2707,16 @@ const As = {
|
|
|
2688
2707
|
"stroke-linecap": "round",
|
|
2689
2708
|
"stroke-linejoin": "round",
|
|
2690
2709
|
"aria-hidden": "true"
|
|
2691
|
-
},
|
|
2710
|
+
}, Fs = {
|
|
2692
2711
|
key: 1,
|
|
2693
2712
|
class: "wm-art__footer wm-tk__footer"
|
|
2694
2713
|
};
|
|
2695
|
-
function
|
|
2696
|
-
return c(), u("div",
|
|
2697
|
-
o("div",
|
|
2698
|
-
o("div",
|
|
2699
|
-
o("div",
|
|
2700
|
-
o("div",
|
|
2714
|
+
function js(e, t, n, i, r, s) {
|
|
2715
|
+
return c(), u("div", Ms, [
|
|
2716
|
+
o("div", Ts, [
|
|
2717
|
+
o("div", xs, v(n.data.title), 1),
|
|
2718
|
+
o("div", Os, [
|
|
2719
|
+
o("div", Is, [
|
|
2701
2720
|
t[0] || (t[0] = o("svg", {
|
|
2702
2721
|
width: "11",
|
|
2703
2722
|
height: "11",
|
|
@@ -2725,17 +2744,17 @@ function Fs(e, t, n, i, r, s) {
|
|
|
2725
2744
|
class: "wm-tk__dot",
|
|
2726
2745
|
"aria-hidden": "true"
|
|
2727
2746
|
}, null, -1)),
|
|
2728
|
-
|
|
2747
|
+
ge(" " + v(n.data.status.label), 1)
|
|
2729
2748
|
], 2)
|
|
2730
2749
|
]),
|
|
2731
2750
|
n.data.body ? (c(), u("div", Ls, v(n.data.body), 1)) : b("", !0)
|
|
2732
2751
|
]),
|
|
2733
|
-
s.fields.length ? (c(), u("div",
|
|
2734
|
-
(c(!0), u(
|
|
2752
|
+
s.fields.length ? (c(), u("div", Bs, [
|
|
2753
|
+
(c(!0), u(I, null, j(s.fields, (a, l) => (c(), u("div", {
|
|
2735
2754
|
key: l,
|
|
2736
2755
|
class: "wm-art__field"
|
|
2737
2756
|
}, [
|
|
2738
|
-
o("div",
|
|
2757
|
+
o("div", Es, v(a.label), 1),
|
|
2739
2758
|
o("div", {
|
|
2740
2759
|
class: x([
|
|
2741
2760
|
"wm-art__fieldValue",
|
|
@@ -2772,7 +2791,7 @@ function Fs(e, t, n, i, r, s) {
|
|
|
2772
2791
|
height: "9",
|
|
2773
2792
|
rx: "0.5"
|
|
2774
2793
|
}, null, -1)
|
|
2775
|
-
])], 8,
|
|
2794
|
+
])], 8, Rs)) : s.isDate(a.label) ? (c(), u("svg", Ns, [...t[3] || (t[3] = [
|
|
2776
2795
|
o("rect", {
|
|
2777
2796
|
x: "3",
|
|
2778
2797
|
y: "4",
|
|
@@ -2786,7 +2805,7 @@ function Fs(e, t, n, i, r, s) {
|
|
|
2786
2805
|
], 2)
|
|
2787
2806
|
]))), 128))
|
|
2788
2807
|
])) : b("", !0),
|
|
2789
|
-
n.data.created_at ? (c(), u("div",
|
|
2808
|
+
n.data.created_at ? (c(), u("div", Fs, [
|
|
2790
2809
|
t[4] || (t[4] = o("svg", {
|
|
2791
2810
|
width: "11",
|
|
2792
2811
|
height: "11",
|
|
@@ -2811,10 +2830,10 @@ function Fs(e, t, n, i, r, s) {
|
|
|
2811
2830
|
])) : b("", !0)
|
|
2812
2831
|
]);
|
|
2813
2832
|
}
|
|
2814
|
-
const
|
|
2815
|
-
form_response:
|
|
2816
|
-
info_card:
|
|
2817
|
-
ticket:
|
|
2833
|
+
const Us = /* @__PURE__ */ B(Ss, [["render", js], ["__scopeId", "data-v-5f30c914"]]), Ps = {
|
|
2834
|
+
form_response: ds,
|
|
2835
|
+
info_card: Cs,
|
|
2836
|
+
ticket: Us
|
|
2818
2837
|
}, Ds = {
|
|
2819
2838
|
name: "WmArtifactRenderer",
|
|
2820
2839
|
props: {
|
|
@@ -2830,19 +2849,19 @@ const js = /* @__PURE__ */ B(As, [["render", Fs], ["__scopeId", "data-v-5f30c914
|
|
|
2830
2849
|
}
|
|
2831
2850
|
}
|
|
2832
2851
|
};
|
|
2833
|
-
function
|
|
2834
|
-
return s.component ? (c(), R(
|
|
2852
|
+
function $s(e, t, n, i, r, s) {
|
|
2853
|
+
return s.component ? (c(), R(Pe(s.component), {
|
|
2835
2854
|
key: 0,
|
|
2836
2855
|
data: n.artifact.data
|
|
2837
2856
|
}, null, 8, ["data"])) : b("", !0);
|
|
2838
2857
|
}
|
|
2839
|
-
const
|
|
2858
|
+
const Hs = /* @__PURE__ */ B(Ds, [["render", $s]]), qs = {
|
|
2840
2859
|
name: "WmAttachmentPreview",
|
|
2841
2860
|
inject: {
|
|
2842
2861
|
signAttachmentFn: { default: null },
|
|
2843
2862
|
// Translator shared by the Messenger shell; French fallback when
|
|
2844
2863
|
// the component is used standalone.
|
|
2845
|
-
t: { default: () =>
|
|
2864
|
+
t: { default: () => U() }
|
|
2846
2865
|
},
|
|
2847
2866
|
props: {
|
|
2848
2867
|
attachment: { type: Object, required: !0 }
|
|
@@ -2900,15 +2919,15 @@ const $s = /* @__PURE__ */ B(Ds, [["render", Us]]), Hs = {
|
|
|
2900
2919
|
this.url || e.preventDefault();
|
|
2901
2920
|
}
|
|
2902
2921
|
}
|
|
2903
|
-
},
|
|
2922
|
+
}, zs = ["href"], Vs = ["src", "alt"], Ks = ["src"], Ws = ["src"], Gs = ["href", "download"], Ys = { class: "wm-att__main" }, Qs = { class: "wm-att__name" }, Xs = {
|
|
2904
2923
|
key: 0,
|
|
2905
2924
|
class: "wm-att__meta"
|
|
2906
|
-
},
|
|
2925
|
+
}, Js = {
|
|
2907
2926
|
key: 0,
|
|
2908
2927
|
class: "wm-att__spin",
|
|
2909
2928
|
"aria-hidden": "true"
|
|
2910
2929
|
};
|
|
2911
|
-
function
|
|
2930
|
+
function Zs(e, t, n, i, r, s) {
|
|
2912
2931
|
return c(), u("div", {
|
|
2913
2932
|
class: x(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
2914
2933
|
}, [
|
|
@@ -2923,18 +2942,18 @@ function Js(e, t, n, i, r, s) {
|
|
|
2923
2942
|
src: r.url,
|
|
2924
2943
|
alt: s.displayName,
|
|
2925
2944
|
loading: "lazy"
|
|
2926
|
-
}, null, 8,
|
|
2927
|
-
], 8,
|
|
2945
|
+
}, null, 8, Vs)
|
|
2946
|
+
], 8, zs)) : s.kind === "audio" && r.url ? (c(), u("audio", {
|
|
2928
2947
|
key: 1,
|
|
2929
2948
|
src: r.url,
|
|
2930
2949
|
controls: "",
|
|
2931
2950
|
preload: "metadata"
|
|
2932
|
-
}, null, 8,
|
|
2951
|
+
}, null, 8, Ks)) : s.kind === "video" && r.url ? (c(), u("video", {
|
|
2933
2952
|
key: 2,
|
|
2934
2953
|
src: r.url,
|
|
2935
2954
|
controls: "",
|
|
2936
2955
|
preload: "metadata"
|
|
2937
|
-
}, null, 8,
|
|
2956
|
+
}, null, 8, Ws)) : (c(), u("a", {
|
|
2938
2957
|
key: 3,
|
|
2939
2958
|
class: "wm-att__file",
|
|
2940
2959
|
href: r.url || "#",
|
|
@@ -2959,15 +2978,15 @@ function Js(e, t, n, i, r, s) {
|
|
|
2959
2978
|
o("path", { d: "M14 2v6h6" })
|
|
2960
2979
|
])
|
|
2961
2980
|
], -1)),
|
|
2962
|
-
o("span",
|
|
2963
|
-
o("span",
|
|
2964
|
-
s.sizeLabel ? (c(), u("span",
|
|
2981
|
+
o("span", Ys, [
|
|
2982
|
+
o("span", Qs, v(s.displayName), 1),
|
|
2983
|
+
s.sizeLabel ? (c(), u("span", Xs, v(s.sizeLabel), 1)) : b("", !0)
|
|
2965
2984
|
]),
|
|
2966
|
-
r.loading ? (c(), u("span",
|
|
2967
|
-
], 8,
|
|
2985
|
+
r.loading ? (c(), u("span", Js)) : b("", !0)
|
|
2986
|
+
], 8, Gs))
|
|
2968
2987
|
], 2);
|
|
2969
2988
|
}
|
|
2970
|
-
const
|
|
2989
|
+
const er = /* @__PURE__ */ B(qs, [["render", Zs], ["__scopeId", "data-v-afc7b0d3"]]), tr = {
|
|
2971
2990
|
name: "WmBubble",
|
|
2972
2991
|
props: {
|
|
2973
2992
|
role: { type: String, default: "ai" },
|
|
@@ -2976,53 +2995,53 @@ const Zs = /* @__PURE__ */ B(Hs, [["render", Js], ["__scopeId", "data-v-afc7b0d3
|
|
|
2976
2995
|
},
|
|
2977
2996
|
computed: {
|
|
2978
2997
|
rendered() {
|
|
2979
|
-
return
|
|
2998
|
+
return mn(this.text);
|
|
2980
2999
|
}
|
|
2981
3000
|
}
|
|
2982
|
-
},
|
|
2983
|
-
function
|
|
3001
|
+
}, nr = ["innerHTML"];
|
|
3002
|
+
function sr(e, t, n, i, r, s) {
|
|
2984
3003
|
return c(), u("div", {
|
|
2985
3004
|
class: x(["wm-bubble", "wm-bubble--" + n.role])
|
|
2986
3005
|
}, [
|
|
2987
|
-
|
|
2988
|
-
o("span", { innerHTML: s.rendered }, null, 8,
|
|
3006
|
+
De(e.$slots, "default", {}, () => [
|
|
3007
|
+
o("span", { innerHTML: s.rendered }, null, 8, nr)
|
|
2989
3008
|
], !0)
|
|
2990
3009
|
], 2);
|
|
2991
3010
|
}
|
|
2992
|
-
const
|
|
2993
|
-
function
|
|
2994
|
-
return c(), u("div",
|
|
3011
|
+
const rr = /* @__PURE__ */ B(tr, [["render", sr], ["__scopeId", "data-v-7ab13147"]]), ir = { name: "WmTyping" }, ar = { class: "wm-typing" };
|
|
3012
|
+
function or(e, t, n, i, r, s) {
|
|
3013
|
+
return c(), u("div", ar, [...t[0] || (t[0] = [
|
|
2995
3014
|
o("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
2996
3015
|
o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
2997
3016
|
o("span", { style: { "animation-delay": "0.4s" } }, null, -1)
|
|
2998
3017
|
])]);
|
|
2999
3018
|
}
|
|
3000
|
-
const
|
|
3019
|
+
const lr = /* @__PURE__ */ B(ir, [["render", or], ["__scopeId", "data-v-df2447fd"]]);
|
|
3001
3020
|
function Z(e) {
|
|
3002
3021
|
return e ? e.client_msg_id || e.id : "";
|
|
3003
3022
|
}
|
|
3004
|
-
const
|
|
3023
|
+
const cr = {
|
|
3005
3024
|
transferred_to_human: "system.transferredToHuman",
|
|
3006
3025
|
assigned: "system.assigned",
|
|
3007
3026
|
unassigned: "system.unassigned",
|
|
3008
3027
|
resolved: "system.resolved",
|
|
3009
3028
|
reopened: "system.reopened",
|
|
3010
3029
|
idle: "system.idle"
|
|
3011
|
-
},
|
|
3030
|
+
}, dr = 80, ur = 200, mr = {
|
|
3012
3031
|
name: "WmMessageList",
|
|
3013
3032
|
components: {
|
|
3014
3033
|
AIAvatar: le,
|
|
3015
3034
|
HumanAvatar: Be,
|
|
3016
|
-
Bubble:
|
|
3017
|
-
Typing:
|
|
3018
|
-
ActionResult:
|
|
3019
|
-
AttachmentPreview:
|
|
3020
|
-
ArtifactRenderer:
|
|
3035
|
+
Bubble: rr,
|
|
3036
|
+
Typing: lr,
|
|
3037
|
+
ActionResult: ts,
|
|
3038
|
+
AttachmentPreview: er,
|
|
3039
|
+
ArtifactRenderer: Hs
|
|
3021
3040
|
},
|
|
3022
3041
|
inject: {
|
|
3023
3042
|
// Translator + resolved-language getter shared by the Messenger
|
|
3024
3043
|
// shell. Fall back to French wording when used standalone.
|
|
3025
|
-
t: { default: () =>
|
|
3044
|
+
t: { default: () => U() },
|
|
3026
3045
|
wmLocale: { default: () => () => "fr" }
|
|
3027
3046
|
},
|
|
3028
3047
|
props: {
|
|
@@ -3047,7 +3066,12 @@ const lr = {
|
|
|
3047
3066
|
// `created_at` la dépasse sont arrivés EN DIRECT pendant que
|
|
3048
3067
|
// l'utilisateur regardait — ils n'entrent pas dans le batch "Non lus".
|
|
3049
3068
|
// Vide ⇒ pas de borne haute (rétrocompatible).
|
|
3050
|
-
unreadBoundaryTs: { type: String, default: "" }
|
|
3069
|
+
unreadBoundaryTs: { type: String, default: "" },
|
|
3070
|
+
// Identité de l'agent IA configuré côté widget. Affichée à gauche
|
|
3071
|
+
// de "Assistant IA" dans le pied du cluster IA, et utilisée comme
|
|
3072
|
+
// image de l'avatar IA quand renseignée.
|
|
3073
|
+
aiAgentName: { type: String, default: "" },
|
|
3074
|
+
aiAgentAvatarUrl: { type: String, default: null }
|
|
3051
3075
|
},
|
|
3052
3076
|
emits: ["load-more"],
|
|
3053
3077
|
data() {
|
|
@@ -3097,8 +3121,8 @@ const lr = {
|
|
|
3097
3121
|
});
|
|
3098
3122
|
continue;
|
|
3099
3123
|
}
|
|
3100
|
-
const
|
|
3101
|
-
|
|
3124
|
+
const p = e[e.length - 1];
|
|
3125
|
+
p && p.role === l && (l === "ai" || p.agentName === (((i = a == null ? void 0 : a.author) == null ? void 0 : i.name) || "")) ? p.messages.push(a) : e.push({
|
|
3102
3126
|
key: `g-${Z(a)}`,
|
|
3103
3127
|
role: l,
|
|
3104
3128
|
agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
|
|
@@ -3110,8 +3134,8 @@ const lr = {
|
|
|
3110
3134
|
for (const a of e) {
|
|
3111
3135
|
if (a.role === "system") continue;
|
|
3112
3136
|
const l = [];
|
|
3113
|
-
for (const
|
|
3114
|
-
for (const C of this.itemsOf(
|
|
3137
|
+
for (const p of a.messages)
|
|
3138
|
+
for (const C of this.itemsOf(p)) l.push(C);
|
|
3115
3139
|
a.items = l;
|
|
3116
3140
|
}
|
|
3117
3141
|
const t = [];
|
|
@@ -3192,11 +3216,11 @@ const lr = {
|
|
|
3192
3216
|
return `g-${n}`;
|
|
3193
3217
|
},
|
|
3194
3218
|
isAtBottom(e) {
|
|
3195
|
-
return e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
3219
|
+
return e.scrollHeight - e.scrollTop - e.clientHeight <= dr;
|
|
3196
3220
|
},
|
|
3197
3221
|
onScroll() {
|
|
3198
3222
|
const e = this.$refs.scrollEl;
|
|
3199
|
-
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <=
|
|
3223
|
+
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <= ur && (this._pendingLoadMore = !0, this.$emit("load-more")));
|
|
3200
3224
|
},
|
|
3201
3225
|
// Capture pre-patch scroll state and restore it on the next tick.
|
|
3202
3226
|
//
|
|
@@ -3302,7 +3326,10 @@ const lr = {
|
|
|
3302
3326
|
return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
|
|
3303
3327
|
},
|
|
3304
3328
|
roleLabel(e) {
|
|
3305
|
-
|
|
3329
|
+
if (e.role === "human")
|
|
3330
|
+
return e.agentName || this.t("common.agent");
|
|
3331
|
+
const t = this.t("common.aiAssistant");
|
|
3332
|
+
return this.aiAgentName ? `${this.aiAgentName} • ${t}` : t;
|
|
3306
3333
|
},
|
|
3307
3334
|
// Expand a message into atomic visual items, each one a row in
|
|
3308
3335
|
// the smart-corner cluster. Most messages = 1 item. An
|
|
@@ -3394,9 +3421,9 @@ const lr = {
|
|
|
3394
3421
|
// doit garder son arrondi.
|
|
3395
3422
|
cornersFor(e, t) {
|
|
3396
3423
|
var te, ne, G;
|
|
3397
|
-
const n = e.items, i = (te = n[t]) == null ? void 0 : te.kind, r = (ne = n[t - 1]) == null ? void 0 : ne.kind, s = (G = n[t + 1]) == null ? void 0 : G.kind, a = e.role === "user", l = 14,
|
|
3398
|
-
let
|
|
3399
|
-
return a ? (C && (N =
|
|
3424
|
+
const n = e.items, i = (te = n[t]) == null ? void 0 : te.kind, r = (ne = n[t - 1]) == null ? void 0 : ne.kind, s = (G = n[t + 1]) == null ? void 0 : G.kind, a = e.role === "user", l = 14, p = 4, C = r == null ? void 0 : r.bottom, k = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], E = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], H = 0.5, M = (Y, Q, z) => Y != null && T != null ? Y + H >= T : Q === z || Q === "card" && z === "bubble";
|
|
3425
|
+
let P = l, N = l, $ = l, W = l;
|
|
3426
|
+
return a ? (C && (N = p), (k || !s) && ($ = p), C && M(E, C, i == null ? void 0 : i.top) && (P = p), k && M(A, k, i == null ? void 0 : i.bottom) && (W = p)) : (C && (P = p), (k || !s) && (W = p), C && M(E, C, i == null ? void 0 : i.top) && (N = p), k && M(A, k, i == null ? void 0 : i.bottom) && ($ = p)), { tl: P, tr: N, br: $, bl: W };
|
|
3400
3427
|
},
|
|
3401
3428
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3402
3429
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3443,8 +3470,8 @@ const lr = {
|
|
|
3443
3470
|
".wm-bubble, .wm-result, .wm-art, .wm-list__body"
|
|
3444
3471
|
);
|
|
3445
3472
|
if (!l) continue;
|
|
3446
|
-
const
|
|
3447
|
-
|
|
3473
|
+
const p = l.getBoundingClientRect().width;
|
|
3474
|
+
p > 0 && (t[a] = p);
|
|
3448
3475
|
}
|
|
3449
3476
|
const n = this.widthByKey, i = Object.keys(n), r = Object.keys(t);
|
|
3450
3477
|
if (i.length === r.length) {
|
|
@@ -3462,7 +3489,7 @@ const lr = {
|
|
|
3462
3489
|
const t = e.items[e.items.length - 1], n = (t == null ? void 0 : t.message) || e.messages[e.messages.length - 1];
|
|
3463
3490
|
if (!(n != null && n.created_at)) return "";
|
|
3464
3491
|
try {
|
|
3465
|
-
return
|
|
3492
|
+
return Ie(
|
|
3466
3493
|
new Date(n.created_at),
|
|
3467
3494
|
oe(this.wmLocale())
|
|
3468
3495
|
);
|
|
@@ -3509,7 +3536,7 @@ const lr = {
|
|
|
3509
3536
|
},
|
|
3510
3537
|
systemLabel(e) {
|
|
3511
3538
|
var r, s, a;
|
|
3512
|
-
const t = (r = e == null ? void 0 : e.payload) == null ? void 0 : r.event, n =
|
|
3539
|
+
const t = (r = e == null ? void 0 : e.payload) == null ? void 0 : r.event, n = cr[t], i = ((s = e == null ? void 0 : e.metadata) == null ? void 0 : s.agent_name) || ((a = e == null ? void 0 : e.author) == null ? void 0 : a.name) || this.t("messageList.anAgent");
|
|
3513
3540
|
return n ? this.t(n, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
|
|
3514
3541
|
},
|
|
3515
3542
|
scrollToBottom() {
|
|
@@ -3522,33 +3549,33 @@ const lr = {
|
|
|
3522
3549
|
class: "wm-list__loadMore",
|
|
3523
3550
|
role: "status",
|
|
3524
3551
|
"aria-live": "polite"
|
|
3525
|
-
},
|
|
3552
|
+
}, fr = { class: "wm-list__loadMore-lbl" }, _r = {
|
|
3526
3553
|
key: 1,
|
|
3527
3554
|
class: "wm-list__historyEnd"
|
|
3528
|
-
},
|
|
3555
|
+
}, gr = {
|
|
3529
3556
|
key: 2,
|
|
3530
3557
|
class: "wm-list__sep"
|
|
3531
|
-
}, pr = { class: "wm-list__sep-label" },
|
|
3558
|
+
}, pr = { class: "wm-list__sep-label" }, vr = {
|
|
3532
3559
|
key: 0,
|
|
3533
3560
|
class: "wm-list__sep wm-list__sep--unread"
|
|
3534
|
-
},
|
|
3561
|
+
}, yr = { class: "wm-list__sep-label wm-list__sep-label--unread" }, br = {
|
|
3535
3562
|
key: 0,
|
|
3536
3563
|
class: "wm-list__sysep"
|
|
3537
|
-
},
|
|
3564
|
+
}, wr = { class: "wm-list__sysep-label" }, kr = ["data-row-key"], Cr = {
|
|
3538
3565
|
key: 0,
|
|
3539
3566
|
class: "wm-list__avatarSlot"
|
|
3540
|
-
},
|
|
3567
|
+
}, Ar = {
|
|
3541
3568
|
key: 5,
|
|
3542
3569
|
class: "wm-list__body"
|
|
3543
|
-
},
|
|
3570
|
+
}, Sr = { key: 0 }, Mr = {
|
|
3544
3571
|
key: 1,
|
|
3545
3572
|
"aria-hidden": "true"
|
|
3546
|
-
},
|
|
3573
|
+
}, Tr = { key: 2 }, xr = {
|
|
3547
3574
|
key: 3,
|
|
3548
3575
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
3549
|
-
},
|
|
3550
|
-
function
|
|
3551
|
-
const a =
|
|
3576
|
+
}, Or = { class: "wm-list__avatarSlot" };
|
|
3577
|
+
function Ir(e, t, n, i, r, s) {
|
|
3578
|
+
const a = L("AIAvatar"), l = L("HumanAvatar"), p = L("ActionResult"), C = L("ArtifactRenderer"), k = L("Bubble"), T = L("AttachmentPreview"), E = L("Typing");
|
|
3552
3579
|
return c(), u("div", {
|
|
3553
3580
|
ref: "scrollEl",
|
|
3554
3581
|
class: x(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
@@ -3559,31 +3586,31 @@ function Or(e, t, n, i, r, s) {
|
|
|
3559
3586
|
class: "wm-list__loadMore-spinner",
|
|
3560
3587
|
"aria-hidden": "true"
|
|
3561
3588
|
}, null, -1)),
|
|
3562
|
-
o("span",
|
|
3563
|
-
])) : s.historyExhausted ? (c(), u("div",
|
|
3564
|
-
n.dateLabel ? (c(), u("div",
|
|
3589
|
+
o("span", fr, v(s.t("messageList.loadingHistory")), 1)
|
|
3590
|
+
])) : s.historyExhausted ? (c(), u("div", _r, v(s.t("messageList.conversationStart")), 1)) : b("", !0),
|
|
3591
|
+
n.dateLabel ? (c(), u("div", gr, [
|
|
3565
3592
|
t[2] || (t[2] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
3566
3593
|
o("span", pr, v(n.dateLabel), 1),
|
|
3567
3594
|
t[3] || (t[3] = o("div", { class: "wm-list__line" }, null, -1))
|
|
3568
3595
|
])) : b("", !0),
|
|
3569
|
-
(c(!0), u(
|
|
3596
|
+
(c(!0), u(I, null, j(s.groups, (A, H) => (c(), u(I, {
|
|
3570
3597
|
key: A.key
|
|
3571
3598
|
}, [
|
|
3572
|
-
A.key === s.unreadGroupKey ? (c(), u("div",
|
|
3599
|
+
A.key === s.unreadGroupKey ? (c(), u("div", vr, [
|
|
3573
3600
|
t[4] || (t[4] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)),
|
|
3574
|
-
o("span",
|
|
3601
|
+
o("span", yr, v(s.t("messageList.unread")), 1),
|
|
3575
3602
|
t[5] || (t[5] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1))
|
|
3576
3603
|
])) : b("", !0),
|
|
3577
3604
|
A.role === "system" || A.items.length ? (c(), u("div", {
|
|
3578
3605
|
key: 1,
|
|
3579
3606
|
class: x(["wm-list__group", "wm-list__group--" + A.role])
|
|
3580
3607
|
}, [
|
|
3581
|
-
A.role === "system" ? (c(), u("div",
|
|
3608
|
+
A.role === "system" ? (c(), u("div", br, [
|
|
3582
3609
|
t[6] || (t[6] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
3583
|
-
o("span",
|
|
3610
|
+
o("span", wr, v(A.systemLabel), 1),
|
|
3584
3611
|
t[7] || (t[7] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
3585
|
-
])) : (c(), u(
|
|
3586
|
-
(c(!0), u(
|
|
3612
|
+
])) : (c(), u(I, { key: 1 }, [
|
|
3613
|
+
(c(!0), u(I, null, j(A.items, (M, P) => (c(), u("div", {
|
|
3587
3614
|
key: `${s.messageKey(M.message)}-${M.partKey}`,
|
|
3588
3615
|
"data-row-key": `${s.messageKey(M.message)}-${M.partKey}`,
|
|
3589
3616
|
class: x(["wm-list__row fade-up", [
|
|
@@ -3593,15 +3620,16 @@ function Or(e, t, n, i, r, s) {
|
|
|
3593
3620
|
"is-failed": M.message._failed
|
|
3594
3621
|
}
|
|
3595
3622
|
]]),
|
|
3596
|
-
style: K(s.cornersStyle(A,
|
|
3623
|
+
style: K(s.cornersStyle(A, P))
|
|
3597
3624
|
}, [
|
|
3598
|
-
A.role !== "user" ? (c(), u("div",
|
|
3599
|
-
|
|
3625
|
+
A.role !== "user" ? (c(), u("div", Cr, [
|
|
3626
|
+
P === A.items.length - 1 ? (c(), u(I, { key: 0 }, [
|
|
3600
3627
|
A.role === "ai" ? (c(), R(a, {
|
|
3601
3628
|
key: 0,
|
|
3602
3629
|
size: 26,
|
|
3603
|
-
tail: !0
|
|
3604
|
-
|
|
3630
|
+
tail: !0,
|
|
3631
|
+
"image-url": n.aiAgentAvatarUrl
|
|
3632
|
+
}, null, 8, ["image-url"])) : (c(), R(l, {
|
|
3605
3633
|
key: 1,
|
|
3606
3634
|
name: A.agentName,
|
|
3607
3635
|
"avatar-url": A.agentAvatarUrl,
|
|
@@ -3610,12 +3638,12 @@ function Or(e, t, n, i, r, s) {
|
|
|
3610
3638
|
}, null, 8, ["name", "avatar-url"]))
|
|
3611
3639
|
], 64)) : b("", !0)
|
|
3612
3640
|
])) : b("", !0),
|
|
3613
|
-
M.renderAs === "action" ? (c(), R(
|
|
3641
|
+
M.renderAs === "action" ? (c(), R(p, {
|
|
3614
3642
|
key: 1,
|
|
3615
3643
|
state: M.message.payload.state,
|
|
3616
3644
|
label: s.actionLabel(M.message),
|
|
3617
3645
|
detail: s.actionDetail(M.message)
|
|
3618
|
-
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), R(
|
|
3646
|
+
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), R(p, {
|
|
3619
3647
|
key: 2,
|
|
3620
3648
|
state: "awaiting",
|
|
3621
3649
|
label: s.t("messageList.approvalRequestSent"),
|
|
@@ -3626,7 +3654,7 @@ function Or(e, t, n, i, r, s) {
|
|
|
3626
3654
|
}, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(), R(C, {
|
|
3627
3655
|
key: 4,
|
|
3628
3656
|
artifact: s.artifactOf(M.message)
|
|
3629
|
-
}, null, 8, ["artifact"])) : (c(), u("div",
|
|
3657
|
+
}, null, 8, ["artifact"])) : (c(), u("div", Ar, [
|
|
3630
3658
|
M.message.text_md ? (c(), R(k, {
|
|
3631
3659
|
key: 0,
|
|
3632
3660
|
role: A.role,
|
|
@@ -3638,7 +3666,7 @@ function Or(e, t, n, i, r, s) {
|
|
|
3638
3666
|
"wm-list__atts--align-end": A.role === "user"
|
|
3639
3667
|
}])
|
|
3640
3668
|
}, [
|
|
3641
|
-
(c(!0), u(
|
|
3669
|
+
(c(!0), u(I, null, j(s.attachmentsOf(
|
|
3642
3670
|
M.message
|
|
3643
3671
|
), (N, $) => (c(), R(T, {
|
|
3644
3672
|
key: `${s.messageKey(M.message)}-att-${$}`,
|
|
@@ -3646,31 +3674,32 @@ function Or(e, t, n, i, r, s) {
|
|
|
3646
3674
|
}, null, 8, ["attachment"]))), 128))
|
|
3647
3675
|
], 2)) : b("", !0)
|
|
3648
3676
|
]))
|
|
3649
|
-
], 14,
|
|
3677
|
+
], 14, kr))), 128)),
|
|
3650
3678
|
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (c(), u("div", {
|
|
3651
3679
|
key: 0,
|
|
3652
3680
|
class: x(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
3653
3681
|
}, [
|
|
3654
|
-
A.role !== "user" ? (c(), u("span",
|
|
3655
|
-
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span",
|
|
3656
|
-
s.lastTimeOf(A) ? (c(), u("span",
|
|
3682
|
+
A.role !== "user" ? (c(), u("span", Sr, v(s.roleLabel(A)), 1)) : b("", !0),
|
|
3683
|
+
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span", Mr, "·")) : b("", !0),
|
|
3684
|
+
s.lastTimeOf(A) ? (c(), u("span", Tr, v(s.lastTimeOf(A)), 1)) : b("", !0)
|
|
3657
3685
|
], 2)) : b("", !0)
|
|
3658
3686
|
], 64))
|
|
3659
3687
|
], 2)) : b("", !0)
|
|
3660
3688
|
], 64))), 128)),
|
|
3661
|
-
n.streamingActive ? (c(), u("div",
|
|
3662
|
-
o("div",
|
|
3689
|
+
n.streamingActive ? (c(), u("div", xr, [
|
|
3690
|
+
o("div", Or, [
|
|
3663
3691
|
q(a, {
|
|
3664
3692
|
size: 26,
|
|
3665
|
-
tail: !0
|
|
3666
|
-
|
|
3693
|
+
tail: !0,
|
|
3694
|
+
"image-url": n.aiAgentAvatarUrl
|
|
3695
|
+
}, null, 8, ["image-url"])
|
|
3667
3696
|
]),
|
|
3668
3697
|
q(E)
|
|
3669
3698
|
])) : b("", !0)
|
|
3670
3699
|
], 34);
|
|
3671
3700
|
}
|
|
3672
|
-
const Lr = /* @__PURE__ */ B(
|
|
3673
|
-
function
|
|
3701
|
+
const Lr = /* @__PURE__ */ B(mr, [["render", Ir], ["__scopeId", "data-v-fc7e23b9"]]), me = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", ve = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
3702
|
+
function Br() {
|
|
3674
3703
|
return ve && [
|
|
3675
3704
|
"video/webm;codecs=vp9,opus",
|
|
3676
3705
|
"video/webm;codecs=vp8,opus",
|
|
@@ -3690,11 +3719,11 @@ function Re({ audio: e }) {
|
|
|
3690
3719
|
systemAudio: e ? "include" : "exclude"
|
|
3691
3720
|
};
|
|
3692
3721
|
}
|
|
3693
|
-
function
|
|
3722
|
+
function $a(e) {
|
|
3694
3723
|
return e ? e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "file" : "file";
|
|
3695
3724
|
}
|
|
3696
|
-
async function
|
|
3697
|
-
if (!
|
|
3725
|
+
async function Er() {
|
|
3726
|
+
if (!me) return null;
|
|
3698
3727
|
let e;
|
|
3699
3728
|
try {
|
|
3700
3729
|
e = await navigator.mediaDevices.getDisplayMedia(
|
|
@@ -3704,7 +3733,7 @@ async function Br() {
|
|
|
3704
3733
|
return (t == null ? void 0 : t.name) !== "NotAllowedError" && console.error("[media] screenshot picker", t), null;
|
|
3705
3734
|
}
|
|
3706
3735
|
try {
|
|
3707
|
-
return await
|
|
3736
|
+
return await Rr(e);
|
|
3708
3737
|
} catch (t) {
|
|
3709
3738
|
return console.error("[media] screenshot capture", t), null;
|
|
3710
3739
|
} finally {
|
|
@@ -3713,22 +3742,22 @@ async function Br() {
|
|
|
3713
3742
|
});
|
|
3714
3743
|
}
|
|
3715
3744
|
}
|
|
3716
|
-
async function
|
|
3745
|
+
async function Rr(e) {
|
|
3717
3746
|
const t = document.createElement("video");
|
|
3718
3747
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
3719
3748
|
const n = t.videoWidth || 1280, i = t.videoHeight || 720, r = document.createElement("canvas");
|
|
3720
3749
|
r.width = n, r.height = i, r.getContext("2d").drawImage(t, 0, 0, n, i);
|
|
3721
|
-
const s = await new Promise((l,
|
|
3750
|
+
const s = await new Promise((l, p) => {
|
|
3722
3751
|
r.toBlob(
|
|
3723
|
-
(C) => C ? l(C) :
|
|
3752
|
+
(C) => C ? l(C) : p(new Error("toBlob failed")),
|
|
3724
3753
|
"image/png"
|
|
3725
3754
|
);
|
|
3726
3755
|
}), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
3727
3756
|
return new File([s], `capture-${a}.png`, { type: "image/png" });
|
|
3728
3757
|
}
|
|
3729
|
-
async function
|
|
3758
|
+
async function Nr(e = {}) {
|
|
3730
3759
|
var C;
|
|
3731
|
-
if (!
|
|
3760
|
+
if (!me || !ve) return null;
|
|
3732
3761
|
let t;
|
|
3733
3762
|
try {
|
|
3734
3763
|
t = await navigator.mediaDevices.getDisplayMedia(
|
|
@@ -3737,7 +3766,7 @@ async function Rr(e = {}) {
|
|
|
3737
3766
|
} catch (k) {
|
|
3738
3767
|
return (k == null ? void 0 : k.name) !== "NotAllowedError" && console.error("[media] record picker", k), null;
|
|
3739
3768
|
}
|
|
3740
|
-
const n =
|
|
3769
|
+
const n = Br();
|
|
3741
3770
|
let i;
|
|
3742
3771
|
try {
|
|
3743
3772
|
i = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
|
|
@@ -3755,10 +3784,10 @@ async function Rr(e = {}) {
|
|
|
3755
3784
|
if (s && clearInterval(s), t.getTracks().forEach((E) => {
|
|
3756
3785
|
E.stop();
|
|
3757
3786
|
}), r.length) {
|
|
3758
|
-
const E = i.mimeType || n || "video/webm", A = new Blob(r, { type: E }), H = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19),
|
|
3787
|
+
const E = i.mimeType || n || "video/webm", A = new Blob(r, { type: E }), H = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), P = new File([A], `ecran-${M}.${H}`, {
|
|
3759
3788
|
type: E
|
|
3760
3789
|
});
|
|
3761
|
-
(k = e.onfinalize) == null || k.call(e,
|
|
3790
|
+
(k = e.onfinalize) == null || k.call(e, P);
|
|
3762
3791
|
} else
|
|
3763
3792
|
(T = e.oncancel) == null || T.call(e);
|
|
3764
3793
|
}), t.getVideoTracks().forEach((k) => {
|
|
@@ -3780,10 +3809,10 @@ async function Rr(e = {}) {
|
|
|
3780
3809
|
}), null;
|
|
3781
3810
|
}
|
|
3782
3811
|
(C = e.onstart) == null || C.call(e);
|
|
3783
|
-
const
|
|
3812
|
+
const p = Date.now();
|
|
3784
3813
|
return s = setInterval(() => {
|
|
3785
3814
|
var k;
|
|
3786
|
-
(k = e.ontick) == null || k.call(e, Date.now() -
|
|
3815
|
+
(k = e.ontick) == null || k.call(e, Date.now() - p);
|
|
3787
3816
|
}, 500), {
|
|
3788
3817
|
stop: l,
|
|
3789
3818
|
get state() {
|
|
@@ -3791,7 +3820,7 @@ async function Rr(e = {}) {
|
|
|
3791
3820
|
}
|
|
3792
3821
|
};
|
|
3793
3822
|
}
|
|
3794
|
-
const
|
|
3823
|
+
const Fr = [
|
|
3795
3824
|
{
|
|
3796
3825
|
action: "file",
|
|
3797
3826
|
labelKey: "composer.attachFile",
|
|
@@ -3807,12 +3836,12 @@ const Nr = [
|
|
|
3807
3836
|
labelKey: "composer.recordScreen",
|
|
3808
3837
|
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"
|
|
3809
3838
|
}
|
|
3810
|
-
],
|
|
3839
|
+
], jr = {
|
|
3811
3840
|
name: "WmComposer",
|
|
3812
3841
|
inject: {
|
|
3813
3842
|
// Translator shared by the Messenger shell; French fallback when
|
|
3814
3843
|
// the component is used standalone.
|
|
3815
|
-
t: { default: () =>
|
|
3844
|
+
t: { default: () => U() }
|
|
3816
3845
|
},
|
|
3817
3846
|
props: {
|
|
3818
3847
|
modelValue: { type: String, default: "" },
|
|
@@ -3835,10 +3864,10 @@ const Nr = [
|
|
|
3835
3864
|
return !this.disabled && !!this.local.trim();
|
|
3836
3865
|
},
|
|
3837
3866
|
attachItems() {
|
|
3838
|
-
return
|
|
3867
|
+
return Fr.map((e) => ({
|
|
3839
3868
|
...e,
|
|
3840
3869
|
label: this.t(e.labelKey),
|
|
3841
|
-
disabled: e.action === "screenshot" && !
|
|
3870
|
+
disabled: e.action === "screenshot" && !me || e.action === "record" && (!me || !ve)
|
|
3842
3871
|
}));
|
|
3843
3872
|
},
|
|
3844
3873
|
recordingElapsedLabel() {
|
|
@@ -3908,13 +3937,13 @@ const Nr = [
|
|
|
3908
3937
|
},
|
|
3909
3938
|
async captureScreenshot() {
|
|
3910
3939
|
if (this.disabled) return;
|
|
3911
|
-
const e = await
|
|
3940
|
+
const e = await Er();
|
|
3912
3941
|
e && this.$emit("attach", e);
|
|
3913
3942
|
},
|
|
3914
3943
|
async startRecording() {
|
|
3915
3944
|
if (this.recording || this.disabled) return;
|
|
3916
3945
|
this.recordingElapsed = 0;
|
|
3917
|
-
const e = await
|
|
3946
|
+
const e = await Nr({
|
|
3918
3947
|
onstart: () => {
|
|
3919
3948
|
this.recording = !0;
|
|
3920
3949
|
},
|
|
@@ -3939,21 +3968,21 @@ const Nr = [
|
|
|
3939
3968
|
}
|
|
3940
3969
|
}
|
|
3941
3970
|
}
|
|
3942
|
-
},
|
|
3971
|
+
}, Ur = { class: "wm-compose-wrap" }, Pr = {
|
|
3943
3972
|
key: 0,
|
|
3944
3973
|
class: "wm-rec"
|
|
3945
|
-
}, Dr = { class: "wm-rec__lbl" },
|
|
3974
|
+
}, Dr = { class: "wm-rec__lbl" }, $r = {
|
|
3946
3975
|
key: 1,
|
|
3947
3976
|
class: "wm-compose__menu",
|
|
3948
3977
|
role: "menu"
|
|
3949
|
-
},
|
|
3978
|
+
}, Hr = ["disabled", "onClick"], qr = { class: "wm-compose__menuIcon" }, zr = {
|
|
3950
3979
|
viewBox: "0 0 24 24",
|
|
3951
3980
|
width: "14",
|
|
3952
3981
|
height: "14",
|
|
3953
3982
|
"aria-hidden": "true"
|
|
3954
|
-
},
|
|
3955
|
-
function
|
|
3956
|
-
return c(), u("div",
|
|
3983
|
+
}, Vr = ["d"], Kr = ["placeholder", "disabled"], Wr = { class: "wm-compose__actions" }, Gr = ["title", "aria-label", "disabled"], Yr = ["disabled", "aria-label"];
|
|
3984
|
+
function Qr(e, t, n, i, r, s) {
|
|
3985
|
+
return c(), u("div", Ur, [
|
|
3957
3986
|
r.recording ? (c(), u("div", Pr, [
|
|
3958
3987
|
t[8] || (t[8] = o("span", {
|
|
3959
3988
|
class: "wm-rec__dot",
|
|
@@ -3982,16 +4011,16 @@ function Yr(e, t, n, i, r, s) {
|
|
|
3982
4011
|
class: "wm-compose__overlay",
|
|
3983
4012
|
onClick: t[2] || (t[2] = (a) => r.attachOpen = !1)
|
|
3984
4013
|
})) : b("", !0),
|
|
3985
|
-
r.attachOpen ? (c(), u("div",
|
|
3986
|
-
(c(!0), u(
|
|
4014
|
+
r.attachOpen ? (c(), u("div", $r, [
|
|
4015
|
+
(c(!0), u(I, null, j(s.attachItems, (a) => (c(), u("button", {
|
|
3987
4016
|
key: a.action,
|
|
3988
4017
|
type: "button",
|
|
3989
4018
|
class: "wm-compose__menuItem",
|
|
3990
4019
|
disabled: a.disabled,
|
|
3991
4020
|
onClick: (l) => s.onAttachAction(a.action)
|
|
3992
4021
|
}, [
|
|
3993
|
-
o("span",
|
|
3994
|
-
(c(), u("svg",
|
|
4022
|
+
o("span", qr, [
|
|
4023
|
+
(c(), u("svg", zr, [
|
|
3995
4024
|
o("path", {
|
|
3996
4025
|
d: a.path,
|
|
3997
4026
|
stroke: "currentColor",
|
|
@@ -3999,11 +4028,11 @@ function Yr(e, t, n, i, r, s) {
|
|
|
3999
4028
|
"stroke-linecap": "round",
|
|
4000
4029
|
"stroke-linejoin": "round",
|
|
4001
4030
|
fill: "none"
|
|
4002
|
-
}, null, 8,
|
|
4031
|
+
}, null, 8, Vr)
|
|
4003
4032
|
]))
|
|
4004
4033
|
]),
|
|
4005
4034
|
o("span", null, v(a.label), 1)
|
|
4006
|
-
], 8,
|
|
4035
|
+
], 8, Hr))), 128))
|
|
4007
4036
|
])) : b("", !0),
|
|
4008
4037
|
V(o("textarea", {
|
|
4009
4038
|
ref: "inputEl",
|
|
@@ -4014,10 +4043,10 @@ function Yr(e, t, n, i, r, s) {
|
|
|
4014
4043
|
disabled: n.disabled,
|
|
4015
4044
|
onKeydown: t[4] || (t[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
|
|
4016
4045
|
onInput: t[5] || (t[5] = (...a) => s.autosize && s.autosize(...a))
|
|
4017
|
-
}, null, 40,
|
|
4046
|
+
}, null, 40, Kr), [
|
|
4018
4047
|
[ee, r.local]
|
|
4019
4048
|
]),
|
|
4020
|
-
o("div",
|
|
4049
|
+
o("div", Wr, [
|
|
4021
4050
|
o("button", {
|
|
4022
4051
|
type: "button",
|
|
4023
4052
|
class: x(["wm-compose__icon", { "is-open": r.attachOpen }]),
|
|
@@ -4039,7 +4068,7 @@ function Yr(e, t, n, i, r, s) {
|
|
|
4039
4068
|
}, [
|
|
4040
4069
|
o("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48" })
|
|
4041
4070
|
], -1)
|
|
4042
|
-
])], 10,
|
|
4071
|
+
])], 10, Gr),
|
|
4043
4072
|
o("button", {
|
|
4044
4073
|
type: "submit",
|
|
4045
4074
|
class: x(["wm-compose__send", { "is-empty": !s.canSend }]),
|
|
@@ -4059,12 +4088,12 @@ function Yr(e, t, n, i, r, s) {
|
|
|
4059
4088
|
}, [
|
|
4060
4089
|
o("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
4061
4090
|
], -1)
|
|
4062
|
-
])], 10,
|
|
4091
|
+
])], 10, Yr)
|
|
4063
4092
|
])
|
|
4064
4093
|
], 34)
|
|
4065
4094
|
]);
|
|
4066
4095
|
}
|
|
4067
|
-
const
|
|
4096
|
+
const Xr = /* @__PURE__ */ B(jr, [["render", Qr], ["__scopeId", "data-v-aa81dbb8"]]), Jr = {
|
|
4068
4097
|
name: "WmSuggestionChips",
|
|
4069
4098
|
props: {
|
|
4070
4099
|
items: { type: Array, default: () => [] },
|
|
@@ -4081,28 +4110,28 @@ const Qr = /* @__PURE__ */ B(Fr, [["render", Yr], ["__scopeId", "data-v-aa81dbb8
|
|
|
4081
4110
|
return this.items.map((e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.text) || "").join("§");
|
|
4082
4111
|
}
|
|
4083
4112
|
}
|
|
4084
|
-
},
|
|
4085
|
-
function
|
|
4113
|
+
}, Zr = ["onClick"];
|
|
4114
|
+
function ei(e, t, n, i, r, s) {
|
|
4086
4115
|
return n.items.length ? (c(), u("div", {
|
|
4087
4116
|
key: s.batchKey,
|
|
4088
4117
|
class: "wm-chips"
|
|
4089
4118
|
}, [
|
|
4090
|
-
(c(!0), u(
|
|
4119
|
+
(c(!0), u(I, null, j(n.items, (a, l) => (c(), u("button", {
|
|
4091
4120
|
key: l,
|
|
4092
4121
|
type: "button",
|
|
4093
4122
|
class: "wm-chip",
|
|
4094
4123
|
style: K({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
|
|
4095
|
-
onClick: (
|
|
4096
|
-
}, v(a.label), 13,
|
|
4124
|
+
onClick: (p) => e.$emit("select", a)
|
|
4125
|
+
}, v(a.label), 13, Zr))), 128))
|
|
4097
4126
|
])) : b("", !0);
|
|
4098
4127
|
}
|
|
4099
|
-
const
|
|
4128
|
+
const ti = /* @__PURE__ */ B(Jr, [["render", ei], ["__scopeId", "data-v-47ad8085"]]), ni = {
|
|
4100
4129
|
name: "WmApprovalCard",
|
|
4101
4130
|
components: { AIAvatar: le },
|
|
4102
4131
|
inject: {
|
|
4103
4132
|
// Translator shared by the Messenger shell; French fallback when
|
|
4104
4133
|
// the component is used standalone.
|
|
4105
|
-
t: { default: () =>
|
|
4134
|
+
t: { default: () => U() }
|
|
4106
4135
|
},
|
|
4107
4136
|
props: {
|
|
4108
4137
|
action: { type: String, required: !0 },
|
|
@@ -4138,23 +4167,23 @@ const ei = /* @__PURE__ */ B(Xr, [["render", Zr], ["__scopeId", "data-v-47ad8085
|
|
|
4138
4167
|
return ((e = this.rejectCallback) == null ? void 0 : e.label) || this.t("approval.reject");
|
|
4139
4168
|
}
|
|
4140
4169
|
}
|
|
4141
|
-
},
|
|
4170
|
+
}, si = { class: "wm-approval" }, ri = { class: "wm-approval__head" }, ii = { class: "wm-approval__icon" }, ai = { class: "wm-approval__main" }, oi = { class: "wm-approval__title" }, li = {
|
|
4142
4171
|
key: 0,
|
|
4143
4172
|
class: "wm-approval__detail"
|
|
4144
|
-
},
|
|
4145
|
-
function
|
|
4146
|
-
const a =
|
|
4147
|
-
return c(), u("div",
|
|
4148
|
-
o("div",
|
|
4149
|
-
o("div",
|
|
4173
|
+
}, ci = { class: "wm-approval__actions" };
|
|
4174
|
+
function di(e, t, n, i, r, s) {
|
|
4175
|
+
const a = L("AIAvatar");
|
|
4176
|
+
return c(), u("div", si, [
|
|
4177
|
+
o("div", ri, [
|
|
4178
|
+
o("div", ii, [
|
|
4150
4179
|
q(a, { size: 24 })
|
|
4151
4180
|
]),
|
|
4152
|
-
o("div",
|
|
4153
|
-
o("div",
|
|
4154
|
-
n.detail ? (c(), u("div",
|
|
4181
|
+
o("div", ai, [
|
|
4182
|
+
o("div", oi, v(n.action), 1),
|
|
4183
|
+
n.detail ? (c(), u("div", li, v(n.detail), 1)) : b("", !0)
|
|
4155
4184
|
])
|
|
4156
4185
|
]),
|
|
4157
|
-
o("div",
|
|
4186
|
+
o("div", ci, [
|
|
4158
4187
|
s.rejectId ? (c(), u("button", {
|
|
4159
4188
|
key: 0,
|
|
4160
4189
|
type: "button",
|
|
@@ -4170,9 +4199,9 @@ function ci(e, t, n, i, r, s) {
|
|
|
4170
4199
|
])
|
|
4171
4200
|
]);
|
|
4172
4201
|
}
|
|
4173
|
-
const
|
|
4202
|
+
const ui = /* @__PURE__ */ B(ni, [["render", di], ["__scopeId", "data-v-53ddf2b2"]]);
|
|
4174
4203
|
let Me = 0;
|
|
4175
|
-
const
|
|
4204
|
+
const mi = /* @__PURE__ */ new Set([
|
|
4176
4205
|
"text",
|
|
4177
4206
|
"textarea",
|
|
4178
4207
|
"number",
|
|
@@ -4186,7 +4215,7 @@ const ui = /* @__PURE__ */ new Set([
|
|
|
4186
4215
|
inject: {
|
|
4187
4216
|
// Translator shared by the Messenger shell; French fallback when
|
|
4188
4217
|
// the component is used standalone.
|
|
4189
|
-
t: { default: () =>
|
|
4218
|
+
t: { default: () => U() }
|
|
4190
4219
|
},
|
|
4191
4220
|
props: {
|
|
4192
4221
|
form: { type: Object, required: !0 },
|
|
@@ -4208,7 +4237,7 @@ const ui = /* @__PURE__ */ new Set([
|
|
|
4208
4237
|
// douteux.
|
|
4209
4238
|
normalizedFields() {
|
|
4210
4239
|
var t;
|
|
4211
|
-
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !
|
|
4240
|
+
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !mi.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
|
|
4212
4241
|
}
|
|
4213
4242
|
},
|
|
4214
4243
|
created() {
|
|
@@ -4261,50 +4290,50 @@ const ui = /* @__PURE__ */ new Set([
|
|
|
4261
4290
|
}
|
|
4262
4291
|
}
|
|
4263
4292
|
}
|
|
4264
|
-
},
|
|
4293
|
+
}, fi = { class: "wm-form" }, _i = { class: "wm-form__head" }, gi = { class: "wm-form__icon" }, pi = { class: "wm-form__main" }, vi = { class: "wm-form__title" }, yi = {
|
|
4265
4294
|
key: 0,
|
|
4266
4295
|
class: "wm-form__detail"
|
|
4267
|
-
},
|
|
4296
|
+
}, bi = ["for"], wi = {
|
|
4268
4297
|
key: 0,
|
|
4269
4298
|
class: "wm-form__req",
|
|
4270
4299
|
"aria-hidden": "true"
|
|
4271
|
-
},
|
|
4300
|
+
}, ki = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ci = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ai = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Si = ["id", "onUpdate:modelValue", "required", "disabled"], Mi = {
|
|
4272
4301
|
key: 4,
|
|
4273
4302
|
class: "wm-form__bool"
|
|
4274
|
-
},
|
|
4303
|
+
}, Ti = ["id", "onUpdate:modelValue", "disabled"], xi = ["id", "onUpdate:modelValue", "required", "disabled"], Oi = {
|
|
4275
4304
|
value: "",
|
|
4276
4305
|
disabled: ""
|
|
4277
|
-
},
|
|
4306
|
+
}, Ii = ["value"], Li = {
|
|
4278
4307
|
key: 6,
|
|
4279
4308
|
class: "wm-form__multi"
|
|
4280
|
-
},
|
|
4309
|
+
}, Bi = ["value", "checked", "disabled", "onChange"], Ei = {
|
|
4281
4310
|
key: 0,
|
|
4282
4311
|
class: "wm-form__err"
|
|
4283
|
-
},
|
|
4312
|
+
}, Ri = ["disabled"], Ni = {
|
|
4284
4313
|
key: 0,
|
|
4285
4314
|
class: "wm-form__spinner",
|
|
4286
4315
|
"aria-hidden": "true"
|
|
4287
|
-
},
|
|
4316
|
+
}, Fi = {
|
|
4288
4317
|
key: 2,
|
|
4289
4318
|
class: "wm-form__doneLbl"
|
|
4290
4319
|
};
|
|
4291
|
-
function
|
|
4292
|
-
const a =
|
|
4293
|
-
return c(), u("div",
|
|
4294
|
-
o("div",
|
|
4295
|
-
o("div",
|
|
4320
|
+
function ji(e, t, n, i, r, s) {
|
|
4321
|
+
const a = L("AIAvatar");
|
|
4322
|
+
return c(), u("div", fi, [
|
|
4323
|
+
o("div", _i, [
|
|
4324
|
+
o("div", gi, [
|
|
4296
4325
|
q(a, { size: 24 })
|
|
4297
4326
|
]),
|
|
4298
4327
|
o("div", pi, [
|
|
4299
|
-
o("div",
|
|
4300
|
-
n.form.description ? (c(), u("div",
|
|
4328
|
+
o("div", vi, v(n.form.title || s.t("form.title")), 1),
|
|
4329
|
+
n.form.description ? (c(), u("div", yi, v(n.form.description), 1)) : b("", !0)
|
|
4301
4330
|
])
|
|
4302
4331
|
]),
|
|
4303
4332
|
o("form", {
|
|
4304
4333
|
class: "wm-form__body",
|
|
4305
4334
|
onSubmit: t[0] || (t[0] = X((...l) => s.onSubmit && s.onSubmit(...l), ["prevent"]))
|
|
4306
4335
|
}, [
|
|
4307
|
-
(c(!0), u(
|
|
4336
|
+
(c(!0), u(I, null, j(s.normalizedFields, (l) => (c(), u("div", {
|
|
4308
4337
|
key: l.key,
|
|
4309
4338
|
class: "wm-form__field"
|
|
4310
4339
|
}, [
|
|
@@ -4312,41 +4341,41 @@ function Fi(e, t, n, i, r, s) {
|
|
|
4312
4341
|
for: `wm-f-${r._uid}-${l.key}`,
|
|
4313
4342
|
class: "wm-form__label"
|
|
4314
4343
|
}, [
|
|
4315
|
-
|
|
4316
|
-
l.required ? (c(), u("span",
|
|
4317
|
-
], 8,
|
|
4344
|
+
ge(v(l.label), 1),
|
|
4345
|
+
l.required ? (c(), u("span", wi, "*")) : b("", !0)
|
|
4346
|
+
], 8, bi),
|
|
4318
4347
|
l.type === "text" ? V((c(), u("input", {
|
|
4319
4348
|
key: 0,
|
|
4320
4349
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4321
|
-
"onUpdate:modelValue": (
|
|
4350
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4322
4351
|
type: "text",
|
|
4323
4352
|
class: "wm-form__input",
|
|
4324
4353
|
placeholder: l.placeholder || "",
|
|
4325
4354
|
required: l.required,
|
|
4326
4355
|
disabled: n.readOnly || r.busy
|
|
4327
|
-
}, null, 8,
|
|
4356
|
+
}, null, 8, ki)), [
|
|
4328
4357
|
[ee, r.values[l.key]]
|
|
4329
4358
|
]) : l.type === "textarea" ? V((c(), u("textarea", {
|
|
4330
4359
|
key: 1,
|
|
4331
4360
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4332
|
-
"onUpdate:modelValue": (
|
|
4361
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4333
4362
|
class: "wm-form__textarea",
|
|
4334
4363
|
rows: "3",
|
|
4335
4364
|
placeholder: l.placeholder || "",
|
|
4336
4365
|
required: l.required,
|
|
4337
4366
|
disabled: n.readOnly || r.busy
|
|
4338
|
-
}, null, 8,
|
|
4367
|
+
}, null, 8, Ci)), [
|
|
4339
4368
|
[ee, r.values[l.key]]
|
|
4340
4369
|
]) : l.type === "number" ? V((c(), u("input", {
|
|
4341
4370
|
key: 2,
|
|
4342
4371
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4343
|
-
"onUpdate:modelValue": (
|
|
4372
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4344
4373
|
type: "number",
|
|
4345
4374
|
class: "wm-form__input",
|
|
4346
4375
|
placeholder: l.placeholder || "",
|
|
4347
4376
|
required: l.required,
|
|
4348
4377
|
disabled: n.readOnly || r.busy
|
|
4349
|
-
}, null, 8,
|
|
4378
|
+
}, null, 8, Ai)), [
|
|
4350
4379
|
[
|
|
4351
4380
|
ee,
|
|
4352
4381
|
r.values[l.key],
|
|
@@ -4356,77 +4385,77 @@ function Fi(e, t, n, i, r, s) {
|
|
|
4356
4385
|
]) : l.type === "date" ? V((c(), u("input", {
|
|
4357
4386
|
key: 3,
|
|
4358
4387
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4359
|
-
"onUpdate:modelValue": (
|
|
4388
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4360
4389
|
type: "date",
|
|
4361
4390
|
class: "wm-form__input",
|
|
4362
4391
|
required: l.required,
|
|
4363
4392
|
disabled: n.readOnly || r.busy
|
|
4364
|
-
}, null, 8,
|
|
4393
|
+
}, null, 8, Si)), [
|
|
4365
4394
|
[ee, r.values[l.key]]
|
|
4366
|
-
]) : l.type === "boolean" ? (c(), u("label",
|
|
4395
|
+
]) : l.type === "boolean" ? (c(), u("label", Mi, [
|
|
4367
4396
|
V(o("input", {
|
|
4368
4397
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4369
|
-
"onUpdate:modelValue": (
|
|
4398
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4370
4399
|
type: "checkbox",
|
|
4371
4400
|
disabled: n.readOnly || r.busy
|
|
4372
|
-
}, null, 8,
|
|
4401
|
+
}, null, 8, Ti), [
|
|
4373
4402
|
[$e, r.values[l.key]]
|
|
4374
4403
|
]),
|
|
4375
4404
|
o("span", null, v(l.placeholder || s.t("common.yes")), 1)
|
|
4376
4405
|
])) : l.type === "select" ? V((c(), u("select", {
|
|
4377
4406
|
key: 5,
|
|
4378
4407
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4379
|
-
"onUpdate:modelValue": (
|
|
4408
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4380
4409
|
class: "wm-form__select",
|
|
4381
4410
|
required: l.required,
|
|
4382
4411
|
disabled: n.readOnly || r.busy
|
|
4383
4412
|
}, [
|
|
4384
|
-
o("option",
|
|
4385
|
-
(c(!0), u(
|
|
4386
|
-
key:
|
|
4387
|
-
value:
|
|
4388
|
-
}, v(
|
|
4389
|
-
], 8,
|
|
4413
|
+
o("option", Oi, v(l.placeholder || s.t("form.choose")), 1),
|
|
4414
|
+
(c(!0), u(I, null, j(l.options, (p) => (c(), u("option", {
|
|
4415
|
+
key: p.value,
|
|
4416
|
+
value: p.value
|
|
4417
|
+
}, v(p.label), 9, Ii))), 128))
|
|
4418
|
+
], 8, xi)), [
|
|
4390
4419
|
[He, r.values[l.key]]
|
|
4391
4420
|
]) : l.type === "multiselect" ? (c(), u("div", Li, [
|
|
4392
|
-
(c(!0), u(
|
|
4393
|
-
key:
|
|
4421
|
+
(c(!0), u(I, null, j(l.options, (p) => (c(), u("label", {
|
|
4422
|
+
key: p.value,
|
|
4394
4423
|
class: "wm-form__multiItem"
|
|
4395
4424
|
}, [
|
|
4396
4425
|
o("input", {
|
|
4397
4426
|
type: "checkbox",
|
|
4398
|
-
value:
|
|
4399
|
-
checked: Array.isArray(r.values[l.key]) && r.values[l.key].includes(
|
|
4427
|
+
value: p.value,
|
|
4428
|
+
checked: Array.isArray(r.values[l.key]) && r.values[l.key].includes(p.value),
|
|
4400
4429
|
disabled: n.readOnly || r.busy,
|
|
4401
4430
|
onChange: (C) => s.toggleMulti(
|
|
4402
4431
|
l.key,
|
|
4403
|
-
|
|
4432
|
+
p.value,
|
|
4404
4433
|
C.target.checked
|
|
4405
4434
|
)
|
|
4406
|
-
}, null, 40,
|
|
4407
|
-
o("span", null, v(
|
|
4435
|
+
}, null, 40, Bi),
|
|
4436
|
+
o("span", null, v(p.label), 1)
|
|
4408
4437
|
]))), 128))
|
|
4409
4438
|
])) : b("", !0)
|
|
4410
4439
|
]))), 128)),
|
|
4411
|
-
r.error ? (c(), u("div",
|
|
4412
|
-
n.readOnly ? (c(), u("div",
|
|
4440
|
+
r.error ? (c(), u("div", Ei, v(r.error), 1)) : b("", !0),
|
|
4441
|
+
n.readOnly ? (c(), u("div", Fi, v(s.t("form.responseSent")), 1)) : (c(), u("button", {
|
|
4413
4442
|
key: 1,
|
|
4414
4443
|
type: "submit",
|
|
4415
4444
|
class: "wm-form__submit",
|
|
4416
4445
|
disabled: r.busy
|
|
4417
4446
|
}, [
|
|
4418
|
-
r.busy ? (c(), u("span",
|
|
4447
|
+
r.busy ? (c(), u("span", Ni)) : b("", !0),
|
|
4419
4448
|
o("span", null, v(r.busy ? s.t("common.sending") : n.form.submit_label || s.t("common.send")), 1)
|
|
4420
|
-
], 8,
|
|
4449
|
+
], 8, Ri))
|
|
4421
4450
|
], 32)
|
|
4422
4451
|
]);
|
|
4423
4452
|
}
|
|
4424
|
-
const
|
|
4453
|
+
const Ui = /* @__PURE__ */ B(hi, [["render", ji], ["__scopeId", "data-v-75332dad"]]), Pi = {
|
|
4425
4454
|
name: "WmFeedback",
|
|
4426
4455
|
inject: {
|
|
4427
4456
|
// Translator shared by the Messenger shell; French fallback when
|
|
4428
4457
|
// the component is used standalone.
|
|
4429
|
-
t: { default: () =>
|
|
4458
|
+
t: { default: () => U() }
|
|
4430
4459
|
},
|
|
4431
4460
|
props: {
|
|
4432
4461
|
busy: { type: Boolean, default: !1 },
|
|
@@ -4455,13 +4484,13 @@ const ji = /* @__PURE__ */ B(hi, [["render", Fi], ["__scopeId", "data-v-75332dad
|
|
|
4455
4484
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
4456
4485
|
}
|
|
4457
4486
|
}
|
|
4458
|
-
}, Di = { class: "wm-fb" },
|
|
4487
|
+
}, Di = { class: "wm-fb" }, $i = { class: "wm-fb__title" }, Hi = { class: "wm-fb__sub" }, qi = { class: "wm-fb__row" }, zi = ["onClick"], Vi = { class: "wm-fb__emoji" }, Ki = { class: "wm-fb__label" }, Wi = ["disabled"], Gi = {
|
|
4459
4488
|
key: 1,
|
|
4460
4489
|
class: "wm-fb__done"
|
|
4461
|
-
},
|
|
4462
|
-
function
|
|
4490
|
+
}, Yi = { class: "wm-fb__doneTitle" }, Qi = { class: "wm-fb__doneSub" };
|
|
4491
|
+
function Xi(e, t, n, i, r, s) {
|
|
4463
4492
|
return c(), u("div", Di, [
|
|
4464
|
-
n.done ? (c(), u("div",
|
|
4493
|
+
n.done ? (c(), u("div", Gi, [
|
|
4465
4494
|
t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
|
|
4466
4495
|
o("svg", {
|
|
4467
4496
|
width: "16",
|
|
@@ -4477,37 +4506,37 @@ function Qi(e, t, n, i, r, s) {
|
|
|
4477
4506
|
o("path", { d: "M20 6L9 17l-5-5" })
|
|
4478
4507
|
])
|
|
4479
4508
|
], -1)),
|
|
4480
|
-
o("div",
|
|
4481
|
-
o("div",
|
|
4482
|
-
])) : (c(), u(
|
|
4483
|
-
o("div",
|
|
4484
|
-
o("div",
|
|
4485
|
-
o("div",
|
|
4486
|
-
(c(!0), u(
|
|
4509
|
+
o("div", Yi, v(s.t("feedback.doneTitle")), 1),
|
|
4510
|
+
o("div", Qi, v(s.t("feedback.doneSubtitle")), 1)
|
|
4511
|
+
])) : (c(), u(I, { key: 0 }, [
|
|
4512
|
+
o("div", $i, v(s.t("feedback.question")), 1),
|
|
4513
|
+
o("div", Hi, v(s.t("feedback.subtitle")), 1),
|
|
4514
|
+
o("div", qi, [
|
|
4515
|
+
(c(!0), u(I, null, j(s.options, (a) => (c(), u("button", {
|
|
4487
4516
|
key: a.v,
|
|
4488
4517
|
type: "button",
|
|
4489
4518
|
class: x(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
|
|
4490
4519
|
onClick: (l) => r.sel = a.v
|
|
4491
4520
|
}, [
|
|
4492
|
-
o("span",
|
|
4493
|
-
o("span",
|
|
4494
|
-
], 10,
|
|
4521
|
+
o("span", Vi, v(a.e), 1),
|
|
4522
|
+
o("span", Ki, v(a.l), 1)
|
|
4523
|
+
], 10, zi))), 128))
|
|
4495
4524
|
]),
|
|
4496
4525
|
o("button", {
|
|
4497
4526
|
type: "button",
|
|
4498
4527
|
class: "wm-fb__send",
|
|
4499
4528
|
disabled: !r.sel || n.busy,
|
|
4500
4529
|
onClick: t[0] || (t[0] = (...a) => s.onSend && s.onSend(...a))
|
|
4501
|
-
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9,
|
|
4530
|
+
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9, Wi)
|
|
4502
4531
|
], 64))
|
|
4503
4532
|
]);
|
|
4504
4533
|
}
|
|
4505
|
-
const
|
|
4534
|
+
const Ji = /* @__PURE__ */ B(Pi, [["render", Xi], ["__scopeId", "data-v-9b630564"]]), Zi = {
|
|
4506
4535
|
name: "WmMoreMenu",
|
|
4507
4536
|
inject: {
|
|
4508
4537
|
// Translator shared by the Messenger shell; French fallback when
|
|
4509
4538
|
// the component is used standalone.
|
|
4510
|
-
t: { default: () =>
|
|
4539
|
+
t: { default: () => U() }
|
|
4511
4540
|
},
|
|
4512
4541
|
props: {
|
|
4513
4542
|
canRename: { type: Boolean, default: !0 },
|
|
@@ -4545,24 +4574,24 @@ const Xi = /* @__PURE__ */ B(Pi, [["render", Qi], ["__scopeId", "data-v-9b630564
|
|
|
4545
4574
|
this.browserNotifOn = !this.browserNotifOn, this.$emit("browser-notif-toggle", this.browserNotifOn);
|
|
4546
4575
|
}
|
|
4547
4576
|
}
|
|
4548
|
-
},
|
|
4577
|
+
}, ea = { class: "wm-mm" }, ta = {
|
|
4549
4578
|
class: "wm-mm__pop",
|
|
4550
4579
|
role: "menu"
|
|
4551
|
-
},
|
|
4580
|
+
}, na = {
|
|
4552
4581
|
key: 0,
|
|
4553
4582
|
class: "wm-mm__section"
|
|
4554
|
-
},
|
|
4583
|
+
}, sa = { class: "wm-mm__label" }, ra = { class: "wm-mm__label" }, ia = {
|
|
4555
4584
|
key: 1,
|
|
4556
4585
|
class: "wm-mm__sep"
|
|
4557
|
-
},
|
|
4558
|
-
function
|
|
4559
|
-
return c(), u("div",
|
|
4586
|
+
}, aa = { class: "wm-mm__section" }, oa = { class: "wm-mm__label" }, la = { class: "wm-mm__label" }, ca = { class: "wm-mm__section" }, da = { class: "wm-mm__label" }, ua = { class: "wm-mm__label" };
|
|
4587
|
+
function ma(e, t, n, i, r, s) {
|
|
4588
|
+
return c(), u("div", ea, [
|
|
4560
4589
|
o("div", {
|
|
4561
4590
|
class: "wm-mm__scrim",
|
|
4562
4591
|
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4563
4592
|
}),
|
|
4564
|
-
o("div",
|
|
4565
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4593
|
+
o("div", ta, [
|
|
4594
|
+
n.canRename || n.canExport ? (c(), u("div", na, [
|
|
4566
4595
|
n.canRename ? (c(), u("button", {
|
|
4567
4596
|
key: 0,
|
|
4568
4597
|
type: "button",
|
|
@@ -4585,7 +4614,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4585
4614
|
o("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" })
|
|
4586
4615
|
])
|
|
4587
4616
|
], -1)),
|
|
4588
|
-
o("span",
|
|
4617
|
+
o("span", sa, v(s.t("moreMenu.editTitle")), 1)
|
|
4589
4618
|
])) : b("", !0),
|
|
4590
4619
|
n.canExport ? (c(), u("button", {
|
|
4591
4620
|
key: 1,
|
|
@@ -4608,12 +4637,12 @@ function ua(e, t, n, i, r, s) {
|
|
|
4608
4637
|
o("path", { d: "M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" })
|
|
4609
4638
|
])
|
|
4610
4639
|
], -1)),
|
|
4611
|
-
o("span",
|
|
4640
|
+
o("span", ra, v(s.t("moreMenu.exportTranscript")), 1),
|
|
4612
4641
|
t[9] || (t[9] = o("span", { class: "wm-mm__hint" }, ".txt", -1))
|
|
4613
4642
|
])) : b("", !0)
|
|
4614
4643
|
])) : b("", !0),
|
|
4615
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4616
|
-
o("div",
|
|
4644
|
+
n.canRename || n.canExport ? (c(), u("div", ia)) : b("", !0),
|
|
4645
|
+
o("div", aa, [
|
|
4617
4646
|
o("button", {
|
|
4618
4647
|
type: "button",
|
|
4619
4648
|
class: "wm-mm__item",
|
|
@@ -4635,7 +4664,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4635
4664
|
o("path", { d: "M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" })
|
|
4636
4665
|
])
|
|
4637
4666
|
], -1)),
|
|
4638
|
-
o("span",
|
|
4667
|
+
o("span", oa, v(s.t("moreMenu.sound")), 1),
|
|
4639
4668
|
o("span", {
|
|
4640
4669
|
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.soundOn }])
|
|
4641
4670
|
}, [...t[10] || (t[10] = [
|
|
@@ -4662,7 +4691,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4662
4691
|
o("path", { d: "M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0" })
|
|
4663
4692
|
])
|
|
4664
4693
|
], -1)),
|
|
4665
|
-
o("span",
|
|
4694
|
+
o("span", la, v(s.t("moreMenu.browserNotifications")), 1),
|
|
4666
4695
|
o("span", {
|
|
4667
4696
|
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.browserNotifOn }])
|
|
4668
4697
|
}, [...t[12] || (t[12] = [
|
|
@@ -4671,7 +4700,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4671
4700
|
])
|
|
4672
4701
|
]),
|
|
4673
4702
|
t[16] || (t[16] = o("div", { class: "wm-mm__sep" }, null, -1)),
|
|
4674
|
-
o("div",
|
|
4703
|
+
o("div", ca, [
|
|
4675
4704
|
n.statusUrl ? (c(), u("button", {
|
|
4676
4705
|
key: 0,
|
|
4677
4706
|
type: "button",
|
|
@@ -4693,7 +4722,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4693
4722
|
o("path", { d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2" })
|
|
4694
4723
|
])
|
|
4695
4724
|
], -1)),
|
|
4696
|
-
o("span",
|
|
4725
|
+
o("span", da, v(s.t("moreMenu.serviceStatus")), 1)
|
|
4697
4726
|
])) : b("", !0),
|
|
4698
4727
|
n.helpUrl ? (c(), u("button", {
|
|
4699
4728
|
key: 1,
|
|
@@ -4716,18 +4745,18 @@ function ua(e, t, n, i, r, s) {
|
|
|
4716
4745
|
o("path", { d: "M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z" })
|
|
4717
4746
|
])
|
|
4718
4747
|
], -1)),
|
|
4719
|
-
o("span",
|
|
4748
|
+
o("span", ua, v(s.t("moreMenu.helpCenter")), 1)
|
|
4720
4749
|
])) : b("", !0)
|
|
4721
4750
|
])
|
|
4722
4751
|
])
|
|
4723
4752
|
]);
|
|
4724
4753
|
}
|
|
4725
|
-
const ha = /* @__PURE__ */ B(
|
|
4754
|
+
const ha = /* @__PURE__ */ B(Zi, [["render", ma], ["__scopeId", "data-v-76281e95"]]), fa = {
|
|
4726
4755
|
name: "WmRenameDialog",
|
|
4727
4756
|
inject: {
|
|
4728
4757
|
// Translator shared by the Messenger shell; French fallback when
|
|
4729
4758
|
// the component is used standalone.
|
|
4730
|
-
t: { default: () =>
|
|
4759
|
+
t: { default: () => U() }
|
|
4731
4760
|
},
|
|
4732
4761
|
props: {
|
|
4733
4762
|
// Empty defaults: the resolved fallback comes from the translator
|
|
@@ -4764,20 +4793,20 @@ const ha = /* @__PURE__ */ B(Ji, [["render", ua], ["__scopeId", "data-v-76281e95
|
|
|
4764
4793
|
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
4765
4794
|
}
|
|
4766
4795
|
}
|
|
4767
|
-
},
|
|
4796
|
+
}, _a = { class: "wm-dialog" }, ga = {
|
|
4768
4797
|
class: "wm-dialog__card",
|
|
4769
4798
|
role: "dialog",
|
|
4770
4799
|
"aria-modal": "true"
|
|
4771
|
-
}, pa = { class: "wm-dialog__head" },
|
|
4772
|
-
function
|
|
4773
|
-
return c(), u("div",
|
|
4800
|
+
}, pa = { class: "wm-dialog__head" }, va = { class: "wm-dialog__title" }, ya = ["aria-label"], ba = { class: "wm-dialog__body" }, wa = ["placeholder"], ka = { class: "wm-dialog__actions" }, Ca = ["disabled"];
|
|
4801
|
+
function Aa(e, t, n, i, r, s) {
|
|
4802
|
+
return c(), u("div", _a, [
|
|
4774
4803
|
o("div", {
|
|
4775
4804
|
class: "wm-dialog__scrim",
|
|
4776
4805
|
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4777
4806
|
}),
|
|
4778
|
-
o("div",
|
|
4807
|
+
o("div", ga, [
|
|
4779
4808
|
o("div", pa, [
|
|
4780
|
-
o("div",
|
|
4809
|
+
o("div", va, v(n.title || s.t("rename.title")), 1),
|
|
4781
4810
|
o("button", {
|
|
4782
4811
|
type: "button",
|
|
4783
4812
|
class: "wm-dialog__close",
|
|
@@ -4797,9 +4826,9 @@ function Ca(e, t, n, i, r, s) {
|
|
|
4797
4826
|
}, [
|
|
4798
4827
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4799
4828
|
], -1)
|
|
4800
|
-
])], 8,
|
|
4829
|
+
])], 8, ya)
|
|
4801
4830
|
]),
|
|
4802
|
-
o("div",
|
|
4831
|
+
o("div", ba, [
|
|
4803
4832
|
V(o("input", {
|
|
4804
4833
|
ref: "input",
|
|
4805
4834
|
"onUpdate:modelValue": t[2] || (t[2] = (a) => r.value = a),
|
|
@@ -4811,11 +4840,11 @@ function Ca(e, t, n, i, r, s) {
|
|
|
4811
4840
|
t[3] || (t[3] = ue(X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
|
|
4812
4841
|
t[4] || (t[4] = ue(X((a) => e.$emit("close"), ["prevent"]), ["esc"]))
|
|
4813
4842
|
]
|
|
4814
|
-
}, null, 40,
|
|
4843
|
+
}, null, 40, wa), [
|
|
4815
4844
|
[ee, r.value]
|
|
4816
4845
|
])
|
|
4817
4846
|
]),
|
|
4818
|
-
o("div",
|
|
4847
|
+
o("div", ka, [
|
|
4819
4848
|
o("button", {
|
|
4820
4849
|
type: "button",
|
|
4821
4850
|
class: "wm-dialog__btn",
|
|
@@ -4826,31 +4855,31 @@ function Ca(e, t, n, i, r, s) {
|
|
|
4826
4855
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
4827
4856
|
disabled: !s.canSubmit,
|
|
4828
4857
|
onClick: t[6] || (t[6] = (...a) => s.onSubmit && s.onSubmit(...a))
|
|
4829
|
-
}, v(s.t("common.save")), 9,
|
|
4858
|
+
}, v(s.t("common.save")), 9, Ca)
|
|
4830
4859
|
])
|
|
4831
4860
|
])
|
|
4832
4861
|
]);
|
|
4833
4862
|
}
|
|
4834
|
-
const
|
|
4863
|
+
const Sa = /* @__PURE__ */ B(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8"]]), Te = "ww-messenger-tokens", Ma = {
|
|
4835
4864
|
name: "Messenger",
|
|
4836
4865
|
components: {
|
|
4837
4866
|
Launcher: jt,
|
|
4838
|
-
Header:
|
|
4839
|
-
Onboarding:
|
|
4867
|
+
Header: cn,
|
|
4868
|
+
Onboarding: qn,
|
|
4840
4869
|
MessageList: Lr,
|
|
4841
|
-
Composer:
|
|
4842
|
-
SuggestionChips:
|
|
4843
|
-
ApprovalCard:
|
|
4844
|
-
FormCard:
|
|
4845
|
-
Feedback:
|
|
4870
|
+
Composer: Xr,
|
|
4871
|
+
SuggestionChips: ti,
|
|
4872
|
+
ApprovalCard: ui,
|
|
4873
|
+
FormCard: Ui,
|
|
4874
|
+
Feedback: Ji,
|
|
4846
4875
|
MoreMenu: ha,
|
|
4847
|
-
RenameDialog:
|
|
4876
|
+
RenameDialog: Sa
|
|
4848
4877
|
},
|
|
4849
4878
|
mixins: [
|
|
4850
4879
|
ot,
|
|
4851
|
-
|
|
4880
|
+
ht,
|
|
4852
4881
|
ft,
|
|
4853
|
-
|
|
4882
|
+
gt
|
|
4854
4883
|
],
|
|
4855
4884
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
4856
4885
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -4965,7 +4994,7 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
4965
4994
|
// 4. French.
|
|
4966
4995
|
locale() {
|
|
4967
4996
|
var e;
|
|
4968
|
-
return
|
|
4997
|
+
return pe(
|
|
4969
4998
|
this.language || this.customerLanguage || ((e = this.widget) == null ? void 0 : e.default_language) || ""
|
|
4970
4999
|
);
|
|
4971
5000
|
},
|
|
@@ -4973,7 +5002,7 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
4973
5002
|
// `locale` changes. `t()` below (and the provided closure) delegate
|
|
4974
5003
|
// to it so every string resolves against the current language.
|
|
4975
5004
|
translator() {
|
|
4976
|
-
return
|
|
5005
|
+
return U(this.locale);
|
|
4977
5006
|
},
|
|
4978
5007
|
error() {
|
|
4979
5008
|
var e;
|
|
@@ -5017,12 +5046,12 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5017
5046
|
t[T.id] !== 0 && (!l && T.author && (l = T.author), a++);
|
|
5018
5047
|
}
|
|
5019
5048
|
}
|
|
5020
|
-
const
|
|
5049
|
+
const p = r.filter(
|
|
5021
5050
|
(k) => !((k == null ? void 0 : k.id) != null && t[k.id] === 0)
|
|
5022
5051
|
);
|
|
5023
5052
|
return {
|
|
5024
5053
|
...i,
|
|
5025
|
-
_preview: st(i,
|
|
5054
|
+
_preview: st(i, p),
|
|
5026
5055
|
_unread: a > 0,
|
|
5027
5056
|
_unreadCount: a,
|
|
5028
5057
|
_lastAuthor: l
|
|
@@ -5057,14 +5086,14 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5057
5086
|
const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
|
|
5058
5087
|
for (const i of this.drawerConversations) {
|
|
5059
5088
|
if (!i._unread) continue;
|
|
5060
|
-
const r = Ce(i, e[i.id] || []), s = i._lastAuthor, a = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (a ? this.agentName : "") || "",
|
|
5089
|
+
const r = Ce(i, e[i.id] || []), s = i._lastAuthor, a = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (a ? this.agentName : "") || "", p = (s == null ? void 0 : s.avatar_url) || (a ? this.agentAvatarUrl : null);
|
|
5061
5090
|
t.push({
|
|
5062
5091
|
convId: i.id,
|
|
5063
5092
|
preview: i._preview || this.t("notification.youHaveNewMessage"),
|
|
5064
5093
|
ts: r,
|
|
5065
5094
|
count: i._unreadCount || 1,
|
|
5066
5095
|
senderName: l,
|
|
5067
|
-
senderAvatarUrl:
|
|
5096
|
+
senderAvatarUrl: p
|
|
5068
5097
|
});
|
|
5069
5098
|
}
|
|
5070
5099
|
return t.sort((i, r) => i.ts < r.ts ? 1 : i.ts > r.ts ? -1 : 0), t;
|
|
@@ -5123,6 +5152,14 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5123
5152
|
var e;
|
|
5124
5153
|
return ((e = this.widget) == null ? void 0 : e.welcome_message) || "";
|
|
5125
5154
|
},
|
|
5155
|
+
widgetSubtitle() {
|
|
5156
|
+
var e;
|
|
5157
|
+
return ((e = this.widget) == null ? void 0 : e.subtitle) || "";
|
|
5158
|
+
},
|
|
5159
|
+
defaultIconUrl() {
|
|
5160
|
+
var e;
|
|
5161
|
+
return ((e = this.widget) == null ? void 0 : e.default_icon_url) || null;
|
|
5162
|
+
},
|
|
5126
5163
|
agentName() {
|
|
5127
5164
|
var e, t, n;
|
|
5128
5165
|
return ((n = (t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.agent) == null ? void 0 : n.name) || "";
|
|
@@ -5194,8 +5231,8 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5194
5231
|
}
|
|
5195
5232
|
const t = this.revealedAt;
|
|
5196
5233
|
return (this.s.messagesByConv[e.id] || []).filter((r) => {
|
|
5197
|
-
var s, a, l,
|
|
5198
|
-
return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending" || ae(r) && !(t[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((a = r == null ? void 0 : r.payload) == null ? void 0 : a.type) === "system" || Array.isArray((l = r == null ? void 0 : r.payload) == null ? void 0 : l.attachments) && r.payload.attachments.length || (
|
|
5234
|
+
var s, a, l, p, C;
|
|
5235
|
+
return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending" || ae(r) && !(t[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((a = r == null ? void 0 : r.payload) == null ? void 0 : a.type) === "system" || Array.isArray((l = r == null ? void 0 : r.payload) == null ? void 0 : l.attachments) && r.payload.attachments.length || (p = r == null ? void 0 : r.metadata) != null && p.artifact || (C = r == null ? void 0 : r.metadata) != null && C.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
|
|
5199
5236
|
});
|
|
5200
5237
|
},
|
|
5201
5238
|
// True whenever we should show the "typing" indicator at the bottom
|
|
@@ -5231,11 +5268,11 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5231
5268
|
return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || this.t("action.title");
|
|
5232
5269
|
},
|
|
5233
5270
|
approvalDetail() {
|
|
5234
|
-
var i, r, s, a, l,
|
|
5271
|
+
var i, r, s, a, l, p;
|
|
5235
5272
|
const e = (s = (r = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
5236
5273
|
if (typeof e == "string" && e.trim())
|
|
5237
5274
|
return e.trim();
|
|
5238
|
-
const t = (
|
|
5275
|
+
const t = (p = (l = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : l.pending) == null ? void 0 : p.prepared_params;
|
|
5239
5276
|
if (!t || typeof t != "object") return "";
|
|
5240
5277
|
const n = Object.entries(t);
|
|
5241
5278
|
return n.length ? n.slice(0, 2).map(([C, k]) => `${C}: ${k}`).join(" · ") : "";
|
|
@@ -5281,7 +5318,7 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5281
5318
|
}
|
|
5282
5319
|
}
|
|
5283
5320
|
return this.t("messageList.today", {
|
|
5284
|
-
time:
|
|
5321
|
+
time: Ie(t, oe(this.locale))
|
|
5285
5322
|
});
|
|
5286
5323
|
},
|
|
5287
5324
|
// Pagination state for the active conversation. Drives the
|
|
@@ -5677,29 +5714,29 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5677
5714
|
}
|
|
5678
5715
|
}
|
|
5679
5716
|
}
|
|
5680
|
-
},
|
|
5717
|
+
}, Ta = {
|
|
5681
5718
|
key: 0,
|
|
5682
5719
|
class: "wm-loading",
|
|
5683
5720
|
"aria-busy": "true",
|
|
5684
5721
|
"aria-live": "polite"
|
|
5685
|
-
},
|
|
5722
|
+
}, xa = ["aria-label"], Oa = {
|
|
5686
5723
|
key: 0,
|
|
5687
5724
|
class: "wm-state"
|
|
5688
|
-
},
|
|
5725
|
+
}, Ia = { class: "wm-state__err" }, La = { class: "wm-state__errTitle" }, Ba = { class: "wm-state__errSub" }, Ea = { class: "wm-bottom" }, Ra = {
|
|
5689
5726
|
key: 0,
|
|
5690
5727
|
ref: "floatEl",
|
|
5691
5728
|
class: "wm-float"
|
|
5692
|
-
},
|
|
5729
|
+
}, Na = {
|
|
5693
5730
|
key: 1,
|
|
5694
5731
|
class: "wm-actionWait",
|
|
5695
5732
|
role: "status",
|
|
5696
5733
|
"aria-live": "polite"
|
|
5697
|
-
},
|
|
5734
|
+
}, Fa = { class: "wm-actionWait__lbl" }, ja = {
|
|
5698
5735
|
key: 2,
|
|
5699
5736
|
class: "wm-attached"
|
|
5700
|
-
},
|
|
5737
|
+
}, Ua = ["aria-label", "onClick"];
|
|
5701
5738
|
function Pa(e, t, n, i, r, s) {
|
|
5702
|
-
const a =
|
|
5739
|
+
const a = L("Launcher"), l = L("Header"), p = L("Onboarding"), C = L("MessageList"), k = L("ApprovalCard"), T = L("FormCard"), E = L("Feedback"), A = L("SuggestionChips"), H = L("Composer"), M = L("MoreMenu"), P = L("RenameDialog");
|
|
5703
5740
|
return c(), u("div", {
|
|
5704
5741
|
class: x(["wm-root", `wm-root--${n.displayMode}`])
|
|
5705
5742
|
}, [
|
|
@@ -5717,7 +5754,7 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5717
5754
|
role: "dialog",
|
|
5718
5755
|
"aria-label": "Messenger"
|
|
5719
5756
|
}, [
|
|
5720
|
-
!s.ready && !s.error ? (c(), u("div",
|
|
5757
|
+
!s.ready && !s.error ? (c(), u("div", Ta, [
|
|
5721
5758
|
s.isEmbedded ? b("", !0) : (c(), u("button", {
|
|
5722
5759
|
key: 0,
|
|
5723
5760
|
type: "button",
|
|
@@ -5738,12 +5775,12 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5738
5775
|
}, [
|
|
5739
5776
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5740
5777
|
], -1)
|
|
5741
|
-
])], 8,
|
|
5778
|
+
])], 8, xa)),
|
|
5742
5779
|
t[6] || (t[6] = o("div", {
|
|
5743
5780
|
class: "wm-loading__spinner",
|
|
5744
5781
|
"aria-hidden": "true"
|
|
5745
5782
|
}, null, -1))
|
|
5746
|
-
])) : (c(), u(
|
|
5783
|
+
])) : (c(), u(I, { key: 1 }, [
|
|
5747
5784
|
q(l, {
|
|
5748
5785
|
title: s.headerTitle,
|
|
5749
5786
|
"team-members": s.teamMembers,
|
|
@@ -5752,12 +5789,13 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5752
5789
|
"show-back": s.canBack,
|
|
5753
5790
|
"show-close": !s.isEmbedded,
|
|
5754
5791
|
"more-active": r.moreOpen,
|
|
5792
|
+
"agent-avatar-url": s.agentAvatarUrl,
|
|
5755
5793
|
onBack: s.goHome,
|
|
5756
5794
|
onMore: s.toggleMore,
|
|
5757
5795
|
onClose: s.close
|
|
5758
|
-
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
|
|
5759
|
-
s.error ? (c(), u("div",
|
|
5760
|
-
o("div",
|
|
5796
|
+
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "agent-avatar-url", "onBack", "onMore", "onClose"]),
|
|
5797
|
+
s.error ? (c(), u("div", Oa, [
|
|
5798
|
+
o("div", Ia, [
|
|
5761
5799
|
t[7] || (t[7] = o("div", { class: "wm-state__errIcon" }, [
|
|
5762
5800
|
o("svg", {
|
|
5763
5801
|
width: "14",
|
|
@@ -5775,10 +5813,10 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5775
5813
|
], -1)),
|
|
5776
5814
|
o("div", null, [
|
|
5777
5815
|
o("div", La, v(s.t("error.connectionFailed")), 1),
|
|
5778
|
-
o("div",
|
|
5816
|
+
o("div", Ba, v(s.error), 1)
|
|
5779
5817
|
])
|
|
5780
5818
|
])
|
|
5781
|
-
])) : s.currentConv ? (c(), u(
|
|
5819
|
+
])) : s.currentConv ? (c(), u(I, { key: 2 }, [
|
|
5782
5820
|
q(C, {
|
|
5783
5821
|
ref: "messageList",
|
|
5784
5822
|
messages: s.displayedMessages,
|
|
@@ -5789,10 +5827,12 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5789
5827
|
"has-more": s.paginationState.hasMore,
|
|
5790
5828
|
"unread-anchor-id": e.unreadAnchorId,
|
|
5791
5829
|
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
5830
|
+
"ai-agent-name": s.agentName,
|
|
5831
|
+
"ai-agent-avatar-url": s.agentAvatarUrl,
|
|
5792
5832
|
onLoadMore: s.onLoadMore
|
|
5793
|
-
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "onLoadMore"]),
|
|
5794
|
-
o("div",
|
|
5795
|
-
s.floatVisible ? (c(), u("div",
|
|
5833
|
+
}, 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"]),
|
|
5834
|
+
o("div", Ea, [
|
|
5835
|
+
s.floatVisible ? (c(), u("div", Ra, [
|
|
5796
5836
|
s.approvalReady ? (c(), R(k, {
|
|
5797
5837
|
key: 0,
|
|
5798
5838
|
action: s.approvalTitle,
|
|
@@ -5814,12 +5854,12 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5814
5854
|
onSelect: s.onSuggestion
|
|
5815
5855
|
}, null, 8, ["items", "onSelect"]))
|
|
5816
5856
|
], 512)) : b("", !0),
|
|
5817
|
-
s.actionInFlight ? (c(), u("div",
|
|
5857
|
+
s.actionInFlight ? (c(), u("div", Na, [
|
|
5818
5858
|
t[8] || (t[8] = o("span", {
|
|
5819
5859
|
class: "wm-actionWait__spinner",
|
|
5820
5860
|
"aria-hidden": "true"
|
|
5821
5861
|
}, null, -1)),
|
|
5822
|
-
o("span",
|
|
5862
|
+
o("span", Fa, v(s.t("action.inProgress", {
|
|
5823
5863
|
name: s.actionInFlightName
|
|
5824
5864
|
})), 1)
|
|
5825
5865
|
])) : (c(), R(H, {
|
|
@@ -5847,15 +5887,15 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5847
5887
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
5848
5888
|
onAction: s.onMoreAction
|
|
5849
5889
|
}, null, 8, ["can-rename", "can-export", "sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : b("", !0),
|
|
5850
|
-
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), R(
|
|
5890
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), R(P, {
|
|
5851
5891
|
key: 1,
|
|
5852
5892
|
"initial-value": s.currentConv.name || "",
|
|
5853
5893
|
title: s.t("rename.dialogTitle"),
|
|
5854
5894
|
onClose: t[3] || (t[3] = (N) => r.renameDialogOpen = !1),
|
|
5855
5895
|
onSubmit: s.onRenameSubmit
|
|
5856
5896
|
}, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0),
|
|
5857
|
-
r.pendingAttachments.length ? (c(), u("div",
|
|
5858
|
-
(c(!0), u(
|
|
5897
|
+
r.pendingAttachments.length ? (c(), u("div", ja, [
|
|
5898
|
+
(c(!0), u(I, null, j(r.pendingAttachments, (N, $) => (c(), u("div", {
|
|
5859
5899
|
key: $,
|
|
5860
5900
|
class: "wm-attached__chip"
|
|
5861
5901
|
}, [
|
|
@@ -5891,20 +5931,22 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5891
5931
|
}, [
|
|
5892
5932
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5893
5933
|
], -1)
|
|
5894
|
-
])], 8,
|
|
5934
|
+
])], 8, Ua)
|
|
5895
5935
|
]))), 128))
|
|
5896
5936
|
])) : b("", !0)
|
|
5897
|
-
], 64)) : (c(), R(
|
|
5937
|
+
], 64)) : (c(), R(p, {
|
|
5898
5938
|
key: 1,
|
|
5899
5939
|
"welcome-message": s.widgetWelcomeMessage,
|
|
5940
|
+
subtitle: s.widgetSubtitle,
|
|
5900
5941
|
"agent-name": s.agentName,
|
|
5942
|
+
"default-icon-url": s.defaultIconUrl,
|
|
5901
5943
|
"quick-links": s.quickLinks,
|
|
5902
5944
|
"open-threads": s.openThreads,
|
|
5903
5945
|
busy: r.busy,
|
|
5904
5946
|
onStart: s.startConv,
|
|
5905
5947
|
onSelect: s.onQuickLink,
|
|
5906
5948
|
onResume: s.onDrawerPick
|
|
5907
|
-
}, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
5949
|
+
}, null, 8, ["welcome-message", "subtitle", "agent-name", "default-icon-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
5908
5950
|
r.moreOpen && !s.currentConv ? (c(), R(M, {
|
|
5909
5951
|
key: 3,
|
|
5910
5952
|
"can-rename": !1,
|
|
@@ -5922,53 +5964,53 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5922
5964
|
], 6)) : b("", !0)
|
|
5923
5965
|
], 2);
|
|
5924
5966
|
}
|
|
5925
|
-
const
|
|
5967
|
+
const Ha = /* @__PURE__ */ B(Ma, [["render", Pa], ["__scopeId", "data-v-7abab363"]]), qa = "0.4.5";
|
|
5926
5968
|
export {
|
|
5927
5969
|
le as AIAvatar,
|
|
5928
5970
|
fe as AVATAR_COLORS,
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5971
|
+
ts as ActionResult,
|
|
5972
|
+
ui as ApprovalCard,
|
|
5973
|
+
ds as ArtifactFormResponse,
|
|
5974
|
+
Cs as ArtifactInfoCard,
|
|
5975
|
+
Hs as ArtifactRenderer,
|
|
5976
|
+
Us as ArtifactTicket,
|
|
5977
|
+
er as AttachmentPreview,
|
|
5978
|
+
rr as Bubble,
|
|
5979
|
+
Xr as Composer,
|
|
5938
5980
|
Ze as DEFAULT_BASE_URL,
|
|
5939
5981
|
ie as DEFAULT_LANGUAGE,
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5982
|
+
Ji as Feedback,
|
|
5983
|
+
Ui as FormCard,
|
|
5984
|
+
cn as Header,
|
|
5943
5985
|
Be as HumanAvatar,
|
|
5944
5986
|
jt as Launcher,
|
|
5945
5987
|
ve as MEDIA_RECORDER_SUPPORTED,
|
|
5946
5988
|
Lr as MessageList,
|
|
5947
|
-
|
|
5989
|
+
Ha as Messenger,
|
|
5948
5990
|
ha as MoreMenu,
|
|
5949
|
-
|
|
5950
|
-
|
|
5991
|
+
qn as Onboarding,
|
|
5992
|
+
me as SCREEN_CAPTURE_SUPPORTED,
|
|
5951
5993
|
et as SUPPORTED_LANGUAGES,
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5994
|
+
ti as SuggestionChips,
|
|
5995
|
+
Yt as TeamAvatars,
|
|
5996
|
+
lr as Typing,
|
|
5997
|
+
qa as VERSION,
|
|
5956
5998
|
xe as avatarColor,
|
|
5957
5999
|
Oe as avatarInitials,
|
|
5958
|
-
|
|
5959
|
-
|
|
6000
|
+
Er as captureScreenshotFile,
|
|
6001
|
+
D as colors,
|
|
5960
6002
|
Xe as createStore,
|
|
5961
|
-
|
|
6003
|
+
U as createTranslator,
|
|
5962
6004
|
We as createTransport,
|
|
5963
6005
|
oe as dateLocale,
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
6006
|
+
Ha as default,
|
|
6007
|
+
Ie as formatTime,
|
|
6008
|
+
$a as guessAttachmentKind,
|
|
6009
|
+
Br as pickRecorderMime,
|
|
6010
|
+
un as renderInlineMarkdown,
|
|
6011
|
+
mn as renderMarkdown,
|
|
6012
|
+
pe as resolveLanguage,
|
|
6013
|
+
Nr as startScreenRecording,
|
|
5972
6014
|
Je as tokensCss,
|
|
5973
6015
|
Qe as uuid,
|
|
5974
6016
|
Qe as v4
|