@_solaris/messenger-widget 0.5.35 → 0.5.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iframe/iframe.css +1 -1
- package/dist/iframe/iframe.js +26 -26
- package/dist/messenger.cjs +7 -7
- package/dist/messenger.js +894 -824
- package/dist/snippet.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/core/i18n.d.ts +2 -0
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
const
|
|
1
|
+
import { reactive as je, openBlock as c, createElementBlock as u, normalizeStyle as z, normalizeClass as O, toDisplayString as v, resolveComponent as R, createVNode as K, Transition as Re, withCtx as Ne, Fragment as E, renderList as F, withKeys as ue, withModifiers as G, createElementVNode as o, createCommentVNode as y, createBlock as P, resolveDynamicComponent as pe, mergeProps as Se, withDirectives as $, vModelText as X, createTextVNode as ye, renderSlot as He, vModelCheckbox as ze, vModelSelect as qe, markRaw as Me } from "vue";
|
|
2
|
+
const Ke = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
5
5
|
"message_stream",
|
|
6
6
|
"conversation_updated",
|
|
7
7
|
"config_updated",
|
|
8
8
|
"action_status"
|
|
9
|
-
], fe = "/client",
|
|
10
|
-
function
|
|
9
|
+
], fe = "/client", Ve = 5 * 60 * 1e3, $e = 10 * 60 * 1e3, We = 5 * 60 * 1e3;
|
|
10
|
+
function Ge(e) {
|
|
11
11
|
const t = {
|
|
12
|
-
baseUrl:
|
|
12
|
+
baseUrl: Ye(e.baseUrl || ""),
|
|
13
13
|
widgetId: e.widgetId || "",
|
|
14
14
|
// Posé après `start()` à partir de la response /session.
|
|
15
15
|
userId: "",
|
|
@@ -35,8 +35,8 @@ function We(e) {
|
|
|
35
35
|
return t.listeners.has(d) || t.listeners.set(d, /* @__PURE__ */ new Set()), t.listeners.get(d).add(f), () => t.listeners.get(d).delete(f);
|
|
36
36
|
}
|
|
37
37
|
function i(d, f) {
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const g = t.listeners.get(d);
|
|
39
|
+
g && g.forEach((b) => {
|
|
40
40
|
try {
|
|
41
41
|
b(f);
|
|
42
42
|
} catch (C) {
|
|
@@ -60,12 +60,12 @@ function We(e) {
|
|
|
60
60
|
...t.origin ? { "X-Parent-Origin": t.origin } : {}
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
async function a(d, f,
|
|
63
|
+
async function a(d, f, g) {
|
|
64
64
|
const b = await fetch(`${t.baseUrl}${fe}${f}`, {
|
|
65
65
|
method: d,
|
|
66
66
|
credentials: "include",
|
|
67
67
|
headers: s(),
|
|
68
|
-
body:
|
|
68
|
+
body: g !== void 0 ? JSON.stringify(g) : void 0
|
|
69
69
|
});
|
|
70
70
|
if (!b.ok) {
|
|
71
71
|
const C = await l(b), M = new Error(
|
|
@@ -109,25 +109,25 @@ function We(e) {
|
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
111
|
if (!f.ok) {
|
|
112
|
-
const
|
|
113
|
-
`Session bootstrap failed: HTTP ${f.status} :: ${(
|
|
112
|
+
const L = await l(f), x = new Error(
|
|
113
|
+
`Session bootstrap failed: HTTP ${f.status} :: ${(L == null ? void 0 : L.error) || f.statusText}`
|
|
114
114
|
);
|
|
115
|
-
throw x.status = f.status, x.body =
|
|
115
|
+
throw x.status = f.status, x.body = L, x;
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
t.userId =
|
|
117
|
+
const g = await f.json();
|
|
118
|
+
t.userId = g.external_id;
|
|
119
119
|
const [b, C] = await Promise.all([
|
|
120
120
|
fetch(
|
|
121
121
|
`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,
|
|
122
122
|
{ credentials: "include" }
|
|
123
|
-
).then(async (
|
|
124
|
-
if (!
|
|
125
|
-
const x = await l(
|
|
123
|
+
).then(async (L) => {
|
|
124
|
+
if (!L.ok) {
|
|
125
|
+
const x = await l(L);
|
|
126
126
|
throw new Error(
|
|
127
|
-
`HTTP ${
|
|
127
|
+
`HTTP ${L.status} GET /widgets/:id/config :: ${(x == null ? void 0 : x.error) || L.statusText}`
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return L.json();
|
|
131
131
|
}),
|
|
132
132
|
a("GET", "/customers/me")
|
|
133
133
|
]), M = { config: b, customer: (C == null ? void 0 : C.customer) ?? null };
|
|
@@ -138,9 +138,9 @@ function We(e) {
|
|
|
138
138
|
}
|
|
139
139
|
async function k() {
|
|
140
140
|
try {
|
|
141
|
-
const d = await
|
|
142
|
-
t.lastActivityAt = d.reduce((f,
|
|
143
|
-
const b =
|
|
141
|
+
const d = await B();
|
|
142
|
+
t.lastActivityAt = d.reduce((f, g) => {
|
|
143
|
+
const b = g == null ? void 0 : g.last_message_at;
|
|
144
144
|
return b && (!f || b > f) ? b : f;
|
|
145
145
|
}, null);
|
|
146
146
|
} catch (d) {
|
|
@@ -155,7 +155,7 @@ function We(e) {
|
|
|
155
155
|
const f = await a("PATCH", "/customers/me", d);
|
|
156
156
|
return (f == null ? void 0 : f.customer) ?? null;
|
|
157
157
|
}
|
|
158
|
-
async function
|
|
158
|
+
async function B() {
|
|
159
159
|
const d = await a("GET", "/conversations");
|
|
160
160
|
return (d == null ? void 0 : d.conversations) ?? [];
|
|
161
161
|
}
|
|
@@ -175,60 +175,60 @@ function We(e) {
|
|
|
175
175
|
f
|
|
176
176
|
)).conversation;
|
|
177
177
|
}
|
|
178
|
-
async function
|
|
178
|
+
async function U(d, f) {
|
|
179
179
|
return a(
|
|
180
180
|
"PATCH",
|
|
181
181
|
`/conversations/${encodeURIComponent(d)}/read`,
|
|
182
182
|
{ message_id: f }
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
|
-
async function
|
|
186
|
-
const
|
|
187
|
-
f.before &&
|
|
188
|
-
const b =
|
|
185
|
+
async function I(d, f = {}) {
|
|
186
|
+
const g = new URLSearchParams();
|
|
187
|
+
f.before && g.set("before", f.before), f.since && g.set("since", f.since), f.limit && g.set("limit", String(f.limit));
|
|
188
|
+
const b = g.toString() ? `?${g.toString()}` : "";
|
|
189
189
|
return a(
|
|
190
190
|
"GET",
|
|
191
191
|
`/conversations/${encodeURIComponent(d)}/messages${b}`
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
|
-
async function
|
|
194
|
+
async function q(d, f) {
|
|
195
195
|
se();
|
|
196
|
-
const
|
|
196
|
+
const g = {
|
|
197
197
|
client_msg_id: f.client_msg_id,
|
|
198
198
|
type: "content",
|
|
199
199
|
text_md: f.text_md,
|
|
200
200
|
author: { id: t.userId, type: "user" },
|
|
201
201
|
created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
202
202
|
};
|
|
203
|
-
return Array.isArray(f.attachments) && f.attachments.length && (
|
|
203
|
+
return Array.isArray(f.attachments) && f.attachments.length && (g.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (g.metadata = f.metadata), a(
|
|
204
204
|
"POST",
|
|
205
205
|
`/conversations/${encodeURIComponent(d)}/messages`,
|
|
206
|
-
|
|
206
|
+
g
|
|
207
207
|
);
|
|
208
208
|
}
|
|
209
|
-
async function Y(d, f,
|
|
209
|
+
async function Y(d, f, g) {
|
|
210
210
|
return se(), a(
|
|
211
211
|
"POST",
|
|
212
212
|
`/messages/${encodeURIComponent(d)}/callbacks/${encodeURIComponent(f)}`,
|
|
213
|
-
|
|
213
|
+
g ? { inputs: g } : {}
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
async function Z(d) {
|
|
217
|
-
const f = d.name || "attachment",
|
|
218
|
-
mime_type:
|
|
217
|
+
const f = d.name || "attachment", g = d.type || "application/octet-stream", b = d.size || 0, C = await a("POST", "/attachments", {
|
|
218
|
+
mime_type: g,
|
|
219
219
|
size_bytes: b,
|
|
220
220
|
name: f
|
|
221
221
|
}), M = await fetch(C.upload_url, {
|
|
222
222
|
method: "PUT",
|
|
223
|
-
headers: { "Content-Type":
|
|
223
|
+
headers: { "Content-Type": g },
|
|
224
224
|
body: d
|
|
225
225
|
});
|
|
226
226
|
if (!M.ok)
|
|
227
227
|
throw new Error(`HTTP ${M.status} PUT signed upload`);
|
|
228
228
|
return {
|
|
229
|
-
type:
|
|
229
|
+
type: Je(g),
|
|
230
230
|
path: C.path,
|
|
231
|
-
mime_type:
|
|
231
|
+
mime_type: g,
|
|
232
232
|
size_bytes: b
|
|
233
233
|
};
|
|
234
234
|
}
|
|
@@ -242,12 +242,12 @@ function We(e) {
|
|
|
242
242
|
const d = new URLSearchParams({ widgetId: t.widgetId }).toString();
|
|
243
243
|
return `${t.baseUrl}${fe}/stream?${d}`;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function V() {
|
|
246
246
|
if (!t.eventSource && !(typeof document < "u" && document.hidden) && t.started)
|
|
247
247
|
try {
|
|
248
248
|
const d = new EventSource(te(), { withCredentials: !0 });
|
|
249
|
-
for (const f of
|
|
250
|
-
d.addEventListener(f, (
|
|
249
|
+
for (const f of Ke)
|
|
250
|
+
d.addEventListener(f, (g) => ne(f, g.data));
|
|
251
251
|
d.addEventListener(
|
|
252
252
|
"error",
|
|
253
253
|
() => i("error", new Error("SSE error"))
|
|
@@ -258,26 +258,26 @@ function We(e) {
|
|
|
258
258
|
}
|
|
259
259
|
function ne(d, f) {
|
|
260
260
|
try {
|
|
261
|
-
const
|
|
261
|
+
const g = JSON.parse(f), b = g && typeof g == "object" && "data" in g ? g.data : g;
|
|
262
262
|
i(d, b);
|
|
263
|
-
} catch (
|
|
264
|
-
console.error("[transport] bad SSE payload", d,
|
|
263
|
+
} catch (g) {
|
|
264
|
+
console.error("[transport] bad SSE payload", d, g);
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
function J() {
|
|
268
268
|
t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" && r("idle");
|
|
269
269
|
}
|
|
270
270
|
function se() {
|
|
271
|
-
clearTimeout(t.burstTimer),
|
|
271
|
+
clearTimeout(t.burstTimer), V(), t.panelOpen || (t.burstTimer = setTimeout(() => {
|
|
272
272
|
t.panelOpen || J();
|
|
273
|
-
},
|
|
273
|
+
}, $e));
|
|
274
274
|
}
|
|
275
275
|
function ce(d) {
|
|
276
|
-
t.panelOpen = !!d, t.panelOpen ? (clearTimeout(t.burstTimer),
|
|
276
|
+
t.panelOpen = !!d, t.panelOpen ? (clearTimeout(t.burstTimer), V()) : se();
|
|
277
277
|
}
|
|
278
278
|
async function me() {
|
|
279
279
|
try {
|
|
280
|
-
const d = await
|
|
280
|
+
const d = await B(), f = d.reduce((b, C) => {
|
|
281
281
|
const M = C == null ? void 0 : C.last_message_at;
|
|
282
282
|
return M && (!b || M > b) ? M : b;
|
|
283
283
|
}, null);
|
|
@@ -287,7 +287,7 @@ function We(e) {
|
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
function de() {
|
|
290
|
-
h(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(me,
|
|
290
|
+
h(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(me, Ve));
|
|
291
291
|
}
|
|
292
292
|
function h() {
|
|
293
293
|
t.pollTimer && (clearInterval(t.pollTimer), t.pollTimer = null);
|
|
@@ -296,16 +296,16 @@ function We(e) {
|
|
|
296
296
|
if (document.hidden)
|
|
297
297
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = setTimeout(() => {
|
|
298
298
|
t.hiddenGraceTimer = null, document.hidden && (h(), J(), r("paused"));
|
|
299
|
-
},
|
|
299
|
+
}, We);
|
|
300
300
|
else {
|
|
301
301
|
if (t.hiddenGraceTimer) {
|
|
302
302
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null;
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
r("idle"), de(), t.panelOpen &&
|
|
305
|
+
r("idle"), de(), t.panelOpen && V();
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function _() {
|
|
309
309
|
h(), clearTimeout(t.burstTimer), clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null, J(), t.visibilityHandler && (document.removeEventListener(
|
|
310
310
|
"visibilitychange",
|
|
311
311
|
t.visibilityHandler
|
|
@@ -314,18 +314,18 @@ function We(e) {
|
|
|
314
314
|
return {
|
|
315
315
|
on: n,
|
|
316
316
|
start: p,
|
|
317
|
-
stop:
|
|
317
|
+
stop: _,
|
|
318
318
|
setPanelOpen: ce,
|
|
319
319
|
// REST
|
|
320
320
|
getCustomer: w,
|
|
321
321
|
patchCustomer: T,
|
|
322
|
-
listConversations:
|
|
322
|
+
listConversations: B,
|
|
323
323
|
createConversation: A,
|
|
324
324
|
getConversation: H,
|
|
325
325
|
patchConversation: S,
|
|
326
|
-
markConversationRead:
|
|
327
|
-
listMessages:
|
|
328
|
-
postMessage:
|
|
326
|
+
markConversationRead: U,
|
|
327
|
+
listMessages: I,
|
|
328
|
+
postMessage: q,
|
|
329
329
|
postCallback: Y,
|
|
330
330
|
uploadAttachment: Z,
|
|
331
331
|
signAttachment: ee,
|
|
@@ -335,13 +335,13 @@ function We(e) {
|
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Ye(e) {
|
|
339
339
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function Je(e) {
|
|
342
342
|
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Qe() {
|
|
345
345
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
346
346
|
return crypto.randomUUID();
|
|
347
347
|
const e = new Uint8Array(16);
|
|
@@ -353,8 +353,8 @@ function Je() {
|
|
|
353
353
|
const t = [...e].map((n) => n.toString(16).padStart(2, "0"));
|
|
354
354
|
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("");
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
const t =
|
|
356
|
+
function Xe(e) {
|
|
357
|
+
const t = je({
|
|
358
358
|
ready: !1,
|
|
359
359
|
error: null,
|
|
360
360
|
config: null,
|
|
@@ -391,22 +391,22 @@ function Qe(e) {
|
|
|
391
391
|
})
|
|
392
392
|
), n.push(
|
|
393
393
|
e.on("message", (h) => {
|
|
394
|
-
const m = h == null ? void 0 : h.conversation_id,
|
|
395
|
-
!m || !(
|
|
394
|
+
const m = h == null ? void 0 : h.conversation_id, _ = h == null ? void 0 : h.message;
|
|
395
|
+
!m || !(_ != null && _.id) || (V(m, _), _.client_msg_id && delete t.streamingByMsgId[_.client_msg_id], se(m, _.created_at));
|
|
396
396
|
})
|
|
397
397
|
), n.push(
|
|
398
398
|
e.on("message_stream", (h) => {
|
|
399
|
-
const m = h == null ? void 0 : h.message_id,
|
|
400
|
-
!m || typeof
|
|
399
|
+
const m = h == null ? void 0 : h.message_id, _ = h == null ? void 0 : h.token;
|
|
400
|
+
!m || typeof _ != "string" || (t.streamingByMsgId[m] = (t.streamingByMsgId[m] || "") + _);
|
|
401
401
|
})
|
|
402
402
|
), n.push(
|
|
403
403
|
e.on("conversation_updated", (h) => {
|
|
404
|
-
const m = h == null ? void 0 : h.conversation_id,
|
|
405
|
-
if (!m || !
|
|
404
|
+
const m = h == null ? void 0 : h.conversation_id, _ = h == null ? void 0 : h.changes;
|
|
405
|
+
if (!m || !_) return;
|
|
406
406
|
const d = t.conversations.findIndex((f) => f.id === m);
|
|
407
407
|
d !== -1 && (t.conversations[d] = {
|
|
408
408
|
...t.conversations[d],
|
|
409
|
-
...
|
|
409
|
+
..._
|
|
410
410
|
});
|
|
411
411
|
})
|
|
412
412
|
), n.push(
|
|
@@ -415,10 +415,10 @@ function Qe(e) {
|
|
|
415
415
|
})
|
|
416
416
|
), n.push(
|
|
417
417
|
e.on("action_status", (h) => {
|
|
418
|
-
const m = h == null ? void 0 : h.conversation_id,
|
|
419
|
-
if (!m || !
|
|
418
|
+
const m = h == null ? void 0 : h.conversation_id, _ = h == null ? void 0 : h.action_id, d = h == null ? void 0 : h.action_name;
|
|
419
|
+
if (!m || !_) return;
|
|
420
420
|
const f = t.runningActionsByConv[m] || {};
|
|
421
|
-
h.state === "running" ? (f[
|
|
421
|
+
h.state === "running" ? (f[_] = d || _, t.runningActionsByConv[m] = { ...f }) : h.state === "done" && (delete f[_], t.runningActionsByConv[m] = { ...f });
|
|
422
422
|
})
|
|
423
423
|
), n.push(
|
|
424
424
|
e.on("activity", (h) => {
|
|
@@ -436,11 +436,11 @@ function Qe(e) {
|
|
|
436
436
|
),
|
|
437
437
|
15e3
|
|
438
438
|
)
|
|
439
|
-
),
|
|
439
|
+
), _ = await Promise.race([
|
|
440
440
|
e.start(h),
|
|
441
441
|
m
|
|
442
442
|
]);
|
|
443
|
-
t.config =
|
|
443
|
+
t.config = _.config, t.customer = _.customer, t.conversations = await Promise.race([
|
|
444
444
|
e.listConversations(),
|
|
445
445
|
m
|
|
446
446
|
]), t.ready = !0;
|
|
@@ -460,16 +460,16 @@ function Qe(e) {
|
|
|
460
460
|
const m = me(h);
|
|
461
461
|
if (!m) return t.customer;
|
|
462
462
|
try {
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
} catch (
|
|
466
|
-
console.error("[store] applyCustomer failed",
|
|
463
|
+
const _ = await e.patchCustomer(m);
|
|
464
|
+
_ && (t.customer = _);
|
|
465
|
+
} catch (_) {
|
|
466
|
+
console.error("[store] applyCustomer failed", _);
|
|
467
467
|
}
|
|
468
468
|
return t.customer;
|
|
469
469
|
}
|
|
470
470
|
async function a(h = {}) {
|
|
471
|
-
const m = await e.createConversation(h),
|
|
472
|
-
return
|
|
471
|
+
const m = await e.createConversation(h), _ = t.conversations.findIndex((d) => d.id === m.id);
|
|
472
|
+
return _ === -1 ? t.conversations = [m, ...t.conversations] : t.conversations[_] = m, m;
|
|
473
473
|
}
|
|
474
474
|
const l = 50;
|
|
475
475
|
async function p(h) {
|
|
@@ -477,21 +477,21 @@ function Qe(e) {
|
|
|
477
477
|
if (!(m != null && m.loaded || m != null && m.loading)) {
|
|
478
478
|
w(h, { nextCursor: null, loading: !0, loaded: !1 });
|
|
479
479
|
try {
|
|
480
|
-
const
|
|
480
|
+
const _ = await e.listMessages(h, {
|
|
481
481
|
limit: l
|
|
482
|
-
}), d = (
|
|
482
|
+
}), d = (_ == null ? void 0 : _.messages) ?? [], f = t.messagesByConv[h] || [], g = /* @__PURE__ */ new Set();
|
|
483
483
|
for (const C of d)
|
|
484
|
-
(C == null ? void 0 : C.id) != null &&
|
|
485
|
-
const b = f.filter((C) => !((C == null ? void 0 : C.id) != null &&
|
|
484
|
+
(C == null ? void 0 : C.id) != null && g.add(`id:${String(C.id)}`), C != null && C.client_msg_id && g.add(`c:${C.client_msg_id}`);
|
|
485
|
+
const b = f.filter((C) => !((C == null ? void 0 : C.id) != null && g.has(`id:${String(C.id)}`) || C != null && C.client_msg_id && g.has(`c:${C.client_msg_id}`)));
|
|
486
486
|
t.messagesByConv[h] = [...d, ...b].sort(
|
|
487
487
|
ce
|
|
488
488
|
), w(h, {
|
|
489
|
-
nextCursor: (
|
|
489
|
+
nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
|
|
490
490
|
loading: !1,
|
|
491
491
|
loaded: !0
|
|
492
492
|
});
|
|
493
|
-
} catch (
|
|
494
|
-
console.error("[store] openConversation failed",
|
|
493
|
+
} catch (_) {
|
|
494
|
+
console.error("[store] openConversation failed", _), w(h, {
|
|
495
495
|
nextCursor: null,
|
|
496
496
|
loading: !1,
|
|
497
497
|
loaded: !1
|
|
@@ -503,24 +503,24 @@ function Qe(e) {
|
|
|
503
503
|
var f;
|
|
504
504
|
const m = t.paginationByConv[h];
|
|
505
505
|
if (!m || m.loading || !m.nextCursor) return;
|
|
506
|
-
const d = (f = (t.messagesByConv[h] || []).find((
|
|
506
|
+
const d = (f = (t.messagesByConv[h] || []).find((g) => g == null ? void 0 : g.created_at)) == null ? void 0 : f.created_at;
|
|
507
507
|
if (d) {
|
|
508
508
|
w(h, { ...m, loading: !0 });
|
|
509
509
|
try {
|
|
510
|
-
const
|
|
510
|
+
const g = await e.listMessages(h, {
|
|
511
511
|
before: d,
|
|
512
512
|
limit: l
|
|
513
|
-
}), b = (
|
|
513
|
+
}), b = (g == null ? void 0 : g.messages) ?? [], C = t.messagesByConv[h] || [], M = /* @__PURE__ */ new Set();
|
|
514
514
|
for (const x of C)
|
|
515
515
|
(x == null ? void 0 : x.id) != null && M.add(`id:${String(x.id)}`), x != null && x.client_msg_id && M.add(`c:${x.client_msg_id}`);
|
|
516
|
-
const
|
|
517
|
-
t.messagesByConv[h] = [...
|
|
518
|
-
nextCursor: (
|
|
516
|
+
const L = b.filter((x) => !((x == null ? void 0 : x.id) != null && M.has(`id:${String(x.id)}`) || x != null && x.client_msg_id && M.has(`c:${x.client_msg_id}`)));
|
|
517
|
+
t.messagesByConv[h] = [...L, ...C], w(h, {
|
|
518
|
+
nextCursor: (g == null ? void 0 : g.next_cursor) ?? null,
|
|
519
519
|
loading: !1,
|
|
520
520
|
loaded: !0
|
|
521
521
|
});
|
|
522
|
-
} catch (
|
|
523
|
-
console.error("[store] loadMore failed",
|
|
522
|
+
} catch (g) {
|
|
523
|
+
console.error("[store] loadMore failed", g), w(h, { ...m, loading: !1 });
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
}
|
|
@@ -528,28 +528,28 @@ function Qe(e) {
|
|
|
528
528
|
t.paginationByConv = { ...t.paginationByConv, [h]: m };
|
|
529
529
|
}
|
|
530
530
|
async function T(h, m) {
|
|
531
|
-
const
|
|
532
|
-
d !== -1 && (t.conversations[d] =
|
|
531
|
+
const _ = await e.patchConversation(h, m), d = t.conversations.findIndex((f) => f.id === h);
|
|
532
|
+
d !== -1 && (t.conversations[d] = _);
|
|
533
533
|
}
|
|
534
|
-
async function
|
|
534
|
+
async function B(h) {
|
|
535
535
|
if (!h) return [];
|
|
536
536
|
const m = t.messagesByConv[h] || [];
|
|
537
|
-
let
|
|
537
|
+
let _ = "";
|
|
538
538
|
for (const d of m)
|
|
539
|
-
d != null && d.created_at && d.created_at >
|
|
539
|
+
d != null && d.created_at && d.created_at > _ && (_ = d.created_at);
|
|
540
540
|
try {
|
|
541
541
|
const d = await e.listMessages(
|
|
542
542
|
h,
|
|
543
|
-
|
|
543
|
+
_ ? { since: _ } : {}
|
|
544
544
|
), f = (d == null ? void 0 : d.messages) || [];
|
|
545
545
|
if (!f.length) return [];
|
|
546
|
-
const
|
|
546
|
+
const g = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set();
|
|
547
547
|
for (const M of m)
|
|
548
|
-
(M == null ? void 0 : M.id) != null &&
|
|
548
|
+
(M == null ? void 0 : M.id) != null && g.add(String(M.id)), M != null && M.client_msg_id && b.add(M.client_msg_id);
|
|
549
549
|
const C = [];
|
|
550
550
|
for (const M of f) {
|
|
551
|
-
const
|
|
552
|
-
|
|
551
|
+
const L = (M == null ? void 0 : M.id) != null && g.has(String(M.id)) || (M == null ? void 0 : M.client_msg_id) && b.has(M.client_msg_id);
|
|
552
|
+
V(h, M), L || C.push(M);
|
|
553
553
|
}
|
|
554
554
|
return C;
|
|
555
555
|
} catch (d) {
|
|
@@ -559,20 +559,20 @@ function Qe(e) {
|
|
|
559
559
|
async function A(h, m) {
|
|
560
560
|
if (!(!h || m == null))
|
|
561
561
|
try {
|
|
562
|
-
const
|
|
562
|
+
const _ = await e.markConversationRead(h, m), d = (_ == null ? void 0 : _.last_read_message_id) ?? m, f = t.conversations.findIndex((g) => (g == null ? void 0 : g.id) === h);
|
|
563
563
|
f !== -1 && (t.conversations[f] = {
|
|
564
564
|
...t.conversations[f],
|
|
565
565
|
last_read_message_id: d
|
|
566
566
|
});
|
|
567
|
-
} catch (
|
|
568
|
-
console.error("[store] markConversationRead failed",
|
|
567
|
+
} catch (_) {
|
|
568
|
+
console.error("[store] markConversationRead failed", _);
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
async function H(h, m, { attachments:
|
|
572
|
-
var
|
|
573
|
-
const f = (m || "").trim(),
|
|
574
|
-
if (!h || !f && !
|
|
575
|
-
const b =
|
|
571
|
+
async function H(h, m, { attachments: _, metadata: d } = {}) {
|
|
572
|
+
var L;
|
|
573
|
+
const f = (m || "").trim(), g = Array.isArray(_) && _.length > 0;
|
|
574
|
+
if (!h || !f && !g) return;
|
|
575
|
+
const b = Qe(), C = de(h), M = {
|
|
576
576
|
id: b,
|
|
577
577
|
client_msg_id: b,
|
|
578
578
|
conversation_id: h,
|
|
@@ -580,21 +580,21 @@ function Qe(e) {
|
|
|
580
580
|
text_md: f,
|
|
581
581
|
author: {
|
|
582
582
|
type: "user",
|
|
583
|
-
id: ((
|
|
583
|
+
id: ((L = t.customer) == null ? void 0 : L.external_id) || null
|
|
584
584
|
},
|
|
585
585
|
created_at: C,
|
|
586
586
|
// Local-only flag — UI may render dimmed until the SSE echo lands.
|
|
587
587
|
_pending: !0,
|
|
588
|
-
...
|
|
588
|
+
...g ? { payload: { type: "content", attachments: _ } } : {},
|
|
589
589
|
...d && typeof d == "object" ? { metadata: d } : {}
|
|
590
590
|
};
|
|
591
|
-
|
|
591
|
+
V(h, M);
|
|
592
592
|
try {
|
|
593
593
|
await e.postMessage(h, {
|
|
594
594
|
client_msg_id: b,
|
|
595
595
|
text_md: f,
|
|
596
596
|
created_at: C,
|
|
597
|
-
...
|
|
597
|
+
...g ? { attachments: _ } : {},
|
|
598
598
|
...d && typeof d == "object" ? { metadata: d } : {}
|
|
599
599
|
});
|
|
600
600
|
} catch (x) {
|
|
@@ -604,61 +604,61 @@ function Qe(e) {
|
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
async function S(h, m,
|
|
607
|
+
async function S(h, m, _) {
|
|
608
608
|
h != null && (t.awaitingCallback[h] = !0);
|
|
609
609
|
try {
|
|
610
|
-
await e.postCallback(h, m,
|
|
610
|
+
await e.postCallback(h, m, _);
|
|
611
611
|
} catch (d) {
|
|
612
612
|
console.error("[store] callback failed", d), h != null && delete t.awaitingCallback[h];
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
const
|
|
616
|
-
async function
|
|
615
|
+
const U = /* @__PURE__ */ new Map();
|
|
616
|
+
async function I(h) {
|
|
617
617
|
if (!h) return null;
|
|
618
|
-
const m =
|
|
618
|
+
const m = U.get(h);
|
|
619
619
|
if (m != null && m.url) {
|
|
620
|
-
const
|
|
621
|
-
if (!
|
|
620
|
+
const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
|
|
621
|
+
if (!_ || _ - Date.now() > 6e4) return m.url;
|
|
622
622
|
}
|
|
623
623
|
try {
|
|
624
|
-
const
|
|
625
|
-
if (
|
|
626
|
-
return
|
|
627
|
-
url:
|
|
628
|
-
expires_at:
|
|
629
|
-
}),
|
|
630
|
-
} catch (
|
|
631
|
-
console.error("[store] sign attachment failed",
|
|
624
|
+
const _ = await e.signAttachment(h);
|
|
625
|
+
if (_ != null && _.signed_url)
|
|
626
|
+
return U.set(h, {
|
|
627
|
+
url: _.signed_url,
|
|
628
|
+
expires_at: _.expires_at
|
|
629
|
+
}), _.signed_url;
|
|
630
|
+
} catch (_) {
|
|
631
|
+
console.error("[store] sign attachment failed", _);
|
|
632
632
|
}
|
|
633
633
|
return null;
|
|
634
634
|
}
|
|
635
|
-
async function
|
|
636
|
-
const d = t.conversations.find((b) => b.id === h),
|
|
635
|
+
async function q(h, { rating: m, comment: _ } = {}) {
|
|
636
|
+
const d = t.conversations.find((b) => b.id === h), g = {
|
|
637
637
|
...(d == null ? void 0 : d.metadata) || {},
|
|
638
638
|
feedback: {
|
|
639
639
|
rating: m,
|
|
640
|
-
comment:
|
|
640
|
+
comment: _ || null,
|
|
641
641
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
642
642
|
}
|
|
643
643
|
};
|
|
644
|
-
await T(h, { metadata:
|
|
644
|
+
await T(h, { metadata: g });
|
|
645
645
|
}
|
|
646
646
|
function Y(h) {
|
|
647
|
-
var
|
|
647
|
+
var _, d;
|
|
648
648
|
const m = t.messagesByConv[h] || [];
|
|
649
649
|
for (let f = m.length - 1; f >= 0; f--) {
|
|
650
|
-
const
|
|
651
|
-
if ((
|
|
652
|
-
return
|
|
650
|
+
const g = m[f];
|
|
651
|
+
if ((g == null ? void 0 : g.type) === "action" && ((_ = g == null ? void 0 : g.payload) == null ? void 0 : _.type) === "action" && ((d = g == null ? void 0 : g.payload) == null ? void 0 : d.state) === "pending" && Array.isArray(g == null ? void 0 : g.callbacks) && g.callbacks.length > 0 && !t.awaitingCallback[g.id])
|
|
652
|
+
return g;
|
|
653
653
|
}
|
|
654
654
|
return null;
|
|
655
655
|
}
|
|
656
656
|
function Z(h) {
|
|
657
|
-
var
|
|
657
|
+
var _, d, f;
|
|
658
658
|
const m = t.messagesByConv[h] || [];
|
|
659
|
-
for (let
|
|
660
|
-
const b = m[
|
|
661
|
-
if (((
|
|
659
|
+
for (let g = m.length - 1; g >= 0; g--) {
|
|
660
|
+
const b = m[g];
|
|
661
|
+
if (((_ = b == null ? void 0 : b.author) == null ? void 0 : _.type) === "user" || (b == null ? void 0 : b.type) === "action" && ((d = b == null ? void 0 : b.payload) == null ? void 0 : d.state) === "pending")
|
|
662
662
|
return null;
|
|
663
663
|
const C = (f = b == null ? void 0 : b.metadata) == null ? void 0 : f.form;
|
|
664
664
|
if (C && Array.isArray(C.fields) && C.fields.length > 0)
|
|
@@ -669,71 +669,71 @@ function Qe(e) {
|
|
|
669
669
|
function ee(h) {
|
|
670
670
|
const m = t.runningActionsByConv[h];
|
|
671
671
|
if (!m) return null;
|
|
672
|
-
const
|
|
673
|
-
if (
|
|
674
|
-
const d =
|
|
672
|
+
const _ = Object.keys(m);
|
|
673
|
+
if (_.length === 0) return null;
|
|
674
|
+
const d = _[0];
|
|
675
675
|
return { id: d, payload: { name: m[d] } };
|
|
676
676
|
}
|
|
677
677
|
function te(h) {
|
|
678
|
-
var
|
|
678
|
+
var _, d, f, g;
|
|
679
679
|
const m = t.messagesByConv[h] || [];
|
|
680
680
|
for (let b = m.length - 1; b >= 0; b--) {
|
|
681
681
|
const C = m[b];
|
|
682
|
-
if (((
|
|
682
|
+
if (((_ = C == null ? void 0 : C.author) == null ? void 0 : _.type) === "user") return [];
|
|
683
683
|
if ((C == null ? void 0 : C.type) === "action" && ((d = C == null ? void 0 : C.payload) == null ? void 0 : d.state) === "pending")
|
|
684
684
|
return [];
|
|
685
685
|
if (((f = C == null ? void 0 : C.author) == null ? void 0 : f.type) !== "agent_ia") continue;
|
|
686
|
-
const M = (
|
|
687
|
-
return Array.isArray(M) && M.length ? M.map((
|
|
688
|
-
if (typeof
|
|
689
|
-
const x =
|
|
686
|
+
const M = (g = C == null ? void 0 : C.metadata) == null ? void 0 : g.suggested_replies;
|
|
687
|
+
return Array.isArray(M) && M.length ? M.map((L) => {
|
|
688
|
+
if (typeof L == "string") {
|
|
689
|
+
const x = L.trim();
|
|
690
690
|
return x ? { label: x, kind: null } : null;
|
|
691
691
|
}
|
|
692
|
-
if (
|
|
693
|
-
const x =
|
|
692
|
+
if (L && typeof L == "object" && typeof L.label == "string") {
|
|
693
|
+
const x = L.label.trim();
|
|
694
694
|
if (!x) return null;
|
|
695
|
-
const
|
|
696
|
-
return { label: x, kind:
|
|
695
|
+
const De = L.kind === "cta" || L.kind === "choice" || L.kind === "followup" ? L.kind : null;
|
|
696
|
+
return { label: x, kind: De };
|
|
697
697
|
}
|
|
698
698
|
return null;
|
|
699
699
|
}).filter(Boolean).slice(0, 4) : [];
|
|
700
700
|
}
|
|
701
701
|
return [];
|
|
702
702
|
}
|
|
703
|
-
function
|
|
704
|
-
var
|
|
705
|
-
const
|
|
703
|
+
function V(h, m) {
|
|
704
|
+
var g;
|
|
705
|
+
const _ = t.messagesByConv[h] || [];
|
|
706
706
|
let d = -1;
|
|
707
|
-
m != null && m.client_msg_id && (d =
|
|
707
|
+
m != null && m.client_msg_id && (d = _.findIndex(
|
|
708
708
|
(b) => (b == null ? void 0 : b.client_msg_id) && b.client_msg_id === m.client_msg_id
|
|
709
|
-
)), d === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (d =
|
|
709
|
+
)), d === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (d = _.findIndex((b) => ne(b == null ? void 0 : b.id, m.id)));
|
|
710
710
|
let f;
|
|
711
|
-
d === -1 ? f = [...
|
|
712
|
-
...
|
|
711
|
+
d === -1 ? f = [..._, m].sort(ce) : (f = _.slice(), f[d] = {
|
|
712
|
+
..._[d],
|
|
713
713
|
...m,
|
|
714
714
|
_pending: !1,
|
|
715
715
|
_failed: !1
|
|
716
|
-
}), t.messagesByConv[h] = f, (m == null ? void 0 : m.type) === "action" && ((
|
|
716
|
+
}), t.messagesByConv[h] = f, (m == null ? void 0 : m.type) === "action" && ((g = m == null ? void 0 : m.payload) != null && g.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && t.awaitingCallback[m.id] && delete t.awaitingCallback[m.id];
|
|
717
717
|
}
|
|
718
718
|
function ne(h, m) {
|
|
719
719
|
return h === m ? !0 : h == null || m == null ? !1 : String(h) === String(m);
|
|
720
720
|
}
|
|
721
|
-
function J(h, m,
|
|
721
|
+
function J(h, m, _) {
|
|
722
722
|
const d = t.messagesByConv[h];
|
|
723
723
|
if (!d) return;
|
|
724
724
|
const f = d.findIndex((b) => b.id === m);
|
|
725
725
|
if (f === -1) return;
|
|
726
|
-
const
|
|
727
|
-
|
|
726
|
+
const g = d.slice();
|
|
727
|
+
g[f] = { ...d[f], ..._ }, t.messagesByConv[h] = g;
|
|
728
728
|
}
|
|
729
729
|
function se(h, m) {
|
|
730
|
-
const
|
|
731
|
-
if (
|
|
732
|
-
const d = t.conversations[
|
|
730
|
+
const _ = t.conversations.findIndex((f) => f.id === h);
|
|
731
|
+
if (_ === -1) return;
|
|
732
|
+
const d = t.conversations[_];
|
|
733
733
|
if (m && (!d.last_message_at || m > d.last_message_at)) {
|
|
734
734
|
const f = t.conversations.slice();
|
|
735
|
-
f[
|
|
736
|
-
(
|
|
735
|
+
f[_] = { ...d, last_message_at: m }, f.sort(
|
|
736
|
+
(g, b) => (b.last_message_at || "").localeCompare(g.last_message_at || "")
|
|
737
737
|
), t.conversations = f;
|
|
738
738
|
}
|
|
739
739
|
}
|
|
@@ -742,18 +742,18 @@ function Qe(e) {
|
|
|
742
742
|
}
|
|
743
743
|
function me(h) {
|
|
744
744
|
if (!h || typeof h != "object") return null;
|
|
745
|
-
const m = {},
|
|
745
|
+
const m = {}, _ = {};
|
|
746
746
|
for (const [d, f] of Object.entries(h))
|
|
747
|
-
f !== void 0 && (d === "name" || d === "email" || d === "language" ? f != null && String(f).trim() !== "" && (m[d] = f) : (d === "values" || d === "metadata") && f && typeof f == "object" ? Object.assign(
|
|
748
|
-
return Object.keys(
|
|
747
|
+
f !== void 0 && (d === "name" || d === "email" || d === "language" ? f != null && String(f).trim() !== "" && (m[d] = f) : (d === "values" || d === "metadata") && f && typeof f == "object" ? Object.assign(_, f) : _[d] = f);
|
|
748
|
+
return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
|
|
749
749
|
}
|
|
750
750
|
function de(h) {
|
|
751
751
|
const m = t.messagesByConv[h] || [];
|
|
752
|
-
let
|
|
753
|
-
for (const
|
|
754
|
-
|
|
752
|
+
let _ = "";
|
|
753
|
+
for (const g of m)
|
|
754
|
+
g != null && g.created_at && g.created_at > _ && (_ = g.created_at);
|
|
755
755
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
756
|
-
return !
|
|
756
|
+
return !_ || d > _ ? d : new Date(Date.parse(_) + 1).toISOString();
|
|
757
757
|
}
|
|
758
758
|
return {
|
|
759
759
|
state: t,
|
|
@@ -763,13 +763,13 @@ function Qe(e) {
|
|
|
763
763
|
createConversation: a,
|
|
764
764
|
openConversation: p,
|
|
765
765
|
loadMore: k,
|
|
766
|
-
fetchSinceLast:
|
|
766
|
+
fetchSinceLast: B,
|
|
767
767
|
patchConversation: T,
|
|
768
768
|
markConversationRead: A,
|
|
769
769
|
send: H,
|
|
770
770
|
clickCallback: S,
|
|
771
|
-
signAttachment:
|
|
772
|
-
submitFeedback:
|
|
771
|
+
signAttachment: I,
|
|
772
|
+
submitFeedback: q,
|
|
773
773
|
getPendingApproval: Y,
|
|
774
774
|
getActionInFlight: ee,
|
|
775
775
|
getLatestSuggestions: te,
|
|
@@ -794,7 +794,7 @@ const j = {
|
|
|
794
794
|
green: "#22C55E",
|
|
795
795
|
red: "#B91C1C",
|
|
796
796
|
redBg: "#FDECEC"
|
|
797
|
-
},
|
|
797
|
+
}, _e = [
|
|
798
798
|
"#5B5FEF",
|
|
799
799
|
"#7C3AED",
|
|
800
800
|
"#DB2777",
|
|
@@ -802,16 +802,16 @@ const j = {
|
|
|
802
802
|
"#D97706",
|
|
803
803
|
"#059669"
|
|
804
804
|
];
|
|
805
|
-
function ye(e = "") {
|
|
806
|
-
return e ? ge[e.charCodeAt(0) % ge.length] : ge[0];
|
|
807
|
-
}
|
|
808
805
|
function we(e = "") {
|
|
806
|
+
return e ? _e[e.charCodeAt(0) % _e.length] : _e[0];
|
|
807
|
+
}
|
|
808
|
+
function be(e = "") {
|
|
809
809
|
return e.split(" ").map((t) => t[0] || "").join("").toUpperCase().slice(0, 2);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function ve(e = /* @__PURE__ */ new Date(), t = "fr-FR") {
|
|
812
812
|
return e.toLocaleTimeString(t, { hour: "2-digit", minute: "2-digit" });
|
|
813
813
|
}
|
|
814
|
-
const
|
|
814
|
+
const Ze = `
|
|
815
815
|
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
|
|
816
816
|
|
|
817
817
|
.wm-root {
|
|
@@ -857,7 +857,7 @@ const Xe = `
|
|
|
857
857
|
0% { transform: translateX(110%); opacity: 0; }
|
|
858
858
|
100% { transform: translateX(0); opacity: 1; }
|
|
859
859
|
}
|
|
860
|
-
`,
|
|
860
|
+
`, et = "https://api.messenger.victorc.fr", ae = "fr", tt = ["fr", "en"], Te = { fr: "fr-FR", en: "en-US" }, ge = {
|
|
861
861
|
fr: {
|
|
862
862
|
// ── Common ───────────────────────────────────────────────────────
|
|
863
863
|
"common.newConversation": "Nouvelle conversation",
|
|
@@ -905,6 +905,7 @@ Je réponds en quelques secondes.`,
|
|
|
905
905
|
"onboarding.newMessage": "Nouveau message",
|
|
906
906
|
"onboarding.statusInProgress": "En cours",
|
|
907
907
|
"onboarding.resume": "Reprendre",
|
|
908
|
+
"onboarding.unreadConversations": "Conversations non lues",
|
|
908
909
|
// ── Composer ─────────────────────────────────────────────────────
|
|
909
910
|
"composer.placeholder": "Écrivez votre message…",
|
|
910
911
|
"composer.replyTo": "Répondre à {name}…",
|
|
@@ -1028,6 +1029,7 @@ I reply within seconds.`,
|
|
|
1028
1029
|
"onboarding.newMessage": "New message",
|
|
1029
1030
|
"onboarding.statusInProgress": "In progress",
|
|
1030
1031
|
"onboarding.resume": "Resume",
|
|
1032
|
+
"onboarding.unreadConversations": "Unread conversations",
|
|
1031
1033
|
// ── Composer ─────────────────────────────────────────────────────
|
|
1032
1034
|
"composer.placeholder": "Type your message…",
|
|
1033
1035
|
"composer.replyTo": "Reply to {name}…",
|
|
@@ -1105,16 +1107,16 @@ I reply within seconds.`,
|
|
|
1105
1107
|
"export.createdOn": "Created on: {date}"
|
|
1106
1108
|
}
|
|
1107
1109
|
};
|
|
1108
|
-
function
|
|
1110
|
+
function ke(e) {
|
|
1109
1111
|
if (typeof e != "string") return ae;
|
|
1110
1112
|
const t = e.trim().toLowerCase().slice(0, 2);
|
|
1111
|
-
return
|
|
1113
|
+
return tt.includes(t) ? t : ae;
|
|
1112
1114
|
}
|
|
1113
1115
|
function re(e) {
|
|
1114
|
-
return
|
|
1116
|
+
return Te[ke(e)] || Te[ae];
|
|
1115
1117
|
}
|
|
1116
1118
|
function D(e) {
|
|
1117
|
-
const t =
|
|
1119
|
+
const t = ke(e), n = ge[t] || ge[ae], i = ge[ae];
|
|
1118
1120
|
return function(s, a) {
|
|
1119
1121
|
let l = n[s];
|
|
1120
1122
|
return l == null && (l = i[s]), l == null ? s : (a && (l = l.replace(
|
|
@@ -1123,22 +1125,22 @@ function D(e) {
|
|
|
1123
1125
|
)), l);
|
|
1124
1126
|
};
|
|
1125
1127
|
}
|
|
1126
|
-
function
|
|
1128
|
+
function xe(e, t) {
|
|
1127
1129
|
if (!Array.isArray(e == null ? void 0 : e.options)) return t;
|
|
1128
1130
|
const n = e.options.find((i) => (i == null ? void 0 : i.value) === t);
|
|
1129
1131
|
return (n == null ? void 0 : n.label) || t;
|
|
1130
1132
|
}
|
|
1131
|
-
function
|
|
1132
|
-
return Array.isArray(t) ? t.map((i) =>
|
|
1133
|
+
function Pe(e, t, n) {
|
|
1134
|
+
return Array.isArray(t) ? t.map((i) => xe(e, String(i))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : xe(e, String(t));
|
|
1133
1135
|
}
|
|
1134
|
-
function
|
|
1136
|
+
function nt(e, t, n = D()) {
|
|
1135
1137
|
if (!e || !t) return "";
|
|
1136
1138
|
const i = Array.isArray(e.fields) ? e.fields : [], r = [];
|
|
1137
1139
|
for (const s of i) {
|
|
1138
1140
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
1139
1141
|
const a = t[s.key];
|
|
1140
1142
|
if (a == null || a === "") continue;
|
|
1141
|
-
const l =
|
|
1143
|
+
const l = Pe(s, a, n);
|
|
1142
1144
|
l && r.push(`${s.label} :
|
|
1143
1145
|
${l}`);
|
|
1144
1146
|
}
|
|
@@ -1146,13 +1148,13 @@ ${l}`);
|
|
|
1146
1148
|
|
|
1147
1149
|
`);
|
|
1148
1150
|
}
|
|
1149
|
-
function
|
|
1151
|
+
function st(e, t, n = D()) {
|
|
1150
1152
|
const i = [], r = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
1151
1153
|
for (const s of r) {
|
|
1152
1154
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
1153
1155
|
const a = t == null ? void 0 : t[s.key];
|
|
1154
1156
|
if (a == null || a === "") continue;
|
|
1155
|
-
const l =
|
|
1157
|
+
const l = Pe(s, a, n);
|
|
1156
1158
|
if (!l) continue;
|
|
1157
1159
|
const p = s.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
|
|
1158
1160
|
`));
|
|
@@ -1176,13 +1178,13 @@ function W(e) {
|
|
|
1176
1178
|
const t = typeof e == "number" ? e : Number(e);
|
|
1177
1179
|
return Number.isFinite(t) ? t : null;
|
|
1178
1180
|
}
|
|
1179
|
-
function
|
|
1181
|
+
function Oe(e, t) {
|
|
1180
1182
|
let n = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
|
|
1181
1183
|
for (const i of t)
|
|
1182
1184
|
i != null && i.created_at && i.created_at > n && (n = i.created_at);
|
|
1183
1185
|
return n;
|
|
1184
1186
|
}
|
|
1185
|
-
function
|
|
1187
|
+
function rt(e, t) {
|
|
1186
1188
|
var n, i, r;
|
|
1187
1189
|
for (let s = t.length - 1; s >= 0; s--) {
|
|
1188
1190
|
const a = t[s];
|
|
@@ -1195,10 +1197,10 @@ function st(e, t) {
|
|
|
1195
1197
|
}
|
|
1196
1198
|
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) || "";
|
|
1197
1199
|
}
|
|
1198
|
-
function
|
|
1200
|
+
function it(e, t) {
|
|
1199
1201
|
return (e == null ? void 0 : e.name) || ((e == null ? void 0 : e.type) === "user" ? t("common.you") : (e == null ? void 0 : e.type) === "agent_human" ? t("common.agent") : (e == null ? void 0 : e.type) === "agent_ia" ? t("common.aiAssistant") : t("common.system"));
|
|
1200
1202
|
}
|
|
1201
|
-
function
|
|
1203
|
+
function at(e, t, n, i) {
|
|
1202
1204
|
const r = [
|
|
1203
1205
|
`# ${e.name || n("common.conversation")}`,
|
|
1204
1206
|
e.created_at ? n("export.createdOn", {
|
|
@@ -1210,15 +1212,15 @@ function it(e, t, n, i) {
|
|
|
1210
1212
|
if (!s) continue;
|
|
1211
1213
|
const a = (s.text_md || "").trim();
|
|
1212
1214
|
if (!a) continue;
|
|
1213
|
-
const l =
|
|
1215
|
+
const l = it(s.author, n), p = s.created_at ? new Date(s.created_at).toLocaleString(i) : "";
|
|
1214
1216
|
r.push(`[${p}] ${l} :`), r.push(a), r.push("");
|
|
1215
1217
|
}
|
|
1216
1218
|
return r.join(`
|
|
1217
1219
|
`);
|
|
1218
1220
|
}
|
|
1219
|
-
function
|
|
1221
|
+
function ot(e, t, n = D(), i) {
|
|
1220
1222
|
if (!e) return;
|
|
1221
|
-
const r =
|
|
1223
|
+
const r = at(e, t || [], n, re(i)), s = new Blob([r], { type: "text/plain;charset=utf-8" });
|
|
1222
1224
|
try {
|
|
1223
1225
|
const a = URL.createObjectURL(s), l = document.createElement("a");
|
|
1224
1226
|
l.href = a, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(a), 1e3);
|
|
@@ -1226,7 +1228,7 @@ function at(e, t, n = D(), i) {
|
|
|
1226
1228
|
console.error("[ww-messenger] export failed", a);
|
|
1227
1229
|
}
|
|
1228
1230
|
}
|
|
1229
|
-
const
|
|
1231
|
+
const lt = {
|
|
1230
1232
|
data() {
|
|
1231
1233
|
const e = typeof Notification < "u";
|
|
1232
1234
|
return {
|
|
@@ -1384,7 +1386,7 @@ const ot = {
|
|
|
1384
1386
|
}
|
|
1385
1387
|
}
|
|
1386
1388
|
}
|
|
1387
|
-
},
|
|
1389
|
+
}, ct = 450, dt = 50, ut = 900, ht = 12e3, mt = 300, ft = {
|
|
1388
1390
|
data() {
|
|
1389
1391
|
return {
|
|
1390
1392
|
// Map: messageId → ms timestamp once shown.
|
|
@@ -1493,11 +1495,11 @@ const ot = {
|
|
|
1493
1495
|
// bounded by MIN/MAX_TYPING_MS.
|
|
1494
1496
|
scheduleReveal(e, t) {
|
|
1495
1497
|
const n = Date.now(), i = ((e == null ? void 0 : e.text_md) || "").length, r = Math.min(
|
|
1496
|
-
|
|
1497
|
-
Math.max(
|
|
1498
|
+
ht,
|
|
1499
|
+
Math.max(ut, i * dt)
|
|
1498
1500
|
), a = Math.max(
|
|
1499
|
-
n +
|
|
1500
|
-
this.nextRevealAt +
|
|
1501
|
+
n + ct,
|
|
1502
|
+
this.nextRevealAt + mt
|
|
1501
1503
|
) + r;
|
|
1502
1504
|
this.nextRevealAt = a;
|
|
1503
1505
|
const l = Math.max(0, a - n), p = e.id, k = setTimeout(() => {
|
|
@@ -1559,7 +1561,7 @@ const ot = {
|
|
|
1559
1561
|
this.revealedAt = { ...this.revealedAt, [e.id]: 0 }, this.scheduleReveal(e, t);
|
|
1560
1562
|
}
|
|
1561
1563
|
}
|
|
1562
|
-
},
|
|
1564
|
+
}, _t = {
|
|
1563
1565
|
data() {
|
|
1564
1566
|
return {
|
|
1565
1567
|
approvalSettled: !0,
|
|
@@ -1589,7 +1591,7 @@ const ot = {
|
|
|
1589
1591
|
}, e);
|
|
1590
1592
|
}
|
|
1591
1593
|
}
|
|
1592
|
-
}, gt = 300,
|
|
1594
|
+
}, gt = 300, pt = {
|
|
1593
1595
|
data() {
|
|
1594
1596
|
return {
|
|
1595
1597
|
// Numeric message id snapshot frozen the moment the user
|
|
@@ -1620,7 +1622,7 @@ const ot = {
|
|
|
1620
1622
|
markConvRead(e) {
|
|
1621
1623
|
var s, a;
|
|
1622
1624
|
if (!(e != null && e.id) || e._draft || !this.store) return;
|
|
1623
|
-
const t = ((a = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : a[e.id]) || [], n =
|
|
1625
|
+
const t = ((a = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : a[e.id]) || [], n = vt(t);
|
|
1624
1626
|
if (n == null) return;
|
|
1625
1627
|
const i = W(e.last_read_message_id), r = W(n);
|
|
1626
1628
|
r != null && (i != null && r <= i || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
|
|
@@ -1633,7 +1635,7 @@ const ot = {
|
|
|
1633
1635
|
}
|
|
1634
1636
|
}
|
|
1635
1637
|
};
|
|
1636
|
-
function
|
|
1638
|
+
function vt(e) {
|
|
1637
1639
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
1638
1640
|
const n = e[t];
|
|
1639
1641
|
if (!(!n || n._pending) && W(n.id) != null)
|
|
@@ -1646,7 +1648,7 @@ const N = (e, t) => {
|
|
|
1646
1648
|
for (const [i, r] of t)
|
|
1647
1649
|
n[i] = r;
|
|
1648
1650
|
return n;
|
|
1649
|
-
},
|
|
1651
|
+
}, yt = {
|
|
1650
1652
|
name: "WmHumanAvatar",
|
|
1651
1653
|
props: {
|
|
1652
1654
|
name: { type: String, default: "" },
|
|
@@ -1660,17 +1662,17 @@ const N = (e, t) => {
|
|
|
1660
1662
|
},
|
|
1661
1663
|
computed: {
|
|
1662
1664
|
bg() {
|
|
1663
|
-
return this.avatarUrl ? "transparent" :
|
|
1665
|
+
return this.avatarUrl ? "transparent" : we(this.name);
|
|
1664
1666
|
},
|
|
1665
1667
|
initials() {
|
|
1666
|
-
return
|
|
1668
|
+
return be(this.name);
|
|
1667
1669
|
}
|
|
1668
1670
|
}
|
|
1669
|
-
},
|
|
1670
|
-
function
|
|
1671
|
+
}, wt = ["src", "alt"];
|
|
1672
|
+
function bt(e, t, n, i, r, s) {
|
|
1671
1673
|
return c(), u("div", {
|
|
1672
1674
|
class: O(["wm-huav", { "wm-huav--tail": n.tail }]),
|
|
1673
|
-
style:
|
|
1675
|
+
style: z({
|
|
1674
1676
|
width: n.size + "px",
|
|
1675
1677
|
height: n.size + "px",
|
|
1676
1678
|
"--wm-avr": Math.round(n.size * 0.32) + "px",
|
|
@@ -1681,15 +1683,15 @@ function wt(e, t, n, i, r, s) {
|
|
|
1681
1683
|
key: 0,
|
|
1682
1684
|
src: n.avatarUrl,
|
|
1683
1685
|
alt: n.name || ""
|
|
1684
|
-
}, null, 8,
|
|
1686
|
+
}, null, 8, wt)) : (c(), u("span", {
|
|
1685
1687
|
key: 1,
|
|
1686
|
-
style:
|
|
1688
|
+
style: z({ fontSize: n.size * 0.36 + "px" })
|
|
1687
1689
|
}, v(s.initials), 5))
|
|
1688
1690
|
], 6);
|
|
1689
1691
|
}
|
|
1690
|
-
const
|
|
1692
|
+
const Ce = /* @__PURE__ */ N(yt, [["render", bt], ["__scopeId", "data-v-14e10c0d"]]), kt = 3, Ct = {
|
|
1691
1693
|
name: "WmLauncher",
|
|
1692
|
-
components: { HumanAvatar:
|
|
1694
|
+
components: { HumanAvatar: Ce },
|
|
1693
1695
|
inject: {
|
|
1694
1696
|
// Translator shared by the Messenger shell; French fallback when
|
|
1695
1697
|
// the component is used standalone.
|
|
@@ -1710,11 +1712,11 @@ const Re = /* @__PURE__ */ N(vt, [["render", wt], ["__scopeId", "data-v-14e10c0d
|
|
|
1710
1712
|
// élément en ordre DOM avec un flex column normal). Les plus
|
|
1711
1713
|
// anciens remontent dans la pile.
|
|
1712
1714
|
visiblePeeks() {
|
|
1713
|
-
return this.peeks.slice(0,
|
|
1715
|
+
return this.peeks.slice(0, kt).reverse();
|
|
1714
1716
|
}
|
|
1715
1717
|
}
|
|
1716
|
-
},
|
|
1717
|
-
function
|
|
1718
|
+
}, 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" }, Et = { class: "wm-peek__text" }, Bt = ["onClick"], Rt = ["aria-label"], Nt = ["aria-label"];
|
|
1719
|
+
function Pt(e, t, n, i, r, s) {
|
|
1718
1720
|
const a = R("HumanAvatar");
|
|
1719
1721
|
return c(), u("div", {
|
|
1720
1722
|
class: "wm-launcherWrap",
|
|
@@ -1723,16 +1725,16 @@ function Nt(e, t, n, i, r, s) {
|
|
|
1723
1725
|
onFocusin: t[3] || (t[3] = (l) => e.$emit("hover", !0)),
|
|
1724
1726
|
onFocusout: t[4] || (t[4] = (l) => e.$emit("hover", !1))
|
|
1725
1727
|
}, [
|
|
1726
|
-
|
|
1727
|
-
default:
|
|
1728
|
+
K(Re, { name: "wm-peek" }, {
|
|
1729
|
+
default: Ne(() => [
|
|
1728
1730
|
s.visiblePeeks.length ? (c(), u("div", {
|
|
1729
1731
|
key: 0,
|
|
1730
1732
|
class: O(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
|
|
1731
1733
|
}, [
|
|
1732
|
-
(c(!0), u(
|
|
1734
|
+
(c(!0), u(E, null, F(s.visiblePeeks, (l, p) => (c(), u("div", {
|
|
1733
1735
|
key: l.convId,
|
|
1734
1736
|
class: "wm-peek",
|
|
1735
|
-
style:
|
|
1737
|
+
style: z({
|
|
1736
1738
|
"--depth": s.visiblePeeks.length - 1 - p,
|
|
1737
1739
|
zIndex: p + 1
|
|
1738
1740
|
}),
|
|
@@ -1766,9 +1768,9 @@ function Nt(e, t, n, i, r, s) {
|
|
|
1766
1768
|
}, [
|
|
1767
1769
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
1768
1770
|
], -1)
|
|
1769
|
-
])], 8,
|
|
1770
|
-
o("div",
|
|
1771
|
-
|
|
1771
|
+
])], 8, St),
|
|
1772
|
+
o("div", Mt, [
|
|
1773
|
+
K(a, {
|
|
1772
1774
|
name: l.senderName,
|
|
1773
1775
|
"avatar-url": l.senderAvatarUrl,
|
|
1774
1776
|
size: 34
|
|
@@ -1777,21 +1779,21 @@ function Nt(e, t, n, i, r, s) {
|
|
|
1777
1779
|
key: 0,
|
|
1778
1780
|
class: "wm-peek__avatarBadge",
|
|
1779
1781
|
"aria-label": s.t("launcher.unreadMessages", { count: l.count })
|
|
1780
|
-
}, v(l.count > 9 ? "9+" : l.count), 9,
|
|
1782
|
+
}, v(l.count > 9 ? "9+" : l.count), 9, Tt)) : y("", !0)
|
|
1781
1783
|
]),
|
|
1782
|
-
o("div",
|
|
1783
|
-
o("div",
|
|
1784
|
-
o("span",
|
|
1784
|
+
o("div", xt, [
|
|
1785
|
+
o("div", Ot, [
|
|
1786
|
+
o("span", It, v(l.senderName || s.t("common.agent")), 1),
|
|
1785
1787
|
o("span", Lt, v(s.t("launcher.repliedToYou")), 1)
|
|
1786
1788
|
]),
|
|
1787
|
-
o("p",
|
|
1789
|
+
o("p", Et, v(l.preview), 1)
|
|
1788
1790
|
]),
|
|
1789
1791
|
o("button", {
|
|
1790
1792
|
type: "button",
|
|
1791
1793
|
class: "wm-peek__open",
|
|
1792
1794
|
onClick: G((k) => e.$emit("open", l.convId), ["stop"])
|
|
1793
|
-
}, v(s.t("common.open")), 9,
|
|
1794
|
-
], 44,
|
|
1795
|
+
}, v(s.t("common.open")), 9, Bt)
|
|
1796
|
+
], 44, At))), 128))
|
|
1795
1797
|
], 2)) : y("", !0)
|
|
1796
1798
|
]),
|
|
1797
1799
|
_: 1
|
|
@@ -1823,11 +1825,11 @@ function Nt(e, t, n, i, r, s) {
|
|
|
1823
1825
|
}) : s.t("launcher.unreadConversationsOne", {
|
|
1824
1826
|
count: n.unreadCount
|
|
1825
1827
|
})
|
|
1826
|
-
}, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9,
|
|
1827
|
-
], 8,
|
|
1828
|
+
}, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Nt)) : y("", !0)
|
|
1829
|
+
], 8, Rt)
|
|
1828
1830
|
], 32);
|
|
1829
1831
|
}
|
|
1830
|
-
const
|
|
1832
|
+
const Ut = /* @__PURE__ */ N(Ct, [["render", Pt], ["__scopeId", "data-v-44ddf1a1"]]), Ft = {
|
|
1831
1833
|
name: "WmAIAvatar",
|
|
1832
1834
|
props: {
|
|
1833
1835
|
size: { type: Number, default: 26 },
|
|
@@ -1850,33 +1852,33 @@ const Pt = /* @__PURE__ */ N(kt, [["render", Nt], ["__scopeId", "data-v-44ddf1a1
|
|
|
1850
1852
|
},
|
|
1851
1853
|
computed: {
|
|
1852
1854
|
initials() {
|
|
1853
|
-
return
|
|
1855
|
+
return be(this.name);
|
|
1854
1856
|
},
|
|
1855
1857
|
bgColor() {
|
|
1856
|
-
return
|
|
1858
|
+
return we(this.name);
|
|
1857
1859
|
}
|
|
1858
1860
|
}
|
|
1859
|
-
},
|
|
1861
|
+
}, Dt = {
|
|
1860
1862
|
key: 0,
|
|
1861
1863
|
class: "wm-aiav__pulse"
|
|
1862
|
-
},
|
|
1863
|
-
function
|
|
1864
|
+
}, jt = ["src", "alt"], Ht = ["width", "height"];
|
|
1865
|
+
function zt(e, t, n, i, r, s) {
|
|
1864
1866
|
return c(), u("div", {
|
|
1865
1867
|
class: O(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
1866
|
-
style:
|
|
1868
|
+
style: z({
|
|
1867
1869
|
width: n.size + "px",
|
|
1868
1870
|
height: n.size + "px",
|
|
1869
1871
|
"--wm-avr": n.size * 0.32 + "px"
|
|
1870
1872
|
})
|
|
1871
1873
|
}, [
|
|
1872
|
-
n.pulse ? (c(), u("div",
|
|
1874
|
+
n.pulse ? (c(), u("div", Dt)) : y("", !0),
|
|
1873
1875
|
o("div", {
|
|
1874
1876
|
class: O(["wm-aiav__inner", {
|
|
1875
1877
|
"wm-aiav__inner--glow": n.pulse,
|
|
1876
1878
|
"wm-aiav__inner--img": !!n.imageUrl,
|
|
1877
1879
|
"wm-aiav__inner--initials": !n.imageUrl && !!s.initials
|
|
1878
1880
|
}]),
|
|
1879
|
-
style:
|
|
1881
|
+
style: z(
|
|
1880
1882
|
!n.imageUrl && s.initials ? { background: s.bgColor } : null
|
|
1881
1883
|
)
|
|
1882
1884
|
}, [
|
|
@@ -1884,9 +1886,9 @@ function Ht(e, t, n, i, r, s) {
|
|
|
1884
1886
|
key: 0,
|
|
1885
1887
|
src: n.imageUrl,
|
|
1886
1888
|
alt: n.name || ""
|
|
1887
|
-
}, null, 8,
|
|
1889
|
+
}, null, 8, jt)) : s.initials ? (c(), u("span", {
|
|
1888
1890
|
key: 1,
|
|
1889
|
-
style:
|
|
1891
|
+
style: z({ fontSize: n.size * 0.36 + "px" })
|
|
1890
1892
|
}, v(s.initials), 5)) : (c(), u("svg", {
|
|
1891
1893
|
key: 2,
|
|
1892
1894
|
width: n.size * 0.5,
|
|
@@ -1914,11 +1916,11 @@ function Ht(e, t, n, i, r, s) {
|
|
|
1914
1916
|
fill: "white",
|
|
1915
1917
|
opacity: "0.38"
|
|
1916
1918
|
}, null, -1)
|
|
1917
|
-
])], 8,
|
|
1919
|
+
])], 8, Ht))
|
|
1918
1920
|
], 6)
|
|
1919
1921
|
], 6);
|
|
1920
1922
|
}
|
|
1921
|
-
const le = /* @__PURE__ */ N(Ft, [["render",
|
|
1923
|
+
const le = /* @__PURE__ */ N(Ft, [["render", zt], ["__scopeId", "data-v-6f7f685d"]]), qt = {
|
|
1922
1924
|
name: "WmTeamAvatars",
|
|
1923
1925
|
props: {
|
|
1924
1926
|
members: { type: Array, default: () => [] },
|
|
@@ -1934,29 +1936,29 @@ const le = /* @__PURE__ */ N(Ft, [["render", Ht], ["__scopeId", "data-v-6f7f685d
|
|
|
1934
1936
|
},
|
|
1935
1937
|
methods: {
|
|
1936
1938
|
colorFor(e) {
|
|
1937
|
-
return e.avatar_url ? "transparent" :
|
|
1939
|
+
return e.avatar_url ? "transparent" : we(e.name || "");
|
|
1938
1940
|
},
|
|
1939
1941
|
initialsFor(e) {
|
|
1940
|
-
return
|
|
1942
|
+
return be(e.name || "");
|
|
1941
1943
|
}
|
|
1942
1944
|
}
|
|
1943
|
-
},
|
|
1945
|
+
}, Kt = {
|
|
1944
1946
|
key: 0,
|
|
1945
1947
|
class: "wm-team"
|
|
1946
|
-
},
|
|
1948
|
+
}, Vt = ["src", "alt"], $t = { key: 1 }, Wt = {
|
|
1947
1949
|
key: 0,
|
|
1948
1950
|
class: "wm-team__label"
|
|
1949
1951
|
};
|
|
1950
|
-
function
|
|
1951
|
-
return s.visible ? (c(), u("div",
|
|
1952
|
+
function Gt(e, t, n, i, r, s) {
|
|
1953
|
+
return s.visible ? (c(), u("div", Kt, [
|
|
1952
1954
|
o("div", {
|
|
1953
1955
|
class: "wm-team__stack",
|
|
1954
|
-
style:
|
|
1956
|
+
style: z({ width: s.stackWidth + "px" })
|
|
1955
1957
|
}, [
|
|
1956
|
-
(c(!0), u(
|
|
1958
|
+
(c(!0), u(E, null, F(n.members.slice(0, 3), (a, l) => (c(), u("div", {
|
|
1957
1959
|
key: l,
|
|
1958
1960
|
class: "wm-team__pill",
|
|
1959
|
-
style:
|
|
1961
|
+
style: z({
|
|
1960
1962
|
left: l * 13 + "px",
|
|
1961
1963
|
zIndex: 3 - l,
|
|
1962
1964
|
background: s.colorFor(a)
|
|
@@ -1966,15 +1968,15 @@ function Wt(e, t, n, i, r, s) {
|
|
|
1966
1968
|
key: 0,
|
|
1967
1969
|
src: a.avatar_url,
|
|
1968
1970
|
alt: a.name || ""
|
|
1969
|
-
}, null, 8,
|
|
1971
|
+
}, null, 8, Vt)) : (c(), u("span", $t, v(s.initialsFor(a)), 1))
|
|
1970
1972
|
], 4))), 128))
|
|
1971
1973
|
], 4),
|
|
1972
|
-
n.responseLabel ? (c(), u("span",
|
|
1974
|
+
n.responseLabel ? (c(), u("span", Wt, v(n.responseLabel), 1)) : y("", !0)
|
|
1973
1975
|
])) : y("", !0);
|
|
1974
1976
|
}
|
|
1975
|
-
const
|
|
1977
|
+
const Yt = /* @__PURE__ */ N(qt, [["render", Gt], ["__scopeId", "data-v-e49a9063"]]), Jt = {
|
|
1976
1978
|
name: "WmHeader",
|
|
1977
|
-
components: { AIAvatar: le, TeamAvatars:
|
|
1979
|
+
components: { AIAvatar: le, TeamAvatars: Yt },
|
|
1978
1980
|
inject: {
|
|
1979
1981
|
// Translator shared by the Messenger shell. Falls back to a French
|
|
1980
1982
|
// translator when the component is used standalone (no provider).
|
|
@@ -2011,16 +2013,16 @@ const Gt = /* @__PURE__ */ N(zt, [["render", Wt], ["__scopeId", "data-v-e49a9063
|
|
|
2011
2013
|
return n;
|
|
2012
2014
|
}
|
|
2013
2015
|
}
|
|
2014
|
-
},
|
|
2016
|
+
}, Qt = { class: "wm-header" }, Xt = ["aria-label"], Zt = {
|
|
2015
2017
|
key: 1,
|
|
2016
2018
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
2017
|
-
},
|
|
2019
|
+
}, en = { class: "wm-header__avatar" }, tn = { class: "wm-header__main" }, nn = { class: "wm-header__title" }, sn = {
|
|
2018
2020
|
key: 3,
|
|
2019
2021
|
class: "wm-header__fill"
|
|
2020
|
-
},
|
|
2021
|
-
function
|
|
2022
|
+
}, rn = { class: "wm-header__actions" }, an = ["aria-label", "title"], on = ["aria-label", "title"];
|
|
2023
|
+
function ln(e, t, n, i, r, s) {
|
|
2022
2024
|
const a = R("AIAvatar"), l = R("TeamAvatars");
|
|
2023
|
-
return c(), u("div",
|
|
2025
|
+
return c(), u("div", Qt, [
|
|
2024
2026
|
n.showBack ? (c(), u("button", {
|
|
2025
2027
|
key: 0,
|
|
2026
2028
|
type: "button",
|
|
@@ -2041,25 +2043,25 @@ function on(e, t, n, i, r, s) {
|
|
|
2041
2043
|
}, [
|
|
2042
2044
|
o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
2043
2045
|
], -1)
|
|
2044
|
-
])], 8,
|
|
2045
|
-
n.showIdentity ? (c(), u(
|
|
2046
|
-
o("div",
|
|
2047
|
-
|
|
2046
|
+
])], 8, Xt)) : (c(), u("div", Zt)),
|
|
2047
|
+
n.showIdentity ? (c(), u(E, { key: 2 }, [
|
|
2048
|
+
o("div", en, [
|
|
2049
|
+
K(a, {
|
|
2048
2050
|
size: 30,
|
|
2049
2051
|
name: n.agentName,
|
|
2050
2052
|
"image-url": n.agentAvatarUrl
|
|
2051
2053
|
}, null, 8, ["name", "image-url"])
|
|
2052
2054
|
]),
|
|
2053
|
-
o("div",
|
|
2054
|
-
o("div",
|
|
2055
|
+
o("div", tn, [
|
|
2056
|
+
o("div", nn, v(n.title), 1)
|
|
2055
2057
|
]),
|
|
2056
2058
|
s.hasTeam ? (c(), P(l, {
|
|
2057
2059
|
key: 0,
|
|
2058
2060
|
members: s.displayedTeamMembers,
|
|
2059
2061
|
"response-label": ""
|
|
2060
2062
|
}, null, 8, ["members"])) : y("", !0)
|
|
2061
|
-
], 64)) : (c(), u("div",
|
|
2062
|
-
o("div",
|
|
2063
|
+
], 64)) : (c(), u("div", sn)),
|
|
2064
|
+
o("div", rn, [
|
|
2063
2065
|
n.showMore ? (c(), u("button", {
|
|
2064
2066
|
key: 0,
|
|
2065
2067
|
type: "button",
|
|
@@ -2091,7 +2093,7 @@ function on(e, t, n, i, r, s) {
|
|
|
2091
2093
|
r: "1.6"
|
|
2092
2094
|
})
|
|
2093
2095
|
], -1)
|
|
2094
|
-
])], 10,
|
|
2096
|
+
])], 10, an)) : y("", !0),
|
|
2095
2097
|
n.showClose ? (c(), u("button", {
|
|
2096
2098
|
key: 1,
|
|
2097
2099
|
type: "button",
|
|
@@ -2113,34 +2115,34 @@ function on(e, t, n, i, r, s) {
|
|
|
2113
2115
|
}, [
|
|
2114
2116
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
2115
2117
|
], -1)
|
|
2116
|
-
])], 8,
|
|
2118
|
+
])], 8, on)) : y("", !0)
|
|
2117
2119
|
])
|
|
2118
2120
|
]);
|
|
2119
2121
|
}
|
|
2120
|
-
const
|
|
2121
|
-
function
|
|
2122
|
+
const cn = /* @__PURE__ */ N(Jt, [["render", ln], ["__scopeId", "data-v-0da6fbcd"]]);
|
|
2123
|
+
function Ue(e) {
|
|
2122
2124
|
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2123
2125
|
}
|
|
2124
|
-
function
|
|
2126
|
+
function dn(e) {
|
|
2125
2127
|
return /^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim());
|
|
2126
2128
|
}
|
|
2127
|
-
const
|
|
2129
|
+
const Ie = "";
|
|
2128
2130
|
function ie(e) {
|
|
2129
2131
|
let t = e;
|
|
2130
2132
|
const n = [];
|
|
2131
2133
|
return t = t.replace(/`([^`\n]+)`/g, (i, r) => {
|
|
2132
2134
|
const s = n.length;
|
|
2133
|
-
return n.push(r), `${
|
|
2134
|
-
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, r, s) =>
|
|
2135
|
+
return n.push(r), `${Ie}CODE${s}${Ie}`;
|
|
2136
|
+
}), 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;
|
|
2135
2137
|
}
|
|
2136
|
-
function
|
|
2138
|
+
function un(e) {
|
|
2137
2139
|
if (!e) return "";
|
|
2138
2140
|
const t = String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g, "$1");
|
|
2139
|
-
return ie(
|
|
2141
|
+
return ie(Ue(t));
|
|
2140
2142
|
}
|
|
2141
|
-
function
|
|
2143
|
+
function hn(e) {
|
|
2142
2144
|
if (!e) return "";
|
|
2143
|
-
const t =
|
|
2145
|
+
const t = Ue(e).split(`
|
|
2144
2146
|
`), n = [];
|
|
2145
2147
|
let i = 0;
|
|
2146
2148
|
for (; i < t.length; ) {
|
|
@@ -2179,10 +2181,10 @@ function un(e) {
|
|
|
2179
2181
|
if (!A) break;
|
|
2180
2182
|
w.push(A[1]), i++;
|
|
2181
2183
|
}
|
|
2182
|
-
const T = w.map((A) => `<li>${ie(A)}</li>`).join(""),
|
|
2184
|
+
const T = w.map((A) => `<li>${ie(A)}</li>`).join(""), B = k !== 1 ? ` start="${k}"` : "";
|
|
2183
2185
|
n.push({
|
|
2184
2186
|
type: "block",
|
|
2185
|
-
html: `<ol class="wm-md-ol"${
|
|
2187
|
+
html: `<ol class="wm-md-ol"${B}>${T}</ol>`
|
|
2186
2188
|
});
|
|
2187
2189
|
continue;
|
|
2188
2190
|
}
|
|
@@ -2207,15 +2209,15 @@ function un(e) {
|
|
|
2207
2209
|
}
|
|
2208
2210
|
return r;
|
|
2209
2211
|
}
|
|
2210
|
-
const
|
|
2212
|
+
const Le = {
|
|
2211
2213
|
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",
|
|
2212
2214
|
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",
|
|
2213
2215
|
status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
2214
2216
|
chat: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",
|
|
2215
2217
|
link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
|
|
2216
|
-
},
|
|
2218
|
+
}, mn = {
|
|
2217
2219
|
name: "WmOnboarding",
|
|
2218
|
-
components: { AIAvatar: le },
|
|
2220
|
+
components: { AIAvatar: le, HumanAvatar: Ce },
|
|
2219
2221
|
inject: {
|
|
2220
2222
|
// Translator + resolved-language getter shared by the Messenger
|
|
2221
2223
|
// shell. Fall back to French wording when used standalone.
|
|
@@ -2253,14 +2255,37 @@ const xe = {
|
|
|
2253
2255
|
return e ? this.openThreads.filter(
|
|
2254
2256
|
(t) => (t.title || "").toLowerCase().includes(e) || (t.preview || "").toLowerCase().includes(e)
|
|
2255
2257
|
) : this.openThreads;
|
|
2258
|
+
},
|
|
2259
|
+
unreadThreads() {
|
|
2260
|
+
return this.openThreads.filter((e) => e.unread);
|
|
2256
2261
|
}
|
|
2257
2262
|
},
|
|
2258
2263
|
methods: {
|
|
2259
2264
|
iconPath(e) {
|
|
2260
|
-
return
|
|
2265
|
+
return Le[e] || Le.link;
|
|
2261
2266
|
},
|
|
2262
2267
|
renderPreview(e) {
|
|
2263
|
-
return
|
|
2268
|
+
return un(e);
|
|
2269
|
+
},
|
|
2270
|
+
// Pick the avatar component for a thread row based on the last
|
|
2271
|
+
// sender's type. Human agents get HumanAvatar (initials on a
|
|
2272
|
+
// deterministic colour, or their photo) ; AI agents and unknown /
|
|
2273
|
+
// user-authored cases fall back to the widget's own AI avatar.
|
|
2274
|
+
avatarComponent(e) {
|
|
2275
|
+
var t;
|
|
2276
|
+
return ((t = e == null ? void 0 : e.author) == null ? void 0 : t.type) === "agent_human" ? "HumanAvatar" : "AIAvatar";
|
|
2277
|
+
},
|
|
2278
|
+
avatarProps(e) {
|
|
2279
|
+
const t = e == null ? void 0 : e.author;
|
|
2280
|
+
return (t == null ? void 0 : t.type) === "agent_human" ? {
|
|
2281
|
+
size: 40,
|
|
2282
|
+
name: t.name || "",
|
|
2283
|
+
avatarUrl: t.avatar_url || null
|
|
2284
|
+
} : {
|
|
2285
|
+
size: 40,
|
|
2286
|
+
name: (t == null ? void 0 : t.name) || this.agentName,
|
|
2287
|
+
imageUrl: (t == null ? void 0 : t.avatar_url) || this.defaultIconUrl
|
|
2288
|
+
};
|
|
2264
2289
|
},
|
|
2265
2290
|
formatTs(e) {
|
|
2266
2291
|
if (!e) return "";
|
|
@@ -2282,10 +2307,10 @@ const xe = {
|
|
|
2282
2307
|
});
|
|
2283
2308
|
}
|
|
2284
2309
|
}
|
|
2285
|
-
},
|
|
2310
|
+
}, fn = { class: "wm-onb" }, _n = { class: "wm-onb__hero" }, gn = { class: "wm-onb__hero-text" }, pn = { class: "wm-onb__title" }, vn = { class: "wm-onb__sub" }, yn = { class: "wm-onb__cta" }, wn = ["disabled"], bn = {
|
|
2286
2311
|
key: 0,
|
|
2287
2312
|
class: "wm-onb__section wm-onb__section--card"
|
|
2288
|
-
},
|
|
2313
|
+
}, kn = { class: "wm-onb__section-title" }, Cn = ["onClick"], An = { class: "wm-onb__card-icon" }, Sn = {
|
|
2289
2314
|
width: "16",
|
|
2290
2315
|
height: "16",
|
|
2291
2316
|
viewBox: "0 0 24 24",
|
|
@@ -2295,26 +2320,29 @@ const xe = {
|
|
|
2295
2320
|
"stroke-linecap": "round",
|
|
2296
2321
|
"stroke-linejoin": "round",
|
|
2297
2322
|
"aria-hidden": "true"
|
|
2298
|
-
},
|
|
2323
|
+
}, Mn = ["d"], Tn = { class: "wm-onb__card-body" }, xn = { class: "wm-onb__card-title" }, On = {
|
|
2299
2324
|
key: 0,
|
|
2300
2325
|
class: "wm-onb__card-sub"
|
|
2301
|
-
},
|
|
2326
|
+
}, In = {
|
|
2302
2327
|
key: 1,
|
|
2303
2328
|
class: "wm-onb__section wm-onb__section--card"
|
|
2304
|
-
}, Ln = { class: "wm-onb__section-title" },
|
|
2329
|
+
}, Ln = { class: "wm-onb__section-title" }, En = { class: "wm-onb__alertList" }, Bn = ["onClick"], Rn = { class: "wm-onb__alert-avatar" }, Nn = ["aria-label"], Pn = { class: "wm-onb__alert-body" }, Un = { class: "wm-onb__alert-title" }, Fn = ["innerHTML"], Dn = { class: "wm-onb__alert-meta" }, jn = {
|
|
2330
|
+
key: 0,
|
|
2331
|
+
class: "wm-onb__alert-time"
|
|
2332
|
+
}, Hn = { class: "wm-onb__alert-resume" }, zn = {
|
|
2333
|
+
key: 2,
|
|
2334
|
+
class: "wm-onb__section wm-onb__section--card"
|
|
2335
|
+
}, qn = { class: "wm-onb__section-title" }, Kn = { class: "wm-onb__search" }, Vn = ["placeholder", "aria-label"], $n = { class: "wm-onb__list" }, Wn = ["onClick"], Gn = { class: "wm-onb__thread-avatar" }, Yn = ["aria-label"], Jn = { class: "wm-onb__thread-body" }, Qn = { class: "wm-onb__thread-title" }, Xn = ["innerHTML"], Zn = { class: "wm-onb__thread-meta" }, es = {
|
|
2305
2336
|
key: 0,
|
|
2306
|
-
class: "wm-onb__thread-statusSep"
|
|
2307
|
-
}, Un = {
|
|
2308
|
-
key: 1,
|
|
2309
2337
|
class: "wm-onb__thread-time"
|
|
2310
|
-
},
|
|
2338
|
+
}, ts = {
|
|
2311
2339
|
key: 0,
|
|
2312
2340
|
class: "wm-onb__empty"
|
|
2313
2341
|
};
|
|
2314
|
-
function
|
|
2342
|
+
function ns(e, t, n, i, r, s) {
|
|
2315
2343
|
const a = R("AIAvatar");
|
|
2316
|
-
return c(), u("div",
|
|
2317
|
-
o("div",
|
|
2344
|
+
return c(), u("div", fn, [
|
|
2345
|
+
o("div", _n, [
|
|
2318
2346
|
t[2] || (t[2] = o("svg", {
|
|
2319
2347
|
class: "wm-onb__hero-deco",
|
|
2320
2348
|
width: "180",
|
|
@@ -2349,16 +2377,16 @@ function qn(e, t, n, i, r, s) {
|
|
|
2349
2377
|
opacity: "0.65"
|
|
2350
2378
|
})
|
|
2351
2379
|
], -1)),
|
|
2352
|
-
|
|
2380
|
+
K(a, {
|
|
2353
2381
|
size: 52,
|
|
2354
2382
|
"image-url": n.defaultIconUrl
|
|
2355
2383
|
}, null, 8, ["image-url"]),
|
|
2356
2384
|
o("div", gn, [
|
|
2357
|
-
o("div",
|
|
2358
|
-
o("div",
|
|
2385
|
+
o("div", pn, v(s.heroTitle), 1),
|
|
2386
|
+
o("div", vn, v(s.heroSub), 1)
|
|
2359
2387
|
])
|
|
2360
2388
|
]),
|
|
2361
|
-
o("div",
|
|
2389
|
+
o("div", yn, [
|
|
2362
2390
|
o("button", {
|
|
2363
2391
|
type: "button",
|
|
2364
2392
|
class: "wm-onb__startBtn",
|
|
@@ -2381,36 +2409,66 @@ function qn(e, t, n, i, r, s) {
|
|
|
2381
2409
|
])
|
|
2382
2410
|
], -1)),
|
|
2383
2411
|
o("span", null, v(n.busy ? "…" : s.t("onboarding.start")), 1)
|
|
2384
|
-
], 8,
|
|
2412
|
+
], 8, wn)
|
|
2385
2413
|
]),
|
|
2386
|
-
n.quickLinks.length ? (c(), u("div",
|
|
2387
|
-
o("div",
|
|
2414
|
+
n.quickLinks.length ? (c(), u("div", bn, [
|
|
2415
|
+
o("div", kn, v(s.t("onboarding.quickAccess")), 1),
|
|
2388
2416
|
o("div", {
|
|
2389
2417
|
class: O(s.quickLinksLayout)
|
|
2390
2418
|
}, [
|
|
2391
|
-
(c(!0), u(
|
|
2419
|
+
(c(!0), u(E, null, F(n.quickLinks, (l, p) => (c(), u("button", {
|
|
2392
2420
|
key: p,
|
|
2393
2421
|
type: "button",
|
|
2394
2422
|
class: O(["wm-onb__card", { "wm-onb__card--row": s.isOddQuickLinks }]),
|
|
2395
2423
|
onClick: (k) => e.$emit("select", l)
|
|
2396
2424
|
}, [
|
|
2397
|
-
o("span",
|
|
2398
|
-
(c(), u("svg",
|
|
2425
|
+
o("span", An, [
|
|
2426
|
+
(c(), u("svg", Sn, [
|
|
2399
2427
|
o("path", {
|
|
2400
2428
|
d: s.iconPath(l.icon)
|
|
2401
|
-
}, null, 8,
|
|
2429
|
+
}, null, 8, Mn)
|
|
2402
2430
|
]))
|
|
2403
2431
|
]),
|
|
2404
|
-
o("span",
|
|
2405
|
-
o("span",
|
|
2406
|
-
l.description ? (c(), u("span",
|
|
2432
|
+
o("span", Tn, [
|
|
2433
|
+
o("span", xn, v(l.label), 1),
|
|
2434
|
+
l.description ? (c(), u("span", On, v(l.description), 1)) : y("", !0)
|
|
2407
2435
|
])
|
|
2408
|
-
], 10,
|
|
2436
|
+
], 10, Cn))), 128))
|
|
2409
2437
|
], 2)
|
|
2410
2438
|
])) : y("", !0),
|
|
2411
|
-
|
|
2412
|
-
o("div", Ln, v(s.t("onboarding.
|
|
2413
|
-
o("div",
|
|
2439
|
+
s.unreadThreads.length ? (c(), u("div", In, [
|
|
2440
|
+
o("div", Ln, v(s.t("onboarding.unreadConversations")), 1),
|
|
2441
|
+
o("div", En, [
|
|
2442
|
+
(c(!0), u(E, null, F(s.unreadThreads, (l) => (c(), u("button", {
|
|
2443
|
+
key: l.id,
|
|
2444
|
+
type: "button",
|
|
2445
|
+
class: "wm-onb__alert",
|
|
2446
|
+
onClick: (p) => e.$emit("resume", l)
|
|
2447
|
+
}, [
|
|
2448
|
+
o("span", Rn, [
|
|
2449
|
+
(c(), P(pe(s.avatarComponent(l)), Se({ ref_for: !0 }, s.avatarProps(l)), null, 16)),
|
|
2450
|
+
o("span", {
|
|
2451
|
+
class: "wm-onb__alert-dot",
|
|
2452
|
+
"aria-label": s.t("onboarding.unread")
|
|
2453
|
+
}, null, 8, Nn)
|
|
2454
|
+
]),
|
|
2455
|
+
o("span", Pn, [
|
|
2456
|
+
o("span", Un, v(l.title), 1),
|
|
2457
|
+
o("span", {
|
|
2458
|
+
class: "wm-onb__alert-preview",
|
|
2459
|
+
innerHTML: s.renderPreview(l.preview)
|
|
2460
|
+
}, null, 8, Fn)
|
|
2461
|
+
]),
|
|
2462
|
+
o("span", Dn, [
|
|
2463
|
+
s.formatTs(l._ts) ? (c(), u("span", jn, v(s.formatTs(l._ts)), 1)) : y("", !0),
|
|
2464
|
+
o("span", Hn, v(s.t("onboarding.resume")), 1)
|
|
2465
|
+
])
|
|
2466
|
+
], 8, Bn))), 128))
|
|
2467
|
+
])
|
|
2468
|
+
])) : y("", !0),
|
|
2469
|
+
n.openThreads.length ? (c(), u("div", zn, [
|
|
2470
|
+
o("div", qn, v(s.t("onboarding.recentConversations")), 1),
|
|
2471
|
+
o("div", Kn, [
|
|
2414
2472
|
t[4] || (t[4] = o("span", { class: "wm-onb__searchIcon" }, [
|
|
2415
2473
|
o("svg", {
|
|
2416
2474
|
width: "12",
|
|
@@ -2426,63 +2484,65 @@ function qn(e, t, n, i, r, s) {
|
|
|
2426
2484
|
o("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
|
|
2427
2485
|
])
|
|
2428
2486
|
], -1)),
|
|
2429
|
-
|
|
2487
|
+
$(o("input", {
|
|
2430
2488
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => r.query = l),
|
|
2431
2489
|
type: "text",
|
|
2432
2490
|
placeholder: s.t("onboarding.search"),
|
|
2433
2491
|
"aria-label": s.t("onboarding.search")
|
|
2434
|
-
}, null, 8,
|
|
2492
|
+
}, null, 8, Vn), [
|
|
2435
2493
|
[X, r.query]
|
|
2436
2494
|
])
|
|
2437
2495
|
]),
|
|
2438
|
-
o("div",
|
|
2439
|
-
(c(!0), u(
|
|
2496
|
+
o("div", $n, [
|
|
2497
|
+
(c(!0), u(E, null, F(s.filteredThreads, (l) => (c(), u("button", {
|
|
2440
2498
|
key: l.id,
|
|
2441
|
-
|
|
2499
|
+
type: "button",
|
|
2500
|
+
class: "wm-onb__thread",
|
|
2501
|
+
onClick: (p) => e.$emit("resume", l)
|
|
2442
2502
|
}, [
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
fill: "currentColor",
|
|
2454
|
-
opacity: "0.92"
|
|
2455
|
-
})
|
|
2456
|
-
])
|
|
2457
|
-
], -1)),
|
|
2458
|
-
o("span", Rn, [
|
|
2459
|
-
o("span", Nn, [
|
|
2460
|
-
o("span", Pn, v(s.t("onboarding.statusInProgress")), 1),
|
|
2461
|
-
s.formatTs(l._ts) ? (c(), u("span", Fn, "·")) : y("", !0),
|
|
2462
|
-
s.formatTs(l._ts) ? (c(), u("span", Un, v(s.formatTs(l._ts)), 1)) : y("", !0)
|
|
2463
|
-
]),
|
|
2464
|
-
o("span", Dn, v(l.title), 1),
|
|
2503
|
+
o("span", Gn, [
|
|
2504
|
+
(c(), P(pe(s.avatarComponent(l)), Se({ ref_for: !0 }, s.avatarProps(l)), null, 16)),
|
|
2505
|
+
l.unread ? (c(), u("span", {
|
|
2506
|
+
key: 0,
|
|
2507
|
+
class: "wm-onb__thread-dot",
|
|
2508
|
+
"aria-label": s.t("onboarding.unread")
|
|
2509
|
+
}, null, 8, Yn)) : y("", !0)
|
|
2510
|
+
]),
|
|
2511
|
+
o("span", Jn, [
|
|
2512
|
+
o("span", Qn, v(l.title), 1),
|
|
2465
2513
|
o("span", {
|
|
2466
2514
|
class: "wm-onb__thread-preview",
|
|
2467
2515
|
innerHTML: s.renderPreview(l.preview)
|
|
2468
|
-
}, null, 8,
|
|
2516
|
+
}, null, 8, Xn)
|
|
2469
2517
|
]),
|
|
2470
|
-
o("
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2518
|
+
o("span", Zn, [
|
|
2519
|
+
s.formatTs(l._ts) ? (c(), u("span", es, v(s.formatTs(l._ts)), 1)) : y("", !0),
|
|
2520
|
+
t[5] || (t[5] = o("svg", {
|
|
2521
|
+
width: "14",
|
|
2522
|
+
height: "14",
|
|
2523
|
+
viewBox: "0 0 24 24",
|
|
2524
|
+
fill: "none",
|
|
2525
|
+
stroke: "currentColor",
|
|
2526
|
+
"stroke-width": "1.8",
|
|
2527
|
+
"stroke-linecap": "round",
|
|
2528
|
+
"stroke-linejoin": "round",
|
|
2529
|
+
class: "wm-onb__thread-chev",
|
|
2530
|
+
"aria-hidden": "true"
|
|
2531
|
+
}, [
|
|
2532
|
+
o("path", { d: "M5 12h14M13 5l7 7-7 7" })
|
|
2533
|
+
], -1))
|
|
2534
|
+
])
|
|
2535
|
+
], 8, Wn))), 128)),
|
|
2536
|
+
s.filteredThreads.length ? y("", !0) : (c(), u("div", ts, v(s.t("onboarding.noResults", { query: r.query })), 1))
|
|
2477
2537
|
])
|
|
2478
2538
|
])) : y("", !0)
|
|
2479
2539
|
]);
|
|
2480
2540
|
}
|
|
2481
|
-
const
|
|
2482
|
-
function
|
|
2541
|
+
const ss = /* @__PURE__ */ N(mn, [["render", ns], ["__scopeId", "data-v-51460a75"]]);
|
|
2542
|
+
function rs(e) {
|
|
2483
2543
|
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();
|
|
2484
2544
|
}
|
|
2485
|
-
const
|
|
2545
|
+
const is = {
|
|
2486
2546
|
name: "WmActionResult",
|
|
2487
2547
|
props: {
|
|
2488
2548
|
state: { type: String, default: "success" },
|
|
@@ -2492,13 +2552,13 @@ const Vn = {
|
|
|
2492
2552
|
},
|
|
2493
2553
|
computed: {
|
|
2494
2554
|
detailText() {
|
|
2495
|
-
return
|
|
2555
|
+
return rs(this.detail);
|
|
2496
2556
|
}
|
|
2497
2557
|
}
|
|
2498
|
-
},
|
|
2558
|
+
}, as = {
|
|
2499
2559
|
class: "wm-result__icon",
|
|
2500
2560
|
"aria-hidden": "true"
|
|
2501
|
-
},
|
|
2561
|
+
}, os = {
|
|
2502
2562
|
key: 0,
|
|
2503
2563
|
width: "11",
|
|
2504
2564
|
height: "11",
|
|
@@ -2508,7 +2568,7 @@ const Vn = {
|
|
|
2508
2568
|
"stroke-width": "2.8",
|
|
2509
2569
|
"stroke-linecap": "round",
|
|
2510
2570
|
"stroke-linejoin": "round"
|
|
2511
|
-
},
|
|
2571
|
+
}, ls = {
|
|
2512
2572
|
key: 1,
|
|
2513
2573
|
width: "11",
|
|
2514
2574
|
height: "11",
|
|
@@ -2518,7 +2578,7 @@ const Vn = {
|
|
|
2518
2578
|
"stroke-width": "2.6",
|
|
2519
2579
|
"stroke-linecap": "round",
|
|
2520
2580
|
"stroke-linejoin": "round"
|
|
2521
|
-
},
|
|
2581
|
+
}, cs = {
|
|
2522
2582
|
key: 2,
|
|
2523
2583
|
width: "11",
|
|
2524
2584
|
height: "11",
|
|
@@ -2528,7 +2588,7 @@ const Vn = {
|
|
|
2528
2588
|
"stroke-width": "2.4",
|
|
2529
2589
|
"stroke-linecap": "round",
|
|
2530
2590
|
"stroke-linejoin": "round"
|
|
2531
|
-
},
|
|
2591
|
+
}, ds = {
|
|
2532
2592
|
key: 3,
|
|
2533
2593
|
width: "12",
|
|
2534
2594
|
height: "12",
|
|
@@ -2538,24 +2598,24 @@ const Vn = {
|
|
|
2538
2598
|
"stroke-width": "2.2",
|
|
2539
2599
|
"stroke-linecap": "round",
|
|
2540
2600
|
"stroke-linejoin": "round"
|
|
2541
|
-
},
|
|
2542
|
-
function
|
|
2601
|
+
}, us = { class: "wm-result__body" }, hs = { class: "wm-result__label" }, ms = { class: "wm-result__detail" };
|
|
2602
|
+
function fs(e, t, n, i, r, s) {
|
|
2543
2603
|
return c(), u("div", {
|
|
2544
2604
|
class: O(["wm-result", `wm-result--${n.state}`])
|
|
2545
2605
|
}, [
|
|
2546
|
-
o("span",
|
|
2547
|
-
n.state === "success" ? (c(), u("svg",
|
|
2606
|
+
o("span", as, [
|
|
2607
|
+
n.state === "success" ? (c(), u("svg", os, [...t[0] || (t[0] = [
|
|
2548
2608
|
o("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
2549
|
-
])])) : n.state === "rejected" ? (c(), u("svg",
|
|
2609
|
+
])])) : n.state === "rejected" ? (c(), u("svg", ls, [...t[1] || (t[1] = [
|
|
2550
2610
|
o("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
2551
|
-
])])) : n.state === "awaiting" ? (c(), u("svg",
|
|
2611
|
+
])])) : n.state === "awaiting" ? (c(), u("svg", cs, [...t[2] || (t[2] = [
|
|
2552
2612
|
o("circle", {
|
|
2553
2613
|
cx: "12",
|
|
2554
2614
|
cy: "12",
|
|
2555
2615
|
r: "10"
|
|
2556
2616
|
}, null, -1),
|
|
2557
2617
|
o("polyline", { points: "12 7 12 12 15 14" }, null, -1)
|
|
2558
|
-
])])) : (c(), u("svg",
|
|
2618
|
+
])])) : (c(), u("svg", ds, [...t[3] || (t[3] = [
|
|
2559
2619
|
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),
|
|
2560
2620
|
o("line", {
|
|
2561
2621
|
x1: "12",
|
|
@@ -2571,19 +2631,19 @@ function ts(e, t, n, i, r, s) {
|
|
|
2571
2631
|
}, null, -1)
|
|
2572
2632
|
])]))
|
|
2573
2633
|
]),
|
|
2574
|
-
o("span",
|
|
2575
|
-
o("span",
|
|
2576
|
-
s.detailText ? (c(), u(
|
|
2634
|
+
o("span", us, [
|
|
2635
|
+
o("span", hs, v(n.label), 1),
|
|
2636
|
+
s.detailText ? (c(), u(E, { key: 0 }, [
|
|
2577
2637
|
t[4] || (t[4] = o("span", {
|
|
2578
2638
|
class: "wm-result__sep",
|
|
2579
2639
|
"aria-hidden": "true"
|
|
2580
2640
|
}, " · ", -1)),
|
|
2581
|
-
o("span",
|
|
2641
|
+
o("span", ms, v(s.detailText), 1)
|
|
2582
2642
|
], 64)) : y("", !0)
|
|
2583
2643
|
])
|
|
2584
2644
|
], 2);
|
|
2585
2645
|
}
|
|
2586
|
-
const
|
|
2646
|
+
const _s = /* @__PURE__ */ N(is, [["render", fs], ["__scopeId", "data-v-7284acd0"]]), gs = {
|
|
2587
2647
|
name: "WmArtifactFormResponse",
|
|
2588
2648
|
inject: {
|
|
2589
2649
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -2599,12 +2659,12 @@ const ns = /* @__PURE__ */ N(Vn, [["render", ts], ["__scopeId", "data-v-7284acd0
|
|
|
2599
2659
|
return Array.isArray((e = this.data) == null ? void 0 : e.fields) ? this.data.fields : [];
|
|
2600
2660
|
}
|
|
2601
2661
|
}
|
|
2602
|
-
},
|
|
2603
|
-
function
|
|
2604
|
-
return c(), u("div",
|
|
2605
|
-
o("div",
|
|
2606
|
-
o("div",
|
|
2607
|
-
o("span",
|
|
2662
|
+
}, ps = { class: "wm-art wm-art--formResponse" }, vs = { class: "wm-art__head" }, ys = { class: "wm-art__title" }, ws = { class: "wm-art__badge wm-art__badge--success" }, bs = { class: "wm-art__body" }, ks = { class: "wm-art__fieldLabel" };
|
|
2663
|
+
function Cs(e, t, n, i, r, s) {
|
|
2664
|
+
return c(), u("div", ps, [
|
|
2665
|
+
o("div", vs, [
|
|
2666
|
+
o("div", ys, v(n.data.title || s.t("form.title")), 1),
|
|
2667
|
+
o("span", ws, [
|
|
2608
2668
|
t[0] || (t[0] = o("svg", {
|
|
2609
2669
|
width: "11",
|
|
2610
2670
|
height: "11",
|
|
@@ -2618,15 +2678,15 @@ function ds(e, t, n, i, r, s) {
|
|
|
2618
2678
|
}, [
|
|
2619
2679
|
o("polyline", { points: "20 6 9 17 4 12" })
|
|
2620
2680
|
], -1)),
|
|
2621
|
-
|
|
2681
|
+
ye(" " + v(s.t("form.sent")), 1)
|
|
2622
2682
|
])
|
|
2623
2683
|
]),
|
|
2624
|
-
o("div",
|
|
2625
|
-
(c(!0), u(
|
|
2684
|
+
o("div", bs, [
|
|
2685
|
+
(c(!0), u(E, null, F(s.fields, (a, l) => (c(), u("div", {
|
|
2626
2686
|
key: l,
|
|
2627
2687
|
class: "wm-art__field"
|
|
2628
2688
|
}, [
|
|
2629
|
-
o("div",
|
|
2689
|
+
o("div", ks, v(a.label), 1),
|
|
2630
2690
|
o("div", {
|
|
2631
2691
|
class: O([
|
|
2632
2692
|
"wm-art__fieldValue",
|
|
@@ -2637,7 +2697,7 @@ function ds(e, t, n, i, r, s) {
|
|
|
2637
2697
|
])
|
|
2638
2698
|
]);
|
|
2639
2699
|
}
|
|
2640
|
-
const
|
|
2700
|
+
const As = /* @__PURE__ */ N(gs, [["render", Cs], ["__scopeId", "data-v-713aecf1"]]), Ss = {
|
|
2641
2701
|
name: "WmArtifactInfoCard",
|
|
2642
2702
|
props: {
|
|
2643
2703
|
data: { type: Object, required: !0 }
|
|
@@ -2652,32 +2712,32 @@ const us = /* @__PURE__ */ N(ss, [["render", ds], ["__scopeId", "data-v-713aecf1
|
|
|
2652
2712
|
return !!((e = this.data) != null && e.body) || this.fields.length > 0;
|
|
2653
2713
|
}
|
|
2654
2714
|
}
|
|
2655
|
-
},
|
|
2715
|
+
}, Ms = { class: "wm-art wm-art--infoCard" }, Ts = {
|
|
2656
2716
|
key: 0,
|
|
2657
2717
|
class: "wm-art__image"
|
|
2658
|
-
},
|
|
2718
|
+
}, xs = ["src", "alt"], Os = { class: "wm-art__head" }, Is = { class: "wm-art__headMain" }, Ls = { class: "wm-art__title" }, Es = {
|
|
2659
2719
|
key: 0,
|
|
2660
2720
|
class: "wm-art__subtitle"
|
|
2661
|
-
},
|
|
2721
|
+
}, Bs = {
|
|
2662
2722
|
key: 1,
|
|
2663
2723
|
class: "wm-art__body"
|
|
2664
|
-
},
|
|
2724
|
+
}, Rs = {
|
|
2665
2725
|
key: 0,
|
|
2666
2726
|
class: "wm-art__text"
|
|
2667
|
-
},
|
|
2668
|
-
function
|
|
2669
|
-
return c(), u("div",
|
|
2670
|
-
n.data.image_url ? (c(), u("figure",
|
|
2727
|
+
}, Ns = { class: "wm-art__fieldLabel" };
|
|
2728
|
+
function Ps(e, t, n, i, r, s) {
|
|
2729
|
+
return c(), u("div", Ms, [
|
|
2730
|
+
n.data.image_url ? (c(), u("figure", Ts, [
|
|
2671
2731
|
o("img", {
|
|
2672
2732
|
src: n.data.image_url,
|
|
2673
2733
|
alt: n.data.title || "",
|
|
2674
2734
|
loading: "lazy"
|
|
2675
|
-
}, null, 8,
|
|
2735
|
+
}, null, 8, xs)
|
|
2676
2736
|
])) : y("", !0),
|
|
2677
|
-
o("div",
|
|
2678
|
-
o("div",
|
|
2679
|
-
o("div",
|
|
2680
|
-
n.data.subtitle ? (c(), u("div",
|
|
2737
|
+
o("div", Os, [
|
|
2738
|
+
o("div", Is, [
|
|
2739
|
+
o("div", Ls, v(n.data.title), 1),
|
|
2740
|
+
n.data.subtitle ? (c(), u("div", Es, v(n.data.subtitle), 1)) : y("", !0)
|
|
2681
2741
|
]),
|
|
2682
2742
|
n.data.badge && n.data.badge.label ? (c(), u("span", {
|
|
2683
2743
|
key: 0,
|
|
@@ -2687,13 +2747,13 @@ function Cs(e, t, n, i, r, s) {
|
|
|
2687
2747
|
])
|
|
2688
2748
|
}, v(n.data.badge.label), 3)) : y("", !0)
|
|
2689
2749
|
]),
|
|
2690
|
-
s.hasBody ? (c(), u("div",
|
|
2691
|
-
n.data.body ? (c(), u("div",
|
|
2692
|
-
s.fields.length ? (c(!0), u(
|
|
2750
|
+
s.hasBody ? (c(), u("div", Bs, [
|
|
2751
|
+
n.data.body ? (c(), u("div", Rs, v(n.data.body), 1)) : y("", !0),
|
|
2752
|
+
s.fields.length ? (c(!0), u(E, { key: 1 }, F(s.fields, (a, l) => (c(), u("div", {
|
|
2693
2753
|
key: l,
|
|
2694
2754
|
class: "wm-art__field"
|
|
2695
2755
|
}, [
|
|
2696
|
-
o("div",
|
|
2756
|
+
o("div", Ns, v(a.label), 1),
|
|
2697
2757
|
o("div", {
|
|
2698
2758
|
class: O([
|
|
2699
2759
|
"wm-art__fieldValue",
|
|
@@ -2704,8 +2764,8 @@ function Cs(e, t, n, i, r, s) {
|
|
|
2704
2764
|
])) : y("", !0)
|
|
2705
2765
|
]);
|
|
2706
2766
|
}
|
|
2707
|
-
const
|
|
2708
|
-
function
|
|
2767
|
+
const Us = /* @__PURE__ */ N(Ss, [["render", Ps], ["__scopeId", "data-v-7eae0e4a"]]);
|
|
2768
|
+
function Fs(e, t, n) {
|
|
2709
2769
|
if (!e) return "";
|
|
2710
2770
|
const i = new Date(e);
|
|
2711
2771
|
if (Number.isNaN(i.getTime())) return e;
|
|
@@ -2719,7 +2779,7 @@ function Ss(e, t, n) {
|
|
|
2719
2779
|
});
|
|
2720
2780
|
return `${r}${n}${s}`;
|
|
2721
2781
|
}
|
|
2722
|
-
const
|
|
2782
|
+
const Ds = {
|
|
2723
2783
|
name: "WmArtifactTicket",
|
|
2724
2784
|
inject: {
|
|
2725
2785
|
// Translator + resolved-language getter shared by the Messenger
|
|
@@ -2737,7 +2797,7 @@ const Ms = {
|
|
|
2737
2797
|
},
|
|
2738
2798
|
formattedDate() {
|
|
2739
2799
|
var e;
|
|
2740
|
-
return
|
|
2800
|
+
return Fs(
|
|
2741
2801
|
(e = this.data) == null ? void 0 : e.created_at,
|
|
2742
2802
|
re(this.wmLocale()),
|
|
2743
2803
|
this.t("ticket.dateAt")
|
|
@@ -2765,13 +2825,13 @@ const Ms = {
|
|
|
2765
2825
|
return /high|haute|élev|elev|critic|critiq|urgent/.test(t) ? 3 : /low|basse|faible|minor/.test(t) ? 1 : 2;
|
|
2766
2826
|
}
|
|
2767
2827
|
}
|
|
2768
|
-
},
|
|
2828
|
+
}, js = { class: "wm-art wm-art--ticket" }, Hs = { class: "wm-art__head wm-tk__head" }, zs = { class: "wm-art__title wm-tk__title" }, qs = { class: "wm-tk__sub" }, Ks = { class: "wm-tk__ref" }, Vs = {
|
|
2769
2829
|
key: 0,
|
|
2770
2830
|
class: "wm-tk__text"
|
|
2771
|
-
},
|
|
2831
|
+
}, $s = {
|
|
2772
2832
|
key: 0,
|
|
2773
2833
|
class: "wm-art__body"
|
|
2774
|
-
},
|
|
2834
|
+
}, Ws = { class: "wm-art__fieldLabel" }, Gs = ["data-level"], Ys = {
|
|
2775
2835
|
key: 1,
|
|
2776
2836
|
class: "wm-tk__date",
|
|
2777
2837
|
width: "12",
|
|
@@ -2783,16 +2843,16 @@ const Ms = {
|
|
|
2783
2843
|
"stroke-linecap": "round",
|
|
2784
2844
|
"stroke-linejoin": "round",
|
|
2785
2845
|
"aria-hidden": "true"
|
|
2786
|
-
},
|
|
2846
|
+
}, Js = {
|
|
2787
2847
|
key: 1,
|
|
2788
2848
|
class: "wm-art__footer wm-tk__footer"
|
|
2789
2849
|
};
|
|
2790
|
-
function
|
|
2791
|
-
return c(), u("div",
|
|
2792
|
-
o("div",
|
|
2793
|
-
o("div",
|
|
2794
|
-
o("div",
|
|
2795
|
-
o("div",
|
|
2850
|
+
function Qs(e, t, n, i, r, s) {
|
|
2851
|
+
return c(), u("div", js, [
|
|
2852
|
+
o("div", Hs, [
|
|
2853
|
+
o("div", zs, v(n.data.title), 1),
|
|
2854
|
+
o("div", qs, [
|
|
2855
|
+
o("div", Ks, [
|
|
2796
2856
|
t[0] || (t[0] = o("svg", {
|
|
2797
2857
|
width: "11",
|
|
2798
2858
|
height: "11",
|
|
@@ -2820,17 +2880,17 @@ function Us(e, t, n, i, r, s) {
|
|
|
2820
2880
|
class: "wm-tk__dot",
|
|
2821
2881
|
"aria-hidden": "true"
|
|
2822
2882
|
}, null, -1)),
|
|
2823
|
-
|
|
2883
|
+
ye(" " + v(n.data.status.label), 1)
|
|
2824
2884
|
], 2)
|
|
2825
2885
|
]),
|
|
2826
|
-
n.data.body ? (c(), u("div",
|
|
2886
|
+
n.data.body ? (c(), u("div", Vs, v(n.data.body), 1)) : y("", !0)
|
|
2827
2887
|
]),
|
|
2828
|
-
s.fields.length ? (c(), u("div",
|
|
2829
|
-
(c(!0), u(
|
|
2888
|
+
s.fields.length ? (c(), u("div", $s, [
|
|
2889
|
+
(c(!0), u(E, null, F(s.fields, (a, l) => (c(), u("div", {
|
|
2830
2890
|
key: l,
|
|
2831
2891
|
class: "wm-art__field"
|
|
2832
2892
|
}, [
|
|
2833
|
-
o("div",
|
|
2893
|
+
o("div", Ws, v(a.label), 1),
|
|
2834
2894
|
o("div", {
|
|
2835
2895
|
class: O([
|
|
2836
2896
|
"wm-art__fieldValue",
|
|
@@ -2867,7 +2927,7 @@ function Us(e, t, n, i, r, s) {
|
|
|
2867
2927
|
height: "9",
|
|
2868
2928
|
rx: "0.5"
|
|
2869
2929
|
}, null, -1)
|
|
2870
|
-
])], 8,
|
|
2930
|
+
])], 8, Gs)) : s.isDate(a.label) ? (c(), u("svg", Ys, [...t[3] || (t[3] = [
|
|
2871
2931
|
o("rect", {
|
|
2872
2932
|
x: "3",
|
|
2873
2933
|
y: "4",
|
|
@@ -2881,7 +2941,7 @@ function Us(e, t, n, i, r, s) {
|
|
|
2881
2941
|
], 2)
|
|
2882
2942
|
]))), 128))
|
|
2883
2943
|
])) : y("", !0),
|
|
2884
|
-
n.data.created_at ? (c(), u("div",
|
|
2944
|
+
n.data.created_at ? (c(), u("div", Js, [
|
|
2885
2945
|
t[4] || (t[4] = o("svg", {
|
|
2886
2946
|
width: "11",
|
|
2887
2947
|
height: "11",
|
|
@@ -2906,11 +2966,11 @@ function Us(e, t, n, i, r, s) {
|
|
|
2906
2966
|
])) : y("", !0)
|
|
2907
2967
|
]);
|
|
2908
2968
|
}
|
|
2909
|
-
const
|
|
2910
|
-
form_response:
|
|
2911
|
-
info_card:
|
|
2912
|
-
ticket:
|
|
2913
|
-
},
|
|
2969
|
+
const Xs = /* @__PURE__ */ N(Ds, [["render", Qs], ["__scopeId", "data-v-5f30c914"]]), Zs = {
|
|
2970
|
+
form_response: As,
|
|
2971
|
+
info_card: Us,
|
|
2972
|
+
ticket: Xs
|
|
2973
|
+
}, er = {
|
|
2914
2974
|
name: "WmArtifactRenderer",
|
|
2915
2975
|
props: {
|
|
2916
2976
|
// Forme : { kind: string, data: any } (le `data` est validé
|
|
@@ -2921,17 +2981,17 @@ const Ds = /* @__PURE__ */ N(Ms, [["render", Us], ["__scopeId", "data-v-5f30c914
|
|
|
2921
2981
|
component() {
|
|
2922
2982
|
var t;
|
|
2923
2983
|
const e = (t = this.artifact) == null ? void 0 : t.kind;
|
|
2924
|
-
return e &&
|
|
2984
|
+
return e && Zs[e] || null;
|
|
2925
2985
|
}
|
|
2926
2986
|
}
|
|
2927
2987
|
};
|
|
2928
|
-
function
|
|
2929
|
-
return s.component ? (c(), P(
|
|
2988
|
+
function tr(e, t, n, i, r, s) {
|
|
2989
|
+
return s.component ? (c(), P(pe(s.component), {
|
|
2930
2990
|
key: 0,
|
|
2931
2991
|
data: n.artifact.data
|
|
2932
2992
|
}, null, 8, ["data"])) : y("", !0);
|
|
2933
2993
|
}
|
|
2934
|
-
const
|
|
2994
|
+
const nr = /* @__PURE__ */ N(er, [["render", tr]]), sr = {
|
|
2935
2995
|
name: "WmAttachmentPreview",
|
|
2936
2996
|
inject: {
|
|
2937
2997
|
signAttachmentFn: { default: null },
|
|
@@ -2999,15 +3059,15 @@ const qs = /* @__PURE__ */ N(Hs, [["render", zs]]), $s = {
|
|
|
2999
3059
|
this.safeHref === "#" && e.preventDefault();
|
|
3000
3060
|
}
|
|
3001
3061
|
}
|
|
3002
|
-
},
|
|
3062
|
+
}, rr = ["href"], ir = ["src", "alt"], ar = ["src"], or = ["src"], lr = ["href", "download"], cr = { class: "wm-att__main" }, dr = { class: "wm-att__name" }, ur = {
|
|
3003
3063
|
key: 0,
|
|
3004
3064
|
class: "wm-att__meta"
|
|
3005
|
-
},
|
|
3065
|
+
}, hr = {
|
|
3006
3066
|
key: 0,
|
|
3007
3067
|
class: "wm-att__spin",
|
|
3008
3068
|
"aria-hidden": "true"
|
|
3009
3069
|
};
|
|
3010
|
-
function
|
|
3070
|
+
function mr(e, t, n, i, r, s) {
|
|
3011
3071
|
return c(), u("div", {
|
|
3012
3072
|
class: O(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
3013
3073
|
}, [
|
|
@@ -3022,18 +3082,18 @@ function er(e, t, n, i, r, s) {
|
|
|
3022
3082
|
src: r.url,
|
|
3023
3083
|
alt: s.displayName,
|
|
3024
3084
|
loading: "lazy"
|
|
3025
|
-
}, null, 8,
|
|
3026
|
-
], 8,
|
|
3085
|
+
}, null, 8, ir)
|
|
3086
|
+
], 8, rr)) : s.kind === "audio" && r.url ? (c(), u("audio", {
|
|
3027
3087
|
key: 1,
|
|
3028
3088
|
src: r.url,
|
|
3029
3089
|
controls: "",
|
|
3030
3090
|
preload: "metadata"
|
|
3031
|
-
}, null, 8,
|
|
3091
|
+
}, null, 8, ar)) : s.kind === "video" && r.url ? (c(), u("video", {
|
|
3032
3092
|
key: 2,
|
|
3033
3093
|
src: r.url,
|
|
3034
3094
|
controls: "",
|
|
3035
3095
|
preload: "metadata"
|
|
3036
|
-
}, null, 8,
|
|
3096
|
+
}, null, 8, or)) : (c(), u("a", {
|
|
3037
3097
|
key: 3,
|
|
3038
3098
|
class: "wm-att__file",
|
|
3039
3099
|
href: s.safeHref,
|
|
@@ -3058,15 +3118,15 @@ function er(e, t, n, i, r, s) {
|
|
|
3058
3118
|
o("path", { d: "M14 2v6h6" })
|
|
3059
3119
|
])
|
|
3060
3120
|
], -1)),
|
|
3061
|
-
o("span",
|
|
3062
|
-
o("span",
|
|
3063
|
-
s.sizeLabel ? (c(), u("span",
|
|
3121
|
+
o("span", cr, [
|
|
3122
|
+
o("span", dr, v(s.displayName), 1),
|
|
3123
|
+
s.sizeLabel ? (c(), u("span", ur, v(s.sizeLabel), 1)) : y("", !0)
|
|
3064
3124
|
]),
|
|
3065
|
-
r.loading ? (c(), u("span",
|
|
3066
|
-
], 8,
|
|
3125
|
+
r.loading ? (c(), u("span", hr)) : y("", !0)
|
|
3126
|
+
], 8, lr))
|
|
3067
3127
|
], 2);
|
|
3068
3128
|
}
|
|
3069
|
-
const
|
|
3129
|
+
const fr = /* @__PURE__ */ N(sr, [["render", mr], ["__scopeId", "data-v-0c877a62"]]), _r = {
|
|
3070
3130
|
name: "WmBubble",
|
|
3071
3131
|
props: {
|
|
3072
3132
|
role: { type: String, default: "ai" },
|
|
@@ -3075,48 +3135,48 @@ const tr = /* @__PURE__ */ N($s, [["render", er], ["__scopeId", "data-v-0c877a62
|
|
|
3075
3135
|
},
|
|
3076
3136
|
computed: {
|
|
3077
3137
|
rendered() {
|
|
3078
|
-
return
|
|
3138
|
+
return hn(this.text);
|
|
3079
3139
|
}
|
|
3080
3140
|
}
|
|
3081
|
-
},
|
|
3082
|
-
function
|
|
3141
|
+
}, gr = ["innerHTML"];
|
|
3142
|
+
function pr(e, t, n, i, r, s) {
|
|
3083
3143
|
return c(), u("div", {
|
|
3084
3144
|
class: O(["wm-bubble", "wm-bubble--" + n.role])
|
|
3085
3145
|
}, [
|
|
3086
|
-
|
|
3087
|
-
o("span", { innerHTML: s.rendered }, null, 8,
|
|
3146
|
+
He(e.$slots, "default", {}, () => [
|
|
3147
|
+
o("span", { innerHTML: s.rendered }, null, 8, gr)
|
|
3088
3148
|
], !0)
|
|
3089
3149
|
], 2);
|
|
3090
3150
|
}
|
|
3091
|
-
const
|
|
3092
|
-
function
|
|
3093
|
-
return c(), u("div",
|
|
3151
|
+
const vr = /* @__PURE__ */ N(_r, [["render", pr], ["__scopeId", "data-v-7ab13147"]]), yr = { name: "WmTyping" }, wr = { class: "wm-typing" };
|
|
3152
|
+
function br(e, t, n, i, r, s) {
|
|
3153
|
+
return c(), u("div", wr, [...t[0] || (t[0] = [
|
|
3094
3154
|
o("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
3095
3155
|
o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
3096
3156
|
o("span", { style: { "animation-delay": "0.4s" } }, null, -1)
|
|
3097
3157
|
])]);
|
|
3098
3158
|
}
|
|
3099
|
-
const
|
|
3159
|
+
const kr = /* @__PURE__ */ N(yr, [["render", br], ["__scopeId", "data-v-df2447fd"]]);
|
|
3100
3160
|
function Q(e) {
|
|
3101
3161
|
return e ? e.client_msg_id || e.id : "";
|
|
3102
3162
|
}
|
|
3103
|
-
const
|
|
3163
|
+
const Cr = {
|
|
3104
3164
|
transferred_to_human: "system.transferredToHuman",
|
|
3105
3165
|
assigned: "system.assigned",
|
|
3106
3166
|
unassigned: "system.unassigned",
|
|
3107
3167
|
resolved: "system.resolved",
|
|
3108
3168
|
reopened: "system.reopened",
|
|
3109
3169
|
idle: "system.idle"
|
|
3110
|
-
},
|
|
3170
|
+
}, Ar = 80, Sr = 200, Mr = {
|
|
3111
3171
|
name: "WmMessageList",
|
|
3112
3172
|
components: {
|
|
3113
3173
|
AIAvatar: le,
|
|
3114
|
-
HumanAvatar:
|
|
3115
|
-
Bubble:
|
|
3116
|
-
Typing:
|
|
3117
|
-
ActionResult:
|
|
3118
|
-
AttachmentPreview:
|
|
3119
|
-
ArtifactRenderer:
|
|
3174
|
+
HumanAvatar: Ce,
|
|
3175
|
+
Bubble: vr,
|
|
3176
|
+
Typing: kr,
|
|
3177
|
+
ActionResult: _s,
|
|
3178
|
+
AttachmentPreview: fr,
|
|
3179
|
+
ArtifactRenderer: nr
|
|
3120
3180
|
},
|
|
3121
3181
|
inject: {
|
|
3122
3182
|
// Translator + resolved-language getter shared by the Messenger
|
|
@@ -3306,11 +3366,11 @@ const dr = {
|
|
|
3306
3366
|
return `g-${n}`;
|
|
3307
3367
|
},
|
|
3308
3368
|
isAtBottom(e) {
|
|
3309
|
-
return e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
3369
|
+
return e.scrollHeight - e.scrollTop - e.clientHeight <= Ar;
|
|
3310
3370
|
},
|
|
3311
3371
|
onScroll() {
|
|
3312
3372
|
const e = this.$refs.scrollEl;
|
|
3313
|
-
e && (this.showScrollDown = !this.isAtBottom(e), !(this.loadingMore || !this.hasMore) && (this._pendingLoadMore || e.scrollTop <=
|
|
3373
|
+
e && (this.showScrollDown = !this.isAtBottom(e), !(this.loadingMore || !this.hasMore) && (this._pendingLoadMore || e.scrollTop <= Sr && (this._pendingLoadMore = !0, this.$emit("load-more"))));
|
|
3314
3374
|
},
|
|
3315
3375
|
// Capture pre-patch scroll state and restore it on the next tick.
|
|
3316
3376
|
//
|
|
@@ -3511,9 +3571,9 @@ const dr = {
|
|
|
3511
3571
|
// doit garder son arrondi.
|
|
3512
3572
|
cornersFor(e, t) {
|
|
3513
3573
|
var Z, ee, te;
|
|
3514
|
-
const n = e.items, i = (Z = n[t]) == null ? void 0 : Z.kind, r = (ee = n[t - 1]) == null ? void 0 : ee.kind, s = (te = n[t + 1]) == null ? void 0 : te.kind, a = e.role === "user", l = 14, p = 4, k = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)],
|
|
3515
|
-
let
|
|
3516
|
-
return a ? (k && (
|
|
3574
|
+
const n = e.items, i = (Z = n[t]) == null ? void 0 : Z.kind, r = (ee = n[t - 1]) == null ? void 0 : ee.kind, s = (te = n[t + 1]) == null ? void 0 : te.kind, a = e.role === "user", l = 14, p = 4, k = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], B = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], H = 0.5, S = (V, ne, J) => V != null && T != null ? V + H >= T : ne === J || ne === "card" && J === "bubble";
|
|
3575
|
+
let U = l, I = l, q = l, Y = l;
|
|
3576
|
+
return a ? (k && (I = p), (w || !s) && (q = p), k && S(B, k, i == null ? void 0 : i.top) && (U = p), w && S(A, w, i == null ? void 0 : i.bottom) && (Y = p)) : (k && (U = p), (w || !s) && (Y = p), k && S(B, k, i == null ? void 0 : i.top) && (I = p), w && S(A, w, i == null ? void 0 : i.bottom) && (q = p)), { tl: U, tr: I, br: q, bl: Y };
|
|
3517
3577
|
},
|
|
3518
3578
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3519
3579
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3589,7 +3649,7 @@ const dr = {
|
|
|
3589
3649
|
timeOf(e) {
|
|
3590
3650
|
if (!(e != null && e.created_at)) return "";
|
|
3591
3651
|
try {
|
|
3592
|
-
return
|
|
3652
|
+
return ve(
|
|
3593
3653
|
new Date(e.created_at),
|
|
3594
3654
|
re(this.wmLocale())
|
|
3595
3655
|
);
|
|
@@ -3601,7 +3661,7 @@ const dr = {
|
|
|
3601
3661
|
const t = e.items[e.items.length - 1], n = (t == null ? void 0 : t.message) || e.messages[e.messages.length - 1];
|
|
3602
3662
|
if (!(n != null && n.created_at)) return "";
|
|
3603
3663
|
try {
|
|
3604
|
-
return
|
|
3664
|
+
return ve(
|
|
3605
3665
|
new Date(n.created_at),
|
|
3606
3666
|
re(this.wmLocale())
|
|
3607
3667
|
);
|
|
@@ -3648,7 +3708,7 @@ const dr = {
|
|
|
3648
3708
|
},
|
|
3649
3709
|
systemLabel(e) {
|
|
3650
3710
|
var r, s, a;
|
|
3651
|
-
const t = (r = e == null ? void 0 : e.payload) == null ? void 0 : r.event, n =
|
|
3711
|
+
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");
|
|
3652
3712
|
return n ? this.t(n, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
|
|
3653
3713
|
},
|
|
3654
3714
|
scrollToBottom() {
|
|
@@ -3663,77 +3723,77 @@ const dr = {
|
|
|
3663
3723
|
e && (typeof e.scrollTo == "function" ? e.scrollTo({ top: e.scrollHeight, behavior: "smooth" }) : e.scrollTop = e.scrollHeight, this.showScrollDown = !1);
|
|
3664
3724
|
}
|
|
3665
3725
|
}
|
|
3666
|
-
},
|
|
3726
|
+
}, Tr = { class: "wm-list__wrap" }, xr = {
|
|
3667
3727
|
key: 0,
|
|
3668
3728
|
class: "wm-list__loadMore",
|
|
3669
3729
|
role: "status",
|
|
3670
3730
|
"aria-live": "polite"
|
|
3671
|
-
},
|
|
3731
|
+
}, Or = { class: "wm-list__loadMore-lbl" }, Ir = {
|
|
3672
3732
|
key: 1,
|
|
3673
3733
|
class: "wm-list__historyEnd"
|
|
3674
|
-
},
|
|
3734
|
+
}, Lr = {
|
|
3675
3735
|
key: 2,
|
|
3676
3736
|
class: "wm-list__sep"
|
|
3677
|
-
},
|
|
3737
|
+
}, Er = { class: "wm-list__sep-label" }, Br = {
|
|
3678
3738
|
key: 0,
|
|
3679
3739
|
class: "wm-list__sep wm-list__sep--unread"
|
|
3680
|
-
},
|
|
3740
|
+
}, Rr = { class: "wm-list__sep-label wm-list__sep-label--unread" }, Nr = {
|
|
3681
3741
|
key: 0,
|
|
3682
3742
|
class: "wm-list__sysep"
|
|
3683
|
-
},
|
|
3743
|
+
}, Pr = { class: "wm-list__sysep-label" }, Ur = ["data-row-key", "onPointerdown"], Fr = {
|
|
3684
3744
|
key: 0,
|
|
3685
3745
|
class: "wm-list__avatarSlot"
|
|
3686
|
-
},
|
|
3746
|
+
}, Dr = {
|
|
3687
3747
|
key: 5,
|
|
3688
3748
|
class: "wm-list__body"
|
|
3689
|
-
},
|
|
3749
|
+
}, jr = { key: 0 }, Hr = {
|
|
3690
3750
|
key: 1,
|
|
3691
3751
|
"aria-hidden": "true"
|
|
3692
|
-
},
|
|
3752
|
+
}, zr = { key: 2 }, qr = { key: 0 }, Kr = {
|
|
3693
3753
|
key: 1,
|
|
3694
3754
|
"aria-hidden": "true"
|
|
3695
|
-
},
|
|
3755
|
+
}, Vr = { key: 2 }, $r = {
|
|
3696
3756
|
key: 3,
|
|
3697
3757
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
3698
|
-
},
|
|
3699
|
-
function
|
|
3700
|
-
const a = R("AIAvatar"), l = R("HumanAvatar"), p = R("ActionResult"), k = R("ArtifactRenderer"), w = R("Bubble"), T = R("AttachmentPreview"),
|
|
3701
|
-
return c(), u("div",
|
|
3758
|
+
}, Wr = { class: "wm-list__avatarSlot" }, Gr = ["aria-label", "title"];
|
|
3759
|
+
function Yr(e, t, n, i, r, s) {
|
|
3760
|
+
const a = R("AIAvatar"), l = R("HumanAvatar"), p = R("ActionResult"), k = R("ArtifactRenderer"), w = R("Bubble"), T = R("AttachmentPreview"), B = R("Typing");
|
|
3761
|
+
return c(), u("div", Tr, [
|
|
3702
3762
|
o("div", {
|
|
3703
3763
|
ref: "scrollEl",
|
|
3704
3764
|
class: O(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
3705
3765
|
onScrollPassive: t[4] || (t[4] = (...A) => s.onScroll && s.onScroll(...A))
|
|
3706
3766
|
}, [
|
|
3707
|
-
n.loadingMore ? (c(), u("div",
|
|
3767
|
+
n.loadingMore ? (c(), u("div", xr, [
|
|
3708
3768
|
t[6] || (t[6] = o("span", {
|
|
3709
3769
|
class: "wm-list__loadMore-spinner",
|
|
3710
3770
|
"aria-hidden": "true"
|
|
3711
3771
|
}, null, -1)),
|
|
3712
|
-
o("span",
|
|
3713
|
-
])) : s.historyExhausted ? (c(), u("div",
|
|
3714
|
-
n.dateLabel ? (c(), u("div",
|
|
3772
|
+
o("span", Or, v(s.t("messageList.loadingHistory")), 1)
|
|
3773
|
+
])) : s.historyExhausted ? (c(), u("div", Ir, v(s.t("messageList.conversationStart")), 1)) : y("", !0),
|
|
3774
|
+
n.dateLabel ? (c(), u("div", Lr, [
|
|
3715
3775
|
t[7] || (t[7] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
3716
|
-
o("span",
|
|
3776
|
+
o("span", Er, v(n.dateLabel), 1),
|
|
3717
3777
|
t[8] || (t[8] = o("div", { class: "wm-list__line" }, null, -1))
|
|
3718
3778
|
])) : y("", !0),
|
|
3719
|
-
(c(!0), u(
|
|
3779
|
+
(c(!0), u(E, null, F(s.groups, (A, H) => (c(), u(E, {
|
|
3720
3780
|
key: A.key
|
|
3721
3781
|
}, [
|
|
3722
|
-
A.key === s.unreadGroupKey ? (c(), u("div",
|
|
3782
|
+
A.key === s.unreadGroupKey ? (c(), u("div", Br, [
|
|
3723
3783
|
t[9] || (t[9] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)),
|
|
3724
|
-
o("span",
|
|
3784
|
+
o("span", Rr, v(s.t("messageList.unread")), 1),
|
|
3725
3785
|
t[10] || (t[10] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1))
|
|
3726
3786
|
])) : y("", !0),
|
|
3727
3787
|
A.role === "system" || A.items.length ? (c(), u("div", {
|
|
3728
3788
|
key: 1,
|
|
3729
3789
|
class: O(["wm-list__group", "wm-list__group--" + A.role])
|
|
3730
3790
|
}, [
|
|
3731
|
-
A.role === "system" ? (c(), u("div",
|
|
3791
|
+
A.role === "system" ? (c(), u("div", Nr, [
|
|
3732
3792
|
t[11] || (t[11] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
3733
|
-
o("span",
|
|
3793
|
+
o("span", Pr, v(A.systemLabel), 1),
|
|
3734
3794
|
t[12] || (t[12] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
3735
|
-
])) : (c(), u(
|
|
3736
|
-
(c(!0), u(
|
|
3795
|
+
])) : (c(), u(E, { key: 1 }, [
|
|
3796
|
+
(c(!0), u(E, null, F(A.items, (S, U) => (c(), u(E, {
|
|
3737
3797
|
key: `${s.messageKey(S.message)}-${S.partKey}`
|
|
3738
3798
|
}, [
|
|
3739
3799
|
o("div", {
|
|
@@ -3745,16 +3805,16 @@ function Pr(e, t, n, i, r, s) {
|
|
|
3745
3805
|
"is-failed": S.message._failed
|
|
3746
3806
|
}
|
|
3747
3807
|
]]),
|
|
3748
|
-
style:
|
|
3749
|
-
onPointerdown: (
|
|
3750
|
-
onPointerup: t[0] || (t[0] = (
|
|
3751
|
-
onPointercancel: t[1] || (t[1] = (
|
|
3752
|
-
onPointerleave: t[2] || (t[2] = (
|
|
3808
|
+
style: z(s.cornersStyle(A, U)),
|
|
3809
|
+
onPointerdown: (I) => s.onPressStart(`${s.messageKey(S.message)}-${S.partKey}`),
|
|
3810
|
+
onPointerup: t[0] || (t[0] = (I) => s.onPressEnd()),
|
|
3811
|
+
onPointercancel: t[1] || (t[1] = (I) => s.onPressEnd()),
|
|
3812
|
+
onPointerleave: t[2] || (t[2] = (I) => s.onPressEnd()),
|
|
3753
3813
|
onContextmenu: t[3] || (t[3] = G(() => {
|
|
3754
3814
|
}, ["prevent"]))
|
|
3755
3815
|
}, [
|
|
3756
|
-
A.role !== "user" ? (c(), u("div",
|
|
3757
|
-
|
|
3816
|
+
A.role !== "user" ? (c(), u("div", Fr, [
|
|
3817
|
+
U === A.items.length - 1 ? (c(), u(E, { key: 0 }, [
|
|
3758
3818
|
A.role === "ai" ? (c(), P(a, {
|
|
3759
3819
|
key: 0,
|
|
3760
3820
|
size: 26,
|
|
@@ -3786,7 +3846,7 @@ function Pr(e, t, n, i, r, s) {
|
|
|
3786
3846
|
}, null, 8, ["artifact"])) : S.renderAs === "artifact" ? (c(), P(k, {
|
|
3787
3847
|
key: 4,
|
|
3788
3848
|
artifact: s.artifactOf(S.message)
|
|
3789
|
-
}, null, 8, ["artifact"])) : (c(), u("div",
|
|
3849
|
+
}, null, 8, ["artifact"])) : (c(), u("div", Dr, [
|
|
3790
3850
|
S.message.text_md ? (c(), P(w, {
|
|
3791
3851
|
key: 0,
|
|
3792
3852
|
role: A.role,
|
|
@@ -3798,49 +3858,49 @@ function Pr(e, t, n, i, r, s) {
|
|
|
3798
3858
|
"wm-list__atts--align-end": A.role === "user"
|
|
3799
3859
|
}])
|
|
3800
3860
|
}, [
|
|
3801
|
-
(c(!0), u(
|
|
3861
|
+
(c(!0), u(E, null, F(s.attachmentsOf(
|
|
3802
3862
|
S.message
|
|
3803
|
-
), (
|
|
3804
|
-
key: `${s.messageKey(S.message)}-att-${
|
|
3805
|
-
attachment:
|
|
3863
|
+
), (I, q) => (c(), P(T, {
|
|
3864
|
+
key: `${s.messageKey(S.message)}-att-${q}`,
|
|
3865
|
+
attachment: I
|
|
3806
3866
|
}, null, 8, ["attachment"]))), 128))
|
|
3807
3867
|
], 2)) : y("", !0)
|
|
3808
3868
|
]))
|
|
3809
|
-
], 46,
|
|
3810
|
-
|
|
3869
|
+
], 46, Ur),
|
|
3870
|
+
U < A.items.length - 1 && r.pressedItemKey === `${s.messageKey(S.message)}-${S.partKey}` && (A.role !== "user" || s.timeOf(S.message)) ? (c(), u("div", {
|
|
3811
3871
|
key: 0,
|
|
3812
3872
|
class: O(["wm-list__meta wm-list__meta--press", { "wm-list__meta--right": A.role === "user" }])
|
|
3813
3873
|
}, [
|
|
3814
|
-
A.role !== "user" ? (c(), u("span",
|
|
3815
|
-
A.role !== "user" && s.timeOf(S.message) ? (c(), u("span",
|
|
3816
|
-
s.timeOf(S.message) ? (c(), u("span",
|
|
3874
|
+
A.role !== "user" ? (c(), u("span", jr, v(s.roleLabel(A)), 1)) : y("", !0),
|
|
3875
|
+
A.role !== "user" && s.timeOf(S.message) ? (c(), u("span", Hr, "·")) : y("", !0),
|
|
3876
|
+
s.timeOf(S.message) ? (c(), u("span", zr, v(s.timeOf(S.message)), 1)) : y("", !0)
|
|
3817
3877
|
], 2)) : y("", !0)
|
|
3818
3878
|
], 64))), 128)),
|
|
3819
3879
|
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (c(), u("div", {
|
|
3820
3880
|
key: 0,
|
|
3821
3881
|
class: O(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
3822
3882
|
}, [
|
|
3823
|
-
A.role !== "user" ? (c(), u("span",
|
|
3824
|
-
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span",
|
|
3825
|
-
s.lastTimeOf(A) ? (c(), u("span",
|
|
3883
|
+
A.role !== "user" ? (c(), u("span", qr, v(s.roleLabel(A)), 1)) : y("", !0),
|
|
3884
|
+
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span", Kr, "·")) : y("", !0),
|
|
3885
|
+
s.lastTimeOf(A) ? (c(), u("span", Vr, v(s.lastTimeOf(A)), 1)) : y("", !0)
|
|
3826
3886
|
], 2)) : y("", !0)
|
|
3827
3887
|
], 64))
|
|
3828
3888
|
], 2)) : y("", !0)
|
|
3829
3889
|
], 64))), 128)),
|
|
3830
|
-
n.streamingActive ? (c(), u("div",
|
|
3831
|
-
o("div",
|
|
3832
|
-
|
|
3890
|
+
n.streamingActive ? (c(), u("div", $r, [
|
|
3891
|
+
o("div", Wr, [
|
|
3892
|
+
K(a, {
|
|
3833
3893
|
size: 26,
|
|
3834
3894
|
tail: !0,
|
|
3835
3895
|
name: n.aiAgentName,
|
|
3836
3896
|
"image-url": n.aiAgentAvatarUrl
|
|
3837
3897
|
}, null, 8, ["name", "image-url"])
|
|
3838
3898
|
]),
|
|
3839
|
-
|
|
3899
|
+
K(B)
|
|
3840
3900
|
])) : y("", !0)
|
|
3841
3901
|
], 34),
|
|
3842
|
-
|
|
3843
|
-
default:
|
|
3902
|
+
K(Re, { name: "wm-scrollDown" }, {
|
|
3903
|
+
default: Ne(() => [
|
|
3844
3904
|
r.showScrollDown ? (c(), u("button", {
|
|
3845
3905
|
key: 0,
|
|
3846
3906
|
type: "button",
|
|
@@ -3862,15 +3922,15 @@ function Pr(e, t, n, i, r, s) {
|
|
|
3862
3922
|
}, [
|
|
3863
3923
|
o("path", { d: "M6 9l6 6 6-6" })
|
|
3864
3924
|
], -1)
|
|
3865
|
-
])], 8,
|
|
3925
|
+
])], 8, Gr)) : y("", !0)
|
|
3866
3926
|
]),
|
|
3867
3927
|
_: 1
|
|
3868
3928
|
})
|
|
3869
3929
|
]);
|
|
3870
3930
|
}
|
|
3871
|
-
const
|
|
3872
|
-
function
|
|
3873
|
-
return
|
|
3931
|
+
const Jr = /* @__PURE__ */ N(Mr, [["render", Yr], ["__scopeId", "data-v-9ddbd0e3"]]), he = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", Ae = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
3932
|
+
function Qr() {
|
|
3933
|
+
return Ae && [
|
|
3874
3934
|
"video/webm;codecs=vp9,opus",
|
|
3875
3935
|
"video/webm;codecs=vp8,opus",
|
|
3876
3936
|
"video/webm",
|
|
@@ -3880,7 +3940,7 @@ function Ur() {
|
|
|
3880
3940
|
return (i = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : i.call(n, t);
|
|
3881
3941
|
}) || "";
|
|
3882
3942
|
}
|
|
3883
|
-
function
|
|
3943
|
+
function Fe({ audio: e }) {
|
|
3884
3944
|
return {
|
|
3885
3945
|
video: !0,
|
|
3886
3946
|
audio: !!e,
|
|
@@ -3889,21 +3949,21 @@ function Pe({ audio: e }) {
|
|
|
3889
3949
|
systemAudio: e ? "include" : "exclude"
|
|
3890
3950
|
};
|
|
3891
3951
|
}
|
|
3892
|
-
function
|
|
3952
|
+
function io(e) {
|
|
3893
3953
|
return e ? e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "file" : "file";
|
|
3894
3954
|
}
|
|
3895
|
-
async function
|
|
3955
|
+
async function Xr() {
|
|
3896
3956
|
if (!he) return null;
|
|
3897
3957
|
let e;
|
|
3898
3958
|
try {
|
|
3899
3959
|
e = await navigator.mediaDevices.getDisplayMedia(
|
|
3900
|
-
|
|
3960
|
+
Fe({ audio: !1 })
|
|
3901
3961
|
);
|
|
3902
3962
|
} catch (t) {
|
|
3903
3963
|
return (t == null ? void 0 : t.name) !== "NotAllowedError" && console.error("[media] screenshot picker", t), null;
|
|
3904
3964
|
}
|
|
3905
3965
|
try {
|
|
3906
|
-
return await
|
|
3966
|
+
return await Zr(e);
|
|
3907
3967
|
} catch (t) {
|
|
3908
3968
|
return console.error("[media] screenshot capture", t), null;
|
|
3909
3969
|
} finally {
|
|
@@ -3912,7 +3972,7 @@ async function Dr() {
|
|
|
3912
3972
|
});
|
|
3913
3973
|
}
|
|
3914
3974
|
}
|
|
3915
|
-
async function
|
|
3975
|
+
async function Zr(e) {
|
|
3916
3976
|
const t = document.createElement("video");
|
|
3917
3977
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
3918
3978
|
const n = t.videoWidth || 1280, i = t.videoHeight || 720, r = document.createElement("canvas");
|
|
@@ -3925,18 +3985,18 @@ async function jr(e) {
|
|
|
3925
3985
|
}), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
3926
3986
|
return new File([s], `capture-${a}.png`, { type: "image/png" });
|
|
3927
3987
|
}
|
|
3928
|
-
async function
|
|
3988
|
+
async function ei(e = {}) {
|
|
3929
3989
|
var k;
|
|
3930
|
-
if (!he || !
|
|
3990
|
+
if (!he || !Ae) return null;
|
|
3931
3991
|
let t;
|
|
3932
3992
|
try {
|
|
3933
3993
|
t = await navigator.mediaDevices.getDisplayMedia(
|
|
3934
|
-
|
|
3994
|
+
Fe({ audio: !0 })
|
|
3935
3995
|
);
|
|
3936
3996
|
} catch (w) {
|
|
3937
3997
|
return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
|
|
3938
3998
|
}
|
|
3939
|
-
const n =
|
|
3999
|
+
const n = Qr();
|
|
3940
4000
|
let i;
|
|
3941
4001
|
try {
|
|
3942
4002
|
i = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
|
|
@@ -3951,13 +4011,13 @@ async function Hr(e = {}) {
|
|
|
3951
4011
|
w.data && w.data.size > 0 && r.push(w.data);
|
|
3952
4012
|
}), i.addEventListener("stop", () => {
|
|
3953
4013
|
var w, T;
|
|
3954
|
-
if (s && clearInterval(s), t.getTracks().forEach((
|
|
3955
|
-
|
|
4014
|
+
if (s && clearInterval(s), t.getTracks().forEach((B) => {
|
|
4015
|
+
B.stop();
|
|
3956
4016
|
}), r.length) {
|
|
3957
|
-
const
|
|
3958
|
-
type:
|
|
4017
|
+
const B = i.mimeType || n || "video/webm", A = new Blob(r, { type: B }), H = /mp4/.test(B) ? "mp4" : "webm", S = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), U = new File([A], `ecran-${S}.${H}`, {
|
|
4018
|
+
type: B
|
|
3959
4019
|
});
|
|
3960
|
-
(w = e.onfinalize) == null || w.call(e,
|
|
4020
|
+
(w = e.onfinalize) == null || w.call(e, U);
|
|
3961
4021
|
} else
|
|
3962
4022
|
(T = e.oncancel) == null || T.call(e);
|
|
3963
4023
|
}), t.getVideoTracks().forEach((w) => {
|
|
@@ -3990,7 +4050,7 @@ async function Hr(e = {}) {
|
|
|
3990
4050
|
}
|
|
3991
4051
|
};
|
|
3992
4052
|
}
|
|
3993
|
-
const
|
|
4053
|
+
const ti = [
|
|
3994
4054
|
{
|
|
3995
4055
|
action: "file",
|
|
3996
4056
|
labelKey: "composer.attachFile",
|
|
@@ -4006,7 +4066,7 @@ const zr = [
|
|
|
4006
4066
|
labelKey: "composer.recordScreen",
|
|
4007
4067
|
path: "M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"
|
|
4008
4068
|
}
|
|
4009
|
-
],
|
|
4069
|
+
], ni = {
|
|
4010
4070
|
name: "WmComposer",
|
|
4011
4071
|
inject: {
|
|
4012
4072
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -4040,10 +4100,10 @@ const zr = [
|
|
|
4040
4100
|
return !this.disabled && !!this.local.trim();
|
|
4041
4101
|
},
|
|
4042
4102
|
attachItems() {
|
|
4043
|
-
return
|
|
4103
|
+
return ti.map((e) => ({
|
|
4044
4104
|
...e,
|
|
4045
4105
|
label: this.t(e.labelKey),
|
|
4046
|
-
disabled: e.action === "screenshot" && !he || e.action === "record" && (!he || !
|
|
4106
|
+
disabled: e.action === "screenshot" && !he || e.action === "record" && (!he || !Ae)
|
|
4047
4107
|
}));
|
|
4048
4108
|
},
|
|
4049
4109
|
recordingElapsedLabel() {
|
|
@@ -4114,13 +4174,13 @@ const zr = [
|
|
|
4114
4174
|
},
|
|
4115
4175
|
async captureScreenshot() {
|
|
4116
4176
|
if (this.disabled) return;
|
|
4117
|
-
const e = await
|
|
4177
|
+
const e = await Xr();
|
|
4118
4178
|
e && this.$emit("attach", e);
|
|
4119
4179
|
},
|
|
4120
4180
|
async startRecording() {
|
|
4121
4181
|
if (this.recording || this.disabled) return;
|
|
4122
4182
|
this.recordingElapsed = 0;
|
|
4123
|
-
const e = await
|
|
4183
|
+
const e = await ei({
|
|
4124
4184
|
onstart: () => {
|
|
4125
4185
|
this.recording = !0;
|
|
4126
4186
|
},
|
|
@@ -4162,30 +4222,30 @@ const zr = [
|
|
|
4162
4222
|
!e || !this._vvHandler || (e.removeEventListener("resize", this._vvHandler), e.removeEventListener("scroll", this._vvHandler), this._vvHandler = null);
|
|
4163
4223
|
}
|
|
4164
4224
|
}
|
|
4165
|
-
},
|
|
4225
|
+
}, si = {
|
|
4166
4226
|
key: 0,
|
|
4167
4227
|
class: "wm-rec"
|
|
4168
|
-
},
|
|
4228
|
+
}, ri = { class: "wm-rec__lbl" }, ii = {
|
|
4169
4229
|
key: 1,
|
|
4170
4230
|
class: "wm-compose__menu",
|
|
4171
4231
|
role: "menu"
|
|
4172
|
-
},
|
|
4232
|
+
}, ai = ["disabled", "onClick"], oi = { class: "wm-compose__menuIcon" }, li = {
|
|
4173
4233
|
viewBox: "0 0 24 24",
|
|
4174
4234
|
width: "14",
|
|
4175
4235
|
height: "14",
|
|
4176
4236
|
"aria-hidden": "true"
|
|
4177
|
-
},
|
|
4178
|
-
function
|
|
4237
|
+
}, ci = ["d"], di = ["placeholder", "disabled"], ui = { class: "wm-compose__actions" }, hi = ["title", "aria-label", "disabled"], mi = ["disabled", "aria-label"];
|
|
4238
|
+
function fi(e, t, n, i, r, s) {
|
|
4179
4239
|
return c(), u("div", {
|
|
4180
4240
|
class: O(["wm-compose-wrap", { "wm-compose-wrap--sheet": n.displayMode === "sheet" }]),
|
|
4181
|
-
style:
|
|
4241
|
+
style: z(r.kbOffset ? { transform: `translateY(-${r.kbOffset}px)` } : null)
|
|
4182
4242
|
}, [
|
|
4183
|
-
r.recording ? (c(), u("div",
|
|
4243
|
+
r.recording ? (c(), u("div", si, [
|
|
4184
4244
|
t[8] || (t[8] = o("span", {
|
|
4185
4245
|
class: "wm-rec__dot",
|
|
4186
4246
|
"aria-hidden": "true"
|
|
4187
4247
|
}, null, -1)),
|
|
4188
|
-
o("span",
|
|
4248
|
+
o("span", ri, v(s.t("composer.recording", { time: s.recordingElapsedLabel })), 1),
|
|
4189
4249
|
o("button", {
|
|
4190
4250
|
type: "button",
|
|
4191
4251
|
class: "wm-rec__stop",
|
|
@@ -4208,16 +4268,16 @@ function ti(e, t, n, i, r, s) {
|
|
|
4208
4268
|
class: "wm-compose__overlay",
|
|
4209
4269
|
onClick: t[2] || (t[2] = (a) => r.attachOpen = !1)
|
|
4210
4270
|
})) : y("", !0),
|
|
4211
|
-
r.attachOpen ? (c(), u("div",
|
|
4212
|
-
(c(!0), u(
|
|
4271
|
+
r.attachOpen ? (c(), u("div", ii, [
|
|
4272
|
+
(c(!0), u(E, null, F(s.attachItems, (a) => (c(), u("button", {
|
|
4213
4273
|
key: a.action,
|
|
4214
4274
|
type: "button",
|
|
4215
4275
|
class: "wm-compose__menuItem",
|
|
4216
4276
|
disabled: a.disabled,
|
|
4217
4277
|
onClick: (l) => s.onAttachAction(a.action)
|
|
4218
4278
|
}, [
|
|
4219
|
-
o("span",
|
|
4220
|
-
(c(), u("svg",
|
|
4279
|
+
o("span", oi, [
|
|
4280
|
+
(c(), u("svg", li, [
|
|
4221
4281
|
o("path", {
|
|
4222
4282
|
d: a.path,
|
|
4223
4283
|
stroke: "currentColor",
|
|
@@ -4225,13 +4285,13 @@ function ti(e, t, n, i, r, s) {
|
|
|
4225
4285
|
"stroke-linecap": "round",
|
|
4226
4286
|
"stroke-linejoin": "round",
|
|
4227
4287
|
fill: "none"
|
|
4228
|
-
}, null, 8,
|
|
4288
|
+
}, null, 8, ci)
|
|
4229
4289
|
]))
|
|
4230
4290
|
]),
|
|
4231
4291
|
o("span", null, v(a.label), 1)
|
|
4232
|
-
], 8,
|
|
4292
|
+
], 8, ai))), 128))
|
|
4233
4293
|
])) : y("", !0),
|
|
4234
|
-
|
|
4294
|
+
$(o("textarea", {
|
|
4235
4295
|
ref: "inputEl",
|
|
4236
4296
|
"onUpdate:modelValue": t[3] || (t[3] = (a) => r.local = a),
|
|
4237
4297
|
class: "wm-compose__input",
|
|
@@ -4240,10 +4300,10 @@ function ti(e, t, n, i, r, s) {
|
|
|
4240
4300
|
disabled: n.disabled,
|
|
4241
4301
|
onKeydown: t[4] || (t[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
|
|
4242
4302
|
onInput: t[5] || (t[5] = (...a) => s.autosize && s.autosize(...a))
|
|
4243
|
-
}, null, 40,
|
|
4303
|
+
}, null, 40, di), [
|
|
4244
4304
|
[X, r.local]
|
|
4245
4305
|
]),
|
|
4246
|
-
o("div",
|
|
4306
|
+
o("div", ui, [
|
|
4247
4307
|
o("button", {
|
|
4248
4308
|
type: "button",
|
|
4249
4309
|
class: O(["wm-compose__icon", { "is-open": r.attachOpen }]),
|
|
@@ -4265,7 +4325,7 @@ function ti(e, t, n, i, r, s) {
|
|
|
4265
4325
|
}, [
|
|
4266
4326
|
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" })
|
|
4267
4327
|
], -1)
|
|
4268
|
-
])], 10,
|
|
4328
|
+
])], 10, hi),
|
|
4269
4329
|
o("button", {
|
|
4270
4330
|
type: "submit",
|
|
4271
4331
|
class: O(["wm-compose__send", { "is-empty": !s.canSend }]),
|
|
@@ -4285,12 +4345,12 @@ function ti(e, t, n, i, r, s) {
|
|
|
4285
4345
|
}, [
|
|
4286
4346
|
o("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
4287
4347
|
], -1)
|
|
4288
|
-
])], 10,
|
|
4348
|
+
])], 10, mi)
|
|
4289
4349
|
])
|
|
4290
4350
|
], 34)
|
|
4291
4351
|
], 6);
|
|
4292
4352
|
}
|
|
4293
|
-
const
|
|
4353
|
+
const _i = /* @__PURE__ */ N(ni, [["render", fi], ["__scopeId", "data-v-01e81a27"]]), gi = {
|
|
4294
4354
|
name: "WmSuggestionChips",
|
|
4295
4355
|
props: {
|
|
4296
4356
|
items: { type: Array, default: () => [] },
|
|
@@ -4307,22 +4367,22 @@ const ni = /* @__PURE__ */ N(qr, [["render", ti], ["__scopeId", "data-v-01e81a27
|
|
|
4307
4367
|
return this.items.map((e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.text) || "").join("§");
|
|
4308
4368
|
}
|
|
4309
4369
|
}
|
|
4310
|
-
},
|
|
4311
|
-
function
|
|
4370
|
+
}, pi = ["onClick"];
|
|
4371
|
+
function vi(e, t, n, i, r, s) {
|
|
4312
4372
|
return n.items.length ? (c(), u("div", {
|
|
4313
4373
|
key: s.batchKey,
|
|
4314
4374
|
class: "wm-chips"
|
|
4315
4375
|
}, [
|
|
4316
|
-
(c(!0), u(
|
|
4376
|
+
(c(!0), u(E, null, F(n.items, (a, l) => (c(), u("button", {
|
|
4317
4377
|
key: l,
|
|
4318
4378
|
type: "button",
|
|
4319
4379
|
class: "wm-chip",
|
|
4320
|
-
style:
|
|
4380
|
+
style: z({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
|
|
4321
4381
|
onClick: (p) => e.$emit("select", a)
|
|
4322
|
-
}, v(a.label), 13,
|
|
4382
|
+
}, v(a.label), 13, pi))), 128))
|
|
4323
4383
|
])) : y("", !0);
|
|
4324
4384
|
}
|
|
4325
|
-
const
|
|
4385
|
+
const yi = /* @__PURE__ */ N(gi, [["render", vi], ["__scopeId", "data-v-47ad8085"]]), wi = {
|
|
4326
4386
|
name: "WmApprovalCard",
|
|
4327
4387
|
components: { AIAvatar: le },
|
|
4328
4388
|
inject: {
|
|
@@ -4366,27 +4426,27 @@ const ai = /* @__PURE__ */ N(si, [["render", ii], ["__scopeId", "data-v-47ad8085
|
|
|
4366
4426
|
return ((e = this.rejectCallback) == null ? void 0 : e.label) || this.t("approval.reject");
|
|
4367
4427
|
}
|
|
4368
4428
|
}
|
|
4369
|
-
},
|
|
4429
|
+
}, bi = { class: "wm-approval" }, ki = { class: "wm-approval__head" }, Ci = { class: "wm-approval__icon" }, Ai = { class: "wm-approval__main" }, Si = { class: "wm-approval__title" }, Mi = {
|
|
4370
4430
|
key: 0,
|
|
4371
4431
|
class: "wm-approval__detail"
|
|
4372
|
-
},
|
|
4373
|
-
function
|
|
4432
|
+
}, Ti = { class: "wm-approval__actions" };
|
|
4433
|
+
function xi(e, t, n, i, r, s) {
|
|
4374
4434
|
const a = R("AIAvatar");
|
|
4375
|
-
return c(), u("div",
|
|
4376
|
-
o("div",
|
|
4377
|
-
o("div",
|
|
4378
|
-
|
|
4435
|
+
return c(), u("div", bi, [
|
|
4436
|
+
o("div", ki, [
|
|
4437
|
+
o("div", Ci, [
|
|
4438
|
+
K(a, {
|
|
4379
4439
|
size: 24,
|
|
4380
4440
|
name: n.agentName,
|
|
4381
4441
|
"image-url": n.agentAvatarUrl
|
|
4382
4442
|
}, null, 8, ["name", "image-url"])
|
|
4383
4443
|
]),
|
|
4384
|
-
o("div",
|
|
4385
|
-
o("div",
|
|
4386
|
-
n.detail ? (c(), u("div",
|
|
4444
|
+
o("div", Ai, [
|
|
4445
|
+
o("div", Si, v(n.action), 1),
|
|
4446
|
+
n.detail ? (c(), u("div", Mi, v(n.detail), 1)) : y("", !0)
|
|
4387
4447
|
])
|
|
4388
4448
|
]),
|
|
4389
|
-
o("div",
|
|
4449
|
+
o("div", Ti, [
|
|
4390
4450
|
s.rejectId ? (c(), u("button", {
|
|
4391
4451
|
key: 0,
|
|
4392
4452
|
type: "button",
|
|
@@ -4402,9 +4462,9 @@ function gi(e, t, n, i, r, s) {
|
|
|
4402
4462
|
])
|
|
4403
4463
|
]);
|
|
4404
4464
|
}
|
|
4405
|
-
const
|
|
4406
|
-
let
|
|
4407
|
-
const
|
|
4465
|
+
const Oi = /* @__PURE__ */ N(wi, [["render", xi], ["__scopeId", "data-v-a2bed37e"]]);
|
|
4466
|
+
let Ee = 0;
|
|
4467
|
+
const Ii = /* @__PURE__ */ new Set([
|
|
4408
4468
|
"text",
|
|
4409
4469
|
"textarea",
|
|
4410
4470
|
"number",
|
|
@@ -4412,7 +4472,7 @@ const pi = /* @__PURE__ */ new Set([
|
|
|
4412
4472
|
"select",
|
|
4413
4473
|
"multiselect",
|
|
4414
4474
|
"date"
|
|
4415
|
-
]),
|
|
4475
|
+
]), Li = {
|
|
4416
4476
|
name: "WmFormCard",
|
|
4417
4477
|
components: { AIAvatar: le },
|
|
4418
4478
|
inject: {
|
|
@@ -4429,8 +4489,8 @@ const pi = /* @__PURE__ */ new Set([
|
|
|
4429
4489
|
},
|
|
4430
4490
|
emits: ["submit"],
|
|
4431
4491
|
data() {
|
|
4432
|
-
return
|
|
4433
|
-
_uid:
|
|
4492
|
+
return Ee += 1, {
|
|
4493
|
+
_uid: Ee,
|
|
4434
4494
|
values: {},
|
|
4435
4495
|
busy: !1,
|
|
4436
4496
|
error: ""
|
|
@@ -4442,7 +4502,7 @@ const pi = /* @__PURE__ */ new Set([
|
|
|
4442
4502
|
// douteux.
|
|
4443
4503
|
normalizedFields() {
|
|
4444
4504
|
var t;
|
|
4445
|
-
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !
|
|
4505
|
+
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !Ii.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
|
|
4446
4506
|
}
|
|
4447
4507
|
},
|
|
4448
4508
|
created() {
|
|
@@ -4495,54 +4555,54 @@ const pi = /* @__PURE__ */ new Set([
|
|
|
4495
4555
|
}
|
|
4496
4556
|
}
|
|
4497
4557
|
}
|
|
4498
|
-
},
|
|
4558
|
+
}, Ei = { class: "wm-form" }, Bi = { class: "wm-form__head" }, Ri = { class: "wm-form__icon" }, Ni = { class: "wm-form__main" }, Pi = { class: "wm-form__title" }, Ui = {
|
|
4499
4559
|
key: 0,
|
|
4500
4560
|
class: "wm-form__detail"
|
|
4501
|
-
},
|
|
4561
|
+
}, Fi = ["for"], Di = {
|
|
4502
4562
|
key: 0,
|
|
4503
4563
|
class: "wm-form__req",
|
|
4504
4564
|
"aria-hidden": "true"
|
|
4505
|
-
},
|
|
4565
|
+
}, ji = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Hi = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], zi = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], qi = ["id", "onUpdate:modelValue", "required", "disabled"], Ki = {
|
|
4506
4566
|
key: 4,
|
|
4507
4567
|
class: "wm-form__bool"
|
|
4508
|
-
},
|
|
4568
|
+
}, Vi = ["id", "onUpdate:modelValue", "disabled"], $i = ["id", "onUpdate:modelValue", "required", "disabled"], Wi = {
|
|
4509
4569
|
value: "",
|
|
4510
4570
|
disabled: ""
|
|
4511
|
-
},
|
|
4571
|
+
}, Gi = ["value"], Yi = {
|
|
4512
4572
|
key: 6,
|
|
4513
4573
|
class: "wm-form__multi"
|
|
4514
|
-
},
|
|
4574
|
+
}, Ji = ["value", "checked", "disabled", "onChange"], Qi = {
|
|
4515
4575
|
key: 0,
|
|
4516
4576
|
class: "wm-form__err"
|
|
4517
|
-
},
|
|
4577
|
+
}, Xi = ["disabled"], Zi = {
|
|
4518
4578
|
key: 0,
|
|
4519
4579
|
class: "wm-form__spinner",
|
|
4520
4580
|
"aria-hidden": "true"
|
|
4521
|
-
},
|
|
4581
|
+
}, ea = {
|
|
4522
4582
|
key: 2,
|
|
4523
4583
|
class: "wm-form__doneLbl"
|
|
4524
4584
|
};
|
|
4525
|
-
function
|
|
4585
|
+
function ta(e, t, n, i, r, s) {
|
|
4526
4586
|
const a = R("AIAvatar");
|
|
4527
|
-
return c(), u("div",
|
|
4528
|
-
o("div",
|
|
4529
|
-
o("div",
|
|
4530
|
-
|
|
4587
|
+
return c(), u("div", Ei, [
|
|
4588
|
+
o("div", Bi, [
|
|
4589
|
+
o("div", Ri, [
|
|
4590
|
+
K(a, {
|
|
4531
4591
|
size: 24,
|
|
4532
4592
|
name: n.agentName,
|
|
4533
4593
|
"image-url": n.agentAvatarUrl
|
|
4534
4594
|
}, null, 8, ["name", "image-url"])
|
|
4535
4595
|
]),
|
|
4536
|
-
o("div",
|
|
4537
|
-
o("div",
|
|
4538
|
-
n.form.description ? (c(), u("div",
|
|
4596
|
+
o("div", Ni, [
|
|
4597
|
+
o("div", Pi, v(n.form.title || s.t("form.title")), 1),
|
|
4598
|
+
n.form.description ? (c(), u("div", Ui, v(n.form.description), 1)) : y("", !0)
|
|
4539
4599
|
])
|
|
4540
4600
|
]),
|
|
4541
4601
|
o("form", {
|
|
4542
4602
|
class: "wm-form__body",
|
|
4543
4603
|
onSubmit: t[0] || (t[0] = G((...l) => s.onSubmit && s.onSubmit(...l), ["prevent"]))
|
|
4544
4604
|
}, [
|
|
4545
|
-
(c(!0), u(
|
|
4605
|
+
(c(!0), u(E, null, F(s.normalizedFields, (l) => (c(), u("div", {
|
|
4546
4606
|
key: l.key,
|
|
4547
4607
|
class: "wm-form__field"
|
|
4548
4608
|
}, [
|
|
@@ -4550,10 +4610,10 @@ function zi(e, t, n, i, r, s) {
|
|
|
4550
4610
|
for: `wm-f-${r._uid}-${l.key}`,
|
|
4551
4611
|
class: "wm-form__label"
|
|
4552
4612
|
}, [
|
|
4553
|
-
|
|
4554
|
-
l.required ? (c(), u("span",
|
|
4555
|
-
], 8,
|
|
4556
|
-
l.type === "text" ?
|
|
4613
|
+
ye(v(l.label), 1),
|
|
4614
|
+
l.required ? (c(), u("span", Di, "*")) : y("", !0)
|
|
4615
|
+
], 8, Fi),
|
|
4616
|
+
l.type === "text" ? $((c(), u("input", {
|
|
4557
4617
|
key: 0,
|
|
4558
4618
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4559
4619
|
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
@@ -4562,9 +4622,9 @@ function zi(e, t, n, i, r, s) {
|
|
|
4562
4622
|
placeholder: l.placeholder || "",
|
|
4563
4623
|
required: l.required,
|
|
4564
4624
|
disabled: n.readOnly || r.busy
|
|
4565
|
-
}, null, 8,
|
|
4625
|
+
}, null, 8, ji)), [
|
|
4566
4626
|
[X, r.values[l.key]]
|
|
4567
|
-
]) : l.type === "textarea" ?
|
|
4627
|
+
]) : l.type === "textarea" ? $((c(), u("textarea", {
|
|
4568
4628
|
key: 1,
|
|
4569
4629
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4570
4630
|
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
@@ -4573,9 +4633,9 @@ function zi(e, t, n, i, r, s) {
|
|
|
4573
4633
|
placeholder: l.placeholder || "",
|
|
4574
4634
|
required: l.required,
|
|
4575
4635
|
disabled: n.readOnly || r.busy
|
|
4576
|
-
}, null, 8,
|
|
4636
|
+
}, null, 8, Hi)), [
|
|
4577
4637
|
[X, r.values[l.key]]
|
|
4578
|
-
]) : l.type === "number" ?
|
|
4638
|
+
]) : l.type === "number" ? $((c(), u("input", {
|
|
4579
4639
|
key: 2,
|
|
4580
4640
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4581
4641
|
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
@@ -4584,14 +4644,14 @@ function zi(e, t, n, i, r, s) {
|
|
|
4584
4644
|
placeholder: l.placeholder || "",
|
|
4585
4645
|
required: l.required,
|
|
4586
4646
|
disabled: n.readOnly || r.busy
|
|
4587
|
-
}, null, 8,
|
|
4647
|
+
}, null, 8, zi)), [
|
|
4588
4648
|
[
|
|
4589
4649
|
X,
|
|
4590
4650
|
r.values[l.key],
|
|
4591
4651
|
void 0,
|
|
4592
4652
|
{ number: !0 }
|
|
4593
4653
|
]
|
|
4594
|
-
]) : l.type === "date" ?
|
|
4654
|
+
]) : l.type === "date" ? $((c(), u("input", {
|
|
4595
4655
|
key: 3,
|
|
4596
4656
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4597
4657
|
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
@@ -4599,19 +4659,19 @@ function zi(e, t, n, i, r, s) {
|
|
|
4599
4659
|
class: "wm-form__input",
|
|
4600
4660
|
required: l.required,
|
|
4601
4661
|
disabled: n.readOnly || r.busy
|
|
4602
|
-
}, null, 8,
|
|
4662
|
+
}, null, 8, qi)), [
|
|
4603
4663
|
[X, r.values[l.key]]
|
|
4604
|
-
]) : l.type === "boolean" ? (c(), u("label",
|
|
4605
|
-
|
|
4664
|
+
]) : l.type === "boolean" ? (c(), u("label", Ki, [
|
|
4665
|
+
$(o("input", {
|
|
4606
4666
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4607
4667
|
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
4608
4668
|
type: "checkbox",
|
|
4609
4669
|
disabled: n.readOnly || r.busy
|
|
4610
|
-
}, null, 8,
|
|
4611
|
-
[
|
|
4670
|
+
}, null, 8, Vi), [
|
|
4671
|
+
[ze, r.values[l.key]]
|
|
4612
4672
|
]),
|
|
4613
4673
|
o("span", null, v(l.placeholder || s.t("common.yes")), 1)
|
|
4614
|
-
])) : l.type === "select" ?
|
|
4674
|
+
])) : l.type === "select" ? $((c(), u("select", {
|
|
4615
4675
|
key: 5,
|
|
4616
4676
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
4617
4677
|
"onUpdate:modelValue": (p) => r.values[l.key] = p,
|
|
@@ -4619,15 +4679,15 @@ function zi(e, t, n, i, r, s) {
|
|
|
4619
4679
|
required: l.required,
|
|
4620
4680
|
disabled: n.readOnly || r.busy
|
|
4621
4681
|
}, [
|
|
4622
|
-
o("option",
|
|
4623
|
-
(c(!0), u(
|
|
4682
|
+
o("option", Wi, v(l.placeholder || s.t("form.choose")), 1),
|
|
4683
|
+
(c(!0), u(E, null, F(l.options, (p) => (c(), u("option", {
|
|
4624
4684
|
key: p.value,
|
|
4625
4685
|
value: p.value
|
|
4626
|
-
}, v(p.label), 9,
|
|
4627
|
-
], 8,
|
|
4628
|
-
[
|
|
4629
|
-
]) : l.type === "multiselect" ? (c(), u("div",
|
|
4630
|
-
(c(!0), u(
|
|
4686
|
+
}, v(p.label), 9, Gi))), 128))
|
|
4687
|
+
], 8, $i)), [
|
|
4688
|
+
[qe, r.values[l.key]]
|
|
4689
|
+
]) : l.type === "multiselect" ? (c(), u("div", Yi, [
|
|
4690
|
+
(c(!0), u(E, null, F(l.options, (p) => (c(), u("label", {
|
|
4631
4691
|
key: p.value,
|
|
4632
4692
|
class: "wm-form__multiItem"
|
|
4633
4693
|
}, [
|
|
@@ -4641,25 +4701,25 @@ function zi(e, t, n, i, r, s) {
|
|
|
4641
4701
|
p.value,
|
|
4642
4702
|
k.target.checked
|
|
4643
4703
|
)
|
|
4644
|
-
}, null, 40,
|
|
4704
|
+
}, null, 40, Ji),
|
|
4645
4705
|
o("span", null, v(p.label), 1)
|
|
4646
4706
|
]))), 128))
|
|
4647
4707
|
])) : y("", !0)
|
|
4648
4708
|
]))), 128)),
|
|
4649
|
-
r.error ? (c(), u("div",
|
|
4650
|
-
n.readOnly ? (c(), u("div",
|
|
4709
|
+
r.error ? (c(), u("div", Qi, v(r.error), 1)) : y("", !0),
|
|
4710
|
+
n.readOnly ? (c(), u("div", ea, v(s.t("form.responseSent")), 1)) : (c(), u("button", {
|
|
4651
4711
|
key: 1,
|
|
4652
4712
|
type: "submit",
|
|
4653
4713
|
class: "wm-form__submit",
|
|
4654
4714
|
disabled: r.busy
|
|
4655
4715
|
}, [
|
|
4656
|
-
r.busy ? (c(), u("span",
|
|
4716
|
+
r.busy ? (c(), u("span", Zi)) : y("", !0),
|
|
4657
4717
|
o("span", null, v(r.busy ? s.t("common.sending") : n.form.submit_label || s.t("common.send")), 1)
|
|
4658
|
-
], 8,
|
|
4718
|
+
], 8, Xi))
|
|
4659
4719
|
], 32)
|
|
4660
4720
|
]);
|
|
4661
4721
|
}
|
|
4662
|
-
const
|
|
4722
|
+
const na = /* @__PURE__ */ N(Li, [["render", ta], ["__scopeId", "data-v-fe65cc56"]]), sa = {
|
|
4663
4723
|
name: "WmFeedback",
|
|
4664
4724
|
inject: {
|
|
4665
4725
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -4693,13 +4753,13 @@ const qi = /* @__PURE__ */ N(vi, [["render", zi], ["__scopeId", "data-v-fe65cc56
|
|
|
4693
4753
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
4694
4754
|
}
|
|
4695
4755
|
}
|
|
4696
|
-
},
|
|
4756
|
+
}, ra = { class: "wm-fb" }, ia = { class: "wm-fb__title" }, aa = { class: "wm-fb__sub" }, oa = { class: "wm-fb__row" }, la = ["onClick"], ca = { class: "wm-fb__emoji" }, da = { class: "wm-fb__label" }, ua = ["disabled"], ha = {
|
|
4697
4757
|
key: 1,
|
|
4698
4758
|
class: "wm-fb__done"
|
|
4699
|
-
},
|
|
4700
|
-
function
|
|
4701
|
-
return c(), u("div",
|
|
4702
|
-
n.done ? (c(), u("div",
|
|
4759
|
+
}, ma = { class: "wm-fb__doneTitle" }, fa = { class: "wm-fb__doneSub" };
|
|
4760
|
+
function _a(e, t, n, i, r, s) {
|
|
4761
|
+
return c(), u("div", ra, [
|
|
4762
|
+
n.done ? (c(), u("div", ha, [
|
|
4703
4763
|
t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
|
|
4704
4764
|
o("svg", {
|
|
4705
4765
|
width: "16",
|
|
@@ -4715,32 +4775,32 @@ function na(e, t, n, i, r, s) {
|
|
|
4715
4775
|
o("path", { d: "M20 6L9 17l-5-5" })
|
|
4716
4776
|
])
|
|
4717
4777
|
], -1)),
|
|
4718
|
-
o("div",
|
|
4719
|
-
o("div",
|
|
4720
|
-
])) : (c(), u(
|
|
4721
|
-
o("div",
|
|
4722
|
-
o("div",
|
|
4723
|
-
o("div",
|
|
4724
|
-
(c(!0), u(
|
|
4778
|
+
o("div", ma, v(s.t("feedback.doneTitle")), 1),
|
|
4779
|
+
o("div", fa, v(s.t("feedback.doneSubtitle")), 1)
|
|
4780
|
+
])) : (c(), u(E, { key: 0 }, [
|
|
4781
|
+
o("div", ia, v(s.t("feedback.question")), 1),
|
|
4782
|
+
o("div", aa, v(s.t("feedback.subtitle")), 1),
|
|
4783
|
+
o("div", oa, [
|
|
4784
|
+
(c(!0), u(E, null, F(s.options, (a) => (c(), u("button", {
|
|
4725
4785
|
key: a.v,
|
|
4726
4786
|
type: "button",
|
|
4727
4787
|
class: O(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
|
|
4728
4788
|
onClick: (l) => r.sel = a.v
|
|
4729
4789
|
}, [
|
|
4730
|
-
o("span",
|
|
4731
|
-
o("span",
|
|
4732
|
-
], 10,
|
|
4790
|
+
o("span", ca, v(a.e), 1),
|
|
4791
|
+
o("span", da, v(a.l), 1)
|
|
4792
|
+
], 10, la))), 128))
|
|
4733
4793
|
]),
|
|
4734
4794
|
o("button", {
|
|
4735
4795
|
type: "button",
|
|
4736
4796
|
class: "wm-fb__send",
|
|
4737
4797
|
disabled: !r.sel || n.busy,
|
|
4738
4798
|
onClick: t[0] || (t[0] = (...a) => s.onSend && s.onSend(...a))
|
|
4739
|
-
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9,
|
|
4799
|
+
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9, ua)
|
|
4740
4800
|
], 64))
|
|
4741
4801
|
]);
|
|
4742
4802
|
}
|
|
4743
|
-
const
|
|
4803
|
+
const ga = /* @__PURE__ */ N(sa, [["render", _a], ["__scopeId", "data-v-9b630564"]]), pa = {
|
|
4744
4804
|
name: "WmMoreMenu",
|
|
4745
4805
|
inject: {
|
|
4746
4806
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -4783,24 +4843,24 @@ const sa = /* @__PURE__ */ N($i, [["render", na], ["__scopeId", "data-v-9b630564
|
|
|
4783
4843
|
this.browserNotifOn = !this.browserNotifOn, this.$emit("browser-notif-toggle", this.browserNotifOn);
|
|
4784
4844
|
}
|
|
4785
4845
|
}
|
|
4786
|
-
},
|
|
4846
|
+
}, va = { class: "wm-mm" }, ya = {
|
|
4787
4847
|
class: "wm-mm__pop",
|
|
4788
4848
|
role: "menu"
|
|
4789
|
-
},
|
|
4849
|
+
}, wa = {
|
|
4790
4850
|
key: 0,
|
|
4791
4851
|
class: "wm-mm__section"
|
|
4792
|
-
},
|
|
4852
|
+
}, ba = { class: "wm-mm__label" }, ka = { class: "wm-mm__label" }, Ca = {
|
|
4793
4853
|
key: 1,
|
|
4794
4854
|
class: "wm-mm__sep"
|
|
4795
|
-
},
|
|
4796
|
-
function
|
|
4797
|
-
return c(), u("div",
|
|
4855
|
+
}, Aa = { class: "wm-mm__section" }, Sa = { class: "wm-mm__label" }, Ma = { class: "wm-mm__label" }, Ta = { class: "wm-mm__section" }, xa = { class: "wm-mm__label" }, Oa = { class: "wm-mm__label" };
|
|
4856
|
+
function Ia(e, t, n, i, r, s) {
|
|
4857
|
+
return c(), u("div", va, [
|
|
4798
4858
|
o("div", {
|
|
4799
4859
|
class: "wm-mm__scrim",
|
|
4800
4860
|
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4801
4861
|
}),
|
|
4802
|
-
o("div",
|
|
4803
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4862
|
+
o("div", ya, [
|
|
4863
|
+
n.canRename || n.canExport ? (c(), u("div", wa, [
|
|
4804
4864
|
n.canRename ? (c(), u("button", {
|
|
4805
4865
|
key: 0,
|
|
4806
4866
|
type: "button",
|
|
@@ -4823,7 +4883,7 @@ function pa(e, t, n, i, r, s) {
|
|
|
4823
4883
|
o("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" })
|
|
4824
4884
|
])
|
|
4825
4885
|
], -1)),
|
|
4826
|
-
o("span",
|
|
4886
|
+
o("span", ba, v(s.t("moreMenu.editTitle")), 1)
|
|
4827
4887
|
])) : y("", !0),
|
|
4828
4888
|
n.canExport ? (c(), u("button", {
|
|
4829
4889
|
key: 1,
|
|
@@ -4846,12 +4906,12 @@ function pa(e, t, n, i, r, s) {
|
|
|
4846
4906
|
o("path", { d: "M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" })
|
|
4847
4907
|
])
|
|
4848
4908
|
], -1)),
|
|
4849
|
-
o("span",
|
|
4909
|
+
o("span", ka, v(s.t("moreMenu.exportTranscript")), 1),
|
|
4850
4910
|
t[9] || (t[9] = o("span", { class: "wm-mm__hint" }, ".txt", -1))
|
|
4851
4911
|
])) : y("", !0)
|
|
4852
4912
|
])) : y("", !0),
|
|
4853
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4854
|
-
o("div",
|
|
4913
|
+
n.canRename || n.canExport ? (c(), u("div", Ca)) : y("", !0),
|
|
4914
|
+
o("div", Aa, [
|
|
4855
4915
|
o("button", {
|
|
4856
4916
|
type: "button",
|
|
4857
4917
|
class: "wm-mm__item",
|
|
@@ -4873,7 +4933,7 @@ function pa(e, t, n, i, r, s) {
|
|
|
4873
4933
|
o("path", { d: "M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" })
|
|
4874
4934
|
])
|
|
4875
4935
|
], -1)),
|
|
4876
|
-
o("span",
|
|
4936
|
+
o("span", Sa, v(s.t("moreMenu.sound")), 1),
|
|
4877
4937
|
o("span", {
|
|
4878
4938
|
class: O(["wm-mm__toggle", { "wm-mm__toggle--on": r.soundOn }])
|
|
4879
4939
|
}, [...t[10] || (t[10] = [
|
|
@@ -4900,7 +4960,7 @@ function pa(e, t, n, i, r, s) {
|
|
|
4900
4960
|
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" })
|
|
4901
4961
|
])
|
|
4902
4962
|
], -1)),
|
|
4903
|
-
o("span",
|
|
4963
|
+
o("span", Ma, v(s.t("moreMenu.browserNotifications")), 1),
|
|
4904
4964
|
o("span", {
|
|
4905
4965
|
class: O(["wm-mm__toggle", { "wm-mm__toggle--on": r.browserNotifOn }])
|
|
4906
4966
|
}, [...t[12] || (t[12] = [
|
|
@@ -4909,7 +4969,7 @@ function pa(e, t, n, i, r, s) {
|
|
|
4909
4969
|
])
|
|
4910
4970
|
]),
|
|
4911
4971
|
t[16] || (t[16] = o("div", { class: "wm-mm__sep" }, null, -1)),
|
|
4912
|
-
o("div",
|
|
4972
|
+
o("div", Ta, [
|
|
4913
4973
|
n.statusUrl ? (c(), u("button", {
|
|
4914
4974
|
key: 0,
|
|
4915
4975
|
type: "button",
|
|
@@ -4931,7 +4991,7 @@ function pa(e, t, n, i, r, s) {
|
|
|
4931
4991
|
o("path", { d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2" })
|
|
4932
4992
|
])
|
|
4933
4993
|
], -1)),
|
|
4934
|
-
o("span",
|
|
4994
|
+
o("span", xa, v(s.t("moreMenu.serviceStatus")), 1)
|
|
4935
4995
|
])) : y("", !0),
|
|
4936
4996
|
n.helpUrl ? (c(), u("button", {
|
|
4937
4997
|
key: 1,
|
|
@@ -4954,13 +5014,13 @@ function pa(e, t, n, i, r, s) {
|
|
|
4954
5014
|
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" })
|
|
4955
5015
|
])
|
|
4956
5016
|
], -1)),
|
|
4957
|
-
o("span",
|
|
5017
|
+
o("span", Oa, v(s.t("moreMenu.helpCenter")), 1)
|
|
4958
5018
|
])) : y("", !0)
|
|
4959
5019
|
])
|
|
4960
5020
|
])
|
|
4961
5021
|
]);
|
|
4962
5022
|
}
|
|
4963
|
-
const
|
|
5023
|
+
const La = /* @__PURE__ */ N(pa, [["render", Ia], ["__scopeId", "data-v-76281e95"]]), Ea = {
|
|
4964
5024
|
name: "WmRenameDialog",
|
|
4965
5025
|
inject: {
|
|
4966
5026
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -5002,20 +5062,20 @@ const va = /* @__PURE__ */ N(ra, [["render", pa], ["__scopeId", "data-v-76281e95
|
|
|
5002
5062
|
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
5003
5063
|
}
|
|
5004
5064
|
}
|
|
5005
|
-
},
|
|
5065
|
+
}, Ba = { class: "wm-dialog" }, Ra = {
|
|
5006
5066
|
class: "wm-dialog__card",
|
|
5007
5067
|
role: "dialog",
|
|
5008
5068
|
"aria-modal": "true"
|
|
5009
|
-
},
|
|
5010
|
-
function
|
|
5011
|
-
return c(), u("div",
|
|
5069
|
+
}, Na = { class: "wm-dialog__head" }, Pa = { class: "wm-dialog__title" }, Ua = ["aria-label"], Fa = { class: "wm-dialog__body" }, Da = ["placeholder"], ja = { class: "wm-dialog__actions" }, Ha = ["disabled"];
|
|
5070
|
+
function za(e, t, n, i, r, s) {
|
|
5071
|
+
return c(), u("div", Ba, [
|
|
5012
5072
|
o("div", {
|
|
5013
5073
|
class: "wm-dialog__scrim",
|
|
5014
5074
|
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
5015
5075
|
}),
|
|
5016
|
-
o("div",
|
|
5017
|
-
o("div",
|
|
5018
|
-
o("div",
|
|
5076
|
+
o("div", Ra, [
|
|
5077
|
+
o("div", Na, [
|
|
5078
|
+
o("div", Pa, v(n.title || s.t("rename.title")), 1),
|
|
5019
5079
|
o("button", {
|
|
5020
5080
|
type: "button",
|
|
5021
5081
|
class: "wm-dialog__close",
|
|
@@ -5035,10 +5095,10 @@ function Oa(e, t, n, i, r, s) {
|
|
|
5035
5095
|
}, [
|
|
5036
5096
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5037
5097
|
], -1)
|
|
5038
|
-
])], 8,
|
|
5098
|
+
])], 8, Ua)
|
|
5039
5099
|
]),
|
|
5040
|
-
o("div",
|
|
5041
|
-
|
|
5100
|
+
o("div", Fa, [
|
|
5101
|
+
$(o("input", {
|
|
5042
5102
|
ref: "input",
|
|
5043
5103
|
"onUpdate:modelValue": t[2] || (t[2] = (a) => r.value = a),
|
|
5044
5104
|
type: "text",
|
|
@@ -5049,11 +5109,11 @@ function Oa(e, t, n, i, r, s) {
|
|
|
5049
5109
|
t[3] || (t[3] = ue(G((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
|
|
5050
5110
|
t[4] || (t[4] = ue(G((a) => e.$emit("close"), ["prevent"]), ["esc"]))
|
|
5051
5111
|
]
|
|
5052
|
-
}, null, 40,
|
|
5112
|
+
}, null, 40, Da), [
|
|
5053
5113
|
[X, r.value]
|
|
5054
5114
|
])
|
|
5055
5115
|
]),
|
|
5056
|
-
o("div",
|
|
5116
|
+
o("div", ja, [
|
|
5057
5117
|
o("button", {
|
|
5058
5118
|
type: "button",
|
|
5059
5119
|
class: "wm-dialog__btn",
|
|
@@ -5064,31 +5124,31 @@ function Oa(e, t, n, i, r, s) {
|
|
|
5064
5124
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
5065
5125
|
disabled: !s.canSubmit,
|
|
5066
5126
|
onClick: t[6] || (t[6] = (...a) => s.onSubmit && s.onSubmit(...a))
|
|
5067
|
-
}, v(s.t("common.save")), 9,
|
|
5127
|
+
}, v(s.t("common.save")), 9, Ha)
|
|
5068
5128
|
])
|
|
5069
5129
|
])
|
|
5070
5130
|
]);
|
|
5071
5131
|
}
|
|
5072
|
-
const
|
|
5132
|
+
const qa = /* @__PURE__ */ N(Ea, [["render", za], ["__scopeId", "data-v-6d5f94a8"]]), Be = "ww-messenger-tokens", Ka = {
|
|
5073
5133
|
name: "Messenger",
|
|
5074
5134
|
components: {
|
|
5075
|
-
Launcher:
|
|
5076
|
-
Header:
|
|
5077
|
-
Onboarding:
|
|
5078
|
-
MessageList:
|
|
5079
|
-
Composer:
|
|
5080
|
-
SuggestionChips:
|
|
5081
|
-
ApprovalCard:
|
|
5082
|
-
FormCard:
|
|
5083
|
-
Feedback:
|
|
5084
|
-
MoreMenu:
|
|
5085
|
-
RenameDialog:
|
|
5135
|
+
Launcher: Ut,
|
|
5136
|
+
Header: cn,
|
|
5137
|
+
Onboarding: ss,
|
|
5138
|
+
MessageList: Jr,
|
|
5139
|
+
Composer: _i,
|
|
5140
|
+
SuggestionChips: yi,
|
|
5141
|
+
ApprovalCard: Oi,
|
|
5142
|
+
FormCard: na,
|
|
5143
|
+
Feedback: ga,
|
|
5144
|
+
MoreMenu: La,
|
|
5145
|
+
RenameDialog: qa
|
|
5086
5146
|
},
|
|
5087
5147
|
mixins: [
|
|
5088
|
-
|
|
5089
|
-
mt,
|
|
5148
|
+
lt,
|
|
5090
5149
|
ft,
|
|
5091
|
-
_t
|
|
5150
|
+
_t,
|
|
5151
|
+
pt
|
|
5092
5152
|
],
|
|
5093
5153
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
5094
5154
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -5110,7 +5170,7 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5110
5170
|
},
|
|
5111
5171
|
props: {
|
|
5112
5172
|
// Hardcoded server default (overridable for staging/dev).
|
|
5113
|
-
baseUrl: { type: String, default:
|
|
5173
|
+
baseUrl: { type: String, default: et },
|
|
5114
5174
|
widgetId: { type: String, default: "" },
|
|
5115
5175
|
// En mode iframe (modèle par défaut), `origin` et `token` ne sont
|
|
5116
5176
|
// PAS des props : ils sont reçus via `postMessage` du parent
|
|
@@ -5225,7 +5285,7 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5225
5285
|
// 4. French.
|
|
5226
5286
|
locale() {
|
|
5227
5287
|
var e;
|
|
5228
|
-
return
|
|
5288
|
+
return ke(
|
|
5229
5289
|
this.language || this.customerLanguage || ((e = this.widget) == null ? void 0 : e.default_language) || ""
|
|
5230
5290
|
);
|
|
5231
5291
|
},
|
|
@@ -5271,9 +5331,9 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5271
5331
|
const T = r[w];
|
|
5272
5332
|
if (!T) continue;
|
|
5273
5333
|
if (((k = T.author) == null ? void 0 : k.type) === "user") break;
|
|
5274
|
-
const
|
|
5275
|
-
if (
|
|
5276
|
-
if (s != null &&
|
|
5334
|
+
const B = W(T.id);
|
|
5335
|
+
if (B != null) {
|
|
5336
|
+
if (s != null && B <= s) break;
|
|
5277
5337
|
t[T.id] !== 0 && (!l && T.author && (l = T.author), a++);
|
|
5278
5338
|
}
|
|
5279
5339
|
}
|
|
@@ -5286,7 +5346,7 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5286
5346
|
);
|
|
5287
5347
|
return {
|
|
5288
5348
|
...i,
|
|
5289
|
-
_preview:
|
|
5349
|
+
_preview: rt(i, p),
|
|
5290
5350
|
_unread: a > 0,
|
|
5291
5351
|
_unreadCount: a,
|
|
5292
5352
|
_lastAuthor: l
|
|
@@ -5309,7 +5369,8 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5309
5369
|
title: n.name || this.t("common.newConversation"),
|
|
5310
5370
|
preview: n._preview || this.t("onboarding.newMessage"),
|
|
5311
5371
|
unread: !!n._unread,
|
|
5312
|
-
|
|
5372
|
+
author: n._lastAuthor || null,
|
|
5373
|
+
_ts: Oe(n, e[n.id] || [])
|
|
5313
5374
|
})).sort((n, i) => n._ts < i._ts ? 1 : n._ts > i._ts ? -1 : 0);
|
|
5314
5375
|
},
|
|
5315
5376
|
// Unread threads (one entry per conv with unseen agent/human
|
|
@@ -5321,7 +5382,7 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5321
5382
|
const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
|
|
5322
5383
|
for (const i of this.drawerConversations) {
|
|
5323
5384
|
if (!i._unread) continue;
|
|
5324
|
-
const r =
|
|
5385
|
+
const r = Oe(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);
|
|
5325
5386
|
t.push({
|
|
5326
5387
|
convId: i.id,
|
|
5327
5388
|
preview: i._preview || this.t("notification.youHaveNewMessage"),
|
|
@@ -5383,6 +5444,14 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5383
5444
|
var e, t;
|
|
5384
5445
|
return ((t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.widget) || null;
|
|
5385
5446
|
},
|
|
5447
|
+
// Lets the merchant override the brand colour from the widget
|
|
5448
|
+
// config. Falls through to the default `--wm-a` from tokens.css
|
|
5449
|
+
// when unset, so existing widgets render unchanged.
|
|
5450
|
+
rootStyle() {
|
|
5451
|
+
var t;
|
|
5452
|
+
const e = (t = this.widget) == null ? void 0 : t.primary_color;
|
|
5453
|
+
return e ? { "--wm-a": e } : null;
|
|
5454
|
+
},
|
|
5386
5455
|
widgetWelcomeMessage() {
|
|
5387
5456
|
var e;
|
|
5388
5457
|
return ((e = this.widget) == null ? void 0 : e.welcome_message) || "";
|
|
@@ -5553,7 +5622,7 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5553
5622
|
}
|
|
5554
5623
|
}
|
|
5555
5624
|
return this.t("messageList.today", {
|
|
5556
|
-
time:
|
|
5625
|
+
time: ve(t, re(this.locale))
|
|
5557
5626
|
});
|
|
5558
5627
|
},
|
|
5559
5628
|
// Pagination state for the active conversation. Drives the
|
|
@@ -5658,9 +5727,9 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5658
5727
|
}
|
|
5659
5728
|
},
|
|
5660
5729
|
async mounted() {
|
|
5661
|
-
if (typeof document < "u" && !document.getElementById(
|
|
5730
|
+
if (typeof document < "u" && !document.getElementById(Be)) {
|
|
5662
5731
|
const e = document.createElement("style");
|
|
5663
|
-
e.id =
|
|
5732
|
+
e.id = Be, e.textContent = Ze, document.head.appendChild(e);
|
|
5664
5733
|
}
|
|
5665
5734
|
this._parentMessageHandler = this.onParentMessage.bind(this), window.addEventListener("message", this._parentMessageHandler), window.parent && window.parent !== window && window.parent.postMessage({ type: "READY" }, "*"), this.isEmbedded ? (await this.boot(), this.store && await this.open()) : (await this.$nextTick(), this.sendCurrentLauncherSize(), this.observeLauncherSize());
|
|
5666
5735
|
},
|
|
@@ -5715,12 +5784,12 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5715
5784
|
return;
|
|
5716
5785
|
}
|
|
5717
5786
|
try {
|
|
5718
|
-
await this.waitForParentInit(), this.transport =
|
|
5719
|
-
|
|
5787
|
+
await this.waitForParentInit(), this.transport = Me(
|
|
5788
|
+
Ge({
|
|
5720
5789
|
baseUrl: this.baseUrl,
|
|
5721
5790
|
widgetId: this.widgetId
|
|
5722
5791
|
})
|
|
5723
|
-
), this.store =
|
|
5792
|
+
), this.store = Me(Xe(this.transport)), this.hydrateNotifPref();
|
|
5724
5793
|
const n = ((e = this.parentContext) == null ? void 0 : e.customer) || ((t = this.context) == null ? void 0 : t.customer);
|
|
5725
5794
|
await this.store.start({
|
|
5726
5795
|
origin: this.parentOrigin,
|
|
@@ -5809,21 +5878,21 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5809
5878
|
this.launcherHovered = e, this.sendCurrentLauncherSize();
|
|
5810
5879
|
},
|
|
5811
5880
|
sendCurrentLauncherSize() {
|
|
5812
|
-
var w, T,
|
|
5881
|
+
var w, T, B, A, H, S, U;
|
|
5813
5882
|
if (this.isOpen) return;
|
|
5814
5883
|
const e = (T = (w = this.$el) == null ? void 0 : w.querySelector) == null ? void 0 : T.call(w, ".wm-launcherWrap");
|
|
5815
5884
|
if (!e) return;
|
|
5816
5885
|
const t = e.getBoundingClientRect();
|
|
5817
5886
|
if (!t.width || !t.height) return;
|
|
5818
|
-
const n = (((
|
|
5887
|
+
const n = (((B = this.launcherPeeks) == null ? void 0 : B.length) ?? 0) > 0, i = 16, r = Math.ceil(t.width), s = Math.ceil(t.height), a = (H = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : H.call(A, ".wm-launcher"), l = (U = (S = this.$el) == null ? void 0 : S.querySelectorAll) == null ? void 0 : U.call(S, ".wm-peek"), p = l && l.length ? l[l.length - 1] : null;
|
|
5819
5888
|
let k = null;
|
|
5820
5889
|
if (p) {
|
|
5821
|
-
const
|
|
5890
|
+
const I = p.getBoundingClientRect();
|
|
5822
5891
|
k = {
|
|
5823
|
-
width: Math.ceil(
|
|
5824
|
-
height: Math.ceil(
|
|
5825
|
-
rightOffset: Math.max(0, Math.ceil(t.right -
|
|
5826
|
-
bottomOffset: Math.max(0, Math.ceil(t.bottom -
|
|
5892
|
+
width: Math.ceil(I.width),
|
|
5893
|
+
height: Math.ceil(I.height),
|
|
5894
|
+
rightOffset: Math.max(0, Math.ceil(t.right - I.right)),
|
|
5895
|
+
bottomOffset: Math.max(0, Math.ceil(t.bottom - I.bottom))
|
|
5827
5896
|
};
|
|
5828
5897
|
}
|
|
5829
5898
|
this.notifyParentResize("closed", {
|
|
@@ -5926,7 +5995,7 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5926
5995
|
this.openRenameDialog();
|
|
5927
5996
|
break;
|
|
5928
5997
|
case "export":
|
|
5929
|
-
|
|
5998
|
+
ot(
|
|
5930
5999
|
this.currentConv,
|
|
5931
6000
|
this.currentConv ? (n = (t = this.s) == null ? void 0 : t.messagesByConv) == null ? void 0 : n[this.currentConv.id] : [],
|
|
5932
6001
|
this.translator,
|
|
@@ -5990,12 +6059,12 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5990
6059
|
async onFormSubmit({ values: e }) {
|
|
5991
6060
|
const t = this.pendingForm;
|
|
5992
6061
|
if (!(t != null && t.form)) return;
|
|
5993
|
-
const n =
|
|
6062
|
+
const n = nt(t.form, e, this.translator);
|
|
5994
6063
|
if (!n) return;
|
|
5995
6064
|
let i = this.currentConv;
|
|
5996
6065
|
i && (i._draft && (i = await this.ensureRealConv(), !i) || await this.store.send(i.id, n, {
|
|
5997
6066
|
metadata: {
|
|
5998
|
-
artifact:
|
|
6067
|
+
artifact: st(
|
|
5999
6068
|
t.form,
|
|
6000
6069
|
e,
|
|
6001
6070
|
this.translator
|
|
@@ -6071,31 +6140,32 @@ const La = /* @__PURE__ */ N(ya, [["render", Oa], ["__scopeId", "data-v-6d5f94a8
|
|
|
6071
6140
|
}
|
|
6072
6141
|
}
|
|
6073
6142
|
}
|
|
6074
|
-
},
|
|
6143
|
+
}, Va = {
|
|
6075
6144
|
key: 0,
|
|
6076
6145
|
class: "wm-loading",
|
|
6077
6146
|
"aria-busy": "true",
|
|
6078
6147
|
"aria-live": "polite"
|
|
6079
|
-
},
|
|
6148
|
+
}, $a = ["aria-label"], Wa = {
|
|
6080
6149
|
key: 0,
|
|
6081
6150
|
class: "wm-state"
|
|
6082
|
-
},
|
|
6151
|
+
}, Ga = { class: "wm-state__err" }, Ya = { class: "wm-state__errTitle" }, Ja = { class: "wm-state__errSub" }, Qa = { class: "wm-bottom" }, Xa = {
|
|
6083
6152
|
key: 0,
|
|
6084
6153
|
ref: "floatEl",
|
|
6085
6154
|
class: "wm-float"
|
|
6086
|
-
},
|
|
6155
|
+
}, Za = {
|
|
6087
6156
|
key: 1,
|
|
6088
6157
|
class: "wm-actionWait",
|
|
6089
6158
|
role: "status",
|
|
6090
6159
|
"aria-live": "polite"
|
|
6091
|
-
},
|
|
6160
|
+
}, eo = { class: "wm-actionWait__lbl" }, to = {
|
|
6092
6161
|
key: 2,
|
|
6093
6162
|
class: "wm-attached"
|
|
6094
|
-
},
|
|
6095
|
-
function
|
|
6096
|
-
const a = R("Launcher"), l = R("Header"), p = R("Onboarding"), k = R("MessageList"), w = R("ApprovalCard"), T = R("FormCard"),
|
|
6163
|
+
}, no = ["aria-label", "onClick"];
|
|
6164
|
+
function so(e, t, n, i, r, s) {
|
|
6165
|
+
const a = R("Launcher"), l = R("Header"), p = R("Onboarding"), k = R("MessageList"), w = R("ApprovalCard"), T = R("FormCard"), B = R("Feedback"), A = R("SuggestionChips"), H = R("Composer"), S = R("MoreMenu"), U = R("RenameDialog");
|
|
6097
6166
|
return c(), u("div", {
|
|
6098
|
-
class: O(["wm-root", `wm-root--${n.displayMode}`])
|
|
6167
|
+
class: O(["wm-root", `wm-root--${n.displayMode}`]),
|
|
6168
|
+
style: z(s.rootStyle)
|
|
6099
6169
|
}, [
|
|
6100
6170
|
!r.isOpen && !s.isEmbedded ? (c(), P(a, {
|
|
6101
6171
|
key: 0,
|
|
@@ -6112,18 +6182,18 @@ function $a(e, t, n, i, r, s) {
|
|
|
6112
6182
|
`wm-panel--${n.displayMode}`,
|
|
6113
6183
|
{ "wm-panel--welcome": s.ready && !s.error && !s.currentConv }
|
|
6114
6184
|
]),
|
|
6115
|
-
style:
|
|
6185
|
+
style: z(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
|
|
6116
6186
|
role: "dialog",
|
|
6117
6187
|
"aria-label": "Messenger",
|
|
6118
|
-
onClick: t[5] || (t[5] = (...
|
|
6188
|
+
onClick: t[5] || (t[5] = (...I) => s.onPanelClick && s.onPanelClick(...I))
|
|
6119
6189
|
}, [
|
|
6120
|
-
!s.ready && !s.error ? (c(), u("div",
|
|
6190
|
+
!s.ready && !s.error ? (c(), u("div", Va, [
|
|
6121
6191
|
s.isEmbedded ? y("", !0) : (c(), u("button", {
|
|
6122
6192
|
key: 0,
|
|
6123
6193
|
type: "button",
|
|
6124
6194
|
class: "wm-loading__close",
|
|
6125
6195
|
"aria-label": s.t("loading.minimize"),
|
|
6126
|
-
onClick: t[0] || (t[0] = (...
|
|
6196
|
+
onClick: t[0] || (t[0] = (...I) => s.close && s.close(...I))
|
|
6127
6197
|
}, [...t[6] || (t[6] = [
|
|
6128
6198
|
o("svg", {
|
|
6129
6199
|
width: "13",
|
|
@@ -6138,13 +6208,13 @@ function $a(e, t, n, i, r, s) {
|
|
|
6138
6208
|
}, [
|
|
6139
6209
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6140
6210
|
], -1)
|
|
6141
|
-
])], 8,
|
|
6211
|
+
])], 8, $a)),
|
|
6142
6212
|
t[7] || (t[7] = o("div", {
|
|
6143
6213
|
class: "wm-loading__spinner",
|
|
6144
6214
|
"aria-hidden": "true"
|
|
6145
6215
|
}, null, -1))
|
|
6146
|
-
])) : (c(), u(
|
|
6147
|
-
|
|
6216
|
+
])) : (c(), u(E, { key: 1 }, [
|
|
6217
|
+
K(l, {
|
|
6148
6218
|
title: s.headerTitle,
|
|
6149
6219
|
"team-members": s.teamMembers,
|
|
6150
6220
|
"response-label": s.responseLabel,
|
|
@@ -6158,8 +6228,8 @@ function $a(e, t, n, i, r, s) {
|
|
|
6158
6228
|
onMore: s.toggleMore,
|
|
6159
6229
|
onClose: s.close
|
|
6160
6230
|
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "agent-name", "agent-avatar-url", "onBack", "onMore", "onClose"]),
|
|
6161
|
-
s.error ? (c(), u("div",
|
|
6162
|
-
o("div",
|
|
6231
|
+
s.error ? (c(), u("div", Wa, [
|
|
6232
|
+
o("div", Ga, [
|
|
6163
6233
|
t[8] || (t[8] = o("div", { class: "wm-state__errIcon" }, [
|
|
6164
6234
|
o("svg", {
|
|
6165
6235
|
width: "14",
|
|
@@ -6176,12 +6246,12 @@ function $a(e, t, n, i, r, s) {
|
|
|
6176
6246
|
])
|
|
6177
6247
|
], -1)),
|
|
6178
6248
|
o("div", null, [
|
|
6179
|
-
o("div",
|
|
6180
|
-
o("div",
|
|
6249
|
+
o("div", Ya, v(s.t("error.connectionFailed")), 1),
|
|
6250
|
+
o("div", Ja, v(s.error), 1)
|
|
6181
6251
|
])
|
|
6182
6252
|
])
|
|
6183
|
-
])) : s.currentConv ? (c(), u(
|
|
6184
|
-
|
|
6253
|
+
])) : s.currentConv ? (c(), u(E, { key: 2 }, [
|
|
6254
|
+
K(k, {
|
|
6185
6255
|
ref: "messageList",
|
|
6186
6256
|
messages: s.displayedMessages,
|
|
6187
6257
|
"streaming-active": s.streamingActive,
|
|
@@ -6195,8 +6265,8 @@ function $a(e, t, n, i, r, s) {
|
|
|
6195
6265
|
"ai-agent-avatar-url": s.agentAvatarUrl,
|
|
6196
6266
|
onLoadMore: s.onLoadMore
|
|
6197
6267
|
}, 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"]),
|
|
6198
|
-
o("div",
|
|
6199
|
-
s.floatVisible ? (c(), u("div",
|
|
6268
|
+
o("div", Qa, [
|
|
6269
|
+
s.floatVisible ? (c(), u("div", Xa, [
|
|
6200
6270
|
s.approvalReady ? (c(), P(w, {
|
|
6201
6271
|
key: 0,
|
|
6202
6272
|
action: s.approvalTitle,
|
|
@@ -6211,7 +6281,7 @@ function $a(e, t, n, i, r, s) {
|
|
|
6211
6281
|
"agent-name": s.agentName,
|
|
6212
6282
|
"agent-avatar-url": s.agentAvatarUrl,
|
|
6213
6283
|
onSubmit: s.onFormSubmit
|
|
6214
|
-
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : s.showFeedback ? (c(), P(
|
|
6284
|
+
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : s.showFeedback ? (c(), P(B, {
|
|
6215
6285
|
key: 2,
|
|
6216
6286
|
busy: r.feedbackBusy,
|
|
6217
6287
|
done: r.feedbackDone,
|
|
@@ -6222,19 +6292,19 @@ function $a(e, t, n, i, r, s) {
|
|
|
6222
6292
|
onSelect: s.onSuggestion
|
|
6223
6293
|
}, null, 8, ["items", "onSelect"]))
|
|
6224
6294
|
], 512)) : y("", !0),
|
|
6225
|
-
s.actionInFlight ? (c(), u("div",
|
|
6295
|
+
s.actionInFlight ? (c(), u("div", Za, [
|
|
6226
6296
|
t[9] || (t[9] = o("span", {
|
|
6227
6297
|
class: "wm-actionWait__spinner",
|
|
6228
6298
|
"aria-hidden": "true"
|
|
6229
6299
|
}, null, -1)),
|
|
6230
|
-
o("span",
|
|
6300
|
+
o("span", eo, v(s.t("action.inProgress", {
|
|
6231
6301
|
name: s.actionInFlightName
|
|
6232
6302
|
})), 1)
|
|
6233
6303
|
])) : (c(), P(H, {
|
|
6234
6304
|
key: 2,
|
|
6235
6305
|
ref: "composer",
|
|
6236
6306
|
modelValue: r.draft,
|
|
6237
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
6307
|
+
"onUpdate:modelValue": t[1] || (t[1] = (I) => r.draft = I),
|
|
6238
6308
|
placeholder: s.composerPlaceholder,
|
|
6239
6309
|
disabled: !!s.pendingApproval,
|
|
6240
6310
|
"attach-label": s.t("composer.attachFile"),
|
|
@@ -6251,21 +6321,21 @@ function $a(e, t, n, i, r, s) {
|
|
|
6251
6321
|
"browser-notif-enabled": e.browserNotifEnabled,
|
|
6252
6322
|
"status-url": s.statusUrl,
|
|
6253
6323
|
"help-url": s.helpUrl,
|
|
6254
|
-
onClose: t[2] || (t[2] = (
|
|
6324
|
+
onClose: t[2] || (t[2] = (I) => r.moreOpen = !1),
|
|
6255
6325
|
onSoundToggle: e.onSoundToggle,
|
|
6256
6326
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
6257
6327
|
onAction: s.onMoreAction
|
|
6258
6328
|
}, null, 8, ["can-rename", "can-export", "sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : y("", !0),
|
|
6259
|
-
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), P(
|
|
6329
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), P(U, {
|
|
6260
6330
|
key: 1,
|
|
6261
6331
|
"initial-value": s.currentConv.name || "",
|
|
6262
6332
|
title: s.t("rename.dialogTitle"),
|
|
6263
|
-
onClose: t[3] || (t[3] = (
|
|
6333
|
+
onClose: t[3] || (t[3] = (I) => r.renameDialogOpen = !1),
|
|
6264
6334
|
onSubmit: s.onRenameSubmit
|
|
6265
6335
|
}, null, 8, ["initial-value", "title", "onSubmit"])) : y("", !0),
|
|
6266
|
-
r.pendingAttachments.length ? (c(), u("div",
|
|
6267
|
-
(c(!0), u(
|
|
6268
|
-
key:
|
|
6336
|
+
r.pendingAttachments.length ? (c(), u("div", to, [
|
|
6337
|
+
(c(!0), u(E, null, F(r.pendingAttachments, (I, q) => (c(), u("div", {
|
|
6338
|
+
key: q,
|
|
6269
6339
|
class: "wm-attached__chip"
|
|
6270
6340
|
}, [
|
|
6271
6341
|
t[11] || (t[11] = o("svg", {
|
|
@@ -6281,11 +6351,11 @@ function $a(e, t, n, i, r, s) {
|
|
|
6281
6351
|
}, [
|
|
6282
6352
|
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" })
|
|
6283
6353
|
], -1)),
|
|
6284
|
-
o("span", null, v(
|
|
6354
|
+
o("span", null, v(I.name), 1),
|
|
6285
6355
|
o("button", {
|
|
6286
6356
|
type: "button",
|
|
6287
6357
|
"aria-label": s.t("attachment.remove"),
|
|
6288
|
-
onClick: (Y) => r.pendingAttachments.splice(
|
|
6358
|
+
onClick: (Y) => r.pendingAttachments.splice(q, 1)
|
|
6289
6359
|
}, [...t[10] || (t[10] = [
|
|
6290
6360
|
o("svg", {
|
|
6291
6361
|
width: "10",
|
|
@@ -6300,7 +6370,7 @@ function $a(e, t, n, i, r, s) {
|
|
|
6300
6370
|
}, [
|
|
6301
6371
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6302
6372
|
], -1)
|
|
6303
|
-
])], 8,
|
|
6373
|
+
])], 8, no)
|
|
6304
6374
|
]))), 128))
|
|
6305
6375
|
])) : y("", !0)
|
|
6306
6376
|
], 64)) : (c(), P(p, {
|
|
@@ -6324,63 +6394,63 @@ function $a(e, t, n, i, r, s) {
|
|
|
6324
6394
|
"browser-notif-enabled": e.browserNotifEnabled,
|
|
6325
6395
|
"status-url": s.statusUrl,
|
|
6326
6396
|
"help-url": s.helpUrl,
|
|
6327
|
-
onClose: t[4] || (t[4] = (
|
|
6397
|
+
onClose: t[4] || (t[4] = (I) => r.moreOpen = !1),
|
|
6328
6398
|
onSoundToggle: e.onSoundToggle,
|
|
6329
6399
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
6330
6400
|
onAction: s.onMoreAction
|
|
6331
6401
|
}, null, 8, ["sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : y("", !0)
|
|
6332
6402
|
], 64))
|
|
6333
6403
|
], 6)) : y("", !0)
|
|
6334
|
-
],
|
|
6404
|
+
], 6);
|
|
6335
6405
|
}
|
|
6336
|
-
const
|
|
6406
|
+
const ao = /* @__PURE__ */ N(Ka, [["render", so], ["__scopeId", "data-v-f715675c"]]), oo = "0.5.37";
|
|
6337
6407
|
export {
|
|
6338
6408
|
le as AIAvatar,
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6409
|
+
_e as AVATAR_COLORS,
|
|
6410
|
+
_s as ActionResult,
|
|
6411
|
+
Oi as ApprovalCard,
|
|
6412
|
+
As as ArtifactFormResponse,
|
|
6413
|
+
Us as ArtifactInfoCard,
|
|
6414
|
+
nr as ArtifactRenderer,
|
|
6415
|
+
Xs as ArtifactTicket,
|
|
6416
|
+
fr as AttachmentPreview,
|
|
6417
|
+
vr as Bubble,
|
|
6418
|
+
_i as Composer,
|
|
6419
|
+
et as DEFAULT_BASE_URL,
|
|
6350
6420
|
ae as DEFAULT_LANGUAGE,
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6421
|
+
ga as Feedback,
|
|
6422
|
+
na as FormCard,
|
|
6423
|
+
cn as Header,
|
|
6424
|
+
Ce as HumanAvatar,
|
|
6425
|
+
Ut as Launcher,
|
|
6426
|
+
Ae as MEDIA_RECORDER_SUPPORTED,
|
|
6427
|
+
Jr as MessageList,
|
|
6428
|
+
ao as Messenger,
|
|
6429
|
+
La as MoreMenu,
|
|
6430
|
+
ss as Onboarding,
|
|
6361
6431
|
he as SCREEN_CAPTURE_SUPPORTED,
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6432
|
+
tt as SUPPORTED_LANGUAGES,
|
|
6433
|
+
yi as SuggestionChips,
|
|
6434
|
+
Yt as TeamAvatars,
|
|
6435
|
+
kr as Typing,
|
|
6436
|
+
oo as VERSION,
|
|
6437
|
+
we as avatarColor,
|
|
6438
|
+
be as avatarInitials,
|
|
6439
|
+
Xr as captureScreenshotFile,
|
|
6370
6440
|
j as colors,
|
|
6371
|
-
|
|
6441
|
+
Xe as createStore,
|
|
6372
6442
|
D as createTranslator,
|
|
6373
|
-
|
|
6443
|
+
Ge as createTransport,
|
|
6374
6444
|
re as dateLocale,
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6445
|
+
ao as default,
|
|
6446
|
+
ve as formatTime,
|
|
6447
|
+
io as guessAttachmentKind,
|
|
6448
|
+
Qr as pickRecorderMime,
|
|
6449
|
+
un as renderInlineMarkdown,
|
|
6450
|
+
hn as renderMarkdown,
|
|
6451
|
+
ke as resolveLanguage,
|
|
6452
|
+
ei as startScreenRecording,
|
|
6453
|
+
Ze as tokensCss,
|
|
6454
|
+
Qe as uuid,
|
|
6455
|
+
Qe as v4
|
|
6386
6456
|
};
|