@_solaris/messenger-widget 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/messenger.cjs +24 -24
- package/dist/messenger.embed.js +30 -30
- package/dist/messenger.js +1285 -1292
- package/dist/style.css +1 -1
- package/dist/types/core/messageHelpers.d.ts +1 -0
- package/dist/types/core/store.d.ts +1 -0
- package/dist/types/core/transport.d.ts +4 -0
- package/dist/types/core/types.d.ts +9 -0
- package/dist/types/mixins/readState.d.ts +3 -7
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
const
|
|
1
|
+
import { reactive as Ie, openBlock as d, createElementBlock as c, normalizeStyle as W, normalizeClass as x, toDisplayString as b, resolveComponent as E, createVNode as V, Transition as Oe, withCtx as Be, Fragment as B, renderList as F, withKeys as oe, withModifiers as Y, createElementVNode as o, createCommentVNode as w, createBlock as L, withDirectives as q, vModelText as J, createTextVNode as he, resolveDynamicComponent as Ee, renderSlot as $e, vModelCheckbox as Le, vModelSelect as Re, createStaticVNode as ae, markRaw as fe } from "vue";
|
|
2
|
+
const Ne = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
5
5
|
"message_stream",
|
|
6
6
|
"conversation_updated",
|
|
7
7
|
"config_updated",
|
|
8
8
|
"action_status"
|
|
9
|
-
], _e = "/client",
|
|
10
|
-
function
|
|
9
|
+
], _e = "/client", Fe = 5 * 60 * 1e3, Pe = 10 * 60 * 1e3, De = 5 * 60 * 1e3;
|
|
10
|
+
function je(e) {
|
|
11
11
|
const t = {
|
|
12
|
-
baseUrl:
|
|
12
|
+
baseUrl: Ue(e.baseUrl || ""),
|
|
13
13
|
widgetId: e.widgetId || "",
|
|
14
14
|
userId: e.userId || "",
|
|
15
15
|
userHash: e.userHash || "",
|
|
@@ -31,14 +31,14 @@ function De(e) {
|
|
|
31
31
|
throw new Error(
|
|
32
32
|
"[transport] baseUrl, widgetId, userId, userHash are all required"
|
|
33
33
|
);
|
|
34
|
-
function n(h,
|
|
35
|
-
return t.listeners.has(h) || t.listeners.set(h, /* @__PURE__ */ new Set()), t.listeners.get(h).add(
|
|
34
|
+
function n(h, m) {
|
|
35
|
+
return t.listeners.has(h) || t.listeners.set(h, /* @__PURE__ */ new Set()), t.listeners.get(h).add(m), () => t.listeners.get(h).delete(m);
|
|
36
36
|
}
|
|
37
|
-
function i(h,
|
|
37
|
+
function i(h, m) {
|
|
38
38
|
const p = t.listeners.get(h);
|
|
39
|
-
p && p.forEach((
|
|
39
|
+
p && p.forEach((y) => {
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
y(m);
|
|
42
42
|
} catch (M) {
|
|
43
43
|
console.error("[transport] listener", h, M);
|
|
44
44
|
}
|
|
@@ -54,19 +54,19 @@ function De(e) {
|
|
|
54
54
|
"X-Widget-Id": t.widgetId
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
async function
|
|
58
|
-
const
|
|
57
|
+
async function a(h, m, p) {
|
|
58
|
+
const y = await fetch(`${t.baseUrl}${_e}${m}`, {
|
|
59
59
|
method: h,
|
|
60
60
|
headers: { "Content-Type": "application/json", ...s() },
|
|
61
61
|
body: p !== void 0 ? JSON.stringify(p) : void 0
|
|
62
62
|
});
|
|
63
|
-
if (!
|
|
64
|
-
const M = await l(
|
|
65
|
-
`HTTP ${
|
|
63
|
+
if (!y.ok) {
|
|
64
|
+
const M = await l(y), I = new Error(
|
|
65
|
+
`HTTP ${y.status} ${h} ${m} :: ${(M == null ? void 0 : M.error) || y.statusText}`
|
|
66
66
|
);
|
|
67
|
-
throw
|
|
67
|
+
throw I.status = y.status, I.body = M, I;
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return y.status === 204 ? null : y.json();
|
|
70
70
|
}
|
|
71
71
|
async function l(h) {
|
|
72
72
|
try {
|
|
@@ -76,110 +76,117 @@ function De(e) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
async function g() {
|
|
79
|
-
const [h,
|
|
79
|
+
const [h, m] = await Promise.all([
|
|
80
80
|
// Public — no HMAC required.
|
|
81
81
|
fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`).then(async (p) => {
|
|
82
82
|
if (!p.ok) {
|
|
83
|
-
const
|
|
84
|
-
throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(
|
|
83
|
+
const y = await l(p);
|
|
84
|
+
throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(y == null ? void 0 : y.error) || p.statusText}`);
|
|
85
85
|
}
|
|
86
86
|
return p.json();
|
|
87
87
|
}),
|
|
88
88
|
// HMAC-protected.
|
|
89
|
-
|
|
89
|
+
a("GET", "/customers/me")
|
|
90
90
|
]);
|
|
91
91
|
return {
|
|
92
92
|
config: (
|
|
93
93
|
/** @type {import('./types.js').BootstrapConfig} */
|
|
94
94
|
h
|
|
95
95
|
),
|
|
96
|
-
customer: (
|
|
96
|
+
customer: (m == null ? void 0 : m.customer) ?? null
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
async function k() {
|
|
100
|
-
const h = await
|
|
100
|
+
const h = await a("GET", "/customers/me");
|
|
101
101
|
return (h == null ? void 0 : h.customer) ?? null;
|
|
102
102
|
}
|
|
103
103
|
async function C(h) {
|
|
104
|
-
const
|
|
105
|
-
return (
|
|
104
|
+
const m = await a("PATCH", "/customers/me", h);
|
|
105
|
+
return (m == null ? void 0 : m.customer) ?? null;
|
|
106
106
|
}
|
|
107
|
-
async function
|
|
108
|
-
const h = await
|
|
107
|
+
async function T() {
|
|
108
|
+
const h = await a("GET", "/conversations");
|
|
109
109
|
return (h == null ? void 0 : h.conversations) ?? [];
|
|
110
110
|
}
|
|
111
111
|
async function R(h = {}) {
|
|
112
|
-
return (await
|
|
112
|
+
return (await a("POST", "/conversations", h)).conversation;
|
|
113
113
|
}
|
|
114
114
|
async function A(h) {
|
|
115
|
-
return (await
|
|
115
|
+
return (await a("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
|
|
116
|
+
}
|
|
117
|
+
async function U(h, m) {
|
|
118
|
+
return (await a("PATCH", `/conversations/${encodeURIComponent(h)}`, m)).conversation;
|
|
116
119
|
}
|
|
117
|
-
async function
|
|
118
|
-
return (
|
|
120
|
+
async function S(h, m) {
|
|
121
|
+
return a(
|
|
122
|
+
"PATCH",
|
|
123
|
+
`/conversations/${encodeURIComponent(h)}/read`,
|
|
124
|
+
{ message_id: m }
|
|
125
|
+
);
|
|
119
126
|
}
|
|
120
|
-
async function
|
|
127
|
+
async function D(h, m = {}) {
|
|
121
128
|
const p = new URLSearchParams();
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
return
|
|
129
|
+
m.before && p.set("before", m.before), m.since && p.set("since", m.since), m.limit && p.set("limit", String(m.limit));
|
|
130
|
+
const y = p.toString() ? `?${p.toString()}` : "";
|
|
131
|
+
return a(
|
|
125
132
|
"GET",
|
|
126
|
-
`/conversations/${encodeURIComponent(h)}/messages${
|
|
133
|
+
`/conversations/${encodeURIComponent(h)}/messages${y}`
|
|
127
134
|
);
|
|
128
135
|
}
|
|
129
|
-
async function
|
|
130
|
-
|
|
136
|
+
async function N(h, m) {
|
|
137
|
+
H();
|
|
131
138
|
const p = {
|
|
132
|
-
client_msg_id:
|
|
139
|
+
client_msg_id: m.client_msg_id,
|
|
133
140
|
type: "content",
|
|
134
|
-
text_md:
|
|
141
|
+
text_md: m.text_md,
|
|
135
142
|
author: { id: t.userId, type: "user" },
|
|
136
|
-
created_at:
|
|
143
|
+
created_at: m.created_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
137
144
|
};
|
|
138
|
-
return Array.isArray(
|
|
145
|
+
return Array.isArray(m.attachments) && m.attachments.length && (p.payload = { type: "content", attachments: m.attachments }), m.metadata && typeof m.metadata == "object" && (p.metadata = m.metadata), a(
|
|
139
146
|
"POST",
|
|
140
147
|
`/conversations/${encodeURIComponent(h)}/messages`,
|
|
141
148
|
p
|
|
142
149
|
);
|
|
143
150
|
}
|
|
144
|
-
async function
|
|
145
|
-
return
|
|
151
|
+
async function j(h, m, p) {
|
|
152
|
+
return H(), a(
|
|
146
153
|
"POST",
|
|
147
|
-
`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(
|
|
154
|
+
`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(m)}`,
|
|
148
155
|
p ? { inputs: p } : {}
|
|
149
156
|
);
|
|
150
157
|
}
|
|
151
|
-
async function
|
|
152
|
-
const
|
|
158
|
+
async function K(h) {
|
|
159
|
+
const m = (
|
|
153
160
|
/** @type {File} */
|
|
154
161
|
h.name || "attachment"
|
|
155
|
-
), p = h.type || "application/octet-stream",
|
|
162
|
+
), p = h.type || "application/octet-stream", y = h.size || 0, M = (
|
|
156
163
|
/** @type {import('./types.js').AttachmentUploadTicket} */
|
|
157
|
-
await
|
|
164
|
+
await a("POST", "/attachments", {
|
|
158
165
|
mime_type: p,
|
|
159
|
-
size_bytes:
|
|
160
|
-
name:
|
|
166
|
+
size_bytes: y,
|
|
167
|
+
name: m
|
|
161
168
|
})
|
|
162
|
-
),
|
|
169
|
+
), I = await fetch(M.upload_url, {
|
|
163
170
|
method: "PUT",
|
|
164
171
|
headers: { "Content-Type": p },
|
|
165
172
|
body: h
|
|
166
173
|
});
|
|
167
|
-
if (!
|
|
168
|
-
throw new Error(`HTTP ${
|
|
174
|
+
if (!I.ok)
|
|
175
|
+
throw new Error(`HTTP ${I.status} PUT signed upload`);
|
|
169
176
|
return {
|
|
170
|
-
type:
|
|
177
|
+
type: Ve(p),
|
|
171
178
|
path: M.path,
|
|
172
179
|
mime_type: p,
|
|
173
|
-
size_bytes:
|
|
180
|
+
size_bytes: y
|
|
174
181
|
};
|
|
175
182
|
}
|
|
176
|
-
async function
|
|
177
|
-
return
|
|
183
|
+
async function Q(h) {
|
|
184
|
+
return a(
|
|
178
185
|
"GET",
|
|
179
186
|
`/attachments/sign?path=${encodeURIComponent(h)}`
|
|
180
187
|
);
|
|
181
188
|
}
|
|
182
|
-
function
|
|
189
|
+
function Z() {
|
|
183
190
|
const h = new URLSearchParams({
|
|
184
191
|
userId: t.userId,
|
|
185
192
|
userHash: t.userHash,
|
|
@@ -190,18 +197,18 @@ function De(e) {
|
|
|
190
197
|
function z() {
|
|
191
198
|
if (!t.eventSource && !(typeof document < "u" && document.hidden))
|
|
192
199
|
try {
|
|
193
|
-
const h = new EventSource(
|
|
194
|
-
for (const
|
|
195
|
-
h.addEventListener(
|
|
200
|
+
const h = new EventSource(Z());
|
|
201
|
+
for (const m of Ne)
|
|
202
|
+
h.addEventListener(m, (p) => ee(m, p.data));
|
|
196
203
|
h.addEventListener("error", () => i("error", new Error("SSE error"))), t.eventSource = h, r("open");
|
|
197
204
|
} catch (h) {
|
|
198
205
|
console.error("[transport] SSE open failed", h), i("error", h);
|
|
199
206
|
}
|
|
200
207
|
}
|
|
201
|
-
function
|
|
208
|
+
function ee(h, m) {
|
|
202
209
|
try {
|
|
203
|
-
const p = JSON.parse(
|
|
204
|
-
i(h,
|
|
210
|
+
const p = JSON.parse(m), y = p && typeof p == "object" && "data" in p ? p.data : p;
|
|
211
|
+
i(h, y);
|
|
205
212
|
} catch (p) {
|
|
206
213
|
console.error("[transport] bad SSE payload", h, p);
|
|
207
214
|
}
|
|
@@ -209,42 +216,42 @@ function De(e) {
|
|
|
209
216
|
function G() {
|
|
210
217
|
t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" && r("idle");
|
|
211
218
|
}
|
|
212
|
-
function
|
|
219
|
+
function H() {
|
|
213
220
|
clearTimeout(t.burstTimer), z(), t.panelOpen || (t.burstTimer = setTimeout(() => {
|
|
214
221
|
t.panelOpen || G();
|
|
215
|
-
},
|
|
222
|
+
}, Pe));
|
|
216
223
|
}
|
|
217
|
-
function
|
|
218
|
-
t.panelOpen = !!h, t.panelOpen ? (clearTimeout(t.burstTimer), z()) :
|
|
224
|
+
function se(h) {
|
|
225
|
+
t.panelOpen = !!h, t.panelOpen ? (clearTimeout(t.burstTimer), z()) : H();
|
|
219
226
|
}
|
|
220
|
-
async function
|
|
227
|
+
async function ce() {
|
|
221
228
|
try {
|
|
222
|
-
const h = await
|
|
223
|
-
const
|
|
224
|
-
return
|
|
229
|
+
const h = await T(), m = h.reduce((y, M) => {
|
|
230
|
+
const I = M == null ? void 0 : M.last_message_at;
|
|
231
|
+
return I && (!y || I > y) ? I : y;
|
|
225
232
|
}, null);
|
|
226
|
-
|
|
233
|
+
m && (!t.lastActivityAt || m > t.lastActivityAt) && (t.lastActivityAt = m, i("activity", { conversations: h, latestAt: m }), H());
|
|
227
234
|
} catch (h) {
|
|
228
235
|
console.error("[transport] poll failed", h);
|
|
229
236
|
}
|
|
230
237
|
}
|
|
231
|
-
function
|
|
232
|
-
u(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(
|
|
238
|
+
function re() {
|
|
239
|
+
u(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(ce, Fe));
|
|
233
240
|
}
|
|
234
241
|
function u() {
|
|
235
242
|
t.pollTimer && (clearInterval(t.pollTimer), t.pollTimer = null);
|
|
236
243
|
}
|
|
237
|
-
function
|
|
244
|
+
function f() {
|
|
238
245
|
if (document.hidden)
|
|
239
246
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = setTimeout(() => {
|
|
240
247
|
t.hiddenGraceTimer = null, document.hidden && (u(), G(), r("paused"));
|
|
241
|
-
},
|
|
248
|
+
}, De);
|
|
242
249
|
else {
|
|
243
250
|
if (t.hiddenGraceTimer) {
|
|
244
251
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null;
|
|
245
252
|
return;
|
|
246
253
|
}
|
|
247
|
-
r("idle"),
|
|
254
|
+
r("idle"), re(), t.panelOpen && z();
|
|
248
255
|
}
|
|
249
256
|
}
|
|
250
257
|
async function _() {
|
|
@@ -253,50 +260,51 @@ function De(e) {
|
|
|
253
260
|
const h = await g();
|
|
254
261
|
t.lastBootstrap = h;
|
|
255
262
|
try {
|
|
256
|
-
const
|
|
257
|
-
t.lastActivityAt =
|
|
258
|
-
const M =
|
|
263
|
+
const m = await T();
|
|
264
|
+
t.lastActivityAt = m.reduce((p, y) => {
|
|
265
|
+
const M = y == null ? void 0 : y.last_message_at;
|
|
259
266
|
return M && (!p || M > p) ? M : p;
|
|
260
267
|
}, null);
|
|
261
|
-
} catch (
|
|
262
|
-
console.error("[transport] initial /conversations failed",
|
|
268
|
+
} catch (m) {
|
|
269
|
+
console.error("[transport] initial /conversations failed", m);
|
|
263
270
|
}
|
|
264
|
-
return typeof document < "u" && (t.visibilityHandler =
|
|
271
|
+
return typeof document < "u" && (t.visibilityHandler = f, document.addEventListener("visibilitychange", t.visibilityHandler)), re(), h;
|
|
265
272
|
}
|
|
266
|
-
function
|
|
273
|
+
function v() {
|
|
267
274
|
u(), clearTimeout(t.burstTimer), clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null, G(), t.visibilityHandler && (document.removeEventListener("visibilitychange", t.visibilityHandler), t.visibilityHandler = null), t.started = !1;
|
|
268
275
|
}
|
|
269
276
|
return {
|
|
270
277
|
on: n,
|
|
271
278
|
start: _,
|
|
272
|
-
stop:
|
|
273
|
-
setPanelOpen:
|
|
279
|
+
stop: v,
|
|
280
|
+
setPanelOpen: se,
|
|
274
281
|
// REST
|
|
275
282
|
bootstrap: g,
|
|
276
283
|
getCustomer: k,
|
|
277
284
|
patchCustomer: C,
|
|
278
|
-
listConversations:
|
|
285
|
+
listConversations: T,
|
|
279
286
|
createConversation: R,
|
|
280
287
|
getConversation: A,
|
|
281
|
-
patchConversation:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
patchConversation: U,
|
|
289
|
+
markConversationRead: S,
|
|
290
|
+
listMessages: D,
|
|
291
|
+
postMessage: N,
|
|
292
|
+
postCallback: j,
|
|
293
|
+
uploadAttachment: K,
|
|
294
|
+
signAttachment: Q,
|
|
287
295
|
// Read-only state
|
|
288
296
|
get connection() {
|
|
289
297
|
return t.connection;
|
|
290
298
|
}
|
|
291
299
|
};
|
|
292
300
|
}
|
|
293
|
-
function
|
|
301
|
+
function Ue(e) {
|
|
294
302
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
295
303
|
}
|
|
296
|
-
function
|
|
304
|
+
function Ve(e) {
|
|
297
305
|
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
|
|
298
306
|
}
|
|
299
|
-
function
|
|
307
|
+
function ze() {
|
|
300
308
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
301
309
|
return crypto.randomUUID();
|
|
302
310
|
const e = new Uint8Array(16);
|
|
@@ -308,8 +316,8 @@ function Ue() {
|
|
|
308
316
|
const t = [...e].map((n) => n.toString(16).padStart(2, "0"));
|
|
309
317
|
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("");
|
|
310
318
|
}
|
|
311
|
-
function
|
|
312
|
-
const t =
|
|
319
|
+
function He(e) {
|
|
320
|
+
const t = Ie({
|
|
313
321
|
ready: !1,
|
|
314
322
|
error: null,
|
|
315
323
|
config: null,
|
|
@@ -343,32 +351,32 @@ function ze(e) {
|
|
|
343
351
|
n.push(e.on("connection", (u) => {
|
|
344
352
|
t.connection = u;
|
|
345
353
|
})), n.push(e.on("message", (u) => {
|
|
346
|
-
const
|
|
347
|
-
!
|
|
354
|
+
const f = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
|
|
355
|
+
!f || !(_ != null && _.id) || (z(f, _), _.client_msg_id && delete t.streamingByMsgId[_.client_msg_id], H(f, _.created_at));
|
|
348
356
|
})), n.push(e.on("message_stream", (u) => {
|
|
349
|
-
const
|
|
350
|
-
!
|
|
357
|
+
const f = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
|
|
358
|
+
!f || typeof _ != "string" || (t.streamingByMsgId[f] = (t.streamingByMsgId[f] || "") + _);
|
|
351
359
|
})), n.push(e.on("conversation_updated", (u) => {
|
|
352
|
-
const
|
|
353
|
-
if (!
|
|
354
|
-
const
|
|
355
|
-
|
|
360
|
+
const f = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
|
|
361
|
+
if (!f || !_) return;
|
|
362
|
+
const v = t.conversations.findIndex((h) => h.id === f);
|
|
363
|
+
v !== -1 && (t.conversations[v] = { ...t.conversations[v], ..._ });
|
|
356
364
|
})), n.push(e.on("config_updated", (u) => {
|
|
357
365
|
u != null && u.config && (t.config = u.config);
|
|
358
366
|
})), n.push(e.on("action_status", (u) => {
|
|
359
|
-
const
|
|
360
|
-
if (!
|
|
361
|
-
const h = t.runningActionsByConv[
|
|
362
|
-
u.state === "running" ? (h[_] =
|
|
367
|
+
const f = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, v = u == null ? void 0 : u.action_name;
|
|
368
|
+
if (!f || !_) return;
|
|
369
|
+
const h = t.runningActionsByConv[f] || {};
|
|
370
|
+
u.state === "running" ? (h[_] = v || _, t.runningActionsByConv[f] = { ...h }) : u.state === "done" && (delete h[_], t.runningActionsByConv[f] = { ...h });
|
|
363
371
|
})), n.push(e.on("activity", (u) => {
|
|
364
372
|
Array.isArray(u == null ? void 0 : u.conversations) && (t.conversations = u.conversations);
|
|
365
373
|
}));
|
|
366
374
|
async function i() {
|
|
367
375
|
try {
|
|
368
376
|
const u = new Promise(
|
|
369
|
-
(_,
|
|
370
|
-
),
|
|
371
|
-
t.config =
|
|
377
|
+
(_, v) => setTimeout(() => v(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
|
|
378
|
+
), f = await Promise.race([e.start(), u]);
|
|
379
|
+
t.config = f.config, t.customer = f.customer, t.conversations = await Promise.race([e.listConversations(), u]), t.ready = !0;
|
|
372
380
|
} catch (u) {
|
|
373
381
|
console.error("[store] start failed", u), t.error = (u == null ? void 0 : u.message) || String(u);
|
|
374
382
|
}
|
|
@@ -382,31 +390,31 @@ function ze(e) {
|
|
|
382
390
|
e.stop();
|
|
383
391
|
}
|
|
384
392
|
async function s(u) {
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
393
|
+
const f = ce(u);
|
|
394
|
+
if (!f) return t.customer;
|
|
387
395
|
try {
|
|
388
|
-
const _ = await e.patchCustomer(
|
|
396
|
+
const _ = await e.patchCustomer(f);
|
|
389
397
|
_ && (t.customer = _);
|
|
390
398
|
} catch (_) {
|
|
391
399
|
console.error("[store] applyCustomer failed", _);
|
|
392
400
|
}
|
|
393
401
|
return t.customer;
|
|
394
402
|
}
|
|
395
|
-
async function
|
|
396
|
-
const
|
|
397
|
-
return _ === -1 ? t.conversations = [
|
|
403
|
+
async function a(u = {}) {
|
|
404
|
+
const f = await e.createConversation(u), _ = t.conversations.findIndex((v) => v.id === f.id);
|
|
405
|
+
return _ === -1 ? t.conversations = [f, ...t.conversations] : t.conversations[_] = f, f;
|
|
398
406
|
}
|
|
399
407
|
const l = 50;
|
|
400
408
|
async function g(u) {
|
|
401
|
-
const
|
|
402
|
-
if (!(
|
|
409
|
+
const f = t.paginationByConv[u];
|
|
410
|
+
if (!(f != null && f.loaded || f != null && f.loading)) {
|
|
403
411
|
C(u, { nextCursor: null, loading: !0, loaded: !1 });
|
|
404
412
|
try {
|
|
405
|
-
const _ = await e.listMessages(u, { limit: l }),
|
|
406
|
-
for (const
|
|
407
|
-
(
|
|
408
|
-
const p = h.filter((
|
|
409
|
-
t.messagesByConv[u] = [...
|
|
413
|
+
const _ = await e.listMessages(u, { limit: l }), v = (_ == null ? void 0 : _.messages) ?? [], h = t.messagesByConv[u] || [], m = /* @__PURE__ */ new Set();
|
|
414
|
+
for (const y of v)
|
|
415
|
+
(y == null ? void 0 : y.id) != null && m.add(`id:${String(y.id)}`), y != null && y.client_msg_id && m.add(`c:${y.client_msg_id}`);
|
|
416
|
+
const p = h.filter((y) => !((y == null ? void 0 : y.id) != null && m.has(`id:${String(y.id)}`) || y != null && y.client_msg_id && m.has(`c:${y.client_msg_id}`)));
|
|
417
|
+
t.messagesByConv[u] = [...v, ...p].sort(se), C(u, {
|
|
410
418
|
nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
|
|
411
419
|
loading: !1,
|
|
412
420
|
loaded: !0
|
|
@@ -418,41 +426,53 @@ function ze(e) {
|
|
|
418
426
|
}
|
|
419
427
|
async function k(u) {
|
|
420
428
|
var h;
|
|
421
|
-
const
|
|
422
|
-
if (!
|
|
423
|
-
const
|
|
424
|
-
if (
|
|
425
|
-
C(u, { ...
|
|
429
|
+
const f = t.paginationByConv[u];
|
|
430
|
+
if (!f || f.loading || !f.nextCursor) return;
|
|
431
|
+
const v = (h = (t.messagesByConv[u] || []).find((m) => m == null ? void 0 : m.created_at)) == null ? void 0 : h.created_at;
|
|
432
|
+
if (v) {
|
|
433
|
+
C(u, { ...f, loading: !0 });
|
|
426
434
|
try {
|
|
427
|
-
const
|
|
428
|
-
before:
|
|
435
|
+
const m = await e.listMessages(u, {
|
|
436
|
+
before: v,
|
|
429
437
|
limit: l
|
|
430
|
-
}), p = (
|
|
431
|
-
for (const
|
|
432
|
-
(
|
|
433
|
-
const
|
|
434
|
-
t.messagesByConv[u] = [...
|
|
435
|
-
nextCursor: (
|
|
438
|
+
}), p = (m == null ? void 0 : m.messages) ?? [], y = t.messagesByConv[u] || [], M = /* @__PURE__ */ new Set();
|
|
439
|
+
for (const O of y)
|
|
440
|
+
(O == null ? void 0 : O.id) != null && M.add(`id:${String(O.id)}`), O != null && O.client_msg_id && M.add(`c:${O.client_msg_id}`);
|
|
441
|
+
const I = p.filter((O) => !((O == null ? void 0 : O.id) != null && M.has(`id:${String(O.id)}`) || O != null && O.client_msg_id && M.has(`c:${O.client_msg_id}`)));
|
|
442
|
+
t.messagesByConv[u] = [...I, ...y], C(u, {
|
|
443
|
+
nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
|
|
436
444
|
loading: !1,
|
|
437
445
|
loaded: !0
|
|
438
446
|
});
|
|
439
|
-
} catch (
|
|
440
|
-
console.error("[store] loadMore failed",
|
|
447
|
+
} catch (m) {
|
|
448
|
+
console.error("[store] loadMore failed", m), C(u, { ...f, loading: !1 });
|
|
441
449
|
}
|
|
442
450
|
}
|
|
443
451
|
}
|
|
444
|
-
function C(u,
|
|
445
|
-
t.paginationByConv = { ...t.paginationByConv, [u]:
|
|
452
|
+
function C(u, f) {
|
|
453
|
+
t.paginationByConv = { ...t.paginationByConv, [u]: f };
|
|
446
454
|
}
|
|
447
|
-
async function
|
|
448
|
-
const _ = await e.patchConversation(u,
|
|
449
|
-
|
|
455
|
+
async function T(u, f) {
|
|
456
|
+
const _ = await e.patchConversation(u, f), v = t.conversations.findIndex((h) => h.id === u);
|
|
457
|
+
v !== -1 && (t.conversations[v] = _);
|
|
450
458
|
}
|
|
451
|
-
async function R(u,
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
459
|
+
async function R(u, f) {
|
|
460
|
+
if (!(!u || f == null))
|
|
461
|
+
try {
|
|
462
|
+
const _ = await e.markConversationRead(u, f), v = (_ == null ? void 0 : _.last_read_message_id) ?? f, h = t.conversations.findIndex((m) => (m == null ? void 0 : m.id) === u);
|
|
463
|
+
h !== -1 && (t.conversations[h] = {
|
|
464
|
+
...t.conversations[h],
|
|
465
|
+
last_read_message_id: v
|
|
466
|
+
});
|
|
467
|
+
} catch (_) {
|
|
468
|
+
console.error("[store] markConversationRead failed", _);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
async function A(u, f, { attachments: _, metadata: v } = {}) {
|
|
472
|
+
var I;
|
|
473
|
+
const h = (f || "").trim(), m = Array.isArray(_) && _.length > 0;
|
|
474
|
+
if (!u || !h && !m) return;
|
|
475
|
+
const p = ze(), y = re(u), M = {
|
|
456
476
|
id: p,
|
|
457
477
|
client_msg_id: p,
|
|
458
478
|
conversation_id: u,
|
|
@@ -460,190 +480,191 @@ function ze(e) {
|
|
|
460
480
|
text_md: h,
|
|
461
481
|
author: {
|
|
462
482
|
type: "user",
|
|
463
|
-
id: ((
|
|
483
|
+
id: ((I = t.customer) == null ? void 0 : I.external_id) || null
|
|
464
484
|
},
|
|
465
|
-
created_at:
|
|
485
|
+
created_at: y,
|
|
466
486
|
// Local-only flag — UI may render dimmed until the SSE echo lands.
|
|
467
487
|
_pending: !0,
|
|
468
|
-
...
|
|
469
|
-
...
|
|
488
|
+
...m ? { payload: { type: "content", attachments: _ } } : {},
|
|
489
|
+
...v && typeof v == "object" ? { metadata: v } : {}
|
|
470
490
|
};
|
|
471
491
|
z(u, M);
|
|
472
492
|
try {
|
|
473
493
|
await e.postMessage(u, {
|
|
474
494
|
client_msg_id: p,
|
|
475
495
|
text_md: h,
|
|
476
|
-
created_at:
|
|
477
|
-
...
|
|
478
|
-
...
|
|
496
|
+
created_at: y,
|
|
497
|
+
...m ? { attachments: _ } : {},
|
|
498
|
+
...v && typeof v == "object" ? { metadata: v } : {}
|
|
479
499
|
});
|
|
480
|
-
} catch (
|
|
481
|
-
console.error("[store] send failed",
|
|
500
|
+
} catch (O) {
|
|
501
|
+
console.error("[store] send failed", O), G(u, p, { _failed: !0, _pending: !1 });
|
|
482
502
|
}
|
|
483
503
|
}
|
|
484
|
-
async function
|
|
504
|
+
async function U(u, f, _) {
|
|
485
505
|
u != null && (t.awaitingCallback[u] = !0);
|
|
486
506
|
try {
|
|
487
|
-
await e.postCallback(u,
|
|
488
|
-
} catch (
|
|
489
|
-
console.error("[store] callback failed",
|
|
507
|
+
await e.postCallback(u, f, _);
|
|
508
|
+
} catch (v) {
|
|
509
|
+
console.error("[store] callback failed", v), u != null && delete t.awaitingCallback[u];
|
|
490
510
|
}
|
|
491
511
|
}
|
|
492
|
-
const
|
|
493
|
-
async function
|
|
512
|
+
const S = /* @__PURE__ */ new Map();
|
|
513
|
+
async function D(u) {
|
|
494
514
|
if (!u) return null;
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
-
const _ =
|
|
498
|
-
if (!_ || _ - Date.now() > 6e4) return
|
|
515
|
+
const f = S.get(u);
|
|
516
|
+
if (f != null && f.url) {
|
|
517
|
+
const _ = f.expires_at ? Date.parse(f.expires_at) : 0;
|
|
518
|
+
if (!_ || _ - Date.now() > 6e4) return f.url;
|
|
499
519
|
}
|
|
500
520
|
try {
|
|
501
521
|
const _ = await e.signAttachment(u);
|
|
502
522
|
if (_ != null && _.signed_url)
|
|
503
|
-
return
|
|
523
|
+
return S.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
|
|
504
524
|
} catch (_) {
|
|
505
525
|
console.error("[store] sign attachment failed", _);
|
|
506
526
|
}
|
|
507
527
|
return null;
|
|
508
528
|
}
|
|
509
|
-
async function
|
|
510
|
-
const
|
|
511
|
-
...(
|
|
529
|
+
async function N(u, { rating: f, comment: _ } = {}) {
|
|
530
|
+
const v = t.conversations.find((p) => p.id === u), m = {
|
|
531
|
+
...(v == null ? void 0 : v.metadata) || {},
|
|
512
532
|
feedback: {
|
|
513
|
-
rating:
|
|
533
|
+
rating: f,
|
|
514
534
|
comment: _ || null,
|
|
515
535
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
516
536
|
}
|
|
517
537
|
};
|
|
518
|
-
await
|
|
538
|
+
await T(u, { metadata: m });
|
|
519
539
|
}
|
|
520
|
-
function
|
|
521
|
-
var _,
|
|
522
|
-
const
|
|
523
|
-
for (let h =
|
|
524
|
-
const
|
|
525
|
-
if ((
|
|
526
|
-
return
|
|
540
|
+
function j(u) {
|
|
541
|
+
var _, v;
|
|
542
|
+
const f = t.messagesByConv[u] || [];
|
|
543
|
+
for (let h = f.length - 1; h >= 0; h--) {
|
|
544
|
+
const m = f[h];
|
|
545
|
+
if ((m == null ? void 0 : m.type) === "action" && ((_ = m == null ? void 0 : m.payload) == null ? void 0 : _.type) === "action" && ((v = m == null ? void 0 : m.payload) == null ? void 0 : v.state) === "pending" && Array.isArray(m == null ? void 0 : m.callbacks) && m.callbacks.length > 0 && !t.awaitingCallback[m.id])
|
|
546
|
+
return m;
|
|
527
547
|
}
|
|
528
548
|
return null;
|
|
529
549
|
}
|
|
530
|
-
function
|
|
531
|
-
var _,
|
|
532
|
-
const
|
|
533
|
-
for (let
|
|
534
|
-
const p = m
|
|
535
|
-
if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((
|
|
536
|
-
const
|
|
537
|
-
if (
|
|
538
|
-
return { message: p, form:
|
|
550
|
+
function K(u) {
|
|
551
|
+
var _, v, h;
|
|
552
|
+
const f = t.messagesByConv[u] || [];
|
|
553
|
+
for (let m = f.length - 1; m >= 0; m--) {
|
|
554
|
+
const p = f[m];
|
|
555
|
+
if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((v = p == null ? void 0 : p.payload) == null ? void 0 : v.state) === "pending") return null;
|
|
556
|
+
const y = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
|
|
557
|
+
if (y && Array.isArray(y.fields) && y.fields.length > 0)
|
|
558
|
+
return { message: p, form: y };
|
|
539
559
|
}
|
|
540
560
|
return null;
|
|
541
561
|
}
|
|
542
|
-
function
|
|
543
|
-
const
|
|
544
|
-
if (!
|
|
545
|
-
const _ = Object.keys(
|
|
562
|
+
function Q(u) {
|
|
563
|
+
const f = t.runningActionsByConv[u];
|
|
564
|
+
if (!f) return null;
|
|
565
|
+
const _ = Object.keys(f);
|
|
546
566
|
if (_.length === 0) return null;
|
|
547
|
-
const
|
|
548
|
-
return { id:
|
|
567
|
+
const v = _[0];
|
|
568
|
+
return { id: v, payload: { name: f[v] } };
|
|
549
569
|
}
|
|
550
|
-
function
|
|
551
|
-
var _,
|
|
552
|
-
const
|
|
553
|
-
for (let p =
|
|
554
|
-
const
|
|
555
|
-
if (((_ =
|
|
556
|
-
if ((
|
|
557
|
-
if (((h =
|
|
558
|
-
const M = (
|
|
559
|
-
return Array.isArray(M) && M.length ? M.map((
|
|
560
|
-
if (typeof
|
|
561
|
-
const
|
|
562
|
-
return
|
|
570
|
+
function Z(u) {
|
|
571
|
+
var _, v, h, m;
|
|
572
|
+
const f = t.messagesByConv[u] || [];
|
|
573
|
+
for (let p = f.length - 1; p >= 0; p--) {
|
|
574
|
+
const y = f[p];
|
|
575
|
+
if (((_ = y == null ? void 0 : y.author) == null ? void 0 : _.type) === "user") return [];
|
|
576
|
+
if ((y == null ? void 0 : y.type) === "action" && ((v = y == null ? void 0 : y.payload) == null ? void 0 : v.state) === "pending") return [];
|
|
577
|
+
if (((h = y == null ? void 0 : y.author) == null ? void 0 : h.type) !== "agent_ia") continue;
|
|
578
|
+
const M = (m = y == null ? void 0 : y.metadata) == null ? void 0 : m.suggested_replies;
|
|
579
|
+
return Array.isArray(M) && M.length ? M.map((I) => {
|
|
580
|
+
if (typeof I == "string") {
|
|
581
|
+
const O = I.trim();
|
|
582
|
+
return O ? { label: O, kind: null } : null;
|
|
563
583
|
}
|
|
564
|
-
if (
|
|
565
|
-
const
|
|
566
|
-
if (!
|
|
567
|
-
const
|
|
568
|
-
return { label:
|
|
584
|
+
if (I && typeof I == "object" && typeof I.label == "string") {
|
|
585
|
+
const O = I.label.trim();
|
|
586
|
+
if (!O) return null;
|
|
587
|
+
const Te = I.kind === "cta" || I.kind === "choice" || I.kind === "followup" ? I.kind : null;
|
|
588
|
+
return { label: O, kind: Te };
|
|
569
589
|
}
|
|
570
590
|
return null;
|
|
571
591
|
}).filter(Boolean).slice(0, 4) : [];
|
|
572
592
|
}
|
|
573
593
|
return [];
|
|
574
594
|
}
|
|
575
|
-
function z(u,
|
|
576
|
-
var
|
|
595
|
+
function z(u, f) {
|
|
596
|
+
var m;
|
|
577
597
|
const _ = t.messagesByConv[u] || [];
|
|
578
|
-
let
|
|
579
|
-
|
|
580
|
-
(p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id ===
|
|
581
|
-
)),
|
|
598
|
+
let v = -1;
|
|
599
|
+
f != null && f.client_msg_id && (v = _.findIndex(
|
|
600
|
+
(p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === f.client_msg_id
|
|
601
|
+
)), v === -1 && (f == null ? void 0 : f.id) !== void 0 && (f == null ? void 0 : f.id) !== null && (v = _.findIndex((p) => ee(p == null ? void 0 : p.id, f.id)));
|
|
582
602
|
let h;
|
|
583
|
-
|
|
603
|
+
v === -1 ? h = [..._, f].sort(se) : (h = _.slice(), h[v] = { ..._[v], ...f, _pending: !1, _failed: !1 }), t.messagesByConv[u] = h, (f == null ? void 0 : f.type) === "action" && ((m = f == null ? void 0 : f.payload) != null && m.state) && f.payload.state !== "pending" && (f == null ? void 0 : f.id) != null && t.awaitingCallback[f.id] && delete t.awaitingCallback[f.id];
|
|
584
604
|
}
|
|
585
|
-
function
|
|
586
|
-
return u ===
|
|
605
|
+
function ee(u, f) {
|
|
606
|
+
return u === f ? !0 : u == null || f == null ? !1 : String(u) === String(f);
|
|
587
607
|
}
|
|
588
|
-
function G(u,
|
|
589
|
-
const
|
|
590
|
-
if (!
|
|
591
|
-
const h =
|
|
608
|
+
function G(u, f, _) {
|
|
609
|
+
const v = t.messagesByConv[u];
|
|
610
|
+
if (!v) return;
|
|
611
|
+
const h = v.findIndex((p) => p.id === f);
|
|
592
612
|
if (h === -1) return;
|
|
593
|
-
const
|
|
594
|
-
|
|
613
|
+
const m = v.slice();
|
|
614
|
+
m[h] = { ...v[h], ..._ }, t.messagesByConv[u] = m;
|
|
595
615
|
}
|
|
596
|
-
function
|
|
616
|
+
function H(u, f) {
|
|
597
617
|
const _ = t.conversations.findIndex((h) => h.id === u);
|
|
598
618
|
if (_ === -1) return;
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
619
|
+
const v = t.conversations[_];
|
|
620
|
+
if (f && (!v.last_message_at || f > v.last_message_at)) {
|
|
601
621
|
const h = t.conversations.slice();
|
|
602
|
-
h[_] = { ...
|
|
603
|
-
(
|
|
622
|
+
h[_] = { ...v, last_message_at: f }, h.sort(
|
|
623
|
+
(m, p) => (p.last_message_at || "").localeCompare(m.last_message_at || "")
|
|
604
624
|
), t.conversations = h;
|
|
605
625
|
}
|
|
606
626
|
}
|
|
607
|
-
function
|
|
608
|
-
return (u.created_at || "").localeCompare(
|
|
627
|
+
function se(u, f) {
|
|
628
|
+
return (u.created_at || "").localeCompare(f.created_at || "");
|
|
609
629
|
}
|
|
610
|
-
function
|
|
630
|
+
function ce(u) {
|
|
611
631
|
if (!u || typeof u != "object") return null;
|
|
612
|
-
const
|
|
613
|
-
for (const [
|
|
614
|
-
h !== void 0 && (
|
|
615
|
-
return Object.keys(_).length && (
|
|
632
|
+
const f = {}, _ = {};
|
|
633
|
+
for (const [v, h] of Object.entries(u))
|
|
634
|
+
h !== void 0 && (v === "name" || v === "email" ? h != null && String(h).trim() !== "" && (f[v] = h) : (v === "values" || v === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[v] = h);
|
|
635
|
+
return Object.keys(_).length && (f.values = _), Object.keys(f).length ? f : null;
|
|
616
636
|
}
|
|
617
|
-
function
|
|
618
|
-
const
|
|
637
|
+
function re(u) {
|
|
638
|
+
const f = t.messagesByConv[u] || [];
|
|
619
639
|
let _ = "";
|
|
620
|
-
for (const
|
|
621
|
-
|
|
622
|
-
const
|
|
623
|
-
return !_ ||
|
|
640
|
+
for (const m of f)
|
|
641
|
+
m != null && m.created_at && m.created_at > _ && (_ = m.created_at);
|
|
642
|
+
const v = (/* @__PURE__ */ new Date()).toISOString();
|
|
643
|
+
return !_ || v > _ ? v : new Date(Date.parse(_) + 1).toISOString();
|
|
624
644
|
}
|
|
625
645
|
return {
|
|
626
646
|
state: t,
|
|
627
647
|
start: i,
|
|
628
648
|
destroy: r,
|
|
629
649
|
applyCustomer: s,
|
|
630
|
-
createConversation:
|
|
650
|
+
createConversation: a,
|
|
631
651
|
openConversation: g,
|
|
632
652
|
loadMore: k,
|
|
633
|
-
patchConversation:
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
653
|
+
patchConversation: T,
|
|
654
|
+
markConversationRead: R,
|
|
655
|
+
send: A,
|
|
656
|
+
clickCallback: U,
|
|
657
|
+
signAttachment: D,
|
|
658
|
+
submitFeedback: N,
|
|
659
|
+
getPendingApproval: j,
|
|
660
|
+
getActionInFlight: Q,
|
|
661
|
+
getLatestSuggestions: Z,
|
|
662
|
+
getLatestForm: K,
|
|
642
663
|
// Pass-through for panel open/close (controls SSE burst).
|
|
643
664
|
setPanelOpen: e.setPanelOpen
|
|
644
665
|
};
|
|
645
666
|
}
|
|
646
|
-
const
|
|
667
|
+
const P = {
|
|
647
668
|
w: "#ffffff",
|
|
648
669
|
g50: "#F9F9F7",
|
|
649
670
|
g100: "#F2F1EE",
|
|
@@ -659,37 +680,37 @@ const j = {
|
|
|
659
680
|
green: "#22C55E",
|
|
660
681
|
red: "#B91C1C",
|
|
661
682
|
redBg: "#FDECEC"
|
|
662
|
-
},
|
|
663
|
-
function be(e = "") {
|
|
664
|
-
return e ? ce[e.charCodeAt(0) % ce.length] : ce[0];
|
|
665
|
-
}
|
|
683
|
+
}, ue = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
|
|
666
684
|
function ke(e = "") {
|
|
685
|
+
return e ? ue[e.charCodeAt(0) % ue.length] : ue[0];
|
|
686
|
+
}
|
|
687
|
+
function Ce(e = "") {
|
|
667
688
|
return e.split(" ").map((t) => t[0] || "").join("").toUpperCase().slice(0, 2);
|
|
668
689
|
}
|
|
669
|
-
function
|
|
690
|
+
function Ae(e = /* @__PURE__ */ new Date()) {
|
|
670
691
|
return e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
|
|
671
692
|
}
|
|
672
|
-
const
|
|
693
|
+
const qe = `
|
|
673
694
|
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
|
|
674
695
|
|
|
675
696
|
.wm-root {
|
|
676
697
|
--wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
677
698
|
--wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
678
|
-
--wm-w: ${
|
|
679
|
-
--wm-g50: ${
|
|
680
|
-
--wm-g100: ${
|
|
681
|
-
--wm-g150: ${
|
|
682
|
-
--wm-g200: ${
|
|
683
|
-
--wm-g300: ${
|
|
684
|
-
--wm-g400: ${
|
|
685
|
-
--wm-g500: ${
|
|
686
|
-
--wm-g700: ${
|
|
687
|
-
--wm-g900: ${
|
|
688
|
-
--wm-a: ${
|
|
689
|
-
--wm-al: ${
|
|
690
|
-
--wm-green: ${
|
|
691
|
-
--wm-red: ${
|
|
692
|
-
--wm-redBg: ${
|
|
699
|
+
--wm-w: ${P.w};
|
|
700
|
+
--wm-g50: ${P.g50};
|
|
701
|
+
--wm-g100: ${P.g100};
|
|
702
|
+
--wm-g150: ${P.g150};
|
|
703
|
+
--wm-g200: ${P.g200};
|
|
704
|
+
--wm-g300: ${P.g300};
|
|
705
|
+
--wm-g400: ${P.g400};
|
|
706
|
+
--wm-g500: ${P.g500};
|
|
707
|
+
--wm-g700: ${P.g700};
|
|
708
|
+
--wm-g900: ${P.g900};
|
|
709
|
+
--wm-a: ${P.accent};
|
|
710
|
+
--wm-al: ${P.accentLight};
|
|
711
|
+
--wm-green: ${P.green};
|
|
712
|
+
--wm-red: ${P.red};
|
|
713
|
+
--wm-redBg: ${P.redBg};
|
|
693
714
|
--wm-sh1: 0 1px 3px rgba(0,0,0,.06);
|
|
694
715
|
--wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
|
|
695
716
|
--wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
|
|
@@ -715,41 +736,41 @@ const Ve = `
|
|
|
715
736
|
0% { transform: translateX(110%); opacity: 0; }
|
|
716
737
|
100% { transform: translateX(0); opacity: 1; }
|
|
717
738
|
}
|
|
718
|
-
`,
|
|
739
|
+
`, We = "https://api.messenger.victorc.fr";
|
|
719
740
|
function pe(e, t) {
|
|
720
741
|
if (!Array.isArray(e == null ? void 0 : e.options)) return t;
|
|
721
742
|
const n = e.options.find((i) => (i == null ? void 0 : i.value) === t);
|
|
722
743
|
return (n == null ? void 0 : n.label) || t;
|
|
723
744
|
}
|
|
724
|
-
function
|
|
745
|
+
function Se(e, t) {
|
|
725
746
|
return Array.isArray(t) ? t.map((n) => pe(e, String(n))).join(", ") : typeof t == "boolean" ? t ? "Oui" : "Non" : pe(e, String(t));
|
|
726
747
|
}
|
|
727
|
-
function
|
|
748
|
+
function Ke(e, t) {
|
|
728
749
|
if (!e || !t) return "";
|
|
729
750
|
const n = Array.isArray(e.fields) ? e.fields : [], i = [];
|
|
730
751
|
for (const r of n) {
|
|
731
752
|
if (!(r != null && r.key) || !(r != null && r.label)) continue;
|
|
732
753
|
const s = t[r.key];
|
|
733
754
|
if (s == null || s === "") continue;
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
${
|
|
755
|
+
const a = Se(r, s);
|
|
756
|
+
a && i.push(`${r.label} :
|
|
757
|
+
${a}`);
|
|
737
758
|
}
|
|
738
759
|
return i.join(`
|
|
739
760
|
|
|
740
761
|
`);
|
|
741
762
|
}
|
|
742
|
-
function
|
|
763
|
+
function Ge(e, t) {
|
|
743
764
|
const n = [], i = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
744
765
|
for (const r of i) {
|
|
745
766
|
if (!(r != null && r.key) || !(r != null && r.label)) continue;
|
|
746
767
|
const s = t == null ? void 0 : t[r.key];
|
|
747
768
|
if (s == null || s === "") continue;
|
|
748
|
-
const
|
|
749
|
-
if (!
|
|
750
|
-
const l = r.type === "textarea" || typeof
|
|
769
|
+
const a = Se(r, s);
|
|
770
|
+
if (!a) continue;
|
|
771
|
+
const l = r.type === "textarea" || typeof a == "string" && (a.length > 60 || a.includes(`
|
|
751
772
|
`));
|
|
752
|
-
n.push({ label: r.label, value:
|
|
773
|
+
n.push({ label: r.label, value: a, multiline: l });
|
|
753
774
|
}
|
|
754
775
|
return {
|
|
755
776
|
kind: "form_response",
|
|
@@ -759,39 +780,36 @@ function Ke(e, t) {
|
|
|
759
780
|
}
|
|
760
781
|
};
|
|
761
782
|
}
|
|
762
|
-
function
|
|
783
|
+
function le(e) {
|
|
763
784
|
var n;
|
|
764
785
|
const t = (n = e == null ? void 0 : e.author) == null ? void 0 : n.type;
|
|
765
786
|
return t === "agent_ia" || t === "agent_human";
|
|
766
787
|
}
|
|
767
|
-
function
|
|
788
|
+
function X(e) {
|
|
789
|
+
if (e == null) return null;
|
|
790
|
+
const t = typeof e == "number" ? e : Number(e);
|
|
791
|
+
return Number.isFinite(t) ? t : null;
|
|
792
|
+
}
|
|
793
|
+
function ge(e, t) {
|
|
768
794
|
let n = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
|
|
769
795
|
for (const i of t)
|
|
770
796
|
i != null && i.created_at && i.created_at > n && (n = i.created_at);
|
|
771
797
|
return n;
|
|
772
798
|
}
|
|
773
|
-
function
|
|
774
|
-
var t, n;
|
|
775
|
-
for (let i = e.length - 1; i >= 0; i--) {
|
|
776
|
-
const r = (n = (t = e[i]) == null ? void 0 : t.author) == null ? void 0 : n.type;
|
|
777
|
-
if (r) return r;
|
|
778
|
-
}
|
|
779
|
-
return "";
|
|
780
|
-
}
|
|
781
|
-
function Ge(e, t) {
|
|
799
|
+
function Ye(e, t) {
|
|
782
800
|
var n, i, r;
|
|
783
801
|
for (let s = t.length - 1; s >= 0; s--) {
|
|
784
|
-
const
|
|
785
|
-
if (!
|
|
786
|
-
const l = typeof
|
|
802
|
+
const a = t[s];
|
|
803
|
+
if (!a) continue;
|
|
804
|
+
const l = typeof a.text_md == "string" ? a.text_md.trim() : "";
|
|
787
805
|
if (l)
|
|
788
|
-
return (((n =
|
|
789
|
-
const g = (i =
|
|
806
|
+
return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
|
|
807
|
+
const g = (i = a.payload) == null ? void 0 : i.attachments;
|
|
790
808
|
if (Array.isArray(g) && g.length) return "📎 Pièce jointe";
|
|
791
809
|
}
|
|
792
810
|
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) || "";
|
|
793
811
|
}
|
|
794
|
-
function
|
|
812
|
+
function Xe(e) {
|
|
795
813
|
return (e == null ? void 0 : e.name) || ((e == null ? void 0 : e.type) === "user" ? "Vous" : (e == null ? void 0 : e.type) === "agent_human" ? "Agent" : (e == null ? void 0 : e.type) === "agent_ia" ? "Assistant IA" : "Système");
|
|
796
814
|
}
|
|
797
815
|
function Je(e, t) {
|
|
@@ -804,13 +822,13 @@ function Je(e, t) {
|
|
|
804
822
|
if (!i) continue;
|
|
805
823
|
const r = (i.text_md || "").trim();
|
|
806
824
|
if (!r) continue;
|
|
807
|
-
const s =
|
|
808
|
-
n.push(`[${
|
|
825
|
+
const s = Xe(i.author), a = i.created_at ? new Date(i.created_at).toLocaleString("fr-FR") : "";
|
|
826
|
+
n.push(`[${a}] ${s} :`), n.push(r), n.push("");
|
|
809
827
|
}
|
|
810
828
|
return n.join(`
|
|
811
829
|
`);
|
|
812
830
|
}
|
|
813
|
-
function
|
|
831
|
+
function Qe(e, t) {
|
|
814
832
|
if (!e) return;
|
|
815
833
|
const n = Je(e, t || []), i = new Blob([n], { type: "text/plain;charset=utf-8" });
|
|
816
834
|
try {
|
|
@@ -820,7 +838,7 @@ function Xe(e, t) {
|
|
|
820
838
|
console.error("[ww-messenger] export failed", r);
|
|
821
839
|
}
|
|
822
840
|
}
|
|
823
|
-
const
|
|
841
|
+
const Ze = {
|
|
824
842
|
data() {
|
|
825
843
|
const e = typeof Notification < "u";
|
|
826
844
|
return {
|
|
@@ -921,14 +939,14 @@ const Qe = {
|
|
|
921
939
|
this.browserNotifEnabled = t === "granted", this.persistBrowserNotifPref();
|
|
922
940
|
},
|
|
923
941
|
onIncomingNotification(e) {
|
|
924
|
-
var
|
|
942
|
+
var a;
|
|
925
943
|
if (!this.soundEnabled && !this.browserNotifEnabled) return;
|
|
926
944
|
const t = e == null ? void 0 : e.conversation_id, n = e == null ? void 0 : e.message;
|
|
927
|
-
if (!t || !n || !
|
|
945
|
+
if (!t || !n || !le(n)) return;
|
|
928
946
|
const i = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
|
|
929
947
|
if (Number.isFinite(i) && i < this.convOpenedAt - 1e3) return;
|
|
930
948
|
const r = typeof document < "u" && document.hidden;
|
|
931
|
-
this.isOpen && !r && ((
|
|
949
|
+
this.isOpen && !r && ((a = this.currentConv) == null ? void 0 : a.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, n));
|
|
932
950
|
},
|
|
933
951
|
playNotificationSound() {
|
|
934
952
|
if (typeof window > "u") return;
|
|
@@ -948,9 +966,9 @@ const Qe = {
|
|
|
948
966
|
}
|
|
949
967
|
},
|
|
950
968
|
showBrowserNotification(e, t) {
|
|
951
|
-
var
|
|
969
|
+
var a;
|
|
952
970
|
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
953
|
-
const n = this.allConversations.find((l) => l.id === e), i = (n == null ? void 0 : n.name) || ((
|
|
971
|
+
const n = this.allConversations.find((l) => l.id === e), i = (n == null ? void 0 : n.name) || ((a = this.widget) == null ? void 0 : a.name) || "Nouveau message", r = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", s = r ? r.slice(0, 140) : "Vous avez un nouveau message";
|
|
954
972
|
try {
|
|
955
973
|
const l = new Notification(i, {
|
|
956
974
|
body: s,
|
|
@@ -974,7 +992,7 @@ const Qe = {
|
|
|
974
992
|
}
|
|
975
993
|
}
|
|
976
994
|
}
|
|
977
|
-
},
|
|
995
|
+
}, et = 450, tt = 50, nt = 900, st = 12e3, rt = 300, it = {
|
|
978
996
|
data() {
|
|
979
997
|
return {
|
|
980
998
|
// Map: messageId → ms timestamp once shown.
|
|
@@ -998,16 +1016,16 @@ const Qe = {
|
|
|
998
1016
|
// bounded by MIN/MAX_TYPING_MS.
|
|
999
1017
|
scheduleReveal(e) {
|
|
1000
1018
|
const t = Date.now(), n = ((e == null ? void 0 : e.text_md) || "").length, i = Math.min(
|
|
1001
|
-
|
|
1002
|
-
Math.max(
|
|
1019
|
+
st,
|
|
1020
|
+
Math.max(nt, n * tt)
|
|
1003
1021
|
), s = Math.max(
|
|
1004
|
-
t +
|
|
1005
|
-
this.nextRevealAt +
|
|
1022
|
+
t + et,
|
|
1023
|
+
this.nextRevealAt + rt
|
|
1006
1024
|
) + i;
|
|
1007
1025
|
this.nextRevealAt = s;
|
|
1008
|
-
const
|
|
1026
|
+
const a = Math.max(0, s - t), l = e.id, g = setTimeout(() => {
|
|
1009
1027
|
this.revealedAt = { ...this.revealedAt, [l]: Date.now() }, this.revealTimers = this.revealTimers.filter((k) => k !== g);
|
|
1010
|
-
},
|
|
1028
|
+
}, a);
|
|
1011
1029
|
this.revealTimers.push(g);
|
|
1012
1030
|
},
|
|
1013
1031
|
// Walk the message list and queue / instantly-reveal every new
|
|
@@ -1019,7 +1037,7 @@ const Qe = {
|
|
|
1019
1037
|
const t = Date.now(), n = { ...this.revealedAt };
|
|
1020
1038
|
for (const r of e) {
|
|
1021
1039
|
if ((r == null ? void 0 : r.id) == null || n[r.id] !== void 0) continue;
|
|
1022
|
-
if (!
|
|
1040
|
+
if (!le(r)) {
|
|
1023
1041
|
n[r.id] = t;
|
|
1024
1042
|
continue;
|
|
1025
1043
|
}
|
|
@@ -1028,8 +1046,8 @@ const Qe = {
|
|
|
1028
1046
|
n[r.id] = t;
|
|
1029
1047
|
continue;
|
|
1030
1048
|
}
|
|
1031
|
-
const
|
|
1032
|
-
if (!
|
|
1049
|
+
const a = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, l = Array.isArray((i = r == null ? void 0 : r.payload) == null ? void 0 : i.attachments) && r.payload.attachments.length > 0;
|
|
1050
|
+
if (!a && !l) {
|
|
1033
1051
|
n[r.id] = t;
|
|
1034
1052
|
continue;
|
|
1035
1053
|
}
|
|
@@ -1038,7 +1056,7 @@ const Qe = {
|
|
|
1038
1056
|
this.revealedAt = n;
|
|
1039
1057
|
}
|
|
1040
1058
|
}
|
|
1041
|
-
},
|
|
1059
|
+
}, at = {
|
|
1042
1060
|
data() {
|
|
1043
1061
|
return {
|
|
1044
1062
|
approvalSettled: !0,
|
|
@@ -1068,78 +1086,61 @@ const Qe = {
|
|
|
1068
1086
|
}, e);
|
|
1069
1087
|
}
|
|
1070
1088
|
}
|
|
1071
|
-
},
|
|
1089
|
+
}, ot = 300, lt = {
|
|
1072
1090
|
data() {
|
|
1073
1091
|
return {
|
|
1074
|
-
//
|
|
1075
|
-
//
|
|
1076
|
-
//
|
|
1077
|
-
|
|
1078
|
-
//
|
|
1079
|
-
//
|
|
1080
|
-
//
|
|
1081
|
-
|
|
1082
|
-
//
|
|
1083
|
-
|
|
1084
|
-
//
|
|
1085
|
-
// the current thread (panel open + thread visible). Drives the
|
|
1086
|
-
// "Non lus" separator inside the MessageList: messages newer than
|
|
1087
|
-
// this anchor are shown below the separator. Distinct from
|
|
1088
|
-
// `readState` because that one gets bumped to the latest as soon
|
|
1089
|
-
// as the messages render — we need to remember what was read
|
|
1090
|
-
// BEFORE this viewing session so the separator stays put.
|
|
1091
|
-
unreadAnchorTs: "",
|
|
1092
|
-
// Borne haute du batch "Non lus" — instant ISO capturé à
|
|
1093
|
-
// l'ouverture du thread. Les messages arrivant APRÈS (created_at
|
|
1094
|
-
// > borne) ne déclenchent pas le séparateur : l'utilisateur est
|
|
1095
|
-
// déjà sur le ticket, il les voit arriver en direct. Vide ⇒ pas
|
|
1096
|
-
// de borne (séparateur classique).
|
|
1092
|
+
// Numeric message id snapshot frozen the moment the user
|
|
1093
|
+
// *started viewing* the current thread. Drives the "Non lus"
|
|
1094
|
+
// separator: messages whose id > this anchor are below it.
|
|
1095
|
+
// We can't read the conversation's live `last_read_message_id`
|
|
1096
|
+
// here because `markConvRead` bumps it forward as soon as
|
|
1097
|
+
// messages render — we need the value as it stood BEFORE this
|
|
1098
|
+
// viewing session.
|
|
1099
|
+
unreadAnchorId: null,
|
|
1100
|
+
// Upper bound for the "Non lus" batch (ISO captured at thread
|
|
1101
|
+
// open). Messages arriving AFTER this don't fall under the
|
|
1102
|
+
// separator — the user is actively watching them land.
|
|
1097
1103
|
unreadBoundaryTs: ""
|
|
1098
1104
|
};
|
|
1099
1105
|
},
|
|
1106
|
+
created() {
|
|
1107
|
+
this._readMarkerTimer = null, this._readMarkerPending = null;
|
|
1108
|
+
},
|
|
1109
|
+
beforeUnmount() {
|
|
1110
|
+
this._readMarkerTimer && (clearTimeout(this._readMarkerTimer), this._readMarkerTimer = null), this._readMarkerPending = null;
|
|
1111
|
+
},
|
|
1100
1112
|
methods: {
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
return `wm:read-boot:${this.widgetId || ""}:${this.userId || ""}`;
|
|
1106
|
-
},
|
|
1107
|
-
hydrateReadState() {
|
|
1108
|
-
try {
|
|
1109
|
-
if (typeof localStorage > "u") return;
|
|
1110
|
-
const e = localStorage.getItem(this.readStorageKey());
|
|
1111
|
-
if (e) {
|
|
1112
|
-
const n = JSON.parse(e);
|
|
1113
|
-
n && typeof n == "object" && (this.readState = n);
|
|
1114
|
-
}
|
|
1115
|
-
let t = localStorage.getItem(this.readBootStorageKey()) || "";
|
|
1116
|
-
t || (t = (/* @__PURE__ */ new Date()).toISOString(), localStorage.setItem(this.readBootStorageKey(), t)), this.readBootTs = t;
|
|
1117
|
-
} catch {
|
|
1118
|
-
}
|
|
1119
|
-
},
|
|
1120
|
-
persistReadState() {
|
|
1121
|
-
try {
|
|
1122
|
-
if (typeof localStorage > "u") return;
|
|
1123
|
-
localStorage.setItem(this.readStorageKey(), JSON.stringify(this.readState));
|
|
1124
|
-
} catch {
|
|
1125
|
-
}
|
|
1126
|
-
},
|
|
1127
|
-
// Stamp a conversation as read up to its newest known activity.
|
|
1128
|
-
// Called when the user opens/starts a thread and whenever the
|
|
1129
|
-
// actively-viewed thread receives new messages.
|
|
1113
|
+
// Stamp the conversation as read up to its newest cached message
|
|
1114
|
+
// (server-side, debounced). No-op for drafts, optimistic-only
|
|
1115
|
+
// messages, or when the pointer is already at/ahead of the
|
|
1116
|
+
// candidate id.
|
|
1130
1117
|
markConvRead(e) {
|
|
1131
|
-
var
|
|
1132
|
-
if (!(e != null && e.id) || e._draft) return;
|
|
1133
|
-
const t = ((
|
|
1134
|
-
|
|
1118
|
+
var s, a;
|
|
1119
|
+
if (!(e != null && e.id) || e._draft || !this.store) return;
|
|
1120
|
+
const t = ((a = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : a[e.id]) || [], n = dt(t);
|
|
1121
|
+
if (n == null) return;
|
|
1122
|
+
const i = X(e.last_read_message_id), r = X(n);
|
|
1123
|
+
r != null && (i != null && r <= i || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
|
|
1124
|
+
const l = this._readMarkerPending;
|
|
1125
|
+
this._readMarkerPending = null, this._readMarkerTimer = null, l && this.store && this.store.markConversationRead(l.convId, l.messageId);
|
|
1126
|
+
}, ot))));
|
|
1135
1127
|
}
|
|
1136
1128
|
}
|
|
1137
|
-
}
|
|
1129
|
+
};
|
|
1130
|
+
function dt(e) {
|
|
1131
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
1132
|
+
const n = e[t];
|
|
1133
|
+
if (!(!n || n._pending) && X(n.id) != null)
|
|
1134
|
+
return n.id;
|
|
1135
|
+
}
|
|
1136
|
+
return null;
|
|
1137
|
+
}
|
|
1138
|
+
const $ = (e, t) => {
|
|
1138
1139
|
const n = e.__vccOpts || e;
|
|
1139
1140
|
for (const [i, r] of t)
|
|
1140
1141
|
n[i] = r;
|
|
1141
1142
|
return n;
|
|
1142
|
-
},
|
|
1143
|
+
}, ct = {
|
|
1143
1144
|
name: "WmHumanAvatar",
|
|
1144
1145
|
props: {
|
|
1145
1146
|
name: { type: String, default: "" },
|
|
@@ -1153,17 +1154,17 @@ const Qe = {
|
|
|
1153
1154
|
},
|
|
1154
1155
|
computed: {
|
|
1155
1156
|
bg() {
|
|
1156
|
-
return this.avatarUrl ? "transparent" :
|
|
1157
|
+
return this.avatarUrl ? "transparent" : ke(this.name);
|
|
1157
1158
|
},
|
|
1158
1159
|
initials() {
|
|
1159
|
-
return
|
|
1160
|
+
return Ce(this.name);
|
|
1160
1161
|
}
|
|
1161
1162
|
}
|
|
1162
|
-
},
|
|
1163
|
-
function
|
|
1163
|
+
}, ut = ["src", "alt"];
|
|
1164
|
+
function ht(e, t, n, i, r, s) {
|
|
1164
1165
|
return d(), c("div", {
|
|
1165
|
-
class:
|
|
1166
|
-
style:
|
|
1166
|
+
class: x(["wm-huav", { "wm-huav--tail": n.tail }]),
|
|
1167
|
+
style: W({
|
|
1167
1168
|
width: n.size + "px",
|
|
1168
1169
|
height: n.size + "px",
|
|
1169
1170
|
"--wm-avr": Math.round(n.size * 0.32) + "px",
|
|
@@ -1174,15 +1175,15 @@ function dt(e, t, n, i, r, s) {
|
|
|
1174
1175
|
key: 0,
|
|
1175
1176
|
src: n.avatarUrl,
|
|
1176
1177
|
alt: n.name || ""
|
|
1177
|
-
}, null, 8,
|
|
1178
|
+
}, null, 8, ut)) : (d(), c("span", {
|
|
1178
1179
|
key: 1,
|
|
1179
|
-
style:
|
|
1180
|
+
style: W({ fontSize: n.size * 0.36 + "px" })
|
|
1180
1181
|
}, b(s.initials), 5))
|
|
1181
1182
|
], 6);
|
|
1182
1183
|
}
|
|
1183
|
-
const
|
|
1184
|
+
const xe = /* @__PURE__ */ $(ct, [["render", ht], ["__scopeId", "data-v-07246775"]]), mt = 3, ft = {
|
|
1184
1185
|
name: "WmLauncher",
|
|
1185
|
-
components: { HumanAvatar:
|
|
1186
|
+
components: { HumanAvatar: xe },
|
|
1186
1187
|
props: {
|
|
1187
1188
|
// Nombre de conversations non lues — pilote la pastille.
|
|
1188
1189
|
unreadCount: { type: Number, default: 0 },
|
|
@@ -1198,39 +1199,39 @@ const he = /* @__PURE__ */ L(ot, [["render", dt], ["__scopeId", "data-v-07246775
|
|
|
1198
1199
|
// élément en ordre DOM avec un flex column normal). Les plus
|
|
1199
1200
|
// anciens remontent dans la pile.
|
|
1200
1201
|
visiblePeeks() {
|
|
1201
|
-
return this.peeks.slice(0,
|
|
1202
|
+
return this.peeks.slice(0, mt).reverse();
|
|
1202
1203
|
}
|
|
1203
1204
|
}
|
|
1204
|
-
},
|
|
1205
|
-
function
|
|
1206
|
-
const
|
|
1207
|
-
return d(), c("div",
|
|
1208
|
-
|
|
1209
|
-
default:
|
|
1205
|
+
}, _t = { class: "wm-launcherWrap" }, pt = ["aria-label", "onClick", "onKeydown"], gt = ["onClick"], vt = { class: "wm-peek__avatar" }, yt = ["aria-label"], wt = { class: "wm-peek__body" }, bt = { class: "wm-peek__head" }, kt = { class: "wm-peek__name" }, Ct = { class: "wm-peek__text" }, At = ["onClick"], St = ["aria-label"];
|
|
1206
|
+
function xt(e, t, n, i, r, s) {
|
|
1207
|
+
const a = E("HumanAvatar");
|
|
1208
|
+
return d(), c("div", _t, [
|
|
1209
|
+
V(Oe, { name: "wm-peek" }, {
|
|
1210
|
+
default: Be(() => [
|
|
1210
1211
|
s.visiblePeeks.length ? (d(), c("div", {
|
|
1211
1212
|
key: 0,
|
|
1212
|
-
class:
|
|
1213
|
+
class: x(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
|
|
1213
1214
|
}, [
|
|
1214
|
-
(d(!0), c(
|
|
1215
|
+
(d(!0), c(B, null, F(s.visiblePeeks, (l, g) => (d(), c("div", {
|
|
1215
1216
|
key: l.convId,
|
|
1216
1217
|
class: "wm-peek",
|
|
1217
|
-
style:
|
|
1218
|
+
style: W({ "--depth": s.visiblePeeks.length - 1 - g, zIndex: g + 1 }),
|
|
1218
1219
|
role: "button",
|
|
1219
1220
|
tabindex: "0",
|
|
1220
1221
|
"aria-label": `Ouvrir la conversation avec ${l.senderName || "l'agent"}`,
|
|
1221
1222
|
onClick: (k) => e.$emit("open", l.convId),
|
|
1222
1223
|
onKeydown: [
|
|
1223
|
-
|
|
1224
|
-
|
|
1224
|
+
oe(Y((k) => e.$emit("open", l.convId), ["prevent"]), ["enter"]),
|
|
1225
|
+
oe(Y((k) => e.$emit("open", l.convId), ["prevent"]), ["space"])
|
|
1225
1226
|
]
|
|
1226
1227
|
}, [
|
|
1227
|
-
|
|
1228
|
+
o("button", {
|
|
1228
1229
|
type: "button",
|
|
1229
1230
|
class: "wm-peek__close",
|
|
1230
1231
|
"aria-label": "Ignorer",
|
|
1231
1232
|
onClick: Y((k) => e.$emit("dismiss", l.convId), ["stop"])
|
|
1232
1233
|
}, [...t[1] || (t[1] = [
|
|
1233
|
-
|
|
1234
|
+
o("svg", {
|
|
1234
1235
|
width: "9",
|
|
1235
1236
|
height: "9",
|
|
1236
1237
|
viewBox: "0 0 24 24",
|
|
@@ -1241,11 +1242,11 @@ function Ct(e, t, n, i, r, s) {
|
|
|
1241
1242
|
"stroke-linejoin": "round",
|
|
1242
1243
|
"aria-hidden": "true"
|
|
1243
1244
|
}, [
|
|
1244
|
-
|
|
1245
|
+
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
1245
1246
|
], -1)
|
|
1246
|
-
])], 8,
|
|
1247
|
-
|
|
1248
|
-
|
|
1247
|
+
])], 8, gt),
|
|
1248
|
+
o("div", vt, [
|
|
1249
|
+
V(a, {
|
|
1249
1250
|
name: l.senderName,
|
|
1250
1251
|
"avatar-url": l.senderAvatarUrl,
|
|
1251
1252
|
size: 34
|
|
@@ -1254,32 +1255,32 @@ function Ct(e, t, n, i, r, s) {
|
|
|
1254
1255
|
key: 0,
|
|
1255
1256
|
class: "wm-peek__avatarBadge",
|
|
1256
1257
|
"aria-label": `${l.count} messages non lus`
|
|
1257
|
-
}, b(l.count > 9 ? "9+" : l.count), 9,
|
|
1258
|
+
}, b(l.count > 9 ? "9+" : l.count), 9, yt)) : w("", !0)
|
|
1258
1259
|
]),
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
t[2] || (t[2] =
|
|
1260
|
+
o("div", wt, [
|
|
1261
|
+
o("div", bt, [
|
|
1262
|
+
o("span", kt, b(l.senderName || "Agent"), 1),
|
|
1263
|
+
t[2] || (t[2] = o("span", { class: "wm-peek__action" }, " vous a répondu", -1))
|
|
1263
1264
|
]),
|
|
1264
|
-
|
|
1265
|
+
o("p", Ct, b(l.preview), 1)
|
|
1265
1266
|
]),
|
|
1266
|
-
|
|
1267
|
+
o("button", {
|
|
1267
1268
|
type: "button",
|
|
1268
1269
|
class: "wm-peek__open",
|
|
1269
1270
|
onClick: Y((k) => e.$emit("open", l.convId), ["stop"])
|
|
1270
|
-
}, "Ouvrir", 8,
|
|
1271
|
-
], 44,
|
|
1271
|
+
}, "Ouvrir", 8, At)
|
|
1272
|
+
], 44, pt))), 128))
|
|
1272
1273
|
], 2)) : w("", !0)
|
|
1273
1274
|
]),
|
|
1274
1275
|
_: 1
|
|
1275
1276
|
}),
|
|
1276
|
-
|
|
1277
|
+
o("button", {
|
|
1277
1278
|
type: "button",
|
|
1278
1279
|
class: "wm-launcher",
|
|
1279
1280
|
"aria-label": "Ouvrir le messenger",
|
|
1280
1281
|
onClick: t[0] || (t[0] = (l) => e.$emit("open"))
|
|
1281
1282
|
}, [
|
|
1282
|
-
t[3] || (t[3] =
|
|
1283
|
+
t[3] || (t[3] = o("svg", {
|
|
1283
1284
|
width: "20",
|
|
1284
1285
|
height: "20",
|
|
1285
1286
|
viewBox: "0 0 24 24",
|
|
@@ -1290,17 +1291,17 @@ function Ct(e, t, n, i, r, s) {
|
|
|
1290
1291
|
"stroke-linejoin": "round",
|
|
1291
1292
|
"aria-hidden": "true"
|
|
1292
1293
|
}, [
|
|
1293
|
-
|
|
1294
|
+
o("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
1294
1295
|
], -1)),
|
|
1295
1296
|
n.unreadCount > 0 ? (d(), c("span", {
|
|
1296
1297
|
key: 0,
|
|
1297
1298
|
class: "wm-launcher__badge",
|
|
1298
1299
|
"aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
|
|
1299
|
-
}, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9,
|
|
1300
|
+
}, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, St)) : w("", !0)
|
|
1300
1301
|
])
|
|
1301
1302
|
]);
|
|
1302
1303
|
}
|
|
1303
|
-
const
|
|
1304
|
+
const Mt = /* @__PURE__ */ $(ft, [["render", xt], ["__scopeId", "data-v-525fd423"]]), Tt = {
|
|
1304
1305
|
name: "WmAIAvatar",
|
|
1305
1306
|
props: {
|
|
1306
1307
|
size: { type: Number, default: 26 },
|
|
@@ -1312,18 +1313,18 @@ const At = /* @__PURE__ */ L(ut, [["render", Ct], ["__scopeId", "data-v-525fd423
|
|
|
1312
1313
|
// pour garder l'avatar pleinement arrondi.
|
|
1313
1314
|
tail: { type: Boolean, default: !1 }
|
|
1314
1315
|
}
|
|
1315
|
-
},
|
|
1316
|
+
}, It = {
|
|
1316
1317
|
key: 0,
|
|
1317
1318
|
class: "wm-aiav__pulse"
|
|
1318
|
-
},
|
|
1319
|
-
function
|
|
1319
|
+
}, Ot = ["width", "height"];
|
|
1320
|
+
function Bt(e, t, n, i, r, s) {
|
|
1320
1321
|
return d(), c("div", {
|
|
1321
|
-
class:
|
|
1322
|
-
style:
|
|
1322
|
+
class: x(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
1323
|
+
style: W({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
|
|
1323
1324
|
}, [
|
|
1324
|
-
n.pulse ? (d(), c("div",
|
|
1325
|
-
|
|
1326
|
-
class:
|
|
1325
|
+
n.pulse ? (d(), c("div", It)) : w("", !0),
|
|
1326
|
+
o("div", {
|
|
1327
|
+
class: x(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
|
|
1327
1328
|
}, [
|
|
1328
1329
|
(d(), c("svg", {
|
|
1329
1330
|
width: n.size * 0.5,
|
|
@@ -1332,30 +1333,30 @@ function Mt(e, t, n, i, r, s) {
|
|
|
1332
1333
|
fill: "none",
|
|
1333
1334
|
"aria-hidden": "true"
|
|
1334
1335
|
}, [...t[0] || (t[0] = [
|
|
1335
|
-
|
|
1336
|
+
o("path", {
|
|
1336
1337
|
d: "M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",
|
|
1337
1338
|
fill: "white",
|
|
1338
1339
|
opacity: "0.92"
|
|
1339
1340
|
}, null, -1),
|
|
1340
|
-
|
|
1341
|
+
o("circle", {
|
|
1341
1342
|
cx: "19",
|
|
1342
1343
|
cy: "5",
|
|
1343
1344
|
r: "1.5",
|
|
1344
1345
|
fill: "white",
|
|
1345
1346
|
opacity: "0.55"
|
|
1346
1347
|
}, null, -1),
|
|
1347
|
-
|
|
1348
|
+
o("circle", {
|
|
1348
1349
|
cx: "5",
|
|
1349
1350
|
cy: "18",
|
|
1350
1351
|
r: "1",
|
|
1351
1352
|
fill: "white",
|
|
1352
1353
|
opacity: "0.38"
|
|
1353
1354
|
}, null, -1)
|
|
1354
|
-
])], 8,
|
|
1355
|
+
])], 8, Ot))
|
|
1355
1356
|
], 2)
|
|
1356
1357
|
], 6);
|
|
1357
1358
|
}
|
|
1358
|
-
const
|
|
1359
|
+
const ne = /* @__PURE__ */ $(Tt, [["render", Bt], ["__scopeId", "data-v-8c924688"]]), Et = {
|
|
1359
1360
|
name: "WmTeamAvatars",
|
|
1360
1361
|
props: {
|
|
1361
1362
|
members: { type: Array, default: () => [] },
|
|
@@ -1371,48 +1372,45 @@ const te = /* @__PURE__ */ L(St, [["render", Mt], ["__scopeId", "data-v-8c924688
|
|
|
1371
1372
|
},
|
|
1372
1373
|
methods: {
|
|
1373
1374
|
colorFor(e) {
|
|
1374
|
-
return e.avatar_url ? "transparent" :
|
|
1375
|
+
return e.avatar_url ? "transparent" : ke(e.name || "");
|
|
1375
1376
|
},
|
|
1376
1377
|
initialsFor(e) {
|
|
1377
|
-
return
|
|
1378
|
+
return Ce(e.name || "");
|
|
1378
1379
|
}
|
|
1379
1380
|
}
|
|
1380
|
-
},
|
|
1381
|
+
}, $t = {
|
|
1381
1382
|
key: 0,
|
|
1382
1383
|
class: "wm-team"
|
|
1383
|
-
},
|
|
1384
|
+
}, Lt = ["src", "alt"], Rt = { key: 1 }, Nt = {
|
|
1384
1385
|
key: 0,
|
|
1385
1386
|
class: "wm-team__label"
|
|
1386
1387
|
};
|
|
1387
|
-
function
|
|
1388
|
-
return s.visible ? (d(), c("div",
|
|
1389
|
-
|
|
1388
|
+
function Ft(e, t, n, i, r, s) {
|
|
1389
|
+
return s.visible ? (d(), c("div", $t, [
|
|
1390
|
+
o("div", {
|
|
1390
1391
|
class: "wm-team__stack",
|
|
1391
|
-
style:
|
|
1392
|
+
style: W({ width: s.stackWidth + "px" })
|
|
1392
1393
|
}, [
|
|
1393
|
-
(d(!0), c(
|
|
1394
|
+
(d(!0), c(B, null, F(n.members.slice(0, 3), (a, l) => (d(), c("div", {
|
|
1394
1395
|
key: l,
|
|
1395
1396
|
class: "wm-team__pill",
|
|
1396
|
-
style:
|
|
1397
|
+
style: W({ left: l * 13 + "px", zIndex: 3 - l, background: s.colorFor(a) })
|
|
1397
1398
|
}, [
|
|
1398
|
-
|
|
1399
|
+
a.avatar_url ? (d(), c("img", {
|
|
1399
1400
|
key: 0,
|
|
1400
|
-
src:
|
|
1401
|
-
alt:
|
|
1402
|
-
}, null, 8,
|
|
1401
|
+
src: a.avatar_url,
|
|
1402
|
+
alt: a.name || ""
|
|
1403
|
+
}, null, 8, Lt)) : (d(), c("span", Rt, b(s.initialsFor(a)), 1))
|
|
1403
1404
|
], 4))), 128))
|
|
1404
1405
|
], 4),
|
|
1405
|
-
n.responseLabel ? (d(), c("span",
|
|
1406
|
+
n.responseLabel ? (d(), c("span", Nt, b(n.responseLabel), 1)) : w("", !0)
|
|
1406
1407
|
])) : w("", !0);
|
|
1407
1408
|
}
|
|
1408
|
-
const
|
|
1409
|
+
const Pt = /* @__PURE__ */ $(Et, [["render", Ft], ["__scopeId", "data-v-3659b9c1"]]), Dt = {
|
|
1409
1410
|
name: "WmHeader",
|
|
1410
|
-
components: { AIAvatar:
|
|
1411
|
+
components: { AIAvatar: ne, TeamAvatars: Pt },
|
|
1411
1412
|
props: {
|
|
1412
1413
|
title: { type: String, default: "Nouvelle conversation" },
|
|
1413
|
-
escalated: { type: Boolean, default: !1 },
|
|
1414
|
-
agentName: { type: String, default: "" },
|
|
1415
|
-
agentAvatarUrl: { type: String, default: null },
|
|
1416
1414
|
showBack: { type: Boolean, default: !1 },
|
|
1417
1415
|
teamMembers: { type: Array, default: () => [] },
|
|
1418
1416
|
responseLabel: { type: String, default: "" },
|
|
@@ -1439,24 +1437,24 @@ const Rt = /* @__PURE__ */ L(Ot, [["render", $t], ["__scopeId", "data-v-3659b9c1
|
|
|
1439
1437
|
return n;
|
|
1440
1438
|
}
|
|
1441
1439
|
}
|
|
1442
|
-
},
|
|
1440
|
+
}, jt = { class: "wm-header" }, Ut = {
|
|
1443
1441
|
key: 1,
|
|
1444
1442
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
1445
|
-
},
|
|
1443
|
+
}, Vt = { class: "wm-header__avatar" }, zt = { class: "wm-header__main" }, Ht = { class: "wm-header__title" }, qt = {
|
|
1446
1444
|
key: 3,
|
|
1447
1445
|
class: "wm-header__fill"
|
|
1448
|
-
},
|
|
1449
|
-
function
|
|
1450
|
-
const
|
|
1451
|
-
return d(), c("div",
|
|
1446
|
+
}, Wt = { class: "wm-header__actions" };
|
|
1447
|
+
function Kt(e, t, n, i, r, s) {
|
|
1448
|
+
const a = E("AIAvatar"), l = E("TeamAvatars");
|
|
1449
|
+
return d(), c("div", jt, [
|
|
1452
1450
|
n.showBack ? (d(), c("button", {
|
|
1453
1451
|
key: 0,
|
|
1454
1452
|
type: "button",
|
|
1455
1453
|
class: "wm-header__icon",
|
|
1456
1454
|
"aria-label": "Retour à l'accueil",
|
|
1457
|
-
onClick: t[0] || (t[0] = (
|
|
1455
|
+
onClick: t[0] || (t[0] = (g) => e.$emit("back"))
|
|
1458
1456
|
}, [...t[3] || (t[3] = [
|
|
1459
|
-
|
|
1457
|
+
o("svg", {
|
|
1460
1458
|
width: "13",
|
|
1461
1459
|
height: "13",
|
|
1462
1460
|
viewBox: "0 0 24 24",
|
|
@@ -1467,57 +1465,49 @@ function Ht(e, t, n, i, r, s) {
|
|
|
1467
1465
|
"stroke-linejoin": "round",
|
|
1468
1466
|
"aria-hidden": "true"
|
|
1469
1467
|
}, [
|
|
1470
|
-
|
|
1468
|
+
o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
1471
1469
|
], -1)
|
|
1472
|
-
])])) : (d(), c("div",
|
|
1473
|
-
n.showIdentity ? (d(), c(
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
key: 0,
|
|
1477
|
-
name: n.agentName,
|
|
1478
|
-
"avatar-url": n.agentAvatarUrl,
|
|
1479
|
-
size: 30
|
|
1480
|
-
}, null, 8, ["name", "avatar-url"])) : (d(), $(l, {
|
|
1481
|
-
key: 1,
|
|
1482
|
-
size: 30
|
|
1483
|
-
}))
|
|
1470
|
+
])])) : (d(), c("div", Ut)),
|
|
1471
|
+
n.showIdentity ? (d(), c(B, { key: 2 }, [
|
|
1472
|
+
o("div", Vt, [
|
|
1473
|
+
V(a, { size: 30 })
|
|
1484
1474
|
]),
|
|
1485
|
-
|
|
1486
|
-
|
|
1475
|
+
o("div", zt, [
|
|
1476
|
+
o("div", Ht, b(n.title), 1)
|
|
1487
1477
|
]),
|
|
1488
|
-
s.hasTeam ? (d(),
|
|
1478
|
+
s.hasTeam ? (d(), L(l, {
|
|
1489
1479
|
key: 0,
|
|
1490
1480
|
members: s.displayedTeamMembers,
|
|
1491
1481
|
"response-label": ""
|
|
1492
1482
|
}, null, 8, ["members"])) : w("", !0)
|
|
1493
|
-
], 64)) : (d(), c("div",
|
|
1494
|
-
|
|
1483
|
+
], 64)) : (d(), c("div", qt)),
|
|
1484
|
+
o("div", Wt, [
|
|
1495
1485
|
n.showMore ? (d(), c("button", {
|
|
1496
1486
|
key: 0,
|
|
1497
1487
|
type: "button",
|
|
1498
|
-
class:
|
|
1488
|
+
class: x(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
|
|
1499
1489
|
"aria-label": "Plus d'options",
|
|
1500
1490
|
title: "Plus d'options",
|
|
1501
|
-
onClick: t[1] || (t[1] = (
|
|
1491
|
+
onClick: t[1] || (t[1] = (g) => e.$emit("more"))
|
|
1502
1492
|
}, [...t[4] || (t[4] = [
|
|
1503
|
-
|
|
1493
|
+
o("svg", {
|
|
1504
1494
|
width: "13",
|
|
1505
1495
|
height: "13",
|
|
1506
1496
|
viewBox: "0 0 24 24",
|
|
1507
1497
|
fill: "currentColor",
|
|
1508
1498
|
"aria-hidden": "true"
|
|
1509
1499
|
}, [
|
|
1510
|
-
|
|
1500
|
+
o("circle", {
|
|
1511
1501
|
cx: "12",
|
|
1512
1502
|
cy: "5",
|
|
1513
1503
|
r: "1.6"
|
|
1514
1504
|
}),
|
|
1515
|
-
|
|
1505
|
+
o("circle", {
|
|
1516
1506
|
cx: "12",
|
|
1517
1507
|
cy: "12",
|
|
1518
1508
|
r: "1.6"
|
|
1519
1509
|
}),
|
|
1520
|
-
|
|
1510
|
+
o("circle", {
|
|
1521
1511
|
cx: "12",
|
|
1522
1512
|
cy: "19",
|
|
1523
1513
|
r: "1.6"
|
|
@@ -1530,9 +1520,9 @@ function Ht(e, t, n, i, r, s) {
|
|
|
1530
1520
|
class: "wm-header__icon",
|
|
1531
1521
|
"aria-label": "Fermer le widget",
|
|
1532
1522
|
title: "Fermer le widget",
|
|
1533
|
-
onClick: t[2] || (t[2] = (
|
|
1523
|
+
onClick: t[2] || (t[2] = (g) => e.$emit("close"))
|
|
1534
1524
|
}, [...t[5] || (t[5] = [
|
|
1535
|
-
|
|
1525
|
+
o("svg", {
|
|
1536
1526
|
width: "13",
|
|
1537
1527
|
height: "13",
|
|
1538
1528
|
viewBox: "0 0 24 24",
|
|
@@ -1543,21 +1533,21 @@ function Ht(e, t, n, i, r, s) {
|
|
|
1543
1533
|
"stroke-linejoin": "round",
|
|
1544
1534
|
"aria-hidden": "true"
|
|
1545
1535
|
}, [
|
|
1546
|
-
|
|
1536
|
+
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
1547
1537
|
], -1)
|
|
1548
1538
|
])])) : w("", !0)
|
|
1549
1539
|
])
|
|
1550
1540
|
]);
|
|
1551
1541
|
}
|
|
1552
|
-
const
|
|
1542
|
+
const Gt = /* @__PURE__ */ $(Dt, [["render", Kt], ["__scopeId", "data-v-ef4b443e"]]), ve = {
|
|
1553
1543
|
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",
|
|
1554
1544
|
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",
|
|
1555
1545
|
status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
1556
1546
|
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",
|
|
1557
1547
|
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"
|
|
1558
|
-
},
|
|
1548
|
+
}, Yt = {
|
|
1559
1549
|
name: "WmOnboarding",
|
|
1560
|
-
components: { AIAvatar:
|
|
1550
|
+
components: { AIAvatar: ne },
|
|
1561
1551
|
props: {
|
|
1562
1552
|
welcomeMessage: { type: String, default: "" },
|
|
1563
1553
|
agentName: { type: String, default: "" },
|
|
@@ -1592,7 +1582,7 @@ Je réponds en quelques secondes.`;
|
|
|
1592
1582
|
},
|
|
1593
1583
|
methods: {
|
|
1594
1584
|
iconPath(e) {
|
|
1595
|
-
return
|
|
1585
|
+
return ve[e] || ve.link;
|
|
1596
1586
|
},
|
|
1597
1587
|
formatTs(e) {
|
|
1598
1588
|
if (!e) return "";
|
|
@@ -1600,8 +1590,8 @@ Je réponds en quelques secondes.`;
|
|
|
1600
1590
|
if (Number.isNaN(t.getTime())) return "";
|
|
1601
1591
|
const n = /* @__PURE__ */ new Date();
|
|
1602
1592
|
if (t.toDateString() === n.toDateString()) {
|
|
1603
|
-
const s = String(t.getHours()).padStart(2, "0"),
|
|
1604
|
-
return `${s}h${
|
|
1593
|
+
const s = String(t.getHours()).padStart(2, "0"), a = String(t.getMinutes()).padStart(2, "0");
|
|
1594
|
+
return `${s}h${a}`;
|
|
1605
1595
|
}
|
|
1606
1596
|
if (n.getTime() - t.getTime() < 7 * 864e5) {
|
|
1607
1597
|
const s = t.toLocaleDateString("fr-FR", { weekday: "short" });
|
|
@@ -1610,10 +1600,10 @@ Je réponds en quelques secondes.`;
|
|
|
1610
1600
|
return t.toLocaleDateString("fr-FR", { day: "2-digit", month: "2-digit" });
|
|
1611
1601
|
}
|
|
1612
1602
|
}
|
|
1613
|
-
},
|
|
1603
|
+
}, Xt = { class: "wm-onb" }, Jt = { class: "wm-onb__hero" }, Qt = { class: "wm-onb__title" }, Zt = { class: "wm-onb__sub" }, en = { class: "wm-onb__cta" }, tn = ["disabled"], nn = {
|
|
1614
1604
|
key: 0,
|
|
1615
1605
|
class: "wm-onb__section"
|
|
1616
|
-
},
|
|
1606
|
+
}, sn = ["onClick"], rn = { class: "wm-onb__card-icon" }, an = {
|
|
1617
1607
|
width: "16",
|
|
1618
1608
|
height: "16",
|
|
1619
1609
|
viewBox: "0 0 24 24",
|
|
@@ -1623,43 +1613,43 @@ Je réponds en quelques secondes.`;
|
|
|
1623
1613
|
"stroke-linecap": "round",
|
|
1624
1614
|
"stroke-linejoin": "round",
|
|
1625
1615
|
"aria-hidden": "true"
|
|
1626
|
-
},
|
|
1616
|
+
}, on = ["d"], ln = { class: "wm-onb__card-body" }, dn = { class: "wm-onb__card-title" }, cn = {
|
|
1627
1617
|
key: 0,
|
|
1628
1618
|
class: "wm-onb__card-sub"
|
|
1629
|
-
},
|
|
1619
|
+
}, un = {
|
|
1630
1620
|
key: 1,
|
|
1631
1621
|
class: "wm-onb__section"
|
|
1632
|
-
},
|
|
1622
|
+
}, hn = { class: "wm-onb__search" }, mn = { class: "wm-onb__list" }, fn = ["onClick"], _n = {
|
|
1633
1623
|
key: 0,
|
|
1634
1624
|
class: "wm-onb__thread-dot",
|
|
1635
1625
|
"aria-label": "Non lu"
|
|
1636
|
-
},
|
|
1626
|
+
}, pn = { class: "wm-onb__thread-body" }, gn = { class: "wm-onb__thread-title" }, vn = { class: "wm-onb__thread-preview" }, yn = { class: "wm-onb__thread-meta" }, wn = {
|
|
1637
1627
|
key: 0,
|
|
1638
1628
|
class: "wm-onb__thread-time"
|
|
1639
|
-
},
|
|
1629
|
+
}, bn = {
|
|
1640
1630
|
key: 0,
|
|
1641
1631
|
class: "wm-onb__empty"
|
|
1642
1632
|
};
|
|
1643
|
-
function
|
|
1644
|
-
const
|
|
1645
|
-
return d(), c("div",
|
|
1646
|
-
|
|
1647
|
-
|
|
1633
|
+
function kn(e, t, n, i, r, s) {
|
|
1634
|
+
const a = E("AIAvatar");
|
|
1635
|
+
return d(), c("div", Xt, [
|
|
1636
|
+
o("div", Jt, [
|
|
1637
|
+
V(a, {
|
|
1648
1638
|
size: 56,
|
|
1649
1639
|
pulse: !0
|
|
1650
1640
|
}),
|
|
1651
|
-
|
|
1652
|
-
|
|
1641
|
+
o("div", Qt, b(s.heroTitle), 1),
|
|
1642
|
+
o("div", Zt, b(s.heroSub), 1)
|
|
1653
1643
|
]),
|
|
1654
|
-
|
|
1655
|
-
|
|
1644
|
+
o("div", en, [
|
|
1645
|
+
o("button", {
|
|
1656
1646
|
type: "button",
|
|
1657
1647
|
class: "wm-onb__startBtn",
|
|
1658
1648
|
disabled: n.busy,
|
|
1659
1649
|
onClick: t[0] || (t[0] = (l) => e.$emit("start"))
|
|
1660
1650
|
}, [
|
|
1661
|
-
t[2] || (t[2] =
|
|
1662
|
-
|
|
1651
|
+
t[2] || (t[2] = o("span", { class: "wm-onb__startIcon" }, [
|
|
1652
|
+
o("svg", {
|
|
1663
1653
|
width: "12",
|
|
1664
1654
|
height: "12",
|
|
1665
1655
|
viewBox: "0 0 24 24",
|
|
@@ -1670,42 +1660,42 @@ function yn(e, t, n, i, r, s) {
|
|
|
1670
1660
|
"stroke-linejoin": "round",
|
|
1671
1661
|
"aria-hidden": "true"
|
|
1672
1662
|
}, [
|
|
1673
|
-
|
|
1663
|
+
o("path", { d: "M12 5v14M5 12h14" })
|
|
1674
1664
|
])
|
|
1675
1665
|
], -1)),
|
|
1676
|
-
|
|
1677
|
-
], 8,
|
|
1666
|
+
o("span", null, b(n.busy ? "…" : "Commencer une conversation"), 1)
|
|
1667
|
+
], 8, tn)
|
|
1678
1668
|
]),
|
|
1679
|
-
n.quickLinks.length ? (d(), c("div",
|
|
1680
|
-
t[3] || (t[3] =
|
|
1681
|
-
|
|
1682
|
-
class:
|
|
1669
|
+
n.quickLinks.length ? (d(), c("div", nn, [
|
|
1670
|
+
t[3] || (t[3] = o("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
|
|
1671
|
+
o("div", {
|
|
1672
|
+
class: x(s.quickLinksLayout)
|
|
1683
1673
|
}, [
|
|
1684
|
-
(d(!0), c(
|
|
1674
|
+
(d(!0), c(B, null, F(n.quickLinks, (l, g) => (d(), c("button", {
|
|
1685
1675
|
key: g,
|
|
1686
1676
|
type: "button",
|
|
1687
|
-
class:
|
|
1677
|
+
class: x(["wm-onb__card", { "wm-onb__card--row": s.isOddQuickLinks }]),
|
|
1688
1678
|
onClick: (k) => e.$emit("select", l)
|
|
1689
1679
|
}, [
|
|
1690
|
-
|
|
1691
|
-
(d(), c("svg",
|
|
1692
|
-
|
|
1680
|
+
o("span", rn, [
|
|
1681
|
+
(d(), c("svg", an, [
|
|
1682
|
+
o("path", {
|
|
1693
1683
|
d: s.iconPath(l.icon)
|
|
1694
|
-
}, null, 8,
|
|
1684
|
+
}, null, 8, on)
|
|
1695
1685
|
]))
|
|
1696
1686
|
]),
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
l.description ? (d(), c("span",
|
|
1687
|
+
o("span", ln, [
|
|
1688
|
+
o("span", dn, b(l.label), 1),
|
|
1689
|
+
l.description ? (d(), c("span", cn, b(l.description), 1)) : w("", !0)
|
|
1700
1690
|
])
|
|
1701
|
-
], 10,
|
|
1691
|
+
], 10, sn))), 128))
|
|
1702
1692
|
], 2)
|
|
1703
1693
|
])) : w("", !0),
|
|
1704
|
-
n.openThreads.length ? (d(), c("div",
|
|
1705
|
-
t[7] || (t[7] =
|
|
1706
|
-
|
|
1707
|
-
t[4] || (t[4] =
|
|
1708
|
-
|
|
1694
|
+
n.openThreads.length ? (d(), c("div", un, [
|
|
1695
|
+
t[7] || (t[7] = o("div", { class: "wm-onb__section-title" }, "Conversations récentes", -1)),
|
|
1696
|
+
o("div", hn, [
|
|
1697
|
+
t[4] || (t[4] = o("span", { class: "wm-onb__searchIcon" }, [
|
|
1698
|
+
o("svg", {
|
|
1709
1699
|
width: "12",
|
|
1710
1700
|
height: "12",
|
|
1711
1701
|
viewBox: "0 0 24 24",
|
|
@@ -1716,50 +1706,50 @@ function yn(e, t, n, i, r, s) {
|
|
|
1716
1706
|
"stroke-linejoin": "round",
|
|
1717
1707
|
"aria-hidden": "true"
|
|
1718
1708
|
}, [
|
|
1719
|
-
|
|
1709
|
+
o("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
|
|
1720
1710
|
])
|
|
1721
1711
|
], -1)),
|
|
1722
|
-
|
|
1712
|
+
q(o("input", {
|
|
1723
1713
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => r.query = l),
|
|
1724
1714
|
type: "text",
|
|
1725
1715
|
placeholder: "Rechercher dans vos messages",
|
|
1726
1716
|
"aria-label": "Rechercher dans vos messages"
|
|
1727
1717
|
}, null, 512), [
|
|
1728
|
-
[
|
|
1718
|
+
[J, r.query]
|
|
1729
1719
|
])
|
|
1730
1720
|
]),
|
|
1731
|
-
|
|
1732
|
-
(d(!0), c(
|
|
1721
|
+
o("div", mn, [
|
|
1722
|
+
(d(!0), c(B, null, F(s.filteredThreads, (l) => (d(), c("button", {
|
|
1733
1723
|
key: l.id,
|
|
1734
1724
|
type: "button",
|
|
1735
1725
|
class: "wm-onb__thread",
|
|
1736
1726
|
onClick: (g) => e.$emit("resume", l)
|
|
1737
1727
|
}, [
|
|
1738
|
-
|
|
1739
|
-
class:
|
|
1728
|
+
o("span", {
|
|
1729
|
+
class: x(["wm-onb__thread-icon", { "wm-onb__thread-icon--inverted": !l.unread }])
|
|
1740
1730
|
}, [
|
|
1741
|
-
t[5] || (t[5] =
|
|
1731
|
+
t[5] || (t[5] = o("svg", {
|
|
1742
1732
|
width: "18",
|
|
1743
1733
|
height: "18",
|
|
1744
1734
|
viewBox: "0 0 24 24",
|
|
1745
1735
|
fill: "none",
|
|
1746
1736
|
"aria-hidden": "true"
|
|
1747
1737
|
}, [
|
|
1748
|
-
|
|
1738
|
+
o("path", {
|
|
1749
1739
|
d: "M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",
|
|
1750
1740
|
fill: "currentColor",
|
|
1751
1741
|
opacity: "0.92"
|
|
1752
1742
|
})
|
|
1753
1743
|
], -1)),
|
|
1754
|
-
l.unread ? (d(), c("span",
|
|
1744
|
+
l.unread ? (d(), c("span", _n)) : w("", !0)
|
|
1755
1745
|
], 2),
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1746
|
+
o("span", pn, [
|
|
1747
|
+
o("span", gn, b(l.title), 1),
|
|
1748
|
+
o("span", vn, b(l.preview), 1)
|
|
1759
1749
|
]),
|
|
1760
|
-
|
|
1761
|
-
s.formatTs(l._ts) ? (d(), c("span",
|
|
1762
|
-
t[6] || (t[6] =
|
|
1750
|
+
o("span", yn, [
|
|
1751
|
+
s.formatTs(l._ts) ? (d(), c("span", wn, b(s.formatTs(l._ts)), 1)) : w("", !0),
|
|
1752
|
+
t[6] || (t[6] = o("svg", {
|
|
1763
1753
|
width: "14",
|
|
1764
1754
|
height: "14",
|
|
1765
1755
|
viewBox: "0 0 24 24",
|
|
@@ -1771,20 +1761,20 @@ function yn(e, t, n, i, r, s) {
|
|
|
1771
1761
|
class: "wm-onb__thread-chev",
|
|
1772
1762
|
"aria-hidden": "true"
|
|
1773
1763
|
}, [
|
|
1774
|
-
|
|
1764
|
+
o("path", { d: "M5 12h14M13 5l7 7-7 7" })
|
|
1775
1765
|
], -1))
|
|
1776
1766
|
])
|
|
1777
|
-
], 8,
|
|
1778
|
-
s.filteredThreads.length ? w("", !0) : (d(), c("div",
|
|
1767
|
+
], 8, fn))), 128)),
|
|
1768
|
+
s.filteredThreads.length ? w("", !0) : (d(), c("div", bn, " Aucun résultat pour « " + b(r.query) + " ». ", 1))
|
|
1779
1769
|
])
|
|
1780
1770
|
])) : w("", !0)
|
|
1781
1771
|
]);
|
|
1782
1772
|
}
|
|
1783
|
-
const
|
|
1784
|
-
function
|
|
1773
|
+
const Cn = /* @__PURE__ */ $(Yt, [["render", kn], ["__scopeId", "data-v-c85f6958"]]);
|
|
1774
|
+
function An(e) {
|
|
1785
1775
|
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();
|
|
1786
1776
|
}
|
|
1787
|
-
const
|
|
1777
|
+
const Sn = {
|
|
1788
1778
|
name: "WmActionResult",
|
|
1789
1779
|
props: {
|
|
1790
1780
|
state: { type: String, default: "success" },
|
|
@@ -1794,13 +1784,13 @@ const kn = {
|
|
|
1794
1784
|
},
|
|
1795
1785
|
computed: {
|
|
1796
1786
|
detailText() {
|
|
1797
|
-
return
|
|
1787
|
+
return An(this.detail);
|
|
1798
1788
|
}
|
|
1799
1789
|
}
|
|
1800
|
-
},
|
|
1790
|
+
}, xn = {
|
|
1801
1791
|
class: "wm-result__icon",
|
|
1802
1792
|
"aria-hidden": "true"
|
|
1803
|
-
},
|
|
1793
|
+
}, Mn = {
|
|
1804
1794
|
key: 0,
|
|
1805
1795
|
width: "11",
|
|
1806
1796
|
height: "11",
|
|
@@ -1810,7 +1800,7 @@ const kn = {
|
|
|
1810
1800
|
"stroke-width": "2.8",
|
|
1811
1801
|
"stroke-linecap": "round",
|
|
1812
1802
|
"stroke-linejoin": "round"
|
|
1813
|
-
},
|
|
1803
|
+
}, Tn = {
|
|
1814
1804
|
key: 1,
|
|
1815
1805
|
width: "11",
|
|
1816
1806
|
height: "11",
|
|
@@ -1820,7 +1810,7 @@ const kn = {
|
|
|
1820
1810
|
"stroke-width": "2.6",
|
|
1821
1811
|
"stroke-linecap": "round",
|
|
1822
1812
|
"stroke-linejoin": "round"
|
|
1823
|
-
},
|
|
1813
|
+
}, In = {
|
|
1824
1814
|
key: 2,
|
|
1825
1815
|
width: "11",
|
|
1826
1816
|
height: "11",
|
|
@@ -1830,7 +1820,7 @@ const kn = {
|
|
|
1830
1820
|
"stroke-width": "2.4",
|
|
1831
1821
|
"stroke-linecap": "round",
|
|
1832
1822
|
"stroke-linejoin": "round"
|
|
1833
|
-
},
|
|
1823
|
+
}, On = {
|
|
1834
1824
|
key: 3,
|
|
1835
1825
|
width: "12",
|
|
1836
1826
|
height: "12",
|
|
@@ -1840,32 +1830,32 @@ const kn = {
|
|
|
1840
1830
|
"stroke-width": "2.2",
|
|
1841
1831
|
"stroke-linecap": "round",
|
|
1842
1832
|
"stroke-linejoin": "round"
|
|
1843
|
-
},
|
|
1844
|
-
function
|
|
1833
|
+
}, Bn = { class: "wm-result__body" }, En = { class: "wm-result__label" }, $n = { class: "wm-result__detail" };
|
|
1834
|
+
function Ln(e, t, n, i, r, s) {
|
|
1845
1835
|
return d(), c("div", {
|
|
1846
|
-
class:
|
|
1836
|
+
class: x(["wm-result", `wm-result--${n.state}`])
|
|
1847
1837
|
}, [
|
|
1848
|
-
|
|
1849
|
-
n.state === "success" ? (d(), c("svg",
|
|
1850
|
-
|
|
1851
|
-
])])) : n.state === "rejected" ? (d(), c("svg",
|
|
1852
|
-
|
|
1853
|
-
])])) : n.state === "awaiting" ? (d(), c("svg",
|
|
1854
|
-
|
|
1838
|
+
o("span", xn, [
|
|
1839
|
+
n.state === "success" ? (d(), c("svg", Mn, [...t[0] || (t[0] = [
|
|
1840
|
+
o("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
1841
|
+
])])) : n.state === "rejected" ? (d(), c("svg", Tn, [...t[1] || (t[1] = [
|
|
1842
|
+
o("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
1843
|
+
])])) : n.state === "awaiting" ? (d(), c("svg", In, [...t[2] || (t[2] = [
|
|
1844
|
+
o("circle", {
|
|
1855
1845
|
cx: "12",
|
|
1856
1846
|
cy: "12",
|
|
1857
1847
|
r: "10"
|
|
1858
1848
|
}, null, -1),
|
|
1859
|
-
|
|
1860
|
-
])])) : (d(), c("svg",
|
|
1861
|
-
|
|
1862
|
-
|
|
1849
|
+
o("polyline", { points: "12 7 12 12 15 14" }, null, -1)
|
|
1850
|
+
])])) : (d(), c("svg", On, [...t[3] || (t[3] = [
|
|
1851
|
+
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),
|
|
1852
|
+
o("line", {
|
|
1863
1853
|
x1: "12",
|
|
1864
1854
|
y1: "9",
|
|
1865
1855
|
x2: "12",
|
|
1866
1856
|
y2: "13"
|
|
1867
1857
|
}, null, -1),
|
|
1868
|
-
|
|
1858
|
+
o("line", {
|
|
1869
1859
|
x1: "12",
|
|
1870
1860
|
y1: "17",
|
|
1871
1861
|
x2: "12.01",
|
|
@@ -1873,19 +1863,19 @@ function In(e, t, n, i, r, s) {
|
|
|
1873
1863
|
}, null, -1)
|
|
1874
1864
|
])]))
|
|
1875
1865
|
]),
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
s.detailText ? (d(), c(
|
|
1879
|
-
t[4] || (t[4] =
|
|
1866
|
+
o("span", Bn, [
|
|
1867
|
+
o("span", En, b(n.label), 1),
|
|
1868
|
+
s.detailText ? (d(), c(B, { key: 0 }, [
|
|
1869
|
+
t[4] || (t[4] = o("span", {
|
|
1880
1870
|
class: "wm-result__sep",
|
|
1881
1871
|
"aria-hidden": "true"
|
|
1882
1872
|
}, " · ", -1)),
|
|
1883
|
-
|
|
1873
|
+
o("span", $n, b(s.detailText), 1)
|
|
1884
1874
|
], 64)) : w("", !0)
|
|
1885
1875
|
])
|
|
1886
1876
|
], 2);
|
|
1887
1877
|
}
|
|
1888
|
-
const
|
|
1878
|
+
const Rn = /* @__PURE__ */ $(Sn, [["render", Ln], ["__scopeId", "data-v-64a83fb8"]]), Nn = {
|
|
1889
1879
|
name: "WmArtifactFormResponse",
|
|
1890
1880
|
props: {
|
|
1891
1881
|
data: { type: Object, required: !0 }
|
|
@@ -1896,13 +1886,13 @@ const En = /* @__PURE__ */ L(kn, [["render", In], ["__scopeId", "data-v-64a83fb8
|
|
|
1896
1886
|
return Array.isArray((e = this.data) == null ? void 0 : e.fields) ? this.data.fields : [];
|
|
1897
1887
|
}
|
|
1898
1888
|
}
|
|
1899
|
-
},
|
|
1900
|
-
function
|
|
1901
|
-
return d(), c("div",
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
t[0] || (t[0] =
|
|
1905
|
-
|
|
1889
|
+
}, Fn = { class: "wm-art wm-art--formResponse" }, Pn = { class: "wm-art__head" }, Dn = { class: "wm-art__title" }, jn = { class: "wm-art__body" }, Un = { class: "wm-art__fieldLabel" };
|
|
1890
|
+
function Vn(e, t, n, i, r, s) {
|
|
1891
|
+
return d(), c("div", Fn, [
|
|
1892
|
+
o("div", Pn, [
|
|
1893
|
+
o("div", Dn, b(n.data.title || "Formulaire"), 1),
|
|
1894
|
+
t[0] || (t[0] = o("span", { class: "wm-art__badge wm-art__badge--success" }, [
|
|
1895
|
+
o("svg", {
|
|
1906
1896
|
width: "11",
|
|
1907
1897
|
height: "11",
|
|
1908
1898
|
viewBox: "0 0 24 24",
|
|
@@ -1913,25 +1903,25 @@ function jn(e, t, n, i, r, s) {
|
|
|
1913
1903
|
"stroke-linejoin": "round",
|
|
1914
1904
|
"aria-hidden": "true"
|
|
1915
1905
|
}, [
|
|
1916
|
-
|
|
1906
|
+
o("polyline", { points: "20 6 9 17 4 12" })
|
|
1917
1907
|
]),
|
|
1918
|
-
|
|
1908
|
+
he(" Envoyé ")
|
|
1919
1909
|
], -1))
|
|
1920
1910
|
]),
|
|
1921
|
-
|
|
1922
|
-
(d(!0), c(
|
|
1911
|
+
o("div", jn, [
|
|
1912
|
+
(d(!0), c(B, null, F(s.fields, (a, l) => (d(), c("div", {
|
|
1923
1913
|
key: l,
|
|
1924
1914
|
class: "wm-art__field"
|
|
1925
1915
|
}, [
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
class:
|
|
1929
|
-
}, b(
|
|
1916
|
+
o("div", Un, b(a.label), 1),
|
|
1917
|
+
o("div", {
|
|
1918
|
+
class: x(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
|
|
1919
|
+
}, b(a.value), 3)
|
|
1930
1920
|
]))), 128))
|
|
1931
1921
|
])
|
|
1932
1922
|
]);
|
|
1933
1923
|
}
|
|
1934
|
-
const
|
|
1924
|
+
const zn = /* @__PURE__ */ $(Nn, [["render", Vn], ["__scopeId", "data-v-ca24a9c9"]]), Hn = {
|
|
1935
1925
|
name: "WmArtifactInfoCard",
|
|
1936
1926
|
props: {
|
|
1937
1927
|
data: { type: Object, required: !0 }
|
|
@@ -1946,61 +1936,61 @@ const Pn = /* @__PURE__ */ L(Ln, [["render", jn], ["__scopeId", "data-v-ca24a9c9
|
|
|
1946
1936
|
return !!((e = this.data) != null && e.body) || this.fields.length > 0;
|
|
1947
1937
|
}
|
|
1948
1938
|
}
|
|
1949
|
-
},
|
|
1939
|
+
}, qn = { class: "wm-art wm-art--infoCard" }, Wn = {
|
|
1950
1940
|
key: 0,
|
|
1951
1941
|
class: "wm-art__image"
|
|
1952
|
-
},
|
|
1942
|
+
}, Kn = ["src", "alt"], Gn = { class: "wm-art__head" }, Yn = { class: "wm-art__headMain" }, Xn = { class: "wm-art__title" }, Jn = {
|
|
1953
1943
|
key: 0,
|
|
1954
1944
|
class: "wm-art__subtitle"
|
|
1955
|
-
},
|
|
1945
|
+
}, Qn = {
|
|
1956
1946
|
key: 1,
|
|
1957
1947
|
class: "wm-art__body"
|
|
1958
|
-
},
|
|
1948
|
+
}, Zn = {
|
|
1959
1949
|
key: 0,
|
|
1960
1950
|
class: "wm-art__text"
|
|
1961
|
-
},
|
|
1962
|
-
function
|
|
1963
|
-
return d(), c("div",
|
|
1964
|
-
n.data.image_url ? (d(), c("figure",
|
|
1965
|
-
|
|
1951
|
+
}, es = { class: "wm-art__fieldLabel" };
|
|
1952
|
+
function ts(e, t, n, i, r, s) {
|
|
1953
|
+
return d(), c("div", qn, [
|
|
1954
|
+
n.data.image_url ? (d(), c("figure", Wn, [
|
|
1955
|
+
o("img", {
|
|
1966
1956
|
src: n.data.image_url,
|
|
1967
1957
|
alt: n.data.title || "",
|
|
1968
1958
|
loading: "lazy"
|
|
1969
|
-
}, null, 8,
|
|
1959
|
+
}, null, 8, Kn)
|
|
1970
1960
|
])) : w("", !0),
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
n.data.subtitle ? (d(), c("div",
|
|
1961
|
+
o("div", Gn, [
|
|
1962
|
+
o("div", Yn, [
|
|
1963
|
+
o("div", Xn, b(n.data.title), 1),
|
|
1964
|
+
n.data.subtitle ? (d(), c("div", Jn, b(n.data.subtitle), 1)) : w("", !0)
|
|
1975
1965
|
]),
|
|
1976
1966
|
n.data.badge && n.data.badge.label ? (d(), c("span", {
|
|
1977
1967
|
key: 0,
|
|
1978
|
-
class:
|
|
1968
|
+
class: x(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
|
|
1979
1969
|
}, b(n.data.badge.label), 3)) : w("", !0)
|
|
1980
1970
|
]),
|
|
1981
|
-
s.hasBody ? (d(), c("div",
|
|
1982
|
-
n.data.body ? (d(), c("div",
|
|
1983
|
-
s.fields.length ? (d(!0), c(
|
|
1971
|
+
s.hasBody ? (d(), c("div", Qn, [
|
|
1972
|
+
n.data.body ? (d(), c("div", Zn, b(n.data.body), 1)) : w("", !0),
|
|
1973
|
+
s.fields.length ? (d(!0), c(B, { key: 1 }, F(s.fields, (a, l) => (d(), c("div", {
|
|
1984
1974
|
key: l,
|
|
1985
1975
|
class: "wm-art__field"
|
|
1986
1976
|
}, [
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
class:
|
|
1990
|
-
}, b(
|
|
1977
|
+
o("div", es, b(a.label), 1),
|
|
1978
|
+
o("div", {
|
|
1979
|
+
class: x(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
|
|
1980
|
+
}, b(a.value), 3)
|
|
1991
1981
|
]))), 128)) : w("", !0)
|
|
1992
1982
|
])) : w("", !0)
|
|
1993
1983
|
]);
|
|
1994
1984
|
}
|
|
1995
|
-
const
|
|
1996
|
-
function
|
|
1985
|
+
const ns = /* @__PURE__ */ $(Hn, [["render", ts], ["__scopeId", "data-v-d7369333"]]);
|
|
1986
|
+
function ss(e) {
|
|
1997
1987
|
if (!e) return "";
|
|
1998
1988
|
const t = new Date(e);
|
|
1999
1989
|
if (Number.isNaN(t.getTime())) return e;
|
|
2000
1990
|
const n = t.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), i = t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
|
|
2001
1991
|
return `${n} à ${i}`;
|
|
2002
1992
|
}
|
|
2003
|
-
const
|
|
1993
|
+
const rs = {
|
|
2004
1994
|
name: "WmArtifactTicket",
|
|
2005
1995
|
props: {
|
|
2006
1996
|
data: { type: Object, required: !0 }
|
|
@@ -2012,7 +2002,7 @@ const ts = {
|
|
|
2012
2002
|
},
|
|
2013
2003
|
formattedDate() {
|
|
2014
2004
|
var e;
|
|
2015
|
-
return
|
|
2005
|
+
return ss((e = this.data) == null ? void 0 : e.created_at);
|
|
2016
2006
|
}
|
|
2017
2007
|
},
|
|
2018
2008
|
methods: {
|
|
@@ -2034,13 +2024,13 @@ const ts = {
|
|
|
2034
2024
|
return /high|haute|élev|elev|critic|critiq|urgent/.test(t) ? 3 : /low|basse|faible|minor/.test(t) ? 1 : 2;
|
|
2035
2025
|
}
|
|
2036
2026
|
}
|
|
2037
|
-
},
|
|
2027
|
+
}, is = { class: "wm-art wm-art--ticket" }, as = { class: "wm-art__head wm-tk__head" }, os = { class: "wm-art__title wm-tk__title" }, ls = { class: "wm-tk__sub" }, ds = { class: "wm-tk__ref" }, cs = {
|
|
2038
2028
|
key: 0,
|
|
2039
2029
|
class: "wm-tk__text"
|
|
2040
|
-
},
|
|
2030
|
+
}, us = {
|
|
2041
2031
|
key: 0,
|
|
2042
2032
|
class: "wm-art__body"
|
|
2043
|
-
},
|
|
2033
|
+
}, hs = { class: "wm-art__fieldLabel" }, ms = ["data-level"], fs = {
|
|
2044
2034
|
key: 1,
|
|
2045
2035
|
class: "wm-tk__date",
|
|
2046
2036
|
width: "12",
|
|
@@ -2052,17 +2042,17 @@ const ts = {
|
|
|
2052
2042
|
"stroke-linecap": "round",
|
|
2053
2043
|
"stroke-linejoin": "round",
|
|
2054
2044
|
"aria-hidden": "true"
|
|
2055
|
-
},
|
|
2045
|
+
}, _s = {
|
|
2056
2046
|
key: 1,
|
|
2057
2047
|
class: "wm-art__footer wm-tk__footer"
|
|
2058
2048
|
};
|
|
2059
|
-
function
|
|
2060
|
-
return d(), c("div",
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
t[0] || (t[0] =
|
|
2049
|
+
function ps(e, t, n, i, r, s) {
|
|
2050
|
+
return d(), c("div", is, [
|
|
2051
|
+
o("div", as, [
|
|
2052
|
+
o("div", os, b(n.data.title), 1),
|
|
2053
|
+
o("div", ls, [
|
|
2054
|
+
o("div", ds, [
|
|
2055
|
+
t[0] || (t[0] = o("svg", {
|
|
2066
2056
|
width: "11",
|
|
2067
2057
|
height: "11",
|
|
2068
2058
|
viewBox: "0 0 24 24",
|
|
@@ -2073,78 +2063,78 @@ function ms(e, t, n, i, r, s) {
|
|
|
2073
2063
|
"stroke-linejoin": "round",
|
|
2074
2064
|
"aria-hidden": "true"
|
|
2075
2065
|
}, [
|
|
2076
|
-
|
|
2077
|
-
|
|
2066
|
+
o("path", { d: "M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z" }),
|
|
2067
|
+
o("path", { d: "M13 5v2M13 17v2M13 11v2" })
|
|
2078
2068
|
], -1)),
|
|
2079
|
-
|
|
2069
|
+
o("span", null, b(n.data.reference), 1)
|
|
2080
2070
|
]),
|
|
2081
|
-
|
|
2082
|
-
class:
|
|
2071
|
+
o("span", {
|
|
2072
|
+
class: x(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
|
|
2083
2073
|
}, [
|
|
2084
|
-
t[1] || (t[1] =
|
|
2074
|
+
t[1] || (t[1] = o("span", {
|
|
2085
2075
|
class: "wm-tk__dot",
|
|
2086
2076
|
"aria-hidden": "true"
|
|
2087
2077
|
}, null, -1)),
|
|
2088
|
-
|
|
2078
|
+
he(" " + b(n.data.status.label), 1)
|
|
2089
2079
|
], 2)
|
|
2090
2080
|
]),
|
|
2091
|
-
n.data.body ? (d(), c("div",
|
|
2081
|
+
n.data.body ? (d(), c("div", cs, b(n.data.body), 1)) : w("", !0)
|
|
2092
2082
|
]),
|
|
2093
|
-
s.fields.length ? (d(), c("div",
|
|
2094
|
-
(d(!0), c(
|
|
2083
|
+
s.fields.length ? (d(), c("div", us, [
|
|
2084
|
+
(d(!0), c(B, null, F(s.fields, (a, l) => (d(), c("div", {
|
|
2095
2085
|
key: l,
|
|
2096
2086
|
class: "wm-art__field"
|
|
2097
2087
|
}, [
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
class:
|
|
2088
|
+
o("div", hs, b(a.label), 1),
|
|
2089
|
+
o("div", {
|
|
2090
|
+
class: x(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
|
|
2101
2091
|
}, [
|
|
2102
|
-
s.isPriority(
|
|
2092
|
+
s.isPriority(a.label) ? (d(), c("svg", {
|
|
2103
2093
|
key: 0,
|
|
2104
2094
|
class: "wm-tk__prio",
|
|
2105
|
-
"data-level": s.priorityLevel(
|
|
2095
|
+
"data-level": s.priorityLevel(a.value),
|
|
2106
2096
|
width: "12",
|
|
2107
2097
|
height: "12",
|
|
2108
2098
|
viewBox: "0 0 12 12",
|
|
2109
2099
|
"aria-hidden": "true"
|
|
2110
2100
|
}, [...t[2] || (t[2] = [
|
|
2111
|
-
|
|
2101
|
+
o("rect", {
|
|
2112
2102
|
x: "1",
|
|
2113
2103
|
y: "8",
|
|
2114
2104
|
width: "2",
|
|
2115
2105
|
height: "3",
|
|
2116
2106
|
rx: "0.5"
|
|
2117
2107
|
}, null, -1),
|
|
2118
|
-
|
|
2108
|
+
o("rect", {
|
|
2119
2109
|
x: "5",
|
|
2120
2110
|
y: "5",
|
|
2121
2111
|
width: "2",
|
|
2122
2112
|
height: "6",
|
|
2123
2113
|
rx: "0.5"
|
|
2124
2114
|
}, null, -1),
|
|
2125
|
-
|
|
2115
|
+
o("rect", {
|
|
2126
2116
|
x: "9",
|
|
2127
2117
|
y: "2",
|
|
2128
2118
|
width: "2",
|
|
2129
2119
|
height: "9",
|
|
2130
2120
|
rx: "0.5"
|
|
2131
2121
|
}, null, -1)
|
|
2132
|
-
])], 8,
|
|
2133
|
-
|
|
2122
|
+
])], 8, ms)) : s.isDate(a.label) ? (d(), c("svg", fs, [...t[3] || (t[3] = [
|
|
2123
|
+
o("rect", {
|
|
2134
2124
|
x: "3",
|
|
2135
2125
|
y: "4",
|
|
2136
2126
|
width: "18",
|
|
2137
2127
|
height: "18",
|
|
2138
2128
|
rx: "2"
|
|
2139
2129
|
}, null, -1),
|
|
2140
|
-
|
|
2130
|
+
o("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
|
|
2141
2131
|
])])) : w("", !0),
|
|
2142
|
-
|
|
2132
|
+
o("span", null, b(a.value), 1)
|
|
2143
2133
|
], 2)
|
|
2144
2134
|
]))), 128))
|
|
2145
2135
|
])) : w("", !0),
|
|
2146
|
-
n.data.created_at ? (d(), c("div",
|
|
2147
|
-
t[4] || (t[4] =
|
|
2136
|
+
n.data.created_at ? (d(), c("div", _s, [
|
|
2137
|
+
t[4] || (t[4] = o("svg", {
|
|
2148
2138
|
width: "11",
|
|
2149
2139
|
height: "11",
|
|
2150
2140
|
viewBox: "0 0 24 24",
|
|
@@ -2155,24 +2145,24 @@ function ms(e, t, n, i, r, s) {
|
|
|
2155
2145
|
"stroke-linejoin": "round",
|
|
2156
2146
|
"aria-hidden": "true"
|
|
2157
2147
|
}, [
|
|
2158
|
-
|
|
2148
|
+
o("rect", {
|
|
2159
2149
|
x: "3",
|
|
2160
2150
|
y: "4",
|
|
2161
2151
|
width: "18",
|
|
2162
2152
|
height: "18",
|
|
2163
2153
|
rx: "2"
|
|
2164
2154
|
}),
|
|
2165
|
-
|
|
2155
|
+
o("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
2166
2156
|
], -1)),
|
|
2167
|
-
|
|
2157
|
+
o("span", null, b(s.formattedDate), 1)
|
|
2168
2158
|
])) : w("", !0)
|
|
2169
2159
|
]);
|
|
2170
2160
|
}
|
|
2171
|
-
const
|
|
2172
|
-
form_response:
|
|
2173
|
-
info_card:
|
|
2174
|
-
ticket:
|
|
2175
|
-
},
|
|
2161
|
+
const gs = /* @__PURE__ */ $(rs, [["render", ps], ["__scopeId", "data-v-8b274eb7"]]), vs = {
|
|
2162
|
+
form_response: zn,
|
|
2163
|
+
info_card: ns,
|
|
2164
|
+
ticket: gs
|
|
2165
|
+
}, ys = {
|
|
2176
2166
|
name: "WmArtifactRenderer",
|
|
2177
2167
|
props: {
|
|
2178
2168
|
// Forme : { kind: string, data: any } (le `data` est validé
|
|
@@ -2183,17 +2173,17 @@ const fs = /* @__PURE__ */ L(ts, [["render", ms], ["__scopeId", "data-v-8b274eb7
|
|
|
2183
2173
|
component() {
|
|
2184
2174
|
var t;
|
|
2185
2175
|
const e = (t = this.artifact) == null ? void 0 : t.kind;
|
|
2186
|
-
return e &&
|
|
2176
|
+
return e && vs[e] || null;
|
|
2187
2177
|
}
|
|
2188
2178
|
}
|
|
2189
2179
|
};
|
|
2190
|
-
function
|
|
2191
|
-
return s.component ? (d(),
|
|
2180
|
+
function ws(e, t, n, i, r, s) {
|
|
2181
|
+
return s.component ? (d(), L(Ee(s.component), {
|
|
2192
2182
|
key: 0,
|
|
2193
2183
|
data: n.artifact.data
|
|
2194
2184
|
}, null, 8, ["data"])) : w("", !0);
|
|
2195
2185
|
}
|
|
2196
|
-
const
|
|
2186
|
+
const bs = /* @__PURE__ */ $(ys, [["render", ws]]), ks = {
|
|
2197
2187
|
name: "WmAttachmentPreview",
|
|
2198
2188
|
inject: {
|
|
2199
2189
|
signAttachmentFn: { default: null }
|
|
@@ -2247,17 +2237,17 @@ const vs = /* @__PURE__ */ L(ps, [["render", gs]]), ys = {
|
|
|
2247
2237
|
this.url || e.preventDefault();
|
|
2248
2238
|
}
|
|
2249
2239
|
}
|
|
2250
|
-
},
|
|
2240
|
+
}, Cs = ["href"], As = ["src", "alt"], Ss = ["src"], xs = ["src"], Ms = ["href", "download"], Ts = { class: "wm-att__main" }, Is = { class: "wm-att__name" }, Os = {
|
|
2251
2241
|
key: 0,
|
|
2252
2242
|
class: "wm-att__meta"
|
|
2253
|
-
},
|
|
2243
|
+
}, Bs = {
|
|
2254
2244
|
key: 0,
|
|
2255
2245
|
class: "wm-att__spin",
|
|
2256
2246
|
"aria-hidden": "true"
|
|
2257
2247
|
};
|
|
2258
|
-
function
|
|
2248
|
+
function Es(e, t, n, i, r, s) {
|
|
2259
2249
|
return d(), c("div", {
|
|
2260
|
-
class:
|
|
2250
|
+
class: x(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
2261
2251
|
}, [
|
|
2262
2252
|
s.kind === "image" && r.url ? (d(), c("a", {
|
|
2263
2253
|
key: 0,
|
|
@@ -2266,32 +2256,32 @@ function Os(e, t, n, i, r, s) {
|
|
|
2266
2256
|
rel: "noopener",
|
|
2267
2257
|
class: "wm-att__imgWrap"
|
|
2268
2258
|
}, [
|
|
2269
|
-
|
|
2259
|
+
o("img", {
|
|
2270
2260
|
src: r.url,
|
|
2271
2261
|
alt: s.displayName,
|
|
2272
2262
|
loading: "lazy"
|
|
2273
|
-
}, null, 8,
|
|
2274
|
-
], 8,
|
|
2263
|
+
}, null, 8, As)
|
|
2264
|
+
], 8, Cs)) : s.kind === "audio" && r.url ? (d(), c("audio", {
|
|
2275
2265
|
key: 1,
|
|
2276
2266
|
src: r.url,
|
|
2277
2267
|
controls: "",
|
|
2278
2268
|
preload: "metadata"
|
|
2279
|
-
}, null, 8,
|
|
2269
|
+
}, null, 8, Ss)) : s.kind === "video" && r.url ? (d(), c("video", {
|
|
2280
2270
|
key: 2,
|
|
2281
2271
|
src: r.url,
|
|
2282
2272
|
controls: "",
|
|
2283
2273
|
preload: "metadata"
|
|
2284
|
-
}, null, 8,
|
|
2274
|
+
}, null, 8, xs)) : (d(), c("a", {
|
|
2285
2275
|
key: 3,
|
|
2286
2276
|
class: "wm-att__file",
|
|
2287
2277
|
href: r.url || "#",
|
|
2288
2278
|
download: s.displayName,
|
|
2289
2279
|
target: "_blank",
|
|
2290
2280
|
rel: "noopener",
|
|
2291
|
-
onClick: t[0] || (t[0] = (...
|
|
2281
|
+
onClick: t[0] || (t[0] = (...a) => s.onFileClick && s.onFileClick(...a))
|
|
2292
2282
|
}, [
|
|
2293
|
-
t[1] || (t[1] =
|
|
2294
|
-
|
|
2283
|
+
t[1] || (t[1] = o("span", { class: "wm-att__icon" }, [
|
|
2284
|
+
o("svg", {
|
|
2295
2285
|
width: "14",
|
|
2296
2286
|
height: "14",
|
|
2297
2287
|
viewBox: "0 0 24 24",
|
|
@@ -2302,37 +2292,37 @@ function Os(e, t, n, i, r, s) {
|
|
|
2302
2292
|
"stroke-linejoin": "round",
|
|
2303
2293
|
"aria-hidden": "true"
|
|
2304
2294
|
}, [
|
|
2305
|
-
|
|
2306
|
-
|
|
2295
|
+
o("path", { d: "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" }),
|
|
2296
|
+
o("path", { d: "M14 2v6h6" })
|
|
2307
2297
|
])
|
|
2308
2298
|
], -1)),
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
s.sizeLabel ? (d(), c("span",
|
|
2299
|
+
o("span", Ts, [
|
|
2300
|
+
o("span", Is, b(s.displayName), 1),
|
|
2301
|
+
s.sizeLabel ? (d(), c("span", Os, b(s.sizeLabel), 1)) : w("", !0)
|
|
2312
2302
|
]),
|
|
2313
|
-
r.loading ? (d(), c("span",
|
|
2314
|
-
], 8,
|
|
2303
|
+
r.loading ? (d(), c("span", Bs)) : w("", !0)
|
|
2304
|
+
], 8, Ms))
|
|
2315
2305
|
], 2);
|
|
2316
2306
|
}
|
|
2317
|
-
const
|
|
2318
|
-
function
|
|
2307
|
+
const $s = /* @__PURE__ */ $(ks, [["render", Es], ["__scopeId", "data-v-1cd1267b"]]);
|
|
2308
|
+
function Ls(e) {
|
|
2319
2309
|
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2320
2310
|
}
|
|
2321
|
-
function
|
|
2311
|
+
function Rs(e) {
|
|
2322
2312
|
return /^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim());
|
|
2323
2313
|
}
|
|
2324
|
-
const
|
|
2325
|
-
function
|
|
2314
|
+
const ye = "";
|
|
2315
|
+
function ie(e) {
|
|
2326
2316
|
let t = e;
|
|
2327
2317
|
const n = [];
|
|
2328
2318
|
return t = t.replace(/`([^`\n]+)`/g, (i, r) => {
|
|
2329
2319
|
const s = n.length;
|
|
2330
|
-
return n.push(r), `${
|
|
2331
|
-
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, r, s) =>
|
|
2320
|
+
return n.push(r), `${ye}CODE${s}${ye}`;
|
|
2321
|
+
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, r, s) => Rs(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;
|
|
2332
2322
|
}
|
|
2333
|
-
function
|
|
2323
|
+
function Ns(e) {
|
|
2334
2324
|
if (!e) return "";
|
|
2335
|
-
const t =
|
|
2325
|
+
const t = Ls(e).split(`
|
|
2336
2326
|
`), n = [];
|
|
2337
2327
|
let i = 0;
|
|
2338
2328
|
for (; i < t.length; ) {
|
|
@@ -2352,11 +2342,11 @@ function Ls(e) {
|
|
|
2352
2342
|
if (/^\s*[-*]\s+/.test(s)) {
|
|
2353
2343
|
const k = [];
|
|
2354
2344
|
for (; i < t.length; ) {
|
|
2355
|
-
const
|
|
2356
|
-
if (!
|
|
2357
|
-
k.push(
|
|
2345
|
+
const T = /^\s*[-*]\s+(.*)$/.exec(t[i]);
|
|
2346
|
+
if (!T) break;
|
|
2347
|
+
k.push(T[1]), i++;
|
|
2358
2348
|
}
|
|
2359
|
-
const C = k.map((
|
|
2349
|
+
const C = k.map((T) => `<li>${ie(T)}</li>`).join("");
|
|
2360
2350
|
n.push({ type: "block", html: `<ul class="wm-md-ul">${C}</ul>` });
|
|
2361
2351
|
continue;
|
|
2362
2352
|
}
|
|
@@ -2368,8 +2358,8 @@ function Ls(e) {
|
|
|
2368
2358
|
if (!A) break;
|
|
2369
2359
|
C.push(A[1]), i++;
|
|
2370
2360
|
}
|
|
2371
|
-
const
|
|
2372
|
-
n.push({ type: "block", html: `<ol class="wm-md-ol"${R}>${
|
|
2361
|
+
const T = C.map((A) => `<li>${ie(A)}</li>`).join(""), R = k !== 1 ? ` start="${k}"` : "";
|
|
2362
|
+
n.push({ type: "block", html: `<ol class="wm-md-ol"${R}>${T}</ol>` });
|
|
2373
2363
|
continue;
|
|
2374
2364
|
}
|
|
2375
2365
|
const g = /^(#{1,6})\s+(.*)$/.exec(s);
|
|
@@ -2377,23 +2367,23 @@ function Ls(e) {
|
|
|
2377
2367
|
const k = g[1].length;
|
|
2378
2368
|
n.push({
|
|
2379
2369
|
type: "block",
|
|
2380
|
-
html: `<h${k} class="wm-md-h wm-md-h${k}">${
|
|
2370
|
+
html: `<h${k} class="wm-md-h wm-md-h${k}">${ie(g[2])}</h${k}>`
|
|
2381
2371
|
}), i++;
|
|
2382
2372
|
continue;
|
|
2383
2373
|
}
|
|
2384
|
-
n.push({ type: "text", html:
|
|
2374
|
+
n.push({ type: "text", html: ie(s) }), i++;
|
|
2385
2375
|
}
|
|
2386
2376
|
let r = "";
|
|
2387
2377
|
for (let s = 0; s < n.length; s++) {
|
|
2388
|
-
const
|
|
2389
|
-
r +=
|
|
2378
|
+
const a = n[s];
|
|
2379
|
+
r += a.html;
|
|
2390
2380
|
const l = n[s + 1];
|
|
2391
|
-
l &&
|
|
2381
|
+
l && a.type !== "block" && l.type !== "block" && (r += `
|
|
2392
2382
|
`);
|
|
2393
2383
|
}
|
|
2394
2384
|
return r;
|
|
2395
2385
|
}
|
|
2396
|
-
const
|
|
2386
|
+
const Fs = {
|
|
2397
2387
|
name: "WmBubble",
|
|
2398
2388
|
props: {
|
|
2399
2389
|
role: { type: String, default: "ai" },
|
|
@@ -2402,41 +2392,41 @@ const $s = {
|
|
|
2402
2392
|
},
|
|
2403
2393
|
computed: {
|
|
2404
2394
|
rendered() {
|
|
2405
|
-
return
|
|
2395
|
+
return Ns(this.text);
|
|
2406
2396
|
}
|
|
2407
2397
|
}
|
|
2408
|
-
},
|
|
2409
|
-
function
|
|
2398
|
+
}, Ps = ["innerHTML"];
|
|
2399
|
+
function Ds(e, t, n, i, r, s) {
|
|
2410
2400
|
return d(), c("div", {
|
|
2411
|
-
class:
|
|
2401
|
+
class: x(["wm-bubble", "wm-bubble--" + n.role])
|
|
2412
2402
|
}, [
|
|
2413
|
-
|
|
2414
|
-
|
|
2403
|
+
$e(e.$slots, "default", {}, () => [
|
|
2404
|
+
o("span", { innerHTML: s.rendered }, null, 8, Ps)
|
|
2415
2405
|
], !0)
|
|
2416
2406
|
], 2);
|
|
2417
2407
|
}
|
|
2418
|
-
const
|
|
2419
|
-
function
|
|
2420
|
-
return d(), c("div",
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2408
|
+
const js = /* @__PURE__ */ $(Fs, [["render", Ds], ["__scopeId", "data-v-5c9e9f2b"]]), Us = { name: "WmTyping" }, Vs = { class: "wm-typing" };
|
|
2409
|
+
function zs(e, t, n, i, r, s) {
|
|
2410
|
+
return d(), c("div", Vs, [...t[0] || (t[0] = [
|
|
2411
|
+
o("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
2412
|
+
o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
2413
|
+
o("span", { style: { "animation-delay": "0.4s" } }, null, -1)
|
|
2424
2414
|
])]);
|
|
2425
2415
|
}
|
|
2426
|
-
const
|
|
2427
|
-
function
|
|
2416
|
+
const Hs = /* @__PURE__ */ $(Us, [["render", zs], ["__scopeId", "data-v-df2447fd"]]);
|
|
2417
|
+
function te(e) {
|
|
2428
2418
|
return e ? e.client_msg_id || e.id : "";
|
|
2429
2419
|
}
|
|
2430
|
-
const
|
|
2420
|
+
const qs = {
|
|
2431
2421
|
transferred_to_human: "Conversation transférée à un humain",
|
|
2432
2422
|
assigned: "{name} a rejoint la conversation",
|
|
2433
2423
|
unassigned: "L'agent a quitté la conversation",
|
|
2434
2424
|
resolved: "Conversation résolue",
|
|
2435
2425
|
reopened: "Conversation rouverte",
|
|
2436
2426
|
idle: "Conversation en pause"
|
|
2437
|
-
},
|
|
2427
|
+
}, Ws = 80, Ks = 200, Gs = {
|
|
2438
2428
|
name: "WmMessageList",
|
|
2439
|
-
components: { AIAvatar:
|
|
2429
|
+
components: { AIAvatar: ne, HumanAvatar: xe, Bubble: js, Typing: Hs, ActionResult: Rn, AttachmentPreview: $s, ArtifactRenderer: bs },
|
|
2440
2430
|
props: {
|
|
2441
2431
|
messages: { type: Array, default: () => [] },
|
|
2442
2432
|
streamingActive: { type: Boolean, default: !1 },
|
|
@@ -2448,11 +2438,13 @@ const zs = {
|
|
|
2448
2438
|
loadingMore: { type: Boolean, default: !1 },
|
|
2449
2439
|
// True when the server still has older messages to return.
|
|
2450
2440
|
hasMore: { type: Boolean, default: !1 },
|
|
2451
|
-
//
|
|
2452
|
-
//
|
|
2453
|
-
//
|
|
2454
|
-
//
|
|
2455
|
-
|
|
2441
|
+
// Numeric message id snapshot frozen the moment the user started
|
|
2442
|
+
// viewing the current thread (mirror of the conversation's
|
|
2443
|
+
// `last_read_message_id` at that instant). Drives the "Non lus"
|
|
2444
|
+
// separator: rendered before the first non-user group whose first
|
|
2445
|
+
// message has a strictly greater id. `null` disables the separator
|
|
2446
|
+
// (fresh thread or no prior read pointer).
|
|
2447
|
+
unreadAnchorId: { type: Number, default: null },
|
|
2456
2448
|
// Borne haute (instant ISO d'ouverture du thread). Les messages dont
|
|
2457
2449
|
// `created_at` la dépasse sont arrivés EN DIRECT pendant que
|
|
2458
2450
|
// l'utilisateur regardait — ils n'entrent pas dans le batch "Non lus".
|
|
@@ -2483,69 +2475,72 @@ const zs = {
|
|
|
2483
2475
|
groups() {
|
|
2484
2476
|
var n, i, r, s;
|
|
2485
2477
|
const e = [];
|
|
2486
|
-
for (const
|
|
2487
|
-
const l = this.roleOf(
|
|
2478
|
+
for (const a of this.messages) {
|
|
2479
|
+
const l = this.roleOf(a);
|
|
2488
2480
|
if (l === "system") {
|
|
2489
|
-
if (((n =
|
|
2481
|
+
if (((n = a == null ? void 0 : a.payload) == null ? void 0 : n.event) === "action_admin_pending") {
|
|
2490
2482
|
const C = e[e.length - 1];
|
|
2491
|
-
C && C.role === "ai" ? C.messages.push(
|
|
2492
|
-
key: `g-${
|
|
2483
|
+
C && C.role === "ai" ? C.messages.push(a) : e.push({
|
|
2484
|
+
key: `g-${te(a)}`,
|
|
2493
2485
|
role: "ai",
|
|
2494
2486
|
agentName: "",
|
|
2495
2487
|
agentAvatarUrl: null,
|
|
2496
|
-
messages: [
|
|
2488
|
+
messages: [a],
|
|
2497
2489
|
items: []
|
|
2498
2490
|
});
|
|
2499
2491
|
continue;
|
|
2500
2492
|
}
|
|
2501
2493
|
e.push({
|
|
2502
|
-
key: `sys-${
|
|
2494
|
+
key: `sys-${te(a)}`,
|
|
2503
2495
|
role: l,
|
|
2504
|
-
messages: [
|
|
2496
|
+
messages: [a],
|
|
2505
2497
|
items: [],
|
|
2506
|
-
systemLabel: this.systemLabel(
|
|
2498
|
+
systemLabel: this.systemLabel(a)
|
|
2507
2499
|
});
|
|
2508
2500
|
continue;
|
|
2509
2501
|
}
|
|
2510
2502
|
const g = e[e.length - 1];
|
|
2511
|
-
g && g.role === l && (l === "ai" || g.agentName === (((i =
|
|
2512
|
-
key: `g-${
|
|
2503
|
+
g && g.role === l && (l === "ai" || g.agentName === (((i = a == null ? void 0 : a.author) == null ? void 0 : i.name) || "")) ? g.messages.push(a) : e.push({
|
|
2504
|
+
key: `g-${te(a)}`,
|
|
2513
2505
|
role: l,
|
|
2514
|
-
agentName: ((r =
|
|
2515
|
-
agentAvatarUrl: ((s =
|
|
2516
|
-
messages: [
|
|
2506
|
+
agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
|
|
2507
|
+
agentAvatarUrl: ((s = a == null ? void 0 : a.author) == null ? void 0 : s.avatar_url) || null,
|
|
2508
|
+
messages: [a],
|
|
2517
2509
|
items: []
|
|
2518
2510
|
});
|
|
2519
2511
|
}
|
|
2520
|
-
for (const
|
|
2521
|
-
if (
|
|
2512
|
+
for (const a of e) {
|
|
2513
|
+
if (a.role === "system") continue;
|
|
2522
2514
|
const l = [];
|
|
2523
|
-
for (const g of
|
|
2515
|
+
for (const g of a.messages)
|
|
2524
2516
|
for (const k of this.itemsOf(g)) l.push(k);
|
|
2525
|
-
|
|
2517
|
+
a.items = l;
|
|
2526
2518
|
}
|
|
2527
2519
|
const t = [];
|
|
2528
|
-
for (const
|
|
2529
|
-
if (
|
|
2520
|
+
for (const a of e) {
|
|
2521
|
+
if (a.role !== "system" && !a.items.length) continue;
|
|
2530
2522
|
const l = t[t.length - 1];
|
|
2531
|
-
if (l && l.role !== "system" && l.role ===
|
|
2532
|
-
l.messages.push(...
|
|
2523
|
+
if (l && l.role !== "system" && l.role === a.role && (a.role === "ai" || l.agentName === a.agentName)) {
|
|
2524
|
+
l.messages.push(...a.messages), l.items.push(...a.items);
|
|
2533
2525
|
continue;
|
|
2534
2526
|
}
|
|
2535
|
-
t.push(
|
|
2527
|
+
t.push(a);
|
|
2536
2528
|
}
|
|
2537
2529
|
return t;
|
|
2538
2530
|
},
|
|
2539
|
-
// Key of the first non-user group that starts after the unread
|
|
2540
|
-
//
|
|
2541
|
-
//
|
|
2531
|
+
// Key of the first non-user group that starts after the unread
|
|
2532
|
+
// anchor (numeric message id snapshot of last_read_message_id at
|
|
2533
|
+
// thread-open time). Comparison is purely numeric on `message.id`.
|
|
2542
2534
|
unreadGroupKey() {
|
|
2543
|
-
if (
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2535
|
+
if (this.unreadAnchorId == null) return null;
|
|
2536
|
+
const e = this.unreadAnchorId, t = this.unreadBoundaryTs;
|
|
2537
|
+
for (const n of this.groups) {
|
|
2538
|
+
if (n.role === "user" || n.role === "system" || !n.items.length) continue;
|
|
2539
|
+
const i = n.messages[0];
|
|
2540
|
+
if (!i) continue;
|
|
2541
|
+
const r = X(i.id);
|
|
2542
|
+
if (r != null && !(r <= e) && !(t && i.created_at && i.created_at > t))
|
|
2543
|
+
return n.key;
|
|
2549
2544
|
}
|
|
2550
2545
|
return null;
|
|
2551
2546
|
}
|
|
@@ -2570,13 +2565,13 @@ const zs = {
|
|
|
2570
2565
|
this.scheduleMeasure();
|
|
2571
2566
|
},
|
|
2572
2567
|
methods: {
|
|
2573
|
-
messageKey:
|
|
2568
|
+
messageKey: te,
|
|
2574
2569
|
isAtBottom(e) {
|
|
2575
|
-
return e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
2570
|
+
return e.scrollHeight - e.scrollTop - e.clientHeight <= Ws;
|
|
2576
2571
|
},
|
|
2577
2572
|
onScroll() {
|
|
2578
2573
|
const e = this.$refs.scrollEl;
|
|
2579
|
-
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <=
|
|
2574
|
+
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <= Ks && (this._pendingLoadMore = !0, this.$emit("load-more")));
|
|
2580
2575
|
},
|
|
2581
2576
|
// Capture pre-patch scroll state and restore it on the next tick.
|
|
2582
2577
|
//
|
|
@@ -2609,10 +2604,10 @@ const zs = {
|
|
|
2609
2604
|
if (!t && !n) {
|
|
2610
2605
|
const s = this.pickAnchor(e);
|
|
2611
2606
|
if (s != null && s.el) {
|
|
2612
|
-
const
|
|
2607
|
+
const a = e.getBoundingClientRect().top;
|
|
2613
2608
|
i = {
|
|
2614
2609
|
el: s.el,
|
|
2615
|
-
relY: s.el.getBoundingClientRect().top -
|
|
2610
|
+
relY: s.el.getBoundingClientRect().top - a
|
|
2616
2611
|
};
|
|
2617
2612
|
}
|
|
2618
2613
|
}
|
|
@@ -2625,9 +2620,9 @@ const zs = {
|
|
|
2625
2620
|
if (!r.anchor) return;
|
|
2626
2621
|
const s = () => {
|
|
2627
2622
|
var k;
|
|
2628
|
-
const
|
|
2629
|
-
if (!((k =
|
|
2630
|
-
const g =
|
|
2623
|
+
const a = r.anchor;
|
|
2624
|
+
if (!((k = a.el) != null && k.isConnected)) return;
|
|
2625
|
+
const g = a.el.getBoundingClientRect().top - e.getBoundingClientRect().top - a.relY;
|
|
2631
2626
|
Math.abs(g) > 0.5 && (e.scrollTop += g);
|
|
2632
2627
|
};
|
|
2633
2628
|
s(), requestAnimationFrame(() => {
|
|
@@ -2751,10 +2746,10 @@ const zs = {
|
|
|
2751
2746
|
// adjacent à une `bubble`) : mon coin déborde le voisin et
|
|
2752
2747
|
// doit garder son arrondi.
|
|
2753
2748
|
cornersFor(e, t) {
|
|
2754
|
-
var Q,
|
|
2755
|
-
const n = e.items, i = (Q = n[t]) == null ? void 0 : Q.kind, r = (
|
|
2756
|
-
let
|
|
2757
|
-
return
|
|
2749
|
+
var Q, Z, z;
|
|
2750
|
+
const n = e.items, i = (Q = n[t]) == null ? void 0 : Q.kind, r = (Z = n[t - 1]) == null ? void 0 : Z.kind, s = (z = n[t + 1]) == null ? void 0 : z.kind, a = e.role === "user", l = 14, g = 4, k = r == null ? void 0 : r.bottom, C = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], R = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], U = 0.5, S = (ee, G, H) => ee != null && T != null ? ee + U >= T : G === H || G === "card" && H === "bubble";
|
|
2751
|
+
let D = l, N = l, j = l, K = l;
|
|
2752
|
+
return a ? (k && (N = g), (C || !s) && (j = g), k && S(R, k, i == null ? void 0 : i.top) && (D = g), C && S(A, C, i == null ? void 0 : i.bottom) && (K = g)) : (k && (D = g), (C || !s) && (K = g), k && S(R, k, i == null ? void 0 : i.top) && (N = g), C && S(A, C, i == null ? void 0 : i.bottom) && (j = g)), { tl: D, tr: N, br: j, bl: K };
|
|
2758
2753
|
},
|
|
2759
2754
|
// Inline style emitting the four corner CSS variables. Set on
|
|
2760
2755
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -2775,7 +2770,7 @@ const zs = {
|
|
|
2775
2770
|
rowKeyOf(e, t) {
|
|
2776
2771
|
var i;
|
|
2777
2772
|
const n = (i = e == null ? void 0 : e.items) == null ? void 0 : i[t];
|
|
2778
|
-
return n ? `${
|
|
2773
|
+
return n ? `${te(n.message)}-${n.partKey}` : "";
|
|
2779
2774
|
},
|
|
2780
2775
|
// rAF-debouncé : `updated()` peut être appelé en rafale (stream,
|
|
2781
2776
|
// typing, scroll), un seul flush layout par frame suffit.
|
|
@@ -2793,18 +2788,18 @@ const zs = {
|
|
|
2793
2788
|
if (!e) return;
|
|
2794
2789
|
const t = {};
|
|
2795
2790
|
for (const s of e.querySelectorAll(".wm-list__row[data-row-key]")) {
|
|
2796
|
-
const
|
|
2797
|
-
if (!
|
|
2791
|
+
const a = s.dataset.rowKey;
|
|
2792
|
+
if (!a) continue;
|
|
2798
2793
|
const l = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
|
|
2799
2794
|
if (!l) continue;
|
|
2800
2795
|
const g = l.getBoundingClientRect().width;
|
|
2801
|
-
g > 0 && (t[
|
|
2796
|
+
g > 0 && (t[a] = g);
|
|
2802
2797
|
}
|
|
2803
2798
|
const n = this.widthByKey, i = Object.keys(n), r = Object.keys(t);
|
|
2804
2799
|
if (i.length === r.length) {
|
|
2805
2800
|
let s = !0;
|
|
2806
|
-
for (const
|
|
2807
|
-
if (Math.abs((n[
|
|
2801
|
+
for (const a of r)
|
|
2802
|
+
if (Math.abs((n[a] ?? 0) - t[a]) > 0.5) {
|
|
2808
2803
|
s = !1;
|
|
2809
2804
|
break;
|
|
2810
2805
|
}
|
|
@@ -2816,7 +2811,7 @@ const zs = {
|
|
|
2816
2811
|
const t = e.items[e.items.length - 1], n = (t == null ? void 0 : t.message) || e.messages[e.messages.length - 1];
|
|
2817
2812
|
if (!(n != null && n.created_at)) return "";
|
|
2818
2813
|
try {
|
|
2819
|
-
return
|
|
2814
|
+
return Ae(new Date(n.created_at));
|
|
2820
2815
|
} catch {
|
|
2821
2816
|
return "";
|
|
2822
2817
|
}
|
|
@@ -2849,9 +2844,9 @@ const zs = {
|
|
|
2849
2844
|
return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || "Action";
|
|
2850
2845
|
},
|
|
2851
2846
|
actionDetail(e) {
|
|
2852
|
-
var n, i, r, s,
|
|
2847
|
+
var n, i, r, s, a, l;
|
|
2853
2848
|
const t = e == null ? void 0 : e.payload;
|
|
2854
|
-
return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((r = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : r.description) || "" : t.state === "rejected" ? ((s = t.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : t.state === "failure" && (((
|
|
2849
|
+
return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((r = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : r.description) || "" : t.state === "rejected" ? ((s = t.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : t.state === "failure" && (((a = t.failure) == null ? void 0 : a.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
|
|
2855
2850
|
},
|
|
2856
2851
|
actionArtifact(e) {
|
|
2857
2852
|
var n, i;
|
|
@@ -2859,8 +2854,8 @@ const zs = {
|
|
|
2859
2854
|
return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
|
|
2860
2855
|
},
|
|
2861
2856
|
systemLabel(e) {
|
|
2862
|
-
var r, s,
|
|
2863
|
-
const t = (r = e == null ? void 0 : e.payload) == null ? void 0 : r.event, n =
|
|
2857
|
+
var r, s, a;
|
|
2858
|
+
const t = (r = e == null ? void 0 : e.payload) == null ? void 0 : r.event, n = qs[t] || (e == null ? void 0 : e.text_md) || "Mise à jour de la conversation", 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) || "";
|
|
2864
2859
|
return n.replace("{name}", i || "Un agent");
|
|
2865
2860
|
},
|
|
2866
2861
|
scrollToBottom() {
|
|
@@ -2868,85 +2863,85 @@ const zs = {
|
|
|
2868
2863
|
e && (e.scrollTop = e.scrollHeight);
|
|
2869
2864
|
}
|
|
2870
2865
|
}
|
|
2871
|
-
},
|
|
2866
|
+
}, Ys = {
|
|
2872
2867
|
key: 0,
|
|
2873
2868
|
class: "wm-list__loadMore",
|
|
2874
2869
|
role: "status",
|
|
2875
2870
|
"aria-live": "polite"
|
|
2876
|
-
},
|
|
2871
|
+
}, Xs = {
|
|
2877
2872
|
key: 1,
|
|
2878
2873
|
class: "wm-list__historyEnd"
|
|
2879
|
-
},
|
|
2874
|
+
}, Js = {
|
|
2880
2875
|
key: 2,
|
|
2881
2876
|
class: "wm-list__sep"
|
|
2882
|
-
},
|
|
2877
|
+
}, Qs = { class: "wm-list__sep-label" }, Zs = {
|
|
2883
2878
|
key: 0,
|
|
2884
2879
|
class: "wm-list__sep wm-list__sep--unread"
|
|
2885
|
-
},
|
|
2880
|
+
}, er = {
|
|
2886
2881
|
key: 0,
|
|
2887
2882
|
class: "wm-list__sysep"
|
|
2888
|
-
},
|
|
2883
|
+
}, tr = { class: "wm-list__sysep-label" }, nr = ["data-row-key"], sr = {
|
|
2889
2884
|
key: 0,
|
|
2890
2885
|
class: "wm-list__avatarSlot"
|
|
2891
|
-
},
|
|
2886
|
+
}, rr = {
|
|
2892
2887
|
key: 5,
|
|
2893
2888
|
class: "wm-list__body"
|
|
2894
|
-
},
|
|
2889
|
+
}, ir = { key: 0 }, ar = {
|
|
2895
2890
|
key: 1,
|
|
2896
2891
|
"aria-hidden": "true"
|
|
2897
|
-
},
|
|
2892
|
+
}, or = { key: 2 }, lr = {
|
|
2898
2893
|
key: 3,
|
|
2899
2894
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
2900
|
-
},
|
|
2901
|
-
function
|
|
2902
|
-
const
|
|
2895
|
+
}, dr = { class: "wm-list__avatarSlot" };
|
|
2896
|
+
function cr(e, t, n, i, r, s) {
|
|
2897
|
+
const a = E("AIAvatar"), l = E("HumanAvatar"), g = E("ActionResult"), k = E("ArtifactRenderer"), C = E("Bubble"), T = E("AttachmentPreview"), R = E("Typing");
|
|
2903
2898
|
return d(), c("div", {
|
|
2904
2899
|
ref: "scrollEl",
|
|
2905
|
-
class:
|
|
2900
|
+
class: x(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
2906
2901
|
onScrollPassive: t[0] || (t[0] = (...A) => s.onScroll && s.onScroll(...A))
|
|
2907
2902
|
}, [
|
|
2908
|
-
n.loadingMore ? (d(), c("div",
|
|
2909
|
-
|
|
2903
|
+
n.loadingMore ? (d(), c("div", Ys, [...t[1] || (t[1] = [
|
|
2904
|
+
o("span", {
|
|
2910
2905
|
class: "wm-list__loadMore-spinner",
|
|
2911
2906
|
"aria-hidden": "true"
|
|
2912
2907
|
}, null, -1),
|
|
2913
|
-
|
|
2914
|
-
])])) : s.historyExhausted ? (d(), c("div",
|
|
2915
|
-
n.dateLabel ? (d(), c("div",
|
|
2916
|
-
t[2] || (t[2] =
|
|
2917
|
-
|
|
2918
|
-
t[3] || (t[3] =
|
|
2908
|
+
o("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
|
|
2909
|
+
])])) : s.historyExhausted ? (d(), c("div", Xs, "Début de la conversation")) : w("", !0),
|
|
2910
|
+
n.dateLabel ? (d(), c("div", Js, [
|
|
2911
|
+
t[2] || (t[2] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
2912
|
+
o("span", Qs, b(n.dateLabel), 1),
|
|
2913
|
+
t[3] || (t[3] = o("div", { class: "wm-list__line" }, null, -1))
|
|
2919
2914
|
])) : w("", !0),
|
|
2920
|
-
(d(!0), c(
|
|
2915
|
+
(d(!0), c(B, null, F(s.groups, (A, U) => (d(), c(B, {
|
|
2921
2916
|
key: A.key
|
|
2922
2917
|
}, [
|
|
2923
|
-
A.key === s.unreadGroupKey ? (d(), c("div",
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2918
|
+
A.key === s.unreadGroupKey ? (d(), c("div", Zs, [...t[4] || (t[4] = [
|
|
2919
|
+
o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
|
|
2920
|
+
o("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
|
|
2921
|
+
o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
|
|
2927
2922
|
])])) : w("", !0),
|
|
2928
2923
|
A.role === "system" || A.items.length ? (d(), c("div", {
|
|
2929
2924
|
key: 1,
|
|
2930
|
-
class:
|
|
2925
|
+
class: x(["wm-list__group", "wm-list__group--" + A.role])
|
|
2931
2926
|
}, [
|
|
2932
|
-
A.role === "system" ? (d(), c("div",
|
|
2933
|
-
t[5] || (t[5] =
|
|
2934
|
-
|
|
2935
|
-
t[6] || (t[6] =
|
|
2936
|
-
])) : (d(), c(
|
|
2937
|
-
(d(!0), c(
|
|
2927
|
+
A.role === "system" ? (d(), c("div", er, [
|
|
2928
|
+
t[5] || (t[5] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
2929
|
+
o("span", tr, b(A.systemLabel), 1),
|
|
2930
|
+
t[6] || (t[6] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
2931
|
+
])) : (d(), c(B, { key: 1 }, [
|
|
2932
|
+
(d(!0), c(B, null, F(A.items, (S, D) => (d(), c("div", {
|
|
2938
2933
|
key: `${s.messageKey(S.message)}-${S.partKey}`,
|
|
2939
2934
|
"data-row-key": `${s.messageKey(S.message)}-${S.partKey}`,
|
|
2940
|
-
class:
|
|
2941
|
-
style:
|
|
2935
|
+
class: x(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": S.message._pending, "is-failed": S.message._failed }]]),
|
|
2936
|
+
style: W(s.cornersStyle(A, D))
|
|
2942
2937
|
}, [
|
|
2943
|
-
A.role !== "user" ? (d(), c("div",
|
|
2944
|
-
|
|
2945
|
-
A.role === "ai" ? (d(),
|
|
2938
|
+
A.role !== "user" ? (d(), c("div", sr, [
|
|
2939
|
+
D === A.items.length - 1 ? (d(), c(B, { key: 0 }, [
|
|
2940
|
+
A.role === "ai" ? (d(), L(a, {
|
|
2946
2941
|
key: 0,
|
|
2947
2942
|
size: 26,
|
|
2948
2943
|
tail: !0
|
|
2949
|
-
})) : (d(),
|
|
2944
|
+
})) : (d(), L(l, {
|
|
2950
2945
|
key: 1,
|
|
2951
2946
|
name: A.agentName,
|
|
2952
2947
|
"avatar-url": A.agentAvatarUrl,
|
|
@@ -2955,63 +2950,63 @@ function or(e, t, n, i, r, s) {
|
|
|
2955
2950
|
}, null, 8, ["name", "avatar-url"]))
|
|
2956
2951
|
], 64)) : w("", !0)
|
|
2957
2952
|
])) : w("", !0),
|
|
2958
|
-
S.renderAs === "action" ? (d(),
|
|
2953
|
+
S.renderAs === "action" ? (d(), L(g, {
|
|
2959
2954
|
key: 1,
|
|
2960
2955
|
state: S.message.payload.state,
|
|
2961
2956
|
label: s.actionLabel(S.message),
|
|
2962
2957
|
detail: s.actionDetail(S.message)
|
|
2963
|
-
}, null, 8, ["state", "label", "detail"])) : S.renderAs === "admin-pending" ? (d(),
|
|
2958
|
+
}, null, 8, ["state", "label", "detail"])) : S.renderAs === "admin-pending" ? (d(), L(g, {
|
|
2964
2959
|
key: 2,
|
|
2965
2960
|
state: "awaiting",
|
|
2966
2961
|
label: "Demande d'approbation envoyée",
|
|
2967
2962
|
detail: S.message.text_md || ""
|
|
2968
|
-
}, null, 8, ["detail"])) : S.renderAs === "artifact-of-action" ? (d(),
|
|
2963
|
+
}, null, 8, ["detail"])) : S.renderAs === "artifact-of-action" ? (d(), L(k, {
|
|
2969
2964
|
key: 3,
|
|
2970
2965
|
artifact: s.actionArtifact(S.message)
|
|
2971
|
-
}, null, 8, ["artifact"])) : S.renderAs === "artifact" ? (d(),
|
|
2966
|
+
}, null, 8, ["artifact"])) : S.renderAs === "artifact" ? (d(), L(k, {
|
|
2972
2967
|
key: 4,
|
|
2973
2968
|
artifact: s.artifactOf(S.message)
|
|
2974
|
-
}, null, 8, ["artifact"])) : (d(), c("div",
|
|
2975
|
-
S.message.text_md ? (d(),
|
|
2969
|
+
}, null, 8, ["artifact"])) : (d(), c("div", rr, [
|
|
2970
|
+
S.message.text_md ? (d(), L(C, {
|
|
2976
2971
|
key: 0,
|
|
2977
2972
|
role: A.role,
|
|
2978
2973
|
text: S.message.text_md
|
|
2979
2974
|
}, null, 8, ["role", "text"])) : w("", !0),
|
|
2980
2975
|
s.attachmentsOf(S.message).length ? (d(), c("div", {
|
|
2981
2976
|
key: 1,
|
|
2982
|
-
class:
|
|
2977
|
+
class: x(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
|
|
2983
2978
|
}, [
|
|
2984
|
-
(d(!0), c(
|
|
2985
|
-
key: `${s.messageKey(S.message)}-att-${
|
|
2986
|
-
attachment:
|
|
2979
|
+
(d(!0), c(B, null, F(s.attachmentsOf(S.message), (N, j) => (d(), L(T, {
|
|
2980
|
+
key: `${s.messageKey(S.message)}-att-${j}`,
|
|
2981
|
+
attachment: N
|
|
2987
2982
|
}, null, 8, ["attachment"]))), 128))
|
|
2988
2983
|
], 2)) : w("", !0)
|
|
2989
2984
|
]))
|
|
2990
|
-
], 14,
|
|
2985
|
+
], 14, nr))), 128)),
|
|
2991
2986
|
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (d(), c("div", {
|
|
2992
2987
|
key: 0,
|
|
2993
|
-
class:
|
|
2988
|
+
class: x(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
2994
2989
|
}, [
|
|
2995
|
-
A.role !== "user" ? (d(), c("span",
|
|
2996
|
-
A.role !== "user" && s.lastTimeOf(A) ? (d(), c("span",
|
|
2997
|
-
s.lastTimeOf(A) ? (d(), c("span",
|
|
2990
|
+
A.role !== "user" ? (d(), c("span", ir, b(s.roleLabel(A)), 1)) : w("", !0),
|
|
2991
|
+
A.role !== "user" && s.lastTimeOf(A) ? (d(), c("span", ar, "·")) : w("", !0),
|
|
2992
|
+
s.lastTimeOf(A) ? (d(), c("span", or, b(s.lastTimeOf(A)), 1)) : w("", !0)
|
|
2998
2993
|
], 2)) : w("", !0)
|
|
2999
2994
|
], 64))
|
|
3000
2995
|
], 2)) : w("", !0)
|
|
3001
2996
|
], 64))), 128)),
|
|
3002
|
-
n.streamingActive ? (d(), c("div",
|
|
3003
|
-
|
|
3004
|
-
|
|
2997
|
+
n.streamingActive ? (d(), c("div", lr, [
|
|
2998
|
+
o("div", dr, [
|
|
2999
|
+
V(a, {
|
|
3005
3000
|
size: 26,
|
|
3006
3001
|
tail: !0
|
|
3007
3002
|
})
|
|
3008
3003
|
]),
|
|
3009
|
-
|
|
3004
|
+
V(R)
|
|
3010
3005
|
])) : w("", !0)
|
|
3011
3006
|
], 34);
|
|
3012
3007
|
}
|
|
3013
|
-
const
|
|
3014
|
-
function
|
|
3008
|
+
const ur = /* @__PURE__ */ $(Gs, [["render", cr], ["__scopeId", "data-v-946babe3"]]), de = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", me = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
3009
|
+
function hr() {
|
|
3015
3010
|
return me && [
|
|
3016
3011
|
"video/webm;codecs=vp9,opus",
|
|
3017
3012
|
"video/webm;codecs=vp8,opus",
|
|
@@ -3022,7 +3017,7 @@ function dr() {
|
|
|
3022
3017
|
return (i = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : i.call(n, t);
|
|
3023
3018
|
}) || "";
|
|
3024
3019
|
}
|
|
3025
|
-
function
|
|
3020
|
+
function Me({ audio: e }) {
|
|
3026
3021
|
return {
|
|
3027
3022
|
video: !0,
|
|
3028
3023
|
audio: !!e,
|
|
@@ -3031,19 +3026,19 @@ function Se({ audio: e }) {
|
|
|
3031
3026
|
systemAudio: e ? "include" : "exclude"
|
|
3032
3027
|
};
|
|
3033
3028
|
}
|
|
3034
|
-
function
|
|
3029
|
+
function la(e) {
|
|
3035
3030
|
return e ? e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "file" : "file";
|
|
3036
3031
|
}
|
|
3037
|
-
async function
|
|
3038
|
-
if (!
|
|
3032
|
+
async function mr() {
|
|
3033
|
+
if (!de) return null;
|
|
3039
3034
|
let e;
|
|
3040
3035
|
try {
|
|
3041
|
-
e = await navigator.mediaDevices.getDisplayMedia(
|
|
3036
|
+
e = await navigator.mediaDevices.getDisplayMedia(Me({ audio: !1 }));
|
|
3042
3037
|
} catch (t) {
|
|
3043
3038
|
return (t == null ? void 0 : t.name) !== "NotAllowedError" && console.error("[media] screenshot picker", t), null;
|
|
3044
3039
|
}
|
|
3045
3040
|
try {
|
|
3046
|
-
return await
|
|
3041
|
+
return await fr(e);
|
|
3047
3042
|
} catch (t) {
|
|
3048
3043
|
return console.error("[media] screenshot capture", t), null;
|
|
3049
3044
|
} finally {
|
|
@@ -3052,52 +3047,52 @@ async function cr() {
|
|
|
3052
3047
|
});
|
|
3053
3048
|
}
|
|
3054
3049
|
}
|
|
3055
|
-
async function
|
|
3050
|
+
async function fr(e) {
|
|
3056
3051
|
const t = document.createElement("video");
|
|
3057
3052
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
3058
3053
|
const n = t.videoWidth || 1280, i = t.videoHeight || 720, r = document.createElement("canvas");
|
|
3059
3054
|
r.width = n, r.height = i, r.getContext("2d").drawImage(t, 0, 0, n, i);
|
|
3060
3055
|
const s = await new Promise((l, g) => {
|
|
3061
3056
|
r.toBlob((k) => k ? l(k) : g(new Error("toBlob failed")), "image/png");
|
|
3062
|
-
}),
|
|
3063
|
-
return new File([s], `capture-${
|
|
3057
|
+
}), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
3058
|
+
return new File([s], `capture-${a}.png`, { type: "image/png" });
|
|
3064
3059
|
}
|
|
3065
|
-
async function
|
|
3060
|
+
async function _r(e = {}) {
|
|
3066
3061
|
var k;
|
|
3067
|
-
if (!
|
|
3062
|
+
if (!de || !me) return null;
|
|
3068
3063
|
let t;
|
|
3069
3064
|
try {
|
|
3070
|
-
t = await navigator.mediaDevices.getDisplayMedia(
|
|
3065
|
+
t = await navigator.mediaDevices.getDisplayMedia(Me({ audio: !0 }));
|
|
3071
3066
|
} catch (C) {
|
|
3072
3067
|
return (C == null ? void 0 : C.name) !== "NotAllowedError" && console.error("[media] record picker", C), null;
|
|
3073
3068
|
}
|
|
3074
|
-
const n =
|
|
3069
|
+
const n = hr();
|
|
3075
3070
|
let i;
|
|
3076
3071
|
try {
|
|
3077
3072
|
i = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
|
|
3078
3073
|
} catch (C) {
|
|
3079
|
-
return console.error("[media] recorder init", C), t.getTracks().forEach((
|
|
3080
|
-
|
|
3074
|
+
return console.error("[media] recorder init", C), t.getTracks().forEach((T) => {
|
|
3075
|
+
T.stop();
|
|
3081
3076
|
}), null;
|
|
3082
3077
|
}
|
|
3083
3078
|
const r = [];
|
|
3084
|
-
let s = null,
|
|
3079
|
+
let s = null, a = !1;
|
|
3085
3080
|
i.addEventListener("dataavailable", (C) => {
|
|
3086
3081
|
C.data && C.data.size > 0 && r.push(C.data);
|
|
3087
3082
|
}), i.addEventListener("stop", () => {
|
|
3088
|
-
var C,
|
|
3083
|
+
var C, T;
|
|
3089
3084
|
if (s && clearInterval(s), t.getTracks().forEach((R) => {
|
|
3090
3085
|
R.stop();
|
|
3091
3086
|
}), r.length) {
|
|
3092
|
-
const R = i.mimeType || n || "video/webm", A = new Blob(r, { type: R }),
|
|
3093
|
-
(C = e.onfinalize) == null || C.call(e,
|
|
3087
|
+
const R = i.mimeType || n || "video/webm", A = new Blob(r, { type: R }), U = /mp4/.test(R) ? "mp4" : "webm", S = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), D = new File([A], `ecran-${S}.${U}`, { type: R });
|
|
3088
|
+
(C = e.onfinalize) == null || C.call(e, D);
|
|
3094
3089
|
} else
|
|
3095
|
-
(
|
|
3090
|
+
(T = e.oncancel) == null || T.call(e);
|
|
3096
3091
|
}), t.getVideoTracks().forEach((C) => {
|
|
3097
3092
|
C.addEventListener("ended", () => l(), { once: !0 });
|
|
3098
3093
|
});
|
|
3099
3094
|
function l() {
|
|
3100
|
-
if (!
|
|
3095
|
+
if (!a && (a = !0, i.state !== "inactive"))
|
|
3101
3096
|
try {
|
|
3102
3097
|
i.stop();
|
|
3103
3098
|
} catch (C) {
|
|
@@ -3107,8 +3102,8 @@ async function hr(e = {}) {
|
|
|
3107
3102
|
try {
|
|
3108
3103
|
i.start(1e3);
|
|
3109
3104
|
} catch (C) {
|
|
3110
|
-
return console.error("[media] recorder start", C), t.getTracks().forEach((
|
|
3111
|
-
|
|
3105
|
+
return console.error("[media] recorder start", C), t.getTracks().forEach((T) => {
|
|
3106
|
+
T.stop();
|
|
3112
3107
|
}), null;
|
|
3113
3108
|
}
|
|
3114
3109
|
(k = e.onstart) == null || k.call(e);
|
|
@@ -3123,7 +3118,7 @@ async function hr(e = {}) {
|
|
|
3123
3118
|
}
|
|
3124
3119
|
};
|
|
3125
3120
|
}
|
|
3126
|
-
const
|
|
3121
|
+
const pr = [
|
|
3127
3122
|
{
|
|
3128
3123
|
action: "file",
|
|
3129
3124
|
label: "Joindre un fichier",
|
|
@@ -3139,7 +3134,7 @@ const mr = [
|
|
|
3139
3134
|
label: "Enregistrer l'écran",
|
|
3140
3135
|
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"
|
|
3141
3136
|
}
|
|
3142
|
-
],
|
|
3137
|
+
], gr = {
|
|
3143
3138
|
name: "WmComposer",
|
|
3144
3139
|
props: {
|
|
3145
3140
|
modelValue: { type: String, default: "" },
|
|
@@ -3162,9 +3157,9 @@ const mr = [
|
|
|
3162
3157
|
return !this.disabled && !!this.local.trim();
|
|
3163
3158
|
},
|
|
3164
3159
|
attachItems() {
|
|
3165
|
-
return
|
|
3160
|
+
return pr.map((e) => ({
|
|
3166
3161
|
...e,
|
|
3167
|
-
disabled: e.action === "screenshot" && !
|
|
3162
|
+
disabled: e.action === "screenshot" && !de || e.action === "record" && (!de || !me)
|
|
3168
3163
|
}));
|
|
3169
3164
|
},
|
|
3170
3165
|
recordingElapsedLabel() {
|
|
@@ -3234,13 +3229,13 @@ const mr = [
|
|
|
3234
3229
|
},
|
|
3235
3230
|
async captureScreenshot() {
|
|
3236
3231
|
if (this.disabled) return;
|
|
3237
|
-
const e = await
|
|
3232
|
+
const e = await mr();
|
|
3238
3233
|
e && this.$emit("attach", e);
|
|
3239
3234
|
},
|
|
3240
3235
|
async startRecording() {
|
|
3241
3236
|
if (this.recording || this.disabled) return;
|
|
3242
3237
|
this.recordingElapsed = 0;
|
|
3243
|
-
const e = await
|
|
3238
|
+
const e = await _r({
|
|
3244
3239
|
onstart: () => {
|
|
3245
3240
|
this.recording = !0;
|
|
3246
3241
|
},
|
|
@@ -3265,94 +3260,94 @@ const mr = [
|
|
|
3265
3260
|
}
|
|
3266
3261
|
}
|
|
3267
3262
|
}
|
|
3268
|
-
},
|
|
3263
|
+
}, vr = { class: "wm-compose-wrap" }, yr = {
|
|
3269
3264
|
key: 0,
|
|
3270
3265
|
class: "wm-rec"
|
|
3271
|
-
},
|
|
3266
|
+
}, wr = { class: "wm-rec__lbl" }, br = {
|
|
3272
3267
|
key: 1,
|
|
3273
3268
|
class: "wm-compose__menu",
|
|
3274
3269
|
role: "menu"
|
|
3275
|
-
},
|
|
3270
|
+
}, kr = ["disabled", "onClick"], Cr = { class: "wm-compose__menuIcon" }, Ar = {
|
|
3276
3271
|
viewBox: "0 0 24 24",
|
|
3277
3272
|
width: "14",
|
|
3278
3273
|
height: "14",
|
|
3279
3274
|
"aria-hidden": "true"
|
|
3280
|
-
},
|
|
3281
|
-
function
|
|
3282
|
-
return d(), c("div",
|
|
3283
|
-
r.recording ? (d(), c("div",
|
|
3284
|
-
t[8] || (t[8] =
|
|
3275
|
+
}, Sr = ["d"], xr = ["placeholder", "disabled"], Mr = { class: "wm-compose__actions" }, Tr = ["title", "aria-label", "disabled"], Ir = ["disabled"];
|
|
3276
|
+
function Or(e, t, n, i, r, s) {
|
|
3277
|
+
return d(), c("div", vr, [
|
|
3278
|
+
r.recording ? (d(), c("div", yr, [
|
|
3279
|
+
t[8] || (t[8] = o("span", {
|
|
3285
3280
|
class: "wm-rec__dot",
|
|
3286
3281
|
"aria-hidden": "true"
|
|
3287
3282
|
}, null, -1)),
|
|
3288
|
-
|
|
3289
|
-
|
|
3283
|
+
o("span", wr, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
|
|
3284
|
+
o("button", {
|
|
3290
3285
|
type: "button",
|
|
3291
3286
|
class: "wm-rec__stop",
|
|
3292
|
-
onClick: t[0] || (t[0] = (...
|
|
3287
|
+
onClick: t[0] || (t[0] = (...a) => s.stopRecording && s.stopRecording(...a))
|
|
3293
3288
|
}, "Arrêter")
|
|
3294
3289
|
])) : w("", !0),
|
|
3295
|
-
|
|
3296
|
-
class:
|
|
3297
|
-
onSubmit: t[7] || (t[7] = Y((...
|
|
3290
|
+
o("form", {
|
|
3291
|
+
class: x(["wm-compose", { "has-attach": r.attachOpen }]),
|
|
3292
|
+
onSubmit: t[7] || (t[7] = Y((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
|
|
3298
3293
|
}, [
|
|
3299
|
-
|
|
3294
|
+
o("input", {
|
|
3300
3295
|
ref: "fileEl",
|
|
3301
3296
|
type: "file",
|
|
3302
3297
|
hidden: "",
|
|
3303
3298
|
multiple: "",
|
|
3304
|
-
onChange: t[1] || (t[1] = (...
|
|
3299
|
+
onChange: t[1] || (t[1] = (...a) => s.onFile && s.onFile(...a))
|
|
3305
3300
|
}, null, 544),
|
|
3306
3301
|
r.attachOpen ? (d(), c("div", {
|
|
3307
3302
|
key: 0,
|
|
3308
3303
|
class: "wm-compose__overlay",
|
|
3309
|
-
onClick: t[2] || (t[2] = (
|
|
3304
|
+
onClick: t[2] || (t[2] = (a) => r.attachOpen = !1)
|
|
3310
3305
|
})) : w("", !0),
|
|
3311
|
-
r.attachOpen ? (d(), c("div",
|
|
3312
|
-
(d(!0), c(
|
|
3313
|
-
key:
|
|
3306
|
+
r.attachOpen ? (d(), c("div", br, [
|
|
3307
|
+
(d(!0), c(B, null, F(s.attachItems, (a) => (d(), c("button", {
|
|
3308
|
+
key: a.action,
|
|
3314
3309
|
type: "button",
|
|
3315
3310
|
class: "wm-compose__menuItem",
|
|
3316
|
-
disabled:
|
|
3317
|
-
onClick: (l) => s.onAttachAction(
|
|
3311
|
+
disabled: a.disabled,
|
|
3312
|
+
onClick: (l) => s.onAttachAction(a.action)
|
|
3318
3313
|
}, [
|
|
3319
|
-
|
|
3320
|
-
(d(), c("svg",
|
|
3321
|
-
|
|
3322
|
-
d:
|
|
3314
|
+
o("span", Cr, [
|
|
3315
|
+
(d(), c("svg", Ar, [
|
|
3316
|
+
o("path", {
|
|
3317
|
+
d: a.path,
|
|
3323
3318
|
stroke: "currentColor",
|
|
3324
3319
|
"stroke-width": "1.8",
|
|
3325
3320
|
"stroke-linecap": "round",
|
|
3326
3321
|
"stroke-linejoin": "round",
|
|
3327
3322
|
fill: "none"
|
|
3328
|
-
}, null, 8,
|
|
3323
|
+
}, null, 8, Sr)
|
|
3329
3324
|
]))
|
|
3330
3325
|
]),
|
|
3331
|
-
|
|
3332
|
-
], 8,
|
|
3326
|
+
o("span", null, b(a.label), 1)
|
|
3327
|
+
], 8, kr))), 128))
|
|
3333
3328
|
])) : w("", !0),
|
|
3334
|
-
|
|
3329
|
+
q(o("textarea", {
|
|
3335
3330
|
ref: "inputEl",
|
|
3336
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
3331
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => r.local = a),
|
|
3337
3332
|
class: "wm-compose__input",
|
|
3338
3333
|
rows: "3",
|
|
3339
3334
|
placeholder: n.placeholder,
|
|
3340
3335
|
disabled: n.disabled,
|
|
3341
|
-
onKeydown: t[4] || (t[4] = (...
|
|
3342
|
-
onInput: t[5] || (t[5] = (...
|
|
3343
|
-
}, null, 40,
|
|
3344
|
-
[
|
|
3336
|
+
onKeydown: t[4] || (t[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
|
|
3337
|
+
onInput: t[5] || (t[5] = (...a) => s.autosize && s.autosize(...a))
|
|
3338
|
+
}, null, 40, xr), [
|
|
3339
|
+
[J, r.local]
|
|
3345
3340
|
]),
|
|
3346
|
-
|
|
3347
|
-
|
|
3341
|
+
o("div", Mr, [
|
|
3342
|
+
o("button", {
|
|
3348
3343
|
type: "button",
|
|
3349
|
-
class:
|
|
3344
|
+
class: x(["wm-compose__icon", { "is-open": r.attachOpen }]),
|
|
3350
3345
|
title: n.attachLabel,
|
|
3351
3346
|
"aria-label": n.attachLabel,
|
|
3352
3347
|
disabled: r.recording,
|
|
3353
|
-
onClick: t[6] || (t[6] = (
|
|
3348
|
+
onClick: t[6] || (t[6] = (a) => r.attachOpen = !r.attachOpen)
|
|
3354
3349
|
}, [...t[9] || (t[9] = [
|
|
3355
|
-
|
|
3350
|
+
o("svg", {
|
|
3356
3351
|
width: "13",
|
|
3357
3352
|
height: "13",
|
|
3358
3353
|
viewBox: "0 0 24 24",
|
|
@@ -3363,16 +3358,16 @@ function Tr(e, t, n, i, r, s) {
|
|
|
3363
3358
|
"stroke-linejoin": "round",
|
|
3364
3359
|
"aria-hidden": "true"
|
|
3365
3360
|
}, [
|
|
3366
|
-
|
|
3361
|
+
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" })
|
|
3367
3362
|
], -1)
|
|
3368
|
-
])], 10,
|
|
3369
|
-
|
|
3363
|
+
])], 10, Tr),
|
|
3364
|
+
o("button", {
|
|
3370
3365
|
type: "submit",
|
|
3371
|
-
class:
|
|
3366
|
+
class: x(["wm-compose__send", { "is-empty": !s.canSend }]),
|
|
3372
3367
|
disabled: !s.canSend,
|
|
3373
3368
|
"aria-label": "Envoyer"
|
|
3374
3369
|
}, [...t[10] || (t[10] = [
|
|
3375
|
-
|
|
3370
|
+
o("svg", {
|
|
3376
3371
|
width: "13",
|
|
3377
3372
|
height: "13",
|
|
3378
3373
|
viewBox: "0 0 24 24",
|
|
@@ -3383,14 +3378,14 @@ function Tr(e, t, n, i, r, s) {
|
|
|
3383
3378
|
"stroke-linejoin": "round",
|
|
3384
3379
|
"aria-hidden": "true"
|
|
3385
3380
|
}, [
|
|
3386
|
-
|
|
3381
|
+
o("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
3387
3382
|
], -1)
|
|
3388
|
-
])], 10,
|
|
3383
|
+
])], 10, Ir)
|
|
3389
3384
|
])
|
|
3390
3385
|
], 34)
|
|
3391
3386
|
]);
|
|
3392
3387
|
}
|
|
3393
|
-
const
|
|
3388
|
+
const Br = /* @__PURE__ */ $(gr, [["render", Or], ["__scopeId", "data-v-14fa9ec0"]]), Er = {
|
|
3394
3389
|
name: "WmSuggestionChips",
|
|
3395
3390
|
props: {
|
|
3396
3391
|
items: { type: Array, default: () => [] },
|
|
@@ -3407,24 +3402,24 @@ const Mr = /* @__PURE__ */ L(fr, [["render", Tr], ["__scopeId", "data-v-14fa9ec0
|
|
|
3407
3402
|
return this.items.map((e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.text) || "").join("§");
|
|
3408
3403
|
}
|
|
3409
3404
|
}
|
|
3410
|
-
},
|
|
3411
|
-
function
|
|
3405
|
+
}, $r = ["onClick"];
|
|
3406
|
+
function Lr(e, t, n, i, r, s) {
|
|
3412
3407
|
return n.items.length ? (d(), c("div", {
|
|
3413
3408
|
key: s.batchKey,
|
|
3414
3409
|
class: "wm-chips"
|
|
3415
3410
|
}, [
|
|
3416
|
-
(d(!0), c(
|
|
3411
|
+
(d(!0), c(B, null, F(n.items, (a, l) => (d(), c("button", {
|
|
3417
3412
|
key: l,
|
|
3418
3413
|
type: "button",
|
|
3419
3414
|
class: "wm-chip",
|
|
3420
|
-
style:
|
|
3421
|
-
onClick: (g) => e.$emit("select",
|
|
3422
|
-
}, b(
|
|
3415
|
+
style: W({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
|
|
3416
|
+
onClick: (g) => e.$emit("select", a)
|
|
3417
|
+
}, b(a.label), 13, $r))), 128))
|
|
3423
3418
|
])) : w("", !0);
|
|
3424
3419
|
}
|
|
3425
|
-
const
|
|
3420
|
+
const Rr = /* @__PURE__ */ $(Er, [["render", Lr], ["__scopeId", "data-v-55aa529d"]]), Nr = {
|
|
3426
3421
|
name: "WmApprovalCard",
|
|
3427
|
-
components: { AIAvatar:
|
|
3422
|
+
components: { AIAvatar: ne },
|
|
3428
3423
|
props: {
|
|
3429
3424
|
action: { type: String, required: !0 },
|
|
3430
3425
|
detail: { type: String, default: "" },
|
|
@@ -3455,23 +3450,23 @@ const Er = /* @__PURE__ */ L(Or, [["render", Ir], ["__scopeId", "data-v-55aa529d
|
|
|
3455
3450
|
return ((e = this.rejectCallback) == null ? void 0 : e.label) || "Refuser";
|
|
3456
3451
|
}
|
|
3457
3452
|
}
|
|
3458
|
-
},
|
|
3453
|
+
}, Fr = { class: "wm-approval" }, Pr = { class: "wm-approval__head" }, Dr = { class: "wm-approval__icon" }, jr = { class: "wm-approval__main" }, Ur = { class: "wm-approval__title" }, Vr = {
|
|
3459
3454
|
key: 0,
|
|
3460
3455
|
class: "wm-approval__detail"
|
|
3461
|
-
},
|
|
3462
|
-
function
|
|
3463
|
-
const
|
|
3464
|
-
return d(), c("div",
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3456
|
+
}, zr = { class: "wm-approval__actions" };
|
|
3457
|
+
function Hr(e, t, n, i, r, s) {
|
|
3458
|
+
const a = E("AIAvatar");
|
|
3459
|
+
return d(), c("div", Fr, [
|
|
3460
|
+
o("div", Pr, [
|
|
3461
|
+
o("div", Dr, [
|
|
3462
|
+
V(a, { size: 24 })
|
|
3468
3463
|
]),
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
n.detail ? (d(), c("div",
|
|
3464
|
+
o("div", jr, [
|
|
3465
|
+
o("div", Ur, b(n.action), 1),
|
|
3466
|
+
n.detail ? (d(), c("div", Vr, b(n.detail), 1)) : w("", !0)
|
|
3472
3467
|
])
|
|
3473
3468
|
]),
|
|
3474
|
-
|
|
3469
|
+
o("div", zr, [
|
|
3475
3470
|
s.rejectId ? (d(), c("button", {
|
|
3476
3471
|
key: 0,
|
|
3477
3472
|
type: "button",
|
|
@@ -3487,9 +3482,9 @@ function Ur(e, t, n, i, r, s) {
|
|
|
3487
3482
|
])
|
|
3488
3483
|
]);
|
|
3489
3484
|
}
|
|
3490
|
-
const
|
|
3491
|
-
let
|
|
3492
|
-
const
|
|
3485
|
+
const qr = /* @__PURE__ */ $(Nr, [["render", Hr], ["__scopeId", "data-v-b1be139c"]]);
|
|
3486
|
+
let we = 0;
|
|
3487
|
+
const Wr = /* @__PURE__ */ new Set([
|
|
3493
3488
|
"text",
|
|
3494
3489
|
"textarea",
|
|
3495
3490
|
"number",
|
|
@@ -3497,9 +3492,9 @@ const Vr = /* @__PURE__ */ new Set([
|
|
|
3497
3492
|
"select",
|
|
3498
3493
|
"multiselect",
|
|
3499
3494
|
"date"
|
|
3500
|
-
]),
|
|
3495
|
+
]), Kr = {
|
|
3501
3496
|
name: "WmFormCard",
|
|
3502
|
-
components: { AIAvatar:
|
|
3497
|
+
components: { AIAvatar: ne },
|
|
3503
3498
|
props: {
|
|
3504
3499
|
form: { type: Object, required: !0 },
|
|
3505
3500
|
readOnly: { type: Boolean, default: !1 },
|
|
@@ -3507,8 +3502,8 @@ const Vr = /* @__PURE__ */ new Set([
|
|
|
3507
3502
|
},
|
|
3508
3503
|
emits: ["submit"],
|
|
3509
3504
|
data() {
|
|
3510
|
-
return
|
|
3511
|
-
_uid:
|
|
3505
|
+
return we += 1, {
|
|
3506
|
+
_uid: we,
|
|
3512
3507
|
values: {},
|
|
3513
3508
|
busy: !1,
|
|
3514
3509
|
error: ""
|
|
@@ -3520,7 +3515,7 @@ const Vr = /* @__PURE__ */ new Set([
|
|
|
3520
3515
|
// douteux.
|
|
3521
3516
|
normalizedFields() {
|
|
3522
3517
|
var t;
|
|
3523
|
-
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !
|
|
3518
|
+
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !Wr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
|
|
3524
3519
|
}
|
|
3525
3520
|
},
|
|
3526
3521
|
created() {
|
|
@@ -3571,61 +3566,61 @@ const Vr = /* @__PURE__ */ new Set([
|
|
|
3571
3566
|
}
|
|
3572
3567
|
}
|
|
3573
3568
|
}
|
|
3574
|
-
},
|
|
3569
|
+
}, Gr = { class: "wm-form" }, Yr = { class: "wm-form__head" }, Xr = { class: "wm-form__icon" }, Jr = { class: "wm-form__main" }, Qr = { class: "wm-form__title" }, Zr = {
|
|
3575
3570
|
key: 0,
|
|
3576
3571
|
class: "wm-form__detail"
|
|
3577
|
-
},
|
|
3572
|
+
}, ei = ["for"], ti = {
|
|
3578
3573
|
key: 0,
|
|
3579
3574
|
class: "wm-form__req",
|
|
3580
3575
|
"aria-hidden": "true"
|
|
3581
|
-
},
|
|
3576
|
+
}, ni = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], si = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], ri = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], ii = ["id", "onUpdate:modelValue", "required", "disabled"], ai = {
|
|
3582
3577
|
key: 4,
|
|
3583
3578
|
class: "wm-form__bool"
|
|
3584
|
-
},
|
|
3579
|
+
}, oi = ["id", "onUpdate:modelValue", "disabled"], li = ["id", "onUpdate:modelValue", "required", "disabled"], di = {
|
|
3585
3580
|
value: "",
|
|
3586
3581
|
disabled: ""
|
|
3587
|
-
},
|
|
3582
|
+
}, ci = ["value"], ui = {
|
|
3588
3583
|
key: 6,
|
|
3589
3584
|
class: "wm-form__multi"
|
|
3590
|
-
},
|
|
3585
|
+
}, hi = ["value", "checked", "disabled", "onChange"], mi = {
|
|
3591
3586
|
key: 0,
|
|
3592
3587
|
class: "wm-form__err"
|
|
3593
|
-
},
|
|
3588
|
+
}, fi = ["disabled"], _i = {
|
|
3594
3589
|
key: 0,
|
|
3595
3590
|
class: "wm-form__spinner",
|
|
3596
3591
|
"aria-hidden": "true"
|
|
3597
|
-
},
|
|
3592
|
+
}, pi = {
|
|
3598
3593
|
key: 2,
|
|
3599
3594
|
class: "wm-form__doneLbl"
|
|
3600
3595
|
};
|
|
3601
|
-
function
|
|
3602
|
-
const
|
|
3603
|
-
return d(), c("div",
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3596
|
+
function gi(e, t, n, i, r, s) {
|
|
3597
|
+
const a = E("AIAvatar");
|
|
3598
|
+
return d(), c("div", Gr, [
|
|
3599
|
+
o("div", Yr, [
|
|
3600
|
+
o("div", Xr, [
|
|
3601
|
+
V(a, { size: 24 })
|
|
3607
3602
|
]),
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
n.form.description ? (d(), c("div",
|
|
3603
|
+
o("div", Jr, [
|
|
3604
|
+
o("div", Qr, b(n.form.title || "Formulaire"), 1),
|
|
3605
|
+
n.form.description ? (d(), c("div", Zr, b(n.form.description), 1)) : w("", !0)
|
|
3611
3606
|
])
|
|
3612
3607
|
]),
|
|
3613
|
-
|
|
3608
|
+
o("form", {
|
|
3614
3609
|
class: "wm-form__body",
|
|
3615
3610
|
onSubmit: t[0] || (t[0] = Y((...l) => s.onSubmit && s.onSubmit(...l), ["prevent"]))
|
|
3616
3611
|
}, [
|
|
3617
|
-
(d(!0), c(
|
|
3612
|
+
(d(!0), c(B, null, F(s.normalizedFields, (l) => (d(), c("div", {
|
|
3618
3613
|
key: l.key,
|
|
3619
3614
|
class: "wm-form__field"
|
|
3620
3615
|
}, [
|
|
3621
|
-
|
|
3616
|
+
o("label", {
|
|
3622
3617
|
for: `wm-f-${r._uid}-${l.key}`,
|
|
3623
3618
|
class: "wm-form__label"
|
|
3624
3619
|
}, [
|
|
3625
|
-
|
|
3626
|
-
l.required ? (d(), c("span",
|
|
3627
|
-
], 8,
|
|
3628
|
-
l.type === "text" ?
|
|
3620
|
+
he(b(l.label), 1),
|
|
3621
|
+
l.required ? (d(), c("span", ti, "*")) : w("", !0)
|
|
3622
|
+
], 8, ei),
|
|
3623
|
+
l.type === "text" ? q((d(), c("input", {
|
|
3629
3624
|
key: 0,
|
|
3630
3625
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
3631
3626
|
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
@@ -3634,9 +3629,9 @@ function fi(e, t, n, i, r, s) {
|
|
|
3634
3629
|
placeholder: l.placeholder || "",
|
|
3635
3630
|
required: l.required,
|
|
3636
3631
|
disabled: n.readOnly || r.busy
|
|
3637
|
-
}, null, 8,
|
|
3638
|
-
[
|
|
3639
|
-
]) : l.type === "textarea" ?
|
|
3632
|
+
}, null, 8, ni)), [
|
|
3633
|
+
[J, r.values[l.key]]
|
|
3634
|
+
]) : l.type === "textarea" ? q((d(), c("textarea", {
|
|
3640
3635
|
key: 1,
|
|
3641
3636
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
3642
3637
|
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
@@ -3645,9 +3640,9 @@ function fi(e, t, n, i, r, s) {
|
|
|
3645
3640
|
placeholder: l.placeholder || "",
|
|
3646
3641
|
required: l.required,
|
|
3647
3642
|
disabled: n.readOnly || r.busy
|
|
3648
|
-
}, null, 8,
|
|
3649
|
-
[
|
|
3650
|
-
]) : l.type === "number" ?
|
|
3643
|
+
}, null, 8, si)), [
|
|
3644
|
+
[J, r.values[l.key]]
|
|
3645
|
+
]) : l.type === "number" ? q((d(), c("input", {
|
|
3651
3646
|
key: 2,
|
|
3652
3647
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
3653
3648
|
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
@@ -3656,14 +3651,14 @@ function fi(e, t, n, i, r, s) {
|
|
|
3656
3651
|
placeholder: l.placeholder || "",
|
|
3657
3652
|
required: l.required,
|
|
3658
3653
|
disabled: n.readOnly || r.busy
|
|
3659
|
-
}, null, 8,
|
|
3654
|
+
}, null, 8, ri)), [
|
|
3660
3655
|
[
|
|
3661
|
-
|
|
3656
|
+
J,
|
|
3662
3657
|
r.values[l.key],
|
|
3663
3658
|
void 0,
|
|
3664
3659
|
{ number: !0 }
|
|
3665
3660
|
]
|
|
3666
|
-
]) : l.type === "date" ?
|
|
3661
|
+
]) : l.type === "date" ? q((d(), c("input", {
|
|
3667
3662
|
key: 3,
|
|
3668
3663
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
3669
3664
|
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
@@ -3671,19 +3666,19 @@ function fi(e, t, n, i, r, s) {
|
|
|
3671
3666
|
class: "wm-form__input",
|
|
3672
3667
|
required: l.required,
|
|
3673
3668
|
disabled: n.readOnly || r.busy
|
|
3674
|
-
}, null, 8,
|
|
3675
|
-
[
|
|
3676
|
-
]) : l.type === "boolean" ? (d(), c("label",
|
|
3677
|
-
|
|
3669
|
+
}, null, 8, ii)), [
|
|
3670
|
+
[J, r.values[l.key]]
|
|
3671
|
+
]) : l.type === "boolean" ? (d(), c("label", ai, [
|
|
3672
|
+
q(o("input", {
|
|
3678
3673
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
3679
3674
|
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
3680
3675
|
type: "checkbox",
|
|
3681
3676
|
disabled: n.readOnly || r.busy
|
|
3682
|
-
}, null, 8,
|
|
3683
|
-
[
|
|
3677
|
+
}, null, 8, oi), [
|
|
3678
|
+
[Le, r.values[l.key]]
|
|
3684
3679
|
]),
|
|
3685
|
-
|
|
3686
|
-
])) : l.type === "select" ?
|
|
3680
|
+
o("span", null, b(l.placeholder || "Oui"), 1)
|
|
3681
|
+
])) : l.type === "select" ? q((d(), c("select", {
|
|
3687
3682
|
key: 5,
|
|
3688
3683
|
id: `wm-f-${r._uid}-${l.key}`,
|
|
3689
3684
|
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
@@ -3691,43 +3686,43 @@ function fi(e, t, n, i, r, s) {
|
|
|
3691
3686
|
required: l.required,
|
|
3692
3687
|
disabled: n.readOnly || r.busy
|
|
3693
3688
|
}, [
|
|
3694
|
-
|
|
3695
|
-
(d(!0), c(
|
|
3689
|
+
o("option", di, b(l.placeholder || "Choisir…"), 1),
|
|
3690
|
+
(d(!0), c(B, null, F(l.options, (g) => (d(), c("option", {
|
|
3696
3691
|
key: g.value,
|
|
3697
3692
|
value: g.value
|
|
3698
|
-
}, b(g.label), 9,
|
|
3699
|
-
], 8,
|
|
3700
|
-
[
|
|
3701
|
-
]) : l.type === "multiselect" ? (d(), c("div",
|
|
3702
|
-
(d(!0), c(
|
|
3693
|
+
}, b(g.label), 9, ci))), 128))
|
|
3694
|
+
], 8, li)), [
|
|
3695
|
+
[Re, r.values[l.key]]
|
|
3696
|
+
]) : l.type === "multiselect" ? (d(), c("div", ui, [
|
|
3697
|
+
(d(!0), c(B, null, F(l.options, (g) => (d(), c("label", {
|
|
3703
3698
|
key: g.value,
|
|
3704
3699
|
class: "wm-form__multiItem"
|
|
3705
3700
|
}, [
|
|
3706
|
-
|
|
3701
|
+
o("input", {
|
|
3707
3702
|
type: "checkbox",
|
|
3708
3703
|
value: g.value,
|
|
3709
3704
|
checked: Array.isArray(r.values[l.key]) && r.values[l.key].includes(g.value),
|
|
3710
3705
|
disabled: n.readOnly || r.busy,
|
|
3711
3706
|
onChange: (k) => s.toggleMulti(l.key, g.value, k.target.checked)
|
|
3712
|
-
}, null, 40,
|
|
3713
|
-
|
|
3707
|
+
}, null, 40, hi),
|
|
3708
|
+
o("span", null, b(g.label), 1)
|
|
3714
3709
|
]))), 128))
|
|
3715
3710
|
])) : w("", !0)
|
|
3716
3711
|
]))), 128)),
|
|
3717
|
-
r.error ? (d(), c("div",
|
|
3718
|
-
n.readOnly ? (d(), c("div",
|
|
3712
|
+
r.error ? (d(), c("div", mi, b(r.error), 1)) : w("", !0),
|
|
3713
|
+
n.readOnly ? (d(), c("div", pi, "Réponse envoyée")) : (d(), c("button", {
|
|
3719
3714
|
key: 1,
|
|
3720
3715
|
type: "submit",
|
|
3721
3716
|
class: "wm-form__submit",
|
|
3722
3717
|
disabled: r.busy
|
|
3723
3718
|
}, [
|
|
3724
|
-
r.busy ? (d(), c("span",
|
|
3725
|
-
|
|
3726
|
-
], 8,
|
|
3719
|
+
r.busy ? (d(), c("span", _i)) : w("", !0),
|
|
3720
|
+
o("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
|
|
3721
|
+
], 8, fi))
|
|
3727
3722
|
], 32)
|
|
3728
3723
|
]);
|
|
3729
3724
|
}
|
|
3730
|
-
const
|
|
3725
|
+
const vi = /* @__PURE__ */ $(Kr, [["render", gi], ["__scopeId", "data-v-64b40f76"]]), yi = {
|
|
3731
3726
|
name: "WmFeedback",
|
|
3732
3727
|
props: {
|
|
3733
3728
|
busy: { type: Boolean, default: !1 },
|
|
@@ -3751,38 +3746,38 @@ const _i = /* @__PURE__ */ L(Hr, [["render", fi], ["__scopeId", "data-v-64b40f76
|
|
|
3751
3746
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
3752
3747
|
}
|
|
3753
3748
|
}
|
|
3754
|
-
},
|
|
3749
|
+
}, wi = { class: "wm-fb" }, bi = { class: "wm-fb__row" }, ki = ["onClick"], Ci = { class: "wm-fb__emoji" }, Ai = { class: "wm-fb__label" }, Si = ["disabled"], xi = {
|
|
3755
3750
|
key: 1,
|
|
3756
3751
|
class: "wm-fb__done"
|
|
3757
3752
|
};
|
|
3758
|
-
function
|
|
3759
|
-
return d(), c("div",
|
|
3760
|
-
n.done ? (d(), c("div",
|
|
3761
|
-
|
|
3762
|
-
])])) : (d(), c(
|
|
3763
|
-
t[1] || (t[1] =
|
|
3764
|
-
t[2] || (t[2] =
|
|
3765
|
-
|
|
3766
|
-
(d(!0), c(
|
|
3767
|
-
key:
|
|
3753
|
+
function Mi(e, t, n, i, r, s) {
|
|
3754
|
+
return d(), c("div", wi, [
|
|
3755
|
+
n.done ? (d(), c("div", xi, [...t[3] || (t[3] = [
|
|
3756
|
+
ae('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
|
|
3757
|
+
])])) : (d(), c(B, { key: 0 }, [
|
|
3758
|
+
t[1] || (t[1] = o("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
|
|
3759
|
+
t[2] || (t[2] = o("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
|
|
3760
|
+
o("div", bi, [
|
|
3761
|
+
(d(!0), c(B, null, F(r.options, (a) => (d(), c("button", {
|
|
3762
|
+
key: a.v,
|
|
3768
3763
|
type: "button",
|
|
3769
|
-
class:
|
|
3770
|
-
onClick: (l) => r.sel =
|
|
3764
|
+
class: x(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
|
|
3765
|
+
onClick: (l) => r.sel = a.v
|
|
3771
3766
|
}, [
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
], 10,
|
|
3767
|
+
o("span", Ci, b(a.e), 1),
|
|
3768
|
+
o("span", Ai, b(a.l), 1)
|
|
3769
|
+
], 10, ki))), 128))
|
|
3775
3770
|
]),
|
|
3776
|
-
|
|
3771
|
+
o("button", {
|
|
3777
3772
|
type: "button",
|
|
3778
3773
|
class: "wm-fb__send",
|
|
3779
3774
|
disabled: !r.sel || n.busy,
|
|
3780
|
-
onClick: t[0] || (t[0] = (...
|
|
3781
|
-
}, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9,
|
|
3775
|
+
onClick: t[0] || (t[0] = (...a) => s.onSend && s.onSend(...a))
|
|
3776
|
+
}, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Si)
|
|
3782
3777
|
], 64))
|
|
3783
3778
|
]);
|
|
3784
3779
|
}
|
|
3785
|
-
const
|
|
3780
|
+
const Ti = /* @__PURE__ */ $(yi, [["render", Mi], ["__scopeId", "data-v-6f45ff3b"]]), Ii = {
|
|
3786
3781
|
name: "WmMoreMenu",
|
|
3787
3782
|
props: {
|
|
3788
3783
|
canRename: { type: Boolean, default: !0 },
|
|
@@ -3820,62 +3815,62 @@ const Si = /* @__PURE__ */ L(pi, [["render", Ai], ["__scopeId", "data-v-6f45ff3b
|
|
|
3820
3815
|
this.browserNotifOn = !this.browserNotifOn, this.$emit("browser-notif-toggle", this.browserNotifOn);
|
|
3821
3816
|
}
|
|
3822
3817
|
}
|
|
3823
|
-
},
|
|
3818
|
+
}, Oi = { class: "wm-mm" }, Bi = {
|
|
3824
3819
|
class: "wm-mm__pop",
|
|
3825
3820
|
role: "menu"
|
|
3826
|
-
},
|
|
3821
|
+
}, Ei = {
|
|
3827
3822
|
key: 0,
|
|
3828
3823
|
class: "wm-mm__section"
|
|
3829
|
-
},
|
|
3824
|
+
}, $i = {
|
|
3830
3825
|
key: 1,
|
|
3831
3826
|
class: "wm-mm__sep"
|
|
3832
|
-
},
|
|
3833
|
-
function
|
|
3834
|
-
return d(), c("div",
|
|
3835
|
-
|
|
3827
|
+
}, Li = { class: "wm-mm__section" }, Ri = { class: "wm-mm__section" };
|
|
3828
|
+
function Ni(e, t, n, i, r, s) {
|
|
3829
|
+
return d(), c("div", Oi, [
|
|
3830
|
+
o("div", {
|
|
3836
3831
|
class: "wm-mm__scrim",
|
|
3837
|
-
onClick: t[0] || (t[0] = (
|
|
3832
|
+
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
3838
3833
|
}),
|
|
3839
|
-
|
|
3840
|
-
n.canRename || n.canExport ? (d(), c("div",
|
|
3834
|
+
o("div", Bi, [
|
|
3835
|
+
n.canRename || n.canExport ? (d(), c("div", Ei, [
|
|
3841
3836
|
n.canRename ? (d(), c("button", {
|
|
3842
3837
|
key: 0,
|
|
3843
3838
|
type: "button",
|
|
3844
3839
|
class: "wm-mm__item",
|
|
3845
|
-
onClick: t[1] || (t[1] = (
|
|
3840
|
+
onClick: t[1] || (t[1] = (a) => s.emit("rename"))
|
|
3846
3841
|
}, [...t[7] || (t[7] = [
|
|
3847
|
-
|
|
3842
|
+
ae('<span class="wm-mm__icon" data-v-3a73911b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3a73911b><path d="M12 20h9" data-v-3a73911b></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-3a73911b></path></svg></span><span class="wm-mm__label" data-v-3a73911b>Modifier le titre</span>', 2)
|
|
3848
3843
|
])])) : w("", !0),
|
|
3849
3844
|
n.canExport ? (d(), c("button", {
|
|
3850
3845
|
key: 1,
|
|
3851
3846
|
type: "button",
|
|
3852
3847
|
class: "wm-mm__item",
|
|
3853
|
-
onClick: t[2] || (t[2] = (
|
|
3848
|
+
onClick: t[2] || (t[2] = (a) => s.emit("export"))
|
|
3854
3849
|
}, [...t[8] || (t[8] = [
|
|
3855
|
-
|
|
3850
|
+
ae('<span class="wm-mm__icon" data-v-3a73911b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3a73911b><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-3a73911b></path></svg></span><span class="wm-mm__label" data-v-3a73911b>Exporter la transcription</span><span class="wm-mm__hint" data-v-3a73911b>.txt</span>', 3)
|
|
3856
3851
|
])])) : w("", !0)
|
|
3857
3852
|
])) : w("", !0),
|
|
3858
|
-
n.canRename || n.canExport ? (d(), c("div",
|
|
3859
|
-
|
|
3860
|
-
|
|
3853
|
+
n.canRename || n.canExport ? (d(), c("div", $i)) : w("", !0),
|
|
3854
|
+
o("div", Li, [
|
|
3855
|
+
o("button", {
|
|
3861
3856
|
type: "button",
|
|
3862
3857
|
class: "wm-mm__item",
|
|
3863
|
-
onClick: t[3] || (t[3] = (...
|
|
3858
|
+
onClick: t[3] || (t[3] = (...a) => s.toggleSound && s.toggleSound(...a))
|
|
3864
3859
|
}, [
|
|
3865
|
-
t[10] || (t[10] =
|
|
3866
|
-
|
|
3867
|
-
class:
|
|
3860
|
+
t[10] || (t[10] = ae('<span class="wm-mm__icon" data-v-3a73911b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3a73911b><path d="M11 5L6 9H2v6h4l5 4V5z" data-v-3a73911b></path><path d="M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" data-v-3a73911b></path></svg></span><span class="wm-mm__label" data-v-3a73911b>Son</span>', 2)),
|
|
3861
|
+
o("span", {
|
|
3862
|
+
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.soundOn }])
|
|
3868
3863
|
}, [...t[9] || (t[9] = [
|
|
3869
|
-
|
|
3864
|
+
o("span", { class: "wm-mm__knob" }, null, -1)
|
|
3870
3865
|
])], 2)
|
|
3871
3866
|
]),
|
|
3872
|
-
|
|
3867
|
+
o("button", {
|
|
3873
3868
|
type: "button",
|
|
3874
3869
|
class: "wm-mm__item",
|
|
3875
|
-
onClick: t[4] || (t[4] = (...
|
|
3870
|
+
onClick: t[4] || (t[4] = (...a) => s.toggleBrowserNotif && s.toggleBrowserNotif(...a))
|
|
3876
3871
|
}, [
|
|
3877
|
-
t[12] || (t[12] =
|
|
3878
|
-
|
|
3872
|
+
t[12] || (t[12] = o("span", { class: "wm-mm__icon" }, [
|
|
3873
|
+
o("svg", {
|
|
3879
3874
|
width: "12",
|
|
3880
3875
|
height: "12",
|
|
3881
3876
|
viewBox: "0 0 24 24",
|
|
@@ -3886,27 +3881,27 @@ function Li(e, t, n, i, r, s) {
|
|
|
3886
3881
|
"stroke-linejoin": "round",
|
|
3887
3882
|
"aria-hidden": "true"
|
|
3888
3883
|
}, [
|
|
3889
|
-
|
|
3884
|
+
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" })
|
|
3890
3885
|
])
|
|
3891
3886
|
], -1)),
|
|
3892
|
-
t[13] || (t[13] =
|
|
3893
|
-
|
|
3894
|
-
class:
|
|
3887
|
+
t[13] || (t[13] = o("span", { class: "wm-mm__label" }, "Notifications navigateur", -1)),
|
|
3888
|
+
o("span", {
|
|
3889
|
+
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.browserNotifOn }])
|
|
3895
3890
|
}, [...t[11] || (t[11] = [
|
|
3896
|
-
|
|
3891
|
+
o("span", { class: "wm-mm__knob" }, null, -1)
|
|
3897
3892
|
])], 2)
|
|
3898
3893
|
])
|
|
3899
3894
|
]),
|
|
3900
|
-
t[16] || (t[16] =
|
|
3901
|
-
|
|
3895
|
+
t[16] || (t[16] = o("div", { class: "wm-mm__sep" }, null, -1)),
|
|
3896
|
+
o("div", Ri, [
|
|
3902
3897
|
n.statusUrl ? (d(), c("button", {
|
|
3903
3898
|
key: 0,
|
|
3904
3899
|
type: "button",
|
|
3905
3900
|
class: "wm-mm__item",
|
|
3906
|
-
onClick: t[5] || (t[5] = (
|
|
3901
|
+
onClick: t[5] || (t[5] = (a) => s.emit("status"))
|
|
3907
3902
|
}, [...t[14] || (t[14] = [
|
|
3908
|
-
|
|
3909
|
-
|
|
3903
|
+
o("span", { class: "wm-mm__icon" }, [
|
|
3904
|
+
o("svg", {
|
|
3910
3905
|
width: "12",
|
|
3911
3906
|
height: "12",
|
|
3912
3907
|
viewBox: "0 0 24 24",
|
|
@@ -3917,19 +3912,19 @@ function Li(e, t, n, i, r, s) {
|
|
|
3917
3912
|
"stroke-linejoin": "round",
|
|
3918
3913
|
"aria-hidden": "true"
|
|
3919
3914
|
}, [
|
|
3920
|
-
|
|
3915
|
+
o("path", { d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2" })
|
|
3921
3916
|
])
|
|
3922
3917
|
], -1),
|
|
3923
|
-
|
|
3918
|
+
o("span", { class: "wm-mm__label" }, "Statut des services", -1)
|
|
3924
3919
|
])])) : w("", !0),
|
|
3925
3920
|
n.helpUrl ? (d(), c("button", {
|
|
3926
3921
|
key: 1,
|
|
3927
3922
|
type: "button",
|
|
3928
3923
|
class: "wm-mm__item",
|
|
3929
|
-
onClick: t[6] || (t[6] = (
|
|
3924
|
+
onClick: t[6] || (t[6] = (a) => s.emit("help"))
|
|
3930
3925
|
}, [...t[15] || (t[15] = [
|
|
3931
|
-
|
|
3932
|
-
|
|
3926
|
+
o("span", { class: "wm-mm__icon" }, [
|
|
3927
|
+
o("svg", {
|
|
3933
3928
|
width: "12",
|
|
3934
3929
|
height: "12",
|
|
3935
3930
|
viewBox: "0 0 24 24",
|
|
@@ -3940,16 +3935,16 @@ function Li(e, t, n, i, r, s) {
|
|
|
3940
3935
|
"stroke-linejoin": "round",
|
|
3941
3936
|
"aria-hidden": "true"
|
|
3942
3937
|
}, [
|
|
3943
|
-
|
|
3938
|
+
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" })
|
|
3944
3939
|
])
|
|
3945
3940
|
], -1),
|
|
3946
|
-
|
|
3941
|
+
o("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
|
|
3947
3942
|
])])) : w("", !0)
|
|
3948
3943
|
])
|
|
3949
3944
|
])
|
|
3950
3945
|
]);
|
|
3951
3946
|
}
|
|
3952
|
-
const
|
|
3947
|
+
const Fi = /* @__PURE__ */ $(Ii, [["render", Ni], ["__scopeId", "data-v-3a73911b"]]), Pi = {
|
|
3953
3948
|
name: "WmRenameDialog",
|
|
3954
3949
|
props: {
|
|
3955
3950
|
title: { type: String, default: "Modifier le titre" },
|
|
@@ -3983,27 +3978,27 @@ const $i = /* @__PURE__ */ L(xi, [["render", Li], ["__scopeId", "data-v-3a73911b
|
|
|
3983
3978
|
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
3984
3979
|
}
|
|
3985
3980
|
}
|
|
3986
|
-
},
|
|
3981
|
+
}, Di = { class: "wm-dialog" }, ji = {
|
|
3987
3982
|
class: "wm-dialog__card",
|
|
3988
3983
|
role: "dialog",
|
|
3989
3984
|
"aria-modal": "true"
|
|
3990
|
-
},
|
|
3991
|
-
function
|
|
3992
|
-
return d(), c("div",
|
|
3993
|
-
|
|
3985
|
+
}, Ui = { class: "wm-dialog__head" }, Vi = { class: "wm-dialog__title" }, zi = { class: "wm-dialog__body" }, Hi = ["placeholder"], qi = { class: "wm-dialog__actions" }, Wi = ["disabled"];
|
|
3986
|
+
function Ki(e, t, n, i, r, s) {
|
|
3987
|
+
return d(), c("div", Di, [
|
|
3988
|
+
o("div", {
|
|
3994
3989
|
class: "wm-dialog__scrim",
|
|
3995
|
-
onClick: t[0] || (t[0] = (
|
|
3990
|
+
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
3996
3991
|
}),
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
3992
|
+
o("div", ji, [
|
|
3993
|
+
o("div", Ui, [
|
|
3994
|
+
o("div", Vi, b(n.title), 1),
|
|
3995
|
+
o("button", {
|
|
4001
3996
|
type: "button",
|
|
4002
3997
|
class: "wm-dialog__close",
|
|
4003
3998
|
"aria-label": "Fermer",
|
|
4004
|
-
onClick: t[1] || (t[1] = (
|
|
3999
|
+
onClick: t[1] || (t[1] = (a) => e.$emit("close"))
|
|
4005
4000
|
}, [...t[7] || (t[7] = [
|
|
4006
|
-
|
|
4001
|
+
o("svg", {
|
|
4007
4002
|
width: "12",
|
|
4008
4003
|
height: "12",
|
|
4009
4004
|
viewBox: "0 0 24 24",
|
|
@@ -4014,62 +4009,62 @@ function Hi(e, t, n, i, r, s) {
|
|
|
4014
4009
|
"stroke-linejoin": "round",
|
|
4015
4010
|
"aria-hidden": "true"
|
|
4016
4011
|
}, [
|
|
4017
|
-
|
|
4012
|
+
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4018
4013
|
], -1)
|
|
4019
4014
|
])])
|
|
4020
4015
|
]),
|
|
4021
|
-
|
|
4022
|
-
|
|
4016
|
+
o("div", zi, [
|
|
4017
|
+
q(o("input", {
|
|
4023
4018
|
ref: "input",
|
|
4024
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
4019
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => r.value = a),
|
|
4025
4020
|
type: "text",
|
|
4026
4021
|
class: "wm-dialog__input",
|
|
4027
4022
|
placeholder: n.placeholder,
|
|
4028
4023
|
maxlength: 120,
|
|
4029
4024
|
onKeydown: [
|
|
4030
|
-
t[3] || (t[3] =
|
|
4031
|
-
t[4] || (t[4] =
|
|
4025
|
+
t[3] || (t[3] = oe(Y((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
|
|
4026
|
+
t[4] || (t[4] = oe(Y((a) => e.$emit("close"), ["prevent"]), ["esc"]))
|
|
4032
4027
|
]
|
|
4033
|
-
}, null, 40,
|
|
4034
|
-
[
|
|
4028
|
+
}, null, 40, Hi), [
|
|
4029
|
+
[J, r.value]
|
|
4035
4030
|
])
|
|
4036
4031
|
]),
|
|
4037
|
-
|
|
4038
|
-
|
|
4032
|
+
o("div", qi, [
|
|
4033
|
+
o("button", {
|
|
4039
4034
|
type: "button",
|
|
4040
4035
|
class: "wm-dialog__btn",
|
|
4041
|
-
onClick: t[5] || (t[5] = (
|
|
4036
|
+
onClick: t[5] || (t[5] = (a) => e.$emit("close"))
|
|
4042
4037
|
}, "Annuler"),
|
|
4043
|
-
|
|
4038
|
+
o("button", {
|
|
4044
4039
|
type: "button",
|
|
4045
4040
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
4046
4041
|
disabled: !s.canSubmit,
|
|
4047
|
-
onClick: t[6] || (t[6] = (...
|
|
4048
|
-
}, "Enregistrer", 8,
|
|
4042
|
+
onClick: t[6] || (t[6] = (...a) => s.onSubmit && s.onSubmit(...a))
|
|
4043
|
+
}, "Enregistrer", 8, Wi)
|
|
4049
4044
|
])
|
|
4050
4045
|
])
|
|
4051
4046
|
]);
|
|
4052
4047
|
}
|
|
4053
|
-
const
|
|
4048
|
+
const Gi = /* @__PURE__ */ $(Pi, [["render", Ki], ["__scopeId", "data-v-4f4b37c9"]]), be = "ww-messenger-tokens", Yi = {
|
|
4054
4049
|
name: "Messenger",
|
|
4055
4050
|
components: {
|
|
4056
|
-
Launcher:
|
|
4057
|
-
Header:
|
|
4058
|
-
Onboarding:
|
|
4059
|
-
MessageList:
|
|
4060
|
-
Composer:
|
|
4061
|
-
SuggestionChips:
|
|
4062
|
-
ApprovalCard:
|
|
4063
|
-
FormCard:
|
|
4064
|
-
Feedback:
|
|
4065
|
-
MoreMenu:
|
|
4066
|
-
RenameDialog:
|
|
4051
|
+
Launcher: Mt,
|
|
4052
|
+
Header: Gt,
|
|
4053
|
+
Onboarding: Cn,
|
|
4054
|
+
MessageList: ur,
|
|
4055
|
+
Composer: Br,
|
|
4056
|
+
SuggestionChips: Rr,
|
|
4057
|
+
ApprovalCard: qr,
|
|
4058
|
+
FormCard: vi,
|
|
4059
|
+
Feedback: Ti,
|
|
4060
|
+
MoreMenu: Fi,
|
|
4061
|
+
RenameDialog: Gi
|
|
4067
4062
|
},
|
|
4068
4063
|
mixins: [
|
|
4069
|
-
|
|
4070
|
-
rt,
|
|
4064
|
+
Ze,
|
|
4071
4065
|
it,
|
|
4072
|
-
at
|
|
4066
|
+
at,
|
|
4067
|
+
lt
|
|
4073
4068
|
],
|
|
4074
4069
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
4075
4070
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -4085,7 +4080,7 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4085
4080
|
},
|
|
4086
4081
|
props: {
|
|
4087
4082
|
// Hardcoded server default (overridable for staging/dev).
|
|
4088
|
-
baseUrl: { type: String, default:
|
|
4083
|
+
baseUrl: { type: String, default: We },
|
|
4089
4084
|
widgetId: { type: String, default: "" },
|
|
4090
4085
|
userId: { type: String, default: "" },
|
|
4091
4086
|
userHash: { type: String, default: "" },
|
|
@@ -4177,31 +4172,34 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4177
4172
|
const e = (t = this.s) == null ? void 0 : t.conversations;
|
|
4178
4173
|
return Array.isArray(e) ? e : [];
|
|
4179
4174
|
},
|
|
4180
|
-
// Conversations enriched for the
|
|
4181
|
-
// of the last message
|
|
4182
|
-
//
|
|
4183
|
-
//
|
|
4184
|
-
//
|
|
4175
|
+
// Conversations enriched for the home/recent list: a one-line
|
|
4176
|
+
// preview of the last message + an unread flag derived from the
|
|
4177
|
+
// server-side `last_read_message_id` pointer compared against
|
|
4178
|
+
// the cached messages. The server exposes no preview field, so
|
|
4179
|
+
// that one stays client-derived.
|
|
4185
4180
|
drawerConversations() {
|
|
4186
|
-
var
|
|
4187
|
-
const e =
|
|
4188
|
-
return this.allConversations.map((
|
|
4189
|
-
var
|
|
4190
|
-
const
|
|
4191
|
-
let
|
|
4192
|
-
for (let
|
|
4193
|
-
const
|
|
4194
|
-
if (
|
|
4195
|
-
|
|
4196
|
-
|
|
4181
|
+
var t;
|
|
4182
|
+
const e = ((t = this.s) == null ? void 0 : t.messagesByConv) || {};
|
|
4183
|
+
return this.allConversations.map((n) => {
|
|
4184
|
+
var l;
|
|
4185
|
+
const i = e[n.id] || [], r = X(n.last_read_message_id);
|
|
4186
|
+
let s = 0, a = null;
|
|
4187
|
+
for (let g = i.length - 1; g >= 0; g--) {
|
|
4188
|
+
const k = i[g];
|
|
4189
|
+
if (!k) continue;
|
|
4190
|
+
if (((l = k.author) == null ? void 0 : l.type) === "user") break;
|
|
4191
|
+
const C = X(k.id);
|
|
4192
|
+
if (C != null) {
|
|
4193
|
+
if (r != null && C <= r) break;
|
|
4194
|
+
!a && k.author && (a = k.author), s++;
|
|
4197
4195
|
}
|
|
4198
4196
|
}
|
|
4199
|
-
return
|
|
4200
|
-
...
|
|
4201
|
-
_preview:
|
|
4202
|
-
_unread:
|
|
4203
|
-
_unreadCount:
|
|
4204
|
-
_lastAuthor:
|
|
4197
|
+
return {
|
|
4198
|
+
...n,
|
|
4199
|
+
_preview: Ye(n, i),
|
|
4200
|
+
_unread: s > 0,
|
|
4201
|
+
_unreadCount: s,
|
|
4202
|
+
_lastAuthor: a
|
|
4205
4203
|
};
|
|
4206
4204
|
});
|
|
4207
4205
|
},
|
|
@@ -4221,7 +4219,7 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4221
4219
|
title: n.name || "Nouvelle conversation",
|
|
4222
4220
|
preview: n._preview || "Nouveau message",
|
|
4223
4221
|
unread: !!n._unread,
|
|
4224
|
-
_ts:
|
|
4222
|
+
_ts: ge(n, e[n.id] || [])
|
|
4225
4223
|
})).sort((n, i) => n._ts < i._ts ? 1 : n._ts > i._ts ? -1 : 0);
|
|
4226
4224
|
},
|
|
4227
4225
|
// Unread threads (one entry per conv with unseen agent/human
|
|
@@ -4233,7 +4231,7 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4233
4231
|
const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
|
|
4234
4232
|
for (const i of this.drawerConversations) {
|
|
4235
4233
|
if (!i._unread) continue;
|
|
4236
|
-
const r =
|
|
4234
|
+
const r = ge(i, e[i.id] || []), s = i._lastAuthor, a = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (a ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (a ? this.agentAvatarUrl : null);
|
|
4237
4235
|
t.push({
|
|
4238
4236
|
convId: i.id,
|
|
4239
4237
|
preview: i._preview || "Vous avez un nouveau message",
|
|
@@ -4256,7 +4254,7 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4256
4254
|
},
|
|
4257
4255
|
// True when the user is actively looking at a thread (panel open or
|
|
4258
4256
|
// embedded, a currentConv exists). Used as the trigger to
|
|
4259
|
-
// (re)snapshot `
|
|
4257
|
+
// (re)snapshot `unreadAnchorId` so the "Non lus" separator anchors
|
|
4260
4258
|
// against what was read PRIOR to this viewing.
|
|
4261
4259
|
isViewingThread() {
|
|
4262
4260
|
return (this.isOpen || this.isEmbedded) && !!this.currentConv;
|
|
@@ -4360,8 +4358,8 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4360
4358
|
if (!e) return [];
|
|
4361
4359
|
const t = this.revealedAt;
|
|
4362
4360
|
return (this.s.messagesByConv[e.id] || []).filter((n) => {
|
|
4363
|
-
var i, r, s,
|
|
4364
|
-
return (n == null ? void 0 : n.type) === "action" && ((i = n == null ? void 0 : n.payload) == null ? void 0 : i.state) === "pending" ||
|
|
4361
|
+
var i, r, s, a, l;
|
|
4362
|
+
return (n == null ? void 0 : n.type) === "action" && ((i = n == null ? void 0 : n.payload) == null ? void 0 : i.state) === "pending" || le(n) && !(t[n.id] > 0) ? !1 : (n == null ? void 0 : n.type) === "action" || (n == null ? void 0 : n.type) === "system" || ((r = n == null ? void 0 : n.payload) == null ? void 0 : r.type) === "system" || Array.isArray((s = n == null ? void 0 : n.payload) == null ? void 0 : s.attachments) && n.payload.attachments.length || (a = n == null ? void 0 : n.metadata) != null && a.artifact || (l = n == null ? void 0 : n.metadata) != null && l.form ? !0 : typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0;
|
|
4365
4363
|
});
|
|
4366
4364
|
},
|
|
4367
4365
|
// True whenever we should show the "typing" indicator at the bottom
|
|
@@ -4371,7 +4369,7 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4371
4369
|
streamingActive() {
|
|
4372
4370
|
var n, i, r;
|
|
4373
4371
|
const e = this.currentConv;
|
|
4374
|
-
return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (i = this.s) == null ? void 0 : i.messagesByConv) == null ? void 0 : r[e.id]) || []).some((s) =>
|
|
4372
|
+
return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (i = this.s) == null ? void 0 : i.messagesByConv) == null ? void 0 : r[e.id]) || []).some((s) => le(s) && !(this.revealedAt[s.id] > 0)) : !1;
|
|
4375
4373
|
},
|
|
4376
4374
|
// Internal: the raw persisted list for the current conversation. We
|
|
4377
4375
|
// watch this to detect new agent messages that need to be paced.
|
|
@@ -4395,11 +4393,11 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4395
4393
|
return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || "Confirmer l'action";
|
|
4396
4394
|
},
|
|
4397
4395
|
approvalDetail() {
|
|
4398
|
-
var i, r, s,
|
|
4396
|
+
var i, r, s, a, l, g;
|
|
4399
4397
|
const e = (s = (r = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
4400
4398
|
if (typeof e == "string" && e.trim())
|
|
4401
4399
|
return e.trim();
|
|
4402
|
-
const t = (g = (l = (
|
|
4400
|
+
const t = (g = (l = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : l.pending) == null ? void 0 : g.prepared_params;
|
|
4403
4401
|
if (!t || typeof t != "object") return "";
|
|
4404
4402
|
const n = Object.entries(t);
|
|
4405
4403
|
return n.length ? n.slice(0, 2).map(([k, C]) => `${k}: ${C}`).join(" · ") : "";
|
|
@@ -4438,13 +4436,13 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4438
4436
|
const e = this.currentConv;
|
|
4439
4437
|
let t = /* @__PURE__ */ new Date();
|
|
4440
4438
|
if (e) {
|
|
4441
|
-
const
|
|
4442
|
-
if (
|
|
4443
|
-
const l = new Date(
|
|
4439
|
+
const a = ((r = (((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : r.created_at) || e.created_at;
|
|
4440
|
+
if (a) {
|
|
4441
|
+
const l = new Date(a);
|
|
4444
4442
|
Number.isNaN(l.getTime()) || (t = l);
|
|
4445
4443
|
}
|
|
4446
4444
|
}
|
|
4447
|
-
return `Aujourd'hui · ${
|
|
4445
|
+
return `Aujourd'hui · ${Ae(t)}`;
|
|
4448
4446
|
},
|
|
4449
4447
|
// Pagination state for the active conversation. Drives the
|
|
4450
4448
|
// MessageList's scroll-up history loader. Defaults are safe (no
|
|
@@ -4467,12 +4465,12 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4467
4465
|
// ts comparison in `launcherPeeks`.
|
|
4468
4466
|
latestUnreads: {
|
|
4469
4467
|
handler(e) {
|
|
4470
|
-
const t = new Set(e.map((
|
|
4468
|
+
const t = new Set(e.map((a) => a.convId)), n = this.dismissedPeeks || {}, i = Object.keys(n);
|
|
4471
4469
|
if (!i.length) return;
|
|
4472
4470
|
const r = {};
|
|
4473
4471
|
let s = !1;
|
|
4474
|
-
for (const
|
|
4475
|
-
t.has(
|
|
4472
|
+
for (const a of i)
|
|
4473
|
+
t.has(a) ? r[a] = n[a] : s = !0;
|
|
4476
4474
|
s && (this.dismissedPeeks = r);
|
|
4477
4475
|
},
|
|
4478
4476
|
deep: !0
|
|
@@ -4482,20 +4480,18 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4482
4480
|
// we're about to load count as history and bypass pacing.
|
|
4483
4481
|
"currentConv.id": {
|
|
4484
4482
|
handler(e) {
|
|
4485
|
-
|
|
4483
|
+
var t;
|
|
4484
|
+
this.resetRevealQueue(), this.convOpenedAt = Date.now(), this.moreOpen = !1, this.renameDialogOpen = !1, this.resetApprovalPacing(), this.isViewingThread && (this.unreadAnchorId = X((t = this.currentConv) == null ? void 0 : t.last_read_message_id), this.unreadBoundaryTs = e ? (/* @__PURE__ */ new Date()).toISOString() : "");
|
|
4486
4485
|
},
|
|
4487
4486
|
immediate: !0
|
|
4488
4487
|
},
|
|
4489
|
-
// Panel just opened onto a thread
|
|
4490
|
-
//
|
|
4491
|
-
//
|
|
4492
|
-
//
|
|
4488
|
+
// Panel just opened onto a thread. Snapshot the read pointer so the
|
|
4489
|
+
// separator marks the pre-session boundary, even though
|
|
4490
|
+
// markConvRead will immediately push it forward as the messages
|
|
4491
|
+
// render.
|
|
4493
4492
|
isViewingThread(e, t) {
|
|
4494
4493
|
var n;
|
|
4495
|
-
|
|
4496
|
-
const i = (n = this.currentConv) == null ? void 0 : n.id;
|
|
4497
|
-
this.unreadAnchorTs = i && this.readState[i] || "", this.unreadBoundaryTs = i ? (/* @__PURE__ */ new Date()).toISOString() : "";
|
|
4498
|
-
} else e || (this.unreadAnchorTs = "", this.unreadBoundaryTs = "");
|
|
4494
|
+
e && !t ? (this.unreadAnchorId = X((n = this.currentConv) == null ? void 0 : n.last_read_message_id), this.unreadBoundaryTs = (/* @__PURE__ */ new Date()).toISOString()) : e || (this.unreadAnchorId = null, this.unreadBoundaryTs = "");
|
|
4499
4495
|
},
|
|
4500
4496
|
// Fresh `pendingApproval` arrival : kick off the settle debounce so
|
|
4501
4497
|
// the card waits for the conversation to go quiet. Historical
|
|
@@ -4545,11 +4541,11 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4545
4541
|
}
|
|
4546
4542
|
},
|
|
4547
4543
|
async mounted() {
|
|
4548
|
-
if (typeof document < "u" && !document.getElementById(
|
|
4544
|
+
if (typeof document < "u" && !document.getElementById(be)) {
|
|
4549
4545
|
const e = document.createElement("style");
|
|
4550
|
-
e.id =
|
|
4546
|
+
e.id = be, e.textContent = qe, document.head.appendChild(e);
|
|
4551
4547
|
}
|
|
4552
|
-
|
|
4548
|
+
await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
4553
4549
|
},
|
|
4554
4550
|
beforeUnmount() {
|
|
4555
4551
|
this.cancelReveals(), this.disconnectFloatRO(), this.resetApprovalPacing(), this.teardownNotifications(), this.store && this.store.destroy();
|
|
@@ -4562,12 +4558,12 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4562
4558
|
return;
|
|
4563
4559
|
}
|
|
4564
4560
|
try {
|
|
4565
|
-
this.transport = fe(
|
|
4561
|
+
this.transport = fe(je({
|
|
4566
4562
|
baseUrl: this.baseUrl,
|
|
4567
4563
|
widgetId: this.widgetId,
|
|
4568
4564
|
userId: this.userId,
|
|
4569
4565
|
userHash: this.userHash
|
|
4570
|
-
})), this.store = fe(
|
|
4566
|
+
})), this.store = fe(He(this.transport)), this.hydrateNotifPref(), this.setupNotifications(), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer);
|
|
4571
4567
|
} catch (e) {
|
|
4572
4568
|
console.error("[ww-messenger] bootstrap failed", e), this.bootError = (e == null ? void 0 : e.message) || String(e);
|
|
4573
4569
|
}
|
|
@@ -4592,8 +4588,8 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4592
4588
|
if (!i) return;
|
|
4593
4589
|
const r = Math.ceil(i.contentRect.height + 8);
|
|
4594
4590
|
r !== this.floatHeight && (this.floatHeight = r, this.$nextTick(() => {
|
|
4595
|
-
var s,
|
|
4596
|
-
(
|
|
4591
|
+
var s, a;
|
|
4592
|
+
(a = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || a.call(s);
|
|
4597
4593
|
}));
|
|
4598
4594
|
}), this.floatRO.observe(t);
|
|
4599
4595
|
}
|
|
@@ -4703,7 +4699,7 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4703
4699
|
this.openRenameDialog();
|
|
4704
4700
|
break;
|
|
4705
4701
|
case "export":
|
|
4706
|
-
|
|
4702
|
+
Qe(
|
|
4707
4703
|
this.currentConv,
|
|
4708
4704
|
this.currentConv ? (n = (t = this.s) == null ? void 0 : t.messagesByConv) == null ? void 0 : n[this.currentConv.id] : []
|
|
4709
4705
|
);
|
|
@@ -4745,7 +4741,7 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4745
4741
|
if (!t && (this.startConv(), t = this.currentConv, !t) || t._draft && (t = await this.ensureRealConv(), !t))
|
|
4746
4742
|
return;
|
|
4747
4743
|
const n = t.id, i = this.pendingAttachments.slice();
|
|
4748
|
-
this.pendingAttachments = [], this.
|
|
4744
|
+
this.pendingAttachments = [], this.unreadAnchorId = null, this.unreadBoundaryTs = "", await this.store.send(n, e, { attachments: i.length ? i : void 0 });
|
|
4749
4745
|
},
|
|
4750
4746
|
async onSuggestion(e) {
|
|
4751
4747
|
const t = e == null ? void 0 : e.label;
|
|
@@ -4763,12 +4759,12 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4763
4759
|
async onFormSubmit({ values: e }) {
|
|
4764
4760
|
const t = this.pendingForm;
|
|
4765
4761
|
if (!(t != null && t.form)) return;
|
|
4766
|
-
const n =
|
|
4762
|
+
const n = Ke(t.form, e);
|
|
4767
4763
|
if (!n) return;
|
|
4768
4764
|
let i = this.currentConv;
|
|
4769
4765
|
i && (i._draft && (i = await this.ensureRealConv(), !i) || await this.store.send(i.id, n, {
|
|
4770
4766
|
metadata: {
|
|
4771
|
-
artifact:
|
|
4767
|
+
artifact: Ge(t.form, e)
|
|
4772
4768
|
}
|
|
4773
4769
|
}));
|
|
4774
4770
|
},
|
|
@@ -4812,33 +4808,33 @@ const qi = /* @__PURE__ */ L(Ri, [["render", Hi], ["__scopeId", "data-v-4f4b37c9
|
|
|
4812
4808
|
}
|
|
4813
4809
|
}
|
|
4814
4810
|
}
|
|
4815
|
-
},
|
|
4811
|
+
}, Xi = {
|
|
4816
4812
|
key: 0,
|
|
4817
4813
|
class: "wm-loading",
|
|
4818
4814
|
"aria-busy": "true",
|
|
4819
4815
|
"aria-live": "polite"
|
|
4820
|
-
},
|
|
4816
|
+
}, Ji = {
|
|
4821
4817
|
key: 0,
|
|
4822
4818
|
class: "wm-state"
|
|
4823
|
-
},
|
|
4819
|
+
}, Qi = { class: "wm-state__err" }, Zi = { class: "wm-state__errSub" }, ea = { class: "wm-bottom" }, ta = {
|
|
4824
4820
|
key: 0,
|
|
4825
4821
|
ref: "floatEl",
|
|
4826
4822
|
class: "wm-float"
|
|
4827
|
-
},
|
|
4823
|
+
}, na = {
|
|
4828
4824
|
key: 1,
|
|
4829
4825
|
class: "wm-actionWait",
|
|
4830
4826
|
role: "status",
|
|
4831
4827
|
"aria-live": "polite"
|
|
4832
|
-
},
|
|
4828
|
+
}, sa = { class: "wm-actionWait__lbl" }, ra = {
|
|
4833
4829
|
key: 2,
|
|
4834
4830
|
class: "wm-attached"
|
|
4835
|
-
},
|
|
4836
|
-
function
|
|
4837
|
-
const
|
|
4831
|
+
}, ia = ["onClick"];
|
|
4832
|
+
function aa(e, t, n, i, r, s) {
|
|
4833
|
+
const a = E("Launcher"), l = E("Header"), g = E("Onboarding"), k = E("MessageList"), C = E("ApprovalCard"), T = E("FormCard"), R = E("Feedback"), A = E("SuggestionChips"), U = E("Composer"), S = E("MoreMenu"), D = E("RenameDialog");
|
|
4838
4834
|
return d(), c("div", {
|
|
4839
|
-
class:
|
|
4835
|
+
class: x(["wm-root", `wm-root--${n.displayMode}`])
|
|
4840
4836
|
}, [
|
|
4841
|
-
!r.isOpen && !s.isEmbedded ? (d(),
|
|
4837
|
+
!r.isOpen && !s.isEmbedded ? (d(), L(a, {
|
|
4842
4838
|
key: 0,
|
|
4843
4839
|
"unread-count": s.unreadCount,
|
|
4844
4840
|
peeks: s.launcherPeeks,
|
|
@@ -4847,20 +4843,20 @@ function sa(e, t, n, i, r, s) {
|
|
|
4847
4843
|
}, null, 8, ["unread-count", "peeks", "onOpen", "onDismiss"])) : w("", !0),
|
|
4848
4844
|
r.isOpen || s.isEmbedded ? (d(), c("section", {
|
|
4849
4845
|
key: 1,
|
|
4850
|
-
class:
|
|
4851
|
-
style:
|
|
4846
|
+
class: x(["wm-panel", `wm-panel--${n.displayMode}`]),
|
|
4847
|
+
style: W(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
|
|
4852
4848
|
role: "dialog",
|
|
4853
4849
|
"aria-label": "Messenger"
|
|
4854
4850
|
}, [
|
|
4855
|
-
!s.ready && !s.error ? (d(), c("div",
|
|
4851
|
+
!s.ready && !s.error ? (d(), c("div", Xi, [
|
|
4856
4852
|
s.isEmbedded ? w("", !0) : (d(), c("button", {
|
|
4857
4853
|
key: 0,
|
|
4858
4854
|
type: "button",
|
|
4859
4855
|
class: "wm-loading__close",
|
|
4860
4856
|
"aria-label": "Réduire",
|
|
4861
|
-
onClick: t[0] || (t[0] = (...
|
|
4857
|
+
onClick: t[0] || (t[0] = (...N) => s.close && s.close(...N))
|
|
4862
4858
|
}, [...t[5] || (t[5] = [
|
|
4863
|
-
|
|
4859
|
+
o("svg", {
|
|
4864
4860
|
width: "13",
|
|
4865
4861
|
height: "13",
|
|
4866
4862
|
viewBox: "0 0 24 24",
|
|
@@ -4871,19 +4867,16 @@ function sa(e, t, n, i, r, s) {
|
|
|
4871
4867
|
"stroke-linejoin": "round",
|
|
4872
4868
|
"aria-hidden": "true"
|
|
4873
4869
|
}, [
|
|
4874
|
-
|
|
4870
|
+
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4875
4871
|
], -1)
|
|
4876
4872
|
])])),
|
|
4877
|
-
t[6] || (t[6] =
|
|
4873
|
+
t[6] || (t[6] = o("div", {
|
|
4878
4874
|
class: "wm-loading__spinner",
|
|
4879
4875
|
"aria-hidden": "true"
|
|
4880
4876
|
}, null, -1))
|
|
4881
|
-
])) : (d(), c(
|
|
4882
|
-
|
|
4877
|
+
])) : (d(), c(B, { key: 1 }, [
|
|
4878
|
+
V(l, {
|
|
4883
4879
|
title: s.headerTitle,
|
|
4884
|
-
escalated: s.isEscalated,
|
|
4885
|
-
"agent-name": s.humanAgentName,
|
|
4886
|
-
"agent-avatar-url": s.humanAgentAvatarUrl,
|
|
4887
4880
|
"team-members": s.teamMembers,
|
|
4888
4881
|
"response-label": s.responseLabel,
|
|
4889
4882
|
"show-identity": !!s.currentConv,
|
|
@@ -4893,11 +4886,11 @@ function sa(e, t, n, i, r, s) {
|
|
|
4893
4886
|
onBack: s.goHome,
|
|
4894
4887
|
onMore: s.toggleMore,
|
|
4895
4888
|
onClose: s.close
|
|
4896
|
-
}, null, 8, ["title", "
|
|
4897
|
-
s.error ? (d(), c("div",
|
|
4898
|
-
|
|
4899
|
-
t[8] || (t[8] =
|
|
4900
|
-
|
|
4889
|
+
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
|
|
4890
|
+
s.error ? (d(), c("div", Ji, [
|
|
4891
|
+
o("div", Qi, [
|
|
4892
|
+
t[8] || (t[8] = o("div", { class: "wm-state__errIcon" }, [
|
|
4893
|
+
o("svg", {
|
|
4901
4894
|
width: "14",
|
|
4902
4895
|
height: "14",
|
|
4903
4896
|
viewBox: "0 0 24 24",
|
|
@@ -4908,16 +4901,16 @@ function sa(e, t, n, i, r, s) {
|
|
|
4908
4901
|
"stroke-linejoin": "round",
|
|
4909
4902
|
"aria-hidden": "true"
|
|
4910
4903
|
}, [
|
|
4911
|
-
|
|
4904
|
+
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4912
4905
|
])
|
|
4913
4906
|
], -1)),
|
|
4914
|
-
|
|
4915
|
-
t[7] || (t[7] =
|
|
4916
|
-
|
|
4907
|
+
o("div", null, [
|
|
4908
|
+
t[7] || (t[7] = o("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
|
|
4909
|
+
o("div", Zi, b(s.error), 1)
|
|
4917
4910
|
])
|
|
4918
4911
|
])
|
|
4919
|
-
])) : s.currentConv ? (d(), c(
|
|
4920
|
-
|
|
4912
|
+
])) : s.currentConv ? (d(), c(B, { key: 2 }, [
|
|
4913
|
+
V(k, {
|
|
4921
4914
|
ref: "messageList",
|
|
4922
4915
|
messages: s.displayedMessages,
|
|
4923
4916
|
"streaming-active": s.streamingActive,
|
|
@@ -4925,44 +4918,44 @@ function sa(e, t, n, i, r, s) {
|
|
|
4925
4918
|
"conversation-id": s.currentConv ? s.currentConv.id : null,
|
|
4926
4919
|
"loading-more": s.paginationState.loading,
|
|
4927
4920
|
"has-more": s.paginationState.hasMore,
|
|
4928
|
-
"unread-anchor-
|
|
4921
|
+
"unread-anchor-id": e.unreadAnchorId,
|
|
4929
4922
|
"unread-boundary-ts": e.unreadBoundaryTs,
|
|
4930
4923
|
onLoadMore: s.onLoadMore
|
|
4931
|
-
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-
|
|
4932
|
-
|
|
4933
|
-
s.floatVisible ? (d(), c("div",
|
|
4934
|
-
s.approvalReady ? (d(),
|
|
4924
|
+
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "onLoadMore"]),
|
|
4925
|
+
o("div", ea, [
|
|
4926
|
+
s.floatVisible ? (d(), c("div", ta, [
|
|
4927
|
+
s.approvalReady ? (d(), L(C, {
|
|
4935
4928
|
key: 0,
|
|
4936
4929
|
action: s.approvalTitle,
|
|
4937
4930
|
detail: s.approvalDetail,
|
|
4938
4931
|
callbacks: s.pendingApproval.callbacks,
|
|
4939
4932
|
onCallback: s.onApprovalCallback
|
|
4940
|
-
}, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (d(),
|
|
4933
|
+
}, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (d(), L(T, {
|
|
4941
4934
|
key: s.pendingForm.message && s.pendingForm.message.id,
|
|
4942
4935
|
form: s.pendingForm.form,
|
|
4943
4936
|
onSubmit: s.onFormSubmit
|
|
4944
|
-
}, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (d(),
|
|
4937
|
+
}, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (d(), L(R, {
|
|
4945
4938
|
key: 2,
|
|
4946
4939
|
busy: r.feedbackBusy,
|
|
4947
4940
|
done: r.feedbackDone,
|
|
4948
4941
|
onSubmit: s.onFeedback
|
|
4949
|
-
}, null, 8, ["busy", "done", "onSubmit"])) : (d(),
|
|
4942
|
+
}, null, 8, ["busy", "done", "onSubmit"])) : (d(), L(A, {
|
|
4950
4943
|
key: 3,
|
|
4951
4944
|
items: s.suggestions,
|
|
4952
4945
|
onSelect: s.onSuggestion
|
|
4953
4946
|
}, null, 8, ["items", "onSelect"]))
|
|
4954
4947
|
], 512)) : w("", !0),
|
|
4955
|
-
s.actionInFlight ? (d(), c("div",
|
|
4956
|
-
t[9] || (t[9] =
|
|
4948
|
+
s.actionInFlight ? (d(), c("div", na, [
|
|
4949
|
+
t[9] || (t[9] = o("span", {
|
|
4957
4950
|
class: "wm-actionWait__spinner",
|
|
4958
4951
|
"aria-hidden": "true"
|
|
4959
4952
|
}, null, -1)),
|
|
4960
|
-
|
|
4961
|
-
])) : (d(),
|
|
4953
|
+
o("span", sa, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
|
|
4954
|
+
])) : (d(), L(U, {
|
|
4962
4955
|
key: 2,
|
|
4963
4956
|
ref: "composer",
|
|
4964
4957
|
modelValue: r.draft,
|
|
4965
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
4958
|
+
"onUpdate:modelValue": t[1] || (t[1] = (N) => r.draft = N),
|
|
4966
4959
|
placeholder: s.composerPlaceholder,
|
|
4967
4960
|
disabled: !!s.pendingApproval,
|
|
4968
4961
|
"attach-label": "Joindre un fichier",
|
|
@@ -4970,7 +4963,7 @@ function sa(e, t, n, i, r, s) {
|
|
|
4970
4963
|
onAttach: s.onAttach
|
|
4971
4964
|
}, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
|
|
4972
4965
|
]),
|
|
4973
|
-
r.moreOpen ? (d(),
|
|
4966
|
+
r.moreOpen ? (d(), L(S, {
|
|
4974
4967
|
key: 0,
|
|
4975
4968
|
"can-rename": !!s.currentConv && !s.currentConv._draft,
|
|
4976
4969
|
"can-export": !!s.currentConv && !s.currentConv._draft,
|
|
@@ -4978,24 +4971,24 @@ function sa(e, t, n, i, r, s) {
|
|
|
4978
4971
|
"browser-notif-enabled": e.browserNotifEnabled,
|
|
4979
4972
|
"status-url": s.statusUrl,
|
|
4980
4973
|
"help-url": s.helpUrl,
|
|
4981
|
-
onClose: t[2] || (t[2] = (
|
|
4974
|
+
onClose: t[2] || (t[2] = (N) => r.moreOpen = !1),
|
|
4982
4975
|
onSoundToggle: e.onSoundToggle,
|
|
4983
4976
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
4984
4977
|
onAction: s.onMoreAction
|
|
4985
4978
|
}, null, 8, ["can-rename", "can-export", "sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : w("", !0),
|
|
4986
|
-
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (d(),
|
|
4979
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (d(), L(D, {
|
|
4987
4980
|
key: 1,
|
|
4988
4981
|
"initial-value": s.currentConv.name || "",
|
|
4989
4982
|
title: "Modifier le titre de la conversation",
|
|
4990
|
-
onClose: t[3] || (t[3] = (
|
|
4983
|
+
onClose: t[3] || (t[3] = (N) => r.renameDialogOpen = !1),
|
|
4991
4984
|
onSubmit: s.onRenameSubmit
|
|
4992
4985
|
}, null, 8, ["initial-value", "onSubmit"])) : w("", !0),
|
|
4993
|
-
r.pendingAttachments.length ? (d(), c("div",
|
|
4994
|
-
(d(!0), c(
|
|
4995
|
-
key:
|
|
4986
|
+
r.pendingAttachments.length ? (d(), c("div", ra, [
|
|
4987
|
+
(d(!0), c(B, null, F(r.pendingAttachments, (N, j) => (d(), c("div", {
|
|
4988
|
+
key: j,
|
|
4996
4989
|
class: "wm-attached__chip"
|
|
4997
4990
|
}, [
|
|
4998
|
-
t[11] || (t[11] =
|
|
4991
|
+
t[11] || (t[11] = o("svg", {
|
|
4999
4992
|
width: "11",
|
|
5000
4993
|
height: "11",
|
|
5001
4994
|
viewBox: "0 0 24 24",
|
|
@@ -5006,15 +4999,15 @@ function sa(e, t, n, i, r, s) {
|
|
|
5006
4999
|
"stroke-linejoin": "round",
|
|
5007
5000
|
"aria-hidden": "true"
|
|
5008
5001
|
}, [
|
|
5009
|
-
|
|
5002
|
+
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" })
|
|
5010
5003
|
], -1)),
|
|
5011
|
-
|
|
5012
|
-
|
|
5004
|
+
o("span", null, b(N.name), 1),
|
|
5005
|
+
o("button", {
|
|
5013
5006
|
type: "button",
|
|
5014
5007
|
"aria-label": "Retirer",
|
|
5015
|
-
onClick: (
|
|
5008
|
+
onClick: (K) => r.pendingAttachments.splice(j, 1)
|
|
5016
5009
|
}, [...t[10] || (t[10] = [
|
|
5017
|
-
|
|
5010
|
+
o("svg", {
|
|
5018
5011
|
width: "10",
|
|
5019
5012
|
height: "10",
|
|
5020
5013
|
viewBox: "0 0 24 24",
|
|
@@ -5025,12 +5018,12 @@ function sa(e, t, n, i, r, s) {
|
|
|
5025
5018
|
"stroke-linejoin": "round",
|
|
5026
5019
|
"aria-hidden": "true"
|
|
5027
5020
|
}, [
|
|
5028
|
-
|
|
5021
|
+
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5029
5022
|
], -1)
|
|
5030
|
-
])], 8,
|
|
5023
|
+
])], 8, ia)
|
|
5031
5024
|
]))), 128))
|
|
5032
5025
|
])) : w("", !0)
|
|
5033
|
-
], 64)) : (d(),
|
|
5026
|
+
], 64)) : (d(), L(g, {
|
|
5034
5027
|
key: 1,
|
|
5035
5028
|
"welcome-message": s.widgetWelcomeMessage,
|
|
5036
5029
|
"agent-name": s.agentName,
|
|
@@ -5041,7 +5034,7 @@ function sa(e, t, n, i, r, s) {
|
|
|
5041
5034
|
onSelect: s.onQuickLink,
|
|
5042
5035
|
onResume: s.onDrawerPick
|
|
5043
5036
|
}, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
5044
|
-
r.moreOpen && !s.currentConv ? (d(),
|
|
5037
|
+
r.moreOpen && !s.currentConv ? (d(), L(S, {
|
|
5045
5038
|
key: 3,
|
|
5046
5039
|
"can-rename": !1,
|
|
5047
5040
|
"can-export": !1,
|
|
@@ -5049,7 +5042,7 @@ function sa(e, t, n, i, r, s) {
|
|
|
5049
5042
|
"browser-notif-enabled": e.browserNotifEnabled,
|
|
5050
5043
|
"status-url": s.statusUrl,
|
|
5051
5044
|
"help-url": s.helpUrl,
|
|
5052
|
-
onClose: t[4] || (t[4] = (
|
|
5045
|
+
onClose: t[4] || (t[4] = (N) => r.moreOpen = !1),
|
|
5053
5046
|
onSoundToggle: e.onSoundToggle,
|
|
5054
5047
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
5055
5048
|
onAction: s.onMoreAction
|
|
@@ -5058,48 +5051,48 @@ function sa(e, t, n, i, r, s) {
|
|
|
5058
5051
|
], 6)) : w("", !0)
|
|
5059
5052
|
], 2);
|
|
5060
5053
|
}
|
|
5061
|
-
const
|
|
5054
|
+
const da = /* @__PURE__ */ $(Yi, [["render", aa], ["__scopeId", "data-v-4500d0e5"]]), ca = "0.3.11";
|
|
5062
5055
|
export {
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5056
|
+
ne as AIAvatar,
|
|
5057
|
+
ue as AVATAR_COLORS,
|
|
5058
|
+
Rn as ActionResult,
|
|
5059
|
+
qr as ApprovalCard,
|
|
5060
|
+
zn as ArtifactFormResponse,
|
|
5061
|
+
ns as ArtifactInfoCard,
|
|
5062
|
+
bs as ArtifactRenderer,
|
|
5063
|
+
gs as ArtifactTicket,
|
|
5064
|
+
$s as AttachmentPreview,
|
|
5065
|
+
js as Bubble,
|
|
5066
|
+
Br as Composer,
|
|
5067
|
+
We as DEFAULT_BASE_URL,
|
|
5068
|
+
Ti as Feedback,
|
|
5069
|
+
vi as FormCard,
|
|
5070
|
+
Gt as Header,
|
|
5071
|
+
xe as HumanAvatar,
|
|
5072
|
+
Mt as Launcher,
|
|
5080
5073
|
me as MEDIA_RECORDER_SUPPORTED,
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5074
|
+
ur as MessageList,
|
|
5075
|
+
da as Messenger,
|
|
5076
|
+
Fi as MoreMenu,
|
|
5077
|
+
Cn as Onboarding,
|
|
5078
|
+
de as SCREEN_CAPTURE_SUPPORTED,
|
|
5079
|
+
Rr as SuggestionChips,
|
|
5080
|
+
Pt as TeamAvatars,
|
|
5081
|
+
Hs as Typing,
|
|
5082
|
+
ca as VERSION,
|
|
5083
|
+
ke as avatarColor,
|
|
5084
|
+
Ce as avatarInitials,
|
|
5085
|
+
mr as captureScreenshotFile,
|
|
5086
|
+
P as colors,
|
|
5087
|
+
He as createStore,
|
|
5088
|
+
je as createTransport,
|
|
5089
|
+
da as default,
|
|
5090
|
+
Ae as formatTime,
|
|
5091
|
+
la as guessAttachmentKind,
|
|
5092
|
+
hr as pickRecorderMime,
|
|
5093
|
+
Ns as renderMarkdown,
|
|
5094
|
+
_r as startScreenRecording,
|
|
5095
|
+
qe as tokensCss,
|
|
5096
|
+
ze as uuid,
|
|
5097
|
+
ze as v4
|
|
5105
5098
|
};
|