@_solaris/messenger-widget 0.3.3 → 0.3.4

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 N, 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 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";
2
2
  const Ee = [
3
3
  "connected",
4
4
  "message",
@@ -9,7 +9,7 @@ const Ee = [
9
9
  ], fe = "/client", $e = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 5 * 60 * 1e3;
10
10
  function Fe(t) {
11
11
  const e = {
12
- baseUrl: Ne(t.baseUrl || ""),
12
+ baseUrl: De(t.baseUrl || ""),
13
13
  widgetId: t.widgetId || "",
14
14
  userId: t.userId || "",
15
15
  userHash: t.userHash || "",
@@ -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((k) => {
39
+ p && p.forEach((C) => {
40
40
  try {
41
- k(f);
41
+ C(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 k = await fetch(`${e.baseUrl}${fe}${f}`, {
58
+ const C = 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 (!k.ok) {
64
- const T = await d(k), O = new Error(
65
- `HTTP ${k.status} ${h} ${f} :: ${(T == null ? void 0 : T.error) || k.statusText}`
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}`
66
66
  );
67
- throw O.status = k.status, O.body = T, O;
67
+ throw O.status = C.status, O.body = T, O;
68
68
  }
69
- return k.status === 204 ? null : k.json();
69
+ return C.status === 204 ? null : C.json();
70
70
  }
71
71
  async function d(h) {
72
72
  try {
@@ -80,8 +80,8 @@ function Fe(t) {
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 k = await d(p);
84
- throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(k == null ? void 0 : k.error) || p.statusText}`);
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}`);
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 C() {
99
+ async function k() {
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 k = p.toString() ? `?${p.toString()}` : "";
123
+ const C = p.toString() ? `?${p.toString()}` : "";
124
124
  return a(
125
125
  "GET",
126
- `/conversations/${encodeURIComponent(h)}/messages${k}`
126
+ `/conversations/${encodeURIComponent(h)}/messages${C}`
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", k = h.size || 0, T = (
155
+ ), p = h.type || "application/octet-stream", C = 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: k,
159
+ size_bytes: C,
160
160
  name: f
161
161
  })
162
162
  ), O = await fetch(T.upload_url, {
@@ -167,10 +167,10 @@ function Fe(t) {
167
167
  if (!O.ok)
168
168
  throw new Error(`HTTP ${O.status} PUT signed upload`);
169
169
  return {
170
- type: De(p),
170
+ type: Ne(p),
171
171
  path: T.path,
172
172
  mime_type: p,
173
- size_bytes: k
173
+ size_bytes: C
174
174
  };
175
175
  }
176
176
  async function H(h) {
@@ -200,8 +200,8 @@ function Fe(t) {
200
200
  }
201
201
  function Z(h, f) {
202
202
  try {
203
- const p = JSON.parse(f), k = p && typeof p == "object" && "data" in p ? p.data : p;
204
- o(h, k);
203
+ const p = JSON.parse(f), C = p && typeof p == "object" && "data" in p ? p.data : p;
204
+ o(h, C);
205
205
  } catch (p) {
206
206
  console.error("[transport] bad SSE payload", h, p);
207
207
  }
@@ -219,9 +219,9 @@ function Fe(t) {
219
219
  }
220
220
  async function de() {
221
221
  try {
222
- const h = await S(), f = h.reduce((k, T) => {
222
+ const h = await S(), f = h.reduce((C, T) => {
223
223
  const O = T == null ? void 0 : T.last_message_at;
224
- return O && (!k || O > k) ? O : k;
224
+ return O && (!C || O > C) ? O : C;
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) {
@@ -254,8 +254,8 @@ function Fe(t) {
254
254
  e.lastBootstrap = h;
255
255
  try {
256
256
  const f = await S();
257
- e.lastActivityAt = f.reduce((p, k) => {
258
- const T = k == null ? void 0 : k.last_message_at;
257
+ e.lastActivityAt = f.reduce((p, C) => {
258
+ const T = C == null ? void 0 : C.last_message_at;
259
259
  return T && (!p || T > p) ? T : p;
260
260
  }, null);
261
261
  } catch (f) {
@@ -273,7 +273,7 @@ function Fe(t) {
273
273
  setPanelOpen: Q,
274
274
  // REST
275
275
  bootstrap: v,
276
- getCustomer: C,
276
+ getCustomer: k,
277
277
  patchCustomer: w,
278
278
  listConversations: S,
279
279
  createConversation: F,
@@ -290,10 +290,10 @@ function Fe(t) {
290
290
  }
291
291
  };
292
292
  }
293
- function Ne(t) {
293
+ function De(t) {
294
294
  return t.endsWith("/") ? t.slice(0, -1) : t;
295
295
  }
296
- function De(t) {
296
+ function Ne(t) {
297
297
  return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
298
298
  }
299
299
  function je() {
@@ -406,7 +406,7 @@ function Ue(t) {
406
406
  loaded: !0
407
407
  });
408
408
  }
409
- async function C(u) {
409
+ async function k(u) {
410
410
  var h;
411
411
  const m = e.paginationByConv[u];
412
412
  if (!m || m.loading || !m.nextCursor) return;
@@ -417,11 +417,11 @@ function Ue(t) {
417
417
  const f = await t.listMessages(u, {
418
418
  before: g,
419
419
  limit: d
420
- }), p = (f == null ? void 0 : f.messages) ?? [], k = e.messagesByConv[u] || [], T = /* @__PURE__ */ new Set();
421
- for (const I of k)
420
+ }), p = (f == null ? void 0 : f.messages) ?? [], C = e.messagesByConv[u] || [], T = /* @__PURE__ */ new Set();
421
+ for (const I of C)
422
422
  (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
423
  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, ...k], w(u, {
424
+ e.messagesByConv[u] = [...O, ...C], w(u, {
425
425
  nextCursor: (f == null ? void 0 : f.next_cursor) ?? null,
426
426
  loading: !1,
427
427
  loaded: !0
@@ -442,7 +442,7 @@ function Ue(t) {
442
442
  var O;
443
443
  const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
444
444
  if (!u || !h && !f) return;
445
- const p = je(), k = se(u), T = {
445
+ const p = je(), C = se(u), T = {
446
446
  id: p,
447
447
  client_msg_id: p,
448
448
  conversation_id: u,
@@ -452,7 +452,7 @@ function Ue(t) {
452
452
  type: "user",
453
453
  id: ((O = e.customer) == null ? void 0 : O.external_id) || null
454
454
  },
455
- created_at: k,
455
+ created_at: C,
456
456
  // Local-only flag — UI may render dimmed until the SSE echo lands.
457
457
  _pending: !0,
458
458
  ...f ? { payload: { type: "content", attachments: _ } } : {},
@@ -463,7 +463,7 @@ function Ue(t) {
463
463
  await t.postMessage(u, {
464
464
  client_msg_id: p,
465
465
  text_md: h,
466
- created_at: k,
466
+ created_at: C,
467
467
  ...f ? { attachments: _ } : {},
468
468
  ...g && typeof g == "object" ? { metadata: g } : {}
469
469
  });
@@ -523,9 +523,9 @@ function Ue(t) {
523
523
  for (let f = m.length - 1; f >= 0; f--) {
524
524
  const p = m[f];
525
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 k = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
527
- if (k && Array.isArray(k.fields) && k.fields.length > 0)
528
- return { message: p, form: k };
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 };
529
529
  }
530
530
  return null;
531
531
  }
@@ -541,11 +541,11 @@ function Ue(t) {
541
541
  var _, g, h, f;
542
542
  const m = e.messagesByConv[u] || [];
543
543
  for (let p = m.length - 1; p >= 0; p--) {
544
- const k = m[p];
545
- if (((_ = k == null ? void 0 : k.author) == null ? void 0 : _.type) === "user") return [];
546
- if ((k == null ? void 0 : k.type) === "action" && ((g = k == null ? void 0 : k.payload) == null ? void 0 : g.state) === "pending") return [];
547
- if (((h = k == null ? void 0 : k.author) == null ? void 0 : h.type) !== "agent_ia") continue;
548
- const T = (f = k == null ? void 0 : k.metadata) == null ? void 0 : f.suggested_replies;
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;
549
549
  return Array.isArray(T) && T.length ? T.map((O) => {
550
550
  if (typeof O == "string") {
551
551
  const I = O.trim();
@@ -619,7 +619,7 @@ function Ue(t) {
619
619
  applyCustomer: s,
620
620
  createConversation: a,
621
621
  openConversation: v,
622
- loadMore: C,
622
+ loadMore: k,
623
623
  patchConversation: S,
624
624
  send: F,
625
625
  clickCallback: A,
@@ -633,7 +633,7 @@ function Ue(t) {
633
633
  setPanelOpen: t.setPanelOpen
634
634
  };
635
635
  }
636
- const D = {
636
+ const N = {
637
637
  w: "#ffffff",
638
638
  g50: "#F9F9F7",
639
639
  g100: "#F2F1EE",
@@ -665,21 +665,21 @@ const Pe = `
665
665
  .wm-root {
666
666
  --wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
667
667
  --wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
668
- --wm-w: ${D.w};
669
- --wm-g50: ${D.g50};
670
- --wm-g100: ${D.g100};
671
- --wm-g150: ${D.g150};
672
- --wm-g200: ${D.g200};
673
- --wm-g300: ${D.g300};
674
- --wm-g400: ${D.g400};
675
- --wm-g500: ${D.g500};
676
- --wm-g700: ${D.g700};
677
- --wm-g900: ${D.g900};
678
- --wm-a: ${D.accent};
679
- --wm-al: ${D.accentLight};
680
- --wm-green: ${D.green};
681
- --wm-red: ${D.red};
682
- --wm-redBg: ${D.redBg};
668
+ --wm-w: ${N.w};
669
+ --wm-g50: ${N.g50};
670
+ --wm-g100: ${N.g100};
671
+ --wm-g150: ${N.g150};
672
+ --wm-g200: ${N.g200};
673
+ --wm-g300: ${N.g300};
674
+ --wm-g400: ${N.g400};
675
+ --wm-g500: ${N.g500};
676
+ --wm-g700: ${N.g700};
677
+ --wm-g900: ${N.g900};
678
+ --wm-a: ${N.accent};
679
+ --wm-al: ${N.accentLight};
680
+ --wm-green: ${N.green};
681
+ --wm-red: ${N.red};
682
+ --wm-redBg: ${N.redBg};
683
683
  --wm-sh1: 0 1px 3px rgba(0,0,0,.06);
684
684
  --wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
685
685
  --wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
@@ -915,7 +915,7 @@ function ot(t, e, n, o, r, s) {
915
915
  class: "wm-team__stack",
916
916
  style: G({ width: s.stackWidth + "px" })
917
917
  }, [
918
- (l(!0), c(M, null, N(n.members.slice(0, 3), (a, d) => (l(), c("div", {
918
+ (l(!0), c(M, null, D(n.members.slice(0, 3), (a, d) => (l(), c("div", {
919
919
  key: d,
920
920
  class: "wm-team__pill",
921
921
  style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(a) })
@@ -981,7 +981,7 @@ function yt(t, e, n, o, r, s) {
981
981
  type: "button",
982
982
  class: "wm-header__icon",
983
983
  "aria-label": "Retour à l'accueil",
984
- onClick: e[0] || (e[0] = (C) => t.$emit("back"))
984
+ onClick: e[0] || (e[0] = (k) => t.$emit("back"))
985
985
  }, [...e[3] || (e[3] = [
986
986
  i("svg", {
987
987
  width: "13",
@@ -1031,7 +1031,7 @@ function yt(t, e, n, o, r, s) {
1031
1031
  class: E(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
1032
1032
  "aria-label": "Plus d'options",
1033
1033
  title: "Plus d'options",
1034
- onClick: e[1] || (e[1] = (C) => t.$emit("more"))
1034
+ onClick: e[1] || (e[1] = (k) => t.$emit("more"))
1035
1035
  }, [...e[5] || (e[5] = [
1036
1036
  i("svg", {
1037
1037
  width: "13",
@@ -1063,7 +1063,7 @@ function yt(t, e, n, o, r, s) {
1063
1063
  class: "wm-header__icon",
1064
1064
  "aria-label": "Fermer le widget",
1065
1065
  title: "Fermer le widget",
1066
- onClick: e[2] || (e[2] = (C) => t.$emit("close"))
1066
+ onClick: e[2] || (e[2] = (k) => t.$emit("close"))
1067
1067
  }, [...e[6] || (e[6] = [
1068
1068
  i("svg", {
1069
1069
  width: "13",
@@ -1133,7 +1133,7 @@ Je réponds en quelques secondes.`;
1133
1133
  key: 0,
1134
1134
  class: "wm-onb__resume-dot",
1135
1135
  "aria-label": "Non lu"
1136
- }, Nt = { class: "wm-onb__resume-body" }, Dt = { class: "wm-onb__resume-title" }, jt = { class: "wm-onb__resume-preview" }, Ut = { class: "wm-onb__cta" }, Pt = ["disabled"];
1136
+ }, Dt = { class: "wm-onb__resume-body" }, Nt = { class: "wm-onb__resume-title" }, jt = { class: "wm-onb__resume-preview" }, Ut = { class: "wm-onb__cta" }, Pt = ["disabled"];
1137
1137
  function Ht(t, e, n, o, r, s) {
1138
1138
  const a = B("AIAvatar");
1139
1139
  return l(), c("div", kt, [
@@ -1148,11 +1148,11 @@ function Ht(t, e, n, o, r, s) {
1148
1148
  n.quickLinks.length ? (l(), c("div", xt, [
1149
1149
  e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1150
1150
  i("div", Tt, [
1151
- (l(!0), c(M, null, N(n.quickLinks, (d, v) => (l(), c("button", {
1151
+ (l(!0), c(M, null, D(n.quickLinks, (d, v) => (l(), c("button", {
1152
1152
  key: v,
1153
1153
  type: "button",
1154
1154
  class: "wm-onb__link",
1155
- onClick: (C) => t.$emit("select", d)
1155
+ onClick: (k) => t.$emit("select", d)
1156
1156
  }, [
1157
1157
  i("span", Ot, [
1158
1158
  (l(), c("svg", It, [
@@ -1182,7 +1182,7 @@ function Ht(t, e, n, o, r, s) {
1182
1182
  n.openThreads.length ? (l(), c("div", $t, [
1183
1183
  e[7] || (e[7] = i("div", { class: "wm-onb__section-title" }, "Vos conversations", -1)),
1184
1184
  i("div", Lt, [
1185
- (l(!0), c(M, null, N(n.openThreads, (d) => (l(), c("button", {
1185
+ (l(!0), c(M, null, D(n.openThreads, (d) => (l(), c("button", {
1186
1186
  key: d.id,
1187
1187
  type: "button",
1188
1188
  class: "wm-onb__link wm-onb__resume",
@@ -1206,8 +1206,8 @@ function Ht(t, e, n, o, r, s) {
1206
1206
  ], -1)),
1207
1207
  d.unread ? (l(), c("span", Ft)) : y("", !0)
1208
1208
  ], 2),
1209
- i("span", Nt, [
1210
- i("span", Dt, b(d.title), 1),
1209
+ i("span", Dt, [
1210
+ i("span", Nt, b(d.title), 1),
1211
1211
  i("span", jt, b(d.preview), 1)
1212
1212
  ]),
1213
1213
  e[5] || (e[5] = i("svg", {
@@ -1396,7 +1396,7 @@ function dn(t, e, n, o, r, s) {
1396
1396
  ], -1))
1397
1397
  ]),
1398
1398
  i("div", on, [
1399
- (l(!0), c(M, null, N(s.fields, (a, d) => (l(), c("div", {
1399
+ (l(!0), c(M, null, D(s.fields, (a, d) => (l(), c("div", {
1400
1400
  key: d,
1401
1401
  class: "wm-art__field"
1402
1402
  }, [
@@ -1457,7 +1457,7 @@ function kn(t, e, n, o, r, s) {
1457
1457
  ]),
1458
1458
  s.hasBody ? (l(), c("div", yn, [
1459
1459
  n.data.body ? (l(), c("div", wn, b(n.data.body), 1)) : y("", !0),
1460
- s.fields.length ? (l(!0), c(M, { key: 1 }, N(s.fields, (a, d) => (l(), c("div", {
1460
+ s.fields.length ? (l(!0), c(M, { key: 1 }, D(s.fields, (a, d) => (l(), c("div", {
1461
1461
  key: d,
1462
1462
  class: "wm-art__field"
1463
1463
  }, [
@@ -1533,7 +1533,7 @@ const Sn = {
1533
1533
  key: 1,
1534
1534
  class: "wm-art__footer wm-tk__footer"
1535
1535
  };
1536
- function Nn(t, e, n, o, r, s) {
1536
+ function Dn(t, e, n, o, r, s) {
1537
1537
  return l(), c("div", xn, [
1538
1538
  i("div", Tn, [
1539
1539
  i("div", Mn, b(n.data.title), 1),
@@ -1568,7 +1568,7 @@ function Nn(t, e, n, o, r, s) {
1568
1568
  n.data.body ? (l(), c("div", Bn, b(n.data.body), 1)) : y("", !0)
1569
1569
  ]),
1570
1570
  s.fields.length ? (l(), c("div", En, [
1571
- (l(!0), c(M, null, N(s.fields, (a, d) => (l(), c("div", {
1571
+ (l(!0), c(M, null, D(s.fields, (a, d) => (l(), c("div", {
1572
1572
  key: d,
1573
1573
  class: "wm-art__field"
1574
1574
  }, [
@@ -1645,10 +1645,10 @@ function Nn(t, e, n, o, r, s) {
1645
1645
  ])) : y("", !0)
1646
1646
  ]);
1647
1647
  }
1648
- const Dn = /* @__PURE__ */ $(Sn, [["render", Nn], ["__scopeId", "data-v-8b274eb7"]]), jn = {
1648
+ const Nn = /* @__PURE__ */ $(Sn, [["render", Dn], ["__scopeId", "data-v-8b274eb7"]]), jn = {
1649
1649
  form_response: cn,
1650
1650
  info_card: Cn,
1651
- ticket: Dn
1651
+ ticket: Nn
1652
1652
  }, Un = {
1653
1653
  name: "WmArtifactRenderer",
1654
1654
  props: {
@@ -1816,45 +1816,45 @@ function ss(t) {
1816
1816
  const s = e[o];
1817
1817
  if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1818
1818
  o++;
1819
- const C = [];
1819
+ const k = [];
1820
1820
  for (; o < e.length && !/^\s*```\s*$/.test(e[o]); )
1821
- C.push(e[o]), o++;
1821
+ k.push(e[o]), o++;
1822
1822
  o < e.length && o++, n.push({
1823
1823
  type: "block",
1824
- html: `<pre class="wm-md-pre"><code>${C.join(`
1824
+ html: `<pre class="wm-md-pre"><code>${k.join(`
1825
1825
  `)}</code></pre>`
1826
1826
  });
1827
1827
  continue;
1828
1828
  }
1829
1829
  if (/^\s*[-*]\s+/.test(s)) {
1830
- const C = [];
1830
+ const k = [];
1831
1831
  for (; o < e.length; ) {
1832
1832
  const S = /^\s*[-*]\s+(.*)$/.exec(e[o]);
1833
1833
  if (!S) break;
1834
- C.push(S[1]), o++;
1834
+ k.push(S[1]), o++;
1835
1835
  }
1836
- const w = C.map((S) => `<li>${re(S)}</li>`).join("");
1836
+ const w = k.map((S) => `<li>${re(S)}</li>`).join("");
1837
1837
  n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1838
1838
  continue;
1839
1839
  }
1840
1840
  const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1841
1841
  if (d) {
1842
- const C = parseInt(d[1], 10), w = [d[2]];
1842
+ const k = parseInt(d[1], 10), w = [d[2]];
1843
1843
  for (o++; o < e.length; ) {
1844
1844
  const A = /^\s*\d+\.\s+(.*)$/.exec(e[o]);
1845
1845
  if (!A) break;
1846
1846
  w.push(A[1]), o++;
1847
1847
  }
1848
- const S = w.map((A) => `<li>${re(A)}</li>`).join(""), F = C !== 1 ? ` start="${C}"` : "";
1848
+ const S = w.map((A) => `<li>${re(A)}</li>`).join(""), F = k !== 1 ? ` start="${k}"` : "";
1849
1849
  n.push({ type: "block", html: `<ol class="wm-md-ol"${F}>${S}</ol>` });
1850
1850
  continue;
1851
1851
  }
1852
1852
  const v = /^(#{1,6})\s+(.*)$/.exec(s);
1853
1853
  if (v) {
1854
- const C = v[1].length;
1854
+ const k = v[1].length;
1855
1855
  n.push({
1856
1856
  type: "block",
1857
- html: `<h${C} class="wm-md-h wm-md-h${C}">${re(v[2])}</h${C}>`
1857
+ html: `<h${k} class="wm-md-h wm-md-h${k}">${re(v[2])}</h${k}>`
1858
1858
  }), o++;
1859
1859
  continue;
1860
1860
  }
@@ -1998,7 +1998,7 @@ const hs = {
1998
1998
  if (a.role === "system") continue;
1999
1999
  const d = [];
2000
2000
  for (const v of a.messages)
2001
- for (const C of this.itemsOf(v)) d.push(C);
2001
+ for (const k of this.itemsOf(v)) d.push(k);
2002
2002
  a.items = d;
2003
2003
  }
2004
2004
  const e = [];
@@ -2101,9 +2101,9 @@ const hs = {
2101
2101
  }
2102
2102
  if (!r.anchor) return;
2103
2103
  const s = () => {
2104
- var C;
2104
+ var k;
2105
2105
  const a = r.anchor;
2106
- if (!((C = a.el) != null && C.isConnected)) return;
2106
+ if (!((k = a.el) != null && k.isConnected)) return;
2107
2107
  const v = a.el.getBoundingClientRect().top - t.getBoundingClientRect().top - a.relY;
2108
2108
  Math.abs(v) > 0.5 && (t.scrollTop += v);
2109
2109
  };
@@ -2229,9 +2229,9 @@ const hs = {
2229
2229
  // doit garder son arrondi.
2230
2230
  cornersFor(t, e) {
2231
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, 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, Q) => W != null && S != null ? W + U >= S : V === Q || V === "card" && Q === "bubble";
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";
2233
2233
  let j = d, P = d, R = d, H = d;
2234
- return a ? (C && (P = v), (w || !s) && (R = v), C && x(F, C, o == null ? void 0 : o.top) && (j = v), w && x(A, w, o == null ? void 0 : o.bottom) && (H = v)) : (C && (j = v), (w || !s) && (H = v), C && x(F, C, 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 };
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 };
2235
2235
  },
2236
2236
  // Inline style emitting the four corner CSS variables. Set on
2237
2237
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2376,7 +2376,7 @@ const hs = {
2376
2376
  class: "wm-list__row wm-list__row--ai fade-up"
2377
2377
  }, Is = { class: "wm-list__avatarSlot" };
2378
2378
  function Bs(t, e, n, o, r, s) {
2379
- const a = B("AIAvatar"), d = B("HumanAvatar"), v = B("ActionResult"), C = B("ArtifactRenderer"), w = B("Bubble"), S = B("AttachmentPreview"), F = B("Typing");
2379
+ const a = B("AIAvatar"), d = B("HumanAvatar"), v = B("ActionResult"), k = B("ArtifactRenderer"), w = B("Bubble"), S = B("AttachmentPreview"), F = B("Typing");
2380
2380
  return l(), c("div", {
2381
2381
  ref: "scrollEl",
2382
2382
  class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
@@ -2394,7 +2394,7 @@ function Bs(t, e, n, o, r, s) {
2394
2394
  i("span", ys, b(n.dateLabel), 1),
2395
2395
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2396
2396
  ])) : y("", !0),
2397
- (l(!0), c(M, null, N(s.groups, (A, U) => (l(), c(M, {
2397
+ (l(!0), c(M, null, D(s.groups, (A, U) => (l(), c(M, {
2398
2398
  key: A.key
2399
2399
  }, [
2400
2400
  A.key === s.unreadGroupKey ? (l(), c("div", ws, [...e[4] || (e[4] = [
@@ -2411,7 +2411,7 @@ function Bs(t, e, n, o, r, s) {
2411
2411
  i("span", ks, b(A.systemLabel), 1),
2412
2412
  e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2413
2413
  ])) : (l(), c(M, { key: 1 }, [
2414
- (l(!0), c(M, null, N(A.items, (x, j) => (l(), c("div", {
2414
+ (l(!0), c(M, null, D(A.items, (x, j) => (l(), c("div", {
2415
2415
  key: `${s.messageKey(x.message)}-${x.partKey}`,
2416
2416
  "data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
2417
2417
  class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
@@ -2441,10 +2441,10 @@ function Bs(t, e, n, o, r, s) {
2441
2441
  state: "awaiting",
2442
2442
  label: "Demande d'approbation envoyée",
2443
2443
  detail: x.message.text_md || ""
2444
- }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), L(C, {
2444
+ }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), L(k, {
2445
2445
  key: 3,
2446
2446
  artifact: s.actionArtifact(x.message)
2447
- }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), L(C, {
2447
+ }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), L(k, {
2448
2448
  key: 4,
2449
2449
  artifact: s.artifactOf(x.message)
2450
2450
  }, null, 8, ["artifact"])) : (l(), c("div", Ss, [
@@ -2457,7 +2457,7 @@ function Bs(t, e, n, o, r, s) {
2457
2457
  key: 1,
2458
2458
  class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2459
2459
  }, [
2460
- (l(!0), c(M, null, N(s.attachmentsOf(x.message), (P, R) => (l(), L(S, {
2460
+ (l(!0), c(M, null, D(s.attachmentsOf(x.message), (P, R) => (l(), L(S, {
2461
2461
  key: `${s.messageKey(x.message)}-att-${R}`,
2462
2462
  attachment: P
2463
2463
  }, null, 8, ["attachment"]))), 128))
@@ -2534,12 +2534,12 @@ async function Rs(t) {
2534
2534
  const n = e.videoWidth || 1280, o = e.videoHeight || 720, r = document.createElement("canvas");
2535
2535
  r.width = n, r.height = o, r.getContext("2d").drawImage(e, 0, 0, n, o);
2536
2536
  const s = await new Promise((d, v) => {
2537
- r.toBlob((C) => C ? d(C) : v(new Error("toBlob failed")), "image/png");
2537
+ r.toBlob((k) => k ? d(k) : v(new Error("toBlob failed")), "image/png");
2538
2538
  }), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2539
2539
  return new File([s], `capture-${a}.png`, { type: "image/png" });
2540
2540
  }
2541
2541
  async function Fs(t = {}) {
2542
- var C;
2542
+ var k;
2543
2543
  if (!oe || !he) return null;
2544
2544
  let e;
2545
2545
  try {
@@ -2587,7 +2587,7 @@ async function Fs(t = {}) {
2587
2587
  S.stop();
2588
2588
  }), null;
2589
2589
  }
2590
- (C = t.onstart) == null || C.call(t);
2590
+ (k = t.onstart) == null || k.call(t);
2591
2591
  const v = Date.now();
2592
2592
  return s = setInterval(() => {
2593
2593
  var w;
@@ -2599,7 +2599,7 @@ async function Fs(t = {}) {
2599
2599
  }
2600
2600
  };
2601
2601
  }
2602
- const Ns = [
2602
+ const Ds = [
2603
2603
  {
2604
2604
  action: "file",
2605
2605
  label: "Joindre un fichier",
@@ -2615,7 +2615,7 @@ const Ns = [
2615
2615
  label: "Enregistrer l'écran",
2616
2616
  path: "M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"
2617
2617
  }
2618
- ], Ds = {
2618
+ ], Ns = {
2619
2619
  name: "WmComposer",
2620
2620
  props: {
2621
2621
  modelValue: { type: String, default: "" },
@@ -2638,7 +2638,7 @@ const Ns = [
2638
2638
  return !this.disabled && !!this.local.trim();
2639
2639
  },
2640
2640
  attachItems() {
2641
- return Ns.map((t) => ({
2641
+ return Ds.map((t) => ({
2642
2642
  ...t,
2643
2643
  disabled: t.action === "screenshot" && !oe || t.action === "record" && (!oe || !he)
2644
2644
  }));
@@ -2785,7 +2785,7 @@ function Xs(t, e, n, o, r, s) {
2785
2785
  onClick: e[2] || (e[2] = (a) => r.attachOpen = !1)
2786
2786
  })) : y("", !0),
2787
2787
  r.attachOpen ? (l(), c("div", Hs, [
2788
- (l(!0), c(M, null, N(s.attachItems, (a) => (l(), c("button", {
2788
+ (l(!0), c(M, null, D(s.attachItems, (a) => (l(), c("button", {
2789
2789
  key: a.action,
2790
2790
  type: "button",
2791
2791
  class: "wm-compose__menuItem",
@@ -2866,7 +2866,7 @@ function Xs(t, e, n, o, r, s) {
2866
2866
  ], 34)
2867
2867
  ]);
2868
2868
  }
2869
- const Zs = /* @__PURE__ */ $(Ds, [["render", Xs], ["__scopeId", "data-v-14fa9ec0"]]), Qs = {
2869
+ const Zs = /* @__PURE__ */ $(Ns, [["render", Xs], ["__scopeId", "data-v-14fa9ec0"]]), Qs = {
2870
2870
  name: "WmSuggestionChips",
2871
2871
  props: {
2872
2872
  items: { type: Array, default: () => [] },
@@ -2889,7 +2889,7 @@ function tr(t, e, n, o, r, s) {
2889
2889
  key: s.batchKey,
2890
2890
  class: "wm-chips"
2891
2891
  }, [
2892
- (l(!0), c(M, null, N(n.items, (a, d) => (l(), c("button", {
2892
+ (l(!0), c(M, null, D(n.items, (a, d) => (l(), c("button", {
2893
2893
  key: d,
2894
2894
  type: "button",
2895
2895
  class: "wm-chip",
@@ -3070,11 +3070,11 @@ const mr = /* @__PURE__ */ new Set([
3070
3070
  key: 0,
3071
3071
  class: "wm-form__spinner",
3072
3072
  "aria-hidden": "true"
3073
- }, Nr = {
3073
+ }, Dr = {
3074
3074
  key: 2,
3075
3075
  class: "wm-form__doneLbl"
3076
3076
  };
3077
- function Dr(t, e, n, o, r, s) {
3077
+ function Nr(t, e, n, o, r, s) {
3078
3078
  const a = B("AIAvatar");
3079
3079
  return l(), c("div", _r, [
3080
3080
  i("div", pr, [
@@ -3090,7 +3090,7 @@ function Dr(t, e, n, o, r, s) {
3090
3090
  class: "wm-form__body",
3091
3091
  onSubmit: e[0] || (e[0] = X((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
3092
3092
  }, [
3093
- (l(!0), c(M, null, N(s.normalizedFields, (d) => (l(), c("div", {
3093
+ (l(!0), c(M, null, D(s.normalizedFields, (d) => (l(), c("div", {
3094
3094
  key: d.key,
3095
3095
  class: "wm-form__field"
3096
3096
  }, [
@@ -3168,14 +3168,14 @@ function Dr(t, e, n, o, r, s) {
3168
3168
  disabled: n.readOnly || r.busy
3169
3169
  }, [
3170
3170
  i("option", Ir, b(d.placeholder || "Choisir…"), 1),
3171
- (l(!0), c(M, null, N(d.options, (v) => (l(), c("option", {
3171
+ (l(!0), c(M, null, D(d.options, (v) => (l(), c("option", {
3172
3172
  key: v.value,
3173
3173
  value: v.value
3174
3174
  }, b(v.label), 9, Br))), 128))
3175
3175
  ], 8, Or)), [
3176
3176
  [Be, r.values[d.key]]
3177
3177
  ]) : d.type === "multiselect" ? (l(), c("div", Er, [
3178
- (l(!0), c(M, null, N(d.options, (v) => (l(), c("label", {
3178
+ (l(!0), c(M, null, D(d.options, (v) => (l(), c("label", {
3179
3179
  key: v.value,
3180
3180
  class: "wm-form__multiItem"
3181
3181
  }, [
@@ -3184,14 +3184,14 @@ function Dr(t, e, n, o, r, s) {
3184
3184
  value: v.value,
3185
3185
  checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
3186
3186
  disabled: n.readOnly || r.busy,
3187
- onChange: (C) => s.toggleMulti(d.key, v.value, C.target.checked)
3187
+ onChange: (k) => s.toggleMulti(d.key, v.value, k.target.checked)
3188
3188
  }, null, 40, $r),
3189
3189
  i("span", null, b(v.label), 1)
3190
3190
  ]))), 128))
3191
3191
  ])) : y("", !0)
3192
3192
  ]))), 128)),
3193
3193
  r.error ? (l(), c("div", Lr, b(r.error), 1)) : y("", !0),
3194
- n.readOnly ? (l(), c("div", Nr, "Réponse envoyée")) : (l(), c("button", {
3194
+ n.readOnly ? (l(), c("div", Dr, "Réponse envoyée")) : (l(), c("button", {
3195
3195
  key: 1,
3196
3196
  type: "submit",
3197
3197
  class: "wm-form__submit",
@@ -3203,7 +3203,7 @@ function Dr(t, e, n, o, r, s) {
3203
3203
  ], 32)
3204
3204
  ]);
3205
3205
  }
3206
- const jr = /* @__PURE__ */ $(fr, [["render", Dr], ["__scopeId", "data-v-64b40f76"]]), Ur = {
3206
+ const jr = /* @__PURE__ */ $(fr, [["render", Nr], ["__scopeId", "data-v-64b40f76"]]), Ur = {
3207
3207
  name: "WmFeedback",
3208
3208
  props: {
3209
3209
  busy: { type: Boolean, default: !1 },
@@ -3239,7 +3239,7 @@ function Gr(t, e, n, o, r, s) {
3239
3239
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
3240
3240
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
3241
3241
  i("div", Hr, [
3242
- (l(!0), c(M, null, N(r.options, (a) => (l(), c("button", {
3242
+ (l(!0), c(M, null, D(r.options, (a) => (l(), c("button", {
3243
3243
  key: a.v,
3244
3244
  type: "button",
3245
3245
  class: E(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
@@ -3413,13 +3413,13 @@ function _i(t, e, n, o, r, s) {
3413
3413
  ])
3414
3414
  ]),
3415
3415
  i("div", si, [
3416
- (l(!0), c(M, null, N(s.groups, (a) => (l(), c(M, {
3416
+ (l(!0), c(M, null, D(s.groups, (a) => (l(), c(M, {
3417
3417
  key: a.key
3418
3418
  }, [
3419
3419
  a.items.length ? (l(), c("div", ri, [
3420
3420
  i("div", ii, b(a.label), 1),
3421
3421
  i("div", ai, [
3422
- (l(!0), c(M, null, N(a.items, (d) => (l(), c("button", {
3422
+ (l(!0), c(M, null, D(a.items, (d) => (l(), c("button", {
3423
3423
  key: d.id,
3424
3424
  type: "button",
3425
3425
  class: E(["wm-hd__row", {
@@ -3748,7 +3748,7 @@ function le(t, e) {
3748
3748
  const n = t.options.find((o) => (o == null ? void 0 : o.value) === e);
3749
3749
  return (n == null ? void 0 : n.label) || e;
3750
3750
  }
3751
- function Ni(t, e) {
3751
+ function Di(t, e) {
3752
3752
  const n = [], o = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3753
3753
  for (const r of o) {
3754
3754
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3770,7 +3770,7 @@ function Ni(t, e) {
3770
3770
  }
3771
3771
  };
3772
3772
  }
3773
- const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3773
+ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3774
3774
  name: "Messenger",
3775
3775
  components: {
3776
3776
  Launcher: Ge,
@@ -3880,6 +3880,12 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3880
3880
  // unread dot in the history drawer survives reloads. The server
3881
3881
  // has no per-customer read model, so this is purely client-side.
3882
3882
  readState: {},
3883
+ // ISO timestamp captured the first time this client boots on a
3884
+ // device (no prior `readState` in localStorage). Used as the floor
3885
+ // for conversations with no explicit read entry, so opening the
3886
+ // messenger on a fresh browser doesn't mark every historical
3887
+ // thread as unread.
3888
+ readBootTs: "",
3883
3889
  // ISO timestamp frozen at the moment the user *started viewing*
3884
3890
  // the current thread (panel open + thread visible). Drives the
3885
3891
  // "Non lus" separator inside the MessageList: messages newer than
@@ -3962,11 +3968,11 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3962
3968
  // so both are derived client-side from the cached messages + the
3963
3969
  // local `readState`.
3964
3970
  drawerConversations() {
3965
- var n;
3966
- const t = this.readState, e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
3967
- return this.allConversations.map((o) => {
3968
- const r = e[o.id] || [], s = this.convLastActivity(o, r), a = t[o.id] || "", d = this.lastMessageAuthorType(r), v = !!s && d !== "user" && (!a || s > a);
3969
- return { ...o, _preview: this.convPreview(o, r), _unread: v };
3971
+ var o;
3972
+ const t = this.readState, e = this.readBootTs, n = ((o = this.s) == null ? void 0 : o.messagesByConv) || {};
3973
+ 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 };
3970
3976
  });
3971
3977
  },
3972
3978
  // How many threads have an unseen agent/human message. Drives the
@@ -4164,7 +4170,7 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4164
4170
  const e = (v = (d = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
4165
4171
  if (!e || typeof e != "object") return "";
4166
4172
  const n = Object.entries(e);
4167
- return n.length ? n.slice(0, 2).map(([C, w]) => `${C}: ${w}`).join(" · ") : "";
4173
+ return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
4168
4174
  },
4169
4175
  actionInFlight() {
4170
4176
  var t, e;
@@ -4414,13 +4420,20 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4414
4420
  const t = this.widgetId || "", e = this.userId || "";
4415
4421
  return `wm:read:${t}:${e}`;
4416
4422
  },
4423
+ readBootStorageKey() {
4424
+ const t = this.widgetId || "", e = this.userId || "";
4425
+ return `wm:read-boot:${t}:${e}`;
4426
+ },
4417
4427
  hydrateReadState() {
4418
4428
  try {
4419
4429
  if (typeof localStorage > "u") return;
4420
4430
  const t = localStorage.getItem(this.readStorageKey());
4421
- if (!t) return;
4422
- const e = JSON.parse(t);
4423
- e && typeof e == "object" && (this.readState = e);
4431
+ if (t) {
4432
+ const n = JSON.parse(t);
4433
+ n && typeof n == "object" && (this.readState = n);
4434
+ }
4435
+ let e = localStorage.getItem(this.readBootStorageKey()) || "";
4436
+ e || (e = (/* @__PURE__ */ new Date()).toISOString(), localStorage.setItem(this.readBootStorageKey(), e)), this.readBootTs = e;
4424
4437
  } catch {
4425
4438
  }
4426
4439
  },
@@ -4474,12 +4487,12 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4474
4487
  Pi,
4475
4488
  Math.max(Ui, n * ji)
4476
4489
  ), s = Math.max(
4477
- e + Di,
4490
+ e + Ni,
4478
4491
  this.nextRevealAt + Hi
4479
4492
  ) + o;
4480
4493
  this.nextRevealAt = s;
4481
4494
  const a = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
4482
- this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((C) => C !== v);
4495
+ this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((k) => k !== v);
4483
4496
  }, a);
4484
4497
  this.revealTimers.push(v);
4485
4498
  },
@@ -4741,7 +4754,7 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4741
4754
  }
4742
4755
  },
4743
4756
  exportCurrentConv() {
4744
- var r, s, a, d, v, C;
4757
+ var r, s, a, d, v, k;
4745
4758
  const t = this.currentConv;
4746
4759
  if (!t) return;
4747
4760
  const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
@@ -4751,7 +4764,7 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4751
4764
  ];
4752
4765
  for (const w of e) {
4753
4766
  if (!w) continue;
4754
- 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" : ((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();
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();
4755
4768
  A && (n.push(`[${F}] ${S} :`), n.push(A), n.push(""));
4756
4769
  }
4757
4770
  const o = new Blob([n.join(`
@@ -4791,7 +4804,7 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4791
4804
  let o = this.currentConv;
4792
4805
  o && (o._draft && (o = await this.ensureRealConv(), !o) || await this.store.send(o.id, n, {
4793
4806
  metadata: {
4794
- artifact: Ni(e.form, t)
4807
+ artifact: Di(e.form, t)
4795
4808
  }
4796
4809
  }));
4797
4810
  },
@@ -4857,7 +4870,7 @@ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4857
4870
  class: "wm-attached"
4858
4871
  }, Qi = ["onClick"];
4859
4872
  function ea(t, e, n, o, r, s) {
4860
- const a = B("Launcher"), d = B("Header"), v = 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");
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");
4861
4874
  return l(), c("div", {
4862
4875
  class: E(["wm-root", `wm-root--${n.displayMode}`])
4863
4876
  }, [
@@ -4940,7 +4953,7 @@ function ea(t, e, n, o, r, s) {
4940
4953
  ])
4941
4954
  ])
4942
4955
  ])) : s.currentConv ? (l(), c(M, { key: 2 }, [
4943
- K(C, {
4956
+ K(k, {
4944
4957
  ref: "messageList",
4945
4958
  messages: s.displayedMessages,
4946
4959
  "streaming-active": s.streamingActive,
@@ -5012,7 +5025,7 @@ function ea(t, e, n, o, r, s) {
5012
5025
  onSubmit: s.onRenameSubmit
5013
5026
  }, null, 8, ["initial-value", "onSubmit"])) : y("", !0),
5014
5027
  r.pendingAttachments.length ? (l(), c("div", Zi, [
5015
- (l(!0), c(M, null, N(r.pendingAttachments, (R, H) => (l(), c("div", {
5028
+ (l(!0), c(M, null, D(r.pendingAttachments, (R, H) => (l(), c("div", {
5016
5029
  key: H,
5017
5030
  class: "wm-attached__chip"
5018
5031
  }, [
@@ -5086,7 +5099,7 @@ function ea(t, e, n, o, r, s) {
5086
5099
  ], 6)) : y("", !0)
5087
5100
  ], 2);
5088
5101
  }
5089
- const sa = /* @__PURE__ */ $(zi, [["render", ea], ["__scopeId", "data-v-5889aa58"]]), ra = "0.3.3";
5102
+ const sa = /* @__PURE__ */ $(zi, [["render", ea], ["__scopeId", "data-v-e5f17e35"]]), ra = "0.3.4";
5090
5103
  export {
5091
5104
  ne as AIAvatar,
5092
5105
  ce as AVATAR_COLORS,
@@ -5095,7 +5108,7 @@ export {
5095
5108
  cn as ArtifactFormResponse,
5096
5109
  Cn as ArtifactInfoCard,
5097
5110
  Hn as ArtifactRenderer,
5098
- Dn as ArtifactTicket,
5111
+ Nn as ArtifactTicket,
5099
5112
  es as AttachmentPreview,
5100
5113
  os as Bubble,
5101
5114
  Zs as Composer,
@@ -5119,7 +5132,7 @@ export {
5119
5132
  ye as avatarColor,
5120
5133
  we as avatarInitials,
5121
5134
  Ls as captureScreenshotFile,
5122
- D as colors,
5135
+ N as colors,
5123
5136
  Ue as createStore,
5124
5137
  Fe as createTransport,
5125
5138
  sa as default,