@aiden-voice/widget 0.7.0 → 0.7.1

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/widget.js CHANGED
@@ -193,11 +193,11 @@ function te(e) {
193
193
  }
194
194
  //#endregion
195
195
  //#region node_modules/.pnpm/preact@11.0.0/node_modules/preact/dist/preact.mjs
196
- var A, ne, j, re, ie, ae, oe, M, se, ce, le, ue, N = {}, de = [], fe = /^m(i|n|o|s|text|space)$/, pe = Array.isArray, me = de.slice, P = Object.assign;
197
- function he(e) {
196
+ var A, ne, j, re, ie, ae, oe, M, se, ce, le, ue, de = {}, fe = [], pe = /^m(i|n|o|s|text|space)$/, me = Array.isArray, he = fe.slice, N = Object.assign;
197
+ function ge(e) {
198
198
  e && e.parentNode && e.remove();
199
199
  }
200
- function ge(e, t, n, r, i) {
200
+ function _e(e, t, n, r, i) {
201
201
  var a = {
202
202
  type: e,
203
203
  props: t,
@@ -215,41 +215,41 @@ function ge(e, t, n, r, i) {
215
215
  };
216
216
  return !i && A.vnode && A.vnode(a), a;
217
217
  }
218
- function F(e) {
218
+ function P(e) {
219
219
  return e.children;
220
220
  }
221
- function _e(e, t) {
221
+ function ve(e, t) {
222
222
  this.props = e, this.context = t, this.__g = 0;
223
223
  }
224
- function I(e, t) {
225
- if (t == null) return e.__ ? I(e.__, e.__i + 1) : null;
224
+ function F(e, t) {
225
+ if (t == null) return e.__ ? F(e.__, e.__i + 1) : null;
226
226
  for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) && n.__e) return n.__e;
227
- return typeof e.type != "function" || e.props.__P ? null : I(e);
227
+ return typeof e.type != "function" || e.props.__P ? null : F(e);
228
228
  }
229
- function ve(e) {
229
+ function ye(e) {
230
230
  if ((e = e.__) && e.__c && !e.props.__P) return e.__e = null, e.__k.some(function(t) {
231
231
  return t && (e.__e = t.__e);
232
- }), ve(e);
232
+ }), ye(e);
233
233
  }
234
- function ye(e) {
235
- (8 & e.__g || !(e.__g |= 8) || !j.push(e) || ie++) && re == A.debounceRendering || ((re = A.debounceRendering) || queueMicrotask)(be);
234
+ function be(e) {
235
+ (8 & e.__g || !(e.__g |= 8) || !j.push(e) || ie++) && re == A.debounceRendering || ((re = A.debounceRendering) || queueMicrotask)(xe);
236
236
  }
237
- function be() {
237
+ function xe() {
238
238
  var e, t, n, r, i, a, o, s, c;
239
239
  try {
240
- for (t = 1; j.length;) j.length > t && j.sort(ae), e = j.shift(), t = j.length, 8 & e.__g && (r = void 0, i = void 0, a = (i = (n = e).__v).__e, o = [], s = [], (c = n.__P) && ((r = P({ constructor: void 0 }, i)).__v = i.__v + 1, A.vnode && A.vnode(r), Oe(c, r, i, n.__n, c.namespaceURI, 32 & i.__u ? [a] : null, o, a || I(i), 32 & i.__u, s), r.__v = i.__v, r.__.__k[r.__i] = r, Ae(o, r, s), i.__ = i.__e = null, r.__e != a && ve(r)));
240
+ for (t = 1; j.length;) j.length > t && j.sort(ae), e = j.shift(), t = j.length, 8 & e.__g && (r = void 0, i = void 0, a = (i = (n = e).__v).__e, o = [], s = [], (c = n.__P) && ((r = N({ constructor: void 0 }, i)).__v = i.__v + 1, A.vnode && A.vnode(r), ke(c, r, i, n.__n, c.namespaceURI, 32 & i.__u ? [a] : null, o, a || F(i), 32 & i.__u, s), r.__v = i.__v, r.__.__k[r.__i] = r, je(o, r, s), i.__ = i.__e = null, r.__e != a && ye(r)));
241
241
  } finally {
242
242
  j.length = ie = 0;
243
243
  }
244
244
  }
245
- function xe(e, t, n, r, i, a, o, s, c, l, u) {
246
- var d, f, p, m, h, g, _ = r.__k || de, v = t.length;
247
- for (c = Se(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = ~p.__i && _[p.__i] || N, p.__i = d, g = Oe(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && (f.ref != p.ref || 8 & f.__u) && (f.ref != p.ref && f.ref && Me(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h ||= m, 4 & p.__u ? (c = Ce(p, c, e, !f.__v), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
245
+ function Se(e, t, n, r, i, a, o, s, c, l, u) {
246
+ var d, f, p, m, h, g, _ = r.__k || fe, v = t.length;
247
+ for (c = Ce(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = ~p.__i && _[p.__i] || de, p.__i = d, g = ke(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && (f.ref != p.ref || 8 & f.__u) && (f.ref != p.ref && f.ref && Ne(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h ||= m, 4 & p.__u ? (c = we(p, c, e, !f.__v), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
248
248
  return n.__e = h, c;
249
249
  }
250
- function Se(e, t, n, r, i) {
250
+ function Ce(e, t, n, r, i) {
251
251
  var a, o, s, c, l, u, d, f, p, m, h = n.length, g = h, _ = 0, v = !1, y = e.__k = Array(i);
252
- for (a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o != "object" || o.constructor == String ? o = y[a] = ge(null, o) : pe(o) ? o = y[a] = ge(F, { children: o }) : o.constructor === void 0 && o.__b ? o = y[a] = ge(o.type, o.props, o.key, o.ref, o.__v) : y[a] = o, c = a + _, o.__ = e, o.__b = e.__b + 1, s = null, ~(l = o.__i = we(o, n, c, g)) && (g--, (s = n[l]) && (s.__u |= 2)), s && s.__v ? (o.__u |= 2, l == c - 1 ? _-- : l == c + 1 ? _++ : l != c && (l > c ? _-- : _++, v = !0)) : (~l || (i > h ? _-- : i < h && _++), typeof o.type != "function" && (o.__u |= 4))) : y[a] = null;
252
+ for (a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o != "object" || o.constructor == String ? o = y[a] = _e(null, o) : me(o) ? o = y[a] = _e(P, { children: o }) : o.constructor === void 0 && o.__b ? o = y[a] = _e(o.type, o.props, o.key, o.ref, o.__v) : y[a] = o, c = a + _, o.__ = e, o.__b = e.__b + 1, s = null, ~(l = o.__i = Te(o, n, c, g)) && (g--, (s = n[l]) && (s.__u |= 2)), s && s.__v ? (o.__u |= 2, l == c - 1 ? _-- : l == c + 1 ? _++ : l != c && (l > c ? _-- : _++, v = !0)) : (~l || (i > h ? _-- : i < h && _++), typeof o.type != "function" && (o.__u |= 4))) : y[a] = null;
253
253
  if (v) {
254
254
  for (u = [], d = [], a = 0; a < i; a++) if ((o = y[a]) && 2 & o.__u) {
255
255
  for (f = 0, p = u.length; f < p;) u[m = f + p >> 1] < o.__i ? f = m + 1 : p = m;
@@ -257,20 +257,20 @@ function Se(e, t, n, r, i) {
257
257
  }
258
258
  for (_ = u.length; a--;) d[a] && (d[a] == _ ? _-- : y[a].__u |= 4);
259
259
  }
260
- if (g) for (a = 0; a < h; a++) !(s = n[a]) || 2 & s.__u || (s.__e == r && (r = I(s)), Ne(s, s));
260
+ if (g) for (a = 0; a < h; a++) !(s = n[a]) || 2 & s.__u || (s.__e == r && (r = F(s)), Pe(s, s));
261
261
  return r;
262
262
  }
263
- function Ce(e, t, n, r) {
263
+ function we(e, t, n, r) {
264
264
  var i, a;
265
265
  if (typeof e.type == "function") {
266
266
  if (e.props.__P) return t;
267
- if (i = e.__k) for (a = 0; a < i.length; a++) i[a] && (i[a].__ = e, t = Ce(i[a], t, n, !1));
267
+ if (i = e.__k) for (a = 0; a < i.length; a++) i[a] && (i[a].__ = e, t = we(i[a], t, n, !1));
268
268
  return t;
269
269
  }
270
- for (t && !t.parentNode && (t = I(e)) && !t.parentNode && (t = null), e.__e != t && (!r && n.moveBefore && e.__e.parentNode ? n.moveBefore(e.__e, t) : n.insertBefore(e.__e, t || null)), t = e.__e; (t &&= t.nextSibling) && t.nodeType == 8;);
270
+ for (t && !t.parentNode && (t = F(e)) && !t.parentNode && (t = null), e.__e != t && (!r && n.moveBefore && e.__e.parentNode ? n.moveBefore(e.__e, t) : n.insertBefore(e.__e, t || null)), t = e.__e; (t &&= t.nextSibling) && t.nodeType == 8;);
271
271
  return t;
272
272
  }
273
- function we(e, t, n, r) {
273
+ function Te(e, t, n, r) {
274
274
  var i, a, o, s = e.key, c = e.type, l = t[n], u = l && !(2 & l.__u);
275
275
  if (l === null && s == null || u && s == l.key && c == l.type) return n;
276
276
  if (r > +!!u) {
@@ -278,16 +278,16 @@ function we(e, t, n, r) {
278
278
  }
279
279
  return -1;
280
280
  }
281
- function Te(e, t, n) {
281
+ function Ee(e, t, n) {
282
282
  n ??= "", t[0] == "-" ? e.setProperty(t, n) : e[t] = n;
283
283
  }
284
- function Ee(e, t, n, r, i) {
284
+ function De(e, t, n, r, i) {
285
285
  var a;
286
286
  n: if (t == "style") {
287
287
  if (typeof n == "string") e.style.cssText = n;
288
288
  else {
289
- if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || Te(e.style, t, "");
290
- if (n) for (t in n) r && n[t] == r[t] || Te(e.style, t, n[t]);
289
+ if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || Ee(e.style, t, "");
290
+ if (n) for (t in n) r && n[t] == r[t] || Ee(e.style, t, n[t]);
291
291
  }
292
292
  } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(se, "$1")), (t = t.slice(2))[0] < "a" && (t = t.toLowerCase()), (e.__e ||= {})[t + a] = n, n ? r ? n[M] = r[M] : (n[M] = ce, e.addEventListener(t, a ? ue : le, a)) : e.removeEventListener(t, a ? ue : le, a);
293
293
  else {
@@ -299,7 +299,7 @@ function Ee(e, t, n, r, i) {
299
299
  typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
300
300
  }
301
301
  }
302
- function De(e) {
302
+ function Oe(e) {
303
303
  return function(t) {
304
304
  if (this.__e) {
305
305
  var n = this.__e[t.type + e];
@@ -309,7 +309,7 @@ function De(e) {
309
309
  }
310
310
  };
311
311
  }
312
- function Oe(e, t, n, r, i, a, o, s, c, l) {
312
+ function ke(e, t, n, r, i, a, o, s, c, l) {
313
313
  var u, d, f, p, m, h, g, _, v, y, b, x, S, C, ee, w, T, E, D, O, k = t.type;
314
314
  if (t.constructor !== void 0) return null;
315
315
  if (128 & n.__u && (c = 32 & n.__u, u = n.__c.__z)) {
@@ -327,24 +327,24 @@ function Oe(e, t, n, r, i, a, o, s, c, l) {
327
327
  n: if (typeof k == "function") {
328
328
  m = o.length;
329
329
  try {
330
- if (y = t.props, b = (u = k.prototype) && u.render, x = (u = k.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? 2 & (h = t.__c = n.__c).__g && (h.__g |= 1) : (b ? t.__c = h = new k(y, S) : (t.__c = h = new _e(y, S), h.constructor = k, h.render = Pe), x && x.sub(h), h.state || (h.state = {}), h.__n = r, h.__g |= 8, h.__h = [], h.__k = []), b && (h.__s || (h.__s = h.state), k.getDerivedStateFromProps && (h.__s == h.state && (h.__s = P({}, h.__s)), P(h.__s, k.getDerivedStateFromProps(y, h.__s)))), g = h.props, _ = h.state, h.__v = t, n.__c) {
330
+ if (y = t.props, b = (u = k.prototype) && u.render, x = (u = k.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? 2 & (h = t.__c = n.__c).__g && (h.__g |= 1) : (b ? t.__c = h = new k(y, S) : (t.__c = h = new ve(y, S), h.constructor = k, h.render = Fe), x && x.sub(h), h.state || (h.state = {}), h.__n = r, h.__g |= 8, h.__h = [], h.__k = []), b && (h.__s || (h.__s = h.state), k.getDerivedStateFromProps && (h.__s == h.state && (h.__s = N({}, h.__s)), N(h.__s, k.getDerivedStateFromProps(y, h.__s)))), g = h.props, _ = h.state, h.__v = t, n.__c) {
331
331
  if (b && !k.getDerivedStateFromProps && y !== g && h.componentWillReceiveProps && h.componentWillReceiveProps(y, S), t.__v == n.__v && !(8 & h.__g) || !(4 & h.__g) && h.shouldComponentUpdate && !1 === h.shouldComponentUpdate(y, h.__s, S)) {
332
332
  t.__v != n.__v && (h.props = y, h.state = h.__s, h.__g &= -9), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
333
333
  e && (e.__ = t);
334
- }), de.push.apply(h.__h, h.__k), h.__k = [], h.__h.length && o.push(h), s = I(n);
334
+ }), fe.push.apply(h.__h, h.__k), h.__k = [], h.__h.length && o.push(h), s = F(n);
335
335
  break n;
336
336
  }
337
337
  h.componentWillUpdate && h.componentWillUpdate(y, h.__s, S), b && h.componentDidUpdate && h.__h.push(function() {
338
338
  h.componentDidUpdate(g, _, v);
339
339
  });
340
340
  } else b && !k.getDerivedStateFromProps && h.componentWillMount && h.componentWillMount(), b && h.componentDidMount && h.__h.push(h.componentDidMount);
341
- if (h.context = S, h.props = y, h.__P = e, h.__g &= -5, C = A.__r, ee = 0, b) h.state = h.__s, h.__g &= -9, C && C(t), u = h.render(h.props, h.state, h.context), de.push.apply(h.__h, h.__k), h.__k = [];
341
+ if (h.context = S, h.props = y, h.__P = e, h.__g &= -5, C = A.__r, ee = 0, b) h.state = h.__s, h.__g &= -9, C && C(t), u = h.render(h.props, h.state, h.context), fe.push.apply(h.__h, h.__k), h.__k = [];
342
342
  else do
343
343
  h.__g &= -9, C && C(t), u = h.render(h.props, h.state, h.context), h.state = h.__s;
344
344
  while (8 & h.__g && ++ee < 25);
345
- h.state = h.__s, h.getChildContext && (r = P({}, r, h.getChildContext())), b && n.__c && h.getSnapshotBeforeUpdate && (v = h.getSnapshotBeforeUpdate(g, _)), w = u && u.type === F && u.key == null ? u.props.children : u, y.__P && (u = s, i = (e = y.__P).namespaceURI, c = a = null, n.props && n.props.__P != e && (n.__k.some(function(e) {
346
- e && Ne(e, e);
347
- }), n.__k = null), s = n.__k ? I(n, 0) : null), s = xe(e, pe(w) ? w : [w], t, n, r, i, a, o, s, c, l), y.__P && (t.__e = null, s = u), t.__u &= -161, 128 & n.__u && (h.__z = null), d && d.some(he), h.__h.length && o.push(h), 1 & h.__g && (h.__g &= -4);
345
+ h.state = h.__s, h.getChildContext && (r = N({}, r, h.getChildContext())), b && n.__c && h.getSnapshotBeforeUpdate && (v = h.getSnapshotBeforeUpdate(g, _)), w = u && u.type === P && u.key == null ? u.props.children : u, y.__P && (u = s, i = (e = y.__P).namespaceURI, c = a = null, n.props && n.props.__P != e && (n.__k.some(function(e) {
346
+ e && Pe(e, e);
347
+ }), n.__k = null), s = n.__k ? F(n, 0) : null), s = Se(e, me(w) ? w : [w], t, n, r, i, a, o, s, c, l), y.__P && (t.__e = null, s = u), t.__u &= -161, 128 & n.__u && (h.__z = null), d && d.some(ge), h.__h.length && o.push(h), 1 & h.__g && (h.__g &= -4);
348
348
  } catch (e) {
349
349
  if (o.length = m, t.__v = null, c || a) {
350
350
  if (e.then) {
@@ -364,18 +364,18 @@ function Oe(e, t, n, r, i, a, o, s, c, l) {
364
364
  a && (a[a.indexOf(s)] = null), E = s;
365
365
  }
366
366
  t.__c.__z || (t.__c.__z = E), t.__e = s;
367
- } else a && a.some(he);
367
+ } else a && a.some(ge);
368
368
  } else t.__e = n.__e;
369
- t.__k ||= n.__k || [], e.then || ke(t), A.__e(e, t, n);
369
+ t.__k ||= n.__k || [], e.then || Ae(t), A.__e(e, t, n);
370
370
  }
371
- } else s = t.__e = je(n.__e, t, n, r, i, a, o, c, l, e);
371
+ } else s = t.__e = Me(n.__e, t, n, r, i, a, o, c, l, e);
372
372
  return (u = A.diffed) && u(t), 128 & t.__u ? void 0 : s;
373
373
  }
374
- function ke(e) {
375
- e && (e.__c && (e.__c.__g |= 4), e.__k && e.__k.some(ke));
374
+ function Ae(e) {
375
+ e && (e.__c && (e.__c.__g |= 4), e.__k && e.__k.some(Ae));
376
376
  }
377
- function Ae(e, t, n) {
378
- for (var r = 0; r < n.length;) Me(n[r++], n[r++], n[r++]);
377
+ function je(e, t, n) {
378
+ for (var r = 0; r < n.length;) Ne(n[r++], n[r++], n[r++]);
379
379
  A.__c && A.__c(t, e), e.some(function(t) {
380
380
  try {
381
381
  e = t.__h, t.__h = [], e.some(function(e) {
@@ -386,8 +386,8 @@ function Ae(e, t, n) {
386
386
  }
387
387
  });
388
388
  }
389
- function je(e, t, n, r, i, a, o, s, c, l) {
390
- var u, d, f, p, m, h, g, _, v, y = n.props || N, b = t.props, x = t.type;
389
+ function Me(e, t, n, r, i, a, o, s, c, l) {
390
+ var u, d, f, p, m, h, g, _, v, y = n.props || de, b = t.props, x = t.type;
391
391
  if (x == "svg" ? i = "http://www.w3.org/2000/svg" : x == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a) {
392
392
  for (u = 0; u < a.length; u++) if ((m = a[u]) && (x ? m.localName == x : m.nodeType == 3)) {
393
393
  e = m, a[u] = null;
@@ -399,23 +399,23 @@ function je(e, t, n, r, i, a, o, s, c, l) {
399
399
  e = _.createElementNS(i, x, b.is && b), s &&= (A.__m && A.__m(t, a), !1), a = null;
400
400
  }
401
401
  if (x) {
402
- if (l = x == "template" ? e.content : e, a = x == "textarea" && b.defaultValue != null ? null : a && me.call(l.childNodes), !s && a) for (y = {}, u = 0; u < e.attributes.length; u++) y[(m = e.attributes[u]).name] = m.value;
403
- for (u in y) m = y[u], u == "dangerouslySetInnerHTML" ? f = m : u == "children" || u in b || u == "value" && "defaultValue" in b || u == "checked" && "defaultChecked" in b || Ee(e, u, null, m, i);
404
- for (u in v = 1 & n.__u, b) m = b[u], u == "children" ? p = m : u == "dangerouslySetInnerHTML" ? d = m : u == "value" ? h = m : u == "checked" ? g = m : s && typeof m != "function" || !(y[u] !== m || v && m != null) || Ee(e, u, m, y[u], i);
405
- d ? (s || f && (d.__html == f.__html || d.__html == e.innerHTML) || (e.innerHTML = d.__html), t.__k = []) : (f && (e.textContent = ""), (x == "foreignObject" || i == "http://www.w3.org/1998/Math/MathML" && fe.test(x)) && (i = "http://www.w3.org/1999/xhtml"), xe(l, pe(p) ? p : [p], t, n, r, i, a, o, a ? a[0] : n.__k && I(n, 0), s, c), a && a.some(he)), s && x != "textarea" || (u = "value", x == "progress" && h == null ? e.removeAttribute(u) : h == null || h === e[u] && (x != "progress" || h) || Ee(e, u, h, y[u], i), u = "checked", g != null && g != e[u] && Ee(e, u, g, y[u], i));
402
+ if (l = x == "template" ? e.content : e, a = x == "textarea" && b.defaultValue != null ? null : a && he.call(l.childNodes), !s && a) for (y = {}, u = 0; u < e.attributes.length; u++) y[(m = e.attributes[u]).name] = m.value;
403
+ for (u in y) m = y[u], u == "dangerouslySetInnerHTML" ? f = m : u == "children" || u in b || u == "value" && "defaultValue" in b || u == "checked" && "defaultChecked" in b || De(e, u, null, m, i);
404
+ for (u in v = 1 & n.__u, b) m = b[u], u == "children" ? p = m : u == "dangerouslySetInnerHTML" ? d = m : u == "value" ? h = m : u == "checked" ? g = m : s && typeof m != "function" || !(y[u] !== m || v && m != null) || De(e, u, m, y[u], i);
405
+ d ? (s || f && (d.__html == f.__html || d.__html == e.innerHTML) || (e.innerHTML = d.__html), t.__k = []) : (f && (e.textContent = ""), (x == "foreignObject" || i == "http://www.w3.org/1998/Math/MathML" && pe.test(x)) && (i = "http://www.w3.org/1999/xhtml"), Se(l, me(p) ? p : [p], t, n, r, i, a, o, a ? a[0] : n.__k && F(n, 0), s, c), a && a.some(ge)), s && x != "textarea" || (u = "value", x == "progress" && h == null ? e.removeAttribute(u) : h == null || h === e[u] && (x != "progress" || h) || De(e, u, h, y[u], i), u = "checked", g != null && g != e[u] && De(e, u, g, y[u], i));
406
406
  } else y === b || s && e.data == b || (e.data = b);
407
407
  return e;
408
408
  }
409
- function Me(e, t, n) {
409
+ function Ne(e, t, n) {
410
410
  try {
411
411
  typeof e == "function" ? (typeof e.__u == "function" && e.__u(), (typeof e.__u != "function" || t) && (e.__u = e(t))) : e.current = t;
412
412
  } catch (e) {
413
413
  A.__e(e, n);
414
414
  }
415
415
  }
416
- function Ne(e, t, n) {
416
+ function Pe(e, t, n) {
417
417
  var r, i;
418
- if (A.unmount && A.unmount(e), !(r = e.ref) || r.current && r.current != e.__e || Me(r, null, t), r = e.__c) {
418
+ if (A.unmount && A.unmount(e), !(r = e.ref) || r.current && r.current != e.__e || Ne(r, null, t), r = e.__c) {
419
419
  if (r.componentWillUnmount) try {
420
420
  r.componentWillUnmount();
421
421
  } catch (e) {
@@ -423,15 +423,15 @@ function Ne(e, t, n) {
423
423
  }
424
424
  r.__P = r.__n = null;
425
425
  }
426
- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Ne(r[i], t, typeof e.type != "function" || n && !e.props.__P);
427
- (r = e.__e) && (n || he(r), r.__e && (r.__e = null)), e.__e = e.__c = e.__ = null;
426
+ if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Pe(r[i], t, typeof e.type != "function" || n && !e.props.__P);
427
+ (r = e.__e) && (n || ge(r), r.__e && (r.__e = null)), e.__e = e.__c = e.__ = null;
428
428
  }
429
- function Pe(e, t, n) {
429
+ function Fe(e, t, n) {
430
430
  return this.constructor(e, n);
431
431
  }
432
- function Fe(e, t) {
432
+ function Ie(e, t) {
433
433
  var n, r, i, a;
434
- A.__ && A.__(e, t), t.nodeType == 9 && (t = t.documentElement), r = (n = e && 32 & e.__u) ? null : t.__k, t.__k = ge(F, { children: [e] }), i = [], a = [], Oe(t, t.__k, r || N, N, t.namespaceURI, r ? null : t.firstChild ? me.call(t.childNodes) : null, i, r ? r.__e : t.firstChild, n, a), Ae(i, t.__k, a), t.__k.props.children = null;
434
+ A.__ && A.__(e, t), t.nodeType == 9 && (t = t.documentElement), r = (n = e && 32 & e.__u) ? null : t.__k, t.__k = _e(P, { children: [e] }), i = [], a = [], ke(t, t.__k, r || de, de, t.namespaceURI, r ? null : t.firstChild ? he.call(t.childNodes) : null, i, r ? r.__e : t.firstChild, n, a), je(i, t.__k, a), t.__k.props.children = null;
435
435
  }
436
436
  A = { __e: function(e, t, n, r) {
437
437
  for (var i, a, o; t = t.__;) if ((i = t.__c) && !(1 & i.__g)) {
@@ -443,42 +443,42 @@ A = { __e: function(e, t, n, r) {
443
443
  }
444
444
  }
445
445
  throw ie = 0, e;
446
- } }, ne = 0, _e.prototype.setState = function(e, t) {
446
+ } }, ne = 0, ve.prototype.setState = function(e, t) {
447
447
  var n = this.__s;
448
- n && n != this.state || (n = this.__s = P({}, this.state)), typeof e == "function" && (e = e(P({}, n), this.props)), e && (P(n, e), this.__v && (t && this.__k.push(t), ye(this)));
449
- }, _e.prototype.forceUpdate = function(e) {
450
- this.__v && (this.__g |= 4, e && this.__h.push(e), ye(this));
451
- }, _e.prototype.render = F, j = [], ie = 0, ae = function(e, t) {
448
+ n && n != this.state || (n = this.__s = N({}, this.state)), typeof e == "function" && (e = e(N({}, n), this.props)), e && (N(n, e), this.__v && (t && this.__k.push(t), be(this)));
449
+ }, ve.prototype.forceUpdate = function(e) {
450
+ this.__v && (this.__g |= 4, e && this.__h.push(e), be(this));
451
+ }, ve.prototype.render = P, j = [], ie = 0, ae = function(e, t) {
452
452
  return e.__v.__b - t.__v.__b;
453
- }, oe = Symbol(), M = Symbol(), se = /(PointerCapture)$|Capture$/i, ce = 0, le = De(!1), ue = De(!0);
453
+ }, oe = Symbol(), M = Symbol(), se = /(PointerCapture)$|Capture$/i, ce = 0, le = Oe(!1), ue = Oe(!0);
454
454
  //#endregion
455
455
  //#region node_modules/.pnpm/preact@11.0.0/node_modules/preact/hooks/dist/hooks.mjs
456
- var L, R, Ie, Le, Re = Object.is, z = 0, ze = [], Be = [], B = A, Ve = B.__b, He = B.__r, Ue = B.diffed, We = B.__c, Ge = B.unmount, Ke = B.__;
457
- function qe(e, t) {
458
- B.__h && B.__h(R, e, z || t), z = 0;
459
- var n = R.__H || (R.__H = {
456
+ var I, L, Le, Re, ze = Object.is, R = 0, Be = [], Ve = [], z = A, He = z.__b, Ue = z.__r, We = z.diffed, Ge = z.__c, Ke = z.unmount, qe = z.__;
457
+ function Je(e, t) {
458
+ z.__h && z.__h(L, e, R || t), R = 0;
459
+ var n = L.__H || (L.__H = {
460
460
  __: [],
461
461
  __h: []
462
462
  });
463
463
  return e >= n.__.length && n.__.push({}), n.__[e];
464
464
  }
465
- function V(e) {
466
- return z = 1, Je(nt, e);
465
+ function Ye(e) {
466
+ return R = 1, Xe(it, e);
467
467
  }
468
- function Je(e, t, n) {
469
- var r = qe(L++, 2);
470
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : nt(void 0, t), function(e) {
468
+ function Xe(e, t, n) {
469
+ var r = Je(I++, 2);
470
+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : it(void 0, t), function(e) {
471
471
  var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
472
- Re(t, n) || (r.__N = [n, r.__[1]], r.__c.setState({}));
473
- }], r.__c = R, !R.__f)) {
474
- R.__f = !0;
475
- var i = R.shouldComponentUpdate;
476
- R.shouldComponentUpdate = function(e, t, n) {
472
+ ze(t, n) || (r.__N = [n, r.__[1]], r.__c.setState({}));
473
+ }], r.__c = L, !L.__f)) {
474
+ L.__f = !0;
475
+ var i = L.shouldComponentUpdate;
476
+ L.shouldComponentUpdate = function(e, t, n) {
477
477
  var r = this.__H;
478
478
  if (!r) return !0;
479
479
  var a = !1, o = this.props != e;
480
480
  if (r.__.some(function(e) {
481
- e.__N && (a = !0, Re(e.__[0], e.__N[0]) || (o = !0));
481
+ e.__N && (a = !0, ze(e.__[0], e.__N[0]) || (o = !0));
482
482
  }), i) {
483
483
  var s = i.call(this, e, t, n);
484
484
  return a ? s || o : s;
@@ -488,67 +488,67 @@ function Je(e, t, n) {
488
488
  }
489
489
  return r.__;
490
490
  }
491
- function H(e, t) {
492
- var n = qe(L++, 3);
493
- !B.__s && tt(n.__H, t) && (n.__P = !0, n.__ = e, n.u = t, R.__H.__h.push(n));
491
+ function B(e, t) {
492
+ var n = Je(I++, 3);
493
+ !z.__s && rt(n.__H, t) && (n.__P = !0, n.__ = e, n.u = t, L.__H.__h.push(n));
494
494
  }
495
- function U(e) {
496
- return z = 5, Ye(function() {
495
+ function V(e) {
496
+ return R = 5, Ze(function() {
497
497
  return { current: e };
498
498
  }, []);
499
499
  }
500
- function Ye(e, t) {
501
- var n = qe(L++, 7);
502
- return tt(n.__H, t) && (n.__ = e(), n.__H = t), n.__;
500
+ function Ze(e, t) {
501
+ var n = Je(I++, 7);
502
+ return rt(n.__H, t) && (n.__ = e(), n.__H = t), n.__;
503
503
  }
504
- function Xe() {
504
+ function Qe() {
505
505
  var e;
506
506
  do {
507
- for (; e = Be.shift();) try {
508
- W(e);
507
+ for (; e = Ve.shift();) try {
508
+ H(e);
509
509
  } catch (t) {
510
- B.__e(t, { __: (e = e.__P) && e.__v });
510
+ z.__e(t, { __: (e = e.__P) && e.__v });
511
511
  }
512
- for (; e = ze.shift();) {
512
+ for (; e = Be.shift();) {
513
513
  var t = e.__H;
514
514
  if (e.__P && t) try {
515
- t.__h.some(W), t.__h.some(et), t.__h = [];
515
+ t.__h.some(H), t.__h.some(nt), t.__h = [];
516
516
  } catch (n) {
517
- t.__h = [], B.__e(n, e.__v);
517
+ t.__h = [], z.__e(n, e.__v);
518
518
  }
519
519
  }
520
- } while (Be.length);
521
- }
522
- B.__b = function(e) {
523
- R = null, Ve && Ve(e);
524
- }, B.__ = function(e, t) {
525
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Ke && Ke(e, t);
526
- }, B.__r = function(e) {
527
- He && He(e), L = 0;
528
- var t = (R = e.__c).__H;
529
- t && (Ie == R ? R.__h = [] : (t.__h.some(W), t.__h.some(et), L = 0), t.__h = [], t.__.some(function(e) {
520
+ } while (Ve.length);
521
+ }
522
+ z.__b = function(e) {
523
+ L = null, He && He(e);
524
+ }, z.__ = function(e, t) {
525
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), qe && qe(e, t);
526
+ }, z.__r = function(e) {
527
+ Ue && Ue(e), I = 0;
528
+ var t = (L = e.__c).__H;
529
+ t && (Le == L ? L.__h = [] : (t.__h.some(H), t.__h.some(nt), I = 0), t.__h = [], t.__.some(function(e) {
530
530
  e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
531
- })), Ie = R;
532
- }, B.diffed = function(e) {
533
- Ue && Ue(e);
531
+ })), Le = L;
532
+ }, z.diffed = function(e) {
533
+ We && We(e);
534
534
  var t = e.__c;
535
- t && t.__H && (t.__H.__h.length && $e(ze.push(t)), t.__H.__.some(function(e) {
535
+ t && t.__H && (t.__H.__h.length && tt(Be.push(t)), t.__H.__.some(function(e) {
536
536
  e.u && (e.__H = e.u);
537
- })), Ie = R = null;
538
- }, B.__c = function(e, t) {
537
+ })), Le = L = null;
538
+ }, z.__c = function(e, t) {
539
539
  t.some(function(e) {
540
540
  try {
541
- e.__h.some(W), e.__h = e.__h.filter(function(e) {
542
- return !e.__ || et(e);
541
+ e.__h.some(H), e.__h = e.__h.filter(function(e) {
542
+ return !e.__ || nt(e);
543
543
  });
544
544
  } catch (n) {
545
545
  t.some(function(e) {
546
546
  e.__h &&= [];
547
- }), t = [], B.__e(n, e.__v);
547
+ }), t = [], z.__e(n, e.__v);
548
548
  }
549
- }), We && We(e, t);
550
- }, B.unmount = function(e) {
551
- Ge && Ge(e);
549
+ }), Ge && Ge(e, t);
550
+ }, z.unmount = function(e) {
551
+ Ke && Ke(e);
552
552
  var t, n, r = e.__c;
553
553
  r && r.__H && (r.__H.__.some(function(r) {
554
554
  try {
@@ -557,44 +557,44 @@ B.__b = function(e) {
557
557
  for (n = e.__; n && (!n.__c || !n.__c.__P);) n = n.__;
558
558
  n &&= n.__c;
559
559
  }
560
- r.__P = n, $e(Be.push(r));
561
- } else W(r);
560
+ r.__P = n, tt(Ve.push(r));
561
+ } else H(r);
562
562
  } catch (e) {
563
563
  t = e;
564
564
  }
565
- }), r.__H = void 0, t && B.__e(t, r.__v));
565
+ }), r.__H = void 0, t && z.__e(t, r.__v));
566
566
  };
567
- var Ze = typeof requestAnimationFrame == "function";
568
- function Qe(e) {
567
+ var $e = typeof requestAnimationFrame == "function";
568
+ function et(e) {
569
569
  var t, n = function() {
570
- clearTimeout(r), Ze && cancelAnimationFrame(t), setTimeout(e);
570
+ clearTimeout(r), $e && cancelAnimationFrame(t), setTimeout(e);
571
571
  }, r = setTimeout(n, 35);
572
- Ze && (t = requestAnimationFrame(n));
572
+ $e && (t = requestAnimationFrame(n));
573
573
  }
574
- function $e(e) {
575
- e != 1 && Le == B.requestAnimationFrame || ((Le = B.requestAnimationFrame) || Qe)(Xe);
574
+ function tt(e) {
575
+ e != 1 && Re == z.requestAnimationFrame || ((Re = z.requestAnimationFrame) || et)(Qe);
576
576
  }
577
- function W(e) {
578
- var t = R, n = e.__c;
579
- typeof n == "function" && (e.__c = void 0, n()), R = t;
577
+ function H(e) {
578
+ var t = L, n = e.__c;
579
+ typeof n == "function" && (e.__c = void 0, n()), L = t;
580
580
  }
581
- function et(e) {
582
- var t = R;
583
- e.__c = e.__(), R = t;
581
+ function nt(e) {
582
+ var t = L;
583
+ e.__c = e.__(), L = t;
584
584
  }
585
- function tt(e, t) {
585
+ function rt(e, t) {
586
586
  return !e || e.length != t.length || t.some(function(t, n) {
587
- return !Re(t, e[n]);
587
+ return !ze(t, e[n]);
588
588
  });
589
589
  }
590
- function nt(e, t) {
590
+ function it(e, t) {
591
591
  return typeof t == "function" ? t(e) : t;
592
592
  }
593
593
  //#endregion
594
594
  //#region node_modules/.pnpm/preact@11.0.0/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs
595
- var rt = 0;
595
+ var at = 0;
596
596
  Array.isArray;
597
- function G(e, t, n, r, i, a) {
597
+ function U(e, t, n, r, i, a) {
598
598
  t ||= {};
599
599
  var o, s, c = t;
600
600
  if ("ref" in c && typeof e != "function") for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];
@@ -609,7 +609,7 @@ function G(e, t, n, r, i, a) {
609
609
  __e: null,
610
610
  __c: null,
611
611
  constructor: void 0,
612
- __v: --rt,
612
+ __v: --at,
613
613
  __i: -1,
614
614
  __u: 0
615
615
  };
@@ -617,8 +617,8 @@ function G(e, t, n, r, i, a) {
617
617
  }
618
618
  //#endregion
619
619
  //#region src/components/icons.tsx
620
- function K({ name: e, size: t, children: n }) {
621
- return /* @__PURE__ */ G("svg", {
620
+ function W({ name: e, size: t, children: n }) {
621
+ return /* @__PURE__ */ U("svg", {
622
622
  "data-icon": e,
623
623
  "aria-hidden": "true",
624
624
  focusable: "false",
@@ -633,83 +633,83 @@ function K({ name: e, size: t, children: n }) {
633
633
  children: n
634
634
  });
635
635
  }
636
- function it({ size: e = 26 }) {
637
- return /* @__PURE__ */ G(K, {
636
+ function ot({ size: e = 26 }) {
637
+ return /* @__PURE__ */ U(W, {
638
638
  name: "chat",
639
639
  size: e,
640
- children: [/* @__PURE__ */ G("path", { d: "M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H10l-4.5 4v-4h0A1.5 1.5 0 0 1 4 14.5z" }), /* @__PURE__ */ G("path", {
640
+ children: [/* @__PURE__ */ U("path", { d: "M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H10l-4.5 4v-4h0A1.5 1.5 0 0 1 4 14.5z" }), /* @__PURE__ */ U("path", {
641
641
  d: "M8.5 9.5h.01M12 9.5h.01M15.5 9.5h.01",
642
642
  "stroke-width": "2.5"
643
643
  })]
644
644
  });
645
645
  }
646
- function at({ size: e = 26 }) {
647
- return /* @__PURE__ */ G(K, {
646
+ function st({ size: e = 26 }) {
647
+ return /* @__PURE__ */ U(W, {
648
648
  name: "message",
649
649
  size: e,
650
- children: /* @__PURE__ */ G("path", { d: "M21 11.5a8.5 8.5 0 0 1-12.4 7.5L3 20.5l1.6-5.1A8.5 8.5 0 1 1 21 11.5z" })
650
+ children: /* @__PURE__ */ U("path", { d: "M21 11.5a8.5 8.5 0 0 1-12.4 7.5L3 20.5l1.6-5.1A8.5 8.5 0 1 1 21 11.5z" })
651
651
  });
652
652
  }
653
- function ot({ size: e = 26 }) {
654
- return /* @__PURE__ */ G(K, {
653
+ function ct({ size: e = 26 }) {
654
+ return /* @__PURE__ */ U(W, {
655
655
  name: "sparkle",
656
656
  size: e,
657
- children: [/* @__PURE__ */ G("path", { d: "M11 3l1.9 5.1L18 10l-5.1 1.9L11 17l-1.9-5.1L4 10l5.1-1.9z" }), /* @__PURE__ */ G("path", { d: "M19 15l.7 1.8 1.8.7-1.8.7L19 20l-.7-1.8-1.8-.7 1.8-.7z" })]
657
+ children: [/* @__PURE__ */ U("path", { d: "M11 3l1.9 5.1L18 10l-5.1 1.9L11 17l-1.9-5.1L4 10l5.1-1.9z" }), /* @__PURE__ */ U("path", { d: "M19 15l.7 1.8 1.8.7-1.8.7L19 20l-.7-1.8-1.8-.7 1.8-.7z" })]
658
658
  });
659
659
  }
660
- function st({ size: e = 26 }) {
661
- return /* @__PURE__ */ G(K, {
660
+ function lt({ size: e = 26 }) {
661
+ return /* @__PURE__ */ U(W, {
662
662
  name: "chevron-down",
663
663
  size: e,
664
- children: /* @__PURE__ */ G("path", { d: "M6 9l6 6 6-6" })
664
+ children: /* @__PURE__ */ U("path", { d: "M6 9l6 6 6-6" })
665
665
  });
666
666
  }
667
- function ct({ size: e = 18 }) {
668
- return /* @__PURE__ */ G(K, {
667
+ function ut({ size: e = 18 }) {
668
+ return /* @__PURE__ */ U(W, {
669
669
  name: "close",
670
670
  size: e,
671
- children: /* @__PURE__ */ G("path", { d: "M6 6l12 12M18 6L6 18" })
671
+ children: /* @__PURE__ */ U("path", { d: "M6 6l12 12M18 6L6 18" })
672
672
  });
673
673
  }
674
- var lt = "M7 11v9M7 11l3.5-7.2A1.8 1.8 0 0 1 14 4.6V9h4.6a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 17.4 20H7M7 11H4.5A1.5 1.5 0 0 0 3 12.5v6A1.5 1.5 0 0 0 4.5 20H7";
675
- function ut({ size: e = 16 }) {
676
- return /* @__PURE__ */ G(K, {
674
+ var dt = "M7 11v9M7 11l3.5-7.2A1.8 1.8 0 0 1 14 4.6V9h4.6a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 17.4 20H7M7 11H4.5A1.5 1.5 0 0 0 3 12.5v6A1.5 1.5 0 0 0 4.5 20H7";
675
+ function ft({ size: e = 16 }) {
676
+ return /* @__PURE__ */ U(W, {
677
677
  name: "thumb-up",
678
678
  size: e,
679
- children: /* @__PURE__ */ G("path", { d: lt })
679
+ children: /* @__PURE__ */ U("path", { d: dt })
680
680
  });
681
681
  }
682
- function dt({ size: e = 16 }) {
683
- return /* @__PURE__ */ G(K, {
682
+ function pt({ size: e = 16 }) {
683
+ return /* @__PURE__ */ U(W, {
684
684
  name: "thumb-down",
685
685
  size: e,
686
- children: /* @__PURE__ */ G("path", {
687
- d: lt,
686
+ children: /* @__PURE__ */ U("path", {
687
+ d: dt,
688
688
  transform: "matrix(1 0 0 -1 0 24)"
689
689
  })
690
690
  });
691
691
  }
692
692
  //#endregion
693
693
  //#region src/components/Launcher.tsx
694
- var ft = {
695
- chat: it,
696
- message: at,
697
- sparkle: ot
698
- }, pt = {
699
- "chevron-down": st,
700
- close: ct
694
+ var mt = {
695
+ chat: ot,
696
+ message: st,
697
+ sparkle: ct
698
+ }, ht = {
699
+ "chevron-down": lt,
700
+ close: ut
701
701
  };
702
- function mt({ isOpen: e, onClick: t, iconUrl: n, icon: r = "chat", openIconUrl: i, openIcon: a = "chevron-down", buttonRef: o }) {
703
- let [s, c] = V("loading"), [l, u] = V("loading"), d = n !== void 0 && s !== "failed", f = i !== void 0 && l !== "failed", p = d && !e && s === "loaded", m = f && e && l === "loaded", h = ft[r] ?? it, g = pt[a] ?? st;
704
- return /* @__PURE__ */ G("button", {
702
+ function gt({ isOpen: e, onClick: t, iconUrl: n, icon: r = "chat", openIconUrl: i, openIcon: a = "chevron-down", buttonRef: o }) {
703
+ let [s, c] = Ye("loading"), [l, u] = Ye("loading"), d = n !== void 0 && s !== "failed", f = i !== void 0 && l !== "failed", p = d && !e && s === "loaded", m = f && e && l === "loaded", h = mt[r] ?? ot, g = ht[a] ?? lt;
704
+ return /* @__PURE__ */ U("button", {
705
705
  type: "button",
706
706
  class: "whoo-widget-launcher",
707
707
  onClick: t,
708
708
  "aria-label": e ? "Close chat" : "Open chat",
709
709
  ref: o,
710
710
  children: [
711
- e ? m ? null : /* @__PURE__ */ G(g, {}) : p ? null : /* @__PURE__ */ G(h, {}),
712
- d ? /* @__PURE__ */ G("img", {
711
+ e ? m ? null : /* @__PURE__ */ U(g, {}) : p ? null : /* @__PURE__ */ U(h, {}),
712
+ d ? /* @__PURE__ */ U("img", {
713
713
  class: "whoo-widget-launcher-icon-image",
714
714
  src: n,
715
715
  alt: "",
@@ -718,7 +718,7 @@ function mt({ isOpen: e, onClick: t, iconUrl: n, icon: r = "chat", openIconUrl:
718
718
  onLoad: () => c("loaded"),
719
719
  onError: () => c("failed")
720
720
  }) : null,
721
- f ? /* @__PURE__ */ G("img", {
721
+ f ? /* @__PURE__ */ U("img", {
722
722
  class: "whoo-widget-launcher-icon-image",
723
723
  src: i,
724
724
  alt: "",
@@ -732,16 +732,16 @@ function mt({ isOpen: e, onClick: t, iconUrl: n, icon: r = "chat", openIconUrl:
732
732
  }
733
733
  //#endregion
734
734
  //#region src/components/Composer.tsx
735
- function ht({ value: e, onChange: t, onSend: n, disabled: r, inputRef: i }) {
736
- return /* @__PURE__ */ G("div", {
735
+ function _t({ value: e, onChange: t, onSend: n, disabled: r, inputRef: i }) {
736
+ return /* @__PURE__ */ U("div", {
737
737
  class: "whoo-widget-composer",
738
738
  children: [
739
- /* @__PURE__ */ G("label", {
739
+ /* @__PURE__ */ U("label", {
740
740
  class: "whoo-widget-sr-only",
741
741
  for: "whoo-widget-composer-input",
742
742
  children: "Message"
743
743
  }),
744
- /* @__PURE__ */ G("input", {
744
+ /* @__PURE__ */ U("input", {
745
745
  id: "whoo-widget-composer-input",
746
746
  class: "whoo-widget-composer-input",
747
747
  value: e,
@@ -753,7 +753,7 @@ function ht({ value: e, onChange: t, onSend: n, disabled: r, inputRef: i }) {
753
753
  e.key === "Enter" && n();
754
754
  }
755
755
  }),
756
- /* @__PURE__ */ G("button", {
756
+ /* @__PURE__ */ U("button", {
757
757
  type: "button",
758
758
  class: "whoo-widget-composer-send",
759
759
  "aria-disabled": r,
@@ -767,8 +767,8 @@ function ht({ value: e, onChange: t, onSend: n, disabled: r, inputRef: i }) {
767
767
  }
768
768
  //#endregion
769
769
  //#region src/components/ErrorBanner.tsx
770
- function gt({ message: e }) {
771
- return /* @__PURE__ */ G("div", {
770
+ function vt({ message: e }) {
771
+ return /* @__PURE__ */ U("div", {
772
772
  class: "whoo-widget-error-banner",
773
773
  role: "alert",
774
774
  children: e
@@ -776,8 +776,8 @@ function gt({ message: e }) {
776
776
  }
777
777
  //#endregion
778
778
  //#region src/markdown/tokenizer.ts
779
- var _t = /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/y, vt = /\*\*([^*\s](?:[^*]*[^*\s])?)\*\*/y, yt = /(?<![A-Za-z0-9_])_([^_\s](?:[^_]*[^_\s])?)_(?![A-Za-z0-9_])/y, bt = /\*([^*\s](?:[^*]*[^*\s])?)\*/y, xt = /[ \t]*[*+-][ \t]+/y, St = /https?:\/\/\S+/y, Ct = /[.,;:!?)\]}>]+$/;
780
- function wt(e) {
779
+ var yt = /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/y, bt = /\*\*([^*\s](?:[^*]*[^*\s])?)\*\*/y, xt = /(?<![A-Za-z0-9_])_([^_\s](?:[^_]*[^_\s])?)_(?![A-Za-z0-9_])/y, St = /\*([^*\s](?:[^*]*[^*\s])?)\*/y, Ct = /[ \t]*[*+-][ \t]+/y, wt = /https?:\/\/\S+/y, Tt = /[.,;:!?)\]}>]+$/;
780
+ function Et(e) {
781
781
  let t = [], n = 0, r = 0, i = (n) => {
782
782
  n > r && t.push({
783
783
  type: "text",
@@ -787,13 +787,13 @@ function wt(e) {
787
787
  });
788
788
  };
789
789
  for (; n < e.length;) {
790
- if ((n === 0 || e[n - 1] === "\n") && (xt.lastIndex = n, xt.exec(e))) {
790
+ if ((n === 0 || e[n - 1] === "\n") && (Ct.lastIndex = n, Ct.exec(e))) {
791
791
  i(n), t.push({
792
792
  type: "text",
793
793
  value: "• ",
794
794
  start: n,
795
- end: xt.lastIndex
796
- }), n = xt.lastIndex, r = n;
795
+ end: Ct.lastIndex
796
+ }), n = Ct.lastIndex, r = n;
797
797
  continue;
798
798
  }
799
799
  if (e[n] === "!" && n + 1 < e.length && e[n + 1] === "[") {
@@ -806,56 +806,56 @@ function wt(e) {
806
806
  }
807
807
  }
808
808
  if (e[n - 1] !== "!") {
809
- _t.lastIndex = n;
810
- let a = _t.exec(e);
809
+ yt.lastIndex = n;
810
+ let a = yt.exec(e);
811
811
  if (a) {
812
812
  i(n), t.push({
813
813
  type: "link",
814
814
  text: a[1],
815
815
  url: a[2],
816
816
  start: n,
817
- end: _t.lastIndex
818
- }), n = _t.lastIndex, r = n;
817
+ end: yt.lastIndex
818
+ }), n = yt.lastIndex, r = n;
819
819
  continue;
820
820
  }
821
821
  }
822
- vt.lastIndex = n;
823
- let a = vt.exec(e);
822
+ bt.lastIndex = n;
823
+ let a = bt.exec(e);
824
824
  if (a) {
825
825
  i(n), t.push({
826
826
  type: "bold",
827
827
  value: a[1],
828
828
  start: n,
829
- end: vt.lastIndex
830
- }), n = vt.lastIndex, r = n;
829
+ end: bt.lastIndex
830
+ }), n = bt.lastIndex, r = n;
831
831
  continue;
832
832
  }
833
- yt.lastIndex = n;
834
- let o = yt.exec(e);
833
+ xt.lastIndex = n;
834
+ let o = xt.exec(e);
835
835
  if (o) {
836
836
  i(n), t.push({
837
837
  type: "italic",
838
838
  value: o[1],
839
839
  start: n,
840
- end: yt.lastIndex
841
- }), n = yt.lastIndex, r = n;
840
+ end: xt.lastIndex
841
+ }), n = xt.lastIndex, r = n;
842
842
  continue;
843
843
  }
844
- bt.lastIndex = n;
845
- let s = bt.exec(e);
844
+ St.lastIndex = n;
845
+ let s = St.exec(e);
846
846
  if (s) {
847
847
  i(n), t.push({
848
848
  type: "italic",
849
849
  value: s[1],
850
850
  start: n,
851
- end: bt.lastIndex
852
- }), n = bt.lastIndex, r = n;
851
+ end: St.lastIndex
852
+ }), n = St.lastIndex, r = n;
853
853
  continue;
854
854
  }
855
- St.lastIndex = n;
856
- let c = St.exec(e);
855
+ wt.lastIndex = n;
856
+ let c = wt.exec(e);
857
857
  if (c) {
858
- let e = c[0].match(Ct), a = e ? c[0].slice(0, c[0].length - e[0].length) : c[0];
858
+ let e = c[0].match(Tt), a = e ? c[0].slice(0, c[0].length - e[0].length) : c[0];
859
859
  if (a.length > 0) {
860
860
  i(n), t.push({
861
861
  type: "link",
@@ -873,8 +873,8 @@ function wt(e) {
873
873
  }
874
874
  //#endregion
875
875
  //#region src/markdown/render.tsx
876
- var Tt = /^[ \t]*[*+-][ \t]+(.*)$/;
877
- function Et(e) {
876
+ var Dt = /^[ \t]*[*+-][ \t]+(.*)$/;
877
+ function Ot(e) {
878
878
  let t = [], n = [], r = [], i = () => {
879
879
  n.length > 0 && t.push({
880
880
  type: "text",
@@ -887,7 +887,7 @@ function Et(e) {
887
887
  }), r = [];
888
888
  };
889
889
  for (let t of e.split("\n")) {
890
- let e = t.match(Tt);
890
+ let e = t.match(Dt);
891
891
  e ? (i(), r.push(e[1])) : (a(), n.push(t));
892
892
  }
893
893
  return i(), a(), t.some((e) => e.type === "list") ? t.flatMap((e, n) => {
@@ -899,16 +899,16 @@ function Et(e) {
899
899
  }];
900
900
  }) : null;
901
901
  }
902
- function q(e) {
903
- return wt(e).map((e, t) => {
902
+ function G(e) {
903
+ return Et(e).map((e, t) => {
904
904
  switch (e.type) {
905
- case "bold": return /* @__PURE__ */ G("strong", { children: q(e.value) }, t);
906
- case "italic": return /* @__PURE__ */ G("em", { children: q(e.value) }, t);
907
- case "link": return /* @__PURE__ */ G("a", {
905
+ case "bold": return /* @__PURE__ */ U("strong", { children: G(e.value) }, t);
906
+ case "italic": return /* @__PURE__ */ U("em", { children: G(e.value) }, t);
907
+ case "link": return /* @__PURE__ */ U("a", {
908
908
  href: e.url,
909
909
  target: "_blank",
910
910
  rel: "noopener noreferrer",
911
- children: [e.text, /* @__PURE__ */ G("span", {
911
+ children: [e.text, /* @__PURE__ */ U("span", {
912
912
  class: "whoo-widget-sr-only",
913
913
  children: " (opens in new tab)"
914
914
  })]
@@ -917,16 +917,16 @@ function q(e) {
917
917
  }
918
918
  });
919
919
  }
920
- function Dt(e) {
921
- let t = e.replace(/\r\n?/g, "\n"), n = Et(t);
922
- return n ? n.map((e, t) => e.type === "list" ? /* @__PURE__ */ G("ul", {
920
+ function kt(e) {
921
+ let t = e.replace(/\r\n?/g, "\n"), n = Ot(t);
922
+ return n ? n.map((e, t) => e.type === "list" ? /* @__PURE__ */ U("ul", {
923
923
  class: "whoo-widget-list",
924
- children: e.items.map((e, t) => /* @__PURE__ */ G("li", { children: q(e) }, t))
925
- }, t) : /* @__PURE__ */ G("span", { children: q(e.text) }, t)) : q(t);
924
+ children: e.items.map((e, t) => /* @__PURE__ */ U("li", { children: G(e) }, t))
925
+ }, t) : /* @__PURE__ */ U("span", { children: G(e.text) }, t)) : G(t);
926
926
  }
927
927
  //#endregion
928
928
  //#region src/components/MessageFeedback.tsx
929
- var Ot = [
929
+ var At = [
930
930
  {
931
931
  value: "",
932
932
  label: "Select a reason (optional)"
@@ -948,45 +948,54 @@ var Ot = [
948
948
  label: "Other"
949
949
  }
950
950
  ];
951
- function kt({ state: e, containerRef: t, onThumbsUp: n, onThumbsDown: r, onDraftChange: i, onSubmitDetailed: a, onCancel: o }) {
952
- let s = e.correction ?? "", c = e.category ?? "", l = U(e.status);
953
- if (H(() => {
951
+ function jt({ state: e, containerRef: t, onThumbsUp: n, onThumbsDown: r, onDraftChange: i, onSubmitDetailed: a, onCancel: o }) {
952
+ let s = e.correction ?? "", c = e.category ?? "", l = V(e.status), u = V(null), d = V(null);
953
+ if (B(() => {
954
954
  let n = l.current;
955
955
  if (l.current = e.status, n === e.status) return;
956
+ if (e.status === "expanded") {
957
+ u.current?.focus();
958
+ return;
959
+ }
960
+ if (n === "expanded" && e.status === "idle") {
961
+ d.current?.focus();
962
+ return;
963
+ }
956
964
  let r = t?.current;
957
965
  if (!r) return;
958
966
  let i = r.getRootNode();
959
967
  r.contains(i.activeElement) || r.focus();
960
- }, [e.status, t]), e.status === "expanded") return /* @__PURE__ */ G("div", {
968
+ }, [e.status, t]), e.status === "expanded") return /* @__PURE__ */ U("div", {
961
969
  class: "whoo-widget-feedback-form",
962
970
  children: [
963
- /* @__PURE__ */ G("label", { children: [/* @__PURE__ */ G("span", {
971
+ /* @__PURE__ */ U("label", { children: [/* @__PURE__ */ U("span", {
964
972
  class: "whoo-widget-sr-only",
965
973
  children: "Additional feedback"
966
- }), /* @__PURE__ */ G("textarea", {
974
+ }), /* @__PURE__ */ U("textarea", {
975
+ ref: u,
967
976
  class: "whoo-widget-feedback-textarea",
968
977
  value: s,
969
978
  onInput: (e) => i(e.target.value, c),
970
979
  placeholder: "What was wrong? (optional)"
971
980
  })] }),
972
- /* @__PURE__ */ G("select", {
981
+ /* @__PURE__ */ U("select", {
973
982
  class: "whoo-widget-feedback-select",
974
983
  "aria-label": "Feedback category",
975
984
  value: c,
976
985
  onChange: (e) => i(s, e.target.value),
977
- children: Ot.map((e) => /* @__PURE__ */ G("option", {
986
+ children: At.map((e) => /* @__PURE__ */ U("option", {
978
987
  value: e.value,
979
988
  children: e.label
980
989
  }, e.value))
981
990
  }),
982
- /* @__PURE__ */ G("div", {
991
+ /* @__PURE__ */ U("div", {
983
992
  class: "whoo-widget-feedback-form-buttons",
984
- children: [/* @__PURE__ */ G("button", {
993
+ children: [/* @__PURE__ */ U("button", {
985
994
  type: "button",
986
995
  class: "whoo-widget-feedback-submit",
987
996
  onClick: () => a(s, c),
988
997
  children: "Submit"
989
- }), /* @__PURE__ */ G("button", {
998
+ }), /* @__PURE__ */ U("button", {
990
999
  type: "button",
991
1000
  class: "whoo-widget-feedback-cancel",
992
1001
  onClick: o,
@@ -995,54 +1004,55 @@ function kt({ state: e, containerRef: t, onThumbsUp: n, onThumbsDown: r, onDraft
995
1004
  })
996
1005
  ]
997
1006
  });
998
- let u = e.status === "submitting", d = e.status === "submitted";
999
- return /* @__PURE__ */ G("div", {
1007
+ let f = e.status === "submitting", p = e.status === "submitted";
1008
+ return /* @__PURE__ */ U("div", {
1000
1009
  class: "whoo-widget-feedback",
1001
- children: [d ? null : /* @__PURE__ */ G("div", {
1010
+ children: [p ? null : /* @__PURE__ */ U("div", {
1002
1011
  class: "whoo-widget-feedback-buttons",
1003
- children: [/* @__PURE__ */ G("button", {
1012
+ children: [/* @__PURE__ */ U("button", {
1004
1013
  type: "button",
1005
1014
  "aria-label": "Good response",
1006
- disabled: u,
1015
+ disabled: f,
1007
1016
  onClick: n,
1008
- children: /* @__PURE__ */ G(ut, {})
1009
- }), /* @__PURE__ */ G("button", {
1017
+ children: /* @__PURE__ */ U(ft, {})
1018
+ }), /* @__PURE__ */ U("button", {
1019
+ ref: d,
1010
1020
  type: "button",
1011
1021
  "aria-label": "Bad response",
1012
- disabled: u,
1022
+ disabled: f,
1013
1023
  onClick: r,
1014
- children: /* @__PURE__ */ G(dt, {})
1024
+ children: /* @__PURE__ */ U(pt, {})
1015
1025
  })]
1016
- }), /* @__PURE__ */ G("div", {
1026
+ }), /* @__PURE__ */ U("div", {
1017
1027
  role: "status",
1018
- class: d ? "whoo-widget-feedback-submitted" : e.status === "error" ? "whoo-widget-feedback-error" : void 0,
1019
- children: d ? "Thanks for the feedback" : e.status === "error" ? "Couldn't send feedback" : null
1028
+ class: p ? "whoo-widget-feedback-submitted" : e.status === "error" ? "whoo-widget-feedback-error" : void 0,
1029
+ children: p ? "Thanks for the feedback" : e.status === "error" ? "Couldn't send feedback" : null
1020
1030
  })]
1021
1031
  });
1022
1032
  }
1023
1033
  //#endregion
1024
1034
  //#region src/components/MessageList.tsx
1025
- function At({ isSlowResponse: e }) {
1026
- return /* @__PURE__ */ G("div", {
1035
+ function Mt({ isSlowResponse: e }) {
1036
+ return /* @__PURE__ */ U("div", {
1027
1037
  class: "whoo-widget-pending",
1028
1038
  role: "status",
1029
- children: [/* @__PURE__ */ G("span", {
1039
+ children: [/* @__PURE__ */ U("span", {
1030
1040
  class: "whoo-widget-typing",
1031
1041
  "aria-hidden": "true",
1032
1042
  children: [
1033
- /* @__PURE__ */ G("span", {}),
1034
- /* @__PURE__ */ G("span", {}),
1035
- /* @__PURE__ */ G("span", {})
1043
+ /* @__PURE__ */ U("span", {}),
1044
+ /* @__PURE__ */ U("span", {}),
1045
+ /* @__PURE__ */ U("span", {})
1036
1046
  ]
1037
- }), e ? /* @__PURE__ */ G("span", {
1047
+ }), e ? /* @__PURE__ */ U("span", {
1038
1048
  class: "whoo-widget-pending-text",
1039
1049
  children: "Looking that up for you…"
1040
1050
  }) : null]
1041
1051
  });
1042
1052
  }
1043
- function jt({ url: e, alt: t }) {
1044
- let [n, r] = V(!1);
1045
- return n ? null : /* @__PURE__ */ G("img", {
1053
+ function Nt({ url: e, alt: t }) {
1054
+ let [n, r] = Ye(!1);
1055
+ return n ? null : /* @__PURE__ */ U("img", {
1046
1056
  class: "whoo-widget-empty-state-image",
1047
1057
  src: e,
1048
1058
  alt: t,
@@ -1050,19 +1060,19 @@ function jt({ url: e, alt: t }) {
1050
1060
  onError: () => r(!0)
1051
1061
  });
1052
1062
  }
1053
- function Mt({ message: e, speaker: t, feedbackState: n, showFeedback: r, pending: i, isSlowResponse: a, onThumbsUp: o, onThumbsDown: s, onDraftChange: c, onSubmitDetailed: l, onCancelFeedback: u }) {
1054
- let d = U(null), f = e.id;
1055
- return /* @__PURE__ */ G("div", {
1063
+ function Pt({ message: e, speaker: t, feedbackState: n, showFeedback: r, pending: i, isSlowResponse: a, onThumbsUp: o, onThumbsDown: s, onDraftChange: c, onSubmitDetailed: l, onCancelFeedback: u }) {
1064
+ let d = V(null), f = e.id;
1065
+ return /* @__PURE__ */ U("div", {
1056
1066
  ref: d,
1057
1067
  tabIndex: -1,
1058
1068
  class: `whoo-widget-message whoo-widget-message--${e.role}`,
1059
1069
  children: [
1060
- /* @__PURE__ */ G("span", {
1070
+ /* @__PURE__ */ U("span", {
1061
1071
  class: "whoo-widget-sr-only",
1062
1072
  children: [t, ": "]
1063
1073
  }),
1064
- i ? /* @__PURE__ */ G(At, { isSlowResponse: a }) : Dt(e.content),
1065
- r && e.role === "assistant" && f ? /* @__PURE__ */ G(kt, {
1074
+ i ? /* @__PURE__ */ U(Mt, { isSlowResponse: a }) : kt(e.content),
1075
+ r && e.role === "assistant" && f ? /* @__PURE__ */ U(jt, {
1066
1076
  state: n,
1067
1077
  containerRef: d,
1068
1078
  onThumbsUp: () => o(f),
@@ -1074,17 +1084,17 @@ function Mt({ message: e, speaker: t, feedbackState: n, showFeedback: r, pending
1074
1084
  ]
1075
1085
  });
1076
1086
  }
1077
- function Nt({ messages: e, messageFeedback: t, announcement: n, emptyStateImage: r, agentName: i = s, showFeedback: a = !1, isStreaming: o = !1, isSlowResponse: c = !1, onThumbsUp: l, onThumbsDown: u, onDraftChange: d = () => {}, onSubmitDetailed: f, onCancelFeedback: p }) {
1078
- let m = U(null);
1079
- return H(() => {
1087
+ function Ft({ messages: e, messageFeedback: t, announcement: n, emptyStateImage: r, agentName: i = s, showFeedback: a = !1, isStreaming: o = !1, isSlowResponse: c = !1, onThumbsUp: l, onThumbsDown: u, onDraftChange: d = () => {}, onSubmitDetailed: f, onCancelFeedback: p }) {
1088
+ let m = V(null);
1089
+ return B(() => {
1080
1090
  let e = m.current;
1081
1091
  e && (e.scrollTop = e.scrollHeight);
1082
- }, [e, c]), /* @__PURE__ */ G(F, { children: [/* @__PURE__ */ G("section", {
1092
+ }, [e, c]), /* @__PURE__ */ U(P, { children: [/* @__PURE__ */ U("section", {
1083
1093
  class: "whoo-widget-message-list",
1084
1094
  ref: m,
1085
1095
  "aria-label": "Conversation",
1086
1096
  tabIndex: 0,
1087
- children: [r ? /* @__PURE__ */ G(jt, { ...r }) : null, e.map((n, r) => /* @__PURE__ */ G(Mt, {
1097
+ children: [r ? /* @__PURE__ */ U(Nt, { ...r }) : null, e.map((n, r) => /* @__PURE__ */ U(Pt, {
1088
1098
  message: n,
1089
1099
  speaker: n.role === "user" ? "You" : i,
1090
1100
  showFeedback: a,
@@ -1097,7 +1107,7 @@ function Nt({ messages: e, messageFeedback: t, announcement: n, emptyStateImage:
1097
1107
  onSubmitDetailed: f,
1098
1108
  onCancelFeedback: p
1099
1109
  }, n.id ?? r))]
1100
- }), /* @__PURE__ */ G("div", {
1110
+ }), /* @__PURE__ */ U("div", {
1101
1111
  class: "whoo-widget-sr-only",
1102
1112
  "aria-live": "polite",
1103
1113
  "aria-atomic": "true",
@@ -1106,16 +1116,16 @@ function Nt({ messages: e, messageFeedback: t, announcement: n, emptyStateImage:
1106
1116
  }
1107
1117
  //#endregion
1108
1118
  //#region src/components/Panel.tsx
1109
- var Pt = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])";
1110
- function Ft(e) {
1111
- return Array.from(e.querySelectorAll(Pt)).filter((e) => {
1119
+ var It = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])";
1120
+ function Lt(e) {
1121
+ return Array.from(e.querySelectorAll(It)).filter((e) => {
1112
1122
  let t = getComputedStyle(e);
1113
1123
  return t.display !== "none" && t.visibility !== "hidden";
1114
1124
  });
1115
1125
  }
1116
- function It({ state: e, controller: t, greeting: n }) {
1117
- let r = U(null), i = U(null);
1118
- H(() => {
1126
+ function Rt({ state: e, controller: t, greeting: n }) {
1127
+ let r = V(null), i = V(null);
1128
+ B(() => {
1119
1129
  i.current?.focus();
1120
1130
  }, []);
1121
1131
  let a = (e) => {
@@ -1126,7 +1136,7 @@ function It({ state: e, controller: t, greeting: n }) {
1126
1136
  if (e.key !== "Tab") return;
1127
1137
  let n = r.current;
1128
1138
  if (!n) return;
1129
- let i = Ft(n);
1139
+ let i = Lt(n);
1130
1140
  if (i.length === 0) return;
1131
1141
  let a = i[0], o = i[i.length - 1], s = n.getRootNode().activeElement;
1132
1142
  if (!n.contains(s)) {
@@ -1145,7 +1155,7 @@ function It({ state: e, controller: t, greeting: n }) {
1145
1155
  url: d,
1146
1156
  alt: t.emptyStateImageAlt
1147
1157
  } : void 0;
1148
- return /* @__PURE__ */ G("div", {
1158
+ return /* @__PURE__ */ U("div", {
1149
1159
  class: "whoo-widget-panel",
1150
1160
  role: "dialog",
1151
1161
  "aria-modal": "true",
@@ -1153,30 +1163,30 @@ function It({ state: e, controller: t, greeting: n }) {
1153
1163
  ref: r,
1154
1164
  onKeyDown: a,
1155
1165
  children: [
1156
- /* @__PURE__ */ G("div", {
1166
+ /* @__PURE__ */ U("div", {
1157
1167
  class: "whoo-widget-header",
1158
- children: [/* @__PURE__ */ G("h2", {
1168
+ children: [/* @__PURE__ */ U("h2", {
1159
1169
  class: "whoo-widget-header-title",
1160
1170
  children: l
1161
- }), /* @__PURE__ */ G("div", {
1171
+ }), /* @__PURE__ */ U("div", {
1162
1172
  class: "whoo-widget-header-actions",
1163
- children: [e.messages.length > 0 && /* @__PURE__ */ G("button", {
1173
+ children: [e.messages.length > 0 && /* @__PURE__ */ U("button", {
1164
1174
  type: "button",
1165
1175
  class: "whoo-widget-header-reset",
1166
1176
  onClick: () => {
1167
1177
  t.resetConversation(), i.current?.focus();
1168
1178
  },
1169
1179
  children: "New conversation"
1170
- }), /* @__PURE__ */ G("button", {
1180
+ }), /* @__PURE__ */ U("button", {
1171
1181
  type: "button",
1172
1182
  class: "whoo-widget-header-close",
1173
1183
  "aria-label": "Close chat",
1174
1184
  onClick: () => t.close(),
1175
- children: /* @__PURE__ */ G(ct, {})
1185
+ children: /* @__PURE__ */ U(ut, {})
1176
1186
  })]
1177
1187
  })]
1178
1188
  }),
1179
- /* @__PURE__ */ G(Nt, {
1189
+ /* @__PURE__ */ U(Ft, {
1180
1190
  messages: u,
1181
1191
  messageFeedback: e.messageFeedback,
1182
1192
  announcement: e.announcement,
@@ -1191,8 +1201,8 @@ function It({ state: e, controller: t, greeting: n }) {
1191
1201
  onSubmitDetailed: (e, n, r) => t.submitFeedback(e, "down", n || void 0, r || void 0),
1192
1202
  onCancelFeedback: (e) => t.cancelFeedback(e)
1193
1203
  }),
1194
- e.runtimeError && /* @__PURE__ */ G(gt, { message: e.runtimeError }),
1195
- /* @__PURE__ */ G(ht, {
1204
+ e.runtimeError && /* @__PURE__ */ U(vt, { message: e.runtimeError }),
1205
+ /* @__PURE__ */ U(_t, {
1196
1206
  value: e.draft,
1197
1207
  onChange: (e) => t.setDraft(e),
1198
1208
  onSend: o,
@@ -1204,11 +1214,11 @@ function It({ state: e, controller: t, greeting: n }) {
1204
1214
  }
1205
1215
  //#endregion
1206
1216
  //#region src/components/App.tsx
1207
- function Lt({ controller: e }) {
1208
- let [t, n] = V(e.getState()), r = U(null), i = U(t.isOpen);
1209
- return H(() => (n(e.getState()), e.subscribe(n)), [e]), H(() => {
1217
+ function zt({ controller: e }) {
1218
+ let [t, n] = Ye(e.getState()), r = V(null), i = V(t.isOpen);
1219
+ return B(() => (n(e.getState()), e.subscribe(n)), [e]), B(() => {
1210
1220
  i.current && !t.isOpen && r.current?.focus(), i.current = t.isOpen;
1211
- }, [t.isOpen]), t.initError || t.isInitializing ? null : /* @__PURE__ */ G(F, { children: [/* @__PURE__ */ G(mt, {
1221
+ }, [t.isOpen]), t.initError || t.isInitializing ? null : /* @__PURE__ */ U(P, { children: [/* @__PURE__ */ U(gt, {
1212
1222
  isOpen: t.isOpen,
1213
1223
  onClick: () => t.isOpen ? e.close() : e.open(),
1214
1224
  iconUrl: e.launcher.iconUrl,
@@ -1216,7 +1226,7 @@ function Lt({ controller: e }) {
1216
1226
  openIconUrl: e.launcher.openIconUrl,
1217
1227
  openIcon: e.launcher.openIcon,
1218
1228
  buttonRef: r
1219
- }), t.isOpen && /* @__PURE__ */ G(It, {
1229
+ }), t.isOpen && /* @__PURE__ */ U(Rt, {
1220
1230
  state: t,
1221
1231
  controller: e,
1222
1232
  greeting: e.config.greeting
@@ -1224,44 +1234,44 @@ function Lt({ controller: e }) {
1224
1234
  }
1225
1235
  //#endregion
1226
1236
  //#region src/api/client.ts
1227
- var Rt = class extends Error {
1237
+ var Bt = class extends Error {
1228
1238
  status;
1229
1239
  constructor(e, t) {
1230
1240
  super(e), this.name = "WidgetApiError", this.status = t;
1231
1241
  }
1232
1242
  };
1233
- function zt(e) {
1243
+ function Vt(e) {
1234
1244
  if (typeof e != "string") return null;
1235
1245
  let t = e.trim();
1236
1246
  return t === "" ? null : t;
1237
1247
  }
1238
- async function Bt(e, t) {
1248
+ async function Ht(e, t) {
1239
1249
  let n = await fetch(`${e}/api/v1/widget/session`, {
1240
1250
  method: "POST",
1241
1251
  headers: { "Content-Type": "application/json" },
1242
1252
  body: JSON.stringify({ publishable_key: t })
1243
1253
  });
1244
- if (!n.ok) throw new Rt(`Failed to create widget session (${n.status})`, n.status);
1254
+ if (!n.ok) throw new Bt(`Failed to create widget session (${n.status})`, n.status);
1245
1255
  let r = await n.json();
1246
1256
  return {
1247
1257
  token: r.token,
1248
- ...Vt(r)
1258
+ ...Ut(r)
1249
1259
  };
1250
1260
  }
1251
- function Vt(e) {
1261
+ function Ut(e) {
1252
1262
  return {
1253
- primaryColor: zt(e.primary_color),
1254
- name: zt(e.name),
1255
- accentColor: zt(e.accent_color),
1256
- inkColor: zt(e.ink_color)
1263
+ primaryColor: Vt(e.primary_color),
1264
+ name: Vt(e.name),
1265
+ accentColor: Vt(e.accent_color),
1266
+ inkColor: Vt(e.ink_color)
1257
1267
  };
1258
1268
  }
1259
- async function Ht(e, t) {
1269
+ async function Wt(e, t) {
1260
1270
  let n = await fetch(`${e}/api/v1/widget/branding`, { headers: { Authorization: `Bearer ${t}` } });
1261
- if (!n.ok) throw new Rt(`Failed to load widget branding (${n.status})`, n.status);
1262
- return Vt(await n.json());
1271
+ if (!n.ok) throw new Bt(`Failed to load widget branding (${n.status})`, n.status);
1272
+ return Ut(await n.json());
1263
1273
  }
1264
- async function Ut(e, t, n) {
1274
+ async function Gt(e, t, n) {
1265
1275
  let r = await fetch(`${e}/api/v1/widget/feedback`, {
1266
1276
  method: "POST",
1267
1277
  headers: {
@@ -1275,11 +1285,11 @@ async function Ut(e, t, n) {
1275
1285
  category: n.category ?? null
1276
1286
  })
1277
1287
  });
1278
- if (!r.ok) throw new Rt(`Feedback submission failed (${r.status})`, r.status);
1288
+ if (!r.ok) throw new Bt(`Feedback submission failed (${r.status})`, r.status);
1279
1289
  }
1280
1290
  //#endregion
1281
1291
  //#region src/api/sse.ts
1282
- async function* Wt(e, t, n, r, i) {
1292
+ async function* Kt(e, t, n, r, i) {
1283
1293
  let a = await fetch(`${e}/api/v1/widget/chat`, {
1284
1294
  method: "POST",
1285
1295
  headers: {
@@ -1292,7 +1302,7 @@ async function* Wt(e, t, n, r, i) {
1292
1302
  }),
1293
1303
  signal: i
1294
1304
  });
1295
- if (!a.ok || !a.body) throw new Rt(`Chat request failed (${a.status})`, a.status);
1305
+ if (!a.ok || !a.body) throw new Bt(`Chat request failed (${a.status})`, a.status);
1296
1306
  let o = a.body.getReader(), s = new TextDecoder(), c = "";
1297
1307
  for (;;) {
1298
1308
  let { done: e, value: t } = await o.read();
@@ -1303,11 +1313,11 @@ async function* Wt(e, t, n, r, i) {
1303
1313
  let e = c.slice(0, n);
1304
1314
  c = c.slice(n + 2);
1305
1315
  let t = e.split("\n").find((e) => e.startsWith("data: "));
1306
- t && (yield Gt(JSON.parse(t.slice(6)))), n = c.indexOf("\n\n");
1316
+ t && (yield qt(JSON.parse(t.slice(6)))), n = c.indexOf("\n\n");
1307
1317
  }
1308
1318
  }
1309
1319
  }
1310
- function Gt(e) {
1320
+ function qt(e) {
1311
1321
  return typeof e.error == "string" ? {
1312
1322
  type: "error",
1313
1323
  error: e.error,
@@ -1330,11 +1340,11 @@ function Gt(e) {
1330
1340
  }
1331
1341
  //#endregion
1332
1342
  //#region src/markdown/plainText.ts
1333
- function Kt(e) {
1334
- return wt(e.replace(/\r\n?/g, "\n")).map((e) => {
1343
+ function Jt(e) {
1344
+ return Et(e.replace(/\r\n?/g, "\n")).map((e) => {
1335
1345
  switch (e.type) {
1336
1346
  case "bold":
1337
- case "italic": return Kt(e.value);
1347
+ case "italic": return Jt(e.value);
1338
1348
  case "link": return e.text;
1339
1349
  default: return e.value;
1340
1350
  }
@@ -1342,16 +1352,16 @@ function Kt(e) {
1342
1352
  }
1343
1353
  //#endregion
1344
1354
  //#region src/markdown/reveal.ts
1345
- var qt = 40, Jt = 120;
1346
- function Yt(e) {
1355
+ var Yt = 40, Xt = 120;
1356
+ function Zt(e) {
1347
1357
  let t = [];
1348
- for (let n of wt(e)) if (n.type === "text") {
1358
+ for (let n of Et(e)) if (n.type === "text") {
1349
1359
  let e = n.value.split(/(\s+)/), r = n.start;
1350
1360
  for (let n of e) r += n.length, n.trim().length > 0 && t.push(r);
1351
1361
  } else t.push(n.end);
1352
1362
  return t;
1353
1363
  }
1354
- function Xt(e) {
1364
+ function Qt(e) {
1355
1365
  let t = null;
1356
1366
  return e?.addEventListener("abort", () => {
1357
1367
  t?.();
@@ -1366,14 +1376,14 @@ function Xt(e) {
1366
1376
  });
1367
1377
  };
1368
1378
  }
1369
- async function Zt(e, t, n) {
1370
- let r = n?.wordIntervalMs ?? qt, i = n?.tokenIntervalMs ?? Jt, a = n?.signal, o = wt(e), s = new Set(o.filter((e) => e.type !== "text").map((e) => e.end)), c = Xt(a), l = "";
1371
- for (let n of Yt(e)) if (a?.aborted || (l = e.slice(0, n), t(l), await c(s.has(n) ? i : r), a?.aborted)) return;
1379
+ async function $t(e, t, n) {
1380
+ let r = n?.wordIntervalMs ?? Yt, i = n?.tokenIntervalMs ?? Xt, a = n?.signal, o = Et(e), s = new Set(o.filter((e) => e.type !== "text").map((e) => e.end)), c = Qt(a), l = "";
1381
+ for (let n of Zt(e)) if (a?.aborted || (l = e.slice(0, n), t(l), await c(s.has(n) ? i : r), a?.aborted)) return;
1372
1382
  l !== e && t(e);
1373
1383
  }
1374
1384
  //#endregion
1375
1385
  //#region src/sessionToken.ts
1376
- function Qt(e, t = Date.now()) {
1386
+ function en(e, t = Date.now()) {
1377
1387
  let n = e.split(".");
1378
1388
  if (n.length !== 3 || n.some((e) => e === "")) return !1;
1379
1389
  let r = n[1];
@@ -1386,31 +1396,31 @@ function Qt(e, t = Date.now()) {
1386
1396
  }
1387
1397
  //#endregion
1388
1398
  //#region src/storage.ts
1389
- function $t(e) {
1399
+ function tn(e) {
1390
1400
  return `whoo-aiden-widget:conversation:${e}`;
1391
1401
  }
1392
- function en(e) {
1402
+ function nn(e) {
1393
1403
  try {
1394
- return window.sessionStorage.getItem($t(e));
1404
+ return window.sessionStorage.getItem(tn(e));
1395
1405
  } catch {
1396
1406
  return null;
1397
1407
  }
1398
1408
  }
1399
- function tn(e, t) {
1409
+ function rn(e, t) {
1400
1410
  try {
1401
- window.sessionStorage.setItem($t(e), t);
1411
+ window.sessionStorage.setItem(tn(e), t);
1402
1412
  } catch {}
1403
1413
  }
1404
- function nn(e) {
1414
+ function an(e) {
1405
1415
  try {
1406
- window.sessionStorage.removeItem($t(e));
1416
+ window.sessionStorage.removeItem(tn(e));
1407
1417
  } catch {}
1408
1418
  }
1409
1419
  //#endregion
1410
1420
  //#region src/theme.ts
1411
- var rn = /^(inherit|initial|unset|revert|revert-layer)$|\bcurrentcolor\b|\b(var|env|attr|light-dark)\(/i;
1412
- function an(e) {
1413
- if (rn.test(e.trim())) return null;
1421
+ var on = /^(inherit|initial|unset|revert|revert-layer)$|\bcurrentcolor\b|\b(var|env|attr|light-dark)\(/i;
1422
+ function K(e) {
1423
+ if (on.test(e.trim())) return null;
1414
1424
  let t = document.createElement("div");
1415
1425
  if (t.style.color = e, t.style.color === "") return null;
1416
1426
  let n = document.createElement("div");
@@ -1429,67 +1439,67 @@ function an(e) {
1429
1439
  translucent: a < 1
1430
1440
  };
1431
1441
  }
1432
- function J(e) {
1433
- return an(e)?.rgb ?? null;
1442
+ function q(e) {
1443
+ return K(e)?.rgb ?? null;
1434
1444
  }
1435
- function Y([e, t, n]) {
1445
+ function J([e, t, n]) {
1436
1446
  let r = (e) => {
1437
1447
  let t = e / 255;
1438
1448
  return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
1439
1449
  };
1440
1450
  return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
1441
1451
  }
1442
- function on(e, t) {
1452
+ function sn(e, t) {
1443
1453
  let n = Math.max(e, t), r = Math.min(e, t);
1444
1454
  return (n + .05) / (r + .05);
1445
1455
  }
1446
- function sn(e) {
1447
- let t = J(e);
1456
+ function cn(e) {
1457
+ let t = q(e);
1448
1458
  if (!t) return console.warn(`[whoo-aiden-widget] Could not parse color "${e}" for contrast calculation; defaulting to white text.`), "#ffffff";
1449
- let n = Y(t);
1450
- return on(n, Y([
1459
+ let n = J(t);
1460
+ return sn(n, J([
1451
1461
  0,
1452
1462
  0,
1453
1463
  0
1454
- ])) >= on(n, Y([
1464
+ ])) >= sn(n, J([
1455
1465
  255,
1456
1466
  255,
1457
1467
  255
1458
1468
  ])) ? "#000000" : "#ffffff";
1459
1469
  }
1460
- function cn(e, t) {
1461
- let n = J(e), r = J(t);
1462
- return !n || !r ? NaN : on(Y(n), Y(r));
1470
+ function ln(e, t) {
1471
+ let n = q(e), r = q(t);
1472
+ return !n || !r ? NaN : sn(J(n), J(r));
1463
1473
  }
1464
- var ln = n.primary, un = n.panel, dn = n.assistantBubble, fn = n.headerHover, pn = 4.5;
1465
- function mn([e, t, n]) {
1474
+ var un = n.primary, dn = n.panel, fn = n.assistantBubble, pn = n.headerHover, mn = 4.5;
1475
+ function Y([e, t, n]) {
1466
1476
  return `#${[
1467
1477
  e,
1468
1478
  t,
1469
1479
  n
1470
1480
  ].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
1471
1481
  }
1472
- function hn(e, t = un) {
1473
- let n = J(e), r = J(t);
1474
- if (!n || !r) return ln;
1475
- let i = Y(r), a = (e) => on(Y(e), i) >= pn;
1476
- if (a(n)) return mn(n);
1482
+ function hn(e, t = dn) {
1483
+ let n = q(e), r = q(t);
1484
+ if (!n || !r) return un;
1485
+ let i = J(r), a = (e) => sn(J(e), i) >= mn;
1486
+ if (a(n)) return Y(n);
1477
1487
  for (let e = .99; e > 0; e -= .01) {
1478
1488
  let t = n.map((t) => Math.round(t * e));
1479
- if (a(t)) return mn(t);
1489
+ if (a(t)) return Y(t);
1480
1490
  }
1481
1491
  return "#000000";
1482
1492
  }
1483
1493
  var gn = n.ink, _n = n.link;
1484
1494
  function X(e) {
1485
1495
  if (typeof e != "string" || !e) return null;
1486
- let t = an(e);
1487
- return t ? mn(t.rgb) : null;
1496
+ let t = K(e);
1497
+ return t ? Y(t.rgb) : null;
1488
1498
  }
1489
1499
  function vn(e) {
1490
1500
  if (typeof e != "string" || !e) return null;
1491
- let t = an(e);
1492
- return t ? t.translucent ? e.trim() : mn(t.rgb) : null;
1501
+ let t = K(e);
1502
+ return t ? t.translucent ? e.trim() : Y(t.rgb) : null;
1493
1503
  }
1494
1504
  var yn = [
1495
1505
  {
@@ -1544,7 +1554,7 @@ var yn = [
1544
1554
  }
1545
1555
  ];
1546
1556
  function Z({ color: e, inkColor: r, accentColor: i, overrides: a }) {
1547
- let o = typeof a == "object" && a && !Array.isArray(a) ? a : {}, s = (e) => vn(o[e]), c = X(e), l = s("primary"), u = l ?? c ?? ln, d = s("primaryText"), f = d ?? hn(u, fn), p = s("onPrimary") ?? sn(u), m = X(r), h = s("ink") ?? (m ? hn(m, dn) : gn), g = X(i), _ = s("link") ?? (g ? hn(g, dn) : _n), v = (e) => s(e) ?? n[e], y = {
1557
+ let o = typeof a == "object" && a && !Array.isArray(a) ? a : {}, s = (e) => vn(o[e]), c = X(e), l = s("primary"), u = l ?? c ?? un, d = s("primaryText"), f = d ?? hn(u, pn), p = s("onPrimary") ?? cn(u), m = X(r), h = s("ink") ?? (m ? hn(m, fn) : gn), g = X(i), _ = s("link") ?? (g ? hn(g, fn) : _n), v = (e) => s(e) ?? n[e], y = {
1548
1558
  primary: u,
1549
1559
  onPrimary: p,
1550
1560
  primaryText: f,
@@ -1562,14 +1572,16 @@ function Z({ color: e, inkColor: r, accentColor: i, overrides: a }) {
1562
1572
  inputBorder: v("inputBorder"),
1563
1573
  focusRing: v("focusRing")
1564
1574
  }, b = Object.fromEntries(t.map((e) => [e, s(e) !== null])), x = [];
1565
- for (let { role: e, against: t, required: n } of yn) if (b[e]) for (let r of t) {
1566
- let t = cn(y[e], y[r]);
1575
+ for (let { role: e, against: t, required: n } of yn) for (let r of t) {
1576
+ if (!b[e] && !b[r]) continue;
1577
+ let t = ln(y[e], y[r]);
1567
1578
  Number.isFinite(t) && t < n && x.push({
1568
1579
  role: e,
1569
1580
  against: r,
1570
1581
  value: y[e],
1571
1582
  ratio: t,
1572
- required: n
1583
+ required: n,
1584
+ overridden: b[e]
1573
1585
  });
1574
1586
  }
1575
1587
  return {
@@ -1591,7 +1603,7 @@ function Z({ color: e, inkColor: r, accentColor: i, overrides: a }) {
1591
1603
  function Q(e) {
1592
1604
  return typeof e == "string" ? `"${e}"` : `a ${typeof e} value`;
1593
1605
  }
1594
- function bn(e, t, n = ln) {
1606
+ function bn(e, t, n = un) {
1595
1607
  let r = t;
1596
1608
  X(t) === null && (console.warn(`[whoo-aiden-widget] Could not use ${Q(t)} as the theme color; falling back to ${Q(n)}.`), r = n);
1597
1609
  let i = Z({ color: r });
@@ -1619,16 +1631,18 @@ function wn(e, n) {
1619
1631
  let t = n[e];
1620
1632
  t && X(t) === null && console.warn(`[whoo-aiden-widget] Could not use ${Q(t)} as theme.colors.${e}; using the calculated color.`);
1621
1633
  }
1622
- let { contrastWarnings: r } = Z({
1634
+ let r = n.primary;
1635
+ typeof r == "string" && K(r)?.translucent && console.warn(`[whoo-aiden-widget] theme.colors.primary ${Q(r)} is translucent. The launcher shows your page through it, so its icon may be unreadable over dark content; pass a solid color.`);
1636
+ let { contrastWarnings: i } = Z({
1623
1637
  color: e.color,
1624
1638
  inkColor: e.inkColor,
1625
1639
  accentColor: e.accentColor,
1626
1640
  overrides: n
1627
1641
  });
1628
- for (let { role: e, against: t, value: n, ratio: i, required: a } of r) console.warn(`[whoo-aiden-widget] theme.colors.${e} (${n}) has ${i.toFixed(2)}:1 contrast against the ${t} color; ${a}:1 is recommended. Using it as given.`);
1642
+ for (let { role: e, against: t, value: n, ratio: r, required: a, overridden: o } of i) console.warn(o ? `[whoo-aiden-widget] theme.colors.${e} (${n}) has ${r.toFixed(2)}:1 contrast against the ${t} color; ${a}:1 is recommended. Using it as given.` : `[whoo-aiden-widget] the ${e} color (${n}) has ${r.toFixed(2)}:1 contrast against your theme.colors.${t}; ${a}:1 is recommended. Override theme.colors.${e} too.`);
1629
1643
  }
1630
1644
  function Tn(e, t) {
1631
- bn(e, t.color ?? ln), Cn(t.inkColor, "ink color"), Cn(t.accentColor, "accent color"), xn(e, {
1645
+ bn(e, t.color ?? un), Cn(t.inkColor, "ink color"), Cn(t.accentColor, "accent color"), xn(e, {
1632
1646
  inkColor: t.inkColor,
1633
1647
  accentColor: t.accentColor
1634
1648
  });
@@ -1712,10 +1726,10 @@ var kn = class {
1712
1726
  let e = this.config.apiBaseUrl ?? "https://api.aidenvoice.com";
1713
1727
  try {
1714
1728
  if (this.config.sessionToken) {
1715
- if (Qt(this.config.sessionToken)) throw Error("The sessionToken has expired.");
1729
+ if (en(this.config.sessionToken)) throw Error("The sessionToken has expired.");
1716
1730
  this.sessionToken = this.config.sessionToken;
1717
1731
  } else if (this.config.publishableKey) {
1718
- let { token: t, primaryColor: n, name: r, accentColor: i, inkColor: a } = await Bt(e, this.config.publishableKey);
1732
+ let { token: t, primaryColor: n, name: r, accentColor: i, inkColor: a } = await Ht(e, this.config.publishableKey);
1719
1733
  this.sessionToken = t, this.setState({
1720
1734
  primaryColor: n,
1721
1735
  agentName: r,
@@ -1727,13 +1741,13 @@ var kn = class {
1727
1741
  console.error("[whoo-aiden-widget] initialization failed:", e), this.setState({ initError: e instanceof Error ? e.message : String(e) });
1728
1742
  return;
1729
1743
  }
1730
- this.conversationId = en(this.storageIdentifier), this.config.sessionToken && await On(this.loadBranding(e, this.config.sessionToken), Dn);
1744
+ this.conversationId = nn(this.storageIdentifier), this.config.sessionToken && await On(this.loadBranding(e, this.config.sessionToken), Dn);
1731
1745
  }
1732
1746
  async loadBranding(e, t) {
1733
1747
  try {
1734
1748
  let n = this.config;
1735
1749
  if (X(n.color) && X(n.inkColor) && X(n.accentColor) && c(n.name)) return;
1736
- let { primaryColor: r, name: i, accentColor: a, inkColor: o } = await Ht(e, t);
1750
+ let { primaryColor: r, name: i, accentColor: a, inkColor: o } = await Wt(e, t);
1737
1751
  this.setState({
1738
1752
  primaryColor: r,
1739
1753
  agentName: i,
@@ -1749,7 +1763,7 @@ var kn = class {
1749
1763
  this.setState({ isOpen: !0 });
1750
1764
  }
1751
1765
  resetConversation() {
1752
- this.activeRequestController?.abort(), this.activeRequestController = null, this.clearSlowResponse(), this.conversationId = null, nn(this.storageIdentifier), this.setState({
1766
+ this.activeRequestController?.abort(), this.activeRequestController = null, this.clearSlowResponse(), this.conversationId = null, an(this.storageIdentifier), this.setState({
1753
1767
  messages: [],
1754
1768
  messageFeedback: {},
1755
1769
  runtimeError: null,
@@ -1803,17 +1817,17 @@ var kn = class {
1803
1817
  });
1804
1818
  }, s = "";
1805
1819
  try {
1806
- for await (let n of Wt(t, this.sessionToken, this.conversationId, e, a)) if (n.type === "conversation_id") this.conversationId = n.conversationId, tn(this.storageIdentifier, n.conversationId);
1807
- else if (n.type === "delta") this.clearSlowResponse(), n.verbatim && !this.prefersReducedMotion ? (await Zt(n.delta, (e) => i(e), { signal: a }), s = n.delta) : n.verbatim ? (s = n.delta, i(s)) : (s += n.delta, i(s));
1820
+ for await (let n of Kt(t, this.sessionToken, this.conversationId, e, a)) if (n.type === "conversation_id") this.conversationId = n.conversationId, rn(this.storageIdentifier, n.conversationId);
1821
+ else if (n.type === "delta") this.clearSlowResponse(), n.verbatim && !this.prefersReducedMotion ? (await $t(n.delta, (e) => i(e), { signal: a }), s = n.delta) : n.verbatim ? (s = n.delta, i(s)) : (s += n.delta, i(s));
1808
1822
  else if (n.type === "done") {
1809
- if (n.conversationId && (this.conversationId = n.conversationId, tn(this.storageIdentifier, n.conversationId)), n.messageId) {
1823
+ if (n.conversationId && (this.conversationId = n.conversationId, rn(this.storageIdentifier, n.conversationId)), n.messageId) {
1810
1824
  let e = [...this.state.messages];
1811
1825
  e[e.length - 1] = {
1812
1826
  ...e[e.length - 1],
1813
1827
  id: n.messageId
1814
1828
  }, this.setState({ messages: e });
1815
1829
  }
1816
- this.setState({ announcement: Kt(s) });
1830
+ this.setState({ announcement: Jt(s) });
1817
1831
  } else if (n.type === "error") {
1818
1832
  console.error("[whoo-aiden-widget] chat error:", n.error), o(), this.activeRequestController?.abort();
1819
1833
  break;
@@ -1821,7 +1835,12 @@ var kn = class {
1821
1835
  } catch (e) {
1822
1836
  e?.name === "AbortError" || (console.error("[whoo-aiden-widget] chat request failed:", e), o());
1823
1837
  } finally {
1824
- this.activeRequestController = null, this.clearSlowResponse(), this.setState({ isStreaming: !1 });
1838
+ this.activeRequestController = null, this.clearSlowResponse();
1839
+ let e = this.state.messages.filter((e) => e !== r);
1840
+ this.setState({
1841
+ isStreaming: !1,
1842
+ ...e.length === this.state.messages.length ? {} : { messages: e }
1843
+ });
1825
1844
  }
1826
1845
  }
1827
1846
  expandFeedback(e) {
@@ -1862,7 +1881,7 @@ var kn = class {
1862
1881
  }
1863
1882
  } });
1864
1883
  try {
1865
- await Ut(i, this.sessionToken, {
1884
+ await Gt(i, this.sessionToken, {
1866
1885
  messageId: e,
1867
1886
  rating: t,
1868
1887
  correction: n,
@@ -1917,8 +1936,8 @@ function Fn(e) {
1917
1936
  inkColor: X(e.inkColor) ? e.inkColor : t.inkColor,
1918
1937
  accentColor: X(e.accentColor) ? e.accentColor : t.accentColor
1919
1938
  }), n = !0), n && Sn(i, u);
1920
- }), a.init(), Fe(/* @__PURE__ */ G(Lt, { controller: a }), i), document.body.appendChild(t), { unmount() {
1921
- Fe(null, i), t.remove();
1939
+ }), a.init(), Ie(/* @__PURE__ */ U(zt, { controller: a }), i), document.body.appendChild(t), { unmount() {
1940
+ Ie(null, i), t.remove();
1922
1941
  } };
1923
1942
  }
1924
1943
  //#endregion