@_solaris/messenger-widget 0.1.1 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/messenger.js CHANGED
@@ -1,15 +1,15 @@
1
- import { reactive as Ae, openBlock as l, createElementBlock as d, createVNode as z, Transition as Se, withCtx as xe, withKeys as ue, withModifiers as J, createElementVNode as i, toDisplayString as y, createCommentVNode as v, normalizeStyle as H, normalizeClass as B, Fragment as E, renderList as F, resolveComponent as O, createBlock as $, createTextVNode as se, resolveDynamicComponent as Me, renderSlot as Te, withDirectives as q, vModelText as G, vModelCheckbox as Ie, vModelSelect as Oe, createStaticVNode as de, markRaw as he } from "vue";
2
- const Ee = [
1
+ import { reactive as xe, openBlock as l, createElementBlock as c, createVNode as H, Transition as Me, withCtx as Te, withKeys as me, withModifiers as Y, createElementVNode as i, toDisplayString as b, createCommentVNode as g, normalizeStyle as P, normalizeClass as E, Fragment as O, renderList as F, resolveComponent as I, createBlock as $, createTextVNode as se, resolveDynamicComponent as Ie, renderSlot as Oe, withDirectives as V, vModelText as G, vModelCheckbox as Ee, vModelSelect as Be, createStaticVNode as ue, markRaw as fe } from "vue";
2
+ const Le = [
3
3
  "connected",
4
4
  "message",
5
5
  "message_stream",
6
6
  "conversation_updated",
7
7
  "config_updated",
8
8
  "action_status"
9
- ], Be = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 30 * 1e3;
10
- function $e(t) {
9
+ ], Re = 5 * 60 * 1e3, $e = 10 * 60 * 1e3, Fe = 5 * 60 * 1e3;
10
+ function je(t) {
11
11
  const e = {
12
- baseUrl: Fe(t.baseUrl || ""),
12
+ baseUrl: Ue(t.baseUrl || ""),
13
13
  widgetId: t.widgetId || "",
14
14
  userId: t.userId || "",
15
15
  userHash: t.userHash || "",
@@ -31,21 +31,21 @@ function $e(t) {
31
31
  throw new Error(
32
32
  "[transport] baseUrl, widgetId, userId, userHash are all required"
33
33
  );
34
- function n(m, _) {
35
- return e.listeners.has(m) || e.listeners.set(m, /* @__PURE__ */ new Set()), e.listeners.get(m).add(_), () => e.listeners.get(m).delete(_);
34
+ function n(h, f) {
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
- function a(m, _) {
38
- const b = e.listeners.get(m);
39
- b && b.forEach((S) => {
37
+ function a(h, f) {
38
+ const p = e.listeners.get(h);
39
+ p && p.forEach((k) => {
40
40
  try {
41
- S(_);
42
- } catch (M) {
43
- console.error("[transport] listener", m, M);
41
+ k(f);
42
+ } catch (T) {
43
+ console.error("[transport] listener", h, T);
44
44
  }
45
45
  });
46
46
  }
47
- function r(m) {
48
- e.connection !== m && (e.connection = m, a("connection", m));
47
+ function r(h) {
48
+ e.connection !== h && (e.connection = h, a("connection", h));
49
49
  }
50
50
  function s() {
51
51
  return {
@@ -54,36 +54,36 @@ function $e(t) {
54
54
  "X-Widget-Id": e.widgetId
55
55
  };
56
56
  }
57
- async function o(m, _, b) {
58
- const S = await fetch(`${e.baseUrl}${_}`, {
59
- method: m,
57
+ async function o(h, f, p) {
58
+ const k = await fetch(`${e.baseUrl}${f}`, {
59
+ method: h,
60
60
  headers: { "Content-Type": "application/json", ...s() },
61
- body: b !== void 0 ? JSON.stringify(b) : void 0
61
+ body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
- if (!S.ok) {
64
- const M = await c(S), D = new Error(
65
- `HTTP ${S.status} ${m} ${_} :: ${(M == null ? void 0 : M.error) || S.statusText}`
63
+ if (!k.ok) {
64
+ const T = await d(k), M = new Error(
65
+ `HTTP ${k.status} ${h} ${f} :: ${(T == null ? void 0 : T.error) || k.statusText}`
66
66
  );
67
- throw D.status = S.status, D.body = M, D;
67
+ throw M.status = k.status, M.body = T, M;
68
68
  }
69
- return S.status === 204 ? null : S.json();
69
+ return k.status === 204 ? null : k.json();
70
70
  }
71
- async function c(m) {
71
+ async function d(h) {
72
72
  try {
73
- return await m.json();
73
+ return await h.json();
74
74
  } catch {
75
75
  return null;
76
76
  }
77
77
  }
78
- async function p() {
79
- const [m, _] = await Promise.all([
78
+ async function v() {
79
+ const [h, f] = await Promise.all([
80
80
  // Public — no HMAC required.
81
- fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (b) => {
82
- if (!b.ok) {
83
- const S = await c(b);
84
- throw new Error(`HTTP ${b.status} GET /widgets/:id/config :: ${(S == null ? void 0 : S.error) || b.statusText}`);
81
+ fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
82
+ if (!p.ok) {
83
+ const k = await d(p);
84
+ throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(k == null ? void 0 : k.error) || p.statusText}`);
85
85
  }
86
- return b.json();
86
+ return p.json();
87
87
  }),
88
88
  // HMAC-protected.
89
89
  o("GET", "/customers/me")
@@ -91,212 +91,212 @@ function $e(t) {
91
91
  return {
92
92
  config: (
93
93
  /** @type {import('./types.js').BootstrapConfig} */
94
- m
94
+ h
95
95
  ),
96
- customer: (_ == null ? void 0 : _.customer) ?? null
96
+ customer: (f == null ? void 0 : f.customer) ?? null
97
97
  };
98
98
  }
99
- async function k() {
100
- const m = await o("GET", "/customers/me");
101
- return (m == null ? void 0 : m.customer) ?? null;
99
+ async function C() {
100
+ const h = await o("GET", "/customers/me");
101
+ return (h == null ? void 0 : h.customer) ?? null;
102
102
  }
103
- async function g(m) {
104
- const _ = await o("PATCH", "/customers/me", m);
105
- return (_ == null ? void 0 : _.customer) ?? null;
103
+ async function w(h) {
104
+ const f = await o("PATCH", "/customers/me", h);
105
+ return (f == null ? void 0 : f.customer) ?? null;
106
106
  }
107
- async function T() {
108
- const m = await o("GET", "/conversations");
109
- return (m == null ? void 0 : m.conversations) ?? [];
107
+ async function S() {
108
+ const h = await o("GET", "/conversations");
109
+ return (h == null ? void 0 : h.conversations) ?? [];
110
110
  }
111
- async function R(m = {}) {
112
- return (await o("POST", "/conversations", m)).conversation;
111
+ async function L(h = {}) {
112
+ return (await o("POST", "/conversations", h)).conversation;
113
113
  }
114
- async function x(m) {
115
- return (await o("GET", `/conversations/${encodeURIComponent(m)}`)).conversation;
114
+ async function A(h) {
115
+ return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
116
116
  }
117
- async function N(m, _) {
118
- return (await o("PATCH", `/conversations/${encodeURIComponent(m)}`, _)).conversation;
117
+ async function D(h, f) {
118
+ return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
119
119
  }
120
- async function I(m, _ = {}) {
121
- const b = new URLSearchParams();
122
- _.before && b.set("before", _.before), _.since && b.set("since", _.since), _.limit && b.set("limit", String(_.limit));
123
- const S = b.toString() ? `?${b.toString()}` : "";
120
+ async function x(h, f = {}) {
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 k = p.toString() ? `?${p.toString()}` : "";
124
124
  return o(
125
125
  "GET",
126
- `/conversations/${encodeURIComponent(m)}/messages${S}`
126
+ `/conversations/${encodeURIComponent(h)}/messages${k}`
127
127
  );
128
128
  }
129
- async function P(m, _) {
129
+ async function N(h, f) {
130
130
  W();
131
- const b = {
132
- client_msg_id: _.client_msg_id,
131
+ const p = {
132
+ client_msg_id: f.client_msg_id,
133
133
  type: "content",
134
- text_md: _.text_md,
134
+ text_md: f.text_md,
135
135
  author: { id: e.userId, type: "user" },
136
- created_at: _.created_at || (/* @__PURE__ */ new Date()).toISOString()
136
+ created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
137
137
  };
138
- return Array.isArray(_.attachments) && _.attachments.length && (b.payload = { type: "content", attachments: _.attachments }), _.metadata && typeof _.metadata == "object" && (b.metadata = _.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
- `/conversations/${encodeURIComponent(m)}/messages`,
141
- b
140
+ `/conversations/${encodeURIComponent(h)}/messages`,
141
+ p
142
142
  );
143
143
  }
144
- async function U(m, _, b) {
144
+ async function j(h, f, p) {
145
145
  return W(), o(
146
146
  "POST",
147
- `/messages/${encodeURIComponent(m)}/callbacks/${encodeURIComponent(_)}`,
148
- b ? { inputs: b } : {}
147
+ `/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
148
+ p ? { inputs: p } : {}
149
149
  );
150
150
  }
151
- async function V(m) {
152
- const _ = (
151
+ async function z(h) {
152
+ const f = (
153
153
  /** @type {File} */
154
- m.name || "attachment"
155
- ), b = m.type || "application/octet-stream", S = m.size || 0, M = (
154
+ h.name || "attachment"
155
+ ), p = h.type || "application/octet-stream", k = h.size || 0, T = (
156
156
  /** @type {import('./types.js').AttachmentUploadTicket} */
157
157
  await o("POST", "/attachments", {
158
- mime_type: b,
159
- size_bytes: S,
160
- name: _
158
+ mime_type: p,
159
+ size_bytes: k,
160
+ name: f
161
161
  })
162
- ), D = await fetch(M.upload_url, {
162
+ ), M = await fetch(T.upload_url, {
163
163
  method: "PUT",
164
- headers: { "Content-Type": b },
165
- body: m
164
+ headers: { "Content-Type": p },
165
+ body: h
166
166
  });
167
- if (!D.ok)
168
- throw new Error(`HTTP ${D.status} PUT signed upload`);
167
+ if (!M.ok)
168
+ throw new Error(`HTTP ${M.status} PUT signed upload`);
169
169
  return {
170
- type: Ue(b),
171
- path: M.path,
172
- mime_type: b,
173
- size_bytes: S
170
+ type: De(p),
171
+ path: T.path,
172
+ mime_type: p,
173
+ size_bytes: k
174
174
  };
175
175
  }
176
- async function Q(m) {
176
+ async function X(h) {
177
177
  return o(
178
178
  "GET",
179
- `/attachments/sign?path=${encodeURIComponent(m)}`
179
+ `/attachments/sign?path=${encodeURIComponent(h)}`
180
180
  );
181
181
  }
182
- function Z() {
183
- const m = new URLSearchParams({
182
+ function re() {
183
+ const h = new URLSearchParams({
184
184
  userId: e.userId,
185
185
  userHash: e.userHash,
186
186
  widgetId: e.widgetId
187
187
  }).toString();
188
- return `${e.baseUrl}/stream?${m}`;
188
+ return `${e.baseUrl}/stream?${h}`;
189
189
  }
190
- function K() {
190
+ function q() {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
- const m = new EventSource(Z());
194
- for (const _ of Ee)
195
- m.addEventListener(_, (b) => re(_, b.data));
196
- m.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = m, r("open");
197
- } catch (m) {
198
- console.error("[transport] SSE open failed", m), a("error", m);
193
+ const h = new EventSource(re());
194
+ for (const f of Le)
195
+ h.addEventListener(f, (p) => ie(f, p.data));
196
+ h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
197
+ } catch (h) {
198
+ console.error("[transport] SSE open failed", h), a("error", h);
199
199
  }
200
200
  }
201
- function re(m, _) {
201
+ function ie(h, f) {
202
202
  try {
203
- const b = JSON.parse(_), S = b && typeof b == "object" && "data" in b ? b.data : b;
204
- a(m, S);
205
- } catch (b) {
206
- console.error("[transport] bad SSE payload", m, b);
203
+ const p = JSON.parse(f), k = p && typeof p == "object" && "data" in p ? p.data : p;
204
+ a(h, k);
205
+ } catch (p) {
206
+ console.error("[transport] bad SSE payload", h, p);
207
207
  }
208
208
  }
209
- function Y() {
209
+ function K() {
210
210
  e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
211
211
  }
212
212
  function W() {
213
- clearTimeout(e.burstTimer), K(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
- e.panelOpen || Y();
215
- }, Le));
213
+ clearTimeout(e.burstTimer), q(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
+ e.panelOpen || K();
215
+ }, $e));
216
216
  }
217
- function ie(m) {
218
- e.panelOpen = !!m, e.panelOpen ? (clearTimeout(e.burstTimer), K()) : W();
217
+ function ae(h) {
218
+ e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), q()) : W();
219
219
  }
220
- async function u() {
220
+ async function oe() {
221
221
  try {
222
- const m = await T(), _ = m.reduce((S, M) => {
223
- const D = M == null ? void 0 : M.last_message_at;
224
- return D && (!S || D > S) ? D : S;
222
+ const h = await S(), f = h.reduce((k, T) => {
223
+ const M = T == null ? void 0 : T.last_message_at;
224
+ return M && (!k || M > k) ? M : k;
225
225
  }, null);
226
- _ && (!e.lastActivityAt || _ > e.lastActivityAt) && (e.lastActivityAt = _, a("activity", { conversations: m, latestAt: _ }), W());
227
- } catch (m) {
228
- console.error("[transport] poll failed", m);
226
+ f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), W());
227
+ } catch (h) {
228
+ console.error("[transport] poll failed", h);
229
229
  }
230
230
  }
231
- function h() {
232
- f(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(u, Be));
231
+ function Q() {
232
+ u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(oe, Re));
233
233
  }
234
- function f() {
234
+ function u() {
235
235
  e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
236
236
  }
237
- function w() {
237
+ function m() {
238
238
  if (document.hidden)
239
239
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
240
- e.hiddenGraceTimer = null, document.hidden && (f(), Y(), r("paused"));
241
- }, Re);
240
+ e.hiddenGraceTimer = null, document.hidden && (u(), K(), r("paused"));
241
+ }, Fe);
242
242
  else {
243
243
  if (e.hiddenGraceTimer) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
245
245
  return;
246
246
  }
247
- r("idle"), h(), e.panelOpen && K();
247
+ r("idle"), Q(), e.panelOpen && q();
248
248
  }
249
249
  }
250
- async function A() {
250
+ async function _() {
251
251
  if (e.started) return e.lastBootstrap;
252
252
  e.started = !0;
253
- const m = await p();
254
- e.lastBootstrap = m;
253
+ const h = await v();
254
+ e.lastBootstrap = h;
255
255
  try {
256
- const _ = await T();
257
- e.lastActivityAt = _.reduce((b, S) => {
258
- const M = S == null ? void 0 : S.last_message_at;
259
- return M && (!b || M > b) ? M : b;
256
+ const f = await S();
257
+ e.lastActivityAt = f.reduce((p, k) => {
258
+ const T = k == null ? void 0 : k.last_message_at;
259
+ return T && (!p || T > p) ? T : p;
260
260
  }, null);
261
- } catch (_) {
262
- console.error("[transport] initial /conversations failed", _);
261
+ } catch (f) {
262
+ console.error("[transport] initial /conversations failed", f);
263
263
  }
264
- return typeof document < "u" && (e.visibilityHandler = w, document.addEventListener("visibilitychange", e.visibilityHandler)), h(), m;
264
+ return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), Q(), h;
265
265
  }
266
- function C() {
267
- f(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, Y(), 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, K(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
268
268
  }
269
269
  return {
270
270
  on: n,
271
- start: A,
272
- stop: C,
273
- setPanelOpen: ie,
271
+ start: _,
272
+ stop: y,
273
+ setPanelOpen: ae,
274
274
  // REST
275
- bootstrap: p,
276
- getCustomer: k,
277
- patchCustomer: g,
278
- listConversations: T,
279
- createConversation: R,
280
- getConversation: x,
281
- patchConversation: N,
282
- listMessages: I,
283
- postMessage: P,
284
- postCallback: U,
285
- uploadAttachment: V,
286
- signAttachment: Q,
275
+ bootstrap: v,
276
+ getCustomer: C,
277
+ patchCustomer: w,
278
+ listConversations: S,
279
+ createConversation: L,
280
+ getConversation: A,
281
+ patchConversation: D,
282
+ listMessages: x,
283
+ postMessage: N,
284
+ postCallback: j,
285
+ uploadAttachment: z,
286
+ signAttachment: X,
287
287
  // Read-only state
288
288
  get connection() {
289
289
  return e.connection;
290
290
  }
291
291
  };
292
292
  }
293
- function Fe(t) {
293
+ function Ue(t) {
294
294
  return t.endsWith("/") ? t.slice(0, -1) : t;
295
295
  }
296
- function Ue(t) {
296
+ function De(t) {
297
297
  return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
298
298
  }
299
- function De() {
299
+ function Ne() {
300
300
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
301
301
  return crypto.randomUUID();
302
302
  const t = new Uint8Array(16);
@@ -308,8 +308,8 @@ function De() {
308
308
  const e = [...t].map((n) => n.toString(16).padStart(2, "0"));
309
309
  return e.slice(0, 4).join("") + "-" + e.slice(4, 6).join("") + "-" + e.slice(6, 8).join("") + "-" + e.slice(8, 10).join("") + "-" + e.slice(10, 16).join("");
310
310
  }
311
- function je(t) {
312
- const e = Ae({
311
+ function Pe(t) {
312
+ const e = xe({
313
313
  ready: !1,
314
314
  error: null,
315
315
  config: null,
@@ -343,32 +343,32 @@ function je(t) {
343
343
  n.push(t.on("connection", (u) => {
344
344
  e.connection = u;
345
345
  })), n.push(t.on("message", (u) => {
346
- const h = u == null ? void 0 : u.conversation_id, f = u == null ? void 0 : u.message;
347
- !h || !(f != null && f.id) || (Z(h, f), f.client_msg_id && delete e.streamingByMsgId[f.client_msg_id], Y(h, f.created_at));
346
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
347
+ !m || !(_ != null && _.id) || (q(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], W(m, _.created_at));
348
348
  })), n.push(t.on("message_stream", (u) => {
349
- const h = u == null ? void 0 : u.message_id, f = u == null ? void 0 : u.token;
350
- !h || typeof f != "string" || (e.streamingByMsgId[h] = (e.streamingByMsgId[h] || "") + f);
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 h = u == null ? void 0 : u.conversation_id, f = u == null ? void 0 : u.changes;
353
- if (!h || !f) return;
354
- const w = e.conversations.findIndex((A) => A.id === h);
355
- w !== -1 && (e.conversations[w] = { ...e.conversations[w], ...f });
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 h = u == null ? void 0 : u.conversation_id, f = u == null ? void 0 : u.action_id, w = u == null ? void 0 : u.action_name;
360
- if (!h || !f) return;
361
- const A = e.runningActionsByConv[h] || {};
362
- u.state === "running" ? (A[f] = w || f, e.runningActionsByConv[h] = { ...A }) : u.state === "done" && (delete A[f], e.runningActionsByConv[h] = { ...A });
359
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, y = u == null ? void 0 : u.action_name;
360
+ if (!m || !_) return;
361
+ const h = e.runningActionsByConv[m] || {};
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
- (f, w) => setTimeout(() => w(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
370
- ), h = await Promise.race([t.start(), u]);
371
- e.config = h.config, e.customer = h.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
369
+ (_, y) => setTimeout(() => y(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
370
+ ), m = await Promise.race([t.start(), u]);
371
+ e.config = m.config, e.customer = m.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
372
372
  } catch (u) {
373
373
  console.error("[store] start failed", u), e.error = (u == null ? void 0 : u.message) || String(u);
374
374
  }
@@ -381,239 +381,258 @@ function je(t) {
381
381
  }
382
382
  t.stop();
383
383
  }
384
- async function s(u = {}) {
385
- const h = await t.createConversation(u), f = e.conversations.findIndex((w) => w.id === h.id);
386
- return f === -1 ? e.conversations = [h, ...e.conversations] : e.conversations[f] = h, h;
384
+ async function s(u) {
385
+ const m = oe(u);
386
+ if (!m) return e.customer;
387
+ try {
388
+ const _ = await t.patchCustomer(m);
389
+ _ && (e.customer = _);
390
+ } catch (_) {
391
+ console.error("[store] applyCustomer failed", _);
392
+ }
393
+ return e.customer;
387
394
  }
388
- const o = 50;
389
- async function c(u) {
395
+ async function o(u = {}) {
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
+ }
399
+ const d = 50;
400
+ async function v(u) {
390
401
  if (e.messagesByConv[u]) return;
391
- const h = await t.listMessages(u, { limit: o });
392
- e.messagesByConv[u] = (h == null ? void 0 : h.messages) ?? [], k(u, {
393
- nextCursor: (h == null ? void 0 : h.next_cursor) ?? null,
402
+ const m = await t.listMessages(u, { limit: d });
403
+ e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], w(u, {
404
+ nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
394
405
  loading: !1,
395
406
  loaded: !0
396
407
  });
397
408
  }
398
- async function p(u) {
399
- const h = e.paginationByConv[u];
400
- if (!(!h || h.loading || !h.nextCursor)) {
401
- k(u, { ...h, loading: !0 });
409
+ async function C(u) {
410
+ const m = e.paginationByConv[u];
411
+ if (!(!m || m.loading || !m.nextCursor)) {
412
+ w(u, { ...m, loading: !0 });
402
413
  try {
403
- let A = h.nextCursor, C = [], m = 0;
404
- for (; m < 6 && A; m++) {
405
- const M = await t.listMessages(u, {
406
- before: A,
407
- limit: o
408
- }), D = (M == null ? void 0 : M.messages) ?? [];
409
- if (C = [...D, ...C], A = (M == null ? void 0 : M.next_cursor) ?? null, !D.length || C.length >= 60) break;
414
+ let h = m.nextCursor, f = [], p = 0;
415
+ for (; p < 6 && h; p++) {
416
+ const R = await t.listMessages(u, {
417
+ before: h,
418
+ limit: d
419
+ }), Z = (R == null ? void 0 : R.messages) ?? [];
420
+ if (f = [...Z, ...f], h = (R == null ? void 0 : R.next_cursor) ?? null, !Z.length || f.length >= 60) break;
410
421
  }
411
- const _ = e.messagesByConv[u] || [], b = new Set(_.map((M) => String(M == null ? void 0 : M.id))), S = [...C.filter((M) => !b.has(String(M == null ? void 0 : M.id))), ..._];
412
- e.messagesByConv[u] = S, k(u, {
413
- nextCursor: A,
422
+ const k = e.messagesByConv[u] || [], T = new Set(k.map((R) => String(R == null ? void 0 : R.id))), M = [...f.filter((R) => !T.has(String(R == null ? void 0 : R.id))), ...k];
423
+ e.messagesByConv[u] = M, w(u, {
424
+ nextCursor: h,
414
425
  loading: !1,
415
426
  loaded: !0
416
427
  });
417
- } catch (f) {
418
- console.error("[store] loadMore failed", f), k(u, { ...h, loading: !1 });
428
+ } catch (_) {
429
+ console.error("[store] loadMore failed", _), w(u, { ...m, loading: !1 });
419
430
  }
420
431
  }
421
432
  }
422
- function k(u, h) {
423
- e.paginationByConv = { ...e.paginationByConv, [u]: h };
433
+ function w(u, m) {
434
+ e.paginationByConv = { ...e.paginationByConv, [u]: m };
424
435
  }
425
- async function g(u, h) {
426
- const f = await t.patchConversation(u, h), w = e.conversations.findIndex((A) => A.id === u);
427
- w !== -1 && (e.conversations[w] = f);
436
+ async function S(u, m) {
437
+ const _ = await t.patchConversation(u, m), y = e.conversations.findIndex((h) => h.id === u);
438
+ y !== -1 && (e.conversations[y] = _);
428
439
  }
429
- async function T(u, h, { attachments: f, metadata: w } = {}) {
430
- var S;
431
- const A = (h || "").trim(), C = Array.isArray(f) && f.length > 0;
432
- if (!u || !A && !C) return;
433
- const m = De(), _ = ie(u), b = {
434
- id: m,
435
- client_msg_id: m,
440
+ async function L(u, m, { attachments: _, metadata: y } = {}) {
441
+ var M;
442
+ const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
443
+ if (!u || !h && !f) return;
444
+ const p = Ne(), k = Q(u), T = {
445
+ id: p,
446
+ client_msg_id: p,
436
447
  conversation_id: u,
437
448
  type: "content",
438
- text_md: A,
449
+ text_md: h,
439
450
  author: {
440
451
  type: "user",
441
- id: ((S = e.customer) == null ? void 0 : S.external_id) || null
452
+ id: ((M = e.customer) == null ? void 0 : M.external_id) || null
442
453
  },
443
- created_at: _,
454
+ created_at: k,
444
455
  // Local-only flag — UI may render dimmed until the SSE echo lands.
445
456
  _pending: !0,
446
- ...C ? { payload: { type: "content", attachments: f } } : {},
447
- ...w && typeof w == "object" ? { metadata: w } : {}
457
+ ...f ? { payload: { type: "content", attachments: _ } } : {},
458
+ ...y && typeof y == "object" ? { metadata: y } : {}
448
459
  };
449
- Z(u, b);
460
+ q(u, T);
450
461
  try {
451
462
  await t.postMessage(u, {
452
- client_msg_id: m,
453
- text_md: A,
454
- created_at: _,
455
- ...C ? { attachments: f } : {},
456
- ...w && typeof w == "object" ? { metadata: w } : {}
463
+ client_msg_id: p,
464
+ text_md: h,
465
+ created_at: k,
466
+ ...f ? { attachments: _ } : {},
467
+ ...y && typeof y == "object" ? { metadata: y } : {}
457
468
  });
458
- } catch (M) {
459
- console.error("[store] send failed", M), re(u, m, { _failed: !0, _pending: !1 });
469
+ } catch (R) {
470
+ console.error("[store] send failed", R), K(u, p, { _failed: !0, _pending: !1 });
460
471
  }
461
472
  }
462
- async function R(u, h, f) {
473
+ async function A(u, m, _) {
463
474
  u != null && (e.awaitingCallback[u] = !0);
464
475
  try {
465
- await t.postCallback(u, h, f);
466
- } catch (w) {
467
- console.error("[store] callback failed", w), 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];
468
479
  }
469
480
  }
470
- const x = /* @__PURE__ */ new Map();
471
- async function N(u) {
481
+ const D = /* @__PURE__ */ new Map();
482
+ async function x(u) {
472
483
  if (!u) return null;
473
- const h = x.get(u);
474
- if (h != null && h.url) {
475
- const f = h.expires_at ? Date.parse(h.expires_at) : 0;
476
- if (!f || f - Date.now() > 6e4) return h.url;
484
+ const m = D.get(u);
485
+ if (m != null && m.url) {
486
+ const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
487
+ if (!_ || _ - Date.now() > 6e4) return m.url;
477
488
  }
478
489
  try {
479
- const f = await t.signAttachment(u);
480
- if (f != null && f.signed_url)
481
- return x.set(u, { url: f.signed_url, expires_at: f.expires_at }), f.signed_url;
482
- } catch (f) {
483
- console.error("[store] sign attachment failed", f);
490
+ const _ = await t.signAttachment(u);
491
+ if (_ != null && _.signed_url)
492
+ return D.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
493
+ } catch (_) {
494
+ console.error("[store] sign attachment failed", _);
484
495
  }
485
496
  return null;
486
497
  }
487
- async function I(u, { rating: h, comment: f } = {}) {
488
- const w = e.conversations.find((m) => m.id === u), C = {
489
- ...(w == null ? void 0 : w.metadata) || {},
498
+ async function N(u, { rating: m, comment: _ } = {}) {
499
+ const y = e.conversations.find((p) => p.id === u), f = {
500
+ ...(y == null ? void 0 : y.metadata) || {},
490
501
  feedback: {
491
- rating: h,
492
- comment: f || null,
502
+ rating: m,
503
+ comment: _ || null,
493
504
  submitted_at: (/* @__PURE__ */ new Date()).toISOString()
494
505
  }
495
506
  };
496
- await g(u, { metadata: C });
507
+ await S(u, { metadata: f });
497
508
  }
498
- function P(u) {
499
- var f, w;
500
- const h = e.messagesByConv[u] || [];
501
- for (let A = h.length - 1; A >= 0; A--) {
502
- const C = h[A];
503
- if ((C == null ? void 0 : C.type) === "action" && ((f = C == null ? void 0 : C.payload) == null ? void 0 : f.type) === "action" && ((w = C == null ? void 0 : C.payload) == null ? void 0 : w.state) === "pending" && Array.isArray(C == null ? void 0 : C.callbacks) && C.callbacks.length > 0 && !e.awaitingCallback[C.id])
504
- return C;
509
+ function j(u) {
510
+ var _, y;
511
+ const m = e.messagesByConv[u] || [];
512
+ for (let h = m.length - 1; h >= 0; h--) {
513
+ const f = m[h];
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
+ return f;
505
516
  }
506
517
  return null;
507
518
  }
508
- function U(u) {
509
- var f, w, A;
510
- const h = e.messagesByConv[u] || [];
511
- for (let C = h.length - 1; C >= 0; C--) {
512
- const m = h[C];
513
- if (((f = m == null ? void 0 : m.author) == null ? void 0 : f.type) === "user" || (m == null ? void 0 : m.type) === "action" && ((w = m == null ? void 0 : m.payload) == null ? void 0 : w.state) === "pending") return null;
514
- const _ = (A = m == null ? void 0 : m.metadata) == null ? void 0 : A.form;
515
- if (_ && Array.isArray(_.fields) && _.fields.length > 0)
516
- return { message: m, form: _ };
519
+ function z(u) {
520
+ var _, y, h;
521
+ const m = e.messagesByConv[u] || [];
522
+ for (let f = m.length - 1; f >= 0; f--) {
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 k = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
526
+ if (k && Array.isArray(k.fields) && k.fields.length > 0)
527
+ return { message: p, form: k };
517
528
  }
518
529
  return null;
519
530
  }
520
- function V(u) {
521
- const h = e.runningActionsByConv[u];
522
- if (!h) return null;
523
- const f = Object.keys(h);
524
- if (f.length === 0) return null;
525
- const w = f[0];
526
- return { id: w, payload: { name: h[w] } };
531
+ function X(u) {
532
+ const m = e.runningActionsByConv[u];
533
+ if (!m) return null;
534
+ const _ = Object.keys(m);
535
+ if (_.length === 0) return null;
536
+ const y = _[0];
537
+ return { id: y, payload: { name: m[y] } };
527
538
  }
528
- function Q(u) {
529
- var f, w, A, C;
530
- const h = e.messagesByConv[u] || [];
531
- for (let m = h.length - 1; m >= 0; m--) {
532
- const _ = h[m];
533
- if (((f = _ == null ? void 0 : _.author) == null ? void 0 : f.type) === "user") return [];
534
- if ((_ == null ? void 0 : _.type) === "action" && ((w = _ == null ? void 0 : _.payload) == null ? void 0 : w.state) === "pending") return [];
535
- if (((A = _ == null ? void 0 : _.author) == null ? void 0 : A.type) !== "agent_ia") continue;
536
- const b = (C = _ == null ? void 0 : _.metadata) == null ? void 0 : C.suggested_replies;
537
- return Array.isArray(b) && b.length ? b.map((S) => {
538
- if (typeof S == "string") {
539
- const M = S.trim();
540
- return M ? { label: M, kind: null } : null;
539
+ function re(u) {
540
+ var _, y, h, f;
541
+ const m = e.messagesByConv[u] || [];
542
+ for (let p = m.length - 1; p >= 0; p--) {
543
+ const k = m[p];
544
+ if (((_ = k == null ? void 0 : k.author) == null ? void 0 : _.type) === "user") return [];
545
+ if ((k == null ? void 0 : k.type) === "action" && ((y = k == null ? void 0 : k.payload) == null ? void 0 : y.state) === "pending") return [];
546
+ if (((h = k == null ? void 0 : k.author) == null ? void 0 : h.type) !== "agent_ia") continue;
547
+ const T = (f = k == null ? void 0 : k.metadata) == null ? void 0 : f.suggested_replies;
548
+ return Array.isArray(T) && T.length ? T.map((M) => {
549
+ if (typeof M == "string") {
550
+ const R = M.trim();
551
+ return R ? { label: R, kind: null } : null;
541
552
  }
542
- if (S && typeof S == "object" && typeof S.label == "string") {
543
- const M = S.label.trim();
544
- if (!M) return null;
545
- const D = S.kind === "cta" || S.kind === "choice" || S.kind === "followup" ? S.kind : null;
546
- return { label: M, kind: D };
553
+ if (M && typeof M == "object" && typeof M.label == "string") {
554
+ const R = M.label.trim();
555
+ if (!R) return null;
556
+ const Z = M.kind === "cta" || M.kind === "choice" || M.kind === "followup" ? M.kind : null;
557
+ return { label: R, kind: Z };
547
558
  }
548
559
  return null;
549
560
  }).filter(Boolean).slice(0, 4) : [];
550
561
  }
551
562
  return [];
552
563
  }
553
- function Z(u, h) {
554
- var C;
555
- const f = e.messagesByConv[u] || [];
556
- let w = -1;
557
- h != null && h.client_msg_id && (w = f.findIndex(
558
- (m) => (m == null ? void 0 : m.client_msg_id) && m.client_msg_id === h.client_msg_id
559
- )), w === -1 && (h == null ? void 0 : h.id) !== void 0 && (h == null ? void 0 : h.id) !== null && (w = f.findIndex((m) => K(m == null ? void 0 : m.id, h.id)));
560
- let A;
561
- w === -1 ? A = [...f, h].sort(W) : (A = f.slice(), A[w] = { ...f[w], ...h, _pending: !1, _failed: !1 }), e.messagesByConv[u] = A, (h == null ? void 0 : h.type) === "action" && ((C = h == null ? void 0 : h.payload) != null && C.state) && h.payload.state !== "pending" && (h == null ? void 0 : h.id) != null && e.awaitingCallback[h.id] && delete e.awaitingCallback[h.id];
564
+ function q(u, m) {
565
+ var f;
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) => ie(p == null ? void 0 : p.id, m.id)));
571
+ let h;
572
+ y === -1 ? h = [..._, m].sort(ae) : (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];
562
573
  }
563
- function K(u, h) {
564
- return u === h ? !0 : u == null || h == null ? !1 : String(u) === String(h);
574
+ function ie(u, m) {
575
+ return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
565
576
  }
566
- function re(u, h, f) {
567
- const w = e.messagesByConv[u];
568
- if (!w) return;
569
- const A = w.findIndex((m) => m.id === h);
570
- if (A === -1) return;
571
- const C = w.slice();
572
- C[A] = { ...w[A], ...f }, e.messagesByConv[u] = C;
577
+ function K(u, m, _) {
578
+ const y = e.messagesByConv[u];
579
+ if (!y) return;
580
+ const h = y.findIndex((p) => p.id === m);
581
+ if (h === -1) return;
582
+ const f = y.slice();
583
+ f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
573
584
  }
574
- function Y(u, h) {
575
- const f = e.conversations.findIndex((A) => A.id === u);
576
- if (f === -1) return;
577
- const w = e.conversations[f];
578
- if (h && (!w.last_message_at || h > w.last_message_at)) {
579
- const A = e.conversations.slice();
580
- A[f] = { ...w, last_message_at: h }, A.sort(
581
- (C, m) => (m.last_message_at || "").localeCompare(C.last_message_at || "")
582
- ), e.conversations = A;
585
+ function W(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
+ const h = e.conversations.slice();
591
+ h[_] = { ...y, last_message_at: m }, h.sort(
592
+ (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
593
+ ), e.conversations = h;
583
594
  }
584
595
  }
585
- function W(u, h) {
586
- return (u.created_at || "").localeCompare(h.created_at || "");
596
+ function ae(u, m) {
597
+ return (u.created_at || "").localeCompare(m.created_at || "");
587
598
  }
588
- function ie(u) {
589
- const h = e.messagesByConv[u] || [];
590
- let f = "";
591
- for (const C of h)
592
- C != null && C.created_at && C.created_at > f && (f = C.created_at);
593
- const w = (/* @__PURE__ */ new Date()).toISOString();
594
- return !f || w > f ? w : new Date(Date.parse(f) + 1).toISOString();
599
+ function oe(u) {
600
+ if (!u || typeof u != "object") return 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
+ }
606
+ function Q(u) {
607
+ const m = e.messagesByConv[u] || [];
608
+ let _ = "";
609
+ for (const f of m)
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();
595
613
  }
596
614
  return {
597
615
  state: e,
598
616
  start: a,
599
617
  destroy: r,
600
- createConversation: s,
601
- openConversation: c,
602
- loadMore: p,
603
- patchConversation: g,
604
- send: T,
605
- clickCallback: R,
606
- signAttachment: N,
607
- submitFeedback: I,
608
- getPendingApproval: P,
609
- getActionInFlight: V,
610
- getLatestSuggestions: Q,
611
- getLatestForm: U,
618
+ applyCustomer: s,
619
+ createConversation: o,
620
+ openConversation: v,
621
+ loadMore: C,
622
+ patchConversation: S,
623
+ send: L,
624
+ clickCallback: A,
625
+ signAttachment: x,
626
+ submitFeedback: N,
627
+ getPendingApproval: j,
628
+ getActionInFlight: X,
629
+ getLatestSuggestions: re,
630
+ getLatestForm: z,
612
631
  // Pass-through for panel open/close (controls SSE burst).
613
632
  setPanelOpen: t.setPanelOpen
614
633
  };
615
634
  }
616
- const j = {
635
+ const U = {
617
636
  w: "#ffffff",
618
637
  g50: "#F9F9F7",
619
638
  g100: "#F2F1EE",
@@ -629,37 +648,37 @@ const j = {
629
648
  green: "#22C55E",
630
649
  red: "#B91C1C",
631
650
  redBg: "#FDECEC"
632
- }, ae = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
633
- function ve(t = "") {
634
- return t ? ae[t.charCodeAt(0) % ae.length] : ae[0];
635
- }
651
+ }, le = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
636
652
  function ge(t = "") {
653
+ return t ? le[t.charCodeAt(0) % le.length] : le[0];
654
+ }
655
+ function we(t = "") {
637
656
  return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
638
657
  }
639
- function ye(t = /* @__PURE__ */ new Date()) {
658
+ function be(t = /* @__PURE__ */ new Date()) {
640
659
  return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
641
660
  }
642
- const Ne = `
661
+ const He = `
643
662
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
644
663
 
645
664
  .wm-root {
646
665
  --wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
647
666
  --wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
648
- --wm-w: ${j.w};
649
- --wm-g50: ${j.g50};
650
- --wm-g100: ${j.g100};
651
- --wm-g150: ${j.g150};
652
- --wm-g200: ${j.g200};
653
- --wm-g300: ${j.g300};
654
- --wm-g400: ${j.g400};
655
- --wm-g500: ${j.g500};
656
- --wm-g700: ${j.g700};
657
- --wm-g900: ${j.g900};
658
- --wm-a: ${j.accent};
659
- --wm-al: ${j.accentLight};
660
- --wm-green: ${j.green};
661
- --wm-red: ${j.red};
662
- --wm-redBg: ${j.redBg};
667
+ --wm-w: ${U.w};
668
+ --wm-g50: ${U.g50};
669
+ --wm-g100: ${U.g100};
670
+ --wm-g150: ${U.g150};
671
+ --wm-g200: ${U.g200};
672
+ --wm-g300: ${U.g300};
673
+ --wm-g400: ${U.g400};
674
+ --wm-g500: ${U.g500};
675
+ --wm-g700: ${U.g700};
676
+ --wm-g900: ${U.g900};
677
+ --wm-a: ${U.accent};
678
+ --wm-al: ${U.accentLight};
679
+ --wm-green: ${U.green};
680
+ --wm-red: ${U.red};
681
+ --wm-redBg: ${U.redBg};
663
682
  --wm-sh1: 0 1px 3px rgba(0,0,0,.06);
664
683
  --wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
665
684
  --wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
@@ -685,12 +704,12 @@ const Ne = `
685
704
  0% { transform: translateX(110%); opacity: 0; }
686
705
  100% { transform: translateX(0); opacity: 1; }
687
706
  }
688
- `, L = (t, e) => {
707
+ `, ze = "https://api.messenger.victorc.fr", B = (t, e) => {
689
708
  const n = t.__vccOpts || t;
690
709
  for (const [a, r] of e)
691
710
  n[a] = r;
692
711
  return n;
693
- }, Pe = {
712
+ }, Ve = {
694
713
  name: "WmLauncher",
695
714
  props: {
696
715
  // Nombre de conversations non lues — pilote la pastille.
@@ -700,12 +719,12 @@ const Ne = `
700
719
  peek: { type: String, default: "" }
701
720
  },
702
721
  emits: ["open", "dismiss"]
703
- }, He = { class: "wm-launcherWrap" }, ze = { class: "wm-peek__text" }, Ve = ["aria-label"];
704
- function qe(t, e, n, a, r, s) {
705
- return l(), d("div", He, [
706
- z(Se, { name: "wm-peek" }, {
707
- default: xe(() => [
708
- n.peek ? (l(), d("div", {
722
+ }, qe = { class: "wm-launcherWrap" }, We = { class: "wm-peek__text" }, Ge = ["aria-label"];
723
+ function Ke(t, e, n, a, r, s) {
724
+ return l(), c("div", qe, [
725
+ H(Me, { name: "wm-peek" }, {
726
+ default: Te(() => [
727
+ n.peek ? (l(), c("div", {
709
728
  key: 0,
710
729
  class: "wm-peek",
711
730
  role: "button",
@@ -713,16 +732,16 @@ function qe(t, e, n, a, r, s) {
713
732
  "aria-label": "Ouvrir le messenger sur le dernier message",
714
733
  onClick: e[1] || (e[1] = (o) => t.$emit("open")),
715
734
  onKeydown: [
716
- e[2] || (e[2] = ue(J((o) => t.$emit("open"), ["prevent"]), ["enter"])),
717
- e[3] || (e[3] = ue(J((o) => t.$emit("open"), ["prevent"]), ["space"]))
735
+ e[2] || (e[2] = me(Y((o) => t.$emit("open"), ["prevent"]), ["enter"])),
736
+ e[3] || (e[3] = me(Y((o) => t.$emit("open"), ["prevent"]), ["space"]))
718
737
  ]
719
738
  }, [
720
- i("p", ze, y(n.peek), 1),
739
+ i("p", We, b(n.peek), 1),
721
740
  i("button", {
722
741
  type: "button",
723
742
  class: "wm-peek__close",
724
743
  "aria-label": "Ignorer",
725
- onClick: e[0] || (e[0] = J((o) => t.$emit("dismiss"), ["stop"]))
744
+ onClick: e[0] || (e[0] = Y((o) => t.$emit("dismiss"), ["stop"]))
726
745
  }, [...e[5] || (e[5] = [
727
746
  i("svg", {
728
747
  width: "11",
@@ -738,7 +757,7 @@ function qe(t, e, n, a, r, s) {
738
757
  i("path", { d: "M18 6L6 18M6 6l12 12" })
739
758
  ], -1)
740
759
  ])])
741
- ], 32)) : v("", !0)
760
+ ], 32)) : g("", !0)
742
761
  ]),
743
762
  _: 1
744
763
  }),
@@ -761,36 +780,36 @@ function qe(t, e, n, a, r, s) {
761
780
  }, [
762
781
  i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
763
782
  ], -1)),
764
- n.unreadCount > 0 ? (l(), d("span", {
783
+ n.unreadCount > 0 ? (l(), c("span", {
765
784
  key: 0,
766
785
  class: "wm-launcher__badge",
767
786
  "aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
768
- }, y(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Ve)) : v("", !0)
787
+ }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Ge)) : g("", !0)
769
788
  ])
770
789
  ]);
771
790
  }
772
- const We = /* @__PURE__ */ L(Pe, [["render", qe], ["__scopeId", "data-v-fabef371"]]), Ge = {
791
+ const Ye = /* @__PURE__ */ B(Ve, [["render", Ke], ["__scopeId", "data-v-fabef371"]]), Je = {
773
792
  name: "WmAIAvatar",
774
793
  props: {
775
794
  size: { type: Number, default: 26 },
776
795
  pulse: { type: Boolean, default: !1 }
777
796
  }
778
- }, Ke = ["width", "height"];
779
- function Ye(t, e, n, a, r, s) {
780
- return l(), d("div", {
797
+ }, Xe = ["width", "height"];
798
+ function Qe(t, e, n, a, r, s) {
799
+ return l(), c("div", {
781
800
  class: "wm-aiav",
782
- style: H({ width: n.size + "px", height: n.size + "px" })
801
+ style: P({ width: n.size + "px", height: n.size + "px" })
783
802
  }, [
784
- n.pulse ? (l(), d("div", {
803
+ n.pulse ? (l(), c("div", {
785
804
  key: 0,
786
805
  class: "wm-aiav__pulse",
787
- style: H({ borderRadius: n.size * 0.32 + 3 + "px" })
788
- }, null, 4)) : v("", !0),
806
+ style: P({ borderRadius: n.size * 0.32 + 3 + "px" })
807
+ }, null, 4)) : g("", !0),
789
808
  i("div", {
790
- class: B(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }]),
791
- style: H({ borderRadius: n.size * 0.32 + "px" })
809
+ class: E(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }]),
810
+ style: P({ borderRadius: n.size * 0.32 + "px" })
792
811
  }, [
793
- (l(), d("svg", {
812
+ (l(), c("svg", {
794
813
  width: n.size * 0.5,
795
814
  height: n.size * 0.5,
796
815
  viewBox: "0 0 24 24",
@@ -816,11 +835,11 @@ function Ye(t, e, n, a, r, s) {
816
835
  fill: "white",
817
836
  opacity: "0.38"
818
837
  }, null, -1)
819
- ])], 8, Ke))
838
+ ])], 8, Xe))
820
839
  ], 6)
821
840
  ], 4);
822
841
  }
823
- const X = /* @__PURE__ */ L(Ge, [["render", Ye], ["__scopeId", "data-v-fe042be7"]]), Je = {
842
+ const J = /* @__PURE__ */ B(Je, [["render", Qe], ["__scopeId", "data-v-fe042be7"]]), Ze = {
824
843
  name: "WmHumanAvatar",
825
844
  props: {
826
845
  name: { type: String, default: "" },
@@ -829,34 +848,34 @@ const X = /* @__PURE__ */ L(Ge, [["render", Ye], ["__scopeId", "data-v-fe042be7"
829
848
  },
830
849
  computed: {
831
850
  bg() {
832
- return this.avatarUrl ? "transparent" : ve(this.name);
851
+ return this.avatarUrl ? "transparent" : ge(this.name);
833
852
  },
834
853
  initials() {
835
- return ge(this.name);
854
+ return we(this.name);
836
855
  }
837
856
  }
838
- }, Xe = ["src", "alt"];
839
- function Qe(t, e, n, a, r, s) {
840
- return l(), d("div", {
857
+ }, et = ["src", "alt"];
858
+ function tt(t, e, n, a, r, s) {
859
+ return l(), c("div", {
841
860
  class: "wm-huav",
842
- style: H({
861
+ style: P({
843
862
  width: n.size + "px",
844
863
  height: n.size + "px",
845
864
  borderRadius: Math.round(n.size * 0.32) + "px",
846
865
  background: s.bg
847
866
  })
848
867
  }, [
849
- n.avatarUrl ? (l(), d("img", {
868
+ n.avatarUrl ? (l(), c("img", {
850
869
  key: 0,
851
870
  src: n.avatarUrl,
852
871
  alt: n.name || ""
853
- }, null, 8, Xe)) : (l(), d("span", {
872
+ }, null, 8, et)) : (l(), c("span", {
854
873
  key: 1,
855
- style: H({ fontSize: n.size * 0.36 + "px" })
856
- }, y(s.initials), 5))
874
+ style: P({ fontSize: n.size * 0.36 + "px" })
875
+ }, b(s.initials), 5))
857
876
  ], 4);
858
877
  }
859
- const we = /* @__PURE__ */ L(Je, [["render", Qe], ["__scopeId", "data-v-79449443"]]), Ze = {
878
+ const ke = /* @__PURE__ */ B(Ze, [["render", tt], ["__scopeId", "data-v-79449443"]]), nt = {
860
879
  name: "WmTeamAvatars",
861
880
  props: {
862
881
  members: { type: Array, default: () => [] },
@@ -872,43 +891,43 @@ const we = /* @__PURE__ */ L(Je, [["render", Qe], ["__scopeId", "data-v-79449443
872
891
  },
873
892
  methods: {
874
893
  colorFor(t) {
875
- return t.avatar_url ? "transparent" : ve(t.name || "");
894
+ return t.avatar_url ? "transparent" : ge(t.name || "");
876
895
  },
877
896
  initialsFor(t) {
878
- return ge(t.name || "");
897
+ return we(t.name || "");
879
898
  }
880
899
  }
881
- }, et = {
900
+ }, st = {
882
901
  key: 0,
883
902
  class: "wm-team"
884
- }, tt = ["src", "alt"], nt = { key: 1 }, st = {
903
+ }, rt = ["src", "alt"], it = { key: 1 }, at = {
885
904
  key: 0,
886
905
  class: "wm-team__label"
887
906
  };
888
- function rt(t, e, n, a, r, s) {
889
- return s.visible ? (l(), d("div", et, [
907
+ function ot(t, e, n, a, r, s) {
908
+ return s.visible ? (l(), c("div", st, [
890
909
  i("div", {
891
910
  class: "wm-team__stack",
892
- style: H({ width: s.stackWidth + "px" })
911
+ style: P({ width: s.stackWidth + "px" })
893
912
  }, [
894
- (l(!0), d(E, null, F(n.members.slice(0, 3), (o, c) => (l(), d("div", {
895
- key: c,
913
+ (l(!0), c(O, null, F(n.members.slice(0, 3), (o, d) => (l(), c("div", {
914
+ key: d,
896
915
  class: "wm-team__pill",
897
- style: H({ left: c * 13 + "px", zIndex: 3 - c, background: s.colorFor(o) })
916
+ style: P({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
898
917
  }, [
899
- o.avatar_url ? (l(), d("img", {
918
+ o.avatar_url ? (l(), c("img", {
900
919
  key: 0,
901
920
  src: o.avatar_url,
902
921
  alt: o.name || ""
903
- }, null, 8, tt)) : (l(), d("span", nt, y(s.initialsFor(o)), 1))
922
+ }, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(o)), 1))
904
923
  ], 4))), 128))
905
924
  ], 4),
906
- n.responseLabel ? (l(), d("span", st, y(n.responseLabel), 1)) : v("", !0)
907
- ])) : v("", !0);
925
+ n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : g("", !0)
926
+ ])) : g("", !0);
908
927
  }
909
- const it = /* @__PURE__ */ L(Ze, [["render", rt], ["__scopeId", "data-v-3659b9c1"]]), at = {
928
+ const lt = /* @__PURE__ */ B(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), ct = {
910
929
  name: "WmHeader",
911
- components: { AIAvatar: X, HumanAvatar: we, TeamAvatars: it },
930
+ components: { AIAvatar: J, HumanAvatar: ke, TeamAvatars: lt },
912
931
  props: {
913
932
  title: { type: String, default: "Nouvelle conversation" },
914
933
  escalated: { type: Boolean, default: !1 },
@@ -939,25 +958,25 @@ const it = /* @__PURE__ */ L(Ze, [["render", rt], ["__scopeId", "data-v-3659b9c1
939
958
  return this.escalated && this.agentName ? this.agentName : "En ligne";
940
959
  }
941
960
  }
942
- }, ot = { class: "wm-header" }, lt = {
961
+ }, dt = { class: "wm-header" }, ut = {
943
962
  key: 1,
944
963
  style: { width: "30px", height: "30px", "flex-shrink": "0" }
945
- }, dt = { class: "wm-header__avatar" }, ct = { class: "wm-header__main" }, ut = { class: "wm-header__title" }, ht = {
964
+ }, ht = { class: "wm-header__avatar" }, mt = { class: "wm-header__main" }, ft = { class: "wm-header__title" }, _t = {
946
965
  key: 0,
947
966
  class: "wm-header__sub"
948
- }, mt = { class: "wm-header__status" }, ft = {
967
+ }, pt = { class: "wm-header__status" }, vt = {
949
968
  key: 3,
950
969
  class: "wm-header__fill"
951
- }, _t = { class: "wm-header__actions" };
952
- function pt(t, e, n, a, r, s) {
953
- const o = O("HumanAvatar"), c = O("AIAvatar"), p = O("TeamAvatars");
954
- return l(), d("div", ot, [
955
- n.showBack ? (l(), d("button", {
970
+ }, yt = { class: "wm-header__actions" };
971
+ function gt(t, e, n, a, r, s) {
972
+ const o = I("HumanAvatar"), d = I("AIAvatar"), v = I("TeamAvatars");
973
+ return l(), c("div", dt, [
974
+ n.showBack ? (l(), c("button", {
956
975
  key: 0,
957
976
  type: "button",
958
977
  class: "wm-header__icon",
959
978
  "aria-label": "Retour à l'accueil",
960
- onClick: e[0] || (e[0] = (k) => t.$emit("back"))
979
+ onClick: e[0] || (e[0] = (C) => t.$emit("back"))
961
980
  }, [...e[3] || (e[3] = [
962
981
  i("svg", {
963
982
  width: "13",
@@ -972,42 +991,42 @@ function pt(t, e, n, a, r, s) {
972
991
  }, [
973
992
  i("path", { d: "M19 12H5M12 5l-7 7 7 7" })
974
993
  ], -1)
975
- ])])) : (l(), d("div", lt)),
976
- n.showIdentity ? (l(), d(E, { key: 2 }, [
977
- i("div", dt, [
994
+ ])])) : (l(), c("div", ut)),
995
+ n.showIdentity ? (l(), c(O, { key: 2 }, [
996
+ i("div", ht, [
978
997
  n.escalated ? (l(), $(o, {
979
998
  key: 0,
980
999
  name: n.agentName,
981
1000
  "avatar-url": n.agentAvatarUrl,
982
1001
  size: 34
983
- }, null, 8, ["name", "avatar-url"])) : (l(), $(c, {
1002
+ }, null, 8, ["name", "avatar-url"])) : (l(), $(d, {
984
1003
  key: 1,
985
1004
  size: 34
986
1005
  }))
987
1006
  ]),
988
- i("div", ct, [
989
- i("div", ut, y(n.title), 1),
990
- s.showPresence ? (l(), d("div", ht, [
991
- s.hasTeam ? (l(), $(p, {
1007
+ i("div", mt, [
1008
+ i("div", ft, b(n.title), 1),
1009
+ s.showPresence ? (l(), c("div", _t, [
1010
+ s.hasTeam ? (l(), $(v, {
992
1011
  key: 0,
993
1012
  members: n.teamMembers,
994
1013
  "response-label": n.responseLabel
995
- }, null, 8, ["members", "response-label"])) : v("", !0),
996
- i("span", mt, [
1014
+ }, null, 8, ["members", "response-label"])) : g("", !0),
1015
+ i("span", pt, [
997
1016
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
998
- se(" " + y(s.statusText), 1)
1017
+ se(" " + b(s.statusText), 1)
999
1018
  ])
1000
- ])) : v("", !0)
1019
+ ])) : g("", !0)
1001
1020
  ])
1002
- ], 64)) : (l(), d("div", ft)),
1003
- i("div", _t, [
1004
- n.showMore ? (l(), d("button", {
1021
+ ], 64)) : (l(), c("div", vt)),
1022
+ i("div", yt, [
1023
+ n.showMore ? (l(), c("button", {
1005
1024
  key: 0,
1006
1025
  type: "button",
1007
- class: B(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
1026
+ class: E(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
1008
1027
  "aria-label": "Plus d'options",
1009
1028
  title: "Plus d'options",
1010
- onClick: e[1] || (e[1] = (k) => t.$emit("more"))
1029
+ onClick: e[1] || (e[1] = (C) => t.$emit("more"))
1011
1030
  }, [...e[5] || (e[5] = [
1012
1031
  i("svg", {
1013
1032
  width: "13",
@@ -1032,14 +1051,14 @@ function pt(t, e, n, a, r, s) {
1032
1051
  r: "1.6"
1033
1052
  })
1034
1053
  ], -1)
1035
- ])], 2)) : v("", !0),
1036
- n.showClose ? (l(), d("button", {
1054
+ ])], 2)) : g("", !0),
1055
+ n.showClose ? (l(), c("button", {
1037
1056
  key: 1,
1038
1057
  type: "button",
1039
1058
  class: "wm-header__icon",
1040
1059
  "aria-label": "Fermer le widget",
1041
1060
  title: "Fermer le widget",
1042
- onClick: e[2] || (e[2] = (k) => t.$emit("close"))
1061
+ onClick: e[2] || (e[2] = (C) => t.$emit("close"))
1043
1062
  }, [...e[6] || (e[6] = [
1044
1063
  i("svg", {
1045
1064
  width: "13",
@@ -1054,19 +1073,19 @@ function pt(t, e, n, a, r, s) {
1054
1073
  }, [
1055
1074
  i("path", { d: "M18 6L6 18M6 6l12 12" })
1056
1075
  ], -1)
1057
- ])])) : v("", !0)
1076
+ ])])) : g("", !0)
1058
1077
  ])
1059
1078
  ]);
1060
1079
  }
1061
- const vt = /* @__PURE__ */ L(at, [["render", pt], ["__scopeId", "data-v-b5f5f6a9"]]), me = {
1080
+ const wt = /* @__PURE__ */ B(ct, [["render", gt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1062
1081
  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",
1063
1082
  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",
1064
1083
  status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
1065
1084
  chat: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",
1066
1085
  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"
1067
- }, gt = {
1086
+ }, bt = {
1068
1087
  name: "WmOnboarding",
1069
- components: { AIAvatar: X },
1088
+ components: { AIAvatar: J },
1070
1089
  props: {
1071
1090
  welcomeMessage: { type: String, default: "" },
1072
1091
  agentName: { type: String, default: "" },
@@ -1086,16 +1105,16 @@ Je réponds en quelques secondes.`;
1086
1105
  },
1087
1106
  methods: {
1088
1107
  iconPath(t) {
1089
- return me[t] || me.link;
1108
+ return _e[t] || _e.link;
1090
1109
  }
1091
1110
  }
1092
- }, yt = { class: "wm-onb" }, wt = { class: "wm-onb__hero" }, bt = { class: "wm-onb__title" }, kt = { class: "wm-onb__sub" }, Ct = {
1111
+ }, kt = { class: "wm-onb" }, Ct = { class: "wm-onb__hero" }, At = { class: "wm-onb__title" }, St = { class: "wm-onb__sub" }, xt = {
1093
1112
  key: 0,
1094
1113
  class: "wm-onb__section"
1095
- }, At = { class: "wm-onb__links" }, St = ["onClick"], xt = { class: "wm-onb__resume-body" }, Mt = { class: "wm-onb__resume-title" }, Tt = { class: "wm-onb__resume-preview" }, It = {
1114
+ }, Mt = { class: "wm-onb__links" }, Tt = ["onClick"], It = { class: "wm-onb__resume-body" }, Ot = { class: "wm-onb__resume-title" }, Et = { class: "wm-onb__resume-preview" }, Bt = {
1096
1115
  key: 1,
1097
1116
  class: "wm-onb__section"
1098
- }, Ot = { class: "wm-onb__links" }, Et = ["onClick"], Bt = { class: "wm-onb__link-icon" }, Lt = {
1117
+ }, Lt = { class: "wm-onb__links" }, Rt = ["onClick"], $t = { class: "wm-onb__link-icon" }, Ft = {
1099
1118
  width: "14",
1100
1119
  height: "14",
1101
1120
  viewBox: "0 0 24 24",
@@ -1105,26 +1124,26 @@ Je réponds en quelques secondes.`;
1105
1124
  "stroke-linecap": "round",
1106
1125
  "stroke-linejoin": "round",
1107
1126
  "aria-hidden": "true"
1108
- }, Rt = ["d"], $t = { class: "wm-onb__link-label" }, Ft = { class: "wm-onb__cta" }, Ut = ["disabled"];
1109
- function Dt(t, e, n, a, r, s) {
1110
- const o = O("AIAvatar");
1111
- return l(), d("div", yt, [
1112
- i("div", wt, [
1113
- z(o, {
1127
+ }, jt = ["d"], Ut = { class: "wm-onb__link-label" }, Dt = { class: "wm-onb__cta" }, Nt = ["disabled"];
1128
+ function Pt(t, e, n, a, r, s) {
1129
+ const o = I("AIAvatar");
1130
+ return l(), c("div", kt, [
1131
+ i("div", Ct, [
1132
+ H(o, {
1114
1133
  size: 56,
1115
1134
  pulse: !0
1116
1135
  }),
1117
- i("div", bt, y(s.heroTitle), 1),
1118
- i("div", kt, y(s.heroSub), 1)
1136
+ i("div", At, b(s.heroTitle), 1),
1137
+ i("div", St, b(s.heroSub), 1)
1119
1138
  ]),
1120
- n.unreadThreads.length ? (l(), d("div", Ct, [
1139
+ n.unreadThreads.length ? (l(), c("div", xt, [
1121
1140
  e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Messages non lus", -1)),
1122
- i("div", At, [
1123
- (l(!0), d(E, null, F(n.unreadThreads, (c) => (l(), d("button", {
1124
- key: c.id,
1141
+ i("div", Mt, [
1142
+ (l(!0), c(O, null, F(n.unreadThreads, (d) => (l(), c("button", {
1143
+ key: d.id,
1125
1144
  type: "button",
1126
1145
  class: "wm-onb__link wm-onb__resume",
1127
- onClick: (p) => t.$emit("resume", c)
1146
+ onClick: (v) => t.$emit("resume", d)
1128
1147
  }, [
1129
1148
  e[1] || (e[1] = i("span", { class: "wm-onb__link-icon wm-onb__resume-icon" }, [
1130
1149
  i("svg", {
@@ -1145,9 +1164,9 @@ function Dt(t, e, n, a, r, s) {
1145
1164
  "aria-label": "Non lu"
1146
1165
  })
1147
1166
  ], -1)),
1148
- i("span", xt, [
1149
- i("span", Mt, y(c.title), 1),
1150
- i("span", Tt, y(c.preview), 1)
1167
+ i("span", It, [
1168
+ i("span", Ot, b(d.title), 1),
1169
+ i("span", Et, b(d.preview), 1)
1151
1170
  ]),
1152
1171
  e[2] || (e[2] = i("svg", {
1153
1172
  width: "13",
@@ -1163,26 +1182,26 @@ function Dt(t, e, n, a, r, s) {
1163
1182
  }, [
1164
1183
  i("path", { d: "M9 18l6-6-6-6" })
1165
1184
  ], -1))
1166
- ], 8, St))), 128))
1185
+ ], 8, Tt))), 128))
1167
1186
  ])
1168
- ])) : v("", !0),
1169
- n.quickLinks.length ? (l(), d("div", It, [
1187
+ ])) : g("", !0),
1188
+ n.quickLinks.length ? (l(), c("div", Bt, [
1170
1189
  e[5] || (e[5] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1171
- i("div", Ot, [
1172
- (l(!0), d(E, null, F(n.quickLinks, (c, p) => (l(), d("button", {
1173
- key: p,
1190
+ i("div", Lt, [
1191
+ (l(!0), c(O, null, F(n.quickLinks, (d, v) => (l(), c("button", {
1192
+ key: v,
1174
1193
  type: "button",
1175
1194
  class: "wm-onb__link",
1176
- onClick: (k) => t.$emit("select", c)
1195
+ onClick: (C) => t.$emit("select", d)
1177
1196
  }, [
1178
- i("span", Bt, [
1179
- (l(), d("svg", Lt, [
1197
+ i("span", $t, [
1198
+ (l(), c("svg", Ft, [
1180
1199
  i("path", {
1181
- d: s.iconPath(c.icon)
1182
- }, null, 8, Rt)
1200
+ d: s.iconPath(d.icon)
1201
+ }, null, 8, jt)
1183
1202
  ]))
1184
1203
  ]),
1185
- i("span", $t, y(c.label), 1),
1204
+ i("span", Ut, b(d.label), 1),
1186
1205
  e[4] || (e[4] = i("svg", {
1187
1206
  width: "13",
1188
1207
  height: "13",
@@ -1197,83 +1216,83 @@ function Dt(t, e, n, a, r, s) {
1197
1216
  }, [
1198
1217
  i("path", { d: "M9 18l6-6-6-6" })
1199
1218
  ], -1))
1200
- ], 8, Et))), 128))
1219
+ ], 8, Rt))), 128))
1201
1220
  ])
1202
- ])) : v("", !0),
1203
- i("div", Ft, [
1221
+ ])) : g("", !0),
1222
+ i("div", Dt, [
1204
1223
  i("button", {
1205
1224
  type: "button",
1206
1225
  class: "wm-onb__startBtn",
1207
1226
  disabled: n.busy,
1208
- onClick: e[0] || (e[0] = (c) => t.$emit("start"))
1209
- }, y(n.busy ? "…" : "Commencer une conversation"), 9, Ut)
1227
+ onClick: e[0] || (e[0] = (d) => t.$emit("start"))
1228
+ }, b(n.busy ? "…" : "Commencer une conversation"), 9, Nt)
1210
1229
  ])
1211
1230
  ]);
1212
1231
  }
1213
- const jt = /* @__PURE__ */ L(gt, [["render", Dt], ["__scopeId", "data-v-bd89bc8f"]]);
1214
- function Nt(t) {
1232
+ const Ht = /* @__PURE__ */ B(bt, [["render", Pt], ["__scopeId", "data-v-bd89bc8f"]]);
1233
+ function zt(t) {
1215
1234
  return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1216
1235
  }
1217
- function Pt(t) {
1236
+ function Vt(t) {
1218
1237
  return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1219
1238
  }
1220
- const fe = "";
1239
+ const pe = "";
1221
1240
  function ee(t) {
1222
1241
  let e = t;
1223
1242
  const n = [];
1224
1243
  return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
1225
1244
  const s = n.length;
1226
- return n.push(r), `${fe}CODE${s}${fe}`;
1227
- }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Pt(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;
1245
+ return n.push(r), `${pe}CODE${s}${pe}`;
1246
+ }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Vt(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;
1228
1247
  }
1229
- function be(t) {
1248
+ function Ce(t) {
1230
1249
  if (!t) return "";
1231
- const e = Nt(t).split(`
1250
+ const e = zt(t).split(`
1232
1251
  `), n = [];
1233
1252
  let a = 0;
1234
1253
  for (; a < e.length; ) {
1235
1254
  const s = e[a];
1236
1255
  if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1237
1256
  a++;
1238
- const k = [];
1257
+ const C = [];
1239
1258
  for (; a < e.length && !/^\s*```\s*$/.test(e[a]); )
1240
- k.push(e[a]), a++;
1259
+ C.push(e[a]), a++;
1241
1260
  a < e.length && a++, n.push({
1242
1261
  type: "block",
1243
- html: `<pre class="wm-md-pre"><code>${k.join(`
1262
+ html: `<pre class="wm-md-pre"><code>${C.join(`
1244
1263
  `)}</code></pre>`
1245
1264
  });
1246
1265
  continue;
1247
1266
  }
1248
1267
  if (/^\s*[-*]\s+/.test(s)) {
1249
- const k = [];
1268
+ const C = [];
1250
1269
  for (; a < e.length; ) {
1251
- const T = /^\s*[-*]\s+(.*)$/.exec(e[a]);
1252
- if (!T) break;
1253
- k.push(T[1]), a++;
1270
+ const S = /^\s*[-*]\s+(.*)$/.exec(e[a]);
1271
+ if (!S) break;
1272
+ C.push(S[1]), a++;
1254
1273
  }
1255
- const g = k.map((T) => `<li>${ee(T)}</li>`).join("");
1256
- n.push({ type: "block", html: `<ul class="wm-md-ul">${g}</ul>` });
1274
+ const w = C.map((S) => `<li>${ee(S)}</li>`).join("");
1275
+ n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1257
1276
  continue;
1258
1277
  }
1259
- const c = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1260
- if (c) {
1261
- const k = parseInt(c[1], 10), g = [c[2]];
1278
+ const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1279
+ if (d) {
1280
+ const C = parseInt(d[1], 10), w = [d[2]];
1262
1281
  for (a++; a < e.length; ) {
1263
- const x = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1264
- if (!x) break;
1265
- g.push(x[1]), a++;
1282
+ const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1283
+ if (!A) break;
1284
+ w.push(A[1]), a++;
1266
1285
  }
1267
- const T = g.map((x) => `<li>${ee(x)}</li>`).join(""), R = k !== 1 ? ` start="${k}"` : "";
1268
- n.push({ type: "block", html: `<ol class="wm-md-ol"${R}>${T}</ol>` });
1286
+ const S = w.map((A) => `<li>${ee(A)}</li>`).join(""), L = C !== 1 ? ` start="${C}"` : "";
1287
+ n.push({ type: "block", html: `<ol class="wm-md-ol"${L}>${S}</ol>` });
1269
1288
  continue;
1270
1289
  }
1271
- const p = /^(#{1,6})\s+(.*)$/.exec(s);
1272
- if (p) {
1273
- const k = p[1].length;
1290
+ const v = /^(#{1,6})\s+(.*)$/.exec(s);
1291
+ if (v) {
1292
+ const C = v[1].length;
1274
1293
  n.push({
1275
1294
  type: "block",
1276
- html: `<h${k} class="wm-md-h wm-md-h${k}">${ee(p[2])}</h${k}>`
1295
+ html: `<h${C} class="wm-md-h wm-md-h${C}">${ee(v[2])}</h${C}>`
1277
1296
  }), a++;
1278
1297
  continue;
1279
1298
  }
@@ -1283,13 +1302,13 @@ function be(t) {
1283
1302
  for (let s = 0; s < n.length; s++) {
1284
1303
  const o = n[s];
1285
1304
  r += o.html;
1286
- const c = n[s + 1];
1287
- c && o.type !== "block" && c.type !== "block" && (r += `
1305
+ const d = n[s + 1];
1306
+ d && o.type !== "block" && d.type !== "block" && (r += `
1288
1307
  `);
1289
1308
  }
1290
1309
  return r;
1291
1310
  }
1292
- const Ht = {
1311
+ const qt = {
1293
1312
  name: "WmArtifactFormResponse",
1294
1313
  props: {
1295
1314
  data: { type: Object, required: !0 }
@@ -1300,11 +1319,11 @@ const Ht = {
1300
1319
  return Array.isArray((t = this.data) == null ? void 0 : t.fields) ? this.data.fields : [];
1301
1320
  }
1302
1321
  }
1303
- }, zt = { class: "wm-art wm-art--formResponse" }, Vt = { class: "wm-art__head" }, qt = { class: "wm-art__title" }, Wt = { class: "wm-art__body" }, Gt = { class: "wm-art__fieldLabel" };
1304
- function Kt(t, e, n, a, r, s) {
1305
- return l(), d("div", zt, [
1306
- i("div", Vt, [
1307
- i("div", qt, y(n.data.title || "Formulaire"), 1),
1322
+ }, Wt = { class: "wm-art wm-art--formResponse" }, Gt = { class: "wm-art__head" }, Kt = { class: "wm-art__title" }, Yt = { class: "wm-art__body" }, Jt = { class: "wm-art__fieldLabel" };
1323
+ function Xt(t, e, n, a, r, s) {
1324
+ return l(), c("div", Wt, [
1325
+ i("div", Gt, [
1326
+ i("div", Kt, b(n.data.title || "Formulaire"), 1),
1308
1327
  e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
1309
1328
  i("svg", {
1310
1329
  width: "11",
@@ -1322,20 +1341,20 @@ function Kt(t, e, n, a, r, s) {
1322
1341
  se(" Envoyé ")
1323
1342
  ], -1))
1324
1343
  ]),
1325
- i("div", Wt, [
1326
- (l(!0), d(E, null, F(s.fields, (o, c) => (l(), d("div", {
1327
- key: c,
1344
+ i("div", Yt, [
1345
+ (l(!0), c(O, null, F(s.fields, (o, d) => (l(), c("div", {
1346
+ key: d,
1328
1347
  class: "wm-art__field"
1329
1348
  }, [
1330
- i("div", Gt, y(o.label), 1),
1349
+ i("div", Jt, b(o.label), 1),
1331
1350
  i("div", {
1332
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1333
- }, y(o.value), 3)
1351
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1352
+ }, b(o.value), 3)
1334
1353
  ]))), 128))
1335
1354
  ])
1336
1355
  ]);
1337
1356
  }
1338
- const Yt = /* @__PURE__ */ L(Ht, [["render", Kt], ["__scopeId", "data-v-812bda8b"]]), Jt = {
1357
+ const Qt = /* @__PURE__ */ B(qt, [["render", Xt], ["__scopeId", "data-v-812bda8b"]]), Zt = {
1339
1358
  name: "WmArtifactInfoCard",
1340
1359
  props: {
1341
1360
  data: { type: Object, required: !0 }
@@ -1350,61 +1369,61 @@ const Yt = /* @__PURE__ */ L(Ht, [["render", Kt], ["__scopeId", "data-v-812bda8b
1350
1369
  return !!((t = this.data) != null && t.body) || this.fields.length > 0;
1351
1370
  }
1352
1371
  }
1353
- }, Xt = { class: "wm-art wm-art--infoCard" }, Qt = {
1372
+ }, en = { class: "wm-art wm-art--infoCard" }, tn = {
1354
1373
  key: 0,
1355
1374
  class: "wm-art__image"
1356
- }, Zt = ["src", "alt"], en = { class: "wm-art__head" }, tn = { class: "wm-art__headMain" }, nn = { class: "wm-art__title" }, sn = {
1375
+ }, nn = ["src", "alt"], sn = { class: "wm-art__head" }, rn = { class: "wm-art__headMain" }, an = { class: "wm-art__title" }, on = {
1357
1376
  key: 0,
1358
1377
  class: "wm-art__subtitle"
1359
- }, rn = {
1378
+ }, ln = {
1360
1379
  key: 1,
1361
1380
  class: "wm-art__body"
1362
- }, an = {
1381
+ }, cn = {
1363
1382
  key: 0,
1364
1383
  class: "wm-art__text"
1365
- }, on = { class: "wm-art__fieldLabel" };
1366
- function ln(t, e, n, a, r, s) {
1367
- return l(), d("div", Xt, [
1368
- n.data.image_url ? (l(), d("figure", Qt, [
1384
+ }, dn = { class: "wm-art__fieldLabel" };
1385
+ function un(t, e, n, a, r, s) {
1386
+ return l(), c("div", en, [
1387
+ n.data.image_url ? (l(), c("figure", tn, [
1369
1388
  i("img", {
1370
1389
  src: n.data.image_url,
1371
1390
  alt: n.data.title || "",
1372
1391
  loading: "lazy"
1373
- }, null, 8, Zt)
1374
- ])) : v("", !0),
1375
- i("div", en, [
1376
- i("div", tn, [
1377
- i("div", nn, y(n.data.title), 1),
1378
- n.data.subtitle ? (l(), d("div", sn, y(n.data.subtitle), 1)) : v("", !0)
1392
+ }, null, 8, nn)
1393
+ ])) : g("", !0),
1394
+ i("div", sn, [
1395
+ i("div", rn, [
1396
+ i("div", an, b(n.data.title), 1),
1397
+ n.data.subtitle ? (l(), c("div", on, b(n.data.subtitle), 1)) : g("", !0)
1379
1398
  ]),
1380
- n.data.badge && n.data.badge.label ? (l(), d("span", {
1399
+ n.data.badge && n.data.badge.label ? (l(), c("span", {
1381
1400
  key: 0,
1382
- class: B(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1383
- }, y(n.data.badge.label), 3)) : v("", !0)
1401
+ class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1402
+ }, b(n.data.badge.label), 3)) : g("", !0)
1384
1403
  ]),
1385
- s.hasBody ? (l(), d("div", rn, [
1386
- n.data.body ? (l(), d("div", an, y(n.data.body), 1)) : v("", !0),
1387
- s.fields.length ? (l(!0), d(E, { key: 1 }, F(s.fields, (o, c) => (l(), d("div", {
1388
- key: c,
1404
+ s.hasBody ? (l(), c("div", ln, [
1405
+ n.data.body ? (l(), c("div", cn, b(n.data.body), 1)) : g("", !0),
1406
+ s.fields.length ? (l(!0), c(O, { key: 1 }, F(s.fields, (o, d) => (l(), c("div", {
1407
+ key: d,
1389
1408
  class: "wm-art__field"
1390
1409
  }, [
1391
- i("div", on, y(o.label), 1),
1410
+ i("div", dn, b(o.label), 1),
1392
1411
  i("div", {
1393
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1394
- }, y(o.value), 3)
1395
- ]))), 128)) : v("", !0)
1396
- ])) : v("", !0)
1412
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1413
+ }, b(o.value), 3)
1414
+ ]))), 128)) : g("", !0)
1415
+ ])) : g("", !0)
1397
1416
  ]);
1398
1417
  }
1399
- const dn = /* @__PURE__ */ L(Jt, [["render", ln], ["__scopeId", "data-v-d7369333"]]);
1400
- function cn(t) {
1418
+ const hn = /* @__PURE__ */ B(Zt, [["render", un], ["__scopeId", "data-v-d7369333"]]);
1419
+ function mn(t) {
1401
1420
  if (!t) return "";
1402
1421
  const e = new Date(t);
1403
1422
  if (Number.isNaN(e.getTime())) return t;
1404
1423
  const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), a = e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
1405
1424
  return `${n} à ${a}`;
1406
1425
  }
1407
- const un = {
1426
+ const fn = {
1408
1427
  name: "WmArtifactTicket",
1409
1428
  props: {
1410
1429
  data: { type: Object, required: !0 }
@@ -1420,7 +1439,7 @@ const un = {
1420
1439
  },
1421
1440
  formattedDate() {
1422
1441
  var t;
1423
- return cn((t = this.data) == null ? void 0 : t.created_at);
1442
+ return mn((t = this.data) == null ? void 0 : t.created_at);
1424
1443
  }
1425
1444
  },
1426
1445
  methods: {
@@ -1437,22 +1456,22 @@ const un = {
1437
1456
  return /high|haute|élev|elev|critic|critiq|urgent/.test(e) ? 3 : /low|basse|faible|minor/.test(e) ? 1 : 2;
1438
1457
  }
1439
1458
  }
1440
- }, hn = { class: "wm-art wm-art--ticket" }, mn = { class: "wm-art__head wm-tk__head" }, fn = { class: "wm-art__title wm-tk__title" }, _n = { class: "wm-tk__sub" }, pn = { class: "wm-tk__ref" }, vn = {
1459
+ }, _n = { class: "wm-art wm-art--ticket" }, pn = { class: "wm-art__head wm-tk__head" }, vn = { class: "wm-art__title wm-tk__title" }, yn = { class: "wm-tk__sub" }, gn = { class: "wm-tk__ref" }, wn = {
1441
1460
  key: 0,
1442
1461
  class: "wm-art__body"
1443
- }, gn = {
1462
+ }, bn = {
1444
1463
  key: 0,
1445
1464
  class: "wm-tk__text"
1446
- }, yn = { class: "wm-art__fieldLabel" }, wn = ["data-level"], bn = {
1465
+ }, kn = { class: "wm-art__fieldLabel" }, Cn = ["data-level"], An = {
1447
1466
  key: 1,
1448
1467
  class: "wm-art__footer wm-tk__footer"
1449
1468
  };
1450
- function kn(t, e, n, a, r, s) {
1451
- return l(), d("div", hn, [
1452
- i("div", mn, [
1453
- i("div", fn, y(n.data.title), 1),
1454
- i("div", _n, [
1455
- i("div", pn, [
1469
+ function Sn(t, e, n, a, r, s) {
1470
+ return l(), c("div", _n, [
1471
+ i("div", pn, [
1472
+ i("div", vn, b(n.data.title), 1),
1473
+ i("div", yn, [
1474
+ i("div", gn, [
1456
1475
  e[0] || (e[0] = i("svg", {
1457
1476
  width: "11",
1458
1477
  height: "11",
@@ -1467,30 +1486,30 @@ function kn(t, e, n, a, r, s) {
1467
1486
  i("path", { d: "M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z" }),
1468
1487
  i("path", { d: "M13 5v2M13 17v2M13 11v2" })
1469
1488
  ], -1)),
1470
- i("span", null, y(n.data.reference), 1)
1489
+ i("span", null, b(n.data.reference), 1)
1471
1490
  ]),
1472
1491
  i("span", {
1473
- class: B(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
1492
+ class: E(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
1474
1493
  }, [
1475
1494
  e[1] || (e[1] = i("span", {
1476
1495
  class: "wm-tk__dot",
1477
1496
  "aria-hidden": "true"
1478
1497
  }, null, -1)),
1479
- se(" " + y(n.data.status.label), 1)
1498
+ se(" " + b(n.data.status.label), 1)
1480
1499
  ], 2)
1481
1500
  ])
1482
1501
  ]),
1483
- s.hasBody ? (l(), d("div", vn, [
1484
- n.data.body ? (l(), d("div", gn, y(n.data.body), 1)) : v("", !0),
1485
- s.fields.length ? (l(!0), d(E, { key: 1 }, F(s.fields, (o, c) => (l(), d("div", {
1486
- key: c,
1502
+ s.hasBody ? (l(), c("div", wn, [
1503
+ n.data.body ? (l(), c("div", bn, b(n.data.body), 1)) : g("", !0),
1504
+ s.fields.length ? (l(!0), c(O, { key: 1 }, F(s.fields, (o, d) => (l(), c("div", {
1505
+ key: d,
1487
1506
  class: "wm-art__field"
1488
1507
  }, [
1489
- i("div", yn, y(o.label), 1),
1508
+ i("div", kn, b(o.label), 1),
1490
1509
  i("div", {
1491
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1510
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1492
1511
  }, [
1493
- s.isPriority(o.label) ? (l(), d("svg", {
1512
+ s.isPriority(o.label) ? (l(), c("svg", {
1494
1513
  key: 0,
1495
1514
  class: "wm-tk__prio",
1496
1515
  "data-level": s.priorityLevel(o.value),
@@ -1520,12 +1539,12 @@ function kn(t, e, n, a, r, s) {
1520
1539
  height: "9",
1521
1540
  rx: "0.5"
1522
1541
  }, null, -1)
1523
- ])], 8, wn)) : v("", !0),
1524
- i("span", null, y(o.value), 1)
1542
+ ])], 8, Cn)) : g("", !0),
1543
+ i("span", null, b(o.value), 1)
1525
1544
  ], 2)
1526
- ]))), 128)) : v("", !0)
1527
- ])) : v("", !0),
1528
- n.data.created_at ? (l(), d("div", bn, [
1545
+ ]))), 128)) : g("", !0)
1546
+ ])) : g("", !0),
1547
+ n.data.created_at ? (l(), c("div", An, [
1529
1548
  e[3] || (e[3] = i("svg", {
1530
1549
  width: "11",
1531
1550
  height: "11",
@@ -1546,15 +1565,15 @@ function kn(t, e, n, a, r, s) {
1546
1565
  }),
1547
1566
  i("path", { d: "M16 2v4M8 2v4M3 10h18" })
1548
1567
  ], -1)),
1549
- i("span", null, y(s.formattedDate), 1)
1550
- ])) : v("", !0)
1568
+ i("span", null, b(s.formattedDate), 1)
1569
+ ])) : g("", !0)
1551
1570
  ]);
1552
1571
  }
1553
- const Cn = /* @__PURE__ */ L(un, [["render", kn], ["__scopeId", "data-v-f0495924"]]), An = {
1554
- form_response: Yt,
1555
- info_card: dn,
1556
- ticket: Cn
1557
- }, Sn = {
1572
+ const xn = /* @__PURE__ */ B(fn, [["render", Sn], ["__scopeId", "data-v-f0495924"]]), Mn = {
1573
+ form_response: Qt,
1574
+ info_card: hn,
1575
+ ticket: xn
1576
+ }, Tn = {
1558
1577
  name: "WmArtifactRenderer",
1559
1578
  props: {
1560
1579
  // Forme : { kind: string, data: any } (le `data` est validé
@@ -1565,19 +1584,19 @@ const Cn = /* @__PURE__ */ L(un, [["render", kn], ["__scopeId", "data-v-f0495924
1565
1584
  component() {
1566
1585
  var e;
1567
1586
  const t = (e = this.artifact) == null ? void 0 : e.kind;
1568
- return t && An[t] || null;
1587
+ return t && Mn[t] || null;
1569
1588
  }
1570
1589
  }
1571
1590
  };
1572
- function xn(t, e, n, a, r, s) {
1573
- return s.component ? (l(), $(Me(s.component), {
1591
+ function In(t, e, n, a, r, s) {
1592
+ return s.component ? (l(), $(Ie(s.component), {
1574
1593
  key: 0,
1575
1594
  data: n.artifact.data
1576
- }, null, 8, ["data"])) : v("", !0);
1595
+ }, null, 8, ["data"])) : g("", !0);
1577
1596
  }
1578
- const ke = /* @__PURE__ */ L(Sn, [["render", xn]]), Mn = {
1597
+ const Ae = /* @__PURE__ */ B(Tn, [["render", In]]), On = {
1579
1598
  name: "WmActionResult",
1580
- components: { ArtifactRenderer: ke },
1599
+ components: { ArtifactRenderer: Ae },
1581
1600
  props: {
1582
1601
  state: { type: String, default: "success" },
1583
1602
  // 'success' | 'failure' | 'rejected'
@@ -1595,10 +1614,10 @@ const ke = /* @__PURE__ */ L(Sn, [["render", xn]]), Mn = {
1595
1614
  // bullet lists / bold emphasis / inline code. Render them through
1596
1615
  // the shared markdown pipeline so they read like the chat bubbles.
1597
1616
  detailHtml() {
1598
- return be(this.detail);
1617
+ return Ce(this.detail);
1599
1618
  }
1600
1619
  }
1601
- }, Tn = { class: "wm-result-wrap" }, In = { class: "wm-result" }, On = {
1620
+ }, En = { class: "wm-result-wrap" }, Bn = { class: "wm-result" }, Ln = {
1602
1621
  key: 0,
1603
1622
  width: "10",
1604
1623
  height: "10",
@@ -1609,7 +1628,7 @@ const ke = /* @__PURE__ */ L(Sn, [["render", xn]]), Mn = {
1609
1628
  "stroke-linecap": "round",
1610
1629
  "stroke-linejoin": "round",
1611
1630
  "aria-hidden": "true"
1612
- }, En = {
1631
+ }, Rn = {
1613
1632
  key: 1,
1614
1633
  width: "10",
1615
1634
  height: "10",
@@ -1620,40 +1639,40 @@ const ke = /* @__PURE__ */ L(Sn, [["render", xn]]), Mn = {
1620
1639
  "stroke-linecap": "round",
1621
1640
  "stroke-linejoin": "round",
1622
1641
  "aria-hidden": "true"
1623
- }, Bn = { class: "wm-result__body" }, Ln = ["innerHTML"], Rn = {
1642
+ }, $n = { class: "wm-result__body" }, Fn = ["innerHTML"], jn = {
1624
1643
  key: 0,
1625
1644
  class: "wm-result-art"
1626
1645
  };
1627
- function $n(t, e, n, a, r, s) {
1628
- const o = O("ArtifactRenderer");
1629
- return l(), d("div", Tn, [
1630
- i("div", In, [
1646
+ function Un(t, e, n, a, r, s) {
1647
+ const o = I("ArtifactRenderer");
1648
+ return l(), c("div", En, [
1649
+ i("div", Bn, [
1631
1650
  i("div", {
1632
- class: B(["wm-result__check", { "wm-result__check--ok": s.ok }])
1651
+ class: E(["wm-result__check", { "wm-result__check--ok": s.ok }])
1633
1652
  }, [
1634
- s.ok ? (l(), d("svg", On, [...e[0] || (e[0] = [
1653
+ s.ok ? (l(), c("svg", Ln, [...e[0] || (e[0] = [
1635
1654
  i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
1636
- ])])) : (l(), d("svg", En, [...e[1] || (e[1] = [
1655
+ ])])) : (l(), c("svg", Rn, [...e[1] || (e[1] = [
1637
1656
  i("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
1638
1657
  ])]))
1639
1658
  ], 2),
1640
- i("div", Bn, [
1659
+ i("div", $n, [
1641
1660
  i("div", {
1642
- class: B(["wm-result__label", { "wm-result__label--struck": !s.ok }])
1643
- }, y(n.label), 3),
1644
- n.detail ? (l(), d("div", {
1661
+ class: E(["wm-result__label", { "wm-result__label--struck": !s.ok }])
1662
+ }, b(n.label), 3),
1663
+ n.detail ? (l(), c("div", {
1645
1664
  key: 0,
1646
1665
  class: "wm-result__detail",
1647
1666
  innerHTML: s.detailHtml
1648
- }, null, 8, Ln)) : v("", !0)
1667
+ }, null, 8, Fn)) : g("", !0)
1649
1668
  ])
1650
1669
  ]),
1651
- n.artifact ? (l(), d("div", Rn, [
1652
- z(o, { artifact: n.artifact }, null, 8, ["artifact"])
1653
- ])) : v("", !0)
1670
+ n.artifact ? (l(), c("div", jn, [
1671
+ H(o, { artifact: n.artifact }, null, 8, ["artifact"])
1672
+ ])) : g("", !0)
1654
1673
  ]);
1655
1674
  }
1656
- const Fn = /* @__PURE__ */ L(Mn, [["render", $n], ["__scopeId", "data-v-037fd69e"]]), Un = {
1675
+ const Dn = /* @__PURE__ */ B(On, [["render", Un], ["__scopeId", "data-v-037fd69e"]]), Nn = {
1657
1676
  name: "WmAttachmentPreview",
1658
1677
  inject: {
1659
1678
  signAttachmentFn: { default: null }
@@ -1707,19 +1726,19 @@ const Fn = /* @__PURE__ */ L(Mn, [["render", $n], ["__scopeId", "data-v-037fd69e
1707
1726
  this.url || t.preventDefault();
1708
1727
  }
1709
1728
  }
1710
- }, Dn = ["href"], jn = ["src", "alt"], Nn = ["src"], Pn = ["src"], Hn = ["href", "download"], zn = { class: "wm-att__main" }, Vn = { class: "wm-att__name" }, qn = {
1729
+ }, Pn = ["href"], Hn = ["src", "alt"], zn = ["src"], Vn = ["src"], qn = ["href", "download"], Wn = { class: "wm-att__main" }, Gn = { class: "wm-att__name" }, Kn = {
1711
1730
  key: 0,
1712
1731
  class: "wm-att__meta"
1713
- }, Wn = {
1732
+ }, Yn = {
1714
1733
  key: 0,
1715
1734
  class: "wm-att__spin",
1716
1735
  "aria-hidden": "true"
1717
1736
  };
1718
- function Gn(t, e, n, a, r, s) {
1719
- return l(), d("div", {
1720
- class: B(["wm-att", ["wm-att--" + (s.kind || "file")]])
1737
+ function Jn(t, e, n, a, r, s) {
1738
+ return l(), c("div", {
1739
+ class: E(["wm-att", ["wm-att--" + (s.kind || "file")]])
1721
1740
  }, [
1722
- s.kind === "image" && r.url ? (l(), d("a", {
1741
+ s.kind === "image" && r.url ? (l(), c("a", {
1723
1742
  key: 0,
1724
1743
  href: r.url,
1725
1744
  target: "_blank",
@@ -1730,18 +1749,18 @@ function Gn(t, e, n, a, r, s) {
1730
1749
  src: r.url,
1731
1750
  alt: s.displayName,
1732
1751
  loading: "lazy"
1733
- }, null, 8, jn)
1734
- ], 8, Dn)) : s.kind === "audio" && r.url ? (l(), d("audio", {
1752
+ }, null, 8, Hn)
1753
+ ], 8, Pn)) : s.kind === "audio" && r.url ? (l(), c("audio", {
1735
1754
  key: 1,
1736
1755
  src: r.url,
1737
1756
  controls: "",
1738
1757
  preload: "metadata"
1739
- }, null, 8, Nn)) : s.kind === "video" && r.url ? (l(), d("video", {
1758
+ }, null, 8, zn)) : s.kind === "video" && r.url ? (l(), c("video", {
1740
1759
  key: 2,
1741
1760
  src: r.url,
1742
1761
  controls: "",
1743
1762
  preload: "metadata"
1744
- }, null, 8, Pn)) : (l(), d("a", {
1763
+ }, null, 8, Vn)) : (l(), c("a", {
1745
1764
  key: 3,
1746
1765
  class: "wm-att__file",
1747
1766
  href: r.url || "#",
@@ -1766,15 +1785,15 @@ function Gn(t, e, n, a, r, s) {
1766
1785
  i("path", { d: "M14 2v6h6" })
1767
1786
  ])
1768
1787
  ], -1)),
1769
- i("span", zn, [
1770
- i("span", Vn, y(s.displayName), 1),
1771
- s.sizeLabel ? (l(), d("span", qn, y(s.sizeLabel), 1)) : v("", !0)
1788
+ i("span", Wn, [
1789
+ i("span", Gn, b(s.displayName), 1),
1790
+ s.sizeLabel ? (l(), c("span", Kn, b(s.sizeLabel), 1)) : g("", !0)
1772
1791
  ]),
1773
- r.loading ? (l(), d("span", Wn)) : v("", !0)
1774
- ], 8, Hn))
1792
+ r.loading ? (l(), c("span", Yn)) : g("", !0)
1793
+ ], 8, qn))
1775
1794
  ], 2);
1776
1795
  }
1777
- const Kn = /* @__PURE__ */ L(Un, [["render", Gn], ["__scopeId", "data-v-1cd1267b"]]), Yn = {
1796
+ const Xn = /* @__PURE__ */ B(Nn, [["render", Jn], ["__scopeId", "data-v-1cd1267b"]]), Qn = {
1778
1797
  name: "WmBubble",
1779
1798
  props: {
1780
1799
  role: { type: String, default: "ai" },
@@ -1783,41 +1802,41 @@ const Kn = /* @__PURE__ */ L(Un, [["render", Gn], ["__scopeId", "data-v-1cd1267b
1783
1802
  },
1784
1803
  computed: {
1785
1804
  rendered() {
1786
- return be(this.text);
1805
+ return Ce(this.text);
1787
1806
  }
1788
1807
  }
1789
- }, Jn = ["innerHTML"];
1790
- function Xn(t, e, n, a, r, s) {
1791
- return l(), d("div", {
1792
- class: B(["wm-bubble", "wm-bubble--" + n.role])
1808
+ }, Zn = ["innerHTML"];
1809
+ function es(t, e, n, a, r, s) {
1810
+ return l(), c("div", {
1811
+ class: E(["wm-bubble", "wm-bubble--" + n.role])
1793
1812
  }, [
1794
- Te(t.$slots, "default", {}, () => [
1795
- i("span", { innerHTML: s.rendered }, null, 8, Jn)
1813
+ Oe(t.$slots, "default", {}, () => [
1814
+ i("span", { innerHTML: s.rendered }, null, 8, Zn)
1796
1815
  ], !0)
1797
1816
  ], 2);
1798
1817
  }
1799
- const Qn = /* @__PURE__ */ L(Yn, [["render", Xn], ["__scopeId", "data-v-bcbe5969"]]), Zn = { name: "WmTyping" }, es = { class: "wm-typing" };
1800
- function ts(t, e, n, a, r, s) {
1801
- return l(), d("div", es, [...e[0] || (e[0] = [
1818
+ const ts = /* @__PURE__ */ B(Qn, [["render", es], ["__scopeId", "data-v-c52bb028"]]), ns = { name: "WmTyping" }, ss = { class: "wm-typing" };
1819
+ function rs(t, e, n, a, r, s) {
1820
+ return l(), c("div", ss, [...e[0] || (e[0] = [
1802
1821
  i("span", { style: { "animation-delay": "0s" } }, null, -1),
1803
1822
  i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
1804
1823
  i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
1805
1824
  ])]);
1806
1825
  }
1807
- const ns = /* @__PURE__ */ L(Zn, [["render", ts], ["__scopeId", "data-v-df2447fd"]]);
1808
- function oe(t) {
1826
+ const is = /* @__PURE__ */ B(ns, [["render", rs], ["__scopeId", "data-v-df2447fd"]]);
1827
+ function ce(t) {
1809
1828
  return t ? t.client_msg_id || t.id : "";
1810
1829
  }
1811
- const ss = {
1830
+ const as = {
1812
1831
  transferred_to_human: "Conversation transférée à un humain",
1813
1832
  assigned: "{name} a rejoint la conversation",
1814
1833
  unassigned: "L'agent a quitté la conversation",
1815
1834
  resolved: "Conversation résolue",
1816
1835
  reopened: "Conversation rouverte",
1817
1836
  idle: "Conversation en pause"
1818
- }, rs = 80, is = 200, as = {
1837
+ }, os = 80, ls = 200, cs = {
1819
1838
  name: "WmMessageList",
1820
- components: { AIAvatar: X, HumanAvatar: we, Bubble: Qn, Typing: ns, ActionResult: Fn, AttachmentPreview: Kn, ArtifactRenderer: ke },
1839
+ components: { AIAvatar: J, HumanAvatar: ke, Bubble: ts, Typing: is, ActionResult: Dn, AttachmentPreview: Xn, ArtifactRenderer: Ae },
1821
1840
  props: {
1822
1841
  messages: { type: Array, default: () => [] },
1823
1842
  streamingActive: { type: Boolean, default: !1 },
@@ -1851,7 +1870,7 @@ const ss = {
1851
1870
  const s = this.roleOf(r);
1852
1871
  if (s === "system") {
1853
1872
  t.push({
1854
- key: `sys-${oe(r)}`,
1873
+ key: `sys-${ce(r)}`,
1855
1874
  role: s,
1856
1875
  messages: [r],
1857
1876
  systemLabel: this.systemLabel(r)
@@ -1860,7 +1879,7 @@ const ss = {
1860
1879
  }
1861
1880
  const o = t[t.length - 1];
1862
1881
  o && o.role === s && (s === "ai" || o.agentName === (((e = r == null ? void 0 : r.author) == null ? void 0 : e.name) || "")) ? o.messages.push(r) : t.push({
1863
- key: `g-${oe(r)}`,
1882
+ key: `g-${ce(r)}`,
1864
1883
  role: s,
1865
1884
  agentName: ((n = r == null ? void 0 : r.author) == null ? void 0 : n.name) || "",
1866
1885
  agentAvatarUrl: ((a = r == null ? void 0 : r.author) == null ? void 0 : a.avatar_url) || null,
@@ -1883,13 +1902,13 @@ const ss = {
1883
1902
  this._lastSeenConvId = this.conversationId, this.scrollToBottom();
1884
1903
  },
1885
1904
  methods: {
1886
- messageKey: oe,
1905
+ messageKey: ce,
1887
1906
  isAtBottom(t) {
1888
- return t.scrollHeight - t.scrollTop - t.clientHeight <= rs;
1907
+ return t.scrollHeight - t.scrollTop - t.clientHeight <= os;
1889
1908
  },
1890
1909
  onScroll() {
1891
1910
  const t = this.$refs.scrollEl;
1892
- t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= is && (this._pendingLoadMore = !0, this.$emit("load-more")));
1911
+ t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= ls && (this._pendingLoadMore = !0, this.$emit("load-more")));
1893
1912
  },
1894
1913
  // Capture pre-patch scroll state and restore it on the next tick.
1895
1914
  //
@@ -1937,11 +1956,11 @@ const ss = {
1937
1956
  }
1938
1957
  if (!r.anchor) return;
1939
1958
  const s = () => {
1940
- var k;
1959
+ var C;
1941
1960
  const o = r.anchor;
1942
- if (!((k = o.el) != null && k.isConnected)) return;
1943
- const p = o.el.getBoundingClientRect().top - t.getBoundingClientRect().top - o.relY;
1944
- Math.abs(p) > 0.5 && (t.scrollTop += p);
1961
+ if (!((C = o.el) != null && C.isConnected)) return;
1962
+ const v = o.el.getBoundingClientRect().top - t.getBoundingClientRect().top - o.relY;
1963
+ Math.abs(v) > 0.5 && (t.scrollTop += v);
1945
1964
  };
1946
1965
  s(), requestAnimationFrame(() => {
1947
1966
  s(), requestAnimationFrame(s);
@@ -1997,12 +2016,13 @@ const ss = {
1997
2016
  // - The two corners on the *opposite* edge stay rounded
1998
2017
  // unless the neighbour is a strictly-wider item (card vs
1999
2018
  // bubble) that physically covers them.
2000
- // Standalone bubbles (no neighbours) keep the tail design: a
2001
- // small TL for ai/human, small BR for user.
2019
+ // Bubbles also get a small "tail" on their bottom lateral
2020
+ // corner whenever they're the last item of the cluster
2021
+ // (standalone counts as last) — BL for ai/human, BR for user.
2002
2022
  cornersFor(t, e) {
2003
- const n = t.messages, a = this.itemKindOf(n[e]), r = this.itemKindOf(n[e - 1]), s = this.itemKindOf(n[e + 1]), o = t.role === "user", c = 14, p = 4, k = (N, I) => N === "card" && I === "bubble";
2004
- let g = c, T = c, R = c, x = c;
2005
- return o ? (r && (T = p, k(r, a) && (g = p)), s && (R = p, k(s, a) && (x = p)), !r && !s && a === "bubble" && (R = p)) : (r && (g = p, k(r, a) && (T = p)), s && (x = p, k(s, a) && (R = p)), !r && !s && a === "bubble" && (g = p)), { tl: g, tr: T, br: R, bl: x };
2023
+ const n = t.messages, a = this.itemKindOf(n[e]), r = this.itemKindOf(n[e - 1]), s = this.itemKindOf(n[e + 1]), o = t.role === "user", d = 14, v = 4, C = (D, x) => D === "card" && x === "bubble";
2024
+ let w = d, S = d, L = d, A = d;
2025
+ return o ? (r && (S = v, C(r, a) && (w = v)), s && (L = v, C(s, a) && (A = v)), !s && a === "bubble" && (L = v)) : (r && (w = v, C(r, a) && (S = v)), s && (A = v, C(s, a) && (L = v)), !s && a === "bubble" && (A = v)), { tl: w, tr: S, br: L, bl: A };
2006
2026
  },
2007
2027
  // Inline style emitting the four corner CSS variables. Set on
2008
2028
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2025,7 +2045,7 @@ const ss = {
2025
2045
  const e = t.messages[t.messages.length - 1];
2026
2046
  if (!(e != null && e.created_at)) return "";
2027
2047
  try {
2028
- return ye(new Date(e.created_at));
2048
+ return be(new Date(e.created_at));
2029
2049
  } catch {
2030
2050
  return "";
2031
2051
  }
@@ -2049,9 +2069,9 @@ const ss = {
2049
2069
  return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
2050
2070
  },
2051
2071
  actionDetail(t) {
2052
- var n, a, r, s, o, c;
2072
+ var n, a, r, s, o, d;
2053
2073
  const e = t == null ? void 0 : t.payload;
2054
- return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (a = e.success) == null ? void 0 : a.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((o = e.failure) == null ? void 0 : o.summary) || ((c = e.failure) == null ? void 0 : c.error)) || "" : "";
2074
+ return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (a = e.success) == null ? void 0 : a.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((o = e.failure) == null ? void 0 : o.summary) || ((d = e.failure) == null ? void 0 : d.error)) || "" : "";
2055
2075
  },
2056
2076
  actionArtifact(t) {
2057
2077
  var n, a;
@@ -2060,7 +2080,7 @@ const ss = {
2060
2080
  },
2061
2081
  systemLabel(t) {
2062
2082
  var r, s, o;
2063
- const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = ss[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
2083
+ const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = as[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
2064
2084
  return n.replace("{name}", a || "Un agent");
2065
2085
  },
2066
2086
  scrollToBottom() {
@@ -2068,123 +2088,126 @@ const ss = {
2068
2088
  t && (t.scrollTop = t.scrollHeight);
2069
2089
  }
2070
2090
  }
2071
- }, os = {
2091
+ }, ds = {
2072
2092
  key: 0,
2073
2093
  class: "wm-list__loadMore",
2074
2094
  role: "status",
2075
2095
  "aria-live": "polite"
2076
- }, ls = {
2096
+ }, us = {
2077
2097
  key: 1,
2078
2098
  class: "wm-list__historyEnd"
2079
- }, ds = {
2099
+ }, hs = {
2080
2100
  key: 2,
2081
2101
  class: "wm-list__sep"
2082
- }, cs = { class: "wm-list__sep-label" }, us = {
2102
+ }, ms = { class: "wm-list__sep-label" }, fs = {
2083
2103
  key: 0,
2084
2104
  class: "wm-list__sysep"
2085
- }, hs = { class: "wm-list__sysep-label" }, ms = {
2086
- key: 0,
2087
- class: "wm-list__role"
2088
- }, fs = {
2105
+ }, _s = { class: "wm-list__sysep-label" }, ps = {
2089
2106
  key: 0,
2090
2107
  class: "wm-list__avatarSlot"
2091
- }, _s = {
2108
+ }, vs = {
2092
2109
  key: 3,
2093
2110
  class: "wm-list__body"
2094
- }, ps = {
2111
+ }, ys = { key: 0 }, gs = {
2112
+ key: 1,
2113
+ "aria-hidden": "true"
2114
+ }, ws = { key: 2 }, bs = {
2095
2115
  key: 3,
2096
2116
  class: "wm-list__row wm-list__row--ai fade-up"
2097
- }, vs = { class: "wm-list__avatarSlot" };
2098
- function gs(t, e, n, a, r, s) {
2099
- const o = O("AIAvatar"), c = O("HumanAvatar"), p = O("ActionResult"), k = O("ArtifactRenderer"), g = O("Bubble"), T = O("AttachmentPreview"), R = O("Typing");
2100
- return l(), d("div", {
2117
+ }, ks = { class: "wm-list__avatarSlot" };
2118
+ function Cs(t, e, n, a, r, s) {
2119
+ const o = I("AIAvatar"), d = I("HumanAvatar"), v = I("ActionResult"), C = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), L = I("Typing");
2120
+ return l(), c("div", {
2101
2121
  ref: "scrollEl",
2102
- class: B(["wm-list", { "wm-list--silent": r.silentFades }]),
2103
- onScrollPassive: e[0] || (e[0] = (...x) => s.onScroll && s.onScroll(...x))
2122
+ class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
2123
+ onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
2104
2124
  }, [
2105
- n.loadingMore ? (l(), d("div", os, [...e[1] || (e[1] = [
2125
+ n.loadingMore ? (l(), c("div", ds, [...e[1] || (e[1] = [
2106
2126
  i("span", {
2107
2127
  class: "wm-list__loadMore-spinner",
2108
2128
  "aria-hidden": "true"
2109
2129
  }, null, -1),
2110
2130
  i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
2111
- ])])) : s.historyExhausted ? (l(), d("div", ls, "Début de la conversation")) : v("", !0),
2112
- n.dateLabel ? (l(), d("div", ds, [
2131
+ ])])) : s.historyExhausted ? (l(), c("div", us, "Début de la conversation")) : g("", !0),
2132
+ n.dateLabel ? (l(), c("div", hs, [
2113
2133
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2114
- i("span", cs, y(n.dateLabel), 1),
2134
+ i("span", ms, b(n.dateLabel), 1),
2115
2135
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2116
- ])) : v("", !0),
2117
- (l(!0), d(E, null, F(s.groups, (x, N) => (l(), d("div", {
2118
- key: x.key,
2119
- class: B(["wm-list__group", "wm-list__group--" + x.role])
2136
+ ])) : g("", !0),
2137
+ (l(!0), c(O, null, F(s.groups, (A, D) => (l(), c("div", {
2138
+ key: A.key,
2139
+ class: E(["wm-list__group", "wm-list__group--" + A.role])
2120
2140
  }, [
2121
- x.role === "system" ? (l(), d("div", us, [
2141
+ A.role === "system" ? (l(), c("div", fs, [
2122
2142
  e[4] || (e[4] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2123
- i("span", hs, y(x.systemLabel), 1),
2143
+ i("span", _s, b(A.systemLabel), 1),
2124
2144
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2125
- ])) : (l(), d(E, { key: 1 }, [
2126
- x.role !== "user" ? (l(), d("div", ms, y(s.roleLabel(x)), 1)) : v("", !0),
2127
- (l(!0), d(E, null, F(x.messages, (I, P) => (l(), d("div", {
2128
- key: s.messageKey(I),
2129
- class: B(["wm-list__row fade-up", ["wm-list__row--" + x.role, { "is-pending": I._pending, "is-failed": I._failed }]]),
2130
- style: H(s.cornersStyle(x, P))
2145
+ ])) : (l(), c(O, { key: 1 }, [
2146
+ (l(!0), c(O, null, F(A.messages, (x, N) => (l(), c("div", {
2147
+ key: s.messageKey(x),
2148
+ class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x._pending, "is-failed": x._failed }]]),
2149
+ style: P(s.cornersStyle(A, N))
2131
2150
  }, [
2132
- x.role !== "user" ? (l(), d("div", fs, [
2133
- P === x.messages.length - 1 ? (l(), d(E, { key: 0 }, [
2134
- x.role === "ai" ? (l(), $(o, {
2151
+ A.role !== "user" ? (l(), c("div", ps, [
2152
+ N === A.messages.length - 1 ? (l(), c(O, { key: 0 }, [
2153
+ A.role === "ai" ? (l(), $(o, {
2135
2154
  key: 0,
2136
2155
  size: 26
2137
- })) : (l(), $(c, {
2156
+ })) : (l(), $(d, {
2138
2157
  key: 1,
2139
- name: x.agentName,
2140
- "avatar-url": x.agentAvatarUrl,
2158
+ name: A.agentName,
2159
+ "avatar-url": A.agentAvatarUrl,
2141
2160
  size: 26
2142
2161
  }, null, 8, ["name", "avatar-url"]))
2143
- ], 64)) : v("", !0)
2144
- ])) : v("", !0),
2145
- I.type === "action" && I.payload && I.payload.state !== "pending" ? (l(), $(p, {
2162
+ ], 64)) : g("", !0)
2163
+ ])) : g("", !0),
2164
+ x.type === "action" && x.payload && x.payload.state !== "pending" ? (l(), $(v, {
2146
2165
  key: 1,
2147
- state: I.payload.state,
2148
- label: s.actionLabel(I),
2149
- detail: s.actionDetail(I),
2150
- artifact: s.actionArtifact(I)
2151
- }, null, 8, ["state", "label", "detail", "artifact"])) : s.artifactOf(I) ? (l(), $(k, {
2166
+ state: x.payload.state,
2167
+ label: s.actionLabel(x),
2168
+ detail: s.actionDetail(x),
2169
+ artifact: s.actionArtifact(x)
2170
+ }, null, 8, ["state", "label", "detail", "artifact"])) : s.artifactOf(x) ? (l(), $(C, {
2152
2171
  key: 2,
2153
- artifact: s.artifactOf(I)
2154
- }, null, 8, ["artifact"])) : (l(), d("div", _s, [
2155
- I.text_md ? (l(), $(g, {
2172
+ artifact: s.artifactOf(x)
2173
+ }, null, 8, ["artifact"])) : (l(), c("div", vs, [
2174
+ x.text_md ? (l(), $(w, {
2156
2175
  key: 0,
2157
- role: x.role,
2158
- text: I.text_md
2159
- }, null, 8, ["role", "text"])) : v("", !0),
2160
- s.attachmentsOf(I).length ? (l(), d("div", {
2176
+ role: A.role,
2177
+ text: x.text_md
2178
+ }, null, 8, ["role", "text"])) : g("", !0),
2179
+ s.attachmentsOf(x).length ? (l(), c("div", {
2161
2180
  key: 1,
2162
- class: B(["wm-list__atts", { "wm-list__atts--align-end": x.role === "user" }])
2181
+ class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2163
2182
  }, [
2164
- (l(!0), d(E, null, F(s.attachmentsOf(I), (U, V) => (l(), $(T, {
2165
- key: `${s.messageKey(I)}-att-${V}`,
2166
- attachment: U
2183
+ (l(!0), c(O, null, F(s.attachmentsOf(x), (j, z) => (l(), $(S, {
2184
+ key: `${s.messageKey(x)}-att-${z}`,
2185
+ attachment: j
2167
2186
  }, null, 8, ["attachment"]))), 128))
2168
- ], 2)) : v("", !0)
2187
+ ], 2)) : g("", !0)
2169
2188
  ]))
2170
2189
  ], 6))), 128)),
2171
- s.lastTimeOf(x) ? (l(), d("div", {
2172
- key: 1,
2173
- class: B(["wm-list__time", { "wm-list__time--right": x.role === "user" }])
2174
- }, y(s.lastTimeOf(x)), 3)) : v("", !0)
2190
+ A.role !== "user" || s.lastTimeOf(A) ? (l(), c("div", {
2191
+ key: 0,
2192
+ class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2193
+ }, [
2194
+ A.role !== "user" ? (l(), c("span", ys, b(s.roleLabel(A)), 1)) : g("", !0),
2195
+ A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", gs, "·")) : g("", !0),
2196
+ s.lastTimeOf(A) ? (l(), c("span", ws, b(s.lastTimeOf(A)), 1)) : g("", !0)
2197
+ ], 2)) : g("", !0)
2175
2198
  ], 64))
2176
2199
  ], 2))), 128)),
2177
- n.streamingActive ? (l(), d("div", ps, [
2178
- i("div", vs, [
2179
- z(o, { size: 26 })
2200
+ n.streamingActive ? (l(), c("div", bs, [
2201
+ i("div", ks, [
2202
+ H(o, { size: 26 })
2180
2203
  ]),
2181
- z(R)
2182
- ])) : v("", !0)
2204
+ H(L)
2205
+ ])) : g("", !0)
2183
2206
  ], 34);
2184
2207
  }
2185
- const ys = /* @__PURE__ */ L(as, [["render", gs], ["__scopeId", "data-v-f23f2f8c"]]), te = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", ce = typeof window < "u" && typeof window.MediaRecorder < "u";
2186
- function ws() {
2187
- return ce && [
2208
+ const As = /* @__PURE__ */ B(cs, [["render", Cs], ["__scopeId", "data-v-02fa95cc"]]), te = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2209
+ function Ss() {
2210
+ return he && [
2188
2211
  "video/webm;codecs=vp9,opus",
2189
2212
  "video/webm;codecs=vp8,opus",
2190
2213
  "video/webm",
@@ -2194,7 +2217,7 @@ function ws() {
2194
2217
  return (a = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : a.call(n, e);
2195
2218
  }) || "";
2196
2219
  }
2197
- function Ce({ audio: t }) {
2220
+ function Se({ audio: t }) {
2198
2221
  return {
2199
2222
  video: !0,
2200
2223
  audio: !!t,
@@ -2203,19 +2226,19 @@ function Ce({ audio: t }) {
2203
2226
  systemAudio: t ? "include" : "exclude"
2204
2227
  };
2205
2228
  }
2206
- function Bi(t) {
2229
+ function ji(t) {
2207
2230
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
2208
2231
  }
2209
- async function bs() {
2232
+ async function xs() {
2210
2233
  if (!te) return null;
2211
2234
  let t;
2212
2235
  try {
2213
- t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
2236
+ t = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !1 }));
2214
2237
  } catch (e) {
2215
2238
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2216
2239
  }
2217
2240
  try {
2218
- return await ks(t);
2241
+ return await Ms(t);
2219
2242
  } catch (e) {
2220
2243
  return console.error("[media] screenshot capture", e), null;
2221
2244
  } finally {
@@ -2224,78 +2247,78 @@ async function bs() {
2224
2247
  });
2225
2248
  }
2226
2249
  }
2227
- async function ks(t) {
2250
+ async function Ms(t) {
2228
2251
  const e = document.createElement("video");
2229
- e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((c) => requestAnimationFrame(c));
2252
+ e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
2230
2253
  const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
2231
2254
  r.width = n, r.height = a, r.getContext("2d").drawImage(e, 0, 0, n, a);
2232
- const s = await new Promise((c, p) => {
2233
- r.toBlob((k) => k ? c(k) : p(new Error("toBlob failed")), "image/png");
2255
+ const s = await new Promise((d, v) => {
2256
+ r.toBlob((C) => C ? d(C) : v(new Error("toBlob failed")), "image/png");
2234
2257
  }), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2235
2258
  return new File([s], `capture-${o}.png`, { type: "image/png" });
2236
2259
  }
2237
- async function Cs(t = {}) {
2238
- var k;
2239
- if (!te || !ce) return null;
2260
+ async function Ts(t = {}) {
2261
+ var C;
2262
+ if (!te || !he) return null;
2240
2263
  let e;
2241
2264
  try {
2242
- e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
2243
- } catch (g) {
2244
- return (g == null ? void 0 : g.name) !== "NotAllowedError" && console.error("[media] record picker", g), null;
2265
+ e = await navigator.mediaDevices.getDisplayMedia(Se({ audio: !0 }));
2266
+ } catch (w) {
2267
+ return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
2245
2268
  }
2246
- const n = ws();
2269
+ const n = Ss();
2247
2270
  let a;
2248
2271
  try {
2249
2272
  a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
2250
- } catch (g) {
2251
- return console.error("[media] recorder init", g), e.getTracks().forEach((T) => {
2252
- T.stop();
2273
+ } catch (w) {
2274
+ return console.error("[media] recorder init", w), e.getTracks().forEach((S) => {
2275
+ S.stop();
2253
2276
  }), null;
2254
2277
  }
2255
2278
  const r = [];
2256
2279
  let s = null, o = !1;
2257
- a.addEventListener("dataavailable", (g) => {
2258
- g.data && g.data.size > 0 && r.push(g.data);
2280
+ a.addEventListener("dataavailable", (w) => {
2281
+ w.data && w.data.size > 0 && r.push(w.data);
2259
2282
  }), a.addEventListener("stop", () => {
2260
- var g, T;
2261
- if (s && clearInterval(s), e.getTracks().forEach((R) => {
2262
- R.stop();
2283
+ var w, S;
2284
+ if (s && clearInterval(s), e.getTracks().forEach((L) => {
2285
+ L.stop();
2263
2286
  }), r.length) {
2264
- const R = a.mimeType || n || "video/webm", x = new Blob(r, { type: R }), N = /mp4/.test(R) ? "mp4" : "webm", I = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), P = new File([x], `ecran-${I}.${N}`, { type: R });
2265
- (g = t.onfinalize) == null || g.call(t, P);
2287
+ const L = a.mimeType || n || "video/webm", A = new Blob(r, { type: L }), D = /mp4/.test(L) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), N = new File([A], `ecran-${x}.${D}`, { type: L });
2288
+ (w = t.onfinalize) == null || w.call(t, N);
2266
2289
  } else
2267
- (T = t.oncancel) == null || T.call(t);
2268
- }), e.getVideoTracks().forEach((g) => {
2269
- g.addEventListener("ended", () => c(), { once: !0 });
2290
+ (S = t.oncancel) == null || S.call(t);
2291
+ }), e.getVideoTracks().forEach((w) => {
2292
+ w.addEventListener("ended", () => d(), { once: !0 });
2270
2293
  });
2271
- function c() {
2294
+ function d() {
2272
2295
  if (!o && (o = !0, a.state !== "inactive"))
2273
2296
  try {
2274
2297
  a.stop();
2275
- } catch (g) {
2276
- console.error("[media] recorder stop", g);
2298
+ } catch (w) {
2299
+ console.error("[media] recorder stop", w);
2277
2300
  }
2278
2301
  }
2279
2302
  try {
2280
2303
  a.start(1e3);
2281
- } catch (g) {
2282
- return console.error("[media] recorder start", g), e.getTracks().forEach((T) => {
2283
- T.stop();
2304
+ } catch (w) {
2305
+ return console.error("[media] recorder start", w), e.getTracks().forEach((S) => {
2306
+ S.stop();
2284
2307
  }), null;
2285
2308
  }
2286
- (k = t.onstart) == null || k.call(t);
2287
- const p = Date.now();
2309
+ (C = t.onstart) == null || C.call(t);
2310
+ const v = Date.now();
2288
2311
  return s = setInterval(() => {
2289
- var g;
2290
- (g = t.ontick) == null || g.call(t, Date.now() - p);
2312
+ var w;
2313
+ (w = t.ontick) == null || w.call(t, Date.now() - v);
2291
2314
  }, 500), {
2292
- stop: c,
2315
+ stop: d,
2293
2316
  get state() {
2294
2317
  return a.state;
2295
2318
  }
2296
2319
  };
2297
2320
  }
2298
- const As = [
2321
+ const Is = [
2299
2322
  {
2300
2323
  action: "file",
2301
2324
  label: "Joindre un fichier",
@@ -2311,7 +2334,7 @@ const As = [
2311
2334
  label: "Enregistrer l'écran",
2312
2335
  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"
2313
2336
  }
2314
- ], Ss = {
2337
+ ], Os = {
2315
2338
  name: "WmComposer",
2316
2339
  props: {
2317
2340
  modelValue: { type: String, default: "" },
@@ -2334,9 +2357,9 @@ const As = [
2334
2357
  return !this.disabled && !!this.local.trim();
2335
2358
  },
2336
2359
  attachItems() {
2337
- return As.map((t) => ({
2360
+ return Is.map((t) => ({
2338
2361
  ...t,
2339
- disabled: t.action === "screenshot" && !te || t.action === "record" && (!te || !ce)
2362
+ disabled: t.action === "screenshot" && !te || t.action === "record" && (!te || !he)
2340
2363
  }));
2341
2364
  },
2342
2365
  recordingElapsedLabel() {
@@ -2406,13 +2429,13 @@ const As = [
2406
2429
  },
2407
2430
  async captureScreenshot() {
2408
2431
  if (this.disabled) return;
2409
- const t = await bs();
2432
+ const t = await xs();
2410
2433
  t && this.$emit("attach", t);
2411
2434
  },
2412
2435
  async startRecording() {
2413
2436
  if (this.recording || this.disabled) return;
2414
2437
  this.recordingElapsed = 0;
2415
- const t = await Cs({
2438
+ const t = await Ts({
2416
2439
  onstart: () => {
2417
2440
  this.recording = !0;
2418
2441
  },
@@ -2437,36 +2460,36 @@ const As = [
2437
2460
  }
2438
2461
  }
2439
2462
  }
2440
- }, xs = { class: "wm-compose-wrap" }, Ms = {
2463
+ }, Es = { class: "wm-compose-wrap" }, Bs = {
2441
2464
  key: 0,
2442
2465
  class: "wm-rec"
2443
- }, Ts = { class: "wm-rec__lbl" }, Is = {
2466
+ }, Ls = { class: "wm-rec__lbl" }, Rs = {
2444
2467
  key: 1,
2445
2468
  class: "wm-compose__menu",
2446
2469
  role: "menu"
2447
- }, Os = ["disabled", "onClick"], Es = { class: "wm-compose__menuIcon" }, Bs = {
2470
+ }, $s = ["disabled", "onClick"], Fs = { class: "wm-compose__menuIcon" }, js = {
2448
2471
  viewBox: "0 0 24 24",
2449
2472
  width: "14",
2450
2473
  height: "14",
2451
2474
  "aria-hidden": "true"
2452
- }, Ls = ["d"], Rs = ["placeholder", "disabled"], $s = { class: "wm-compose__actions" }, Fs = ["title", "aria-label", "disabled"], Us = ["disabled"];
2453
- function Ds(t, e, n, a, r, s) {
2454
- return l(), d("div", xs, [
2455
- r.recording ? (l(), d("div", Ms, [
2475
+ }, Us = ["d"], Ds = ["placeholder", "disabled"], Ns = { class: "wm-compose__actions" }, Ps = ["title", "aria-label", "disabled"], Hs = ["disabled"];
2476
+ function zs(t, e, n, a, r, s) {
2477
+ return l(), c("div", Es, [
2478
+ r.recording ? (l(), c("div", Bs, [
2456
2479
  e[8] || (e[8] = i("span", {
2457
2480
  class: "wm-rec__dot",
2458
2481
  "aria-hidden": "true"
2459
2482
  }, null, -1)),
2460
- i("span", Ts, "Enregistrement · " + y(s.recordingElapsedLabel), 1),
2483
+ i("span", Ls, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2461
2484
  i("button", {
2462
2485
  type: "button",
2463
2486
  class: "wm-rec__stop",
2464
2487
  onClick: e[0] || (e[0] = (...o) => s.stopRecording && s.stopRecording(...o))
2465
2488
  }, "Arrêter")
2466
- ])) : v("", !0),
2489
+ ])) : g("", !0),
2467
2490
  i("form", {
2468
- class: B(["wm-compose", { "has-attach": r.attachOpen }]),
2469
- onSubmit: e[7] || (e[7] = J((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2491
+ class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2492
+ onSubmit: e[7] || (e[7] = Y((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2470
2493
  }, [
2471
2494
  i("input", {
2472
2495
  ref: "fileEl",
@@ -2475,21 +2498,21 @@ function Ds(t, e, n, a, r, s) {
2475
2498
  multiple: "",
2476
2499
  onChange: e[1] || (e[1] = (...o) => s.onFile && s.onFile(...o))
2477
2500
  }, null, 544),
2478
- r.attachOpen ? (l(), d("div", {
2501
+ r.attachOpen ? (l(), c("div", {
2479
2502
  key: 0,
2480
2503
  class: "wm-compose__overlay",
2481
2504
  onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
2482
- })) : v("", !0),
2483
- r.attachOpen ? (l(), d("div", Is, [
2484
- (l(!0), d(E, null, F(s.attachItems, (o) => (l(), d("button", {
2505
+ })) : g("", !0),
2506
+ r.attachOpen ? (l(), c("div", Rs, [
2507
+ (l(!0), c(O, null, F(s.attachItems, (o) => (l(), c("button", {
2485
2508
  key: o.action,
2486
2509
  type: "button",
2487
2510
  class: "wm-compose__menuItem",
2488
2511
  disabled: o.disabled,
2489
- onClick: (c) => s.onAttachAction(o.action)
2512
+ onClick: (d) => s.onAttachAction(o.action)
2490
2513
  }, [
2491
- i("span", Es, [
2492
- (l(), d("svg", Bs, [
2514
+ i("span", Fs, [
2515
+ (l(), c("svg", js, [
2493
2516
  i("path", {
2494
2517
  d: o.path,
2495
2518
  stroke: "currentColor",
@@ -2497,13 +2520,13 @@ function Ds(t, e, n, a, r, s) {
2497
2520
  "stroke-linecap": "round",
2498
2521
  "stroke-linejoin": "round",
2499
2522
  fill: "none"
2500
- }, null, 8, Ls)
2523
+ }, null, 8, Us)
2501
2524
  ]))
2502
2525
  ]),
2503
- i("span", null, y(o.label), 1)
2504
- ], 8, Os))), 128))
2505
- ])) : v("", !0),
2506
- q(i("textarea", {
2526
+ i("span", null, b(o.label), 1)
2527
+ ], 8, $s))), 128))
2528
+ ])) : g("", !0),
2529
+ V(i("textarea", {
2507
2530
  ref: "inputEl",
2508
2531
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
2509
2532
  class: "wm-compose__input",
@@ -2512,13 +2535,13 @@ function Ds(t, e, n, a, r, s) {
2512
2535
  disabled: n.disabled,
2513
2536
  onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
2514
2537
  onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
2515
- }, null, 40, Rs), [
2538
+ }, null, 40, Ds), [
2516
2539
  [G, r.local]
2517
2540
  ]),
2518
- i("div", $s, [
2541
+ i("div", Ns, [
2519
2542
  i("button", {
2520
2543
  type: "button",
2521
- class: B(["wm-compose__icon", { "is-open": r.attachOpen }]),
2544
+ class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
2522
2545
  title: n.attachLabel,
2523
2546
  "aria-label": n.attachLabel,
2524
2547
  disabled: r.recording,
@@ -2537,10 +2560,10 @@ function Ds(t, e, n, a, r, s) {
2537
2560
  }, [
2538
2561
  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" })
2539
2562
  ], -1)
2540
- ])], 10, Fs),
2563
+ ])], 10, Ps),
2541
2564
  i("button", {
2542
2565
  type: "submit",
2543
- class: B(["wm-compose__send", { "is-empty": !s.canSend }]),
2566
+ class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
2544
2567
  disabled: !s.canSend,
2545
2568
  "aria-label": "Envoyer"
2546
2569
  }, [...e[10] || (e[10] = [
@@ -2557,12 +2580,12 @@ function Ds(t, e, n, a, r, s) {
2557
2580
  }, [
2558
2581
  i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
2559
2582
  ], -1)
2560
- ])], 10, Us)
2583
+ ])], 10, Hs)
2561
2584
  ])
2562
2585
  ], 34)
2563
2586
  ]);
2564
2587
  }
2565
- const js = /* @__PURE__ */ L(Ss, [["render", Ds], ["__scopeId", "data-v-14fa9ec0"]]), Ns = {
2588
+ const Vs = /* @__PURE__ */ B(Os, [["render", zs], ["__scopeId", "data-v-14fa9ec0"]]), qs = {
2566
2589
  name: "WmSuggestionChips",
2567
2590
  props: {
2568
2591
  items: { type: Array, default: () => [] },
@@ -2579,24 +2602,24 @@ const js = /* @__PURE__ */ L(Ss, [["render", Ds], ["__scopeId", "data-v-14fa9ec0
2579
2602
  return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
2580
2603
  }
2581
2604
  }
2582
- }, Ps = ["onClick"];
2583
- function Hs(t, e, n, a, r, s) {
2584
- return n.items.length ? (l(), d("div", {
2605
+ }, Ws = ["onClick"];
2606
+ function Gs(t, e, n, a, r, s) {
2607
+ return n.items.length ? (l(), c("div", {
2585
2608
  key: s.batchKey,
2586
2609
  class: "wm-chips"
2587
2610
  }, [
2588
- (l(!0), d(E, null, F(n.items, (o, c) => (l(), d("button", {
2589
- key: c,
2611
+ (l(!0), c(O, null, F(n.items, (o, d) => (l(), c("button", {
2612
+ key: d,
2590
2613
  type: "button",
2591
2614
  class: "wm-chip",
2592
- style: H({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2593
- onClick: (p) => t.$emit("select", o)
2594
- }, y(o.label), 13, Ps))), 128))
2595
- ])) : v("", !0);
2615
+ style: P({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
2616
+ onClick: (v) => t.$emit("select", o)
2617
+ }, b(o.label), 13, Ws))), 128))
2618
+ ])) : g("", !0);
2596
2619
  }
2597
- const zs = /* @__PURE__ */ L(Ns, [["render", Hs], ["__scopeId", "data-v-55aa529d"]]), Vs = {
2620
+ const Ks = /* @__PURE__ */ B(qs, [["render", Gs], ["__scopeId", "data-v-55aa529d"]]), Ys = {
2598
2621
  name: "WmApprovalCard",
2599
- components: { AIAvatar: X },
2622
+ components: { AIAvatar: J },
2600
2623
  props: {
2601
2624
  action: { type: String, required: !0 },
2602
2625
  detail: { type: String, default: "" },
@@ -2627,41 +2650,41 @@ const zs = /* @__PURE__ */ L(Ns, [["render", Hs], ["__scopeId", "data-v-55aa529d
2627
2650
  return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
2628
2651
  }
2629
2652
  }
2630
- }, qs = { class: "wm-approval" }, Ws = { class: "wm-approval__head" }, Gs = { class: "wm-approval__icon" }, Ks = { class: "wm-approval__main" }, Ys = { class: "wm-approval__title" }, Js = {
2653
+ }, Js = { class: "wm-approval" }, Xs = { class: "wm-approval__head" }, Qs = { class: "wm-approval__icon" }, Zs = { class: "wm-approval__main" }, er = { class: "wm-approval__title" }, tr = {
2631
2654
  key: 0,
2632
2655
  class: "wm-approval__detail"
2633
- }, Xs = { class: "wm-approval__actions" };
2634
- function Qs(t, e, n, a, r, s) {
2635
- const o = O("AIAvatar");
2636
- return l(), d("div", qs, [
2637
- i("div", Ws, [
2638
- i("div", Gs, [
2639
- z(o, { size: 24 })
2656
+ }, nr = { class: "wm-approval__actions" };
2657
+ function sr(t, e, n, a, r, s) {
2658
+ const o = I("AIAvatar");
2659
+ return l(), c("div", Js, [
2660
+ i("div", Xs, [
2661
+ i("div", Qs, [
2662
+ H(o, { size: 24 })
2640
2663
  ]),
2641
- i("div", Ks, [
2642
- i("div", Ys, y(n.action), 1),
2643
- n.detail ? (l(), d("div", Js, y(n.detail), 1)) : v("", !0)
2664
+ i("div", Zs, [
2665
+ i("div", er, b(n.action), 1),
2666
+ n.detail ? (l(), c("div", tr, b(n.detail), 1)) : g("", !0)
2644
2667
  ])
2645
2668
  ]),
2646
- i("div", Xs, [
2647
- s.rejectId ? (l(), d("button", {
2669
+ i("div", nr, [
2670
+ s.rejectId ? (l(), c("button", {
2648
2671
  key: 0,
2649
2672
  type: "button",
2650
2673
  class: "wm-approval__btn wm-approval__btn--neutral",
2651
- onClick: e[0] || (e[0] = (c) => t.$emit("callback", s.rejectId))
2652
- }, y(s.rejectLabel), 1)) : v("", !0),
2653
- s.approveId ? (l(), d("button", {
2674
+ onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
2675
+ }, b(s.rejectLabel), 1)) : g("", !0),
2676
+ s.approveId ? (l(), c("button", {
2654
2677
  key: 1,
2655
2678
  type: "button",
2656
2679
  class: "wm-approval__btn wm-approval__btn--primary",
2657
- onClick: e[1] || (e[1] = (c) => t.$emit("callback", s.approveId))
2658
- }, y(s.approveLabel), 1)) : v("", !0)
2680
+ onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
2681
+ }, b(s.approveLabel), 1)) : g("", !0)
2659
2682
  ])
2660
2683
  ]);
2661
2684
  }
2662
- const Zs = /* @__PURE__ */ L(Vs, [["render", Qs], ["__scopeId", "data-v-b1be139c"]]);
2663
- let _e = 0;
2664
- const er = /* @__PURE__ */ new Set([
2685
+ const rr = /* @__PURE__ */ B(Ys, [["render", sr], ["__scopeId", "data-v-b1be139c"]]);
2686
+ let ve = 0;
2687
+ const ir = /* @__PURE__ */ new Set([
2665
2688
  "text",
2666
2689
  "textarea",
2667
2690
  "number",
@@ -2669,9 +2692,9 @@ const er = /* @__PURE__ */ new Set([
2669
2692
  "select",
2670
2693
  "multiselect",
2671
2694
  "date"
2672
- ]), tr = {
2695
+ ]), ar = {
2673
2696
  name: "WmFormCard",
2674
- components: { AIAvatar: X },
2697
+ components: { AIAvatar: J },
2675
2698
  props: {
2676
2699
  form: { type: Object, required: !0 },
2677
2700
  readOnly: { type: Boolean, default: !1 },
@@ -2679,8 +2702,8 @@ const er = /* @__PURE__ */ new Set([
2679
2702
  },
2680
2703
  emits: ["submit"],
2681
2704
  data() {
2682
- return _e += 1, {
2683
- _uid: _e,
2705
+ return ve += 1, {
2706
+ _uid: ve,
2684
2707
  values: {},
2685
2708
  busy: !1,
2686
2709
  error: ""
@@ -2692,7 +2715,7 @@ const er = /* @__PURE__ */ new Set([
2692
2715
  // douteux.
2693
2716
  normalizedFields() {
2694
2717
  var e;
2695
- return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !er.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2718
+ return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !ir.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2696
2719
  }
2697
2720
  },
2698
2721
  created() {
@@ -2743,163 +2766,163 @@ const er = /* @__PURE__ */ new Set([
2743
2766
  }
2744
2767
  }
2745
2768
  }
2746
- }, nr = { class: "wm-form" }, sr = { class: "wm-form__head" }, rr = { class: "wm-form__icon" }, ir = { class: "wm-form__main" }, ar = { class: "wm-form__title" }, or = {
2769
+ }, or = { class: "wm-form" }, lr = { class: "wm-form__head" }, cr = { class: "wm-form__icon" }, dr = { class: "wm-form__main" }, ur = { class: "wm-form__title" }, hr = {
2747
2770
  key: 0,
2748
2771
  class: "wm-form__detail"
2749
- }, lr = ["for"], dr = {
2772
+ }, mr = ["for"], fr = {
2750
2773
  key: 0,
2751
2774
  class: "wm-form__req",
2752
2775
  "aria-hidden": "true"
2753
- }, cr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], ur = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], hr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], mr = ["id", "onUpdate:modelValue", "required", "disabled"], fr = {
2776
+ }, _r = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], pr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], vr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], yr = ["id", "onUpdate:modelValue", "required", "disabled"], gr = {
2754
2777
  key: 4,
2755
2778
  class: "wm-form__bool"
2756
- }, _r = ["id", "onUpdate:modelValue", "disabled"], pr = ["id", "onUpdate:modelValue", "required", "disabled"], vr = {
2779
+ }, wr = ["id", "onUpdate:modelValue", "disabled"], br = ["id", "onUpdate:modelValue", "required", "disabled"], kr = {
2757
2780
  value: "",
2758
2781
  disabled: ""
2759
- }, gr = ["value"], yr = {
2782
+ }, Cr = ["value"], Ar = {
2760
2783
  key: 6,
2761
2784
  class: "wm-form__multi"
2762
- }, wr = ["value", "checked", "disabled", "onChange"], br = {
2785
+ }, Sr = ["value", "checked", "disabled", "onChange"], xr = {
2763
2786
  key: 0,
2764
2787
  class: "wm-form__err"
2765
- }, kr = ["disabled"], Cr = {
2788
+ }, Mr = ["disabled"], Tr = {
2766
2789
  key: 0,
2767
2790
  class: "wm-form__spinner",
2768
2791
  "aria-hidden": "true"
2769
- }, Ar = {
2792
+ }, Ir = {
2770
2793
  key: 2,
2771
2794
  class: "wm-form__doneLbl"
2772
2795
  };
2773
- function Sr(t, e, n, a, r, s) {
2774
- const o = O("AIAvatar");
2775
- return l(), d("div", nr, [
2776
- i("div", sr, [
2777
- i("div", rr, [
2778
- z(o, { size: 24 })
2796
+ function Or(t, e, n, a, r, s) {
2797
+ const o = I("AIAvatar");
2798
+ return l(), c("div", or, [
2799
+ i("div", lr, [
2800
+ i("div", cr, [
2801
+ H(o, { size: 24 })
2779
2802
  ]),
2780
- i("div", ir, [
2781
- i("div", ar, y(n.form.title || "Formulaire"), 1),
2782
- n.form.description ? (l(), d("div", or, y(n.form.description), 1)) : v("", !0)
2803
+ i("div", dr, [
2804
+ i("div", ur, b(n.form.title || "Formulaire"), 1),
2805
+ n.form.description ? (l(), c("div", hr, b(n.form.description), 1)) : g("", !0)
2783
2806
  ])
2784
2807
  ]),
2785
2808
  i("form", {
2786
2809
  class: "wm-form__body",
2787
- onSubmit: e[0] || (e[0] = J((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
2810
+ onSubmit: e[0] || (e[0] = Y((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
2788
2811
  }, [
2789
- (l(!0), d(E, null, F(s.normalizedFields, (c) => (l(), d("div", {
2790
- key: c.key,
2812
+ (l(!0), c(O, null, F(s.normalizedFields, (d) => (l(), c("div", {
2813
+ key: d.key,
2791
2814
  class: "wm-form__field"
2792
2815
  }, [
2793
2816
  i("label", {
2794
- for: `wm-f-${r._uid}-${c.key}`,
2817
+ for: `wm-f-${r._uid}-${d.key}`,
2795
2818
  class: "wm-form__label"
2796
2819
  }, [
2797
- se(y(c.label), 1),
2798
- c.required ? (l(), d("span", dr, "*")) : v("", !0)
2799
- ], 8, lr),
2800
- c.type === "text" ? q((l(), d("input", {
2820
+ se(b(d.label), 1),
2821
+ d.required ? (l(), c("span", fr, "*")) : g("", !0)
2822
+ ], 8, mr),
2823
+ d.type === "text" ? V((l(), c("input", {
2801
2824
  key: 0,
2802
- id: `wm-f-${r._uid}-${c.key}`,
2803
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2825
+ id: `wm-f-${r._uid}-${d.key}`,
2826
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2804
2827
  type: "text",
2805
2828
  class: "wm-form__input",
2806
- placeholder: c.placeholder || "",
2807
- required: c.required,
2829
+ placeholder: d.placeholder || "",
2830
+ required: d.required,
2808
2831
  disabled: n.readOnly || r.busy
2809
- }, null, 8, cr)), [
2810
- [G, r.values[c.key]]
2811
- ]) : c.type === "textarea" ? q((l(), d("textarea", {
2832
+ }, null, 8, _r)), [
2833
+ [G, r.values[d.key]]
2834
+ ]) : d.type === "textarea" ? V((l(), c("textarea", {
2812
2835
  key: 1,
2813
- id: `wm-f-${r._uid}-${c.key}`,
2814
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2836
+ id: `wm-f-${r._uid}-${d.key}`,
2837
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2815
2838
  class: "wm-form__textarea",
2816
2839
  rows: "3",
2817
- placeholder: c.placeholder || "",
2818
- required: c.required,
2840
+ placeholder: d.placeholder || "",
2841
+ required: d.required,
2819
2842
  disabled: n.readOnly || r.busy
2820
- }, null, 8, ur)), [
2821
- [G, r.values[c.key]]
2822
- ]) : c.type === "number" ? q((l(), d("input", {
2843
+ }, null, 8, pr)), [
2844
+ [G, r.values[d.key]]
2845
+ ]) : d.type === "number" ? V((l(), c("input", {
2823
2846
  key: 2,
2824
- id: `wm-f-${r._uid}-${c.key}`,
2825
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2847
+ id: `wm-f-${r._uid}-${d.key}`,
2848
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2826
2849
  type: "number",
2827
2850
  class: "wm-form__input",
2828
- placeholder: c.placeholder || "",
2829
- required: c.required,
2851
+ placeholder: d.placeholder || "",
2852
+ required: d.required,
2830
2853
  disabled: n.readOnly || r.busy
2831
- }, null, 8, hr)), [
2854
+ }, null, 8, vr)), [
2832
2855
  [
2833
2856
  G,
2834
- r.values[c.key],
2857
+ r.values[d.key],
2835
2858
  void 0,
2836
2859
  { number: !0 }
2837
2860
  ]
2838
- ]) : c.type === "date" ? q((l(), d("input", {
2861
+ ]) : d.type === "date" ? V((l(), c("input", {
2839
2862
  key: 3,
2840
- id: `wm-f-${r._uid}-${c.key}`,
2841
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2863
+ id: `wm-f-${r._uid}-${d.key}`,
2864
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2842
2865
  type: "date",
2843
2866
  class: "wm-form__input",
2844
- required: c.required,
2867
+ required: d.required,
2845
2868
  disabled: n.readOnly || r.busy
2846
- }, null, 8, mr)), [
2847
- [G, r.values[c.key]]
2848
- ]) : c.type === "boolean" ? (l(), d("label", fr, [
2849
- q(i("input", {
2850
- id: `wm-f-${r._uid}-${c.key}`,
2851
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2869
+ }, null, 8, yr)), [
2870
+ [G, r.values[d.key]]
2871
+ ]) : d.type === "boolean" ? (l(), c("label", gr, [
2872
+ V(i("input", {
2873
+ id: `wm-f-${r._uid}-${d.key}`,
2874
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2852
2875
  type: "checkbox",
2853
2876
  disabled: n.readOnly || r.busy
2854
- }, null, 8, _r), [
2855
- [Ie, r.values[c.key]]
2877
+ }, null, 8, wr), [
2878
+ [Ee, r.values[d.key]]
2856
2879
  ]),
2857
- i("span", null, y(c.placeholder || "Oui"), 1)
2858
- ])) : c.type === "select" ? q((l(), d("select", {
2880
+ i("span", null, b(d.placeholder || "Oui"), 1)
2881
+ ])) : d.type === "select" ? V((l(), c("select", {
2859
2882
  key: 5,
2860
- id: `wm-f-${r._uid}-${c.key}`,
2861
- "onUpdate:modelValue": (p) => r.values[c.key] = p,
2883
+ id: `wm-f-${r._uid}-${d.key}`,
2884
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
2862
2885
  class: "wm-form__select",
2863
- required: c.required,
2886
+ required: d.required,
2864
2887
  disabled: n.readOnly || r.busy
2865
2888
  }, [
2866
- i("option", vr, y(c.placeholder || "Choisir…"), 1),
2867
- (l(!0), d(E, null, F(c.options, (p) => (l(), d("option", {
2868
- key: p.value,
2869
- value: p.value
2870
- }, y(p.label), 9, gr))), 128))
2871
- ], 8, pr)), [
2872
- [Oe, r.values[c.key]]
2873
- ]) : c.type === "multiselect" ? (l(), d("div", yr, [
2874
- (l(!0), d(E, null, F(c.options, (p) => (l(), d("label", {
2875
- key: p.value,
2889
+ i("option", kr, b(d.placeholder || "Choisir…"), 1),
2890
+ (l(!0), c(O, null, F(d.options, (v) => (l(), c("option", {
2891
+ key: v.value,
2892
+ value: v.value
2893
+ }, b(v.label), 9, Cr))), 128))
2894
+ ], 8, br)), [
2895
+ [Be, r.values[d.key]]
2896
+ ]) : d.type === "multiselect" ? (l(), c("div", Ar, [
2897
+ (l(!0), c(O, null, F(d.options, (v) => (l(), c("label", {
2898
+ key: v.value,
2876
2899
  class: "wm-form__multiItem"
2877
2900
  }, [
2878
2901
  i("input", {
2879
2902
  type: "checkbox",
2880
- value: p.value,
2881
- checked: Array.isArray(r.values[c.key]) && r.values[c.key].includes(p.value),
2903
+ value: v.value,
2904
+ checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
2882
2905
  disabled: n.readOnly || r.busy,
2883
- onChange: (k) => s.toggleMulti(c.key, p.value, k.target.checked)
2884
- }, null, 40, wr),
2885
- i("span", null, y(p.label), 1)
2906
+ onChange: (C) => s.toggleMulti(d.key, v.value, C.target.checked)
2907
+ }, null, 40, Sr),
2908
+ i("span", null, b(v.label), 1)
2886
2909
  ]))), 128))
2887
- ])) : v("", !0)
2910
+ ])) : g("", !0)
2888
2911
  ]))), 128)),
2889
- r.error ? (l(), d("div", br, y(r.error), 1)) : v("", !0),
2890
- n.readOnly ? (l(), d("div", Ar, "Réponse envoyée")) : (l(), d("button", {
2912
+ r.error ? (l(), c("div", xr, b(r.error), 1)) : g("", !0),
2913
+ n.readOnly ? (l(), c("div", Ir, "Réponse envoyée")) : (l(), c("button", {
2891
2914
  key: 1,
2892
2915
  type: "submit",
2893
2916
  class: "wm-form__submit",
2894
2917
  disabled: r.busy
2895
2918
  }, [
2896
- r.busy ? (l(), d("span", Cr)) : v("", !0),
2897
- i("span", null, y(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
2898
- ], 8, kr))
2919
+ r.busy ? (l(), c("span", Tr)) : g("", !0),
2920
+ i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
2921
+ ], 8, Mr))
2899
2922
  ], 32)
2900
2923
  ]);
2901
2924
  }
2902
- const xr = /* @__PURE__ */ L(tr, [["render", Sr], ["__scopeId", "data-v-64b40f76"]]), Mr = {
2925
+ const Er = /* @__PURE__ */ B(ar, [["render", Or], ["__scopeId", "data-v-64b40f76"]]), Br = {
2903
2926
  name: "WmFeedback",
2904
2927
  props: {
2905
2928
  busy: { type: Boolean, default: !1 },
@@ -2923,43 +2946,43 @@ const xr = /* @__PURE__ */ L(tr, [["render", Sr], ["__scopeId", "data-v-64b40f76
2923
2946
  !this.sel || this.busy || this.$emit("submit", { rating: this.sel });
2924
2947
  }
2925
2948
  }
2926
- }, Tr = { class: "wm-fb" }, Ir = { class: "wm-fb__row" }, Or = ["onClick"], Er = { class: "wm-fb__emoji" }, Br = { class: "wm-fb__label" }, Lr = ["disabled"], Rr = {
2949
+ }, Lr = { class: "wm-fb" }, Rr = { class: "wm-fb__row" }, $r = ["onClick"], Fr = { class: "wm-fb__emoji" }, jr = { class: "wm-fb__label" }, Ur = ["disabled"], Dr = {
2927
2950
  key: 1,
2928
2951
  class: "wm-fb__done"
2929
2952
  };
2930
- function $r(t, e, n, a, r, s) {
2931
- return l(), d("div", Tr, [
2932
- n.done ? (l(), d("div", Rr, [...e[3] || (e[3] = [
2933
- de('<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)
2934
- ])])) : (l(), d(E, { key: 0 }, [
2953
+ function Nr(t, e, n, a, r, s) {
2954
+ return l(), c("div", Lr, [
2955
+ n.done ? (l(), c("div", Dr, [...e[3] || (e[3] = [
2956
+ 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)
2957
+ ])])) : (l(), c(O, { key: 0 }, [
2935
2958
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
2936
2959
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
2937
- i("div", Ir, [
2938
- (l(!0), d(E, null, F(r.options, (o) => (l(), d("button", {
2960
+ i("div", Rr, [
2961
+ (l(!0), c(O, null, F(r.options, (o) => (l(), c("button", {
2939
2962
  key: o.v,
2940
2963
  type: "button",
2941
- class: B(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
2942
- onClick: (c) => r.sel = o.v
2964
+ class: E(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
2965
+ onClick: (d) => r.sel = o.v
2943
2966
  }, [
2944
- i("span", Er, y(o.e), 1),
2945
- i("span", Br, y(o.l), 1)
2946
- ], 10, Or))), 128))
2967
+ i("span", Fr, b(o.e), 1),
2968
+ i("span", jr, b(o.l), 1)
2969
+ ], 10, $r))), 128))
2947
2970
  ]),
2948
2971
  i("button", {
2949
2972
  type: "button",
2950
2973
  class: "wm-fb__send",
2951
2974
  disabled: !r.sel || n.busy,
2952
2975
  onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
2953
- }, y(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Lr)
2976
+ }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Ur)
2954
2977
  ], 64))
2955
2978
  ]);
2956
2979
  }
2957
- const Fr = /* @__PURE__ */ L(Mr, [["render", $r], ["__scopeId", "data-v-6f45ff3b"]]);
2958
- function Ur(t) {
2980
+ const Pr = /* @__PURE__ */ B(Br, [["render", Nr], ["__scopeId", "data-v-6f45ff3b"]]);
2981
+ function Hr(t) {
2959
2982
  const e = new Date(t);
2960
2983
  return e.setHours(0, 0, 0, 0), e;
2961
2984
  }
2962
- const Dr = {
2985
+ const zr = {
2963
2986
  name: "WmHistoryDrawer",
2964
2987
  props: {
2965
2988
  conversations: { type: Array, default: () => [] },
@@ -2993,7 +3016,7 @@ const Dr = {
2993
3016
  ) : this.normalized;
2994
3017
  },
2995
3018
  groups() {
2996
- const e = Ur(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3019
+ const e = Hr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
2997
3020
  for (const o of this.filtered) {
2998
3021
  if (!o.stamp) {
2999
3022
  s.push(o);
@@ -3011,29 +3034,29 @@ const Dr = {
3011
3034
  return this.filtered.length > 0;
3012
3035
  }
3013
3036
  }
3014
- }, jr = { class: "wm-hd" }, Nr = {
3037
+ }, Vr = { class: "wm-hd" }, qr = {
3015
3038
  class: "wm-hd__panel",
3016
3039
  role: "dialog",
3017
3040
  "aria-label": "Vos discussions"
3018
- }, Pr = { class: "wm-hd__head" }, Hr = { class: "wm-hd__top" }, zr = { class: "wm-hd__search" }, Vr = { class: "wm-hd__list" }, qr = {
3041
+ }, Wr = { class: "wm-hd__head" }, Gr = { class: "wm-hd__top" }, Kr = { class: "wm-hd__search" }, Yr = { class: "wm-hd__list" }, Jr = {
3019
3042
  key: 0,
3020
3043
  class: "wm-hd__group"
3021
- }, Wr = { class: "wm-hd__groupLabel" }, Gr = { class: "wm-hd__rows" }, Kr = ["onClick"], Yr = { class: "wm-hd__rowIcon" }, Jr = {
3044
+ }, Xr = { class: "wm-hd__groupLabel" }, Qr = { class: "wm-hd__rows" }, Zr = ["onClick"], ei = { class: "wm-hd__rowIcon" }, ti = {
3022
3045
  key: 0,
3023
3046
  class: "wm-hd__rowDot",
3024
3047
  "aria-label": "Message non lu"
3025
- }, Xr = { class: "wm-hd__rowBody" }, Qr = { class: "wm-hd__rowTop" }, Zr = { class: "wm-hd__rowTitle" }, ei = { class: "wm-hd__rowPreview" }, ti = {
3048
+ }, ni = { class: "wm-hd__rowBody" }, si = { class: "wm-hd__rowTop" }, ri = { class: "wm-hd__rowTitle" }, ii = { class: "wm-hd__rowPreview" }, ai = {
3026
3049
  key: 0,
3027
3050
  class: "wm-hd__empty"
3028
3051
  };
3029
- function ni(t, e, n, a, r, s) {
3030
- return l(), d("div", jr, [
3052
+ function oi(t, e, n, a, r, s) {
3053
+ return l(), c("div", Vr, [
3031
3054
  i("div", {
3032
3055
  class: "wm-hd__scrim",
3033
3056
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3034
3057
  }),
3035
- i("aside", Nr, [
3036
- i("div", Pr, [
3058
+ i("aside", qr, [
3059
+ i("div", Wr, [
3037
3060
  e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
3038
3061
  i("div", { class: "wm-hd__title" }, "Vos discussions"),
3039
3062
  i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
@@ -3059,7 +3082,7 @@ function ni(t, e, n, a, r, s) {
3059
3082
  ], -1)
3060
3083
  ])])
3061
3084
  ]),
3062
- i("div", Hr, [
3085
+ i("div", Gr, [
3063
3086
  i("button", {
3064
3087
  type: "button",
3065
3088
  class: "wm-hd__new",
@@ -3082,7 +3105,7 @@ function ni(t, e, n, a, r, s) {
3082
3105
  ], -1),
3083
3106
  i("span", null, "Démarrer un nouveau fil", -1)
3084
3107
  ])]),
3085
- i("div", zr, [
3108
+ i("div", Kr, [
3086
3109
  e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
3087
3110
  i("svg", {
3088
3111
  width: "12",
@@ -3098,7 +3121,7 @@ function ni(t, e, n, a, r, s) {
3098
3121
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3099
3122
  ])
3100
3123
  ], -1)),
3101
- q(i("input", {
3124
+ V(i("input", {
3102
3125
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3103
3126
  type: "text",
3104
3127
  placeholder: "Rechercher dans vos messages",
@@ -3108,23 +3131,23 @@ function ni(t, e, n, a, r, s) {
3108
3131
  ])
3109
3132
  ])
3110
3133
  ]),
3111
- i("div", Vr, [
3112
- (l(!0), d(E, null, F(s.groups, (o) => (l(), d(E, {
3134
+ i("div", Yr, [
3135
+ (l(!0), c(O, null, F(s.groups, (o) => (l(), c(O, {
3113
3136
  key: o.key
3114
3137
  }, [
3115
- o.items.length ? (l(), d("div", qr, [
3116
- i("div", Wr, y(o.label), 1),
3117
- i("div", Gr, [
3118
- (l(!0), d(E, null, F(o.items, (c) => (l(), d("button", {
3119
- key: c.id,
3138
+ o.items.length ? (l(), c("div", Jr, [
3139
+ i("div", Xr, b(o.label), 1),
3140
+ i("div", Qr, [
3141
+ (l(!0), c(O, null, F(o.items, (d) => (l(), c("button", {
3142
+ key: d.id,
3120
3143
  type: "button",
3121
- class: B(["wm-hd__row", {
3122
- "wm-hd__row--active": c.id === n.activeId,
3123
- "wm-hd__row--unread": c.unread
3144
+ class: E(["wm-hd__row", {
3145
+ "wm-hd__row--active": d.id === n.activeId,
3146
+ "wm-hd__row--unread": d.unread
3124
3147
  }]),
3125
- onClick: (p) => t.$emit("pick", c)
3148
+ onClick: (v) => t.$emit("pick", d)
3126
3149
  }, [
3127
- i("div", Yr, [
3150
+ i("div", ei, [
3128
3151
  e[8] || (e[8] = i("svg", {
3129
3152
  width: "11",
3130
3153
  height: "11",
@@ -3138,24 +3161,24 @@ function ni(t, e, n, a, r, s) {
3138
3161
  opacity: "0.92"
3139
3162
  })
3140
3163
  ], -1)),
3141
- c.unread ? (l(), d("span", Jr)) : v("", !0)
3164
+ d.unread ? (l(), c("span", ti)) : g("", !0)
3142
3165
  ]),
3143
- i("div", Xr, [
3144
- i("div", Qr, [
3145
- i("span", Zr, y(c.title), 1)
3166
+ i("div", ni, [
3167
+ i("div", si, [
3168
+ i("span", ri, b(d.title), 1)
3146
3169
  ]),
3147
- i("div", ei, y(c.preview || "Aucun message"), 1)
3170
+ i("div", ii, b(d.preview || "Aucun message"), 1)
3148
3171
  ])
3149
- ], 10, Kr))), 128))
3172
+ ], 10, Zr))), 128))
3150
3173
  ])
3151
- ])) : v("", !0)
3174
+ ])) : g("", !0)
3152
3175
  ], 64))), 128)),
3153
- s.hasAny ? v("", !0) : (l(), d("div", ti, " Aucun fil pour le moment. "))
3176
+ s.hasAny ? g("", !0) : (l(), c("div", ai, " Aucun fil pour le moment. "))
3154
3177
  ])
3155
3178
  ])
3156
3179
  ]);
3157
3180
  }
3158
- const si = /* @__PURE__ */ L(Dr, [["render", ni], ["__scopeId", "data-v-1259e822"]]), ri = {
3181
+ const li = /* @__PURE__ */ B(zr, [["render", oi], ["__scopeId", "data-v-1259e822"]]), ci = {
3159
3182
  name: "WmMoreMenu",
3160
3183
  props: {
3161
3184
  canRename: { type: Boolean, default: !0 },
@@ -3182,18 +3205,18 @@ const si = /* @__PURE__ */ L(Dr, [["render", ni], ["__scopeId", "data-v-1259e822
3182
3205
  this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
3183
3206
  }
3184
3207
  }
3185
- }, ii = { class: "wm-mm" }, ai = {
3208
+ }, di = { class: "wm-mm" }, ui = {
3186
3209
  class: "wm-mm__pop",
3187
3210
  role: "menu"
3188
- }, oi = { class: "wm-mm__section" }, li = { class: "wm-mm__section" }, di = { class: "wm-mm__section" };
3189
- function ci(t, e, n, a, r, s) {
3190
- return l(), d("div", ii, [
3211
+ }, hi = { class: "wm-mm__section" }, mi = { class: "wm-mm__section" }, fi = { class: "wm-mm__section" };
3212
+ function _i(t, e, n, a, r, s) {
3213
+ return l(), c("div", di, [
3191
3214
  i("div", {
3192
3215
  class: "wm-mm__scrim",
3193
3216
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3194
3217
  }),
3195
- i("div", ai, [
3196
- i("div", oi, [
3218
+ i("div", ui, [
3219
+ i("div", hi, [
3197
3220
  i("button", {
3198
3221
  type: "button",
3199
3222
  class: "wm-mm__item",
@@ -3216,15 +3239,15 @@ function ci(t, e, n, a, r, s) {
3216
3239
  ], -1),
3217
3240
  i("span", { class: "wm-mm__label" }, "Historique des discussions", -1)
3218
3241
  ])]),
3219
- n.canRename ? (l(), d("button", {
3242
+ n.canRename ? (l(), c("button", {
3220
3243
  key: 0,
3221
3244
  type: "button",
3222
3245
  class: "wm-mm__item",
3223
3246
  onClick: e[2] || (e[2] = (o) => s.emit("rename"))
3224
3247
  }, [...e[9] || (e[9] = [
3225
- de('<span class="wm-mm__icon" data-v-c1bb81d2><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-c1bb81d2><path d="M12 20h9" data-v-c1bb81d2></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Renommer le fil</span>', 2)
3226
- ])])) : v("", !0),
3227
- n.canClear ? (l(), d("button", {
3248
+ ue('<span class="wm-mm__icon" data-v-c1bb81d2><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-c1bb81d2><path d="M12 20h9" data-v-c1bb81d2></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Renommer le fil</span>', 2)
3249
+ ])])) : g("", !0),
3250
+ n.canClear ? (l(), c("button", {
3228
3251
  key: 1,
3229
3252
  type: "button",
3230
3253
  class: "wm-mm__item",
@@ -3246,18 +3269,18 @@ function ci(t, e, n, a, r, s) {
3246
3269
  ])
3247
3270
  ], -1),
3248
3271
  i("span", { class: "wm-mm__label" }, "Effacer ce fil", -1)
3249
- ])])) : v("", !0),
3250
- n.canExport ? (l(), d("button", {
3272
+ ])])) : g("", !0),
3273
+ n.canExport ? (l(), c("button", {
3251
3274
  key: 2,
3252
3275
  type: "button",
3253
3276
  class: "wm-mm__item",
3254
3277
  onClick: e[4] || (e[4] = (o) => s.emit("export"))
3255
3278
  }, [...e[11] || (e[11] = [
3256
- de('<span class="wm-mm__icon" data-v-c1bb81d2><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-c1bb81d2><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Exporter la transcription</span><span class="wm-mm__hint" data-v-c1bb81d2>.txt</span>', 3)
3257
- ])])) : v("", !0)
3279
+ ue('<span class="wm-mm__icon" data-v-c1bb81d2><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-c1bb81d2><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Exporter la transcription</span><span class="wm-mm__hint" data-v-c1bb81d2>.txt</span>', 3)
3280
+ ])])) : g("", !0)
3258
3281
  ]),
3259
3282
  e[17] || (e[17] = i("div", { class: "wm-mm__sep" }, null, -1)),
3260
- i("div", li, [
3283
+ i("div", mi, [
3261
3284
  i("button", {
3262
3285
  type: "button",
3263
3286
  class: "wm-mm__item",
@@ -3280,15 +3303,15 @@ function ci(t, e, n, a, r, s) {
3280
3303
  ], -1)),
3281
3304
  e[14] || (e[14] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
3282
3305
  i("span", {
3283
- class: B(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
3306
+ class: E(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
3284
3307
  }, [...e[12] || (e[12] = [
3285
3308
  i("span", { class: "wm-mm__knob" }, null, -1)
3286
3309
  ])], 2)
3287
3310
  ])
3288
3311
  ]),
3289
3312
  e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
3290
- i("div", di, [
3291
- n.statusUrl ? (l(), d("button", {
3313
+ i("div", fi, [
3314
+ n.statusUrl ? (l(), c("button", {
3292
3315
  key: 0,
3293
3316
  type: "button",
3294
3317
  class: "wm-mm__item",
@@ -3310,8 +3333,8 @@ function ci(t, e, n, a, r, s) {
3310
3333
  ])
3311
3334
  ], -1),
3312
3335
  i("span", { class: "wm-mm__label" }, "Statut des services", -1)
3313
- ])])) : v("", !0),
3314
- n.helpUrl ? (l(), d("button", {
3336
+ ])])) : g("", !0),
3337
+ n.helpUrl ? (l(), c("button", {
3315
3338
  key: 1,
3316
3339
  type: "button",
3317
3340
  class: "wm-mm__item",
@@ -3333,18 +3356,18 @@ function ci(t, e, n, a, r, s) {
3333
3356
  ])
3334
3357
  ], -1),
3335
3358
  i("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
3336
- ])])) : v("", !0)
3359
+ ])])) : g("", !0)
3337
3360
  ])
3338
3361
  ])
3339
3362
  ]);
3340
3363
  }
3341
- const ui = /* @__PURE__ */ L(ri, [["render", ci], ["__scopeId", "data-v-c1bb81d2"]]), pe = "ww-messenger-tokens";
3342
- function le(t) {
3364
+ const pi = /* @__PURE__ */ B(ci, [["render", _i], ["__scopeId", "data-v-c1bb81d2"]]), ye = "ww-messenger-tokens";
3365
+ function de(t) {
3343
3366
  var n;
3344
3367
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
3345
3368
  return e === "agent_ia" || e === "agent_human";
3346
3369
  }
3347
- function hi(t, e) {
3370
+ function vi(t, e) {
3348
3371
  if (!t || !e) return "";
3349
3372
  const n = Array.isArray(t.fields) ? t.fields : [], a = [];
3350
3373
  for (const r of n) {
@@ -3353,7 +3376,7 @@ function hi(t, e) {
3353
3376
  if (s == null || s === "") continue;
3354
3377
  let o;
3355
3378
  if (Array.isArray(s)) {
3356
- if (o = s.map((c) => ne(r, String(c))).join(", "), !o) continue;
3379
+ if (o = s.map((d) => ne(r, String(d))).join(", "), !o) continue;
3357
3380
  } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ne(r, String(s));
3358
3381
  a.push(`${r.label} :
3359
3382
  ${o}`);
@@ -3367,7 +3390,7 @@ function ne(t, e) {
3367
3390
  const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
3368
3391
  return (n == null ? void 0 : n.label) || e;
3369
3392
  }
3370
- function mi(t, e) {
3393
+ function yi(t, e) {
3371
3394
  const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3372
3395
  for (const r of a) {
3373
3396
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3375,11 +3398,11 @@ function mi(t, e) {
3375
3398
  if (s == null || s === "") continue;
3376
3399
  let o;
3377
3400
  if (Array.isArray(s)) {
3378
- if (o = s.map((p) => ne(r, String(p))).join(", "), !o) continue;
3401
+ if (o = s.map((v) => ne(r, String(v))).join(", "), !o) continue;
3379
3402
  } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ne(r, String(s));
3380
- const c = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3403
+ const d = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3381
3404
  `));
3382
- n.push({ label: r.label, value: o, multiline: c });
3405
+ n.push({ label: r.label, value: o, multiline: d });
3383
3406
  }
3384
3407
  return {
3385
3408
  kind: "form_response",
@@ -3389,20 +3412,20 @@ function mi(t, e) {
3389
3412
  }
3390
3413
  };
3391
3414
  }
3392
- const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3415
+ const gi = 450, wi = 50, bi = 900, ki = 12e3, Ci = 300, Ai = {
3393
3416
  name: "Messenger",
3394
3417
  components: {
3395
- Launcher: We,
3396
- Header: vt,
3397
- Onboarding: jt,
3398
- MessageList: ys,
3399
- Composer: js,
3400
- SuggestionChips: zs,
3401
- ApprovalCard: Zs,
3402
- FormCard: xr,
3403
- Feedback: Fr,
3404
- HistoryDrawer: si,
3405
- MoreMenu: ui
3418
+ Launcher: Ye,
3419
+ Header: wt,
3420
+ Onboarding: Ht,
3421
+ MessageList: As,
3422
+ Composer: Vs,
3423
+ SuggestionChips: Ks,
3424
+ ApprovalCard: rr,
3425
+ FormCard: Er,
3426
+ Feedback: Pr,
3427
+ HistoryDrawer: li,
3428
+ MoreMenu: pi
3406
3429
  },
3407
3430
  // Make signAttachment available to deep children (AttachmentPreview)
3408
3431
  // without prop drilling. The store may not exist yet at provide-time
@@ -3417,10 +3440,18 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3417
3440
  };
3418
3441
  },
3419
3442
  props: {
3420
- baseUrl: { type: String, default: "" },
3443
+ // Hardcoded server default (overridable for staging/dev).
3444
+ baseUrl: { type: String, default: ze },
3421
3445
  widgetId: { type: String, default: "" },
3422
3446
  userId: { type: String, default: "" },
3423
3447
  userHash: { type: String, default: "" },
3448
+ // Flat object of consumer-supplied customer data pushed to the
3449
+ // server (PATCH /customers/me) once, on boot, so the agent has it
3450
+ // as context. `name`/`email` map to the customer's canonical
3451
+ // columns; every other key is a named variable value sent under
3452
+ // `values`. e.g. { name, email, plan: 'pro', seats: 5 }. The
3453
+ // server does a partial set (keeps variables you didn't pass).
3454
+ customer: { type: Object, default: null },
3424
3455
  // 'floating' (default) | 'sheet' | 'embedded'
3425
3456
  displayMode: { type: String, default: "floating" },
3426
3457
  // Replaces the old WeWeb `wwEditorState` editor-detection prop.
@@ -3541,8 +3572,8 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3541
3572
  var n;
3542
3573
  const t = this.readState, e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
3543
3574
  return this.allConversations.map((a) => {
3544
- const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "", c = this.lastMessageAuthorType(r), p = !!s && c !== "user" && (!o || s > o);
3545
- return { ...a, _preview: this.convPreview(a, r), _unread: p };
3575
+ const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "", d = this.lastMessageAuthorType(r), v = !!s && d !== "user" && (!o || s > o);
3576
+ return { ...a, _preview: this.convPreview(a, r), _unread: v };
3546
3577
  });
3547
3578
  },
3548
3579
  // How many threads have an unseen agent/human message. Drives the
@@ -3684,7 +3715,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3684
3715
  var s;
3685
3716
  return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending";
3686
3717
  }, a = this.revealedAt;
3687
- return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => le(r) ? a[r.id] > 0 : !0).filter(e);
3718
+ return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => de(r) ? a[r.id] > 0 : !0).filter(e);
3688
3719
  },
3689
3720
  // True whenever we should show the "typing" indicator at the bottom
3690
3721
  // of the list: either the LLM is actively streaming tokens, or one
@@ -3693,7 +3724,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3693
3724
  streamingActive() {
3694
3725
  var n, a, r;
3695
3726
  const t = this.currentConv;
3696
- return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => le(s) && !(this.revealedAt[s.id] > 0)) : !1;
3727
+ return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => de(s) && !(this.revealedAt[s.id] > 0)) : !1;
3697
3728
  },
3698
3729
  // Internal: the raw persisted list for the current conversation. We
3699
3730
  // watch this to detect new agent messages that need to be paced.
@@ -3725,14 +3756,14 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3725
3756
  return ((e = (t = this.pendingApproval) == null ? void 0 : t.payload) == null ? void 0 : e.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || "Confirmer l'action";
3726
3757
  },
3727
3758
  approvalDetail() {
3728
- var a, r, s, o, c, p;
3759
+ var a, r, s, o, d, v;
3729
3760
  const t = (s = (r = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
3730
3761
  if (typeof t == "string" && t.trim())
3731
3762
  return t.trim();
3732
- const e = (p = (c = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : c.pending) == null ? void 0 : p.prepared_params;
3763
+ const e = (v = (d = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
3733
3764
  if (!e || typeof e != "object") return "";
3734
3765
  const n = Object.entries(e);
3735
- return n.length ? n.slice(0, 2).map(([k, g]) => `${k}: ${g}`).join(" · ") : "";
3766
+ return n.length ? n.slice(0, 2).map(([C, w]) => `${C}: ${w}`).join(" · ") : "";
3736
3767
  },
3737
3768
  actionInFlight() {
3738
3769
  var t, e;
@@ -3768,13 +3799,13 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3768
3799
  const t = this.currentConv;
3769
3800
  let e = /* @__PURE__ */ new Date();
3770
3801
  if (t) {
3771
- const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((c) => c == null ? void 0 : c.created_at)) == null ? void 0 : r.created_at) || t.created_at;
3802
+ const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((d) => d == null ? void 0 : d.created_at)) == null ? void 0 : r.created_at) || t.created_at;
3772
3803
  if (o) {
3773
- const c = new Date(o);
3774
- Number.isNaN(c.getTime()) || (e = c);
3804
+ const d = new Date(o);
3805
+ Number.isNaN(d.getTime()) || (e = d);
3775
3806
  }
3776
3807
  }
3777
- return `Aujourd'hui · ${ye(e)}`;
3808
+ return `Aujourd'hui · ${be(e)}`;
3778
3809
  },
3779
3810
  // Pagination state for the active conversation. Drives the
3780
3811
  // MessageList's scroll-up history loader. Defaults are safe (no
@@ -3864,7 +3895,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3864
3895
  const e = Date.now(), n = { ...this.revealedAt };
3865
3896
  for (const r of t) {
3866
3897
  if ((r == null ? void 0 : r.id) == null || n[r.id] !== void 0) continue;
3867
- if (!le(r)) {
3898
+ if (!de(r)) {
3868
3899
  n[r.id] = e;
3869
3900
  continue;
3870
3901
  }
@@ -3873,8 +3904,8 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3873
3904
  n[r.id] = e;
3874
3905
  continue;
3875
3906
  }
3876
- const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, c = Array.isArray((a = r == null ? void 0 : r.payload) == null ? void 0 : a.attachments) && r.payload.attachments.length > 0;
3877
- if (!o && !c) {
3907
+ const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, d = Array.isArray((a = r == null ? void 0 : r.payload) == null ? void 0 : a.attachments) && r.payload.attachments.length > 0;
3908
+ if (!o && !d) {
3878
3909
  n[r.id] = e;
3879
3910
  continue;
3880
3911
  }
@@ -3891,9 +3922,9 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3891
3922
  hasWidgetId: !!this.widgetId,
3892
3923
  hasUserId: !!this.userId,
3893
3924
  hasUserHash: !!this.userHash
3894
- }), typeof document < "u" && !document.getElementById(pe)) {
3925
+ }), typeof document < "u" && !document.getElementById(ye)) {
3895
3926
  const t = document.createElement("style");
3896
- t.id = pe, t.textContent = Ne, document.head.appendChild(t);
3927
+ t.id = ye, t.textContent = He, document.head.appendChild(t);
3897
3928
  }
3898
3929
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
3899
3930
  },
@@ -3959,11 +3990,11 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
3959
3990
  for (let s = e.length - 1; s >= 0; s--) {
3960
3991
  const o = e[s];
3961
3992
  if (!o) continue;
3962
- const c = typeof o.text_md == "string" ? o.text_md.trim() : "";
3963
- if (c)
3964
- return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + c.replace(/\s+/g, " ");
3965
- const p = (a = o.payload) == null ? void 0 : a.attachments;
3966
- if (Array.isArray(p) && p.length) return "📎 Pièce jointe";
3993
+ const d = typeof o.text_md == "string" ? o.text_md.trim() : "";
3994
+ if (d)
3995
+ return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
3996
+ const v = (a = o.payload) == null ? void 0 : a.attachments;
3997
+ if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
3967
3998
  }
3968
3999
  return (t == null ? void 0 : t.last_message_preview) || (t == null ? void 0 : t.preview) || ((r = t == null ? void 0 : t.metadata) == null ? void 0 : r.last_preview) || "";
3969
4000
  },
@@ -4044,21 +4075,21 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4044
4075
  // bounded by MIN/MAX_BETWEEN_MS.
4045
4076
  scheduleReveal(t) {
4046
4077
  const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
4047
- vi,
4048
- Math.max(pi, n * _i)
4078
+ ki,
4079
+ Math.max(bi, n * wi)
4049
4080
  ), s = Math.max(
4050
- e + fi,
4051
- this.nextRevealAt + gi
4081
+ e + gi,
4082
+ this.nextRevealAt + Ci
4052
4083
  ) + a;
4053
4084
  this.nextRevealAt = s;
4054
- const o = Math.max(0, s - e), c = t.id, p = setTimeout(() => {
4055
- this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((g) => g !== p);
4085
+ const o = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
4086
+ this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== v);
4056
4087
  }, o);
4057
- this.revealTimers.push(p);
4058
- const k = setTimeout(() => {
4059
- this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((g) => g !== k);
4088
+ this.revealTimers.push(v);
4089
+ const C = setTimeout(() => {
4090
+ this.revealedAt[d] > 0 || (this.revealedAt = { ...this.revealedAt, [d]: Date.now() }), this.revealTimers = this.revealTimers.filter((w) => w !== C);
4060
4091
  }, o + 4e3);
4061
- this.revealTimers.push(k);
4092
+ this.revealTimers.push(C);
4062
4093
  },
4063
4094
  async boot() {
4064
4095
  if (!this.canBoot) {
@@ -4075,12 +4106,12 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4075
4106
  baseUrl: this.baseUrl,
4076
4107
  widgetId: this.widgetId,
4077
4108
  userId: this.userId
4078
- }), this.transport = he($e({
4109
+ }), this.transport = fe(je({
4079
4110
  baseUrl: this.baseUrl,
4080
4111
  widgetId: this.widgetId,
4081
4112
  userId: this.userId,
4082
4113
  userHash: this.userHash
4083
- })), this.store = he(je(this.transport)), await this.store.start(), console.log("[ww-messenger] boot done", {
4114
+ })), this.store = fe(Pe(this.transport)), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4084
4115
  ready: this.store.state.ready,
4085
4116
  error: this.store.state.error
4086
4117
  });
@@ -4211,7 +4242,7 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4211
4242
  !t || !this.store || !(!(typeof window < "u" && typeof window.confirm == "function") || window.confirm("Effacer ce fil de votre côté ? Cette action ne supprime pas les messages côté agent.")) || ((n = this.s) != null && n.messagesByConv && (this.s.messagesByConv[t.id] = []), this.activeConvId = null, this.showOnboarding = !0);
4212
4243
  },
4213
4244
  exportCurrentConv() {
4214
- var r, s, o, c, p, k;
4245
+ var r, s, o, d, v, C;
4215
4246
  const t = this.currentConv;
4216
4247
  if (!t) return;
4217
4248
  const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
@@ -4219,18 +4250,18 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4219
4250
  t.created_at ? `Créée le : ${t.created_at}` : "",
4220
4251
  ""
4221
4252
  ];
4222
- for (const g of e) {
4223
- if (!g) continue;
4224
- const T = ((o = g.author) == null ? void 0 : o.name) || (((c = g.author) == null ? void 0 : c.type) === "user" ? "Vous" : ((p = g.author) == null ? void 0 : p.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") : "", x = (g.text_md || "").trim();
4225
- x && (n.push(`[${R}] ${T} :`), n.push(x), n.push(""));
4253
+ for (const w of e) {
4254
+ if (!w) continue;
4255
+ const S = ((o = w.author) == null ? void 0 : o.name) || (((d = w.author) == null ? void 0 : d.type) === "user" ? "Vous" : ((v = w.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((C = w.author) == null ? void 0 : C.type) === "agent_ia" ? "Assistant IA" : "Système"), L = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
4256
+ A && (n.push(`[${L}] ${S} :`), n.push(A), n.push(""));
4226
4257
  }
4227
4258
  const a = new Blob([n.join(`
4228
4259
  `)], { type: "text/plain;charset=utf-8" });
4229
4260
  try {
4230
- const g = URL.createObjectURL(a), T = document.createElement("a");
4231
- T.href = g, T.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(T), T.click(), document.body.removeChild(T), setTimeout(() => URL.revokeObjectURL(g), 1e3);
4232
- } catch (g) {
4233
- console.error("[ww-messenger] export failed", g);
4261
+ const w = URL.createObjectURL(a), S = document.createElement("a");
4262
+ S.href = w, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(w), 1e3);
4263
+ } catch (w) {
4264
+ console.error("[ww-messenger] export failed", w);
4234
4265
  }
4235
4266
  },
4236
4267
  async onSend(t) {
@@ -4256,12 +4287,12 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4256
4287
  async onFormSubmit({ values: t }) {
4257
4288
  const e = this.pendingForm;
4258
4289
  if (!(e != null && e.form)) return;
4259
- const n = hi(e.form, t);
4290
+ const n = vi(e.form, t);
4260
4291
  if (!n) return;
4261
4292
  const a = this.currentConv;
4262
4293
  a && await this.store.send(a.id, n, {
4263
4294
  metadata: {
4264
- artifact: mi(e.form, t)
4295
+ artifact: yi(e.form, t)
4265
4296
  }
4266
4297
  });
4267
4298
  },
@@ -4305,53 +4336,53 @@ const fi = 450, _i = 50, pi = 900, vi = 12e3, gi = 300, yi = {
4305
4336
  }
4306
4337
  }
4307
4338
  }
4308
- }, wi = {
4339
+ }, Si = {
4309
4340
  key: 0,
4310
4341
  class: "wm-loading",
4311
4342
  "aria-busy": "true",
4312
4343
  "aria-live": "polite"
4313
- }, bi = {
4344
+ }, xi = {
4314
4345
  key: 0,
4315
4346
  class: "wm-state"
4316
- }, ki = { class: "wm-state__err" }, Ci = { class: "wm-state__errSub" }, Ai = { class: "wm-bottom" }, Si = {
4347
+ }, Mi = { class: "wm-state__err" }, Ti = { class: "wm-state__errSub" }, Ii = { class: "wm-bottom" }, Oi = {
4317
4348
  key: 0,
4318
4349
  ref: "floatEl",
4319
4350
  class: "wm-float"
4320
- }, xi = {
4351
+ }, Ei = {
4321
4352
  key: 1,
4322
4353
  class: "wm-actionWait",
4323
4354
  role: "status",
4324
4355
  "aria-live": "polite"
4325
- }, Mi = { class: "wm-actionWait__lbl" }, Ti = {
4356
+ }, Bi = { class: "wm-actionWait__lbl" }, Li = {
4326
4357
  key: 1,
4327
4358
  class: "wm-attached"
4328
- }, Ii = ["onClick"];
4329
- function Oi(t, e, n, a, r, s) {
4330
- const o = O("Launcher"), c = O("Header"), p = O("Onboarding"), k = O("MessageList"), g = O("ApprovalCard"), T = O("FormCard"), R = O("Feedback"), x = O("SuggestionChips"), N = O("Composer"), I = O("MoreMenu"), P = O("HistoryDrawer");
4331
- return l(), d("div", {
4332
- class: B(["wm-root", `wm-root--${n.displayMode}`])
4359
+ }, Ri = ["onClick"];
4360
+ function $i(t, e, n, a, r, s) {
4361
+ const o = I("Launcher"), d = I("Header"), v = I("Onboarding"), C = I("MessageList"), w = I("ApprovalCard"), S = I("FormCard"), L = I("Feedback"), A = I("SuggestionChips"), D = I("Composer"), x = I("MoreMenu"), N = I("HistoryDrawer");
4362
+ return l(), c("div", {
4363
+ class: E(["wm-root", `wm-root--${n.displayMode}`])
4333
4364
  }, [
4334
4365
  !r.isOpen && !s.isEmbedded ? (l(), $(o, {
4335
4366
  key: 0,
4336
4367
  "unread-count": s.unreadCount,
4337
4368
  peek: s.launcherPeek,
4338
4369
  onOpen: s.openFromPeek,
4339
- onDismiss: e[0] || (e[0] = (U) => r.labelDismissed = !0)
4340
- }, null, 8, ["unread-count", "peek", "onOpen"])) : v("", !0),
4341
- r.isOpen || s.isEmbedded ? (l(), d("section", {
4370
+ onDismiss: e[0] || (e[0] = (j) => r.labelDismissed = !0)
4371
+ }, null, 8, ["unread-count", "peek", "onOpen"])) : g("", !0),
4372
+ r.isOpen || s.isEmbedded ? (l(), c("section", {
4342
4373
  key: 1,
4343
- class: B(["wm-panel", `wm-panel--${n.displayMode}`]),
4344
- style: H(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4374
+ class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
4375
+ style: P(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4345
4376
  role: "dialog",
4346
4377
  "aria-label": "Messenger"
4347
4378
  }, [
4348
- !s.ready && !s.error ? (l(), d("div", wi, [
4349
- s.isEmbedded ? v("", !0) : (l(), d("button", {
4379
+ !s.ready && !s.error ? (l(), c("div", Si, [
4380
+ s.isEmbedded ? g("", !0) : (l(), c("button", {
4350
4381
  key: 0,
4351
4382
  type: "button",
4352
4383
  class: "wm-loading__close",
4353
4384
  "aria-label": "Réduire",
4354
- onClick: e[1] || (e[1] = (...U) => s.close && s.close(...U))
4385
+ onClick: e[1] || (e[1] = (...j) => s.close && s.close(...j))
4355
4386
  }, [...e[6] || (e[6] = [
4356
4387
  i("svg", {
4357
4388
  width: "13",
@@ -4371,8 +4402,8 @@ function Oi(t, e, n, a, r, s) {
4371
4402
  class: "wm-loading__spinner",
4372
4403
  "aria-hidden": "true"
4373
4404
  }, null, -1))
4374
- ])) : (l(), d(E, { key: 1 }, [
4375
- z(c, {
4405
+ ])) : (l(), c(O, { key: 1 }, [
4406
+ H(d, {
4376
4407
  title: s.headerTitle,
4377
4408
  escalated: s.isEscalated,
4378
4409
  "agent-name": s.humanAgentName,
@@ -4387,8 +4418,8 @@ function Oi(t, e, n, a, r, s) {
4387
4418
  onMore: s.toggleMore,
4388
4419
  onClose: s.close
4389
4420
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4390
- s.error ? (l(), d("div", bi, [
4391
- i("div", ki, [
4421
+ s.error ? (l(), c("div", xi, [
4422
+ i("div", Mi, [
4392
4423
  e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
4393
4424
  i("svg", {
4394
4425
  width: "14",
@@ -4406,11 +4437,11 @@ function Oi(t, e, n, a, r, s) {
4406
4437
  ], -1)),
4407
4438
  i("div", null, [
4408
4439
  e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4409
- i("div", Ci, y(s.error), 1)
4440
+ i("div", Ti, b(s.error), 1)
4410
4441
  ])
4411
4442
  ])
4412
- ])) : s.currentConv ? (l(), d(E, { key: 2 }, [
4413
- z(k, {
4443
+ ])) : s.currentConv ? (l(), c(O, { key: 2 }, [
4444
+ H(C, {
4414
4445
  ref: "messageList",
4415
4446
  messages: s.displayedMessages,
4416
4447
  "streaming-active": s.streamingActive,
@@ -4420,40 +4451,40 @@ function Oi(t, e, n, a, r, s) {
4420
4451
  "has-more": s.paginationState.hasMore,
4421
4452
  onLoadMore: s.onLoadMore
4422
4453
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "onLoadMore"]),
4423
- i("div", Ai, [
4424
- s.floatVisible ? (l(), d("div", Si, [
4425
- s.approvalReady ? (l(), $(g, {
4454
+ i("div", Ii, [
4455
+ s.floatVisible ? (l(), c("div", Oi, [
4456
+ s.approvalReady ? (l(), $(w, {
4426
4457
  key: 0,
4427
4458
  action: s.approvalTitle,
4428
4459
  detail: s.approvalDetail,
4429
4460
  callbacks: s.pendingApproval.callbacks,
4430
4461
  onCallback: s.onApprovalCallback
4431
- }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(T, {
4462
+ }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(S, {
4432
4463
  key: s.pendingForm.message && s.pendingForm.message.id,
4433
4464
  form: s.pendingForm.form,
4434
4465
  onSubmit: s.onFormSubmit
4435
- }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(R, {
4466
+ }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(L, {
4436
4467
  key: 2,
4437
4468
  busy: r.feedbackBusy,
4438
4469
  done: r.feedbackDone,
4439
4470
  onSubmit: s.onFeedback
4440
- }, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(x, {
4471
+ }, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(A, {
4441
4472
  key: 3,
4442
4473
  items: s.suggestions,
4443
4474
  onSelect: s.onSuggestion
4444
4475
  }, null, 8, ["items", "onSelect"]))
4445
- ], 512)) : v("", !0),
4446
- s.actionInFlight ? (l(), d("div", xi, [
4476
+ ], 512)) : g("", !0),
4477
+ s.actionInFlight ? (l(), c("div", Ei, [
4447
4478
  e[10] || (e[10] = i("span", {
4448
4479
  class: "wm-actionWait__spinner",
4449
4480
  "aria-hidden": "true"
4450
4481
  }, null, -1)),
4451
- i("span", Mi, y(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4452
- ])) : (l(), $(N, {
4482
+ i("span", Bi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4483
+ ])) : (l(), $(D, {
4453
4484
  key: 2,
4454
4485
  ref: "composer",
4455
4486
  modelValue: r.draft,
4456
- "onUpdate:modelValue": e[2] || (e[2] = (U) => r.draft = U),
4487
+ "onUpdate:modelValue": e[2] || (e[2] = (j) => r.draft = j),
4457
4488
  placeholder: s.composerPlaceholder,
4458
4489
  disabled: !!s.pendingApproval,
4459
4490
  "attach-label": "Joindre un fichier",
@@ -4461,7 +4492,7 @@ function Oi(t, e, n, a, r, s) {
4461
4492
  onAttach: s.onAttach
4462
4493
  }, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
4463
4494
  ]),
4464
- r.moreOpen ? (l(), $(I, {
4495
+ r.moreOpen ? (l(), $(x, {
4465
4496
  key: 0,
4466
4497
  "can-rename": !!s.currentConv,
4467
4498
  "can-clear": !!s.currentConv,
@@ -4469,13 +4500,13 @@ function Oi(t, e, n, a, r, s) {
4469
4500
  "notif-enabled": r.notifEnabled,
4470
4501
  "status-url": s.statusUrl,
4471
4502
  "help-url": s.helpUrl,
4472
- onClose: e[3] || (e[3] = (U) => r.moreOpen = !1),
4503
+ onClose: e[3] || (e[3] = (j) => r.moreOpen = !1),
4473
4504
  onNotifToggle: s.onNotifToggle,
4474
4505
  onAction: s.onMoreAction
4475
- }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : v("", !0),
4476
- r.pendingAttachments.length ? (l(), d("div", Ti, [
4477
- (l(!0), d(E, null, F(r.pendingAttachments, (U, V) => (l(), d("div", {
4478
- key: V,
4506
+ }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0),
4507
+ r.pendingAttachments.length ? (l(), c("div", Li, [
4508
+ (l(!0), c(O, null, F(r.pendingAttachments, (j, z) => (l(), c("div", {
4509
+ key: z,
4479
4510
  class: "wm-attached__chip"
4480
4511
  }, [
4481
4512
  e[12] || (e[12] = i("svg", {
@@ -4491,11 +4522,11 @@ function Oi(t, e, n, a, r, s) {
4491
4522
  }, [
4492
4523
  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" })
4493
4524
  ], -1)),
4494
- i("span", null, y(U.name), 1),
4525
+ i("span", null, b(j.name), 1),
4495
4526
  i("button", {
4496
4527
  type: "button",
4497
4528
  "aria-label": "Retirer",
4498
- onClick: (Q) => r.pendingAttachments.splice(V, 1)
4529
+ onClick: (X) => r.pendingAttachments.splice(z, 1)
4499
4530
  }, [...e[11] || (e[11] = [
4500
4531
  i("svg", {
4501
4532
  width: "10",
@@ -4510,10 +4541,10 @@ function Oi(t, e, n, a, r, s) {
4510
4541
  }, [
4511
4542
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4512
4543
  ], -1)
4513
- ])], 8, Ii)
4544
+ ])], 8, Ri)
4514
4545
  ]))), 128))
4515
- ])) : v("", !0)
4516
- ], 64)) : (l(), $(p, {
4546
+ ])) : g("", !0)
4547
+ ], 64)) : (l(), $(v, {
4517
4548
  key: 1,
4518
4549
  "welcome-message": s.widgetWelcomeMessage,
4519
4550
  "agent-name": s.agentName,
@@ -4524,15 +4555,15 @@ function Oi(t, e, n, a, r, s) {
4524
4555
  onSelect: s.onQuickLink,
4525
4556
  onResume: s.onDrawerPick
4526
4557
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
4527
- r.historyOpen ? (l(), $(P, {
4558
+ r.historyOpen ? (l(), $(N, {
4528
4559
  key: 3,
4529
4560
  conversations: s.drawerConversations,
4530
4561
  "active-id": s.currentConv ? s.currentConv.id : null,
4531
- onClose: e[4] || (e[4] = (U) => r.historyOpen = !1),
4562
+ onClose: e[4] || (e[4] = (j) => r.historyOpen = !1),
4532
4563
  onNew: s.onDrawerNew,
4533
4564
  onPick: s.onDrawerPick
4534
- }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : v("", !0),
4535
- r.moreOpen && !s.currentConv ? (l(), $(I, {
4565
+ }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : g("", !0),
4566
+ r.moreOpen && !s.currentConv ? (l(), $(x, {
4536
4567
  key: 4,
4537
4568
  "can-rename": !1,
4538
4569
  "can-clear": !1,
@@ -4540,55 +4571,56 @@ function Oi(t, e, n, a, r, s) {
4540
4571
  "notif-enabled": r.notifEnabled,
4541
4572
  "status-url": s.statusUrl,
4542
4573
  "help-url": s.helpUrl,
4543
- onClose: e[5] || (e[5] = (U) => r.moreOpen = !1),
4574
+ onClose: e[5] || (e[5] = (j) => r.moreOpen = !1),
4544
4575
  onNotifToggle: s.onNotifToggle,
4545
4576
  onAction: s.onMoreAction
4546
- }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : v("", !0)
4577
+ }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0)
4547
4578
  ], 64))
4548
- ], 6)) : v("", !0)
4579
+ ], 6)) : g("", !0)
4549
4580
  ], 2);
4550
4581
  }
4551
- const Li = /* @__PURE__ */ L(yi, [["render", Oi], ["__scopeId", "data-v-da51a155"]]);
4582
+ const Ui = /* @__PURE__ */ B(Ai, [["render", $i], ["__scopeId", "data-v-bee7b290"]]);
4552
4583
  export {
4553
- X as AIAvatar,
4554
- ae as AVATAR_COLORS,
4555
- Fn as ActionResult,
4556
- Zs as ApprovalCard,
4557
- Yt as ArtifactFormResponse,
4558
- dn as ArtifactInfoCard,
4559
- ke as ArtifactRenderer,
4560
- Cn as ArtifactTicket,
4561
- Kn as AttachmentPreview,
4562
- Qn as Bubble,
4563
- js as Composer,
4564
- Fr as Feedback,
4565
- xr as FormCard,
4566
- vt as Header,
4567
- si as HistoryDrawer,
4568
- we as HumanAvatar,
4569
- We as Launcher,
4570
- ce as MEDIA_RECORDER_SUPPORTED,
4571
- ys as MessageList,
4572
- Li as Messenger,
4573
- ui as MoreMenu,
4574
- jt as Onboarding,
4584
+ J as AIAvatar,
4585
+ le as AVATAR_COLORS,
4586
+ Dn as ActionResult,
4587
+ rr as ApprovalCard,
4588
+ Qt as ArtifactFormResponse,
4589
+ hn as ArtifactInfoCard,
4590
+ Ae as ArtifactRenderer,
4591
+ xn as ArtifactTicket,
4592
+ Xn as AttachmentPreview,
4593
+ ts as Bubble,
4594
+ Vs as Composer,
4595
+ ze as DEFAULT_BASE_URL,
4596
+ Pr as Feedback,
4597
+ Er as FormCard,
4598
+ wt as Header,
4599
+ li as HistoryDrawer,
4600
+ ke as HumanAvatar,
4601
+ Ye as Launcher,
4602
+ he as MEDIA_RECORDER_SUPPORTED,
4603
+ As as MessageList,
4604
+ Ui as Messenger,
4605
+ pi as MoreMenu,
4606
+ Ht as Onboarding,
4575
4607
  te as SCREEN_CAPTURE_SUPPORTED,
4576
- zs as SuggestionChips,
4577
- it as TeamAvatars,
4578
- ns as Typing,
4579
- ve as avatarColor,
4580
- ge as avatarInitials,
4581
- bs as captureScreenshotFile,
4582
- j as colors,
4583
- je as createStore,
4584
- $e as createTransport,
4585
- Li as default,
4586
- ye as formatTime,
4587
- Bi as guessAttachmentKind,
4588
- ws as pickRecorderMime,
4589
- be as renderMarkdown,
4590
- Cs as startScreenRecording,
4591
- Ne as tokensCss,
4592
- De as uuid,
4593
- De as v4
4608
+ Ks as SuggestionChips,
4609
+ lt as TeamAvatars,
4610
+ is as Typing,
4611
+ ge as avatarColor,
4612
+ we as avatarInitials,
4613
+ xs as captureScreenshotFile,
4614
+ U as colors,
4615
+ Pe as createStore,
4616
+ je as createTransport,
4617
+ Ui as default,
4618
+ be as formatTime,
4619
+ ji as guessAttachmentKind,
4620
+ Ss as pickRecorderMime,
4621
+ Ce as renderMarkdown,
4622
+ Ts as startScreenRecording,
4623
+ He as tokensCss,
4624
+ Ne as uuid,
4625
+ Ne as v4
4594
4626
  };