@_solaris/messenger-widget 0.3.4 → 0.3.5

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,4 +1,4 @@
1
- import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as K, Transition as xe, withCtx as Te, withKeys as ae, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as y, normalizeStyle as G, normalizeClass as E, Fragment as M, renderList as D, resolveComponent as B, createBlock as L, createTextVNode as te, resolveDynamicComponent as Me, renderSlot as Oe, withDirectives as q, vModelText as J, vModelCheckbox as Ie, vModelSelect as Be, createStaticVNode as ue, markRaw as me } from "vue";
1
+ import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as K, Transition as xe, withCtx as Te, withKeys as ae, withModifiers as Z, createElementVNode as i, toDisplayString as k, createCommentVNode as b, normalizeStyle as G, normalizeClass as E, Fragment as M, renderList as D, resolveComponent as B, createBlock as L, createTextVNode as te, resolveDynamicComponent as Me, renderSlot as Oe, withDirectives as q, vModelText as X, vModelCheckbox as Ie, vModelSelect as Be, createStaticVNode as ue, markRaw as me } from "vue";
2
2
  const Ee = [
3
3
  "connected",
4
4
  "message",
@@ -36,9 +36,9 @@ function Fe(t) {
36
36
  }
37
37
  function o(h, f) {
38
38
  const p = e.listeners.get(h);
39
- p && p.forEach((C) => {
39
+ p && p.forEach((v) => {
40
40
  try {
41
- C(f);
41
+ v(f);
42
42
  } catch (T) {
43
43
  console.error("[transport] listener", h, T);
44
44
  }
@@ -55,18 +55,18 @@ function Fe(t) {
55
55
  };
56
56
  }
57
57
  async function a(h, f, p) {
58
- const C = await fetch(`${e.baseUrl}${fe}${f}`, {
58
+ const v = await fetch(`${e.baseUrl}${fe}${f}`, {
59
59
  method: h,
60
60
  headers: { "Content-Type": "application/json", ...s() },
61
61
  body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
- if (!C.ok) {
64
- const T = await d(C), O = new Error(
65
- `HTTP ${C.status} ${h} ${f} :: ${(T == null ? void 0 : T.error) || C.statusText}`
63
+ if (!v.ok) {
64
+ const T = await d(v), O = new Error(
65
+ `HTTP ${v.status} ${h} ${f} :: ${(T == null ? void 0 : T.error) || v.statusText}`
66
66
  );
67
- throw O.status = C.status, O.body = T, O;
67
+ throw O.status = v.status, O.body = T, O;
68
68
  }
69
- return C.status === 204 ? null : C.json();
69
+ return v.status === 204 ? null : v.json();
70
70
  }
71
71
  async function d(h) {
72
72
  try {
@@ -75,13 +75,13 @@ function Fe(t) {
75
75
  return null;
76
76
  }
77
77
  }
78
- async function v() {
78
+ async function g() {
79
79
  const [h, f] = await Promise.all([
80
80
  // Public — no HMAC required.
81
81
  fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
82
82
  if (!p.ok) {
83
- const C = await d(p);
84
- throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || p.statusText}`);
83
+ const v = await d(p);
84
+ throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(v == null ? void 0 : v.error) || p.statusText}`);
85
85
  }
86
86
  return p.json();
87
87
  }),
@@ -96,7 +96,7 @@ function Fe(t) {
96
96
  customer: (f == null ? void 0 : f.customer) ?? null
97
97
  };
98
98
  }
99
- async function k() {
99
+ async function C() {
100
100
  const h = await a("GET", "/customers/me");
101
101
  return (h == null ? void 0 : h.customer) ?? null;
102
102
  }
@@ -120,10 +120,10 @@ function Fe(t) {
120
120
  async function x(h, f = {}) {
121
121
  const p = new URLSearchParams();
122
122
  f.before && p.set("before", f.before), f.since && p.set("since", f.since), f.limit && p.set("limit", String(f.limit));
123
- const C = p.toString() ? `?${p.toString()}` : "";
123
+ const v = p.toString() ? `?${p.toString()}` : "";
124
124
  return a(
125
125
  "GET",
126
- `/conversations/${encodeURIComponent(h)}/messages${C}`
126
+ `/conversations/${encodeURIComponent(h)}/messages${v}`
127
127
  );
128
128
  }
129
129
  async function j(h, f) {
@@ -152,11 +152,11 @@ function Fe(t) {
152
152
  const f = (
153
153
  /** @type {File} */
154
154
  h.name || "attachment"
155
- ), p = h.type || "application/octet-stream", C = h.size || 0, T = (
155
+ ), p = h.type || "application/octet-stream", v = h.size || 0, T = (
156
156
  /** @type {import('./types.js').AttachmentUploadTicket} */
157
157
  await a("POST", "/attachments", {
158
158
  mime_type: p,
159
- size_bytes: C,
159
+ size_bytes: v,
160
160
  name: f
161
161
  })
162
162
  ), O = await fetch(T.upload_url, {
@@ -170,7 +170,7 @@ function Fe(t) {
170
170
  type: Ne(p),
171
171
  path: T.path,
172
172
  mime_type: p,
173
- size_bytes: C
173
+ size_bytes: v
174
174
  };
175
175
  }
176
176
  async function H(h) {
@@ -192,16 +192,16 @@ function Fe(t) {
192
192
  try {
193
193
  const h = new EventSource(Y());
194
194
  for (const f of Ee)
195
- h.addEventListener(f, (p) => Z(f, p.data));
195
+ h.addEventListener(f, (p) => Q(f, p.data));
196
196
  h.addEventListener("error", () => o("error", new Error("SSE error"))), e.eventSource = h, r("open");
197
197
  } catch (h) {
198
198
  console.error("[transport] SSE open failed", h), o("error", h);
199
199
  }
200
200
  }
201
- function Z(h, f) {
201
+ function Q(h, f) {
202
202
  try {
203
- const p = JSON.parse(f), C = p && typeof p == "object" && "data" in p ? p.data : p;
204
- o(h, C);
203
+ const p = JSON.parse(f), v = p && typeof p == "object" && "data" in p ? p.data : p;
204
+ o(h, v);
205
205
  } catch (p) {
206
206
  console.error("[transport] bad SSE payload", h, p);
207
207
  }
@@ -214,14 +214,14 @@ function Fe(t) {
214
214
  e.panelOpen || W();
215
215
  }, Le));
216
216
  }
217
- function Q(h) {
217
+ function J(h) {
218
218
  e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), z()) : V();
219
219
  }
220
220
  async function de() {
221
221
  try {
222
- const h = await S(), f = h.reduce((C, T) => {
222
+ const h = await S(), f = h.reduce((v, T) => {
223
223
  const O = T == null ? void 0 : T.last_message_at;
224
- return O && (!C || O > C) ? O : C;
224
+ return O && (!v || O > v) ? O : v;
225
225
  }, null);
226
226
  f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, o("activity", { conversations: h, latestAt: f }), V());
227
227
  } catch (h) {
@@ -250,12 +250,12 @@ function Fe(t) {
250
250
  async function _() {
251
251
  if (e.started) return e.lastBootstrap;
252
252
  e.started = !0;
253
- const h = await v();
253
+ const h = await g();
254
254
  e.lastBootstrap = h;
255
255
  try {
256
256
  const f = await S();
257
- e.lastActivityAt = f.reduce((p, C) => {
258
- const T = C == null ? void 0 : C.last_message_at;
257
+ e.lastActivityAt = f.reduce((p, v) => {
258
+ const T = v == null ? void 0 : v.last_message_at;
259
259
  return T && (!p || T > p) ? T : p;
260
260
  }, null);
261
261
  } catch (f) {
@@ -263,17 +263,17 @@ function Fe(t) {
263
263
  }
264
264
  return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), se(), h;
265
265
  }
266
- function g() {
266
+ function y() {
267
267
  u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, W(), 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: g,
273
- setPanelOpen: Q,
272
+ stop: y,
273
+ setPanelOpen: J,
274
274
  // REST
275
- bootstrap: v,
276
- getCustomer: k,
275
+ bootstrap: g,
276
+ getCustomer: C,
277
277
  patchCustomer: w,
278
278
  listConversations: S,
279
279
  createConversation: F,
@@ -351,22 +351,22 @@ function Ue(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 g = e.conversations.findIndex((h) => h.id === m);
355
- g !== -1 && (e.conversations[g] = { ...e.conversations[g], ..._ });
354
+ const y = e.conversations.findIndex((h) => h.id === m);
355
+ y !== -1 && (e.conversations[y] = { ...e.conversations[y], ..._ });
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, g = u == null ? void 0 : u.action_name;
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;
360
360
  if (!m || !_) return;
361
361
  const h = e.runningActionsByConv[m] || {};
362
- u.state === "running" ? (h[_] = g || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
362
+ u.state === "running" ? (h[_] = y || _, 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 o() {
367
367
  try {
368
368
  const u = new Promise(
369
- (_, g) => setTimeout(() => g(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
369
+ (_, y) => setTimeout(() => y(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,35 +393,45 @@ function Ue(t) {
393
393
  return e.customer;
394
394
  }
395
395
  async function a(u = {}) {
396
- const m = await t.createConversation(u), _ = e.conversations.findIndex((g) => g.id === m.id);
396
+ const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.id === m.id);
397
397
  return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
398
398
  }
399
399
  const d = 50;
400
- async function v(u) {
401
- if (e.messagesByConv[u]) return;
402
- const m = await t.listMessages(u, { limit: d });
403
- e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], w(u, {
404
- nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
405
- loading: !1,
406
- loaded: !0
407
- });
400
+ async function g(u) {
401
+ const m = e.paginationByConv[u];
402
+ if (!(m != null && m.loaded || m != null && m.loading)) {
403
+ w(u, { nextCursor: null, loading: !0, loaded: !1 });
404
+ try {
405
+ const _ = await t.listMessages(u, { limit: d }), y = (_ == null ? void 0 : _.messages) ?? [], h = e.messagesByConv[u] || [], f = /* @__PURE__ */ new Set();
406
+ for (const v of y)
407
+ (v == null ? void 0 : v.id) != null && f.add(`id:${String(v.id)}`), v != null && v.client_msg_id && f.add(`c:${v.client_msg_id}`);
408
+ const p = h.filter((v) => !((v == null ? void 0 : v.id) != null && f.has(`id:${String(v.id)}`) || v != null && v.client_msg_id && f.has(`c:${v.client_msg_id}`)));
409
+ e.messagesByConv[u] = [...y, ...p].sort(J), w(u, {
410
+ nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
411
+ loading: !1,
412
+ loaded: !0
413
+ });
414
+ } catch (_) {
415
+ console.error("[store] openConversation failed", _), w(u, { nextCursor: null, loading: !1, loaded: !1 });
416
+ }
417
+ }
408
418
  }
409
- async function k(u) {
419
+ async function C(u) {
410
420
  var h;
411
421
  const m = e.paginationByConv[u];
412
422
  if (!m || m.loading || !m.nextCursor) return;
413
- const g = (h = (e.messagesByConv[u] || []).find((f) => f == null ? void 0 : f.created_at)) == null ? void 0 : h.created_at;
414
- if (g) {
423
+ const y = (h = (e.messagesByConv[u] || []).find((f) => f == null ? void 0 : f.created_at)) == null ? void 0 : h.created_at;
424
+ if (y) {
415
425
  w(u, { ...m, loading: !0 });
416
426
  try {
417
427
  const f = await t.listMessages(u, {
418
- before: g,
428
+ before: y,
419
429
  limit: d
420
- }), p = (f == null ? void 0 : f.messages) ?? [], C = e.messagesByConv[u] || [], T = /* @__PURE__ */ new Set();
421
- for (const I of C)
430
+ }), p = (f == null ? void 0 : f.messages) ?? [], v = e.messagesByConv[u] || [], T = /* @__PURE__ */ new Set();
431
+ for (const I of v)
422
432
  (I == null ? void 0 : I.id) != null && T.add(`id:${String(I.id)}`), I != null && I.client_msg_id && T.add(`c:${I.client_msg_id}`);
423
433
  const O = p.filter((I) => !((I == null ? void 0 : I.id) != null && T.has(`id:${String(I.id)}`) || I != null && I.client_msg_id && T.has(`c:${I.client_msg_id}`)));
424
- e.messagesByConv[u] = [...O, ...C], w(u, {
434
+ e.messagesByConv[u] = [...O, ...v], w(u, {
425
435
  nextCursor: (f == null ? void 0 : f.next_cursor) ?? null,
426
436
  loading: !1,
427
437
  loaded: !0
@@ -435,14 +445,14 @@ function Ue(t) {
435
445
  e.paginationByConv = { ...e.paginationByConv, [u]: m };
436
446
  }
437
447
  async function S(u, m) {
438
- const _ = await t.patchConversation(u, m), g = e.conversations.findIndex((h) => h.id === u);
439
- g !== -1 && (e.conversations[g] = _);
448
+ const _ = await t.patchConversation(u, m), y = e.conversations.findIndex((h) => h.id === u);
449
+ y !== -1 && (e.conversations[y] = _);
440
450
  }
441
- async function F(u, m, { attachments: _, metadata: g } = {}) {
451
+ async function F(u, m, { attachments: _, metadata: y } = {}) {
442
452
  var O;
443
453
  const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
444
454
  if (!u || !h && !f) return;
445
- const p = je(), C = se(u), T = {
455
+ const p = je(), v = se(u), T = {
446
456
  id: p,
447
457
  client_msg_id: p,
448
458
  conversation_id: u,
@@ -452,20 +462,20 @@ function Ue(t) {
452
462
  type: "user",
453
463
  id: ((O = e.customer) == null ? void 0 : O.external_id) || null
454
464
  },
455
- created_at: C,
465
+ created_at: v,
456
466
  // Local-only flag — UI may render dimmed until the SSE echo lands.
457
467
  _pending: !0,
458
468
  ...f ? { payload: { type: "content", attachments: _ } } : {},
459
- ...g && typeof g == "object" ? { metadata: g } : {}
469
+ ...y && typeof y == "object" ? { metadata: y } : {}
460
470
  };
461
471
  z(u, T);
462
472
  try {
463
473
  await t.postMessage(u, {
464
474
  client_msg_id: p,
465
475
  text_md: h,
466
- created_at: C,
476
+ created_at: v,
467
477
  ...f ? { attachments: _ } : {},
468
- ...g && typeof g == "object" ? { metadata: g } : {}
478
+ ...y && typeof y == "object" ? { metadata: y } : {}
469
479
  });
470
480
  } catch (I) {
471
481
  console.error("[store] send failed", I), W(u, p, { _failed: !0, _pending: !1 });
@@ -475,8 +485,8 @@ function Ue(t) {
475
485
  u != null && (e.awaitingCallback[u] = !0);
476
486
  try {
477
487
  await t.postCallback(u, m, _);
478
- } catch (g) {
479
- console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
488
+ } catch (y) {
489
+ console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
480
490
  }
481
491
  }
482
492
  const U = /* @__PURE__ */ new Map();
@@ -497,8 +507,8 @@ function Ue(t) {
497
507
  return null;
498
508
  }
499
509
  async function j(u, { rating: m, comment: _ } = {}) {
500
- const g = e.conversations.find((p) => p.id === u), f = {
501
- ...(g == null ? void 0 : g.metadata) || {},
510
+ const y = e.conversations.find((p) => p.id === u), f = {
511
+ ...(y == null ? void 0 : y.metadata) || {},
502
512
  feedback: {
503
513
  rating: m,
504
514
  comment: _ || null,
@@ -508,24 +518,24 @@ function Ue(t) {
508
518
  await S(u, { metadata: f });
509
519
  }
510
520
  function P(u) {
511
- var _, g;
521
+ var _, y;
512
522
  const m = e.messagesByConv[u] || [];
513
523
  for (let h = m.length - 1; h >= 0; h--) {
514
524
  const f = m[h];
515
- 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])
525
+ if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((y = f == null ? void 0 : f.payload) == null ? void 0 : y.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
516
526
  return f;
517
527
  }
518
528
  return null;
519
529
  }
520
530
  function R(u) {
521
- var _, g, h;
531
+ var _, y, h;
522
532
  const m = e.messagesByConv[u] || [];
523
533
  for (let f = m.length - 1; f >= 0; f--) {
524
534
  const p = m[f];
525
- 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;
526
- const C = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
527
- if (C && Array.isArray(C.fields) && C.fields.length > 0)
528
- return { message: p, form: C };
535
+ if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((y = p == null ? void 0 : p.payload) == null ? void 0 : y.state) === "pending") return null;
536
+ const v = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
537
+ if (v && Array.isArray(v.fields) && v.fields.length > 0)
538
+ return { message: p, form: v };
529
539
  }
530
540
  return null;
531
541
  }
@@ -534,18 +544,18 @@ function Ue(t) {
534
544
  if (!m) return null;
535
545
  const _ = Object.keys(m);
536
546
  if (_.length === 0) return null;
537
- const g = _[0];
538
- return { id: g, payload: { name: m[g] } };
547
+ const y = _[0];
548
+ return { id: y, payload: { name: m[y] } };
539
549
  }
540
550
  function Y(u) {
541
- var _, g, h, f;
551
+ var _, y, h, f;
542
552
  const m = e.messagesByConv[u] || [];
543
553
  for (let p = m.length - 1; p >= 0; p--) {
544
- const C = m[p];
545
- if (((_ = C == null ? void 0 : C.author) == null ? void 0 : _.type) === "user") return [];
546
- if ((C == null ? void 0 : C.type) === "action" && ((g = C == null ? void 0 : C.payload) == null ? void 0 : g.state) === "pending") return [];
547
- if (((h = C == null ? void 0 : C.author) == null ? void 0 : h.type) !== "agent_ia") continue;
548
- const T = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
554
+ const v = m[p];
555
+ if (((_ = v == null ? void 0 : v.author) == null ? void 0 : _.type) === "user") return [];
556
+ if ((v == null ? void 0 : v.type) === "action" && ((y = v == null ? void 0 : v.payload) == null ? void 0 : y.state) === "pending") return [];
557
+ if (((h = v == null ? void 0 : v.author) == null ? void 0 : h.type) !== "agent_ia") continue;
558
+ const T = (f = v == null ? void 0 : v.metadata) == null ? void 0 : f.suggested_replies;
549
559
  return Array.isArray(T) && T.length ? T.map((O) => {
550
560
  if (typeof O == "string") {
551
561
  const I = O.trim();
@@ -565,43 +575,43 @@ function Ue(t) {
565
575
  function z(u, m) {
566
576
  var f;
567
577
  const _ = e.messagesByConv[u] || [];
568
- let g = -1;
569
- m != null && m.client_msg_id && (g = _.findIndex(
578
+ let y = -1;
579
+ m != null && m.client_msg_id && (y = _.findIndex(
570
580
  (p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
571
- )), g === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (g = _.findIndex((p) => Z(p == null ? void 0 : p.id, m.id)));
581
+ )), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => Q(p == null ? void 0 : p.id, m.id)));
572
582
  let h;
573
- g === -1 ? h = [..._, m].sort(Q) : (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];
583
+ y === -1 ? h = [..._, m].sort(J) : (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];
574
584
  }
575
- function Z(u, m) {
585
+ function Q(u, m) {
576
586
  return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
577
587
  }
578
588
  function W(u, m, _) {
579
- const g = e.messagesByConv[u];
580
- if (!g) return;
581
- const h = g.findIndex((p) => p.id === m);
589
+ const y = e.messagesByConv[u];
590
+ if (!y) return;
591
+ const h = y.findIndex((p) => p.id === m);
582
592
  if (h === -1) return;
583
- const f = g.slice();
584
- f[h] = { ...g[h], ..._ }, e.messagesByConv[u] = f;
593
+ const f = y.slice();
594
+ f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
585
595
  }
586
596
  function V(u, m) {
587
597
  const _ = e.conversations.findIndex((h) => h.id === u);
588
598
  if (_ === -1) return;
589
- const g = e.conversations[_];
590
- if (m && (!g.last_message_at || m > g.last_message_at)) {
599
+ const y = e.conversations[_];
600
+ if (m && (!y.last_message_at || m > y.last_message_at)) {
591
601
  const h = e.conversations.slice();
592
- h[_] = { ...g, last_message_at: m }, h.sort(
602
+ h[_] = { ...y, last_message_at: m }, h.sort(
593
603
  (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
594
604
  ), e.conversations = h;
595
605
  }
596
606
  }
597
- function Q(u, m) {
607
+ function J(u, m) {
598
608
  return (u.created_at || "").localeCompare(m.created_at || "");
599
609
  }
600
610
  function de(u) {
601
611
  if (!u || typeof u != "object") return null;
602
612
  const m = {}, _ = {};
603
- for (const [g, h] of Object.entries(u))
604
- 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);
613
+ for (const [y, h] of Object.entries(u))
614
+ h !== void 0 && (y === "name" || y === "email" ? h != null && String(h).trim() !== "" && (m[y] = h) : (y === "values" || y === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[y] = h);
605
615
  return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
606
616
  }
607
617
  function se(u) {
@@ -609,8 +619,8 @@ function Ue(t) {
609
619
  let _ = "";
610
620
  for (const f of m)
611
621
  f != null && f.created_at && f.created_at > _ && (_ = f.created_at);
612
- const g = (/* @__PURE__ */ new Date()).toISOString();
613
- return !_ || g > _ ? g : new Date(Date.parse(_) + 1).toISOString();
622
+ const y = (/* @__PURE__ */ new Date()).toISOString();
623
+ return !_ || y > _ ? y : new Date(Date.parse(_) + 1).toISOString();
614
624
  }
615
625
  return {
616
626
  state: e,
@@ -618,8 +628,8 @@ function Ue(t) {
618
628
  destroy: r,
619
629
  applyCustomer: s,
620
630
  createConversation: a,
621
- openConversation: v,
622
- loadMore: k,
631
+ openConversation: g,
632
+ loadMore: C,
623
633
  patchConversation: S,
624
634
  send: F,
625
635
  clickCallback: A,
@@ -733,16 +743,16 @@ function Ke(t, e, n, o, r, s) {
733
743
  "aria-label": "Ouvrir le messenger sur le dernier message",
734
744
  onClick: e[1] || (e[1] = (a) => t.$emit("open")),
735
745
  onKeydown: [
736
- e[2] || (e[2] = ae(X((a) => t.$emit("open"), ["prevent"]), ["enter"])),
737
- e[3] || (e[3] = ae(X((a) => t.$emit("open"), ["prevent"]), ["space"]))
746
+ e[2] || (e[2] = ae(Z((a) => t.$emit("open"), ["prevent"]), ["enter"])),
747
+ e[3] || (e[3] = ae(Z((a) => t.$emit("open"), ["prevent"]), ["space"]))
738
748
  ]
739
749
  }, [
740
- i("p", qe, b(n.peek), 1),
750
+ i("p", qe, k(n.peek), 1),
741
751
  i("button", {
742
752
  type: "button",
743
753
  class: "wm-peek__close",
744
754
  "aria-label": "Ignorer",
745
- onClick: e[0] || (e[0] = X((a) => t.$emit("dismiss"), ["stop"]))
755
+ onClick: e[0] || (e[0] = Z((a) => t.$emit("dismiss"), ["stop"]))
746
756
  }, [...e[5] || (e[5] = [
747
757
  i("svg", {
748
758
  width: "11",
@@ -758,7 +768,7 @@ function Ke(t, e, n, o, r, s) {
758
768
  i("path", { d: "M18 6L6 18M6 6l12 12" })
759
769
  ], -1)
760
770
  ])])
761
- ], 32)) : y("", !0)
771
+ ], 32)) : b("", !0)
762
772
  ]),
763
773
  _: 1
764
774
  }),
@@ -785,7 +795,7 @@ function Ke(t, e, n, o, r, s) {
785
795
  key: 0,
786
796
  class: "wm-launcher__badge",
787
797
  "aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
788
- }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, We)) : y("", !0)
798
+ }, k(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, We)) : b("", !0)
789
799
  ])
790
800
  ]);
791
801
  }
@@ -810,7 +820,7 @@ function Ze(t, e, n, o, r, s) {
810
820
  class: E(["wm-aiav", { "wm-aiav--tail": n.tail }]),
811
821
  style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
812
822
  }, [
813
- n.pulse ? (l(), c("div", Je)) : y("", !0),
823
+ n.pulse ? (l(), c("div", Je)) : b("", !0),
814
824
  i("div", {
815
825
  class: E(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
816
826
  }, [
@@ -877,7 +887,7 @@ function tt(t, e, n, o, r, s) {
877
887
  }, null, 8, et)) : (l(), c("span", {
878
888
  key: 1,
879
889
  style: G({ fontSize: n.size * 0.36 + "px" })
880
- }, b(s.initials), 5))
890
+ }, k(s.initials), 5))
881
891
  ], 4);
882
892
  }
883
893
  const ke = /* @__PURE__ */ $(Qe, [["render", tt], ["__scopeId", "data-v-a772b179"]]), nt = {
@@ -924,11 +934,11 @@ function ot(t, e, n, o, r, s) {
924
934
  key: 0,
925
935
  src: a.avatar_url,
926
936
  alt: a.name || ""
927
- }, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(a)), 1))
937
+ }, null, 8, rt)) : (l(), c("span", it, k(s.initialsFor(a)), 1))
928
938
  ], 4))), 128))
929
939
  ], 4),
930
- n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : y("", !0)
931
- ])) : y("", !0);
940
+ n.responseLabel ? (l(), c("span", at, k(n.responseLabel), 1)) : b("", !0)
941
+ ])) : b("", !0);
932
942
  }
933
943
  const lt = /* @__PURE__ */ $(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), dt = {
934
944
  name: "WmHeader",
@@ -969,19 +979,19 @@ const lt = /* @__PURE__ */ $(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1
969
979
  }, ht = { class: "wm-header__avatar" }, mt = { class: "wm-header__main" }, ft = { class: "wm-header__title" }, _t = {
970
980
  key: 0,
971
981
  class: "wm-header__sub"
972
- }, pt = { class: "wm-header__status" }, vt = {
982
+ }, pt = { class: "wm-header__status" }, gt = {
973
983
  key: 3,
974
984
  class: "wm-header__fill"
975
- }, gt = { class: "wm-header__actions" };
985
+ }, vt = { class: "wm-header__actions" };
976
986
  function yt(t, e, n, o, r, s) {
977
- const a = B("HumanAvatar"), d = B("AIAvatar"), v = B("TeamAvatars");
987
+ const a = B("HumanAvatar"), d = B("AIAvatar"), g = B("TeamAvatars");
978
988
  return l(), c("div", ct, [
979
989
  n.showBack ? (l(), c("button", {
980
990
  key: 0,
981
991
  type: "button",
982
992
  class: "wm-header__icon",
983
993
  "aria-label": "Retour à l'accueil",
984
- onClick: e[0] || (e[0] = (k) => t.$emit("back"))
994
+ onClick: e[0] || (e[0] = (C) => t.$emit("back"))
985
995
  }, [...e[3] || (e[3] = [
986
996
  i("svg", {
987
997
  width: "13",
@@ -1010,28 +1020,28 @@ function yt(t, e, n, o, r, s) {
1010
1020
  }))
1011
1021
  ]),
1012
1022
  i("div", mt, [
1013
- i("div", ft, b(n.title), 1),
1023
+ i("div", ft, k(n.title), 1),
1014
1024
  s.showPresence ? (l(), c("div", _t, [
1015
- s.hasTeam ? (l(), L(v, {
1025
+ s.hasTeam ? (l(), L(g, {
1016
1026
  key: 0,
1017
1027
  members: n.teamMembers,
1018
1028
  "response-label": n.responseLabel
1019
- }, null, 8, ["members", "response-label"])) : y("", !0),
1029
+ }, null, 8, ["members", "response-label"])) : b("", !0),
1020
1030
  i("span", pt, [
1021
1031
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
1022
- te(" " + b(s.statusText), 1)
1032
+ te(" " + k(s.statusText), 1)
1023
1033
  ])
1024
- ])) : y("", !0)
1034
+ ])) : b("", !0)
1025
1035
  ])
1026
- ], 64)) : (l(), c("div", vt)),
1027
- i("div", gt, [
1036
+ ], 64)) : (l(), c("div", gt)),
1037
+ i("div", vt, [
1028
1038
  n.showMore ? (l(), c("button", {
1029
1039
  key: 0,
1030
1040
  type: "button",
1031
1041
  class: E(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
1032
1042
  "aria-label": "Plus d'options",
1033
1043
  title: "Plus d'options",
1034
- onClick: e[1] || (e[1] = (k) => t.$emit("more"))
1044
+ onClick: e[1] || (e[1] = (C) => t.$emit("more"))
1035
1045
  }, [...e[5] || (e[5] = [
1036
1046
  i("svg", {
1037
1047
  width: "13",
@@ -1056,14 +1066,14 @@ function yt(t, e, n, o, r, s) {
1056
1066
  r: "1.6"
1057
1067
  })
1058
1068
  ], -1)
1059
- ])], 2)) : y("", !0),
1069
+ ])], 2)) : b("", !0),
1060
1070
  n.showClose ? (l(), c("button", {
1061
1071
  key: 1,
1062
1072
  type: "button",
1063
1073
  class: "wm-header__icon",
1064
1074
  "aria-label": "Fermer le widget",
1065
1075
  title: "Fermer le widget",
1066
- onClick: e[2] || (e[2] = (k) => t.$emit("close"))
1076
+ onClick: e[2] || (e[2] = (C) => t.$emit("close"))
1067
1077
  }, [...e[6] || (e[6] = [
1068
1078
  i("svg", {
1069
1079
  width: "13",
@@ -1078,7 +1088,7 @@ function yt(t, e, n, o, r, s) {
1078
1088
  }, [
1079
1089
  i("path", { d: "M18 6L6 18M6 6l12 12" })
1080
1090
  ], -1)
1081
- ])])) : y("", !0)
1091
+ ])])) : b("", !0)
1082
1092
  ])
1083
1093
  ]);
1084
1094
  }
@@ -1142,17 +1152,17 @@ function Ht(t, e, n, o, r, s) {
1142
1152
  size: 56,
1143
1153
  pulse: !0
1144
1154
  }),
1145
- i("div", At, b(s.heroTitle), 1),
1146
- i("div", St, b(s.heroSub), 1)
1155
+ i("div", At, k(s.heroTitle), 1),
1156
+ i("div", St, k(s.heroSub), 1)
1147
1157
  ]),
1148
1158
  n.quickLinks.length ? (l(), c("div", xt, [
1149
1159
  e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1150
1160
  i("div", Tt, [
1151
- (l(!0), c(M, null, D(n.quickLinks, (d, v) => (l(), c("button", {
1152
- key: v,
1161
+ (l(!0), c(M, null, D(n.quickLinks, (d, g) => (l(), c("button", {
1162
+ key: g,
1153
1163
  type: "button",
1154
1164
  class: "wm-onb__link",
1155
- onClick: (k) => t.$emit("select", d)
1165
+ onClick: (C) => t.$emit("select", d)
1156
1166
  }, [
1157
1167
  i("span", Ot, [
1158
1168
  (l(), c("svg", It, [
@@ -1161,7 +1171,7 @@ function Ht(t, e, n, o, r, s) {
1161
1171
  }, null, 8, Bt)
1162
1172
  ]))
1163
1173
  ]),
1164
- i("span", Et, b(d.label), 1),
1174
+ i("span", Et, k(d.label), 1),
1165
1175
  e[2] || (e[2] = i("svg", {
1166
1176
  width: "13",
1167
1177
  height: "13",
@@ -1178,7 +1188,7 @@ function Ht(t, e, n, o, r, s) {
1178
1188
  ], -1))
1179
1189
  ], 8, Mt))), 128))
1180
1190
  ])
1181
- ])) : y("", !0),
1191
+ ])) : b("", !0),
1182
1192
  n.openThreads.length ? (l(), c("div", $t, [
1183
1193
  e[7] || (e[7] = i("div", { class: "wm-onb__section-title" }, "Vos conversations", -1)),
1184
1194
  i("div", Lt, [
@@ -1186,7 +1196,7 @@ function Ht(t, e, n, o, r, s) {
1186
1196
  key: d.id,
1187
1197
  type: "button",
1188
1198
  class: "wm-onb__link wm-onb__resume",
1189
- onClick: (v) => t.$emit("resume", d)
1199
+ onClick: (g) => t.$emit("resume", d)
1190
1200
  }, [
1191
1201
  i("span", {
1192
1202
  class: E(["wm-onb__link-icon", { "wm-onb__resume-icon": d.unread }])
@@ -1204,11 +1214,11 @@ function Ht(t, e, n, o, r, s) {
1204
1214
  }, [
1205
1215
  i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
1206
1216
  ], -1)),
1207
- d.unread ? (l(), c("span", Ft)) : y("", !0)
1217
+ d.unread ? (l(), c("span", Ft)) : b("", !0)
1208
1218
  ], 2),
1209
1219
  i("span", Dt, [
1210
- i("span", Nt, b(d.title), 1),
1211
- i("span", jt, b(d.preview), 1)
1220
+ i("span", Nt, k(d.title), 1),
1221
+ i("span", jt, k(d.preview), 1)
1212
1222
  ]),
1213
1223
  e[5] || (e[5] = i("svg", {
1214
1224
  width: "13",
@@ -1246,14 +1256,14 @@ function Ht(t, e, n, o, r, s) {
1246
1256
  ], -1)
1247
1257
  ])])
1248
1258
  ])
1249
- ])) : y("", !0),
1259
+ ])) : b("", !0),
1250
1260
  i("div", Ut, [
1251
1261
  i("button", {
1252
1262
  type: "button",
1253
1263
  class: "wm-onb__startBtn",
1254
1264
  disabled: n.busy,
1255
1265
  onClick: e[1] || (e[1] = (d) => t.$emit("start"))
1256
- }, b(n.busy ? "…" : "Commencer une conversation"), 9, Pt)
1266
+ }, k(n.busy ? "…" : "Commencer une conversation"), 9, Pt)
1257
1267
  ])
1258
1268
  ]);
1259
1269
  }
@@ -1351,14 +1361,14 @@ function en(t, e, n, o, r, s) {
1351
1361
  ])]))
1352
1362
  ]),
1353
1363
  i("span", Xt, [
1354
- i("span", Zt, b(n.label), 1),
1364
+ i("span", Zt, k(n.label), 1),
1355
1365
  s.detailText ? (l(), c(M, { key: 0 }, [
1356
1366
  e[4] || (e[4] = i("span", {
1357
1367
  class: "wm-result__sep",
1358
1368
  "aria-hidden": "true"
1359
1369
  }, " · ", -1)),
1360
- i("span", Qt, b(s.detailText), 1)
1361
- ], 64)) : y("", !0)
1370
+ i("span", Qt, k(s.detailText), 1)
1371
+ ], 64)) : b("", !0)
1362
1372
  ])
1363
1373
  ], 2);
1364
1374
  }
@@ -1377,7 +1387,7 @@ const tn = /* @__PURE__ */ $(qt, [["render", en], ["__scopeId", "data-v-64a83fb8
1377
1387
  function dn(t, e, n, o, r, s) {
1378
1388
  return l(), c("div", sn, [
1379
1389
  i("div", rn, [
1380
- i("div", an, b(n.data.title || "Formulaire"), 1),
1390
+ i("div", an, k(n.data.title || "Formulaire"), 1),
1381
1391
  e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
1382
1392
  i("svg", {
1383
1393
  width: "11",
@@ -1400,10 +1410,10 @@ function dn(t, e, n, o, r, s) {
1400
1410
  key: d,
1401
1411
  class: "wm-art__field"
1402
1412
  }, [
1403
- i("div", ln, b(a.label), 1),
1413
+ i("div", ln, k(a.label), 1),
1404
1414
  i("div", {
1405
1415
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1406
- }, b(a.value), 3)
1416
+ }, k(a.value), 3)
1407
1417
  ]))), 128))
1408
1418
  ])
1409
1419
  ]);
@@ -1426,7 +1436,7 @@ const cn = /* @__PURE__ */ $(nn, [["render", dn], ["__scopeId", "data-v-ca24a9c9
1426
1436
  }, hn = { class: "wm-art wm-art--infoCard" }, mn = {
1427
1437
  key: 0,
1428
1438
  class: "wm-art__image"
1429
- }, fn = ["src", "alt"], _n = { class: "wm-art__head" }, pn = { class: "wm-art__headMain" }, vn = { class: "wm-art__title" }, gn = {
1439
+ }, fn = ["src", "alt"], _n = { class: "wm-art__head" }, pn = { class: "wm-art__headMain" }, gn = { class: "wm-art__title" }, vn = {
1430
1440
  key: 0,
1431
1441
  class: "wm-art__subtitle"
1432
1442
  }, yn = {
@@ -1444,29 +1454,29 @@ function kn(t, e, n, o, r, s) {
1444
1454
  alt: n.data.title || "",
1445
1455
  loading: "lazy"
1446
1456
  }, null, 8, fn)
1447
- ])) : y("", !0),
1457
+ ])) : b("", !0),
1448
1458
  i("div", _n, [
1449
1459
  i("div", pn, [
1450
- i("div", vn, b(n.data.title), 1),
1451
- n.data.subtitle ? (l(), c("div", gn, b(n.data.subtitle), 1)) : y("", !0)
1460
+ i("div", gn, k(n.data.title), 1),
1461
+ n.data.subtitle ? (l(), c("div", vn, k(n.data.subtitle), 1)) : b("", !0)
1452
1462
  ]),
1453
1463
  n.data.badge && n.data.badge.label ? (l(), c("span", {
1454
1464
  key: 0,
1455
1465
  class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1456
- }, b(n.data.badge.label), 3)) : y("", !0)
1466
+ }, k(n.data.badge.label), 3)) : b("", !0)
1457
1467
  ]),
1458
1468
  s.hasBody ? (l(), c("div", yn, [
1459
- n.data.body ? (l(), c("div", wn, b(n.data.body), 1)) : y("", !0),
1469
+ n.data.body ? (l(), c("div", wn, k(n.data.body), 1)) : b("", !0),
1460
1470
  s.fields.length ? (l(!0), c(M, { key: 1 }, D(s.fields, (a, d) => (l(), c("div", {
1461
1471
  key: d,
1462
1472
  class: "wm-art__field"
1463
1473
  }, [
1464
- i("div", bn, b(a.label), 1),
1474
+ i("div", bn, k(a.label), 1),
1465
1475
  i("div", {
1466
1476
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1467
- }, b(a.value), 3)
1468
- ]))), 128)) : y("", !0)
1469
- ])) : y("", !0)
1477
+ }, k(a.value), 3)
1478
+ ]))), 128)) : b("", !0)
1479
+ ])) : b("", !0)
1470
1480
  ]);
1471
1481
  }
1472
1482
  const Cn = /* @__PURE__ */ $(un, [["render", kn], ["__scopeId", "data-v-d7369333"]]);
@@ -1536,7 +1546,7 @@ const Sn = {
1536
1546
  function Dn(t, e, n, o, r, s) {
1537
1547
  return l(), c("div", xn, [
1538
1548
  i("div", Tn, [
1539
- i("div", Mn, b(n.data.title), 1),
1549
+ i("div", Mn, k(n.data.title), 1),
1540
1550
  i("div", On, [
1541
1551
  i("div", In, [
1542
1552
  e[0] || (e[0] = i("svg", {
@@ -1553,7 +1563,7 @@ function Dn(t, e, n, o, r, s) {
1553
1563
  i("path", { d: "M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z" }),
1554
1564
  i("path", { d: "M13 5v2M13 17v2M13 11v2" })
1555
1565
  ], -1)),
1556
- i("span", null, b(n.data.reference), 1)
1566
+ i("span", null, k(n.data.reference), 1)
1557
1567
  ]),
1558
1568
  i("span", {
1559
1569
  class: E(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
@@ -1562,17 +1572,17 @@ function Dn(t, e, n, o, r, s) {
1562
1572
  class: "wm-tk__dot",
1563
1573
  "aria-hidden": "true"
1564
1574
  }, null, -1)),
1565
- te(" " + b(n.data.status.label), 1)
1575
+ te(" " + k(n.data.status.label), 1)
1566
1576
  ], 2)
1567
1577
  ]),
1568
- n.data.body ? (l(), c("div", Bn, b(n.data.body), 1)) : y("", !0)
1578
+ n.data.body ? (l(), c("div", Bn, k(n.data.body), 1)) : b("", !0)
1569
1579
  ]),
1570
1580
  s.fields.length ? (l(), c("div", En, [
1571
1581
  (l(!0), c(M, null, D(s.fields, (a, d) => (l(), c("div", {
1572
1582
  key: d,
1573
1583
  class: "wm-art__field"
1574
1584
  }, [
1575
- i("div", $n, b(a.label), 1),
1585
+ i("div", $n, k(a.label), 1),
1576
1586
  i("div", {
1577
1587
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1578
1588
  }, [
@@ -1615,11 +1625,11 @@ function Dn(t, e, n, o, r, s) {
1615
1625
  rx: "2"
1616
1626
  }, null, -1),
1617
1627
  i("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
1618
- ])])) : y("", !0),
1619
- i("span", null, b(a.value), 1)
1628
+ ])])) : b("", !0),
1629
+ i("span", null, k(a.value), 1)
1620
1630
  ], 2)
1621
1631
  ]))), 128))
1622
- ])) : y("", !0),
1632
+ ])) : b("", !0),
1623
1633
  n.data.created_at ? (l(), c("div", Fn, [
1624
1634
  e[4] || (e[4] = i("svg", {
1625
1635
  width: "11",
@@ -1641,8 +1651,8 @@ function Dn(t, e, n, o, r, s) {
1641
1651
  }),
1642
1652
  i("path", { d: "M16 2v4M8 2v4M3 10h18" })
1643
1653
  ], -1)),
1644
- i("span", null, b(s.formattedDate), 1)
1645
- ])) : y("", !0)
1654
+ i("span", null, k(s.formattedDate), 1)
1655
+ ])) : b("", !0)
1646
1656
  ]);
1647
1657
  }
1648
1658
  const Nn = /* @__PURE__ */ $(Sn, [["render", Dn], ["__scopeId", "data-v-8b274eb7"]]), jn = {
@@ -1668,7 +1678,7 @@ function Pn(t, e, n, o, r, s) {
1668
1678
  return s.component ? (l(), L(Me(s.component), {
1669
1679
  key: 0,
1670
1680
  data: n.artifact.data
1671
- }, null, 8, ["data"])) : y("", !0);
1681
+ }, null, 8, ["data"])) : b("", !0);
1672
1682
  }
1673
1683
  const Hn = /* @__PURE__ */ $(Un, [["render", Pn]]), zn = {
1674
1684
  name: "WmAttachmentPreview",
@@ -1784,10 +1794,10 @@ function Qn(t, e, n, o, r, s) {
1784
1794
  ])
1785
1795
  ], -1)),
1786
1796
  i("span", Yn, [
1787
- i("span", Jn, b(s.displayName), 1),
1788
- s.sizeLabel ? (l(), c("span", Xn, b(s.sizeLabel), 1)) : y("", !0)
1797
+ i("span", Jn, k(s.displayName), 1),
1798
+ s.sizeLabel ? (l(), c("span", Xn, k(s.sizeLabel), 1)) : b("", !0)
1789
1799
  ]),
1790
- r.loading ? (l(), c("span", Zn)) : y("", !0)
1800
+ r.loading ? (l(), c("span", Zn)) : b("", !0)
1791
1801
  ], 8, Gn))
1792
1802
  ], 2);
1793
1803
  }
@@ -1816,45 +1826,45 @@ function ss(t) {
1816
1826
  const s = e[o];
1817
1827
  if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1818
1828
  o++;
1819
- const k = [];
1829
+ const C = [];
1820
1830
  for (; o < e.length && !/^\s*```\s*$/.test(e[o]); )
1821
- k.push(e[o]), o++;
1831
+ C.push(e[o]), o++;
1822
1832
  o < e.length && o++, n.push({
1823
1833
  type: "block",
1824
- html: `<pre class="wm-md-pre"><code>${k.join(`
1834
+ html: `<pre class="wm-md-pre"><code>${C.join(`
1825
1835
  `)}</code></pre>`
1826
1836
  });
1827
1837
  continue;
1828
1838
  }
1829
1839
  if (/^\s*[-*]\s+/.test(s)) {
1830
- const k = [];
1840
+ const C = [];
1831
1841
  for (; o < e.length; ) {
1832
1842
  const S = /^\s*[-*]\s+(.*)$/.exec(e[o]);
1833
1843
  if (!S) break;
1834
- k.push(S[1]), o++;
1844
+ C.push(S[1]), o++;
1835
1845
  }
1836
- const w = k.map((S) => `<li>${re(S)}</li>`).join("");
1846
+ const w = C.map((S) => `<li>${re(S)}</li>`).join("");
1837
1847
  n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1838
1848
  continue;
1839
1849
  }
1840
1850
  const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1841
1851
  if (d) {
1842
- const k = parseInt(d[1], 10), w = [d[2]];
1852
+ const C = parseInt(d[1], 10), w = [d[2]];
1843
1853
  for (o++; o < e.length; ) {
1844
1854
  const A = /^\s*\d+\.\s+(.*)$/.exec(e[o]);
1845
1855
  if (!A) break;
1846
1856
  w.push(A[1]), o++;
1847
1857
  }
1848
- const S = w.map((A) => `<li>${re(A)}</li>`).join(""), F = k !== 1 ? ` start="${k}"` : "";
1858
+ const S = w.map((A) => `<li>${re(A)}</li>`).join(""), F = C !== 1 ? ` start="${C}"` : "";
1849
1859
  n.push({ type: "block", html: `<ol class="wm-md-ol"${F}>${S}</ol>` });
1850
1860
  continue;
1851
1861
  }
1852
- const v = /^(#{1,6})\s+(.*)$/.exec(s);
1853
- if (v) {
1854
- const k = v[1].length;
1862
+ const g = /^(#{1,6})\s+(.*)$/.exec(s);
1863
+ if (g) {
1864
+ const C = g[1].length;
1855
1865
  n.push({
1856
1866
  type: "block",
1857
- html: `<h${k} class="wm-md-h wm-md-h${k}">${re(v[2])}</h${k}>`
1867
+ html: `<h${C} class="wm-md-h wm-md-h${C}">${re(g[2])}</h${C}>`
1858
1868
  }), o++;
1859
1869
  continue;
1860
1870
  }
@@ -1984,8 +1994,8 @@ const hs = {
1984
1994
  });
1985
1995
  continue;
1986
1996
  }
1987
- const v = t[t.length - 1];
1988
- v && v.role === d && (d === "ai" || v.agentName === (((o = a == null ? void 0 : a.author) == null ? void 0 : o.name) || "")) ? v.messages.push(a) : t.push({
1997
+ const g = t[t.length - 1];
1998
+ g && g.role === d && (d === "ai" || g.agentName === (((o = a == null ? void 0 : a.author) == null ? void 0 : o.name) || "")) ? g.messages.push(a) : t.push({
1989
1999
  key: `g-${ee(a)}`,
1990
2000
  role: d,
1991
2001
  agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
@@ -1997,8 +2007,8 @@ const hs = {
1997
2007
  for (const a of t) {
1998
2008
  if (a.role === "system") continue;
1999
2009
  const d = [];
2000
- for (const v of a.messages)
2001
- for (const k of this.itemsOf(v)) d.push(k);
2010
+ for (const g of a.messages)
2011
+ for (const C of this.itemsOf(g)) d.push(C);
2002
2012
  a.items = d;
2003
2013
  }
2004
2014
  const e = [];
@@ -2101,11 +2111,11 @@ const hs = {
2101
2111
  }
2102
2112
  if (!r.anchor) return;
2103
2113
  const s = () => {
2104
- var k;
2114
+ var C;
2105
2115
  const a = r.anchor;
2106
- if (!((k = a.el) != null && k.isConnected)) return;
2107
- const v = a.el.getBoundingClientRect().top - t.getBoundingClientRect().top - a.relY;
2108
- Math.abs(v) > 0.5 && (t.scrollTop += v);
2116
+ if (!((C = a.el) != null && C.isConnected)) return;
2117
+ const g = a.el.getBoundingClientRect().top - t.getBoundingClientRect().top - a.relY;
2118
+ Math.abs(g) > 0.5 && (t.scrollTop += g);
2109
2119
  };
2110
2120
  s(), requestAnimationFrame(() => {
2111
2121
  s(), requestAnimationFrame(s);
@@ -2228,10 +2238,10 @@ const hs = {
2228
2238
  // adjacent à une `bubble`) : mon coin déborde le voisin et
2229
2239
  // doit garder son arrondi.
2230
2240
  cornersFor(t, e) {
2231
- var Y, z, Z;
2232
- const n = t.items, o = (Y = n[e]) == null ? void 0 : Y.kind, r = (z = n[e - 1]) == null ? void 0 : z.kind, s = (Z = n[e + 1]) == null ? void 0 : Z.kind, a = t.role === "user", d = 14, v = 4, k = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], F = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], U = 0.5, x = (W, V, Q) => W != null && S != null ? W + U >= S : V === Q || V === "card" && Q === "bubble";
2241
+ var Y, z, Q;
2242
+ const n = t.items, o = (Y = n[e]) == null ? void 0 : Y.kind, r = (z = n[e - 1]) == null ? void 0 : z.kind, s = (Q = n[e + 1]) == null ? void 0 : Q.kind, a = t.role === "user", d = 14, g = 4, C = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], F = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], U = 0.5, x = (W, V, J) => W != null && S != null ? W + U >= S : V === J || V === "card" && J === "bubble";
2233
2243
  let j = d, P = d, R = d, H = d;
2234
- return a ? (k && (P = v), (w || !s) && (R = v), k && x(F, k, o == null ? void 0 : o.top) && (j = v), w && x(A, w, o == null ? void 0 : o.bottom) && (H = v)) : (k && (j = v), (w || !s) && (H = v), k && x(F, k, o == null ? void 0 : o.top) && (P = v), w && x(A, w, o == null ? void 0 : o.bottom) && (R = v)), { tl: j, tr: P, br: R, bl: H };
2244
+ return a ? (C && (P = g), (w || !s) && (R = g), C && x(F, C, o == null ? void 0 : o.top) && (j = g), w && x(A, w, o == null ? void 0 : o.bottom) && (H = g)) : (C && (j = g), (w || !s) && (H = g), C && x(F, C, o == null ? void 0 : o.top) && (P = g), w && x(A, w, o == null ? void 0 : o.bottom) && (R = g)), { tl: j, tr: P, br: R, bl: H };
2235
2245
  },
2236
2246
  // Inline style emitting the four corner CSS variables. Set on
2237
2247
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2274,8 +2284,8 @@ const hs = {
2274
2284
  if (!a) continue;
2275
2285
  const d = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2276
2286
  if (!d) continue;
2277
- const v = d.getBoundingClientRect().width;
2278
- v > 0 && (e[a] = v);
2287
+ const g = d.getBoundingClientRect().width;
2288
+ g > 0 && (e[a] = g);
2279
2289
  }
2280
2290
  const n = this.widthByKey, o = Object.keys(n), r = Object.keys(e);
2281
2291
  if (o.length === r.length) {
@@ -2350,10 +2360,10 @@ const hs = {
2350
2360
  class: "wm-list__loadMore",
2351
2361
  role: "status",
2352
2362
  "aria-live": "polite"
2353
- }, vs = {
2363
+ }, gs = {
2354
2364
  key: 1,
2355
2365
  class: "wm-list__historyEnd"
2356
- }, gs = {
2366
+ }, vs = {
2357
2367
  key: 2,
2358
2368
  class: "wm-list__sep"
2359
2369
  }, ys = { class: "wm-list__sep-label" }, ws = {
@@ -2376,7 +2386,7 @@ const hs = {
2376
2386
  class: "wm-list__row wm-list__row--ai fade-up"
2377
2387
  }, Is = { class: "wm-list__avatarSlot" };
2378
2388
  function Bs(t, e, n, o, r, s) {
2379
- const a = B("AIAvatar"), d = B("HumanAvatar"), v = B("ActionResult"), k = B("ArtifactRenderer"), w = B("Bubble"), S = B("AttachmentPreview"), F = B("Typing");
2389
+ const a = B("AIAvatar"), d = B("HumanAvatar"), g = B("ActionResult"), C = B("ArtifactRenderer"), w = B("Bubble"), S = B("AttachmentPreview"), F = B("Typing");
2380
2390
  return l(), c("div", {
2381
2391
  ref: "scrollEl",
2382
2392
  class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
@@ -2388,12 +2398,12 @@ function Bs(t, e, n, o, r, s) {
2388
2398
  "aria-hidden": "true"
2389
2399
  }, null, -1),
2390
2400
  i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
2391
- ])])) : s.historyExhausted ? (l(), c("div", vs, "Début de la conversation")) : y("", !0),
2392
- n.dateLabel ? (l(), c("div", gs, [
2401
+ ])])) : s.historyExhausted ? (l(), c("div", gs, "Début de la conversation")) : b("", !0),
2402
+ n.dateLabel ? (l(), c("div", vs, [
2393
2403
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2394
- i("span", ys, b(n.dateLabel), 1),
2404
+ i("span", ys, k(n.dateLabel), 1),
2395
2405
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2396
- ])) : y("", !0),
2406
+ ])) : b("", !0),
2397
2407
  (l(!0), c(M, null, D(s.groups, (A, U) => (l(), c(M, {
2398
2408
  key: A.key
2399
2409
  }, [
@@ -2401,14 +2411,14 @@ function Bs(t, e, n, o, r, s) {
2401
2411
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
2402
2412
  i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
2403
2413
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
2404
- ])])) : y("", !0),
2414
+ ])])) : b("", !0),
2405
2415
  A.role === "system" || A.items.length ? (l(), c("div", {
2406
2416
  key: 1,
2407
2417
  class: E(["wm-list__group", "wm-list__group--" + A.role])
2408
2418
  }, [
2409
2419
  A.role === "system" ? (l(), c("div", bs, [
2410
2420
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2411
- i("span", ks, b(A.systemLabel), 1),
2421
+ i("span", ks, k(A.systemLabel), 1),
2412
2422
  e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2413
2423
  ])) : (l(), c(M, { key: 1 }, [
2414
2424
  (l(!0), c(M, null, D(A.items, (x, j) => (l(), c("div", {
@@ -2429,22 +2439,22 @@ function Bs(t, e, n, o, r, s) {
2429
2439
  "avatar-url": A.agentAvatarUrl,
2430
2440
  size: 26
2431
2441
  }, null, 8, ["name", "avatar-url"]))
2432
- ], 64)) : y("", !0)
2433
- ])) : y("", !0),
2434
- x.renderAs === "action" ? (l(), L(v, {
2442
+ ], 64)) : b("", !0)
2443
+ ])) : b("", !0),
2444
+ x.renderAs === "action" ? (l(), L(g, {
2435
2445
  key: 1,
2436
2446
  state: x.message.payload.state,
2437
2447
  label: s.actionLabel(x.message),
2438
2448
  detail: s.actionDetail(x.message)
2439
- }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), L(v, {
2449
+ }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), L(g, {
2440
2450
  key: 2,
2441
2451
  state: "awaiting",
2442
2452
  label: "Demande d'approbation envoyée",
2443
2453
  detail: x.message.text_md || ""
2444
- }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), L(k, {
2454
+ }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), L(C, {
2445
2455
  key: 3,
2446
2456
  artifact: s.actionArtifact(x.message)
2447
- }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), L(k, {
2457
+ }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), L(C, {
2448
2458
  key: 4,
2449
2459
  artifact: s.artifactOf(x.message)
2450
2460
  }, null, 8, ["artifact"])) : (l(), c("div", Ss, [
@@ -2452,7 +2462,7 @@ function Bs(t, e, n, o, r, s) {
2452
2462
  key: 0,
2453
2463
  role: A.role,
2454
2464
  text: x.message.text_md
2455
- }, null, 8, ["role", "text"])) : y("", !0),
2465
+ }, null, 8, ["role", "text"])) : b("", !0),
2456
2466
  s.attachmentsOf(x.message).length ? (l(), c("div", {
2457
2467
  key: 1,
2458
2468
  class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
@@ -2461,19 +2471,19 @@ function Bs(t, e, n, o, r, s) {
2461
2471
  key: `${s.messageKey(x.message)}-att-${R}`,
2462
2472
  attachment: P
2463
2473
  }, null, 8, ["attachment"]))), 128))
2464
- ], 2)) : y("", !0)
2474
+ ], 2)) : b("", !0)
2465
2475
  ]))
2466
2476
  ], 14, Cs))), 128)),
2467
2477
  (A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (l(), c("div", {
2468
2478
  key: 0,
2469
2479
  class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2470
2480
  }, [
2471
- A.role !== "user" ? (l(), c("span", xs, b(s.roleLabel(A)), 1)) : y("", !0),
2472
- A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ts, "·")) : y("", !0),
2473
- s.lastTimeOf(A) ? (l(), c("span", Ms, b(s.lastTimeOf(A)), 1)) : y("", !0)
2474
- ], 2)) : y("", !0)
2481
+ A.role !== "user" ? (l(), c("span", xs, k(s.roleLabel(A)), 1)) : b("", !0),
2482
+ A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ts, "·")) : b("", !0),
2483
+ s.lastTimeOf(A) ? (l(), c("span", Ms, k(s.lastTimeOf(A)), 1)) : b("", !0)
2484
+ ], 2)) : b("", !0)
2475
2485
  ], 64))
2476
- ], 2)) : y("", !0)
2486
+ ], 2)) : b("", !0)
2477
2487
  ], 64))), 128)),
2478
2488
  n.streamingActive ? (l(), c("div", Os, [
2479
2489
  i("div", Is, [
@@ -2483,7 +2493,7 @@ function Bs(t, e, n, o, r, s) {
2483
2493
  })
2484
2494
  ]),
2485
2495
  K(F)
2486
- ])) : y("", !0)
2496
+ ])) : b("", !0)
2487
2497
  ], 34);
2488
2498
  }
2489
2499
  const Es = /* @__PURE__ */ $(_s, [["render", Bs], ["__scopeId", "data-v-54959b73"]]), oe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
@@ -2533,13 +2543,13 @@ async function Rs(t) {
2533
2543
  e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
2534
2544
  const n = e.videoWidth || 1280, o = e.videoHeight || 720, r = document.createElement("canvas");
2535
2545
  r.width = n, r.height = o, r.getContext("2d").drawImage(e, 0, 0, n, o);
2536
- const s = await new Promise((d, v) => {
2537
- r.toBlob((k) => k ? d(k) : v(new Error("toBlob failed")), "image/png");
2546
+ const s = await new Promise((d, g) => {
2547
+ r.toBlob((C) => C ? d(C) : g(new Error("toBlob failed")), "image/png");
2538
2548
  }), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2539
2549
  return new File([s], `capture-${a}.png`, { type: "image/png" });
2540
2550
  }
2541
2551
  async function Fs(t = {}) {
2542
- var k;
2552
+ var C;
2543
2553
  if (!oe || !he) return null;
2544
2554
  let e;
2545
2555
  try {
@@ -2587,11 +2597,11 @@ async function Fs(t = {}) {
2587
2597
  S.stop();
2588
2598
  }), null;
2589
2599
  }
2590
- (k = t.onstart) == null || k.call(t);
2591
- const v = Date.now();
2600
+ (C = t.onstart) == null || C.call(t);
2601
+ const g = Date.now();
2592
2602
  return s = setInterval(() => {
2593
2603
  var w;
2594
- (w = t.ontick) == null || w.call(t, Date.now() - v);
2604
+ (w = t.ontick) == null || w.call(t, Date.now() - g);
2595
2605
  }, 500), {
2596
2606
  stop: d,
2597
2607
  get state() {
@@ -2761,16 +2771,16 @@ function Xs(t, e, n, o, r, s) {
2761
2771
  class: "wm-rec__dot",
2762
2772
  "aria-hidden": "true"
2763
2773
  }, null, -1)),
2764
- i("span", Ps, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2774
+ i("span", Ps, "Enregistrement · " + k(s.recordingElapsedLabel), 1),
2765
2775
  i("button", {
2766
2776
  type: "button",
2767
2777
  class: "wm-rec__stop",
2768
2778
  onClick: e[0] || (e[0] = (...a) => s.stopRecording && s.stopRecording(...a))
2769
2779
  }, "Arrêter")
2770
- ])) : y("", !0),
2780
+ ])) : b("", !0),
2771
2781
  i("form", {
2772
2782
  class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2773
- onSubmit: e[7] || (e[7] = X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
2783
+ onSubmit: e[7] || (e[7] = Z((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
2774
2784
  }, [
2775
2785
  i("input", {
2776
2786
  ref: "fileEl",
@@ -2783,7 +2793,7 @@ function Xs(t, e, n, o, r, s) {
2783
2793
  key: 0,
2784
2794
  class: "wm-compose__overlay",
2785
2795
  onClick: e[2] || (e[2] = (a) => r.attachOpen = !1)
2786
- })) : y("", !0),
2796
+ })) : b("", !0),
2787
2797
  r.attachOpen ? (l(), c("div", Hs, [
2788
2798
  (l(!0), c(M, null, D(s.attachItems, (a) => (l(), c("button", {
2789
2799
  key: a.action,
@@ -2804,9 +2814,9 @@ function Xs(t, e, n, o, r, s) {
2804
2814
  }, null, 8, Ws)
2805
2815
  ]))
2806
2816
  ]),
2807
- i("span", null, b(a.label), 1)
2817
+ i("span", null, k(a.label), 1)
2808
2818
  ], 8, zs))), 128))
2809
- ])) : y("", !0),
2819
+ ])) : b("", !0),
2810
2820
  q(i("textarea", {
2811
2821
  ref: "inputEl",
2812
2822
  "onUpdate:modelValue": e[3] || (e[3] = (a) => r.local = a),
@@ -2817,7 +2827,7 @@ function Xs(t, e, n, o, r, s) {
2817
2827
  onKeydown: e[4] || (e[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
2818
2828
  onInput: e[5] || (e[5] = (...a) => s.autosize && s.autosize(...a))
2819
2829
  }, null, 40, Ks), [
2820
- [J, r.local]
2830
+ [X, r.local]
2821
2831
  ]),
2822
2832
  i("div", Gs, [
2823
2833
  i("button", {
@@ -2894,9 +2904,9 @@ function tr(t, e, n, o, r, s) {
2894
2904
  type: "button",
2895
2905
  class: "wm-chip",
2896
2906
  style: G({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
2897
- onClick: (v) => t.$emit("select", a)
2898
- }, b(a.label), 13, er))), 128))
2899
- ])) : y("", !0);
2907
+ onClick: (g) => t.$emit("select", a)
2908
+ }, k(a.label), 13, er))), 128))
2909
+ ])) : b("", !0);
2900
2910
  }
2901
2911
  const nr = /* @__PURE__ */ $(Qs, [["render", tr], ["__scopeId", "data-v-55aa529d"]]), sr = {
2902
2912
  name: "WmApprovalCard",
@@ -2943,8 +2953,8 @@ function ur(t, e, n, o, r, s) {
2943
2953
  K(a, { size: 24 })
2944
2954
  ]),
2945
2955
  i("div", or, [
2946
- i("div", lr, b(n.action), 1),
2947
- n.detail ? (l(), c("div", dr, b(n.detail), 1)) : y("", !0)
2956
+ i("div", lr, k(n.action), 1),
2957
+ n.detail ? (l(), c("div", dr, k(n.detail), 1)) : b("", !0)
2948
2958
  ])
2949
2959
  ]),
2950
2960
  i("div", cr, [
@@ -2953,18 +2963,18 @@ function ur(t, e, n, o, r, s) {
2953
2963
  type: "button",
2954
2964
  class: "wm-approval__btn wm-approval__btn--neutral",
2955
2965
  onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
2956
- }, b(s.rejectLabel), 1)) : y("", !0),
2966
+ }, k(s.rejectLabel), 1)) : b("", !0),
2957
2967
  s.approveId ? (l(), c("button", {
2958
2968
  key: 1,
2959
2969
  type: "button",
2960
2970
  class: "wm-approval__btn wm-approval__btn--primary",
2961
2971
  onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
2962
- }, b(s.approveLabel), 1)) : y("", !0)
2972
+ }, k(s.approveLabel), 1)) : b("", !0)
2963
2973
  ])
2964
2974
  ]);
2965
2975
  }
2966
2976
  const hr = /* @__PURE__ */ $(sr, [["render", ur], ["__scopeId", "data-v-b1be139c"]]);
2967
- let ve = 0;
2977
+ let ge = 0;
2968
2978
  const mr = /* @__PURE__ */ new Set([
2969
2979
  "text",
2970
2980
  "textarea",
@@ -2983,8 +2993,8 @@ const mr = /* @__PURE__ */ new Set([
2983
2993
  },
2984
2994
  emits: ["submit"],
2985
2995
  data() {
2986
- return ve += 1, {
2987
- _uid: ve,
2996
+ return ge += 1, {
2997
+ _uid: ge,
2988
2998
  values: {},
2989
2999
  busy: !1,
2990
3000
  error: ""
@@ -3047,7 +3057,7 @@ const mr = /* @__PURE__ */ new Set([
3047
3057
  }
3048
3058
  }
3049
3059
  }
3050
- }, _r = { class: "wm-form" }, pr = { class: "wm-form__head" }, vr = { class: "wm-form__icon" }, gr = { class: "wm-form__main" }, yr = { class: "wm-form__title" }, wr = {
3060
+ }, _r = { class: "wm-form" }, pr = { class: "wm-form__head" }, gr = { class: "wm-form__icon" }, vr = { class: "wm-form__main" }, yr = { class: "wm-form__title" }, wr = {
3051
3061
  key: 0,
3052
3062
  class: "wm-form__detail"
3053
3063
  }, br = ["for"], kr = {
@@ -3078,17 +3088,17 @@ function Nr(t, e, n, o, r, s) {
3078
3088
  const a = B("AIAvatar");
3079
3089
  return l(), c("div", _r, [
3080
3090
  i("div", pr, [
3081
- i("div", vr, [
3091
+ i("div", gr, [
3082
3092
  K(a, { size: 24 })
3083
3093
  ]),
3084
- i("div", gr, [
3085
- i("div", yr, b(n.form.title || "Formulaire"), 1),
3086
- n.form.description ? (l(), c("div", wr, b(n.form.description), 1)) : y("", !0)
3094
+ i("div", vr, [
3095
+ i("div", yr, k(n.form.title || "Formulaire"), 1),
3096
+ n.form.description ? (l(), c("div", wr, k(n.form.description), 1)) : b("", !0)
3087
3097
  ])
3088
3098
  ]),
3089
3099
  i("form", {
3090
3100
  class: "wm-form__body",
3091
- onSubmit: e[0] || (e[0] = X((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
3101
+ onSubmit: e[0] || (e[0] = Z((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
3092
3102
  }, [
3093
3103
  (l(!0), c(M, null, D(s.normalizedFields, (d) => (l(), c("div", {
3094
3104
  key: d.key,
@@ -3098,35 +3108,35 @@ function Nr(t, e, n, o, r, s) {
3098
3108
  for: `wm-f-${r._uid}-${d.key}`,
3099
3109
  class: "wm-form__label"
3100
3110
  }, [
3101
- te(b(d.label), 1),
3102
- d.required ? (l(), c("span", kr, "*")) : y("", !0)
3111
+ te(k(d.label), 1),
3112
+ d.required ? (l(), c("span", kr, "*")) : b("", !0)
3103
3113
  ], 8, br),
3104
3114
  d.type === "text" ? q((l(), c("input", {
3105
3115
  key: 0,
3106
3116
  id: `wm-f-${r._uid}-${d.key}`,
3107
- "onUpdate:modelValue": (v) => r.values[d.key] = v,
3117
+ "onUpdate:modelValue": (g) => r.values[d.key] = g,
3108
3118
  type: "text",
3109
3119
  class: "wm-form__input",
3110
3120
  placeholder: d.placeholder || "",
3111
3121
  required: d.required,
3112
3122
  disabled: n.readOnly || r.busy
3113
3123
  }, null, 8, Cr)), [
3114
- [J, r.values[d.key]]
3124
+ [X, r.values[d.key]]
3115
3125
  ]) : d.type === "textarea" ? q((l(), c("textarea", {
3116
3126
  key: 1,
3117
3127
  id: `wm-f-${r._uid}-${d.key}`,
3118
- "onUpdate:modelValue": (v) => r.values[d.key] = v,
3128
+ "onUpdate:modelValue": (g) => r.values[d.key] = g,
3119
3129
  class: "wm-form__textarea",
3120
3130
  rows: "3",
3121
3131
  placeholder: d.placeholder || "",
3122
3132
  required: d.required,
3123
3133
  disabled: n.readOnly || r.busy
3124
3134
  }, null, 8, Ar)), [
3125
- [J, r.values[d.key]]
3135
+ [X, r.values[d.key]]
3126
3136
  ]) : d.type === "number" ? q((l(), c("input", {
3127
3137
  key: 2,
3128
3138
  id: `wm-f-${r._uid}-${d.key}`,
3129
- "onUpdate:modelValue": (v) => r.values[d.key] = v,
3139
+ "onUpdate:modelValue": (g) => r.values[d.key] = g,
3130
3140
  type: "number",
3131
3141
  class: "wm-form__input",
3132
3142
  placeholder: d.placeholder || "",
@@ -3134,7 +3144,7 @@ function Nr(t, e, n, o, r, s) {
3134
3144
  disabled: n.readOnly || r.busy
3135
3145
  }, null, 8, Sr)), [
3136
3146
  [
3137
- J,
3147
+ X,
3138
3148
  r.values[d.key],
3139
3149
  void 0,
3140
3150
  { number: !0 }
@@ -3142,63 +3152,63 @@ function Nr(t, e, n, o, r, s) {
3142
3152
  ]) : d.type === "date" ? q((l(), c("input", {
3143
3153
  key: 3,
3144
3154
  id: `wm-f-${r._uid}-${d.key}`,
3145
- "onUpdate:modelValue": (v) => r.values[d.key] = v,
3155
+ "onUpdate:modelValue": (g) => r.values[d.key] = g,
3146
3156
  type: "date",
3147
3157
  class: "wm-form__input",
3148
3158
  required: d.required,
3149
3159
  disabled: n.readOnly || r.busy
3150
3160
  }, null, 8, xr)), [
3151
- [J, r.values[d.key]]
3161
+ [X, r.values[d.key]]
3152
3162
  ]) : d.type === "boolean" ? (l(), c("label", Tr, [
3153
3163
  q(i("input", {
3154
3164
  id: `wm-f-${r._uid}-${d.key}`,
3155
- "onUpdate:modelValue": (v) => r.values[d.key] = v,
3165
+ "onUpdate:modelValue": (g) => r.values[d.key] = g,
3156
3166
  type: "checkbox",
3157
3167
  disabled: n.readOnly || r.busy
3158
3168
  }, null, 8, Mr), [
3159
3169
  [Ie, r.values[d.key]]
3160
3170
  ]),
3161
- i("span", null, b(d.placeholder || "Oui"), 1)
3171
+ i("span", null, k(d.placeholder || "Oui"), 1)
3162
3172
  ])) : d.type === "select" ? q((l(), c("select", {
3163
3173
  key: 5,
3164
3174
  id: `wm-f-${r._uid}-${d.key}`,
3165
- "onUpdate:modelValue": (v) => r.values[d.key] = v,
3175
+ "onUpdate:modelValue": (g) => r.values[d.key] = g,
3166
3176
  class: "wm-form__select",
3167
3177
  required: d.required,
3168
3178
  disabled: n.readOnly || r.busy
3169
3179
  }, [
3170
- i("option", Ir, b(d.placeholder || "Choisir…"), 1),
3171
- (l(!0), c(M, null, D(d.options, (v) => (l(), c("option", {
3172
- key: v.value,
3173
- value: v.value
3174
- }, b(v.label), 9, Br))), 128))
3180
+ i("option", Ir, k(d.placeholder || "Choisir…"), 1),
3181
+ (l(!0), c(M, null, D(d.options, (g) => (l(), c("option", {
3182
+ key: g.value,
3183
+ value: g.value
3184
+ }, k(g.label), 9, Br))), 128))
3175
3185
  ], 8, Or)), [
3176
3186
  [Be, r.values[d.key]]
3177
3187
  ]) : d.type === "multiselect" ? (l(), c("div", Er, [
3178
- (l(!0), c(M, null, D(d.options, (v) => (l(), c("label", {
3179
- key: v.value,
3188
+ (l(!0), c(M, null, D(d.options, (g) => (l(), c("label", {
3189
+ key: g.value,
3180
3190
  class: "wm-form__multiItem"
3181
3191
  }, [
3182
3192
  i("input", {
3183
3193
  type: "checkbox",
3184
- value: v.value,
3185
- checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
3194
+ value: g.value,
3195
+ checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(g.value),
3186
3196
  disabled: n.readOnly || r.busy,
3187
- onChange: (k) => s.toggleMulti(d.key, v.value, k.target.checked)
3197
+ onChange: (C) => s.toggleMulti(d.key, g.value, C.target.checked)
3188
3198
  }, null, 40, $r),
3189
- i("span", null, b(v.label), 1)
3199
+ i("span", null, k(g.label), 1)
3190
3200
  ]))), 128))
3191
- ])) : y("", !0)
3201
+ ])) : b("", !0)
3192
3202
  ]))), 128)),
3193
- r.error ? (l(), c("div", Lr, b(r.error), 1)) : y("", !0),
3203
+ r.error ? (l(), c("div", Lr, k(r.error), 1)) : b("", !0),
3194
3204
  n.readOnly ? (l(), c("div", Dr, "Réponse envoyée")) : (l(), c("button", {
3195
3205
  key: 1,
3196
3206
  type: "submit",
3197
3207
  class: "wm-form__submit",
3198
3208
  disabled: r.busy
3199
3209
  }, [
3200
- r.busy ? (l(), c("span", Fr)) : y("", !0),
3201
- i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
3210
+ r.busy ? (l(), c("span", Fr)) : b("", !0),
3211
+ i("span", null, k(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
3202
3212
  ], 8, Rr))
3203
3213
  ], 32)
3204
3214
  ]);
@@ -3245,8 +3255,8 @@ function Gr(t, e, n, o, r, s) {
3245
3255
  class: E(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
3246
3256
  onClick: (d) => r.sel = a.v
3247
3257
  }, [
3248
- i("span", Vr, b(a.e), 1),
3249
- i("span", qr, b(a.l), 1)
3258
+ i("span", Vr, k(a.e), 1),
3259
+ i("span", qr, k(a.l), 1)
3250
3260
  ], 10, zr))), 128))
3251
3261
  ]),
3252
3262
  i("button", {
@@ -3254,7 +3264,7 @@ function Gr(t, e, n, o, r, s) {
3254
3264
  class: "wm-fb__send",
3255
3265
  disabled: !r.sel || n.busy,
3256
3266
  onClick: e[0] || (e[0] = (...a) => s.onSend && s.onSend(...a))
3257
- }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Wr)
3267
+ }, k(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Wr)
3258
3268
  ], 64))
3259
3269
  ]);
3260
3270
  }
@@ -3408,7 +3418,7 @@ function _i(t, e, n, o, r, s) {
3408
3418
  placeholder: "Rechercher dans vos messages",
3409
3419
  "aria-label": "Rechercher dans vos messages"
3410
3420
  }, null, 512), [
3411
- [J, r.query]
3421
+ [X, r.query]
3412
3422
  ])
3413
3423
  ])
3414
3424
  ]),
@@ -3417,7 +3427,7 @@ function _i(t, e, n, o, r, s) {
3417
3427
  key: a.key
3418
3428
  }, [
3419
3429
  a.items.length ? (l(), c("div", ri, [
3420
- i("div", ii, b(a.label), 1),
3430
+ i("div", ii, k(a.label), 1),
3421
3431
  i("div", ai, [
3422
3432
  (l(!0), c(M, null, D(a.items, (d) => (l(), c("button", {
3423
3433
  key: d.id,
@@ -3426,7 +3436,7 @@ function _i(t, e, n, o, r, s) {
3426
3436
  "wm-hd__row--active": d.id === n.activeId,
3427
3437
  "wm-hd__row--unread": d.unread
3428
3438
  }]),
3429
- onClick: (v) => t.$emit("pick", d)
3439
+ onClick: (g) => t.$emit("pick", d)
3430
3440
  }, [
3431
3441
  i("div", li, [
3432
3442
  e[8] || (e[8] = i("svg", {
@@ -3442,24 +3452,24 @@ function _i(t, e, n, o, r, s) {
3442
3452
  opacity: "0.92"
3443
3453
  })
3444
3454
  ], -1)),
3445
- d.unread ? (l(), c("span", di)) : y("", !0)
3455
+ d.unread ? (l(), c("span", di)) : b("", !0)
3446
3456
  ]),
3447
3457
  i("div", ci, [
3448
3458
  i("div", ui, [
3449
- i("span", hi, b(d.title), 1)
3459
+ i("span", hi, k(d.title), 1)
3450
3460
  ]),
3451
- i("div", mi, b(d.preview || "Aucun message"), 1)
3461
+ i("div", mi, k(d.preview || "Aucun message"), 1)
3452
3462
  ])
3453
3463
  ], 10, oi))), 128))
3454
3464
  ])
3455
- ])) : y("", !0)
3465
+ ])) : b("", !0)
3456
3466
  ], 64))), 128)),
3457
- s.hasAny ? y("", !0) : (l(), c("div", fi, " Aucun fil pour le moment. "))
3467
+ s.hasAny ? b("", !0) : (l(), c("div", fi, " Aucun fil pour le moment. "))
3458
3468
  ])
3459
3469
  ])
3460
3470
  ]);
3461
3471
  }
3462
- const pi = /* @__PURE__ */ $(Xr, [["render", _i], ["__scopeId", "data-v-1259e822"]]), vi = {
3472
+ const pi = /* @__PURE__ */ $(Xr, [["render", _i], ["__scopeId", "data-v-1259e822"]]), gi = {
3463
3473
  name: "WmMoreMenu",
3464
3474
  props: {
3465
3475
  canRename: { type: Boolean, default: !0 },
@@ -3485,12 +3495,12 @@ const pi = /* @__PURE__ */ $(Xr, [["render", _i], ["__scopeId", "data-v-1259e822
3485
3495
  this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
3486
3496
  }
3487
3497
  }
3488
- }, gi = { class: "wm-mm" }, yi = {
3498
+ }, vi = { class: "wm-mm" }, yi = {
3489
3499
  class: "wm-mm__pop",
3490
3500
  role: "menu"
3491
3501
  }, wi = { class: "wm-mm__section" }, bi = { class: "wm-mm__section" }, ki = { class: "wm-mm__section" };
3492
3502
  function Ci(t, e, n, o, r, s) {
3493
- return l(), c("div", gi, [
3503
+ return l(), c("div", vi, [
3494
3504
  i("div", {
3495
3505
  class: "wm-mm__scrim",
3496
3506
  onClick: e[0] || (e[0] = (a) => t.$emit("close"))
@@ -3526,7 +3536,7 @@ function Ci(t, e, n, o, r, s) {
3526
3536
  onClick: e[2] || (e[2] = (a) => s.emit("rename"))
3527
3537
  }, [...e[8] || (e[8] = [
3528
3538
  ue('<span class="wm-mm__icon" data-v-3181ad1b><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-3181ad1b><path d="M12 20h9" data-v-3181ad1b></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-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Modifier le titre</span>', 2)
3529
- ])])) : y("", !0),
3539
+ ])])) : b("", !0),
3530
3540
  n.canExport ? (l(), c("button", {
3531
3541
  key: 1,
3532
3542
  type: "button",
@@ -3534,7 +3544,7 @@ function Ci(t, e, n, o, r, s) {
3534
3544
  onClick: e[3] || (e[3] = (a) => s.emit("export"))
3535
3545
  }, [...e[9] || (e[9] = [
3536
3546
  ue('<span class="wm-mm__icon" data-v-3181ad1b><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-3181ad1b><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Exporter la transcription</span><span class="wm-mm__hint" data-v-3181ad1b>.txt</span>', 3)
3537
- ])])) : y("", !0)
3547
+ ])])) : b("", !0)
3538
3548
  ]),
3539
3549
  e[15] || (e[15] = i("div", { class: "wm-mm__sep" }, null, -1)),
3540
3550
  i("div", bi, [
@@ -3590,7 +3600,7 @@ function Ci(t, e, n, o, r, s) {
3590
3600
  ])
3591
3601
  ], -1),
3592
3602
  i("span", { class: "wm-mm__label" }, "Statut des services", -1)
3593
- ])])) : y("", !0),
3603
+ ])])) : b("", !0),
3594
3604
  n.helpUrl ? (l(), c("button", {
3595
3605
  key: 1,
3596
3606
  type: "button",
@@ -3613,12 +3623,12 @@ function Ci(t, e, n, o, r, s) {
3613
3623
  ])
3614
3624
  ], -1),
3615
3625
  i("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
3616
- ])])) : y("", !0)
3626
+ ])])) : b("", !0)
3617
3627
  ])
3618
3628
  ])
3619
3629
  ]);
3620
3630
  }
3621
- const Ai = /* @__PURE__ */ $(vi, [["render", Ci], ["__scopeId", "data-v-3181ad1b"]]), Si = {
3631
+ const Ai = /* @__PURE__ */ $(gi, [["render", Ci], ["__scopeId", "data-v-3181ad1b"]]), Si = {
3622
3632
  name: "WmRenameDialog",
3623
3633
  props: {
3624
3634
  title: { type: String, default: "Modifier le titre" },
@@ -3665,7 +3675,7 @@ function Li(t, e, n, o, r, s) {
3665
3675
  }),
3666
3676
  i("div", Ti, [
3667
3677
  i("div", Mi, [
3668
- i("div", Oi, b(n.title), 1),
3678
+ i("div", Oi, k(n.title), 1),
3669
3679
  i("button", {
3670
3680
  type: "button",
3671
3681
  class: "wm-dialog__close",
@@ -3696,11 +3706,11 @@ function Li(t, e, n, o, r, s) {
3696
3706
  placeholder: n.placeholder,
3697
3707
  maxlength: 120,
3698
3708
  onKeydown: [
3699
- e[3] || (e[3] = ae(X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
3700
- e[4] || (e[4] = ae(X((a) => t.$emit("close"), ["prevent"]), ["esc"]))
3709
+ e[3] || (e[3] = ae(Z((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
3710
+ e[4] || (e[4] = ae(Z((a) => t.$emit("close"), ["prevent"]), ["esc"]))
3701
3711
  ]
3702
3712
  }, null, 40, Bi), [
3703
- [J, r.value]
3713
+ [X, r.value]
3704
3714
  ])
3705
3715
  ]),
3706
3716
  i("div", Ei, [
@@ -3719,7 +3729,7 @@ function Li(t, e, n, o, r, s) {
3719
3729
  ])
3720
3730
  ]);
3721
3731
  }
3722
- const Ri = /* @__PURE__ */ $(Si, [["render", Li], ["__scopeId", "data-v-4f4b37c9"]]), ge = "ww-messenger-tokens";
3732
+ const Ri = /* @__PURE__ */ $(Si, [["render", Li], ["__scopeId", "data-v-4f4b37c9"]]), ve = "ww-messenger-tokens";
3723
3733
  function ie(t) {
3724
3734
  var n;
3725
3735
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
@@ -3756,7 +3766,7 @@ function Di(t, e) {
3756
3766
  if (s == null || s === "") continue;
3757
3767
  let a;
3758
3768
  if (Array.isArray(s)) {
3759
- if (a = s.map((v) => le(r, String(v))).join(", "), !a) continue;
3769
+ if (a = s.map((g) => le(r, String(g))).join(", "), !a) continue;
3760
3770
  } else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = le(r, String(s));
3761
3771
  const d = r.type === "textarea" || typeof a == "string" && (a.length > 60 || a.includes(`
3762
3772
  `));
@@ -3971,8 +3981,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3971
3981
  var o;
3972
3982
  const t = this.readState, e = this.readBootTs, n = ((o = this.s) == null ? void 0 : o.messagesByConv) || {};
3973
3983
  return this.allConversations.map((r) => {
3974
- const s = n[r.id] || [], a = this.convLastActivity(r, s), d = t[r.id] || e || "", v = this.lastMessageAuthorType(s), k = !!a && v !== "user" && (!d || a > d);
3975
- return { ...r, _preview: this.convPreview(r, s), _unread: k };
3984
+ const s = n[r.id] || [], a = this.convLastActivity(r, s), d = t[r.id] || e || "", g = this.lastMessageAuthorType(s), C = !!a && g !== "user" && (!d || a > d);
3985
+ return { ...r, _preview: this.convPreview(r, s), _unread: C };
3976
3986
  });
3977
3987
  },
3978
3988
  // How many threads have an unseen agent/human message. Drives the
@@ -4163,14 +4173,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4163
4173
  return ((e = (t = this.pendingApproval) == null ? void 0 : t.payload) == null ? void 0 : e.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || "Confirmer l'action";
4164
4174
  },
4165
4175
  approvalDetail() {
4166
- var o, r, s, a, d, v;
4176
+ var o, r, s, a, d, g;
4167
4177
  const t = (s = (r = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
4168
4178
  if (typeof t == "string" && t.trim())
4169
4179
  return t.trim();
4170
- const e = (v = (d = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
4180
+ const e = (g = (d = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : d.pending) == null ? void 0 : g.prepared_params;
4171
4181
  if (!e || typeof e != "object") return "";
4172
4182
  const n = Object.entries(e);
4173
- return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
4183
+ return n.length ? n.slice(0, 2).map(([C, w]) => `${C}: ${w}`).join(" · ") : "";
4174
4184
  },
4175
4185
  actionInFlight() {
4176
4186
  var t, e;
@@ -4340,9 +4350,9 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4340
4350
  hasWidgetId: !!this.widgetId,
4341
4351
  hasUserId: !!this.userId,
4342
4352
  hasUserHash: !!this.userHash
4343
- }), typeof document < "u" && !document.getElementById(ge)) {
4353
+ }), typeof document < "u" && !document.getElementById(ve)) {
4344
4354
  const t = document.createElement("style");
4345
- t.id = ge, t.textContent = Pe, document.head.appendChild(t);
4355
+ t.id = ve, t.textContent = Pe, document.head.appendChild(t);
4346
4356
  }
4347
4357
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
4348
4358
  },
@@ -4411,8 +4421,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4411
4421
  const d = typeof a.text_md == "string" ? a.text_md.trim() : "";
4412
4422
  if (d)
4413
4423
  return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
4414
- const v = (o = a.payload) == null ? void 0 : o.attachments;
4415
- if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
4424
+ const g = (o = a.payload) == null ? void 0 : o.attachments;
4425
+ if (Array.isArray(g) && g.length) return "📎 Pièce jointe";
4416
4426
  }
4417
4427
  return (t == null ? void 0 : t.last_message_preview) || (t == null ? void 0 : t.preview) || ((r = t == null ? void 0 : t.metadata) == null ? void 0 : r.last_preview) || "";
4418
4428
  },
@@ -4491,10 +4501,10 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4491
4501
  this.nextRevealAt + Hi
4492
4502
  ) + o;
4493
4503
  this.nextRevealAt = s;
4494
- const a = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
4495
- this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((k) => k !== v);
4504
+ const a = Math.max(0, s - e), d = t.id, g = setTimeout(() => {
4505
+ this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((C) => C !== g);
4496
4506
  }, a);
4497
- this.revealTimers.push(v);
4507
+ this.revealTimers.push(g);
4498
4508
  },
4499
4509
  async boot() {
4500
4510
  if (!this.canBoot) {
@@ -4754,7 +4764,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4754
4764
  }
4755
4765
  },
4756
4766
  exportCurrentConv() {
4757
- var r, s, a, d, v, k;
4767
+ var r, s, a, d, g, C;
4758
4768
  const t = this.currentConv;
4759
4769
  if (!t) return;
4760
4770
  const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
@@ -4764,7 +4774,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4764
4774
  ];
4765
4775
  for (const w of e) {
4766
4776
  if (!w) continue;
4767
- const S = ((a = w.author) == null ? void 0 : a.name) || (((d = w.author) == null ? void 0 : d.type) === "user" ? "Vous" : ((v = w.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = w.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), F = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
4777
+ const S = ((a = w.author) == null ? void 0 : a.name) || (((d = w.author) == null ? void 0 : d.type) === "user" ? "Vous" : ((g = w.author) == null ? void 0 : g.type) === "agent_human" ? "Agent" : ((C = w.author) == null ? void 0 : C.type) === "agent_ia" ? "Assistant IA" : "Système"), F = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
4768
4778
  A && (n.push(`[${F}] ${S} :`), n.push(A), n.push(""));
4769
4779
  }
4770
4780
  const o = new Blob([n.join(`
@@ -4870,7 +4880,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4870
4880
  class: "wm-attached"
4871
4881
  }, Qi = ["onClick"];
4872
4882
  function ea(t, e, n, o, r, s) {
4873
- const a = B("Launcher"), d = B("Header"), v = B("Onboarding"), k = B("MessageList"), w = B("ApprovalCard"), S = B("FormCard"), F = B("Feedback"), A = B("SuggestionChips"), U = B("Composer"), x = B("MoreMenu"), j = B("RenameDialog"), P = B("HistoryDrawer");
4883
+ const a = B("Launcher"), d = B("Header"), g = B("Onboarding"), C = B("MessageList"), w = B("ApprovalCard"), S = B("FormCard"), F = B("Feedback"), A = B("SuggestionChips"), U = B("Composer"), x = B("MoreMenu"), j = B("RenameDialog"), P = B("HistoryDrawer");
4874
4884
  return l(), c("div", {
4875
4885
  class: E(["wm-root", `wm-root--${n.displayMode}`])
4876
4886
  }, [
@@ -4880,7 +4890,7 @@ function ea(t, e, n, o, r, s) {
4880
4890
  peek: s.launcherPeek,
4881
4891
  onOpen: s.openFromPeek,
4882
4892
  onDismiss: e[0] || (e[0] = (R) => r.labelDismissed = !0)
4883
- }, null, 8, ["unread-count", "peek", "onOpen"])) : y("", !0),
4893
+ }, null, 8, ["unread-count", "peek", "onOpen"])) : b("", !0),
4884
4894
  r.isOpen || s.isEmbedded ? (l(), c("section", {
4885
4895
  key: 1,
4886
4896
  class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
@@ -4889,7 +4899,7 @@ function ea(t, e, n, o, r, s) {
4889
4899
  "aria-label": "Messenger"
4890
4900
  }, [
4891
4901
  !s.ready && !s.error ? (l(), c("div", Vi, [
4892
- s.isEmbedded ? y("", !0) : (l(), c("button", {
4902
+ s.isEmbedded ? b("", !0) : (l(), c("button", {
4893
4903
  key: 0,
4894
4904
  type: "button",
4895
4905
  class: "wm-loading__close",
@@ -4949,11 +4959,11 @@ function ea(t, e, n, o, r, s) {
4949
4959
  ], -1)),
4950
4960
  i("div", null, [
4951
4961
  e[10] || (e[10] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4952
- i("div", Ki, b(s.error), 1)
4962
+ i("div", Ki, k(s.error), 1)
4953
4963
  ])
4954
4964
  ])
4955
4965
  ])) : s.currentConv ? (l(), c(M, { key: 2 }, [
4956
- K(k, {
4966
+ K(C, {
4957
4967
  ref: "messageList",
4958
4968
  messages: s.displayedMessages,
4959
4969
  "streaming-active": s.streamingActive,
@@ -4987,13 +4997,13 @@ function ea(t, e, n, o, r, s) {
4987
4997
  items: s.suggestions,
4988
4998
  onSelect: s.onSuggestion
4989
4999
  }, null, 8, ["items", "onSelect"]))
4990
- ], 512)) : y("", !0),
5000
+ ], 512)) : b("", !0),
4991
5001
  s.actionInFlight ? (l(), c("div", Ji, [
4992
5002
  e[12] || (e[12] = i("span", {
4993
5003
  class: "wm-actionWait__spinner",
4994
5004
  "aria-hidden": "true"
4995
5005
  }, null, -1)),
4996
- i("span", Xi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
5006
+ i("span", Xi, k(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4997
5007
  ])) : (l(), L(U, {
4998
5008
  key: 2,
4999
5009
  ref: "composer",
@@ -5016,14 +5026,14 @@ function ea(t, e, n, o, r, s) {
5016
5026
  onClose: e[4] || (e[4] = (R) => r.moreOpen = !1),
5017
5027
  onNotifToggle: s.onNotifToggle,
5018
5028
  onAction: s.onMoreAction
5019
- }, null, 8, ["can-rename", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0),
5029
+ }, null, 8, ["can-rename", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : b("", !0),
5020
5030
  r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (l(), L(j, {
5021
5031
  key: 1,
5022
5032
  "initial-value": s.currentConv.name || "",
5023
5033
  title: "Modifier le titre de la conversation",
5024
5034
  onClose: e[5] || (e[5] = (R) => r.renameDialogOpen = !1),
5025
5035
  onSubmit: s.onRenameSubmit
5026
- }, null, 8, ["initial-value", "onSubmit"])) : y("", !0),
5036
+ }, null, 8, ["initial-value", "onSubmit"])) : b("", !0),
5027
5037
  r.pendingAttachments.length ? (l(), c("div", Zi, [
5028
5038
  (l(!0), c(M, null, D(r.pendingAttachments, (R, H) => (l(), c("div", {
5029
5039
  key: H,
@@ -5042,7 +5052,7 @@ function ea(t, e, n, o, r, s) {
5042
5052
  }, [
5043
5053
  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" })
5044
5054
  ], -1)),
5045
- i("span", null, b(R.name), 1),
5055
+ i("span", null, k(R.name), 1),
5046
5056
  i("button", {
5047
5057
  type: "button",
5048
5058
  "aria-label": "Retirer",
@@ -5063,8 +5073,8 @@ function ea(t, e, n, o, r, s) {
5063
5073
  ], -1)
5064
5074
  ])], 8, Qi)
5065
5075
  ]))), 128))
5066
- ])) : y("", !0)
5067
- ], 64)) : (l(), L(v, {
5076
+ ])) : b("", !0)
5077
+ ], 64)) : (l(), L(g, {
5068
5078
  key: 1,
5069
5079
  "welcome-message": s.widgetWelcomeMessage,
5070
5080
  "agent-name": s.agentName,
@@ -5083,7 +5093,7 @@ function ea(t, e, n, o, r, s) {
5083
5093
  onClose: e[6] || (e[6] = (R) => r.historyOpen = !1),
5084
5094
  onNew: s.onDrawerNew,
5085
5095
  onPick: s.onDrawerPick
5086
- }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : y("", !0),
5096
+ }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : b("", !0),
5087
5097
  r.moreOpen && !s.currentConv ? (l(), L(x, {
5088
5098
  key: 4,
5089
5099
  "can-rename": !1,
@@ -5094,12 +5104,12 @@ function ea(t, e, n, o, r, s) {
5094
5104
  onClose: e[7] || (e[7] = (R) => r.moreOpen = !1),
5095
5105
  onNotifToggle: s.onNotifToggle,
5096
5106
  onAction: s.onMoreAction
5097
- }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0)
5107
+ }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : b("", !0)
5098
5108
  ], 64))
5099
- ], 6)) : y("", !0)
5109
+ ], 6)) : b("", !0)
5100
5110
  ], 2);
5101
5111
  }
5102
- const sa = /* @__PURE__ */ $(zi, [["render", ea], ["__scopeId", "data-v-e5f17e35"]]), ra = "0.3.4";
5112
+ const sa = /* @__PURE__ */ $(zi, [["render", ea], ["__scopeId", "data-v-e5f17e35"]]), ra = "0.3.5";
5103
5113
  export {
5104
5114
  ne as AIAvatar,
5105
5115
  ce as AVATAR_COLORS,