@_solaris/messenger-widget 0.2.21 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/messenger.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reactive as Ae, openBlock as l, createElementBlock as d, createVNode as z, Transition as Se, withCtx as xe, withKeys as me, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as w, normalizeStyle as V, normalizeClass as E, Fragment as M, renderList as j, resolveComponent as O, createBlock as R, createTextVNode as ie, resolveDynamicComponent as Me, renderSlot as Te, withDirectives as H, vModelText as Y, vModelCheckbox as Ie, vModelSelect as Oe, createStaticVNode as ue, markRaw as fe } from "vue";
1
+ import { reactive as Ae, openBlock as l, createElementBlock as d, createVNode as K, Transition as Se, withCtx as xe, withKeys as me, withModifiers as ee, createElementVNode as i, toDisplayString as b, createCommentVNode as w, normalizeStyle as G, normalizeClass as E, Fragment as M, renderList as j, resolveComponent as I, createBlock as $, createTextVNode as oe, resolveDynamicComponent as Me, renderSlot as Te, withDirectives as W, vModelText as Q, vModelCheckbox as Oe, vModelSelect as Ie, createStaticVNode as ue, markRaw as fe } from "vue";
2
2
  const Ee = [
3
3
  "connected",
4
4
  "message",
@@ -6,8 +6,8 @@ const Ee = [
6
6
  "conversation_updated",
7
7
  "config_updated",
8
8
  "action_status"
9
- ], Be = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 5 * 60 * 1e3;
10
- function $e(t) {
9
+ ], Be = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, $e = 5 * 60 * 1e3;
10
+ function Re(t) {
11
11
  const e = {
12
12
  baseUrl: Fe(t.baseUrl || ""),
13
13
  widgetId: t.widgetId || "",
@@ -35,12 +35,12 @@ function $e(t) {
35
35
  return e.listeners.has(h) || e.listeners.set(h, /* @__PURE__ */ new Set()), e.listeners.get(h).add(f), () => e.listeners.get(h).delete(f);
36
36
  }
37
37
  function a(h, f) {
38
- const _ = e.listeners.get(h);
39
- _ && _.forEach((C) => {
38
+ const p = e.listeners.get(h);
39
+ p && p.forEach((C) => {
40
40
  try {
41
41
  C(f);
42
- } catch (I) {
43
- console.error("[transport] listener", h, I);
42
+ } catch (O) {
43
+ console.error("[transport] listener", h, O);
44
44
  }
45
45
  });
46
46
  }
@@ -54,17 +54,17 @@ function $e(t) {
54
54
  "X-Widget-Id": e.widgetId
55
55
  };
56
56
  }
57
- async function o(h, f, _) {
57
+ async function o(h, f, p) {
58
58
  const C = await fetch(`${e.baseUrl}${f}`, {
59
59
  method: h,
60
60
  headers: { "Content-Type": "application/json", ...s() },
61
- body: _ !== void 0 ? JSON.stringify(_) : void 0
61
+ body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
63
  if (!C.ok) {
64
- const I = await c(C), T = new Error(
65
- `HTTP ${C.status} ${h} ${f} :: ${(I == null ? void 0 : I.error) || C.statusText}`
64
+ const O = await c(C), T = new Error(
65
+ `HTTP ${C.status} ${h} ${f} :: ${(O == null ? void 0 : O.error) || C.statusText}`
66
66
  );
67
- throw T.status = C.status, T.body = I, T;
67
+ throw T.status = C.status, T.body = O, T;
68
68
  }
69
69
  return C.status === 204 ? null : C.json();
70
70
  }
@@ -78,12 +78,12 @@ function $e(t) {
78
78
  async function v() {
79
79
  const [h, f] = await Promise.all([
80
80
  // Public — no HMAC required.
81
- fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (_) => {
82
- if (!_.ok) {
83
- const C = await c(_);
84
- throw new Error(`HTTP ${_.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || _.statusText}`);
81
+ fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
82
+ if (!p.ok) {
83
+ const C = await c(p);
84
+ throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || p.statusText}`);
85
85
  }
86
- return _.json();
86
+ return p.json();
87
87
  }),
88
88
  // HMAC-protected.
89
89
  o("GET", "/customers/me")
@@ -100,7 +100,7 @@ function $e(t) {
100
100
  const h = await o("GET", "/customers/me");
101
101
  return (h == null ? void 0 : h.customer) ?? null;
102
102
  }
103
- async function y(h) {
103
+ async function g(h) {
104
104
  const f = await o("PATCH", "/customers/me", h);
105
105
  return (f == null ? void 0 : f.customer) ?? null;
106
106
  }
@@ -108,78 +108,78 @@ function $e(t) {
108
108
  const h = await o("GET", "/conversations");
109
109
  return (h == null ? void 0 : h.conversations) ?? [];
110
110
  }
111
- async function $(h = {}) {
111
+ async function R(h = {}) {
112
112
  return (await o("POST", "/conversations", h)).conversation;
113
113
  }
114
114
  async function A(h) {
115
115
  return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
116
116
  }
117
- async function D(h, f) {
117
+ async function P(h, f) {
118
118
  return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
119
119
  }
120
120
  async function x(h, f = {}) {
121
- const _ = new URLSearchParams();
122
- f.before && _.set("before", f.before), f.since && _.set("since", f.since), f.limit && _.set("limit", String(f.limit));
123
- const C = _.toString() ? `?${_.toString()}` : "";
121
+ 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 C = p.toString() ? `?${p.toString()}` : "";
124
124
  return o(
125
125
  "GET",
126
126
  `/conversations/${encodeURIComponent(h)}/messages${C}`
127
127
  );
128
128
  }
129
- async function N(h, f) {
130
- K();
131
- const _ = {
129
+ async function D(h, f) {
130
+ z();
131
+ const p = {
132
132
  client_msg_id: f.client_msg_id,
133
133
  type: "content",
134
134
  text_md: f.text_md,
135
135
  author: { id: e.userId, type: "user" },
136
136
  created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
137
137
  };
138
- return Array.isArray(f.attachments) && f.attachments.length && (_.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (_.metadata = f.metadata), o(
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(
139
139
  "POST",
140
140
  `/conversations/${encodeURIComponent(h)}/messages`,
141
- _
141
+ p
142
142
  );
143
143
  }
144
- async function F(h, f, _) {
145
- return K(), o(
144
+ async function F(h, f, p) {
145
+ return z(), o(
146
146
  "POST",
147
147
  `/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
148
- _ ? { inputs: _ } : {}
148
+ p ? { inputs: p } : {}
149
149
  );
150
150
  }
151
- async function P(h) {
151
+ async function N(h) {
152
152
  const f = (
153
153
  /** @type {File} */
154
154
  h.name || "attachment"
155
- ), _ = h.type || "application/octet-stream", C = h.size || 0, I = (
155
+ ), p = h.type || "application/octet-stream", C = h.size || 0, O = (
156
156
  /** @type {import('./types.js').AttachmentUploadTicket} */
157
157
  await o("POST", "/attachments", {
158
- mime_type: _,
158
+ mime_type: p,
159
159
  size_bytes: C,
160
160
  name: f
161
161
  })
162
- ), T = await fetch(I.upload_url, {
162
+ ), T = await fetch(O.upload_url, {
163
163
  method: "PUT",
164
- headers: { "Content-Type": _ },
164
+ headers: { "Content-Type": p },
165
165
  body: h
166
166
  });
167
167
  if (!T.ok)
168
168
  throw new Error(`HTTP ${T.status} PUT signed upload`);
169
169
  return {
170
- type: je(_),
171
- path: I.path,
172
- mime_type: _,
170
+ type: je(p),
171
+ path: O.path,
172
+ mime_type: p,
173
173
  size_bytes: C
174
174
  };
175
175
  }
176
- async function q(h) {
176
+ async function V(h) {
177
177
  return o(
178
178
  "GET",
179
179
  `/attachments/sign?path=${encodeURIComponent(h)}`
180
180
  );
181
181
  }
182
- function W() {
182
+ function Y() {
183
183
  const h = new URLSearchParams({
184
184
  userId: e.userId,
185
185
  userHash: e.userHash,
@@ -187,48 +187,48 @@ function $e(t) {
187
187
  }).toString();
188
188
  return `${e.baseUrl}/stream?${h}`;
189
189
  }
190
- function G() {
190
+ function H() {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
- const h = new EventSource(W());
193
+ const h = new EventSource(Y());
194
194
  for (const f of Ee)
195
- h.addEventListener(f, (_) => ae(f, _.data));
195
+ h.addEventListener(f, (p) => J(f, p.data));
196
196
  h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
197
197
  } catch (h) {
198
198
  console.error("[transport] SSE open failed", h), a("error", h);
199
199
  }
200
200
  }
201
- function ae(h, f) {
201
+ function J(h, f) {
202
202
  try {
203
- const _ = JSON.parse(f), C = _ && typeof _ == "object" && "data" in _ ? _.data : _;
203
+ const p = JSON.parse(f), C = p && typeof p == "object" && "data" in p ? p.data : p;
204
204
  a(h, C);
205
- } catch (_) {
206
- console.error("[transport] bad SSE payload", h, _);
205
+ } catch (p) {
206
+ console.error("[transport] bad SSE payload", h, p);
207
207
  }
208
208
  }
209
- function J() {
209
+ function q() {
210
210
  e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
211
211
  }
212
- function K() {
213
- clearTimeout(e.burstTimer), G(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
- e.panelOpen || J();
212
+ function z() {
213
+ clearTimeout(e.burstTimer), H(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
+ e.panelOpen || q();
215
215
  }, Le));
216
216
  }
217
- function oe(h) {
218
- e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), G()) : K();
217
+ function X(h) {
218
+ e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), H()) : z();
219
219
  }
220
220
  async function le() {
221
221
  try {
222
- const h = await S(), f = h.reduce((C, I) => {
223
- const T = I == null ? void 0 : I.last_message_at;
222
+ const h = await S(), f = h.reduce((C, O) => {
223
+ const T = O == null ? void 0 : O.last_message_at;
224
224
  return T && (!C || T > C) ? T : C;
225
225
  }, null);
226
- f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), K());
226
+ f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), z());
227
227
  } catch (h) {
228
228
  console.error("[transport] poll failed", h);
229
229
  }
230
230
  }
231
- function Z() {
231
+ function ne() {
232
232
  u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(le, Be));
233
233
  }
234
234
  function u() {
@@ -237,53 +237,53 @@ function $e(t) {
237
237
  function m() {
238
238
  if (document.hidden)
239
239
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
240
- e.hiddenGraceTimer = null, document.hidden && (u(), J(), r("paused"));
241
- }, Re);
240
+ e.hiddenGraceTimer = null, document.hidden && (u(), q(), r("paused"));
241
+ }, $e);
242
242
  else {
243
243
  if (e.hiddenGraceTimer) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
245
245
  return;
246
246
  }
247
- r("idle"), Z(), e.panelOpen && G();
247
+ r("idle"), ne(), e.panelOpen && H();
248
248
  }
249
249
  }
250
- async function p() {
250
+ async function _() {
251
251
  if (e.started) return e.lastBootstrap;
252
252
  e.started = !0;
253
253
  const h = await v();
254
254
  e.lastBootstrap = h;
255
255
  try {
256
256
  const f = await S();
257
- e.lastActivityAt = f.reduce((_, C) => {
258
- const I = C == null ? void 0 : C.last_message_at;
259
- return I && (!_ || I > _) ? I : _;
257
+ e.lastActivityAt = f.reduce((p, C) => {
258
+ const O = C == null ? void 0 : C.last_message_at;
259
+ return O && (!p || O > p) ? O : p;
260
260
  }, null);
261
261
  } catch (f) {
262
262
  console.error("[transport] initial /conversations failed", f);
263
263
  }
264
- return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), Z(), h;
264
+ return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), ne(), h;
265
265
  }
266
- function g() {
267
- u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, J(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
266
+ function y() {
267
+ u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, q(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
268
268
  }
269
269
  return {
270
270
  on: n,
271
- start: p,
272
- stop: g,
273
- setPanelOpen: oe,
271
+ start: _,
272
+ stop: y,
273
+ setPanelOpen: X,
274
274
  // REST
275
275
  bootstrap: v,
276
276
  getCustomer: k,
277
- patchCustomer: y,
277
+ patchCustomer: g,
278
278
  listConversations: S,
279
- createConversation: $,
279
+ createConversation: R,
280
280
  getConversation: A,
281
- patchConversation: D,
281
+ patchConversation: P,
282
282
  listMessages: x,
283
- postMessage: N,
283
+ postMessage: D,
284
284
  postCallback: F,
285
- uploadAttachment: P,
286
- signAttachment: q,
285
+ uploadAttachment: N,
286
+ signAttachment: V,
287
287
  // Read-only state
288
288
  get connection() {
289
289
  return e.connection;
@@ -343,30 +343,30 @@ function De(t) {
343
343
  n.push(t.on("connection", (u) => {
344
344
  e.connection = u;
345
345
  })), n.push(t.on("message", (u) => {
346
- const m = u == null ? void 0 : u.conversation_id, p = u == null ? void 0 : u.message;
347
- !m || !(p != null && p.id) || (G(m, p), p.client_msg_id && delete e.streamingByMsgId[p.client_msg_id], K(m, p.created_at));
346
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
347
+ !m || !(_ != null && _.id) || (H(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], z(m, _.created_at));
348
348
  })), n.push(t.on("message_stream", (u) => {
349
- const m = u == null ? void 0 : u.message_id, p = u == null ? void 0 : u.token;
350
- !m || typeof p != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + p);
349
+ const m = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
350
+ !m || typeof _ != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + _);
351
351
  })), n.push(t.on("conversation_updated", (u) => {
352
- const m = u == null ? void 0 : u.conversation_id, p = u == null ? void 0 : u.changes;
353
- if (!m || !p) return;
354
- const g = e.conversations.findIndex((h) => h.id === m);
355
- g !== -1 && (e.conversations[g] = { ...e.conversations[g], ...p });
352
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
353
+ if (!m || !_) return;
354
+ const y = e.conversations.findIndex((h) => h.id === m);
355
+ y !== -1 && (e.conversations[y] = { ...e.conversations[y], ..._ });
356
356
  })), n.push(t.on("config_updated", (u) => {
357
357
  u != null && u.config && (e.config = u.config);
358
358
  })), n.push(t.on("action_status", (u) => {
359
- const m = u == null ? void 0 : u.conversation_id, p = u == null ? void 0 : u.action_id, g = u == null ? void 0 : u.action_name;
360
- if (!m || !p) return;
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
361
  const h = e.runningActionsByConv[m] || {};
362
- u.state === "running" ? (h[p] = g || p, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[p], e.runningActionsByConv[m] = { ...h });
362
+ u.state === "running" ? (h[_] = y || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
363
363
  })), n.push(t.on("activity", (u) => {
364
364
  Array.isArray(u == null ? void 0 : u.conversations) && (e.conversations = u.conversations);
365
365
  }));
366
366
  async function a() {
367
367
  try {
368
368
  const u = new Promise(
369
- (p, g) => setTimeout(() => g(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
369
+ (_, y) => setTimeout(() => y(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
370
370
  ), m = await Promise.race([t.start(), u]);
371
371
  e.config = m.config, e.customer = m.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
372
372
  } catch (u) {
@@ -385,22 +385,22 @@ function De(t) {
385
385
  const m = le(u);
386
386
  if (!m) return e.customer;
387
387
  try {
388
- const p = await t.patchCustomer(m);
389
- p && (e.customer = p);
390
- } catch (p) {
391
- console.error("[store] applyCustomer failed", p);
388
+ const _ = await t.patchCustomer(m);
389
+ _ && (e.customer = _);
390
+ } catch (_) {
391
+ console.error("[store] applyCustomer failed", _);
392
392
  }
393
393
  return e.customer;
394
394
  }
395
395
  async function o(u = {}) {
396
- const m = await t.createConversation(u), p = e.conversations.findIndex((g) => g.id === m.id);
397
- return p === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[p] = m, m;
396
+ const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.id === m.id);
397
+ return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
398
398
  }
399
399
  const c = 50;
400
400
  async function v(u) {
401
401
  if (e.messagesByConv[u]) return;
402
402
  const m = await t.listMessages(u, { limit: c });
403
- e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], y(u, {
403
+ e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], g(u, {
404
404
  nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
405
405
  loading: !1,
406
406
  loaded: !0
@@ -409,41 +409,41 @@ function De(t) {
409
409
  async function k(u) {
410
410
  const m = e.paginationByConv[u];
411
411
  if (!(!m || m.loading || !m.nextCursor)) {
412
- y(u, { ...m, loading: !0 });
412
+ g(u, { ...m, loading: !0 });
413
413
  try {
414
- let h = m.nextCursor, f = [], _ = 0;
415
- for (; _ < 6 && h; _++) {
414
+ let h = m.nextCursor, f = [], p = 0;
415
+ for (; p < 6 && h; p++) {
416
416
  const L = await t.listMessages(u, {
417
417
  before: h,
418
418
  limit: c
419
- }), ee = (L == null ? void 0 : L.messages) ?? [];
420
- if (f = [...ee, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !ee.length || f.length >= 60) break;
419
+ }), se = (L == null ? void 0 : L.messages) ?? [];
420
+ if (f = [...se, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !se.length || f.length >= 60) break;
421
421
  }
422
- const C = e.messagesByConv[u] || [], I = new Set(C.map((L) => String(L == null ? void 0 : L.id))), T = [...f.filter((L) => !I.has(String(L == null ? void 0 : L.id))), ...C];
423
- e.messagesByConv[u] = T, y(u, {
422
+ const C = e.messagesByConv[u] || [], O = new Set(C.map((L) => String(L == null ? void 0 : L.id))), T = [...f.filter((L) => !O.has(String(L == null ? void 0 : L.id))), ...C];
423
+ e.messagesByConv[u] = T, g(u, {
424
424
  nextCursor: h,
425
425
  loading: !1,
426
426
  loaded: !0
427
427
  });
428
- } catch (p) {
429
- console.error("[store] loadMore failed", p), y(u, { ...m, loading: !1 });
428
+ } catch (_) {
429
+ console.error("[store] loadMore failed", _), g(u, { ...m, loading: !1 });
430
430
  }
431
431
  }
432
432
  }
433
- function y(u, m) {
433
+ function g(u, m) {
434
434
  e.paginationByConv = { ...e.paginationByConv, [u]: m };
435
435
  }
436
436
  async function S(u, m) {
437
- const p = await t.patchConversation(u, m), g = e.conversations.findIndex((h) => h.id === u);
438
- g !== -1 && (e.conversations[g] = p);
437
+ const _ = await t.patchConversation(u, m), y = e.conversations.findIndex((h) => h.id === u);
438
+ y !== -1 && (e.conversations[y] = _);
439
439
  }
440
- async function $(u, m, { attachments: p, metadata: g } = {}) {
440
+ async function R(u, m, { attachments: _, metadata: y } = {}) {
441
441
  var T;
442
- const h = (m || "").trim(), f = Array.isArray(p) && p.length > 0;
442
+ const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
443
443
  if (!u || !h && !f) return;
444
- const _ = Ue(), C = Z(u), I = {
445
- id: _,
446
- client_msg_id: _,
444
+ const p = Ue(), C = ne(u), O = {
445
+ id: p,
446
+ client_msg_id: p,
447
447
  conversation_id: u,
448
448
  type: "content",
449
449
  text_md: h,
@@ -454,98 +454,98 @@ function De(t) {
454
454
  created_at: C,
455
455
  // Local-only flag — UI may render dimmed until the SSE echo lands.
456
456
  _pending: !0,
457
- ...f ? { payload: { type: "content", attachments: p } } : {},
458
- ...g && typeof g == "object" ? { metadata: g } : {}
457
+ ...f ? { payload: { type: "content", attachments: _ } } : {},
458
+ ...y && typeof y == "object" ? { metadata: y } : {}
459
459
  };
460
- G(u, I);
460
+ H(u, O);
461
461
  try {
462
462
  await t.postMessage(u, {
463
- client_msg_id: _,
463
+ client_msg_id: p,
464
464
  text_md: h,
465
465
  created_at: C,
466
- ...f ? { attachments: p } : {},
467
- ...g && typeof g == "object" ? { metadata: g } : {}
466
+ ...f ? { attachments: _ } : {},
467
+ ...y && typeof y == "object" ? { metadata: y } : {}
468
468
  });
469
469
  } catch (L) {
470
- console.error("[store] send failed", L), J(u, _, { _failed: !0, _pending: !1 });
470
+ console.error("[store] send failed", L), q(u, p, { _failed: !0, _pending: !1 });
471
471
  }
472
472
  }
473
- async function A(u, m, p) {
473
+ async function A(u, m, _) {
474
474
  u != null && (e.awaitingCallback[u] = !0);
475
475
  try {
476
- await t.postCallback(u, m, p);
477
- } catch (g) {
478
- console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
476
+ await t.postCallback(u, m, _);
477
+ } catch (y) {
478
+ console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
479
479
  }
480
480
  }
481
- const D = /* @__PURE__ */ new Map();
481
+ const P = /* @__PURE__ */ new Map();
482
482
  async function x(u) {
483
483
  if (!u) return null;
484
- const m = D.get(u);
484
+ const m = P.get(u);
485
485
  if (m != null && m.url) {
486
- const p = m.expires_at ? Date.parse(m.expires_at) : 0;
487
- if (!p || p - Date.now() > 6e4) return m.url;
486
+ const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
487
+ if (!_ || _ - Date.now() > 6e4) return m.url;
488
488
  }
489
489
  try {
490
- const p = await t.signAttachment(u);
491
- if (p != null && p.signed_url)
492
- return D.set(u, { url: p.signed_url, expires_at: p.expires_at }), p.signed_url;
493
- } catch (p) {
494
- console.error("[store] sign attachment failed", p);
490
+ const _ = await t.signAttachment(u);
491
+ if (_ != null && _.signed_url)
492
+ return P.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
493
+ } catch (_) {
494
+ console.error("[store] sign attachment failed", _);
495
495
  }
496
496
  return null;
497
497
  }
498
- async function N(u, { rating: m, comment: p } = {}) {
499
- const g = e.conversations.find((_) => _.id === u), f = {
500
- ...(g == null ? void 0 : g.metadata) || {},
498
+ async function D(u, { rating: m, comment: _ } = {}) {
499
+ const y = e.conversations.find((p) => p.id === u), f = {
500
+ ...(y == null ? void 0 : y.metadata) || {},
501
501
  feedback: {
502
502
  rating: m,
503
- comment: p || null,
503
+ comment: _ || null,
504
504
  submitted_at: (/* @__PURE__ */ new Date()).toISOString()
505
505
  }
506
506
  };
507
507
  await S(u, { metadata: f });
508
508
  }
509
509
  function F(u) {
510
- var p, g;
510
+ var _, y;
511
511
  const m = e.messagesByConv[u] || [];
512
512
  for (let h = m.length - 1; h >= 0; h--) {
513
513
  const f = m[h];
514
- if ((f == null ? void 0 : f.type) === "action" && ((p = f == null ? void 0 : f.payload) == null ? void 0 : p.type) === "action" && ((g = f == null ? void 0 : f.payload) == null ? void 0 : g.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
514
+ if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((y = f == null ? void 0 : f.payload) == null ? void 0 : y.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
515
515
  return f;
516
516
  }
517
517
  return null;
518
518
  }
519
- function P(u) {
520
- var p, g, h;
519
+ function N(u) {
520
+ var _, y, h;
521
521
  const m = e.messagesByConv[u] || [];
522
522
  for (let f = m.length - 1; f >= 0; f--) {
523
- const _ = m[f];
524
- if (((p = _ == null ? void 0 : _.author) == null ? void 0 : p.type) === "user" || (_ == null ? void 0 : _.type) === "action" && ((g = _ == null ? void 0 : _.payload) == null ? void 0 : g.state) === "pending") return null;
525
- const C = (h = _ == null ? void 0 : _.metadata) == null ? void 0 : h.form;
523
+ const p = m[f];
524
+ if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((y = p == null ? void 0 : p.payload) == null ? void 0 : y.state) === "pending") return null;
525
+ const C = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
526
526
  if (C && Array.isArray(C.fields) && C.fields.length > 0)
527
- return { message: _, form: C };
527
+ return { message: p, form: C };
528
528
  }
529
529
  return null;
530
530
  }
531
- function q(u) {
531
+ function V(u) {
532
532
  const m = e.runningActionsByConv[u];
533
533
  if (!m) return null;
534
- const p = Object.keys(m);
535
- if (p.length === 0) return null;
536
- const g = p[0];
537
- return { id: g, payload: { name: m[g] } };
534
+ const _ = Object.keys(m);
535
+ if (_.length === 0) return null;
536
+ const y = _[0];
537
+ return { id: y, payload: { name: m[y] } };
538
538
  }
539
- function W(u) {
540
- var p, g, h, f;
539
+ function Y(u) {
540
+ var _, y, h, f;
541
541
  const m = e.messagesByConv[u] || [];
542
- for (let _ = m.length - 1; _ >= 0; _--) {
543
- const C = m[_];
544
- if (((p = C == null ? void 0 : C.author) == null ? void 0 : p.type) === "user") return [];
545
- if ((C == null ? void 0 : C.type) === "action" && ((g = C == null ? void 0 : C.payload) == null ? void 0 : g.state) === "pending") return [];
542
+ for (let p = m.length - 1; p >= 0; p--) {
543
+ const C = m[p];
544
+ if (((_ = C == null ? void 0 : C.author) == null ? void 0 : _.type) === "user") return [];
545
+ if ((C == null ? void 0 : C.type) === "action" && ((y = C == null ? void 0 : C.payload) == null ? void 0 : y.state) === "pending") return [];
546
546
  if (((h = C == null ? void 0 : C.author) == null ? void 0 : h.type) !== "agent_ia") continue;
547
- const I = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
548
- return Array.isArray(I) && I.length ? I.map((T) => {
547
+ const O = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
548
+ return Array.isArray(O) && O.length ? O.map((T) => {
549
549
  if (typeof T == "string") {
550
550
  const L = T.trim();
551
551
  return L ? { label: L, kind: null } : null;
@@ -553,63 +553,63 @@ function De(t) {
553
553
  if (T && typeof T == "object" && typeof T.label == "string") {
554
554
  const L = T.label.trim();
555
555
  if (!L) return null;
556
- const ee = T.kind === "cta" || T.kind === "choice" || T.kind === "followup" ? T.kind : null;
557
- return { label: L, kind: ee };
556
+ const se = T.kind === "cta" || T.kind === "choice" || T.kind === "followup" ? T.kind : null;
557
+ return { label: L, kind: se };
558
558
  }
559
559
  return null;
560
560
  }).filter(Boolean).slice(0, 4) : [];
561
561
  }
562
562
  return [];
563
563
  }
564
- function G(u, m) {
564
+ function H(u, m) {
565
565
  var f;
566
- const p = e.messagesByConv[u] || [];
567
- let g = -1;
568
- m != null && m.client_msg_id && (g = p.findIndex(
569
- (_) => (_ == null ? void 0 : _.client_msg_id) && _.client_msg_id === m.client_msg_id
570
- )), g === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (g = p.findIndex((_) => ae(_ == null ? void 0 : _.id, m.id)));
566
+ const _ = e.messagesByConv[u] || [];
567
+ let y = -1;
568
+ m != null && m.client_msg_id && (y = _.findIndex(
569
+ (p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
570
+ )), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => J(p == null ? void 0 : p.id, m.id)));
571
571
  let h;
572
- g === -1 ? h = [...p, m].sort(oe) : (h = p.slice(), h[g] = { ...p[g], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
572
+ y === -1 ? h = [..._, m].sort(X) : (h = _.slice(), h[y] = { ..._[y], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
573
573
  }
574
- function ae(u, m) {
574
+ function J(u, m) {
575
575
  return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
576
576
  }
577
- function J(u, m, p) {
578
- const g = e.messagesByConv[u];
579
- if (!g) return;
580
- const h = g.findIndex((_) => _.id === m);
577
+ function q(u, m, _) {
578
+ const y = e.messagesByConv[u];
579
+ if (!y) return;
580
+ const h = y.findIndex((p) => p.id === m);
581
581
  if (h === -1) return;
582
- const f = g.slice();
583
- f[h] = { ...g[h], ...p }, e.messagesByConv[u] = f;
582
+ const f = y.slice();
583
+ f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
584
584
  }
585
- function K(u, m) {
586
- const p = e.conversations.findIndex((h) => h.id === u);
587
- if (p === -1) return;
588
- const g = e.conversations[p];
589
- if (m && (!g.last_message_at || m > g.last_message_at)) {
585
+ function z(u, m) {
586
+ const _ = e.conversations.findIndex((h) => h.id === u);
587
+ if (_ === -1) return;
588
+ const y = e.conversations[_];
589
+ if (m && (!y.last_message_at || m > y.last_message_at)) {
590
590
  const h = e.conversations.slice();
591
- h[p] = { ...g, last_message_at: m }, h.sort(
592
- (f, _) => (_.last_message_at || "").localeCompare(f.last_message_at || "")
591
+ h[_] = { ...y, last_message_at: m }, h.sort(
592
+ (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
593
593
  ), e.conversations = h;
594
594
  }
595
595
  }
596
- function oe(u, m) {
596
+ function X(u, m) {
597
597
  return (u.created_at || "").localeCompare(m.created_at || "");
598
598
  }
599
599
  function le(u) {
600
600
  if (!u || typeof u != "object") return null;
601
- const m = {}, p = {};
602
- for (const [g, h] of Object.entries(u))
603
- h !== void 0 && (g === "name" || g === "email" ? h != null && String(h).trim() !== "" && (m[g] = h) : (g === "values" || g === "metadata") && h && typeof h == "object" ? Object.assign(p, h) : p[g] = h);
604
- return Object.keys(p).length && (m.values = p), Object.keys(m).length ? m : null;
601
+ const m = {}, _ = {};
602
+ for (const [y, h] of Object.entries(u))
603
+ h !== void 0 && (y === "name" || y === "email" ? h != null && String(h).trim() !== "" && (m[y] = h) : (y === "values" || y === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[y] = h);
604
+ return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
605
605
  }
606
- function Z(u) {
606
+ function ne(u) {
607
607
  const m = e.messagesByConv[u] || [];
608
- let p = "";
608
+ let _ = "";
609
609
  for (const f of m)
610
- f != null && f.created_at && f.created_at > p && (p = f.created_at);
611
- const g = (/* @__PURE__ */ new Date()).toISOString();
612
- return !p || g > p ? g : new Date(Date.parse(p) + 1).toISOString();
610
+ f != null && f.created_at && f.created_at > _ && (_ = f.created_at);
611
+ const y = (/* @__PURE__ */ new Date()).toISOString();
612
+ return !_ || y > _ ? y : new Date(Date.parse(_) + 1).toISOString();
613
613
  }
614
614
  return {
615
615
  state: e,
@@ -620,14 +620,14 @@ function De(t) {
620
620
  openConversation: v,
621
621
  loadMore: k,
622
622
  patchConversation: S,
623
- send: $,
623
+ send: R,
624
624
  clickCallback: A,
625
625
  signAttachment: x,
626
- submitFeedback: N,
626
+ submitFeedback: D,
627
627
  getPendingApproval: F,
628
- getActionInFlight: q,
629
- getLatestSuggestions: W,
630
- getLatestForm: P,
628
+ getActionInFlight: V,
629
+ getLatestSuggestions: Y,
630
+ getLatestForm: N,
631
631
  // Pass-through for panel open/close (controls SSE burst).
632
632
  setPanelOpen: t.setPanelOpen
633
633
  };
@@ -649,7 +649,7 @@ const U = {
649
649
  red: "#B91C1C",
650
650
  redBg: "#FDECEC"
651
651
  }, ce = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
652
- function ye(t = "") {
652
+ function ge(t = "") {
653
653
  return t ? ce[t.charCodeAt(0) % ce.length] : ce[0];
654
654
  }
655
655
  function we(t = "") {
@@ -722,7 +722,7 @@ const Ne = `
722
722
  }, ze = { class: "wm-launcherWrap" }, Ve = { class: "wm-peek__text" }, qe = ["aria-label"];
723
723
  function We(t, e, n, a, r, s) {
724
724
  return l(), d("div", ze, [
725
- z(Se, { name: "wm-peek" }, {
725
+ K(Se, { name: "wm-peek" }, {
726
726
  default: xe(() => [
727
727
  n.peek ? (l(), d("div", {
728
728
  key: 0,
@@ -732,8 +732,8 @@ function We(t, e, n, a, r, s) {
732
732
  "aria-label": "Ouvrir le messenger sur le dernier message",
733
733
  onClick: e[1] || (e[1] = (o) => t.$emit("open")),
734
734
  onKeydown: [
735
- e[2] || (e[2] = me(X((o) => t.$emit("open"), ["prevent"]), ["enter"])),
736
- e[3] || (e[3] = me(X((o) => t.$emit("open"), ["prevent"]), ["space"]))
735
+ e[2] || (e[2] = me(ee((o) => t.$emit("open"), ["prevent"]), ["enter"])),
736
+ e[3] || (e[3] = me(ee((o) => t.$emit("open"), ["prevent"]), ["space"]))
737
737
  ]
738
738
  }, [
739
739
  i("p", Ve, b(n.peek), 1),
@@ -741,7 +741,7 @@ function We(t, e, n, a, r, s) {
741
741
  type: "button",
742
742
  class: "wm-peek__close",
743
743
  "aria-label": "Ignorer",
744
- onClick: e[0] || (e[0] = X((o) => t.$emit("dismiss"), ["stop"]))
744
+ onClick: e[0] || (e[0] = ee((o) => t.$emit("dismiss"), ["stop"]))
745
745
  }, [...e[5] || (e[5] = [
746
746
  i("svg", {
747
747
  width: "11",
@@ -788,7 +788,7 @@ function We(t, e, n, a, r, s) {
788
788
  ])
789
789
  ]);
790
790
  }
791
- const Ge = /* @__PURE__ */ B(He, [["render", We], ["__scopeId", "data-v-fabef371"]]), Ke = {
791
+ const Ke = /* @__PURE__ */ B(He, [["render", We], ["__scopeId", "data-v-fabef371"]]), Ge = {
792
792
  name: "WmAIAvatar",
793
793
  props: {
794
794
  size: { type: Number, default: 26 },
@@ -807,7 +807,7 @@ const Ge = /* @__PURE__ */ B(He, [["render", We], ["__scopeId", "data-v-fabef371
807
807
  function Xe(t, e, n, a, r, s) {
808
808
  return l(), d("div", {
809
809
  class: E(["wm-aiav", { "wm-aiav--tail": n.tail }]),
810
- style: V({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
810
+ style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
811
811
  }, [
812
812
  n.pulse ? (l(), d("div", Ye)) : w("", !0),
813
813
  i("div", {
@@ -843,7 +843,7 @@ function Xe(t, e, n, a, r, s) {
843
843
  ], 2)
844
844
  ], 6);
845
845
  }
846
- const Q = /* @__PURE__ */ B(Ke, [["render", Xe], ["__scopeId", "data-v-8c924688"]]), Qe = {
846
+ const te = /* @__PURE__ */ B(Ge, [["render", Xe], ["__scopeId", "data-v-8c924688"]]), Qe = {
847
847
  name: "WmHumanAvatar",
848
848
  props: {
849
849
  name: { type: String, default: "" },
@@ -852,7 +852,7 @@ const Q = /* @__PURE__ */ B(Ke, [["render", Xe], ["__scopeId", "data-v-8c924688"
852
852
  },
853
853
  computed: {
854
854
  bg() {
855
- return this.avatarUrl ? "transparent" : ye(this.name);
855
+ return this.avatarUrl ? "transparent" : ge(this.name);
856
856
  },
857
857
  initials() {
858
858
  return we(this.name);
@@ -862,7 +862,7 @@ const Q = /* @__PURE__ */ B(Ke, [["render", Xe], ["__scopeId", "data-v-8c924688"
862
862
  function et(t, e, n, a, r, s) {
863
863
  return l(), d("div", {
864
864
  class: "wm-huav",
865
- style: V({
865
+ style: G({
866
866
  width: n.size + "px",
867
867
  height: n.size + "px",
868
868
  "--wm-avr": Math.round(n.size * 0.32) + "px",
@@ -875,7 +875,7 @@ function et(t, e, n, a, r, s) {
875
875
  alt: n.name || ""
876
876
  }, null, 8, Ze)) : (l(), d("span", {
877
877
  key: 1,
878
- style: V({ fontSize: n.size * 0.36 + "px" })
878
+ style: G({ fontSize: n.size * 0.36 + "px" })
879
879
  }, b(s.initials), 5))
880
880
  ], 4);
881
881
  }
@@ -895,7 +895,7 @@ const ke = /* @__PURE__ */ B(Qe, [["render", et], ["__scopeId", "data-v-a772b179
895
895
  },
896
896
  methods: {
897
897
  colorFor(t) {
898
- return t.avatar_url ? "transparent" : ye(t.name || "");
898
+ return t.avatar_url ? "transparent" : ge(t.name || "");
899
899
  },
900
900
  initialsFor(t) {
901
901
  return we(t.name || "");
@@ -912,12 +912,12 @@ function at(t, e, n, a, r, s) {
912
912
  return s.visible ? (l(), d("div", nt, [
913
913
  i("div", {
914
914
  class: "wm-team__stack",
915
- style: V({ width: s.stackWidth + "px" })
915
+ style: G({ width: s.stackWidth + "px" })
916
916
  }, [
917
917
  (l(!0), d(M, null, j(n.members.slice(0, 3), (o, c) => (l(), d("div", {
918
918
  key: c,
919
919
  class: "wm-team__pill",
920
- style: V({ left: c * 13 + "px", zIndex: 3 - c, background: s.colorFor(o) })
920
+ style: G({ left: c * 13 + "px", zIndex: 3 - c, background: s.colorFor(o) })
921
921
  }, [
922
922
  o.avatar_url ? (l(), d("img", {
923
923
  key: 0,
@@ -931,7 +931,7 @@ function at(t, e, n, a, r, s) {
931
931
  }
932
932
  const ot = /* @__PURE__ */ B(tt, [["render", at], ["__scopeId", "data-v-3659b9c1"]]), lt = {
933
933
  name: "WmHeader",
934
- components: { AIAvatar: Q, HumanAvatar: ke, TeamAvatars: ot },
934
+ components: { AIAvatar: te, HumanAvatar: ke, TeamAvatars: ot },
935
935
  props: {
936
936
  title: { type: String, default: "Nouvelle conversation" },
937
937
  escalated: { type: Boolean, default: !1 },
@@ -968,12 +968,12 @@ const ot = /* @__PURE__ */ B(tt, [["render", at], ["__scopeId", "data-v-3659b9c1
968
968
  }, ut = { class: "wm-header__avatar" }, ht = { class: "wm-header__main" }, mt = { class: "wm-header__title" }, ft = {
969
969
  key: 0,
970
970
  class: "wm-header__sub"
971
- }, pt = { class: "wm-header__status" }, _t = {
971
+ }, _t = { class: "wm-header__status" }, pt = {
972
972
  key: 3,
973
973
  class: "wm-header__fill"
974
974
  }, vt = { class: "wm-header__actions" };
975
- function gt(t, e, n, a, r, s) {
976
- const o = O("HumanAvatar"), c = O("AIAvatar"), v = O("TeamAvatars");
975
+ function yt(t, e, n, a, r, s) {
976
+ const o = I("HumanAvatar"), c = I("AIAvatar"), v = I("TeamAvatars");
977
977
  return l(), d("div", ct, [
978
978
  n.showBack ? (l(), d("button", {
979
979
  key: 0,
@@ -998,12 +998,12 @@ function gt(t, e, n, a, r, s) {
998
998
  ])])) : (l(), d("div", dt)),
999
999
  n.showIdentity ? (l(), d(M, { key: 2 }, [
1000
1000
  i("div", ut, [
1001
- n.escalated ? (l(), R(o, {
1001
+ n.escalated ? (l(), $(o, {
1002
1002
  key: 0,
1003
1003
  name: n.agentName,
1004
1004
  "avatar-url": n.agentAvatarUrl,
1005
1005
  size: 34
1006
- }, null, 8, ["name", "avatar-url"])) : (l(), R(c, {
1006
+ }, null, 8, ["name", "avatar-url"])) : (l(), $(c, {
1007
1007
  key: 1,
1008
1008
  size: 34
1009
1009
  }))
@@ -1011,18 +1011,18 @@ function gt(t, e, n, a, r, s) {
1011
1011
  i("div", ht, [
1012
1012
  i("div", mt, b(n.title), 1),
1013
1013
  s.showPresence ? (l(), d("div", ft, [
1014
- s.hasTeam ? (l(), R(v, {
1014
+ s.hasTeam ? (l(), $(v, {
1015
1015
  key: 0,
1016
1016
  members: n.teamMembers,
1017
1017
  "response-label": n.responseLabel
1018
1018
  }, null, 8, ["members", "response-label"])) : w("", !0),
1019
- i("span", pt, [
1019
+ i("span", _t, [
1020
1020
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
1021
- ie(" " + b(s.statusText), 1)
1021
+ oe(" " + b(s.statusText), 1)
1022
1022
  ])
1023
1023
  ])) : w("", !0)
1024
1024
  ])
1025
- ], 64)) : (l(), d("div", _t)),
1025
+ ], 64)) : (l(), d("div", pt)),
1026
1026
  i("div", vt, [
1027
1027
  n.showMore ? (l(), d("button", {
1028
1028
  key: 0,
@@ -1081,7 +1081,7 @@ function gt(t, e, n, a, r, s) {
1081
1081
  ])
1082
1082
  ]);
1083
1083
  }
1084
- const yt = /* @__PURE__ */ B(lt, [["render", gt], ["__scopeId", "data-v-b5f5f6a9"]]), pe = {
1084
+ const gt = /* @__PURE__ */ B(lt, [["render", yt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1085
1085
  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",
1086
1086
  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",
1087
1087
  status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
@@ -1089,7 +1089,7 @@ const yt = /* @__PURE__ */ B(lt, [["render", gt], ["__scopeId", "data-v-b5f5f6a9
1089
1089
  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"
1090
1090
  }, wt = {
1091
1091
  name: "WmOnboarding",
1092
- components: { AIAvatar: Q },
1092
+ components: { AIAvatar: te },
1093
1093
  props: {
1094
1094
  welcomeMessage: { type: String, default: "" },
1095
1095
  agentName: { type: String, default: "" },
@@ -1109,16 +1109,16 @@ Je réponds en quelques secondes.`;
1109
1109
  },
1110
1110
  methods: {
1111
1111
  iconPath(t) {
1112
- return pe[t] || pe.link;
1112
+ return _e[t] || _e.link;
1113
1113
  }
1114
1114
  }
1115
1115
  }, bt = { class: "wm-onb" }, kt = { class: "wm-onb__hero" }, Ct = { class: "wm-onb__title" }, At = { class: "wm-onb__sub" }, St = {
1116
1116
  key: 0,
1117
1117
  class: "wm-onb__section"
1118
- }, xt = { class: "wm-onb__links" }, Mt = ["onClick"], Tt = { class: "wm-onb__resume-body" }, It = { class: "wm-onb__resume-title" }, Ot = { class: "wm-onb__resume-preview" }, Et = {
1118
+ }, xt = { class: "wm-onb__links" }, Mt = ["onClick"], Tt = { class: "wm-onb__resume-body" }, Ot = { class: "wm-onb__resume-title" }, It = { class: "wm-onb__resume-preview" }, Et = {
1119
1119
  key: 1,
1120
1120
  class: "wm-onb__section"
1121
- }, Bt = { class: "wm-onb__links" }, Lt = ["onClick"], Rt = { class: "wm-onb__link-icon" }, $t = {
1121
+ }, Bt = { class: "wm-onb__links" }, Lt = ["onClick"], $t = { class: "wm-onb__link-icon" }, Rt = {
1122
1122
  width: "14",
1123
1123
  height: "14",
1124
1124
  viewBox: "0 0 24 24",
@@ -1130,10 +1130,10 @@ Je réponds en quelques secondes.`;
1130
1130
  "aria-hidden": "true"
1131
1131
  }, Ft = ["d"], jt = { class: "wm-onb__link-label" }, Ut = { class: "wm-onb__cta" }, Dt = ["disabled"];
1132
1132
  function Nt(t, e, n, a, r, s) {
1133
- const o = O("AIAvatar");
1133
+ const o = I("AIAvatar");
1134
1134
  return l(), d("div", bt, [
1135
1135
  i("div", kt, [
1136
- z(o, {
1136
+ K(o, {
1137
1137
  size: 56,
1138
1138
  pulse: !0
1139
1139
  }),
@@ -1169,8 +1169,8 @@ function Nt(t, e, n, a, r, s) {
1169
1169
  })
1170
1170
  ], -1)),
1171
1171
  i("span", Tt, [
1172
- i("span", It, b(c.title), 1),
1173
- i("span", Ot, b(c.preview), 1)
1172
+ i("span", Ot, b(c.title), 1),
1173
+ i("span", It, b(c.preview), 1)
1174
1174
  ]),
1175
1175
  e[2] || (e[2] = i("svg", {
1176
1176
  width: "13",
@@ -1198,8 +1198,8 @@ function Nt(t, e, n, a, r, s) {
1198
1198
  class: "wm-onb__link",
1199
1199
  onClick: (k) => t.$emit("select", c)
1200
1200
  }, [
1201
- i("span", Rt, [
1202
- (l(), d("svg", $t, [
1201
+ i("span", $t, [
1202
+ (l(), d("svg", Rt, [
1203
1203
  i("path", {
1204
1204
  d: s.iconPath(c.icon)
1205
1205
  }, null, 8, Ft)
@@ -1273,7 +1273,7 @@ const zt = {
1273
1273
  "stroke-width": "2.6",
1274
1274
  "stroke-linecap": "round",
1275
1275
  "stroke-linejoin": "round"
1276
- }, Gt = {
1276
+ }, Kt = {
1277
1277
  key: 2,
1278
1278
  width: "11",
1279
1279
  height: "11",
@@ -1283,7 +1283,7 @@ const zt = {
1283
1283
  "stroke-width": "2.4",
1284
1284
  "stroke-linecap": "round",
1285
1285
  "stroke-linejoin": "round"
1286
- }, Kt = {
1286
+ }, Gt = {
1287
1287
  key: 3,
1288
1288
  width: "12",
1289
1289
  height: "12",
@@ -1303,14 +1303,14 @@ function Xt(t, e, n, a, r, s) {
1303
1303
  i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
1304
1304
  ])])) : n.state === "rejected" ? (l(), d("svg", Wt, [...e[1] || (e[1] = [
1305
1305
  i("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
1306
- ])])) : n.state === "awaiting" ? (l(), d("svg", Gt, [...e[2] || (e[2] = [
1306
+ ])])) : n.state === "awaiting" ? (l(), d("svg", Kt, [...e[2] || (e[2] = [
1307
1307
  i("circle", {
1308
1308
  cx: "12",
1309
1309
  cy: "12",
1310
1310
  r: "10"
1311
1311
  }, null, -1),
1312
1312
  i("polyline", { points: "12 7 12 12 15 14" }, null, -1)
1313
- ])])) : (l(), d("svg", Kt, [...e[3] || (e[3] = [
1313
+ ])])) : (l(), d("svg", Gt, [...e[3] || (e[3] = [
1314
1314
  i("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }, null, -1),
1315
1315
  i("line", {
1316
1316
  x1: "12",
@@ -1366,7 +1366,7 @@ function an(t, e, n, a, r, s) {
1366
1366
  }, [
1367
1367
  i("polyline", { points: "20 6 9 17 4 12" })
1368
1368
  ]),
1369
- ie(" Envoyé ")
1369
+ oe(" Envoyé ")
1370
1370
  ], -1))
1371
1371
  ]),
1372
1372
  i("div", sn, [
@@ -1400,17 +1400,17 @@ const on = /* @__PURE__ */ B(Zt, [["render", an], ["__scopeId", "data-v-812bda8b
1400
1400
  }, cn = { class: "wm-art wm-art--infoCard" }, dn = {
1401
1401
  key: 0,
1402
1402
  class: "wm-art__image"
1403
- }, un = ["src", "alt"], hn = { class: "wm-art__head" }, mn = { class: "wm-art__headMain" }, fn = { class: "wm-art__title" }, pn = {
1403
+ }, un = ["src", "alt"], hn = { class: "wm-art__head" }, mn = { class: "wm-art__headMain" }, fn = { class: "wm-art__title" }, _n = {
1404
1404
  key: 0,
1405
1405
  class: "wm-art__subtitle"
1406
- }, _n = {
1406
+ }, pn = {
1407
1407
  key: 1,
1408
1408
  class: "wm-art__body"
1409
1409
  }, vn = {
1410
1410
  key: 0,
1411
1411
  class: "wm-art__text"
1412
- }, gn = { class: "wm-art__fieldLabel" };
1413
- function yn(t, e, n, a, r, s) {
1412
+ }, yn = { class: "wm-art__fieldLabel" };
1413
+ function gn(t, e, n, a, r, s) {
1414
1414
  return l(), d("div", cn, [
1415
1415
  n.data.image_url ? (l(), d("figure", dn, [
1416
1416
  i("img", {
@@ -1422,20 +1422,20 @@ function yn(t, e, n, a, r, s) {
1422
1422
  i("div", hn, [
1423
1423
  i("div", mn, [
1424
1424
  i("div", fn, b(n.data.title), 1),
1425
- n.data.subtitle ? (l(), d("div", pn, b(n.data.subtitle), 1)) : w("", !0)
1425
+ n.data.subtitle ? (l(), d("div", _n, b(n.data.subtitle), 1)) : w("", !0)
1426
1426
  ]),
1427
1427
  n.data.badge && n.data.badge.label ? (l(), d("span", {
1428
1428
  key: 0,
1429
1429
  class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1430
1430
  }, b(n.data.badge.label), 3)) : w("", !0)
1431
1431
  ]),
1432
- s.hasBody ? (l(), d("div", _n, [
1432
+ s.hasBody ? (l(), d("div", pn, [
1433
1433
  n.data.body ? (l(), d("div", vn, b(n.data.body), 1)) : w("", !0),
1434
1434
  s.fields.length ? (l(!0), d(M, { key: 1 }, j(s.fields, (o, c) => (l(), d("div", {
1435
1435
  key: c,
1436
1436
  class: "wm-art__field"
1437
1437
  }, [
1438
- i("div", gn, b(o.label), 1),
1438
+ i("div", yn, b(o.label), 1),
1439
1439
  i("div", {
1440
1440
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1441
1441
  }, b(o.value), 3)
@@ -1443,7 +1443,7 @@ function yn(t, e, n, a, r, s) {
1443
1443
  ])) : w("", !0)
1444
1444
  ]);
1445
1445
  }
1446
- const wn = /* @__PURE__ */ B(ln, [["render", yn], ["__scopeId", "data-v-d7369333"]]);
1446
+ const wn = /* @__PURE__ */ B(ln, [["render", gn], ["__scopeId", "data-v-d7369333"]]);
1447
1447
  function bn(t) {
1448
1448
  if (!t) return "";
1449
1449
  const e = new Date(t);
@@ -1483,10 +1483,10 @@ const kn = {
1483
1483
  }, Cn = { class: "wm-art wm-art--ticket" }, An = { class: "wm-art__head wm-tk__head" }, Sn = { class: "wm-art__title wm-tk__title" }, xn = { class: "wm-tk__sub" }, Mn = { class: "wm-tk__ref" }, Tn = {
1484
1484
  key: 0,
1485
1485
  class: "wm-tk__text"
1486
- }, In = {
1486
+ }, On = {
1487
1487
  key: 0,
1488
1488
  class: "wm-art__body"
1489
- }, On = { class: "wm-art__fieldLabel" }, En = ["data-level"], Bn = {
1489
+ }, In = { class: "wm-art__fieldLabel" }, En = ["data-level"], Bn = {
1490
1490
  key: 1,
1491
1491
  class: "wm-art__footer wm-tk__footer"
1492
1492
  };
@@ -1519,17 +1519,17 @@ function Ln(t, e, n, a, r, s) {
1519
1519
  class: "wm-tk__dot",
1520
1520
  "aria-hidden": "true"
1521
1521
  }, null, -1)),
1522
- ie(" " + b(n.data.status.label), 1)
1522
+ oe(" " + b(n.data.status.label), 1)
1523
1523
  ], 2)
1524
1524
  ]),
1525
1525
  n.data.body ? (l(), d("div", Tn, b(n.data.body), 1)) : w("", !0)
1526
1526
  ]),
1527
- s.fields.length ? (l(), d("div", In, [
1527
+ s.fields.length ? (l(), d("div", On, [
1528
1528
  (l(!0), d(M, null, j(s.fields, (o, c) => (l(), d("div", {
1529
1529
  key: c,
1530
1530
  class: "wm-art__field"
1531
1531
  }, [
1532
- i("div", On, b(o.label), 1),
1532
+ i("div", In, b(o.label), 1),
1533
1533
  i("div", {
1534
1534
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1535
1535
  }, [
@@ -1593,10 +1593,10 @@ function Ln(t, e, n, a, r, s) {
1593
1593
  ])) : w("", !0)
1594
1594
  ]);
1595
1595
  }
1596
- const Rn = /* @__PURE__ */ B(kn, [["render", Ln], ["__scopeId", "data-v-97001af0"]]), $n = {
1596
+ const $n = /* @__PURE__ */ B(kn, [["render", Ln], ["__scopeId", "data-v-97001af0"]]), Rn = {
1597
1597
  form_response: on,
1598
1598
  info_card: wn,
1599
- ticket: Rn
1599
+ ticket: $n
1600
1600
  }, Fn = {
1601
1601
  name: "WmArtifactRenderer",
1602
1602
  props: {
@@ -1608,12 +1608,12 @@ const Rn = /* @__PURE__ */ B(kn, [["render", Ln], ["__scopeId", "data-v-97001af0
1608
1608
  component() {
1609
1609
  var e;
1610
1610
  const t = (e = this.artifact) == null ? void 0 : e.kind;
1611
- return t && $n[t] || null;
1611
+ return t && Rn[t] || null;
1612
1612
  }
1613
1613
  }
1614
1614
  };
1615
1615
  function jn(t, e, n, a, r, s) {
1616
- return s.component ? (l(), R(Me(s.component), {
1616
+ return s.component ? (l(), $(Me(s.component), {
1617
1617
  key: 0,
1618
1618
  data: n.artifact.data
1619
1619
  }, null, 8, ["data"])) : w("", !0);
@@ -1672,10 +1672,10 @@ const Un = /* @__PURE__ */ B(Fn, [["render", jn]]), Dn = {
1672
1672
  this.url || t.preventDefault();
1673
1673
  }
1674
1674
  }
1675
- }, Nn = ["href"], Pn = ["src", "alt"], Hn = ["src"], zn = ["src"], Vn = ["href", "download"], qn = { class: "wm-att__main" }, Wn = { class: "wm-att__name" }, Gn = {
1675
+ }, Nn = ["href"], Pn = ["src", "alt"], Hn = ["src"], zn = ["src"], Vn = ["href", "download"], qn = { class: "wm-att__main" }, Wn = { class: "wm-att__name" }, Kn = {
1676
1676
  key: 0,
1677
1677
  class: "wm-att__meta"
1678
- }, Kn = {
1678
+ }, Gn = {
1679
1679
  key: 0,
1680
1680
  class: "wm-att__spin",
1681
1681
  "aria-hidden": "true"
@@ -1733,9 +1733,9 @@ function Yn(t, e, n, a, r, s) {
1733
1733
  ], -1)),
1734
1734
  i("span", qn, [
1735
1735
  i("span", Wn, b(s.displayName), 1),
1736
- s.sizeLabel ? (l(), d("span", Gn, b(s.sizeLabel), 1)) : w("", !0)
1736
+ s.sizeLabel ? (l(), d("span", Kn, b(s.sizeLabel), 1)) : w("", !0)
1737
1737
  ]),
1738
- r.loading ? (l(), d("span", Kn)) : w("", !0)
1738
+ r.loading ? (l(), d("span", Gn)) : w("", !0)
1739
1739
  ], 8, Vn))
1740
1740
  ], 2);
1741
1741
  }
@@ -1746,13 +1746,13 @@ function Xn(t) {
1746
1746
  function Qn(t) {
1747
1747
  return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1748
1748
  }
1749
- const _e = "";
1750
- function te(t) {
1749
+ const pe = "";
1750
+ function re(t) {
1751
1751
  let e = t;
1752
1752
  const n = [];
1753
1753
  return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
1754
1754
  const s = n.length;
1755
- return n.push(r), `${_e}CODE${s}${_e}`;
1755
+ return n.push(r), `${pe}CODE${s}${pe}`;
1756
1756
  }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Qn(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (a, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
1757
1757
  }
1758
1758
  function Zn(t) {
@@ -1781,20 +1781,20 @@ function Zn(t) {
1781
1781
  if (!S) break;
1782
1782
  k.push(S[1]), a++;
1783
1783
  }
1784
- const y = k.map((S) => `<li>${te(S)}</li>`).join("");
1785
- n.push({ type: "block", html: `<ul class="wm-md-ul">${y}</ul>` });
1784
+ const g = k.map((S) => `<li>${re(S)}</li>`).join("");
1785
+ n.push({ type: "block", html: `<ul class="wm-md-ul">${g}</ul>` });
1786
1786
  continue;
1787
1787
  }
1788
1788
  const c = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1789
1789
  if (c) {
1790
- const k = parseInt(c[1], 10), y = [c[2]];
1790
+ const k = parseInt(c[1], 10), g = [c[2]];
1791
1791
  for (a++; a < e.length; ) {
1792
1792
  const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1793
1793
  if (!A) break;
1794
- y.push(A[1]), a++;
1794
+ g.push(A[1]), a++;
1795
1795
  }
1796
- const S = y.map((A) => `<li>${te(A)}</li>`).join(""), $ = k !== 1 ? ` start="${k}"` : "";
1797
- n.push({ type: "block", html: `<ol class="wm-md-ol"${$}>${S}</ol>` });
1796
+ const S = g.map((A) => `<li>${re(A)}</li>`).join(""), R = k !== 1 ? ` start="${k}"` : "";
1797
+ n.push({ type: "block", html: `<ol class="wm-md-ol"${R}>${S}</ol>` });
1798
1798
  continue;
1799
1799
  }
1800
1800
  const v = /^(#{1,6})\s+(.*)$/.exec(s);
@@ -1802,11 +1802,11 @@ function Zn(t) {
1802
1802
  const k = v[1].length;
1803
1803
  n.push({
1804
1804
  type: "block",
1805
- html: `<h${k} class="wm-md-h wm-md-h${k}">${te(v[2])}</h${k}>`
1805
+ html: `<h${k} class="wm-md-h wm-md-h${k}">${re(v[2])}</h${k}>`
1806
1806
  }), a++;
1807
1807
  continue;
1808
1808
  }
1809
- n.push({ type: "text", html: te(s) }), a++;
1809
+ n.push({ type: "text", html: re(s) }), a++;
1810
1810
  }
1811
1811
  let r = "";
1812
1812
  for (let s = 0; s < n.length; s++) {
@@ -1849,7 +1849,7 @@ function as(t, e, n, a, r, s) {
1849
1849
  ])]);
1850
1850
  }
1851
1851
  const os = /* @__PURE__ */ B(rs, [["render", as], ["__scopeId", "data-v-df2447fd"]]);
1852
- function ne(t) {
1852
+ function Z(t) {
1853
1853
  return t ? t.client_msg_id || t.id : "";
1854
1854
  }
1855
1855
  const ls = {
@@ -1861,7 +1861,7 @@ const ls = {
1861
1861
  idle: "Conversation en pause"
1862
1862
  }, cs = 80, ds = 200, us = {
1863
1863
  name: "WmMessageList",
1864
- components: { AIAvatar: Q, HumanAvatar: ke, Bubble: ss, Typing: os, ActionResult: Qt, AttachmentPreview: Jn, ArtifactRenderer: Un },
1864
+ components: { AIAvatar: te, HumanAvatar: ke, Bubble: ss, Typing: os, ActionResult: Qt, AttachmentPreview: Jn, ArtifactRenderer: Un },
1865
1865
  props: {
1866
1866
  messages: { type: Array, default: () => [] },
1867
1867
  streamingActive: { type: Boolean, default: !1 },
@@ -1886,7 +1886,14 @@ const ls = {
1886
1886
  // window after, suppressing the per-row fade-up animation so
1887
1887
  // a freshly prepended history page doesn't visibly flicker
1888
1888
  // in 50-at-once.
1889
- silentFades: !1
1889
+ silentFades: !1,
1890
+ // Largeur rendue (px) de la moitié visible de chaque item
1891
+ // d'un cluster, indexée par `${messageKey}-${partKey}`.
1892
+ // Alimentée post-render par `measureRows()` et consommée
1893
+ // par `cornersFor()` pour décider du rétractement des coins
1894
+ // intérieurs. Avant la première mesure, `cornersFor` retombe
1895
+ // sur la convention kind-based (`card` > `bubble`).
1896
+ widthByKey: Object.freeze({})
1890
1897
  };
1891
1898
  },
1892
1899
  computed: {
@@ -1902,7 +1909,7 @@ const ls = {
1902
1909
  if (((e = s == null ? void 0 : s.payload) == null ? void 0 : e.event) === "action_admin_pending") {
1903
1910
  const k = t[t.length - 1];
1904
1911
  k && k.role === "ai" ? k.messages.push(s) : t.push({
1905
- key: `g-${ne(s)}`,
1912
+ key: `g-${Z(s)}`,
1906
1913
  role: "ai",
1907
1914
  agentName: "",
1908
1915
  agentAvatarUrl: null,
@@ -1912,7 +1919,7 @@ const ls = {
1912
1919
  continue;
1913
1920
  }
1914
1921
  t.push({
1915
- key: `sys-${ne(s)}`,
1922
+ key: `sys-${Z(s)}`,
1916
1923
  role: o,
1917
1924
  messages: [s],
1918
1925
  items: [],
@@ -1922,7 +1929,7 @@ const ls = {
1922
1929
  }
1923
1930
  const c = t[t.length - 1];
1924
1931
  c && c.role === o && (o === "ai" || c.agentName === (((n = s == null ? void 0 : s.author) == null ? void 0 : n.name) || "")) ? c.messages.push(s) : t.push({
1925
- key: `g-${ne(s)}`,
1932
+ key: `g-${Z(s)}`,
1926
1933
  role: o,
1927
1934
  agentName: ((a = s == null ? void 0 : s.author) == null ? void 0 : a.name) || "",
1928
1935
  agentAvatarUrl: ((r = s == null ? void 0 : s.author) == null ? void 0 : r.avatar_url) || null,
@@ -1963,10 +1970,17 @@ const ls = {
1963
1970
  streamingActive: "snapshotAndRestore"
1964
1971
  },
1965
1972
  mounted() {
1966
- this._lastSeenConvId = this.conversationId, this.scrollToBottom();
1973
+ this._lastSeenConvId = this.conversationId, this.scrollToBottom(), this._measureFrame = null, this._ro = new ResizeObserver(() => this.scheduleMeasure()), this.$refs.scrollEl && this._ro.observe(this.$refs.scrollEl), this.$nextTick(() => this.measureRows());
1974
+ },
1975
+ beforeUnmount() {
1976
+ var t;
1977
+ (t = this._ro) == null || t.disconnect(), this._measureFrame && cancelAnimationFrame(this._measureFrame), clearTimeout(this._silenceTimer);
1978
+ },
1979
+ updated() {
1980
+ this.scheduleMeasure();
1967
1981
  },
1968
1982
  methods: {
1969
- messageKey: ne,
1983
+ messageKey: Z,
1970
1984
  isAtBottom(t) {
1971
1985
  return t.scrollHeight - t.scrollTop - t.clientHeight <= cs;
1972
1986
  },
@@ -2147,10 +2161,10 @@ const ls = {
2147
2161
  // adjacent à une `bubble`) : mon coin déborde le voisin et
2148
2162
  // doit garder son arrondi.
2149
2163
  cornersFor(t, e) {
2150
- var N, F, P;
2151
- const n = t.items, a = (N = n[e]) == null ? void 0 : N.kind, r = (F = n[e - 1]) == null ? void 0 : F.kind, s = (P = n[e + 1]) == null ? void 0 : P.kind, o = t.role === "user", c = 14, v = 4, k = r == null ? void 0 : r.bottom, y = s == null ? void 0 : s.top, S = (q, W) => q === W || q === "card" && W === "bubble";
2152
- let $ = c, A = c, D = c, x = c;
2153
- return o ? (k && (A = v), (y || !s) && (D = v), k && S(k, a == null ? void 0 : a.top) && ($ = v), y && S(y, a == null ? void 0 : a.bottom) && (x = v)) : (k && ($ = v), (y || !s) && (x = v), k && S(k, a == null ? void 0 : a.top) && (A = v), y && S(y, a == null ? void 0 : a.bottom) && (D = v)), { tl: $, tr: A, br: D, bl: x };
2164
+ var Y, H, J;
2165
+ const n = t.items, a = (Y = n[e]) == null ? void 0 : Y.kind, r = (H = n[e - 1]) == null ? void 0 : H.kind, s = (J = n[e + 1]) == null ? void 0 : J.kind, o = t.role === "user", c = 14, v = 4, k = r == null ? void 0 : r.bottom, g = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], R = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], P = 0.5, x = (q, z, X) => q != null && S != null ? q + P >= S : z === X || z === "card" && X === "bubble";
2166
+ let D = c, F = c, N = c, V = c;
2167
+ return o ? (k && (F = v), (g || !s) && (N = v), k && x(R, k, a == null ? void 0 : a.top) && (D = v), g && x(A, g, a == null ? void 0 : a.bottom) && (V = v)) : (k && (D = v), (g || !s) && (V = v), k && x(R, k, a == null ? void 0 : a.top) && (F = v), g && x(A, g, a == null ? void 0 : a.bottom) && (N = v)), { tl: D, tr: F, br: N, bl: V };
2154
2168
  },
2155
2169
  // Inline style emitting the four corner CSS variables. Set on
2156
2170
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2166,6 +2180,48 @@ const ls = {
2166
2180
  "--wm-r-bl": `${n.bl}px`
2167
2181
  };
2168
2182
  },
2183
+ // Clé unique par item de cluster, alignée avec `:key` /
2184
+ // `data-row-key` du template. Sert d'index dans `widthByKey`.
2185
+ rowKeyOf(t, e) {
2186
+ var a;
2187
+ const n = (a = t == null ? void 0 : t.items) == null ? void 0 : a[e];
2188
+ return n ? `${Z(n.message)}-${n.partKey}` : "";
2189
+ },
2190
+ // rAF-debouncé : `updated()` peut être appelé en rafale (stream,
2191
+ // typing, scroll), un seul flush layout par frame suffit.
2192
+ scheduleMeasure() {
2193
+ this._measureFrame || (this._measureFrame = requestAnimationFrame(() => {
2194
+ this._measureFrame = null, this.measureRows();
2195
+ }));
2196
+ },
2197
+ // Mesure la largeur RENDUE de la moitié visible de chaque row,
2198
+ // l'écrit dans `widthByKey`. Vue ré-évalue alors `cornersFor`
2199
+ // sur les rows impactées. Shallow-diff strict (tolérance 0.5px
2200
+ // sub-pixel) pour ne pas relancer `updated()` à vide.
2201
+ measureRows() {
2202
+ const t = this.$refs.scrollEl;
2203
+ if (!t) return;
2204
+ const e = {};
2205
+ for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
2206
+ const o = s.dataset.rowKey;
2207
+ if (!o) continue;
2208
+ const c = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2209
+ if (!c) continue;
2210
+ const v = c.getBoundingClientRect().width;
2211
+ v > 0 && (e[o] = v);
2212
+ }
2213
+ const n = this.widthByKey, a = Object.keys(n), r = Object.keys(e);
2214
+ if (a.length === r.length) {
2215
+ let s = !0;
2216
+ for (const o of r)
2217
+ if (Math.abs((n[o] ?? 0) - e[o]) > 0.5) {
2218
+ s = !1;
2219
+ break;
2220
+ }
2221
+ if (s) return;
2222
+ }
2223
+ this.widthByKey = Object.freeze(e);
2224
+ },
2169
2225
  lastTimeOf(t) {
2170
2226
  const e = t.messages[t.messages.length - 1];
2171
2227
  if (!(e != null && e.created_at)) return "";
@@ -2224,27 +2280,27 @@ const ls = {
2224
2280
  }, fs = {
2225
2281
  key: 2,
2226
2282
  class: "wm-list__sep"
2227
- }, ps = { class: "wm-list__sep-label" }, _s = {
2283
+ }, _s = { class: "wm-list__sep-label" }, ps = {
2228
2284
  key: 0,
2229
2285
  class: "wm-list__sep wm-list__sep--unread"
2230
2286
  }, vs = {
2231
2287
  key: 0,
2232
2288
  class: "wm-list__sysep"
2233
- }, gs = { class: "wm-list__sysep-label" }, ys = {
2289
+ }, ys = { class: "wm-list__sysep-label" }, gs = ["data-row-key"], ws = {
2234
2290
  key: 0,
2235
2291
  class: "wm-list__avatarSlot"
2236
- }, ws = {
2292
+ }, bs = {
2237
2293
  key: 5,
2238
2294
  class: "wm-list__body"
2239
- }, bs = { key: 0 }, ks = {
2295
+ }, ks = { key: 0 }, Cs = {
2240
2296
  key: 1,
2241
2297
  "aria-hidden": "true"
2242
- }, Cs = { key: 2 }, As = {
2298
+ }, As = { key: 2 }, Ss = {
2243
2299
  key: 3,
2244
2300
  class: "wm-list__row wm-list__row--ai fade-up"
2245
- }, Ss = { class: "wm-list__avatarSlot" };
2246
- function xs(t, e, n, a, r, s) {
2247
- const o = O("AIAvatar"), c = O("HumanAvatar"), v = O("ActionResult"), k = O("ArtifactRenderer"), y = O("Bubble"), S = O("AttachmentPreview"), $ = O("Typing");
2301
+ }, xs = { class: "wm-list__avatarSlot" };
2302
+ function Ms(t, e, n, a, r, s) {
2303
+ const o = I("AIAvatar"), c = I("HumanAvatar"), v = I("ActionResult"), k = I("ArtifactRenderer"), g = I("Bubble"), S = I("AttachmentPreview"), R = I("Typing");
2248
2304
  return l(), d("div", {
2249
2305
  ref: "scrollEl",
2250
2306
  class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
@@ -2259,13 +2315,13 @@ function xs(t, e, n, a, r, s) {
2259
2315
  ])])) : s.historyExhausted ? (l(), d("div", ms, "Début de la conversation")) : w("", !0),
2260
2316
  n.dateLabel ? (l(), d("div", fs, [
2261
2317
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2262
- i("span", ps, b(n.dateLabel), 1),
2318
+ i("span", _s, b(n.dateLabel), 1),
2263
2319
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2264
2320
  ])) : w("", !0),
2265
- (l(!0), d(M, null, j(s.groups, (A, D) => (l(), d(M, {
2321
+ (l(!0), d(M, null, j(s.groups, (A, P) => (l(), d(M, {
2266
2322
  key: A.key
2267
2323
  }, [
2268
- A.key === s.unreadGroupKey ? (l(), d("div", _s, [...e[4] || (e[4] = [
2324
+ A.key === s.unreadGroupKey ? (l(), d("div", ps, [...e[4] || (e[4] = [
2269
2325
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
2270
2326
  i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
2271
2327
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
@@ -2275,21 +2331,22 @@ function xs(t, e, n, a, r, s) {
2275
2331
  }, [
2276
2332
  A.role === "system" ? (l(), d("div", vs, [
2277
2333
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2278
- i("span", gs, b(A.systemLabel), 1),
2334
+ i("span", ys, b(A.systemLabel), 1),
2279
2335
  e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2280
2336
  ])) : (l(), d(M, { key: 1 }, [
2281
- (l(!0), d(M, null, j(A.items, (x, N) => (l(), d("div", {
2337
+ (l(!0), d(M, null, j(A.items, (x, D) => (l(), d("div", {
2282
2338
  key: `${s.messageKey(x.message)}-${x.partKey}`,
2339
+ "data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
2283
2340
  class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
2284
- style: V(s.cornersStyle(A, N))
2341
+ style: G(s.cornersStyle(A, D))
2285
2342
  }, [
2286
- A.role !== "user" ? (l(), d("div", ys, [
2287
- N === A.items.length - 1 ? (l(), d(M, { key: 0 }, [
2288
- A.role === "ai" ? (l(), R(o, {
2343
+ A.role !== "user" ? (l(), d("div", ws, [
2344
+ D === A.items.length - 1 ? (l(), d(M, { key: 0 }, [
2345
+ A.role === "ai" ? (l(), $(o, {
2289
2346
  key: 0,
2290
2347
  size: 26,
2291
2348
  tail: !0
2292
- })) : (l(), R(c, {
2349
+ })) : (l(), $(c, {
2293
2350
  key: 1,
2294
2351
  name: A.agentName,
2295
2352
  "avatar-url": A.agentAvatarUrl,
@@ -2297,24 +2354,24 @@ function xs(t, e, n, a, r, s) {
2297
2354
  }, null, 8, ["name", "avatar-url"]))
2298
2355
  ], 64)) : w("", !0)
2299
2356
  ])) : w("", !0),
2300
- x.renderAs === "action" ? (l(), R(v, {
2357
+ x.renderAs === "action" ? (l(), $(v, {
2301
2358
  key: 1,
2302
2359
  state: x.message.payload.state,
2303
2360
  label: s.actionLabel(x.message),
2304
2361
  detail: s.actionDetail(x.message)
2305
- }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), R(v, {
2362
+ }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), $(v, {
2306
2363
  key: 2,
2307
2364
  state: "awaiting",
2308
2365
  label: "Demande d'approbation envoyée",
2309
2366
  detail: x.message.text_md || ""
2310
- }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), R(k, {
2367
+ }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), $(k, {
2311
2368
  key: 3,
2312
2369
  artifact: s.actionArtifact(x.message)
2313
- }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), R(k, {
2370
+ }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), $(k, {
2314
2371
  key: 4,
2315
2372
  artifact: s.artifactOf(x.message)
2316
- }, null, 8, ["artifact"])) : (l(), d("div", ws, [
2317
- x.message.text_md ? (l(), R(y, {
2373
+ }, null, 8, ["artifact"])) : (l(), d("div", bs, [
2374
+ x.message.text_md ? (l(), $(g, {
2318
2375
  key: 0,
2319
2376
  role: A.role,
2320
2377
  text: x.message.text_md
@@ -2323,37 +2380,37 @@ function xs(t, e, n, a, r, s) {
2323
2380
  key: 1,
2324
2381
  class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2325
2382
  }, [
2326
- (l(!0), d(M, null, j(s.attachmentsOf(x.message), (F, P) => (l(), R(S, {
2327
- key: `${s.messageKey(x.message)}-att-${P}`,
2383
+ (l(!0), d(M, null, j(s.attachmentsOf(x.message), (F, N) => (l(), $(S, {
2384
+ key: `${s.messageKey(x.message)}-att-${N}`,
2328
2385
  attachment: F
2329
2386
  }, null, 8, ["attachment"]))), 128))
2330
2387
  ], 2)) : w("", !0)
2331
2388
  ]))
2332
- ], 6))), 128)),
2389
+ ], 14, gs))), 128)),
2333
2390
  A.role !== "user" || s.lastTimeOf(A) ? (l(), d("div", {
2334
2391
  key: 0,
2335
2392
  class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2336
2393
  }, [
2337
- A.role !== "user" ? (l(), d("span", bs, b(s.roleLabel(A)), 1)) : w("", !0),
2338
- A.role !== "user" && s.lastTimeOf(A) ? (l(), d("span", ks, "·")) : w("", !0),
2339
- s.lastTimeOf(A) ? (l(), d("span", Cs, b(s.lastTimeOf(A)), 1)) : w("", !0)
2394
+ A.role !== "user" ? (l(), d("span", ks, b(s.roleLabel(A)), 1)) : w("", !0),
2395
+ A.role !== "user" && s.lastTimeOf(A) ? (l(), d("span", Cs, "·")) : w("", !0),
2396
+ s.lastTimeOf(A) ? (l(), d("span", As, b(s.lastTimeOf(A)), 1)) : w("", !0)
2340
2397
  ], 2)) : w("", !0)
2341
2398
  ], 64))
2342
2399
  ], 2)
2343
2400
  ], 64))), 128)),
2344
- n.streamingActive ? (l(), d("div", As, [
2345
- i("div", Ss, [
2346
- z(o, {
2401
+ n.streamingActive ? (l(), d("div", Ss, [
2402
+ i("div", xs, [
2403
+ K(o, {
2347
2404
  size: 26,
2348
2405
  tail: !0
2349
2406
  })
2350
2407
  ]),
2351
- z($)
2408
+ K(R)
2352
2409
  ])) : w("", !0)
2353
2410
  ], 34);
2354
2411
  }
2355
- const Ms = /* @__PURE__ */ B(us, [["render", xs], ["__scopeId", "data-v-0e691378"]]), se = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2356
- function Ts() {
2412
+ const Ts = /* @__PURE__ */ B(us, [["render", Ms], ["__scopeId", "data-v-3955655c"]]), ie = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2413
+ function Os() {
2357
2414
  return he && [
2358
2415
  "video/webm;codecs=vp9,opus",
2359
2416
  "video/webm;codecs=vp8,opus",
@@ -2373,11 +2430,11 @@ function Ce({ audio: t }) {
2373
2430
  systemAudio: t ? "include" : "exclude"
2374
2431
  };
2375
2432
  }
2376
- function Ni(t) {
2433
+ function Pi(t) {
2377
2434
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
2378
2435
  }
2379
2436
  async function Is() {
2380
- if (!se) return null;
2437
+ if (!ie) return null;
2381
2438
  let t;
2382
2439
  try {
2383
2440
  t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
@@ -2385,7 +2442,7 @@ async function Is() {
2385
2442
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2386
2443
  }
2387
2444
  try {
2388
- return await Os(t);
2445
+ return await Es(t);
2389
2446
  } catch (e) {
2390
2447
  return console.error("[media] screenshot capture", e), null;
2391
2448
  } finally {
@@ -2394,7 +2451,7 @@ async function Is() {
2394
2451
  });
2395
2452
  }
2396
2453
  }
2397
- async function Os(t) {
2454
+ async function Es(t) {
2398
2455
  const e = document.createElement("video");
2399
2456
  e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((c) => requestAnimationFrame(c));
2400
2457
  const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
@@ -2404,60 +2461,60 @@ async function Os(t) {
2404
2461
  }), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2405
2462
  return new File([s], `capture-${o}.png`, { type: "image/png" });
2406
2463
  }
2407
- async function Es(t = {}) {
2464
+ async function Bs(t = {}) {
2408
2465
  var k;
2409
- if (!se || !he) return null;
2466
+ if (!ie || !he) return null;
2410
2467
  let e;
2411
2468
  try {
2412
2469
  e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
2413
- } catch (y) {
2414
- return (y == null ? void 0 : y.name) !== "NotAllowedError" && console.error("[media] record picker", y), null;
2470
+ } catch (g) {
2471
+ return (g == null ? void 0 : g.name) !== "NotAllowedError" && console.error("[media] record picker", g), null;
2415
2472
  }
2416
- const n = Ts();
2473
+ const n = Os();
2417
2474
  let a;
2418
2475
  try {
2419
2476
  a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
2420
- } catch (y) {
2421
- return console.error("[media] recorder init", y), e.getTracks().forEach((S) => {
2477
+ } catch (g) {
2478
+ return console.error("[media] recorder init", g), e.getTracks().forEach((S) => {
2422
2479
  S.stop();
2423
2480
  }), null;
2424
2481
  }
2425
2482
  const r = [];
2426
2483
  let s = null, o = !1;
2427
- a.addEventListener("dataavailable", (y) => {
2428
- y.data && y.data.size > 0 && r.push(y.data);
2484
+ a.addEventListener("dataavailable", (g) => {
2485
+ g.data && g.data.size > 0 && r.push(g.data);
2429
2486
  }), a.addEventListener("stop", () => {
2430
- var y, S;
2431
- if (s && clearInterval(s), e.getTracks().forEach(($) => {
2432
- $.stop();
2487
+ var g, S;
2488
+ if (s && clearInterval(s), e.getTracks().forEach((R) => {
2489
+ R.stop();
2433
2490
  }), r.length) {
2434
- const $ = a.mimeType || n || "video/webm", A = new Blob(r, { type: $ }), D = /mp4/.test($) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), N = new File([A], `ecran-${x}.${D}`, { type: $ });
2435
- (y = t.onfinalize) == null || y.call(t, N);
2491
+ const R = a.mimeType || n || "video/webm", A = new Blob(r, { type: R }), P = /mp4/.test(R) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), D = new File([A], `ecran-${x}.${P}`, { type: R });
2492
+ (g = t.onfinalize) == null || g.call(t, D);
2436
2493
  } else
2437
2494
  (S = t.oncancel) == null || S.call(t);
2438
- }), e.getVideoTracks().forEach((y) => {
2439
- y.addEventListener("ended", () => c(), { once: !0 });
2495
+ }), e.getVideoTracks().forEach((g) => {
2496
+ g.addEventListener("ended", () => c(), { once: !0 });
2440
2497
  });
2441
2498
  function c() {
2442
2499
  if (!o && (o = !0, a.state !== "inactive"))
2443
2500
  try {
2444
2501
  a.stop();
2445
- } catch (y) {
2446
- console.error("[media] recorder stop", y);
2502
+ } catch (g) {
2503
+ console.error("[media] recorder stop", g);
2447
2504
  }
2448
2505
  }
2449
2506
  try {
2450
2507
  a.start(1e3);
2451
- } catch (y) {
2452
- return console.error("[media] recorder start", y), e.getTracks().forEach((S) => {
2508
+ } catch (g) {
2509
+ return console.error("[media] recorder start", g), e.getTracks().forEach((S) => {
2453
2510
  S.stop();
2454
2511
  }), null;
2455
2512
  }
2456
2513
  (k = t.onstart) == null || k.call(t);
2457
2514
  const v = Date.now();
2458
2515
  return s = setInterval(() => {
2459
- var y;
2460
- (y = t.ontick) == null || y.call(t, Date.now() - v);
2516
+ var g;
2517
+ (g = t.ontick) == null || g.call(t, Date.now() - v);
2461
2518
  }, 500), {
2462
2519
  stop: c,
2463
2520
  get state() {
@@ -2465,7 +2522,7 @@ async function Es(t = {}) {
2465
2522
  }
2466
2523
  };
2467
2524
  }
2468
- const Bs = [
2525
+ const Ls = [
2469
2526
  {
2470
2527
  action: "file",
2471
2528
  label: "Joindre un fichier",
@@ -2481,7 +2538,7 @@ const Bs = [
2481
2538
  label: "Enregistrer l'écran",
2482
2539
  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"
2483
2540
  }
2484
- ], Ls = {
2541
+ ], $s = {
2485
2542
  name: "WmComposer",
2486
2543
  props: {
2487
2544
  modelValue: { type: String, default: "" },
@@ -2504,9 +2561,9 @@ const Bs = [
2504
2561
  return !this.disabled && !!this.local.trim();
2505
2562
  },
2506
2563
  attachItems() {
2507
- return Bs.map((t) => ({
2564
+ return Ls.map((t) => ({
2508
2565
  ...t,
2509
- disabled: t.action === "screenshot" && !se || t.action === "record" && (!se || !he)
2566
+ disabled: t.action === "screenshot" && !ie || t.action === "record" && (!ie || !he)
2510
2567
  }));
2511
2568
  },
2512
2569
  recordingElapsedLabel() {
@@ -2582,7 +2639,7 @@ const Bs = [
2582
2639
  async startRecording() {
2583
2640
  if (this.recording || this.disabled) return;
2584
2641
  this.recordingElapsed = 0;
2585
- const t = await Es({
2642
+ const t = await Bs({
2586
2643
  onstart: () => {
2587
2644
  this.recording = !0;
2588
2645
  },
@@ -2607,27 +2664,27 @@ const Bs = [
2607
2664
  }
2608
2665
  }
2609
2666
  }
2610
- }, Rs = { class: "wm-compose-wrap" }, $s = {
2667
+ }, Rs = { class: "wm-compose-wrap" }, Fs = {
2611
2668
  key: 0,
2612
2669
  class: "wm-rec"
2613
- }, Fs = { class: "wm-rec__lbl" }, js = {
2670
+ }, js = { class: "wm-rec__lbl" }, Us = {
2614
2671
  key: 1,
2615
2672
  class: "wm-compose__menu",
2616
2673
  role: "menu"
2617
- }, Us = ["disabled", "onClick"], Ds = { class: "wm-compose__menuIcon" }, Ns = {
2674
+ }, Ds = ["disabled", "onClick"], Ns = { class: "wm-compose__menuIcon" }, Ps = {
2618
2675
  viewBox: "0 0 24 24",
2619
2676
  width: "14",
2620
2677
  height: "14",
2621
2678
  "aria-hidden": "true"
2622
- }, Ps = ["d"], Hs = ["placeholder", "disabled"], zs = { class: "wm-compose__actions" }, Vs = ["title", "aria-label", "disabled"], qs = ["disabled"];
2623
- function Ws(t, e, n, a, r, s) {
2679
+ }, Hs = ["d"], zs = ["placeholder", "disabled"], Vs = { class: "wm-compose__actions" }, qs = ["title", "aria-label", "disabled"], Ws = ["disabled"];
2680
+ function Ks(t, e, n, a, r, s) {
2624
2681
  return l(), d("div", Rs, [
2625
- r.recording ? (l(), d("div", $s, [
2682
+ r.recording ? (l(), d("div", Fs, [
2626
2683
  e[8] || (e[8] = i("span", {
2627
2684
  class: "wm-rec__dot",
2628
2685
  "aria-hidden": "true"
2629
2686
  }, null, -1)),
2630
- i("span", Fs, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2687
+ i("span", js, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2631
2688
  i("button", {
2632
2689
  type: "button",
2633
2690
  class: "wm-rec__stop",
@@ -2636,7 +2693,7 @@ function Ws(t, e, n, a, r, s) {
2636
2693
  ])) : w("", !0),
2637
2694
  i("form", {
2638
2695
  class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2639
- onSubmit: e[7] || (e[7] = X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2696
+ onSubmit: e[7] || (e[7] = ee((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2640
2697
  }, [
2641
2698
  i("input", {
2642
2699
  ref: "fileEl",
@@ -2650,7 +2707,7 @@ function Ws(t, e, n, a, r, s) {
2650
2707
  class: "wm-compose__overlay",
2651
2708
  onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
2652
2709
  })) : w("", !0),
2653
- r.attachOpen ? (l(), d("div", js, [
2710
+ r.attachOpen ? (l(), d("div", Us, [
2654
2711
  (l(!0), d(M, null, j(s.attachItems, (o) => (l(), d("button", {
2655
2712
  key: o.action,
2656
2713
  type: "button",
@@ -2658,8 +2715,8 @@ function Ws(t, e, n, a, r, s) {
2658
2715
  disabled: o.disabled,
2659
2716
  onClick: (c) => s.onAttachAction(o.action)
2660
2717
  }, [
2661
- i("span", Ds, [
2662
- (l(), d("svg", Ns, [
2718
+ i("span", Ns, [
2719
+ (l(), d("svg", Ps, [
2663
2720
  i("path", {
2664
2721
  d: o.path,
2665
2722
  stroke: "currentColor",
@@ -2667,13 +2724,13 @@ function Ws(t, e, n, a, r, s) {
2667
2724
  "stroke-linecap": "round",
2668
2725
  "stroke-linejoin": "round",
2669
2726
  fill: "none"
2670
- }, null, 8, Ps)
2727
+ }, null, 8, Hs)
2671
2728
  ]))
2672
2729
  ]),
2673
2730
  i("span", null, b(o.label), 1)
2674
- ], 8, Us))), 128))
2731
+ ], 8, Ds))), 128))
2675
2732
  ])) : w("", !0),
2676
- H(i("textarea", {
2733
+ W(i("textarea", {
2677
2734
  ref: "inputEl",
2678
2735
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
2679
2736
  class: "wm-compose__input",
@@ -2682,10 +2739,10 @@ function Ws(t, e, n, a, r, s) {
2682
2739
  disabled: n.disabled,
2683
2740
  onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
2684
2741
  onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
2685
- }, null, 40, Hs), [
2686
- [Y, r.local]
2742
+ }, null, 40, zs), [
2743
+ [Q, r.local]
2687
2744
  ]),
2688
- i("div", zs, [
2745
+ i("div", Vs, [
2689
2746
  i("button", {
2690
2747
  type: "button",
2691
2748
  class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
@@ -2707,7 +2764,7 @@ function Ws(t, e, n, a, r, s) {
2707
2764
  }, [
2708
2765
  i("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48" })
2709
2766
  ], -1)
2710
- ])], 10, Vs),
2767
+ ])], 10, qs),
2711
2768
  i("button", {
2712
2769
  type: "submit",
2713
2770
  class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
@@ -2727,12 +2784,12 @@ function Ws(t, e, n, a, r, s) {
2727
2784
  }, [
2728
2785
  i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
2729
2786
  ], -1)
2730
- ])], 10, qs)
2787
+ ])], 10, Ws)
2731
2788
  ])
2732
2789
  ], 34)
2733
2790
  ]);
2734
2791
  }
2735
- const Gs = /* @__PURE__ */ B(Ls, [["render", Ws], ["__scopeId", "data-v-14fa9ec0"]]), Ks = {
2792
+ const Gs = /* @__PURE__ */ B($s, [["render", Ks], ["__scopeId", "data-v-14fa9ec0"]]), Ys = {
2736
2793
  name: "WmSuggestionChips",
2737
2794
  props: {
2738
2795
  items: { type: Array, default: () => [] },
@@ -2749,8 +2806,8 @@ const Gs = /* @__PURE__ */ B(Ls, [["render", Ws], ["__scopeId", "data-v-14fa9ec0
2749
2806
  return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
2750
2807
  }
2751
2808
  }
2752
- }, Ys = ["onClick"];
2753
- function Js(t, e, n, a, r, s) {
2809
+ }, Js = ["onClick"];
2810
+ function Xs(t, e, n, a, r, s) {
2754
2811
  return n.items.length ? (l(), d("div", {
2755
2812
  key: s.batchKey,
2756
2813
  class: "wm-chips"
@@ -2759,14 +2816,14 @@ function Js(t, e, n, a, r, s) {
2759
2816
  key: c,
2760
2817
  type: "button",
2761
2818
  class: "wm-chip",
2762
- style: V({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2819
+ style: G({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2763
2820
  onClick: (v) => t.$emit("select", o)
2764
- }, b(o.label), 13, Ys))), 128))
2821
+ }, b(o.label), 13, Js))), 128))
2765
2822
  ])) : w("", !0);
2766
2823
  }
2767
- const Xs = /* @__PURE__ */ B(Ks, [["render", Js], ["__scopeId", "data-v-55aa529d"]]), Qs = {
2824
+ const Qs = /* @__PURE__ */ B(Ys, [["render", Xs], ["__scopeId", "data-v-55aa529d"]]), Zs = {
2768
2825
  name: "WmApprovalCard",
2769
- components: { AIAvatar: Q },
2826
+ components: { AIAvatar: te },
2770
2827
  props: {
2771
2828
  action: { type: String, required: !0 },
2772
2829
  detail: { type: String, default: "" },
@@ -2797,23 +2854,23 @@ const Xs = /* @__PURE__ */ B(Ks, [["render", Js], ["__scopeId", "data-v-55aa529d
2797
2854
  return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
2798
2855
  }
2799
2856
  }
2800
- }, Zs = { class: "wm-approval" }, er = { class: "wm-approval__head" }, tr = { class: "wm-approval__icon" }, nr = { class: "wm-approval__main" }, sr = { class: "wm-approval__title" }, rr = {
2857
+ }, er = { class: "wm-approval" }, tr = { class: "wm-approval__head" }, nr = { class: "wm-approval__icon" }, sr = { class: "wm-approval__main" }, rr = { class: "wm-approval__title" }, ir = {
2801
2858
  key: 0,
2802
2859
  class: "wm-approval__detail"
2803
- }, ir = { class: "wm-approval__actions" };
2804
- function ar(t, e, n, a, r, s) {
2805
- const o = O("AIAvatar");
2806
- return l(), d("div", Zs, [
2807
- i("div", er, [
2808
- i("div", tr, [
2809
- z(o, { size: 24 })
2810
- ]),
2860
+ }, ar = { class: "wm-approval__actions" };
2861
+ function or(t, e, n, a, r, s) {
2862
+ const o = I("AIAvatar");
2863
+ return l(), d("div", er, [
2864
+ i("div", tr, [
2811
2865
  i("div", nr, [
2812
- i("div", sr, b(n.action), 1),
2813
- n.detail ? (l(), d("div", rr, b(n.detail), 1)) : w("", !0)
2866
+ K(o, { size: 24 })
2867
+ ]),
2868
+ i("div", sr, [
2869
+ i("div", rr, b(n.action), 1),
2870
+ n.detail ? (l(), d("div", ir, b(n.detail), 1)) : w("", !0)
2814
2871
  ])
2815
2872
  ]),
2816
- i("div", ir, [
2873
+ i("div", ar, [
2817
2874
  s.rejectId ? (l(), d("button", {
2818
2875
  key: 0,
2819
2876
  type: "button",
@@ -2829,9 +2886,9 @@ function ar(t, e, n, a, r, s) {
2829
2886
  ])
2830
2887
  ]);
2831
2888
  }
2832
- const or = /* @__PURE__ */ B(Qs, [["render", ar], ["__scopeId", "data-v-b1be139c"]]);
2889
+ const lr = /* @__PURE__ */ B(Zs, [["render", or], ["__scopeId", "data-v-b1be139c"]]);
2833
2890
  let ve = 0;
2834
- const lr = /* @__PURE__ */ new Set([
2891
+ const cr = /* @__PURE__ */ new Set([
2835
2892
  "text",
2836
2893
  "textarea",
2837
2894
  "number",
@@ -2839,9 +2896,9 @@ const lr = /* @__PURE__ */ new Set([
2839
2896
  "select",
2840
2897
  "multiselect",
2841
2898
  "date"
2842
- ]), cr = {
2899
+ ]), dr = {
2843
2900
  name: "WmFormCard",
2844
- components: { AIAvatar: Q },
2901
+ components: { AIAvatar: te },
2845
2902
  props: {
2846
2903
  form: { type: Object, required: !0 },
2847
2904
  readOnly: { type: Boolean, default: !1 },
@@ -2862,7 +2919,7 @@ const lr = /* @__PURE__ */ new Set([
2862
2919
  // douteux.
2863
2920
  normalizedFields() {
2864
2921
  var e;
2865
- return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !lr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2922
+ return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !cr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2866
2923
  }
2867
2924
  },
2868
2925
  created() {
@@ -2913,48 +2970,48 @@ const lr = /* @__PURE__ */ new Set([
2913
2970
  }
2914
2971
  }
2915
2972
  }
2916
- }, dr = { class: "wm-form" }, ur = { class: "wm-form__head" }, hr = { class: "wm-form__icon" }, mr = { class: "wm-form__main" }, fr = { class: "wm-form__title" }, pr = {
2973
+ }, ur = { class: "wm-form" }, hr = { class: "wm-form__head" }, mr = { class: "wm-form__icon" }, fr = { class: "wm-form__main" }, _r = { class: "wm-form__title" }, pr = {
2917
2974
  key: 0,
2918
2975
  class: "wm-form__detail"
2919
- }, _r = ["for"], vr = {
2976
+ }, vr = ["for"], yr = {
2920
2977
  key: 0,
2921
2978
  class: "wm-form__req",
2922
2979
  "aria-hidden": "true"
2923
- }, gr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], yr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], wr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], br = ["id", "onUpdate:modelValue", "required", "disabled"], kr = {
2980
+ }, gr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], wr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], br = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], kr = ["id", "onUpdate:modelValue", "required", "disabled"], Cr = {
2924
2981
  key: 4,
2925
2982
  class: "wm-form__bool"
2926
- }, Cr = ["id", "onUpdate:modelValue", "disabled"], Ar = ["id", "onUpdate:modelValue", "required", "disabled"], Sr = {
2983
+ }, Ar = ["id", "onUpdate:modelValue", "disabled"], Sr = ["id", "onUpdate:modelValue", "required", "disabled"], xr = {
2927
2984
  value: "",
2928
2985
  disabled: ""
2929
- }, xr = ["value"], Mr = {
2986
+ }, Mr = ["value"], Tr = {
2930
2987
  key: 6,
2931
2988
  class: "wm-form__multi"
2932
- }, Tr = ["value", "checked", "disabled", "onChange"], Ir = {
2989
+ }, Or = ["value", "checked", "disabled", "onChange"], Ir = {
2933
2990
  key: 0,
2934
2991
  class: "wm-form__err"
2935
- }, Or = ["disabled"], Er = {
2992
+ }, Er = ["disabled"], Br = {
2936
2993
  key: 0,
2937
2994
  class: "wm-form__spinner",
2938
2995
  "aria-hidden": "true"
2939
- }, Br = {
2996
+ }, Lr = {
2940
2997
  key: 2,
2941
2998
  class: "wm-form__doneLbl"
2942
2999
  };
2943
- function Lr(t, e, n, a, r, s) {
2944
- const o = O("AIAvatar");
2945
- return l(), d("div", dr, [
2946
- i("div", ur, [
2947
- i("div", hr, [
2948
- z(o, { size: 24 })
2949
- ]),
3000
+ function $r(t, e, n, a, r, s) {
3001
+ const o = I("AIAvatar");
3002
+ return l(), d("div", ur, [
3003
+ i("div", hr, [
2950
3004
  i("div", mr, [
2951
- i("div", fr, b(n.form.title || "Formulaire"), 1),
3005
+ K(o, { size: 24 })
3006
+ ]),
3007
+ i("div", fr, [
3008
+ i("div", _r, b(n.form.title || "Formulaire"), 1),
2952
3009
  n.form.description ? (l(), d("div", pr, b(n.form.description), 1)) : w("", !0)
2953
3010
  ])
2954
3011
  ]),
2955
3012
  i("form", {
2956
3013
  class: "wm-form__body",
2957
- onSubmit: e[0] || (e[0] = X((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
3014
+ onSubmit: e[0] || (e[0] = ee((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
2958
3015
  }, [
2959
3016
  (l(!0), d(M, null, j(s.normalizedFields, (c) => (l(), d("div", {
2960
3017
  key: c.key,
@@ -2964,10 +3021,10 @@ function Lr(t, e, n, a, r, s) {
2964
3021
  for: `wm-f-${r._uid}-${c.key}`,
2965
3022
  class: "wm-form__label"
2966
3023
  }, [
2967
- ie(b(c.label), 1),
2968
- c.required ? (l(), d("span", vr, "*")) : w("", !0)
2969
- ], 8, _r),
2970
- c.type === "text" ? H((l(), d("input", {
3024
+ oe(b(c.label), 1),
3025
+ c.required ? (l(), d("span", yr, "*")) : w("", !0)
3026
+ ], 8, vr),
3027
+ c.type === "text" ? W((l(), d("input", {
2971
3028
  key: 0,
2972
3029
  id: `wm-f-${r._uid}-${c.key}`,
2973
3030
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2977,8 +3034,8 @@ function Lr(t, e, n, a, r, s) {
2977
3034
  required: c.required,
2978
3035
  disabled: n.readOnly || r.busy
2979
3036
  }, null, 8, gr)), [
2980
- [Y, r.values[c.key]]
2981
- ]) : c.type === "textarea" ? H((l(), d("textarea", {
3037
+ [Q, r.values[c.key]]
3038
+ ]) : c.type === "textarea" ? W((l(), d("textarea", {
2982
3039
  key: 1,
2983
3040
  id: `wm-f-${r._uid}-${c.key}`,
2984
3041
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2987,9 +3044,9 @@ function Lr(t, e, n, a, r, s) {
2987
3044
  placeholder: c.placeholder || "",
2988
3045
  required: c.required,
2989
3046
  disabled: n.readOnly || r.busy
2990
- }, null, 8, yr)), [
2991
- [Y, r.values[c.key]]
2992
- ]) : c.type === "number" ? H((l(), d("input", {
3047
+ }, null, 8, wr)), [
3048
+ [Q, r.values[c.key]]
3049
+ ]) : c.type === "number" ? W((l(), d("input", {
2993
3050
  key: 2,
2994
3051
  id: `wm-f-${r._uid}-${c.key}`,
2995
3052
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2998,14 +3055,14 @@ function Lr(t, e, n, a, r, s) {
2998
3055
  placeholder: c.placeholder || "",
2999
3056
  required: c.required,
3000
3057
  disabled: n.readOnly || r.busy
3001
- }, null, 8, wr)), [
3058
+ }, null, 8, br)), [
3002
3059
  [
3003
- Y,
3060
+ Q,
3004
3061
  r.values[c.key],
3005
3062
  void 0,
3006
3063
  { number: !0 }
3007
3064
  ]
3008
- ]) : c.type === "date" ? H((l(), d("input", {
3065
+ ]) : c.type === "date" ? W((l(), d("input", {
3009
3066
  key: 3,
3010
3067
  id: `wm-f-${r._uid}-${c.key}`,
3011
3068
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -3013,19 +3070,19 @@ function Lr(t, e, n, a, r, s) {
3013
3070
  class: "wm-form__input",
3014
3071
  required: c.required,
3015
3072
  disabled: n.readOnly || r.busy
3016
- }, null, 8, br)), [
3017
- [Y, r.values[c.key]]
3018
- ]) : c.type === "boolean" ? (l(), d("label", kr, [
3019
- H(i("input", {
3073
+ }, null, 8, kr)), [
3074
+ [Q, r.values[c.key]]
3075
+ ]) : c.type === "boolean" ? (l(), d("label", Cr, [
3076
+ W(i("input", {
3020
3077
  id: `wm-f-${r._uid}-${c.key}`,
3021
3078
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
3022
3079
  type: "checkbox",
3023
3080
  disabled: n.readOnly || r.busy
3024
- }, null, 8, Cr), [
3025
- [Ie, r.values[c.key]]
3081
+ }, null, 8, Ar), [
3082
+ [Oe, r.values[c.key]]
3026
3083
  ]),
3027
3084
  i("span", null, b(c.placeholder || "Oui"), 1)
3028
- ])) : c.type === "select" ? H((l(), d("select", {
3085
+ ])) : c.type === "select" ? W((l(), d("select", {
3029
3086
  key: 5,
3030
3087
  id: `wm-f-${r._uid}-${c.key}`,
3031
3088
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -3033,14 +3090,14 @@ function Lr(t, e, n, a, r, s) {
3033
3090
  required: c.required,
3034
3091
  disabled: n.readOnly || r.busy
3035
3092
  }, [
3036
- i("option", Sr, b(c.placeholder || "Choisir…"), 1),
3093
+ i("option", xr, b(c.placeholder || "Choisir…"), 1),
3037
3094
  (l(!0), d(M, null, j(c.options, (v) => (l(), d("option", {
3038
3095
  key: v.value,
3039
3096
  value: v.value
3040
- }, b(v.label), 9, xr))), 128))
3041
- ], 8, Ar)), [
3042
- [Oe, r.values[c.key]]
3043
- ]) : c.type === "multiselect" ? (l(), d("div", Mr, [
3097
+ }, b(v.label), 9, Mr))), 128))
3098
+ ], 8, Sr)), [
3099
+ [Ie, r.values[c.key]]
3100
+ ]) : c.type === "multiselect" ? (l(), d("div", Tr, [
3044
3101
  (l(!0), d(M, null, j(c.options, (v) => (l(), d("label", {
3045
3102
  key: v.value,
3046
3103
  class: "wm-form__multiItem"
@@ -3051,25 +3108,25 @@ function Lr(t, e, n, a, r, s) {
3051
3108
  checked: Array.isArray(r.values[c.key]) && r.values[c.key].includes(v.value),
3052
3109
  disabled: n.readOnly || r.busy,
3053
3110
  onChange: (k) => s.toggleMulti(c.key, v.value, k.target.checked)
3054
- }, null, 40, Tr),
3111
+ }, null, 40, Or),
3055
3112
  i("span", null, b(v.label), 1)
3056
3113
  ]))), 128))
3057
3114
  ])) : w("", !0)
3058
3115
  ]))), 128)),
3059
3116
  r.error ? (l(), d("div", Ir, b(r.error), 1)) : w("", !0),
3060
- n.readOnly ? (l(), d("div", Br, "Réponse envoyée")) : (l(), d("button", {
3117
+ n.readOnly ? (l(), d("div", Lr, "Réponse envoyée")) : (l(), d("button", {
3061
3118
  key: 1,
3062
3119
  type: "submit",
3063
3120
  class: "wm-form__submit",
3064
3121
  disabled: r.busy
3065
3122
  }, [
3066
- r.busy ? (l(), d("span", Er)) : w("", !0),
3123
+ r.busy ? (l(), d("span", Br)) : w("", !0),
3067
3124
  i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
3068
- ], 8, Or))
3125
+ ], 8, Er))
3069
3126
  ], 32)
3070
3127
  ]);
3071
3128
  }
3072
- const Rr = /* @__PURE__ */ B(cr, [["render", Lr], ["__scopeId", "data-v-64b40f76"]]), $r = {
3129
+ const Rr = /* @__PURE__ */ B(dr, [["render", $r], ["__scopeId", "data-v-64b40f76"]]), Fr = {
3073
3130
  name: "WmFeedback",
3074
3131
  props: {
3075
3132
  busy: { type: Boolean, default: !1 },
@@ -3093,43 +3150,43 @@ const Rr = /* @__PURE__ */ B(cr, [["render", Lr], ["__scopeId", "data-v-64b40f76
3093
3150
  !this.sel || this.busy || this.$emit("submit", { rating: this.sel });
3094
3151
  }
3095
3152
  }
3096
- }, Fr = { class: "wm-fb" }, jr = { class: "wm-fb__row" }, Ur = ["onClick"], Dr = { class: "wm-fb__emoji" }, Nr = { class: "wm-fb__label" }, Pr = ["disabled"], Hr = {
3153
+ }, jr = { class: "wm-fb" }, Ur = { class: "wm-fb__row" }, Dr = ["onClick"], Nr = { class: "wm-fb__emoji" }, Pr = { class: "wm-fb__label" }, Hr = ["disabled"], zr = {
3097
3154
  key: 1,
3098
3155
  class: "wm-fb__done"
3099
3156
  };
3100
- function zr(t, e, n, a, r, s) {
3101
- return l(), d("div", Fr, [
3102
- n.done ? (l(), d("div", Hr, [...e[3] || (e[3] = [
3157
+ function Vr(t, e, n, a, r, s) {
3158
+ return l(), d("div", jr, [
3159
+ n.done ? (l(), d("div", zr, [...e[3] || (e[3] = [
3103
3160
  ue('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
3104
3161
  ])])) : (l(), d(M, { key: 0 }, [
3105
3162
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
3106
3163
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
3107
- i("div", jr, [
3164
+ i("div", Ur, [
3108
3165
  (l(!0), d(M, null, j(r.options, (o) => (l(), d("button", {
3109
3166
  key: o.v,
3110
3167
  type: "button",
3111
3168
  class: E(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
3112
3169
  onClick: (c) => r.sel = o.v
3113
3170
  }, [
3114
- i("span", Dr, b(o.e), 1),
3115
- i("span", Nr, b(o.l), 1)
3116
- ], 10, Ur))), 128))
3171
+ i("span", Nr, b(o.e), 1),
3172
+ i("span", Pr, b(o.l), 1)
3173
+ ], 10, Dr))), 128))
3117
3174
  ]),
3118
3175
  i("button", {
3119
3176
  type: "button",
3120
3177
  class: "wm-fb__send",
3121
3178
  disabled: !r.sel || n.busy,
3122
3179
  onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
3123
- }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Pr)
3180
+ }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Hr)
3124
3181
  ], 64))
3125
3182
  ]);
3126
3183
  }
3127
- const Vr = /* @__PURE__ */ B($r, [["render", zr], ["__scopeId", "data-v-6f45ff3b"]]);
3128
- function qr(t) {
3184
+ const qr = /* @__PURE__ */ B(Fr, [["render", Vr], ["__scopeId", "data-v-6f45ff3b"]]);
3185
+ function Wr(t) {
3129
3186
  const e = new Date(t);
3130
3187
  return e.setHours(0, 0, 0, 0), e;
3131
3188
  }
3132
- const Wr = {
3189
+ const Kr = {
3133
3190
  name: "WmHistoryDrawer",
3134
3191
  props: {
3135
3192
  conversations: { type: Array, default: () => [] },
@@ -3163,7 +3220,7 @@ const Wr = {
3163
3220
  ) : this.normalized;
3164
3221
  },
3165
3222
  groups() {
3166
- const e = qr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3223
+ const e = Wr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3167
3224
  for (const o of this.filtered) {
3168
3225
  if (!o.stamp) {
3169
3226
  s.push(o);
@@ -3181,29 +3238,29 @@ const Wr = {
3181
3238
  return this.filtered.length > 0;
3182
3239
  }
3183
3240
  }
3184
- }, Gr = { class: "wm-hd" }, Kr = {
3241
+ }, Gr = { class: "wm-hd" }, Yr = {
3185
3242
  class: "wm-hd__panel",
3186
3243
  role: "dialog",
3187
3244
  "aria-label": "Vos discussions"
3188
- }, Yr = { class: "wm-hd__head" }, Jr = { class: "wm-hd__top" }, Xr = { class: "wm-hd__search" }, Qr = { class: "wm-hd__list" }, Zr = {
3245
+ }, Jr = { class: "wm-hd__head" }, Xr = { class: "wm-hd__top" }, Qr = { class: "wm-hd__search" }, Zr = { class: "wm-hd__list" }, ei = {
3189
3246
  key: 0,
3190
3247
  class: "wm-hd__group"
3191
- }, ei = { class: "wm-hd__groupLabel" }, ti = { class: "wm-hd__rows" }, ni = ["onClick"], si = { class: "wm-hd__rowIcon" }, ri = {
3248
+ }, ti = { class: "wm-hd__groupLabel" }, ni = { class: "wm-hd__rows" }, si = ["onClick"], ri = { class: "wm-hd__rowIcon" }, ii = {
3192
3249
  key: 0,
3193
3250
  class: "wm-hd__rowDot",
3194
3251
  "aria-label": "Message non lu"
3195
- }, ii = { class: "wm-hd__rowBody" }, ai = { class: "wm-hd__rowTop" }, oi = { class: "wm-hd__rowTitle" }, li = { class: "wm-hd__rowPreview" }, ci = {
3252
+ }, ai = { class: "wm-hd__rowBody" }, oi = { class: "wm-hd__rowTop" }, li = { class: "wm-hd__rowTitle" }, ci = { class: "wm-hd__rowPreview" }, di = {
3196
3253
  key: 0,
3197
3254
  class: "wm-hd__empty"
3198
3255
  };
3199
- function di(t, e, n, a, r, s) {
3256
+ function ui(t, e, n, a, r, s) {
3200
3257
  return l(), d("div", Gr, [
3201
3258
  i("div", {
3202
3259
  class: "wm-hd__scrim",
3203
3260
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3204
3261
  }),
3205
- i("aside", Kr, [
3206
- i("div", Yr, [
3262
+ i("aside", Yr, [
3263
+ i("div", Jr, [
3207
3264
  e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
3208
3265
  i("div", { class: "wm-hd__title" }, "Vos discussions"),
3209
3266
  i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
@@ -3229,7 +3286,7 @@ function di(t, e, n, a, r, s) {
3229
3286
  ], -1)
3230
3287
  ])])
3231
3288
  ]),
3232
- i("div", Jr, [
3289
+ i("div", Xr, [
3233
3290
  i("button", {
3234
3291
  type: "button",
3235
3292
  class: "wm-hd__new",
@@ -3252,7 +3309,7 @@ function di(t, e, n, a, r, s) {
3252
3309
  ], -1),
3253
3310
  i("span", null, "Démarrer un nouveau fil", -1)
3254
3311
  ])]),
3255
- i("div", Xr, [
3312
+ i("div", Qr, [
3256
3313
  e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
3257
3314
  i("svg", {
3258
3315
  width: "12",
@@ -3268,23 +3325,23 @@ function di(t, e, n, a, r, s) {
3268
3325
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3269
3326
  ])
3270
3327
  ], -1)),
3271
- H(i("input", {
3328
+ W(i("input", {
3272
3329
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3273
3330
  type: "text",
3274
3331
  placeholder: "Rechercher dans vos messages",
3275
3332
  "aria-label": "Rechercher dans vos messages"
3276
3333
  }, null, 512), [
3277
- [Y, r.query]
3334
+ [Q, r.query]
3278
3335
  ])
3279
3336
  ])
3280
3337
  ]),
3281
- i("div", Qr, [
3338
+ i("div", Zr, [
3282
3339
  (l(!0), d(M, null, j(s.groups, (o) => (l(), d(M, {
3283
3340
  key: o.key
3284
3341
  }, [
3285
- o.items.length ? (l(), d("div", Zr, [
3286
- i("div", ei, b(o.label), 1),
3287
- i("div", ti, [
3342
+ o.items.length ? (l(), d("div", ei, [
3343
+ i("div", ti, b(o.label), 1),
3344
+ i("div", ni, [
3288
3345
  (l(!0), d(M, null, j(o.items, (c) => (l(), d("button", {
3289
3346
  key: c.id,
3290
3347
  type: "button",
@@ -3294,7 +3351,7 @@ function di(t, e, n, a, r, s) {
3294
3351
  }]),
3295
3352
  onClick: (v) => t.$emit("pick", c)
3296
3353
  }, [
3297
- i("div", si, [
3354
+ i("div", ri, [
3298
3355
  e[8] || (e[8] = i("svg", {
3299
3356
  width: "11",
3300
3357
  height: "11",
@@ -3308,24 +3365,24 @@ function di(t, e, n, a, r, s) {
3308
3365
  opacity: "0.92"
3309
3366
  })
3310
3367
  ], -1)),
3311
- c.unread ? (l(), d("span", ri)) : w("", !0)
3368
+ c.unread ? (l(), d("span", ii)) : w("", !0)
3312
3369
  ]),
3313
- i("div", ii, [
3314
- i("div", ai, [
3315
- i("span", oi, b(c.title), 1)
3370
+ i("div", ai, [
3371
+ i("div", oi, [
3372
+ i("span", li, b(c.title), 1)
3316
3373
  ]),
3317
- i("div", li, b(c.preview || "Aucun message"), 1)
3374
+ i("div", ci, b(c.preview || "Aucun message"), 1)
3318
3375
  ])
3319
- ], 10, ni))), 128))
3376
+ ], 10, si))), 128))
3320
3377
  ])
3321
3378
  ])) : w("", !0)
3322
3379
  ], 64))), 128)),
3323
- s.hasAny ? w("", !0) : (l(), d("div", ci, " Aucun fil pour le moment. "))
3380
+ s.hasAny ? w("", !0) : (l(), d("div", di, " Aucun fil pour le moment. "))
3324
3381
  ])
3325
3382
  ])
3326
3383
  ]);
3327
3384
  }
3328
- const ui = /* @__PURE__ */ B(Wr, [["render", di], ["__scopeId", "data-v-1259e822"]]), hi = {
3385
+ const hi = /* @__PURE__ */ B(Kr, [["render", ui], ["__scopeId", "data-v-1259e822"]]), mi = {
3329
3386
  name: "WmMoreMenu",
3330
3387
  props: {
3331
3388
  canRename: { type: Boolean, default: !0 },
@@ -3352,17 +3409,17 @@ const ui = /* @__PURE__ */ B(Wr, [["render", di], ["__scopeId", "data-v-1259e822
3352
3409
  this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
3353
3410
  }
3354
3411
  }
3355
- }, mi = { class: "wm-mm" }, fi = {
3412
+ }, fi = { class: "wm-mm" }, _i = {
3356
3413
  class: "wm-mm__pop",
3357
3414
  role: "menu"
3358
- }, pi = { class: "wm-mm__section" }, _i = { class: "wm-mm__section" }, vi = { class: "wm-mm__section" };
3415
+ }, pi = { class: "wm-mm__section" }, vi = { class: "wm-mm__section" }, yi = { class: "wm-mm__section" };
3359
3416
  function gi(t, e, n, a, r, s) {
3360
- return l(), d("div", mi, [
3417
+ return l(), d("div", fi, [
3361
3418
  i("div", {
3362
3419
  class: "wm-mm__scrim",
3363
3420
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3364
3421
  }),
3365
- i("div", fi, [
3422
+ i("div", _i, [
3366
3423
  i("div", pi, [
3367
3424
  i("button", {
3368
3425
  type: "button",
@@ -3427,7 +3484,7 @@ function gi(t, e, n, a, r, s) {
3427
3484
  ])])) : w("", !0)
3428
3485
  ]),
3429
3486
  e[17] || (e[17] = i("div", { class: "wm-mm__sep" }, null, -1)),
3430
- i("div", _i, [
3487
+ i("div", vi, [
3431
3488
  i("button", {
3432
3489
  type: "button",
3433
3490
  class: "wm-mm__item",
@@ -3457,7 +3514,7 @@ function gi(t, e, n, a, r, s) {
3457
3514
  ])
3458
3515
  ]),
3459
3516
  e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
3460
- i("div", vi, [
3517
+ i("div", yi, [
3461
3518
  n.statusUrl ? (l(), d("button", {
3462
3519
  key: 0,
3463
3520
  type: "button",
@@ -3508,13 +3565,13 @@ function gi(t, e, n, a, r, s) {
3508
3565
  ])
3509
3566
  ]);
3510
3567
  }
3511
- const yi = /* @__PURE__ */ B(hi, [["render", gi], ["__scopeId", "data-v-c1bb81d2"]]), ge = "ww-messenger-tokens";
3568
+ const wi = /* @__PURE__ */ B(mi, [["render", gi], ["__scopeId", "data-v-c1bb81d2"]]), ye = "ww-messenger-tokens";
3512
3569
  function de(t) {
3513
3570
  var n;
3514
3571
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
3515
3572
  return e === "agent_ia" || e === "agent_human";
3516
3573
  }
3517
- function wi(t, e) {
3574
+ function bi(t, e) {
3518
3575
  if (!t || !e) return "";
3519
3576
  const n = Array.isArray(t.fields) ? t.fields : [], a = [];
3520
3577
  for (const r of n) {
@@ -3523,8 +3580,8 @@ function wi(t, e) {
3523
3580
  if (s == null || s === "") continue;
3524
3581
  let o;
3525
3582
  if (Array.isArray(s)) {
3526
- if (o = s.map((c) => re(r, String(c))).join(", "), !o) continue;
3527
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = re(r, String(s));
3583
+ if (o = s.map((c) => ae(r, String(c))).join(", "), !o) continue;
3584
+ } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ae(r, String(s));
3528
3585
  a.push(`${r.label} :
3529
3586
  ${o}`);
3530
3587
  }
@@ -3532,12 +3589,12 @@ ${o}`);
3532
3589
 
3533
3590
  `);
3534
3591
  }
3535
- function re(t, e) {
3592
+ function ae(t, e) {
3536
3593
  if (!Array.isArray(t == null ? void 0 : t.options)) return e;
3537
3594
  const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
3538
3595
  return (n == null ? void 0 : n.label) || e;
3539
3596
  }
3540
- function bi(t, e) {
3597
+ function ki(t, e) {
3541
3598
  const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3542
3599
  for (const r of a) {
3543
3600
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3545,8 +3602,8 @@ function bi(t, e) {
3545
3602
  if (s == null || s === "") continue;
3546
3603
  let o;
3547
3604
  if (Array.isArray(s)) {
3548
- if (o = s.map((v) => re(r, String(v))).join(", "), !o) continue;
3549
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = re(r, String(s));
3605
+ if (o = s.map((v) => ae(r, String(v))).join(", "), !o) continue;
3606
+ } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ae(r, String(s));
3550
3607
  const c = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3551
3608
  `));
3552
3609
  n.push({ label: r.label, value: o, multiline: c });
@@ -3559,20 +3616,20 @@ function bi(t, e) {
3559
3616
  }
3560
3617
  };
3561
3618
  }
3562
- const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
3619
+ const Ci = 450, Ai = 50, Si = 900, xi = 12e3, Mi = 300, Ti = {
3563
3620
  name: "Messenger",
3564
3621
  components: {
3565
- Launcher: Ge,
3566
- Header: yt,
3622
+ Launcher: Ke,
3623
+ Header: gt,
3567
3624
  Onboarding: Pt,
3568
- MessageList: Ms,
3625
+ MessageList: Ts,
3569
3626
  Composer: Gs,
3570
- SuggestionChips: Xs,
3571
- ApprovalCard: or,
3627
+ SuggestionChips: Qs,
3628
+ ApprovalCard: lr,
3572
3629
  FormCard: Rr,
3573
- Feedback: Vr,
3574
- HistoryDrawer: ui,
3575
- MoreMenu: yi
3630
+ Feedback: qr,
3631
+ HistoryDrawer: hi,
3632
+ MoreMenu: wi
3576
3633
  },
3577
3634
  // Make signAttachment available to deep children (AttachmentPreview)
3578
3635
  // without prop drilling. The store may not exist yet at provide-time
@@ -3925,7 +3982,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
3925
3982
  const e = (v = (c = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : c.pending) == null ? void 0 : v.prepared_params;
3926
3983
  if (!e || typeof e != "object") return "";
3927
3984
  const n = Object.entries(e);
3928
- return n.length ? n.slice(0, 2).map(([k, y]) => `${k}: ${y}`).join(" · ") : "";
3985
+ return n.length ? n.slice(0, 2).map(([k, g]) => `${k}: ${g}`).join(" · ") : "";
3929
3986
  },
3930
3987
  actionInFlight() {
3931
3988
  var t, e;
@@ -4095,9 +4152,9 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4095
4152
  hasWidgetId: !!this.widgetId,
4096
4153
  hasUserId: !!this.userId,
4097
4154
  hasUserHash: !!this.userHash
4098
- }), typeof document < "u" && !document.getElementById(ge)) {
4155
+ }), typeof document < "u" && !document.getElementById(ye)) {
4099
4156
  const t = document.createElement("style");
4100
- t.id = ge, t.textContent = Ne, document.head.appendChild(t);
4157
+ t.id = ye, t.textContent = Ne, document.head.appendChild(t);
4101
4158
  }
4102
4159
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
4103
4160
  },
@@ -4248,19 +4305,19 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4248
4305
  // bounded by MIN/MAX_BETWEEN_MS.
4249
4306
  scheduleReveal(t) {
4250
4307
  const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
4251
- Si,
4252
- Math.max(Ai, n * Ci)
4308
+ xi,
4309
+ Math.max(Si, n * Ai)
4253
4310
  ), s = Math.max(
4254
- e + ki,
4255
- this.nextRevealAt + xi
4311
+ e + Ci,
4312
+ this.nextRevealAt + Mi
4256
4313
  ) + a;
4257
4314
  this.nextRevealAt = s;
4258
4315
  const o = Math.max(0, s - e), c = t.id, v = setTimeout(() => {
4259
- this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((y) => y !== v);
4316
+ this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((g) => g !== v);
4260
4317
  }, o);
4261
4318
  this.revealTimers.push(v);
4262
4319
  const k = setTimeout(() => {
4263
- this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((y) => y !== k);
4320
+ this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((g) => g !== k);
4264
4321
  }, o + 4e3);
4265
4322
  this.revealTimers.push(k);
4266
4323
  },
@@ -4279,7 +4336,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4279
4336
  baseUrl: this.baseUrl,
4280
4337
  widgetId: this.widgetId,
4281
4338
  userId: this.userId
4282
- }), this.transport = fe($e({
4339
+ }), this.transport = fe(Re({
4283
4340
  baseUrl: this.baseUrl,
4284
4341
  widgetId: this.widgetId,
4285
4342
  userId: this.userId,
@@ -4423,18 +4480,18 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4423
4480
  t.created_at ? `Créée le : ${t.created_at}` : "",
4424
4481
  ""
4425
4482
  ];
4426
- for (const y of e) {
4427
- if (!y) continue;
4428
- const S = ((o = y.author) == null ? void 0 : o.name) || (((c = y.author) == null ? void 0 : c.type) === "user" ? "Vous" : ((v = y.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = y.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), $ = y.created_at ? new Date(y.created_at).toLocaleString("fr-FR") : "", A = (y.text_md || "").trim();
4429
- A && (n.push(`[${$}] ${S} :`), n.push(A), n.push(""));
4483
+ for (const g of e) {
4484
+ if (!g) continue;
4485
+ const S = ((o = g.author) == null ? void 0 : o.name) || (((c = g.author) == null ? void 0 : c.type) === "user" ? "Vous" : ((v = g.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = g.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), R = g.created_at ? new Date(g.created_at).toLocaleString("fr-FR") : "", A = (g.text_md || "").trim();
4486
+ A && (n.push(`[${R}] ${S} :`), n.push(A), n.push(""));
4430
4487
  }
4431
4488
  const a = new Blob([n.join(`
4432
4489
  `)], { type: "text/plain;charset=utf-8" });
4433
4490
  try {
4434
- const y = URL.createObjectURL(a), S = document.createElement("a");
4435
- S.href = y, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(y), 1e3);
4436
- } catch (y) {
4437
- console.error("[ww-messenger] export failed", y);
4491
+ const g = URL.createObjectURL(a), S = document.createElement("a");
4492
+ S.href = g, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(g), 1e3);
4493
+ } catch (g) {
4494
+ console.error("[ww-messenger] export failed", g);
4438
4495
  }
4439
4496
  },
4440
4497
  async onSend(t) {
@@ -4460,12 +4517,12 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4460
4517
  async onFormSubmit({ values: t }) {
4461
4518
  const e = this.pendingForm;
4462
4519
  if (!(e != null && e.form)) return;
4463
- const n = wi(e.form, t);
4520
+ const n = bi(e.form, t);
4464
4521
  if (!n) return;
4465
4522
  const a = this.currentConv;
4466
4523
  a && await this.store.send(a.id, n, {
4467
4524
  metadata: {
4468
- artifact: bi(e.form, t)
4525
+ artifact: ki(e.form, t)
4469
4526
  }
4470
4527
  });
4471
4528
  },
@@ -4509,7 +4566,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4509
4566
  }
4510
4567
  }
4511
4568
  }
4512
- }, Ti = {
4569
+ }, Oi = {
4513
4570
  key: 0,
4514
4571
  class: "wm-loading",
4515
4572
  "aria-busy": "true",
@@ -4517,7 +4574,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4517
4574
  }, Ii = {
4518
4575
  key: 0,
4519
4576
  class: "wm-state"
4520
- }, Oi = { class: "wm-state__err" }, Ei = { class: "wm-state__errSub" }, Bi = { class: "wm-bottom" }, Li = {
4577
+ }, Ei = { class: "wm-state__err" }, Bi = { class: "wm-state__errSub" }, Li = { class: "wm-bottom" }, $i = {
4521
4578
  key: 0,
4522
4579
  ref: "floatEl",
4523
4580
  class: "wm-float"
@@ -4526,16 +4583,16 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4526
4583
  class: "wm-actionWait",
4527
4584
  role: "status",
4528
4585
  "aria-live": "polite"
4529
- }, $i = { class: "wm-actionWait__lbl" }, Fi = {
4586
+ }, Fi = { class: "wm-actionWait__lbl" }, ji = {
4530
4587
  key: 1,
4531
4588
  class: "wm-attached"
4532
- }, ji = ["onClick"];
4533
- function Ui(t, e, n, a, r, s) {
4534
- const o = O("Launcher"), c = O("Header"), v = O("Onboarding"), k = O("MessageList"), y = O("ApprovalCard"), S = O("FormCard"), $ = O("Feedback"), A = O("SuggestionChips"), D = O("Composer"), x = O("MoreMenu"), N = O("HistoryDrawer");
4589
+ }, Ui = ["onClick"];
4590
+ function Di(t, e, n, a, r, s) {
4591
+ const o = I("Launcher"), c = I("Header"), v = I("Onboarding"), k = I("MessageList"), g = I("ApprovalCard"), S = I("FormCard"), R = I("Feedback"), A = I("SuggestionChips"), P = I("Composer"), x = I("MoreMenu"), D = I("HistoryDrawer");
4535
4592
  return l(), d("div", {
4536
4593
  class: E(["wm-root", `wm-root--${n.displayMode}`])
4537
4594
  }, [
4538
- !r.isOpen && !s.isEmbedded ? (l(), R(o, {
4595
+ !r.isOpen && !s.isEmbedded ? (l(), $(o, {
4539
4596
  key: 0,
4540
4597
  "unread-count": s.unreadCount,
4541
4598
  peek: s.launcherPeek,
@@ -4545,11 +4602,11 @@ function Ui(t, e, n, a, r, s) {
4545
4602
  r.isOpen || s.isEmbedded ? (l(), d("section", {
4546
4603
  key: 1,
4547
4604
  class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
4548
- style: V(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4605
+ style: G(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4549
4606
  role: "dialog",
4550
4607
  "aria-label": "Messenger"
4551
4608
  }, [
4552
- !s.ready && !s.error ? (l(), d("div", Ti, [
4609
+ !s.ready && !s.error ? (l(), d("div", Oi, [
4553
4610
  s.isEmbedded ? w("", !0) : (l(), d("button", {
4554
4611
  key: 0,
4555
4612
  type: "button",
@@ -4576,7 +4633,7 @@ function Ui(t, e, n, a, r, s) {
4576
4633
  "aria-hidden": "true"
4577
4634
  }, null, -1))
4578
4635
  ])) : (l(), d(M, { key: 1 }, [
4579
- z(c, {
4636
+ K(c, {
4580
4637
  title: s.headerTitle,
4581
4638
  escalated: s.isEscalated,
4582
4639
  "agent-name": s.humanAgentName,
@@ -4592,7 +4649,7 @@ function Ui(t, e, n, a, r, s) {
4592
4649
  onClose: s.close
4593
4650
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4594
4651
  s.error ? (l(), d("div", Ii, [
4595
- i("div", Oi, [
4652
+ i("div", Ei, [
4596
4653
  e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
4597
4654
  i("svg", {
4598
4655
  width: "14",
@@ -4610,11 +4667,11 @@ function Ui(t, e, n, a, r, s) {
4610
4667
  ], -1)),
4611
4668
  i("div", null, [
4612
4669
  e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4613
- i("div", Ei, b(s.error), 1)
4670
+ i("div", Bi, b(s.error), 1)
4614
4671
  ])
4615
4672
  ])
4616
4673
  ])) : s.currentConv ? (l(), d(M, { key: 2 }, [
4617
- z(k, {
4674
+ K(k, {
4618
4675
  ref: "messageList",
4619
4676
  messages: s.displayedMessages,
4620
4677
  "streaming-active": s.streamingActive,
@@ -4625,24 +4682,24 @@ function Ui(t, e, n, a, r, s) {
4625
4682
  "unread-anchor-ts": r.unreadAnchorTs,
4626
4683
  onLoadMore: s.onLoadMore
4627
4684
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "onLoadMore"]),
4628
- i("div", Bi, [
4629
- s.floatVisible ? (l(), d("div", Li, [
4630
- s.approvalReady ? (l(), R(y, {
4685
+ i("div", Li, [
4686
+ s.floatVisible ? (l(), d("div", $i, [
4687
+ s.approvalReady ? (l(), $(g, {
4631
4688
  key: 0,
4632
4689
  action: s.approvalTitle,
4633
4690
  detail: s.approvalDetail,
4634
4691
  callbacks: s.pendingApproval.callbacks,
4635
4692
  onCallback: s.onApprovalCallback
4636
- }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), R(S, {
4693
+ }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(S, {
4637
4694
  key: s.pendingForm.message && s.pendingForm.message.id,
4638
4695
  form: s.pendingForm.form,
4639
4696
  onSubmit: s.onFormSubmit
4640
- }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), R($, {
4697
+ }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(R, {
4641
4698
  key: 2,
4642
4699
  busy: r.feedbackBusy,
4643
4700
  done: r.feedbackDone,
4644
4701
  onSubmit: s.onFeedback
4645
- }, null, 8, ["busy", "done", "onSubmit"])) : (l(), R(A, {
4702
+ }, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(A, {
4646
4703
  key: 3,
4647
4704
  items: s.suggestions,
4648
4705
  onSelect: s.onSuggestion
@@ -4653,8 +4710,8 @@ function Ui(t, e, n, a, r, s) {
4653
4710
  class: "wm-actionWait__spinner",
4654
4711
  "aria-hidden": "true"
4655
4712
  }, null, -1)),
4656
- i("span", $i, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4657
- ])) : (l(), R(D, {
4713
+ i("span", Fi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4714
+ ])) : (l(), $(P, {
4658
4715
  key: 2,
4659
4716
  ref: "composer",
4660
4717
  modelValue: r.draft,
@@ -4666,7 +4723,7 @@ function Ui(t, e, n, a, r, s) {
4666
4723
  onAttach: s.onAttach
4667
4724
  }, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
4668
4725
  ]),
4669
- r.moreOpen ? (l(), R(x, {
4726
+ r.moreOpen ? (l(), $(x, {
4670
4727
  key: 0,
4671
4728
  "can-rename": !!s.currentConv,
4672
4729
  "can-clear": !!s.currentConv,
@@ -4678,9 +4735,9 @@ function Ui(t, e, n, a, r, s) {
4678
4735
  onNotifToggle: s.onNotifToggle,
4679
4736
  onAction: s.onMoreAction
4680
4737
  }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : w("", !0),
4681
- r.pendingAttachments.length ? (l(), d("div", Fi, [
4682
- (l(!0), d(M, null, j(r.pendingAttachments, (F, P) => (l(), d("div", {
4683
- key: P,
4738
+ r.pendingAttachments.length ? (l(), d("div", ji, [
4739
+ (l(!0), d(M, null, j(r.pendingAttachments, (F, N) => (l(), d("div", {
4740
+ key: N,
4684
4741
  class: "wm-attached__chip"
4685
4742
  }, [
4686
4743
  e[12] || (e[12] = i("svg", {
@@ -4700,7 +4757,7 @@ function Ui(t, e, n, a, r, s) {
4700
4757
  i("button", {
4701
4758
  type: "button",
4702
4759
  "aria-label": "Retirer",
4703
- onClick: (q) => r.pendingAttachments.splice(P, 1)
4760
+ onClick: (V) => r.pendingAttachments.splice(N, 1)
4704
4761
  }, [...e[11] || (e[11] = [
4705
4762
  i("svg", {
4706
4763
  width: "10",
@@ -4715,10 +4772,10 @@ function Ui(t, e, n, a, r, s) {
4715
4772
  }, [
4716
4773
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4717
4774
  ], -1)
4718
- ])], 8, ji)
4775
+ ])], 8, Ui)
4719
4776
  ]))), 128))
4720
4777
  ])) : w("", !0)
4721
- ], 64)) : (l(), R(v, {
4778
+ ], 64)) : (l(), $(v, {
4722
4779
  key: 1,
4723
4780
  "welcome-message": s.widgetWelcomeMessage,
4724
4781
  "agent-name": s.agentName,
@@ -4729,7 +4786,7 @@ function Ui(t, e, n, a, r, s) {
4729
4786
  onSelect: s.onQuickLink,
4730
4787
  onResume: s.onDrawerPick
4731
4788
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
4732
- r.historyOpen ? (l(), R(N, {
4789
+ r.historyOpen ? (l(), $(D, {
4733
4790
  key: 3,
4734
4791
  conversations: s.drawerConversations,
4735
4792
  "active-id": s.currentConv ? s.currentConv.id : null,
@@ -4737,7 +4794,7 @@ function Ui(t, e, n, a, r, s) {
4737
4794
  onNew: s.onDrawerNew,
4738
4795
  onPick: s.onDrawerPick
4739
4796
  }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : w("", !0),
4740
- r.moreOpen && !s.currentConv ? (l(), R(x, {
4797
+ r.moreOpen && !s.currentConv ? (l(), $(x, {
4741
4798
  key: 4,
4742
4799
  "can-rename": !1,
4743
4800
  "can-clear": !1,
@@ -4753,48 +4810,48 @@ function Ui(t, e, n, a, r, s) {
4753
4810
  ], 6)) : w("", !0)
4754
4811
  ], 2);
4755
4812
  }
4756
- const Pi = /* @__PURE__ */ B(Mi, [["render", Ui], ["__scopeId", "data-v-8264e504"]]), Hi = "0.2.21";
4813
+ const Hi = /* @__PURE__ */ B(Ti, [["render", Di], ["__scopeId", "data-v-8264e504"]]), zi = "0.2.22";
4757
4814
  export {
4758
- Q as AIAvatar,
4815
+ te as AIAvatar,
4759
4816
  ce as AVATAR_COLORS,
4760
4817
  Qt as ActionResult,
4761
- or as ApprovalCard,
4818
+ lr as ApprovalCard,
4762
4819
  on as ArtifactFormResponse,
4763
4820
  wn as ArtifactInfoCard,
4764
4821
  Un as ArtifactRenderer,
4765
- Rn as ArtifactTicket,
4822
+ $n as ArtifactTicket,
4766
4823
  Jn as AttachmentPreview,
4767
4824
  ss as Bubble,
4768
4825
  Gs as Composer,
4769
4826
  Pe as DEFAULT_BASE_URL,
4770
- Vr as Feedback,
4827
+ qr as Feedback,
4771
4828
  Rr as FormCard,
4772
- yt as Header,
4773
- ui as HistoryDrawer,
4829
+ gt as Header,
4830
+ hi as HistoryDrawer,
4774
4831
  ke as HumanAvatar,
4775
- Ge as Launcher,
4832
+ Ke as Launcher,
4776
4833
  he as MEDIA_RECORDER_SUPPORTED,
4777
- Ms as MessageList,
4778
- Pi as Messenger,
4779
- yi as MoreMenu,
4834
+ Ts as MessageList,
4835
+ Hi as Messenger,
4836
+ wi as MoreMenu,
4780
4837
  Pt as Onboarding,
4781
- se as SCREEN_CAPTURE_SUPPORTED,
4782
- Xs as SuggestionChips,
4838
+ ie as SCREEN_CAPTURE_SUPPORTED,
4839
+ Qs as SuggestionChips,
4783
4840
  ot as TeamAvatars,
4784
4841
  os as Typing,
4785
- Hi as VERSION,
4786
- ye as avatarColor,
4842
+ zi as VERSION,
4843
+ ge as avatarColor,
4787
4844
  we as avatarInitials,
4788
4845
  Is as captureScreenshotFile,
4789
4846
  U as colors,
4790
4847
  De as createStore,
4791
- $e as createTransport,
4792
- Pi as default,
4848
+ Re as createTransport,
4849
+ Hi as default,
4793
4850
  be as formatTime,
4794
- Ni as guessAttachmentKind,
4795
- Ts as pickRecorderMime,
4851
+ Pi as guessAttachmentKind,
4852
+ Os as pickRecorderMime,
4796
4853
  Zn as renderMarkdown,
4797
- Es as startScreenRecording,
4854
+ Bs as startScreenRecording,
4798
4855
  Ne as tokensCss,
4799
4856
  Ue as uuid,
4800
4857
  Ue as v4