@_solaris/messenger-widget 0.2.0 → 0.2.2

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 xe, openBlock as l, createElementBlock as c, createVNode as H, Transition as Me, withCtx as Te, withKeys as me, withModifiers as Y, createElementVNode as i, toDisplayString as b, createCommentVNode as g, normalizeStyle as P, normalizeClass as E, Fragment as O, renderList as F, resolveComponent as I, createBlock as $, createTextVNode as se, resolveDynamicComponent as Ie, renderSlot as Oe, withDirectives as V, vModelText as G, vModelCheckbox as Ee, vModelSelect as Be, createStaticVNode as ue, markRaw as fe } from "vue";
2
- const Le = [
1
+ import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as P, Transition as xe, withCtx as Me, withKeys as me, withModifiers as Y, createElementVNode as i, toDisplayString as b, createCommentVNode as y, normalizeStyle as V, normalizeClass as E, Fragment as M, renderList as F, resolveComponent as I, createBlock as $, createTextVNode as se, resolveDynamicComponent as Te, renderSlot as Oe, withDirectives as z, vModelText as G, vModelCheckbox as Ie, vModelSelect as Ee, createStaticVNode as ue, markRaw as fe } from "vue";
2
+ const Be = [
3
3
  "connected",
4
4
  "message",
5
5
  "message_stream",
6
6
  "conversation_updated",
7
7
  "config_updated",
8
8
  "action_status"
9
- ], Re = 5 * 60 * 1e3, $e = 10 * 60 * 1e3, Fe = 5 * 60 * 1e3;
10
- function je(t) {
9
+ ], Le = 5 * 60 * 1e3, Re = 10 * 60 * 1e3, $e = 5 * 60 * 1e3;
10
+ function Fe(t) {
11
11
  const e = {
12
- baseUrl: Ue(t.baseUrl || ""),
12
+ baseUrl: je(t.baseUrl || ""),
13
13
  widgetId: t.widgetId || "",
14
14
  userId: t.userId || "",
15
15
  userHash: t.userHash || "",
@@ -39,8 +39,8 @@ function je(t) {
39
39
  p && p.forEach((k) => {
40
40
  try {
41
41
  k(f);
42
- } catch (T) {
43
- console.error("[transport] listener", h, T);
42
+ } catch (O) {
43
+ console.error("[transport] listener", h, O);
44
44
  }
45
45
  });
46
46
  }
@@ -61,10 +61,10 @@ function je(t) {
61
61
  body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
63
  if (!k.ok) {
64
- const T = await d(k), M = new Error(
65
- `HTTP ${k.status} ${h} ${f} :: ${(T == null ? void 0 : T.error) || k.statusText}`
64
+ const O = await d(k), T = new Error(
65
+ `HTTP ${k.status} ${h} ${f} :: ${(O == null ? void 0 : O.error) || k.statusText}`
66
66
  );
67
- throw M.status = k.status, M.body = T, M;
67
+ throw T.status = k.status, T.body = O, T;
68
68
  }
69
69
  return k.status === 204 ? null : k.json();
70
70
  }
@@ -148,27 +148,27 @@ function je(t) {
148
148
  p ? { inputs: p } : {}
149
149
  );
150
150
  }
151
- async function z(h) {
151
+ async function H(h) {
152
152
  const f = (
153
153
  /** @type {File} */
154
154
  h.name || "attachment"
155
- ), p = h.type || "application/octet-stream", k = h.size || 0, T = (
155
+ ), p = h.type || "application/octet-stream", k = h.size || 0, O = (
156
156
  /** @type {import('./types.js').AttachmentUploadTicket} */
157
157
  await o("POST", "/attachments", {
158
158
  mime_type: p,
159
159
  size_bytes: k,
160
160
  name: f
161
161
  })
162
- ), M = await fetch(T.upload_url, {
162
+ ), T = await fetch(O.upload_url, {
163
163
  method: "PUT",
164
164
  headers: { "Content-Type": p },
165
165
  body: h
166
166
  });
167
- if (!M.ok)
168
- throw new Error(`HTTP ${M.status} PUT signed upload`);
167
+ if (!T.ok)
168
+ throw new Error(`HTTP ${T.status} PUT signed upload`);
169
169
  return {
170
- type: De(p),
171
- path: T.path,
170
+ type: Ue(p),
171
+ path: O.path,
172
172
  mime_type: p,
173
173
  size_bytes: k
174
174
  };
@@ -191,7 +191,7 @@ function je(t) {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
193
  const h = new EventSource(re());
194
- for (const f of Le)
194
+ for (const f of Be)
195
195
  h.addEventListener(f, (p) => ie(f, p.data));
196
196
  h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
197
197
  } catch (h) {
@@ -212,16 +212,16 @@ function je(t) {
212
212
  function W() {
213
213
  clearTimeout(e.burstTimer), q(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
214
  e.panelOpen || K();
215
- }, $e));
215
+ }, Re));
216
216
  }
217
217
  function ae(h) {
218
218
  e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), q()) : W();
219
219
  }
220
220
  async function oe() {
221
221
  try {
222
- const h = await S(), f = h.reduce((k, T) => {
223
- const M = T == null ? void 0 : T.last_message_at;
224
- return M && (!k || M > k) ? M : k;
222
+ const h = await S(), f = h.reduce((k, O) => {
223
+ const T = O == null ? void 0 : O.last_message_at;
224
+ return T && (!k || T > k) ? T : k;
225
225
  }, null);
226
226
  f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), W());
227
227
  } catch (h) {
@@ -229,7 +229,7 @@ function je(t) {
229
229
  }
230
230
  }
231
231
  function Q() {
232
- u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(oe, Re));
232
+ u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(oe, Le));
233
233
  }
234
234
  function u() {
235
235
  e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
@@ -238,7 +238,7 @@ function je(t) {
238
238
  if (document.hidden)
239
239
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
240
240
  e.hiddenGraceTimer = null, document.hidden && (u(), K(), r("paused"));
241
- }, Fe);
241
+ }, $e);
242
242
  else {
243
243
  if (e.hiddenGraceTimer) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
@@ -255,21 +255,21 @@ function je(t) {
255
255
  try {
256
256
  const f = await S();
257
257
  e.lastActivityAt = f.reduce((p, k) => {
258
- const T = k == null ? void 0 : k.last_message_at;
259
- return T && (!p || T > p) ? T : p;
258
+ const O = k == null ? void 0 : k.last_message_at;
259
+ return O && (!p || O > p) ? O : p;
260
260
  }, null);
261
261
  } catch (f) {
262
262
  console.error("[transport] initial /conversations failed", f);
263
263
  }
264
264
  return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), Q(), h;
265
265
  }
266
- function y() {
266
+ function g() {
267
267
  u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, K(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
268
268
  }
269
269
  return {
270
270
  on: n,
271
271
  start: _,
272
- stop: y,
272
+ stop: g,
273
273
  setPanelOpen: ae,
274
274
  // REST
275
275
  bootstrap: v,
@@ -282,7 +282,7 @@ function je(t) {
282
282
  listMessages: x,
283
283
  postMessage: N,
284
284
  postCallback: j,
285
- uploadAttachment: z,
285
+ uploadAttachment: H,
286
286
  signAttachment: X,
287
287
  // Read-only state
288
288
  get connection() {
@@ -290,13 +290,13 @@ function je(t) {
290
290
  }
291
291
  };
292
292
  }
293
- function Ue(t) {
293
+ function je(t) {
294
294
  return t.endsWith("/") ? t.slice(0, -1) : t;
295
295
  }
296
- function De(t) {
296
+ function Ue(t) {
297
297
  return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
298
298
  }
299
- function Ne() {
299
+ function De() {
300
300
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
301
301
  return crypto.randomUUID();
302
302
  const t = new Uint8Array(16);
@@ -308,8 +308,8 @@ function Ne() {
308
308
  const e = [...t].map((n) => n.toString(16).padStart(2, "0"));
309
309
  return e.slice(0, 4).join("") + "-" + e.slice(4, 6).join("") + "-" + e.slice(6, 8).join("") + "-" + e.slice(8, 10).join("") + "-" + e.slice(10, 16).join("");
310
310
  }
311
- function Pe(t) {
312
- const e = xe({
311
+ function Ne(t) {
312
+ const e = Se({
313
313
  ready: !1,
314
314
  error: null,
315
315
  config: null,
@@ -351,22 +351,22 @@ function Pe(t) {
351
351
  })), n.push(t.on("conversation_updated", (u) => {
352
352
  const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
353
353
  if (!m || !_) return;
354
- const y = e.conversations.findIndex((h) => h.id === m);
355
- y !== -1 && (e.conversations[y] = { ...e.conversations[y], ..._ });
354
+ const g = e.conversations.findIndex((h) => h.id === m);
355
+ g !== -1 && (e.conversations[g] = { ...e.conversations[g], ..._ });
356
356
  })), n.push(t.on("config_updated", (u) => {
357
357
  u != null && u.config && (e.config = u.config);
358
358
  })), n.push(t.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;
359
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, g = u == null ? void 0 : u.action_name;
360
360
  if (!m || !_) return;
361
361
  const h = e.runningActionsByConv[m] || {};
362
- u.state === "running" ? (h[_] = y || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
362
+ u.state === "running" ? (h[_] = g || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
363
363
  })), n.push(t.on("activity", (u) => {
364
364
  Array.isArray(u == null ? void 0 : u.conversations) && (e.conversations = u.conversations);
365
365
  }));
366
366
  async function a() {
367
367
  try {
368
368
  const u = new Promise(
369
- (_, y) => setTimeout(() => y(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
369
+ (_, g) => setTimeout(() => g(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
370
370
  ), m = await Promise.race([t.start(), u]);
371
371
  e.config = m.config, e.customer = m.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
372
372
  } catch (u) {
@@ -393,7 +393,7 @@ function Pe(t) {
393
393
  return e.customer;
394
394
  }
395
395
  async function o(u = {}) {
396
- const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.id === m.id);
396
+ const m = await t.createConversation(u), _ = e.conversations.findIndex((g) => g.id === m.id);
397
397
  return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
398
398
  }
399
399
  const d = 50;
@@ -419,8 +419,8 @@ function Pe(t) {
419
419
  }), Z = (R == null ? void 0 : R.messages) ?? [];
420
420
  if (f = [...Z, ...f], h = (R == null ? void 0 : R.next_cursor) ?? null, !Z.length || f.length >= 60) break;
421
421
  }
422
- const k = e.messagesByConv[u] || [], T = new Set(k.map((R) => String(R == null ? void 0 : R.id))), M = [...f.filter((R) => !T.has(String(R == null ? void 0 : R.id))), ...k];
423
- e.messagesByConv[u] = M, w(u, {
422
+ const k = e.messagesByConv[u] || [], O = new Set(k.map((R) => String(R == null ? void 0 : R.id))), T = [...f.filter((R) => !O.has(String(R == null ? void 0 : R.id))), ...k];
423
+ e.messagesByConv[u] = T, w(u, {
424
424
  nextCursor: h,
425
425
  loading: !1,
426
426
  loaded: !0
@@ -434,14 +434,14 @@ function Pe(t) {
434
434
  e.paginationByConv = { ...e.paginationByConv, [u]: m };
435
435
  }
436
436
  async function S(u, m) {
437
- const _ = await t.patchConversation(u, m), y = e.conversations.findIndex((h) => h.id === u);
438
- y !== -1 && (e.conversations[y] = _);
437
+ const _ = await t.patchConversation(u, m), g = e.conversations.findIndex((h) => h.id === u);
438
+ g !== -1 && (e.conversations[g] = _);
439
439
  }
440
- async function L(u, m, { attachments: _, metadata: y } = {}) {
441
- var M;
440
+ async function L(u, m, { attachments: _, metadata: g } = {}) {
441
+ var T;
442
442
  const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
443
443
  if (!u || !h && !f) return;
444
- const p = Ne(), k = Q(u), T = {
444
+ const p = De(), k = Q(u), O = {
445
445
  id: p,
446
446
  client_msg_id: p,
447
447
  conversation_id: u,
@@ -449,22 +449,22 @@ function Pe(t) {
449
449
  text_md: h,
450
450
  author: {
451
451
  type: "user",
452
- id: ((M = e.customer) == null ? void 0 : M.external_id) || null
452
+ id: ((T = e.customer) == null ? void 0 : T.external_id) || null
453
453
  },
454
454
  created_at: k,
455
455
  // Local-only flag — UI may render dimmed until the SSE echo lands.
456
456
  _pending: !0,
457
457
  ...f ? { payload: { type: "content", attachments: _ } } : {},
458
- ...y && typeof y == "object" ? { metadata: y } : {}
458
+ ...g && typeof g == "object" ? { metadata: g } : {}
459
459
  };
460
- q(u, T);
460
+ q(u, O);
461
461
  try {
462
462
  await t.postMessage(u, {
463
463
  client_msg_id: p,
464
464
  text_md: h,
465
465
  created_at: k,
466
466
  ...f ? { attachments: _ } : {},
467
- ...y && typeof y == "object" ? { metadata: y } : {}
467
+ ...g && typeof g == "object" ? { metadata: g } : {}
468
468
  });
469
469
  } catch (R) {
470
470
  console.error("[store] send failed", R), K(u, p, { _failed: !0, _pending: !1 });
@@ -474,8 +474,8 @@ function Pe(t) {
474
474
  u != null && (e.awaitingCallback[u] = !0);
475
475
  try {
476
476
  await t.postCallback(u, m, _);
477
- } catch (y) {
478
- console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
477
+ } catch (g) {
478
+ console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
479
479
  }
480
480
  }
481
481
  const D = /* @__PURE__ */ new Map();
@@ -496,8 +496,8 @@ function Pe(t) {
496
496
  return null;
497
497
  }
498
498
  async function N(u, { rating: m, comment: _ } = {}) {
499
- const y = e.conversations.find((p) => p.id === u), f = {
500
- ...(y == null ? void 0 : y.metadata) || {},
499
+ const g = e.conversations.find((p) => p.id === u), f = {
500
+ ...(g == null ? void 0 : g.metadata) || {},
501
501
  feedback: {
502
502
  rating: m,
503
503
  comment: _ || null,
@@ -507,21 +507,21 @@ function Pe(t) {
507
507
  await S(u, { metadata: f });
508
508
  }
509
509
  function j(u) {
510
- var _, y;
510
+ var _, g;
511
511
  const m = e.messagesByConv[u] || [];
512
512
  for (let h = m.length - 1; h >= 0; h--) {
513
513
  const f = m[h];
514
- 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 && !e.awaitingCallback[f.id])
514
+ if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((g = f == null ? void 0 : f.payload) == null ? void 0 : g.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
515
515
  return f;
516
516
  }
517
517
  return null;
518
518
  }
519
- function z(u) {
520
- var _, y, h;
519
+ function H(u) {
520
+ var _, g, h;
521
521
  const m = e.messagesByConv[u] || [];
522
522
  for (let f = m.length - 1; f >= 0; f--) {
523
523
  const p = m[f];
524
- 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;
524
+ if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((g = p == null ? void 0 : p.payload) == null ? void 0 : g.state) === "pending") return null;
525
525
  const k = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
526
526
  if (k && Array.isArray(k.fields) && k.fields.length > 0)
527
527
  return { message: p, form: k };
@@ -533,27 +533,27 @@ function Pe(t) {
533
533
  if (!m) return null;
534
534
  const _ = Object.keys(m);
535
535
  if (_.length === 0) return null;
536
- const y = _[0];
537
- return { id: y, payload: { name: m[y] } };
536
+ const g = _[0];
537
+ return { id: g, payload: { name: m[g] } };
538
538
  }
539
539
  function re(u) {
540
- var _, y, h, f;
540
+ var _, g, h, f;
541
541
  const m = e.messagesByConv[u] || [];
542
542
  for (let p = m.length - 1; p >= 0; p--) {
543
543
  const k = m[p];
544
544
  if (((_ = k == null ? void 0 : k.author) == null ? void 0 : _.type) === "user") return [];
545
- if ((k == null ? void 0 : k.type) === "action" && ((y = k == null ? void 0 : k.payload) == null ? void 0 : y.state) === "pending") return [];
545
+ if ((k == null ? void 0 : k.type) === "action" && ((g = k == null ? void 0 : k.payload) == null ? void 0 : g.state) === "pending") return [];
546
546
  if (((h = k == null ? void 0 : k.author) == null ? void 0 : h.type) !== "agent_ia") continue;
547
- const T = (f = k == null ? void 0 : k.metadata) == null ? void 0 : f.suggested_replies;
548
- return Array.isArray(T) && T.length ? T.map((M) => {
549
- if (typeof M == "string") {
550
- const R = M.trim();
547
+ const O = (f = k == null ? void 0 : k.metadata) == null ? void 0 : f.suggested_replies;
548
+ return Array.isArray(O) && O.length ? O.map((T) => {
549
+ if (typeof T == "string") {
550
+ const R = T.trim();
551
551
  return R ? { label: R, kind: null } : null;
552
552
  }
553
- if (M && typeof M == "object" && typeof M.label == "string") {
554
- const R = M.label.trim();
553
+ if (T && typeof T == "object" && typeof T.label == "string") {
554
+ const R = T.label.trim();
555
555
  if (!R) return null;
556
- const Z = M.kind === "cta" || M.kind === "choice" || M.kind === "followup" ? M.kind : null;
556
+ const Z = T.kind === "cta" || T.kind === "choice" || T.kind === "followup" ? T.kind : null;
557
557
  return { label: R, kind: Z };
558
558
  }
559
559
  return null;
@@ -564,31 +564,31 @@ function Pe(t) {
564
564
  function q(u, m) {
565
565
  var f;
566
566
  const _ = e.messagesByConv[u] || [];
567
- let y = -1;
568
- m != null && m.client_msg_id && (y = _.findIndex(
567
+ let g = -1;
568
+ m != null && m.client_msg_id && (g = _.findIndex(
569
569
  (p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
570
- )), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => ie(p == null ? void 0 : p.id, m.id)));
570
+ )), g === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (g = _.findIndex((p) => ie(p == null ? void 0 : p.id, m.id)));
571
571
  let h;
572
- y === -1 ? h = [..._, m].sort(ae) : (h = _.slice(), h[y] = { ..._[y], ...m, _pending: !1, _failed: !1 }), e.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 && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
572
+ g === -1 ? h = [..._, m].sort(ae) : (h = _.slice(), h[g] = { ..._[g], ...m, _pending: !1, _failed: !1 }), e.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 && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
573
573
  }
574
574
  function ie(u, m) {
575
575
  return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
576
576
  }
577
577
  function K(u, m, _) {
578
- const y = e.messagesByConv[u];
579
- if (!y) return;
580
- const h = y.findIndex((p) => p.id === m);
578
+ const g = e.messagesByConv[u];
579
+ if (!g) return;
580
+ const h = g.findIndex((p) => p.id === m);
581
581
  if (h === -1) return;
582
- const f = y.slice();
583
- f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
582
+ const f = g.slice();
583
+ f[h] = { ...g[h], ..._ }, e.messagesByConv[u] = f;
584
584
  }
585
585
  function W(u, m) {
586
586
  const _ = e.conversations.findIndex((h) => h.id === u);
587
587
  if (_ === -1) return;
588
- const y = e.conversations[_];
589
- if (m && (!y.last_message_at || m > y.last_message_at)) {
588
+ const g = e.conversations[_];
589
+ if (m && (!g.last_message_at || m > g.last_message_at)) {
590
590
  const h = e.conversations.slice();
591
- h[_] = { ...y, last_message_at: m }, h.sort(
591
+ h[_] = { ...g, last_message_at: m }, h.sort(
592
592
  (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
593
593
  ), e.conversations = h;
594
594
  }
@@ -599,8 +599,8 @@ function Pe(t) {
599
599
  function oe(u) {
600
600
  if (!u || typeof u != "object") return null;
601
601
  const m = {}, _ = {};
602
- for (const [y, h] of Object.entries(u))
603
- 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);
602
+ for (const [g, h] of Object.entries(u))
603
+ h !== void 0 && (g === "name" || g === "email" ? h != null && String(h).trim() !== "" && (m[g] = h) : (g === "values" || g === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[g] = h);
604
604
  return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
605
605
  }
606
606
  function Q(u) {
@@ -608,8 +608,8 @@ function Pe(t) {
608
608
  let _ = "";
609
609
  for (const f of m)
610
610
  f != null && f.created_at && f.created_at > _ && (_ = f.created_at);
611
- const y = (/* @__PURE__ */ new Date()).toISOString();
612
- return !_ || y > _ ? y : new Date(Date.parse(_) + 1).toISOString();
611
+ const g = (/* @__PURE__ */ new Date()).toISOString();
612
+ return !_ || g > _ ? g : new Date(Date.parse(_) + 1).toISOString();
613
613
  }
614
614
  return {
615
615
  state: e,
@@ -627,7 +627,7 @@ function Pe(t) {
627
627
  getPendingApproval: j,
628
628
  getActionInFlight: X,
629
629
  getLatestSuggestions: re,
630
- getLatestForm: z,
630
+ getLatestForm: H,
631
631
  // Pass-through for panel open/close (controls SSE burst).
632
632
  setPanelOpen: t.setPanelOpen
633
633
  };
@@ -649,7 +649,7 @@ const U = {
649
649
  red: "#B91C1C",
650
650
  redBg: "#FDECEC"
651
651
  }, le = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
652
- function ge(t = "") {
652
+ function ye(t = "") {
653
653
  return t ? le[t.charCodeAt(0) % le.length] : le[0];
654
654
  }
655
655
  function we(t = "") {
@@ -658,7 +658,7 @@ function we(t = "") {
658
658
  function be(t = /* @__PURE__ */ new Date()) {
659
659
  return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
660
660
  }
661
- const He = `
661
+ const Pe = `
662
662
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
663
663
 
664
664
  .wm-root {
@@ -704,12 +704,12 @@ const He = `
704
704
  0% { transform: translateX(110%); opacity: 0; }
705
705
  100% { transform: translateX(0); opacity: 1; }
706
706
  }
707
- `, ze = "https://api.messenger.victorc.fr", B = (t, e) => {
707
+ `, He = "https://api.messenger.victorc.fr", B = (t, e) => {
708
708
  const n = t.__vccOpts || t;
709
709
  for (const [a, r] of e)
710
710
  n[a] = r;
711
711
  return n;
712
- }, Ve = {
712
+ }, ze = {
713
713
  name: "WmLauncher",
714
714
  props: {
715
715
  // Nombre de conversations non lues — pilote la pastille.
@@ -719,11 +719,11 @@ const He = `
719
719
  peek: { type: String, default: "" }
720
720
  },
721
721
  emits: ["open", "dismiss"]
722
- }, qe = { class: "wm-launcherWrap" }, We = { class: "wm-peek__text" }, Ge = ["aria-label"];
723
- function Ke(t, e, n, a, r, s) {
724
- return l(), c("div", qe, [
725
- H(Me, { name: "wm-peek" }, {
726
- default: Te(() => [
722
+ }, Ve = { class: "wm-launcherWrap" }, qe = { class: "wm-peek__text" }, We = ["aria-label"];
723
+ function Ge(t, e, n, a, r, s) {
724
+ return l(), c("div", Ve, [
725
+ P(xe, { name: "wm-peek" }, {
726
+ default: Me(() => [
727
727
  n.peek ? (l(), c("div", {
728
728
  key: 0,
729
729
  class: "wm-peek",
@@ -736,7 +736,7 @@ function Ke(t, e, n, a, r, s) {
736
736
  e[3] || (e[3] = me(Y((o) => t.$emit("open"), ["prevent"]), ["space"]))
737
737
  ]
738
738
  }, [
739
- i("p", We, b(n.peek), 1),
739
+ i("p", qe, b(n.peek), 1),
740
740
  i("button", {
741
741
  type: "button",
742
742
  class: "wm-peek__close",
@@ -757,7 +757,7 @@ function Ke(t, e, n, a, r, s) {
757
757
  i("path", { d: "M18 6L6 18M6 6l12 12" })
758
758
  ], -1)
759
759
  ])])
760
- ], 32)) : g("", !0)
760
+ ], 32)) : y("", !0)
761
761
  ]),
762
762
  _: 1
763
763
  }),
@@ -784,30 +784,28 @@ function Ke(t, e, n, a, r, s) {
784
784
  key: 0,
785
785
  class: "wm-launcher__badge",
786
786
  "aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
787
- }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Ge)) : g("", !0)
787
+ }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, We)) : y("", !0)
788
788
  ])
789
789
  ]);
790
790
  }
791
- const Ye = /* @__PURE__ */ B(Ve, [["render", Ke], ["__scopeId", "data-v-fabef371"]]), Je = {
791
+ const Ke = /* @__PURE__ */ B(ze, [["render", Ge], ["__scopeId", "data-v-fabef371"]]), Ye = {
792
792
  name: "WmAIAvatar",
793
793
  props: {
794
794
  size: { type: Number, default: 26 },
795
795
  pulse: { type: Boolean, default: !1 }
796
796
  }
797
+ }, Je = {
798
+ key: 0,
799
+ class: "wm-aiav__pulse"
797
800
  }, Xe = ["width", "height"];
798
801
  function Qe(t, e, n, a, r, s) {
799
802
  return l(), c("div", {
800
803
  class: "wm-aiav",
801
- style: P({ width: n.size + "px", height: n.size + "px" })
804
+ style: V({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
802
805
  }, [
803
- n.pulse ? (l(), c("div", {
804
- key: 0,
805
- class: "wm-aiav__pulse",
806
- style: P({ borderRadius: n.size * 0.32 + 3 + "px" })
807
- }, null, 4)) : g("", !0),
806
+ n.pulse ? (l(), c("div", Je)) : y("", !0),
808
807
  i("div", {
809
- class: E(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }]),
810
- style: P({ borderRadius: n.size * 0.32 + "px" })
808
+ class: E(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
811
809
  }, [
812
810
  (l(), c("svg", {
813
811
  width: n.size * 0.5,
@@ -836,10 +834,10 @@ function Qe(t, e, n, a, r, s) {
836
834
  opacity: "0.38"
837
835
  }, null, -1)
838
836
  ])], 8, Xe))
839
- ], 6)
837
+ ], 2)
840
838
  ], 4);
841
839
  }
842
- const J = /* @__PURE__ */ B(Je, [["render", Qe], ["__scopeId", "data-v-fe042be7"]]), Ze = {
840
+ const J = /* @__PURE__ */ B(Ye, [["render", Qe], ["__scopeId", "data-v-5ce9c382"]]), Ze = {
843
841
  name: "WmHumanAvatar",
844
842
  props: {
845
843
  name: { type: String, default: "" },
@@ -848,7 +846,7 @@ const J = /* @__PURE__ */ B(Je, [["render", Qe], ["__scopeId", "data-v-fe042be7"
848
846
  },
849
847
  computed: {
850
848
  bg() {
851
- return this.avatarUrl ? "transparent" : ge(this.name);
849
+ return this.avatarUrl ? "transparent" : ye(this.name);
852
850
  },
853
851
  initials() {
854
852
  return we(this.name);
@@ -858,10 +856,10 @@ const J = /* @__PURE__ */ B(Je, [["render", Qe], ["__scopeId", "data-v-fe042be7"
858
856
  function tt(t, e, n, a, r, s) {
859
857
  return l(), c("div", {
860
858
  class: "wm-huav",
861
- style: P({
859
+ style: V({
862
860
  width: n.size + "px",
863
861
  height: n.size + "px",
864
- borderRadius: Math.round(n.size * 0.32) + "px",
862
+ "--wm-avr": Math.round(n.size * 0.32) + "px",
865
863
  background: s.bg
866
864
  })
867
865
  }, [
@@ -871,11 +869,11 @@ function tt(t, e, n, a, r, s) {
871
869
  alt: n.name || ""
872
870
  }, null, 8, et)) : (l(), c("span", {
873
871
  key: 1,
874
- style: P({ fontSize: n.size * 0.36 + "px" })
872
+ style: V({ fontSize: n.size * 0.36 + "px" })
875
873
  }, b(s.initials), 5))
876
874
  ], 4);
877
875
  }
878
- const ke = /* @__PURE__ */ B(Ze, [["render", tt], ["__scopeId", "data-v-79449443"]]), nt = {
876
+ const ke = /* @__PURE__ */ B(Ze, [["render", tt], ["__scopeId", "data-v-a772b179"]]), nt = {
879
877
  name: "WmTeamAvatars",
880
878
  props: {
881
879
  members: { type: Array, default: () => [] },
@@ -891,7 +889,7 @@ const ke = /* @__PURE__ */ B(Ze, [["render", tt], ["__scopeId", "data-v-79449443
891
889
  },
892
890
  methods: {
893
891
  colorFor(t) {
894
- return t.avatar_url ? "transparent" : ge(t.name || "");
892
+ return t.avatar_url ? "transparent" : ye(t.name || "");
895
893
  },
896
894
  initialsFor(t) {
897
895
  return we(t.name || "");
@@ -908,12 +906,12 @@ function ot(t, e, n, a, r, s) {
908
906
  return s.visible ? (l(), c("div", st, [
909
907
  i("div", {
910
908
  class: "wm-team__stack",
911
- style: P({ width: s.stackWidth + "px" })
909
+ style: V({ width: s.stackWidth + "px" })
912
910
  }, [
913
- (l(!0), c(O, null, F(n.members.slice(0, 3), (o, d) => (l(), c("div", {
911
+ (l(!0), c(M, null, F(n.members.slice(0, 3), (o, d) => (l(), c("div", {
914
912
  key: d,
915
913
  class: "wm-team__pill",
916
- style: P({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
914
+ style: V({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
917
915
  }, [
918
916
  o.avatar_url ? (l(), c("img", {
919
917
  key: 0,
@@ -922,8 +920,8 @@ function ot(t, e, n, a, r, s) {
922
920
  }, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(o)), 1))
923
921
  ], 4))), 128))
924
922
  ], 4),
925
- n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : g("", !0)
926
- ])) : g("", !0);
923
+ n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : y("", !0)
924
+ ])) : y("", !0);
927
925
  }
928
926
  const lt = /* @__PURE__ */ B(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), ct = {
929
927
  name: "WmHeader",
@@ -967,8 +965,8 @@ const lt = /* @__PURE__ */ B(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1
967
965
  }, pt = { class: "wm-header__status" }, vt = {
968
966
  key: 3,
969
967
  class: "wm-header__fill"
970
- }, yt = { class: "wm-header__actions" };
971
- function gt(t, e, n, a, r, s) {
968
+ }, gt = { class: "wm-header__actions" };
969
+ function yt(t, e, n, a, r, s) {
972
970
  const o = I("HumanAvatar"), d = I("AIAvatar"), v = I("TeamAvatars");
973
971
  return l(), c("div", dt, [
974
972
  n.showBack ? (l(), c("button", {
@@ -992,7 +990,7 @@ function gt(t, e, n, a, r, s) {
992
990
  i("path", { d: "M19 12H5M12 5l-7 7 7 7" })
993
991
  ], -1)
994
992
  ])])) : (l(), c("div", ut)),
995
- n.showIdentity ? (l(), c(O, { key: 2 }, [
993
+ n.showIdentity ? (l(), c(M, { key: 2 }, [
996
994
  i("div", ht, [
997
995
  n.escalated ? (l(), $(o, {
998
996
  key: 0,
@@ -1011,15 +1009,15 @@ function gt(t, e, n, a, r, s) {
1011
1009
  key: 0,
1012
1010
  members: n.teamMembers,
1013
1011
  "response-label": n.responseLabel
1014
- }, null, 8, ["members", "response-label"])) : g("", !0),
1012
+ }, null, 8, ["members", "response-label"])) : y("", !0),
1015
1013
  i("span", pt, [
1016
1014
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
1017
1015
  se(" " + b(s.statusText), 1)
1018
1016
  ])
1019
- ])) : g("", !0)
1017
+ ])) : y("", !0)
1020
1018
  ])
1021
1019
  ], 64)) : (l(), c("div", vt)),
1022
- i("div", yt, [
1020
+ i("div", gt, [
1023
1021
  n.showMore ? (l(), c("button", {
1024
1022
  key: 0,
1025
1023
  type: "button",
@@ -1051,7 +1049,7 @@ function gt(t, e, n, a, r, s) {
1051
1049
  r: "1.6"
1052
1050
  })
1053
1051
  ], -1)
1054
- ])], 2)) : g("", !0),
1052
+ ])], 2)) : y("", !0),
1055
1053
  n.showClose ? (l(), c("button", {
1056
1054
  key: 1,
1057
1055
  type: "button",
@@ -1073,11 +1071,11 @@ function gt(t, e, n, a, r, s) {
1073
1071
  }, [
1074
1072
  i("path", { d: "M18 6L6 18M6 6l12 12" })
1075
1073
  ], -1)
1076
- ])])) : g("", !0)
1074
+ ])])) : y("", !0)
1077
1075
  ])
1078
1076
  ]);
1079
1077
  }
1080
- const wt = /* @__PURE__ */ B(ct, [["render", gt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1078
+ const wt = /* @__PURE__ */ B(ct, [["render", yt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1081
1079
  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",
1082
1080
  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",
1083
1081
  status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
@@ -1111,7 +1109,7 @@ Je réponds en quelques secondes.`;
1111
1109
  }, kt = { class: "wm-onb" }, Ct = { class: "wm-onb__hero" }, At = { class: "wm-onb__title" }, St = { class: "wm-onb__sub" }, xt = {
1112
1110
  key: 0,
1113
1111
  class: "wm-onb__section"
1114
- }, Mt = { class: "wm-onb__links" }, Tt = ["onClick"], It = { class: "wm-onb__resume-body" }, Ot = { class: "wm-onb__resume-title" }, Et = { class: "wm-onb__resume-preview" }, Bt = {
1112
+ }, Mt = { class: "wm-onb__links" }, Tt = ["onClick"], Ot = { class: "wm-onb__resume-body" }, It = { class: "wm-onb__resume-title" }, Et = { class: "wm-onb__resume-preview" }, Bt = {
1115
1113
  key: 1,
1116
1114
  class: "wm-onb__section"
1117
1115
  }, Lt = { class: "wm-onb__links" }, Rt = ["onClick"], $t = { class: "wm-onb__link-icon" }, Ft = {
@@ -1129,7 +1127,7 @@ function Pt(t, e, n, a, r, s) {
1129
1127
  const o = I("AIAvatar");
1130
1128
  return l(), c("div", kt, [
1131
1129
  i("div", Ct, [
1132
- H(o, {
1130
+ P(o, {
1133
1131
  size: 56,
1134
1132
  pulse: !0
1135
1133
  }),
@@ -1139,7 +1137,7 @@ function Pt(t, e, n, a, r, s) {
1139
1137
  n.unreadThreads.length ? (l(), c("div", xt, [
1140
1138
  e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Messages non lus", -1)),
1141
1139
  i("div", Mt, [
1142
- (l(!0), c(O, null, F(n.unreadThreads, (d) => (l(), c("button", {
1140
+ (l(!0), c(M, null, F(n.unreadThreads, (d) => (l(), c("button", {
1143
1141
  key: d.id,
1144
1142
  type: "button",
1145
1143
  class: "wm-onb__link wm-onb__resume",
@@ -1164,8 +1162,8 @@ function Pt(t, e, n, a, r, s) {
1164
1162
  "aria-label": "Non lu"
1165
1163
  })
1166
1164
  ], -1)),
1167
- i("span", It, [
1168
- i("span", Ot, b(d.title), 1),
1165
+ i("span", Ot, [
1166
+ i("span", It, b(d.title), 1),
1169
1167
  i("span", Et, b(d.preview), 1)
1170
1168
  ]),
1171
1169
  e[2] || (e[2] = i("svg", {
@@ -1184,11 +1182,11 @@ function Pt(t, e, n, a, r, s) {
1184
1182
  ], -1))
1185
1183
  ], 8, Tt))), 128))
1186
1184
  ])
1187
- ])) : g("", !0),
1185
+ ])) : y("", !0),
1188
1186
  n.quickLinks.length ? (l(), c("div", Bt, [
1189
1187
  e[5] || (e[5] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1190
1188
  i("div", Lt, [
1191
- (l(!0), c(O, null, F(n.quickLinks, (d, v) => (l(), c("button", {
1189
+ (l(!0), c(M, null, F(n.quickLinks, (d, v) => (l(), c("button", {
1192
1190
  key: v,
1193
1191
  type: "button",
1194
1192
  class: "wm-onb__link",
@@ -1218,7 +1216,7 @@ function Pt(t, e, n, a, r, s) {
1218
1216
  ], -1))
1219
1217
  ], 8, Rt))), 128))
1220
1218
  ])
1221
- ])) : g("", !0),
1219
+ ])) : y("", !0),
1222
1220
  i("div", Dt, [
1223
1221
  i("button", {
1224
1222
  type: "button",
@@ -1229,86 +1227,7 @@ function Pt(t, e, n, a, r, s) {
1229
1227
  ])
1230
1228
  ]);
1231
1229
  }
1232
- const Ht = /* @__PURE__ */ B(bt, [["render", Pt], ["__scopeId", "data-v-bd89bc8f"]]);
1233
- function zt(t) {
1234
- return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1235
- }
1236
- function Vt(t) {
1237
- return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1238
- }
1239
- const pe = "";
1240
- function ee(t) {
1241
- let e = t;
1242
- const n = [];
1243
- return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
1244
- const s = n.length;
1245
- return n.push(r), `${pe}CODE${s}${pe}`;
1246
- }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Vt(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (a, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
1247
- }
1248
- function Ce(t) {
1249
- if (!t) return "";
1250
- const e = zt(t).split(`
1251
- `), n = [];
1252
- let a = 0;
1253
- for (; a < e.length; ) {
1254
- const s = e[a];
1255
- if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1256
- a++;
1257
- const C = [];
1258
- for (; a < e.length && !/^\s*```\s*$/.test(e[a]); )
1259
- C.push(e[a]), a++;
1260
- a < e.length && a++, n.push({
1261
- type: "block",
1262
- html: `<pre class="wm-md-pre"><code>${C.join(`
1263
- `)}</code></pre>`
1264
- });
1265
- continue;
1266
- }
1267
- if (/^\s*[-*]\s+/.test(s)) {
1268
- const C = [];
1269
- for (; a < e.length; ) {
1270
- const S = /^\s*[-*]\s+(.*)$/.exec(e[a]);
1271
- if (!S) break;
1272
- C.push(S[1]), a++;
1273
- }
1274
- const w = C.map((S) => `<li>${ee(S)}</li>`).join("");
1275
- n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1276
- continue;
1277
- }
1278
- const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1279
- if (d) {
1280
- const C = parseInt(d[1], 10), w = [d[2]];
1281
- for (a++; a < e.length; ) {
1282
- const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1283
- if (!A) break;
1284
- w.push(A[1]), a++;
1285
- }
1286
- const S = w.map((A) => `<li>${ee(A)}</li>`).join(""), L = C !== 1 ? ` start="${C}"` : "";
1287
- n.push({ type: "block", html: `<ol class="wm-md-ol"${L}>${S}</ol>` });
1288
- continue;
1289
- }
1290
- const v = /^(#{1,6})\s+(.*)$/.exec(s);
1291
- if (v) {
1292
- const C = v[1].length;
1293
- n.push({
1294
- type: "block",
1295
- html: `<h${C} class="wm-md-h wm-md-h${C}">${ee(v[2])}</h${C}>`
1296
- }), a++;
1297
- continue;
1298
- }
1299
- n.push({ type: "text", html: ee(s) }), a++;
1300
- }
1301
- let r = "";
1302
- for (let s = 0; s < n.length; s++) {
1303
- const o = n[s];
1304
- r += o.html;
1305
- const d = n[s + 1];
1306
- d && o.type !== "block" && d.type !== "block" && (r += `
1307
- `);
1308
- }
1309
- return r;
1310
- }
1311
- const qt = {
1230
+ const Ht = /* @__PURE__ */ B(bt, [["render", Pt], ["__scopeId", "data-v-bd89bc8f"]]), zt = {
1312
1231
  name: "WmArtifactFormResponse",
1313
1232
  props: {
1314
1233
  data: { type: Object, required: !0 }
@@ -1319,11 +1238,11 @@ const qt = {
1319
1238
  return Array.isArray((t = this.data) == null ? void 0 : t.fields) ? this.data.fields : [];
1320
1239
  }
1321
1240
  }
1322
- }, Wt = { class: "wm-art wm-art--formResponse" }, Gt = { class: "wm-art__head" }, Kt = { class: "wm-art__title" }, Yt = { class: "wm-art__body" }, Jt = { class: "wm-art__fieldLabel" };
1323
- function Xt(t, e, n, a, r, s) {
1324
- return l(), c("div", Wt, [
1325
- i("div", Gt, [
1326
- i("div", Kt, b(n.data.title || "Formulaire"), 1),
1241
+ }, Vt = { class: "wm-art wm-art--formResponse" }, qt = { class: "wm-art__head" }, Wt = { class: "wm-art__title" }, Gt = { class: "wm-art__body" }, Kt = { class: "wm-art__fieldLabel" };
1242
+ function Yt(t, e, n, a, r, s) {
1243
+ return l(), c("div", Vt, [
1244
+ i("div", qt, [
1245
+ i("div", Wt, b(n.data.title || "Formulaire"), 1),
1327
1246
  e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
1328
1247
  i("svg", {
1329
1248
  width: "11",
@@ -1341,12 +1260,12 @@ function Xt(t, e, n, a, r, s) {
1341
1260
  se(" Envoyé ")
1342
1261
  ], -1))
1343
1262
  ]),
1344
- i("div", Yt, [
1345
- (l(!0), c(O, null, F(s.fields, (o, d) => (l(), c("div", {
1263
+ i("div", Gt, [
1264
+ (l(!0), c(M, null, F(s.fields, (o, d) => (l(), c("div", {
1346
1265
  key: d,
1347
1266
  class: "wm-art__field"
1348
1267
  }, [
1349
- i("div", Jt, b(o.label), 1),
1268
+ i("div", Kt, b(o.label), 1),
1350
1269
  i("div", {
1351
1270
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1352
1271
  }, b(o.value), 3)
@@ -1354,7 +1273,7 @@ function Xt(t, e, n, a, r, s) {
1354
1273
  ])
1355
1274
  ]);
1356
1275
  }
1357
- const Qt = /* @__PURE__ */ B(qt, [["render", Xt], ["__scopeId", "data-v-812bda8b"]]), Zt = {
1276
+ const Jt = /* @__PURE__ */ B(zt, [["render", Yt], ["__scopeId", "data-v-812bda8b"]]), Xt = {
1358
1277
  name: "WmArtifactInfoCard",
1359
1278
  props: {
1360
1279
  data: { type: Object, required: !0 }
@@ -1369,61 +1288,61 @@ const Qt = /* @__PURE__ */ B(qt, [["render", Xt], ["__scopeId", "data-v-812bda8b
1369
1288
  return !!((t = this.data) != null && t.body) || this.fields.length > 0;
1370
1289
  }
1371
1290
  }
1372
- }, en = { class: "wm-art wm-art--infoCard" }, tn = {
1291
+ }, Qt = { class: "wm-art wm-art--infoCard" }, Zt = {
1373
1292
  key: 0,
1374
1293
  class: "wm-art__image"
1375
- }, nn = ["src", "alt"], sn = { class: "wm-art__head" }, rn = { class: "wm-art__headMain" }, an = { class: "wm-art__title" }, on = {
1294
+ }, en = ["src", "alt"], tn = { class: "wm-art__head" }, nn = { class: "wm-art__headMain" }, sn = { class: "wm-art__title" }, rn = {
1376
1295
  key: 0,
1377
1296
  class: "wm-art__subtitle"
1378
- }, ln = {
1297
+ }, an = {
1379
1298
  key: 1,
1380
1299
  class: "wm-art__body"
1381
- }, cn = {
1300
+ }, on = {
1382
1301
  key: 0,
1383
1302
  class: "wm-art__text"
1384
- }, dn = { class: "wm-art__fieldLabel" };
1385
- function un(t, e, n, a, r, s) {
1386
- return l(), c("div", en, [
1387
- n.data.image_url ? (l(), c("figure", tn, [
1303
+ }, ln = { class: "wm-art__fieldLabel" };
1304
+ function cn(t, e, n, a, r, s) {
1305
+ return l(), c("div", Qt, [
1306
+ n.data.image_url ? (l(), c("figure", Zt, [
1388
1307
  i("img", {
1389
1308
  src: n.data.image_url,
1390
1309
  alt: n.data.title || "",
1391
1310
  loading: "lazy"
1392
- }, null, 8, nn)
1393
- ])) : g("", !0),
1394
- i("div", sn, [
1395
- i("div", rn, [
1396
- i("div", an, b(n.data.title), 1),
1397
- n.data.subtitle ? (l(), c("div", on, b(n.data.subtitle), 1)) : g("", !0)
1311
+ }, null, 8, en)
1312
+ ])) : y("", !0),
1313
+ i("div", tn, [
1314
+ i("div", nn, [
1315
+ i("div", sn, b(n.data.title), 1),
1316
+ n.data.subtitle ? (l(), c("div", rn, b(n.data.subtitle), 1)) : y("", !0)
1398
1317
  ]),
1399
1318
  n.data.badge && n.data.badge.label ? (l(), c("span", {
1400
1319
  key: 0,
1401
1320
  class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1402
- }, b(n.data.badge.label), 3)) : g("", !0)
1321
+ }, b(n.data.badge.label), 3)) : y("", !0)
1403
1322
  ]),
1404
- s.hasBody ? (l(), c("div", ln, [
1405
- n.data.body ? (l(), c("div", cn, b(n.data.body), 1)) : g("", !0),
1406
- s.fields.length ? (l(!0), c(O, { key: 1 }, F(s.fields, (o, d) => (l(), c("div", {
1323
+ s.hasBody ? (l(), c("div", an, [
1324
+ n.data.body ? (l(), c("div", on, b(n.data.body), 1)) : y("", !0),
1325
+ s.fields.length ? (l(!0), c(M, { key: 1 }, F(s.fields, (o, d) => (l(), c("div", {
1407
1326
  key: d,
1408
1327
  class: "wm-art__field"
1409
1328
  }, [
1410
- i("div", dn, b(o.label), 1),
1329
+ i("div", ln, b(o.label), 1),
1411
1330
  i("div", {
1412
1331
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1413
1332
  }, b(o.value), 3)
1414
- ]))), 128)) : g("", !0)
1415
- ])) : g("", !0)
1333
+ ]))), 128)) : y("", !0)
1334
+ ])) : y("", !0)
1416
1335
  ]);
1417
1336
  }
1418
- const hn = /* @__PURE__ */ B(Zt, [["render", un], ["__scopeId", "data-v-d7369333"]]);
1419
- function mn(t) {
1337
+ const dn = /* @__PURE__ */ B(Xt, [["render", cn], ["__scopeId", "data-v-d7369333"]]);
1338
+ function un(t) {
1420
1339
  if (!t) return "";
1421
1340
  const e = new Date(t);
1422
1341
  if (Number.isNaN(e.getTime())) return t;
1423
1342
  const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), a = e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
1424
1343
  return `${n} à ${a}`;
1425
1344
  }
1426
- const fn = {
1345
+ const hn = {
1427
1346
  name: "WmArtifactTicket",
1428
1347
  props: {
1429
1348
  data: { type: Object, required: !0 }
@@ -1433,13 +1352,9 @@ const fn = {
1433
1352
  var t;
1434
1353
  return Array.isArray((t = this.data) == null ? void 0 : t.fields) ? this.data.fields : [];
1435
1354
  },
1436
- hasBody() {
1437
- var t;
1438
- return !!((t = this.data) != null && t.body) || this.fields.length > 0;
1439
- },
1440
1355
  formattedDate() {
1441
1356
  var t;
1442
- return mn((t = this.data) == null ? void 0 : t.created_at);
1357
+ return un((t = this.data) == null ? void 0 : t.created_at);
1443
1358
  }
1444
1359
  },
1445
1360
  methods: {
@@ -1456,22 +1371,22 @@ const fn = {
1456
1371
  return /high|haute|élev|elev|critic|critiq|urgent/.test(e) ? 3 : /low|basse|faible|minor/.test(e) ? 1 : 2;
1457
1372
  }
1458
1373
  }
1459
- }, _n = { class: "wm-art wm-art--ticket" }, pn = { class: "wm-art__head wm-tk__head" }, vn = { class: "wm-art__title wm-tk__title" }, yn = { class: "wm-tk__sub" }, gn = { class: "wm-tk__ref" }, wn = {
1460
- key: 0,
1461
- class: "wm-art__body"
1462
- }, bn = {
1374
+ }, mn = { class: "wm-art wm-art--ticket" }, fn = { class: "wm-art__head wm-tk__head" }, _n = { class: "wm-art__title wm-tk__title" }, pn = { class: "wm-tk__sub" }, vn = { class: "wm-tk__ref" }, gn = {
1463
1375
  key: 0,
1464
1376
  class: "wm-tk__text"
1465
- }, kn = { class: "wm-art__fieldLabel" }, Cn = ["data-level"], An = {
1377
+ }, yn = {
1378
+ key: 0,
1379
+ class: "wm-art__body"
1380
+ }, wn = { class: "wm-art__fieldLabel" }, bn = ["data-level"], kn = {
1466
1381
  key: 1,
1467
1382
  class: "wm-art__footer wm-tk__footer"
1468
1383
  };
1469
- function Sn(t, e, n, a, r, s) {
1470
- return l(), c("div", _n, [
1471
- i("div", pn, [
1472
- i("div", vn, b(n.data.title), 1),
1473
- i("div", yn, [
1474
- i("div", gn, [
1384
+ function Cn(t, e, n, a, r, s) {
1385
+ return l(), c("div", mn, [
1386
+ i("div", fn, [
1387
+ i("div", _n, b(n.data.title), 1),
1388
+ i("div", pn, [
1389
+ i("div", vn, [
1475
1390
  e[0] || (e[0] = i("svg", {
1476
1391
  width: "11",
1477
1392
  height: "11",
@@ -1497,15 +1412,15 @@ function Sn(t, e, n, a, r, s) {
1497
1412
  }, null, -1)),
1498
1413
  se(" " + b(n.data.status.label), 1)
1499
1414
  ], 2)
1500
- ])
1415
+ ]),
1416
+ n.data.body ? (l(), c("div", gn, b(n.data.body), 1)) : y("", !0)
1501
1417
  ]),
1502
- s.hasBody ? (l(), c("div", wn, [
1503
- n.data.body ? (l(), c("div", bn, b(n.data.body), 1)) : g("", !0),
1504
- s.fields.length ? (l(!0), c(O, { key: 1 }, F(s.fields, (o, d) => (l(), c("div", {
1418
+ s.fields.length ? (l(), c("div", yn, [
1419
+ (l(!0), c(M, null, F(s.fields, (o, d) => (l(), c("div", {
1505
1420
  key: d,
1506
1421
  class: "wm-art__field"
1507
1422
  }, [
1508
- i("div", kn, b(o.label), 1),
1423
+ i("div", wn, b(o.label), 1),
1509
1424
  i("div", {
1510
1425
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1511
1426
  }, [
@@ -1539,12 +1454,12 @@ function Sn(t, e, n, a, r, s) {
1539
1454
  height: "9",
1540
1455
  rx: "0.5"
1541
1456
  }, null, -1)
1542
- ])], 8, Cn)) : g("", !0),
1457
+ ])], 8, bn)) : y("", !0),
1543
1458
  i("span", null, b(o.value), 1)
1544
1459
  ], 2)
1545
- ]))), 128)) : g("", !0)
1546
- ])) : g("", !0),
1547
- n.data.created_at ? (l(), c("div", An, [
1460
+ ]))), 128))
1461
+ ])) : y("", !0),
1462
+ n.data.created_at ? (l(), c("div", kn, [
1548
1463
  e[3] || (e[3] = i("svg", {
1549
1464
  width: "11",
1550
1465
  height: "11",
@@ -1566,14 +1481,14 @@ function Sn(t, e, n, a, r, s) {
1566
1481
  i("path", { d: "M16 2v4M8 2v4M3 10h18" })
1567
1482
  ], -1)),
1568
1483
  i("span", null, b(s.formattedDate), 1)
1569
- ])) : g("", !0)
1484
+ ])) : y("", !0)
1570
1485
  ]);
1571
1486
  }
1572
- const xn = /* @__PURE__ */ B(fn, [["render", Sn], ["__scopeId", "data-v-f0495924"]]), Mn = {
1573
- form_response: Qt,
1574
- info_card: hn,
1575
- ticket: xn
1576
- }, Tn = {
1487
+ const An = /* @__PURE__ */ B(hn, [["render", Cn], ["__scopeId", "data-v-1253a996"]]), Sn = {
1488
+ form_response: Jt,
1489
+ info_card: dn,
1490
+ ticket: An
1491
+ }, xn = {
1577
1492
  name: "WmArtifactRenderer",
1578
1493
  props: {
1579
1494
  // Forme : { kind: string, data: any } (le `data` est validé
@@ -1584,95 +1499,114 @@ const xn = /* @__PURE__ */ B(fn, [["render", Sn], ["__scopeId", "data-v-f0495924
1584
1499
  component() {
1585
1500
  var e;
1586
1501
  const t = (e = this.artifact) == null ? void 0 : e.kind;
1587
- return t && Mn[t] || null;
1502
+ return t && Sn[t] || null;
1588
1503
  }
1589
1504
  }
1590
1505
  };
1591
- function In(t, e, n, a, r, s) {
1592
- return s.component ? (l(), $(Ie(s.component), {
1506
+ function Mn(t, e, n, a, r, s) {
1507
+ return s.component ? (l(), $(Te(s.component), {
1593
1508
  key: 0,
1594
1509
  data: n.artifact.data
1595
- }, null, 8, ["data"])) : g("", !0);
1510
+ }, null, 8, ["data"])) : y("", !0);
1596
1511
  }
1597
- const Ae = /* @__PURE__ */ B(Tn, [["render", In]]), On = {
1512
+ const Ce = /* @__PURE__ */ B(xn, [["render", Mn]]);
1513
+ function Tn(t) {
1514
+ return typeof t != "string" ? "" : t.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
1515
+ }
1516
+ const On = {
1598
1517
  name: "WmActionResult",
1599
- components: { ArtifactRenderer: Ae },
1518
+ components: { ArtifactRenderer: Ce },
1600
1519
  props: {
1601
1520
  state: { type: String, default: "success" },
1602
1521
  // 'success' | 'failure' | 'rejected'
1603
1522
  label: { type: String, required: !0 },
1604
1523
  detail: { type: String, default: "" },
1605
- // Artifact attaché au résultat (forme `{ kind, data }`, posé par
1606
- // le sub-agent via `set_result_artifact`). `null` si rien à afficher.
1607
1524
  artifact: { type: Object, default: null }
1608
1525
  },
1609
1526
  computed: {
1610
- ok() {
1611
- return this.state === "success";
1612
- },
1613
- // Sub-agent summaries arrive as free-form text often containing
1614
- // bullet lists / bold emphasis / inline code. Render them through
1615
- // the shared markdown pipeline so they read like the chat bubbles.
1616
- detailHtml() {
1617
- return Ce(this.detail);
1527
+ detailText() {
1528
+ return Tn(this.detail);
1618
1529
  }
1619
1530
  }
1620
- }, En = { class: "wm-result-wrap" }, Bn = { class: "wm-result" }, Ln = {
1531
+ }, In = { class: "wm-result-wrap" }, En = {
1532
+ class: "wm-result__icon",
1533
+ "aria-hidden": "true"
1534
+ }, Bn = {
1621
1535
  key: 0,
1622
- width: "10",
1623
- height: "10",
1536
+ width: "11",
1537
+ height: "11",
1624
1538
  viewBox: "0 0 24 24",
1625
1539
  fill: "none",
1626
- stroke: "#fff",
1627
- "stroke-width": "2.5",
1540
+ stroke: "currentColor",
1541
+ "stroke-width": "2.8",
1628
1542
  "stroke-linecap": "round",
1629
- "stroke-linejoin": "round",
1630
- "aria-hidden": "true"
1631
- }, Rn = {
1543
+ "stroke-linejoin": "round"
1544
+ }, Ln = {
1632
1545
  key: 1,
1633
- width: "10",
1634
- height: "10",
1546
+ width: "11",
1547
+ height: "11",
1635
1548
  viewBox: "0 0 24 24",
1636
1549
  fill: "none",
1637
1550
  stroke: "currentColor",
1638
- "stroke-width": "2.5",
1551
+ "stroke-width": "2.6",
1639
1552
  "stroke-linecap": "round",
1640
- "stroke-linejoin": "round",
1641
- "aria-hidden": "true"
1642
- }, $n = { class: "wm-result__body" }, Fn = ["innerHTML"], jn = {
1553
+ "stroke-linejoin": "round"
1554
+ }, Rn = {
1555
+ key: 2,
1556
+ width: "12",
1557
+ height: "12",
1558
+ viewBox: "0 0 24 24",
1559
+ fill: "none",
1560
+ stroke: "currentColor",
1561
+ "stroke-width": "2.2",
1562
+ "stroke-linecap": "round",
1563
+ "stroke-linejoin": "round"
1564
+ }, $n = { class: "wm-result__label" }, Fn = { class: "wm-result__detail" }, jn = {
1643
1565
  key: 0,
1644
1566
  class: "wm-result-art"
1645
1567
  };
1646
1568
  function Un(t, e, n, a, r, s) {
1647
1569
  const o = I("ArtifactRenderer");
1648
- return l(), c("div", En, [
1649
- i("div", Bn, [
1650
- i("div", {
1651
- class: E(["wm-result__check", { "wm-result__check--ok": s.ok }])
1652
- }, [
1653
- s.ok ? (l(), c("svg", Ln, [...e[0] || (e[0] = [
1570
+ return l(), c("div", In, [
1571
+ i("div", {
1572
+ class: E(["wm-result", `wm-result--${n.state}`])
1573
+ }, [
1574
+ i("span", En, [
1575
+ n.state === "success" ? (l(), c("svg", Bn, [...e[0] || (e[0] = [
1654
1576
  i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
1655
- ])])) : (l(), c("svg", Rn, [...e[1] || (e[1] = [
1577
+ ])])) : n.state === "rejected" ? (l(), c("svg", Ln, [...e[1] || (e[1] = [
1656
1578
  i("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
1579
+ ])])) : (l(), c("svg", Rn, [...e[2] || (e[2] = [
1580
+ i("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),
1581
+ i("line", {
1582
+ x1: "12",
1583
+ y1: "9",
1584
+ x2: "12",
1585
+ y2: "13"
1586
+ }, null, -1),
1587
+ i("line", {
1588
+ x1: "12",
1589
+ y1: "17",
1590
+ x2: "12.01",
1591
+ y2: "17"
1592
+ }, null, -1)
1657
1593
  ])]))
1658
- ], 2),
1659
- i("div", $n, [
1660
- i("div", {
1661
- class: E(["wm-result__label", { "wm-result__label--struck": !s.ok }])
1662
- }, b(n.label), 3),
1663
- n.detail ? (l(), c("div", {
1664
- key: 0,
1665
- class: "wm-result__detail",
1666
- innerHTML: s.detailHtml
1667
- }, null, 8, Fn)) : g("", !0)
1668
- ])
1669
- ]),
1594
+ ]),
1595
+ i("span", $n, b(n.label), 1),
1596
+ s.detailText ? (l(), c(M, { key: 0 }, [
1597
+ e[3] || (e[3] = i("span", {
1598
+ class: "wm-result__sep",
1599
+ "aria-hidden": "true"
1600
+ }, "·", -1)),
1601
+ i("span", Fn, b(s.detailText), 1)
1602
+ ], 64)) : y("", !0)
1603
+ ], 2),
1670
1604
  n.artifact ? (l(), c("div", jn, [
1671
- H(o, { artifact: n.artifact }, null, 8, ["artifact"])
1672
- ])) : g("", !0)
1605
+ P(o, { artifact: n.artifact }, null, 8, ["artifact"])
1606
+ ])) : y("", !0)
1673
1607
  ]);
1674
1608
  }
1675
- const Dn = /* @__PURE__ */ B(On, [["render", Un], ["__scopeId", "data-v-037fd69e"]]), Nn = {
1609
+ const Dn = /* @__PURE__ */ B(On, [["render", Un], ["__scopeId", "data-v-6cd32022"]]), Nn = {
1676
1610
  name: "WmAttachmentPreview",
1677
1611
  inject: {
1678
1612
  signAttachmentFn: { default: null }
@@ -1787,13 +1721,92 @@ function Jn(t, e, n, a, r, s) {
1787
1721
  ], -1)),
1788
1722
  i("span", Wn, [
1789
1723
  i("span", Gn, b(s.displayName), 1),
1790
- s.sizeLabel ? (l(), c("span", Kn, b(s.sizeLabel), 1)) : g("", !0)
1724
+ s.sizeLabel ? (l(), c("span", Kn, b(s.sizeLabel), 1)) : y("", !0)
1791
1725
  ]),
1792
- r.loading ? (l(), c("span", Yn)) : g("", !0)
1726
+ r.loading ? (l(), c("span", Yn)) : y("", !0)
1793
1727
  ], 8, qn))
1794
1728
  ], 2);
1795
1729
  }
1796
- const Xn = /* @__PURE__ */ B(Nn, [["render", Jn], ["__scopeId", "data-v-1cd1267b"]]), Qn = {
1730
+ const Xn = /* @__PURE__ */ B(Nn, [["render", Jn], ["__scopeId", "data-v-1cd1267b"]]);
1731
+ function Qn(t) {
1732
+ return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1733
+ }
1734
+ function Zn(t) {
1735
+ return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1736
+ }
1737
+ const pe = "";
1738
+ function ee(t) {
1739
+ let e = t;
1740
+ const n = [];
1741
+ return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
1742
+ const s = n.length;
1743
+ return n.push(r), `${pe}CODE${s}${pe}`;
1744
+ }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Zn(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (a, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
1745
+ }
1746
+ function es(t) {
1747
+ if (!t) return "";
1748
+ const e = Qn(t).split(`
1749
+ `), n = [];
1750
+ let a = 0;
1751
+ for (; a < e.length; ) {
1752
+ const s = e[a];
1753
+ if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1754
+ a++;
1755
+ const C = [];
1756
+ for (; a < e.length && !/^\s*```\s*$/.test(e[a]); )
1757
+ C.push(e[a]), a++;
1758
+ a < e.length && a++, n.push({
1759
+ type: "block",
1760
+ html: `<pre class="wm-md-pre"><code>${C.join(`
1761
+ `)}</code></pre>`
1762
+ });
1763
+ continue;
1764
+ }
1765
+ if (/^\s*[-*]\s+/.test(s)) {
1766
+ const C = [];
1767
+ for (; a < e.length; ) {
1768
+ const S = /^\s*[-*]\s+(.*)$/.exec(e[a]);
1769
+ if (!S) break;
1770
+ C.push(S[1]), a++;
1771
+ }
1772
+ const w = C.map((S) => `<li>${ee(S)}</li>`).join("");
1773
+ n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1774
+ continue;
1775
+ }
1776
+ const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1777
+ if (d) {
1778
+ const C = parseInt(d[1], 10), w = [d[2]];
1779
+ for (a++; a < e.length; ) {
1780
+ const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1781
+ if (!A) break;
1782
+ w.push(A[1]), a++;
1783
+ }
1784
+ const S = w.map((A) => `<li>${ee(A)}</li>`).join(""), L = C !== 1 ? ` start="${C}"` : "";
1785
+ n.push({ type: "block", html: `<ol class="wm-md-ol"${L}>${S}</ol>` });
1786
+ continue;
1787
+ }
1788
+ const v = /^(#{1,6})\s+(.*)$/.exec(s);
1789
+ if (v) {
1790
+ const C = v[1].length;
1791
+ n.push({
1792
+ type: "block",
1793
+ html: `<h${C} class="wm-md-h wm-md-h${C}">${ee(v[2])}</h${C}>`
1794
+ }), a++;
1795
+ continue;
1796
+ }
1797
+ n.push({ type: "text", html: ee(s) }), a++;
1798
+ }
1799
+ let r = "";
1800
+ for (let s = 0; s < n.length; s++) {
1801
+ const o = n[s];
1802
+ r += o.html;
1803
+ const d = n[s + 1];
1804
+ d && o.type !== "block" && d.type !== "block" && (r += `
1805
+ `);
1806
+ }
1807
+ return r;
1808
+ }
1809
+ const ts = {
1797
1810
  name: "WmBubble",
1798
1811
  props: {
1799
1812
  role: { type: String, default: "ai" },
@@ -1802,41 +1815,41 @@ const Xn = /* @__PURE__ */ B(Nn, [["render", Jn], ["__scopeId", "data-v-1cd1267b
1802
1815
  },
1803
1816
  computed: {
1804
1817
  rendered() {
1805
- return Ce(this.text);
1818
+ return es(this.text);
1806
1819
  }
1807
1820
  }
1808
- }, Zn = ["innerHTML"];
1809
- function es(t, e, n, a, r, s) {
1821
+ }, ns = ["innerHTML"];
1822
+ function ss(t, e, n, a, r, s) {
1810
1823
  return l(), c("div", {
1811
1824
  class: E(["wm-bubble", "wm-bubble--" + n.role])
1812
1825
  }, [
1813
1826
  Oe(t.$slots, "default", {}, () => [
1814
- i("span", { innerHTML: s.rendered }, null, 8, Zn)
1827
+ i("span", { innerHTML: s.rendered }, null, 8, ns)
1815
1828
  ], !0)
1816
1829
  ], 2);
1817
1830
  }
1818
- const ts = /* @__PURE__ */ B(Qn, [["render", es], ["__scopeId", "data-v-c52bb028"]]), ns = { name: "WmTyping" }, ss = { class: "wm-typing" };
1819
- function rs(t, e, n, a, r, s) {
1820
- return l(), c("div", ss, [...e[0] || (e[0] = [
1831
+ const rs = /* @__PURE__ */ B(ts, [["render", ss], ["__scopeId", "data-v-c52bb028"]]), is = { name: "WmTyping" }, as = { class: "wm-typing" };
1832
+ function os(t, e, n, a, r, s) {
1833
+ return l(), c("div", as, [...e[0] || (e[0] = [
1821
1834
  i("span", { style: { "animation-delay": "0s" } }, null, -1),
1822
1835
  i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
1823
1836
  i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
1824
1837
  ])]);
1825
1838
  }
1826
- const is = /* @__PURE__ */ B(ns, [["render", rs], ["__scopeId", "data-v-df2447fd"]]);
1839
+ const ls = /* @__PURE__ */ B(is, [["render", os], ["__scopeId", "data-v-df2447fd"]]);
1827
1840
  function ce(t) {
1828
1841
  return t ? t.client_msg_id || t.id : "";
1829
1842
  }
1830
- const as = {
1843
+ const cs = {
1831
1844
  transferred_to_human: "Conversation transférée à un humain",
1832
1845
  assigned: "{name} a rejoint la conversation",
1833
1846
  unassigned: "L'agent a quitté la conversation",
1834
1847
  resolved: "Conversation résolue",
1835
1848
  reopened: "Conversation rouverte",
1836
1849
  idle: "Conversation en pause"
1837
- }, os = 80, ls = 200, cs = {
1850
+ }, ds = 80, us = 200, hs = {
1838
1851
  name: "WmMessageList",
1839
- components: { AIAvatar: J, HumanAvatar: ke, Bubble: ts, Typing: is, ActionResult: Dn, AttachmentPreview: Xn, ArtifactRenderer: Ae },
1852
+ components: { AIAvatar: J, HumanAvatar: ke, Bubble: rs, Typing: ls, ActionResult: Dn, AttachmentPreview: Xn, ArtifactRenderer: Ce },
1840
1853
  props: {
1841
1854
  messages: { type: Array, default: () => [] },
1842
1855
  streamingActive: { type: Boolean, default: !1 },
@@ -1847,7 +1860,12 @@ const as = {
1847
1860
  // True while older messages are being fetched.
1848
1861
  loadingMore: { type: Boolean, default: !1 },
1849
1862
  // True when the server still has older messages to return.
1850
- hasMore: { type: Boolean, default: !1 }
1863
+ hasMore: { type: Boolean, default: !1 },
1864
+ // ISO timestamp frozen at the moment the user started viewing the
1865
+ // current thread. Drives the "Non lus" separator: rendered before the
1866
+ // first non-user group whose first message is newer than this anchor.
1867
+ // Empty string disables the separator (fresh thread or no prior read).
1868
+ unreadAnchorTs: { type: String, default: "" }
1851
1869
  },
1852
1870
  emits: ["load-more"],
1853
1871
  data() {
@@ -1887,6 +1905,19 @@ const as = {
1887
1905
  });
1888
1906
  }
1889
1907
  return t;
1908
+ },
1909
+ // Key of the first non-user group that starts after the unread anchor.
1910
+ // ISO 8601 timestamps sort lexicographically, so a string `>` compare
1911
+ // is correct here (same trick as the unread flag in Messenger.vue).
1912
+ unreadGroupKey() {
1913
+ if (!this.unreadAnchorTs) return null;
1914
+ for (const t of this.groups) {
1915
+ if (t.role === "user" || t.role === "system") continue;
1916
+ const e = t.messages[0];
1917
+ if (e != null && e.created_at && e.created_at > this.unreadAnchorTs)
1918
+ return t.key;
1919
+ }
1920
+ return null;
1890
1921
  }
1891
1922
  },
1892
1923
  watch: {
@@ -1904,11 +1935,11 @@ const as = {
1904
1935
  methods: {
1905
1936
  messageKey: ce,
1906
1937
  isAtBottom(t) {
1907
- return t.scrollHeight - t.scrollTop - t.clientHeight <= os;
1938
+ return t.scrollHeight - t.scrollTop - t.clientHeight <= ds;
1908
1939
  },
1909
1940
  onScroll() {
1910
1941
  const t = this.$refs.scrollEl;
1911
- t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= ls && (this._pendingLoadMore = !0, this.$emit("load-more")));
1942
+ t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= us && (this._pendingLoadMore = !0, this.$emit("load-more")));
1912
1943
  },
1913
1944
  // Capture pre-patch scroll state and restore it on the next tick.
1914
1945
  //
@@ -2006,7 +2037,7 @@ const as = {
2006
2037
  // logic. `null` means the item renders nothing (no body, no
2007
2038
  // bubble) and shouldn't count as a neighbour.
2008
2039
  itemKindOf(t) {
2009
- return t ? t.type === "action" && t.payload && t.payload.state !== "pending" || this.artifactOf(t) ? "card" : t.text_md ? "bubble" : null : null;
2040
+ return t ? t.type === "action" && t.payload && t.payload.state !== "pending" ? "bubble" : this.artifactOf(t) ? "card" : t.text_md ? "bubble" : null : null;
2010
2041
  },
2011
2042
  // Per-corner border radius for an item inside a multi-item
2012
2043
  // cluster. Geometric model:
@@ -2080,7 +2111,7 @@ const as = {
2080
2111
  },
2081
2112
  systemLabel(t) {
2082
2113
  var r, s, o;
2083
- const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = as[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
2114
+ const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = cs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
2084
2115
  return n.replace("{name}", a || "Un agent");
2085
2116
  },
2086
2117
  scrollToBottom() {
@@ -2088,125 +2119,136 @@ const as = {
2088
2119
  t && (t.scrollTop = t.scrollHeight);
2089
2120
  }
2090
2121
  }
2091
- }, ds = {
2122
+ }, ms = {
2092
2123
  key: 0,
2093
2124
  class: "wm-list__loadMore",
2094
2125
  role: "status",
2095
2126
  "aria-live": "polite"
2096
- }, us = {
2127
+ }, fs = {
2097
2128
  key: 1,
2098
2129
  class: "wm-list__historyEnd"
2099
- }, hs = {
2130
+ }, _s = {
2100
2131
  key: 2,
2101
2132
  class: "wm-list__sep"
2102
- }, ms = { class: "wm-list__sep-label" }, fs = {
2133
+ }, ps = { class: "wm-list__sep-label" }, vs = {
2134
+ key: 0,
2135
+ class: "wm-list__sep wm-list__sep--unread"
2136
+ }, gs = {
2103
2137
  key: 0,
2104
2138
  class: "wm-list__sysep"
2105
- }, _s = { class: "wm-list__sysep-label" }, ps = {
2139
+ }, ys = { class: "wm-list__sysep-label" }, ws = {
2106
2140
  key: 0,
2107
2141
  class: "wm-list__avatarSlot"
2108
- }, vs = {
2142
+ }, bs = {
2109
2143
  key: 3,
2110
2144
  class: "wm-list__body"
2111
- }, ys = { key: 0 }, gs = {
2145
+ }, ks = { key: 0 }, Cs = {
2112
2146
  key: 1,
2113
2147
  "aria-hidden": "true"
2114
- }, ws = { key: 2 }, bs = {
2148
+ }, As = { key: 2 }, Ss = {
2115
2149
  key: 3,
2116
2150
  class: "wm-list__row wm-list__row--ai fade-up"
2117
- }, ks = { class: "wm-list__avatarSlot" };
2118
- function Cs(t, e, n, a, r, s) {
2151
+ }, xs = { class: "wm-list__avatarSlot" };
2152
+ function Ms(t, e, n, a, r, s) {
2119
2153
  const o = I("AIAvatar"), d = I("HumanAvatar"), v = I("ActionResult"), C = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), L = I("Typing");
2120
2154
  return l(), c("div", {
2121
2155
  ref: "scrollEl",
2122
2156
  class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
2123
2157
  onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
2124
2158
  }, [
2125
- n.loadingMore ? (l(), c("div", ds, [...e[1] || (e[1] = [
2159
+ n.loadingMore ? (l(), c("div", ms, [...e[1] || (e[1] = [
2126
2160
  i("span", {
2127
2161
  class: "wm-list__loadMore-spinner",
2128
2162
  "aria-hidden": "true"
2129
2163
  }, null, -1),
2130
2164
  i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
2131
- ])])) : s.historyExhausted ? (l(), c("div", us, "Début de la conversation")) : g("", !0),
2132
- n.dateLabel ? (l(), c("div", hs, [
2165
+ ])])) : s.historyExhausted ? (l(), c("div", fs, "Début de la conversation")) : y("", !0),
2166
+ n.dateLabel ? (l(), c("div", _s, [
2133
2167
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2134
- i("span", ms, b(n.dateLabel), 1),
2168
+ i("span", ps, b(n.dateLabel), 1),
2135
2169
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2136
- ])) : g("", !0),
2137
- (l(!0), c(O, null, F(s.groups, (A, D) => (l(), c("div", {
2138
- key: A.key,
2139
- class: E(["wm-list__group", "wm-list__group--" + A.role])
2170
+ ])) : y("", !0),
2171
+ (l(!0), c(M, null, F(s.groups, (A, D) => (l(), c(M, {
2172
+ key: A.key
2140
2173
  }, [
2141
- A.role === "system" ? (l(), c("div", fs, [
2142
- e[4] || (e[4] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2143
- i("span", _s, b(A.systemLabel), 1),
2144
- e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2145
- ])) : (l(), c(O, { key: 1 }, [
2146
- (l(!0), c(O, null, F(A.messages, (x, N) => (l(), c("div", {
2147
- key: s.messageKey(x),
2148
- class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x._pending, "is-failed": x._failed }]]),
2149
- style: P(s.cornersStyle(A, N))
2150
- }, [
2151
- A.role !== "user" ? (l(), c("div", ps, [
2152
- N === A.messages.length - 1 ? (l(), c(O, { key: 0 }, [
2153
- A.role === "ai" ? (l(), $(o, {
2174
+ A.key === s.unreadGroupKey ? (l(), c("div", vs, [...e[4] || (e[4] = [
2175
+ i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
2176
+ i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
2177
+ i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
2178
+ ])])) : y("", !0),
2179
+ i("div", {
2180
+ class: E(["wm-list__group", "wm-list__group--" + A.role])
2181
+ }, [
2182
+ A.role === "system" ? (l(), c("div", gs, [
2183
+ e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2184
+ i("span", ys, b(A.systemLabel), 1),
2185
+ e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2186
+ ])) : (l(), c(M, { key: 1 }, [
2187
+ (l(!0), c(M, null, F(A.messages, (x, N) => (l(), c("div", {
2188
+ key: s.messageKey(x),
2189
+ class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x._pending, "is-failed": x._failed }]]),
2190
+ style: V(s.cornersStyle(A, N))
2191
+ }, [
2192
+ A.role !== "user" ? (l(), c("div", ws, [
2193
+ N === A.messages.length - 1 ? (l(), c(M, { key: 0 }, [
2194
+ A.role === "ai" ? (l(), $(o, {
2195
+ key: 0,
2196
+ size: 26
2197
+ })) : (l(), $(d, {
2198
+ key: 1,
2199
+ name: A.agentName,
2200
+ "avatar-url": A.agentAvatarUrl,
2201
+ size: 26
2202
+ }, null, 8, ["name", "avatar-url"]))
2203
+ ], 64)) : y("", !0)
2204
+ ])) : y("", !0),
2205
+ x.type === "action" && x.payload && x.payload.state !== "pending" ? (l(), $(v, {
2206
+ key: 1,
2207
+ state: x.payload.state,
2208
+ label: s.actionLabel(x),
2209
+ detail: s.actionDetail(x),
2210
+ artifact: s.actionArtifact(x)
2211
+ }, null, 8, ["state", "label", "detail", "artifact"])) : s.artifactOf(x) ? (l(), $(C, {
2212
+ key: 2,
2213
+ artifact: s.artifactOf(x)
2214
+ }, null, 8, ["artifact"])) : (l(), c("div", bs, [
2215
+ x.text_md ? (l(), $(w, {
2154
2216
  key: 0,
2155
- size: 26
2156
- })) : (l(), $(d, {
2217
+ role: A.role,
2218
+ text: x.text_md
2219
+ }, null, 8, ["role", "text"])) : y("", !0),
2220
+ s.attachmentsOf(x).length ? (l(), c("div", {
2157
2221
  key: 1,
2158
- name: A.agentName,
2159
- "avatar-url": A.agentAvatarUrl,
2160
- size: 26
2161
- }, null, 8, ["name", "avatar-url"]))
2162
- ], 64)) : g("", !0)
2163
- ])) : g("", !0),
2164
- x.type === "action" && x.payload && x.payload.state !== "pending" ? (l(), $(v, {
2165
- key: 1,
2166
- state: x.payload.state,
2167
- label: s.actionLabel(x),
2168
- detail: s.actionDetail(x),
2169
- artifact: s.actionArtifact(x)
2170
- }, null, 8, ["state", "label", "detail", "artifact"])) : s.artifactOf(x) ? (l(), $(C, {
2171
- key: 2,
2172
- artifact: s.artifactOf(x)
2173
- }, null, 8, ["artifact"])) : (l(), c("div", vs, [
2174
- x.text_md ? (l(), $(w, {
2175
- key: 0,
2176
- role: A.role,
2177
- text: x.text_md
2178
- }, null, 8, ["role", "text"])) : g("", !0),
2179
- s.attachmentsOf(x).length ? (l(), c("div", {
2180
- key: 1,
2181
- class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2182
- }, [
2183
- (l(!0), c(O, null, F(s.attachmentsOf(x), (j, z) => (l(), $(S, {
2184
- key: `${s.messageKey(x)}-att-${z}`,
2185
- attachment: j
2186
- }, null, 8, ["attachment"]))), 128))
2187
- ], 2)) : g("", !0)
2188
- ]))
2189
- ], 6))), 128)),
2190
- A.role !== "user" || s.lastTimeOf(A) ? (l(), c("div", {
2191
- key: 0,
2192
- class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2193
- }, [
2194
- A.role !== "user" ? (l(), c("span", ys, b(s.roleLabel(A)), 1)) : g("", !0),
2195
- A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", gs, "·")) : g("", !0),
2196
- s.lastTimeOf(A) ? (l(), c("span", ws, b(s.lastTimeOf(A)), 1)) : g("", !0)
2197
- ], 2)) : g("", !0)
2198
- ], 64))
2199
- ], 2))), 128)),
2200
- n.streamingActive ? (l(), c("div", bs, [
2201
- i("div", ks, [
2202
- H(o, { size: 26 })
2222
+ class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2223
+ }, [
2224
+ (l(!0), c(M, null, F(s.attachmentsOf(x), (j, H) => (l(), $(S, {
2225
+ key: `${s.messageKey(x)}-att-${H}`,
2226
+ attachment: j
2227
+ }, null, 8, ["attachment"]))), 128))
2228
+ ], 2)) : y("", !0)
2229
+ ]))
2230
+ ], 6))), 128)),
2231
+ A.role !== "user" || s.lastTimeOf(A) ? (l(), c("div", {
2232
+ key: 0,
2233
+ class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2234
+ }, [
2235
+ A.role !== "user" ? (l(), c("span", ks, b(s.roleLabel(A)), 1)) : y("", !0),
2236
+ A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Cs, "·")) : y("", !0),
2237
+ s.lastTimeOf(A) ? (l(), c("span", As, b(s.lastTimeOf(A)), 1)) : y("", !0)
2238
+ ], 2)) : y("", !0)
2239
+ ], 64))
2240
+ ], 2)
2241
+ ], 64))), 128)),
2242
+ n.streamingActive ? (l(), c("div", Ss, [
2243
+ i("div", xs, [
2244
+ P(o, { size: 26 })
2203
2245
  ]),
2204
- H(L)
2205
- ])) : g("", !0)
2246
+ P(L)
2247
+ ])) : y("", !0)
2206
2248
  ], 34);
2207
2249
  }
2208
- const As = /* @__PURE__ */ B(cs, [["render", Cs], ["__scopeId", "data-v-02fa95cc"]]), te = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2209
- function Ss() {
2250
+ const Ts = /* @__PURE__ */ B(hs, [["render", Ms], ["__scopeId", "data-v-0404f48d"]]), te = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2251
+ function Os() {
2210
2252
  return he && [
2211
2253
  "video/webm;codecs=vp9,opus",
2212
2254
  "video/webm;codecs=vp8,opus",
@@ -2217,7 +2259,7 @@ function Ss() {
2217
2259
  return (a = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : a.call(n, e);
2218
2260
  }) || "";
2219
2261
  }
2220
- function Se({ audio: t }) {
2262
+ function Ae({ audio: t }) {
2221
2263
  return {
2222
2264
  video: !0,
2223
2265
  audio: !!t,
@@ -2226,19 +2268,19 @@ function Se({ audio: t }) {
2226
2268
  systemAudio: t ? "include" : "exclude"
2227
2269
  };
2228
2270
  }
2229
- function ji(t) {
2271
+ function Pi(t) {
2230
2272
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
2231
2273
  }
2232
- async function xs() {
2274
+ async function Is() {
2233
2275
  if (!te) return null;
2234
2276
  let t;
2235
2277
  try {
2236
- t = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !1 }));
2278
+ t = await navigator.mediaDevices.getDisplayMedia(Ae({ audio: !1 }));
2237
2279
  } catch (e) {
2238
2280
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2239
2281
  }
2240
2282
  try {
2241
- return await Ms(t);
2283
+ return await Es(t);
2242
2284
  } catch (e) {
2243
2285
  return console.error("[media] screenshot capture", e), null;
2244
2286
  } finally {
@@ -2247,7 +2289,7 @@ async function xs() {
2247
2289
  });
2248
2290
  }
2249
2291
  }
2250
- async function Ms(t) {
2292
+ async function Es(t) {
2251
2293
  const e = document.createElement("video");
2252
2294
  e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
2253
2295
  const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
@@ -2257,16 +2299,16 @@ async function Ms(t) {
2257
2299
  }), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2258
2300
  return new File([s], `capture-${o}.png`, { type: "image/png" });
2259
2301
  }
2260
- async function Ts(t = {}) {
2302
+ async function Bs(t = {}) {
2261
2303
  var C;
2262
2304
  if (!te || !he) return null;
2263
2305
  let e;
2264
2306
  try {
2265
- e = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !0 }));
2307
+ e = await navigator.mediaDevices.getDisplayMedia(Ae({ audio: !0 }));
2266
2308
  } catch (w) {
2267
2309
  return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
2268
2310
  }
2269
- const n = Ss();
2311
+ const n = Os();
2270
2312
  let a;
2271
2313
  try {
2272
2314
  a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
@@ -2318,7 +2360,7 @@ async function Ts(t = {}) {
2318
2360
  }
2319
2361
  };
2320
2362
  }
2321
- const Is = [
2363
+ const Ls = [
2322
2364
  {
2323
2365
  action: "file",
2324
2366
  label: "Joindre un fichier",
@@ -2334,7 +2376,7 @@ const Is = [
2334
2376
  label: "Enregistrer l'écran",
2335
2377
  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"
2336
2378
  }
2337
- ], Os = {
2379
+ ], Rs = {
2338
2380
  name: "WmComposer",
2339
2381
  props: {
2340
2382
  modelValue: { type: String, default: "" },
@@ -2357,7 +2399,7 @@ const Is = [
2357
2399
  return !this.disabled && !!this.local.trim();
2358
2400
  },
2359
2401
  attachItems() {
2360
- return Is.map((t) => ({
2402
+ return Ls.map((t) => ({
2361
2403
  ...t,
2362
2404
  disabled: t.action === "screenshot" && !te || t.action === "record" && (!te || !he)
2363
2405
  }));
@@ -2429,13 +2471,13 @@ const Is = [
2429
2471
  },
2430
2472
  async captureScreenshot() {
2431
2473
  if (this.disabled) return;
2432
- const t = await xs();
2474
+ const t = await Is();
2433
2475
  t && this.$emit("attach", t);
2434
2476
  },
2435
2477
  async startRecording() {
2436
2478
  if (this.recording || this.disabled) return;
2437
2479
  this.recordingElapsed = 0;
2438
- const t = await Ts({
2480
+ const t = await Bs({
2439
2481
  onstart: () => {
2440
2482
  this.recording = !0;
2441
2483
  },
@@ -2460,33 +2502,33 @@ const Is = [
2460
2502
  }
2461
2503
  }
2462
2504
  }
2463
- }, Es = { class: "wm-compose-wrap" }, Bs = {
2505
+ }, $s = { class: "wm-compose-wrap" }, Fs = {
2464
2506
  key: 0,
2465
2507
  class: "wm-rec"
2466
- }, Ls = { class: "wm-rec__lbl" }, Rs = {
2508
+ }, js = { class: "wm-rec__lbl" }, Us = {
2467
2509
  key: 1,
2468
2510
  class: "wm-compose__menu",
2469
2511
  role: "menu"
2470
- }, $s = ["disabled", "onClick"], Fs = { class: "wm-compose__menuIcon" }, js = {
2512
+ }, Ds = ["disabled", "onClick"], Ns = { class: "wm-compose__menuIcon" }, Ps = {
2471
2513
  viewBox: "0 0 24 24",
2472
2514
  width: "14",
2473
2515
  height: "14",
2474
2516
  "aria-hidden": "true"
2475
- }, Us = ["d"], Ds = ["placeholder", "disabled"], Ns = { class: "wm-compose__actions" }, Ps = ["title", "aria-label", "disabled"], Hs = ["disabled"];
2476
- function zs(t, e, n, a, r, s) {
2477
- return l(), c("div", Es, [
2478
- r.recording ? (l(), c("div", Bs, [
2517
+ }, Hs = ["d"], zs = ["placeholder", "disabled"], Vs = { class: "wm-compose__actions" }, qs = ["title", "aria-label", "disabled"], Ws = ["disabled"];
2518
+ function Gs(t, e, n, a, r, s) {
2519
+ return l(), c("div", $s, [
2520
+ r.recording ? (l(), c("div", Fs, [
2479
2521
  e[8] || (e[8] = i("span", {
2480
2522
  class: "wm-rec__dot",
2481
2523
  "aria-hidden": "true"
2482
2524
  }, null, -1)),
2483
- i("span", Ls, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2525
+ i("span", js, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2484
2526
  i("button", {
2485
2527
  type: "button",
2486
2528
  class: "wm-rec__stop",
2487
2529
  onClick: e[0] || (e[0] = (...o) => s.stopRecording && s.stopRecording(...o))
2488
2530
  }, "Arrêter")
2489
- ])) : g("", !0),
2531
+ ])) : y("", !0),
2490
2532
  i("form", {
2491
2533
  class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2492
2534
  onSubmit: e[7] || (e[7] = Y((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
@@ -2502,17 +2544,17 @@ function zs(t, e, n, a, r, s) {
2502
2544
  key: 0,
2503
2545
  class: "wm-compose__overlay",
2504
2546
  onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
2505
- })) : g("", !0),
2506
- r.attachOpen ? (l(), c("div", Rs, [
2507
- (l(!0), c(O, null, F(s.attachItems, (o) => (l(), c("button", {
2547
+ })) : y("", !0),
2548
+ r.attachOpen ? (l(), c("div", Us, [
2549
+ (l(!0), c(M, null, F(s.attachItems, (o) => (l(), c("button", {
2508
2550
  key: o.action,
2509
2551
  type: "button",
2510
2552
  class: "wm-compose__menuItem",
2511
2553
  disabled: o.disabled,
2512
2554
  onClick: (d) => s.onAttachAction(o.action)
2513
2555
  }, [
2514
- i("span", Fs, [
2515
- (l(), c("svg", js, [
2556
+ i("span", Ns, [
2557
+ (l(), c("svg", Ps, [
2516
2558
  i("path", {
2517
2559
  d: o.path,
2518
2560
  stroke: "currentColor",
@@ -2520,13 +2562,13 @@ function zs(t, e, n, a, r, s) {
2520
2562
  "stroke-linecap": "round",
2521
2563
  "stroke-linejoin": "round",
2522
2564
  fill: "none"
2523
- }, null, 8, Us)
2565
+ }, null, 8, Hs)
2524
2566
  ]))
2525
2567
  ]),
2526
2568
  i("span", null, b(o.label), 1)
2527
- ], 8, $s))), 128))
2528
- ])) : g("", !0),
2529
- V(i("textarea", {
2569
+ ], 8, Ds))), 128))
2570
+ ])) : y("", !0),
2571
+ z(i("textarea", {
2530
2572
  ref: "inputEl",
2531
2573
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
2532
2574
  class: "wm-compose__input",
@@ -2535,10 +2577,10 @@ function zs(t, e, n, a, r, s) {
2535
2577
  disabled: n.disabled,
2536
2578
  onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
2537
2579
  onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
2538
- }, null, 40, Ds), [
2580
+ }, null, 40, zs), [
2539
2581
  [G, r.local]
2540
2582
  ]),
2541
- i("div", Ns, [
2583
+ i("div", Vs, [
2542
2584
  i("button", {
2543
2585
  type: "button",
2544
2586
  class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
@@ -2560,7 +2602,7 @@ function zs(t, e, n, a, r, s) {
2560
2602
  }, [
2561
2603
  i("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" })
2562
2604
  ], -1)
2563
- ])], 10, Ps),
2605
+ ])], 10, qs),
2564
2606
  i("button", {
2565
2607
  type: "submit",
2566
2608
  class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
@@ -2580,12 +2622,12 @@ function zs(t, e, n, a, r, s) {
2580
2622
  }, [
2581
2623
  i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
2582
2624
  ], -1)
2583
- ])], 10, Hs)
2625
+ ])], 10, Ws)
2584
2626
  ])
2585
2627
  ], 34)
2586
2628
  ]);
2587
2629
  }
2588
- const Vs = /* @__PURE__ */ B(Os, [["render", zs], ["__scopeId", "data-v-14fa9ec0"]]), qs = {
2630
+ const Ks = /* @__PURE__ */ B(Rs, [["render", Gs], ["__scopeId", "data-v-14fa9ec0"]]), Ys = {
2589
2631
  name: "WmSuggestionChips",
2590
2632
  props: {
2591
2633
  items: { type: Array, default: () => [] },
@@ -2602,22 +2644,22 @@ const Vs = /* @__PURE__ */ B(Os, [["render", zs], ["__scopeId", "data-v-14fa9ec0
2602
2644
  return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
2603
2645
  }
2604
2646
  }
2605
- }, Ws = ["onClick"];
2606
- function Gs(t, e, n, a, r, s) {
2647
+ }, Js = ["onClick"];
2648
+ function Xs(t, e, n, a, r, s) {
2607
2649
  return n.items.length ? (l(), c("div", {
2608
2650
  key: s.batchKey,
2609
2651
  class: "wm-chips"
2610
2652
  }, [
2611
- (l(!0), c(O, null, F(n.items, (o, d) => (l(), c("button", {
2653
+ (l(!0), c(M, null, F(n.items, (o, d) => (l(), c("button", {
2612
2654
  key: d,
2613
2655
  type: "button",
2614
2656
  class: "wm-chip",
2615
- style: P({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
2657
+ style: V({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
2616
2658
  onClick: (v) => t.$emit("select", o)
2617
- }, b(o.label), 13, Ws))), 128))
2618
- ])) : g("", !0);
2659
+ }, b(o.label), 13, Js))), 128))
2660
+ ])) : y("", !0);
2619
2661
  }
2620
- const Ks = /* @__PURE__ */ B(qs, [["render", Gs], ["__scopeId", "data-v-55aa529d"]]), Ys = {
2662
+ const Qs = /* @__PURE__ */ B(Ys, [["render", Xs], ["__scopeId", "data-v-55aa529d"]]), Zs = {
2621
2663
  name: "WmApprovalCard",
2622
2664
  components: { AIAvatar: J },
2623
2665
  props: {
@@ -2650,41 +2692,41 @@ const Ks = /* @__PURE__ */ B(qs, [["render", Gs], ["__scopeId", "data-v-55aa529d
2650
2692
  return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
2651
2693
  }
2652
2694
  }
2653
- }, Js = { class: "wm-approval" }, Xs = { class: "wm-approval__head" }, Qs = { class: "wm-approval__icon" }, Zs = { class: "wm-approval__main" }, er = { class: "wm-approval__title" }, tr = {
2695
+ }, er = { class: "wm-approval" }, tr = { class: "wm-approval__head" }, nr = { class: "wm-approval__icon" }, sr = { class: "wm-approval__main" }, rr = { class: "wm-approval__title" }, ir = {
2654
2696
  key: 0,
2655
2697
  class: "wm-approval__detail"
2656
- }, nr = { class: "wm-approval__actions" };
2657
- function sr(t, e, n, a, r, s) {
2698
+ }, ar = { class: "wm-approval__actions" };
2699
+ function or(t, e, n, a, r, s) {
2658
2700
  const o = I("AIAvatar");
2659
- return l(), c("div", Js, [
2660
- i("div", Xs, [
2661
- i("div", Qs, [
2662
- H(o, { size: 24 })
2701
+ return l(), c("div", er, [
2702
+ i("div", tr, [
2703
+ i("div", nr, [
2704
+ P(o, { size: 24 })
2663
2705
  ]),
2664
- i("div", Zs, [
2665
- i("div", er, b(n.action), 1),
2666
- n.detail ? (l(), c("div", tr, b(n.detail), 1)) : g("", !0)
2706
+ i("div", sr, [
2707
+ i("div", rr, b(n.action), 1),
2708
+ n.detail ? (l(), c("div", ir, b(n.detail), 1)) : y("", !0)
2667
2709
  ])
2668
2710
  ]),
2669
- i("div", nr, [
2711
+ i("div", ar, [
2670
2712
  s.rejectId ? (l(), c("button", {
2671
2713
  key: 0,
2672
2714
  type: "button",
2673
2715
  class: "wm-approval__btn wm-approval__btn--neutral",
2674
2716
  onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
2675
- }, b(s.rejectLabel), 1)) : g("", !0),
2717
+ }, b(s.rejectLabel), 1)) : y("", !0),
2676
2718
  s.approveId ? (l(), c("button", {
2677
2719
  key: 1,
2678
2720
  type: "button",
2679
2721
  class: "wm-approval__btn wm-approval__btn--primary",
2680
2722
  onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
2681
- }, b(s.approveLabel), 1)) : g("", !0)
2723
+ }, b(s.approveLabel), 1)) : y("", !0)
2682
2724
  ])
2683
2725
  ]);
2684
2726
  }
2685
- const rr = /* @__PURE__ */ B(Ys, [["render", sr], ["__scopeId", "data-v-b1be139c"]]);
2727
+ const lr = /* @__PURE__ */ B(Zs, [["render", or], ["__scopeId", "data-v-b1be139c"]]);
2686
2728
  let ve = 0;
2687
- const ir = /* @__PURE__ */ new Set([
2729
+ const cr = /* @__PURE__ */ new Set([
2688
2730
  "text",
2689
2731
  "textarea",
2690
2732
  "number",
@@ -2692,7 +2734,7 @@ const ir = /* @__PURE__ */ new Set([
2692
2734
  "select",
2693
2735
  "multiselect",
2694
2736
  "date"
2695
- ]), ar = {
2737
+ ]), dr = {
2696
2738
  name: "WmFormCard",
2697
2739
  components: { AIAvatar: J },
2698
2740
  props: {
@@ -2715,7 +2757,7 @@ const ir = /* @__PURE__ */ new Set([
2715
2757
  // douteux.
2716
2758
  normalizedFields() {
2717
2759
  var e;
2718
- return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !ir.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2760
+ return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !cr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2719
2761
  }
2720
2762
  },
2721
2763
  created() {
@@ -2766,50 +2808,50 @@ const ir = /* @__PURE__ */ new Set([
2766
2808
  }
2767
2809
  }
2768
2810
  }
2769
- }, or = { class: "wm-form" }, lr = { class: "wm-form__head" }, cr = { class: "wm-form__icon" }, dr = { class: "wm-form__main" }, ur = { class: "wm-form__title" }, hr = {
2811
+ }, ur = { class: "wm-form" }, hr = { class: "wm-form__head" }, mr = { class: "wm-form__icon" }, fr = { class: "wm-form__main" }, _r = { class: "wm-form__title" }, pr = {
2770
2812
  key: 0,
2771
2813
  class: "wm-form__detail"
2772
- }, mr = ["for"], fr = {
2814
+ }, vr = ["for"], gr = {
2773
2815
  key: 0,
2774
2816
  class: "wm-form__req",
2775
2817
  "aria-hidden": "true"
2776
- }, _r = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], pr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], vr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], yr = ["id", "onUpdate:modelValue", "required", "disabled"], gr = {
2818
+ }, yr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], wr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], br = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], kr = ["id", "onUpdate:modelValue", "required", "disabled"], Cr = {
2777
2819
  key: 4,
2778
2820
  class: "wm-form__bool"
2779
- }, wr = ["id", "onUpdate:modelValue", "disabled"], br = ["id", "onUpdate:modelValue", "required", "disabled"], kr = {
2821
+ }, Ar = ["id", "onUpdate:modelValue", "disabled"], Sr = ["id", "onUpdate:modelValue", "required", "disabled"], xr = {
2780
2822
  value: "",
2781
2823
  disabled: ""
2782
- }, Cr = ["value"], Ar = {
2824
+ }, Mr = ["value"], Tr = {
2783
2825
  key: 6,
2784
2826
  class: "wm-form__multi"
2785
- }, Sr = ["value", "checked", "disabled", "onChange"], xr = {
2827
+ }, Or = ["value", "checked", "disabled", "onChange"], Ir = {
2786
2828
  key: 0,
2787
2829
  class: "wm-form__err"
2788
- }, Mr = ["disabled"], Tr = {
2830
+ }, Er = ["disabled"], Br = {
2789
2831
  key: 0,
2790
2832
  class: "wm-form__spinner",
2791
2833
  "aria-hidden": "true"
2792
- }, Ir = {
2834
+ }, Lr = {
2793
2835
  key: 2,
2794
2836
  class: "wm-form__doneLbl"
2795
2837
  };
2796
- function Or(t, e, n, a, r, s) {
2838
+ function Rr(t, e, n, a, r, s) {
2797
2839
  const o = I("AIAvatar");
2798
- return l(), c("div", or, [
2799
- i("div", lr, [
2800
- i("div", cr, [
2801
- H(o, { size: 24 })
2840
+ return l(), c("div", ur, [
2841
+ i("div", hr, [
2842
+ i("div", mr, [
2843
+ P(o, { size: 24 })
2802
2844
  ]),
2803
- i("div", dr, [
2804
- i("div", ur, b(n.form.title || "Formulaire"), 1),
2805
- n.form.description ? (l(), c("div", hr, b(n.form.description), 1)) : g("", !0)
2845
+ i("div", fr, [
2846
+ i("div", _r, b(n.form.title || "Formulaire"), 1),
2847
+ n.form.description ? (l(), c("div", pr, b(n.form.description), 1)) : y("", !0)
2806
2848
  ])
2807
2849
  ]),
2808
2850
  i("form", {
2809
2851
  class: "wm-form__body",
2810
2852
  onSubmit: e[0] || (e[0] = Y((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
2811
2853
  }, [
2812
- (l(!0), c(O, null, F(s.normalizedFields, (d) => (l(), c("div", {
2854
+ (l(!0), c(M, null, F(s.normalizedFields, (d) => (l(), c("div", {
2813
2855
  key: d.key,
2814
2856
  class: "wm-form__field"
2815
2857
  }, [
@@ -2818,9 +2860,9 @@ function Or(t, e, n, a, r, s) {
2818
2860
  class: "wm-form__label"
2819
2861
  }, [
2820
2862
  se(b(d.label), 1),
2821
- d.required ? (l(), c("span", fr, "*")) : g("", !0)
2822
- ], 8, mr),
2823
- d.type === "text" ? V((l(), c("input", {
2863
+ d.required ? (l(), c("span", gr, "*")) : y("", !0)
2864
+ ], 8, vr),
2865
+ d.type === "text" ? z((l(), c("input", {
2824
2866
  key: 0,
2825
2867
  id: `wm-f-${r._uid}-${d.key}`,
2826
2868
  "onUpdate:modelValue": (v) => r.values[d.key] = v,
@@ -2829,9 +2871,9 @@ function Or(t, e, n, a, r, s) {
2829
2871
  placeholder: d.placeholder || "",
2830
2872
  required: d.required,
2831
2873
  disabled: n.readOnly || r.busy
2832
- }, null, 8, _r)), [
2874
+ }, null, 8, yr)), [
2833
2875
  [G, r.values[d.key]]
2834
- ]) : d.type === "textarea" ? V((l(), c("textarea", {
2876
+ ]) : d.type === "textarea" ? z((l(), c("textarea", {
2835
2877
  key: 1,
2836
2878
  id: `wm-f-${r._uid}-${d.key}`,
2837
2879
  "onUpdate:modelValue": (v) => r.values[d.key] = v,
@@ -2840,9 +2882,9 @@ function Or(t, e, n, a, r, s) {
2840
2882
  placeholder: d.placeholder || "",
2841
2883
  required: d.required,
2842
2884
  disabled: n.readOnly || r.busy
2843
- }, null, 8, pr)), [
2885
+ }, null, 8, wr)), [
2844
2886
  [G, r.values[d.key]]
2845
- ]) : d.type === "number" ? V((l(), c("input", {
2887
+ ]) : d.type === "number" ? z((l(), c("input", {
2846
2888
  key: 2,
2847
2889
  id: `wm-f-${r._uid}-${d.key}`,
2848
2890
  "onUpdate:modelValue": (v) => r.values[d.key] = v,
@@ -2851,14 +2893,14 @@ function Or(t, e, n, a, r, s) {
2851
2893
  placeholder: d.placeholder || "",
2852
2894
  required: d.required,
2853
2895
  disabled: n.readOnly || r.busy
2854
- }, null, 8, vr)), [
2896
+ }, null, 8, br)), [
2855
2897
  [
2856
2898
  G,
2857
2899
  r.values[d.key],
2858
2900
  void 0,
2859
2901
  { number: !0 }
2860
2902
  ]
2861
- ]) : d.type === "date" ? V((l(), c("input", {
2903
+ ]) : d.type === "date" ? z((l(), c("input", {
2862
2904
  key: 3,
2863
2905
  id: `wm-f-${r._uid}-${d.key}`,
2864
2906
  "onUpdate:modelValue": (v) => r.values[d.key] = v,
@@ -2866,19 +2908,19 @@ function Or(t, e, n, a, r, s) {
2866
2908
  class: "wm-form__input",
2867
2909
  required: d.required,
2868
2910
  disabled: n.readOnly || r.busy
2869
- }, null, 8, yr)), [
2911
+ }, null, 8, kr)), [
2870
2912
  [G, r.values[d.key]]
2871
- ]) : d.type === "boolean" ? (l(), c("label", gr, [
2872
- V(i("input", {
2913
+ ]) : d.type === "boolean" ? (l(), c("label", Cr, [
2914
+ z(i("input", {
2873
2915
  id: `wm-f-${r._uid}-${d.key}`,
2874
2916
  "onUpdate:modelValue": (v) => r.values[d.key] = v,
2875
2917
  type: "checkbox",
2876
2918
  disabled: n.readOnly || r.busy
2877
- }, null, 8, wr), [
2878
- [Ee, r.values[d.key]]
2919
+ }, null, 8, Ar), [
2920
+ [Ie, r.values[d.key]]
2879
2921
  ]),
2880
2922
  i("span", null, b(d.placeholder || "Oui"), 1)
2881
- ])) : d.type === "select" ? V((l(), c("select", {
2923
+ ])) : d.type === "select" ? z((l(), c("select", {
2882
2924
  key: 5,
2883
2925
  id: `wm-f-${r._uid}-${d.key}`,
2884
2926
  "onUpdate:modelValue": (v) => r.values[d.key] = v,
@@ -2886,15 +2928,15 @@ function Or(t, e, n, a, r, s) {
2886
2928
  required: d.required,
2887
2929
  disabled: n.readOnly || r.busy
2888
2930
  }, [
2889
- i("option", kr, b(d.placeholder || "Choisir…"), 1),
2890
- (l(!0), c(O, null, F(d.options, (v) => (l(), c("option", {
2931
+ i("option", xr, b(d.placeholder || "Choisir…"), 1),
2932
+ (l(!0), c(M, null, F(d.options, (v) => (l(), c("option", {
2891
2933
  key: v.value,
2892
2934
  value: v.value
2893
- }, b(v.label), 9, Cr))), 128))
2894
- ], 8, br)), [
2895
- [Be, r.values[d.key]]
2896
- ]) : d.type === "multiselect" ? (l(), c("div", Ar, [
2897
- (l(!0), c(O, null, F(d.options, (v) => (l(), c("label", {
2935
+ }, b(v.label), 9, Mr))), 128))
2936
+ ], 8, Sr)), [
2937
+ [Ee, r.values[d.key]]
2938
+ ]) : d.type === "multiselect" ? (l(), c("div", Tr, [
2939
+ (l(!0), c(M, null, F(d.options, (v) => (l(), c("label", {
2898
2940
  key: v.value,
2899
2941
  class: "wm-form__multiItem"
2900
2942
  }, [
@@ -2904,25 +2946,25 @@ function Or(t, e, n, a, r, s) {
2904
2946
  checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
2905
2947
  disabled: n.readOnly || r.busy,
2906
2948
  onChange: (C) => s.toggleMulti(d.key, v.value, C.target.checked)
2907
- }, null, 40, Sr),
2949
+ }, null, 40, Or),
2908
2950
  i("span", null, b(v.label), 1)
2909
2951
  ]))), 128))
2910
- ])) : g("", !0)
2952
+ ])) : y("", !0)
2911
2953
  ]))), 128)),
2912
- r.error ? (l(), c("div", xr, b(r.error), 1)) : g("", !0),
2913
- n.readOnly ? (l(), c("div", Ir, "Réponse envoyée")) : (l(), c("button", {
2954
+ r.error ? (l(), c("div", Ir, b(r.error), 1)) : y("", !0),
2955
+ n.readOnly ? (l(), c("div", Lr, "Réponse envoyée")) : (l(), c("button", {
2914
2956
  key: 1,
2915
2957
  type: "submit",
2916
2958
  class: "wm-form__submit",
2917
2959
  disabled: r.busy
2918
2960
  }, [
2919
- r.busy ? (l(), c("span", Tr)) : g("", !0),
2961
+ r.busy ? (l(), c("span", Br)) : y("", !0),
2920
2962
  i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
2921
- ], 8, Mr))
2963
+ ], 8, Er))
2922
2964
  ], 32)
2923
2965
  ]);
2924
2966
  }
2925
- const Er = /* @__PURE__ */ B(ar, [["render", Or], ["__scopeId", "data-v-64b40f76"]]), Br = {
2967
+ const $r = /* @__PURE__ */ B(dr, [["render", Rr], ["__scopeId", "data-v-64b40f76"]]), Fr = {
2926
2968
  name: "WmFeedback",
2927
2969
  props: {
2928
2970
  busy: { type: Boolean, default: !1 },
@@ -2946,43 +2988,43 @@ const Er = /* @__PURE__ */ B(ar, [["render", Or], ["__scopeId", "data-v-64b40f76
2946
2988
  !this.sel || this.busy || this.$emit("submit", { rating: this.sel });
2947
2989
  }
2948
2990
  }
2949
- }, Lr = { class: "wm-fb" }, Rr = { class: "wm-fb__row" }, $r = ["onClick"], Fr = { class: "wm-fb__emoji" }, jr = { class: "wm-fb__label" }, Ur = ["disabled"], Dr = {
2991
+ }, jr = { class: "wm-fb" }, Ur = { class: "wm-fb__row" }, Dr = ["onClick"], Nr = { class: "wm-fb__emoji" }, Pr = { class: "wm-fb__label" }, Hr = ["disabled"], zr = {
2950
2992
  key: 1,
2951
2993
  class: "wm-fb__done"
2952
2994
  };
2953
- function Nr(t, e, n, a, r, s) {
2954
- return l(), c("div", Lr, [
2955
- n.done ? (l(), c("div", Dr, [...e[3] || (e[3] = [
2995
+ function Vr(t, e, n, a, r, s) {
2996
+ return l(), c("div", jr, [
2997
+ n.done ? (l(), c("div", zr, [...e[3] || (e[3] = [
2956
2998
  ue('<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)
2957
- ])])) : (l(), c(O, { key: 0 }, [
2999
+ ])])) : (l(), c(M, { key: 0 }, [
2958
3000
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
2959
3001
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
2960
- i("div", Rr, [
2961
- (l(!0), c(O, null, F(r.options, (o) => (l(), c("button", {
3002
+ i("div", Ur, [
3003
+ (l(!0), c(M, null, F(r.options, (o) => (l(), c("button", {
2962
3004
  key: o.v,
2963
3005
  type: "button",
2964
3006
  class: E(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
2965
3007
  onClick: (d) => r.sel = o.v
2966
3008
  }, [
2967
- i("span", Fr, b(o.e), 1),
2968
- i("span", jr, b(o.l), 1)
2969
- ], 10, $r))), 128))
3009
+ i("span", Nr, b(o.e), 1),
3010
+ i("span", Pr, b(o.l), 1)
3011
+ ], 10, Dr))), 128))
2970
3012
  ]),
2971
3013
  i("button", {
2972
3014
  type: "button",
2973
3015
  class: "wm-fb__send",
2974
3016
  disabled: !r.sel || n.busy,
2975
3017
  onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
2976
- }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Ur)
3018
+ }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Hr)
2977
3019
  ], 64))
2978
3020
  ]);
2979
3021
  }
2980
- const Pr = /* @__PURE__ */ B(Br, [["render", Nr], ["__scopeId", "data-v-6f45ff3b"]]);
2981
- function Hr(t) {
3022
+ const qr = /* @__PURE__ */ B(Fr, [["render", Vr], ["__scopeId", "data-v-6f45ff3b"]]);
3023
+ function Wr(t) {
2982
3024
  const e = new Date(t);
2983
3025
  return e.setHours(0, 0, 0, 0), e;
2984
3026
  }
2985
- const zr = {
3027
+ const Gr = {
2986
3028
  name: "WmHistoryDrawer",
2987
3029
  props: {
2988
3030
  conversations: { type: Array, default: () => [] },
@@ -3016,7 +3058,7 @@ const zr = {
3016
3058
  ) : this.normalized;
3017
3059
  },
3018
3060
  groups() {
3019
- const e = Hr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3061
+ const e = Wr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3020
3062
  for (const o of this.filtered) {
3021
3063
  if (!o.stamp) {
3022
3064
  s.push(o);
@@ -3034,29 +3076,29 @@ const zr = {
3034
3076
  return this.filtered.length > 0;
3035
3077
  }
3036
3078
  }
3037
- }, Vr = { class: "wm-hd" }, qr = {
3079
+ }, Kr = { class: "wm-hd" }, Yr = {
3038
3080
  class: "wm-hd__panel",
3039
3081
  role: "dialog",
3040
3082
  "aria-label": "Vos discussions"
3041
- }, Wr = { class: "wm-hd__head" }, Gr = { class: "wm-hd__top" }, Kr = { class: "wm-hd__search" }, Yr = { class: "wm-hd__list" }, Jr = {
3083
+ }, Jr = { class: "wm-hd__head" }, Xr = { class: "wm-hd__top" }, Qr = { class: "wm-hd__search" }, Zr = { class: "wm-hd__list" }, ei = {
3042
3084
  key: 0,
3043
3085
  class: "wm-hd__group"
3044
- }, Xr = { class: "wm-hd__groupLabel" }, Qr = { class: "wm-hd__rows" }, Zr = ["onClick"], ei = { class: "wm-hd__rowIcon" }, ti = {
3086
+ }, ti = { class: "wm-hd__groupLabel" }, ni = { class: "wm-hd__rows" }, si = ["onClick"], ri = { class: "wm-hd__rowIcon" }, ii = {
3045
3087
  key: 0,
3046
3088
  class: "wm-hd__rowDot",
3047
3089
  "aria-label": "Message non lu"
3048
- }, ni = { class: "wm-hd__rowBody" }, si = { class: "wm-hd__rowTop" }, ri = { class: "wm-hd__rowTitle" }, ii = { class: "wm-hd__rowPreview" }, ai = {
3090
+ }, ai = { class: "wm-hd__rowBody" }, oi = { class: "wm-hd__rowTop" }, li = { class: "wm-hd__rowTitle" }, ci = { class: "wm-hd__rowPreview" }, di = {
3049
3091
  key: 0,
3050
3092
  class: "wm-hd__empty"
3051
3093
  };
3052
- function oi(t, e, n, a, r, s) {
3053
- return l(), c("div", Vr, [
3094
+ function ui(t, e, n, a, r, s) {
3095
+ return l(), c("div", Kr, [
3054
3096
  i("div", {
3055
3097
  class: "wm-hd__scrim",
3056
3098
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3057
3099
  }),
3058
- i("aside", qr, [
3059
- i("div", Wr, [
3100
+ i("aside", Yr, [
3101
+ i("div", Jr, [
3060
3102
  e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
3061
3103
  i("div", { class: "wm-hd__title" }, "Vos discussions"),
3062
3104
  i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
@@ -3082,7 +3124,7 @@ function oi(t, e, n, a, r, s) {
3082
3124
  ], -1)
3083
3125
  ])])
3084
3126
  ]),
3085
- i("div", Gr, [
3127
+ i("div", Xr, [
3086
3128
  i("button", {
3087
3129
  type: "button",
3088
3130
  class: "wm-hd__new",
@@ -3105,7 +3147,7 @@ function oi(t, e, n, a, r, s) {
3105
3147
  ], -1),
3106
3148
  i("span", null, "Démarrer un nouveau fil", -1)
3107
3149
  ])]),
3108
- i("div", Kr, [
3150
+ i("div", Qr, [
3109
3151
  e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
3110
3152
  i("svg", {
3111
3153
  width: "12",
@@ -3121,7 +3163,7 @@ function oi(t, e, n, a, r, s) {
3121
3163
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3122
3164
  ])
3123
3165
  ], -1)),
3124
- V(i("input", {
3166
+ z(i("input", {
3125
3167
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3126
3168
  type: "text",
3127
3169
  placeholder: "Rechercher dans vos messages",
@@ -3131,14 +3173,14 @@ function oi(t, e, n, a, r, s) {
3131
3173
  ])
3132
3174
  ])
3133
3175
  ]),
3134
- i("div", Yr, [
3135
- (l(!0), c(O, null, F(s.groups, (o) => (l(), c(O, {
3176
+ i("div", Zr, [
3177
+ (l(!0), c(M, null, F(s.groups, (o) => (l(), c(M, {
3136
3178
  key: o.key
3137
3179
  }, [
3138
- o.items.length ? (l(), c("div", Jr, [
3139
- i("div", Xr, b(o.label), 1),
3140
- i("div", Qr, [
3141
- (l(!0), c(O, null, F(o.items, (d) => (l(), c("button", {
3180
+ o.items.length ? (l(), c("div", ei, [
3181
+ i("div", ti, b(o.label), 1),
3182
+ i("div", ni, [
3183
+ (l(!0), c(M, null, F(o.items, (d) => (l(), c("button", {
3142
3184
  key: d.id,
3143
3185
  type: "button",
3144
3186
  class: E(["wm-hd__row", {
@@ -3147,7 +3189,7 @@ function oi(t, e, n, a, r, s) {
3147
3189
  }]),
3148
3190
  onClick: (v) => t.$emit("pick", d)
3149
3191
  }, [
3150
- i("div", ei, [
3192
+ i("div", ri, [
3151
3193
  e[8] || (e[8] = i("svg", {
3152
3194
  width: "11",
3153
3195
  height: "11",
@@ -3161,24 +3203,24 @@ function oi(t, e, n, a, r, s) {
3161
3203
  opacity: "0.92"
3162
3204
  })
3163
3205
  ], -1)),
3164
- d.unread ? (l(), c("span", ti)) : g("", !0)
3206
+ d.unread ? (l(), c("span", ii)) : y("", !0)
3165
3207
  ]),
3166
- i("div", ni, [
3167
- i("div", si, [
3168
- i("span", ri, b(d.title), 1)
3208
+ i("div", ai, [
3209
+ i("div", oi, [
3210
+ i("span", li, b(d.title), 1)
3169
3211
  ]),
3170
- i("div", ii, b(d.preview || "Aucun message"), 1)
3212
+ i("div", ci, b(d.preview || "Aucun message"), 1)
3171
3213
  ])
3172
- ], 10, Zr))), 128))
3214
+ ], 10, si))), 128))
3173
3215
  ])
3174
- ])) : g("", !0)
3216
+ ])) : y("", !0)
3175
3217
  ], 64))), 128)),
3176
- s.hasAny ? g("", !0) : (l(), c("div", ai, " Aucun fil pour le moment. "))
3218
+ s.hasAny ? y("", !0) : (l(), c("div", di, " Aucun fil pour le moment. "))
3177
3219
  ])
3178
3220
  ])
3179
3221
  ]);
3180
3222
  }
3181
- const li = /* @__PURE__ */ B(zr, [["render", oi], ["__scopeId", "data-v-1259e822"]]), ci = {
3223
+ const hi = /* @__PURE__ */ B(Gr, [["render", ui], ["__scopeId", "data-v-1259e822"]]), mi = {
3182
3224
  name: "WmMoreMenu",
3183
3225
  props: {
3184
3226
  canRename: { type: Boolean, default: !0 },
@@ -3205,18 +3247,18 @@ const li = /* @__PURE__ */ B(zr, [["render", oi], ["__scopeId", "data-v-1259e822
3205
3247
  this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
3206
3248
  }
3207
3249
  }
3208
- }, di = { class: "wm-mm" }, ui = {
3250
+ }, fi = { class: "wm-mm" }, _i = {
3209
3251
  class: "wm-mm__pop",
3210
3252
  role: "menu"
3211
- }, hi = { class: "wm-mm__section" }, mi = { class: "wm-mm__section" }, fi = { class: "wm-mm__section" };
3212
- function _i(t, e, n, a, r, s) {
3213
- return l(), c("div", di, [
3253
+ }, pi = { class: "wm-mm__section" }, vi = { class: "wm-mm__section" }, gi = { class: "wm-mm__section" };
3254
+ function yi(t, e, n, a, r, s) {
3255
+ return l(), c("div", fi, [
3214
3256
  i("div", {
3215
3257
  class: "wm-mm__scrim",
3216
3258
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3217
3259
  }),
3218
- i("div", ui, [
3219
- i("div", hi, [
3260
+ i("div", _i, [
3261
+ i("div", pi, [
3220
3262
  i("button", {
3221
3263
  type: "button",
3222
3264
  class: "wm-mm__item",
@@ -3246,7 +3288,7 @@ function _i(t, e, n, a, r, s) {
3246
3288
  onClick: e[2] || (e[2] = (o) => s.emit("rename"))
3247
3289
  }, [...e[9] || (e[9] = [
3248
3290
  ue('<span class="wm-mm__icon" data-v-c1bb81d2><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-c1bb81d2><path d="M12 20h9" data-v-c1bb81d2></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-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Renommer le fil</span>', 2)
3249
- ])])) : g("", !0),
3291
+ ])])) : y("", !0),
3250
3292
  n.canClear ? (l(), c("button", {
3251
3293
  key: 1,
3252
3294
  type: "button",
@@ -3269,7 +3311,7 @@ function _i(t, e, n, a, r, s) {
3269
3311
  ])
3270
3312
  ], -1),
3271
3313
  i("span", { class: "wm-mm__label" }, "Effacer ce fil", -1)
3272
- ])])) : g("", !0),
3314
+ ])])) : y("", !0),
3273
3315
  n.canExport ? (l(), c("button", {
3274
3316
  key: 2,
3275
3317
  type: "button",
@@ -3277,10 +3319,10 @@ function _i(t, e, n, a, r, s) {
3277
3319
  onClick: e[4] || (e[4] = (o) => s.emit("export"))
3278
3320
  }, [...e[11] || (e[11] = [
3279
3321
  ue('<span class="wm-mm__icon" data-v-c1bb81d2><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-c1bb81d2><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Exporter la transcription</span><span class="wm-mm__hint" data-v-c1bb81d2>.txt</span>', 3)
3280
- ])])) : g("", !0)
3322
+ ])])) : y("", !0)
3281
3323
  ]),
3282
3324
  e[17] || (e[17] = i("div", { class: "wm-mm__sep" }, null, -1)),
3283
- i("div", mi, [
3325
+ i("div", vi, [
3284
3326
  i("button", {
3285
3327
  type: "button",
3286
3328
  class: "wm-mm__item",
@@ -3310,7 +3352,7 @@ function _i(t, e, n, a, r, s) {
3310
3352
  ])
3311
3353
  ]),
3312
3354
  e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
3313
- i("div", fi, [
3355
+ i("div", gi, [
3314
3356
  n.statusUrl ? (l(), c("button", {
3315
3357
  key: 0,
3316
3358
  type: "button",
@@ -3333,7 +3375,7 @@ function _i(t, e, n, a, r, s) {
3333
3375
  ])
3334
3376
  ], -1),
3335
3377
  i("span", { class: "wm-mm__label" }, "Statut des services", -1)
3336
- ])])) : g("", !0),
3378
+ ])])) : y("", !0),
3337
3379
  n.helpUrl ? (l(), c("button", {
3338
3380
  key: 1,
3339
3381
  type: "button",
@@ -3356,18 +3398,18 @@ function _i(t, e, n, a, r, s) {
3356
3398
  ])
3357
3399
  ], -1),
3358
3400
  i("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
3359
- ])])) : g("", !0)
3401
+ ])])) : y("", !0)
3360
3402
  ])
3361
3403
  ])
3362
3404
  ]);
3363
3405
  }
3364
- const pi = /* @__PURE__ */ B(ci, [["render", _i], ["__scopeId", "data-v-c1bb81d2"]]), ye = "ww-messenger-tokens";
3406
+ const wi = /* @__PURE__ */ B(mi, [["render", yi], ["__scopeId", "data-v-c1bb81d2"]]), ge = "ww-messenger-tokens";
3365
3407
  function de(t) {
3366
3408
  var n;
3367
3409
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
3368
3410
  return e === "agent_ia" || e === "agent_human";
3369
3411
  }
3370
- function vi(t, e) {
3412
+ function bi(t, e) {
3371
3413
  if (!t || !e) return "";
3372
3414
  const n = Array.isArray(t.fields) ? t.fields : [], a = [];
3373
3415
  for (const r of n) {
@@ -3390,7 +3432,7 @@ function ne(t, e) {
3390
3432
  const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
3391
3433
  return (n == null ? void 0 : n.label) || e;
3392
3434
  }
3393
- function yi(t, e) {
3435
+ function ki(t, e) {
3394
3436
  const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3395
3437
  for (const r of a) {
3396
3438
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3412,20 +3454,20 @@ function yi(t, e) {
3412
3454
  }
3413
3455
  };
3414
3456
  }
3415
- const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
3457
+ const Ci = 450, Ai = 50, Si = 900, xi = 12e3, Mi = 300, Ti = {
3416
3458
  name: "Messenger",
3417
3459
  components: {
3418
- Launcher: Ye,
3460
+ Launcher: Ke,
3419
3461
  Header: wt,
3420
3462
  Onboarding: Ht,
3421
- MessageList: As,
3422
- Composer: Vs,
3423
- SuggestionChips: Ks,
3424
- ApprovalCard: rr,
3425
- FormCard: Er,
3426
- Feedback: Pr,
3427
- HistoryDrawer: li,
3428
- MoreMenu: pi
3463
+ MessageList: Ts,
3464
+ Composer: Ks,
3465
+ SuggestionChips: Qs,
3466
+ ApprovalCard: lr,
3467
+ FormCard: $r,
3468
+ Feedback: qr,
3469
+ HistoryDrawer: hi,
3470
+ MoreMenu: wi
3429
3471
  },
3430
3472
  // Make signAttachment available to deep children (AttachmentPreview)
3431
3473
  // without prop drilling. The store may not exist yet at provide-time
@@ -3441,7 +3483,7 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
3441
3483
  },
3442
3484
  props: {
3443
3485
  // Hardcoded server default (overridable for staging/dev).
3444
- baseUrl: { type: String, default: ze },
3486
+ baseUrl: { type: String, default: He },
3445
3487
  widgetId: { type: String, default: "" },
3446
3488
  userId: { type: String, default: "" },
3447
3489
  userHash: { type: String, default: "" },
@@ -3501,6 +3543,14 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
3501
3543
  // unread dot in the history drawer survives reloads. The server
3502
3544
  // has no per-customer read model, so this is purely client-side.
3503
3545
  readState: {},
3546
+ // ISO timestamp frozen at the moment the user *started viewing*
3547
+ // the current thread (panel open + thread visible). Drives the
3548
+ // "Non lus" separator inside the MessageList: messages newer than
3549
+ // this anchor are shown below the separator. Distinct from
3550
+ // `readState` because that one gets bumped to the latest as soon
3551
+ // as the messages render — we need to remember what was read
3552
+ // BEFORE this viewing session so the separator stays put.
3553
+ unreadAnchorTs: "",
3504
3554
  // Live-measured height of the floating overlay (chips / approval
3505
3555
  // / feedback). Reserved as bottom padding on the MessageList so
3506
3556
  // the latest message scrolls above the overlay instead of
@@ -3614,6 +3664,13 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
3614
3664
  const t = this.latestUnread;
3615
3665
  return t ? t.preview || "Vous avez un nouveau message" : "";
3616
3666
  },
3667
+ // True when the user is actively looking at a thread (panel open or
3668
+ // embedded, no history drawer overlay, a currentConv exists). Used as
3669
+ // the trigger to (re)snapshot `unreadAnchorTs` so the "Non lus"
3670
+ // separator anchors against what was read PRIOR to this viewing.
3671
+ isViewingThread() {
3672
+ return (this.isOpen || this.isEmbedded) && !this.historyOpen && !!this.currentConv;
3673
+ },
3617
3674
  currentConv() {
3618
3675
  if (this.showOnboarding) return null;
3619
3676
  const t = this.allConversations;
@@ -3839,11 +3896,22 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
3839
3896
  // timers, reset the queue and stamp the open time so the messages
3840
3897
  // we're about to load count as history and bypass pacing.
3841
3898
  "currentConv.id": {
3842
- handler() {
3843
- this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = Date.now(), this.moreOpen = !1, this.resetApprovalPacing();
3899
+ handler(t) {
3900
+ this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = Date.now(), this.moreOpen = !1, this.resetApprovalPacing(), this.isViewingThread && (this.unreadAnchorTs = t && this.readState[t] || "");
3844
3901
  },
3845
3902
  immediate: !0
3846
3903
  },
3904
+ // Panel just opened onto a thread (or history drawer just closed back
3905
+ // onto one). Snapshot the read mark so the separator marks the
3906
+ // pre-session boundary, even though markConvRead will immediately
3907
+ // bump readState as the messages render.
3908
+ isViewingThread(t, e) {
3909
+ var n;
3910
+ if (t && !e) {
3911
+ const a = (n = this.currentConv) == null ? void 0 : n.id;
3912
+ this.unreadAnchorTs = a && this.readState[a] || "";
3913
+ } else t || (this.unreadAnchorTs = "");
3914
+ },
3847
3915
  // Fresh `pendingApproval` arrival : kick off the settle debounce so
3848
3916
  // the card waits for the conversation to go quiet. Historical
3849
3917
  // approvals (page reload, conv switch on a thread that already had
@@ -3922,9 +3990,9 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
3922
3990
  hasWidgetId: !!this.widgetId,
3923
3991
  hasUserId: !!this.userId,
3924
3992
  hasUserHash: !!this.userHash
3925
- }), typeof document < "u" && !document.getElementById(ye)) {
3993
+ }), typeof document < "u" && !document.getElementById(ge)) {
3926
3994
  const t = document.createElement("style");
3927
- t.id = ye, t.textContent = He, document.head.appendChild(t);
3995
+ t.id = ge, t.textContent = Pe, document.head.appendChild(t);
3928
3996
  }
3929
3997
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
3930
3998
  },
@@ -4075,11 +4143,11 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
4075
4143
  // bounded by MIN/MAX_BETWEEN_MS.
4076
4144
  scheduleReveal(t) {
4077
4145
  const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
4078
- ki,
4079
- Math.max(bi, n * wi)
4146
+ xi,
4147
+ Math.max(Si, n * Ai)
4080
4148
  ), s = Math.max(
4081
- e + gi,
4082
- this.nextRevealAt + Ci
4149
+ e + Ci,
4150
+ this.nextRevealAt + Mi
4083
4151
  ) + a;
4084
4152
  this.nextRevealAt = s;
4085
4153
  const o = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
@@ -4106,12 +4174,12 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
4106
4174
  baseUrl: this.baseUrl,
4107
4175
  widgetId: this.widgetId,
4108
4176
  userId: this.userId
4109
- }), this.transport = fe(je({
4177
+ }), this.transport = fe(Fe({
4110
4178
  baseUrl: this.baseUrl,
4111
4179
  widgetId: this.widgetId,
4112
4180
  userId: this.userId,
4113
4181
  userHash: this.userHash
4114
- })), this.store = fe(Pe(this.transport)), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4182
+ })), this.store = fe(Ne(this.transport)), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4115
4183
  ready: this.store.state.ready,
4116
4184
  error: this.store.state.error
4117
4185
  });
@@ -4287,12 +4355,12 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
4287
4355
  async onFormSubmit({ values: t }) {
4288
4356
  const e = this.pendingForm;
4289
4357
  if (!(e != null && e.form)) return;
4290
- const n = vi(e.form, t);
4358
+ const n = bi(e.form, t);
4291
4359
  if (!n) return;
4292
4360
  const a = this.currentConv;
4293
4361
  a && await this.store.send(a.id, n, {
4294
4362
  metadata: {
4295
- artifact: yi(e.form, t)
4363
+ artifact: ki(e.form, t)
4296
4364
  }
4297
4365
  });
4298
4366
  },
@@ -4336,28 +4404,28 @@ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
4336
4404
  }
4337
4405
  }
4338
4406
  }
4339
- }, Si = {
4407
+ }, Oi = {
4340
4408
  key: 0,
4341
4409
  class: "wm-loading",
4342
4410
  "aria-busy": "true",
4343
4411
  "aria-live": "polite"
4344
- }, xi = {
4412
+ }, Ii = {
4345
4413
  key: 0,
4346
4414
  class: "wm-state"
4347
- }, Mi = { class: "wm-state__err" }, Ti = { class: "wm-state__errSub" }, Ii = { class: "wm-bottom" }, Oi = {
4415
+ }, Ei = { class: "wm-state__err" }, Bi = { class: "wm-state__errSub" }, Li = { class: "wm-bottom" }, Ri = {
4348
4416
  key: 0,
4349
4417
  ref: "floatEl",
4350
4418
  class: "wm-float"
4351
- }, Ei = {
4419
+ }, $i = {
4352
4420
  key: 1,
4353
4421
  class: "wm-actionWait",
4354
4422
  role: "status",
4355
4423
  "aria-live": "polite"
4356
- }, Bi = { class: "wm-actionWait__lbl" }, Li = {
4424
+ }, Fi = { class: "wm-actionWait__lbl" }, ji = {
4357
4425
  key: 1,
4358
4426
  class: "wm-attached"
4359
- }, Ri = ["onClick"];
4360
- function $i(t, e, n, a, r, s) {
4427
+ }, Ui = ["onClick"];
4428
+ function Di(t, e, n, a, r, s) {
4361
4429
  const o = I("Launcher"), d = I("Header"), v = I("Onboarding"), C = I("MessageList"), w = I("ApprovalCard"), S = I("FormCard"), L = I("Feedback"), A = I("SuggestionChips"), D = I("Composer"), x = I("MoreMenu"), N = I("HistoryDrawer");
4362
4430
  return l(), c("div", {
4363
4431
  class: E(["wm-root", `wm-root--${n.displayMode}`])
@@ -4368,16 +4436,16 @@ function $i(t, e, n, a, r, s) {
4368
4436
  peek: s.launcherPeek,
4369
4437
  onOpen: s.openFromPeek,
4370
4438
  onDismiss: e[0] || (e[0] = (j) => r.labelDismissed = !0)
4371
- }, null, 8, ["unread-count", "peek", "onOpen"])) : g("", !0),
4439
+ }, null, 8, ["unread-count", "peek", "onOpen"])) : y("", !0),
4372
4440
  r.isOpen || s.isEmbedded ? (l(), c("section", {
4373
4441
  key: 1,
4374
4442
  class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
4375
- style: P(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4443
+ style: V(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4376
4444
  role: "dialog",
4377
4445
  "aria-label": "Messenger"
4378
4446
  }, [
4379
- !s.ready && !s.error ? (l(), c("div", Si, [
4380
- s.isEmbedded ? g("", !0) : (l(), c("button", {
4447
+ !s.ready && !s.error ? (l(), c("div", Oi, [
4448
+ s.isEmbedded ? y("", !0) : (l(), c("button", {
4381
4449
  key: 0,
4382
4450
  type: "button",
4383
4451
  class: "wm-loading__close",
@@ -4402,8 +4470,8 @@ function $i(t, e, n, a, r, s) {
4402
4470
  class: "wm-loading__spinner",
4403
4471
  "aria-hidden": "true"
4404
4472
  }, null, -1))
4405
- ])) : (l(), c(O, { key: 1 }, [
4406
- H(d, {
4473
+ ])) : (l(), c(M, { key: 1 }, [
4474
+ P(d, {
4407
4475
  title: s.headerTitle,
4408
4476
  escalated: s.isEscalated,
4409
4477
  "agent-name": s.humanAgentName,
@@ -4418,8 +4486,8 @@ function $i(t, e, n, a, r, s) {
4418
4486
  onMore: s.toggleMore,
4419
4487
  onClose: s.close
4420
4488
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4421
- s.error ? (l(), c("div", xi, [
4422
- i("div", Mi, [
4489
+ s.error ? (l(), c("div", Ii, [
4490
+ i("div", Ei, [
4423
4491
  e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
4424
4492
  i("svg", {
4425
4493
  width: "14",
@@ -4437,11 +4505,11 @@ function $i(t, e, n, a, r, s) {
4437
4505
  ], -1)),
4438
4506
  i("div", null, [
4439
4507
  e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4440
- i("div", Ti, b(s.error), 1)
4508
+ i("div", Bi, b(s.error), 1)
4441
4509
  ])
4442
4510
  ])
4443
- ])) : s.currentConv ? (l(), c(O, { key: 2 }, [
4444
- H(C, {
4511
+ ])) : s.currentConv ? (l(), c(M, { key: 2 }, [
4512
+ P(C, {
4445
4513
  ref: "messageList",
4446
4514
  messages: s.displayedMessages,
4447
4515
  "streaming-active": s.streamingActive,
@@ -4449,10 +4517,11 @@ function $i(t, e, n, a, r, s) {
4449
4517
  "conversation-id": s.currentConv ? s.currentConv.id : null,
4450
4518
  "loading-more": s.paginationState.loading,
4451
4519
  "has-more": s.paginationState.hasMore,
4520
+ "unread-anchor-ts": r.unreadAnchorTs,
4452
4521
  onLoadMore: s.onLoadMore
4453
- }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "onLoadMore"]),
4454
- i("div", Ii, [
4455
- s.floatVisible ? (l(), c("div", Oi, [
4522
+ }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "onLoadMore"]),
4523
+ i("div", Li, [
4524
+ s.floatVisible ? (l(), c("div", Ri, [
4456
4525
  s.approvalReady ? (l(), $(w, {
4457
4526
  key: 0,
4458
4527
  action: s.approvalTitle,
@@ -4473,13 +4542,13 @@ function $i(t, e, n, a, r, s) {
4473
4542
  items: s.suggestions,
4474
4543
  onSelect: s.onSuggestion
4475
4544
  }, null, 8, ["items", "onSelect"]))
4476
- ], 512)) : g("", !0),
4477
- s.actionInFlight ? (l(), c("div", Ei, [
4545
+ ], 512)) : y("", !0),
4546
+ s.actionInFlight ? (l(), c("div", $i, [
4478
4547
  e[10] || (e[10] = i("span", {
4479
4548
  class: "wm-actionWait__spinner",
4480
4549
  "aria-hidden": "true"
4481
4550
  }, null, -1)),
4482
- i("span", Bi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4551
+ i("span", Fi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4483
4552
  ])) : (l(), $(D, {
4484
4553
  key: 2,
4485
4554
  ref: "composer",
@@ -4503,10 +4572,10 @@ function $i(t, e, n, a, r, s) {
4503
4572
  onClose: e[3] || (e[3] = (j) => r.moreOpen = !1),
4504
4573
  onNotifToggle: s.onNotifToggle,
4505
4574
  onAction: s.onMoreAction
4506
- }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0),
4507
- r.pendingAttachments.length ? (l(), c("div", Li, [
4508
- (l(!0), c(O, null, F(r.pendingAttachments, (j, z) => (l(), c("div", {
4509
- key: z,
4575
+ }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0),
4576
+ r.pendingAttachments.length ? (l(), c("div", ji, [
4577
+ (l(!0), c(M, null, F(r.pendingAttachments, (j, H) => (l(), c("div", {
4578
+ key: H,
4510
4579
  class: "wm-attached__chip"
4511
4580
  }, [
4512
4581
  e[12] || (e[12] = i("svg", {
@@ -4526,7 +4595,7 @@ function $i(t, e, n, a, r, s) {
4526
4595
  i("button", {
4527
4596
  type: "button",
4528
4597
  "aria-label": "Retirer",
4529
- onClick: (X) => r.pendingAttachments.splice(z, 1)
4598
+ onClick: (X) => r.pendingAttachments.splice(H, 1)
4530
4599
  }, [...e[11] || (e[11] = [
4531
4600
  i("svg", {
4532
4601
  width: "10",
@@ -4541,9 +4610,9 @@ function $i(t, e, n, a, r, s) {
4541
4610
  }, [
4542
4611
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4543
4612
  ], -1)
4544
- ])], 8, Ri)
4613
+ ])], 8, Ui)
4545
4614
  ]))), 128))
4546
- ])) : g("", !0)
4615
+ ])) : y("", !0)
4547
4616
  ], 64)) : (l(), $(v, {
4548
4617
  key: 1,
4549
4618
  "welcome-message": s.widgetWelcomeMessage,
@@ -4562,7 +4631,7 @@ function $i(t, e, n, a, r, s) {
4562
4631
  onClose: e[4] || (e[4] = (j) => r.historyOpen = !1),
4563
4632
  onNew: s.onDrawerNew,
4564
4633
  onPick: s.onDrawerPick
4565
- }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : g("", !0),
4634
+ }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : y("", !0),
4566
4635
  r.moreOpen && !s.currentConv ? (l(), $(x, {
4567
4636
  key: 4,
4568
4637
  "can-rename": !1,
@@ -4574,54 +4643,54 @@ function $i(t, e, n, a, r, s) {
4574
4643
  onClose: e[5] || (e[5] = (j) => r.moreOpen = !1),
4575
4644
  onNotifToggle: s.onNotifToggle,
4576
4645
  onAction: s.onMoreAction
4577
- }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0)
4646
+ }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0)
4578
4647
  ], 64))
4579
- ], 6)) : g("", !0)
4648
+ ], 6)) : y("", !0)
4580
4649
  ], 2);
4581
4650
  }
4582
- const Ui = /* @__PURE__ */ B(Ai, [["render", $i], ["__scopeId", "data-v-bee7b290"]]), Di = "0.2.0";
4651
+ const Hi = /* @__PURE__ */ B(Ti, [["render", Di], ["__scopeId", "data-v-5233982a"]]), zi = "0.2.2";
4583
4652
  export {
4584
4653
  J as AIAvatar,
4585
4654
  le as AVATAR_COLORS,
4586
4655
  Dn as ActionResult,
4587
- rr as ApprovalCard,
4588
- Qt as ArtifactFormResponse,
4589
- hn as ArtifactInfoCard,
4590
- Ae as ArtifactRenderer,
4591
- xn as ArtifactTicket,
4656
+ lr as ApprovalCard,
4657
+ Jt as ArtifactFormResponse,
4658
+ dn as ArtifactInfoCard,
4659
+ Ce as ArtifactRenderer,
4660
+ An as ArtifactTicket,
4592
4661
  Xn as AttachmentPreview,
4593
- ts as Bubble,
4594
- Vs as Composer,
4595
- ze as DEFAULT_BASE_URL,
4596
- Pr as Feedback,
4597
- Er as FormCard,
4662
+ rs as Bubble,
4663
+ Ks as Composer,
4664
+ He as DEFAULT_BASE_URL,
4665
+ qr as Feedback,
4666
+ $r as FormCard,
4598
4667
  wt as Header,
4599
- li as HistoryDrawer,
4668
+ hi as HistoryDrawer,
4600
4669
  ke as HumanAvatar,
4601
- Ye as Launcher,
4670
+ Ke as Launcher,
4602
4671
  he as MEDIA_RECORDER_SUPPORTED,
4603
- As as MessageList,
4604
- Ui as Messenger,
4605
- pi as MoreMenu,
4672
+ Ts as MessageList,
4673
+ Hi as Messenger,
4674
+ wi as MoreMenu,
4606
4675
  Ht as Onboarding,
4607
4676
  te as SCREEN_CAPTURE_SUPPORTED,
4608
- Ks as SuggestionChips,
4677
+ Qs as SuggestionChips,
4609
4678
  lt as TeamAvatars,
4610
- is as Typing,
4611
- Di as VERSION,
4612
- ge as avatarColor,
4679
+ ls as Typing,
4680
+ zi as VERSION,
4681
+ ye as avatarColor,
4613
4682
  we as avatarInitials,
4614
- xs as captureScreenshotFile,
4683
+ Is as captureScreenshotFile,
4615
4684
  U as colors,
4616
- Pe as createStore,
4617
- je as createTransport,
4618
- Ui as default,
4685
+ Ne as createStore,
4686
+ Fe as createTransport,
4687
+ Hi as default,
4619
4688
  be as formatTime,
4620
- ji as guessAttachmentKind,
4621
- Ss as pickRecorderMime,
4622
- Ce as renderMarkdown,
4623
- Ts as startScreenRecording,
4624
- He as tokensCss,
4625
- Ne as uuid,
4626
- Ne as v4
4689
+ Pi as guessAttachmentKind,
4690
+ Os as pickRecorderMime,
4691
+ es as renderMarkdown,
4692
+ Bs as startScreenRecording,
4693
+ Pe as tokensCss,
4694
+ De as uuid,
4695
+ De as v4
4627
4696
  };