@_solaris/messenger-widget 0.3.9 → 0.3.10

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