@ariaflowagents/widget 0.9.0 → 0.9.2

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
@@ -1,22 +1,22 @@
1
- var Q, m, He, I, ye, Fe, Ue, Ie, ce, re, ae, q = {}, De = [], _t = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ee = Array.isArray;
2
- function T(t, e) {
1
+ var B, m, Ie, F, be, De, Re, oe, K, L, Le, de, _e, ce, X = {}, Y = [], ht = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ne = Array.isArray;
2
+ function U(t, e) {
3
3
  for (var n in e) t[n] = e[n];
4
4
  return t;
5
5
  }
6
- function ue(t) {
6
+ function ge(t) {
7
7
  t && t.parentNode && t.parentNode.removeChild(t);
8
8
  }
9
- function L(t, e, n) {
10
- var s, o, i, a = {};
11
- for (i in e) i == "key" ? s = e[i] : i == "ref" ? o = e[i] : a[i] = e[i];
12
- if (arguments.length > 2 && (a.children = arguments.length > 3 ? Q.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (i in t.defaultProps) a[i] === void 0 && (a[i] = t.defaultProps[i]);
13
- return O(t, a, s, o, null);
9
+ function D(t, e, n) {
10
+ var i, o, s, a = {};
11
+ for (s in e) s == "key" ? i = e[s] : s == "ref" ? o = e[s] : a[s] = e[s];
12
+ if (arguments.length > 2 && (a.children = arguments.length > 3 ? B.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) a[s] === void 0 && (a[s] = t.defaultProps[s]);
13
+ return O(t, a, i, o, null);
14
14
  }
15
- function O(t, e, n, s, o) {
16
- var i = { type: t, props: e, key: n, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o ?? ++He, __i: -1, __u: 0 };
17
- return o == null && m.vnode != null && m.vnode(i), i;
15
+ function O(t, e, n, i, o) {
16
+ var s = { type: t, props: e, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: o ?? ++Ie, __i: -1, __u: 0 };
17
+ return o == null && m.vnode != null && m.vnode(s), s;
18
18
  }
19
- function D(t) {
19
+ function H(t) {
20
20
  return t.children;
21
21
  }
22
22
  function J(t, e) {
@@ -27,65 +27,69 @@ function R(t, e) {
27
27
  for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
28
28
  return typeof t.type == "function" ? R(t) : null;
29
29
  }
30
- function Le(t) {
31
- var e, n;
32
- if ((t = t.__) != null && t.__c != null) {
33
- for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
34
- t.__e = t.__c.base = n.__e;
35
- break;
36
- }
37
- return Le(t);
30
+ function dt(t) {
31
+ if (t.__P && t.__d) {
32
+ var e = t.__v, n = e.__e, i = [], o = [], s = U({}, e);
33
+ s.__v = e.__v + 1, m.vnode && m.vnode(s), fe(t.__P, s, e, t.__n, t.__P.namespaceURI, 32 & e.__u ? [n] : null, i, n ?? R(e), !!(32 & e.__u), o), s.__v = e.__v, s.__.__k[s.__i] = s, Qe(i, s, o), e.__e = e.__ = null, s.__e != n && Oe(s);
38
34
  }
39
35
  }
40
- function ve(t) {
41
- (!t.__d && (t.__d = !0) && I.push(t) && !X.__r++ || ye != m.debounceRendering) && ((ye = m.debounceRendering) || Fe)(X);
36
+ function Oe(t) {
37
+ if ((t = t.__) != null && t.__c != null) return t.__e = t.__c.base = null, t.__k.some(function(e) {
38
+ if (e != null && e.__e != null) return t.__e = t.__c.base = e.__e;
39
+ }), Oe(t);
42
40
  }
43
- function X() {
44
- for (var t, e, n, s, o, i, a, _ = 1; I.length; ) I.length > _ && I.sort(Ue), t = I.shift(), _ = I.length, t.__d && (n = void 0, s = void 0, o = (s = (e = t).__v).__e, i = [], a = [], e.__P && ((n = T({}, s)).__v = s.__v + 1, m.vnode && m.vnode(n), he(e.__P, n, s, e.__n, e.__P.namespaceURI, 32 & s.__u ? [o] : null, i, o ?? R(s), !!(32 & s.__u), a), n.__v = s.__v, n.__.__k[n.__i] = n, qe(i, n, a), s.__e = s.__ = null, n.__e != o && Le(n)));
45
- X.__r = 0;
41
+ function Ce(t) {
42
+ (!t.__d && (t.__d = !0) && F.push(t) && !Z.__r++ || be != m.debounceRendering) && ((be = m.debounceRendering) || De)(Z);
46
43
  }
47
- function Re(t, e, n, s, o, i, a, _, c, l, u) {
48
- var r, g, h, v, k, w, p, f = s && s.__k || De, E = e.length;
49
- for (c = ct(n, e, f, c, E), r = 0; r < E; r++) (h = n.__k[r]) != null && (g = h.__i == -1 ? q : f[h.__i] || q, h.__i = r, w = he(t, h, g, o, i, a, _, c, l, u), v = h.__e, h.ref && g.ref != h.ref && (g.ref && de(g.ref, null, h), u.push(h.ref, h.__c || v, h)), k == null && v != null && (k = v), (p = !!(4 & h.__u)) || g.__k === h.__k ? c = Oe(h, c, t, p) : typeof h.type == "function" && w !== void 0 ? c = w : v && (c = v.nextSibling), h.__u &= -7);
44
+ function Z() {
45
+ try {
46
+ for (var t, e = 1; F.length; ) F.length > e && F.sort(Re), t = F.shift(), e = F.length, dt(t);
47
+ } finally {
48
+ F.length = Z.__r = 0;
49
+ }
50
+ }
51
+ function qe(t, e, n, i, o, s, a, _, c, l, u) {
52
+ var r, g, h, v, k, w, p, f = i && i.__k || Y, x = e.length;
53
+ for (c = gt(n, e, f, c, x), r = 0; r < x; r++) (h = n.__k[r]) != null && (g = h.__i != -1 && f[h.__i] || X, h.__i = r, w = fe(t, h, g, o, s, a, _, c, l, u), v = h.__e, h.ref && g.ref != h.ref && (g.ref && pe(g.ref, null, h), u.push(h.ref, h.__c || v, h)), k == null && v != null && (k = v), (p = !!(4 & h.__u)) || g.__k === h.__k ? (c = Be(h, c, t, p), p && g.__e && (g.__e = null)) : typeof h.type == "function" && w !== void 0 ? c = w : v && (c = v.nextSibling), h.__u &= -7);
50
54
  return n.__e = k, c;
51
55
  }
52
- function ct(t, e, n, s, o) {
53
- var i, a, _, c, l, u = n.length, r = u, g = 0;
54
- for (t.__k = new Array(o), i = 0; i < o; i++) (a = e[i]) != null && typeof a != "boolean" && typeof a != "function" ? (typeof a == "string" || typeof a == "number" || typeof a == "bigint" || a.constructor == String ? a = t.__k[i] = O(null, a, null, null, null) : ee(a) ? a = t.__k[i] = O(D, { children: a }, null, null, null) : a.constructor === void 0 && a.__b > 0 ? a = t.__k[i] = O(a.type, a.props, a.key, a.ref ? a.ref : null, a.__v) : t.__k[i] = a, c = i + g, a.__ = t, a.__b = t.__b + 1, _ = null, (l = a.__i = ut(a, n, c, r)) != -1 && (r--, (_ = n[l]) && (_.__u |= 2)), _ == null || _.__v == null ? (l == -1 && (o > u ? g-- : o < u && g++), typeof a.type != "function" && (a.__u |= 4)) : l != c && (l == c - 1 ? g-- : l == c + 1 ? g++ : (l > c ? g-- : g++, a.__u |= 4))) : t.__k[i] = null;
55
- if (r) for (i = 0; i < u; i++) (_ = n[i]) != null && !(2 & _.__u) && (_.__e == s && (s = R(_)), Qe(_, _));
56
- return s;
56
+ function gt(t, e, n, i, o) {
57
+ var s, a, _, c, l, u = n.length, r = u, g = 0;
58
+ for (t.__k = new Array(o), s = 0; s < o; s++) (a = e[s]) != null && typeof a != "boolean" && typeof a != "function" ? (typeof a == "string" || typeof a == "number" || typeof a == "bigint" || a.constructor == String ? a = t.__k[s] = O(null, a, null, null, null) : ne(a) ? a = t.__k[s] = O(H, { children: a }, null, null, null) : a.constructor === void 0 && a.__b > 0 ? a = t.__k[s] = O(a.type, a.props, a.key, a.ref ? a.ref : null, a.__v) : t.__k[s] = a, c = s + g, a.__ = t, a.__b = t.__b + 1, _ = null, (l = a.__i = ft(a, n, c, r)) != -1 && (r--, (_ = n[l]) && (_.__u |= 2)), _ == null || _.__v == null ? (l == -1 && (o > u ? g-- : o < u && g++), typeof a.type != "function" && (a.__u |= 4)) : l != c && (l == c - 1 ? g-- : l == c + 1 ? g++ : (l > c ? g-- : g++, a.__u |= 4))) : t.__k[s] = null;
59
+ if (r) for (s = 0; s < u; s++) (_ = n[s]) != null && !(2 & _.__u) && (_.__e == i && (i = R(_)), je(_, _));
60
+ return i;
57
61
  }
58
- function Oe(t, e, n, s) {
59
- var o, i;
62
+ function Be(t, e, n, i) {
63
+ var o, s;
60
64
  if (typeof t.type == "function") {
61
- for (o = t.__k, i = 0; o && i < o.length; i++) o[i] && (o[i].__ = t, e = Oe(o[i], e, n, s));
65
+ for (o = t.__k, s = 0; o && s < o.length; s++) o[s] && (o[s].__ = t, e = Be(o[s], e, n, i));
62
66
  return e;
63
67
  }
64
- t.__e != e && (s && (e && t.type && !e.parentNode && (e = R(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
68
+ t.__e != e && (i && (e && t.type && !e.parentNode && (e = R(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
65
69
  do
66
70
  e = e && e.nextSibling;
67
71
  while (e != null && e.nodeType == 8);
68
72
  return e;
69
73
  }
70
- function ut(t, e, n, s) {
71
- var o, i, a, _ = t.key, c = t.type, l = e[n], u = l != null && (2 & l.__u) == 0;
74
+ function ft(t, e, n, i) {
75
+ var o, s, a, _ = t.key, c = t.type, l = e[n], u = l != null && (2 & l.__u) == 0;
72
76
  if (l === null && _ == null || u && _ == l.key && c == l.type) return n;
73
- if (s > (u ? 1 : 0)) {
74
- for (o = n - 1, i = n + 1; o >= 0 || i < e.length; ) if ((l = e[a = o >= 0 ? o-- : i++]) != null && !(2 & l.__u) && _ == l.key && c == l.type) return a;
77
+ if (i > (u ? 1 : 0)) {
78
+ for (o = n - 1, s = n + 1; o >= 0 || s < e.length; ) if ((l = e[a = o >= 0 ? o-- : s++]) != null && !(2 & l.__u) && _ == l.key && c == l.type) return a;
75
79
  }
76
80
  return -1;
77
81
  }
78
- function we(t, e, n) {
79
- e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || _t.test(e) ? n : n + "px";
82
+ function ke(t, e, n) {
83
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || ht.test(e) ? n : n + "px";
80
84
  }
81
- function K(t, e, n, s, o) {
82
- var i, a;
85
+ function V(t, e, n, i, o) {
86
+ var s, a;
83
87
  e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
84
88
  else {
85
- if (typeof s == "string" && (t.style.cssText = s = ""), s) for (e in s) n && e in n || we(t.style, e, "");
86
- if (n) for (e in n) s && n[e] == s[e] || we(t.style, e, n[e]);
89
+ if (typeof i == "string" && (t.style.cssText = i = ""), i) for (e in i) n && e in n || ke(t.style, e, "");
90
+ if (n) for (e in n) i && n[e] == i[e] || ke(t.style, e, n[e]);
87
91
  }
88
- else if (e[0] == "o" && e[1] == "n") i = e != (e = e.replace(Ie, "$1")), a = e.toLowerCase(), e = a in t || e == "onFocusOut" || e == "onFocusIn" ? a.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + i] = n, n ? s ? n.u = s.u : (n.u = ce, t.addEventListener(e, i ? ae : re, i)) : t.removeEventListener(e, i ? ae : re, i);
92
+ else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(Le, "$1")), a = e.toLowerCase(), e = a in t || e == "onFocusOut" || e == "onFocusIn" ? a.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? i ? n[L] = i[L] : (n[L] = de, t.addEventListener(e, s ? ce : _e, s)) : t.removeEventListener(e, s ? ce : _e, s);
89
93
  else {
90
94
  if (o == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
91
95
  else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
@@ -96,375 +100,368 @@ function K(t, e, n, s, o) {
96
100
  typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
97
101
  }
98
102
  }
99
- function be(t) {
103
+ function Se(t) {
100
104
  return function(e) {
101
105
  if (this.l) {
102
106
  var n = this.l[e.type + t];
103
- if (e.t == null) e.t = ce++;
104
- else if (e.t < n.u) return;
107
+ if (e[K] == null) e[K] = de++;
108
+ else if (e[K] < n[L]) return;
105
109
  return n(m.event ? m.event(e) : e);
106
110
  }
107
111
  };
108
112
  }
109
- function he(t, e, n, s, o, i, a, _, c, l) {
110
- var u, r, g, h, v, k, w, p, f, E, $, H, S, z, A, F, U, N = e.type;
113
+ function fe(t, e, n, i, o, s, a, _, c, l) {
114
+ var u, r, g, h, v, k, w, p, f, x, S, E, P, I, A, $ = e.type;
111
115
  if (e.constructor !== void 0) return null;
112
- 128 & n.__u && (c = !!(32 & n.__u), i = [_ = e.__e = n.__e]), (u = m.__b) && u(e);
113
- e: if (typeof N == "function") try {
114
- if (p = e.props, f = "prototype" in N && N.prototype.render, E = (u = N.contextType) && s[u.__c], $ = u ? E ? E.props.value : u.__ : s, n.__c ? w = (r = e.__c = n.__c).__ = r.__E : (f ? e.__c = r = new N(p, $) : (e.__c = r = new J(p, $), r.constructor = N, r.render = dt), E && E.sub(r), r.state || (r.state = {}), r.__n = s, g = r.__d = !0, r.__h = [], r._sb = []), f && r.__s == null && (r.__s = r.state), f && N.getDerivedStateFromProps != null && (r.__s == r.state && (r.__s = T({}, r.__s)), T(r.__s, N.getDerivedStateFromProps(p, r.__s))), h = r.props, v = r.state, r.__v = e, g) f && N.getDerivedStateFromProps == null && r.componentWillMount != null && r.componentWillMount(), f && r.componentDidMount != null && r.__h.push(r.componentDidMount);
116
+ 128 & n.__u && (c = !!(32 & n.__u), s = [_ = e.__e = n.__e]), (u = m.__b) && u(e);
117
+ e: if (typeof $ == "function") try {
118
+ if (p = e.props, f = $.prototype && $.prototype.render, x = (u = $.contextType) && i[u.__c], S = u ? x ? x.props.value : u.__ : i, n.__c ? w = (r = e.__c = n.__c).__ = r.__E : (f ? e.__c = r = new $(p, S) : (e.__c = r = new J(p, S), r.constructor = $, r.render = mt), x && x.sub(r), r.state || (r.state = {}), r.__n = i, g = r.__d = !0, r.__h = [], r._sb = []), f && r.__s == null && (r.__s = r.state), f && $.getDerivedStateFromProps != null && (r.__s == r.state && (r.__s = U({}, r.__s)), U(r.__s, $.getDerivedStateFromProps(p, r.__s))), h = r.props, v = r.state, r.__v = e, g) f && $.getDerivedStateFromProps == null && r.componentWillMount != null && r.componentWillMount(), f && r.componentDidMount != null && r.__h.push(r.componentDidMount);
115
119
  else {
116
- if (f && N.getDerivedStateFromProps == null && p !== h && r.componentWillReceiveProps != null && r.componentWillReceiveProps(p, $), e.__v == n.__v || !r.__e && r.shouldComponentUpdate != null && r.shouldComponentUpdate(p, r.__s, $) === !1) {
117
- for (e.__v != n.__v && (r.props = p, r.state = r.__s, r.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(P) {
118
- P && (P.__ = e);
119
- }), H = 0; H < r._sb.length; H++) r.__h.push(r._sb[H]);
120
- r._sb = [], r.__h.length && a.push(r);
120
+ if (f && $.getDerivedStateFromProps == null && p !== h && r.componentWillReceiveProps != null && r.componentWillReceiveProps(p, S), e.__v == n.__v || !r.__e && r.shouldComponentUpdate != null && r.shouldComponentUpdate(p, r.__s, S) === !1) {
121
+ e.__v != n.__v && (r.props = p, r.state = r.__s, r.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(W) {
122
+ W && (W.__ = e);
123
+ }), Y.push.apply(r.__h, r._sb), r._sb = [], r.__h.length && a.push(r);
121
124
  break e;
122
125
  }
123
- r.componentWillUpdate != null && r.componentWillUpdate(p, r.__s, $), f && r.componentDidUpdate != null && r.__h.push(function() {
126
+ r.componentWillUpdate != null && r.componentWillUpdate(p, r.__s, S), f && r.componentDidUpdate != null && r.__h.push(function() {
124
127
  r.componentDidUpdate(h, v, k);
125
128
  });
126
129
  }
127
- if (r.context = $, r.props = p, r.__P = t, r.__e = !1, S = m.__r, z = 0, f) {
128
- for (r.state = r.__s, r.__d = !1, S && S(e), u = r.render(r.props, r.state, r.context), A = 0; A < r._sb.length; A++) r.__h.push(r._sb[A]);
129
- r._sb = [];
130
- } else do
131
- r.__d = !1, S && S(e), u = r.render(r.props, r.state, r.context), r.state = r.__s;
132
- while (r.__d && ++z < 25);
133
- r.state = r.__s, r.getChildContext != null && (s = T(T({}, s), r.getChildContext())), f && !g && r.getSnapshotBeforeUpdate != null && (k = r.getSnapshotBeforeUpdate(h, v)), F = u, u != null && u.type === D && u.key == null && (F = Be(u.props.children)), _ = Re(t, ee(F) ? F : [F], e, n, s, o, i, a, _, c, l), r.base = e.__e, e.__u &= -161, r.__h.length && a.push(r), w && (r.__E = r.__ = null);
134
- } catch (P) {
135
- if (e.__v = null, c || i != null) if (P.then) {
130
+ if (r.context = S, r.props = p, r.__P = t, r.__e = !1, E = m.__r, P = 0, f) r.state = r.__s, r.__d = !1, E && E(e), u = r.render(r.props, r.state, r.context), Y.push.apply(r.__h, r._sb), r._sb = [];
131
+ else do
132
+ r.__d = !1, E && E(e), u = r.render(r.props, r.state, r.context), r.state = r.__s;
133
+ while (r.__d && ++P < 25);
134
+ r.state = r.__s, r.getChildContext != null && (i = U(U({}, i), r.getChildContext())), f && !g && r.getSnapshotBeforeUpdate != null && (k = r.getSnapshotBeforeUpdate(h, v)), I = u != null && u.type === H && u.key == null ? ze(u.props.children) : u, _ = qe(t, ne(I) ? I : [I], e, n, i, o, s, a, _, c, l), r.base = e.__e, e.__u &= -161, r.__h.length && a.push(r), w && (r.__E = r.__ = null);
135
+ } catch (W) {
136
+ if (e.__v = null, c || s != null) if (W.then) {
136
137
  for (e.__u |= c ? 160 : 128; _ && _.nodeType == 8 && _.nextSibling; ) _ = _.nextSibling;
137
- i[i.indexOf(_)] = null, e.__e = _;
138
+ s[s.indexOf(_)] = null, e.__e = _;
138
139
  } else {
139
- for (U = i.length; U--; ) ue(i[U]);
140
- le(e);
140
+ for (A = s.length; A--; ) ge(s[A]);
141
+ ue(e);
141
142
  }
142
- else e.__e = n.__e, e.__k = n.__k, P.then || le(e);
143
- m.__e(P, e, n);
143
+ else e.__e = n.__e, e.__k = n.__k, W.then || ue(e);
144
+ m.__e(W, e, n);
144
145
  }
145
- else i == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : _ = e.__e = ht(n.__e, e, n, s, o, i, a, c, l);
146
+ else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : _ = e.__e = pt(n.__e, e, n, i, o, s, a, c, l);
146
147
  return (u = m.diffed) && u(e), 128 & e.__u ? void 0 : _;
147
148
  }
148
- function le(t) {
149
- t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(le);
149
+ function ue(t) {
150
+ t && (t.__c && (t.__c.__e = !0), t.__k && t.__k.some(ue));
150
151
  }
151
- function qe(t, e, n) {
152
- for (var s = 0; s < n.length; s++) de(n[s], n[++s], n[++s]);
152
+ function Qe(t, e, n) {
153
+ for (var i = 0; i < n.length; i++) pe(n[i], n[++i], n[++i]);
153
154
  m.__c && m.__c(e, t), t.some(function(o) {
154
155
  try {
155
- t = o.__h, o.__h = [], t.some(function(i) {
156
- i.call(o);
156
+ t = o.__h, o.__h = [], t.some(function(s) {
157
+ s.call(o);
157
158
  });
158
- } catch (i) {
159
- m.__e(i, o.__v);
159
+ } catch (s) {
160
+ m.__e(s, o.__v);
160
161
  }
161
162
  });
162
163
  }
163
- function Be(t) {
164
- return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : ee(t) ? t.map(Be) : T({}, t);
164
+ function ze(t) {
165
+ return typeof t != "object" || t == null || t.__b > 0 ? t : ne(t) ? t.map(ze) : U({}, t);
165
166
  }
166
- function ht(t, e, n, s, o, i, a, _, c) {
167
- var l, u, r, g, h, v, k, w = n.props || q, p = e.props, f = e.type;
168
- if (f == "svg" ? o = "http://www.w3.org/2000/svg" : f == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), i != null) {
169
- for (l = 0; l < i.length; l++) if ((h = i[l]) && "setAttribute" in h == !!f && (f ? h.localName == f : h.nodeType == 3)) {
170
- t = h, i[l] = null;
167
+ function pt(t, e, n, i, o, s, a, _, c) {
168
+ var l, u, r, g, h, v, k, w = n.props || X, p = e.props, f = e.type;
169
+ if (f == "svg" ? o = "http://www.w3.org/2000/svg" : f == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), s != null) {
170
+ for (l = 0; l < s.length; l++) if ((h = s[l]) && "setAttribute" in h == !!f && (f ? h.localName == f : h.nodeType == 3)) {
171
+ t = h, s[l] = null;
171
172
  break;
172
173
  }
173
174
  }
174
175
  if (t == null) {
175
176
  if (f == null) return document.createTextNode(p);
176
- t = document.createElementNS(o, f, p.is && p), _ && (m.__m && m.__m(e, i), _ = !1), i = null;
177
+ t = document.createElementNS(o, f, p.is && p), _ && (m.__m && m.__m(e, s), _ = !1), s = null;
177
178
  }
178
179
  if (f == null) w === p || _ && t.data == p || (t.data = p);
179
180
  else {
180
- if (i = i && Q.call(t.childNodes), !_ && i != null) for (w = {}, l = 0; l < t.attributes.length; l++) w[(h = t.attributes[l]).name] = h.value;
181
- for (l in w) if (h = w[l], l != "children") {
182
- if (l == "dangerouslySetInnerHTML") r = h;
183
- else if (!(l in p)) {
184
- if (l == "value" && "defaultValue" in p || l == "checked" && "defaultChecked" in p) continue;
185
- K(t, l, null, h, o);
186
- }
187
- }
188
- for (l in p) h = p[l], l == "children" ? g = h : l == "dangerouslySetInnerHTML" ? u = h : l == "value" ? v = h : l == "checked" ? k = h : _ && typeof h != "function" || w[l] === h || K(t, l, h, w[l], o);
181
+ if (s = s && B.call(t.childNodes), !_ && s != null) for (w = {}, l = 0; l < t.attributes.length; l++) w[(h = t.attributes[l]).name] = h.value;
182
+ for (l in w) h = w[l], l == "dangerouslySetInnerHTML" ? r = h : l == "children" || l in p || l == "value" && "defaultValue" in p || l == "checked" && "defaultChecked" in p || V(t, l, null, h, o);
183
+ for (l in p) h = p[l], l == "children" ? g = h : l == "dangerouslySetInnerHTML" ? u = h : l == "value" ? v = h : l == "checked" ? k = h : _ && typeof h != "function" || w[l] === h || V(t, l, h, w[l], o);
189
184
  if (u) _ || r && (u.__html == r.__html || u.__html == t.innerHTML) || (t.innerHTML = u.__html), e.__k = [];
190
- else if (r && (t.innerHTML = ""), Re(e.type == "template" ? t.content : t, ee(g) ? g : [g], e, n, s, f == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, i, a, i ? i[0] : n.__k && R(n, 0), _, c), i != null) for (l = i.length; l--; ) ue(i[l]);
191
- _ || (l = "value", f == "progress" && v == null ? t.removeAttribute("value") : v != null && (v !== t[l] || f == "progress" && !v || f == "option" && v != w[l]) && K(t, l, v, w[l], o), l = "checked", k != null && k != t[l] && K(t, l, k, w[l], o));
185
+ else if (r && (t.innerHTML = ""), qe(e.type == "template" ? t.content : t, ne(g) ? g : [g], e, n, i, f == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, s, a, s ? s[0] : n.__k && R(n, 0), _, c), s != null) for (l = s.length; l--; ) ge(s[l]);
186
+ _ || (l = "value", f == "progress" && v == null ? t.removeAttribute("value") : v != null && (v !== t[l] || f == "progress" && !v || f == "option" && v != w[l]) && V(t, l, v, w[l], o), l = "checked", k != null && k != t[l] && V(t, l, k, w[l], o));
192
187
  }
193
188
  return t;
194
189
  }
195
- function de(t, e, n) {
190
+ function pe(t, e, n) {
196
191
  try {
197
192
  if (typeof t == "function") {
198
- var s = typeof t.__u == "function";
199
- s && t.__u(), s && e == null || (t.__u = t(e));
193
+ var i = typeof t.__u == "function";
194
+ i && t.__u(), i && e == null || (t.__u = t(e));
200
195
  } else t.current = e;
201
196
  } catch (o) {
202
197
  m.__e(o, n);
203
198
  }
204
199
  }
205
- function Qe(t, e, n) {
206
- var s, o;
207
- if (m.unmount && m.unmount(t), (s = t.ref) && (s.current && s.current != t.__e || de(s, null, e)), (s = t.__c) != null) {
208
- if (s.componentWillUnmount) try {
209
- s.componentWillUnmount();
210
- } catch (i) {
211
- m.__e(i, e);
200
+ function je(t, e, n) {
201
+ var i, o;
202
+ if (m.unmount && m.unmount(t), (i = t.ref) && (i.current && i.current != t.__e || pe(i, null, e)), (i = t.__c) != null) {
203
+ if (i.componentWillUnmount) try {
204
+ i.componentWillUnmount();
205
+ } catch (s) {
206
+ m.__e(s, e);
212
207
  }
213
- s.base = s.__P = null;
208
+ i.base = i.__P = null;
214
209
  }
215
- if (s = t.__k) for (o = 0; o < s.length; o++) s[o] && Qe(s[o], e, n || typeof t.type != "function");
216
- n || ue(t.__e), t.__c = t.__ = t.__e = void 0;
210
+ if (i = t.__k) for (o = 0; o < i.length; o++) i[o] && je(i[o], e, n || typeof t.type != "function");
211
+ n || ge(t.__e), t.__c = t.__ = t.__e = void 0;
217
212
  }
218
- function dt(t, e, n) {
213
+ function mt(t, e, n) {
219
214
  return this.constructor(t, n);
220
215
  }
221
- function te(t, e, n) {
222
- var s, o, i, a;
223
- e == document && (e = document.documentElement), m.__ && m.__(t, e), o = (s = typeof n == "function") ? null : n && n.__k || e.__k, i = [], a = [], he(e, t = (!s && n || e).__k = L(D, null, [t]), o || q, q, e.namespaceURI, !s && n ? [n] : o ? null : e.firstChild ? Q.call(e.childNodes) : null, i, !s && n ? n : o ? o.__e : e.firstChild, s, a), qe(i, t, a);
216
+ function se(t, e, n) {
217
+ var i, o, s, a;
218
+ e == document && (e = document.documentElement), m.__ && m.__(t, e), o = (i = typeof n == "function") ? null : n && n.__k || e.__k, s = [], a = [], fe(e, t = (!i && n || e).__k = D(H, null, [t]), o || X, X, e.namespaceURI, !i && n ? [n] : o ? null : e.firstChild ? B.call(e.childNodes) : null, s, !i && n ? n : o ? o.__e : e.firstChild, i, a), Qe(s, t, a);
224
219
  }
225
- function ze(t, e) {
226
- te(t, e, ze);
220
+ function Ve(t, e) {
221
+ se(t, e, Ve);
227
222
  }
228
- function je(t, e, n) {
229
- var s, o, i, a, _ = T({}, t.props);
230
- for (i in t.type && t.type.defaultProps && (a = t.type.defaultProps), e) i == "key" ? s = e[i] : i == "ref" ? o = e[i] : _[i] = e[i] === void 0 && a != null ? a[i] : e[i];
231
- return arguments.length > 2 && (_.children = arguments.length > 3 ? Q.call(arguments, 2) : n), O(t.type, _, s || t.key, o || t.ref, null);
223
+ function Ke(t, e, n) {
224
+ var i, o, s, a, _ = U({}, t.props);
225
+ for (s in t.type && t.type.defaultProps && (a = t.type.defaultProps), e) s == "key" ? i = e[s] : s == "ref" ? o = e[s] : _[s] = e[s] === void 0 && a != null ? a[s] : e[s];
226
+ return arguments.length > 2 && (_.children = arguments.length > 3 ? B.call(arguments, 2) : n), O(t.type, _, i || t.key, o || t.ref, null);
232
227
  }
233
- Q = De.slice, m = { __e: function(t, e, n, s) {
234
- for (var o, i, a; e = e.__; ) if ((o = e.__c) && !o.__) try {
235
- if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(t)), a = o.__d), o.componentDidCatch != null && (o.componentDidCatch(t, s || {}), a = o.__d), a) return o.__E = o;
228
+ B = Y.slice, m = { __e: function(t, e, n, i) {
229
+ for (var o, s, a; e = e.__; ) if ((o = e.__c) && !o.__) try {
230
+ if ((s = o.constructor) && s.getDerivedStateFromError != null && (o.setState(s.getDerivedStateFromError(t)), a = o.__d), o.componentDidCatch != null && (o.componentDidCatch(t, i || {}), a = o.__d), a) return o.__E = o;
236
231
  } catch (_) {
237
232
  t = _;
238
233
  }
239
234
  throw t;
240
- } }, He = 0, J.prototype.setState = function(t, e) {
235
+ } }, Ie = 0, J.prototype.setState = function(t, e) {
241
236
  var n;
242
- n = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof t == "function" && (t = t(T({}, n), this.props)), t && T(n, t), t != null && this.__v && (e && this._sb.push(e), ve(this));
237
+ n = this.__s != null && this.__s != this.state ? this.__s : this.__s = U({}, this.state), typeof t == "function" && (t = t(U({}, n), this.props)), t && U(n, t), t != null && this.__v && (e && this._sb.push(e), Ce(this));
243
238
  }, J.prototype.forceUpdate = function(t) {
244
- this.__v && (this.__e = !0, t && this.__h.push(t), ve(this));
245
- }, J.prototype.render = D, I = [], Fe = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ue = function(t, e) {
239
+ this.__v && (this.__e = !0, t && this.__h.push(t), Ce(this));
240
+ }, J.prototype.render = H, F = [], De = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Re = function(t, e) {
246
241
  return t.__v.__b - e.__v.__b;
247
- }, X.__r = 0, Ie = /(PointerCapture)$|Capture$/i, ce = 0, re = be(!1), ae = be(!0);
248
- function Y() {
249
- return Y = Object.assign ? Object.assign.bind() : function(t) {
242
+ }, Z.__r = 0, oe = Math.random().toString(8), K = "__d" + oe, L = "__a" + oe, Le = /(PointerCapture)$|Capture$/i, de = 0, _e = Se(!1), ce = Se(!0);
243
+ function ee() {
244
+ return ee = Object.assign ? Object.assign.bind() : function(t) {
250
245
  for (var e = 1; e < arguments.length; e++) {
251
246
  var n = arguments[e];
252
- for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
247
+ for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
253
248
  }
254
249
  return t;
255
- }, Y.apply(this, arguments);
250
+ }, ee.apply(this, arguments);
256
251
  }
257
- function Ve(t, e) {
252
+ function Je(t, e) {
258
253
  if (t == null) return {};
259
- var n, s, o = {}, i = Object.keys(t);
260
- for (s = 0; s < i.length; s++) e.indexOf(n = i[s]) >= 0 || (o[n] = t[n]);
254
+ var n, i, o = {}, s = Object.keys(t);
255
+ for (i = 0; i < s.length; i++) e.indexOf(n = s[i]) >= 0 || (o[n] = t[n]);
261
256
  return o;
262
257
  }
263
- var gt = ["context", "children"], ft = ["useFragment"];
264
- function pt(t, e, n, s) {
258
+ var yt = ["context", "children"], vt = ["useFragment"];
259
+ function wt(t, e, n, i) {
265
260
  function o() {
266
- var i, a = Reflect.construct(HTMLElement, [], o);
267
- return a._vdomComponent = t, s && s.shadow ? (a._root = a.attachShadow({ mode: s.mode || "open", serializable: (i = s.serializable) != null && i }), s.adoptedStyleSheets && (a._root.adoptedStyleSheets = s.adoptedStyleSheets)) : a._root = a, a;
261
+ var s, a = Reflect.construct(HTMLElement, [], o);
262
+ return a._vdomComponent = t, i && i.shadow ? (a._root = a.attachShadow({ mode: i.mode || "open", serializable: (s = i.serializable) != null && s }), i.adoptedStyleSheets && (a._root.adoptedStyleSheets = i.adoptedStyleSheets)) : a._root = a, a;
268
263
  }
269
264
  return (o.prototype = Object.create(HTMLElement.prototype)).constructor = o, o.prototype.connectedCallback = function() {
270
- yt.call(this, s);
271
- }, o.prototype.attributeChangedCallback = vt, o.prototype.disconnectedCallback = wt, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), o.observedAttributes = n, t.formAssociated && (o.formAssociated = !0), n.forEach(function(i) {
272
- Object.defineProperty(o.prototype, i, { get: function() {
273
- return this._vdom ? this._vdom.props[i] : this._props[i];
265
+ Ct.call(this, i);
266
+ }, o.prototype.attributeChangedCallback = kt, o.prototype.disconnectedCallback = St, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), o.observedAttributes = n, t.formAssociated && (o.formAssociated = !0), n.forEach(function(s) {
267
+ Object.defineProperty(o.prototype, s, { get: function() {
268
+ return this._vdom ? this._vdom.props[s] : this._props[s];
274
269
  }, set: function(a) {
275
- this._vdom ? this.attributeChangedCallback(i, null, a) : (this._props || (this._props = {}), this._props[i] = a);
270
+ this._vdom ? this.attributeChangedCallback(s, null, a) : (this._props || (this._props = {}), this._props[s] = a);
276
271
  var _ = typeof a;
277
- a != null && _ !== "string" && _ !== "boolean" && _ !== "number" || this.setAttribute(i, a);
272
+ a != null && _ !== "string" && _ !== "boolean" && _ !== "number" || this.setAttribute(s, a);
278
273
  } });
279
274
  }), customElements.define(e, o), o;
280
275
  }
281
- function mt(t) {
276
+ function bt(t) {
282
277
  this.getChildContext = function() {
283
278
  return t.context;
284
279
  };
285
- var e = t.children, n = Ve(t, gt);
286
- return je(e, n);
280
+ var e = t.children, n = Je(t, yt);
281
+ return Ke(e, n);
287
282
  }
288
- function yt(t) {
283
+ function Ct(t) {
289
284
  var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
290
- this.dispatchEvent(e), this._vdom = L(mt, Y({}, this._props, { context: e.detail.context }), Je(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? ze : te)(this._vdom, this._root);
285
+ this.dispatchEvent(e), this._vdom = D(bt, ee({}, this._props, { context: e.detail.context }), Xe(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? Ve : se)(this._vdom, this._root);
291
286
  }
292
- function Ke(t) {
287
+ function Ge(t) {
293
288
  return t.replace(/-(\w)/g, function(e, n) {
294
289
  return n ? n.toUpperCase() : "";
295
290
  });
296
291
  }
297
- function vt(t, e, n) {
292
+ function kt(t, e, n) {
298
293
  if (this._vdom) {
299
- var s = {};
300
- s[t] = n = n ?? void 0, s[Ke(t)] = n, this._vdom = je(this._vdom, s), te(this._vdom, this._root);
294
+ var i = {};
295
+ i[t] = n = n ?? void 0, i[Ge(t)] = n, this._vdom = Ke(this._vdom, i), se(this._vdom, this._root);
301
296
  }
302
297
  }
303
- function wt() {
304
- te(this._vdom = null, this._root);
298
+ function St() {
299
+ se(this._vdom = null, this._root);
305
300
  }
306
- function Ce(t, e) {
307
- var n = this, s = t.useFragment, o = Ve(t, ft);
308
- return L(s ? D : "slot", Y({}, o, { ref: function(i) {
309
- i ? (n.ref = i, n._listener || (n._listener = function(a) {
301
+ function Ae(t, e) {
302
+ var n = this, i = t.useFragment, o = Je(t, vt);
303
+ return D(i ? H : "slot", ee({}, o, { ref: function(s) {
304
+ s ? (n.ref = s, n._listener || (n._listener = function(a) {
310
305
  a.stopPropagation(), a.detail.context = e;
311
- }, i.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
306
+ }, s.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
312
307
  } }));
313
308
  }
314
- function Je(t, e, n) {
309
+ function Xe(t, e, n) {
315
310
  if (t.nodeType === 3) return t.data;
316
311
  if (t.nodeType !== 1) return null;
317
- var s = [], o = {}, i = 0, a = t.attributes, _ = t.childNodes;
318
- for (i = a.length; i--; ) a[i].name !== "slot" && (o[a[i].name] = a[i].value, o[Ke(a[i].name)] = a[i].value);
319
- for (i = _.length; i--; ) {
320
- var c = Je(_[i], null, n), l = _[i].slot;
321
- l ? o[l] = L(Ce, { name: l }, c) : s[i] = c;
312
+ var i = [], o = {}, s = 0, a = t.attributes, _ = t.childNodes;
313
+ for (s = a.length; s--; ) a[s].name !== "slot" && (o[a[s].name] = a[s].value, o[Ge(a[s].name)] = a[s].value);
314
+ for (s = _.length; s--; ) {
315
+ var c = Xe(_[s], null, n), l = _[s].slot;
316
+ l ? o[l] = D(Ae, { name: l }, c) : i[s] = c;
322
317
  }
323
- var u = !(!n || !n.shadow), r = e ? L(Ce, { useFragment: !u }, s) : s;
324
- return !u && e && (t.innerHTML = ""), L(e || t.nodeName.toLowerCase(), o, r);
318
+ var u = !(!n || !n.shadow), r = e ? D(Ae, { useFragment: !u }, i) : i;
319
+ return !u && e && (t.innerHTML = ""), D(e || t.nodeName.toLowerCase(), o, r);
325
320
  }
326
- var bt = 0;
327
- function d(t, e, n, s, o, i) {
321
+ var At = 0;
322
+ function d(t, e, n, i, o, s) {
328
323
  e || (e = {});
329
324
  var a, _, c = e;
330
325
  if ("ref" in c) for (_ in c = {}, e) _ == "ref" ? a = e[_] : c[_] = e[_];
331
- var l = { type: t, props: c, key: n, ref: a, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --bt, __i: -1, __u: 0, __source: o, __self: i };
326
+ var l = { type: t, props: c, key: n, ref: a, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --At, __i: -1, __u: 0, __source: o, __self: s };
332
327
  if (typeof t == "function" && (a = t.defaultProps)) for (_ in a) c[_] === void 0 && (c[_] = a[_]);
333
328
  return m.vnode && m.vnode(l), l;
334
329
  }
335
- var B, y, se, ke, Z = 0, Ge = [], C = m, Se = C.__b, Ae = C.__r, $e = C.diffed, Ne = C.__c, xe = C.unmount, Pe = C.__;
336
- function ge(t, e) {
337
- C.__h && C.__h(y, t, Z || e), Z = 0;
330
+ var q, y, re, $e, te = 0, Ye = [], C = m, Ne = C.__b, xe = C.__r, Pe = C.diffed, We = C.__c, Me = C.unmount, Te = C.__;
331
+ function me(t, e) {
332
+ C.__h && C.__h(y, t, te || e), te = 0;
338
333
  var n = y.__H || (y.__H = { __: [], __h: [] });
339
334
  return t >= n.__.length && n.__.push({}), n.__[t];
340
335
  }
341
- function M(t) {
342
- return Z = 1, Ct(Ye, t);
336
+ function T(t) {
337
+ return te = 1, $t(et, t);
343
338
  }
344
- function Ct(t, e, n) {
345
- var s = ge(B++, 2);
346
- if (s.t = t, !s.__c && (s.__ = [Ye(void 0, e), function(_) {
347
- var c = s.__N ? s.__N[0] : s.__[0], l = s.t(c, _);
348
- c !== l && (s.__N = [l, s.__[1]], s.__c.setState({}));
349
- }], s.__c = y, !y.__f)) {
339
+ function $t(t, e, n) {
340
+ var i = me(q++, 2);
341
+ if (i.t = t, !i.__c && (i.__ = [et(void 0, e), function(_) {
342
+ var c = i.__N ? i.__N[0] : i.__[0], l = i.t(c, _);
343
+ c !== l && (i.__N = [l, i.__[1]], i.__c.setState({}));
344
+ }], i.__c = y, !y.__f)) {
350
345
  var o = function(_, c, l) {
351
- if (!s.__c.__H) return !0;
352
- var u = s.__c.__H.__.filter(function(g) {
353
- return !!g.__c;
346
+ if (!i.__c.__H) return !0;
347
+ var u = i.__c.__H.__.filter(function(g) {
348
+ return g.__c;
354
349
  });
355
350
  if (u.every(function(g) {
356
351
  return !g.__N;
357
- })) return !i || i.call(this, _, c, l);
358
- var r = s.__c.props !== _;
359
- return u.forEach(function(g) {
352
+ })) return !s || s.call(this, _, c, l);
353
+ var r = i.__c.props !== _;
354
+ return u.some(function(g) {
360
355
  if (g.__N) {
361
356
  var h = g.__[0];
362
357
  g.__ = g.__N, g.__N = void 0, h !== g.__[0] && (r = !0);
363
358
  }
364
- }), i && i.call(this, _, c, l) || r;
359
+ }), s && s.call(this, _, c, l) || r;
365
360
  };
366
361
  y.__f = !0;
367
- var i = y.shouldComponentUpdate, a = y.componentWillUpdate;
362
+ var s = y.shouldComponentUpdate, a = y.componentWillUpdate;
368
363
  y.componentWillUpdate = function(_, c, l) {
369
364
  if (this.__e) {
370
- var u = i;
371
- i = void 0, o(_, c, l), i = u;
365
+ var u = s;
366
+ s = void 0, o(_, c, l), s = u;
372
367
  }
373
368
  a && a.call(this, _, c, l);
374
369
  }, y.shouldComponentUpdate = o;
375
370
  }
376
- return s.__N || s.__;
371
+ return i.__N || i.__;
377
372
  }
378
- function Ee(t, e) {
379
- var n = ge(B++, 3);
380
- !C.__s && Xe(n.__H, e) && (n.__ = t, n.u = e, y.__H.__h.push(n));
373
+ function Ue(t, e) {
374
+ var n = me(q++, 3);
375
+ !C.__s && Ze(n.__H, e) && (n.__ = t, n.u = e, y.__H.__h.push(n));
381
376
  }
382
- function We(t) {
383
- return Z = 5, kt(function() {
377
+ function Ee(t) {
378
+ return te = 5, Nt(function() {
384
379
  return { current: t };
385
380
  }, []);
386
381
  }
387
- function kt(t, e) {
388
- var n = ge(B++, 7);
389
- return Xe(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
382
+ function Nt(t, e) {
383
+ var n = me(q++, 7);
384
+ return Ze(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
390
385
  }
391
- function St() {
392
- for (var t; t = Ge.shift(); ) if (t.__P && t.__H) try {
393
- t.__H.__h.forEach(G), t.__H.__h.forEach(_e), t.__H.__h = [];
394
- } catch (e) {
395
- t.__H.__h = [], C.__e(e, t.__v);
386
+ function xt() {
387
+ for (var t; t = Ye.shift(); ) {
388
+ var e = t.__H;
389
+ if (t.__P && e) try {
390
+ e.__h.some(G), e.__h.some(he), e.__h = [];
391
+ } catch (n) {
392
+ e.__h = [], C.__e(n, t.__v);
393
+ }
396
394
  }
397
395
  }
398
396
  C.__b = function(t) {
399
- y = null, Se && Se(t);
397
+ y = null, Ne && Ne(t);
400
398
  }, C.__ = function(t, e) {
401
- t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Pe && Pe(t, e);
399
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Te && Te(t, e);
402
400
  }, C.__r = function(t) {
403
- Ae && Ae(t), B = 0;
401
+ xe && xe(t), q = 0;
404
402
  var e = (y = t.__c).__H;
405
- e && (se === y ? (e.__h = [], y.__h = [], e.__.forEach(function(n) {
403
+ e && (re === y ? (e.__h = [], y.__h = [], e.__.some(function(n) {
406
404
  n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
407
- })) : (e.__h.forEach(G), e.__h.forEach(_e), e.__h = [], B = 0)), se = y;
405
+ })) : (e.__h.some(G), e.__h.some(he), e.__h = [], q = 0)), re = y;
408
406
  }, C.diffed = function(t) {
409
- $e && $e(t);
407
+ Pe && Pe(t);
410
408
  var e = t.__c;
411
- e && e.__H && (e.__H.__h.length && (Ge.push(e) !== 1 && ke === C.requestAnimationFrame || ((ke = C.requestAnimationFrame) || At)(St)), e.__H.__.forEach(function(n) {
409
+ e && e.__H && (e.__H.__h.length && (Ye.push(e) !== 1 && $e === C.requestAnimationFrame || (($e = C.requestAnimationFrame) || Pt)(xt)), e.__H.__.some(function(n) {
412
410
  n.u && (n.__H = n.u), n.u = void 0;
413
- })), se = y = null;
411
+ })), re = y = null;
414
412
  }, C.__c = function(t, e) {
415
413
  e.some(function(n) {
416
414
  try {
417
- n.__h.forEach(G), n.__h = n.__h.filter(function(s) {
418
- return !s.__ || _e(s);
415
+ n.__h.some(G), n.__h = n.__h.filter(function(i) {
416
+ return !i.__ || he(i);
419
417
  });
420
- } catch (s) {
418
+ } catch (i) {
421
419
  e.some(function(o) {
422
420
  o.__h && (o.__h = []);
423
- }), e = [], C.__e(s, n.__v);
421
+ }), e = [], C.__e(i, n.__v);
424
422
  }
425
- }), Ne && Ne(t, e);
423
+ }), We && We(t, e);
426
424
  }, C.unmount = function(t) {
427
- xe && xe(t);
425
+ Me && Me(t);
428
426
  var e, n = t.__c;
429
- n && n.__H && (n.__H.__.forEach(function(s) {
427
+ n && n.__H && (n.__H.__.some(function(i) {
430
428
  try {
431
- G(s);
429
+ G(i);
432
430
  } catch (o) {
433
431
  e = o;
434
432
  }
435
433
  }), n.__H = void 0, e && C.__e(e, n.__v));
436
434
  };
437
- var Me = typeof requestAnimationFrame == "function";
438
- function At(t) {
435
+ var Fe = typeof requestAnimationFrame == "function";
436
+ function Pt(t) {
439
437
  var e, n = function() {
440
- clearTimeout(s), Me && cancelAnimationFrame(e), setTimeout(t);
441
- }, s = setTimeout(n, 35);
442
- Me && (e = requestAnimationFrame(n));
438
+ clearTimeout(i), Fe && cancelAnimationFrame(e), setTimeout(t);
439
+ }, i = setTimeout(n, 35);
440
+ Fe && (e = requestAnimationFrame(n));
443
441
  }
444
442
  function G(t) {
445
443
  var e = y, n = t.__c;
446
444
  typeof n == "function" && (t.__c = void 0, n()), y = e;
447
445
  }
448
- function _e(t) {
446
+ function he(t) {
449
447
  var e = y;
450
448
  t.__c = t.__(), y = e;
451
449
  }
452
- function Xe(t, e) {
453
- return !t || t.length !== e.length || e.some(function(n, s) {
454
- return n !== t[s];
450
+ function Ze(t, e) {
451
+ return !t || t.length !== e.length || e.some(function(n, i) {
452
+ return n !== t[i];
455
453
  });
456
454
  }
457
- function Ye(t, e) {
455
+ function et(t, e) {
458
456
  return typeof e == "function" ? e(t) : e;
459
457
  }
460
- const $t = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
461
- let ie = (t = 21) => {
458
+ let Wt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", ae = (t = 21) => {
462
459
  let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
463
460
  for (; t--; )
464
- e += $t[n[t] & 63];
461
+ e += Wt[n[t] & 63];
465
462
  return e;
466
463
  };
467
- class Nt {
464
+ class Mt {
468
465
  constructor(e, n) {
469
466
  this.agentUrl = e, this.agentId = n, this.agentConfig = null, this.ws = null, this.messageCallbacks = /* @__PURE__ */ new Set(), this.suggestionsCallbacks = /* @__PURE__ */ new Set(), this.connectionCallbacks = /* @__PURE__ */ new Set(), this.streamingCallbacks = /* @__PURE__ */ new Set(), this.processingCallbacks = /* @__PURE__ */ new Set(), this.queueCallbacks = /* @__PURE__ */ new Set(), this.messages = [], this.activeSuggestions = [], this.reconnectAttempts = 0, this.maxReconnectAttempts = 5, this.reconnectDelay = 1e3, this.isAgentStreaming = !1, this.isAgentProcessing = !1, this.messageQueue = [], this.disposed = !1;
470
467
  }
@@ -474,9 +471,9 @@ class Nt {
474
471
  async initWidget() {
475
472
  try {
476
473
  try {
477
- const s = await fetch(`${this.normalizeBaseUrl(this.agentUrl)}/api/agent/${this.agentId}`);
478
- if (s.ok) {
479
- const o = await s.json();
474
+ const i = await fetch(`${this.normalizeBaseUrl(this.agentUrl)}/api/agent/${this.agentId}`);
475
+ if (i.ok) {
476
+ const o = await i.json();
480
477
  return !o || o.status !== "active" ? (console.error("Agent not found or inactive"), null) : (this.agentConfig = o, this.maxReconnectAttempts = o.config.maxRetries || 5, this.reconnectDelay = o.config.reconnectDelay || 1e3, await this.connectToAgent(), o);
481
478
  }
482
479
  } catch {
@@ -512,23 +509,23 @@ class Nt {
512
509
  if (this.disposed)
513
510
  return;
514
511
  const e = this.getSessionId(), n = `${this.normalizeBaseUrl(this.agentConfig.wsUrl)}/${e}`;
515
- return new Promise((s, o) => {
512
+ return new Promise((i, o) => {
516
513
  try {
517
514
  this.ws = new WebSocket(n), this.ws.onopen = () => {
518
- console.log("[Widget] Connected to agent"), this.reconnectAttempts = 0, this.notifyConnectionChange(!0), s();
519
- }, this.ws.onmessage = (i) => {
520
- this.handleMessage(i);
515
+ console.log("[Widget] Connected to agent"), this.reconnectAttempts = 0, this.notifyConnectionChange(!0), i();
516
+ }, this.ws.onmessage = (s) => {
517
+ this.handleMessage(s);
521
518
  }, this.ws.onclose = () => {
522
519
  if (this.ws = null, this.notifyConnectionChange(!1), !this.disposed && this.reconnectAttempts < this.maxReconnectAttempts) {
523
520
  this.reconnectAttempts++;
524
- const i = this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1);
525
- console.log(`[Widget] Reconnecting in ${i}ms... (attempt ${this.reconnectAttempts})`), setTimeout(() => this.connectToAgent(), i);
521
+ const s = this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1);
522
+ console.log(`[Widget] Reconnecting in ${s}ms... (attempt ${this.reconnectAttempts})`), setTimeout(() => this.connectToAgent(), s);
526
523
  }
527
- }, this.ws.onerror = (i) => {
528
- console.error("[Widget] WebSocket error:", i), o(i);
524
+ }, this.ws.onerror = (s) => {
525
+ console.error("[Widget] WebSocket error:", s), o(s);
529
526
  };
530
- } catch (i) {
531
- o(i);
527
+ } catch (s) {
528
+ o(s);
532
529
  }
533
530
  });
534
531
  }
@@ -552,15 +549,15 @@ class Nt {
552
549
  if (n.type === "connected")
553
550
  this.notifyConnectionChange(!0);
554
551
  else if (n.type === "text-delta")
555
- this.isAgentProcessing && this.notifyProcessingChange(!1), this.setMessages((s) => {
556
- const o = s[s.length - 1];
552
+ this.isAgentProcessing && this.notifyProcessingChange(!1), this.setMessages((i) => {
553
+ const o = i[i.length - 1];
557
554
  return o && o.role === "assistant" && o.isStreaming ? [
558
- ...s.slice(0, -1),
555
+ ...i.slice(0, -1),
559
556
  { ...o, content: o.content + n.text }
560
557
  ] : [
561
- ...s,
558
+ ...i,
562
559
  {
563
- id: ie(),
560
+ id: ae(),
564
561
  role: "assistant",
565
562
  content: n.text,
566
563
  timestamp: Date.now(),
@@ -569,20 +566,20 @@ class Nt {
569
566
  ];
570
567
  });
571
568
  else if (n.type === "done")
572
- this.notifyProcessingChange(!1), this.setMessages((s) => {
573
- const o = s[s.length - 1];
569
+ this.notifyProcessingChange(!1), this.setMessages((i) => {
570
+ const o = i[i.length - 1];
574
571
  return o && o.role === "assistant" && o.isStreaming ? [
575
- ...s.slice(0, -1),
572
+ ...i.slice(0, -1),
576
573
  { ...o, isStreaming: !1 }
577
- ] : s;
574
+ ] : i;
578
575
  }), this.isAgentStreaming = !1, this.notifyStreamingChange(!1), this.processMessageQueue();
579
576
  else if (n.type === "step-start" || n.type === "agent-start")
580
577
  this.isAgentStreaming = !0, this.notifyStreamingChange(!0), this.notifyProcessingChange(!0);
581
578
  else if (n.type === "step-end" || n.type === "agent-end")
582
579
  n.type === "agent-end" && this.notifyProcessingChange(!1);
583
580
  else if (n.type === "tool-call") {
584
- const s = n.tool?.name || n.toolName, o = n.tool?.arguments || n.args;
585
- this.notifyProcessingChange(!0), s === "suggest_options" && o?.options && this.setActiveSuggestions(o.options);
581
+ const i = n.tool?.name || n.toolName, o = n.tool?.arguments || n.args;
582
+ this.notifyProcessingChange(!0), i === "suggest_options" && o?.options && this.setActiveSuggestions(o.options);
586
583
  } else n.type === "tool-result" || n.type === "handoff" || (n.type === "suggested-questions" ? this.setActiveSuggestions(n.suggestions) : n.type === "error" || n.type === "interrupted" ? (this.notifyProcessingChange(!1), this.isAgentStreaming = !1, this.notifyStreamingChange(!1)) : n.type === "cancelled" ? this.notifyProcessingChange(!1) : console.log("[Widget] Unknown message type:", n.type));
587
584
  } catch (n) {
588
585
  console.error("[Widget] Error parsing message:", e.data, n);
@@ -596,12 +593,12 @@ class Nt {
596
593
  throw new Error("Not connected to agent");
597
594
  this.setActiveSuggestions([]);
598
595
  const n = {
599
- id: ie(),
596
+ id: ae(),
600
597
  role: "user",
601
598
  content: e,
602
599
  timestamp: Date.now()
603
600
  };
604
- if (this.setMessages((s) => [...s, n]), this.isAgentStreaming) {
601
+ if (this.setMessages((i) => [...i, n]), this.isAgentStreaming) {
605
602
  console.log("[Widget] Agent is streaming, queuing message"), this.messageQueue.push(e), this.notifyQueueChange(this.messageQueue.length);
606
603
  return;
607
604
  }
@@ -636,7 +633,7 @@ class Nt {
636
633
  */
637
634
  getSessionId() {
638
635
  let e = sessionStorage.getItem("ariaflow_session_id");
639
- return e || (e = ie(), sessionStorage.setItem("ariaflow_session_id", e)), e;
636
+ return e || (e = ae(), sessionStorage.setItem("ariaflow_session_id", e)), e;
640
637
  }
641
638
  /**
642
639
  * Update messages state
@@ -706,8 +703,8 @@ class Nt {
706
703
  * Normalize and notify suggestion changes
707
704
  */
708
705
  setActiveSuggestions(e) {
709
- const n = Array.isArray(e) ? e.filter((o) => typeof o == "string").map((o) => o.trim()).filter(Boolean) : [], s = [...new Set(n)];
710
- this.activeSuggestions = s, this.suggestionsCallbacks.forEach((o) => o(s));
706
+ const n = Array.isArray(e) ? e.filter((o) => typeof o == "string").map((o) => o.trim()).filter(Boolean) : [], i = [...new Set(n)];
707
+ this.activeSuggestions = i, this.suggestionsCallbacks.forEach((o) => o(i));
711
708
  }
712
709
  normalizeBaseUrl(e) {
713
710
  return e.replace(/\/+$/, "");
@@ -745,20 +742,20 @@ class Nt {
745
742
  this.disposed = !0, this.ws && (this.ws.close(), this.ws = null), this.messageCallbacks.clear(), this.suggestionsCallbacks.clear(), this.connectionCallbacks.clear(), this.streamingCallbacks.clear(), this.processingCallbacks.clear(), this.queueCallbacks.clear();
746
743
  }
747
744
  }
748
- const oe = {
745
+ const le = {
749
746
  none: "0",
750
747
  small: "0.375rem",
751
748
  medium: "0.75rem",
752
749
  large: "1rem"
753
750
  };
754
- function xt({
751
+ function Tt({
755
752
  agentUrl: t,
756
753
  agentId: e,
757
754
  // Legacy props for backward compatibility
758
755
  widgetId: n,
759
- apiUrl: s,
756
+ apiUrl: i,
760
757
  mode: o = "chat",
761
- theme: i = "light",
758
+ theme: s = "light",
762
759
  position: a = "bottom-right",
763
760
  size: _ = "full",
764
761
  radius: c = "medium",
@@ -770,45 +767,45 @@ function xt({
770
767
  subtitle: v,
771
768
  emptyChatMessage: k
772
769
  }) {
773
- const [w, p] = M(!1), [f, E] = M([]), [$, H] = M(""), [S, z] = M(!1), [A, F] = M(!1), [U, N] = M(null), [P, Ze] = M(!1), [et, tt] = M(!1), [ne, nt] = M(0), [fe, st] = M([]), j = We(null), pe = We(null);
774
- Ee(() => ((async () => {
770
+ const [w, p] = T(!1), [f, x] = T([]), [S, E] = T(""), [P, I] = T(!1), [A, $] = T(!1), [W, tt] = T(null), [Q, nt] = T(!1), [st, it] = T(!1), [ie, ot] = T(0), [ye, rt] = T([]), z = Ee(null), ve = Ee(null);
771
+ Ue(() => ((async () => {
775
772
  if (t && e) {
776
- const W = new Nt(t, e);
777
- j.current = W;
773
+ const M = new Mt(t, e);
774
+ z.current = M;
778
775
  try {
779
- W.onMessages((x) => E(x)), W.onConnectionChange((x) => {
780
- z(x), x && F(!0);
781
- }), W.onStreamingChange((x) => Ze(x)), W.onQueueChange((x) => nt(x)), W.onProcessingChange((x) => tt(x)), W.onSuggestionsChange((x) => st(x));
782
- const V = await W.initWidget();
783
- V ? N(V) : console.error("[AriaFlow Widget] Agent config fetch failed");
784
- } catch (V) {
785
- console.error("[AriaFlow Widget] Initialization error:", V);
776
+ M.onMessages((N) => x(N)), M.onConnectionChange((N) => {
777
+ I(N), N && $(!0);
778
+ }), M.onStreamingChange((N) => nt(N)), M.onQueueChange((N) => ot(N)), M.onProcessingChange((N) => it(N)), M.onSuggestionsChange((N) => rt(N));
779
+ const j = await M.initWidget();
780
+ j ? tt(j) : console.error("[AriaFlow Widget] Agent config fetch failed");
781
+ } catch (j) {
782
+ console.error("[AriaFlow Widget] Initialization error:", j);
786
783
  }
787
- } else t && !e ? (console.warn("[AriaFlow Widget] Direct WebSocket URLs are deprecated. Use agent-url + agent-id instead."), console.error("[AriaFlow Widget] Configuration error: agent-id is required")) : s && n ? (console.warn("[AriaFlow Widget] Legacy widget config is deprecated. Use agent-url + agent-id instead."), console.error("[AriaFlow Widget] Configuration error: use agent-url + agent-id instead")) : console.error("[AriaFlow Widget] Invalid configuration. Provide agent-url and agent-id.");
784
+ } else t && !e ? (console.warn("[AriaFlow Widget] Direct WebSocket URLs are deprecated. Use agent-url + agent-id instead."), console.error("[AriaFlow Widget] Configuration error: agent-id is required")) : i && n ? (console.warn("[AriaFlow Widget] Legacy widget config is deprecated. Use agent-url + agent-id instead."), console.error("[AriaFlow Widget] Configuration error: use agent-url + agent-id instead")) : console.error("[AriaFlow Widget] Invalid configuration. Provide agent-url and agent-id.");
788
785
  })(), () => {
789
- j.current?.dispose();
790
- }), [t, e, n, s]), Ee(() => {
791
- pe.current?.scrollIntoView({ behavior: "smooth" });
786
+ z.current?.dispose();
787
+ }), [t, e, n, i]), Ue(() => {
788
+ ve.current?.scrollIntoView({ behavior: "smooth" });
792
789
  }, [f]);
793
- const me = async () => {
794
- if (!$.trim() || !S) return;
795
- const b = $.trim();
796
- H("");
790
+ const we = async () => {
791
+ if (!S.trim() || !P) return;
792
+ const b = S.trim();
793
+ E("");
797
794
  try {
798
- await j.current?.sendMessage(b);
799
- } catch (W) {
800
- console.error("Failed to send message:", W);
795
+ await z.current?.sendMessage(b);
796
+ } catch (M) {
797
+ console.error("Failed to send message:", M);
801
798
  }
802
- }, it = (b) => {
803
- b.key === "Enter" && !b.shiftKey && (b.preventDefault(), me());
804
- }, ot = (b) => {
805
- !S || P || j.current?.sendMessage(b);
806
- }, rt = h || U?.config.title || "Ninewells Hospital", at = v || U?.config.subtitle || "How can we help you today?", lt = k || U?.config.emptyChatMessage || "Start a conversation with Ninewells...";
799
+ }, at = (b) => {
800
+ b.key === "Enter" && !b.shiftKey && (b.preventDefault(), we());
801
+ }, lt = (b) => {
802
+ !P || Q || z.current?.sendMessage(b);
803
+ }, _t = h || W?.config.title || "Ninewells Hospital", ct = v || W?.config.subtitle || "How can we help you today?", ut = k || W?.config.emptyChatMessage || "Start a conversation with Ninewells...";
807
804
  return /* @__PURE__ */ d(
808
805
  "div",
809
806
  {
810
807
  className: `ariaflow-widget-container ariaflow-widget-${a} ariaflow-widget-${_} ariaflow-widget-radius-${c}`,
811
- "data-theme": i,
808
+ "data-theme": s,
812
809
  style: {
813
810
  "--ariaflow-accent-color": u,
814
811
  "--ariaflow-base-color": l
@@ -868,8 +865,8 @@ function xt({
868
865
  {
869
866
  className: "ariaflow-widget-window",
870
867
  style: {
871
- backgroundColor: i === "dark" && l ? l : void 0,
872
- borderRadius: oe[c]
868
+ backgroundColor: s === "dark" && l ? l : void 0,
869
+ borderRadius: le[c]
873
870
  },
874
871
  children: [
875
872
  /* @__PURE__ */ d(
@@ -878,12 +875,12 @@ function xt({
878
875
  className: "ariaflow-widget-header",
879
876
  style: {
880
877
  backgroundColor: u,
881
- borderRadius: c === "none" ? "0" : `${oe[c]} ${oe[c]} 0 0`
878
+ borderRadius: c === "none" ? "0" : `${le[c]} ${le[c]} 0 0`
882
879
  },
883
880
  children: [
884
881
  /* @__PURE__ */ d("div", { className: "ariaflow-widget-header-content", children: /* @__PURE__ */ d("div", { className: "ariaflow-widget-title-group", children: [
885
- /* @__PURE__ */ d("h3", { className: "ariaflow-widget-title", children: rt }),
886
- /* @__PURE__ */ d("p", { className: "ariaflow-widget-subtitle", children: at })
882
+ /* @__PURE__ */ d("h3", { className: "ariaflow-widget-title", children: _t }),
883
+ /* @__PURE__ */ d("p", { className: "ariaflow-widget-subtitle", children: ct })
887
884
  ] }) }),
888
885
  /* @__PURE__ */ d(
889
886
  "button",
@@ -911,16 +908,16 @@ function xt({
911
908
  ]
912
909
  }
913
910
  ),
914
- !S && /* @__PURE__ */ d("div", { className: "ariaflow-widget-status", children: [
911
+ !P && /* @__PURE__ */ d("div", { className: "ariaflow-widget-status", children: [
915
912
  /* @__PURE__ */ d("span", { className: "ariaflow-widget-status-dot" }),
916
913
  "Connecting..."
917
914
  ] }),
918
- /* @__PURE__ */ d("div", { className: "ariaflow-widget-messages", children: f.length === 0 ? /* @__PURE__ */ d("div", { className: "ariaflow-widget-empty", children: /* @__PURE__ */ d("p", { children: S ? lt : "Connecting to agent..." }) }) : /* @__PURE__ */ d(D, { children: [
915
+ /* @__PURE__ */ d("div", { className: "ariaflow-widget-messages", children: f.length === 0 ? /* @__PURE__ */ d("div", { className: "ariaflow-widget-empty", children: /* @__PURE__ */ d("p", { children: P ? ut : "Connecting to agent..." }) }) : /* @__PURE__ */ d(H, { children: [
919
916
  f.map((b) => b.role === "tool" ? null : /* @__PURE__ */ d(
920
917
  "div",
921
918
  {
922
919
  className: `ariaflow-widget-message ariaflow-widget-message-${b.role}`,
923
- children: /* @__PURE__ */ d("div", { className: "ariaflow-widget-message-bubble", children: /* @__PURE__ */ d(D, { children: [
920
+ children: /* @__PURE__ */ d("div", { className: "ariaflow-widget-message-bubble", children: /* @__PURE__ */ d(H, { children: [
924
921
  b.content,
925
922
  b.isStreaming && /* @__PURE__ */ d("span", { className: "ariaflow-widget-typing-indicator", children: [
926
923
  /* @__PURE__ */ d("span", { children: "•" }),
@@ -931,18 +928,18 @@ function xt({
931
928
  },
932
929
  b.id
933
930
  )),
934
- /* @__PURE__ */ d("div", { ref: pe }),
935
- et && !P && /* @__PURE__ */ d("div", { className: "ariaflow-widget-message ariaflow-widget-message-assistant", children: /* @__PURE__ */ d("div", { className: "ariaflow-widget-message-bubble", children: /* @__PURE__ */ d("span", { className: "ariaflow-widget-typing-indicator", children: [
931
+ /* @__PURE__ */ d("div", { ref: ve }),
932
+ st && !Q && /* @__PURE__ */ d("div", { className: "ariaflow-widget-message ariaflow-widget-message-assistant", children: /* @__PURE__ */ d("div", { className: "ariaflow-widget-message-bubble", children: /* @__PURE__ */ d("span", { className: "ariaflow-widget-typing-indicator", children: [
936
933
  /* @__PURE__ */ d("span", { children: "•" }),
937
934
  /* @__PURE__ */ d("span", { children: "•" }),
938
935
  /* @__PURE__ */ d("span", { children: "•" })
939
936
  ] }) }) })
940
937
  ] }) }),
941
- !P && fe.length > 0 && /* @__PURE__ */ d("div", { className: "ariaflow-widget-suggestions", children: fe.map((b) => /* @__PURE__ */ d(
938
+ !Q && ye.length > 0 && /* @__PURE__ */ d("div", { className: "ariaflow-widget-suggestions", children: ye.map((b) => /* @__PURE__ */ d(
942
939
  "button",
943
940
  {
944
941
  className: "ariaflow-widget-chip",
945
- onClick: () => ot(b),
942
+ onClick: () => lt(b),
946
943
  style: {
947
944
  borderColor: u,
948
945
  color: u,
@@ -957,20 +954,20 @@ function xt({
957
954
  /* @__PURE__ */ d(
958
955
  "textarea",
959
956
  {
960
- value: $,
961
- onInput: (b) => H(b.target.value),
962
- onKeyDown: it,
963
- placeholder: S ? P ? ne > 0 ? `Agent is responding... (${ne} message${ne > 1 ? "s" : ""} queued)` : "Agent is responding..." : "Type your message..." : "Connecting...",
957
+ value: S,
958
+ onInput: (b) => E(b.target.value),
959
+ onKeyDown: at,
960
+ placeholder: P ? Q ? ie > 0 ? `Agent is responding... (${ie} message${ie > 1 ? "s" : ""} queued)` : "Agent is responding..." : "Type your message..." : "Connecting...",
964
961
  rows: 1,
965
- disabled: !S
962
+ disabled: !P
966
963
  }
967
964
  ),
968
965
  /* @__PURE__ */ d(
969
966
  "button",
970
967
  {
971
968
  className: "ariaflow-widget-send",
972
- onClick: me,
973
- disabled: !$.trim() || !S,
969
+ onClick: we,
970
+ disabled: !S.trim() || !P,
974
971
  style: { backgroundColor: u },
975
972
  "aria-label": "Send message",
976
973
  children: /* @__PURE__ */ d(
@@ -998,7 +995,7 @@ function xt({
998
995
  }
999
996
  );
1000
997
  }
1001
- const Pt = [
998
+ const Ut = [
1002
999
  "agent-url",
1003
1000
  "agent-id",
1004
1001
  // Legacy support
@@ -1018,20 +1015,20 @@ const Pt = [
1018
1015
  "subtitle",
1019
1016
  "empty-chat-message"
1020
1017
  ];
1021
- pt(
1022
- xt,
1018
+ wt(
1019
+ Tt,
1023
1020
  "ariaflow-widget",
1024
1021
  // Keep kebab-case attribute names for HTML usage.
1025
- Pt,
1022
+ Ut,
1026
1023
  // Shadow DOM (optional, set to false for light DOM)
1027
1024
  { shadow: !1 }
1028
1025
  );
1029
- typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Te) : Te());
1030
- function Te() {
1026
+ typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", He) : He());
1027
+ function He() {
1031
1028
  const t = document.querySelectorAll("ariaflow-widget");
1032
1029
  console.log(`[AriaFlow] Initializing ${t.length} widget(s)`);
1033
1030
  }
1034
1031
  export {
1035
- xt as Widget,
1036
- Nt as WidgetClient
1032
+ Tt as Widget,
1033
+ Mt as WidgetClient
1037
1034
  };