@_solaris/messenger-widget 0.3.9 → 0.3.11

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