@_solaris/messenger-widget 0.3.7 → 0.3.8

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 Te, openBlock as d, createElementBlock as c, normalizeStyle as K, normalizeClass as T, toDisplayString as b, resolveComponent as I, createVNode as W, Transition as Me, withCtx as Oe, Fragment as O, renderList as F, withKeys as oe, withModifiers as Y, createElementVNode as i, createCommentVNode as w, createBlock as L, createTextVNode as te, resolveDynamicComponent as Be, renderSlot as Ie, withDirectives as q, vModelText as Q, vModelCheckbox as Ee, vModelSelect as $e, createStaticVNode as ie, markRaw as fe } from "vue";
1
+ import { reactive as Te, openBlock as d, createElementBlock as c, normalizeStyle as W, normalizeClass as T, toDisplayString as b, resolveComponent as I, createVNode as V, Transition as Me, withCtx as Oe, Fragment as O, renderList as F, withKeys as ae, withModifiers as Y, createElementVNode as i, createCommentVNode as w, createBlock as L, withDirectives as H, vModelText as J, createTextVNode as ue, resolveDynamicComponent as Be, renderSlot as Ie, vModelCheckbox as Ee, vModelSelect as $e, createStaticVNode as re, markRaw as fe } from "vue";
2
2
  const Le = [
3
3
  "connected",
4
4
  "message",
@@ -127,7 +127,7 @@ function De(t) {
127
127
  );
128
128
  }
129
129
  async function P(h, f) {
130
- H();
130
+ K();
131
131
  const p = {
132
132
  client_msg_id: f.client_msg_id,
133
133
  type: "content",
@@ -142,7 +142,7 @@ function De(t) {
142
142
  );
143
143
  }
144
144
  async function U(h, f, p) {
145
- return H(), o(
145
+ return K(), o(
146
146
  "POST",
147
147
  `/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
148
148
  p ? { inputs: p } : {}
@@ -179,7 +179,7 @@ function De(t) {
179
179
  `/attachments/sign?path=${encodeURIComponent(h)}`
180
180
  );
181
181
  }
182
- function J() {
182
+ function X() {
183
183
  const h = new URLSearchParams({
184
184
  userId: e.userId,
185
185
  userHash: e.userHash,
@@ -187,10 +187,10 @@ function De(t) {
187
187
  }).toString();
188
188
  return `${e.baseUrl}${_e}/stream?${h}`;
189
189
  }
190
- function V() {
190
+ function q() {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
- const h = new EventSource(J());
193
+ const h = new EventSource(X());
194
194
  for (const f of Le)
195
195
  h.addEventListener(f, (p) => Z(f, p.data));
196
196
  h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
@@ -209,27 +209,27 @@ function De(t) {
209
209
  function G() {
210
210
  e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
211
211
  }
212
- function H() {
213
- clearTimeout(e.burstTimer), V(), e.panelOpen || (e.burstTimer = setTimeout(() => {
212
+ function K() {
213
+ clearTimeout(e.burstTimer), q(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
214
  e.panelOpen || G();
215
215
  }, Re));
216
216
  }
217
- function X(h) {
218
- e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), V()) : H();
217
+ function Q(h) {
218
+ e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), q()) : K();
219
219
  }
220
- async function ce() {
220
+ async function de() {
221
221
  try {
222
222
  const h = await x(), f = h.reduce((v, M) => {
223
223
  const B = M == null ? void 0 : M.last_message_at;
224
224
  return B && (!v || B > v) ? B : v;
225
225
  }, null);
226
- f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), H());
226
+ f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), K());
227
227
  } catch (h) {
228
228
  console.error("[transport] poll failed", h);
229
229
  }
230
230
  }
231
- function se() {
232
- u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(ce, Ne));
231
+ function ne() {
232
+ u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(de, Ne));
233
233
  }
234
234
  function u() {
235
235
  e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
@@ -244,7 +244,7 @@ function De(t) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
245
245
  return;
246
246
  }
247
- r("idle"), se(), e.panelOpen && V();
247
+ r("idle"), ne(), e.panelOpen && q();
248
248
  }
249
249
  }
250
250
  async function _() {
@@ -261,7 +261,7 @@ function De(t) {
261
261
  } catch (f) {
262
262
  console.error("[transport] initial /conversations failed", f);
263
263
  }
264
- return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), se(), h;
264
+ return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), ne(), h;
265
265
  }
266
266
  function y() {
267
267
  u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, G(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
@@ -270,7 +270,7 @@ function De(t) {
270
270
  on: n,
271
271
  start: _,
272
272
  stop: y,
273
- setPanelOpen: X,
273
+ setPanelOpen: Q,
274
274
  // REST
275
275
  bootstrap: g,
276
276
  getCustomer: k,
@@ -344,7 +344,7 @@ function ze(t) {
344
344
  e.connection = u;
345
345
  })), n.push(t.on("message", (u) => {
346
346
  const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
347
- !m || !(_ != null && _.id) || (V(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], H(m, _.created_at));
347
+ !m || !(_ != null && _.id) || (q(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], K(m, _.created_at));
348
348
  })), n.push(t.on("message_stream", (u) => {
349
349
  const m = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
350
350
  !m || typeof _ != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + _);
@@ -382,7 +382,7 @@ function ze(t) {
382
382
  t.stop();
383
383
  }
384
384
  async function s(u) {
385
- const m = ce(u);
385
+ const m = de(u);
386
386
  if (!m) return e.customer;
387
387
  try {
388
388
  const _ = await t.patchCustomer(m);
@@ -406,7 +406,7 @@ function ze(t) {
406
406
  for (const v of y)
407
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
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(X), C(u, {
409
+ e.messagesByConv[u] = [...y, ...p].sort(Q), C(u, {
410
410
  nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
411
411
  loading: !1,
412
412
  loaded: !0
@@ -452,7 +452,7 @@ function ze(t) {
452
452
  var B;
453
453
  const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
454
454
  if (!u || !h && !f) return;
455
- const p = Ue(), v = se(u), M = {
455
+ const p = Ue(), v = ne(u), M = {
456
456
  id: p,
457
457
  client_msg_id: p,
458
458
  conversation_id: u,
@@ -468,7 +468,7 @@ function ze(t) {
468
468
  ...f ? { payload: { type: "content", attachments: _ } } : {},
469
469
  ...y && typeof y == "object" ? { metadata: y } : {}
470
470
  };
471
- V(u, M);
471
+ q(u, M);
472
472
  try {
473
473
  await t.postMessage(u, {
474
474
  client_msg_id: p,
@@ -547,7 +547,7 @@ function ze(t) {
547
547
  const y = _[0];
548
548
  return { id: y, payload: { name: m[y] } };
549
549
  }
550
- function J(u) {
550
+ function X(u) {
551
551
  var _, y, h, f;
552
552
  const m = e.messagesByConv[u] || [];
553
553
  for (let p = m.length - 1; p >= 0; p--) {
@@ -572,7 +572,7 @@ function ze(t) {
572
572
  }
573
573
  return [];
574
574
  }
575
- function V(u, m) {
575
+ function q(u, m) {
576
576
  var f;
577
577
  const _ = e.messagesByConv[u] || [];
578
578
  let y = -1;
@@ -580,7 +580,7 @@ function ze(t) {
580
580
  (p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
581
581
  )), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => Z(p == null ? void 0 : p.id, m.id)));
582
582
  let h;
583
- y === -1 ? h = [..._, m].sort(X) : (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];
583
+ y === -1 ? h = [..._, m].sort(Q) : (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];
584
584
  }
585
585
  function Z(u, m) {
586
586
  return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
@@ -593,7 +593,7 @@ function ze(t) {
593
593
  const f = y.slice();
594
594
  f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
595
595
  }
596
- function H(u, m) {
596
+ function K(u, m) {
597
597
  const _ = e.conversations.findIndex((h) => h.id === u);
598
598
  if (_ === -1) return;
599
599
  const y = e.conversations[_];
@@ -604,17 +604,17 @@ function ze(t) {
604
604
  ), e.conversations = h;
605
605
  }
606
606
  }
607
- function X(u, m) {
607
+ function Q(u, m) {
608
608
  return (u.created_at || "").localeCompare(m.created_at || "");
609
609
  }
610
- function ce(u) {
610
+ function de(u) {
611
611
  if (!u || typeof u != "object") return null;
612
612
  const m = {}, _ = {};
613
613
  for (const [y, h] of Object.entries(u))
614
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);
615
615
  return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
616
616
  }
617
- function se(u) {
617
+ function ne(u) {
618
618
  const m = e.messagesByConv[u] || [];
619
619
  let _ = "";
620
620
  for (const f of m)
@@ -637,7 +637,7 @@ function ze(t) {
637
637
  submitFeedback: P,
638
638
  getPendingApproval: U,
639
639
  getActionInFlight: z,
640
- getLatestSuggestions: J,
640
+ getLatestSuggestions: X,
641
641
  getLatestForm: R,
642
642
  // Pass-through for panel open/close (controls SSE burst).
643
643
  setPanelOpen: t.setPanelOpen
@@ -659,9 +659,9 @@ const j = {
659
659
  green: "#22C55E",
660
660
  red: "#B91C1C",
661
661
  redBg: "#FDECEC"
662
- }, ue = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
662
+ }, ce = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
663
663
  function be(t = "") {
664
- return t ? ue[t.charCodeAt(0) % ue.length] : ue[0];
664
+ return t ? ce[t.charCodeAt(0) % ce.length] : ce[0];
665
665
  }
666
666
  function ke(t = "") {
667
667
  return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
@@ -669,7 +669,7 @@ function ke(t = "") {
669
669
  function Ce(t = /* @__PURE__ */ new Date()) {
670
670
  return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
671
671
  }
672
- const Ve = `
672
+ const He = `
673
673
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
674
674
 
675
675
  .wm-root {
@@ -715,7 +715,7 @@ const Ve = `
715
715
  0% { transform: translateX(110%); opacity: 0; }
716
716
  100% { transform: translateX(0); opacity: 1; }
717
717
  }
718
- `, He = "https://api.messenger.victorc.fr";
718
+ `, Ve = "https://api.messenger.victorc.fr";
719
719
  function pe(t, e) {
720
720
  if (!Array.isArray(t == null ? void 0 : t.options)) return e;
721
721
  const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
@@ -759,12 +759,12 @@ function Ke(t, e) {
759
759
  }
760
760
  };
761
761
  }
762
- function le(t) {
762
+ function oe(t) {
763
763
  var n;
764
764
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
765
765
  return e === "agent_ia" || e === "agent_human";
766
766
  }
767
- function ae(t, e) {
767
+ function ie(t, e) {
768
768
  let n = (t == null ? void 0 : t.last_message_at) || (t == null ? void 0 : t.updated_at) || (t == null ? void 0 : t.created_at) || "";
769
769
  for (const a of e)
770
770
  a != null && a.created_at && a.created_at > n && (n = a.created_at);
@@ -924,7 +924,7 @@ const Qe = {
924
924
  var o;
925
925
  if (!this.soundEnabled && !this.browserNotifEnabled) return;
926
926
  const e = t == null ? void 0 : t.conversation_id, n = t == null ? void 0 : t.message;
927
- if (!e || !n || !le(n)) return;
927
+ if (!e || !n || !oe(n)) return;
928
928
  const a = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
929
929
  if (Number.isFinite(a) && a < this.convOpenedAt - 1e3) return;
930
930
  const r = typeof document < "u" && document.hidden;
@@ -1019,7 +1019,7 @@ const Qe = {
1019
1019
  const e = Date.now(), n = { ...this.revealedAt };
1020
1020
  for (const r of t) {
1021
1021
  if ((r == null ? void 0 : r.id) == null || n[r.id] !== void 0) continue;
1022
- if (!le(r)) {
1022
+ if (!oe(r)) {
1023
1023
  n[r.id] = e;
1024
1024
  continue;
1025
1025
  }
@@ -1130,7 +1130,7 @@ const Qe = {
1130
1130
  markConvRead(t) {
1131
1131
  var a, r;
1132
1132
  if (!(t != null && t.id) || t._draft) return;
1133
- const e = ((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || [], n = ae(t, e);
1133
+ const e = ((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || [], n = ie(t, e);
1134
1134
  n && this.readState[t.id] !== n && (this.readState = { ...this.readState, [t.id]: n }, this.persistReadState());
1135
1135
  }
1136
1136
  }
@@ -1163,7 +1163,7 @@ const Qe = {
1163
1163
  function dt(t, e, n, a, r, s) {
1164
1164
  return d(), c("div", {
1165
1165
  class: T(["wm-huav", { "wm-huav--tail": n.tail }]),
1166
- style: K({
1166
+ style: W({
1167
1167
  width: n.size + "px",
1168
1168
  height: n.size + "px",
1169
1169
  "--wm-avr": Math.round(n.size * 0.32) + "px",
@@ -1176,7 +1176,7 @@ function dt(t, e, n, a, r, s) {
1176
1176
  alt: n.name || ""
1177
1177
  }, null, 8, lt)) : (d(), c("span", {
1178
1178
  key: 1,
1179
- style: K({ fontSize: n.size * 0.36 + "px" })
1179
+ style: W({ fontSize: n.size * 0.36 + "px" })
1180
1180
  }, b(s.initials), 5))
1181
1181
  ], 6);
1182
1182
  }
@@ -1205,7 +1205,7 @@ const he = /* @__PURE__ */ $(ot, [["render", dt], ["__scopeId", "data-v-07246775
1205
1205
  function Ct(t, e, n, a, r, s) {
1206
1206
  const o = I("HumanAvatar");
1207
1207
  return d(), c("div", ht, [
1208
- W(Me, { name: "wm-peek" }, {
1208
+ V(Me, { name: "wm-peek" }, {
1209
1209
  default: Oe(() => [
1210
1210
  s.visiblePeeks.length ? (d(), c("div", {
1211
1211
  key: 0,
@@ -1214,14 +1214,14 @@ function Ct(t, e, n, a, r, s) {
1214
1214
  (d(!0), c(O, null, F(s.visiblePeeks, (l, g) => (d(), c("div", {
1215
1215
  key: l.convId,
1216
1216
  class: "wm-peek",
1217
- style: K({ "--depth": s.visiblePeeks.length - 1 - g, zIndex: g + 1 }),
1217
+ style: W({ "--depth": s.visiblePeeks.length - 1 - g, zIndex: g + 1 }),
1218
1218
  role: "button",
1219
1219
  tabindex: "0",
1220
1220
  "aria-label": `Ouvrir la conversation avec ${l.senderName || "l'agent"}`,
1221
1221
  onClick: (k) => t.$emit("open", l.convId),
1222
1222
  onKeydown: [
1223
- oe(Y((k) => t.$emit("open", l.convId), ["prevent"]), ["enter"]),
1224
- oe(Y((k) => t.$emit("open", l.convId), ["prevent"]), ["space"])
1223
+ ae(Y((k) => t.$emit("open", l.convId), ["prevent"]), ["enter"]),
1224
+ ae(Y((k) => t.$emit("open", l.convId), ["prevent"]), ["space"])
1225
1225
  ]
1226
1226
  }, [
1227
1227
  i("button", {
@@ -1245,7 +1245,7 @@ function Ct(t, e, n, a, r, s) {
1245
1245
  ], -1)
1246
1246
  ])], 8, ft),
1247
1247
  i("div", _t, [
1248
- W(o, {
1248
+ V(o, {
1249
1249
  name: l.senderName,
1250
1250
  "avatar-url": l.senderAvatarUrl,
1251
1251
  size: 34
@@ -1319,7 +1319,7 @@ const At = /* @__PURE__ */ $(ut, [["render", Ct], ["__scopeId", "data-v-7464ea26
1319
1319
  function Mt(t, e, n, a, r, s) {
1320
1320
  return d(), c("div", {
1321
1321
  class: T(["wm-aiav", { "wm-aiav--tail": n.tail }]),
1322
- style: K({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
1322
+ style: W({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
1323
1323
  }, [
1324
1324
  n.pulse ? (d(), c("div", xt)) : w("", !0),
1325
1325
  i("div", {
@@ -1355,7 +1355,7 @@ function Mt(t, e, n, a, r, s) {
1355
1355
  ], 2)
1356
1356
  ], 6);
1357
1357
  }
1358
- const ne = /* @__PURE__ */ $(St, [["render", Mt], ["__scopeId", "data-v-8c924688"]]), Ot = {
1358
+ const te = /* @__PURE__ */ $(St, [["render", Mt], ["__scopeId", "data-v-8c924688"]]), Ot = {
1359
1359
  name: "WmTeamAvatars",
1360
1360
  props: {
1361
1361
  members: { type: Array, default: () => [] },
@@ -1388,12 +1388,12 @@ function Lt(t, e, n, a, r, s) {
1388
1388
  return s.visible ? (d(), c("div", Bt, [
1389
1389
  i("div", {
1390
1390
  class: "wm-team__stack",
1391
- style: K({ width: s.stackWidth + "px" })
1391
+ style: W({ width: s.stackWidth + "px" })
1392
1392
  }, [
1393
1393
  (d(!0), c(O, null, F(n.members.slice(0, 3), (o, l) => (d(), c("div", {
1394
1394
  key: l,
1395
1395
  class: "wm-team__pill",
1396
- style: K({ left: l * 13 + "px", zIndex: 3 - l, background: s.colorFor(o) })
1396
+ style: W({ left: l * 13 + "px", zIndex: 3 - l, background: s.colorFor(o) })
1397
1397
  }, [
1398
1398
  o.avatar_url ? (d(), c("img", {
1399
1399
  key: 0,
@@ -1407,7 +1407,7 @@ function Lt(t, e, n, a, r, s) {
1407
1407
  }
1408
1408
  const Nt = /* @__PURE__ */ $(Ot, [["render", Lt], ["__scopeId", "data-v-3659b9c1"]]), Rt = {
1409
1409
  name: "WmHeader",
1410
- components: { AIAvatar: ne, HumanAvatar: he, TeamAvatars: Nt },
1410
+ components: { AIAvatar: te, HumanAvatar: he, TeamAvatars: Nt },
1411
1411
  props: {
1412
1412
  title: { type: String, default: "Nouvelle conversation" },
1413
1413
  escalated: { type: Boolean, default: !1 },
@@ -1428,14 +1428,15 @@ const Nt = /* @__PURE__ */ $(Ot, [["render", Lt], ["__scopeId", "data-v-3659b9c1
1428
1428
  hasTeam() {
1429
1429
  return Array.isArray(this.teamMembers) && this.teamMembers.length > 0;
1430
1430
  },
1431
- // Show the sub-line only when there's a real presence to convey:
1432
- // configured team members, or a human agent who has taken over.
1433
- // Plain AI chat with no team shows nothing (no orphan "En ligne").
1434
- showPresence() {
1435
- return this.hasTeam || this.escalated && !!this.agentName;
1436
- },
1437
- statusText() {
1438
- return this.escalated && this.agentName ? this.agentName : "En ligne";
1431
+ // Up to 3 team avatars to show. With more than 3 configured members
1432
+ // we slide a 3-wide window across the list, offset by the current
1433
+ // hour gives a sense of rotation without any presence signal.
1434
+ displayedTeamMembers() {
1435
+ const t = Array.isArray(this.teamMembers) ? this.teamMembers : [];
1436
+ if (t.length <= 3) return t;
1437
+ const e = (/* @__PURE__ */ new Date()).getHours() % t.length, n = [];
1438
+ for (let a = 0; a < 3; a++) n.push(t[(e + a) % t.length]);
1439
+ return n;
1439
1440
  }
1440
1441
  }
1441
1442
  }, Ft = { class: "wm-header" }, Dt = {
@@ -1444,11 +1445,11 @@ const Nt = /* @__PURE__ */ $(Ot, [["render", Lt], ["__scopeId", "data-v-3659b9c1
1444
1445
  }, jt = { class: "wm-header__avatar" }, Pt = { class: "wm-header__main" }, Ut = { class: "wm-header__title" }, zt = {
1445
1446
  key: 0,
1446
1447
  class: "wm-header__sub"
1447
- }, Vt = { class: "wm-header__status" }, Ht = {
1448
+ }, Ht = {
1448
1449
  key: 3,
1449
1450
  class: "wm-header__fill"
1450
- }, qt = { class: "wm-header__actions" };
1451
- function Kt(t, e, n, a, r, s) {
1451
+ }, Vt = { class: "wm-header__actions" };
1452
+ function qt(t, e, n, a, r, s) {
1452
1453
  const o = I("HumanAvatar"), l = I("AIAvatar"), g = I("TeamAvatars");
1453
1454
  return d(), c("div", Ft, [
1454
1455
  n.showBack ? (d(), c("button", {
@@ -1486,20 +1487,15 @@ function Kt(t, e, n, a, r, s) {
1486
1487
  ]),
1487
1488
  i("div", Pt, [
1488
1489
  i("div", Ut, b(n.title), 1),
1489
- s.showPresence ? (d(), c("div", zt, [
1490
- s.hasTeam ? (d(), L(g, {
1491
- key: 0,
1492
- members: n.teamMembers,
1490
+ s.hasTeam ? (d(), c("div", zt, [
1491
+ V(g, {
1492
+ members: s.displayedTeamMembers,
1493
1493
  "response-label": n.responseLabel
1494
- }, null, 8, ["members", "response-label"])) : w("", !0),
1495
- i("span", Vt, [
1496
- e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
1497
- te(" " + b(s.statusText), 1)
1498
- ])
1494
+ }, null, 8, ["members", "response-label"])
1499
1495
  ])) : w("", !0)
1500
1496
  ])
1501
1497
  ], 64)) : (d(), c("div", Ht)),
1502
- i("div", qt, [
1498
+ i("div", Vt, [
1503
1499
  n.showMore ? (d(), c("button", {
1504
1500
  key: 0,
1505
1501
  type: "button",
@@ -1507,7 +1503,7 @@ function Kt(t, e, n, a, r, s) {
1507
1503
  "aria-label": "Plus d'options",
1508
1504
  title: "Plus d'options",
1509
1505
  onClick: e[1] || (e[1] = (k) => t.$emit("more"))
1510
- }, [...e[5] || (e[5] = [
1506
+ }, [...e[4] || (e[4] = [
1511
1507
  i("svg", {
1512
1508
  width: "13",
1513
1509
  height: "13",
@@ -1539,7 +1535,7 @@ function Kt(t, e, n, a, r, s) {
1539
1535
  "aria-label": "Fermer le widget",
1540
1536
  title: "Fermer le widget",
1541
1537
  onClick: e[2] || (e[2] = (k) => t.$emit("close"))
1542
- }, [...e[6] || (e[6] = [
1538
+ }, [...e[5] || (e[5] = [
1543
1539
  i("svg", {
1544
1540
  width: "13",
1545
1541
  height: "13",
@@ -1557,15 +1553,15 @@ function Kt(t, e, n, a, r, s) {
1557
1553
  ])
1558
1554
  ]);
1559
1555
  }
1560
- const Wt = /* @__PURE__ */ $(Rt, [["render", Kt], ["__scopeId", "data-v-b5f5f6a9"]]), ge = {
1556
+ const Kt = /* @__PURE__ */ $(Rt, [["render", qt], ["__scopeId", "data-v-a67a7ad8"]]), ge = {
1561
1557
  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",
1562
1558
  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",
1563
1559
  status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
1564
1560
  chat: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",
1565
1561
  link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
1566
- }, Gt = {
1562
+ }, Wt = {
1567
1563
  name: "WmOnboarding",
1568
- components: { AIAvatar: ne },
1564
+ components: { AIAvatar: te },
1569
1565
  props: {
1570
1566
  welcomeMessage: { type: String, default: "" },
1571
1567
  agentName: { type: String, default: "" },
@@ -1573,7 +1569,10 @@ const Wt = /* @__PURE__ */ $(Rt, [["render", Kt], ["__scopeId", "data-v-b5f5f6a9
1573
1569
  openThreads: { type: Array, default: () => [] },
1574
1570
  busy: { type: Boolean, default: !1 }
1575
1571
  },
1576
- emits: ["start", "select", "resume", "view-all"],
1572
+ emits: ["start", "select", "resume"],
1573
+ data() {
1574
+ return { query: "" };
1575
+ },
1577
1576
  computed: {
1578
1577
  heroTitle() {
1579
1578
  return this.welcomeMessage ? this.welcomeMessage : this.agentName ? `Bonjour, je suis ${this.agentName}` : "Bonjour, je suis votre assistant";
@@ -1587,6 +1586,12 @@ Je réponds en quelques secondes.`;
1587
1586
  },
1588
1587
  quickLinksLayout() {
1589
1588
  return this.isOddQuickLinks ? "wm-onb__qlist" : "wm-onb__grid";
1589
+ },
1590
+ filteredThreads() {
1591
+ const t = this.query.trim().toLowerCase();
1592
+ return t ? this.openThreads.filter(
1593
+ (e) => (e.title || "").toLowerCase().includes(t) || (e.preview || "").toLowerCase().includes(t)
1594
+ ) : this.openThreads;
1590
1595
  }
1591
1596
  },
1592
1597
  methods: {
@@ -1609,10 +1614,10 @@ Je réponds en quelques secondes.`;
1609
1614
  return e.toLocaleDateString("fr-FR", { day: "2-digit", month: "2-digit" });
1610
1615
  }
1611
1616
  }
1612
- }, Yt = { class: "wm-onb" }, Jt = { class: "wm-onb__hero" }, Xt = { class: "wm-onb__title" }, Qt = { class: "wm-onb__sub" }, Zt = { class: "wm-onb__cta" }, en = ["disabled"], tn = {
1617
+ }, Gt = { class: "wm-onb" }, Yt = { class: "wm-onb__hero" }, Jt = { class: "wm-onb__title" }, Xt = { class: "wm-onb__sub" }, Qt = { class: "wm-onb__cta" }, Zt = ["disabled"], en = {
1613
1618
  key: 0,
1614
1619
  class: "wm-onb__section"
1615
- }, nn = ["onClick"], sn = { class: "wm-onb__card-icon" }, rn = {
1620
+ }, tn = ["onClick"], nn = { class: "wm-onb__card-icon" }, sn = {
1616
1621
  width: "16",
1617
1622
  height: "16",
1618
1623
  viewBox: "0 0 24 24",
@@ -1622,32 +1627,35 @@ Je réponds en quelques secondes.`;
1622
1627
  "stroke-linecap": "round",
1623
1628
  "stroke-linejoin": "round",
1624
1629
  "aria-hidden": "true"
1625
- }, an = ["d"], on = { class: "wm-onb__card-body" }, ln = { class: "wm-onb__card-title" }, dn = {
1630
+ }, rn = ["d"], an = { class: "wm-onb__card-body" }, on = { class: "wm-onb__card-title" }, ln = {
1626
1631
  key: 0,
1627
1632
  class: "wm-onb__card-sub"
1628
- }, cn = {
1633
+ }, dn = {
1629
1634
  key: 1,
1630
1635
  class: "wm-onb__section"
1631
- }, un = { class: "wm-onb__list" }, hn = ["onClick"], mn = { class: "wm-onb__thread-icon" }, fn = {
1636
+ }, cn = { class: "wm-onb__search" }, un = { class: "wm-onb__list" }, hn = ["onClick"], mn = {
1632
1637
  key: 0,
1633
1638
  class: "wm-onb__thread-dot",
1634
1639
  "aria-label": "Non lu"
1635
- }, _n = { class: "wm-onb__thread-body" }, pn = { class: "wm-onb__thread-title" }, gn = { class: "wm-onb__thread-preview" }, vn = { class: "wm-onb__thread-meta" }, yn = {
1640
+ }, fn = { class: "wm-onb__thread-body" }, _n = { class: "wm-onb__thread-title" }, pn = { class: "wm-onb__thread-preview" }, gn = { class: "wm-onb__thread-meta" }, vn = {
1636
1641
  key: 0,
1637
1642
  class: "wm-onb__thread-time"
1643
+ }, yn = {
1644
+ key: 0,
1645
+ class: "wm-onb__empty"
1638
1646
  };
1639
1647
  function wn(t, e, n, a, r, s) {
1640
1648
  const o = I("AIAvatar");
1641
- return d(), c("div", Yt, [
1642
- i("div", Jt, [
1643
- W(o, {
1649
+ return d(), c("div", Gt, [
1650
+ i("div", Yt, [
1651
+ V(o, {
1644
1652
  size: 56,
1645
1653
  pulse: !0
1646
1654
  }),
1647
- i("div", Xt, b(s.heroTitle), 1),
1648
- i("div", Qt, b(s.heroSub), 1)
1655
+ i("div", Jt, b(s.heroTitle), 1),
1656
+ i("div", Xt, b(s.heroSub), 1)
1649
1657
  ]),
1650
- i("div", Zt, [
1658
+ i("div", Qt, [
1651
1659
  i("button", {
1652
1660
  type: "button",
1653
1661
  class: "wm-onb__startBtn",
@@ -1670,9 +1678,9 @@ function wn(t, e, n, a, r, s) {
1670
1678
  ])
1671
1679
  ], -1)),
1672
1680
  i("span", null, b(n.busy ? "…" : "Commencer une conversation"), 1)
1673
- ], 8, en)
1681
+ ], 8, Zt)
1674
1682
  ]),
1675
- n.quickLinks.length ? (d(), c("div", tn, [
1683
+ n.quickLinks.length ? (d(), c("div", en, [
1676
1684
  e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1677
1685
  i("div", {
1678
1686
  class: T(s.quickLinksLayout)
@@ -1683,52 +1691,79 @@ function wn(t, e, n, a, r, s) {
1683
1691
  class: T(["wm-onb__card", { "wm-onb__card--row": s.isOddQuickLinks }]),
1684
1692
  onClick: (k) => t.$emit("select", l)
1685
1693
  }, [
1686
- i("span", sn, [
1687
- (d(), c("svg", rn, [
1694
+ i("span", nn, [
1695
+ (d(), c("svg", sn, [
1688
1696
  i("path", {
1689
1697
  d: s.iconPath(l.icon)
1690
- }, null, 8, an)
1698
+ }, null, 8, rn)
1691
1699
  ]))
1692
1700
  ]),
1693
- i("span", on, [
1694
- i("span", ln, b(l.label), 1),
1695
- l.description ? (d(), c("span", dn, b(l.description), 1)) : w("", !0)
1701
+ i("span", an, [
1702
+ i("span", on, b(l.label), 1),
1703
+ l.description ? (d(), c("span", ln, b(l.description), 1)) : w("", !0)
1696
1704
  ])
1697
- ], 10, nn))), 128))
1705
+ ], 10, tn))), 128))
1698
1706
  ], 2)
1699
1707
  ])) : w("", !0),
1700
- n.openThreads.length ? (d(), c("div", cn, [
1708
+ n.openThreads.length ? (d(), c("div", dn, [
1701
1709
  e[7] || (e[7] = i("div", { class: "wm-onb__section-title" }, "Conversations récentes", -1)),
1710
+ i("div", cn, [
1711
+ e[4] || (e[4] = i("span", { class: "wm-onb__searchIcon" }, [
1712
+ i("svg", {
1713
+ width: "12",
1714
+ height: "12",
1715
+ viewBox: "0 0 24 24",
1716
+ fill: "none",
1717
+ stroke: "currentColor",
1718
+ "stroke-width": "1.8",
1719
+ "stroke-linecap": "round",
1720
+ "stroke-linejoin": "round",
1721
+ "aria-hidden": "true"
1722
+ }, [
1723
+ i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
1724
+ ])
1725
+ ], -1)),
1726
+ H(i("input", {
1727
+ "onUpdate:modelValue": e[1] || (e[1] = (l) => r.query = l),
1728
+ type: "text",
1729
+ placeholder: "Rechercher dans vos messages",
1730
+ "aria-label": "Rechercher dans vos messages"
1731
+ }, null, 512), [
1732
+ [J, r.query]
1733
+ ])
1734
+ ]),
1702
1735
  i("div", un, [
1703
- (d(!0), c(O, null, F(n.openThreads, (l) => (d(), c("button", {
1736
+ (d(!0), c(O, null, F(s.filteredThreads, (l) => (d(), c("button", {
1704
1737
  key: l.id,
1705
1738
  type: "button",
1706
1739
  class: "wm-onb__thread",
1707
1740
  onClick: (g) => t.$emit("resume", l)
1708
1741
  }, [
1709
- i("span", mn, [
1710
- e[4] || (e[4] = i("svg", {
1742
+ i("span", {
1743
+ class: T(["wm-onb__thread-icon", { "wm-onb__thread-icon--inverted": !l.unread }])
1744
+ }, [
1745
+ e[5] || (e[5] = i("svg", {
1711
1746
  width: "18",
1712
1747
  height: "18",
1713
1748
  viewBox: "0 0 24 24",
1714
1749
  fill: "none",
1715
- stroke: "currentColor",
1716
- "stroke-width": "1.8",
1717
- "stroke-linecap": "round",
1718
- "stroke-linejoin": "round",
1719
1750
  "aria-hidden": "true"
1720
1751
  }, [
1721
- i("path", { d: "M12 5v14M5 12h14" })
1752
+ i("path", {
1753
+ d: "M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",
1754
+ fill: "currentColor",
1755
+ opacity: "0.92"
1756
+ })
1722
1757
  ], -1)),
1723
- l.unread ? (d(), c("span", fn)) : w("", !0)
1724
- ]),
1725
- i("span", _n, [
1726
- i("span", pn, b(l.title), 1),
1727
- i("span", gn, b(l.preview), 1)
1758
+ l.unread ? (d(), c("span", mn)) : w("", !0)
1759
+ ], 2),
1760
+ i("span", fn, [
1761
+ i("span", _n, b(l.title), 1),
1762
+ i("span", pn, b(l.preview), 1)
1728
1763
  ]),
1729
- i("span", vn, [
1730
- s.formatTs(l._ts) ? (d(), c("span", yn, b(s.formatTs(l._ts)), 1)) : w("", !0),
1731
- e[5] || (e[5] = i("svg", {
1764
+ i("span", gn, [
1765
+ s.formatTs(l._ts) ? (d(), c("span", vn, b(s.formatTs(l._ts)), 1)) : w("", !0),
1766
+ e[6] || (e[6] = i("svg", {
1732
1767
  width: "13",
1733
1768
  height: "13",
1734
1769
  viewBox: "0 0 24 24",
@@ -1744,31 +1779,12 @@ function wn(t, e, n, a, r, s) {
1744
1779
  ], -1))
1745
1780
  ])
1746
1781
  ], 8, hn))), 128)),
1747
- i("button", {
1748
- type: "button",
1749
- class: "wm-onb__viewAll",
1750
- onClick: e[1] || (e[1] = (l) => t.$emit("view-all"))
1751
- }, [...e[6] || (e[6] = [
1752
- te(" Voir toutes les conversations ", -1),
1753
- i("svg", {
1754
- width: "12",
1755
- height: "12",
1756
- viewBox: "0 0 24 24",
1757
- fill: "none",
1758
- stroke: "currentColor",
1759
- "stroke-width": "1.8",
1760
- "stroke-linecap": "round",
1761
- "stroke-linejoin": "round",
1762
- "aria-hidden": "true"
1763
- }, [
1764
- i("path", { d: "M9 18l6-6-6-6" })
1765
- ], -1)
1766
- ])])
1782
+ s.filteredThreads.length ? w("", !0) : (d(), c("div", yn, " Aucun résultat pour « " + b(r.query) + " ». ", 1))
1767
1783
  ])
1768
1784
  ])) : w("", !0)
1769
1785
  ]);
1770
1786
  }
1771
- const bn = /* @__PURE__ */ $(Gt, [["render", wn], ["__scopeId", "data-v-3de759ce"]]);
1787
+ const bn = /* @__PURE__ */ $(Wt, [["render", wn], ["__scopeId", "data-v-0fb4345b"]]);
1772
1788
  function kn(t) {
1773
1789
  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();
1774
1790
  }
@@ -1903,7 +1919,7 @@ function Pn(t, e, n, a, r, s) {
1903
1919
  }, [
1904
1920
  i("polyline", { points: "20 6 9 17 4 12" })
1905
1921
  ]),
1906
- te(" Envoyé ")
1922
+ ue(" Envoyé ")
1907
1923
  ], -1))
1908
1924
  ]),
1909
1925
  i("div", Dn, [
@@ -1934,7 +1950,7 @@ const Un = /* @__PURE__ */ $(Ln, [["render", Pn], ["__scopeId", "data-v-ca24a9c9
1934
1950
  return !!((t = this.data) != null && t.body) || this.fields.length > 0;
1935
1951
  }
1936
1952
  }
1937
- }, Vn = { class: "wm-art wm-art--infoCard" }, Hn = {
1953
+ }, Hn = { class: "wm-art wm-art--infoCard" }, Vn = {
1938
1954
  key: 0,
1939
1955
  class: "wm-art__image"
1940
1956
  }, qn = ["src", "alt"], Kn = { class: "wm-art__head" }, Wn = { class: "wm-art__headMain" }, Gn = { class: "wm-art__title" }, Yn = {
@@ -1948,8 +1964,8 @@ const Un = /* @__PURE__ */ $(Ln, [["render", Pn], ["__scopeId", "data-v-ca24a9c9
1948
1964
  class: "wm-art__text"
1949
1965
  }, Qn = { class: "wm-art__fieldLabel" };
1950
1966
  function Zn(t, e, n, a, r, s) {
1951
- return d(), c("div", Vn, [
1952
- n.data.image_url ? (d(), c("figure", Hn, [
1967
+ return d(), c("div", Hn, [
1968
+ n.data.image_url ? (d(), c("figure", Vn, [
1953
1969
  i("img", {
1954
1970
  src: n.data.image_url,
1955
1971
  alt: n.data.title || "",
@@ -2073,7 +2089,7 @@ function fs(t, e, n, a, r, s) {
2073
2089
  class: "wm-tk__dot",
2074
2090
  "aria-hidden": "true"
2075
2091
  }, null, -1)),
2076
- te(" " + b(n.data.status.label), 1)
2092
+ ue(" " + b(n.data.status.label), 1)
2077
2093
  ], 2)
2078
2094
  ]),
2079
2095
  n.data.body ? (d(), c("div", ls, b(n.data.body), 1)) : w("", !0)
@@ -2310,7 +2326,7 @@ function $s(t) {
2310
2326
  return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
2311
2327
  }
2312
2328
  const ve = "";
2313
- function re(t) {
2329
+ function se(t) {
2314
2330
  let e = t;
2315
2331
  const n = [];
2316
2332
  return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
@@ -2344,7 +2360,7 @@ function Ls(t) {
2344
2360
  if (!x) break;
2345
2361
  k.push(x[1]), a++;
2346
2362
  }
2347
- const C = k.map((x) => `<li>${re(x)}</li>`).join("");
2363
+ const C = k.map((x) => `<li>${se(x)}</li>`).join("");
2348
2364
  n.push({ type: "block", html: `<ul class="wm-md-ul">${C}</ul>` });
2349
2365
  continue;
2350
2366
  }
@@ -2356,7 +2372,7 @@ function Ls(t) {
2356
2372
  if (!A) break;
2357
2373
  C.push(A[1]), a++;
2358
2374
  }
2359
- const x = C.map((A) => `<li>${re(A)}</li>`).join(""), N = k !== 1 ? ` start="${k}"` : "";
2375
+ const x = C.map((A) => `<li>${se(A)}</li>`).join(""), N = k !== 1 ? ` start="${k}"` : "";
2360
2376
  n.push({ type: "block", html: `<ol class="wm-md-ol"${N}>${x}</ol>` });
2361
2377
  continue;
2362
2378
  }
@@ -2365,11 +2381,11 @@ function Ls(t) {
2365
2381
  const k = g[1].length;
2366
2382
  n.push({
2367
2383
  type: "block",
2368
- html: `<h${k} class="wm-md-h wm-md-h${k}">${re(g[2])}</h${k}>`
2384
+ html: `<h${k} class="wm-md-h wm-md-h${k}">${se(g[2])}</h${k}>`
2369
2385
  }), a++;
2370
2386
  continue;
2371
2387
  }
2372
- n.push({ type: "text", html: re(s) }), a++;
2388
+ n.push({ type: "text", html: se(s) }), a++;
2373
2389
  }
2374
2390
  let r = "";
2375
2391
  for (let s = 0; s < n.length; s++) {
@@ -2415,16 +2431,16 @@ const zs = /* @__PURE__ */ $(js, [["render", Us], ["__scopeId", "data-v-df2447fd
2415
2431
  function ee(t) {
2416
2432
  return t ? t.client_msg_id || t.id : "";
2417
2433
  }
2418
- const Vs = {
2434
+ const Hs = {
2419
2435
  transferred_to_human: "Conversation transférée à un humain",
2420
2436
  assigned: "{name} a rejoint la conversation",
2421
2437
  unassigned: "L'agent a quitté la conversation",
2422
2438
  resolved: "Conversation résolue",
2423
2439
  reopened: "Conversation rouverte",
2424
2440
  idle: "Conversation en pause"
2425
- }, Hs = 80, qs = 200, Ks = {
2441
+ }, Vs = 80, qs = 200, Ks = {
2426
2442
  name: "WmMessageList",
2427
- components: { AIAvatar: ne, HumanAvatar: he, Bubble: Ds, Typing: zs, ActionResult: $n, AttachmentPreview: Is, ArtifactRenderer: ys },
2443
+ components: { AIAvatar: te, HumanAvatar: he, Bubble: Ds, Typing: zs, ActionResult: $n, AttachmentPreview: Is, ArtifactRenderer: ys },
2428
2444
  props: {
2429
2445
  messages: { type: Array, default: () => [] },
2430
2446
  streamingActive: { type: Boolean, default: !1 },
@@ -2560,7 +2576,7 @@ const Vs = {
2560
2576
  methods: {
2561
2577
  messageKey: ee,
2562
2578
  isAtBottom(t) {
2563
- return t.scrollHeight - t.scrollTop - t.clientHeight <= Hs;
2579
+ return t.scrollHeight - t.scrollTop - t.clientHeight <= Vs;
2564
2580
  },
2565
2581
  onScroll() {
2566
2582
  const t = this.$refs.scrollEl;
@@ -2739,8 +2755,8 @@ const Vs = {
2739
2755
  // adjacent à une `bubble`) : mon coin déborde le voisin et
2740
2756
  // doit garder son arrondi.
2741
2757
  cornersFor(t, e) {
2742
- var J, V, Z;
2743
- const n = t.items, a = (J = n[e]) == null ? void 0 : J.kind, r = (V = n[e - 1]) == null ? void 0 : V.kind, s = (Z = n[e + 1]) == null ? void 0 : Z.kind, o = t.role === "user", l = 14, g = 4, k = r == null ? void 0 : r.bottom, C = s == null ? void 0 : s.top, x = this.widthByKey[this.rowKeyOf(t, e)], N = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], D = 0.5, S = (G, H, X) => G != null && x != null ? G + D >= x : H === X || H === "card" && X === "bubble";
2758
+ var X, q, Z;
2759
+ const n = t.items, a = (X = n[e]) == null ? void 0 : X.kind, r = (q = n[e - 1]) == null ? void 0 : q.kind, s = (Z = n[e + 1]) == null ? void 0 : Z.kind, o = t.role === "user", l = 14, g = 4, k = r == null ? void 0 : r.bottom, C = s == null ? void 0 : s.top, x = this.widthByKey[this.rowKeyOf(t, e)], N = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], D = 0.5, S = (G, K, Q) => G != null && x != null ? G + D >= x : K === Q || K === "card" && Q === "bubble";
2744
2760
  let P = l, U = l, R = l, z = l;
2745
2761
  return o ? (k && (U = g), (C || !s) && (R = g), k && S(N, k, a == null ? void 0 : a.top) && (P = g), C && S(A, C, a == null ? void 0 : a.bottom) && (z = g)) : (k && (P = g), (C || !s) && (z = g), k && S(N, k, a == null ? void 0 : a.top) && (U = g), C && S(A, C, a == null ? void 0 : a.bottom) && (R = g)), { tl: P, tr: U, br: R, bl: z };
2746
2762
  },
@@ -2848,7 +2864,7 @@ const Vs = {
2848
2864
  },
2849
2865
  systemLabel(t) {
2850
2866
  var r, s, o;
2851
- const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = Vs[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) || "";
2867
+ const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = Hs[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) || "";
2852
2868
  return n.replace("{name}", a || "Un agent");
2853
2869
  },
2854
2870
  scrollToBottom() {
@@ -2926,7 +2942,7 @@ function lr(t, e, n, a, r, s) {
2926
2942
  key: `${s.messageKey(S.message)}-${S.partKey}`,
2927
2943
  "data-row-key": `${s.messageKey(S.message)}-${S.partKey}`,
2928
2944
  class: T(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": S.message._pending, "is-failed": S.message._failed }]]),
2929
- style: K(s.cornersStyle(A, P))
2945
+ style: W(s.cornersStyle(A, P))
2930
2946
  }, [
2931
2947
  A.role !== "user" ? (d(), c("div", tr, [
2932
2948
  P === A.items.length - 1 ? (d(), c(O, { key: 0 }, [
@@ -2989,16 +3005,16 @@ function lr(t, e, n, a, r, s) {
2989
3005
  ], 64))), 128)),
2990
3006
  n.streamingActive ? (d(), c("div", ar, [
2991
3007
  i("div", or, [
2992
- W(o, {
3008
+ V(o, {
2993
3009
  size: 26,
2994
3010
  tail: !0
2995
3011
  })
2996
3012
  ]),
2997
- W(N)
3013
+ V(N)
2998
3014
  ])) : w("", !0)
2999
3015
  ], 34);
3000
3016
  }
3001
- const dr = /* @__PURE__ */ $(Ks, [["render", lr], ["__scopeId", "data-v-21381fcb"]]), de = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", me = typeof window < "u" && typeof window.MediaRecorder < "u";
3017
+ const dr = /* @__PURE__ */ $(Ks, [["render", lr], ["__scopeId", "data-v-21381fcb"]]), le = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", me = typeof window < "u" && typeof window.MediaRecorder < "u";
3002
3018
  function cr() {
3003
3019
  return me && [
3004
3020
  "video/webm;codecs=vp9,opus",
@@ -3023,7 +3039,7 @@ function xa(t) {
3023
3039
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
3024
3040
  }
3025
3041
  async function ur() {
3026
- if (!de) return null;
3042
+ if (!le) return null;
3027
3043
  let t;
3028
3044
  try {
3029
3045
  t = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !1 }));
@@ -3052,7 +3068,7 @@ async function hr(t) {
3052
3068
  }
3053
3069
  async function mr(t = {}) {
3054
3070
  var k;
3055
- if (!de || !me) return null;
3071
+ if (!le || !me) return null;
3056
3072
  let e;
3057
3073
  try {
3058
3074
  e = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !0 }));
@@ -3152,7 +3168,7 @@ const fr = [
3152
3168
  attachItems() {
3153
3169
  return fr.map((t) => ({
3154
3170
  ...t,
3155
- disabled: t.action === "screenshot" && !de || t.action === "record" && (!de || !me)
3171
+ disabled: t.action === "screenshot" && !le || t.action === "record" && (!le || !me)
3156
3172
  }));
3157
3173
  },
3158
3174
  recordingElapsedLabel() {
@@ -3319,7 +3335,7 @@ function Mr(t, e, n, a, r, s) {
3319
3335
  i("span", null, b(o.label), 1)
3320
3336
  ], 8, wr))), 128))
3321
3337
  ])) : w("", !0),
3322
- q(i("textarea", {
3338
+ H(i("textarea", {
3323
3339
  ref: "inputEl",
3324
3340
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
3325
3341
  class: "wm-compose__input",
@@ -3329,7 +3345,7 @@ function Mr(t, e, n, a, r, s) {
3329
3345
  onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
3330
3346
  onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
3331
3347
  }, null, 40, Ar), [
3332
- [Q, r.local]
3348
+ [J, r.local]
3333
3349
  ]),
3334
3350
  i("div", Sr, [
3335
3351
  i("button", {
@@ -3405,14 +3421,14 @@ function Er(t, e, n, a, r, s) {
3405
3421
  key: l,
3406
3422
  type: "button",
3407
3423
  class: "wm-chip",
3408
- style: K({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
3424
+ style: W({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
3409
3425
  onClick: (g) => t.$emit("select", o)
3410
3426
  }, b(o.label), 13, Ir))), 128))
3411
3427
  ])) : w("", !0);
3412
3428
  }
3413
3429
  const $r = /* @__PURE__ */ $(Br, [["render", Er], ["__scopeId", "data-v-55aa529d"]]), Lr = {
3414
3430
  name: "WmApprovalCard",
3415
- components: { AIAvatar: ne },
3431
+ components: { AIAvatar: te },
3416
3432
  props: {
3417
3433
  action: { type: String, required: !0 },
3418
3434
  detail: { type: String, default: "" },
@@ -3452,7 +3468,7 @@ function zr(t, e, n, a, r, s) {
3452
3468
  return d(), c("div", Nr, [
3453
3469
  i("div", Rr, [
3454
3470
  i("div", Fr, [
3455
- W(o, { size: 24 })
3471
+ V(o, { size: 24 })
3456
3472
  ]),
3457
3473
  i("div", Dr, [
3458
3474
  i("div", jr, b(n.action), 1),
@@ -3475,9 +3491,9 @@ function zr(t, e, n, a, r, s) {
3475
3491
  ])
3476
3492
  ]);
3477
3493
  }
3478
- const Vr = /* @__PURE__ */ $(Lr, [["render", zr], ["__scopeId", "data-v-b1be139c"]]);
3494
+ const Hr = /* @__PURE__ */ $(Lr, [["render", zr], ["__scopeId", "data-v-b1be139c"]]);
3479
3495
  let ye = 0;
3480
- const Hr = /* @__PURE__ */ new Set([
3496
+ const Vr = /* @__PURE__ */ new Set([
3481
3497
  "text",
3482
3498
  "textarea",
3483
3499
  "number",
@@ -3487,7 +3503,7 @@ const Hr = /* @__PURE__ */ new Set([
3487
3503
  "date"
3488
3504
  ]), qr = {
3489
3505
  name: "WmFormCard",
3490
- components: { AIAvatar: ne },
3506
+ components: { AIAvatar: te },
3491
3507
  props: {
3492
3508
  form: { type: Object, required: !0 },
3493
3509
  readOnly: { type: Boolean, default: !1 },
@@ -3508,7 +3524,7 @@ const Hr = /* @__PURE__ */ new Set([
3508
3524
  // douteux.
3509
3525
  normalizedFields() {
3510
3526
  var e;
3511
- return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !Hr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
3527
+ return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !Vr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
3512
3528
  }
3513
3529
  },
3514
3530
  created() {
@@ -3591,7 +3607,7 @@ function _i(t, e, n, a, r, s) {
3591
3607
  return d(), c("div", Kr, [
3592
3608
  i("div", Wr, [
3593
3609
  i("div", Gr, [
3594
- W(o, { size: 24 })
3610
+ V(o, { size: 24 })
3595
3611
  ]),
3596
3612
  i("div", Yr, [
3597
3613
  i("div", Jr, b(n.form.title || "Formulaire"), 1),
@@ -3610,10 +3626,10 @@ function _i(t, e, n, a, r, s) {
3610
3626
  for: `wm-f-${r._uid}-${l.key}`,
3611
3627
  class: "wm-form__label"
3612
3628
  }, [
3613
- te(b(l.label), 1),
3629
+ ue(b(l.label), 1),
3614
3630
  l.required ? (d(), c("span", Zr, "*")) : w("", !0)
3615
3631
  ], 8, Qr),
3616
- l.type === "text" ? q((d(), c("input", {
3632
+ l.type === "text" ? H((d(), c("input", {
3617
3633
  key: 0,
3618
3634
  id: `wm-f-${r._uid}-${l.key}`,
3619
3635
  "onUpdate:modelValue": (g) => r.values[l.key] = g,
@@ -3623,8 +3639,8 @@ function _i(t, e, n, a, r, s) {
3623
3639
  required: l.required,
3624
3640
  disabled: n.readOnly || r.busy
3625
3641
  }, null, 8, ei)), [
3626
- [Q, r.values[l.key]]
3627
- ]) : l.type === "textarea" ? q((d(), c("textarea", {
3642
+ [J, r.values[l.key]]
3643
+ ]) : l.type === "textarea" ? H((d(), c("textarea", {
3628
3644
  key: 1,
3629
3645
  id: `wm-f-${r._uid}-${l.key}`,
3630
3646
  "onUpdate:modelValue": (g) => r.values[l.key] = g,
@@ -3634,8 +3650,8 @@ function _i(t, e, n, a, r, s) {
3634
3650
  required: l.required,
3635
3651
  disabled: n.readOnly || r.busy
3636
3652
  }, null, 8, ti)), [
3637
- [Q, r.values[l.key]]
3638
- ]) : l.type === "number" ? q((d(), c("input", {
3653
+ [J, r.values[l.key]]
3654
+ ]) : l.type === "number" ? H((d(), c("input", {
3639
3655
  key: 2,
3640
3656
  id: `wm-f-${r._uid}-${l.key}`,
3641
3657
  "onUpdate:modelValue": (g) => r.values[l.key] = g,
@@ -3646,12 +3662,12 @@ function _i(t, e, n, a, r, s) {
3646
3662
  disabled: n.readOnly || r.busy
3647
3663
  }, null, 8, ni)), [
3648
3664
  [
3649
- Q,
3665
+ J,
3650
3666
  r.values[l.key],
3651
3667
  void 0,
3652
3668
  { number: !0 }
3653
3669
  ]
3654
- ]) : l.type === "date" ? q((d(), c("input", {
3670
+ ]) : l.type === "date" ? H((d(), c("input", {
3655
3671
  key: 3,
3656
3672
  id: `wm-f-${r._uid}-${l.key}`,
3657
3673
  "onUpdate:modelValue": (g) => r.values[l.key] = g,
@@ -3660,9 +3676,9 @@ function _i(t, e, n, a, r, s) {
3660
3676
  required: l.required,
3661
3677
  disabled: n.readOnly || r.busy
3662
3678
  }, null, 8, si)), [
3663
- [Q, r.values[l.key]]
3679
+ [J, r.values[l.key]]
3664
3680
  ]) : l.type === "boolean" ? (d(), c("label", ri, [
3665
- q(i("input", {
3681
+ H(i("input", {
3666
3682
  id: `wm-f-${r._uid}-${l.key}`,
3667
3683
  "onUpdate:modelValue": (g) => r.values[l.key] = g,
3668
3684
  type: "checkbox",
@@ -3671,7 +3687,7 @@ function _i(t, e, n, a, r, s) {
3671
3687
  [Ee, r.values[l.key]]
3672
3688
  ]),
3673
3689
  i("span", null, b(l.placeholder || "Oui"), 1)
3674
- ])) : l.type === "select" ? q((d(), c("select", {
3690
+ ])) : l.type === "select" ? H((d(), c("select", {
3675
3691
  key: 5,
3676
3692
  id: `wm-f-${r._uid}-${l.key}`,
3677
3693
  "onUpdate:modelValue": (g) => r.values[l.key] = g,
@@ -3746,7 +3762,7 @@ const pi = /* @__PURE__ */ $(qr, [["render", _i], ["__scopeId", "data-v-64b40f76
3746
3762
  function Si(t, e, n, a, r, s) {
3747
3763
  return d(), c("div", vi, [
3748
3764
  n.done ? (d(), c("div", Ai, [...e[3] || (e[3] = [
3749
- ie('<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)
3765
+ re('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
3750
3766
  ])])) : (d(), c(O, { key: 0 }, [
3751
3767
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
3752
3768
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
@@ -3838,7 +3854,7 @@ const Mi = {
3838
3854
  key: 0,
3839
3855
  class: "wm-hd__rowDot",
3840
3856
  "aria-label": "Message non lu"
3841
- }, Ui = { class: "wm-hd__rowBody" }, zi = { class: "wm-hd__rowTop" }, Vi = { class: "wm-hd__rowTitle" }, Hi = { class: "wm-hd__rowPreview" }, qi = {
3857
+ }, Ui = { class: "wm-hd__rowBody" }, zi = { class: "wm-hd__rowTop" }, Hi = { class: "wm-hd__rowTitle" }, Vi = { class: "wm-hd__rowPreview" }, qi = {
3842
3858
  key: 0,
3843
3859
  class: "wm-hd__empty"
3844
3860
  };
@@ -3914,13 +3930,13 @@ function Ki(t, e, n, a, r, s) {
3914
3930
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3915
3931
  ])
3916
3932
  ], -1)),
3917
- q(i("input", {
3933
+ H(i("input", {
3918
3934
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3919
3935
  type: "text",
3920
3936
  placeholder: "Rechercher dans vos messages",
3921
3937
  "aria-label": "Rechercher dans vos messages"
3922
3938
  }, null, 512), [
3923
- [Q, r.query]
3939
+ [J, r.query]
3924
3940
  ])
3925
3941
  ])
3926
3942
  ]),
@@ -3958,9 +3974,9 @@ function Ki(t, e, n, a, r, s) {
3958
3974
  ]),
3959
3975
  i("div", Ui, [
3960
3976
  i("div", zi, [
3961
- i("span", Vi, b(l.title), 1)
3977
+ i("span", Hi, b(l.title), 1)
3962
3978
  ]),
3963
- i("div", Hi, b(l.preview || "Aucun message"), 1)
3979
+ i("div", Vi, b(l.preview || "Aucun message"), 1)
3964
3980
  ])
3965
3981
  ], 10, Di))), 128))
3966
3982
  ])
@@ -4049,7 +4065,7 @@ function ea(t, e, n, a, r, s) {
4049
4065
  class: "wm-mm__item",
4050
4066
  onClick: e[2] || (e[2] = (o) => s.emit("rename"))
4051
4067
  }, [...e[9] || (e[9] = [
4052
- ie('<span class="wm-mm__icon" data-v-e300b2de><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-e300b2de><path d="M12 20h9" data-v-e300b2de></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-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Modifier le titre</span>', 2)
4068
+ re('<span class="wm-mm__icon" data-v-e300b2de><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-e300b2de><path d="M12 20h9" data-v-e300b2de></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-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Modifier le titre</span>', 2)
4053
4069
  ])])) : w("", !0),
4054
4070
  n.canExport ? (d(), c("button", {
4055
4071
  key: 1,
@@ -4057,7 +4073,7 @@ function ea(t, e, n, a, r, s) {
4057
4073
  class: "wm-mm__item",
4058
4074
  onClick: e[3] || (e[3] = (o) => s.emit("export"))
4059
4075
  }, [...e[10] || (e[10] = [
4060
- ie('<span class="wm-mm__icon" data-v-e300b2de><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-e300b2de><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Exporter la transcription</span><span class="wm-mm__hint" data-v-e300b2de>.txt</span>', 3)
4076
+ re('<span class="wm-mm__icon" data-v-e300b2de><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-e300b2de><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Exporter la transcription</span><span class="wm-mm__hint" data-v-e300b2de>.txt</span>', 3)
4061
4077
  ])])) : w("", !0)
4062
4078
  ]),
4063
4079
  e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
@@ -4067,7 +4083,7 @@ function ea(t, e, n, a, r, s) {
4067
4083
  class: "wm-mm__item",
4068
4084
  onClick: e[4] || (e[4] = (...o) => s.toggleSound && s.toggleSound(...o))
4069
4085
  }, [
4070
- e[12] || (e[12] = ie('<span class="wm-mm__icon" data-v-e300b2de><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-e300b2de><path d="M11 5L6 9H2v6h4l5 4V5z" data-v-e300b2de></path><path d="M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" data-v-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Son</span>', 2)),
4086
+ e[12] || (e[12] = re('<span class="wm-mm__icon" data-v-e300b2de><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-e300b2de><path d="M11 5L6 9H2v6h4l5 4V5z" data-v-e300b2de></path><path d="M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" data-v-e300b2de></path></svg></span><span class="wm-mm__label" data-v-e300b2de>Son</span>', 2)),
4071
4087
  i("span", {
4072
4088
  class: T(["wm-mm__toggle", { "wm-mm__toggle--on": r.soundOn }])
4073
4089
  }, [...e[11] || (e[11] = [
@@ -4224,7 +4240,7 @@ function ua(t, e, n, a, r, s) {
4224
4240
  ])])
4225
4241
  ]),
4226
4242
  i("div", oa, [
4227
- q(i("input", {
4243
+ H(i("input", {
4228
4244
  ref: "input",
4229
4245
  "onUpdate:modelValue": e[2] || (e[2] = (o) => r.value = o),
4230
4246
  type: "text",
@@ -4232,11 +4248,11 @@ function ua(t, e, n, a, r, s) {
4232
4248
  placeholder: n.placeholder,
4233
4249
  maxlength: 120,
4234
4250
  onKeydown: [
4235
- e[3] || (e[3] = oe(Y((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]), ["enter"])),
4236
- e[4] || (e[4] = oe(Y((o) => t.$emit("close"), ["prevent"]), ["esc"]))
4251
+ e[3] || (e[3] = ae(Y((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]), ["enter"])),
4252
+ e[4] || (e[4] = ae(Y((o) => t.$emit("close"), ["prevent"]), ["esc"]))
4237
4253
  ]
4238
4254
  }, null, 40, la), [
4239
- [Q, r.value]
4255
+ [J, r.value]
4240
4256
  ])
4241
4257
  ]),
4242
4258
  i("div", da, [
@@ -4259,12 +4275,12 @@ const ha = /* @__PURE__ */ $(na, [["render", ua], ["__scopeId", "data-v-4f4b37c9
4259
4275
  name: "Messenger",
4260
4276
  components: {
4261
4277
  Launcher: At,
4262
- Header: Wt,
4278
+ Header: Kt,
4263
4279
  Onboarding: bn,
4264
4280
  MessageList: dr,
4265
4281
  Composer: Or,
4266
4282
  SuggestionChips: $r,
4267
- ApprovalCard: Vr,
4283
+ ApprovalCard: Hr,
4268
4284
  FormCard: pi,
4269
4285
  Feedback: xi,
4270
4286
  HistoryDrawer: Wi,
@@ -4291,7 +4307,7 @@ const ha = /* @__PURE__ */ $(na, [["render", ua], ["__scopeId", "data-v-4f4b37c9
4291
4307
  },
4292
4308
  props: {
4293
4309
  // Hardcoded server default (overridable for staging/dev).
4294
- baseUrl: { type: String, default: He },
4310
+ baseUrl: { type: String, default: Ve },
4295
4311
  widgetId: { type: String, default: "" },
4296
4312
  userId: { type: String, default: "" },
4297
4313
  userHash: { type: String, default: "" },
@@ -4394,7 +4410,7 @@ const ha = /* @__PURE__ */ $(na, [["render", ua], ["__scopeId", "data-v-4f4b37c9
4394
4410
  const t = this.readState, e = this.readBootTs, n = ((a = this.s) == null ? void 0 : a.messagesByConv) || {};
4395
4411
  return this.allConversations.map((r) => {
4396
4412
  var N;
4397
- const s = n[r.id] || [], o = ae(r, s), l = t[r.id] || e || "", g = We(s), k = !!o && g !== "user" && (!l || o > l);
4413
+ const s = n[r.id] || [], o = ie(r, s), l = t[r.id] || e || "", g = We(s), k = !!o && g !== "user" && (!l || o > l);
4398
4414
  let C = 0, x = null;
4399
4415
  for (let A = s.length - 1; A >= 0; A--) {
4400
4416
  const D = s[A];
@@ -4428,8 +4444,8 @@ const ha = /* @__PURE__ */ $(na, [["render", ua], ["__scopeId", "data-v-4f4b37c9
4428
4444
  title: n.name || "Nouvelle conversation",
4429
4445
  preview: n._preview || "Nouveau message",
4430
4446
  unread: !!n._unread,
4431
- _ts: ae(n, t[n.id] || [])
4432
- })).sort((n, a) => n._ts < a._ts ? 1 : n._ts > a._ts ? -1 : 0).slice(0, 5);
4447
+ _ts: ie(n, t[n.id] || [])
4448
+ })).sort((n, a) => n._ts < a._ts ? 1 : n._ts > a._ts ? -1 : 0);
4433
4449
  },
4434
4450
  // Unread threads (one entry per conv with unseen agent/human
4435
4451
  // activity), freshest first. Each entry carries everything the
@@ -4440,7 +4456,7 @@ const ha = /* @__PURE__ */ $(na, [["render", ua], ["__scopeId", "data-v-4f4b37c9
4440
4456
  const t = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, e = [];
4441
4457
  for (const a of this.drawerConversations) {
4442
4458
  if (!a._unread) continue;
4443
- const r = ae(a, t[a.id] || []), s = a._lastAuthor, o = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (o ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (o ? this.agentAvatarUrl : null);
4459
+ const r = ie(a, t[a.id] || []), s = a._lastAuthor, o = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (o ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (o ? this.agentAvatarUrl : null);
4444
4460
  e.push({
4445
4461
  convId: a.id,
4446
4462
  preview: a._preview || "Vous avez un nouveau message",
@@ -4568,7 +4584,7 @@ const ha = /* @__PURE__ */ $(na, [["render", ua], ["__scopeId", "data-v-4f4b37c9
4568
4584
  const e = this.revealedAt;
4569
4585
  return (this.s.messagesByConv[t.id] || []).filter((n) => {
4570
4586
  var a, r, s, o, l;
4571
- return (n == null ? void 0 : n.type) === "action" && ((a = n == null ? void 0 : n.payload) == null ? void 0 : a.state) === "pending" || le(n) && !(e[n.id] > 0) ? !1 : (n == null ? void 0 : n.type) === "action" || (n == null ? void 0 : n.type) === "system" || ((r = n == null ? void 0 : n.payload) == null ? void 0 : r.type) === "system" || Array.isArray((s = n == null ? void 0 : n.payload) == null ? void 0 : s.attachments) && n.payload.attachments.length || (o = n == null ? void 0 : n.metadata) != null && o.artifact || (l = n == null ? void 0 : n.metadata) != null && l.form ? !0 : typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0;
4587
+ return (n == null ? void 0 : n.type) === "action" && ((a = n == null ? void 0 : n.payload) == null ? void 0 : a.state) === "pending" || oe(n) && !(e[n.id] > 0) ? !1 : (n == null ? void 0 : n.type) === "action" || (n == null ? void 0 : n.type) === "system" || ((r = n == null ? void 0 : n.payload) == null ? void 0 : r.type) === "system" || Array.isArray((s = n == null ? void 0 : n.payload) == null ? void 0 : s.attachments) && n.payload.attachments.length || (o = n == null ? void 0 : n.metadata) != null && o.artifact || (l = n == null ? void 0 : n.metadata) != null && l.form ? !0 : typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0;
4572
4588
  });
4573
4589
  },
4574
4590
  // True whenever we should show the "typing" indicator at the bottom
@@ -4578,7 +4594,7 @@ const ha = /* @__PURE__ */ $(na, [["render", ua], ["__scopeId", "data-v-4f4b37c9
4578
4594
  streamingActive() {
4579
4595
  var n, a, r;
4580
4596
  const t = this.currentConv;
4581
- return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => le(s) && !(this.revealedAt[s.id] > 0)) : !1;
4597
+ return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => oe(s) && !(this.revealedAt[s.id] > 0)) : !1;
4582
4598
  },
4583
4599
  // Internal: the raw persisted list for the current conversation. We
4584
4600
  // watch this to detect new agent messages that need to be paced.
@@ -4754,7 +4770,7 @@ const ha = /* @__PURE__ */ $(na, [["render", ua], ["__scopeId", "data-v-4f4b37c9
4754
4770
  async mounted() {
4755
4771
  if (typeof document < "u" && !document.getElementById(we)) {
4756
4772
  const t = document.createElement("style");
4757
- t.id = we, t.textContent = Ve, document.head.appendChild(t);
4773
+ t.id = we, t.textContent = He, document.head.appendChild(t);
4758
4774
  }
4759
4775
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
4760
4776
  },
@@ -5061,7 +5077,7 @@ function Aa(t, e, n, a, r, s) {
5061
5077
  r.isOpen || s.isEmbedded ? (d(), c("section", {
5062
5078
  key: 1,
5063
5079
  class: T(["wm-panel", `wm-panel--${n.displayMode}`]),
5064
- style: K(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
5080
+ style: W(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
5065
5081
  role: "dialog",
5066
5082
  "aria-label": "Messenger"
5067
5083
  }, [
@@ -5072,7 +5088,7 @@ function Aa(t, e, n, a, r, s) {
5072
5088
  class: "wm-loading__close",
5073
5089
  "aria-label": "Réduire",
5074
5090
  onClick: e[0] || (e[0] = (...R) => s.close && s.close(...R))
5075
- }, [...e[7] || (e[7] = [
5091
+ }, [...e[6] || (e[6] = [
5076
5092
  i("svg", {
5077
5093
  width: "13",
5078
5094
  height: "13",
@@ -5087,12 +5103,12 @@ function Aa(t, e, n, a, r, s) {
5087
5103
  i("path", { d: "M18 6L6 18M6 6l12 12" })
5088
5104
  ], -1)
5089
5105
  ])])),
5090
- e[8] || (e[8] = i("div", {
5106
+ e[7] || (e[7] = i("div", {
5091
5107
  class: "wm-loading__spinner",
5092
5108
  "aria-hidden": "true"
5093
5109
  }, null, -1))
5094
5110
  ])) : (d(), c(O, { key: 1 }, [
5095
- W(l, {
5111
+ V(l, {
5096
5112
  title: s.headerTitle,
5097
5113
  escalated: s.isEscalated,
5098
5114
  "agent-name": s.humanAgentName,
@@ -5109,7 +5125,7 @@ function Aa(t, e, n, a, r, s) {
5109
5125
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
5110
5126
  s.error ? (d(), c("div", _a, [
5111
5127
  i("div", pa, [
5112
- e[10] || (e[10] = i("div", { class: "wm-state__errIcon" }, [
5128
+ e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
5113
5129
  i("svg", {
5114
5130
  width: "14",
5115
5131
  height: "14",
@@ -5125,12 +5141,12 @@ function Aa(t, e, n, a, r, s) {
5125
5141
  ])
5126
5142
  ], -1)),
5127
5143
  i("div", null, [
5128
- e[9] || (e[9] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
5144
+ e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
5129
5145
  i("div", ga, b(s.error), 1)
5130
5146
  ])
5131
5147
  ])
5132
5148
  ])) : s.currentConv ? (d(), c(O, { key: 2 }, [
5133
- W(k, {
5149
+ V(k, {
5134
5150
  ref: "messageList",
5135
5151
  messages: s.displayedMessages,
5136
5152
  "streaming-active": s.streamingActive,
@@ -5166,7 +5182,7 @@ function Aa(t, e, n, a, r, s) {
5166
5182
  }, null, 8, ["items", "onSelect"]))
5167
5183
  ], 512)) : w("", !0),
5168
5184
  s.actionInFlight ? (d(), c("div", wa, [
5169
- e[11] || (e[11] = i("span", {
5185
+ e[10] || (e[10] = i("span", {
5170
5186
  class: "wm-actionWait__spinner",
5171
5187
  "aria-hidden": "true"
5172
5188
  }, null, -1)),
@@ -5175,7 +5191,7 @@ function Aa(t, e, n, a, r, s) {
5175
5191
  key: 2,
5176
5192
  ref: "composer",
5177
5193
  modelValue: r.draft,
5178
- "onUpdate:modelValue": e[2] || (e[2] = (R) => r.draft = R),
5194
+ "onUpdate:modelValue": e[1] || (e[1] = (R) => r.draft = R),
5179
5195
  placeholder: s.composerPlaceholder,
5180
5196
  disabled: !!s.pendingApproval,
5181
5197
  "attach-label": "Joindre un fichier",
@@ -5191,7 +5207,7 @@ function Aa(t, e, n, a, r, s) {
5191
5207
  "browser-notif-enabled": t.browserNotifEnabled,
5192
5208
  "status-url": s.statusUrl,
5193
5209
  "help-url": s.helpUrl,
5194
- onClose: e[3] || (e[3] = (R) => r.moreOpen = !1),
5210
+ onClose: e[2] || (e[2] = (R) => r.moreOpen = !1),
5195
5211
  onSoundToggle: t.onSoundToggle,
5196
5212
  onBrowserNotifToggle: t.onBrowserNotifToggle,
5197
5213
  onAction: s.onMoreAction
@@ -5200,7 +5216,7 @@ function Aa(t, e, n, a, r, s) {
5200
5216
  key: 1,
5201
5217
  "initial-value": s.currentConv.name || "",
5202
5218
  title: "Modifier le titre de la conversation",
5203
- onClose: e[4] || (e[4] = (R) => r.renameDialogOpen = !1),
5219
+ onClose: e[3] || (e[3] = (R) => r.renameDialogOpen = !1),
5204
5220
  onSubmit: s.onRenameSubmit
5205
5221
  }, null, 8, ["initial-value", "onSubmit"])) : w("", !0),
5206
5222
  r.pendingAttachments.length ? (d(), c("div", ka, [
@@ -5208,7 +5224,7 @@ function Aa(t, e, n, a, r, s) {
5208
5224
  key: z,
5209
5225
  class: "wm-attached__chip"
5210
5226
  }, [
5211
- e[13] || (e[13] = i("svg", {
5227
+ e[12] || (e[12] = i("svg", {
5212
5228
  width: "11",
5213
5229
  height: "11",
5214
5230
  viewBox: "0 0 24 24",
@@ -5225,8 +5241,8 @@ function Aa(t, e, n, a, r, s) {
5225
5241
  i("button", {
5226
5242
  type: "button",
5227
5243
  "aria-label": "Retirer",
5228
- onClick: (J) => r.pendingAttachments.splice(z, 1)
5229
- }, [...e[12] || (e[12] = [
5244
+ onClick: (X) => r.pendingAttachments.splice(z, 1)
5245
+ }, [...e[11] || (e[11] = [
5230
5246
  i("svg", {
5231
5247
  width: "10",
5232
5248
  height: "10",
@@ -5252,14 +5268,13 @@ function Aa(t, e, n, a, r, s) {
5252
5268
  busy: r.busy,
5253
5269
  onStart: s.startConv,
5254
5270
  onSelect: s.onQuickLink,
5255
- onResume: s.onDrawerPick,
5256
- onViewAll: e[1] || (e[1] = (R) => r.historyOpen = !0)
5271
+ onResume: s.onDrawerPick
5257
5272
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
5258
5273
  r.historyOpen ? (d(), L(U, {
5259
5274
  key: 3,
5260
5275
  conversations: s.drawerConversations,
5261
5276
  "active-id": s.currentConv ? s.currentConv.id : null,
5262
- onClose: e[5] || (e[5] = (R) => r.historyOpen = !1),
5277
+ onClose: e[4] || (e[4] = (R) => r.historyOpen = !1),
5263
5278
  onNew: s.onDrawerNew,
5264
5279
  onPick: s.onDrawerPick
5265
5280
  }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : w("", !0),
@@ -5271,7 +5286,7 @@ function Aa(t, e, n, a, r, s) {
5271
5286
  "browser-notif-enabled": t.browserNotifEnabled,
5272
5287
  "status-url": s.statusUrl,
5273
5288
  "help-url": s.helpUrl,
5274
- onClose: e[6] || (e[6] = (R) => r.moreOpen = !1),
5289
+ onClose: e[5] || (e[5] = (R) => r.moreOpen = !1),
5275
5290
  onSoundToggle: t.onSoundToggle,
5276
5291
  onBrowserNotifToggle: t.onBrowserNotifToggle,
5277
5292
  onAction: s.onMoreAction
@@ -5280,12 +5295,12 @@ function Aa(t, e, n, a, r, s) {
5280
5295
  ], 6)) : w("", !0)
5281
5296
  ], 2);
5282
5297
  }
5283
- const Ta = /* @__PURE__ */ $(ma, [["render", Aa], ["__scopeId", "data-v-29cf778d"]]), Ma = "0.3.7";
5298
+ const Ta = /* @__PURE__ */ $(ma, [["render", Aa], ["__scopeId", "data-v-4567b974"]]), Ma = "0.3.8";
5284
5299
  export {
5285
- ne as AIAvatar,
5286
- ue as AVATAR_COLORS,
5300
+ te as AIAvatar,
5301
+ ce as AVATAR_COLORS,
5287
5302
  $n as ActionResult,
5288
- Vr as ApprovalCard,
5303
+ Hr as ApprovalCard,
5289
5304
  Un as ArtifactFormResponse,
5290
5305
  es as ArtifactInfoCard,
5291
5306
  ys as ArtifactRenderer,
@@ -5293,10 +5308,10 @@ export {
5293
5308
  Is as AttachmentPreview,
5294
5309
  Ds as Bubble,
5295
5310
  Or as Composer,
5296
- He as DEFAULT_BASE_URL,
5311
+ Ve as DEFAULT_BASE_URL,
5297
5312
  xi as Feedback,
5298
5313
  pi as FormCard,
5299
- Wt as Header,
5314
+ Kt as Header,
5300
5315
  Wi as HistoryDrawer,
5301
5316
  he as HumanAvatar,
5302
5317
  At as Launcher,
@@ -5305,7 +5320,7 @@ export {
5305
5320
  Ta as Messenger,
5306
5321
  ta as MoreMenu,
5307
5322
  bn as Onboarding,
5308
- de as SCREEN_CAPTURE_SUPPORTED,
5323
+ le as SCREEN_CAPTURE_SUPPORTED,
5309
5324
  $r as SuggestionChips,
5310
5325
  Nt as TeamAvatars,
5311
5326
  zs as Typing,
@@ -5322,7 +5337,7 @@ export {
5322
5337
  cr as pickRecorderMime,
5323
5338
  Ls as renderMarkdown,
5324
5339
  mr as startScreenRecording,
5325
- Ve as tokensCss,
5340
+ He as tokensCss,
5326
5341
  Ue as uuid,
5327
5342
  Ue as v4
5328
5343
  };