@_solaris/messenger-widget 0.5.54 → 0.5.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/messenger.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reactive as qe, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as I, toDisplayString as v, resolveComponent as R, createVNode as V, Transition as Ne, withCtx as Ue, Fragment as L, renderList as F, withKeys as fe, withModifiers as X, createElementVNode as o, createCommentVNode as w, createBlock as P, resolveDynamicComponent as ke, mergeProps as De, withDirectives as G, vModelText as te, createTextVNode as Ce, renderSlot as $e, vModelCheckbox as Ve, vModelSelect as Ke, markRaw as xe } from "vue";
1
+ import { reactive as qe, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as I, toDisplayString as v, resolveComponent as R, createVNode as V, Transition as Ne, withCtx as Ue, Fragment as L, renderList as F, withKeys as fe, withModifiers as X, createElementVNode as o, createCommentVNode as b, createBlock as P, resolveDynamicComponent as ke, mergeProps as De, withDirectives as G, vModelText as te, createTextVNode as Ce, renderSlot as $e, vModelCheckbox as Ve, vModelSelect as Ke, markRaw as xe } from "vue";
2
2
  const We = [
3
3
  "connected",
4
4
  "message",
@@ -38,7 +38,7 @@ function Je(e) {
38
38
  function n(u, _) {
39
39
  return t.listeners.has(u) || t.listeners.set(u, /* @__PURE__ */ new Set()), t.listeners.get(u).add(_), () => t.listeners.get(u).delete(_);
40
40
  }
41
- function r(u, _) {
41
+ function i(u, _) {
42
42
  const p = t.listeners.get(u);
43
43
  p && p.forEach((S) => {
44
44
  try {
@@ -48,8 +48,8 @@ function Je(e) {
48
48
  }
49
49
  });
50
50
  }
51
- function i(u) {
52
- t.connection !== u && (t.connection = u, r("connection", u));
51
+ function a(u) {
52
+ t.connection !== u && (t.connection = u, i("connection", u));
53
53
  }
54
54
  function s() {
55
55
  return {
@@ -64,7 +64,7 @@ function Je(e) {
64
64
  ...t.origin ? { "X-Parent-Origin": t.origin } : {}
65
65
  };
66
66
  }
67
- async function a(u, _, p) {
67
+ async function r(u, _, p) {
68
68
  const S = await fetch(`${t.baseUrl}${ve}${_}`, {
69
69
  method: u,
70
70
  credentials: "include",
@@ -132,7 +132,7 @@ function Je(e) {
132
132
  }
133
133
  return $.json();
134
134
  }),
135
- a("GET", "/customers/me")
135
+ r("GET", "/customers/me")
136
136
  ]), T = { config: S, customer: (O == null ? void 0 : O.customer) ?? null };
137
137
  return t.lastBootstrap = T, await k(), typeof document < "u" && (t.visibilityHandler = m, document.addEventListener(
138
138
  "visibilitychange",
@@ -150,36 +150,36 @@ function Je(e) {
150
150
  console.error("[transport] initial /conversations failed", u);
151
151
  }
152
152
  }
153
- async function b() {
154
- const u = await a("GET", "/customers/me");
153
+ async function w() {
154
+ const u = await r("GET", "/customers/me");
155
155
  return (u == null ? void 0 : u.customer) ?? null;
156
156
  }
157
157
  async function x(u) {
158
- const _ = await a("PATCH", "/customers/me", u);
158
+ const _ = await r("PATCH", "/customers/me", u);
159
159
  return (_ == null ? void 0 : _.customer) ?? null;
160
160
  }
161
161
  async function E() {
162
- const u = await a("GET", "/conversations");
162
+ const u = await r("GET", "/conversations");
163
163
  return (u == null ? void 0 : u.conversations) ?? [];
164
164
  }
165
165
  async function A(u = {}) {
166
- return (await a("POST", "/conversations", u)).conversation;
166
+ return (await r("POST", "/conversations", u)).conversation;
167
167
  }
168
168
  async function q(u) {
169
- return (await a(
169
+ return (await r(
170
170
  "GET",
171
171
  `/conversations/${encodeURIComponent(u)}`
172
172
  )).conversation;
173
173
  }
174
174
  async function M(u, _) {
175
- return (await a(
175
+ return (await r(
176
176
  "PATCH",
177
177
  `/conversations/${encodeURIComponent(u)}`,
178
178
  _
179
179
  )).conversation;
180
180
  }
181
181
  async function U(u, _) {
182
- return a(
182
+ return r(
183
183
  "PATCH",
184
184
  `/conversations/${encodeURIComponent(u)}/read`,
185
185
  { message_id: _ }
@@ -189,7 +189,7 @@ function Je(e) {
189
189
  const p = new URLSearchParams();
190
190
  _.before && p.set("before", _.before), _.since && p.set("since", _.since), _.limit && p.set("limit", String(_.limit));
191
191
  const S = p.toString() ? `?${p.toString()}` : "";
192
- return a(
192
+ return r(
193
193
  "GET",
194
194
  `/conversations/${encodeURIComponent(u)}/messages${S}`
195
195
  );
@@ -203,21 +203,21 @@ function Je(e) {
203
203
  author: { id: t.userId, type: "user" },
204
204
  created_at: _.created_at || (/* @__PURE__ */ new Date()).toISOString()
205
205
  };
206
- return Array.isArray(_.attachments) && _.attachments.length && (p.payload = { type: "content", attachments: _.attachments }), _.metadata && typeof _.metadata == "object" && (p.metadata = _.metadata), t.currentContext && Object.keys(t.currentContext).length > 0 && (p.context = t.currentContext), a(
206
+ return Array.isArray(_.attachments) && _.attachments.length && (p.payload = { type: "content", attachments: _.attachments }), _.metadata && typeof _.metadata == "object" && (p.metadata = _.metadata), t.currentContext && Object.keys(t.currentContext).length > 0 && (p.context = t.currentContext), r(
207
207
  "POST",
208
208
  `/conversations/${encodeURIComponent(u)}/messages`,
209
209
  p
210
210
  );
211
211
  }
212
212
  async function K(u, _, p) {
213
- return ae(), a(
213
+ return ae(), r(
214
214
  "POST",
215
215
  `/messages/${encodeURIComponent(u)}/callbacks/${encodeURIComponent(_)}`,
216
216
  p ? { inputs: p } : {}
217
217
  );
218
218
  }
219
219
  async function Q(u) {
220
- const _ = u.name || "attachment", p = u.type || "application/octet-stream", S = u.size || 0, O = await a("POST", "/attachments", {
220
+ const _ = u.name || "attachment", p = u.type || "application/octet-stream", S = u.size || 0, O = await r("POST", "/attachments", {
221
221
  mime_type: p,
222
222
  size_bytes: S,
223
223
  name: _
@@ -236,7 +236,7 @@ function Je(e) {
236
236
  };
237
237
  }
238
238
  async function se(u) {
239
- return a(
239
+ return r(
240
240
  "GET",
241
241
  `/attachments/sign?path=${encodeURIComponent(u)}`
242
242
  );
@@ -253,22 +253,22 @@ function Je(e) {
253
253
  u.addEventListener(_, (p) => ie(_, p.data));
254
254
  u.addEventListener(
255
255
  "error",
256
- () => r("error", new Error("SSE error"))
257
- ), t.eventSource = u, i("open");
256
+ () => i("error", new Error("SSE error"))
257
+ ), t.eventSource = u, a("open");
258
258
  } catch (u) {
259
- console.error("[transport] SSE open failed", u), r("error", u);
259
+ console.error("[transport] SSE open failed", u), i("error", u);
260
260
  }
261
261
  }
262
262
  function ie(u, _) {
263
263
  try {
264
264
  const p = JSON.parse(_), S = p && typeof p == "object" && "data" in p ? p.data : p;
265
- r(u, S);
265
+ i(u, S);
266
266
  } catch (p) {
267
267
  console.error("[transport] bad SSE payload", u, p);
268
268
  }
269
269
  }
270
270
  function J() {
271
- t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" && i("idle");
271
+ t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" && a("idle");
272
272
  }
273
273
  function ae() {
274
274
  clearTimeout(t.burstTimer), W(), t.panelOpen || (t.burstTimer = setTimeout(() => {
@@ -284,7 +284,7 @@ function Je(e) {
284
284
  const T = O == null ? void 0 : O.last_message_at;
285
285
  return T && (!S || T > S) ? T : S;
286
286
  }, null);
287
- _ && (!t.lastActivityAt || _ > t.lastActivityAt) && (t.lastActivityAt = _, r("activity", { conversations: u, latestAt: _ }), ae());
287
+ _ && (!t.lastActivityAt || _ > t.lastActivityAt) && (t.lastActivityAt = _, i("activity", { conversations: u, latestAt: _ }), ae());
288
288
  } catch (u) {
289
289
  console.error("[transport] poll failed", u);
290
290
  }
@@ -298,14 +298,14 @@ function Je(e) {
298
298
  function m() {
299
299
  if (document.hidden)
300
300
  clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = setTimeout(() => {
301
- t.hiddenGraceTimer = null, document.hidden && (h(), J(), i("paused"));
301
+ t.hiddenGraceTimer = null, document.hidden && (h(), J(), a("paused"));
302
302
  }, Xe);
303
303
  else {
304
304
  if (t.hiddenGraceTimer) {
305
305
  clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null;
306
306
  return;
307
307
  }
308
- i("idle"), he(), t.panelOpen && W();
308
+ a("idle"), he(), t.panelOpen && W();
309
309
  }
310
310
  }
311
311
  function f() {
@@ -315,7 +315,7 @@ function Je(e) {
315
315
  ), t.visibilityHandler = null), t.started = !1;
316
316
  }
317
317
  async function y(u) {
318
- return !u || typeof u != "object" ? null : a("POST", "/update", u);
318
+ return !u || typeof u != "object" ? null : r("POST", "/update", u);
319
319
  }
320
320
  function C(u) {
321
321
  if (!(!u || typeof u != "object"))
@@ -335,7 +335,7 @@ function Je(e) {
335
335
  update: y,
336
336
  context: C,
337
337
  // REST
338
- getCustomer: b,
338
+ getCustomer: w,
339
339
  patchCustomer: x,
340
340
  listConversations: E,
341
341
  createConversation: A,
@@ -443,7 +443,7 @@ function tt(e) {
443
443
  Array.isArray(h == null ? void 0 : h.conversations) && (t.conversations = h.conversations);
444
444
  })
445
445
  );
446
- async function r(h) {
446
+ async function i(h) {
447
447
  try {
448
448
  const m = new Promise(
449
449
  (y, C) => setTimeout(
@@ -466,7 +466,7 @@ function tt(e) {
466
466
  console.error("[store] start failed", m), t.error = (m == null ? void 0 : m.message) || String(m);
467
467
  }
468
468
  }
469
- function i() {
469
+ function a() {
470
470
  for (const h of n)
471
471
  try {
472
472
  h();
@@ -485,7 +485,7 @@ function tt(e) {
485
485
  }
486
486
  return t.customer;
487
487
  }
488
- async function a(h = {}) {
488
+ async function r(h = {}) {
489
489
  const m = await e.createConversation(h), f = t.conversations.findIndex((y) => y.id === m.id);
490
490
  return f === -1 ? t.conversations = [m, ...t.conversations] : t.conversations[f] = m, m;
491
491
  }
@@ -493,7 +493,7 @@ function tt(e) {
493
493
  async function g(h) {
494
494
  const m = t.paginationByConv[h];
495
495
  if (!(m != null && m.loaded || m != null && m.loading)) {
496
- b(h, { nextCursor: null, loading: !0, loaded: !1 });
496
+ w(h, { nextCursor: null, loading: !0, loaded: !1 });
497
497
  try {
498
498
  const f = await e.listMessages(h, {
499
499
  limit: l
@@ -503,13 +503,13 @@ function tt(e) {
503
503
  const _ = C.filter((p) => !((p == null ? void 0 : p.id) != null && u.has(`id:${String(p.id)}`) || p != null && p.client_msg_id && u.has(`c:${p.client_msg_id}`)));
504
504
  t.messagesByConv[h] = [...y, ..._].sort(
505
505
  ue
506
- ), b(h, {
506
+ ), w(h, {
507
507
  nextCursor: (f == null ? void 0 : f.next_cursor) ?? null,
508
508
  loading: !1,
509
509
  loaded: !0
510
510
  });
511
511
  } catch (f) {
512
- console.error("[store] openConversation failed", f), b(h, {
512
+ console.error("[store] openConversation failed", f), w(h, {
513
513
  nextCursor: null,
514
514
  loading: !1,
515
515
  loaded: !1
@@ -523,7 +523,7 @@ function tt(e) {
523
523
  if (!m || m.loading || !m.nextCursor) return;
524
524
  const y = (C = (t.messagesByConv[h] || []).find((u) => u == null ? void 0 : u.created_at)) == null ? void 0 : C.created_at;
525
525
  if (y) {
526
- b(h, { ...m, loading: !0 });
526
+ w(h, { ...m, loading: !0 });
527
527
  try {
528
528
  const u = await e.listMessages(h, {
529
529
  before: y,
@@ -532,17 +532,17 @@ function tt(e) {
532
532
  for (const T of p)
533
533
  (T == null ? void 0 : T.id) != null && S.add(`id:${String(T.id)}`), T != null && T.client_msg_id && S.add(`c:${T.client_msg_id}`);
534
534
  const O = _.filter((T) => !((T == null ? void 0 : T.id) != null && S.has(`id:${String(T.id)}`) || T != null && T.client_msg_id && S.has(`c:${T.client_msg_id}`)));
535
- t.messagesByConv[h] = [...O, ...p], b(h, {
535
+ t.messagesByConv[h] = [...O, ...p], w(h, {
536
536
  nextCursor: (u == null ? void 0 : u.next_cursor) ?? null,
537
537
  loading: !1,
538
538
  loaded: !0
539
539
  });
540
540
  } catch (u) {
541
- console.error("[store] loadMore failed", u), b(h, { ...m, loading: !1 });
541
+ console.error("[store] loadMore failed", u), w(h, { ...m, loading: !1 });
542
542
  }
543
543
  }
544
544
  }
545
- function b(h, m) {
545
+ function w(h, m) {
546
546
  t.paginationByConv = { ...t.paginationByConv, [h]: m };
547
547
  }
548
548
  async function x(h, m) {
@@ -775,10 +775,10 @@ function tt(e) {
775
775
  }
776
776
  return {
777
777
  state: t,
778
- start: r,
779
- destroy: i,
778
+ start: i,
779
+ destroy: a,
780
780
  applyCustomer: s,
781
- createConversation: a,
781
+ createConversation: r,
782
782
  openConversation: g,
783
783
  loadMore: k,
784
784
  fetchSinceLast: E,
@@ -1151,55 +1151,55 @@ function ne(e) {
1151
1151
  return Oe[Me(e)] || Oe[ce];
1152
1152
  }
1153
1153
  function j(e) {
1154
- const t = Me(e), n = we[t] || we[ce], r = we[ce];
1155
- return function(s, a) {
1154
+ const t = Me(e), n = we[t] || we[ce], i = we[ce];
1155
+ return function(s, r) {
1156
1156
  let l = n[s];
1157
- return l == null && (l = r[s]), l == null ? s : (a && (l = l.replace(
1157
+ return l == null && (l = i[s]), l == null ? s : (r && (l = l.replace(
1158
1158
  /\{(\w+)\}/g,
1159
- (g, k) => a[k] != null ? String(a[k]) : g
1159
+ (g, k) => r[k] != null ? String(r[k]) : g
1160
1160
  )), l);
1161
1161
  };
1162
1162
  }
1163
1163
  function Ie(e, t) {
1164
1164
  if (!Array.isArray(e == null ? void 0 : e.options)) return t;
1165
- const n = e.options.find((r) => (r == null ? void 0 : r.value) === t);
1165
+ const n = e.options.find((i) => (i == null ? void 0 : i.value) === t);
1166
1166
  return (n == null ? void 0 : n.label) || t;
1167
1167
  }
1168
1168
  function Fe(e, t, n) {
1169
- return Array.isArray(t) ? t.map((r) => Ie(e, String(r))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : Ie(e, String(t));
1169
+ return Array.isArray(t) ? t.map((i) => Ie(e, String(i))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : Ie(e, String(t));
1170
1170
  }
1171
1171
  function dt(e, t, n = j()) {
1172
1172
  if (!e || !t) return "";
1173
- const r = Array.isArray(e.fields) ? e.fields : [], i = [];
1174
- for (const s of r) {
1173
+ const i = Array.isArray(e.fields) ? e.fields : [], a = [];
1174
+ for (const s of i) {
1175
1175
  if (!(s != null && s.key) || !(s != null && s.label)) continue;
1176
- const a = t[s.key];
1177
- if (a == null || a === "") continue;
1178
- const l = Fe(s, a, n);
1179
- l && i.push(`${s.label} :
1176
+ const r = t[s.key];
1177
+ if (r == null || r === "") continue;
1178
+ const l = Fe(s, r, n);
1179
+ l && a.push(`${s.label} :
1180
1180
  ${l}`);
1181
1181
  }
1182
- return i.join(`
1182
+ return a.join(`
1183
1183
 
1184
1184
  `);
1185
1185
  }
1186
1186
  function ut(e, t, n = j()) {
1187
- const r = [], i = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
1188
- for (const s of i) {
1187
+ const i = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
1188
+ for (const s of a) {
1189
1189
  if (!(s != null && s.key) || !(s != null && s.label)) continue;
1190
- const a = t == null ? void 0 : t[s.key];
1191
- if (a == null || a === "") continue;
1192
- const l = Fe(s, a, n);
1190
+ const r = t == null ? void 0 : t[s.key];
1191
+ if (r == null || r === "") continue;
1192
+ const l = Fe(s, r, n);
1193
1193
  if (!l) continue;
1194
1194
  const g = s.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
1195
1195
  `));
1196
- r.push({ label: s.label, value: l, multiline: g });
1196
+ i.push({ label: s.label, value: l, multiline: g });
1197
1197
  }
1198
1198
  return {
1199
1199
  kind: "form_response",
1200
1200
  data: {
1201
1201
  title: (e == null ? void 0 : e.title) || n("form.title"),
1202
- fields: r
1202
+ fields: i
1203
1203
  }
1204
1204
  };
1205
1205
  }
@@ -1213,10 +1213,10 @@ const Le = "";
1213
1213
  function le(e) {
1214
1214
  let t = e;
1215
1215
  const n = [];
1216
- return t = t.replace(/`([^`\n]+)`/g, (r, i) => {
1216
+ return t = t.replace(/`([^`\n]+)`/g, (i, a) => {
1217
1217
  const s = n.length;
1218
- return n.push(i), `${Le}CODE${s}${Le}`;
1219
- }), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (r, i, s) => me(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${i}</a>` : i), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (r, i) => `<code class="wm-md-code">${n[+i]}</code>`), t;
1218
+ return n.push(a), `${Le}CODE${s}${Le}`;
1219
+ }), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, a, s) => me(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${a}</a>` : a), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (i, a) => `<code class="wm-md-code">${n[+a]}</code>`), t;
1220
1220
  }
1221
1221
  function He(e) {
1222
1222
  if (!e) return "";
@@ -1227,15 +1227,15 @@ function ht(e) {
1227
1227
  if (!e) return "";
1228
1228
  const t = je(e).split(`
1229
1229
  `), n = [];
1230
- let r = 0;
1231
- for (; r < t.length; ) {
1232
- const s = t[r];
1230
+ let i = 0;
1231
+ for (; i < t.length; ) {
1232
+ const s = t[i];
1233
1233
  if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1234
- r++;
1234
+ i++;
1235
1235
  const k = [];
1236
- for (; r < t.length && !/^\s*```\s*$/.test(t[r]); )
1237
- k.push(t[r]), r++;
1238
- r < t.length && r++, n.push({
1236
+ for (; i < t.length && !/^\s*```\s*$/.test(t[i]); )
1237
+ k.push(t[i]), i++;
1238
+ i < t.length && i++, n.push({
1239
1239
  type: "block",
1240
1240
  html: `<pre class="wm-md-pre"><code>${k.join(`
1241
1241
  `)}</code></pre>`
@@ -1244,27 +1244,27 @@ function ht(e) {
1244
1244
  }
1245
1245
  if (/^\s*[-*]\s+/.test(s)) {
1246
1246
  const k = [];
1247
- for (; r < t.length; ) {
1248
- const x = /^\s*[-*]\s+(.*)$/.exec(t[r]);
1247
+ for (; i < t.length; ) {
1248
+ const x = /^\s*[-*]\s+(.*)$/.exec(t[i]);
1249
1249
  if (!x) break;
1250
- k.push(x[1]), r++;
1250
+ k.push(x[1]), i++;
1251
1251
  }
1252
- const b = k.map((x) => `<li>${le(x)}</li>`).join("");
1252
+ const w = k.map((x) => `<li>${le(x)}</li>`).join("");
1253
1253
  n.push({
1254
1254
  type: "block",
1255
- html: `<ul class="wm-md-ul">${b}</ul>`
1255
+ html: `<ul class="wm-md-ul">${w}</ul>`
1256
1256
  });
1257
1257
  continue;
1258
1258
  }
1259
1259
  const l = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1260
1260
  if (l) {
1261
- const k = parseInt(l[1], 10), b = [l[2]];
1262
- for (r++; r < t.length; ) {
1263
- const A = /^\s*\d+\.\s+(.*)$/.exec(t[r]);
1261
+ const k = parseInt(l[1], 10), w = [l[2]];
1262
+ for (i++; i < t.length; ) {
1263
+ const A = /^\s*\d+\.\s+(.*)$/.exec(t[i]);
1264
1264
  if (!A) break;
1265
- b.push(A[1]), r++;
1265
+ w.push(A[1]), i++;
1266
1266
  }
1267
- const x = b.map((A) => `<li>${le(A)}</li>`).join(""), E = k !== 1 ? ` start="${k}"` : "";
1267
+ const x = w.map((A) => `<li>${le(A)}</li>`).join(""), E = k !== 1 ? ` start="${k}"` : "";
1268
1268
  n.push({
1269
1269
  type: "block",
1270
1270
  html: `<ol class="wm-md-ol"${E}>${x}</ol>`
@@ -1277,20 +1277,20 @@ function ht(e) {
1277
1277
  n.push({
1278
1278
  type: "block",
1279
1279
  html: `<h${k} class="wm-md-h wm-md-h${k}">${le(g[2])}</h${k}>`
1280
- }), r++;
1280
+ }), i++;
1281
1281
  continue;
1282
1282
  }
1283
- n.push({ type: "text", html: le(s) }), r++;
1283
+ n.push({ type: "text", html: le(s) }), i++;
1284
1284
  }
1285
- let i = "";
1285
+ let a = "";
1286
1286
  for (let s = 0; s < n.length; s++) {
1287
- const a = n[s];
1288
- i += a.html;
1287
+ const r = n[s];
1288
+ a += r.html;
1289
1289
  const l = n[s + 1];
1290
- l && a.type !== "block" && l.type !== "block" && (i += `
1290
+ l && r.type !== "block" && l.type !== "block" && (a += `
1291
1291
  `);
1292
1292
  }
1293
- return i;
1293
+ return a;
1294
1294
  }
1295
1295
  function de(e) {
1296
1296
  var n;
@@ -1304,52 +1304,52 @@ function Y(e) {
1304
1304
  }
1305
1305
  function Ee(e, t) {
1306
1306
  let n = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
1307
- for (const r of t)
1308
- r != null && r.created_at && r.created_at > n && (n = r.created_at);
1307
+ for (const i of t)
1308
+ i != null && i.created_at && i.created_at > n && (n = i.created_at);
1309
1309
  return n;
1310
1310
  }
1311
1311
  function mt(e, t) {
1312
- var n, r, i;
1312
+ var n, i, a;
1313
1313
  for (let s = t.length - 1; s >= 0; s--) {
1314
- const a = t[s];
1315
- if (!a) continue;
1316
- const l = typeof a.text_md == "string" ? a.text_md.trim() : "";
1314
+ const r = t[s];
1315
+ if (!r) continue;
1316
+ const l = typeof r.text_md == "string" ? r.text_md.trim() : "";
1317
1317
  if (l)
1318
- return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
1319
- const g = (r = a.payload) == null ? void 0 : r.attachments;
1318
+ return (((n = r.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
1319
+ const g = (i = r.payload) == null ? void 0 : i.attachments;
1320
1320
  if (Array.isArray(g) && g.length) return "📎 Pièce jointe";
1321
1321
  }
1322
- return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((i = e == null ? void 0 : e.metadata) == null ? void 0 : i.last_preview) || "";
1322
+ return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((a = e == null ? void 0 : e.metadata) == null ? void 0 : a.last_preview) || "";
1323
1323
  }
1324
1324
  function ft(e, t) {
1325
1325
  return (e == null ? void 0 : e.name) || ((e == null ? void 0 : e.type) === "user" ? t("common.you") : (e == null ? void 0 : e.type) === "agent_human" ? t("common.agent") : (e == null ? void 0 : e.type) === "agent_ia" ? t("common.aiAssistant") : t("common.system"));
1326
1326
  }
1327
- function _t(e, t, n, r) {
1328
- const i = [
1327
+ function _t(e, t, n, i) {
1328
+ const a = [
1329
1329
  `# ${e.name || n("common.conversation")}`,
1330
1330
  e.created_at ? n("export.createdOn", {
1331
- date: new Date(e.created_at).toLocaleString(r)
1331
+ date: new Date(e.created_at).toLocaleString(i)
1332
1332
  }) : "",
1333
1333
  ""
1334
1334
  ];
1335
1335
  for (const s of t) {
1336
1336
  if (!s) continue;
1337
- const a = (s.text_md || "").trim();
1338
- if (!a) continue;
1339
- const l = ft(s.author, n), g = s.created_at ? new Date(s.created_at).toLocaleString(r) : "";
1340
- i.push(`[${g}] ${l} :`), i.push(a), i.push("");
1337
+ const r = (s.text_md || "").trim();
1338
+ if (!r) continue;
1339
+ const l = ft(s.author, n), g = s.created_at ? new Date(s.created_at).toLocaleString(i) : "";
1340
+ a.push(`[${g}] ${l} :`), a.push(r), a.push("");
1341
1341
  }
1342
- return i.join(`
1342
+ return a.join(`
1343
1343
  `);
1344
1344
  }
1345
- function gt(e, t, n = j(), r) {
1345
+ function gt(e, t, n = j(), i) {
1346
1346
  if (!e) return;
1347
- const i = _t(e, t || [], n, ne(r)), s = new Blob([i], { type: "text/plain;charset=utf-8" });
1347
+ const a = _t(e, t || [], n, ne(i)), s = new Blob([a], { type: "text/plain;charset=utf-8" });
1348
1348
  try {
1349
- const a = URL.createObjectURL(s), l = document.createElement("a");
1350
- l.href = a, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(a), 1e3);
1351
- } catch (a) {
1352
- console.error("[ww-messenger] export failed", a);
1349
+ const r = URL.createObjectURL(s), l = document.createElement("a");
1350
+ l.href = r, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(r), 1e3);
1351
+ } catch (r) {
1352
+ console.error("[ww-messenger] export failed", r);
1353
1353
  }
1354
1354
  }
1355
1355
  const pt = {
@@ -1462,10 +1462,10 @@ const pt = {
1462
1462
  // at message-arrival time because the user may have closed the
1463
1463
  // panel or switched threads during the typing dwell.
1464
1464
  onMessageRevealed(e, t) {
1465
- var i;
1465
+ var a;
1466
1466
  if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !de(e)) return;
1467
1467
  const n = typeof document < "u" && document.hidden;
1468
- this.isOpen && !n && ((i = this.currentConv) == null ? void 0 : i.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, e));
1468
+ this.isOpen && !n && ((a = this.currentConv) == null ? void 0 : a.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, e));
1469
1469
  },
1470
1470
  playNotificationSound() {
1471
1471
  if (typeof window > "u") return;
@@ -1479,14 +1479,14 @@ const pt = {
1479
1479
  t.resume();
1480
1480
  } catch {
1481
1481
  }
1482
- const n = t.currentTime, r = t.createOscillator(), i = t.createGain();
1483
- r.connect(i), i.connect(t.destination), r.type = "sine", r.frequency.setValueAtTime(880, n), r.frequency.exponentialRampToValueAtTime(1320, n + 0.08), i.gain.setValueAtTime(0, n), i.gain.linearRampToValueAtTime(0.12, n + 0.02), i.gain.exponentialRampToValueAtTime(1e-4, n + 0.28), r.start(n), r.stop(n + 0.32);
1482
+ const n = t.currentTime, i = t.createOscillator(), a = t.createGain();
1483
+ i.connect(a), a.connect(t.destination), i.type = "sine", i.frequency.setValueAtTime(880, n), i.frequency.exponentialRampToValueAtTime(1320, n + 0.08), a.gain.setValueAtTime(0, n), a.gain.linearRampToValueAtTime(0.12, n + 0.02), a.gain.exponentialRampToValueAtTime(1e-4, n + 0.28), i.start(n), i.stop(n + 0.32);
1484
1484
  } catch {
1485
1485
  }
1486
1486
  },
1487
1487
  showBrowserNotification(e, t) {
1488
1488
  if (typeof Notification > "u" || Notification.permission !== "granted") return;
1489
- const n = t == null ? void 0 : t.author, r = !n || n.type === "agent_ia", s = ((n == null ? void 0 : n.name) || (r ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), a = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = a ? a.slice(0, 140) : this.t("notification.youHaveNewMessage");
1489
+ const n = t == null ? void 0 : t.author, i = !n || n.type === "agent_ia", s = ((n == null ? void 0 : n.name) || (i ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), r = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = r ? r.slice(0, 140) : this.t("notification.youHaveNewMessage");
1490
1490
  try {
1491
1491
  const g = new Notification(s, {
1492
1492
  body: l,
@@ -1545,18 +1545,18 @@ const pt = {
1545
1545
  var n;
1546
1546
  if (!this.transport) return;
1547
1547
  this.teardownLiveReveal();
1548
- const e = this.transport.on("message", (r) => {
1549
- const i = r == null ? void 0 : r.conversation_id, s = r == null ? void 0 : r.message;
1550
- i && s && this.paceLiveMessage(s, i);
1548
+ const e = this.transport.on("message", (i) => {
1549
+ const a = i == null ? void 0 : i.conversation_id, s = i == null ? void 0 : i.message;
1550
+ a && s && this.paceLiveMessage(s, a);
1551
1551
  });
1552
1552
  this._liveRevealConvSnapshot = new Map(
1553
- (((n = this.s) == null ? void 0 : n.conversations) || []).map((r) => [
1554
- r.id,
1555
- (r == null ? void 0 : r.last_message_at) || ""
1553
+ (((n = this.s) == null ? void 0 : n.conversations) || []).map((i) => [
1554
+ i.id,
1555
+ (i == null ? void 0 : i.last_message_at) || ""
1556
1556
  ])
1557
1557
  );
1558
- const t = this.transport.on("activity", (r) => {
1559
- this.handleLiveActivity(r);
1558
+ const t = this.transport.on("activity", (i) => {
1559
+ this.handleLiveActivity(i);
1560
1560
  });
1561
1561
  this._liveRevealOff = () => {
1562
1562
  try {
@@ -1586,25 +1586,25 @@ const pt = {
1586
1586
  // on background convs when SSE wasn't open at the moment they
1587
1587
  // arrived.
1588
1588
  async handleLiveActivity(e) {
1589
- var i, s;
1589
+ var a, s;
1590
1590
  const t = e == null ? void 0 : e.conversations;
1591
1591
  if (!Array.isArray(t) || !this.store) return;
1592
- const n = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), r = [];
1593
- for (const a of t) {
1594
- if (!(a != null && a.id)) continue;
1595
- const l = a.last_message_at || "";
1592
+ const n = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), i = [];
1593
+ for (const r of t) {
1594
+ if (!(r != null && r.id)) continue;
1595
+ const l = r.last_message_at || "";
1596
1596
  if (!l) continue;
1597
- const g = n.get(a.id) || "";
1598
- l > g && r.push(a.id);
1597
+ const g = n.get(r.id) || "";
1598
+ l > g && i.push(r.id);
1599
1599
  }
1600
1600
  this._liveRevealConvSnapshot = new Map(
1601
- t.map((a) => [a.id, (a == null ? void 0 : a.last_message_at) || ""])
1601
+ t.map((r) => [r.id, (r == null ? void 0 : r.last_message_at) || ""])
1602
1602
  );
1603
- for (const a of r)
1603
+ for (const r of i)
1604
1604
  try {
1605
- const l = await ((s = (i = this.store).fetchSinceLast) == null ? void 0 : s.call(i, a));
1605
+ const l = await ((s = (a = this.store).fetchSinceLast) == null ? void 0 : s.call(a, r));
1606
1606
  if (!Array.isArray(l)) continue;
1607
- for (const g of l) this.paceLiveMessage(g, a);
1607
+ for (const g of l) this.paceLiveMessage(g, r);
1608
1608
  } catch (l) {
1609
1609
  console.error(
1610
1610
  "[ww-messenger] activity delta fetch failed",
@@ -1618,16 +1618,16 @@ const pt = {
1618
1618
  // - inter-bubble gap scales with message length (reading time),
1619
1619
  // bounded by MIN/MAX_TYPING_MS.
1620
1620
  scheduleReveal(e, t) {
1621
- const n = Date.now(), r = ((e == null ? void 0 : e.text_md) || "").length, i = Math.min(
1621
+ const n = Date.now(), i = ((e == null ? void 0 : e.text_md) || "").length, a = Math.min(
1622
1622
  bt,
1623
- Math.max(wt, r * yt)
1624
- ), a = Math.max(
1623
+ Math.max(wt, i * yt)
1624
+ ), r = Math.max(
1625
1625
  n + vt,
1626
1626
  this.nextRevealAt + kt
1627
- ) + i;
1628
- this.nextRevealAt = a;
1629
- const l = Math.max(0, a - n), g = e.id, k = setTimeout(() => {
1630
- this.revealedAt = { ...this.revealedAt, [g]: Date.now() }, this.revealTimers = this.revealTimers.filter((b) => b !== k), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
1627
+ ) + a;
1628
+ this.nextRevealAt = r;
1629
+ const l = Math.max(0, r - n), g = e.id, k = setTimeout(() => {
1630
+ this.revealedAt = { ...this.revealedAt, [g]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== k), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
1631
1631
  }, l);
1632
1632
  this.revealTimers.push(k);
1633
1633
  },
@@ -1637,28 +1637,28 @@ const pt = {
1637
1637
  // history (instant) and any live message that the transport
1638
1638
  // subscription already paced (idempotent on msg.id).
1639
1639
  paceMessages(e, t) {
1640
- var i;
1640
+ var a;
1641
1641
  if (!Array.isArray(e) || !e.length) return;
1642
- const n = Date.now(), r = { ...this.revealedAt };
1642
+ const n = Date.now(), i = { ...this.revealedAt };
1643
1643
  for (const s of e) {
1644
- if ((s == null ? void 0 : s.id) == null || r[s.id] !== void 0) continue;
1644
+ if ((s == null ? void 0 : s.id) == null || i[s.id] !== void 0) continue;
1645
1645
  if (!de(s)) {
1646
- r[s.id] = n;
1646
+ i[s.id] = n;
1647
1647
  continue;
1648
1648
  }
1649
- const a = s != null && s.created_at ? Date.parse(s.created_at) : NaN;
1650
- if (!Number.isFinite(a) || a < this.convOpenedAt) {
1651
- r[s.id] = n;
1649
+ const r = s != null && s.created_at ? Date.parse(s.created_at) : NaN;
1650
+ if (!Number.isFinite(r) || r < this.convOpenedAt) {
1651
+ i[s.id] = n;
1652
1652
  continue;
1653
1653
  }
1654
- const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, g = Array.isArray((i = s == null ? void 0 : s.payload) == null ? void 0 : i.attachments) && s.payload.attachments.length > 0;
1654
+ const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, g = Array.isArray((a = s == null ? void 0 : s.payload) == null ? void 0 : a.attachments) && s.payload.attachments.length > 0;
1655
1655
  if (!l && !g) {
1656
- r[s.id] = n;
1656
+ i[s.id] = n;
1657
1657
  continue;
1658
1658
  }
1659
- r[s.id] = 0, this.scheduleReveal(s, t);
1659
+ i[s.id] = 0, this.scheduleReveal(s, t);
1660
1660
  }
1661
- this.revealedAt = r;
1661
+ this.revealedAt = i;
1662
1662
  },
1663
1663
  // Pace a single live message from any conversation. Called from the
1664
1664
  // transport 'message' subscription (live SSE arrival) and from the
@@ -1671,14 +1671,14 @@ const pt = {
1671
1671
  // by definition live, even on convs the user never viewed this
1672
1672
  // session.
1673
1673
  paceLiveMessage(e, t) {
1674
- var i;
1674
+ var a;
1675
1675
  if (!(e != null && e.id) || this.revealedAt[e.id] !== void 0) return;
1676
1676
  if (!de(e)) {
1677
1677
  this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
1678
1678
  return;
1679
1679
  }
1680
- const n = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, r = Array.isArray((i = e == null ? void 0 : e.payload) == null ? void 0 : i.attachments) && e.payload.attachments.length > 0;
1681
- if (!n && !r) {
1680
+ const n = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, i = Array.isArray((a = e == null ? void 0 : e.payload) == null ? void 0 : a.attachments) && e.payload.attachments.length > 0;
1681
+ if (!n && !i) {
1682
1682
  this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
1683
1683
  return;
1684
1684
  }
@@ -1744,12 +1744,12 @@ const pt = {
1744
1744
  // messages, or when the pointer is already at/ahead of the
1745
1745
  // candidate id.
1746
1746
  markConvRead(e) {
1747
- var s, a;
1747
+ var s, r;
1748
1748
  if (!(e != null && e.id) || e._draft || !this.store) return;
1749
- const t = ((a = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : a[e.id]) || [], n = Tt(t);
1749
+ const t = ((r = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : r[e.id]) || [], n = Tt(t);
1750
1750
  if (n == null) return;
1751
- const r = Y(e.last_read_message_id), i = Y(n);
1752
- i != null && (r != null && i <= r || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
1751
+ const i = Y(e.last_read_message_id), a = Y(n);
1752
+ a != null && (i != null && a <= i || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
1753
1753
  const l = this._readMarkerPending;
1754
1754
  this._readMarkerPending = null, this._readMarkerTimer = null, l && this.store && this.store.markConversationRead(
1755
1755
  l.convId,
@@ -1769,8 +1769,8 @@ function Tt(e) {
1769
1769
  }
1770
1770
  const B = (e, t) => {
1771
1771
  const n = e.__vccOpts || e;
1772
- for (const [r, i] of t)
1773
- n[r] = i;
1772
+ for (const [i, a] of t)
1773
+ n[i] = a;
1774
1774
  return n;
1775
1775
  }, xt = {
1776
1776
  name: "WmHumanAvatar",
@@ -1793,7 +1793,7 @@ const B = (e, t) => {
1793
1793
  }
1794
1794
  }
1795
1795
  }, Ot = ["src", "alt"];
1796
- function It(e, t, n, r, i, s) {
1796
+ function It(e, t, n, i, a, s) {
1797
1797
  return c(), d("div", {
1798
1798
  class: I(["wm-huav", { "wm-huav--tail": n.tail }]),
1799
1799
  style: z({
@@ -1840,8 +1840,8 @@ const ge = /* @__PURE__ */ B(xt, [["render", It], ["__scopeId", "data-v-14e10c0d
1840
1840
  }
1841
1841
  }
1842
1842
  }, Rt = ["aria-label", "onClick", "onKeydown"], Bt = ["aria-label", "onClick"], Pt = { class: "wm-peek__avatar" }, Nt = ["aria-label"], Ut = { class: "wm-peek__body" }, Dt = { class: "wm-peek__head" }, Ft = { class: "wm-peek__name" }, jt = { class: "wm-peek__action" }, Ht = { class: "wm-peek__text" }, zt = ["onClick"], qt = ["aria-label"], $t = ["aria-label"];
1843
- function Vt(e, t, n, r, i, s) {
1844
- const a = R("HumanAvatar");
1843
+ function Vt(e, t, n, i, a, s) {
1844
+ const r = R("HumanAvatar");
1845
1845
  return c(), d("div", {
1846
1846
  class: "wm-launcherWrap",
1847
1847
  onMouseenter: t[1] || (t[1] = (l) => e.$emit("hover", !0)),
@@ -1894,7 +1894,7 @@ function Vt(e, t, n, r, i, s) {
1894
1894
  ], -1)
1895
1895
  ])], 8, Bt),
1896
1896
  o("div", Pt, [
1897
- V(a, {
1897
+ V(r, {
1898
1898
  name: l.senderName,
1899
1899
  "avatar-url": l.senderAvatarUrl,
1900
1900
  size: 34
@@ -1903,7 +1903,7 @@ function Vt(e, t, n, r, i, s) {
1903
1903
  key: 0,
1904
1904
  class: "wm-peek__avatarBadge",
1905
1905
  "aria-label": s.t("launcher.unreadMessages", { count: l.count })
1906
- }, v(l.count > 9 ? "9+" : l.count), 9, Nt)) : w("", !0)
1906
+ }, v(l.count > 9 ? "9+" : l.count), 9, Nt)) : b("", !0)
1907
1907
  ]),
1908
1908
  o("div", Ut, [
1909
1909
  o("div", Dt, [
@@ -1918,7 +1918,7 @@ function Vt(e, t, n, r, i, s) {
1918
1918
  onClick: X((k) => e.$emit("open", l.convId), ["stop"])
1919
1919
  }, v(s.t("common.open")), 9, zt)
1920
1920
  ], 44, Rt))), 128))
1921
- ], 2)) : w("", !0)
1921
+ ], 2)) : b("", !0)
1922
1922
  ]),
1923
1923
  _: 1
1924
1924
  }),
@@ -1949,7 +1949,7 @@ function Vt(e, t, n, r, i, s) {
1949
1949
  }) : s.t("launcher.unreadConversationsOne", {
1950
1950
  count: n.unreadCount
1951
1951
  })
1952
- }, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, $t)) : w("", !0)
1952
+ }, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, $t)) : b("", !0)
1953
1953
  ], 8, qt)
1954
1954
  ], 32);
1955
1955
  }
@@ -1986,7 +1986,7 @@ const Kt = /* @__PURE__ */ B(Et, [["render", Vt], ["__scopeId", "data-v-44ddf1a1
1986
1986
  key: 0,
1987
1987
  class: "wm-aiav__pulse"
1988
1988
  }, Yt = ["src", "alt"], Xt = ["width", "height"];
1989
- function Jt(e, t, n, r, i, s) {
1989
+ function Jt(e, t, n, i, a, s) {
1990
1990
  return c(), d("div", {
1991
1991
  class: I(["wm-aiav", { "wm-aiav--tail": n.tail }]),
1992
1992
  style: z({
@@ -1995,7 +1995,7 @@ function Jt(e, t, n, r, i, s) {
1995
1995
  "--wm-avr": n.size * 0.32 + "px"
1996
1996
  })
1997
1997
  }, [
1998
- n.pulse ? (c(), d("div", Gt)) : w("", !0),
1998
+ n.pulse ? (c(), d("div", Gt)) : b("", !0),
1999
1999
  o("div", {
2000
2000
  class: I(["wm-aiav__inner", {
2001
2001
  "wm-aiav__inner--glow": n.pulse,
@@ -2073,30 +2073,30 @@ const oe = /* @__PURE__ */ B(Wt, [["render", Jt], ["__scopeId", "data-v-6f7f685d
2073
2073
  key: 0,
2074
2074
  class: "wm-team__label"
2075
2075
  };
2076
- function sn(e, t, n, r, i, s) {
2076
+ function sn(e, t, n, i, a, s) {
2077
2077
  return s.visible ? (c(), d("div", Zt, [
2078
2078
  o("div", {
2079
2079
  class: "wm-team__stack",
2080
2080
  style: z({ width: s.stackWidth + "px" })
2081
2081
  }, [
2082
- (c(!0), d(L, null, F(n.members.slice(0, 3), (a, l) => (c(), d("div", {
2082
+ (c(!0), d(L, null, F(n.members.slice(0, 3), (r, l) => (c(), d("div", {
2083
2083
  key: l,
2084
2084
  class: "wm-team__pill",
2085
2085
  style: z({
2086
2086
  left: l * 13 + "px",
2087
2087
  zIndex: 3 - l,
2088
- background: s.colorFor(a)
2088
+ background: s.colorFor(r)
2089
2089
  })
2090
2090
  }, [
2091
- a.avatar_url ? (c(), d("img", {
2091
+ r.avatar_url ? (c(), d("img", {
2092
2092
  key: 0,
2093
- src: a.avatar_url,
2094
- alt: a.name || ""
2095
- }, null, 8, en)) : (c(), d("span", tn, v(s.initialsFor(a)), 1))
2093
+ src: r.avatar_url,
2094
+ alt: r.name || ""
2095
+ }, null, 8, en)) : (c(), d("span", tn, v(s.initialsFor(r)), 1))
2096
2096
  ], 4))), 128))
2097
2097
  ], 4),
2098
- n.responseLabel ? (c(), d("span", nn, v(n.responseLabel), 1)) : w("", !0)
2099
- ])) : w("", !0);
2098
+ n.responseLabel ? (c(), d("span", nn, v(n.responseLabel), 1)) : b("", !0)
2099
+ ])) : b("", !0);
2100
2100
  }
2101
2101
  const rn = /* @__PURE__ */ B(Qt, [["render", sn], ["__scopeId", "data-v-e49a9063"]]), an = {
2102
2102
  name: "WmHeader",
@@ -2132,8 +2132,8 @@ const rn = /* @__PURE__ */ B(Qt, [["render", sn], ["__scopeId", "data-v-e49a9063
2132
2132
  const e = Array.isArray(this.teamMembers) ? this.teamMembers : [];
2133
2133
  if (e.length <= 3) return e;
2134
2134
  const t = (/* @__PURE__ */ new Date()).getHours() % e.length, n = [];
2135
- for (let r = 0; r < 3; r++)
2136
- n.push(e[(t + r) % e.length]);
2135
+ for (let i = 0; i < 3; i++)
2136
+ n.push(e[(t + i) % e.length]);
2137
2137
  return n;
2138
2138
  }
2139
2139
  }
@@ -2144,8 +2144,8 @@ const rn = /* @__PURE__ */ B(Qt, [["render", sn], ["__scopeId", "data-v-e49a9063
2144
2144
  key: 3,
2145
2145
  class: "wm-header__fill"
2146
2146
  }, fn = { class: "wm-header__actions" }, _n = ["aria-label", "title"], gn = ["aria-label", "title"];
2147
- function pn(e, t, n, r, i, s) {
2148
- const a = R("AIAvatar"), l = R("TeamAvatars");
2147
+ function pn(e, t, n, i, a, s) {
2148
+ const r = R("AIAvatar"), l = R("TeamAvatars");
2149
2149
  return c(), d("div", on, [
2150
2150
  n.showBack ? (c(), d("button", {
2151
2151
  key: 0,
@@ -2170,7 +2170,7 @@ function pn(e, t, n, r, i, s) {
2170
2170
  ])], 8, ln)) : (c(), d("div", cn)),
2171
2171
  n.showIdentity ? (c(), d(L, { key: 2 }, [
2172
2172
  o("div", dn, [
2173
- V(a, {
2173
+ V(r, {
2174
2174
  size: 30,
2175
2175
  name: n.agentName,
2176
2176
  "image-url": n.agentAvatarUrl
@@ -2183,7 +2183,7 @@ function pn(e, t, n, r, i, s) {
2183
2183
  key: 0,
2184
2184
  members: s.displayedTeamMembers,
2185
2185
  "response-label": ""
2186
- }, null, 8, ["members"])) : w("", !0)
2186
+ }, null, 8, ["members"])) : b("", !0)
2187
2187
  ], 64)) : (c(), d("div", mn)),
2188
2188
  o("div", fn, [
2189
2189
  n.showMore ? (c(), d("button", {
@@ -2217,7 +2217,7 @@ function pn(e, t, n, r, i, s) {
2217
2217
  r: "1.6"
2218
2218
  })
2219
2219
  ], -1)
2220
- ])], 10, _n)) : w("", !0),
2220
+ ])], 10, _n)) : b("", !0),
2221
2221
  n.showClose ? (c(), d("button", {
2222
2222
  key: 1,
2223
2223
  type: "button",
@@ -2239,7 +2239,7 @@ function pn(e, t, n, r, i, s) {
2239
2239
  }, [
2240
2240
  o("path", { d: "M18 6L6 18M6 6l12 12" })
2241
2241
  ], -1)
2242
- ])], 8, gn)) : w("", !0)
2242
+ ])], 8, gn)) : b("", !0)
2243
2243
  ])
2244
2244
  ]);
2245
2245
  }
@@ -2261,7 +2261,7 @@ const vn = /* @__PURE__ */ B(an, [["render", pn], ["__scopeId", "data-v-7af4c118
2261
2261
  wmLocale: { default: () => () => "fr" }
2262
2262
  },
2263
2263
  props: {
2264
- welcomeMessage: { type: String, default: "" },
2264
+ title: { type: String, default: "" },
2265
2265
  subtitle: { type: String, default: "" },
2266
2266
  agentName: { type: String, default: "" },
2267
2267
  defaultIconUrl: { type: String, default: null },
@@ -2272,7 +2272,7 @@ const vn = /* @__PURE__ */ B(an, [["render", pn], ["__scopeId", "data-v-7af4c118
2272
2272
  emits: ["start", "select", "resume", "view-history"],
2273
2273
  computed: {
2274
2274
  heroTitle() {
2275
- return this.welcomeMessage ? this.welcomeMessage : this.agentName ? this.t("onboarding.greetingNamed", { name: this.agentName }) : this.t("onboarding.greeting");
2275
+ return this.title ? this.title : this.agentName ? this.t("onboarding.greetingNamed", { name: this.agentName }) : this.t("onboarding.greeting");
2276
2276
  },
2277
2277
  heroSub() {
2278
2278
  return this.subtitle || this.t("onboarding.heroSub");
@@ -2349,15 +2349,15 @@ const vn = /* @__PURE__ */ B(an, [["render", pn], ["__scopeId", "data-v-7af4c118
2349
2349
  if (!e) return "";
2350
2350
  const t = new Date(e);
2351
2351
  if (Number.isNaN(t.getTime())) return "";
2352
- const n = ne(this.wmLocale()), r = /* @__PURE__ */ new Date();
2353
- if (t.toDateString() === r.toDateString())
2352
+ const n = ne(this.wmLocale()), i = /* @__PURE__ */ new Date();
2353
+ if (t.toDateString() === i.toDateString())
2354
2354
  return t.toLocaleTimeString(n, {
2355
2355
  hour: "2-digit",
2356
2356
  minute: "2-digit"
2357
2357
  });
2358
- if (r.getTime() - t.getTime() < 7 * 864e5) {
2359
- const a = t.toLocaleDateString(n, { weekday: "short" });
2360
- return a.charAt(0).toUpperCase() + a.slice(1);
2358
+ if (i.getTime() - t.getTime() < 7 * 864e5) {
2359
+ const r = t.toLocaleDateString(n, { weekday: "short" });
2360
+ return r.charAt(0).toUpperCase() + r.slice(1);
2361
2361
  }
2362
2362
  return t.toLocaleDateString(n, {
2363
2363
  day: "2-digit",
@@ -2411,8 +2411,8 @@ const vn = /* @__PURE__ */ B(an, [["render", pn], ["__scopeId", "data-v-7af4c118
2411
2411
  "stroke-linejoin": "round",
2412
2412
  "aria-hidden": "true"
2413
2413
  }, Yn = ["d"], Xn = { class: "wm-onb__btn-label" }, Jn = { class: "wm-onb__btn-count" };
2414
- function Qn(e, t, n, r, i, s) {
2415
- const a = R("AIAvatar");
2414
+ function Qn(e, t, n, i, a, s) {
2415
+ const r = R("AIAvatar");
2416
2416
  return c(), d("div", wn, [
2417
2417
  o("div", bn, [
2418
2418
  t[2] || (t[2] = o("svg", {
@@ -2449,7 +2449,7 @@ function Qn(e, t, n, r, i, s) {
2449
2449
  opacity: "0.65"
2450
2450
  })
2451
2451
  ], -1)),
2452
- V(a, {
2452
+ V(r, {
2453
2453
  size: 52,
2454
2454
  "image-url": n.defaultIconUrl
2455
2455
  }, null, 8, ["image-url"]),
@@ -2494,18 +2494,18 @@ function Qn(e, t, n, r, i, s) {
2494
2494
  o("span", On, [
2495
2495
  o("span", In, v(l.title), 1),
2496
2496
  o("span", Ln, [
2497
- s.senderLabel(l) ? (c(), d("span", En, v(s.senderLabel(l)) + " · ", 1)) : w("", !0),
2497
+ s.senderLabel(l) ? (c(), d("span", En, v(s.senderLabel(l)) + " · ", 1)) : b("", !0),
2498
2498
  o("span", {
2499
2499
  innerHTML: s.renderPreview(l.preview)
2500
2500
  }, null, 8, Rn)
2501
2501
  ])
2502
2502
  ]),
2503
2503
  o("span", Bn, [
2504
- s.formatTs(l._ts) ? (c(), d("span", Pn, v(s.formatTs(l._ts)), 1)) : w("", !0),
2504
+ s.formatTs(l._ts) ? (c(), d("span", Pn, v(s.formatTs(l._ts)), 1)) : b("", !0),
2505
2505
  o("span", Nn, v(s.t("onboarding.resume")), 1)
2506
2506
  ])
2507
2507
  ], 8, Mn))), 128))
2508
- ])) : w("", !0),
2508
+ ])) : b("", !0),
2509
2509
  o("div", Un, [
2510
2510
  o("button", {
2511
2511
  type: "button",
@@ -2552,7 +2552,7 @@ function Qn(e, t, n, r, i, s) {
2552
2552
  o("span", Vn, v(l.label), 1),
2553
2553
  s.isExternalLink(l) ? (c(), d("svg", Kn, [...t[5] || (t[5] = [
2554
2554
  o("path", { d: "M7 17L17 7M9 7h8v8" }, null, -1)
2555
- ])])) : w("", !0)
2555
+ ])])) : b("", !0)
2556
2556
  ], 8, jn))), 128)),
2557
2557
  n.openThreads.length ? (c(), d("button", {
2558
2558
  key: 0,
@@ -2583,11 +2583,11 @@ function Qn(e, t, n, r, i, s) {
2583
2583
  }, [
2584
2584
  o("path", { d: "M9 18l6-6-6-6" })
2585
2585
  ], -1))
2586
- ])) : w("", !0)
2586
+ ])) : b("", !0)
2587
2587
  ])
2588
2588
  ]);
2589
2589
  }
2590
- const Zn = /* @__PURE__ */ B(yn, [["render", Qn], ["__scopeId", "data-v-42cb45fe"]]), es = {
2590
+ const Zn = /* @__PURE__ */ B(yn, [["render", Qn], ["__scopeId", "data-v-96c105fa"]]), es = {
2591
2591
  name: "WmHistory",
2592
2592
  components: { AIAvatar: oe, HumanAvatar: ge },
2593
2593
  inject: {
@@ -2640,15 +2640,15 @@ const Zn = /* @__PURE__ */ B(yn, [["render", Qn], ["__scopeId", "data-v-42cb45fe
2640
2640
  if (!e) return "";
2641
2641
  const t = new Date(e);
2642
2642
  if (Number.isNaN(t.getTime())) return "";
2643
- const n = ne(this.wmLocale()), r = /* @__PURE__ */ new Date();
2644
- if (t.toDateString() === r.toDateString())
2643
+ const n = ne(this.wmLocale()), i = /* @__PURE__ */ new Date();
2644
+ if (t.toDateString() === i.toDateString())
2645
2645
  return t.toLocaleTimeString(n, {
2646
2646
  hour: "2-digit",
2647
2647
  minute: "2-digit"
2648
2648
  });
2649
- if (r.getTime() - t.getTime() < 7 * 864e5) {
2650
- const a = t.toLocaleDateString(n, { weekday: "short" });
2651
- return a.charAt(0).toUpperCase() + a.slice(1);
2649
+ if (i.getTime() - t.getTime() < 7 * 864e5) {
2650
+ const r = t.toLocaleDateString(n, { weekday: "short" });
2651
+ return r.charAt(0).toUpperCase() + r.slice(1);
2652
2652
  }
2653
2653
  return t.toLocaleDateString(n, {
2654
2654
  day: "2-digit",
@@ -2666,7 +2666,7 @@ const Zn = /* @__PURE__ */ B(yn, [["render", Qn], ["__scopeId", "data-v-42cb45fe
2666
2666
  key: 0,
2667
2667
  class: "wm-hist__empty"
2668
2668
  };
2669
- function fs(e, t, n, r, i, s) {
2669
+ function fs(e, t, n, i, a, s) {
2670
2670
  return c(), d("div", ts, [
2671
2671
  o("div", ns, [
2672
2672
  t[1] || (t[1] = o("span", { class: "wm-hist__searchIcon" }, [
@@ -2685,25 +2685,25 @@ function fs(e, t, n, r, i, s) {
2685
2685
  ])
2686
2686
  ], -1)),
2687
2687
  G(o("input", {
2688
- "onUpdate:modelValue": t[0] || (t[0] = (a) => i.query = a),
2688
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => a.query = r),
2689
2689
  type: "text",
2690
2690
  placeholder: s.t("onboarding.search"),
2691
2691
  "aria-label": s.t("onboarding.search")
2692
2692
  }, null, 8, ss), [
2693
- [te, i.query]
2693
+ [te, a.query]
2694
2694
  ])
2695
2695
  ]),
2696
2696
  o("div", rs, [
2697
- (c(!0), d(L, null, F(s.filteredThreads, (a) => (c(), d("button", {
2698
- key: a.id,
2697
+ (c(!0), d(L, null, F(s.filteredThreads, (r) => (c(), d("button", {
2698
+ key: r.id,
2699
2699
  type: "button",
2700
- class: I(["wm-hist__thread", { "wm-hist__thread--unread": a.unread }]),
2701
- onClick: (l) => e.$emit("resume", a)
2700
+ class: I(["wm-hist__thread", { "wm-hist__thread--unread": r.unread }]),
2701
+ onClick: (l) => e.$emit("resume", r)
2702
2702
  }, [
2703
2703
  o("span", {
2704
- class: I(["wm-hist__thread-avatar", s.avatarWrapperClass(a)])
2704
+ class: I(["wm-hist__thread-avatar", s.avatarWrapperClass(r)])
2705
2705
  }, [
2706
- s.isDefaultAvatar(a) ? (c(), d("span", as, [...t[2] || (t[2] = [
2706
+ s.isDefaultAvatar(r) ? (c(), d("span", as, [...t[2] || (t[2] = [
2707
2707
  o("svg", {
2708
2708
  width: "18",
2709
2709
  height: "18",
@@ -2717,25 +2717,25 @@ function fs(e, t, n, r, i, s) {
2717
2717
  }, [
2718
2718
  o("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" })
2719
2719
  ], -1)
2720
- ])])) : (c(), P(ke(s.avatarComponent(a)), De({
2720
+ ])])) : (c(), P(ke(s.avatarComponent(r)), De({
2721
2721
  key: 1,
2722
2722
  ref_for: !0
2723
- }, s.avatarProps(a)), null, 16)),
2724
- a.unread ? (c(), d("span", {
2723
+ }, s.avatarProps(r)), null, 16)),
2724
+ r.unread ? (c(), d("span", {
2725
2725
  key: 2,
2726
2726
  class: "wm-hist__thread-dot",
2727
2727
  "aria-label": s.t("onboarding.unread")
2728
- }, null, 8, os)) : w("", !0)
2728
+ }, null, 8, os)) : b("", !0)
2729
2729
  ], 2),
2730
2730
  o("span", ls, [
2731
- o("span", cs, v(a.title), 1),
2731
+ o("span", cs, v(r.title), 1),
2732
2732
  o("span", {
2733
2733
  class: "wm-hist__thread-preview",
2734
- innerHTML: s.renderPreview(a.preview)
2734
+ innerHTML: s.renderPreview(r.preview)
2735
2735
  }, null, 8, ds)
2736
2736
  ]),
2737
2737
  o("span", us, [
2738
- s.formatTs(a._ts) ? (c(), d("span", hs, v(s.formatTs(a._ts)), 1)) : w("", !0),
2738
+ s.formatTs(r._ts) ? (c(), d("span", hs, v(s.formatTs(r._ts)), 1)) : b("", !0),
2739
2739
  t[3] || (t[3] = o("svg", {
2740
2740
  width: "14",
2741
2741
  height: "14",
@@ -2752,7 +2752,7 @@ function fs(e, t, n, r, i, s) {
2752
2752
  ], -1))
2753
2753
  ])
2754
2754
  ], 10, is))), 128)),
2755
- s.filteredThreads.length ? w("", !0) : (c(), d("div", ms, v(i.query ? s.t("onboarding.noResults", { query: i.query }) : s.t("onboarding.noConversations")), 1))
2755
+ s.filteredThreads.length ? b("", !0) : (c(), d("div", ms, v(a.query ? s.t("onboarding.noResults", { query: a.query }) : s.t("onboarding.noConversations")), 1))
2756
2756
  ])
2757
2757
  ]);
2758
2758
  }
@@ -2817,7 +2817,7 @@ const ps = {
2817
2817
  "stroke-linecap": "round",
2818
2818
  "stroke-linejoin": "round"
2819
2819
  }, Cs = { class: "wm-result__body" }, As = { class: "wm-result__label" }, Ss = { class: "wm-result__detail" };
2820
- function Ms(e, t, n, r, i, s) {
2820
+ function Ms(e, t, n, i, a, s) {
2821
2821
  return c(), d("div", {
2822
2822
  class: I(["wm-result", `wm-result--${n.state}`])
2823
2823
  }, [
@@ -2857,7 +2857,7 @@ function Ms(e, t, n, r, i, s) {
2857
2857
  "aria-hidden": "true"
2858
2858
  }, " · ", -1)),
2859
2859
  o("span", Ss, v(s.detailText), 1)
2860
- ], 64)) : w("", !0)
2860
+ ], 64)) : b("", !0)
2861
2861
  ])
2862
2862
  ], 2);
2863
2863
  }
@@ -2878,7 +2878,7 @@ const Ts = /* @__PURE__ */ B(ps, [["render", Ms], ["__scopeId", "data-v-7284acd0
2878
2878
  }
2879
2879
  }
2880
2880
  }, Os = { class: "wm-art wm-art--formResponse" }, Is = { class: "wm-art__head" }, Ls = { class: "wm-art__title" }, Es = { class: "wm-art__badge wm-art__badge--success" }, Rs = { class: "wm-art__body" }, Bs = { class: "wm-art__fieldLabel" };
2881
- function Ps(e, t, n, r, i, s) {
2881
+ function Ps(e, t, n, i, a, s) {
2882
2882
  return c(), d("div", Os, [
2883
2883
  o("div", Is, [
2884
2884
  o("div", Ls, v(n.data.title || s.t("form.title")), 1),
@@ -2900,17 +2900,17 @@ function Ps(e, t, n, r, i, s) {
2900
2900
  ])
2901
2901
  ]),
2902
2902
  o("div", Rs, [
2903
- (c(!0), d(L, null, F(s.fields, (a, l) => (c(), d("div", {
2903
+ (c(!0), d(L, null, F(s.fields, (r, l) => (c(), d("div", {
2904
2904
  key: l,
2905
2905
  class: "wm-art__field"
2906
2906
  }, [
2907
- o("div", Bs, v(a.label), 1),
2907
+ o("div", Bs, v(r.label), 1),
2908
2908
  o("div", {
2909
2909
  class: I([
2910
2910
  "wm-art__fieldValue",
2911
- { "wm-art__fieldValue--multi": a.multiline }
2911
+ { "wm-art__fieldValue--multi": r.multiline }
2912
2912
  ])
2913
- }, v(a.value), 3)
2913
+ }, v(r.value), 3)
2914
2914
  ]))), 128))
2915
2915
  ])
2916
2916
  ]);
@@ -2943,7 +2943,7 @@ const Ns = /* @__PURE__ */ B(xs, [["render", Ps], ["__scopeId", "data-v-713aecf1
2943
2943
  key: 0,
2944
2944
  class: "wm-art__text"
2945
2945
  }, Ws = { class: "wm-art__fieldLabel" };
2946
- function Gs(e, t, n, r, i, s) {
2946
+ function Gs(e, t, n, i, a, s) {
2947
2947
  return c(), d("div", Ds, [
2948
2948
  n.data.image_url ? (c(), d("figure", Fs, [
2949
2949
  o("img", {
@@ -2951,11 +2951,11 @@ function Gs(e, t, n, r, i, s) {
2951
2951
  alt: n.data.title || "",
2952
2952
  loading: "lazy"
2953
2953
  }, null, 8, js)
2954
- ])) : w("", !0),
2954
+ ])) : b("", !0),
2955
2955
  o("div", Hs, [
2956
2956
  o("div", zs, [
2957
2957
  o("div", qs, v(n.data.title), 1),
2958
- n.data.subtitle ? (c(), d("div", $s, v(n.data.subtitle), 1)) : w("", !0)
2958
+ n.data.subtitle ? (c(), d("div", $s, v(n.data.subtitle), 1)) : b("", !0)
2959
2959
  ]),
2960
2960
  n.data.badge && n.data.badge.label ? (c(), d("span", {
2961
2961
  key: 0,
@@ -2963,39 +2963,39 @@ function Gs(e, t, n, r, i, s) {
2963
2963
  "wm-art__badge",
2964
2964
  `wm-art__badge--${n.data.badge.tone || "neutral"}`
2965
2965
  ])
2966
- }, v(n.data.badge.label), 3)) : w("", !0)
2966
+ }, v(n.data.badge.label), 3)) : b("", !0)
2967
2967
  ]),
2968
2968
  s.hasBody ? (c(), d("div", Vs, [
2969
- n.data.body ? (c(), d("div", Ks, v(n.data.body), 1)) : w("", !0),
2970
- s.fields.length ? (c(!0), d(L, { key: 1 }, F(s.fields, (a, l) => (c(), d("div", {
2969
+ n.data.body ? (c(), d("div", Ks, v(n.data.body), 1)) : b("", !0),
2970
+ s.fields.length ? (c(!0), d(L, { key: 1 }, F(s.fields, (r, l) => (c(), d("div", {
2971
2971
  key: l,
2972
2972
  class: "wm-art__field"
2973
2973
  }, [
2974
- o("div", Ws, v(a.label), 1),
2974
+ o("div", Ws, v(r.label), 1),
2975
2975
  o("div", {
2976
2976
  class: I([
2977
2977
  "wm-art__fieldValue",
2978
- { "wm-art__fieldValue--multi": a.multiline }
2978
+ { "wm-art__fieldValue--multi": r.multiline }
2979
2979
  ])
2980
- }, v(a.value), 3)
2981
- ]))), 128)) : w("", !0)
2982
- ])) : w("", !0)
2980
+ }, v(r.value), 3)
2981
+ ]))), 128)) : b("", !0)
2982
+ ])) : b("", !0)
2983
2983
  ]);
2984
2984
  }
2985
2985
  const Ys = /* @__PURE__ */ B(Us, [["render", Gs], ["__scopeId", "data-v-7eae0e4a"]]);
2986
2986
  function Xs(e, t, n) {
2987
2987
  if (!e) return "";
2988
- const r = new Date(e);
2989
- if (Number.isNaN(r.getTime())) return e;
2990
- const i = r.toLocaleDateString(t, {
2988
+ const i = new Date(e);
2989
+ if (Number.isNaN(i.getTime())) return e;
2990
+ const a = i.toLocaleDateString(t, {
2991
2991
  day: "numeric",
2992
2992
  month: "long",
2993
2993
  year: "numeric"
2994
- }), s = r.toLocaleTimeString(t, {
2994
+ }), s = i.toLocaleTimeString(t, {
2995
2995
  hour: "2-digit",
2996
2996
  minute: "2-digit"
2997
2997
  });
2998
- return `${i}${n}${s}`;
2998
+ return `${a}${n}${s}`;
2999
2999
  }
3000
3000
  const Js = {
3001
3001
  name: "WmArtifactTicket",
@@ -3065,7 +3065,7 @@ const Js = {
3065
3065
  key: 1,
3066
3066
  class: "wm-art__footer wm-tk__footer"
3067
3067
  };
3068
- function cr(e, t, n, r, i, s) {
3068
+ function cr(e, t, n, i, a, s) {
3069
3069
  return c(), d("div", Qs, [
3070
3070
  o("div", Zs, [
3071
3071
  o("div", er, v(n.data.title), 1),
@@ -3101,24 +3101,24 @@ function cr(e, t, n, r, i, s) {
3101
3101
  Ce(" " + v(n.data.status.label), 1)
3102
3102
  ], 2)
3103
3103
  ]),
3104
- n.data.body ? (c(), d("div", sr, v(n.data.body), 1)) : w("", !0)
3104
+ n.data.body ? (c(), d("div", sr, v(n.data.body), 1)) : b("", !0)
3105
3105
  ]),
3106
3106
  s.fields.length ? (c(), d("div", rr, [
3107
- (c(!0), d(L, null, F(s.fields, (a, l) => (c(), d("div", {
3107
+ (c(!0), d(L, null, F(s.fields, (r, l) => (c(), d("div", {
3108
3108
  key: l,
3109
3109
  class: "wm-art__field"
3110
3110
  }, [
3111
- o("div", ir, v(a.label), 1),
3111
+ o("div", ir, v(r.label), 1),
3112
3112
  o("div", {
3113
3113
  class: I([
3114
3114
  "wm-art__fieldValue",
3115
- { "wm-art__fieldValue--multi": a.multiline }
3115
+ { "wm-art__fieldValue--multi": r.multiline }
3116
3116
  ])
3117
3117
  }, [
3118
- s.isPriority(a.label) ? (c(), d("svg", {
3118
+ s.isPriority(r.label) ? (c(), d("svg", {
3119
3119
  key: 0,
3120
3120
  class: "wm-tk__prio",
3121
- "data-level": s.priorityLevel(a.value),
3121
+ "data-level": s.priorityLevel(r.value),
3122
3122
  width: "12",
3123
3123
  height: "12",
3124
3124
  viewBox: "0 0 12 12",
@@ -3145,7 +3145,7 @@ function cr(e, t, n, r, i, s) {
3145
3145
  height: "9",
3146
3146
  rx: "0.5"
3147
3147
  }, null, -1)
3148
- ])], 8, ar)) : s.isDate(a.label) ? (c(), d("svg", or, [...t[3] || (t[3] = [
3148
+ ])], 8, ar)) : s.isDate(r.label) ? (c(), d("svg", or, [...t[3] || (t[3] = [
3149
3149
  o("rect", {
3150
3150
  x: "3",
3151
3151
  y: "4",
@@ -3154,11 +3154,11 @@ function cr(e, t, n, r, i, s) {
3154
3154
  rx: "2"
3155
3155
  }, null, -1),
3156
3156
  o("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
3157
- ])])) : w("", !0),
3158
- o("span", null, v(a.value), 1)
3157
+ ])])) : b("", !0),
3158
+ o("span", null, v(r.value), 1)
3159
3159
  ], 2)
3160
3160
  ]))), 128))
3161
- ])) : w("", !0),
3161
+ ])) : b("", !0),
3162
3162
  n.data.created_at ? (c(), d("div", lr, [
3163
3163
  t[4] || (t[4] = o("svg", {
3164
3164
  width: "11",
@@ -3181,7 +3181,7 @@ function cr(e, t, n, r, i, s) {
3181
3181
  o("path", { d: "M16 2v4M8 2v4M3 10h18" })
3182
3182
  ], -1)),
3183
3183
  o("span", null, v(s.formattedDate), 1)
3184
- ])) : w("", !0)
3184
+ ])) : b("", !0)
3185
3185
  ]);
3186
3186
  }
3187
3187
  const dr = /* @__PURE__ */ B(Js, [["render", cr], ["__scopeId", "data-v-5f30c914"]]), ur = {
@@ -3203,11 +3203,11 @@ const dr = /* @__PURE__ */ B(Js, [["render", cr], ["__scopeId", "data-v-5f30c914
3203
3203
  }
3204
3204
  }
3205
3205
  };
3206
- function mr(e, t, n, r, i, s) {
3206
+ function mr(e, t, n, i, a, s) {
3207
3207
  return s.component ? (c(), P(ke(s.component), {
3208
3208
  key: 0,
3209
3209
  data: n.artifact.data
3210
- }, null, 8, ["data"])) : w("", !0);
3210
+ }, null, 8, ["data"])) : b("", !0);
3211
3211
  }
3212
3212
  const fr = /* @__PURE__ */ B(hr, [["render", mr]]), _r = {
3213
3213
  name: "WmAttachmentPreview",
@@ -3225,10 +3225,10 @@ const fr = /* @__PURE__ */ B(hr, [["render", mr]]), _r = {
3225
3225
  },
3226
3226
  computed: {
3227
3227
  kind() {
3228
- var n, r;
3228
+ var n, i;
3229
3229
  const e = (n = this.attachment) == null ? void 0 : n.type;
3230
3230
  if (e) return e;
3231
- const t = (((r = this.attachment) == null ? void 0 : r.mime_type) || "").toLowerCase();
3231
+ const t = (((i = this.attachment) == null ? void 0 : i.mime_type) || "").toLowerCase();
3232
3232
  return t.startsWith("image/") ? "image" : t.startsWith("audio/") ? "audio" : t.startsWith("video/") ? "video" : "file";
3233
3233
  },
3234
3234
  displayName() {
@@ -3285,11 +3285,11 @@ const fr = /* @__PURE__ */ B(hr, [["render", mr]]), _r = {
3285
3285
  class: "wm-att__spin",
3286
3286
  "aria-hidden": "true"
3287
3287
  };
3288
- function Sr(e, t, n, r, i, s) {
3288
+ function Sr(e, t, n, i, a, s) {
3289
3289
  return c(), d("div", {
3290
3290
  class: I(["wm-att", ["wm-att--" + (s.kind || "file")]])
3291
3291
  }, [
3292
- s.kind === "image" && i.url ? (c(), d("a", {
3292
+ s.kind === "image" && a.url ? (c(), d("a", {
3293
3293
  key: 0,
3294
3294
  href: s.safeHref,
3295
3295
  target: "_blank",
@@ -3297,18 +3297,18 @@ function Sr(e, t, n, r, i, s) {
3297
3297
  class: "wm-att__imgWrap"
3298
3298
  }, [
3299
3299
  o("img", {
3300
- src: i.url,
3300
+ src: a.url,
3301
3301
  alt: s.displayName,
3302
3302
  loading: "lazy"
3303
3303
  }, null, 8, pr)
3304
- ], 8, gr)) : s.kind === "audio" && i.url ? (c(), d("audio", {
3304
+ ], 8, gr)) : s.kind === "audio" && a.url ? (c(), d("audio", {
3305
3305
  key: 1,
3306
- src: i.url,
3306
+ src: a.url,
3307
3307
  controls: "",
3308
3308
  preload: "metadata"
3309
- }, null, 8, vr)) : s.kind === "video" && i.url ? (c(), d("video", {
3309
+ }, null, 8, vr)) : s.kind === "video" && a.url ? (c(), d("video", {
3310
3310
  key: 2,
3311
- src: i.url,
3311
+ src: a.url,
3312
3312
  controls: "",
3313
3313
  preload: "metadata"
3314
3314
  }, null, 8, yr)) : (c(), d("a", {
@@ -3318,7 +3318,7 @@ function Sr(e, t, n, r, i, s) {
3318
3318
  download: s.displayName,
3319
3319
  target: "_blank",
3320
3320
  rel: "noopener",
3321
- onClick: t[0] || (t[0] = (...a) => s.onFileClick && s.onFileClick(...a))
3321
+ onClick: t[0] || (t[0] = (...r) => s.onFileClick && s.onFileClick(...r))
3322
3322
  }, [
3323
3323
  t[1] || (t[1] = o("span", { class: "wm-att__icon" }, [
3324
3324
  o("svg", {
@@ -3338,9 +3338,9 @@ function Sr(e, t, n, r, i, s) {
3338
3338
  ], -1)),
3339
3339
  o("span", br, [
3340
3340
  o("span", kr, v(s.displayName), 1),
3341
- s.sizeLabel ? (c(), d("span", Cr, v(s.sizeLabel), 1)) : w("", !0)
3341
+ s.sizeLabel ? (c(), d("span", Cr, v(s.sizeLabel), 1)) : b("", !0)
3342
3342
  ]),
3343
- i.loading ? (c(), d("span", Ar)) : w("", !0)
3343
+ a.loading ? (c(), d("span", Ar)) : b("", !0)
3344
3344
  ], 8, wr))
3345
3345
  ], 2);
3346
3346
  }
@@ -3357,7 +3357,7 @@ const Mr = /* @__PURE__ */ B(_r, [["render", Sr], ["__scopeId", "data-v-0c877a62
3357
3357
  }
3358
3358
  }
3359
3359
  }, xr = ["innerHTML"];
3360
- function Or(e, t, n, r, i, s) {
3360
+ function Or(e, t, n, i, a, s) {
3361
3361
  return c(), d("div", {
3362
3362
  class: I(["wm-bubble", "wm-bubble--" + n.role])
3363
3363
  }, [
@@ -3367,7 +3367,7 @@ function Or(e, t, n, r, i, s) {
3367
3367
  ], 2);
3368
3368
  }
3369
3369
  const Ir = /* @__PURE__ */ B(Tr, [["render", Or], ["__scopeId", "data-v-7ab13147"]]), Lr = { name: "WmTyping" }, Er = { class: "wm-typing" };
3370
- function Rr(e, t, n, r, i, s) {
3370
+ function Rr(e, t, n, i, a, s) {
3371
3371
  return c(), d("div", Er, [...t[0] || (t[0] = [
3372
3372
  o("span", { style: { "animation-delay": "0s" } }, null, -1),
3373
3373
  o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
@@ -3463,61 +3463,61 @@ const Pr = {
3463
3463
  return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
3464
3464
  },
3465
3465
  groups() {
3466
- var n, r, i, s;
3466
+ var n, i, a, s;
3467
3467
  const e = [];
3468
- for (const a of this.messages) {
3469
- const l = this.roleOf(a);
3468
+ for (const r of this.messages) {
3469
+ const l = this.roleOf(r);
3470
3470
  if (l === "system") {
3471
- if (((n = a == null ? void 0 : a.payload) == null ? void 0 : n.event) === "action_admin_pending") {
3472
- const b = e[e.length - 1];
3473
- b && b.role === "ai" ? b.messages.push(a) : e.push({
3474
- key: `g-${ee(a)}`,
3471
+ if (((n = r == null ? void 0 : r.payload) == null ? void 0 : n.event) === "action_admin_pending") {
3472
+ const w = e[e.length - 1];
3473
+ w && w.role === "ai" ? w.messages.push(r) : e.push({
3474
+ key: `g-${ee(r)}`,
3475
3475
  role: "ai",
3476
3476
  agentName: "",
3477
3477
  agentAvatarUrl: null,
3478
- messages: [a],
3478
+ messages: [r],
3479
3479
  items: []
3480
3480
  });
3481
3481
  continue;
3482
3482
  }
3483
3483
  e.push({
3484
- key: `sys-${ee(a)}`,
3484
+ key: `sys-${ee(r)}`,
3485
3485
  role: l,
3486
- messages: [a],
3486
+ messages: [r],
3487
3487
  items: [],
3488
- systemLabel: this.systemLabel(a)
3488
+ systemLabel: this.systemLabel(r)
3489
3489
  });
3490
3490
  continue;
3491
3491
  }
3492
3492
  const g = e[e.length - 1];
3493
- g && g.role === l && (l === "ai" || g.agentName === (((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "")) ? g.messages.push(a) : e.push({
3494
- key: `g-${ee(a)}`,
3493
+ g && g.role === l && (l === "ai" || g.agentName === (((i = r == null ? void 0 : r.author) == null ? void 0 : i.name) || "")) ? g.messages.push(r) : e.push({
3494
+ key: `g-${ee(r)}`,
3495
3495
  role: l,
3496
- agentName: ((i = a == null ? void 0 : a.author) == null ? void 0 : i.name) || "",
3497
- agentAvatarUrl: ((s = a == null ? void 0 : a.author) == null ? void 0 : s.avatar_url) || null,
3498
- messages: [a],
3496
+ agentName: ((a = r == null ? void 0 : r.author) == null ? void 0 : a.name) || "",
3497
+ agentAvatarUrl: ((s = r == null ? void 0 : r.author) == null ? void 0 : s.avatar_url) || null,
3498
+ messages: [r],
3499
3499
  items: []
3500
3500
  });
3501
3501
  }
3502
- for (const a of e) {
3503
- if (a.role === "system") continue;
3502
+ for (const r of e) {
3503
+ if (r.role === "system") continue;
3504
3504
  const l = [];
3505
- for (const g of a.messages)
3505
+ for (const g of r.messages)
3506
3506
  for (const k of this.itemsOf(g)) l.push(k);
3507
- a.items = l;
3507
+ r.items = l;
3508
3508
  }
3509
3509
  const t = [];
3510
- for (const a of e) {
3511
- if (a.role !== "system" && !a.items.length) continue;
3510
+ for (const r of e) {
3511
+ if (r.role !== "system" && !r.items.length) continue;
3512
3512
  const l = t[t.length - 1];
3513
- if (l && l.role !== "system" && l.role === a.role && (a.role === "ai" || l.agentName === a.agentName)) {
3514
- l.messages.push(...a.messages), l.items.push(...a.items);
3513
+ if (l && l.role !== "system" && l.role === r.role && (r.role === "ai" || l.agentName === r.agentName)) {
3514
+ l.messages.push(...r.messages), l.items.push(...r.items);
3515
3515
  continue;
3516
3516
  }
3517
- t.push(a);
3517
+ t.push(r);
3518
3518
  }
3519
- for (const a of t)
3520
- a.role !== "system" && (a.key = this.stableGroupKey(a.messages));
3519
+ for (const r of t)
3520
+ r.role !== "system" && (r.key = this.stableGroupKey(r.messages));
3521
3521
  return t;
3522
3522
  },
3523
3523
  // Key of the first non-user group that starts after the unread
@@ -3528,10 +3528,10 @@ const Pr = {
3528
3528
  const e = this.unreadAnchorId, t = this.unreadBoundaryTs;
3529
3529
  for (const n of this.groups) {
3530
3530
  if (n.role === "user" || n.role === "system" || !n.items.length) continue;
3531
- const r = n.messages[0];
3532
- if (!r) continue;
3533
- const i = Y(r.id);
3534
- if (i != null && !(i <= e) && !(t && r.created_at && r.created_at > t))
3531
+ const i = n.messages[0];
3532
+ if (!i) continue;
3533
+ const a = Y(i.id);
3534
+ if (a != null && !(a <= e) && !(t && i.created_at && i.created_at > t))
3535
3535
  return n.key;
3536
3536
  }
3537
3537
  return null;
@@ -3569,17 +3569,17 @@ const Pr = {
3569
3569
  this._groupIdByMsgKey || (this._groupIdByMsgKey = /* @__PURE__ */ new Map(), this._groupIdCounter = 0);
3570
3570
  const t = this._groupIdByMsgKey;
3571
3571
  let n = null;
3572
- for (const r of e) {
3573
- const i = ee(r);
3574
- if (i && t.has(i)) {
3575
- n = t.get(i);
3572
+ for (const i of e) {
3573
+ const a = ee(i);
3574
+ if (a && t.has(a)) {
3575
+ n = t.get(a);
3576
3576
  break;
3577
3577
  }
3578
3578
  }
3579
3579
  n == null && (n = ++this._groupIdCounter);
3580
- for (const r of e) {
3581
- const i = ee(r);
3582
- i && t.set(i, n);
3580
+ for (const i of e) {
3581
+ const a = ee(i);
3582
+ a && t.set(a, n);
3583
3583
  }
3584
3584
  return `g-${n}`;
3585
3585
  },
@@ -3617,31 +3617,31 @@ const Pr = {
3617
3617
  const t = this._lastSeenConvId !== this.conversationId;
3618
3618
  this._lastSeenConvId = this.conversationId;
3619
3619
  const n = this.isAtBottom(e);
3620
- let r = null;
3620
+ let i = null;
3621
3621
  if (!t && !n) {
3622
3622
  const s = this.pickAnchor(e);
3623
3623
  if (s != null && s.rowKey) {
3624
- const a = this.findRowByKey(e, s.rowKey);
3625
- if (a) {
3624
+ const r = this.findRowByKey(e, s.rowKey);
3625
+ if (r) {
3626
3626
  const l = e.getBoundingClientRect().top;
3627
- r = {
3627
+ i = {
3628
3628
  rowKey: s.rowKey,
3629
- relY: a.getBoundingClientRect().top - l
3629
+ relY: r.getBoundingClientRect().top - l
3630
3630
  };
3631
3631
  }
3632
3632
  }
3633
3633
  }
3634
- const i = { forceBottom: t, wasPinned: n, anchor: r };
3635
- this._scrollSnap = i, this.$nextTick(() => {
3636
- if (this._scrollSnap = null, i.forceBottom || i.wasPinned) {
3634
+ const a = { forceBottom: t, wasPinned: n, anchor: i };
3635
+ this._scrollSnap = a, this.$nextTick(() => {
3636
+ if (this._scrollSnap = null, a.forceBottom || a.wasPinned) {
3637
3637
  e.scrollTop = e.scrollHeight;
3638
3638
  return;
3639
3639
  }
3640
- if (!i.anchor) return;
3640
+ if (!a.anchor) return;
3641
3641
  const s = () => {
3642
- const a = i.anchor, l = this.findRowByKey(e, a.rowKey);
3642
+ const r = a.anchor, l = this.findRowByKey(e, r.rowKey);
3643
3643
  if (!l) return;
3644
- const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top - a.relY;
3644
+ const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top - r.relY;
3645
3645
  Math.abs(k) > 0.5 && (e.scrollTop += k);
3646
3646
  };
3647
3647
  s(), requestAnimationFrame(() => {
@@ -3673,11 +3673,11 @@ const Pr = {
3673
3673
  // very-top-of-scroll edge case the same way the old logic did.
3674
3674
  pickAnchor(e) {
3675
3675
  const t = e.getBoundingClientRect().top, n = e.querySelectorAll(".wm-list__row[data-row-key]");
3676
- let r = null;
3677
- for (const i of n)
3678
- if (r || (r = i), i.getBoundingClientRect().bottom >= t)
3679
- return { rowKey: i.dataset.rowKey };
3680
- return r ? { rowKey: r.dataset.rowKey } : null;
3676
+ let i = null;
3677
+ for (const a of n)
3678
+ if (i || (i = a), a.getBoundingClientRect().bottom >= t)
3679
+ return { rowKey: a.dataset.rowKey };
3680
+ return i ? { rowKey: i.dataset.rowKey } : null;
3681
3681
  },
3682
3682
  findRowByKey(e, t) {
3683
3683
  if (!t) return null;
@@ -3687,10 +3687,10 @@ const Pr = {
3687
3687
  );
3688
3688
  },
3689
3689
  roleOf(e) {
3690
- var n, r;
3690
+ var n, i;
3691
3691
  if ((e == null ? void 0 : e.type) === "system" || ((n = e == null ? void 0 : e.payload) == null ? void 0 : n.type) === "system")
3692
3692
  return "system";
3693
- const t = (r = e == null ? void 0 : e.author) == null ? void 0 : r.type;
3693
+ const t = (i = e == null ? void 0 : e.author) == null ? void 0 : i.type;
3694
3694
  return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
3695
3695
  },
3696
3696
  roleLabel(e) {
@@ -3789,9 +3789,9 @@ const Pr = {
3789
3789
  // doit garder son arrondi.
3790
3790
  cornersFor(e, t) {
3791
3791
  var Q, se, re;
3792
- const n = e.items, r = (Q = n[t]) == null ? void 0 : Q.kind, i = (se = n[t - 1]) == null ? void 0 : se.kind, s = (re = n[t + 1]) == null ? void 0 : re.kind, a = e.role === "user", l = 14, g = 4, k = i == null ? void 0 : i.bottom, b = s == null ? void 0 : s.top, x = this.widthByKey[this.rowKeyOf(e, t)], E = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], q = 0.5, M = (W, ie, J) => W != null && x != null ? W + q >= x : ie === J || ie === "card" && J === "bubble";
3792
+ const n = e.items, i = (Q = n[t]) == null ? void 0 : Q.kind, a = (se = n[t - 1]) == null ? void 0 : se.kind, s = (re = n[t + 1]) == null ? void 0 : re.kind, r = e.role === "user", l = 14, g = 4, k = a == null ? void 0 : a.bottom, w = s == null ? void 0 : s.top, x = this.widthByKey[this.rowKeyOf(e, t)], E = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], q = 0.5, M = (W, ie, J) => W != null && x != null ? W + q >= x : ie === J || ie === "card" && J === "bubble";
3793
3793
  let U = l, D = l, N = l, K = l;
3794
- return a ? (k && (D = g), (b || !s) && (N = g), k && M(E, k, r == null ? void 0 : r.top) && (U = g), b && M(A, b, r == null ? void 0 : r.bottom) && (K = g)) : (k && (U = g), (b || !s) && (K = g), k && M(E, k, r == null ? void 0 : r.top) && (D = g), b && M(A, b, r == null ? void 0 : r.bottom) && (N = g)), { tl: U, tr: D, br: N, bl: K };
3794
+ return r ? (k && (D = g), (w || !s) && (N = g), k && M(E, k, i == null ? void 0 : i.top) && (U = g), w && M(A, w, i == null ? void 0 : i.bottom) && (K = g)) : (k && (U = g), (w || !s) && (K = g), k && M(E, k, i == null ? void 0 : i.top) && (D = g), w && M(A, w, i == null ? void 0 : i.bottom) && (N = g)), { tl: U, tr: D, br: N, bl: K };
3795
3795
  },
3796
3796
  // Inline style emitting the four corner CSS variables. Set on
3797
3797
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -3810,8 +3810,8 @@ const Pr = {
3810
3810
  // Clé unique par item de cluster, alignée avec `:key` /
3811
3811
  // `data-row-key` du template. Sert d'index dans `widthByKey`.
3812
3812
  rowKeyOf(e, t) {
3813
- var r;
3814
- const n = (r = e == null ? void 0 : e.items) == null ? void 0 : r[t];
3813
+ var i;
3814
+ const n = (i = e == null ? void 0 : e.items) == null ? void 0 : i[t];
3815
3815
  return n ? `${ee(n.message)}-${n.partKey}` : "";
3816
3816
  },
3817
3817
  // rAF-debouncé : `updated()` peut être appelé en rafale (stream,
@@ -3832,20 +3832,20 @@ const Pr = {
3832
3832
  for (const s of e.querySelectorAll(
3833
3833
  ".wm-list__row[data-row-key]"
3834
3834
  )) {
3835
- const a = s.dataset.rowKey;
3836
- if (!a) continue;
3835
+ const r = s.dataset.rowKey;
3836
+ if (!r) continue;
3837
3837
  const l = s.querySelector(
3838
3838
  ".wm-bubble, .wm-result, .wm-art, .wm-list__body"
3839
3839
  );
3840
3840
  if (!l) continue;
3841
3841
  const g = l.getBoundingClientRect().width;
3842
- g > 0 && (t[a] = g);
3842
+ g > 0 && (t[r] = g);
3843
3843
  }
3844
- const n = this.widthByKey, r = Object.keys(n), i = Object.keys(t);
3845
- if (r.length === i.length) {
3844
+ const n = this.widthByKey, i = Object.keys(n), a = Object.keys(t);
3845
+ if (i.length === a.length) {
3846
3846
  let s = !0;
3847
- for (const a of i)
3848
- if (Math.abs((n[a] ?? 0) - t[a]) > 0.5) {
3847
+ for (const r of a)
3848
+ if (Math.abs((n[r] ?? 0) - t[r]) > 0.5) {
3849
3849
  s = !1;
3850
3850
  break;
3851
3851
  }
@@ -3915,19 +3915,19 @@ const Pr = {
3915
3915
  return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || this.t("common.action");
3916
3916
  },
3917
3917
  actionDetail(e) {
3918
- var n, r, i, s, a, l;
3918
+ var n, i, a, s, r, l;
3919
3919
  const t = e == null ? void 0 : e.payload;
3920
- return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((i = (r = t.success) == null ? void 0 : r.metadata) == null ? void 0 : i.description) || "" : t.state === "rejected" ? ((s = t.rejected) == null ? void 0 : s.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((a = t.failure) == null ? void 0 : a.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
3920
+ return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((a = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : a.description) || "" : t.state === "rejected" ? ((s = t.rejected) == null ? void 0 : s.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((r = t.failure) == null ? void 0 : r.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
3921
3921
  },
3922
3922
  actionArtifact(e) {
3923
- var n, r;
3924
- const t = (r = (n = e == null ? void 0 : e.payload) == null ? void 0 : n.success) == null ? void 0 : r.artifact;
3923
+ var n, i;
3924
+ const t = (i = (n = e == null ? void 0 : e.payload) == null ? void 0 : n.success) == null ? void 0 : i.artifact;
3925
3925
  return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
3926
3926
  },
3927
3927
  systemLabel(e) {
3928
- var i, s, a;
3929
- const t = (i = e == null ? void 0 : e.payload) == null ? void 0 : i.event, n = Pr[t], r = ((s = e == null ? void 0 : e.metadata) == null ? void 0 : s.agent_name) || ((a = e == null ? void 0 : e.author) == null ? void 0 : a.name) || this.t("messageList.anAgent");
3930
- return n ? this.t(n, { name: r }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
3928
+ var a, s, r;
3929
+ const t = (a = e == null ? void 0 : e.payload) == null ? void 0 : a.event, n = Pr[t], i = ((s = e == null ? void 0 : e.metadata) == null ? void 0 : s.agent_name) || ((r = e == null ? void 0 : e.author) == null ? void 0 : r.name) || this.t("messageList.anAgent");
3930
+ return n ? this.t(n, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
3931
3931
  },
3932
3932
  scrollToBottom() {
3933
3933
  const e = this.$refs.scrollEl;
@@ -3974,12 +3974,12 @@ const Pr = {
3974
3974
  key: 3,
3975
3975
  class: "wm-list__row wm-list__row--ai fade-up"
3976
3976
  }, ii = { class: "wm-list__avatarSlot" }, ai = ["aria-label", "title"];
3977
- function oi(e, t, n, r, i, s) {
3978
- const a = R("AIAvatar"), l = R("HumanAvatar"), g = R("ActionResult"), k = R("ArtifactRenderer"), b = R("Bubble"), x = R("AttachmentPreview"), E = R("Typing");
3977
+ function oi(e, t, n, i, a, s) {
3978
+ const r = R("AIAvatar"), l = R("HumanAvatar"), g = R("ActionResult"), k = R("ArtifactRenderer"), w = R("Bubble"), x = R("AttachmentPreview"), E = R("Typing");
3979
3979
  return c(), d("div", Fr, [
3980
3980
  o("div", {
3981
3981
  ref: "scrollEl",
3982
- class: I(["wm-list", { "wm-list--silent": i.silentFades }]),
3982
+ class: I(["wm-list", { "wm-list--silent": a.silentFades }]),
3983
3983
  onScrollPassive: t[4] || (t[4] = (...A) => s.onScroll && s.onScroll(...A))
3984
3984
  }, [
3985
3985
  n.loadingMore ? (c(), d("div", jr, [
@@ -3988,12 +3988,12 @@ function oi(e, t, n, r, i, s) {
3988
3988
  "aria-hidden": "true"
3989
3989
  }, null, -1)),
3990
3990
  o("span", Hr, v(s.t("messageList.loadingHistory")), 1)
3991
- ])) : s.historyExhausted ? (c(), d("div", zr, v(s.t("messageList.conversationStart")), 1)) : w("", !0),
3991
+ ])) : s.historyExhausted ? (c(), d("div", zr, v(s.t("messageList.conversationStart")), 1)) : b("", !0),
3992
3992
  n.dateLabel ? (c(), d("div", qr, [
3993
3993
  t[7] || (t[7] = o("div", { class: "wm-list__line" }, null, -1)),
3994
3994
  o("span", $r, v(n.dateLabel), 1),
3995
3995
  t[8] || (t[8] = o("div", { class: "wm-list__line" }, null, -1))
3996
- ])) : w("", !0),
3996
+ ])) : b("", !0),
3997
3997
  (c(!0), d(L, null, F(s.groups, (A, q) => (c(), d(L, {
3998
3998
  key: A.key
3999
3999
  }, [
@@ -4001,7 +4001,7 @@ function oi(e, t, n, r, i, s) {
4001
4001
  t[9] || (t[9] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)),
4002
4002
  o("span", Kr, v(s.t("messageList.unread")), 1),
4003
4003
  t[10] || (t[10] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1))
4004
- ])) : w("", !0),
4004
+ ])) : b("", !0),
4005
4005
  A.role === "system" || A.items.length ? (c(), d("div", {
4006
4006
  key: 1,
4007
4007
  class: I(["wm-list__group", "wm-list__group--" + A.role])
@@ -4033,7 +4033,7 @@ function oi(e, t, n, r, i, s) {
4033
4033
  }, [
4034
4034
  A.role !== "user" ? (c(), d("div", Xr, [
4035
4035
  U === A.items.length - 1 ? (c(), d(L, { key: 0 }, [
4036
- A.role === "ai" ? (c(), P(a, {
4036
+ A.role === "ai" ? (c(), P(r, {
4037
4037
  key: 0,
4038
4038
  size: 26,
4039
4039
  tail: !0,
@@ -4046,8 +4046,8 @@ function oi(e, t, n, r, i, s) {
4046
4046
  size: 26,
4047
4047
  tail: !0
4048
4048
  }, null, 8, ["name", "avatar-url"]))
4049
- ], 64)) : w("", !0)
4050
- ])) : w("", !0),
4049
+ ], 64)) : b("", !0)
4050
+ ])) : b("", !0),
4051
4051
  M.renderAs === "action" ? (c(), P(g, {
4052
4052
  key: 1,
4053
4053
  state: M.message.payload.state,
@@ -4065,11 +4065,11 @@ function oi(e, t, n, r, i, s) {
4065
4065
  key: 4,
4066
4066
  artifact: s.artifactOf(M.message)
4067
4067
  }, null, 8, ["artifact"])) : (c(), d("div", Jr, [
4068
- M.message.text_md ? (c(), P(b, {
4068
+ M.message.text_md ? (c(), P(w, {
4069
4069
  key: 0,
4070
4070
  role: A.role,
4071
4071
  text: M.message.text_md
4072
- }, null, 8, ["role", "text"])) : w("", !0),
4072
+ }, null, 8, ["role", "text"])) : b("", !0),
4073
4073
  s.attachmentsOf(M.message).length ? (c(), d("div", {
4074
4074
  key: 1,
4075
4075
  class: I(["wm-list__atts", {
@@ -4082,32 +4082,32 @@ function oi(e, t, n, r, i, s) {
4082
4082
  key: `${s.messageKey(M.message)}-att-${N}`,
4083
4083
  attachment: D
4084
4084
  }, null, 8, ["attachment"]))), 128))
4085
- ], 2)) : w("", !0)
4085
+ ], 2)) : b("", !0)
4086
4086
  ]))
4087
4087
  ], 46, Yr),
4088
- U < A.items.length - 1 && i.pressedItemKey === `${s.messageKey(M.message)}-${M.partKey}` && (A.role !== "user" || s.timeOf(M.message)) ? (c(), d("div", {
4088
+ U < A.items.length - 1 && a.pressedItemKey === `${s.messageKey(M.message)}-${M.partKey}` && (A.role !== "user" || s.timeOf(M.message)) ? (c(), d("div", {
4089
4089
  key: 0,
4090
4090
  class: I(["wm-list__meta wm-list__meta--press", { "wm-list__meta--right": A.role === "user" }])
4091
4091
  }, [
4092
- A.role !== "user" ? (c(), d("span", Qr, v(s.roleLabel(A)), 1)) : w("", !0),
4093
- A.role !== "user" && s.timeOf(M.message) ? (c(), d("span", Zr, "•")) : w("", !0),
4094
- s.timeOf(M.message) ? (c(), d("span", ei, v(s.timeOf(M.message)), 1)) : w("", !0)
4095
- ], 2)) : w("", !0)
4092
+ A.role !== "user" ? (c(), d("span", Qr, v(s.roleLabel(A)), 1)) : b("", !0),
4093
+ A.role !== "user" && s.timeOf(M.message) ? (c(), d("span", Zr, "•")) : b("", !0),
4094
+ s.timeOf(M.message) ? (c(), d("span", ei, v(s.timeOf(M.message)), 1)) : b("", !0)
4095
+ ], 2)) : b("", !0)
4096
4096
  ], 64))), 128)),
4097
4097
  (A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (c(), d("div", {
4098
4098
  key: 0,
4099
4099
  class: I(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
4100
4100
  }, [
4101
- A.role !== "user" ? (c(), d("span", ti, v(s.roleLabel(A)), 1)) : w("", !0),
4102
- A.role !== "user" && s.lastTimeOf(A) ? (c(), d("span", ni, "•")) : w("", !0),
4103
- s.lastTimeOf(A) ? (c(), d("span", si, v(s.lastTimeOf(A)), 1)) : w("", !0)
4104
- ], 2)) : w("", !0)
4101
+ A.role !== "user" ? (c(), d("span", ti, v(s.roleLabel(A)), 1)) : b("", !0),
4102
+ A.role !== "user" && s.lastTimeOf(A) ? (c(), d("span", ni, "•")) : b("", !0),
4103
+ s.lastTimeOf(A) ? (c(), d("span", si, v(s.lastTimeOf(A)), 1)) : b("", !0)
4104
+ ], 2)) : b("", !0)
4105
4105
  ], 64))
4106
- ], 2)) : w("", !0)
4106
+ ], 2)) : b("", !0)
4107
4107
  ], 64))), 128)),
4108
4108
  n.streamingActive ? (c(), d("div", ri, [
4109
4109
  o("div", ii, [
4110
- V(a, {
4110
+ V(r, {
4111
4111
  size: 26,
4112
4112
  tail: !0,
4113
4113
  name: n.aiAgentName,
@@ -4115,11 +4115,11 @@ function oi(e, t, n, r, i, s) {
4115
4115
  }, null, 8, ["name", "image-url"])
4116
4116
  ]),
4117
4117
  V(E)
4118
- ])) : w("", !0)
4118
+ ])) : b("", !0)
4119
4119
  ], 34),
4120
4120
  V(Ne, { name: "wm-scrollDown" }, {
4121
4121
  default: Ue(() => [
4122
- i.showScrollDown ? (c(), d("button", {
4122
+ a.showScrollDown ? (c(), d("button", {
4123
4123
  key: 0,
4124
4124
  type: "button",
4125
4125
  class: "wm-list__scrollDown",
@@ -4140,7 +4140,7 @@ function oi(e, t, n, r, i, s) {
4140
4140
  }, [
4141
4141
  o("path", { d: "M6 9l6 6 6-6" })
4142
4142
  ], -1)
4143
- ])], 8, ai)) : w("", !0)
4143
+ ])], 8, ai)) : b("", !0)
4144
4144
  ]),
4145
4145
  _: 1
4146
4146
  })
@@ -4154,8 +4154,8 @@ function ci() {
4154
4154
  "video/webm",
4155
4155
  "video/mp4"
4156
4156
  ].find((t) => {
4157
- var n, r;
4158
- return (r = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : r.call(n, t);
4157
+ var n, i;
4158
+ return (i = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : i.call(n, t);
4159
4159
  }) || "";
4160
4160
  }
4161
4161
  function ze({ audio: e }) {
@@ -4193,15 +4193,15 @@ async function di() {
4193
4193
  async function ui(e) {
4194
4194
  const t = document.createElement("video");
4195
4195
  t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
4196
- const n = t.videoWidth || 1280, r = t.videoHeight || 720, i = document.createElement("canvas");
4197
- i.width = n, i.height = r, i.getContext("2d").drawImage(t, 0, 0, n, r);
4196
+ const n = t.videoWidth || 1280, i = t.videoHeight || 720, a = document.createElement("canvas");
4197
+ a.width = n, a.height = i, a.getContext("2d").drawImage(t, 0, 0, n, i);
4198
4198
  const s = await new Promise((l, g) => {
4199
- i.toBlob(
4199
+ a.toBlob(
4200
4200
  (k) => k ? l(k) : g(new Error("toBlob failed")),
4201
4201
  "image/png"
4202
4202
  );
4203
- }), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
4204
- return new File([s], `capture-${a}.png`, { type: "image/png" });
4203
+ }), r = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
4204
+ return new File([s], `capture-${r}.png`, { type: "image/png" });
4205
4205
  }
4206
4206
  async function hi(e = {}) {
4207
4207
  var k;
@@ -4211,60 +4211,60 @@ async function hi(e = {}) {
4211
4211
  t = await navigator.mediaDevices.getDisplayMedia(
4212
4212
  ze({ audio: !0 })
4213
4213
  );
4214
- } catch (b) {
4215
- return (b == null ? void 0 : b.name) !== "NotAllowedError" && console.error("[media] record picker", b), null;
4214
+ } catch (w) {
4215
+ return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
4216
4216
  }
4217
4217
  const n = ci();
4218
- let r;
4218
+ let i;
4219
4219
  try {
4220
- r = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
4221
- } catch (b) {
4222
- return console.error("[media] recorder init", b), t.getTracks().forEach((x) => {
4220
+ i = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
4221
+ } catch (w) {
4222
+ return console.error("[media] recorder init", w), t.getTracks().forEach((x) => {
4223
4223
  x.stop();
4224
4224
  }), null;
4225
4225
  }
4226
- const i = [];
4227
- let s = null, a = !1;
4228
- r.addEventListener("dataavailable", (b) => {
4229
- b.data && b.data.size > 0 && i.push(b.data);
4230
- }), r.addEventListener("stop", () => {
4231
- var b, x;
4226
+ const a = [];
4227
+ let s = null, r = !1;
4228
+ i.addEventListener("dataavailable", (w) => {
4229
+ w.data && w.data.size > 0 && a.push(w.data);
4230
+ }), i.addEventListener("stop", () => {
4231
+ var w, x;
4232
4232
  if (s && clearInterval(s), t.getTracks().forEach((E) => {
4233
4233
  E.stop();
4234
- }), i.length) {
4235
- const E = r.mimeType || n || "video/webm", A = new Blob(i, { type: E }), q = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), U = new File([A], `ecran-${M}.${q}`, {
4234
+ }), a.length) {
4235
+ const E = i.mimeType || n || "video/webm", A = new Blob(a, { type: E }), q = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), U = new File([A], `ecran-${M}.${q}`, {
4236
4236
  type: E
4237
4237
  });
4238
- (b = e.onfinalize) == null || b.call(e, U);
4238
+ (w = e.onfinalize) == null || w.call(e, U);
4239
4239
  } else
4240
4240
  (x = e.oncancel) == null || x.call(e);
4241
- }), t.getVideoTracks().forEach((b) => {
4242
- b.addEventListener("ended", () => l(), { once: !0 });
4241
+ }), t.getVideoTracks().forEach((w) => {
4242
+ w.addEventListener("ended", () => l(), { once: !0 });
4243
4243
  });
4244
4244
  function l() {
4245
- if (!a && (a = !0, r.state !== "inactive"))
4245
+ if (!r && (r = !0, i.state !== "inactive"))
4246
4246
  try {
4247
- r.stop();
4248
- } catch (b) {
4249
- console.error("[media] recorder stop", b);
4247
+ i.stop();
4248
+ } catch (w) {
4249
+ console.error("[media] recorder stop", w);
4250
4250
  }
4251
4251
  }
4252
4252
  try {
4253
- r.start(1e3);
4254
- } catch (b) {
4255
- return console.error("[media] recorder start", b), t.getTracks().forEach((x) => {
4253
+ i.start(1e3);
4254
+ } catch (w) {
4255
+ return console.error("[media] recorder start", w), t.getTracks().forEach((x) => {
4256
4256
  x.stop();
4257
4257
  }), null;
4258
4258
  }
4259
4259
  (k = e.onstart) == null || k.call(e);
4260
4260
  const g = Date.now();
4261
4261
  return s = setInterval(() => {
4262
- var b;
4263
- (b = e.ontick) == null || b.call(e, Date.now() - g);
4262
+ var w;
4263
+ (w = e.ontick) == null || w.call(e, Date.now() - g);
4264
4264
  }, 500), {
4265
4265
  stop: l,
4266
4266
  get state() {
4267
- return r.state;
4267
+ return i.state;
4268
4268
  }
4269
4269
  };
4270
4270
  }
@@ -4453,12 +4453,12 @@ const mi = [
4453
4453
  height: "14",
4454
4454
  "aria-hidden": "true"
4455
4455
  }, bi = ["d"], ki = ["placeholder", "disabled"], Ci = { class: "wm-compose__actions" }, Ai = ["title", "aria-label", "disabled"], Si = ["disabled", "aria-label"];
4456
- function Mi(e, t, n, r, i, s) {
4456
+ function Mi(e, t, n, i, a, s) {
4457
4457
  return c(), d("div", {
4458
4458
  class: I(["wm-compose-wrap", { "wm-compose-wrap--sheet": n.displayMode === "sheet" }]),
4459
- style: z(i.kbOffset ? { transform: `translateY(-${i.kbOffset}px)` } : null)
4459
+ style: z(a.kbOffset ? { transform: `translateY(-${a.kbOffset}px)` } : null)
4460
4460
  }, [
4461
- i.recording ? (c(), d("div", _i, [
4461
+ a.recording ? (c(), d("div", _i, [
4462
4462
  t[8] || (t[8] = o("span", {
4463
4463
  class: "wm-rec__dot",
4464
4464
  "aria-hidden": "true"
@@ -4467,37 +4467,37 @@ function Mi(e, t, n, r, i, s) {
4467
4467
  o("button", {
4468
4468
  type: "button",
4469
4469
  class: "wm-rec__stop",
4470
- onClick: t[0] || (t[0] = (...a) => s.stopRecording && s.stopRecording(...a))
4470
+ onClick: t[0] || (t[0] = (...r) => s.stopRecording && s.stopRecording(...r))
4471
4471
  }, v(s.t("composer.stop")), 1)
4472
- ])) : w("", !0),
4472
+ ])) : b("", !0),
4473
4473
  o("form", {
4474
- class: I(["wm-compose", { "has-attach": i.attachOpen }]),
4475
- onSubmit: t[7] || (t[7] = X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
4474
+ class: I(["wm-compose", { "has-attach": a.attachOpen }]),
4475
+ onSubmit: t[7] || (t[7] = X((...r) => s.onSubmit && s.onSubmit(...r), ["prevent"]))
4476
4476
  }, [
4477
4477
  o("input", {
4478
4478
  ref: "fileEl",
4479
4479
  type: "file",
4480
4480
  hidden: "",
4481
4481
  multiple: "",
4482
- onChange: t[1] || (t[1] = (...a) => s.onFile && s.onFile(...a))
4482
+ onChange: t[1] || (t[1] = (...r) => s.onFile && s.onFile(...r))
4483
4483
  }, null, 544),
4484
- i.attachOpen ? (c(), d("div", {
4484
+ a.attachOpen ? (c(), d("div", {
4485
4485
  key: 0,
4486
4486
  class: "wm-compose__overlay",
4487
- onClick: t[2] || (t[2] = (a) => i.attachOpen = !1)
4488
- })) : w("", !0),
4489
- i.attachOpen ? (c(), d("div", pi, [
4490
- (c(!0), d(L, null, F(s.attachItems, (a) => (c(), d("button", {
4491
- key: a.action,
4487
+ onClick: t[2] || (t[2] = (r) => a.attachOpen = !1)
4488
+ })) : b("", !0),
4489
+ a.attachOpen ? (c(), d("div", pi, [
4490
+ (c(!0), d(L, null, F(s.attachItems, (r) => (c(), d("button", {
4491
+ key: r.action,
4492
4492
  type: "button",
4493
4493
  class: "wm-compose__menuItem",
4494
- disabled: a.disabled,
4495
- onClick: (l) => s.onAttachAction(a.action)
4494
+ disabled: r.disabled,
4495
+ onClick: (l) => s.onAttachAction(r.action)
4496
4496
  }, [
4497
4497
  o("span", yi, [
4498
4498
  (c(), d("svg", wi, [
4499
4499
  o("path", {
4500
- d: a.path,
4500
+ d: r.path,
4501
4501
  stroke: "currentColor",
4502
4502
  "stroke-width": "1.8",
4503
4503
  "stroke-linecap": "round",
@@ -4506,29 +4506,29 @@ function Mi(e, t, n, r, i, s) {
4506
4506
  }, null, 8, bi)
4507
4507
  ]))
4508
4508
  ]),
4509
- o("span", null, v(a.label), 1)
4509
+ o("span", null, v(r.label), 1)
4510
4510
  ], 8, vi))), 128))
4511
- ])) : w("", !0),
4511
+ ])) : b("", !0),
4512
4512
  G(o("textarea", {
4513
4513
  ref: "inputEl",
4514
- "onUpdate:modelValue": t[3] || (t[3] = (a) => i.local = a),
4514
+ "onUpdate:modelValue": t[3] || (t[3] = (r) => a.local = r),
4515
4515
  class: "wm-compose__input",
4516
4516
  rows: "3",
4517
4517
  placeholder: n.placeholder,
4518
4518
  disabled: n.disabled,
4519
- onKeydown: t[4] || (t[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
4520
- onInput: t[5] || (t[5] = (...a) => s.autosize && s.autosize(...a))
4519
+ onKeydown: t[4] || (t[4] = (...r) => s.onKeydown && s.onKeydown(...r)),
4520
+ onInput: t[5] || (t[5] = (...r) => s.autosize && s.autosize(...r))
4521
4521
  }, null, 40, ki), [
4522
- [te, i.local]
4522
+ [te, a.local]
4523
4523
  ]),
4524
4524
  o("div", Ci, [
4525
4525
  o("button", {
4526
4526
  type: "button",
4527
- class: I(["wm-compose__icon", { "is-open": i.attachOpen }]),
4527
+ class: I(["wm-compose__icon", { "is-open": a.attachOpen }]),
4528
4528
  title: n.attachLabel,
4529
4529
  "aria-label": n.attachLabel,
4530
- disabled: i.recording,
4531
- onClick: t[6] || (t[6] = (a) => i.attachOpen = !i.attachOpen)
4530
+ disabled: a.recording,
4531
+ onClick: t[6] || (t[6] = (r) => a.attachOpen = !a.attachOpen)
4532
4532
  }, [...t[9] || (t[9] = [
4533
4533
  o("svg", {
4534
4534
  width: "13",
@@ -4586,19 +4586,19 @@ const Ti = /* @__PURE__ */ B(fi, [["render", Mi], ["__scopeId", "data-v-01e81a27
4586
4586
  }
4587
4587
  }
4588
4588
  }, Oi = ["onClick"];
4589
- function Ii(e, t, n, r, i, s) {
4589
+ function Ii(e, t, n, i, a, s) {
4590
4590
  return n.items.length ? (c(), d("div", {
4591
4591
  key: s.batchKey,
4592
4592
  class: "wm-chips"
4593
4593
  }, [
4594
- (c(!0), d(L, null, F(n.items, (a, l) => (c(), d("button", {
4594
+ (c(!0), d(L, null, F(n.items, (r, l) => (c(), d("button", {
4595
4595
  key: l,
4596
4596
  type: "button",
4597
4597
  class: "wm-chip",
4598
4598
  style: z({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
4599
- onClick: (g) => e.$emit("select", a)
4600
- }, v(a.label), 13, Oi))), 128))
4601
- ])) : w("", !0);
4599
+ onClick: (g) => e.$emit("select", r)
4600
+ }, v(r.label), 13, Oi))), 128))
4601
+ ])) : b("", !0);
4602
4602
  }
4603
4603
  const Li = /* @__PURE__ */ B(xi, [["render", Ii], ["__scopeId", "data-v-47ad8085"]]), Ei = {
4604
4604
  name: "WmApprovalCard",
@@ -4648,12 +4648,12 @@ const Li = /* @__PURE__ */ B(xi, [["render", Ii], ["__scopeId", "data-v-47ad8085
4648
4648
  key: 0,
4649
4649
  class: "wm-approval__detail"
4650
4650
  }, Fi = { class: "wm-approval__actions" };
4651
- function ji(e, t, n, r, i, s) {
4652
- const a = R("AIAvatar");
4651
+ function ji(e, t, n, i, a, s) {
4652
+ const r = R("AIAvatar");
4653
4653
  return c(), d("div", Ri, [
4654
4654
  o("div", Bi, [
4655
4655
  o("div", Pi, [
4656
- V(a, {
4656
+ V(r, {
4657
4657
  size: 24,
4658
4658
  name: n.agentName,
4659
4659
  "image-url": n.agentAvatarUrl
@@ -4661,7 +4661,7 @@ function ji(e, t, n, r, i, s) {
4661
4661
  ]),
4662
4662
  o("div", Ni, [
4663
4663
  o("div", Ui, v(n.action), 1),
4664
- n.detail ? (c(), d("div", Di, v(n.detail), 1)) : w("", !0)
4664
+ n.detail ? (c(), d("div", Di, v(n.detail), 1)) : b("", !0)
4665
4665
  ])
4666
4666
  ]),
4667
4667
  o("div", Fi, [
@@ -4670,13 +4670,13 @@ function ji(e, t, n, r, i, s) {
4670
4670
  type: "button",
4671
4671
  class: "wm-approval__btn wm-approval__btn--neutral",
4672
4672
  onClick: t[0] || (t[0] = (l) => e.$emit("callback", s.rejectId))
4673
- }, v(s.rejectLabel), 1)) : w("", !0),
4673
+ }, v(s.rejectLabel), 1)) : b("", !0),
4674
4674
  s.approveId ? (c(), d("button", {
4675
4675
  key: 1,
4676
4676
  type: "button",
4677
4677
  class: "wm-approval__btn wm-approval__btn--primary",
4678
4678
  onClick: t[1] || (t[1] = (l) => e.$emit("callback", s.approveId))
4679
- }, v(s.approveLabel), 1)) : w("", !0)
4679
+ }, v(s.approveLabel), 1)) : b("", !0)
4680
4680
  ])
4681
4681
  ]);
4682
4682
  }
@@ -4739,8 +4739,8 @@ const zi = /* @__PURE__ */ new Set([
4739
4739
  this.values = t, this.error = "";
4740
4740
  },
4741
4741
  toggleMulti(e, t, n) {
4742
- const r = Array.isArray(this.values[e]) ? this.values[e].slice() : [], i = r.indexOf(t);
4743
- n && i === -1 ? r.push(t) : !n && i !== -1 && r.splice(i, 1), this.values = { ...this.values, [e]: r };
4742
+ const i = Array.isArray(this.values[e]) ? this.values[e].slice() : [], a = i.indexOf(t);
4743
+ n && a === -1 ? i.push(t) : !n && a !== -1 && i.splice(a, 1), this.values = { ...this.values, [e]: i };
4744
4744
  },
4745
4745
  validate() {
4746
4746
  for (const e of this.normalizedFields) {
@@ -4800,12 +4800,12 @@ const zi = /* @__PURE__ */ new Set([
4800
4800
  key: 2,
4801
4801
  class: "wm-form__doneLbl"
4802
4802
  };
4803
- function ma(e, t, n, r, i, s) {
4804
- const a = R("AIAvatar");
4803
+ function ma(e, t, n, i, a, s) {
4804
+ const r = R("AIAvatar");
4805
4805
  return c(), d("div", $i, [
4806
4806
  o("div", Vi, [
4807
4807
  o("div", Ki, [
4808
- V(a, {
4808
+ V(r, {
4809
4809
  size: 24,
4810
4810
  name: n.agentName,
4811
4811
  "image-url": n.agentAvatarUrl
@@ -4813,7 +4813,7 @@ function ma(e, t, n, r, i, s) {
4813
4813
  ]),
4814
4814
  o("div", Wi, [
4815
4815
  o("div", Gi, v(n.form.title || s.t("form.title")), 1),
4816
- n.form.description ? (c(), d("div", Yi, v(n.form.description), 1)) : w("", !0)
4816
+ n.form.description ? (c(), d("div", Yi, v(n.form.description), 1)) : b("", !0)
4817
4817
  ])
4818
4818
  ]),
4819
4819
  o("form", {
@@ -4825,77 +4825,77 @@ function ma(e, t, n, r, i, s) {
4825
4825
  class: "wm-form__field"
4826
4826
  }, [
4827
4827
  o("label", {
4828
- for: `wm-f-${i._uid}-${l.key}`,
4828
+ for: `wm-f-${a._uid}-${l.key}`,
4829
4829
  class: "wm-form__label"
4830
4830
  }, [
4831
4831
  Ce(v(l.label), 1),
4832
- l.required ? (c(), d("span", Ji, "*")) : w("", !0)
4832
+ l.required ? (c(), d("span", Ji, "*")) : b("", !0)
4833
4833
  ], 8, Xi),
4834
4834
  l.type === "text" ? G((c(), d("input", {
4835
4835
  key: 0,
4836
- id: `wm-f-${i._uid}-${l.key}`,
4837
- "onUpdate:modelValue": (g) => i.values[l.key] = g,
4836
+ id: `wm-f-${a._uid}-${l.key}`,
4837
+ "onUpdate:modelValue": (g) => a.values[l.key] = g,
4838
4838
  type: "text",
4839
4839
  class: "wm-form__input",
4840
4840
  placeholder: l.placeholder || "",
4841
4841
  required: l.required,
4842
- disabled: n.readOnly || i.busy
4842
+ disabled: n.readOnly || a.busy
4843
4843
  }, null, 8, Qi)), [
4844
- [te, i.values[l.key]]
4844
+ [te, a.values[l.key]]
4845
4845
  ]) : l.type === "textarea" ? G((c(), d("textarea", {
4846
4846
  key: 1,
4847
- id: `wm-f-${i._uid}-${l.key}`,
4848
- "onUpdate:modelValue": (g) => i.values[l.key] = g,
4847
+ id: `wm-f-${a._uid}-${l.key}`,
4848
+ "onUpdate:modelValue": (g) => a.values[l.key] = g,
4849
4849
  class: "wm-form__textarea",
4850
4850
  rows: "3",
4851
4851
  placeholder: l.placeholder || "",
4852
4852
  required: l.required,
4853
- disabled: n.readOnly || i.busy
4853
+ disabled: n.readOnly || a.busy
4854
4854
  }, null, 8, Zi)), [
4855
- [te, i.values[l.key]]
4855
+ [te, a.values[l.key]]
4856
4856
  ]) : l.type === "number" ? G((c(), d("input", {
4857
4857
  key: 2,
4858
- id: `wm-f-${i._uid}-${l.key}`,
4859
- "onUpdate:modelValue": (g) => i.values[l.key] = g,
4858
+ id: `wm-f-${a._uid}-${l.key}`,
4859
+ "onUpdate:modelValue": (g) => a.values[l.key] = g,
4860
4860
  type: "number",
4861
4861
  class: "wm-form__input",
4862
4862
  placeholder: l.placeholder || "",
4863
4863
  required: l.required,
4864
- disabled: n.readOnly || i.busy
4864
+ disabled: n.readOnly || a.busy
4865
4865
  }, null, 8, ea)), [
4866
4866
  [
4867
4867
  te,
4868
- i.values[l.key],
4868
+ a.values[l.key],
4869
4869
  void 0,
4870
4870
  { number: !0 }
4871
4871
  ]
4872
4872
  ]) : l.type === "date" ? G((c(), d("input", {
4873
4873
  key: 3,
4874
- id: `wm-f-${i._uid}-${l.key}`,
4875
- "onUpdate:modelValue": (g) => i.values[l.key] = g,
4874
+ id: `wm-f-${a._uid}-${l.key}`,
4875
+ "onUpdate:modelValue": (g) => a.values[l.key] = g,
4876
4876
  type: "date",
4877
4877
  class: "wm-form__input",
4878
4878
  required: l.required,
4879
- disabled: n.readOnly || i.busy
4879
+ disabled: n.readOnly || a.busy
4880
4880
  }, null, 8, ta)), [
4881
- [te, i.values[l.key]]
4881
+ [te, a.values[l.key]]
4882
4882
  ]) : l.type === "boolean" ? (c(), d("label", na, [
4883
4883
  G(o("input", {
4884
- id: `wm-f-${i._uid}-${l.key}`,
4885
- "onUpdate:modelValue": (g) => i.values[l.key] = g,
4884
+ id: `wm-f-${a._uid}-${l.key}`,
4885
+ "onUpdate:modelValue": (g) => a.values[l.key] = g,
4886
4886
  type: "checkbox",
4887
- disabled: n.readOnly || i.busy
4887
+ disabled: n.readOnly || a.busy
4888
4888
  }, null, 8, sa), [
4889
- [Ve, i.values[l.key]]
4889
+ [Ve, a.values[l.key]]
4890
4890
  ]),
4891
4891
  o("span", null, v(l.placeholder || s.t("common.yes")), 1)
4892
4892
  ])) : l.type === "select" ? G((c(), d("select", {
4893
4893
  key: 5,
4894
- id: `wm-f-${i._uid}-${l.key}`,
4895
- "onUpdate:modelValue": (g) => i.values[l.key] = g,
4894
+ id: `wm-f-${a._uid}-${l.key}`,
4895
+ "onUpdate:modelValue": (g) => a.values[l.key] = g,
4896
4896
  class: "wm-form__select",
4897
4897
  required: l.required,
4898
- disabled: n.readOnly || i.busy
4898
+ disabled: n.readOnly || a.busy
4899
4899
  }, [
4900
4900
  o("option", ia, v(l.placeholder || s.t("form.choose")), 1),
4901
4901
  (c(!0), d(L, null, F(l.options, (g) => (c(), d("option", {
@@ -4903,7 +4903,7 @@ function ma(e, t, n, r, i, s) {
4903
4903
  value: g.value
4904
4904
  }, v(g.label), 9, aa))), 128))
4905
4905
  ], 8, ra)), [
4906
- [Ke, i.values[l.key]]
4906
+ [Ke, a.values[l.key]]
4907
4907
  ]) : l.type === "multiselect" ? (c(), d("div", oa, [
4908
4908
  (c(!0), d(L, null, F(l.options, (g) => (c(), d("label", {
4909
4909
  key: g.value,
@@ -4912,8 +4912,8 @@ function ma(e, t, n, r, i, s) {
4912
4912
  o("input", {
4913
4913
  type: "checkbox",
4914
4914
  value: g.value,
4915
- checked: Array.isArray(i.values[l.key]) && i.values[l.key].includes(g.value),
4916
- disabled: n.readOnly || i.busy,
4915
+ checked: Array.isArray(a.values[l.key]) && a.values[l.key].includes(g.value),
4916
+ disabled: n.readOnly || a.busy,
4917
4917
  onChange: (k) => s.toggleMulti(
4918
4918
  l.key,
4919
4919
  g.value,
@@ -4922,17 +4922,17 @@ function ma(e, t, n, r, i, s) {
4922
4922
  }, null, 40, la),
4923
4923
  o("span", null, v(g.label), 1)
4924
4924
  ]))), 128))
4925
- ])) : w("", !0)
4925
+ ])) : b("", !0)
4926
4926
  ]))), 128)),
4927
- i.error ? (c(), d("div", ca, v(i.error), 1)) : w("", !0),
4927
+ a.error ? (c(), d("div", ca, v(a.error), 1)) : b("", !0),
4928
4928
  n.readOnly ? (c(), d("div", ha, v(s.t("form.responseSent")), 1)) : (c(), d("button", {
4929
4929
  key: 1,
4930
4930
  type: "submit",
4931
4931
  class: "wm-form__submit",
4932
- disabled: i.busy
4932
+ disabled: a.busy
4933
4933
  }, [
4934
- i.busy ? (c(), d("span", ua)) : w("", !0),
4935
- o("span", null, v(i.busy ? s.t("common.sending") : n.form.submit_label || s.t("common.send")), 1)
4934
+ a.busy ? (c(), d("span", ua)) : b("", !0),
4935
+ o("span", null, v(a.busy ? s.t("common.sending") : n.form.submit_label || s.t("common.send")), 1)
4936
4936
  ], 8, da))
4937
4937
  ], 32)
4938
4938
  ]);
@@ -4975,7 +4975,7 @@ const fa = /* @__PURE__ */ B(qi, [["render", ma], ["__scopeId", "data-v-fe65cc56
4975
4975
  key: 1,
4976
4976
  class: "wm-fb__done"
4977
4977
  }, Sa = { class: "wm-fb__doneTitle" }, Ma = { class: "wm-fb__doneSub" };
4978
- function Ta(e, t, n, r, i, s) {
4978
+ function Ta(e, t, n, i, a, s) {
4979
4979
  return c(), d("div", ga, [
4980
4980
  n.done ? (c(), d("div", Aa, [
4981
4981
  t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
@@ -4999,21 +4999,21 @@ function Ta(e, t, n, r, i, s) {
4999
4999
  o("div", pa, v(s.t("feedback.question")), 1),
5000
5000
  o("div", va, v(s.t("feedback.subtitle")), 1),
5001
5001
  o("div", ya, [
5002
- (c(!0), d(L, null, F(s.options, (a) => (c(), d("button", {
5003
- key: a.v,
5002
+ (c(!0), d(L, null, F(s.options, (r) => (c(), d("button", {
5003
+ key: r.v,
5004
5004
  type: "button",
5005
- class: I(["wm-fb__opt", { "is-selected": i.sel === a.v }]),
5006
- onClick: (l) => i.sel = a.v
5005
+ class: I(["wm-fb__opt", { "is-selected": a.sel === r.v }]),
5006
+ onClick: (l) => a.sel = r.v
5007
5007
  }, [
5008
- o("span", ba, v(a.e), 1),
5009
- o("span", ka, v(a.l), 1)
5008
+ o("span", ba, v(r.e), 1),
5009
+ o("span", ka, v(r.l), 1)
5010
5010
  ], 10, wa))), 128))
5011
5011
  ]),
5012
5012
  o("button", {
5013
5013
  type: "button",
5014
5014
  class: "wm-fb__send",
5015
- disabled: !i.sel || n.busy,
5016
- onClick: t[0] || (t[0] = (...a) => s.onSend && s.onSend(...a))
5015
+ disabled: !a.sel || n.busy,
5016
+ onClick: t[0] || (t[0] = (...r) => s.onSend && s.onSend(...r))
5017
5017
  }, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9, Ca)
5018
5018
  ], 64))
5019
5019
  ]);
@@ -5063,11 +5063,11 @@ const xa = /* @__PURE__ */ B(_a, [["render", Ta], ["__scopeId", "data-v-9b630564
5063
5063
  key: 1,
5064
5064
  class: "wm-mm__sep"
5065
5065
  }, Na = { class: "wm-mm__section" }, Ua = { class: "wm-mm__label" }, Da = { class: "wm-mm__section" }, Fa = { class: "wm-mm__label" }, ja = { class: "wm-mm__label" };
5066
- function Ha(e, t, n, r, i, s) {
5066
+ function Ha(e, t, n, i, a, s) {
5067
5067
  return c(), d("div", Ia, [
5068
5068
  o("div", {
5069
5069
  class: "wm-mm__scrim",
5070
- onClick: t[0] || (t[0] = (a) => e.$emit("close"))
5070
+ onClick: t[0] || (t[0] = (r) => e.$emit("close"))
5071
5071
  }),
5072
5072
  o("div", La, [
5073
5073
  n.canRename || n.canExport ? (c(), d("div", Ea, [
@@ -5075,7 +5075,7 @@ function Ha(e, t, n, r, i, s) {
5075
5075
  key: 0,
5076
5076
  type: "button",
5077
5077
  class: "wm-mm__item",
5078
- onClick: t[1] || (t[1] = (a) => s.emit("rename"))
5078
+ onClick: t[1] || (t[1] = (r) => s.emit("rename"))
5079
5079
  }, [
5080
5080
  t[6] || (t[6] = o("span", { class: "wm-mm__icon" }, [
5081
5081
  o("svg", {
@@ -5094,12 +5094,12 @@ function Ha(e, t, n, r, i, s) {
5094
5094
  ])
5095
5095
  ], -1)),
5096
5096
  o("span", Ra, v(s.t("moreMenu.editTitle")), 1)
5097
- ])) : w("", !0),
5097
+ ])) : b("", !0),
5098
5098
  n.canExport ? (c(), d("button", {
5099
5099
  key: 1,
5100
5100
  type: "button",
5101
5101
  class: "wm-mm__item",
5102
- onClick: t[2] || (t[2] = (a) => s.emit("export"))
5102
+ onClick: t[2] || (t[2] = (r) => s.emit("export"))
5103
5103
  }, [
5104
5104
  t[7] || (t[7] = o("span", { class: "wm-mm__icon" }, [
5105
5105
  o("svg", {
@@ -5118,14 +5118,14 @@ function Ha(e, t, n, r, i, s) {
5118
5118
  ], -1)),
5119
5119
  o("span", Ba, v(s.t("moreMenu.exportTranscript")), 1),
5120
5120
  t[8] || (t[8] = o("span", { class: "wm-mm__hint" }, ".txt", -1))
5121
- ])) : w("", !0)
5122
- ])) : w("", !0),
5123
- n.canRename || n.canExport ? (c(), d("div", Pa)) : w("", !0),
5121
+ ])) : b("", !0)
5122
+ ])) : b("", !0),
5123
+ n.canRename || n.canExport ? (c(), d("div", Pa)) : b("", !0),
5124
5124
  o("div", Na, [
5125
5125
  o("button", {
5126
5126
  type: "button",
5127
5127
  class: "wm-mm__item",
5128
- onClick: t[3] || (t[3] = (...a) => s.toggleSound && s.toggleSound(...a))
5128
+ onClick: t[3] || (t[3] = (...r) => s.toggleSound && s.toggleSound(...r))
5129
5129
  }, [
5130
5130
  t[10] || (t[10] = o("span", { class: "wm-mm__icon" }, [
5131
5131
  o("svg", {
@@ -5145,7 +5145,7 @@ function Ha(e, t, n, r, i, s) {
5145
5145
  ], -1)),
5146
5146
  o("span", Ua, v(s.t("moreMenu.sound")), 1),
5147
5147
  o("span", {
5148
- class: I(["wm-mm__toggle", { "wm-mm__toggle--on": i.soundOn }])
5148
+ class: I(["wm-mm__toggle", { "wm-mm__toggle--on": a.soundOn }])
5149
5149
  }, [...t[9] || (t[9] = [
5150
5150
  o("span", { class: "wm-mm__knob" }, null, -1)
5151
5151
  ])], 2)
@@ -5157,7 +5157,7 @@ function Ha(e, t, n, r, i, s) {
5157
5157
  key: 0,
5158
5158
  type: "button",
5159
5159
  class: "wm-mm__item",
5160
- onClick: t[4] || (t[4] = (a) => s.emit("status"))
5160
+ onClick: t[4] || (t[4] = (r) => s.emit("status"))
5161
5161
  }, [
5162
5162
  t[11] || (t[11] = o("span", { class: "wm-mm__icon" }, [
5163
5163
  o("svg", {
@@ -5175,12 +5175,12 @@ function Ha(e, t, n, r, i, s) {
5175
5175
  ])
5176
5176
  ], -1)),
5177
5177
  o("span", Fa, v(s.t("moreMenu.serviceStatus")), 1)
5178
- ])) : w("", !0),
5178
+ ])) : b("", !0),
5179
5179
  n.helpUrl ? (c(), d("button", {
5180
5180
  key: 1,
5181
5181
  type: "button",
5182
5182
  class: "wm-mm__item",
5183
- onClick: t[5] || (t[5] = (a) => s.emit("help"))
5183
+ onClick: t[5] || (t[5] = (r) => s.emit("help"))
5184
5184
  }, [
5185
5185
  t[12] || (t[12] = o("span", { class: "wm-mm__icon" }, [
5186
5186
  o("svg", {
@@ -5198,7 +5198,7 @@ function Ha(e, t, n, r, i, s) {
5198
5198
  ])
5199
5199
  ], -1)),
5200
5200
  o("span", ja, v(s.t("moreMenu.helpCenter")), 1)
5201
- ])) : w("", !0)
5201
+ ])) : b("", !0)
5202
5202
  ])
5203
5203
  ])
5204
5204
  ]);
@@ -5250,11 +5250,11 @@ const za = /* @__PURE__ */ B(Oa, [["render", Ha], ["__scopeId", "data-v-4cf6d578
5250
5250
  role: "dialog",
5251
5251
  "aria-modal": "true"
5252
5252
  }, Ka = { class: "wm-dialog__head" }, Wa = { class: "wm-dialog__title" }, Ga = ["aria-label"], Ya = { class: "wm-dialog__body" }, Xa = ["placeholder"], Ja = { class: "wm-dialog__actions" }, Qa = ["disabled"];
5253
- function Za(e, t, n, r, i, s) {
5253
+ function Za(e, t, n, i, a, s) {
5254
5254
  return c(), d("div", $a, [
5255
5255
  o("div", {
5256
5256
  class: "wm-dialog__scrim",
5257
- onClick: t[0] || (t[0] = (a) => e.$emit("close"))
5257
+ onClick: t[0] || (t[0] = (r) => e.$emit("close"))
5258
5258
  }),
5259
5259
  o("div", Va, [
5260
5260
  o("div", Ka, [
@@ -5263,7 +5263,7 @@ function Za(e, t, n, r, i, s) {
5263
5263
  type: "button",
5264
5264
  class: "wm-dialog__close",
5265
5265
  "aria-label": s.t("common.close"),
5266
- onClick: t[1] || (t[1] = (a) => e.$emit("close"))
5266
+ onClick: t[1] || (t[1] = (r) => e.$emit("close"))
5267
5267
  }, [...t[7] || (t[7] = [
5268
5268
  o("svg", {
5269
5269
  width: "12",
@@ -5283,30 +5283,30 @@ function Za(e, t, n, r, i, s) {
5283
5283
  o("div", Ya, [
5284
5284
  G(o("input", {
5285
5285
  ref: "input",
5286
- "onUpdate:modelValue": t[2] || (t[2] = (a) => i.value = a),
5286
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => a.value = r),
5287
5287
  type: "text",
5288
5288
  class: "wm-dialog__input",
5289
5289
  placeholder: n.placeholder || s.t("rename.placeholder"),
5290
5290
  maxlength: 120,
5291
5291
  onKeydown: [
5292
- t[3] || (t[3] = fe(X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
5293
- t[4] || (t[4] = fe(X((a) => e.$emit("close"), ["prevent"]), ["esc"]))
5292
+ t[3] || (t[3] = fe(X((...r) => s.onSubmit && s.onSubmit(...r), ["prevent"]), ["enter"])),
5293
+ t[4] || (t[4] = fe(X((r) => e.$emit("close"), ["prevent"]), ["esc"]))
5294
5294
  ]
5295
5295
  }, null, 40, Xa), [
5296
- [te, i.value]
5296
+ [te, a.value]
5297
5297
  ])
5298
5298
  ]),
5299
5299
  o("div", Ja, [
5300
5300
  o("button", {
5301
5301
  type: "button",
5302
5302
  class: "wm-dialog__btn",
5303
- onClick: t[5] || (t[5] = (a) => e.$emit("close"))
5303
+ onClick: t[5] || (t[5] = (r) => e.$emit("close"))
5304
5304
  }, v(s.t("common.cancel")), 1),
5305
5305
  o("button", {
5306
5306
  type: "button",
5307
5307
  class: "wm-dialog__btn wm-dialog__btn--primary",
5308
5308
  disabled: !s.canSubmit,
5309
- onClick: t[6] || (t[6] = (...a) => s.onSubmit && s.onSubmit(...a))
5309
+ onClick: t[6] || (t[6] = (...r) => s.onSubmit && s.onSubmit(...r))
5310
5310
  }, v(s.t("common.save")), 9, Qa)
5311
5311
  ])
5312
5312
  ])
@@ -5471,9 +5471,9 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5471
5471
  // so the choice applies immediately, before the boot round-trip
5472
5472
  // that materializes `state.customer` has completed.
5473
5473
  customerLanguage() {
5474
- var n, r, i, s;
5475
- const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((r = e.values) == null ? void 0 : r.language));
5476
- return t || ((s = (i = this.context) == null ? void 0 : i.customer) == null ? void 0 : s.language) || "";
5474
+ var n, i, a, s;
5475
+ const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((i = e.values) == null ? void 0 : i.language));
5476
+ return t || ((s = (a = this.context) == null ? void 0 : a.customer) == null ? void 0 : s.language) || "";
5477
5477
  },
5478
5478
  // Resolved UI language, by priority:
5479
5479
  // 1. explicit `language` prop (consumer override)
@@ -5520,32 +5520,32 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5520
5520
  drawerConversations() {
5521
5521
  var n;
5522
5522
  const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = this.revealedAt;
5523
- return this.allConversations.map((r) => {
5523
+ return this.allConversations.map((i) => {
5524
5524
  var k;
5525
- const i = e[r.id] || [], s = Y(r.last_read_message_id);
5526
- let a = 0, l = null;
5527
- for (let b = i.length - 1; b >= 0; b--) {
5528
- const x = i[b];
5525
+ const a = e[i.id] || [], s = Y(i.last_read_message_id);
5526
+ let r = 0, l = null;
5527
+ for (let w = a.length - 1; w >= 0; w--) {
5528
+ const x = a[w];
5529
5529
  if (!x) continue;
5530
5530
  if (((k = x.author) == null ? void 0 : k.type) === "user") break;
5531
5531
  const E = Y(x.id);
5532
5532
  if (E != null) {
5533
5533
  if (s != null && E <= s) break;
5534
- t[x.id] !== 0 && (!l && x.author && (l = x.author), a++);
5534
+ t[x.id] !== 0 && (!l && x.author && (l = x.author), r++);
5535
5535
  }
5536
5536
  }
5537
- if (!i.length) {
5538
- const b = Y(r.last_message_id);
5539
- b != null && (s == null || b > s) && (a = 1, l = r.last_message_author || null);
5537
+ if (!a.length) {
5538
+ const w = Y(i.last_message_id);
5539
+ w != null && (s == null || w > s) && (r = 1, l = i.last_message_author || null);
5540
5540
  }
5541
- const g = i.filter(
5542
- (b) => !((b == null ? void 0 : b.id) != null && t[b.id] === 0)
5541
+ const g = a.filter(
5542
+ (w) => !((w == null ? void 0 : w.id) != null && t[w.id] === 0)
5543
5543
  );
5544
5544
  return {
5545
- ...r,
5546
- _preview: mt(r, g),
5547
- _unread: a > 0,
5548
- _unreadCount: a,
5545
+ ...i,
5546
+ _preview: mt(i, g),
5547
+ _unread: r > 0,
5548
+ _unreadCount: r,
5549
5549
  _lastAuthor: l
5550
5550
  };
5551
5551
  });
@@ -5568,7 +5568,7 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5568
5568
  unread: !!n._unread,
5569
5569
  author: n._lastAuthor || null,
5570
5570
  _ts: Ee(n, e[n.id] || [])
5571
- })).sort((n, r) => n._ts < r._ts ? 1 : n._ts > r._ts ? -1 : 0);
5571
+ })).sort((n, i) => n._ts < i._ts ? 1 : n._ts > i._ts ? -1 : 0);
5572
5572
  },
5573
5573
  // Unread threads (one entry per conv with unseen agent/human
5574
5574
  // activity), freshest first. Each entry carries everything the
@@ -5577,19 +5577,19 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5577
5577
  latestUnreads() {
5578
5578
  var n;
5579
5579
  const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
5580
- for (const r of this.drawerConversations) {
5581
- if (!r._unread) continue;
5582
- const i = Ee(r, e[r.id] || []), s = r._lastAuthor, a = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (a ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (a ? this.agentAvatarUrl : null);
5580
+ for (const i of this.drawerConversations) {
5581
+ if (!i._unread) continue;
5582
+ const a = Ee(i, e[i.id] || []), s = i._lastAuthor, r = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (r ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (r ? this.agentAvatarUrl : null);
5583
5583
  t.push({
5584
- convId: r.id,
5585
- preview: r._preview || this.t("notification.youHaveNewMessage"),
5586
- ts: i,
5587
- count: r._unreadCount || 1,
5584
+ convId: i.id,
5585
+ preview: i._preview || this.t("notification.youHaveNewMessage"),
5586
+ ts: a,
5587
+ count: i._unreadCount || 1,
5588
5588
  senderName: l,
5589
5589
  senderAvatarUrl: g
5590
5590
  });
5591
5591
  }
5592
- return t.sort((r, i) => r.ts < i.ts ? 1 : r.ts > i.ts ? -1 : 0), t;
5592
+ return t.sort((i, a) => i.ts < a.ts ? 1 : i.ts > a.ts ? -1 : 0), t;
5593
5593
  },
5594
5594
  // Notification cards shown in the closed-launcher stack: the unread
5595
5595
  // threads above, minus any the user has dismissed (×) for their
@@ -5625,7 +5625,7 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5625
5625
  var n;
5626
5626
  const e = (n = this.widget) == null ? void 0 : n.quick_links;
5627
5627
  if (!Array.isArray(e)) return "";
5628
- const t = e.find((r) => r.icon === "status" && r.url);
5628
+ const t = e.find((i) => i.icon === "status" && i.url);
5629
5629
  return (t == null ? void 0 : t.url) || "";
5630
5630
  },
5631
5631
  helpUrl() {
@@ -5633,7 +5633,7 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5633
5633
  const e = (n = this.widget) == null ? void 0 : n.quick_links;
5634
5634
  if (!Array.isArray(e)) return "";
5635
5635
  const t = e.find(
5636
- (r) => (r.icon === "chat" || r.icon === "help") && r.url
5636
+ (i) => (i.icon === "chat" || i.icon === "help") && i.url
5637
5637
  );
5638
5638
  return (t == null ? void 0 : t.url) || "";
5639
5639
  },
@@ -5653,6 +5653,16 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5653
5653
  const e = (t = this.widget) == null ? void 0 : t.primary_color;
5654
5654
  return e && ot(e) ? { "--wm-primary": e } : null;
5655
5655
  },
5656
+ // Hero title shown above the onboarding actions. Schema-side the
5657
+ // column was renamed `welcome_message` → `title` ; the old name
5658
+ // is now the bot's opening line (cf. `widgetWelcomeMessage`).
5659
+ widgetTitle() {
5660
+ var e;
5661
+ return ((e = this.widget) == null ? void 0 : e.title) || "";
5662
+ },
5663
+ // Bot's opening line, surfaced as a synthetic agent bubble at
5664
+ // the top of every conversation (cf. `displayedMessages`). Lives
5665
+ // entirely client-side — never persisted as a real message.
5656
5666
  widgetWelcomeMessage() {
5657
5667
  var e;
5658
5668
  return ((e = this.widget) == null ? void 0 : e.welcome_message) || "";
@@ -5690,12 +5700,12 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5690
5700
  // Last message from a human agent in the current conversation —
5691
5701
  // used to surface the human agent's name + avatar in the header.
5692
5702
  humanMessageAuthor() {
5693
- var t, n, r;
5703
+ var t, n, i;
5694
5704
  if (!this.currentConv) return null;
5695
5705
  const e = ((t = this.s.messagesByConv) == null ? void 0 : t[this.currentConv.id]) || [];
5696
- for (let i = e.length - 1; i >= 0; i--)
5697
- if (((r = (n = e[i]) == null ? void 0 : n.author) == null ? void 0 : r.type) === "agent_human")
5698
- return e[i].author;
5706
+ for (let a = e.length - 1; a >= 0; a--)
5707
+ if (((i = (n = e[a]) == null ? void 0 : n.author) == null ? void 0 : i.type) === "agent_human")
5708
+ return e[a].author;
5699
5709
  return null;
5700
5710
  },
5701
5711
  humanAgentName() {
@@ -5727,36 +5737,37 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5727
5737
  }) : this.isWaitingHuman ? this.t("composer.agentTakingOver") : this.t("composer.placeholder");
5728
5738
  },
5729
5739
  displayedMessages() {
5730
- var n, r;
5740
+ var a, s;
5731
5741
  const e = this.currentConv;
5732
5742
  if (!e) return [];
5743
+ const t = this.buildWelcomePrefix(e);
5733
5744
  if (!e._draft) {
5734
- const i = (r = (n = this.s) == null ? void 0 : n.paginationByConv) == null ? void 0 : r[e.id];
5735
- if (!(i != null && i.loaded)) return [];
5745
+ const r = (s = (a = this.s) == null ? void 0 : a.paginationByConv) == null ? void 0 : s[e.id];
5746
+ if (!(r != null && r.loaded)) return t;
5736
5747
  }
5737
- const t = this.revealedAt;
5738
- return (this.s.messagesByConv[e.id] || []).filter((i) => {
5739
- var s, a, l, g, k;
5740
- return (i == null ? void 0 : i.type) === "action" && ((s = i == null ? void 0 : i.payload) == null ? void 0 : s.state) === "pending" || de(i) && !(t[i.id] > 0) ? !1 : (i == null ? void 0 : i.type) === "action" || (i == null ? void 0 : i.type) === "system" || ((a = i == null ? void 0 : i.payload) == null ? void 0 : a.type) === "system" || Array.isArray((l = i == null ? void 0 : i.payload) == null ? void 0 : l.attachments) && i.payload.attachments.length || (g = i == null ? void 0 : i.metadata) != null && g.artifact || (k = i == null ? void 0 : i.metadata) != null && k.form ? !0 : typeof (i == null ? void 0 : i.text_md) == "string" && i.text_md.trim().length > 0;
5748
+ const n = this.revealedAt, i = (this.s.messagesByConv[e.id] || []).filter((r) => {
5749
+ var l, g, k, w, x;
5750
+ return (r == null ? void 0 : r.type) === "action" && ((l = r == null ? void 0 : r.payload) == null ? void 0 : l.state) === "pending" || de(r) && !(n[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((g = r == null ? void 0 : r.payload) == null ? void 0 : g.type) === "system" || Array.isArray((k = r == null ? void 0 : r.payload) == null ? void 0 : k.attachments) && r.payload.attachments.length || (w = r == null ? void 0 : r.metadata) != null && w.artifact || (x = r == null ? void 0 : r.metadata) != null && x.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
5741
5751
  });
5752
+ return t.length ? [...t, ...i] : i;
5742
5753
  },
5743
5754
  // True whenever we should show the "typing" indicator at the bottom
5744
5755
  // of the list: either the LLM is actively streaming tokens, or one
5745
5756
  // or more agent messages are queued and waiting for their reveal
5746
5757
  // slot to fire.
5747
5758
  streamingActive() {
5748
- var n, r, i;
5759
+ var n, i, a;
5749
5760
  const e = this.currentConv;
5750
- return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((i = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : i[e.id]) || []).some(
5761
+ return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((a = (i = this.s) == null ? void 0 : i.messagesByConv) == null ? void 0 : a[e.id]) || []).some(
5751
5762
  (s) => de(s) && !(this.revealedAt[s.id] > 0)
5752
5763
  ) : !1;
5753
5764
  },
5754
5765
  // Internal: the raw persisted list for the current conversation. We
5755
5766
  // watch this to detect new agent messages that need to be paced.
5756
5767
  currentConvMessages() {
5757
- var t, n, r;
5768
+ var t, n, i;
5758
5769
  const e = (t = this.currentConv) == null ? void 0 : t.id;
5759
- return e ? ((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e]) || [] : [];
5770
+ return e ? ((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e]) || [] : [];
5760
5771
  },
5761
5772
  pendingApproval() {
5762
5773
  return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
@@ -5773,14 +5784,14 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5773
5784
  return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || this.t("action.title");
5774
5785
  },
5775
5786
  approvalDetail() {
5776
- var r, i, s, a, l, g;
5777
- const e = (s = (i = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : i.pending) == null ? void 0 : s.user_explanation;
5787
+ var i, a, s, r, l, g;
5788
+ const e = (s = (a = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : a.pending) == null ? void 0 : s.user_explanation;
5778
5789
  if (typeof e == "string" && e.trim())
5779
5790
  return e.trim();
5780
- const t = (g = (l = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : l.pending) == null ? void 0 : g.prepared_params;
5791
+ const t = (g = (l = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : l.pending) == null ? void 0 : g.prepared_params;
5781
5792
  if (!t || typeof t != "object") return "";
5782
5793
  const n = Object.entries(t);
5783
- return n.length ? n.slice(0, 2).map(([k, b]) => `${k}: ${b}`).join(" · ") : "";
5794
+ return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
5784
5795
  },
5785
5796
  actionInFlight() {
5786
5797
  var e, t;
@@ -5812,13 +5823,13 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5812
5823
  return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
5813
5824
  },
5814
5825
  dateLabel() {
5815
- var n, r, i;
5826
+ var n, i, a;
5816
5827
  const e = this.currentConv;
5817
5828
  let t = /* @__PURE__ */ new Date();
5818
5829
  if (e) {
5819
- const a = ((i = (((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : i.created_at) || e.created_at;
5820
- if (a) {
5821
- const l = new Date(a);
5830
+ const r = ((a = (((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : a.created_at) || e.created_at;
5831
+ if (r) {
5832
+ const l = new Date(r);
5822
5833
  Number.isNaN(l.getTime()) || (t = l);
5823
5834
  }
5824
5835
  }
@@ -5831,8 +5842,8 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5831
5842
  // history available, nothing loading) so the loader stays inert
5832
5843
  // until `openConversation` has populated the entry.
5833
5844
  paginationState() {
5834
- var n, r, i;
5835
- const e = (n = this.currentConv) == null ? void 0 : n.id, t = e ? (i = (r = this.s) == null ? void 0 : r.paginationByConv) == null ? void 0 : i[e] : null;
5845
+ var n, i, a;
5846
+ const e = (n = this.currentConv) == null ? void 0 : n.id, t = e ? (a = (i = this.s) == null ? void 0 : i.paginationByConv) == null ? void 0 : a[e] : null;
5836
5847
  return {
5837
5848
  loading: !!(t != null && t.loading),
5838
5849
  hasMore: !!(t != null && t.nextCursor)
@@ -5847,13 +5858,13 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5847
5858
  // ts comparison in `launcherPeeks`.
5848
5859
  latestUnreads: {
5849
5860
  handler(e) {
5850
- const t = new Set(e.map((a) => a.convId)), n = this.dismissedPeeks || {}, r = Object.keys(n);
5851
- if (!r.length) return;
5852
- const i = {};
5861
+ const t = new Set(e.map((r) => r.convId)), n = this.dismissedPeeks || {}, i = Object.keys(n);
5862
+ if (!i.length) return;
5863
+ const a = {};
5853
5864
  let s = !1;
5854
- for (const a of r)
5855
- t.has(a) ? i[a] = n[a] : s = !0;
5856
- s && (this.dismissedPeeks = i);
5865
+ for (const r of i)
5866
+ t.has(r) ? a[r] = n[r] : s = !0;
5867
+ s && (this.dismissedPeeks = a);
5857
5868
  },
5858
5869
  deep: !0
5859
5870
  },
@@ -5966,8 +5977,8 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5966
5977
  const t = e == null ? void 0 : e.data;
5967
5978
  if (!(!t || typeof t != "object")) {
5968
5979
  if (t.type === "UPDATE") {
5969
- this.transport && t.payload && this.transport.update(t.payload).catch((r) => {
5970
- console.warn("[messenger] update failed", r);
5980
+ this.transport && t.payload && this.transport.update(t.payload).catch((i) => {
5981
+ console.warn("[messenger] update failed", i);
5971
5982
  });
5972
5983
  return;
5973
5984
  }
@@ -5975,8 +5986,8 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
5975
5986
  this.transport && t.payload && this.transport.context(t.payload);
5976
5987
  return;
5977
5988
  }
5978
- t.type === "INIT" && (this.parentOrigin = e.origin, this.parentToken = typeof t.token == "string" ? t.token : "", this.parentVariables = t.variables && typeof t.variables == "object" ? t.variables : t.context && typeof t.context == "object" ? t.context : null, this.parentAllowUnauthenticated = t.allowUnauthenticated === !0, this.parentInitReceived = !0, (n = this.parentInitDeferred) != null && n._resolve && this.parentInitDeferred._resolve(), !this.isEmbedded && !this.isOpen && !this.parentAllowUnauthenticated && this.parentToken && this.hasValidSessionMarker() && this.boot().catch((r) => {
5979
- console.warn("[messenger] eager boot failed", r);
5989
+ t.type === "INIT" && (this.parentOrigin = e.origin, this.parentToken = typeof t.token == "string" ? t.token : "", this.parentVariables = t.variables && typeof t.variables == "object" ? t.variables : t.context && typeof t.context == "object" ? t.context : null, this.parentAllowUnauthenticated = t.allowUnauthenticated === !0, this.parentInitReceived = !0, (n = this.parentInitDeferred) != null && n._resolve && this.parentInitDeferred._resolve(), !this.isEmbedded && !this.isOpen && !this.parentAllowUnauthenticated && this.parentToken && this.hasValidSessionMarker() && this.boot().catch((i) => {
5990
+ console.warn("[messenger] eager boot failed", i);
5980
5991
  }));
5981
5992
  }
5982
5993
  },
@@ -6010,8 +6021,8 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6010
6021
  variables: e && typeof e == "object" ? e : void 0
6011
6022
  }), e && typeof e == "object") {
6012
6023
  const t = {};
6013
- for (const [n, r] of Object.entries(e))
6014
- n !== "customer" && r && typeof r == "object" && !Array.isArray(r) && (t[n] = r);
6024
+ for (const [n, i] of Object.entries(e))
6025
+ n !== "customer" && i && typeof i == "object" && !Array.isArray(i) && (t[n] = i);
6015
6026
  Object.keys(t).length > 0 && this.transport.context(t);
6016
6027
  }
6017
6028
  this.setupLiveReveal();
@@ -6037,12 +6048,12 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6037
6048
  return;
6038
6049
  }
6039
6050
  this.floatRO = new ResizeObserver((n) => {
6040
- const r = n[0];
6041
- if (!r) return;
6042
- const i = Math.ceil(r.contentRect.height + 8);
6043
- i !== this.floatHeight && (this.floatHeight = i, this.$nextTick(() => {
6044
- var s, a;
6045
- (a = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || a.call(s);
6051
+ const i = n[0];
6052
+ if (!i) return;
6053
+ const a = Math.ceil(i.contentRect.height + 8);
6054
+ a !== this.floatHeight && (this.floatHeight = a, this.$nextTick(() => {
6055
+ var s, r;
6056
+ (r = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || r.call(s);
6046
6057
  }));
6047
6058
  }), this.floatRO.observe(t);
6048
6059
  }
@@ -6096,13 +6107,13 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6096
6107
  this.launcherHovered = e, this.sendCurrentLauncherSize();
6097
6108
  },
6098
6109
  sendCurrentLauncherSize() {
6099
- var b, x, E, A, q, M, U;
6110
+ var w, x, E, A, q, M, U;
6100
6111
  if (this.isOpen) return;
6101
- const e = (x = (b = this.$el) == null ? void 0 : b.querySelector) == null ? void 0 : x.call(b, ".wm-launcherWrap");
6112
+ const e = (x = (w = this.$el) == null ? void 0 : w.querySelector) == null ? void 0 : x.call(w, ".wm-launcherWrap");
6102
6113
  if (!e) return;
6103
6114
  const t = e.getBoundingClientRect();
6104
6115
  if (!t.width || !t.height) return;
6105
- const n = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0, r = 16, i = Math.ceil(t.width), s = Math.ceil(t.height), a = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (U = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : U.call(M, ".wm-peek"), g = l && l.length ? l[l.length - 1] : null;
6116
+ const n = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0, i = 16, a = Math.ceil(t.width), s = Math.ceil(t.height), r = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (U = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : U.call(M, ".wm-peek"), g = l && l.length ? l[l.length - 1] : null;
6106
6117
  let k = null;
6107
6118
  if (g) {
6108
6119
  const D = g.getBoundingClientRect();
@@ -6114,19 +6125,19 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6114
6125
  };
6115
6126
  }
6116
6127
  this.notifyParentResize("closed", {
6117
- width: i + r,
6118
- height: s + r,
6119
- launcherWidth: (a == null ? void 0 : a.offsetWidth) || null,
6120
- launcherHeight: (a == null ? void 0 : a.offsetHeight) || null,
6128
+ width: a + i,
6129
+ height: s + i,
6130
+ launcherWidth: (r == null ? void 0 : r.offsetWidth) || null,
6131
+ launcherHeight: (r == null ? void 0 : r.offsetHeight) || null,
6121
6132
  launcherHovered: this.launcherHovered,
6122
6133
  peek: k,
6123
6134
  peekHovered: this.launcherHovered && n
6124
6135
  });
6125
6136
  },
6126
6137
  observeLauncherSize() {
6127
- var n, r;
6138
+ var n, i;
6128
6139
  if (typeof ResizeObserver > "u") return;
6129
- const e = (r = (n = this.$el) == null ? void 0 : n.querySelector) == null ? void 0 : r.call(n, ".wm-launcherWrap");
6140
+ const e = (i = (n = this.$el) == null ? void 0 : n.querySelector) == null ? void 0 : i.call(n, ".wm-launcherWrap");
6130
6141
  if (!e) return;
6131
6142
  this._launcherRo && this._launcherRo.disconnect();
6132
6143
  const t = new ResizeObserver(() => {
@@ -6137,9 +6148,9 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6137
6148
  // Opening straight from a notification card: land on that card's
6138
6149
  // thread rather than whatever was last active.
6139
6150
  async openFromPeek(e) {
6140
- var n, r;
6151
+ var n, i;
6141
6152
  const t = e || ((n = this.latestUnreads[0]) == null ? void 0 : n.convId);
6142
- t && t !== ((r = this.currentConv) == null ? void 0 : r.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = !1), await this.open();
6153
+ t && t !== ((i = this.currentConv) == null ? void 0 : i.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = !1), await this.open();
6143
6154
  },
6144
6155
  // Stamp the dismissed batch ts for a single conv so its card
6145
6156
  // disappears from the stack until a fresher message arrives.
@@ -6188,6 +6199,28 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6188
6199
  return (e = this.$refs.composer) == null ? void 0 : e.focus();
6189
6200
  });
6190
6201
  },
6202
+ // Build the synthetic agent bubble that prefaces every conversation
6203
+ // with `widget.welcome_message`. Returns an empty array when no
6204
+ // welcome line is configured ; otherwise a single-element array
6205
+ // ready to be spread at the head of `displayedMessages`. The bubble
6206
+ // is keyed `__welcome__` and pre-revealed (via `created_at` set to
6207
+ // the epoch) so the pacer treats it as historical and renders it
6208
+ // instantly, like any other already-on-screen message.
6209
+ buildWelcomePrefix(e) {
6210
+ const t = this.widgetWelcomeMessage;
6211
+ return !t || typeof t != "string" || !t.trim() ? [] : [
6212
+ {
6213
+ id: "__welcome__",
6214
+ text_md: t.trim(),
6215
+ author: {
6216
+ type: "agent_ia",
6217
+ name: this.agentName,
6218
+ avatar_url: this.agentAvatarUrl
6219
+ },
6220
+ created_at: (e == null ? void 0 : e.created_at) || (/* @__PURE__ */ new Date(0)).toISOString()
6221
+ }
6222
+ ];
6223
+ },
6191
6224
  // ── Header / more menu ──────────────────────────────────────────
6192
6225
  toggleMore() {
6193
6226
  this.moreOpen = !this.moreOpen;
@@ -6201,10 +6234,10 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6201
6234
  this.draftConv = null, this.activeConvId = e.id, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = t;
6202
6235
  try {
6203
6236
  await this.store.openConversation(e.id);
6204
- } catch (r) {
6205
- console.error("[ww-messenger] open conv failed", r);
6237
+ } catch (i) {
6238
+ console.error("[ww-messenger] open conv failed", i);
6206
6239
  }
6207
- const n = this.allConversations.find((r) => r.id === e.id);
6240
+ const n = this.allConversations.find((i) => i.id === e.id);
6208
6241
  n && this.markConvRead(n);
6209
6242
  },
6210
6243
  async onMoreAction(e) {
@@ -6248,8 +6281,8 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6248
6281
  if (!(!n || n === t.name))
6249
6282
  try {
6250
6283
  await this.store.patchConversation(t.id, { name: n });
6251
- } catch (r) {
6252
- console.error("[ww-messenger] rename failed", r);
6284
+ } catch (i) {
6285
+ console.error("[ww-messenger] rename failed", i);
6253
6286
  }
6254
6287
  },
6255
6288
  // ── Send / suggestion / form / attach / feedback ────────────────
@@ -6257,9 +6290,9 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6257
6290
  let t = this.currentConv;
6258
6291
  if (!t && (this.startConv(), t = this.currentConv, !t) || t._draft && (t = await this.ensureRealConv(), !t))
6259
6292
  return;
6260
- const n = t.id, r = this.pendingAttachments.slice();
6293
+ const n = t.id, i = this.pendingAttachments.slice();
6261
6294
  this.pendingAttachments = [], this.unreadAnchorId = null, this.unreadBoundaryTs = "", await this.store.send(n, e, {
6262
- attachments: r.length ? r : void 0
6295
+ attachments: i.length ? i : void 0
6263
6296
  });
6264
6297
  },
6265
6298
  async onSuggestion(e) {
@@ -6280,8 +6313,8 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6280
6313
  if (!(t != null && t.form)) return;
6281
6314
  const n = dt(t.form, e, this.translator);
6282
6315
  if (!n) return;
6283
- let r = this.currentConv;
6284
- r && (r._draft && (r = await this.ensureRealConv(), !r) || await this.store.send(r.id, n, {
6316
+ let i = this.currentConv;
6317
+ i && (i._draft && (i = await this.ensureRealConv(), !i) || await this.store.send(i.id, n, {
6285
6318
  metadata: {
6286
6319
  artifact: ut(
6287
6320
  t.form,
@@ -6387,34 +6420,34 @@ const eo = /* @__PURE__ */ B(qa, [["render", Za], ["__scopeId", "data-v-6d5f94a8
6387
6420
  key: 2,
6388
6421
  class: "wm-attached"
6389
6422
  }, fo = ["aria-label", "onClick"];
6390
- function _o(e, t, n, r, i, s) {
6391
- const a = R("Launcher"), l = R("Header"), g = R("History"), k = R("Onboarding"), b = R("MessageList"), x = R("ApprovalCard"), E = R("FormCard"), A = R("Feedback"), q = R("SuggestionChips"), M = R("Composer"), U = R("MoreMenu"), D = R("RenameDialog");
6423
+ function _o(e, t, n, i, a, s) {
6424
+ const r = R("Launcher"), l = R("Header"), g = R("History"), k = R("Onboarding"), w = R("MessageList"), x = R("ApprovalCard"), E = R("FormCard"), A = R("Feedback"), q = R("SuggestionChips"), M = R("Composer"), U = R("MoreMenu"), D = R("RenameDialog");
6392
6425
  return c(), d("div", {
6393
6426
  class: I(["wm-root", `wm-root--${n.displayMode}`]),
6394
6427
  style: z(s.rootStyle)
6395
6428
  }, [
6396
- !i.isOpen && !s.isEmbedded ? (c(), P(a, {
6429
+ !a.isOpen && !s.isEmbedded ? (c(), P(r, {
6397
6430
  key: 0,
6398
6431
  "unread-count": s.unreadCount,
6399
6432
  peeks: s.launcherPeeks,
6400
6433
  onOpen: s.openFromPeek,
6401
6434
  onDismiss: s.dismissPeek,
6402
6435
  onHover: s.onLauncherHover
6403
- }, null, 8, ["unread-count", "peeks", "onOpen", "onDismiss", "onHover"])) : w("", !0),
6404
- i.isOpen || s.isEmbedded ? (c(), d("section", {
6436
+ }, null, 8, ["unread-count", "peeks", "onOpen", "onDismiss", "onHover"])) : b("", !0),
6437
+ a.isOpen || s.isEmbedded ? (c(), d("section", {
6405
6438
  key: 1,
6406
6439
  class: I([
6407
6440
  "wm-panel",
6408
6441
  `wm-panel--${n.displayMode}`,
6409
6442
  { "wm-panel--welcome": s.ready && !s.error && !s.currentConv }
6410
6443
  ]),
6411
- style: z(i.floatHeight ? { "--wm-float-h": i.floatHeight + "px" } : null),
6444
+ style: z(a.floatHeight ? { "--wm-float-h": a.floatHeight + "px" } : null),
6412
6445
  role: "dialog",
6413
6446
  "aria-label": "Messenger",
6414
6447
  onClick: t[6] || (t[6] = (...N) => s.onPanelClick && s.onPanelClick(...N))
6415
6448
  }, [
6416
6449
  !s.ready && !s.error ? (c(), d("div", no, [
6417
- s.isEmbedded ? w("", !0) : (c(), d("button", {
6450
+ s.isEmbedded ? b("", !0) : (c(), d("button", {
6418
6451
  key: 0,
6419
6452
  type: "button",
6420
6453
  class: "wm-loading__close",
@@ -6447,7 +6480,7 @@ function _o(e, t, n, r, i, s) {
6447
6480
  "show-identity": !!s.currentConv,
6448
6481
  "show-back": s.canBack,
6449
6482
  "show-close": !s.isEmbedded,
6450
- "more-active": i.moreOpen,
6483
+ "more-active": a.moreOpen,
6451
6484
  "agent-name": s.agentName,
6452
6485
  "agent-avatar-url": s.agentAvatarUrl,
6453
6486
  onBack: s.goHome,
@@ -6476,12 +6509,12 @@ function _o(e, t, n, r, i, s) {
6476
6509
  o("div", oo, v(s.error), 1)
6477
6510
  ])
6478
6511
  ])
6479
- ])) : !s.currentConv && i.showHistory ? (c(), P(g, {
6512
+ ])) : !s.currentConv && a.showHistory ? (c(), P(g, {
6480
6513
  key: 1,
6481
6514
  threads: s.openThreads,
6482
6515
  onResume: s.onDrawerPick
6483
6516
  }, null, 8, ["threads", "onResume"])) : s.currentConv ? (c(), d(L, { key: 3 }, [
6484
- V(b, {
6517
+ V(w, {
6485
6518
  ref: "messageList",
6486
6519
  messages: s.displayedMessages,
6487
6520
  "streaming-active": s.streamingActive,
@@ -6513,15 +6546,15 @@ function _o(e, t, n, r, i, s) {
6513
6546
  onSubmit: s.onFormSubmit
6514
6547
  }, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : s.showFeedback ? (c(), P(A, {
6515
6548
  key: 2,
6516
- busy: i.feedbackBusy,
6517
- done: i.feedbackDone,
6549
+ busy: a.feedbackBusy,
6550
+ done: a.feedbackDone,
6518
6551
  onSubmit: s.onFeedback
6519
6552
  }, null, 8, ["busy", "done", "onSubmit"])) : (c(), P(q, {
6520
6553
  key: 3,
6521
6554
  items: s.suggestions,
6522
6555
  onSelect: s.onSuggestion
6523
6556
  }, null, 8, ["items", "onSelect"]))
6524
- ], 512)) : w("", !0),
6557
+ ], 512)) : b("", !0),
6525
6558
  s.actionInFlight ? (c(), d("div", uo, [
6526
6559
  t[10] || (t[10] = o("span", {
6527
6560
  class: "wm-actionWait__spinner",
@@ -6533,8 +6566,8 @@ function _o(e, t, n, r, i, s) {
6533
6566
  ])) : (c(), P(M, {
6534
6567
  key: 2,
6535
6568
  ref: "composer",
6536
- modelValue: i.draft,
6537
- "onUpdate:modelValue": t[2] || (t[2] = (N) => i.draft = N),
6569
+ modelValue: a.draft,
6570
+ "onUpdate:modelValue": t[2] || (t[2] = (N) => a.draft = N),
6538
6571
  placeholder: s.composerPlaceholder,
6539
6572
  disabled: !!s.pendingApproval,
6540
6573
  "attach-label": s.t("composer.attachFile"),
@@ -6543,26 +6576,26 @@ function _o(e, t, n, r, i, s) {
6543
6576
  onAttach: s.onAttach
6544
6577
  }, null, 8, ["modelValue", "placeholder", "disabled", "attach-label", "display-mode", "onSend", "onAttach"]))
6545
6578
  ]),
6546
- i.moreOpen ? (c(), P(U, {
6579
+ a.moreOpen ? (c(), P(U, {
6547
6580
  key: 0,
6548
6581
  "can-rename": !!s.currentConv && !s.currentConv._draft,
6549
6582
  "can-export": !!s.currentConv && !s.currentConv._draft,
6550
6583
  "sound-enabled": e.soundEnabled,
6551
6584
  "status-url": s.statusUrl,
6552
6585
  "help-url": s.helpUrl,
6553
- onClose: t[3] || (t[3] = (N) => i.moreOpen = !1),
6586
+ onClose: t[3] || (t[3] = (N) => a.moreOpen = !1),
6554
6587
  onSoundToggle: e.onSoundToggle,
6555
6588
  onAction: s.onMoreAction
6556
- }, null, 8, ["can-rename", "can-export", "sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : w("", !0),
6557
- i.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), P(D, {
6589
+ }, null, 8, ["can-rename", "can-export", "sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0),
6590
+ a.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), P(D, {
6558
6591
  key: 1,
6559
6592
  "initial-value": s.currentConv.name || "",
6560
6593
  title: s.t("rename.dialogTitle"),
6561
- onClose: t[4] || (t[4] = (N) => i.renameDialogOpen = !1),
6594
+ onClose: t[4] || (t[4] = (N) => a.renameDialogOpen = !1),
6562
6595
  onSubmit: s.onRenameSubmit
6563
- }, null, 8, ["initial-value", "title", "onSubmit"])) : w("", !0),
6564
- i.pendingAttachments.length ? (c(), d("div", mo, [
6565
- (c(!0), d(L, null, F(i.pendingAttachments, (N, K) => (c(), d("div", {
6596
+ }, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0),
6597
+ a.pendingAttachments.length ? (c(), d("div", mo, [
6598
+ (c(!0), d(L, null, F(a.pendingAttachments, (N, K) => (c(), d("div", {
6566
6599
  key: K,
6567
6600
  class: "wm-attached__chip"
6568
6601
  }, [
@@ -6583,7 +6616,7 @@ function _o(e, t, n, r, i, s) {
6583
6616
  o("button", {
6584
6617
  type: "button",
6585
6618
  "aria-label": s.t("attachment.remove"),
6586
- onClick: (Q) => i.pendingAttachments.splice(K, 1)
6619
+ onClick: (Q) => a.pendingAttachments.splice(K, 1)
6587
6620
  }, [...t[11] || (t[11] = [
6588
6621
  o("svg", {
6589
6622
  width: "10",
@@ -6600,37 +6633,37 @@ function _o(e, t, n, r, i, s) {
6600
6633
  ], -1)
6601
6634
  ])], 8, fo)
6602
6635
  ]))), 128))
6603
- ])) : w("", !0)
6636
+ ])) : b("", !0)
6604
6637
  ], 64)) : (c(), P(k, {
6605
6638
  key: 2,
6606
- "welcome-message": s.widgetWelcomeMessage,
6639
+ title: s.widgetTitle,
6607
6640
  subtitle: s.widgetSubtitle,
6608
6641
  "agent-name": s.agentName,
6609
6642
  "default-icon-url": s.defaultIconUrl,
6610
6643
  "quick-links": s.quickLinks,
6611
6644
  "open-threads": s.openThreads,
6612
- busy: i.busy,
6645
+ busy: a.busy,
6613
6646
  onStart: s.startConv,
6614
6647
  onSelect: s.onQuickLink,
6615
6648
  onResume: s.onDrawerPick,
6616
- onViewHistory: t[1] || (t[1] = (N) => i.showHistory = !0)
6617
- }, null, 8, ["welcome-message", "subtitle", "agent-name", "default-icon-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
6618
- i.moreOpen && !s.currentConv ? (c(), P(U, {
6649
+ onViewHistory: t[1] || (t[1] = (N) => a.showHistory = !0)
6650
+ }, null, 8, ["title", "subtitle", "agent-name", "default-icon-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
6651
+ a.moreOpen && !s.currentConv ? (c(), P(U, {
6619
6652
  key: 4,
6620
6653
  "can-rename": !1,
6621
6654
  "can-export": !1,
6622
6655
  "sound-enabled": e.soundEnabled,
6623
6656
  "status-url": s.statusUrl,
6624
6657
  "help-url": s.helpUrl,
6625
- onClose: t[5] || (t[5] = (N) => i.moreOpen = !1),
6658
+ onClose: t[5] || (t[5] = (N) => a.moreOpen = !1),
6626
6659
  onSoundToggle: e.onSoundToggle,
6627
6660
  onAction: s.onMoreAction
6628
- }, null, 8, ["sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : w("", !0)
6661
+ }, null, 8, ["sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0)
6629
6662
  ], 64))
6630
- ], 6)) : w("", !0)
6663
+ ], 6)) : b("", !0)
6631
6664
  ], 6);
6632
6665
  }
6633
- const vo = /* @__PURE__ */ B(to, [["render", _o], ["__scopeId", "data-v-77e30aba"]]), yo = "0.5.54";
6666
+ const vo = /* @__PURE__ */ B(to, [["render", _o], ["__scopeId", "data-v-108e58b4"]]), yo = "0.5.55";
6634
6667
  export {
6635
6668
  oe as AIAvatar,
6636
6669
  ye as AVATAR_COLORS,