@_solaris/messenger-widget 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/messenger.cjs +10 -10
- package/dist/messenger.embed.js +10 -10
- package/dist/messenger.js +901 -817
- 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
|
|
1
|
+
import { reactive as Ue, openBlock as c, createElementBlock as u, normalizeStyle as z, normalizeClass as x, toDisplayString as v, resolveComponent as L, createVNode as $, Transition as Fe, withCtx as je, Fragment as I, renderList as F, withKeys as ue, withModifiers as X, createElementVNode as o, createCommentVNode as b, createBlock as R, withDirectives as K, vModelText as ee, createTextVNode as ge, resolveDynamicComponent as Pe, renderSlot as De, vModelCheckbox as He, vModelSelect as ze, markRaw as we } from "vue";
|
|
2
2
|
const qe = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -6,7 +6,7 @@ const qe = [
|
|
|
6
6
|
"conversation_updated",
|
|
7
7
|
"config_updated",
|
|
8
8
|
"action_status"
|
|
9
|
-
],
|
|
9
|
+
], ke = "/client", $e = 5 * 60 * 1e3, Ve = 10 * 60 * 1e3, Ke = 5 * 60 * 1e3;
|
|
10
10
|
function We(e) {
|
|
11
11
|
const t = {
|
|
12
12
|
baseUrl: Ge(e.baseUrl || ""),
|
|
@@ -55,7 +55,7 @@ function We(e) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
async function a(d, f, _) {
|
|
58
|
-
const y = await fetch(`${t.baseUrl}${
|
|
58
|
+
const y = await fetch(`${t.baseUrl}${ke}${f}`, {
|
|
59
59
|
method: d,
|
|
60
60
|
headers: { "Content-Type": "application/json", ...s() },
|
|
61
61
|
body: _ !== void 0 ? JSON.stringify(_) : void 0
|
|
@@ -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(
|
|
@@ -121,7 +121,7 @@ function We(e) {
|
|
|
121
121
|
`/conversations/${encodeURIComponent(d)}`
|
|
122
122
|
)).conversation;
|
|
123
123
|
}
|
|
124
|
-
async function
|
|
124
|
+
async function q(d, f) {
|
|
125
125
|
return (await a(
|
|
126
126
|
"PATCH",
|
|
127
127
|
`/conversations/${encodeURIComponent(d)}`,
|
|
@@ -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()}` : "";
|
|
@@ -145,7 +145,7 @@ function We(e) {
|
|
|
145
145
|
);
|
|
146
146
|
}
|
|
147
147
|
async function N(d, f) {
|
|
148
|
-
|
|
148
|
+
V();
|
|
149
149
|
const _ = {
|
|
150
150
|
client_msg_id: f.client_msg_id,
|
|
151
151
|
type: "content",
|
|
@@ -159,8 +159,8 @@ function We(e) {
|
|
|
159
159
|
_
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
|
-
async function
|
|
163
|
-
return
|
|
162
|
+
async function H(d, f, _) {
|
|
163
|
+
return V(), a(
|
|
164
164
|
"POST",
|
|
165
165
|
`/messages/${encodeURIComponent(d)}/callbacks/${encodeURIComponent(f)}`,
|
|
166
166
|
_ ? { inputs: _ } : {}
|
|
@@ -203,7 +203,7 @@ function We(e) {
|
|
|
203
203
|
userHash: t.userHash,
|
|
204
204
|
widgetId: t.widgetId
|
|
205
205
|
}).toString();
|
|
206
|
-
return `${t.baseUrl}${
|
|
206
|
+
return `${t.baseUrl}${ke}/stream?${d}`;
|
|
207
207
|
}
|
|
208
208
|
function G() {
|
|
209
209
|
if (!t.eventSource && !(typeof document < "u" && document.hidden))
|
|
@@ -230,13 +230,13 @@ function We(e) {
|
|
|
230
230
|
function Q() {
|
|
231
231
|
t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" && r("idle");
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function V() {
|
|
234
234
|
clearTimeout(t.burstTimer), G(), t.panelOpen || (t.burstTimer = setTimeout(() => {
|
|
235
235
|
t.panelOpen || Q();
|
|
236
236
|
}, Ve));
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
t.panelOpen = !!d, t.panelOpen ? (clearTimeout(t.burstTimer), G()) :
|
|
238
|
+
function he(d) {
|
|
239
|
+
t.panelOpen = !!d, t.panelOpen ? (clearTimeout(t.burstTimer), G()) : V();
|
|
240
240
|
}
|
|
241
241
|
async function ce() {
|
|
242
242
|
try {
|
|
@@ -244,18 +244,18 @@ function We(e) {
|
|
|
244
244
|
const S = w == null ? void 0 : w.last_message_at;
|
|
245
245
|
return S && (!y || S > y) ? S : y;
|
|
246
246
|
}, null);
|
|
247
|
-
f && (!t.lastActivityAt || f > t.lastActivityAt) && (t.lastActivityAt = f, i("activity", { conversations: d, latestAt: f }),
|
|
247
|
+
f && (!t.lastActivityAt || f > t.lastActivityAt) && (t.lastActivityAt = f, i("activity", { conversations: d, latestAt: f }), V());
|
|
248
248
|
} catch (d) {
|
|
249
249
|
console.error("[transport] poll failed", d);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
function de() {
|
|
253
|
-
se(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(ce,
|
|
253
|
+
se(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(ce, $e));
|
|
254
254
|
}
|
|
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,21 +295,21 @@ 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,
|
|
306
306
|
createConversation: E,
|
|
307
307
|
getConversation: A,
|
|
308
|
-
patchConversation:
|
|
308
|
+
patchConversation: q,
|
|
309
309
|
markConversationRead: M,
|
|
310
|
-
listMessages:
|
|
310
|
+
listMessages: P,
|
|
311
311
|
postMessage: N,
|
|
312
|
-
postCallback:
|
|
312
|
+
postCallback: H,
|
|
313
313
|
uploadAttachment: W,
|
|
314
314
|
signAttachment: te,
|
|
315
315
|
// Read-only state
|
|
@@ -337,7 +337,7 @@ function Qe() {
|
|
|
337
337
|
return t.slice(0, 4).join("") + "-" + t.slice(4, 6).join("") + "-" + t.slice(6, 8).join("") + "-" + t.slice(8, 10).join("") + "-" + t.slice(10, 16).join("");
|
|
338
338
|
}
|
|
339
339
|
function Xe(e) {
|
|
340
|
-
const t =
|
|
340
|
+
const t = Ue({
|
|
341
341
|
ready: !1,
|
|
342
342
|
error: null,
|
|
343
343
|
config: null,
|
|
@@ -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,166 +479,166 @@ 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
|
-
const
|
|
497
|
-
t.messagesByConv[
|
|
496
|
+
const U = 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[m] = [...U, ...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
|
-
const
|
|
532
|
-
Y(
|
|
531
|
+
const U = (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(m, S), U || 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
|
|
552
|
-
var
|
|
553
|
-
const f = (
|
|
554
|
-
if (!
|
|
555
|
-
const y = Qe(), w = se(
|
|
551
|
+
async function q(m, h, { attachments: g, metadata: d } = {}) {
|
|
552
|
+
var U;
|
|
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: {
|
|
562
562
|
type: "user",
|
|
563
|
-
id: ((
|
|
563
|
+
id: ((U = t.customer) == null ? void 0 : U.external_id) || null
|
|
564
564
|
},
|
|
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),
|
|
581
|
+
console.error("[store] send failed", O), V(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 H(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,33 +646,33 @@ 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;
|
|
666
666
|
const S = (_ = w == null ? void 0 : w.metadata) == null ? void 0 : _.suggested_replies;
|
|
667
|
-
return Array.isArray(S) && S.length ? S.map((
|
|
668
|
-
if (typeof
|
|
669
|
-
const O =
|
|
667
|
+
return Array.isArray(S) && S.length ? S.map((U) => {
|
|
668
|
+
if (typeof U == "string") {
|
|
669
|
+
const O = U.trim();
|
|
670
670
|
return O ? { label: O, kind: null } : null;
|
|
671
671
|
}
|
|
672
|
-
if (
|
|
673
|
-
const O =
|
|
672
|
+
if (U && typeof U == "object" && typeof U.label == "string") {
|
|
673
|
+
const O = U.label.trim();
|
|
674
674
|
if (!O) return null;
|
|
675
|
-
const Ne =
|
|
675
|
+
const Ne = U.kind === "cta" || U.kind === "choice" || U.kind === "followup" ? U.kind : null;
|
|
676
676
|
return { label: O, kind: Ne };
|
|
677
677
|
}
|
|
678
678
|
return null;
|
|
@@ -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
|
|
702
|
-
const d = t.messagesByConv[
|
|
701
|
+
function V(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,15 +741,15 @@ 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,
|
|
748
748
|
markConversationRead: A,
|
|
749
|
-
send:
|
|
749
|
+
send: q,
|
|
750
750
|
clickCallback: M,
|
|
751
751
|
signAttachment: N,
|
|
752
|
-
submitFeedback:
|
|
752
|
+
submitFeedback: H,
|
|
753
753
|
getPendingApproval: W,
|
|
754
754
|
getActionInFlight: ne,
|
|
755
755
|
getLatestSuggestions: G,
|
|
@@ -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",
|
|
@@ -782,13 +782,13 @@ const U = {
|
|
|
782
782
|
"#D97706",
|
|
783
783
|
"#059669"
|
|
784
784
|
];
|
|
785
|
-
function
|
|
785
|
+
function pe(e = "") {
|
|
786
786
|
return e ? fe[e.charCodeAt(0) % fe.length] : fe[0];
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function ve(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);
|
|
@@ -837,7 +837,7 @@ const Je = `
|
|
|
837
837
|
0% { transform: translateX(110%); opacity: 0; }
|
|
838
838
|
100% { transform: translateX(0); opacity: 1; }
|
|
839
839
|
}
|
|
840
|
-
`, Ze = "https://api.messenger.victorc.fr", ie = "fr", et = ["fr", "en"],
|
|
840
|
+
`, Ze = "https://api.messenger.victorc.fr", ie = "fr", et = ["fr", "en"], Ce = { fr: "fr-FR", en: "en-US" }, _e = {
|
|
841
841
|
fr: {
|
|
842
842
|
// ── Common ───────────────────────────────────────────────────────
|
|
843
843
|
"common.newConversation": "Nouvelle conversation",
|
|
@@ -1079,40 +1079,40 @@ I reply within seconds.`,
|
|
|
1079
1079
|
"export.createdOn": "Created on: {date}"
|
|
1080
1080
|
}
|
|
1081
1081
|
};
|
|
1082
|
-
function
|
|
1082
|
+
function ye(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
|
|
1088
|
+
return Ce[ye(e)] || Ce[ie];
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const t =
|
|
1090
|
+
function j(e) {
|
|
1091
|
+
const t = ye(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
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function Ae(e, t) {
|
|
1101
1101
|
if (!Array.isArray(e == null ? void 0 : e.options)) return 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
|
|
1106
|
-
return Array.isArray(t) ? t.map((i) =>
|
|
1105
|
+
function Le(e, t, n) {
|
|
1106
|
+
return Array.isArray(t) ? t.map((i) => Ae(e, String(i))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : Ae(e, String(t));
|
|
1107
1107
|
}
|
|
1108
|
-
function tt(e, t, n =
|
|
1108
|
+
function tt(e, t, n = j()) {
|
|
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 = j()) {
|
|
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",
|
|
@@ -1150,7 +1150,7 @@ function J(e) {
|
|
|
1150
1150
|
const t = typeof e == "number" ? e : Number(e);
|
|
1151
1151
|
return Number.isFinite(t) ? t : null;
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function Se(e, t) {
|
|
1154
1154
|
let n = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
|
|
1155
1155
|
for (const i of t)
|
|
1156
1156
|
i != null && i.created_at && i.created_at > n && (n = i.created_at);
|
|
@@ -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 = j(), 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)
|
|
@@ -1634,17 +1634,17 @@ const B = (e, t) => {
|
|
|
1634
1634
|
},
|
|
1635
1635
|
computed: {
|
|
1636
1636
|
bg() {
|
|
1637
|
-
return this.avatarUrl ? "transparent" :
|
|
1637
|
+
return this.avatarUrl ? "transparent" : pe(this.name);
|
|
1638
1638
|
},
|
|
1639
1639
|
initials() {
|
|
1640
|
-
return
|
|
1640
|
+
return ve(this.name);
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
1643
|
}, yt = ["src", "alt"];
|
|
1644
1644
|
function bt(e, t, n, i, r, s) {
|
|
1645
1645
|
return c(), u("div", {
|
|
1646
1646
|
class: x(["wm-huav", { "wm-huav--tail": n.tail }]),
|
|
1647
|
-
style:
|
|
1647
|
+
style: z({
|
|
1648
1648
|
width: n.size + "px",
|
|
1649
1649
|
height: n.size + "px",
|
|
1650
1650
|
"--wm-avr": Math.round(n.size * 0.32) + "px",
|
|
@@ -1657,7 +1657,7 @@ function bt(e, t, n, i, r, s) {
|
|
|
1657
1657
|
alt: n.name || ""
|
|
1658
1658
|
}, null, 8, yt)) : (c(), u("span", {
|
|
1659
1659
|
key: 1,
|
|
1660
|
-
style:
|
|
1660
|
+
style: z({ fontSize: n.size * 0.36 + "px" })
|
|
1661
1661
|
}, v(s.initials), 5))
|
|
1662
1662
|
], 6);
|
|
1663
1663
|
}
|
|
@@ -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: () => j() }
|
|
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" },
|
|
1691
|
-
function
|
|
1692
|
-
const a =
|
|
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
|
+
function Ut(e, t, n, i, r, s) {
|
|
1692
|
+
const a = L("HumanAvatar");
|
|
1693
1693
|
return c(), u("div", Ct, [
|
|
1694
|
-
|
|
1695
|
-
default:
|
|
1694
|
+
$(Fe, { name: "wm-peek" }, {
|
|
1695
|
+
default: je(() => [
|
|
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, F(s.visiblePeeks, (l, p) => (c(), u("div", {
|
|
1701
1701
|
key: l.convId,
|
|
1702
1702
|
class: "wm-peek",
|
|
1703
|
-
style:
|
|
1704
|
-
"--depth": s.visiblePeeks.length - 1 -
|
|
1705
|
-
zIndex:
|
|
1703
|
+
style: z({
|
|
1704
|
+
"--depth": s.visiblePeeks.length - 1 - p,
|
|
1705
|
+
zIndex: p + 1
|
|
1706
1706
|
}),
|
|
1707
1707
|
role: "button",
|
|
1708
1708
|
tabindex: "0",
|
|
@@ -1736,7 +1736,7 @@ function Ft(e, t, n, i, r, s) {
|
|
|
1736
1736
|
], -1)
|
|
1737
1737
|
])], 8, St),
|
|
1738
1738
|
o("div", Mt, [
|
|
1739
|
-
|
|
1739
|
+
$(a, {
|
|
1740
1740
|
name: l.senderName,
|
|
1741
1741
|
"avatar-url": l.senderAvatarUrl,
|
|
1742
1742
|
size: 34
|
|
@@ -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
|
|
1798
|
+
const Ft = /* @__PURE__ */ B(kt, [["render", Ut], ["__scopeId", "data-v-5193a529"]]), jt = {
|
|
1799
1799
|
name: "WmAIAvatar",
|
|
1800
1800
|
props: {
|
|
1801
1801
|
size: { type: Number, default: 26 },
|
|
@@ -1805,26 +1805,58 @@ 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
|
+
// Nom de l'agent IA. Quand renseigné (et sans `imageUrl`), rend
|
|
1810
|
+
// les initiales sur fond déterministe à partir du nom — même
|
|
1811
|
+
// logique que `HumanAvatar` pour les agents humains. L'étoile SVG
|
|
1812
|
+
// ne reste que comme fallback si ni `imageUrl` ni `name`.
|
|
1813
|
+
name: { type: String, default: "" },
|
|
1814
|
+
// Image distante (avatar de l'agent ou `default_icon_url` du
|
|
1815
|
+
// widget). Quand renseignée, remplace les initiales / l'étoile
|
|
1816
|
+
// par l'image dans le même container arrondi.
|
|
1817
|
+
imageUrl: { type: String, default: null }
|
|
1818
|
+
},
|
|
1819
|
+
computed: {
|
|
1820
|
+
initials() {
|
|
1821
|
+
return ve(this.name);
|
|
1822
|
+
},
|
|
1823
|
+
bgColor() {
|
|
1824
|
+
return pe(this.name);
|
|
1825
|
+
}
|
|
1809
1826
|
}
|
|
1810
|
-
},
|
|
1827
|
+
}, Pt = {
|
|
1811
1828
|
key: 0,
|
|
1812
1829
|
class: "wm-aiav__pulse"
|
|
1813
|
-
},
|
|
1814
|
-
function
|
|
1830
|
+
}, Dt = ["src", "alt"], Ht = ["width", "height"];
|
|
1831
|
+
function zt(e, t, n, i, r, s) {
|
|
1815
1832
|
return c(), u("div", {
|
|
1816
1833
|
class: x(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
1817
|
-
style:
|
|
1834
|
+
style: z({
|
|
1818
1835
|
width: n.size + "px",
|
|
1819
1836
|
height: n.size + "px",
|
|
1820
1837
|
"--wm-avr": n.size * 0.32 + "px"
|
|
1821
1838
|
})
|
|
1822
1839
|
}, [
|
|
1823
|
-
n.pulse ? (c(), u("div",
|
|
1840
|
+
n.pulse ? (c(), u("div", Pt)) : b("", !0),
|
|
1824
1841
|
o("div", {
|
|
1825
|
-
class: x(["wm-aiav__inner", {
|
|
1842
|
+
class: x(["wm-aiav__inner", {
|
|
1843
|
+
"wm-aiav__inner--glow": n.pulse,
|
|
1844
|
+
"wm-aiav__inner--img": !!n.imageUrl,
|
|
1845
|
+
"wm-aiav__inner--initials": !n.imageUrl && !!s.initials
|
|
1846
|
+
}]),
|
|
1847
|
+
style: z(
|
|
1848
|
+
!n.imageUrl && s.initials ? { background: s.bgColor } : null
|
|
1849
|
+
)
|
|
1826
1850
|
}, [
|
|
1827
|
-
(c(), u("
|
|
1851
|
+
n.imageUrl ? (c(), u("img", {
|
|
1852
|
+
key: 0,
|
|
1853
|
+
src: n.imageUrl,
|
|
1854
|
+
alt: n.name || ""
|
|
1855
|
+
}, null, 8, Dt)) : s.initials ? (c(), u("span", {
|
|
1856
|
+
key: 1,
|
|
1857
|
+
style: z({ fontSize: n.size * 0.36 + "px" })
|
|
1858
|
+
}, v(s.initials), 5)) : (c(), u("svg", {
|
|
1859
|
+
key: 2,
|
|
1828
1860
|
width: n.size * 0.5,
|
|
1829
1861
|
height: n.size * 0.5,
|
|
1830
1862
|
viewBox: "0 0 24 24",
|
|
@@ -1850,11 +1882,11 @@ function $t(e, t, n, i, r, s) {
|
|
|
1850
1882
|
fill: "white",
|
|
1851
1883
|
opacity: "0.38"
|
|
1852
1884
|
}, null, -1)
|
|
1853
|
-
])], 8,
|
|
1854
|
-
],
|
|
1885
|
+
])], 8, Ht))
|
|
1886
|
+
], 6)
|
|
1855
1887
|
], 6);
|
|
1856
1888
|
}
|
|
1857
|
-
const le = /* @__PURE__ */ B(
|
|
1889
|
+
const le = /* @__PURE__ */ B(jt, [["render", zt], ["__scopeId", "data-v-a91a2925"]]), qt = {
|
|
1858
1890
|
name: "WmTeamAvatars",
|
|
1859
1891
|
props: {
|
|
1860
1892
|
members: { type: Array, default: () => [] },
|
|
@@ -1870,29 +1902,29 @@ const le = /* @__PURE__ */ B(Pt, [["render", $t], ["__scopeId", "data-v-d621a129
|
|
|
1870
1902
|
},
|
|
1871
1903
|
methods: {
|
|
1872
1904
|
colorFor(e) {
|
|
1873
|
-
return e.avatar_url ? "transparent" :
|
|
1905
|
+
return e.avatar_url ? "transparent" : pe(e.name || "");
|
|
1874
1906
|
},
|
|
1875
1907
|
initialsFor(e) {
|
|
1876
|
-
return
|
|
1908
|
+
return ve(e.name || "");
|
|
1877
1909
|
}
|
|
1878
1910
|
}
|
|
1879
|
-
},
|
|
1911
|
+
}, $t = {
|
|
1880
1912
|
key: 0,
|
|
1881
1913
|
class: "wm-team"
|
|
1882
|
-
},
|
|
1914
|
+
}, Vt = ["src", "alt"], Kt = { key: 1 }, Wt = {
|
|
1883
1915
|
key: 0,
|
|
1884
1916
|
class: "wm-team__label"
|
|
1885
1917
|
};
|
|
1886
|
-
function
|
|
1887
|
-
return s.visible ? (c(), u("div",
|
|
1918
|
+
function Gt(e, t, n, i, r, s) {
|
|
1919
|
+
return s.visible ? (c(), u("div", $t, [
|
|
1888
1920
|
o("div", {
|
|
1889
1921
|
class: "wm-team__stack",
|
|
1890
|
-
style:
|
|
1922
|
+
style: z({ width: s.stackWidth + "px" })
|
|
1891
1923
|
}, [
|
|
1892
|
-
(c(!0), u(
|
|
1924
|
+
(c(!0), u(I, null, F(n.members.slice(0, 3), (a, l) => (c(), u("div", {
|
|
1893
1925
|
key: l,
|
|
1894
1926
|
class: "wm-team__pill",
|
|
1895
|
-
style:
|
|
1927
|
+
style: z({
|
|
1896
1928
|
left: l * 13 + "px",
|
|
1897
1929
|
zIndex: 3 - l,
|
|
1898
1930
|
background: s.colorFor(a)
|
|
@@ -1902,19 +1934,19 @@ function Wt(e, t, n, i, r, s) {
|
|
|
1902
1934
|
key: 0,
|
|
1903
1935
|
src: a.avatar_url,
|
|
1904
1936
|
alt: a.name || ""
|
|
1905
|
-
}, null, 8,
|
|
1937
|
+
}, null, 8, Vt)) : (c(), u("span", Kt, v(s.initialsFor(a)), 1))
|
|
1906
1938
|
], 4))), 128))
|
|
1907
1939
|
], 4),
|
|
1908
|
-
n.responseLabel ? (c(), u("span",
|
|
1940
|
+
n.responseLabel ? (c(), u("span", Wt, v(n.responseLabel), 1)) : b("", !0)
|
|
1909
1941
|
])) : b("", !0);
|
|
1910
1942
|
}
|
|
1911
|
-
const
|
|
1943
|
+
const Yt = /* @__PURE__ */ B(qt, [["render", Gt], ["__scopeId", "data-v-e49a9063"]]), Qt = {
|
|
1912
1944
|
name: "WmHeader",
|
|
1913
|
-
components: { AIAvatar: le, TeamAvatars:
|
|
1945
|
+
components: { AIAvatar: le, TeamAvatars: Yt },
|
|
1914
1946
|
inject: {
|
|
1915
1947
|
// Translator shared by the Messenger shell. Falls back to a French
|
|
1916
1948
|
// translator when the component is used standalone (no provider).
|
|
1917
|
-
t: { default: () =>
|
|
1949
|
+
t: { default: () => j() }
|
|
1918
1950
|
},
|
|
1919
1951
|
props: {
|
|
1920
1952
|
title: { type: String, default: "Nouvelle conversation" },
|
|
@@ -1926,7 +1958,9 @@ const Gt = /* @__PURE__ */ B(Ht, [["render", Wt], ["__scopeId", "data-v-e49a9063
|
|
|
1926
1958
|
moreActive: { type: Boolean, default: !1 },
|
|
1927
1959
|
// When false (welcome / no conversation) the avatar + title + status
|
|
1928
1960
|
// block is hidden so the header stays a minimal action bar.
|
|
1929
|
-
showIdentity: { type: Boolean, default: !0 }
|
|
1961
|
+
showIdentity: { type: Boolean, default: !0 },
|
|
1962
|
+
agentName: { type: String, default: "" },
|
|
1963
|
+
agentAvatarUrl: { type: String, default: null }
|
|
1930
1964
|
},
|
|
1931
1965
|
emits: ["back", "close", "more"],
|
|
1932
1966
|
computed: {
|
|
@@ -1945,22 +1979,22 @@ const Gt = /* @__PURE__ */ B(Ht, [["render", Wt], ["__scopeId", "data-v-e49a9063
|
|
|
1945
1979
|
return n;
|
|
1946
1980
|
}
|
|
1947
1981
|
}
|
|
1948
|
-
},
|
|
1982
|
+
}, Xt = { class: "wm-header" }, Jt = ["aria-label"], Zt = {
|
|
1949
1983
|
key: 1,
|
|
1950
1984
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
1951
|
-
},
|
|
1985
|
+
}, en = { class: "wm-header__avatar" }, tn = { class: "wm-header__main" }, nn = { class: "wm-header__title" }, sn = {
|
|
1952
1986
|
key: 3,
|
|
1953
1987
|
class: "wm-header__fill"
|
|
1954
|
-
},
|
|
1955
|
-
function
|
|
1956
|
-
const a =
|
|
1957
|
-
return c(), u("div",
|
|
1988
|
+
}, rn = { class: "wm-header__actions" }, an = ["aria-label", "title"], on = ["aria-label", "title"];
|
|
1989
|
+
function ln(e, t, n, i, r, s) {
|
|
1990
|
+
const a = L("AIAvatar"), l = L("TeamAvatars");
|
|
1991
|
+
return c(), u("div", Xt, [
|
|
1958
1992
|
n.showBack ? (c(), u("button", {
|
|
1959
1993
|
key: 0,
|
|
1960
1994
|
type: "button",
|
|
1961
1995
|
class: "wm-header__icon",
|
|
1962
1996
|
"aria-label": s.t("header.backToHome"),
|
|
1963
|
-
onClick: t[0] || (t[0] = (
|
|
1997
|
+
onClick: t[0] || (t[0] = (p) => e.$emit("back"))
|
|
1964
1998
|
}, [...t[3] || (t[3] = [
|
|
1965
1999
|
o("svg", {
|
|
1966
2000
|
width: "13",
|
|
@@ -1975,28 +2009,32 @@ function on(e, t, n, i, r, s) {
|
|
|
1975
2009
|
}, [
|
|
1976
2010
|
o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
1977
2011
|
], -1)
|
|
1978
|
-
])], 8,
|
|
1979
|
-
n.showIdentity ? (c(), u(
|
|
1980
|
-
o("div", Zt, [
|
|
1981
|
-
q(a, { size: 30 })
|
|
1982
|
-
]),
|
|
2012
|
+
])], 8, Jt)) : (c(), u("div", Zt)),
|
|
2013
|
+
n.showIdentity ? (c(), u(I, { key: 2 }, [
|
|
1983
2014
|
o("div", en, [
|
|
1984
|
-
|
|
2015
|
+
$(a, {
|
|
2016
|
+
size: 30,
|
|
2017
|
+
name: n.agentName,
|
|
2018
|
+
"image-url": n.agentAvatarUrl
|
|
2019
|
+
}, null, 8, ["name", "image-url"])
|
|
2020
|
+
]),
|
|
2021
|
+
o("div", tn, [
|
|
2022
|
+
o("div", nn, v(n.title), 1)
|
|
1985
2023
|
]),
|
|
1986
2024
|
s.hasTeam ? (c(), R(l, {
|
|
1987
2025
|
key: 0,
|
|
1988
2026
|
members: s.displayedTeamMembers,
|
|
1989
2027
|
"response-label": ""
|
|
1990
2028
|
}, null, 8, ["members"])) : b("", !0)
|
|
1991
|
-
], 64)) : (c(), u("div",
|
|
1992
|
-
o("div",
|
|
2029
|
+
], 64)) : (c(), u("div", sn)),
|
|
2030
|
+
o("div", rn, [
|
|
1993
2031
|
n.showMore ? (c(), u("button", {
|
|
1994
2032
|
key: 0,
|
|
1995
2033
|
type: "button",
|
|
1996
2034
|
class: x(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
|
|
1997
2035
|
"aria-label": s.t("header.moreOptions"),
|
|
1998
2036
|
title: s.t("header.moreOptions"),
|
|
1999
|
-
onClick: t[1] || (t[1] = (
|
|
2037
|
+
onClick: t[1] || (t[1] = (p) => e.$emit("more"))
|
|
2000
2038
|
}, [...t[4] || (t[4] = [
|
|
2001
2039
|
o("svg", {
|
|
2002
2040
|
width: "13",
|
|
@@ -2021,14 +2059,14 @@ function on(e, t, n, i, r, s) {
|
|
|
2021
2059
|
r: "1.6"
|
|
2022
2060
|
})
|
|
2023
2061
|
], -1)
|
|
2024
|
-
])], 10,
|
|
2062
|
+
])], 10, an)) : b("", !0),
|
|
2025
2063
|
n.showClose ? (c(), u("button", {
|
|
2026
2064
|
key: 1,
|
|
2027
2065
|
type: "button",
|
|
2028
2066
|
class: "wm-header__icon",
|
|
2029
2067
|
"aria-label": s.t("header.closeWidget"),
|
|
2030
2068
|
title: s.t("header.closeWidget"),
|
|
2031
|
-
onClick: t[2] || (t[2] = (
|
|
2069
|
+
onClick: t[2] || (t[2] = (p) => e.$emit("close"))
|
|
2032
2070
|
}, [...t[5] || (t[5] = [
|
|
2033
2071
|
o("svg", {
|
|
2034
2072
|
width: "13",
|
|
@@ -2043,32 +2081,32 @@ function on(e, t, n, i, r, s) {
|
|
|
2043
2081
|
}, [
|
|
2044
2082
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
2045
2083
|
], -1)
|
|
2046
|
-
])], 8,
|
|
2084
|
+
])], 8, on)) : b("", !0)
|
|
2047
2085
|
])
|
|
2048
2086
|
]);
|
|
2049
2087
|
}
|
|
2050
|
-
const
|
|
2088
|
+
const cn = /* @__PURE__ */ B(Qt, [["render", ln], ["__scopeId", "data-v-925c9e94"]]);
|
|
2051
2089
|
function Ee(e) {
|
|
2052
2090
|
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2053
2091
|
}
|
|
2054
|
-
function
|
|
2092
|
+
function dn(e) {
|
|
2055
2093
|
return /^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim());
|
|
2056
2094
|
}
|
|
2057
|
-
const
|
|
2095
|
+
const Me = "";
|
|
2058
2096
|
function re(e) {
|
|
2059
2097
|
let t = e;
|
|
2060
2098
|
const n = [];
|
|
2061
2099
|
return t = t.replace(/`([^`\n]+)`/g, (i, r) => {
|
|
2062
2100
|
const s = n.length;
|
|
2063
|
-
return n.push(r), `${
|
|
2064
|
-
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, r, s) =>
|
|
2101
|
+
return n.push(r), `${Me}CODE${s}${Me}`;
|
|
2102
|
+
}), 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
2103
|
}
|
|
2066
|
-
function
|
|
2104
|
+
function un(e) {
|
|
2067
2105
|
if (!e) return "";
|
|
2068
2106
|
const t = String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g, "$1");
|
|
2069
2107
|
return re(Ee(t));
|
|
2070
2108
|
}
|
|
2071
|
-
function
|
|
2109
|
+
function mn(e) {
|
|
2072
2110
|
if (!e) return "";
|
|
2073
2111
|
const t = Ee(e).split(`
|
|
2074
2112
|
`), n = [];
|
|
@@ -2116,12 +2154,12 @@ function un(e) {
|
|
|
2116
2154
|
});
|
|
2117
2155
|
continue;
|
|
2118
2156
|
}
|
|
2119
|
-
const
|
|
2120
|
-
if (
|
|
2121
|
-
const C =
|
|
2157
|
+
const p = /^(#{1,6})\s+(.*)$/.exec(s);
|
|
2158
|
+
if (p) {
|
|
2159
|
+
const C = p[1].length;
|
|
2122
2160
|
n.push({
|
|
2123
2161
|
type: "block",
|
|
2124
|
-
html: `<h${C} class="wm-md-h wm-md-h${C}">${re(
|
|
2162
|
+
html: `<h${C} class="wm-md-h wm-md-h${C}">${re(p[2])}</h${C}>`
|
|
2125
2163
|
}), i++;
|
|
2126
2164
|
continue;
|
|
2127
2165
|
}
|
|
@@ -2137,7 +2175,7 @@ function un(e) {
|
|
|
2137
2175
|
}
|
|
2138
2176
|
return r;
|
|
2139
2177
|
}
|
|
2140
|
-
const
|
|
2178
|
+
const Te = {
|
|
2141
2179
|
book: "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",
|
|
2142
2180
|
changelog: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
|
|
2143
2181
|
status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
@@ -2149,12 +2187,14 @@ const Se = {
|
|
|
2149
2187
|
inject: {
|
|
2150
2188
|
// Translator + resolved-language getter shared by the Messenger
|
|
2151
2189
|
// shell. Fall back to French wording when used standalone.
|
|
2152
|
-
t: { default: () =>
|
|
2190
|
+
t: { default: () => j() },
|
|
2153
2191
|
wmLocale: { default: () => () => "fr" }
|
|
2154
2192
|
},
|
|
2155
2193
|
props: {
|
|
2156
2194
|
welcomeMessage: { type: String, default: "" },
|
|
2195
|
+
subtitle: { type: String, default: "" },
|
|
2157
2196
|
agentName: { type: String, default: "" },
|
|
2197
|
+
defaultIconUrl: { type: String, default: null },
|
|
2158
2198
|
quickLinks: { type: Array, default: () => [] },
|
|
2159
2199
|
openThreads: { type: Array, default: () => [] },
|
|
2160
2200
|
busy: { type: Boolean, default: !1 }
|
|
@@ -2168,7 +2208,7 @@ const Se = {
|
|
|
2168
2208
|
return this.welcomeMessage ? this.welcomeMessage : this.agentName ? this.t("onboarding.greetingNamed", { name: this.agentName }) : this.t("onboarding.greeting");
|
|
2169
2209
|
},
|
|
2170
2210
|
heroSub() {
|
|
2171
|
-
return this.t("onboarding.heroSub");
|
|
2211
|
+
return this.subtitle || this.t("onboarding.heroSub");
|
|
2172
2212
|
},
|
|
2173
2213
|
isOddQuickLinks() {
|
|
2174
2214
|
return this.quickLinks.length % 2 === 1;
|
|
@@ -2185,10 +2225,10 @@ const Se = {
|
|
|
2185
2225
|
},
|
|
2186
2226
|
methods: {
|
|
2187
2227
|
iconPath(e) {
|
|
2188
|
-
return
|
|
2228
|
+
return Te[e] || Te.link;
|
|
2189
2229
|
},
|
|
2190
2230
|
renderPreview(e) {
|
|
2191
|
-
return
|
|
2231
|
+
return un(e);
|
|
2192
2232
|
},
|
|
2193
2233
|
formatTs(e) {
|
|
2194
2234
|
if (!e) return "";
|
|
@@ -2210,10 +2250,10 @@ const Se = {
|
|
|
2210
2250
|
});
|
|
2211
2251
|
}
|
|
2212
2252
|
}
|
|
2213
|
-
},
|
|
2253
|
+
}, 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
2254
|
key: 0,
|
|
2215
2255
|
class: "wm-onb__section"
|
|
2216
|
-
},
|
|
2256
|
+
}, wn = { class: "wm-onb__section-title" }, kn = ["onClick"], Cn = { class: "wm-onb__card-icon" }, An = {
|
|
2217
2257
|
width: "16",
|
|
2218
2258
|
height: "16",
|
|
2219
2259
|
viewBox: "0 0 24 24",
|
|
@@ -2223,31 +2263,33 @@ const Se = {
|
|
|
2223
2263
|
"stroke-linecap": "round",
|
|
2224
2264
|
"stroke-linejoin": "round",
|
|
2225
2265
|
"aria-hidden": "true"
|
|
2226
|
-
},
|
|
2266
|
+
}, Sn = ["d"], Mn = { class: "wm-onb__card-body" }, Tn = { class: "wm-onb__card-title" }, xn = {
|
|
2227
2267
|
key: 0,
|
|
2228
2268
|
class: "wm-onb__card-sub"
|
|
2229
|
-
},
|
|
2269
|
+
}, On = {
|
|
2230
2270
|
key: 1,
|
|
2231
2271
|
class: "wm-onb__section"
|
|
2232
|
-
},
|
|
2272
|
+
}, 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"], Un = { class: "wm-onb__thread-body" }, Fn = { class: "wm-onb__thread-title" }, jn = ["innerHTML"], Pn = { class: "wm-onb__thread-meta" }, Dn = {
|
|
2233
2273
|
key: 0,
|
|
2234
2274
|
class: "wm-onb__thread-time"
|
|
2235
|
-
},
|
|
2275
|
+
}, Hn = {
|
|
2236
2276
|
key: 0,
|
|
2237
2277
|
class: "wm-onb__empty"
|
|
2238
2278
|
};
|
|
2239
|
-
function
|
|
2240
|
-
const a =
|
|
2241
|
-
return c(), u("div",
|
|
2242
|
-
o("div",
|
|
2243
|
-
|
|
2279
|
+
function zn(e, t, n, i, r, s) {
|
|
2280
|
+
const a = L("AIAvatar");
|
|
2281
|
+
return c(), u("div", fn, [
|
|
2282
|
+
o("div", _n, [
|
|
2283
|
+
$(a, {
|
|
2244
2284
|
size: 56,
|
|
2245
|
-
pulse: !0
|
|
2246
|
-
|
|
2247
|
-
|
|
2285
|
+
pulse: !0,
|
|
2286
|
+
name: n.agentName,
|
|
2287
|
+
"image-url": n.defaultIconUrl
|
|
2288
|
+
}, null, 8, ["name", "image-url"]),
|
|
2289
|
+
o("div", gn, v(s.heroTitle), 1),
|
|
2248
2290
|
o("div", pn, v(s.heroSub), 1)
|
|
2249
2291
|
]),
|
|
2250
|
-
o("div",
|
|
2292
|
+
o("div", vn, [
|
|
2251
2293
|
o("button", {
|
|
2252
2294
|
type: "button",
|
|
2253
2295
|
class: "wm-onb__startBtn",
|
|
@@ -2270,35 +2312,35 @@ function $n(e, t, n, i, r, s) {
|
|
|
2270
2312
|
])
|
|
2271
2313
|
], -1)),
|
|
2272
2314
|
o("span", null, v(n.busy ? "…" : s.t("onboarding.start")), 1)
|
|
2273
|
-
], 8,
|
|
2315
|
+
], 8, yn)
|
|
2274
2316
|
]),
|
|
2275
|
-
n.quickLinks.length ? (c(), u("div",
|
|
2276
|
-
o("div",
|
|
2317
|
+
n.quickLinks.length ? (c(), u("div", bn, [
|
|
2318
|
+
o("div", wn, v(s.t("onboarding.quickAccess")), 1),
|
|
2277
2319
|
o("div", {
|
|
2278
2320
|
class: x(s.quickLinksLayout)
|
|
2279
2321
|
}, [
|
|
2280
|
-
(c(!0), u(
|
|
2281
|
-
key:
|
|
2322
|
+
(c(!0), u(I, null, F(n.quickLinks, (l, p) => (c(), u("button", {
|
|
2323
|
+
key: p,
|
|
2282
2324
|
type: "button",
|
|
2283
2325
|
class: x(["wm-onb__card", { "wm-onb__card--row": s.isOddQuickLinks }]),
|
|
2284
2326
|
onClick: (C) => e.$emit("select", l)
|
|
2285
2327
|
}, [
|
|
2286
|
-
o("span",
|
|
2287
|
-
(c(), u("svg",
|
|
2328
|
+
o("span", Cn, [
|
|
2329
|
+
(c(), u("svg", An, [
|
|
2288
2330
|
o("path", {
|
|
2289
2331
|
d: s.iconPath(l.icon)
|
|
2290
|
-
}, null, 8,
|
|
2332
|
+
}, null, 8, Sn)
|
|
2291
2333
|
]))
|
|
2292
2334
|
]),
|
|
2293
|
-
o("span",
|
|
2294
|
-
o("span",
|
|
2295
|
-
l.description ? (c(), u("span",
|
|
2335
|
+
o("span", Mn, [
|
|
2336
|
+
o("span", Tn, v(l.label), 1),
|
|
2337
|
+
l.description ? (c(), u("span", xn, v(l.description), 1)) : b("", !0)
|
|
2296
2338
|
])
|
|
2297
|
-
], 10,
|
|
2339
|
+
], 10, kn))), 128))
|
|
2298
2340
|
], 2)
|
|
2299
2341
|
])) : b("", !0),
|
|
2300
|
-
n.openThreads.length ? (c(), u("div",
|
|
2301
|
-
o("div",
|
|
2342
|
+
n.openThreads.length ? (c(), u("div", On, [
|
|
2343
|
+
o("div", In, v(s.t("onboarding.recentConversations")), 1),
|
|
2302
2344
|
o("div", Ln, [
|
|
2303
2345
|
t[3] || (t[3] = o("span", { class: "wm-onb__searchIcon" }, [
|
|
2304
2346
|
o("svg", {
|
|
@@ -2315,21 +2357,21 @@ function $n(e, t, n, i, r, s) {
|
|
|
2315
2357
|
o("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
|
|
2316
2358
|
])
|
|
2317
2359
|
], -1)),
|
|
2318
|
-
|
|
2360
|
+
K(o("input", {
|
|
2319
2361
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => r.query = l),
|
|
2320
2362
|
type: "text",
|
|
2321
2363
|
placeholder: s.t("onboarding.search"),
|
|
2322
2364
|
"aria-label": s.t("onboarding.search")
|
|
2323
|
-
}, null, 8,
|
|
2365
|
+
}, null, 8, Bn), [
|
|
2324
2366
|
[ee, r.query]
|
|
2325
2367
|
])
|
|
2326
2368
|
]),
|
|
2327
|
-
o("div",
|
|
2328
|
-
(c(!0), u(
|
|
2369
|
+
o("div", En, [
|
|
2370
|
+
(c(!0), u(I, null, F(s.filteredThreads, (l) => (c(), u("button", {
|
|
2329
2371
|
key: l.id,
|
|
2330
2372
|
type: "button",
|
|
2331
2373
|
class: "wm-onb__thread",
|
|
2332
|
-
onClick: (
|
|
2374
|
+
onClick: (p) => e.$emit("resume", l)
|
|
2333
2375
|
}, [
|
|
2334
2376
|
o("span", {
|
|
2335
2377
|
class: x(["wm-onb__thread-icon", { "wm-onb__thread-icon--inverted": !l.unread }])
|
|
@@ -2351,9 +2393,9 @@ function $n(e, t, n, i, r, s) {
|
|
|
2351
2393
|
key: 0,
|
|
2352
2394
|
class: "wm-onb__thread-dot",
|
|
2353
2395
|
"aria-label": s.t("onboarding.unread")
|
|
2354
|
-
}, null, 8,
|
|
2396
|
+
}, null, 8, Nn)) : b("", !0)
|
|
2355
2397
|
], 2),
|
|
2356
|
-
o("span",
|
|
2398
|
+
o("span", Un, [
|
|
2357
2399
|
o("span", Fn, v(l.title), 1),
|
|
2358
2400
|
o("span", {
|
|
2359
2401
|
class: "wm-onb__thread-preview",
|
|
@@ -2377,17 +2419,17 @@ function $n(e, t, n, i, r, s) {
|
|
|
2377
2419
|
o("path", { d: "M5 12h14M13 5l7 7-7 7" })
|
|
2378
2420
|
], -1))
|
|
2379
2421
|
])
|
|
2380
|
-
], 8,
|
|
2381
|
-
s.filteredThreads.length ? b("", !0) : (c(), u("div",
|
|
2422
|
+
], 8, Rn))), 128)),
|
|
2423
|
+
s.filteredThreads.length ? b("", !0) : (c(), u("div", Hn, v(s.t("onboarding.noResults", { query: r.query })), 1))
|
|
2382
2424
|
])
|
|
2383
2425
|
])) : b("", !0)
|
|
2384
2426
|
]);
|
|
2385
2427
|
}
|
|
2386
|
-
const
|
|
2387
|
-
function
|
|
2428
|
+
const qn = /* @__PURE__ */ B(hn, [["render", zn], ["__scopeId", "data-v-8d8bd2ac"]]);
|
|
2429
|
+
function $n(e) {
|
|
2388
2430
|
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
2431
|
}
|
|
2390
|
-
const
|
|
2432
|
+
const Vn = {
|
|
2391
2433
|
name: "WmActionResult",
|
|
2392
2434
|
props: {
|
|
2393
2435
|
state: { type: String, default: "success" },
|
|
@@ -2397,13 +2439,13 @@ const zn = {
|
|
|
2397
2439
|
},
|
|
2398
2440
|
computed: {
|
|
2399
2441
|
detailText() {
|
|
2400
|
-
return
|
|
2442
|
+
return $n(this.detail);
|
|
2401
2443
|
}
|
|
2402
2444
|
}
|
|
2403
|
-
},
|
|
2445
|
+
}, Kn = {
|
|
2404
2446
|
class: "wm-result__icon",
|
|
2405
2447
|
"aria-hidden": "true"
|
|
2406
|
-
},
|
|
2448
|
+
}, Wn = {
|
|
2407
2449
|
key: 0,
|
|
2408
2450
|
width: "11",
|
|
2409
2451
|
height: "11",
|
|
@@ -2413,7 +2455,7 @@ const zn = {
|
|
|
2413
2455
|
"stroke-width": "2.8",
|
|
2414
2456
|
"stroke-linecap": "round",
|
|
2415
2457
|
"stroke-linejoin": "round"
|
|
2416
|
-
},
|
|
2458
|
+
}, Gn = {
|
|
2417
2459
|
key: 1,
|
|
2418
2460
|
width: "11",
|
|
2419
2461
|
height: "11",
|
|
@@ -2423,7 +2465,7 @@ const zn = {
|
|
|
2423
2465
|
"stroke-width": "2.6",
|
|
2424
2466
|
"stroke-linecap": "round",
|
|
2425
2467
|
"stroke-linejoin": "round"
|
|
2426
|
-
},
|
|
2468
|
+
}, Yn = {
|
|
2427
2469
|
key: 2,
|
|
2428
2470
|
width: "11",
|
|
2429
2471
|
height: "11",
|
|
@@ -2433,7 +2475,7 @@ const zn = {
|
|
|
2433
2475
|
"stroke-width": "2.4",
|
|
2434
2476
|
"stroke-linecap": "round",
|
|
2435
2477
|
"stroke-linejoin": "round"
|
|
2436
|
-
},
|
|
2478
|
+
}, Qn = {
|
|
2437
2479
|
key: 3,
|
|
2438
2480
|
width: "12",
|
|
2439
2481
|
height: "12",
|
|
@@ -2443,24 +2485,24 @@ const zn = {
|
|
|
2443
2485
|
"stroke-width": "2.2",
|
|
2444
2486
|
"stroke-linecap": "round",
|
|
2445
2487
|
"stroke-linejoin": "round"
|
|
2446
|
-
},
|
|
2447
|
-
function
|
|
2488
|
+
}, Xn = { class: "wm-result__body" }, Jn = { class: "wm-result__label" }, Zn = { class: "wm-result__detail" };
|
|
2489
|
+
function es(e, t, n, i, r, s) {
|
|
2448
2490
|
return c(), u("div", {
|
|
2449
2491
|
class: x(["wm-result", `wm-result--${n.state}`])
|
|
2450
2492
|
}, [
|
|
2451
|
-
o("span",
|
|
2452
|
-
n.state === "success" ? (c(), u("svg",
|
|
2493
|
+
o("span", Kn, [
|
|
2494
|
+
n.state === "success" ? (c(), u("svg", Wn, [...t[0] || (t[0] = [
|
|
2453
2495
|
o("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
2454
|
-
])])) : n.state === "rejected" ? (c(), u("svg",
|
|
2496
|
+
])])) : n.state === "rejected" ? (c(), u("svg", Gn, [...t[1] || (t[1] = [
|
|
2455
2497
|
o("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
2456
|
-
])])) : n.state === "awaiting" ? (c(), u("svg",
|
|
2498
|
+
])])) : n.state === "awaiting" ? (c(), u("svg", Yn, [...t[2] || (t[2] = [
|
|
2457
2499
|
o("circle", {
|
|
2458
2500
|
cx: "12",
|
|
2459
2501
|
cy: "12",
|
|
2460
2502
|
r: "10"
|
|
2461
2503
|
}, null, -1),
|
|
2462
2504
|
o("polyline", { points: "12 7 12 12 15 14" }, null, -1)
|
|
2463
|
-
])])) : (c(), u("svg",
|
|
2505
|
+
])])) : (c(), u("svg", Qn, [...t[3] || (t[3] = [
|
|
2464
2506
|
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
2507
|
o("line", {
|
|
2466
2508
|
x1: "12",
|
|
@@ -2476,24 +2518,24 @@ function Zn(e, t, n, i, r, s) {
|
|
|
2476
2518
|
}, null, -1)
|
|
2477
2519
|
])]))
|
|
2478
2520
|
]),
|
|
2479
|
-
o("span",
|
|
2480
|
-
o("span",
|
|
2481
|
-
s.detailText ? (c(), u(
|
|
2521
|
+
o("span", Xn, [
|
|
2522
|
+
o("span", Jn, v(n.label), 1),
|
|
2523
|
+
s.detailText ? (c(), u(I, { key: 0 }, [
|
|
2482
2524
|
t[4] || (t[4] = o("span", {
|
|
2483
2525
|
class: "wm-result__sep",
|
|
2484
2526
|
"aria-hidden": "true"
|
|
2485
2527
|
}, " · ", -1)),
|
|
2486
|
-
o("span",
|
|
2528
|
+
o("span", Zn, v(s.detailText), 1)
|
|
2487
2529
|
], 64)) : b("", !0)
|
|
2488
2530
|
])
|
|
2489
2531
|
], 2);
|
|
2490
2532
|
}
|
|
2491
|
-
const
|
|
2533
|
+
const ts = /* @__PURE__ */ B(Vn, [["render", es], ["__scopeId", "data-v-7284acd0"]]), ns = {
|
|
2492
2534
|
name: "WmArtifactFormResponse",
|
|
2493
2535
|
inject: {
|
|
2494
2536
|
// Translator shared by the Messenger shell; French fallback when
|
|
2495
2537
|
// the component is used standalone.
|
|
2496
|
-
t: { default: () =>
|
|
2538
|
+
t: { default: () => j() }
|
|
2497
2539
|
},
|
|
2498
2540
|
props: {
|
|
2499
2541
|
data: { type: Object, required: !0 }
|
|
@@ -2504,12 +2546,12 @@ const es = /* @__PURE__ */ B(zn, [["render", Zn], ["__scopeId", "data-v-7284acd0
|
|
|
2504
2546
|
return Array.isArray((e = this.data) == null ? void 0 : e.fields) ? this.data.fields : [];
|
|
2505
2547
|
}
|
|
2506
2548
|
}
|
|
2507
|
-
},
|
|
2508
|
-
function
|
|
2509
|
-
return c(), u("div",
|
|
2510
|
-
o("div",
|
|
2511
|
-
o("div",
|
|
2512
|
-
o("span",
|
|
2549
|
+
}, 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" };
|
|
2550
|
+
function cs(e, t, n, i, r, s) {
|
|
2551
|
+
return c(), u("div", ss, [
|
|
2552
|
+
o("div", rs, [
|
|
2553
|
+
o("div", is, v(n.data.title || s.t("form.title")), 1),
|
|
2554
|
+
o("span", as, [
|
|
2513
2555
|
t[0] || (t[0] = o("svg", {
|
|
2514
2556
|
width: "11",
|
|
2515
2557
|
height: "11",
|
|
@@ -2523,15 +2565,15 @@ function ls(e, t, n, i, r, s) {
|
|
|
2523
2565
|
}, [
|
|
2524
2566
|
o("polyline", { points: "20 6 9 17 4 12" })
|
|
2525
2567
|
], -1)),
|
|
2526
|
-
|
|
2568
|
+
ge(" " + v(s.t("form.sent")), 1)
|
|
2527
2569
|
])
|
|
2528
2570
|
]),
|
|
2529
|
-
o("div",
|
|
2530
|
-
(c(!0), u(
|
|
2571
|
+
o("div", os, [
|
|
2572
|
+
(c(!0), u(I, null, F(s.fields, (a, l) => (c(), u("div", {
|
|
2531
2573
|
key: l,
|
|
2532
2574
|
class: "wm-art__field"
|
|
2533
2575
|
}, [
|
|
2534
|
-
o("div",
|
|
2576
|
+
o("div", ls, v(a.label), 1),
|
|
2535
2577
|
o("div", {
|
|
2536
2578
|
class: x([
|
|
2537
2579
|
"wm-art__fieldValue",
|
|
@@ -2542,7 +2584,7 @@ function ls(e, t, n, i, r, s) {
|
|
|
2542
2584
|
])
|
|
2543
2585
|
]);
|
|
2544
2586
|
}
|
|
2545
|
-
const
|
|
2587
|
+
const ds = /* @__PURE__ */ B(ns, [["render", cs], ["__scopeId", "data-v-713aecf1"]]), us = {
|
|
2546
2588
|
name: "WmArtifactInfoCard",
|
|
2547
2589
|
props: {
|
|
2548
2590
|
data: { type: Object, required: !0 }
|
|
@@ -2557,32 +2599,32 @@ const cs = /* @__PURE__ */ B(ts, [["render", ls], ["__scopeId", "data-v-713aecf1
|
|
|
2557
2599
|
return !!((e = this.data) != null && e.body) || this.fields.length > 0;
|
|
2558
2600
|
}
|
|
2559
2601
|
}
|
|
2560
|
-
},
|
|
2602
|
+
}, ms = { class: "wm-art wm-art--infoCard" }, hs = {
|
|
2561
2603
|
key: 0,
|
|
2562
2604
|
class: "wm-art__image"
|
|
2563
|
-
},
|
|
2605
|
+
}, fs = ["src", "alt"], _s = { class: "wm-art__head" }, gs = { class: "wm-art__headMain" }, ps = { class: "wm-art__title" }, vs = {
|
|
2564
2606
|
key: 0,
|
|
2565
2607
|
class: "wm-art__subtitle"
|
|
2566
|
-
},
|
|
2608
|
+
}, ys = {
|
|
2567
2609
|
key: 1,
|
|
2568
2610
|
class: "wm-art__body"
|
|
2569
|
-
},
|
|
2611
|
+
}, bs = {
|
|
2570
2612
|
key: 0,
|
|
2571
2613
|
class: "wm-art__text"
|
|
2572
|
-
},
|
|
2573
|
-
function
|
|
2574
|
-
return c(), u("div",
|
|
2614
|
+
}, ws = { class: "wm-art__fieldLabel" };
|
|
2615
|
+
function ks(e, t, n, i, r, s) {
|
|
2616
|
+
return c(), u("div", ms, [
|
|
2575
2617
|
n.data.image_url ? (c(), u("figure", hs, [
|
|
2576
2618
|
o("img", {
|
|
2577
2619
|
src: n.data.image_url,
|
|
2578
2620
|
alt: n.data.title || "",
|
|
2579
2621
|
loading: "lazy"
|
|
2580
|
-
}, null, 8,
|
|
2622
|
+
}, null, 8, fs)
|
|
2581
2623
|
])) : b("", !0),
|
|
2582
|
-
o("div",
|
|
2583
|
-
o("div",
|
|
2624
|
+
o("div", _s, [
|
|
2625
|
+
o("div", gs, [
|
|
2584
2626
|
o("div", ps, v(n.data.title), 1),
|
|
2585
|
-
n.data.subtitle ? (c(), u("div",
|
|
2627
|
+
n.data.subtitle ? (c(), u("div", vs, v(n.data.subtitle), 1)) : b("", !0)
|
|
2586
2628
|
]),
|
|
2587
2629
|
n.data.badge && n.data.badge.label ? (c(), u("span", {
|
|
2588
2630
|
key: 0,
|
|
@@ -2592,13 +2634,13 @@ function ws(e, t, n, i, r, s) {
|
|
|
2592
2634
|
])
|
|
2593
2635
|
}, v(n.data.badge.label), 3)) : b("", !0)
|
|
2594
2636
|
]),
|
|
2595
|
-
s.hasBody ? (c(), u("div",
|
|
2596
|
-
n.data.body ? (c(), u("div",
|
|
2597
|
-
s.fields.length ? (c(!0), u(
|
|
2637
|
+
s.hasBody ? (c(), u("div", ys, [
|
|
2638
|
+
n.data.body ? (c(), u("div", bs, v(n.data.body), 1)) : b("", !0),
|
|
2639
|
+
s.fields.length ? (c(!0), u(I, { key: 1 }, F(s.fields, (a, l) => (c(), u("div", {
|
|
2598
2640
|
key: l,
|
|
2599
2641
|
class: "wm-art__field"
|
|
2600
2642
|
}, [
|
|
2601
|
-
o("div",
|
|
2643
|
+
o("div", ws, v(a.label), 1),
|
|
2602
2644
|
o("div", {
|
|
2603
2645
|
class: x([
|
|
2604
2646
|
"wm-art__fieldValue",
|
|
@@ -2609,8 +2651,8 @@ function ws(e, t, n, i, r, s) {
|
|
|
2609
2651
|
])) : b("", !0)
|
|
2610
2652
|
]);
|
|
2611
2653
|
}
|
|
2612
|
-
const
|
|
2613
|
-
function
|
|
2654
|
+
const Cs = /* @__PURE__ */ B(us, [["render", ks], ["__scopeId", "data-v-7eae0e4a"]]);
|
|
2655
|
+
function As(e, t, n) {
|
|
2614
2656
|
if (!e) return "";
|
|
2615
2657
|
const i = new Date(e);
|
|
2616
2658
|
if (Number.isNaN(i.getTime())) return e;
|
|
@@ -2624,12 +2666,12 @@ function Cs(e, t, n) {
|
|
|
2624
2666
|
});
|
|
2625
2667
|
return `${r}${n}${s}`;
|
|
2626
2668
|
}
|
|
2627
|
-
const
|
|
2669
|
+
const Ss = {
|
|
2628
2670
|
name: "WmArtifactTicket",
|
|
2629
2671
|
inject: {
|
|
2630
2672
|
// Translator + resolved-language getter shared by the Messenger
|
|
2631
2673
|
// shell. Fall back to French wording when used standalone.
|
|
2632
|
-
t: { default: () =>
|
|
2674
|
+
t: { default: () => j() },
|
|
2633
2675
|
wmLocale: { default: () => () => "fr" }
|
|
2634
2676
|
},
|
|
2635
2677
|
props: {
|
|
@@ -2642,7 +2684,7 @@ const As = {
|
|
|
2642
2684
|
},
|
|
2643
2685
|
formattedDate() {
|
|
2644
2686
|
var e;
|
|
2645
|
-
return
|
|
2687
|
+
return As(
|
|
2646
2688
|
(e = this.data) == null ? void 0 : e.created_at,
|
|
2647
2689
|
oe(this.wmLocale()),
|
|
2648
2690
|
this.t("ticket.dateAt")
|
|
@@ -2670,13 +2712,13 @@ const As = {
|
|
|
2670
2712
|
return /high|haute|élev|elev|critic|critiq|urgent/.test(t) ? 3 : /low|basse|faible|minor/.test(t) ? 1 : 2;
|
|
2671
2713
|
}
|
|
2672
2714
|
}
|
|
2673
|
-
},
|
|
2715
|
+
}, 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
2716
|
key: 0,
|
|
2675
2717
|
class: "wm-tk__text"
|
|
2676
|
-
},
|
|
2718
|
+
}, Bs = {
|
|
2677
2719
|
key: 0,
|
|
2678
2720
|
class: "wm-art__body"
|
|
2679
|
-
},
|
|
2721
|
+
}, Es = { class: "wm-art__fieldLabel" }, Rs = ["data-level"], Ns = {
|
|
2680
2722
|
key: 1,
|
|
2681
2723
|
class: "wm-tk__date",
|
|
2682
2724
|
width: "12",
|
|
@@ -2688,16 +2730,16 @@ const As = {
|
|
|
2688
2730
|
"stroke-linecap": "round",
|
|
2689
2731
|
"stroke-linejoin": "round",
|
|
2690
2732
|
"aria-hidden": "true"
|
|
2691
|
-
},
|
|
2733
|
+
}, Us = {
|
|
2692
2734
|
key: 1,
|
|
2693
2735
|
class: "wm-art__footer wm-tk__footer"
|
|
2694
2736
|
};
|
|
2695
2737
|
function Fs(e, t, n, i, r, s) {
|
|
2696
|
-
return c(), u("div",
|
|
2697
|
-
o("div",
|
|
2698
|
-
o("div",
|
|
2699
|
-
o("div",
|
|
2700
|
-
o("div",
|
|
2738
|
+
return c(), u("div", Ms, [
|
|
2739
|
+
o("div", Ts, [
|
|
2740
|
+
o("div", xs, v(n.data.title), 1),
|
|
2741
|
+
o("div", Os, [
|
|
2742
|
+
o("div", Is, [
|
|
2701
2743
|
t[0] || (t[0] = o("svg", {
|
|
2702
2744
|
width: "11",
|
|
2703
2745
|
height: "11",
|
|
@@ -2725,17 +2767,17 @@ function Fs(e, t, n, i, r, s) {
|
|
|
2725
2767
|
class: "wm-tk__dot",
|
|
2726
2768
|
"aria-hidden": "true"
|
|
2727
2769
|
}, null, -1)),
|
|
2728
|
-
|
|
2770
|
+
ge(" " + v(n.data.status.label), 1)
|
|
2729
2771
|
], 2)
|
|
2730
2772
|
]),
|
|
2731
2773
|
n.data.body ? (c(), u("div", Ls, v(n.data.body), 1)) : b("", !0)
|
|
2732
2774
|
]),
|
|
2733
|
-
s.fields.length ? (c(), u("div",
|
|
2734
|
-
(c(!0), u(
|
|
2775
|
+
s.fields.length ? (c(), u("div", Bs, [
|
|
2776
|
+
(c(!0), u(I, null, F(s.fields, (a, l) => (c(), u("div", {
|
|
2735
2777
|
key: l,
|
|
2736
2778
|
class: "wm-art__field"
|
|
2737
2779
|
}, [
|
|
2738
|
-
o("div",
|
|
2780
|
+
o("div", Es, v(a.label), 1),
|
|
2739
2781
|
o("div", {
|
|
2740
2782
|
class: x([
|
|
2741
2783
|
"wm-art__fieldValue",
|
|
@@ -2772,7 +2814,7 @@ function Fs(e, t, n, i, r, s) {
|
|
|
2772
2814
|
height: "9",
|
|
2773
2815
|
rx: "0.5"
|
|
2774
2816
|
}, null, -1)
|
|
2775
|
-
])], 8,
|
|
2817
|
+
])], 8, Rs)) : s.isDate(a.label) ? (c(), u("svg", Ns, [...t[3] || (t[3] = [
|
|
2776
2818
|
o("rect", {
|
|
2777
2819
|
x: "3",
|
|
2778
2820
|
y: "4",
|
|
@@ -2786,7 +2828,7 @@ function Fs(e, t, n, i, r, s) {
|
|
|
2786
2828
|
], 2)
|
|
2787
2829
|
]))), 128))
|
|
2788
2830
|
])) : b("", !0),
|
|
2789
|
-
n.data.created_at ? (c(), u("div",
|
|
2831
|
+
n.data.created_at ? (c(), u("div", Us, [
|
|
2790
2832
|
t[4] || (t[4] = o("svg", {
|
|
2791
2833
|
width: "11",
|
|
2792
2834
|
height: "11",
|
|
@@ -2811,9 +2853,9 @@ function Fs(e, t, n, i, r, s) {
|
|
|
2811
2853
|
])) : b("", !0)
|
|
2812
2854
|
]);
|
|
2813
2855
|
}
|
|
2814
|
-
const js = /* @__PURE__ */ B(
|
|
2815
|
-
form_response:
|
|
2816
|
-
info_card:
|
|
2856
|
+
const js = /* @__PURE__ */ B(Ss, [["render", Fs], ["__scopeId", "data-v-5f30c914"]]), Ps = {
|
|
2857
|
+
form_response: ds,
|
|
2858
|
+
info_card: Cs,
|
|
2817
2859
|
ticket: js
|
|
2818
2860
|
}, Ds = {
|
|
2819
2861
|
name: "WmArtifactRenderer",
|
|
@@ -2830,19 +2872,19 @@ const js = /* @__PURE__ */ B(As, [["render", Fs], ["__scopeId", "data-v-5f30c914
|
|
|
2830
2872
|
}
|
|
2831
2873
|
}
|
|
2832
2874
|
};
|
|
2833
|
-
function
|
|
2834
|
-
return s.component ? (c(), R(
|
|
2875
|
+
function Hs(e, t, n, i, r, s) {
|
|
2876
|
+
return s.component ? (c(), R(Pe(s.component), {
|
|
2835
2877
|
key: 0,
|
|
2836
2878
|
data: n.artifact.data
|
|
2837
2879
|
}, null, 8, ["data"])) : b("", !0);
|
|
2838
2880
|
}
|
|
2839
|
-
const
|
|
2881
|
+
const zs = /* @__PURE__ */ B(Ds, [["render", Hs]]), qs = {
|
|
2840
2882
|
name: "WmAttachmentPreview",
|
|
2841
2883
|
inject: {
|
|
2842
2884
|
signAttachmentFn: { default: null },
|
|
2843
2885
|
// Translator shared by the Messenger shell; French fallback when
|
|
2844
2886
|
// the component is used standalone.
|
|
2845
|
-
t: { default: () =>
|
|
2887
|
+
t: { default: () => j() }
|
|
2846
2888
|
},
|
|
2847
2889
|
props: {
|
|
2848
2890
|
attachment: { type: Object, required: !0 }
|
|
@@ -2900,15 +2942,15 @@ const $s = /* @__PURE__ */ B(Ds, [["render", Us]]), Hs = {
|
|
|
2900
2942
|
this.url || e.preventDefault();
|
|
2901
2943
|
}
|
|
2902
2944
|
}
|
|
2903
|
-
},
|
|
2945
|
+
}, $s = ["href"], Vs = ["src", "alt"], Ks = ["src"], Ws = ["src"], Gs = ["href", "download"], Ys = { class: "wm-att__main" }, Qs = { class: "wm-att__name" }, Xs = {
|
|
2904
2946
|
key: 0,
|
|
2905
2947
|
class: "wm-att__meta"
|
|
2906
|
-
},
|
|
2948
|
+
}, Js = {
|
|
2907
2949
|
key: 0,
|
|
2908
2950
|
class: "wm-att__spin",
|
|
2909
2951
|
"aria-hidden": "true"
|
|
2910
2952
|
};
|
|
2911
|
-
function
|
|
2953
|
+
function Zs(e, t, n, i, r, s) {
|
|
2912
2954
|
return c(), u("div", {
|
|
2913
2955
|
class: x(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
2914
2956
|
}, [
|
|
@@ -2923,18 +2965,18 @@ function Js(e, t, n, i, r, s) {
|
|
|
2923
2965
|
src: r.url,
|
|
2924
2966
|
alt: s.displayName,
|
|
2925
2967
|
loading: "lazy"
|
|
2926
|
-
}, null, 8,
|
|
2927
|
-
], 8,
|
|
2968
|
+
}, null, 8, Vs)
|
|
2969
|
+
], 8, $s)) : s.kind === "audio" && r.url ? (c(), u("audio", {
|
|
2928
2970
|
key: 1,
|
|
2929
2971
|
src: r.url,
|
|
2930
2972
|
controls: "",
|
|
2931
2973
|
preload: "metadata"
|
|
2932
|
-
}, null, 8,
|
|
2974
|
+
}, null, 8, Ks)) : s.kind === "video" && r.url ? (c(), u("video", {
|
|
2933
2975
|
key: 2,
|
|
2934
2976
|
src: r.url,
|
|
2935
2977
|
controls: "",
|
|
2936
2978
|
preload: "metadata"
|
|
2937
|
-
}, null, 8,
|
|
2979
|
+
}, null, 8, Ws)) : (c(), u("a", {
|
|
2938
2980
|
key: 3,
|
|
2939
2981
|
class: "wm-att__file",
|
|
2940
2982
|
href: r.url || "#",
|
|
@@ -2959,15 +3001,15 @@ function Js(e, t, n, i, r, s) {
|
|
|
2959
3001
|
o("path", { d: "M14 2v6h6" })
|
|
2960
3002
|
])
|
|
2961
3003
|
], -1)),
|
|
2962
|
-
o("span",
|
|
2963
|
-
o("span",
|
|
2964
|
-
s.sizeLabel ? (c(), u("span",
|
|
3004
|
+
o("span", Ys, [
|
|
3005
|
+
o("span", Qs, v(s.displayName), 1),
|
|
3006
|
+
s.sizeLabel ? (c(), u("span", Xs, v(s.sizeLabel), 1)) : b("", !0)
|
|
2965
3007
|
]),
|
|
2966
|
-
r.loading ? (c(), u("span",
|
|
2967
|
-
], 8,
|
|
3008
|
+
r.loading ? (c(), u("span", Js)) : b("", !0)
|
|
3009
|
+
], 8, Gs))
|
|
2968
3010
|
], 2);
|
|
2969
3011
|
}
|
|
2970
|
-
const
|
|
3012
|
+
const er = /* @__PURE__ */ B(qs, [["render", Zs], ["__scopeId", "data-v-afc7b0d3"]]), tr = {
|
|
2971
3013
|
name: "WmBubble",
|
|
2972
3014
|
props: {
|
|
2973
3015
|
role: { type: String, default: "ai" },
|
|
@@ -2976,53 +3018,53 @@ const Zs = /* @__PURE__ */ B(Hs, [["render", Js], ["__scopeId", "data-v-afc7b0d3
|
|
|
2976
3018
|
},
|
|
2977
3019
|
computed: {
|
|
2978
3020
|
rendered() {
|
|
2979
|
-
return
|
|
3021
|
+
return mn(this.text);
|
|
2980
3022
|
}
|
|
2981
3023
|
}
|
|
2982
|
-
},
|
|
2983
|
-
function
|
|
3024
|
+
}, nr = ["innerHTML"];
|
|
3025
|
+
function sr(e, t, n, i, r, s) {
|
|
2984
3026
|
return c(), u("div", {
|
|
2985
3027
|
class: x(["wm-bubble", "wm-bubble--" + n.role])
|
|
2986
3028
|
}, [
|
|
2987
|
-
|
|
2988
|
-
o("span", { innerHTML: s.rendered }, null, 8,
|
|
3029
|
+
De(e.$slots, "default", {}, () => [
|
|
3030
|
+
o("span", { innerHTML: s.rendered }, null, 8, nr)
|
|
2989
3031
|
], !0)
|
|
2990
3032
|
], 2);
|
|
2991
3033
|
}
|
|
2992
|
-
const
|
|
2993
|
-
function
|
|
2994
|
-
return c(), u("div",
|
|
3034
|
+
const rr = /* @__PURE__ */ B(tr, [["render", sr], ["__scopeId", "data-v-7ab13147"]]), ir = { name: "WmTyping" }, ar = { class: "wm-typing" };
|
|
3035
|
+
function or(e, t, n, i, r, s) {
|
|
3036
|
+
return c(), u("div", ar, [...t[0] || (t[0] = [
|
|
2995
3037
|
o("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
2996
3038
|
o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
2997
3039
|
o("span", { style: { "animation-delay": "0.4s" } }, null, -1)
|
|
2998
3040
|
])]);
|
|
2999
3041
|
}
|
|
3000
|
-
const
|
|
3042
|
+
const lr = /* @__PURE__ */ B(ir, [["render", or], ["__scopeId", "data-v-df2447fd"]]);
|
|
3001
3043
|
function Z(e) {
|
|
3002
3044
|
return e ? e.client_msg_id || e.id : "";
|
|
3003
3045
|
}
|
|
3004
|
-
const
|
|
3046
|
+
const cr = {
|
|
3005
3047
|
transferred_to_human: "system.transferredToHuman",
|
|
3006
3048
|
assigned: "system.assigned",
|
|
3007
3049
|
unassigned: "system.unassigned",
|
|
3008
3050
|
resolved: "system.resolved",
|
|
3009
3051
|
reopened: "system.reopened",
|
|
3010
3052
|
idle: "system.idle"
|
|
3011
|
-
},
|
|
3053
|
+
}, dr = 80, ur = 200, mr = {
|
|
3012
3054
|
name: "WmMessageList",
|
|
3013
3055
|
components: {
|
|
3014
3056
|
AIAvatar: le,
|
|
3015
3057
|
HumanAvatar: Be,
|
|
3016
|
-
Bubble:
|
|
3017
|
-
Typing:
|
|
3018
|
-
ActionResult:
|
|
3019
|
-
AttachmentPreview:
|
|
3020
|
-
ArtifactRenderer:
|
|
3058
|
+
Bubble: rr,
|
|
3059
|
+
Typing: lr,
|
|
3060
|
+
ActionResult: ts,
|
|
3061
|
+
AttachmentPreview: er,
|
|
3062
|
+
ArtifactRenderer: zs
|
|
3021
3063
|
},
|
|
3022
3064
|
inject: {
|
|
3023
3065
|
// Translator + resolved-language getter shared by the Messenger
|
|
3024
3066
|
// shell. Fall back to French wording when used standalone.
|
|
3025
|
-
t: { default: () =>
|
|
3067
|
+
t: { default: () => j() },
|
|
3026
3068
|
wmLocale: { default: () => () => "fr" }
|
|
3027
3069
|
},
|
|
3028
3070
|
props: {
|
|
@@ -3047,7 +3089,12 @@ const lr = {
|
|
|
3047
3089
|
// `created_at` la dépasse sont arrivés EN DIRECT pendant que
|
|
3048
3090
|
// l'utilisateur regardait — ils n'entrent pas dans le batch "Non lus".
|
|
3049
3091
|
// Vide ⇒ pas de borne haute (rétrocompatible).
|
|
3050
|
-
unreadBoundaryTs: { type: String, default: "" }
|
|
3092
|
+
unreadBoundaryTs: { type: String, default: "" },
|
|
3093
|
+
// Identité de l'agent IA configuré côté widget. Affichée à gauche
|
|
3094
|
+
// de "Assistant IA" dans le pied du cluster IA, et utilisée comme
|
|
3095
|
+
// image de l'avatar IA quand renseignée.
|
|
3096
|
+
aiAgentName: { type: String, default: "" },
|
|
3097
|
+
aiAgentAvatarUrl: { type: String, default: null }
|
|
3051
3098
|
},
|
|
3052
3099
|
emits: ["load-more"],
|
|
3053
3100
|
data() {
|
|
@@ -3097,8 +3144,8 @@ const lr = {
|
|
|
3097
3144
|
});
|
|
3098
3145
|
continue;
|
|
3099
3146
|
}
|
|
3100
|
-
const
|
|
3101
|
-
|
|
3147
|
+
const p = e[e.length - 1];
|
|
3148
|
+
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
3149
|
key: `g-${Z(a)}`,
|
|
3103
3150
|
role: l,
|
|
3104
3151
|
agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
|
|
@@ -3110,8 +3157,8 @@ const lr = {
|
|
|
3110
3157
|
for (const a of e) {
|
|
3111
3158
|
if (a.role === "system") continue;
|
|
3112
3159
|
const l = [];
|
|
3113
|
-
for (const
|
|
3114
|
-
for (const C of this.itemsOf(
|
|
3160
|
+
for (const p of a.messages)
|
|
3161
|
+
for (const C of this.itemsOf(p)) l.push(C);
|
|
3115
3162
|
a.items = l;
|
|
3116
3163
|
}
|
|
3117
3164
|
const t = [];
|
|
@@ -3192,11 +3239,11 @@ const lr = {
|
|
|
3192
3239
|
return `g-${n}`;
|
|
3193
3240
|
},
|
|
3194
3241
|
isAtBottom(e) {
|
|
3195
|
-
return e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
3242
|
+
return e.scrollHeight - e.scrollTop - e.clientHeight <= dr;
|
|
3196
3243
|
},
|
|
3197
3244
|
onScroll() {
|
|
3198
3245
|
const e = this.$refs.scrollEl;
|
|
3199
|
-
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <=
|
|
3246
|
+
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <= ur && (this._pendingLoadMore = !0, this.$emit("load-more")));
|
|
3200
3247
|
},
|
|
3201
3248
|
// Capture pre-patch scroll state and restore it on the next tick.
|
|
3202
3249
|
//
|
|
@@ -3302,7 +3349,10 @@ const lr = {
|
|
|
3302
3349
|
return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
|
|
3303
3350
|
},
|
|
3304
3351
|
roleLabel(e) {
|
|
3305
|
-
|
|
3352
|
+
if (e.role === "human")
|
|
3353
|
+
return e.agentName || this.t("common.agent");
|
|
3354
|
+
const t = this.t("common.aiAssistant");
|
|
3355
|
+
return this.aiAgentName ? `${this.aiAgentName} • ${t}` : t;
|
|
3306
3356
|
},
|
|
3307
3357
|
// Expand a message into atomic visual items, each one a row in
|
|
3308
3358
|
// the smart-corner cluster. Most messages = 1 item. An
|
|
@@ -3394,9 +3444,9 @@ const lr = {
|
|
|
3394
3444
|
// doit garder son arrondi.
|
|
3395
3445
|
cornersFor(e, t) {
|
|
3396
3446
|
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 =
|
|
3447
|
+
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)], q = 0.5, M = (Y, Q, V) => Y != null && T != null ? Y + q >= T : Q === V || Q === "card" && V === "bubble";
|
|
3448
|
+
let P = l, N = l, H = l, W = l;
|
|
3449
|
+
return a ? (C && (N = p), (k || !s) && (H = 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) && (H = p)), { tl: P, tr: N, br: H, bl: W };
|
|
3400
3450
|
},
|
|
3401
3451
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3402
3452
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3443,8 +3493,8 @@ const lr = {
|
|
|
3443
3493
|
".wm-bubble, .wm-result, .wm-art, .wm-list__body"
|
|
3444
3494
|
);
|
|
3445
3495
|
if (!l) continue;
|
|
3446
|
-
const
|
|
3447
|
-
|
|
3496
|
+
const p = l.getBoundingClientRect().width;
|
|
3497
|
+
p > 0 && (t[a] = p);
|
|
3448
3498
|
}
|
|
3449
3499
|
const n = this.widthByKey, i = Object.keys(n), r = Object.keys(t);
|
|
3450
3500
|
if (i.length === r.length) {
|
|
@@ -3462,7 +3512,7 @@ const lr = {
|
|
|
3462
3512
|
const t = e.items[e.items.length - 1], n = (t == null ? void 0 : t.message) || e.messages[e.messages.length - 1];
|
|
3463
3513
|
if (!(n != null && n.created_at)) return "";
|
|
3464
3514
|
try {
|
|
3465
|
-
return
|
|
3515
|
+
return Ie(
|
|
3466
3516
|
new Date(n.created_at),
|
|
3467
3517
|
oe(this.wmLocale())
|
|
3468
3518
|
);
|
|
@@ -3509,7 +3559,7 @@ const lr = {
|
|
|
3509
3559
|
},
|
|
3510
3560
|
systemLabel(e) {
|
|
3511
3561
|
var r, s, a;
|
|
3512
|
-
const t = (r = e == null ? void 0 : e.payload) == null ? void 0 : r.event, n =
|
|
3562
|
+
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
3563
|
return n ? this.t(n, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
|
|
3514
3564
|
},
|
|
3515
3565
|
scrollToBottom() {
|
|
@@ -3522,33 +3572,33 @@ const lr = {
|
|
|
3522
3572
|
class: "wm-list__loadMore",
|
|
3523
3573
|
role: "status",
|
|
3524
3574
|
"aria-live": "polite"
|
|
3525
|
-
},
|
|
3575
|
+
}, fr = { class: "wm-list__loadMore-lbl" }, _r = {
|
|
3526
3576
|
key: 1,
|
|
3527
3577
|
class: "wm-list__historyEnd"
|
|
3528
|
-
},
|
|
3578
|
+
}, gr = {
|
|
3529
3579
|
key: 2,
|
|
3530
3580
|
class: "wm-list__sep"
|
|
3531
|
-
}, pr = { class: "wm-list__sep-label" },
|
|
3581
|
+
}, pr = { class: "wm-list__sep-label" }, vr = {
|
|
3532
3582
|
key: 0,
|
|
3533
3583
|
class: "wm-list__sep wm-list__sep--unread"
|
|
3534
|
-
},
|
|
3584
|
+
}, yr = { class: "wm-list__sep-label wm-list__sep-label--unread" }, br = {
|
|
3535
3585
|
key: 0,
|
|
3536
3586
|
class: "wm-list__sysep"
|
|
3537
|
-
},
|
|
3587
|
+
}, wr = { class: "wm-list__sysep-label" }, kr = ["data-row-key"], Cr = {
|
|
3538
3588
|
key: 0,
|
|
3539
3589
|
class: "wm-list__avatarSlot"
|
|
3540
|
-
},
|
|
3590
|
+
}, Ar = {
|
|
3541
3591
|
key: 5,
|
|
3542
3592
|
class: "wm-list__body"
|
|
3543
|
-
},
|
|
3593
|
+
}, Sr = { key: 0 }, Mr = {
|
|
3544
3594
|
key: 1,
|
|
3545
3595
|
"aria-hidden": "true"
|
|
3546
|
-
},
|
|
3596
|
+
}, Tr = { key: 2 }, xr = {
|
|
3547
3597
|
key: 3,
|
|
3548
3598
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
3549
|
-
},
|
|
3550
|
-
function
|
|
3551
|
-
const a =
|
|
3599
|
+
}, Or = { class: "wm-list__avatarSlot" };
|
|
3600
|
+
function Ir(e, t, n, i, r, s) {
|
|
3601
|
+
const a = L("AIAvatar"), l = L("HumanAvatar"), p = L("ActionResult"), C = L("ArtifactRenderer"), k = L("Bubble"), T = L("AttachmentPreview"), E = L("Typing");
|
|
3552
3602
|
return c(), u("div", {
|
|
3553
3603
|
ref: "scrollEl",
|
|
3554
3604
|
class: x(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
@@ -3559,31 +3609,31 @@ function Or(e, t, n, i, r, s) {
|
|
|
3559
3609
|
class: "wm-list__loadMore-spinner",
|
|
3560
3610
|
"aria-hidden": "true"
|
|
3561
3611
|
}, null, -1)),
|
|
3562
|
-
o("span",
|
|
3563
|
-
])) : s.historyExhausted ? (c(), u("div",
|
|
3564
|
-
n.dateLabel ? (c(), u("div",
|
|
3612
|
+
o("span", fr, v(s.t("messageList.loadingHistory")), 1)
|
|
3613
|
+
])) : s.historyExhausted ? (c(), u("div", _r, v(s.t("messageList.conversationStart")), 1)) : b("", !0),
|
|
3614
|
+
n.dateLabel ? (c(), u("div", gr, [
|
|
3565
3615
|
t[2] || (t[2] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
3566
3616
|
o("span", pr, v(n.dateLabel), 1),
|
|
3567
3617
|
t[3] || (t[3] = o("div", { class: "wm-list__line" }, null, -1))
|
|
3568
3618
|
])) : b("", !0),
|
|
3569
|
-
(c(!0), u(
|
|
3619
|
+
(c(!0), u(I, null, F(s.groups, (A, q) => (c(), u(I, {
|
|
3570
3620
|
key: A.key
|
|
3571
3621
|
}, [
|
|
3572
|
-
A.key === s.unreadGroupKey ? (c(), u("div",
|
|
3622
|
+
A.key === s.unreadGroupKey ? (c(), u("div", vr, [
|
|
3573
3623
|
t[4] || (t[4] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)),
|
|
3574
|
-
o("span",
|
|
3624
|
+
o("span", yr, v(s.t("messageList.unread")), 1),
|
|
3575
3625
|
t[5] || (t[5] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1))
|
|
3576
3626
|
])) : b("", !0),
|
|
3577
3627
|
A.role === "system" || A.items.length ? (c(), u("div", {
|
|
3578
3628
|
key: 1,
|
|
3579
3629
|
class: x(["wm-list__group", "wm-list__group--" + A.role])
|
|
3580
3630
|
}, [
|
|
3581
|
-
A.role === "system" ? (c(), u("div",
|
|
3631
|
+
A.role === "system" ? (c(), u("div", br, [
|
|
3582
3632
|
t[6] || (t[6] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
3583
|
-
o("span",
|
|
3633
|
+
o("span", wr, v(A.systemLabel), 1),
|
|
3584
3634
|
t[7] || (t[7] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
3585
|
-
])) : (c(), u(
|
|
3586
|
-
(c(!0), u(
|
|
3635
|
+
])) : (c(), u(I, { key: 1 }, [
|
|
3636
|
+
(c(!0), u(I, null, F(A.items, (M, P) => (c(), u("div", {
|
|
3587
3637
|
key: `${s.messageKey(M.message)}-${M.partKey}`,
|
|
3588
3638
|
"data-row-key": `${s.messageKey(M.message)}-${M.partKey}`,
|
|
3589
3639
|
class: x(["wm-list__row fade-up", [
|
|
@@ -3593,15 +3643,17 @@ function Or(e, t, n, i, r, s) {
|
|
|
3593
3643
|
"is-failed": M.message._failed
|
|
3594
3644
|
}
|
|
3595
3645
|
]]),
|
|
3596
|
-
style:
|
|
3646
|
+
style: z(s.cornersStyle(A, P))
|
|
3597
3647
|
}, [
|
|
3598
|
-
A.role !== "user" ? (c(), u("div",
|
|
3599
|
-
|
|
3648
|
+
A.role !== "user" ? (c(), u("div", Cr, [
|
|
3649
|
+
P === A.items.length - 1 ? (c(), u(I, { key: 0 }, [
|
|
3600
3650
|
A.role === "ai" ? (c(), R(a, {
|
|
3601
3651
|
key: 0,
|
|
3602
3652
|
size: 26,
|
|
3603
|
-
tail: !0
|
|
3604
|
-
|
|
3653
|
+
tail: !0,
|
|
3654
|
+
name: n.aiAgentName,
|
|
3655
|
+
"image-url": n.aiAgentAvatarUrl
|
|
3656
|
+
}, null, 8, ["name", "image-url"])) : (c(), R(l, {
|
|
3605
3657
|
key: 1,
|
|
3606
3658
|
name: A.agentName,
|
|
3607
3659
|
"avatar-url": A.agentAvatarUrl,
|
|
@@ -3610,12 +3662,12 @@ function Or(e, t, n, i, r, s) {
|
|
|
3610
3662
|
}, null, 8, ["name", "avatar-url"]))
|
|
3611
3663
|
], 64)) : b("", !0)
|
|
3612
3664
|
])) : b("", !0),
|
|
3613
|
-
M.renderAs === "action" ? (c(), R(
|
|
3665
|
+
M.renderAs === "action" ? (c(), R(p, {
|
|
3614
3666
|
key: 1,
|
|
3615
3667
|
state: M.message.payload.state,
|
|
3616
3668
|
label: s.actionLabel(M.message),
|
|
3617
3669
|
detail: s.actionDetail(M.message)
|
|
3618
|
-
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), R(
|
|
3670
|
+
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), R(p, {
|
|
3619
3671
|
key: 2,
|
|
3620
3672
|
state: "awaiting",
|
|
3621
3673
|
label: s.t("messageList.approvalRequestSent"),
|
|
@@ -3626,7 +3678,7 @@ function Or(e, t, n, i, r, s) {
|
|
|
3626
3678
|
}, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(), R(C, {
|
|
3627
3679
|
key: 4,
|
|
3628
3680
|
artifact: s.artifactOf(M.message)
|
|
3629
|
-
}, null, 8, ["artifact"])) : (c(), u("div",
|
|
3681
|
+
}, null, 8, ["artifact"])) : (c(), u("div", Ar, [
|
|
3630
3682
|
M.message.text_md ? (c(), R(k, {
|
|
3631
3683
|
key: 0,
|
|
3632
3684
|
role: A.role,
|
|
@@ -3638,40 +3690,42 @@ function Or(e, t, n, i, r, s) {
|
|
|
3638
3690
|
"wm-list__atts--align-end": A.role === "user"
|
|
3639
3691
|
}])
|
|
3640
3692
|
}, [
|
|
3641
|
-
(c(!0), u(
|
|
3693
|
+
(c(!0), u(I, null, F(s.attachmentsOf(
|
|
3642
3694
|
M.message
|
|
3643
|
-
), (N,
|
|
3644
|
-
key: `${s.messageKey(M.message)}-att-${
|
|
3695
|
+
), (N, H) => (c(), R(T, {
|
|
3696
|
+
key: `${s.messageKey(M.message)}-att-${H}`,
|
|
3645
3697
|
attachment: N
|
|
3646
3698
|
}, null, 8, ["attachment"]))), 128))
|
|
3647
3699
|
], 2)) : b("", !0)
|
|
3648
3700
|
]))
|
|
3649
|
-
], 14,
|
|
3701
|
+
], 14, kr))), 128)),
|
|
3650
3702
|
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (c(), u("div", {
|
|
3651
3703
|
key: 0,
|
|
3652
3704
|
class: x(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
3653
3705
|
}, [
|
|
3654
|
-
A.role !== "user" ? (c(), u("span",
|
|
3655
|
-
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span",
|
|
3656
|
-
s.lastTimeOf(A) ? (c(), u("span",
|
|
3706
|
+
A.role !== "user" ? (c(), u("span", Sr, v(s.roleLabel(A)), 1)) : b("", !0),
|
|
3707
|
+
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span", Mr, "·")) : b("", !0),
|
|
3708
|
+
s.lastTimeOf(A) ? (c(), u("span", Tr, v(s.lastTimeOf(A)), 1)) : b("", !0)
|
|
3657
3709
|
], 2)) : b("", !0)
|
|
3658
3710
|
], 64))
|
|
3659
3711
|
], 2)) : b("", !0)
|
|
3660
3712
|
], 64))), 128)),
|
|
3661
|
-
n.streamingActive ? (c(), u("div",
|
|
3662
|
-
o("div",
|
|
3663
|
-
|
|
3713
|
+
n.streamingActive ? (c(), u("div", xr, [
|
|
3714
|
+
o("div", Or, [
|
|
3715
|
+
$(a, {
|
|
3664
3716
|
size: 26,
|
|
3665
|
-
tail: !0
|
|
3666
|
-
|
|
3717
|
+
tail: !0,
|
|
3718
|
+
name: n.aiAgentName,
|
|
3719
|
+
"image-url": n.aiAgentAvatarUrl
|
|
3720
|
+
}, null, 8, ["name", "image-url"])
|
|
3667
3721
|
]),
|
|
3668
|
-
|
|
3722
|
+
$(E)
|
|
3669
3723
|
])) : b("", !0)
|
|
3670
3724
|
], 34);
|
|
3671
3725
|
}
|
|
3672
|
-
const Lr = /* @__PURE__ */ B(
|
|
3673
|
-
function
|
|
3674
|
-
return
|
|
3726
|
+
const Lr = /* @__PURE__ */ B(mr, [["render", Ir], ["__scopeId", "data-v-d769b193"]]), me = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", be = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
3727
|
+
function Br() {
|
|
3728
|
+
return be && [
|
|
3675
3729
|
"video/webm;codecs=vp9,opus",
|
|
3676
3730
|
"video/webm;codecs=vp8,opus",
|
|
3677
3731
|
"video/webm",
|
|
@@ -3690,11 +3744,11 @@ function Re({ audio: e }) {
|
|
|
3690
3744
|
systemAudio: e ? "include" : "exclude"
|
|
3691
3745
|
};
|
|
3692
3746
|
}
|
|
3693
|
-
function
|
|
3747
|
+
function Ha(e) {
|
|
3694
3748
|
return e ? e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "file" : "file";
|
|
3695
3749
|
}
|
|
3696
|
-
async function
|
|
3697
|
-
if (!
|
|
3750
|
+
async function Er() {
|
|
3751
|
+
if (!me) return null;
|
|
3698
3752
|
let e;
|
|
3699
3753
|
try {
|
|
3700
3754
|
e = await navigator.mediaDevices.getDisplayMedia(
|
|
@@ -3704,7 +3758,7 @@ async function Br() {
|
|
|
3704
3758
|
return (t == null ? void 0 : t.name) !== "NotAllowedError" && console.error("[media] screenshot picker", t), null;
|
|
3705
3759
|
}
|
|
3706
3760
|
try {
|
|
3707
|
-
return await
|
|
3761
|
+
return await Rr(e);
|
|
3708
3762
|
} catch (t) {
|
|
3709
3763
|
return console.error("[media] screenshot capture", t), null;
|
|
3710
3764
|
} finally {
|
|
@@ -3713,22 +3767,22 @@ async function Br() {
|
|
|
3713
3767
|
});
|
|
3714
3768
|
}
|
|
3715
3769
|
}
|
|
3716
|
-
async function
|
|
3770
|
+
async function Rr(e) {
|
|
3717
3771
|
const t = document.createElement("video");
|
|
3718
3772
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
3719
3773
|
const n = t.videoWidth || 1280, i = t.videoHeight || 720, r = document.createElement("canvas");
|
|
3720
3774
|
r.width = n, r.height = i, r.getContext("2d").drawImage(t, 0, 0, n, i);
|
|
3721
|
-
const s = await new Promise((l,
|
|
3775
|
+
const s = await new Promise((l, p) => {
|
|
3722
3776
|
r.toBlob(
|
|
3723
|
-
(C) => C ? l(C) :
|
|
3777
|
+
(C) => C ? l(C) : p(new Error("toBlob failed")),
|
|
3724
3778
|
"image/png"
|
|
3725
3779
|
);
|
|
3726
3780
|
}), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
3727
3781
|
return new File([s], `capture-${a}.png`, { type: "image/png" });
|
|
3728
3782
|
}
|
|
3729
|
-
async function
|
|
3783
|
+
async function Nr(e = {}) {
|
|
3730
3784
|
var C;
|
|
3731
|
-
if (!
|
|
3785
|
+
if (!me || !be) return null;
|
|
3732
3786
|
let t;
|
|
3733
3787
|
try {
|
|
3734
3788
|
t = await navigator.mediaDevices.getDisplayMedia(
|
|
@@ -3737,7 +3791,7 @@ async function Rr(e = {}) {
|
|
|
3737
3791
|
} catch (k) {
|
|
3738
3792
|
return (k == null ? void 0 : k.name) !== "NotAllowedError" && console.error("[media] record picker", k), null;
|
|
3739
3793
|
}
|
|
3740
|
-
const n =
|
|
3794
|
+
const n = Br();
|
|
3741
3795
|
let i;
|
|
3742
3796
|
try {
|
|
3743
3797
|
i = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
|
|
@@ -3755,10 +3809,10 @@ async function Rr(e = {}) {
|
|
|
3755
3809
|
if (s && clearInterval(s), t.getTracks().forEach((E) => {
|
|
3756
3810
|
E.stop();
|
|
3757
3811
|
}), r.length) {
|
|
3758
|
-
const E = i.mimeType || n || "video/webm", A = new Blob(r, { type: E }),
|
|
3812
|
+
const E = i.mimeType || n || "video/webm", A = new Blob(r, { type: E }), q = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), P = new File([A], `ecran-${M}.${q}`, {
|
|
3759
3813
|
type: E
|
|
3760
3814
|
});
|
|
3761
|
-
(k = e.onfinalize) == null || k.call(e,
|
|
3815
|
+
(k = e.onfinalize) == null || k.call(e, P);
|
|
3762
3816
|
} else
|
|
3763
3817
|
(T = e.oncancel) == null || T.call(e);
|
|
3764
3818
|
}), t.getVideoTracks().forEach((k) => {
|
|
@@ -3780,10 +3834,10 @@ async function Rr(e = {}) {
|
|
|
3780
3834
|
}), null;
|
|
3781
3835
|
}
|
|
3782
3836
|
(C = e.onstart) == null || C.call(e);
|
|
3783
|
-
const
|
|
3837
|
+
const p = Date.now();
|
|
3784
3838
|
return s = setInterval(() => {
|
|
3785
3839
|
var k;
|
|
3786
|
-
(k = e.ontick) == null || k.call(e, Date.now() -
|
|
3840
|
+
(k = e.ontick) == null || k.call(e, Date.now() - p);
|
|
3787
3841
|
}, 500), {
|
|
3788
3842
|
stop: l,
|
|
3789
3843
|
get state() {
|
|
@@ -3791,7 +3845,7 @@ async function Rr(e = {}) {
|
|
|
3791
3845
|
}
|
|
3792
3846
|
};
|
|
3793
3847
|
}
|
|
3794
|
-
const
|
|
3848
|
+
const Ur = [
|
|
3795
3849
|
{
|
|
3796
3850
|
action: "file",
|
|
3797
3851
|
labelKey: "composer.attachFile",
|
|
@@ -3812,7 +3866,7 @@ const Nr = [
|
|
|
3812
3866
|
inject: {
|
|
3813
3867
|
// Translator shared by the Messenger shell; French fallback when
|
|
3814
3868
|
// the component is used standalone.
|
|
3815
|
-
t: { default: () =>
|
|
3869
|
+
t: { default: () => j() }
|
|
3816
3870
|
},
|
|
3817
3871
|
props: {
|
|
3818
3872
|
modelValue: { type: String, default: "" },
|
|
@@ -3835,10 +3889,10 @@ const Nr = [
|
|
|
3835
3889
|
return !this.disabled && !!this.local.trim();
|
|
3836
3890
|
},
|
|
3837
3891
|
attachItems() {
|
|
3838
|
-
return
|
|
3892
|
+
return Ur.map((e) => ({
|
|
3839
3893
|
...e,
|
|
3840
3894
|
label: this.t(e.labelKey),
|
|
3841
|
-
disabled: e.action === "screenshot" && !
|
|
3895
|
+
disabled: e.action === "screenshot" && !me || e.action === "record" && (!me || !be)
|
|
3842
3896
|
}));
|
|
3843
3897
|
},
|
|
3844
3898
|
recordingElapsedLabel() {
|
|
@@ -3908,13 +3962,13 @@ const Nr = [
|
|
|
3908
3962
|
},
|
|
3909
3963
|
async captureScreenshot() {
|
|
3910
3964
|
if (this.disabled) return;
|
|
3911
|
-
const e = await
|
|
3965
|
+
const e = await Er();
|
|
3912
3966
|
e && this.$emit("attach", e);
|
|
3913
3967
|
},
|
|
3914
3968
|
async startRecording() {
|
|
3915
3969
|
if (this.recording || this.disabled) return;
|
|
3916
3970
|
this.recordingElapsed = 0;
|
|
3917
|
-
const e = await
|
|
3971
|
+
const e = await Nr({
|
|
3918
3972
|
onstart: () => {
|
|
3919
3973
|
this.recording = !0;
|
|
3920
3974
|
},
|
|
@@ -3942,17 +3996,17 @@ const Nr = [
|
|
|
3942
3996
|
}, jr = { class: "wm-compose-wrap" }, Pr = {
|
|
3943
3997
|
key: 0,
|
|
3944
3998
|
class: "wm-rec"
|
|
3945
|
-
}, Dr = { class: "wm-rec__lbl" },
|
|
3999
|
+
}, Dr = { class: "wm-rec__lbl" }, Hr = {
|
|
3946
4000
|
key: 1,
|
|
3947
4001
|
class: "wm-compose__menu",
|
|
3948
4002
|
role: "menu"
|
|
3949
|
-
},
|
|
4003
|
+
}, zr = ["disabled", "onClick"], qr = { class: "wm-compose__menuIcon" }, $r = {
|
|
3950
4004
|
viewBox: "0 0 24 24",
|
|
3951
4005
|
width: "14",
|
|
3952
4006
|
height: "14",
|
|
3953
4007
|
"aria-hidden": "true"
|
|
3954
|
-
},
|
|
3955
|
-
function
|
|
4008
|
+
}, Vr = ["d"], Kr = ["placeholder", "disabled"], Wr = { class: "wm-compose__actions" }, Gr = ["title", "aria-label", "disabled"], Yr = ["disabled", "aria-label"];
|
|
4009
|
+
function Qr(e, t, n, i, r, s) {
|
|
3956
4010
|
return c(), u("div", jr, [
|
|
3957
4011
|
r.recording ? (c(), u("div", Pr, [
|
|
3958
4012
|
t[8] || (t[8] = o("span", {
|
|
@@ -3982,16 +4036,16 @@ function Yr(e, t, n, i, r, s) {
|
|
|
3982
4036
|
class: "wm-compose__overlay",
|
|
3983
4037
|
onClick: t[2] || (t[2] = (a) => r.attachOpen = !1)
|
|
3984
4038
|
})) : b("", !0),
|
|
3985
|
-
r.attachOpen ? (c(), u("div",
|
|
3986
|
-
(c(!0), u(
|
|
4039
|
+
r.attachOpen ? (c(), u("div", Hr, [
|
|
4040
|
+
(c(!0), u(I, null, F(s.attachItems, (a) => (c(), u("button", {
|
|
3987
4041
|
key: a.action,
|
|
3988
4042
|
type: "button",
|
|
3989
4043
|
class: "wm-compose__menuItem",
|
|
3990
4044
|
disabled: a.disabled,
|
|
3991
4045
|
onClick: (l) => s.onAttachAction(a.action)
|
|
3992
4046
|
}, [
|
|
3993
|
-
o("span",
|
|
3994
|
-
(c(), u("svg",
|
|
4047
|
+
o("span", qr, [
|
|
4048
|
+
(c(), u("svg", $r, [
|
|
3995
4049
|
o("path", {
|
|
3996
4050
|
d: a.path,
|
|
3997
4051
|
stroke: "currentColor",
|
|
@@ -3999,13 +4053,13 @@ function Yr(e, t, n, i, r, s) {
|
|
|
3999
4053
|
"stroke-linecap": "round",
|
|
4000
4054
|
"stroke-linejoin": "round",
|
|
4001
4055
|
fill: "none"
|
|
4002
|
-
}, null, 8,
|
|
4056
|
+
}, null, 8, Vr)
|
|
4003
4057
|
]))
|
|
4004
4058
|
]),
|
|
4005
4059
|
o("span", null, v(a.label), 1)
|
|
4006
|
-
], 8,
|
|
4060
|
+
], 8, zr))), 128))
|
|
4007
4061
|
])) : b("", !0),
|
|
4008
|
-
|
|
4062
|
+
K(o("textarea", {
|
|
4009
4063
|
ref: "inputEl",
|
|
4010
4064
|
"onUpdate:modelValue": t[3] || (t[3] = (a) => r.local = a),
|
|
4011
4065
|
class: "wm-compose__input",
|
|
@@ -4014,10 +4068,10 @@ function Yr(e, t, n, i, r, s) {
|
|
|
4014
4068
|
disabled: n.disabled,
|
|
4015
4069
|
onKeydown: t[4] || (t[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
|
|
4016
4070
|
onInput: t[5] || (t[5] = (...a) => s.autosize && s.autosize(...a))
|
|
4017
|
-
}, null, 40,
|
|
4071
|
+
}, null, 40, Kr), [
|
|
4018
4072
|
[ee, r.local]
|
|
4019
4073
|
]),
|
|
4020
|
-
o("div",
|
|
4074
|
+
o("div", Wr, [
|
|
4021
4075
|
o("button", {
|
|
4022
4076
|
type: "button",
|
|
4023
4077
|
class: x(["wm-compose__icon", { "is-open": r.attachOpen }]),
|
|
@@ -4039,7 +4093,7 @@ function Yr(e, t, n, i, r, s) {
|
|
|
4039
4093
|
}, [
|
|
4040
4094
|
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
4095
|
], -1)
|
|
4042
|
-
])], 10,
|
|
4096
|
+
])], 10, Gr),
|
|
4043
4097
|
o("button", {
|
|
4044
4098
|
type: "submit",
|
|
4045
4099
|
class: x(["wm-compose__send", { "is-empty": !s.canSend }]),
|
|
@@ -4059,12 +4113,12 @@ function Yr(e, t, n, i, r, s) {
|
|
|
4059
4113
|
}, [
|
|
4060
4114
|
o("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
4061
4115
|
], -1)
|
|
4062
|
-
])], 10,
|
|
4116
|
+
])], 10, Yr)
|
|
4063
4117
|
])
|
|
4064
4118
|
], 34)
|
|
4065
4119
|
]);
|
|
4066
4120
|
}
|
|
4067
|
-
const
|
|
4121
|
+
const Xr = /* @__PURE__ */ B(Fr, [["render", Qr], ["__scopeId", "data-v-aa81dbb8"]]), Jr = {
|
|
4068
4122
|
name: "WmSuggestionChips",
|
|
4069
4123
|
props: {
|
|
4070
4124
|
items: { type: Array, default: () => [] },
|
|
@@ -4081,33 +4135,35 @@ const Qr = /* @__PURE__ */ B(Fr, [["render", Yr], ["__scopeId", "data-v-aa81dbb8
|
|
|
4081
4135
|
return this.items.map((e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.text) || "").join("§");
|
|
4082
4136
|
}
|
|
4083
4137
|
}
|
|
4084
|
-
},
|
|
4085
|
-
function
|
|
4138
|
+
}, Zr = ["onClick"];
|
|
4139
|
+
function ei(e, t, n, i, r, s) {
|
|
4086
4140
|
return n.items.length ? (c(), u("div", {
|
|
4087
4141
|
key: s.batchKey,
|
|
4088
4142
|
class: "wm-chips"
|
|
4089
4143
|
}, [
|
|
4090
|
-
(c(!0), u(
|
|
4144
|
+
(c(!0), u(I, null, F(n.items, (a, l) => (c(), u("button", {
|
|
4091
4145
|
key: l,
|
|
4092
4146
|
type: "button",
|
|
4093
4147
|
class: "wm-chip",
|
|
4094
|
-
style:
|
|
4095
|
-
onClick: (
|
|
4096
|
-
}, v(a.label), 13,
|
|
4148
|
+
style: z({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
|
|
4149
|
+
onClick: (p) => e.$emit("select", a)
|
|
4150
|
+
}, v(a.label), 13, Zr))), 128))
|
|
4097
4151
|
])) : b("", !0);
|
|
4098
4152
|
}
|
|
4099
|
-
const
|
|
4153
|
+
const ti = /* @__PURE__ */ B(Jr, [["render", ei], ["__scopeId", "data-v-47ad8085"]]), ni = {
|
|
4100
4154
|
name: "WmApprovalCard",
|
|
4101
4155
|
components: { AIAvatar: le },
|
|
4102
4156
|
inject: {
|
|
4103
4157
|
// Translator shared by the Messenger shell; French fallback when
|
|
4104
4158
|
// the component is used standalone.
|
|
4105
|
-
t: { default: () =>
|
|
4159
|
+
t: { default: () => j() }
|
|
4106
4160
|
},
|
|
4107
4161
|
props: {
|
|
4108
4162
|
action: { type: String, required: !0 },
|
|
4109
4163
|
detail: { type: String, default: "" },
|
|
4110
|
-
callbacks: { type: Array, default: () => [] }
|
|
4164
|
+
callbacks: { type: Array, default: () => [] },
|
|
4165
|
+
agentName: { type: String, default: "" },
|
|
4166
|
+
agentAvatarUrl: { type: String, default: null }
|
|
4111
4167
|
},
|
|
4112
4168
|
emits: ["callback"],
|
|
4113
4169
|
computed: {
|
|
@@ -4138,23 +4194,27 @@ const ei = /* @__PURE__ */ B(Xr, [["render", Zr], ["__scopeId", "data-v-47ad8085
|
|
|
4138
4194
|
return ((e = this.rejectCallback) == null ? void 0 : e.label) || this.t("approval.reject");
|
|
4139
4195
|
}
|
|
4140
4196
|
}
|
|
4141
|
-
},
|
|
4197
|
+
}, 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
4198
|
key: 0,
|
|
4143
4199
|
class: "wm-approval__detail"
|
|
4144
|
-
},
|
|
4145
|
-
function
|
|
4146
|
-
const a =
|
|
4147
|
-
return c(), u("div",
|
|
4148
|
-
o("div",
|
|
4149
|
-
o("div", ri, [
|
|
4150
|
-
q(a, { size: 24 })
|
|
4151
|
-
]),
|
|
4200
|
+
}, ci = { class: "wm-approval__actions" };
|
|
4201
|
+
function di(e, t, n, i, r, s) {
|
|
4202
|
+
const a = L("AIAvatar");
|
|
4203
|
+
return c(), u("div", si, [
|
|
4204
|
+
o("div", ri, [
|
|
4152
4205
|
o("div", ii, [
|
|
4153
|
-
|
|
4154
|
-
|
|
4206
|
+
$(a, {
|
|
4207
|
+
size: 24,
|
|
4208
|
+
name: n.agentName,
|
|
4209
|
+
"image-url": n.agentAvatarUrl
|
|
4210
|
+
}, null, 8, ["name", "image-url"])
|
|
4211
|
+
]),
|
|
4212
|
+
o("div", ai, [
|
|
4213
|
+
o("div", oi, v(n.action), 1),
|
|
4214
|
+
n.detail ? (c(), u("div", li, v(n.detail), 1)) : b("", !0)
|
|
4155
4215
|
])
|
|
4156
4216
|
]),
|
|
4157
|
-
o("div",
|
|
4217
|
+
o("div", ci, [
|
|
4158
4218
|
s.rejectId ? (c(), u("button", {
|
|
4159
4219
|
key: 0,
|
|
4160
4220
|
type: "button",
|
|
@@ -4170,9 +4230,9 @@ function ci(e, t, n, i, r, s) {
|
|
|
4170
4230
|
])
|
|
4171
4231
|
]);
|
|
4172
4232
|
}
|
|
4173
|
-
const
|
|
4174
|
-
let
|
|
4175
|
-
const
|
|
4233
|
+
const ui = /* @__PURE__ */ B(ni, [["render", di], ["__scopeId", "data-v-a2bed37e"]]);
|
|
4234
|
+
let xe = 0;
|
|
4235
|
+
const mi = /* @__PURE__ */ new Set([
|
|
4176
4236
|
"text",
|
|
4177
4237
|
"textarea",
|
|
4178
4238
|
"number",
|
|
@@ -4186,17 +4246,19 @@ const ui = /* @__PURE__ */ new Set([
|
|
|
4186
4246
|
inject: {
|
|
4187
4247
|
// Translator shared by the Messenger shell; French fallback when
|
|
4188
4248
|
// the component is used standalone.
|
|
4189
|
-
t: { default: () =>
|
|
4249
|
+
t: { default: () => j() }
|
|
4190
4250
|
},
|
|
4191
4251
|
props: {
|
|
4192
4252
|
form: { type: Object, required: !0 },
|
|
4193
4253
|
readOnly: { type: Boolean, default: !1 },
|
|
4194
|
-
initialValues: { type: Object, default: null }
|
|
4254
|
+
initialValues: { type: Object, default: null },
|
|
4255
|
+
agentName: { type: String, default: "" },
|
|
4256
|
+
agentAvatarUrl: { type: String, default: null }
|
|
4195
4257
|
},
|
|
4196
4258
|
emits: ["submit"],
|
|
4197
4259
|
data() {
|
|
4198
|
-
return
|
|
4199
|
-
_uid:
|
|
4260
|
+
return xe += 1, {
|
|
4261
|
+
_uid: xe,
|
|
4200
4262
|
values: {},
|
|
4201
4263
|
busy: !1,
|
|
4202
4264
|
error: ""
|
|
@@ -4208,7 +4270,7 @@ const ui = /* @__PURE__ */ new Set([
|
|
|
4208
4270
|
// douteux.
|
|
4209
4271
|
normalizedFields() {
|
|
4210
4272
|
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) || !
|
|
4273
|
+
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
4274
|
}
|
|
4213
4275
|
},
|
|
4214
4276
|
created() {
|
|
@@ -4261,50 +4323,54 @@ const ui = /* @__PURE__ */ new Set([
|
|
|
4261
4323
|
}
|
|
4262
4324
|
}
|
|
4263
4325
|
}
|
|
4264
|
-
},
|
|
4326
|
+
}, 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
4327
|
key: 0,
|
|
4266
4328
|
class: "wm-form__detail"
|
|
4267
|
-
},
|
|
4329
|
+
}, bi = ["for"], wi = {
|
|
4268
4330
|
key: 0,
|
|
4269
4331
|
class: "wm-form__req",
|
|
4270
4332
|
"aria-hidden": "true"
|
|
4271
|
-
},
|
|
4333
|
+
}, 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
4334
|
key: 4,
|
|
4273
4335
|
class: "wm-form__bool"
|
|
4274
|
-
},
|
|
4336
|
+
}, Ti = ["id", "onUpdate:modelValue", "disabled"], xi = ["id", "onUpdate:modelValue", "required", "disabled"], Oi = {
|
|
4275
4337
|
value: "",
|
|
4276
4338
|
disabled: ""
|
|
4277
|
-
},
|
|
4339
|
+
}, Ii = ["value"], Li = {
|
|
4278
4340
|
key: 6,
|
|
4279
4341
|
class: "wm-form__multi"
|
|
4280
|
-
},
|
|
4342
|
+
}, Bi = ["value", "checked", "disabled", "onChange"], Ei = {
|
|
4281
4343
|
key: 0,
|
|
4282
4344
|
class: "wm-form__err"
|
|
4283
|
-
},
|
|
4345
|
+
}, Ri = ["disabled"], Ni = {
|
|
4284
4346
|
key: 0,
|
|
4285
4347
|
class: "wm-form__spinner",
|
|
4286
4348
|
"aria-hidden": "true"
|
|
4287
|
-
},
|
|
4349
|
+
}, Ui = {
|
|
4288
4350
|
key: 2,
|
|
4289
4351
|
class: "wm-form__doneLbl"
|
|
4290
4352
|
};
|
|
4291
4353
|
function Fi(e, t, n, i, r, s) {
|
|
4292
|
-
const a =
|
|
4293
|
-
return c(), u("div",
|
|
4294
|
-
o("div",
|
|
4295
|
-
o("div",
|
|
4296
|
-
|
|
4354
|
+
const a = L("AIAvatar");
|
|
4355
|
+
return c(), u("div", fi, [
|
|
4356
|
+
o("div", _i, [
|
|
4357
|
+
o("div", gi, [
|
|
4358
|
+
$(a, {
|
|
4359
|
+
size: 24,
|
|
4360
|
+
name: n.agentName,
|
|
4361
|
+
"image-url": n.agentAvatarUrl
|
|
4362
|
+
}, null, 8, ["name", "image-url"])
|
|
4297
4363
|
]),
|
|
4298
4364
|
o("div", pi, [
|
|
4299
|
-
o("div",
|
|
4300
|
-
n.form.description ? (c(), u("div",
|
|
4365
|
+
o("div", vi, v(n.form.title || s.t("form.title")), 1),
|
|
4366
|
+
n.form.description ? (c(), u("div", yi, v(n.form.description), 1)) : b("", !0)
|
|
4301
4367
|
])
|
|
4302
4368
|
]),
|
|
4303
4369
|
o("form", {
|
|
4304
4370
|
class: "wm-form__body",
|
|
4305
4371
|
onSubmit: t[0] || (t[0] = X((...l) => s.onSubmit && s.onSubmit(...l), ["prevent"]))
|
|
4306
4372
|
}, [
|
|
4307
|
-
(c(!0), u(
|
|
4373
|
+
(c(!0), u(I, null, F(s.normalizedFields, (l) => (c(), u("div", {
|
|
4308
4374
|
key: l.key,
|
|
4309
4375
|
class: "wm-form__field"
|
|
4310
4376
|
}, [
|
|
@@ -4312,121 +4378,121 @@ function Fi(e, t, n, i, r, s) {
|
|
|
4312
4378
|
for: `wm-f-${r._uid}-${l.key}`,
|
|
4313
4379
|
class: "wm-form__label"
|
|
4314
4380
|
}, [
|
|
4315
|
-
|
|
4316
|
-
l.required ? (c(), u("span",
|
|
4317
|
-
], 8,
|
|
4318
|
-
l.type === "text" ?
|
|
4381
|
+
ge(v(l.label), 1),
|
|
4382
|
+
l.required ? (c(), u("span", wi, "*")) : b("", !0)
|
|
4383
|
+
], 8, bi),
|
|
4384
|
+
l.type === "text" ? K((c(), u("input", {
|
|
4319
4385
|
key: 0,
|
|
4320
4386
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4321
|
-
"onUpdate:modelValue": (
|
|
4387
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4322
4388
|
type: "text",
|
|
4323
4389
|
class: "wm-form__input",
|
|
4324
4390
|
placeholder: l.placeholder || "",
|
|
4325
4391
|
required: l.required,
|
|
4326
4392
|
disabled: n.readOnly || r.busy
|
|
4327
|
-
}, null, 8,
|
|
4393
|
+
}, null, 8, ki)), [
|
|
4328
4394
|
[ee, r.values[l.key]]
|
|
4329
|
-
]) : l.type === "textarea" ?
|
|
4395
|
+
]) : l.type === "textarea" ? K((c(), u("textarea", {
|
|
4330
4396
|
key: 1,
|
|
4331
4397
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4332
|
-
"onUpdate:modelValue": (
|
|
4398
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4333
4399
|
class: "wm-form__textarea",
|
|
4334
4400
|
rows: "3",
|
|
4335
4401
|
placeholder: l.placeholder || "",
|
|
4336
4402
|
required: l.required,
|
|
4337
4403
|
disabled: n.readOnly || r.busy
|
|
4338
|
-
}, null, 8,
|
|
4404
|
+
}, null, 8, Ci)), [
|
|
4339
4405
|
[ee, r.values[l.key]]
|
|
4340
|
-
]) : l.type === "number" ?
|
|
4406
|
+
]) : l.type === "number" ? K((c(), u("input", {
|
|
4341
4407
|
key: 2,
|
|
4342
4408
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4343
|
-
"onUpdate:modelValue": (
|
|
4409
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4344
4410
|
type: "number",
|
|
4345
4411
|
class: "wm-form__input",
|
|
4346
4412
|
placeholder: l.placeholder || "",
|
|
4347
4413
|
required: l.required,
|
|
4348
4414
|
disabled: n.readOnly || r.busy
|
|
4349
|
-
}, null, 8,
|
|
4415
|
+
}, null, 8, Ai)), [
|
|
4350
4416
|
[
|
|
4351
4417
|
ee,
|
|
4352
4418
|
r.values[l.key],
|
|
4353
4419
|
void 0,
|
|
4354
4420
|
{ number: !0 }
|
|
4355
4421
|
]
|
|
4356
|
-
]) : l.type === "date" ?
|
|
4422
|
+
]) : l.type === "date" ? K((c(), u("input", {
|
|
4357
4423
|
key: 3,
|
|
4358
4424
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4359
|
-
"onUpdate:modelValue": (
|
|
4425
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4360
4426
|
type: "date",
|
|
4361
4427
|
class: "wm-form__input",
|
|
4362
4428
|
required: l.required,
|
|
4363
4429
|
disabled: n.readOnly || r.busy
|
|
4364
|
-
}, null, 8,
|
|
4430
|
+
}, null, 8, Si)), [
|
|
4365
4431
|
[ee, r.values[l.key]]
|
|
4366
|
-
]) : l.type === "boolean" ? (c(), u("label",
|
|
4367
|
-
|
|
4432
|
+
]) : l.type === "boolean" ? (c(), u("label", Mi, [
|
|
4433
|
+
K(o("input", {
|
|
4368
4434
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4369
|
-
"onUpdate:modelValue": (
|
|
4435
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4370
4436
|
type: "checkbox",
|
|
4371
4437
|
disabled: n.readOnly || r.busy
|
|
4372
|
-
}, null, 8,
|
|
4373
|
-
[
|
|
4438
|
+
}, null, 8, Ti), [
|
|
4439
|
+
[He, r.values[l.key]]
|
|
4374
4440
|
]),
|
|
4375
4441
|
o("span", null, v(l.placeholder || s.t("common.yes")), 1)
|
|
4376
|
-
])) : l.type === "select" ?
|
|
4442
|
+
])) : l.type === "select" ? K((c(), u("select", {
|
|
4377
4443
|
key: 5,
|
|
4378
4444
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4379
|
-
"onUpdate:modelValue": (
|
|
4445
|
+
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4380
4446
|
class: "wm-form__select",
|
|
4381
4447
|
required: l.required,
|
|
4382
4448
|
disabled: n.readOnly || r.busy
|
|
4383
4449
|
}, [
|
|
4384
|
-
o("option",
|
|
4385
|
-
(c(!0), u(
|
|
4386
|
-
key:
|
|
4387
|
-
value:
|
|
4388
|
-
}, v(
|
|
4389
|
-
], 8,
|
|
4390
|
-
[
|
|
4450
|
+
o("option", Oi, v(l.placeholder || s.t("form.choose")), 1),
|
|
4451
|
+
(c(!0), u(I, null, F(l.options, (p) => (c(), u("option", {
|
|
4452
|
+
key: p.value,
|
|
4453
|
+
value: p.value
|
|
4454
|
+
}, v(p.label), 9, Ii))), 128))
|
|
4455
|
+
], 8, xi)), [
|
|
4456
|
+
[ze, r.values[l.key]]
|
|
4391
4457
|
]) : l.type === "multiselect" ? (c(), u("div", Li, [
|
|
4392
|
-
(c(!0), u(
|
|
4393
|
-
key:
|
|
4458
|
+
(c(!0), u(I, null, F(l.options, (p) => (c(), u("label", {
|
|
4459
|
+
key: p.value,
|
|
4394
4460
|
class: "wm-form__multiItem"
|
|
4395
4461
|
}, [
|
|
4396
4462
|
o("input", {
|
|
4397
4463
|
type: "checkbox",
|
|
4398
|
-
value:
|
|
4399
|
-
checked: Array.isArray(r.values[l.key]) && r.values[l.key].includes(
|
|
4464
|
+
value: p.value,
|
|
4465
|
+
checked: Array.isArray(r.values[l.key]) && r.values[l.key].includes(p.value),
|
|
4400
4466
|
disabled: n.readOnly || r.busy,
|
|
4401
4467
|
onChange: (C) => s.toggleMulti(
|
|
4402
4468
|
l.key,
|
|
4403
|
-
|
|
4469
|
+
p.value,
|
|
4404
4470
|
C.target.checked
|
|
4405
4471
|
)
|
|
4406
|
-
}, null, 40,
|
|
4407
|
-
o("span", null, v(
|
|
4472
|
+
}, null, 40, Bi),
|
|
4473
|
+
o("span", null, v(p.label), 1)
|
|
4408
4474
|
]))), 128))
|
|
4409
4475
|
])) : b("", !0)
|
|
4410
4476
|
]))), 128)),
|
|
4411
|
-
r.error ? (c(), u("div",
|
|
4412
|
-
n.readOnly ? (c(), u("div",
|
|
4477
|
+
r.error ? (c(), u("div", Ei, v(r.error), 1)) : b("", !0),
|
|
4478
|
+
n.readOnly ? (c(), u("div", Ui, v(s.t("form.responseSent")), 1)) : (c(), u("button", {
|
|
4413
4479
|
key: 1,
|
|
4414
4480
|
type: "submit",
|
|
4415
4481
|
class: "wm-form__submit",
|
|
4416
4482
|
disabled: r.busy
|
|
4417
4483
|
}, [
|
|
4418
|
-
r.busy ? (c(), u("span",
|
|
4484
|
+
r.busy ? (c(), u("span", Ni)) : b("", !0),
|
|
4419
4485
|
o("span", null, v(r.busy ? s.t("common.sending") : n.form.submit_label || s.t("common.send")), 1)
|
|
4420
|
-
], 8,
|
|
4486
|
+
], 8, Ri))
|
|
4421
4487
|
], 32)
|
|
4422
4488
|
]);
|
|
4423
4489
|
}
|
|
4424
|
-
const ji = /* @__PURE__ */ B(hi, [["render", Fi], ["__scopeId", "data-v-
|
|
4490
|
+
const ji = /* @__PURE__ */ B(hi, [["render", Fi], ["__scopeId", "data-v-fe65cc56"]]), Pi = {
|
|
4425
4491
|
name: "WmFeedback",
|
|
4426
4492
|
inject: {
|
|
4427
4493
|
// Translator shared by the Messenger shell; French fallback when
|
|
4428
4494
|
// the component is used standalone.
|
|
4429
|
-
t: { default: () =>
|
|
4495
|
+
t: { default: () => j() }
|
|
4430
4496
|
},
|
|
4431
4497
|
props: {
|
|
4432
4498
|
busy: { type: Boolean, default: !1 },
|
|
@@ -4455,13 +4521,13 @@ const ji = /* @__PURE__ */ B(hi, [["render", Fi], ["__scopeId", "data-v-75332dad
|
|
|
4455
4521
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
4456
4522
|
}
|
|
4457
4523
|
}
|
|
4458
|
-
}, Di = { class: "wm-fb" },
|
|
4524
|
+
}, Di = { class: "wm-fb" }, Hi = { class: "wm-fb__title" }, zi = { class: "wm-fb__sub" }, qi = { class: "wm-fb__row" }, $i = ["onClick"], Vi = { class: "wm-fb__emoji" }, Ki = { class: "wm-fb__label" }, Wi = ["disabled"], Gi = {
|
|
4459
4525
|
key: 1,
|
|
4460
4526
|
class: "wm-fb__done"
|
|
4461
|
-
},
|
|
4462
|
-
function
|
|
4527
|
+
}, Yi = { class: "wm-fb__doneTitle" }, Qi = { class: "wm-fb__doneSub" };
|
|
4528
|
+
function Xi(e, t, n, i, r, s) {
|
|
4463
4529
|
return c(), u("div", Di, [
|
|
4464
|
-
n.done ? (c(), u("div",
|
|
4530
|
+
n.done ? (c(), u("div", Gi, [
|
|
4465
4531
|
t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
|
|
4466
4532
|
o("svg", {
|
|
4467
4533
|
width: "16",
|
|
@@ -4477,37 +4543,37 @@ function Qi(e, t, n, i, r, s) {
|
|
|
4477
4543
|
o("path", { d: "M20 6L9 17l-5-5" })
|
|
4478
4544
|
])
|
|
4479
4545
|
], -1)),
|
|
4480
|
-
o("div",
|
|
4481
|
-
o("div",
|
|
4482
|
-
])) : (c(), u(
|
|
4483
|
-
o("div",
|
|
4484
|
-
o("div",
|
|
4485
|
-
o("div",
|
|
4486
|
-
(c(!0), u(
|
|
4546
|
+
o("div", Yi, v(s.t("feedback.doneTitle")), 1),
|
|
4547
|
+
o("div", Qi, v(s.t("feedback.doneSubtitle")), 1)
|
|
4548
|
+
])) : (c(), u(I, { key: 0 }, [
|
|
4549
|
+
o("div", Hi, v(s.t("feedback.question")), 1),
|
|
4550
|
+
o("div", zi, v(s.t("feedback.subtitle")), 1),
|
|
4551
|
+
o("div", qi, [
|
|
4552
|
+
(c(!0), u(I, null, F(s.options, (a) => (c(), u("button", {
|
|
4487
4553
|
key: a.v,
|
|
4488
4554
|
type: "button",
|
|
4489
4555
|
class: x(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
|
|
4490
4556
|
onClick: (l) => r.sel = a.v
|
|
4491
4557
|
}, [
|
|
4492
|
-
o("span",
|
|
4493
|
-
o("span",
|
|
4494
|
-
], 10,
|
|
4558
|
+
o("span", Vi, v(a.e), 1),
|
|
4559
|
+
o("span", Ki, v(a.l), 1)
|
|
4560
|
+
], 10, $i))), 128))
|
|
4495
4561
|
]),
|
|
4496
4562
|
o("button", {
|
|
4497
4563
|
type: "button",
|
|
4498
4564
|
class: "wm-fb__send",
|
|
4499
4565
|
disabled: !r.sel || n.busy,
|
|
4500
4566
|
onClick: t[0] || (t[0] = (...a) => s.onSend && s.onSend(...a))
|
|
4501
|
-
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9,
|
|
4567
|
+
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9, Wi)
|
|
4502
4568
|
], 64))
|
|
4503
4569
|
]);
|
|
4504
4570
|
}
|
|
4505
|
-
const
|
|
4571
|
+
const Ji = /* @__PURE__ */ B(Pi, [["render", Xi], ["__scopeId", "data-v-9b630564"]]), Zi = {
|
|
4506
4572
|
name: "WmMoreMenu",
|
|
4507
4573
|
inject: {
|
|
4508
4574
|
// Translator shared by the Messenger shell; French fallback when
|
|
4509
4575
|
// the component is used standalone.
|
|
4510
|
-
t: { default: () =>
|
|
4576
|
+
t: { default: () => j() }
|
|
4511
4577
|
},
|
|
4512
4578
|
props: {
|
|
4513
4579
|
canRename: { type: Boolean, default: !0 },
|
|
@@ -4545,24 +4611,24 @@ const Xi = /* @__PURE__ */ B(Pi, [["render", Qi], ["__scopeId", "data-v-9b630564
|
|
|
4545
4611
|
this.browserNotifOn = !this.browserNotifOn, this.$emit("browser-notif-toggle", this.browserNotifOn);
|
|
4546
4612
|
}
|
|
4547
4613
|
}
|
|
4548
|
-
},
|
|
4614
|
+
}, ea = { class: "wm-mm" }, ta = {
|
|
4549
4615
|
class: "wm-mm__pop",
|
|
4550
4616
|
role: "menu"
|
|
4551
|
-
},
|
|
4617
|
+
}, na = {
|
|
4552
4618
|
key: 0,
|
|
4553
4619
|
class: "wm-mm__section"
|
|
4554
|
-
},
|
|
4620
|
+
}, sa = { class: "wm-mm__label" }, ra = { class: "wm-mm__label" }, ia = {
|
|
4555
4621
|
key: 1,
|
|
4556
4622
|
class: "wm-mm__sep"
|
|
4557
|
-
},
|
|
4558
|
-
function
|
|
4559
|
-
return c(), u("div",
|
|
4623
|
+
}, 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" };
|
|
4624
|
+
function ma(e, t, n, i, r, s) {
|
|
4625
|
+
return c(), u("div", ea, [
|
|
4560
4626
|
o("div", {
|
|
4561
4627
|
class: "wm-mm__scrim",
|
|
4562
4628
|
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4563
4629
|
}),
|
|
4564
|
-
o("div",
|
|
4565
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4630
|
+
o("div", ta, [
|
|
4631
|
+
n.canRename || n.canExport ? (c(), u("div", na, [
|
|
4566
4632
|
n.canRename ? (c(), u("button", {
|
|
4567
4633
|
key: 0,
|
|
4568
4634
|
type: "button",
|
|
@@ -4585,7 +4651,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4585
4651
|
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
4652
|
])
|
|
4587
4653
|
], -1)),
|
|
4588
|
-
o("span",
|
|
4654
|
+
o("span", sa, v(s.t("moreMenu.editTitle")), 1)
|
|
4589
4655
|
])) : b("", !0),
|
|
4590
4656
|
n.canExport ? (c(), u("button", {
|
|
4591
4657
|
key: 1,
|
|
@@ -4608,12 +4674,12 @@ function ua(e, t, n, i, r, s) {
|
|
|
4608
4674
|
o("path", { d: "M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" })
|
|
4609
4675
|
])
|
|
4610
4676
|
], -1)),
|
|
4611
|
-
o("span",
|
|
4677
|
+
o("span", ra, v(s.t("moreMenu.exportTranscript")), 1),
|
|
4612
4678
|
t[9] || (t[9] = o("span", { class: "wm-mm__hint" }, ".txt", -1))
|
|
4613
4679
|
])) : b("", !0)
|
|
4614
4680
|
])) : b("", !0),
|
|
4615
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4616
|
-
o("div",
|
|
4681
|
+
n.canRename || n.canExport ? (c(), u("div", ia)) : b("", !0),
|
|
4682
|
+
o("div", aa, [
|
|
4617
4683
|
o("button", {
|
|
4618
4684
|
type: "button",
|
|
4619
4685
|
class: "wm-mm__item",
|
|
@@ -4635,7 +4701,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4635
4701
|
o("path", { d: "M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" })
|
|
4636
4702
|
])
|
|
4637
4703
|
], -1)),
|
|
4638
|
-
o("span",
|
|
4704
|
+
o("span", oa, v(s.t("moreMenu.sound")), 1),
|
|
4639
4705
|
o("span", {
|
|
4640
4706
|
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.soundOn }])
|
|
4641
4707
|
}, [...t[10] || (t[10] = [
|
|
@@ -4662,7 +4728,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4662
4728
|
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
4729
|
])
|
|
4664
4730
|
], -1)),
|
|
4665
|
-
o("span",
|
|
4731
|
+
o("span", la, v(s.t("moreMenu.browserNotifications")), 1),
|
|
4666
4732
|
o("span", {
|
|
4667
4733
|
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.browserNotifOn }])
|
|
4668
4734
|
}, [...t[12] || (t[12] = [
|
|
@@ -4671,7 +4737,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4671
4737
|
])
|
|
4672
4738
|
]),
|
|
4673
4739
|
t[16] || (t[16] = o("div", { class: "wm-mm__sep" }, null, -1)),
|
|
4674
|
-
o("div",
|
|
4740
|
+
o("div", ca, [
|
|
4675
4741
|
n.statusUrl ? (c(), u("button", {
|
|
4676
4742
|
key: 0,
|
|
4677
4743
|
type: "button",
|
|
@@ -4693,7 +4759,7 @@ function ua(e, t, n, i, r, s) {
|
|
|
4693
4759
|
o("path", { d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2" })
|
|
4694
4760
|
])
|
|
4695
4761
|
], -1)),
|
|
4696
|
-
o("span",
|
|
4762
|
+
o("span", da, v(s.t("moreMenu.serviceStatus")), 1)
|
|
4697
4763
|
])) : b("", !0),
|
|
4698
4764
|
n.helpUrl ? (c(), u("button", {
|
|
4699
4765
|
key: 1,
|
|
@@ -4716,18 +4782,18 @@ function ua(e, t, n, i, r, s) {
|
|
|
4716
4782
|
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
4783
|
])
|
|
4718
4784
|
], -1)),
|
|
4719
|
-
o("span",
|
|
4785
|
+
o("span", ua, v(s.t("moreMenu.helpCenter")), 1)
|
|
4720
4786
|
])) : b("", !0)
|
|
4721
4787
|
])
|
|
4722
4788
|
])
|
|
4723
4789
|
]);
|
|
4724
4790
|
}
|
|
4725
|
-
const ha = /* @__PURE__ */ B(
|
|
4791
|
+
const ha = /* @__PURE__ */ B(Zi, [["render", ma], ["__scopeId", "data-v-76281e95"]]), fa = {
|
|
4726
4792
|
name: "WmRenameDialog",
|
|
4727
4793
|
inject: {
|
|
4728
4794
|
// Translator shared by the Messenger shell; French fallback when
|
|
4729
4795
|
// the component is used standalone.
|
|
4730
|
-
t: { default: () =>
|
|
4796
|
+
t: { default: () => j() }
|
|
4731
4797
|
},
|
|
4732
4798
|
props: {
|
|
4733
4799
|
// Empty defaults: the resolved fallback comes from the translator
|
|
@@ -4764,20 +4830,20 @@ const ha = /* @__PURE__ */ B(Ji, [["render", ua], ["__scopeId", "data-v-76281e95
|
|
|
4764
4830
|
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
4765
4831
|
}
|
|
4766
4832
|
}
|
|
4767
|
-
},
|
|
4833
|
+
}, _a = { class: "wm-dialog" }, ga = {
|
|
4768
4834
|
class: "wm-dialog__card",
|
|
4769
4835
|
role: "dialog",
|
|
4770
4836
|
"aria-modal": "true"
|
|
4771
|
-
}, pa = { class: "wm-dialog__head" },
|
|
4772
|
-
function
|
|
4773
|
-
return c(), u("div",
|
|
4837
|
+
}, 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"];
|
|
4838
|
+
function Aa(e, t, n, i, r, s) {
|
|
4839
|
+
return c(), u("div", _a, [
|
|
4774
4840
|
o("div", {
|
|
4775
4841
|
class: "wm-dialog__scrim",
|
|
4776
4842
|
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4777
4843
|
}),
|
|
4778
|
-
o("div",
|
|
4844
|
+
o("div", ga, [
|
|
4779
4845
|
o("div", pa, [
|
|
4780
|
-
o("div",
|
|
4846
|
+
o("div", va, v(n.title || s.t("rename.title")), 1),
|
|
4781
4847
|
o("button", {
|
|
4782
4848
|
type: "button",
|
|
4783
4849
|
class: "wm-dialog__close",
|
|
@@ -4797,10 +4863,10 @@ function Ca(e, t, n, i, r, s) {
|
|
|
4797
4863
|
}, [
|
|
4798
4864
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4799
4865
|
], -1)
|
|
4800
|
-
])], 8,
|
|
4866
|
+
])], 8, ya)
|
|
4801
4867
|
]),
|
|
4802
|
-
o("div",
|
|
4803
|
-
|
|
4868
|
+
o("div", ba, [
|
|
4869
|
+
K(o("input", {
|
|
4804
4870
|
ref: "input",
|
|
4805
4871
|
"onUpdate:modelValue": t[2] || (t[2] = (a) => r.value = a),
|
|
4806
4872
|
type: "text",
|
|
@@ -4811,11 +4877,11 @@ function Ca(e, t, n, i, r, s) {
|
|
|
4811
4877
|
t[3] || (t[3] = ue(X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
|
|
4812
4878
|
t[4] || (t[4] = ue(X((a) => e.$emit("close"), ["prevent"]), ["esc"]))
|
|
4813
4879
|
]
|
|
4814
|
-
}, null, 40,
|
|
4880
|
+
}, null, 40, wa), [
|
|
4815
4881
|
[ee, r.value]
|
|
4816
4882
|
])
|
|
4817
4883
|
]),
|
|
4818
|
-
o("div",
|
|
4884
|
+
o("div", ka, [
|
|
4819
4885
|
o("button", {
|
|
4820
4886
|
type: "button",
|
|
4821
4887
|
class: "wm-dialog__btn",
|
|
@@ -4826,31 +4892,31 @@ function Ca(e, t, n, i, r, s) {
|
|
|
4826
4892
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
4827
4893
|
disabled: !s.canSubmit,
|
|
4828
4894
|
onClick: t[6] || (t[6] = (...a) => s.onSubmit && s.onSubmit(...a))
|
|
4829
|
-
}, v(s.t("common.save")), 9,
|
|
4895
|
+
}, v(s.t("common.save")), 9, Ca)
|
|
4830
4896
|
])
|
|
4831
4897
|
])
|
|
4832
4898
|
]);
|
|
4833
4899
|
}
|
|
4834
|
-
const
|
|
4900
|
+
const Sa = /* @__PURE__ */ B(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8"]]), Oe = "ww-messenger-tokens", Ma = {
|
|
4835
4901
|
name: "Messenger",
|
|
4836
4902
|
components: {
|
|
4837
|
-
Launcher:
|
|
4838
|
-
Header:
|
|
4839
|
-
Onboarding:
|
|
4903
|
+
Launcher: Ft,
|
|
4904
|
+
Header: cn,
|
|
4905
|
+
Onboarding: qn,
|
|
4840
4906
|
MessageList: Lr,
|
|
4841
|
-
Composer:
|
|
4842
|
-
SuggestionChips:
|
|
4843
|
-
ApprovalCard:
|
|
4907
|
+
Composer: Xr,
|
|
4908
|
+
SuggestionChips: ti,
|
|
4909
|
+
ApprovalCard: ui,
|
|
4844
4910
|
FormCard: ji,
|
|
4845
|
-
Feedback:
|
|
4911
|
+
Feedback: Ji,
|
|
4846
4912
|
MoreMenu: ha,
|
|
4847
|
-
RenameDialog:
|
|
4913
|
+
RenameDialog: Sa
|
|
4848
4914
|
},
|
|
4849
4915
|
mixins: [
|
|
4850
4916
|
ot,
|
|
4851
|
-
|
|
4917
|
+
ht,
|
|
4852
4918
|
ft,
|
|
4853
|
-
|
|
4919
|
+
gt
|
|
4854
4920
|
],
|
|
4855
4921
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
4856
4922
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -4965,7 +5031,7 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
4965
5031
|
// 4. French.
|
|
4966
5032
|
locale() {
|
|
4967
5033
|
var e;
|
|
4968
|
-
return
|
|
5034
|
+
return ye(
|
|
4969
5035
|
this.language || this.customerLanguage || ((e = this.widget) == null ? void 0 : e.default_language) || ""
|
|
4970
5036
|
);
|
|
4971
5037
|
},
|
|
@@ -4973,7 +5039,7 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
4973
5039
|
// `locale` changes. `t()` below (and the provided closure) delegate
|
|
4974
5040
|
// to it so every string resolves against the current language.
|
|
4975
5041
|
translator() {
|
|
4976
|
-
return
|
|
5042
|
+
return j(this.locale);
|
|
4977
5043
|
},
|
|
4978
5044
|
error() {
|
|
4979
5045
|
var e;
|
|
@@ -5017,12 +5083,12 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5017
5083
|
t[T.id] !== 0 && (!l && T.author && (l = T.author), a++);
|
|
5018
5084
|
}
|
|
5019
5085
|
}
|
|
5020
|
-
const
|
|
5086
|
+
const p = r.filter(
|
|
5021
5087
|
(k) => !((k == null ? void 0 : k.id) != null && t[k.id] === 0)
|
|
5022
5088
|
);
|
|
5023
5089
|
return {
|
|
5024
5090
|
...i,
|
|
5025
|
-
_preview: st(i,
|
|
5091
|
+
_preview: st(i, p),
|
|
5026
5092
|
_unread: a > 0,
|
|
5027
5093
|
_unreadCount: a,
|
|
5028
5094
|
_lastAuthor: l
|
|
@@ -5045,7 +5111,7 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5045
5111
|
title: n.name || this.t("common.newConversation"),
|
|
5046
5112
|
preview: n._preview || this.t("onboarding.newMessage"),
|
|
5047
5113
|
unread: !!n._unread,
|
|
5048
|
-
_ts:
|
|
5114
|
+
_ts: Se(n, e[n.id] || [])
|
|
5049
5115
|
})).sort((n, i) => n._ts < i._ts ? 1 : n._ts > i._ts ? -1 : 0);
|
|
5050
5116
|
},
|
|
5051
5117
|
// Unread threads (one entry per conv with unseen agent/human
|
|
@@ -5057,14 +5123,14 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5057
5123
|
const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
|
|
5058
5124
|
for (const i of this.drawerConversations) {
|
|
5059
5125
|
if (!i._unread) continue;
|
|
5060
|
-
const r =
|
|
5126
|
+
const r = Se(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
5127
|
t.push({
|
|
5062
5128
|
convId: i.id,
|
|
5063
5129
|
preview: i._preview || this.t("notification.youHaveNewMessage"),
|
|
5064
5130
|
ts: r,
|
|
5065
5131
|
count: i._unreadCount || 1,
|
|
5066
5132
|
senderName: l,
|
|
5067
|
-
senderAvatarUrl:
|
|
5133
|
+
senderAvatarUrl: p
|
|
5068
5134
|
});
|
|
5069
5135
|
}
|
|
5070
5136
|
return t.sort((i, r) => i.ts < r.ts ? 1 : i.ts > r.ts ? -1 : 0), t;
|
|
@@ -5123,6 +5189,14 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5123
5189
|
var e;
|
|
5124
5190
|
return ((e = this.widget) == null ? void 0 : e.welcome_message) || "";
|
|
5125
5191
|
},
|
|
5192
|
+
widgetSubtitle() {
|
|
5193
|
+
var e;
|
|
5194
|
+
return ((e = this.widget) == null ? void 0 : e.subtitle) || "";
|
|
5195
|
+
},
|
|
5196
|
+
defaultIconUrl() {
|
|
5197
|
+
var e;
|
|
5198
|
+
return ((e = this.widget) == null ? void 0 : e.default_icon_url) || null;
|
|
5199
|
+
},
|
|
5126
5200
|
agentName() {
|
|
5127
5201
|
var e, t, n;
|
|
5128
5202
|
return ((n = (t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.agent) == null ? void 0 : n.name) || "";
|
|
@@ -5194,8 +5268,8 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5194
5268
|
}
|
|
5195
5269
|
const t = this.revealedAt;
|
|
5196
5270
|
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 || (
|
|
5271
|
+
var s, a, l, p, C;
|
|
5272
|
+
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
5273
|
});
|
|
5200
5274
|
},
|
|
5201
5275
|
// True whenever we should show the "typing" indicator at the bottom
|
|
@@ -5231,11 +5305,11 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5231
5305
|
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
5306
|
},
|
|
5233
5307
|
approvalDetail() {
|
|
5234
|
-
var i, r, s, a, l,
|
|
5308
|
+
var i, r, s, a, l, p;
|
|
5235
5309
|
const e = (s = (r = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
5236
5310
|
if (typeof e == "string" && e.trim())
|
|
5237
5311
|
return e.trim();
|
|
5238
|
-
const t = (
|
|
5312
|
+
const t = (p = (l = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : l.pending) == null ? void 0 : p.prepared_params;
|
|
5239
5313
|
if (!t || typeof t != "object") return "";
|
|
5240
5314
|
const n = Object.entries(t);
|
|
5241
5315
|
return n.length ? n.slice(0, 2).map(([C, k]) => `${C}: ${k}`).join(" · ") : "";
|
|
@@ -5281,7 +5355,7 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5281
5355
|
}
|
|
5282
5356
|
}
|
|
5283
5357
|
return this.t("messageList.today", {
|
|
5284
|
-
time:
|
|
5358
|
+
time: Ie(t, oe(this.locale))
|
|
5285
5359
|
});
|
|
5286
5360
|
},
|
|
5287
5361
|
// Pagination state for the active conversation. Drives the
|
|
@@ -5386,9 +5460,9 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5386
5460
|
}
|
|
5387
5461
|
},
|
|
5388
5462
|
async mounted() {
|
|
5389
|
-
if (typeof document < "u" && !document.getElementById(
|
|
5463
|
+
if (typeof document < "u" && !document.getElementById(Oe)) {
|
|
5390
5464
|
const e = document.createElement("style");
|
|
5391
|
-
e.id =
|
|
5465
|
+
e.id = Oe, e.textContent = Je, document.head.appendChild(e);
|
|
5392
5466
|
}
|
|
5393
5467
|
await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
5394
5468
|
},
|
|
@@ -5410,14 +5484,14 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5410
5484
|
return;
|
|
5411
5485
|
}
|
|
5412
5486
|
try {
|
|
5413
|
-
this.transport =
|
|
5487
|
+
this.transport = we(
|
|
5414
5488
|
We({
|
|
5415
5489
|
baseUrl: this.baseUrl,
|
|
5416
5490
|
widgetId: this.widgetId,
|
|
5417
5491
|
userId: this.userId,
|
|
5418
5492
|
userHash: this.userHash
|
|
5419
5493
|
})
|
|
5420
|
-
), this.store =
|
|
5494
|
+
), this.store = we(Xe(this.transport)), this.hydrateNotifPref(), await this.store.start(), this.setupLiveReveal();
|
|
5421
5495
|
const t = (e = this.context) == null ? void 0 : e.customer;
|
|
5422
5496
|
t && typeof t == "object" && await this.store.applyCustomer(t);
|
|
5423
5497
|
} catch (t) {
|
|
@@ -5677,29 +5751,29 @@ const Aa = /* @__PURE__ */ B(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8
|
|
|
5677
5751
|
}
|
|
5678
5752
|
}
|
|
5679
5753
|
}
|
|
5680
|
-
},
|
|
5754
|
+
}, Ta = {
|
|
5681
5755
|
key: 0,
|
|
5682
5756
|
class: "wm-loading",
|
|
5683
5757
|
"aria-busy": "true",
|
|
5684
5758
|
"aria-live": "polite"
|
|
5685
|
-
},
|
|
5759
|
+
}, xa = ["aria-label"], Oa = {
|
|
5686
5760
|
key: 0,
|
|
5687
5761
|
class: "wm-state"
|
|
5688
|
-
},
|
|
5762
|
+
}, Ia = { class: "wm-state__err" }, La = { class: "wm-state__errTitle" }, Ba = { class: "wm-state__errSub" }, Ea = { class: "wm-bottom" }, Ra = {
|
|
5689
5763
|
key: 0,
|
|
5690
5764
|
ref: "floatEl",
|
|
5691
5765
|
class: "wm-float"
|
|
5692
|
-
},
|
|
5766
|
+
}, Na = {
|
|
5693
5767
|
key: 1,
|
|
5694
5768
|
class: "wm-actionWait",
|
|
5695
5769
|
role: "status",
|
|
5696
5770
|
"aria-live": "polite"
|
|
5697
|
-
},
|
|
5771
|
+
}, Ua = { class: "wm-actionWait__lbl" }, Fa = {
|
|
5698
5772
|
key: 2,
|
|
5699
5773
|
class: "wm-attached"
|
|
5700
5774
|
}, ja = ["aria-label", "onClick"];
|
|
5701
5775
|
function Pa(e, t, n, i, r, s) {
|
|
5702
|
-
const a =
|
|
5776
|
+
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"), q = L("Composer"), M = L("MoreMenu"), P = L("RenameDialog");
|
|
5703
5777
|
return c(), u("div", {
|
|
5704
5778
|
class: x(["wm-root", `wm-root--${n.displayMode}`])
|
|
5705
5779
|
}, [
|
|
@@ -5713,11 +5787,11 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5713
5787
|
r.isOpen || s.isEmbedded ? (c(), u("section", {
|
|
5714
5788
|
key: 1,
|
|
5715
5789
|
class: x(["wm-panel", `wm-panel--${n.displayMode}`]),
|
|
5716
|
-
style:
|
|
5790
|
+
style: z(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
|
|
5717
5791
|
role: "dialog",
|
|
5718
5792
|
"aria-label": "Messenger"
|
|
5719
5793
|
}, [
|
|
5720
|
-
!s.ready && !s.error ? (c(), u("div",
|
|
5794
|
+
!s.ready && !s.error ? (c(), u("div", Ta, [
|
|
5721
5795
|
s.isEmbedded ? b("", !0) : (c(), u("button", {
|
|
5722
5796
|
key: 0,
|
|
5723
5797
|
type: "button",
|
|
@@ -5738,13 +5812,13 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5738
5812
|
}, [
|
|
5739
5813
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5740
5814
|
], -1)
|
|
5741
|
-
])], 8,
|
|
5815
|
+
])], 8, xa)),
|
|
5742
5816
|
t[6] || (t[6] = o("div", {
|
|
5743
5817
|
class: "wm-loading__spinner",
|
|
5744
5818
|
"aria-hidden": "true"
|
|
5745
5819
|
}, null, -1))
|
|
5746
|
-
])) : (c(), u(
|
|
5747
|
-
|
|
5820
|
+
])) : (c(), u(I, { key: 1 }, [
|
|
5821
|
+
$(l, {
|
|
5748
5822
|
title: s.headerTitle,
|
|
5749
5823
|
"team-members": s.teamMembers,
|
|
5750
5824
|
"response-label": s.responseLabel,
|
|
@@ -5752,12 +5826,14 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5752
5826
|
"show-back": s.canBack,
|
|
5753
5827
|
"show-close": !s.isEmbedded,
|
|
5754
5828
|
"more-active": r.moreOpen,
|
|
5829
|
+
"agent-name": s.agentName,
|
|
5830
|
+
"agent-avatar-url": s.agentAvatarUrl,
|
|
5755
5831
|
onBack: s.goHome,
|
|
5756
5832
|
onMore: s.toggleMore,
|
|
5757
5833
|
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",
|
|
5834
|
+
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "agent-name", "agent-avatar-url", "onBack", "onMore", "onClose"]),
|
|
5835
|
+
s.error ? (c(), u("div", Oa, [
|
|
5836
|
+
o("div", Ia, [
|
|
5761
5837
|
t[7] || (t[7] = o("div", { class: "wm-state__errIcon" }, [
|
|
5762
5838
|
o("svg", {
|
|
5763
5839
|
width: "14",
|
|
@@ -5775,11 +5851,11 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5775
5851
|
], -1)),
|
|
5776
5852
|
o("div", null, [
|
|
5777
5853
|
o("div", La, v(s.t("error.connectionFailed")), 1),
|
|
5778
|
-
o("div",
|
|
5854
|
+
o("div", Ba, v(s.error), 1)
|
|
5779
5855
|
])
|
|
5780
5856
|
])
|
|
5781
|
-
])) : s.currentConv ? (c(), u(
|
|
5782
|
-
|
|
5857
|
+
])) : s.currentConv ? (c(), u(I, { key: 2 }, [
|
|
5858
|
+
$(C, {
|
|
5783
5859
|
ref: "messageList",
|
|
5784
5860
|
messages: s.displayedMessages,
|
|
5785
5861
|
"streaming-active": s.streamingActive,
|
|
@@ -5789,21 +5865,27 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5789
5865
|
"has-more": s.paginationState.hasMore,
|
|
5790
5866
|
"unread-anchor-id": e.unreadAnchorId,
|
|
5791
5867
|
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
5868
|
+
"ai-agent-name": s.agentName,
|
|
5869
|
+
"ai-agent-avatar-url": s.agentAvatarUrl,
|
|
5792
5870
|
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",
|
|
5871
|
+
}, 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"]),
|
|
5872
|
+
o("div", Ea, [
|
|
5873
|
+
s.floatVisible ? (c(), u("div", Ra, [
|
|
5796
5874
|
s.approvalReady ? (c(), R(k, {
|
|
5797
5875
|
key: 0,
|
|
5798
5876
|
action: s.approvalTitle,
|
|
5799
5877
|
detail: s.approvalDetail,
|
|
5800
5878
|
callbacks: s.pendingApproval.callbacks,
|
|
5879
|
+
"agent-name": s.agentName,
|
|
5880
|
+
"agent-avatar-url": s.agentAvatarUrl,
|
|
5801
5881
|
onCallback: s.onApprovalCallback
|
|
5802
|
-
}, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (c(), R(T, {
|
|
5882
|
+
}, null, 8, ["action", "detail", "callbacks", "agent-name", "agent-avatar-url", "onCallback"])) : s.pendingForm ? (c(), R(T, {
|
|
5803
5883
|
key: s.pendingForm.message && s.pendingForm.message.id,
|
|
5804
5884
|
form: s.pendingForm.form,
|
|
5885
|
+
"agent-name": s.agentName,
|
|
5886
|
+
"agent-avatar-url": s.agentAvatarUrl,
|
|
5805
5887
|
onSubmit: s.onFormSubmit
|
|
5806
|
-
}, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (c(), R(E, {
|
|
5888
|
+
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : s.showFeedback ? (c(), R(E, {
|
|
5807
5889
|
key: 2,
|
|
5808
5890
|
busy: r.feedbackBusy,
|
|
5809
5891
|
done: r.feedbackDone,
|
|
@@ -5814,15 +5896,15 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5814
5896
|
onSelect: s.onSuggestion
|
|
5815
5897
|
}, null, 8, ["items", "onSelect"]))
|
|
5816
5898
|
], 512)) : b("", !0),
|
|
5817
|
-
s.actionInFlight ? (c(), u("div",
|
|
5899
|
+
s.actionInFlight ? (c(), u("div", Na, [
|
|
5818
5900
|
t[8] || (t[8] = o("span", {
|
|
5819
5901
|
class: "wm-actionWait__spinner",
|
|
5820
5902
|
"aria-hidden": "true"
|
|
5821
5903
|
}, null, -1)),
|
|
5822
|
-
o("span",
|
|
5904
|
+
o("span", Ua, v(s.t("action.inProgress", {
|
|
5823
5905
|
name: s.actionInFlightName
|
|
5824
5906
|
})), 1)
|
|
5825
|
-
])) : (c(), R(
|
|
5907
|
+
])) : (c(), R(q, {
|
|
5826
5908
|
key: 2,
|
|
5827
5909
|
ref: "composer",
|
|
5828
5910
|
modelValue: r.draft,
|
|
@@ -5847,7 +5929,7 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5847
5929
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
5848
5930
|
onAction: s.onMoreAction
|
|
5849
5931
|
}, 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(
|
|
5932
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), R(P, {
|
|
5851
5933
|
key: 1,
|
|
5852
5934
|
"initial-value": s.currentConv.name || "",
|
|
5853
5935
|
title: s.t("rename.dialogTitle"),
|
|
@@ -5855,8 +5937,8 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5855
5937
|
onSubmit: s.onRenameSubmit
|
|
5856
5938
|
}, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0),
|
|
5857
5939
|
r.pendingAttachments.length ? (c(), u("div", Fa, [
|
|
5858
|
-
(c(!0), u(
|
|
5859
|
-
key:
|
|
5940
|
+
(c(!0), u(I, null, F(r.pendingAttachments, (N, H) => (c(), u("div", {
|
|
5941
|
+
key: H,
|
|
5860
5942
|
class: "wm-attached__chip"
|
|
5861
5943
|
}, [
|
|
5862
5944
|
t[10] || (t[10] = o("svg", {
|
|
@@ -5876,7 +5958,7 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5876
5958
|
o("button", {
|
|
5877
5959
|
type: "button",
|
|
5878
5960
|
"aria-label": s.t("attachment.remove"),
|
|
5879
|
-
onClick: (W) => r.pendingAttachments.splice(
|
|
5961
|
+
onClick: (W) => r.pendingAttachments.splice(H, 1)
|
|
5880
5962
|
}, [...t[9] || (t[9] = [
|
|
5881
5963
|
o("svg", {
|
|
5882
5964
|
width: "10",
|
|
@@ -5894,17 +5976,19 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5894
5976
|
])], 8, ja)
|
|
5895
5977
|
]))), 128))
|
|
5896
5978
|
])) : b("", !0)
|
|
5897
|
-
], 64)) : (c(), R(
|
|
5979
|
+
], 64)) : (c(), R(p, {
|
|
5898
5980
|
key: 1,
|
|
5899
5981
|
"welcome-message": s.widgetWelcomeMessage,
|
|
5982
|
+
subtitle: s.widgetSubtitle,
|
|
5900
5983
|
"agent-name": s.agentName,
|
|
5984
|
+
"default-icon-url": s.defaultIconUrl,
|
|
5901
5985
|
"quick-links": s.quickLinks,
|
|
5902
5986
|
"open-threads": s.openThreads,
|
|
5903
5987
|
busy: r.busy,
|
|
5904
5988
|
onStart: s.startConv,
|
|
5905
5989
|
onSelect: s.onQuickLink,
|
|
5906
5990
|
onResume: s.onDrawerPick
|
|
5907
|
-
}, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
5991
|
+
}, null, 8, ["welcome-message", "subtitle", "agent-name", "default-icon-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
5908
5992
|
r.moreOpen && !s.currentConv ? (c(), R(M, {
|
|
5909
5993
|
key: 3,
|
|
5910
5994
|
"can-rename": !1,
|
|
@@ -5922,53 +6006,53 @@ function Pa(e, t, n, i, r, s) {
|
|
|
5922
6006
|
], 6)) : b("", !0)
|
|
5923
6007
|
], 2);
|
|
5924
6008
|
}
|
|
5925
|
-
const
|
|
6009
|
+
const za = /* @__PURE__ */ B(Ma, [["render", Pa], ["__scopeId", "data-v-0bf94dbd"]]), qa = "0.4.6";
|
|
5926
6010
|
export {
|
|
5927
6011
|
le as AIAvatar,
|
|
5928
6012
|
fe as AVATAR_COLORS,
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
6013
|
+
ts as ActionResult,
|
|
6014
|
+
ui as ApprovalCard,
|
|
6015
|
+
ds as ArtifactFormResponse,
|
|
6016
|
+
Cs as ArtifactInfoCard,
|
|
6017
|
+
zs as ArtifactRenderer,
|
|
5934
6018
|
js as ArtifactTicket,
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
6019
|
+
er as AttachmentPreview,
|
|
6020
|
+
rr as Bubble,
|
|
6021
|
+
Xr as Composer,
|
|
5938
6022
|
Ze as DEFAULT_BASE_URL,
|
|
5939
6023
|
ie as DEFAULT_LANGUAGE,
|
|
5940
|
-
|
|
6024
|
+
Ji as Feedback,
|
|
5941
6025
|
ji as FormCard,
|
|
5942
|
-
|
|
6026
|
+
cn as Header,
|
|
5943
6027
|
Be as HumanAvatar,
|
|
5944
|
-
|
|
5945
|
-
|
|
6028
|
+
Ft as Launcher,
|
|
6029
|
+
be as MEDIA_RECORDER_SUPPORTED,
|
|
5946
6030
|
Lr as MessageList,
|
|
5947
|
-
|
|
6031
|
+
za as Messenger,
|
|
5948
6032
|
ha as MoreMenu,
|
|
5949
|
-
|
|
5950
|
-
|
|
6033
|
+
qn as Onboarding,
|
|
6034
|
+
me as SCREEN_CAPTURE_SUPPORTED,
|
|
5951
6035
|
et as SUPPORTED_LANGUAGES,
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
6036
|
+
ti as SuggestionChips,
|
|
6037
|
+
Yt as TeamAvatars,
|
|
6038
|
+
lr as Typing,
|
|
6039
|
+
qa as VERSION,
|
|
6040
|
+
pe as avatarColor,
|
|
6041
|
+
ve as avatarInitials,
|
|
6042
|
+
Er as captureScreenshotFile,
|
|
6043
|
+
D as colors,
|
|
5960
6044
|
Xe as createStore,
|
|
5961
|
-
|
|
6045
|
+
j as createTranslator,
|
|
5962
6046
|
We as createTransport,
|
|
5963
6047
|
oe as dateLocale,
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
6048
|
+
za as default,
|
|
6049
|
+
Ie as formatTime,
|
|
6050
|
+
Ha as guessAttachmentKind,
|
|
6051
|
+
Br as pickRecorderMime,
|
|
6052
|
+
un as renderInlineMarkdown,
|
|
6053
|
+
mn as renderMarkdown,
|
|
6054
|
+
ye as resolveLanguage,
|
|
6055
|
+
Nr as startScreenRecording,
|
|
5972
6056
|
Je as tokensCss,
|
|
5973
6057
|
Qe as uuid,
|
|
5974
6058
|
Qe as v4
|