@anam-ai/agent-widget 0.1.0-alpha.10 → 0.1.0-alpha.12

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Fe, D, fi, pi, Ee, Ht, _i, Ei, mi, It, _t, Et, Me = {}, gi = [], ln = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, rt = Array.isArray;
1
+ var Fe, k, fi, pi, Ee, Ht, _i, Ei, mi, It, _t, Et, Ue = {}, gi = [], ln = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, rt = Array.isArray;
2
2
  function ie(t, e) {
3
3
  for (var n in e) t[n] = e[n];
4
4
  return t;
@@ -6,15 +6,15 @@ function ie(t, e) {
6
6
  function bt(t) {
7
7
  t && t.parentNode && t.parentNode.removeChild(t);
8
8
  }
9
- function Ie(t, e, n) {
10
- var o, u, a, c = {};
11
- for (a in e) a == "key" ? o = e[a] : a == "ref" ? u = e[a] : c[a] = e[a];
12
- if (arguments.length > 2 && (c.children = arguments.length > 3 ? Fe.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (a in t.defaultProps) c[a] === void 0 && (c[a] = t.defaultProps[a]);
13
- return xe(t, c, o, u, null);
9
+ function Ce(t, e, n) {
10
+ var o, c, a, u = {};
11
+ for (a in e) a == "key" ? o = e[a] : a == "ref" ? c = e[a] : u[a] = e[a];
12
+ if (arguments.length > 2 && (u.children = arguments.length > 3 ? Fe.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (a in t.defaultProps) u[a] === void 0 && (u[a] = t.defaultProps[a]);
13
+ return xe(t, u, o, c, null);
14
14
  }
15
- function xe(t, e, n, o, u) {
16
- var a = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: u ?? ++fi, __i: -1, __u: 0 };
17
- return u == null && D.vnode != null && D.vnode(a), a;
15
+ function xe(t, e, n, o, c) {
16
+ var a = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: c ?? ++fi, __i: -1, __u: 0 };
17
+ return c == null && k.vnode != null && k.vnode(a), a;
18
18
  }
19
19
  function oe(t) {
20
20
  return t.children;
@@ -38,27 +38,27 @@ function vi(t) {
38
38
  }
39
39
  }
40
40
  function Wt(t) {
41
- (!t.__d && (t.__d = !0) && Ee.push(t) && !Je.__r++ || Ht != D.debounceRendering) && ((Ht = D.debounceRendering) || _i)(Je);
41
+ (!t.__d && (t.__d = !0) && Ee.push(t) && !Je.__r++ || Ht != k.debounceRendering) && ((Ht = k.debounceRendering) || _i)(Je);
42
42
  }
43
43
  function Je() {
44
- for (var t, e, n, o, u, a, c, l = 1; Ee.length; ) Ee.length > l && Ee.sort(Ei), t = Ee.shift(), l = Ee.length, t.__d && (n = void 0, o = void 0, u = (o = (e = t).__v).__e, a = [], c = [], e.__P && ((n = ie({}, o)).__v = o.__v + 1, D.vnode && D.vnode(n), At(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [u] : null, a, u ?? be(o), !!(32 & o.__u), c), n.__v = o.__v, n.__.__k[n.__i] = n, wi(a, n, c), o.__e = o.__ = null, n.__e != u && vi(n)));
44
+ for (var t, e, n, o, c, a, u, l = 1; Ee.length; ) Ee.length > l && Ee.sort(Ei), t = Ee.shift(), l = Ee.length, t.__d && (n = void 0, o = void 0, c = (o = (e = t).__v).__e, a = [], u = [], e.__P && ((n = ie({}, o)).__v = o.__v + 1, k.vnode && k.vnode(n), At(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [c] : null, a, c ?? be(o), !!(32 & o.__u), u), n.__v = o.__v, n.__.__k[n.__i] = n, wi(a, n, u), o.__e = o.__ = null, n.__e != c && vi(n)));
45
45
  Je.__r = 0;
46
46
  }
47
- function yi(t, e, n, o, u, a, c, l, m, p, _) {
48
- var d, S, g, y, b, A, C, I = o && o.__k || gi, x = e.length;
49
- for (m = cn(n, e, I, m, x), d = 0; d < x; d++) (g = n.__k[d]) != null && (S = g.__i == -1 ? Me : I[g.__i] || Me, g.__i = d, A = At(t, g, S, u, a, c, l, m, p, _), y = g.__e, g.ref && S.ref != g.ref && (S.ref && Tt(S.ref, null, g), _.push(g.ref, g.__c || y, g)), b == null && y != null && (b = y), (C = !!(4 & g.__u)) || S.__k === g.__k ? m = Si(g, m, t, C) : typeof g.type == "function" && A !== void 0 ? m = A : y && (m = y.nextSibling), g.__u &= -7);
50
- return n.__e = b, m;
47
+ function yi(t, e, n, o, c, a, u, l, m, p, _) {
48
+ var d, y, g, S, C, A, I, b = o && o.__k || gi, T = e.length;
49
+ for (m = cn(n, e, b, m, T), d = 0; d < T; d++) (g = n.__k[d]) != null && (y = g.__i == -1 ? Ue : b[g.__i] || Ue, g.__i = d, A = At(t, g, y, c, a, u, l, m, p, _), S = g.__e, g.ref && y.ref != g.ref && (y.ref && Tt(y.ref, null, g), _.push(g.ref, g.__c || S, g)), C == null && S != null && (C = S), (I = !!(4 & g.__u)) || y.__k === g.__k ? m = Si(g, m, t, I) : typeof g.type == "function" && A !== void 0 ? m = A : S && (m = S.nextSibling), g.__u &= -7);
50
+ return n.__e = C, m;
51
51
  }
52
- function cn(t, e, n, o, u) {
53
- var a, c, l, m, p, _ = n.length, d = _, S = 0;
54
- for (t.__k = new Array(u), a = 0; a < u; a++) (c = e[a]) != null && typeof c != "boolean" && typeof c != "function" ? (typeof c == "string" || typeof c == "number" || typeof c == "bigint" || c.constructor == String ? c = t.__k[a] = xe(null, c, null, null, null) : rt(c) ? c = t.__k[a] = xe(oe, { children: c }, null, null, null) : c.constructor === void 0 && c.__b > 0 ? c = t.__k[a] = xe(c.type, c.props, c.key, c.ref ? c.ref : null, c.__v) : t.__k[a] = c, m = a + S, c.__ = t, c.__b = t.__b + 1, l = null, (p = c.__i = un(c, n, m, d)) != -1 && (d--, (l = n[p]) && (l.__u |= 2)), l == null || l.__v == null ? (p == -1 && (u > _ ? S-- : u < _ && S++), typeof c.type != "function" && (c.__u |= 4)) : p != m && (p == m - 1 ? S-- : p == m + 1 ? S++ : (p > m ? S-- : S++, c.__u |= 4))) : t.__k[a] = null;
52
+ function cn(t, e, n, o, c) {
53
+ var a, u, l, m, p, _ = n.length, d = _, y = 0;
54
+ for (t.__k = new Array(c), a = 0; a < c; a++) (u = e[a]) != null && typeof u != "boolean" && typeof u != "function" ? (typeof u == "string" || typeof u == "number" || typeof u == "bigint" || u.constructor == String ? u = t.__k[a] = xe(null, u, null, null, null) : rt(u) ? u = t.__k[a] = xe(oe, { children: u }, null, null, null) : u.constructor === void 0 && u.__b > 0 ? u = t.__k[a] = xe(u.type, u.props, u.key, u.ref ? u.ref : null, u.__v) : t.__k[a] = u, m = a + y, u.__ = t, u.__b = t.__b + 1, l = null, (p = u.__i = un(u, n, m, d)) != -1 && (d--, (l = n[p]) && (l.__u |= 2)), l == null || l.__v == null ? (p == -1 && (c > _ ? y-- : c < _ && y++), typeof u.type != "function" && (u.__u |= 4)) : p != m && (p == m - 1 ? y-- : p == m + 1 ? y++ : (p > m ? y-- : y++, u.__u |= 4))) : t.__k[a] = null;
55
55
  if (d) for (a = 0; a < _; a++) (l = n[a]) != null && (2 & l.__u) == 0 && (l.__e == o && (o = be(l)), Ii(l, l));
56
56
  return o;
57
57
  }
58
58
  function Si(t, e, n, o) {
59
- var u, a;
59
+ var c, a;
60
60
  if (typeof t.type == "function") {
61
- for (u = t.__k, a = 0; u && a < u.length; a++) u[a] && (u[a].__ = t, e = Si(u[a], e, n, o));
61
+ for (c = t.__k, a = 0; c && a < c.length; a++) c[a] && (c[a].__ = t, e = Si(c[a], e, n, o));
62
62
  return e;
63
63
  }
64
64
  t.__e != e && (o && (e && t.type && !e.parentNode && (e = be(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
@@ -68,26 +68,26 @@ function Si(t, e, n, o) {
68
68
  return e;
69
69
  }
70
70
  function un(t, e, n, o) {
71
- var u, a, c, l = t.key, m = t.type, p = e[n], _ = p != null && (2 & p.__u) == 0;
71
+ var c, a, u, l = t.key, m = t.type, p = e[n], _ = p != null && (2 & p.__u) == 0;
72
72
  if (p === null && l == null || _ && l == p.key && m == p.type) return n;
73
73
  if (o > (_ ? 1 : 0)) {
74
- for (u = n - 1, a = n + 1; u >= 0 || a < e.length; ) if ((p = e[c = u >= 0 ? u-- : a++]) != null && (2 & p.__u) == 0 && l == p.key && m == p.type) return c;
74
+ for (c = n - 1, a = n + 1; c >= 0 || a < e.length; ) if ((p = e[u = c >= 0 ? c-- : a++]) != null && (2 & p.__u) == 0 && l == p.key && m == p.type) return u;
75
75
  }
76
76
  return -1;
77
77
  }
78
78
  function zt(t, e, n) {
79
79
  e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || ln.test(e) ? n : n + "px";
80
80
  }
81
- function Ve(t, e, n, o, u) {
82
- var a, c;
81
+ function Ve(t, e, n, o, c) {
82
+ var a, u;
83
83
  e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
84
84
  else {
85
85
  if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || zt(t.style, e, "");
86
86
  if (n) for (e in n) o && n[e] == o[e] || zt(t.style, e, n[e]);
87
87
  }
88
- else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(mi, "$1")), c = e.toLowerCase(), e = c in t || e == "onFocusOut" || e == "onFocusIn" ? c.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + a] = n, n ? o ? n.u = o.u : (n.u = It, t.addEventListener(e, a ? Et : _t, a)) : t.removeEventListener(e, a ? Et : _t, a);
88
+ else if (e[0] == "o" && e[1] == "n") a = e != (e = e.replace(mi, "$1")), u = e.toLowerCase(), e = u in t || e == "onFocusOut" || e == "onFocusIn" ? u.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + a] = n, n ? o ? n.u = o.u : (n.u = It, t.addEventListener(e, a ? Et : _t, a)) : t.removeEventListener(e, a ? Et : _t, a);
89
89
  else {
90
- if (u == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
90
+ if (c == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
91
91
  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 {
92
92
  t[e] = n ?? "";
93
93
  break e;
@@ -102,35 +102,35 @@ function qt(t) {
102
102
  var n = this.l[e.type + t];
103
103
  if (e.t == null) e.t = It++;
104
104
  else if (e.t < n.u) return;
105
- return n(D.event ? D.event(e) : e);
105
+ return n(k.event ? k.event(e) : e);
106
106
  }
107
107
  };
108
108
  }
109
- function At(t, e, n, o, u, a, c, l, m, p) {
110
- var _, d, S, g, y, b, A, C, I, x, O, R, G, W, ae, ne, re, Q = e.type;
109
+ function At(t, e, n, o, c, a, u, l, m, p) {
110
+ var _, d, y, g, S, C, A, I, b, T, D, x, Z, H, ae, ne, re, Q = e.type;
111
111
  if (e.constructor !== void 0) return null;
112
- 128 & n.__u && (m = !!(32 & n.__u), a = [l = e.__e = n.__e]), (_ = D.__b) && _(e);
112
+ 128 & n.__u && (m = !!(32 & n.__u), a = [l = e.__e = n.__e]), (_ = k.__b) && _(e);
113
113
  e: if (typeof Q == "function") try {
114
- if (C = e.props, I = "prototype" in Q && Q.prototype.render, x = (_ = Q.contextType) && o[_.__c], O = _ ? x ? x.props.value : _.__ : o, n.__c ? A = (d = e.__c = n.__c).__ = d.__E : (I ? e.__c = d = new Q(C, O) : (e.__c = d = new Oe(C, O), d.constructor = Q, d.render = hn), x && x.sub(d), d.state || (d.state = {}), d.__n = o, S = d.__d = !0, d.__h = [], d._sb = []), I && d.__s == null && (d.__s = d.state), I && Q.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ie({}, d.__s)), ie(d.__s, Q.getDerivedStateFromProps(C, d.__s))), g = d.props, y = d.state, d.__v = e, S) I && Q.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), I && d.componentDidMount != null && d.__h.push(d.componentDidMount);
114
+ if (I = e.props, b = "prototype" in Q && Q.prototype.render, T = (_ = Q.contextType) && o[_.__c], D = _ ? T ? T.props.value : _.__ : o, n.__c ? A = (d = e.__c = n.__c).__ = d.__E : (b ? e.__c = d = new Q(I, D) : (e.__c = d = new Oe(I, D), d.constructor = Q, d.render = hn), T && T.sub(d), d.state || (d.state = {}), d.__n = o, y = d.__d = !0, d.__h = [], d._sb = []), b && d.__s == null && (d.__s = d.state), b && Q.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ie({}, d.__s)), ie(d.__s, Q.getDerivedStateFromProps(I, d.__s))), g = d.props, S = d.state, d.__v = e, y) b && Q.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), b && d.componentDidMount != null && d.__h.push(d.componentDidMount);
115
115
  else {
116
- if (I && Q.getDerivedStateFromProps == null && C !== g && d.componentWillReceiveProps != null && d.componentWillReceiveProps(C, O), e.__v == n.__v || !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(C, d.__s, O) === !1) {
117
- for (e.__v != n.__v && (d.props = C, d.state = d.__s, d.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(le) {
116
+ if (b && Q.getDerivedStateFromProps == null && I !== g && d.componentWillReceiveProps != null && d.componentWillReceiveProps(I, D), e.__v == n.__v || !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(I, d.__s, D) === !1) {
117
+ for (e.__v != n.__v && (d.props = I, d.state = d.__s, d.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(le) {
118
118
  le && (le.__ = e);
119
- }), R = 0; R < d._sb.length; R++) d.__h.push(d._sb[R]);
120
- d._sb = [], d.__h.length && c.push(d);
119
+ }), x = 0; x < d._sb.length; x++) d.__h.push(d._sb[x]);
120
+ d._sb = [], d.__h.length && u.push(d);
121
121
  break e;
122
122
  }
123
- d.componentWillUpdate != null && d.componentWillUpdate(C, d.__s, O), I && d.componentDidUpdate != null && d.__h.push(function() {
124
- d.componentDidUpdate(g, y, b);
123
+ d.componentWillUpdate != null && d.componentWillUpdate(I, d.__s, D), b && d.componentDidUpdate != null && d.__h.push(function() {
124
+ d.componentDidUpdate(g, S, C);
125
125
  });
126
126
  }
127
- if (d.context = O, d.props = C, d.__P = t, d.__e = !1, G = D.__r, W = 0, I) {
128
- for (d.state = d.__s, d.__d = !1, G && G(e), _ = d.render(d.props, d.state, d.context), ae = 0; ae < d._sb.length; ae++) d.__h.push(d._sb[ae]);
127
+ if (d.context = D, d.props = I, d.__P = t, d.__e = !1, Z = k.__r, H = 0, b) {
128
+ for (d.state = d.__s, d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), ae = 0; ae < d._sb.length; ae++) d.__h.push(d._sb[ae]);
129
129
  d._sb = [];
130
130
  } else do
131
- d.__d = !1, G && G(e), _ = d.render(d.props, d.state, d.context), d.state = d.__s;
132
- while (d.__d && ++W < 25);
133
- d.state = d.__s, d.getChildContext != null && (o = ie(ie({}, o), d.getChildContext())), I && !S && d.getSnapshotBeforeUpdate != null && (b = d.getSnapshotBeforeUpdate(g, y)), ne = _, _ != null && _.type === oe && _.key == null && (ne = Ci(_.props.children)), l = yi(t, rt(ne) ? ne : [ne], e, n, o, u, a, c, l, m, p), d.base = e.__e, e.__u &= -161, d.__h.length && c.push(d), A && (d.__E = d.__ = null);
131
+ d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), d.state = d.__s;
132
+ while (d.__d && ++H < 25);
133
+ d.state = d.__s, d.getChildContext != null && (o = ie(ie({}, o), d.getChildContext())), b && !y && d.getSnapshotBeforeUpdate != null && (C = d.getSnapshotBeforeUpdate(g, S)), ne = _, _ != null && _.type === oe && _.key == null && (ne = Ci(_.props.children)), l = yi(t, rt(ne) ? ne : [ne], e, n, o, c, a, u, l, m, p), d.base = e.__e, e.__u &= -161, d.__h.length && u.push(d), A && (d.__E = d.__ = null);
134
134
  } catch (le) {
135
135
  if (e.__v = null, m || a != null) if (le.then) {
136
136
  for (e.__u |= m ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
@@ -140,55 +140,55 @@ function At(t, e, n, o, u, a, c, l, m, p) {
140
140
  mt(e);
141
141
  }
142
142
  else e.__e = n.__e, e.__k = n.__k, le.then || mt(e);
143
- D.__e(le, e, n);
143
+ k.__e(le, e, n);
144
144
  }
145
- else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = dn(n.__e, e, n, o, u, a, c, m, p);
146
- return (_ = D.diffed) && _(e), 128 & e.__u ? void 0 : l;
145
+ else a == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = dn(n.__e, e, n, o, c, a, u, m, p);
146
+ return (_ = k.diffed) && _(e), 128 & e.__u ? void 0 : l;
147
147
  }
148
148
  function mt(t) {
149
149
  t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(mt);
150
150
  }
151
151
  function wi(t, e, n) {
152
152
  for (var o = 0; o < n.length; o++) Tt(n[o], n[++o], n[++o]);
153
- D.__c && D.__c(e, t), t.some(function(u) {
153
+ k.__c && k.__c(e, t), t.some(function(c) {
154
154
  try {
155
- t = u.__h, u.__h = [], t.some(function(a) {
156
- a.call(u);
155
+ t = c.__h, c.__h = [], t.some(function(a) {
156
+ a.call(c);
157
157
  });
158
158
  } catch (a) {
159
- D.__e(a, u.__v);
159
+ k.__e(a, c.__v);
160
160
  }
161
161
  });
162
162
  }
163
163
  function Ci(t) {
164
164
  return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : rt(t) ? t.map(Ci) : ie({}, t);
165
165
  }
166
- function dn(t, e, n, o, u, a, c, l, m) {
167
- var p, _, d, S, g, y, b, A = n.props || Me, C = e.props, I = e.type;
168
- if (I == "svg" ? u = "http://www.w3.org/2000/svg" : I == "math" ? u = "http://www.w3.org/1998/Math/MathML" : u || (u = "http://www.w3.org/1999/xhtml"), a != null) {
169
- for (p = 0; p < a.length; p++) if ((g = a[p]) && "setAttribute" in g == !!I && (I ? g.localName == I : g.nodeType == 3)) {
166
+ function dn(t, e, n, o, c, a, u, l, m) {
167
+ var p, _, d, y, g, S, C, A = n.props || Ue, I = e.props, b = e.type;
168
+ if (b == "svg" ? c = "http://www.w3.org/2000/svg" : b == "math" ? c = "http://www.w3.org/1998/Math/MathML" : c || (c = "http://www.w3.org/1999/xhtml"), a != null) {
169
+ for (p = 0; p < a.length; p++) if ((g = a[p]) && "setAttribute" in g == !!b && (b ? g.localName == b : g.nodeType == 3)) {
170
170
  t = g, a[p] = null;
171
171
  break;
172
172
  }
173
173
  }
174
174
  if (t == null) {
175
- if (I == null) return document.createTextNode(C);
176
- t = document.createElementNS(u, I, C.is && C), l && (D.__m && D.__m(e, a), l = !1), a = null;
175
+ if (b == null) return document.createTextNode(I);
176
+ t = document.createElementNS(c, b, I.is && I), l && (k.__m && k.__m(e, a), l = !1), a = null;
177
177
  }
178
- if (I == null) A === C || l && t.data == C || (t.data = C);
178
+ if (b == null) A === I || l && t.data == I || (t.data = I);
179
179
  else {
180
180
  if (a = a && Fe.call(t.childNodes), !l && a != null) for (A = {}, p = 0; p < t.attributes.length; p++) A[(g = t.attributes[p]).name] = g.value;
181
181
  for (p in A) if (g = A[p], p != "children") {
182
182
  if (p == "dangerouslySetInnerHTML") d = g;
183
- else if (!(p in C)) {
184
- if (p == "value" && "defaultValue" in C || p == "checked" && "defaultChecked" in C) continue;
185
- Ve(t, p, null, g, u);
183
+ else if (!(p in I)) {
184
+ if (p == "value" && "defaultValue" in I || p == "checked" && "defaultChecked" in I) continue;
185
+ Ve(t, p, null, g, c);
186
186
  }
187
187
  }
188
- for (p in C) g = C[p], p == "children" ? S = g : p == "dangerouslySetInnerHTML" ? _ = g : p == "value" ? y = g : p == "checked" ? b = g : l && typeof g != "function" || A[p] === g || Ve(t, p, g, A[p], u);
188
+ for (p in I) g = I[p], p == "children" ? y = g : p == "dangerouslySetInnerHTML" ? _ = g : p == "value" ? S = g : p == "checked" ? C = g : l && typeof g != "function" || A[p] === g || Ve(t, p, g, A[p], c);
189
189
  if (_) l || d && (_.__html == d.__html || _.__html == t.innerHTML) || (t.innerHTML = _.__html), e.__k = [];
190
- else if (d && (t.innerHTML = ""), yi(e.type == "template" ? t.content : t, rt(S) ? S : [S], e, n, o, I == "foreignObject" ? "http://www.w3.org/1999/xhtml" : u, a, c, a ? a[0] : n.__k && be(n, 0), l, m), a != null) for (p = a.length; p--; ) bt(a[p]);
191
- l || (p = "value", I == "progress" && y == null ? t.removeAttribute("value") : y != null && (y !== t[p] || I == "progress" && !y || I == "option" && y != A[p]) && Ve(t, p, y, A[p], u), p = "checked", b != null && b != t[p] && Ve(t, p, b, A[p], u));
190
+ else if (d && (t.innerHTML = ""), yi(e.type == "template" ? t.content : t, rt(y) ? y : [y], e, n, o, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : c, a, u, a ? a[0] : n.__k && be(n, 0), l, m), a != null) for (p = a.length; p--; ) bt(a[p]);
191
+ l || (p = "value", b == "progress" && S == null ? t.removeAttribute("value") : S != null && (S !== t[p] || b == "progress" && !S || b == "option" && S != A[p]) && Ve(t, p, S, A[p], c), p = "checked", C != null && C != t[p] && Ve(t, p, C, A[p], c));
192
192
  }
193
193
  return t;
194
194
  }
@@ -198,41 +198,41 @@ function Tt(t, e, n) {
198
198
  var o = typeof t.__u == "function";
199
199
  o && t.__u(), o && e == null || (t.__u = t(e));
200
200
  } else t.current = e;
201
- } catch (u) {
202
- D.__e(u, n);
201
+ } catch (c) {
202
+ k.__e(c, n);
203
203
  }
204
204
  }
205
205
  function Ii(t, e, n) {
206
- var o, u;
207
- if (D.unmount && D.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || Tt(o, null, e)), (o = t.__c) != null) {
206
+ var o, c;
207
+ if (k.unmount && k.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || Tt(o, null, e)), (o = t.__c) != null) {
208
208
  if (o.componentWillUnmount) try {
209
209
  o.componentWillUnmount();
210
210
  } catch (a) {
211
- D.__e(a, e);
211
+ k.__e(a, e);
212
212
  }
213
213
  o.base = o.__P = null;
214
214
  }
215
- if (o = t.__k) for (u = 0; u < o.length; u++) o[u] && Ii(o[u], e, n || typeof t.type != "function");
215
+ if (o = t.__k) for (c = 0; c < o.length; c++) o[c] && Ii(o[c], e, n || typeof t.type != "function");
216
216
  n || bt(t.__e), t.__c = t.__ = t.__e = void 0;
217
217
  }
218
218
  function hn(t, e, n) {
219
219
  return this.constructor(t, n);
220
220
  }
221
221
  function ot(t, e, n) {
222
- var o, u, a, c;
223
- e == document && (e = document.documentElement), D.__ && D.__(t, e), u = (o = typeof n == "function") ? null : n && n.__k || e.__k, a = [], c = [], At(e, t = (!o && n || e).__k = Ie(oe, null, [t]), u || Me, Me, e.namespaceURI, !o && n ? [n] : u ? null : e.firstChild ? Fe.call(e.childNodes) : null, a, !o && n ? n : u ? u.__e : e.firstChild, o, c), wi(a, t, c);
222
+ var o, c, a, u;
223
+ e == document && (e = document.documentElement), k.__ && k.__(t, e), c = (o = typeof n == "function") ? null : n && n.__k || e.__k, a = [], u = [], At(e, t = (!o && n || e).__k = Ce(oe, null, [t]), c || Ue, Ue, e.namespaceURI, !o && n ? [n] : c ? null : e.firstChild ? Fe.call(e.childNodes) : null, a, !o && n ? n : c ? c.__e : e.firstChild, o, u), wi(a, t, u);
224
224
  }
225
225
  function bi(t, e) {
226
226
  ot(t, e, bi);
227
227
  }
228
228
  function Ai(t, e, n) {
229
- var o, u, a, c, l = ie({}, t.props);
230
- for (a in t.type && t.type.defaultProps && (c = t.type.defaultProps), e) a == "key" ? o = e[a] : a == "ref" ? u = e[a] : l[a] = e[a] === void 0 && c != null ? c[a] : e[a];
231
- return arguments.length > 2 && (l.children = arguments.length > 3 ? Fe.call(arguments, 2) : n), xe(t.type, l, o || t.key, u || t.ref, null);
229
+ var o, c, a, u, l = ie({}, t.props);
230
+ for (a in t.type && t.type.defaultProps && (u = t.type.defaultProps), e) a == "key" ? o = e[a] : a == "ref" ? c = e[a] : l[a] = e[a] === void 0 && u != null ? u[a] : e[a];
231
+ return arguments.length > 2 && (l.children = arguments.length > 3 ? Fe.call(arguments, 2) : n), xe(t.type, l, o || t.key, c || t.ref, null);
232
232
  }
233
- Fe = gi.slice, D = { __e: function(t, e, n, o) {
234
- for (var u, a, c; e = e.__; ) if ((u = e.__c) && !u.__) try {
235
- if ((a = u.constructor) && a.getDerivedStateFromError != null && (u.setState(a.getDerivedStateFromError(t)), c = u.__d), u.componentDidCatch != null && (u.componentDidCatch(t, o || {}), c = u.__d), c) return u.__E = u;
233
+ Fe = gi.slice, k = { __e: function(t, e, n, o) {
234
+ for (var c, a, u; e = e.__; ) if ((c = e.__c) && !c.__) try {
235
+ if ((a = c.constructor) && a.getDerivedStateFromError != null && (c.setState(a.getDerivedStateFromError(t)), u = c.__d), c.componentDidCatch != null && (c.componentDidCatch(t, o || {}), u = c.__d), u) return c.__E = c;
236
236
  } catch (l) {
237
237
  t = l;
238
238
  }
@@ -258,27 +258,27 @@ function Xe() {
258
258
  }
259
259
  function Ti(t, e) {
260
260
  if (t == null) return {};
261
- var n, o, u = {}, a = Object.keys(t);
262
- for (o = 0; o < a.length; o++) e.indexOf(n = a[o]) >= 0 || (u[n] = t[n]);
263
- return u;
261
+ var n, o, c = {}, a = Object.keys(t);
262
+ for (o = 0; o < a.length; o++) e.indexOf(n = a[o]) >= 0 || (c[n] = t[n]);
263
+ return c;
264
264
  }
265
265
  var fn = ["context", "children"], pn = ["useFragment"];
266
266
  function _n(t, e, n, o) {
267
- function u() {
268
- var a, c = Reflect.construct(HTMLElement, [], u);
269
- return c._vdomComponent = t, o && o.shadow ? (c._root = c.attachShadow({ mode: o.mode || "open", serializable: (a = o.serializable) != null && a }), o.adoptedStyleSheets && (c._root.adoptedStyleSheets = o.adoptedStyleSheets)) : c._root = c, c;
267
+ function c() {
268
+ var a, u = Reflect.construct(HTMLElement, [], c);
269
+ return u._vdomComponent = t, o && o.shadow ? (u._root = u.attachShadow({ mode: o.mode || "open", serializable: (a = o.serializable) != null && a }), o.adoptedStyleSheets && (u._root.adoptedStyleSheets = o.adoptedStyleSheets)) : u._root = u, u;
270
270
  }
271
- return (u.prototype = Object.create(HTMLElement.prototype)).constructor = u, u.prototype.connectedCallback = function() {
271
+ return (c.prototype = Object.create(HTMLElement.prototype)).constructor = c, c.prototype.connectedCallback = function() {
272
272
  mn.call(this, o);
273
- }, u.prototype.attributeChangedCallback = gn, u.prototype.disconnectedCallback = vn, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), u.observedAttributes = n, t.formAssociated && (u.formAssociated = !0), n.forEach(function(a) {
274
- Object.defineProperty(u.prototype, a, { get: function() {
273
+ }, c.prototype.attributeChangedCallback = gn, c.prototype.disconnectedCallback = vn, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), c.observedAttributes = n, t.formAssociated && (c.formAssociated = !0), n.forEach(function(a) {
274
+ Object.defineProperty(c.prototype, a, { get: function() {
275
275
  return this._vdom ? this._vdom.props[a] : this._props[a];
276
- }, set: function(c) {
277
- this._vdom ? this.attributeChangedCallback(a, null, c) : (this._props || (this._props = {}), this._props[a] = c);
278
- var l = typeof c;
279
- c != null && l !== "string" && l !== "boolean" && l !== "number" || this.setAttribute(a, c);
276
+ }, set: function(u) {
277
+ this._vdom ? this.attributeChangedCallback(a, null, u) : (this._props || (this._props = {}), this._props[a] = u);
278
+ var l = typeof u;
279
+ u != null && l !== "string" && l !== "boolean" && l !== "number" || this.setAttribute(a, u);
280
280
  } });
281
- }), customElements.define(e || t.tagName || t.displayName || t.name, u), u;
281
+ }), customElements.define(e || t.tagName || t.displayName || t.name, c), c;
282
282
  }
283
283
  function En(t) {
284
284
  this.getChildContext = function() {
@@ -289,7 +289,7 @@ function En(t) {
289
289
  }
290
290
  function mn(t) {
291
291
  var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
292
- this.dispatchEvent(e), this._vdom = Ie(En, Xe({}, this._props, { context: e.detail.context }), Ni(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? bi : ot)(this._vdom, this._root);
292
+ this.dispatchEvent(e), this._vdom = Ce(En, Xe({}, this._props, { context: e.detail.context }), Ni(this, this._vdomComponent, t)), (this.hasAttribute("hydrate") ? bi : ot)(this._vdom, this._root);
293
293
  }
294
294
  function Ri(t) {
295
295
  return t.replace(/-(\w)/g, function(e, n) {
@@ -306,35 +306,35 @@ function vn() {
306
306
  ot(this._vdom = null, this._root);
307
307
  }
308
308
  function Yt(t, e) {
309
- var n = this, o = t.useFragment, u = Ti(t, pn);
310
- return Ie(o ? oe : "slot", Xe({}, u, { ref: function(a) {
311
- a ? (n.ref = a, n._listener || (n._listener = function(c) {
312
- c.stopPropagation(), c.detail.context = e;
309
+ var n = this, o = t.useFragment, c = Ti(t, pn);
310
+ return Ce(o ? oe : "slot", Xe({}, c, { ref: function(a) {
311
+ a ? (n.ref = a, n._listener || (n._listener = function(u) {
312
+ u.stopPropagation(), u.detail.context = e;
313
313
  }, a.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
314
314
  } }));
315
315
  }
316
316
  function Ni(t, e, n) {
317
317
  if (t.nodeType === 3) return t.data;
318
318
  if (t.nodeType !== 1) return null;
319
- var o = [], u = {}, a = 0, c = t.attributes, l = t.childNodes;
320
- for (a = c.length; a--; ) c[a].name !== "slot" && (u[c[a].name] = c[a].value, u[Ri(c[a].name)] = c[a].value);
319
+ var o = [], c = {}, a = 0, u = t.attributes, l = t.childNodes;
320
+ for (a = u.length; a--; ) u[a].name !== "slot" && (c[u[a].name] = u[a].value, c[Ri(u[a].name)] = u[a].value);
321
321
  for (a = l.length; a--; ) {
322
322
  var m = Ni(l[a], null, n), p = l[a].slot;
323
- p ? u[p] = Ie(Yt, { name: p }, m) : o[a] = m;
323
+ p ? c[p] = Ce(Yt, { name: p }, m) : o[a] = m;
324
324
  }
325
- var _ = !(!n || !n.shadow), d = e ? Ie(Yt, { useFragment: !_ }, o) : o;
326
- return !_ && e && (t.innerHTML = ""), Ie(e || t.nodeName.toLowerCase(), u, d);
325
+ var _ = !(!n || !n.shadow), d = e ? Ce(Yt, { useFragment: !_ }, o) : o;
326
+ return !_ && e && (t.innerHTML = ""), Ce(e || t.nodeName.toLowerCase(), c, d);
327
327
  }
328
328
  var yn = 0;
329
- function w(t, e, n, o, u, a) {
329
+ function w(t, e, n, o, c, a) {
330
330
  e || (e = {});
331
- var c, l, m = e;
332
- if ("ref" in m) for (l in m = {}, e) l == "ref" ? c = e[l] : m[l] = e[l];
333
- var p = { type: t, props: m, key: n, ref: c, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --yn, __i: -1, __u: 0, __source: u, __self: a };
334
- if (typeof t == "function" && (c = t.defaultProps)) for (l in c) m[l] === void 0 && (m[l] = c[l]);
335
- return D.vnode && D.vnode(p), p;
331
+ var u, l, m = e;
332
+ if ("ref" in m) for (l in m = {}, e) l == "ref" ? u = e[l] : m[l] = e[l];
333
+ var p = { type: t, props: m, key: n, ref: u, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --yn, __i: -1, __u: 0, __source: c, __self: a };
334
+ if (typeof t == "function" && (u = t.defaultProps)) for (l in u) m[l] === void 0 && (m[l] = u[l]);
335
+ return k.vnode && k.vnode(p), p;
336
336
  }
337
- var Ue, P, dt, Kt, Be = 0, xi = [], F = D, Jt = F.__b, Xt = F.__r, Zt = F.diffed, Qt = F.__c, ei = F.unmount, ti = F.__;
337
+ var Me, P, dt, Kt, Be = 0, xi = [], F = k, Jt = F.__b, Xt = F.__r, Zt = F.diffed, Qt = F.__c, ei = F.unmount, ti = F.__;
338
338
  function Rt(t, e) {
339
339
  F.__h && F.__h(P, t, Be || e), Be = 0;
340
340
  var n = P.__H || (P.__H = { __: [], __h: [] });
@@ -344,54 +344,54 @@ function qe(t) {
344
344
  return Be = 1, Sn(ki, t);
345
345
  }
346
346
  function Sn(t, e, n) {
347
- var o = Rt(Ue++, 2);
347
+ var o = Rt(Me++, 2);
348
348
  if (o.t = t, !o.__c && (o.__ = [ki(void 0, e), function(l) {
349
349
  var m = o.__N ? o.__N[0] : o.__[0], p = o.t(m, l);
350
350
  m !== p && (o.__N = [p, o.__[1]], o.__c.setState({}));
351
351
  }], o.__c = P, !P.__f)) {
352
- var u = function(l, m, p) {
352
+ var c = function(l, m, p) {
353
353
  if (!o.__c.__H) return !0;
354
- var _ = o.__c.__H.__.filter(function(S) {
355
- return !!S.__c;
354
+ var _ = o.__c.__H.__.filter(function(y) {
355
+ return !!y.__c;
356
356
  });
357
- if (_.every(function(S) {
358
- return !S.__N;
357
+ if (_.every(function(y) {
358
+ return !y.__N;
359
359
  })) return !a || a.call(this, l, m, p);
360
360
  var d = o.__c.props !== l;
361
- return _.forEach(function(S) {
362
- if (S.__N) {
363
- var g = S.__[0];
364
- S.__ = S.__N, S.__N = void 0, g !== S.__[0] && (d = !0);
361
+ return _.forEach(function(y) {
362
+ if (y.__N) {
363
+ var g = y.__[0];
364
+ y.__ = y.__N, y.__N = void 0, g !== y.__[0] && (d = !0);
365
365
  }
366
366
  }), a && a.call(this, l, m, p) || d;
367
367
  };
368
368
  P.__f = !0;
369
- var a = P.shouldComponentUpdate, c = P.componentWillUpdate;
369
+ var a = P.shouldComponentUpdate, u = P.componentWillUpdate;
370
370
  P.componentWillUpdate = function(l, m, p) {
371
371
  if (this.__e) {
372
372
  var _ = a;
373
- a = void 0, u(l, m, p), a = _;
373
+ a = void 0, c(l, m, p), a = _;
374
374
  }
375
- c && c.call(this, l, m, p);
376
- }, P.shouldComponentUpdate = u;
375
+ u && u.call(this, l, m, p);
376
+ }, P.shouldComponentUpdate = c;
377
377
  }
378
378
  return o.__N || o.__;
379
379
  }
380
380
  function gt(t, e) {
381
- var n = Rt(Ue++, 3);
381
+ var n = Rt(Me++, 3);
382
382
  !F.__s && Oi(n.__H, e) && (n.__ = t, n.u = e, P.__H.__h.push(n));
383
383
  }
384
384
  function Ze(t) {
385
- return Be = 5, me(function() {
385
+ return Be = 5, Ie(function() {
386
386
  return { current: t };
387
387
  }, []);
388
388
  }
389
- function me(t, e) {
390
- var n = Rt(Ue++, 7);
389
+ function Ie(t, e) {
390
+ var n = Rt(Me++, 7);
391
391
  return Oi(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
392
392
  }
393
393
  function je(t, e) {
394
- return Be = 8, me(function() {
394
+ return Be = 8, Ie(function() {
395
395
  return t;
396
396
  }, e);
397
397
  }
@@ -407,11 +407,11 @@ F.__b = function(t) {
407
407
  }, F.__ = function(t, e) {
408
408
  t && e.__k && e.__k.__m && (t.__m = e.__k.__m), ti && ti(t, e);
409
409
  }, F.__r = function(t) {
410
- Xt && Xt(t), Ue = 0;
410
+ Xt && Xt(t), Me = 0;
411
411
  var e = (P = t.__c).__H;
412
412
  e && (dt === P ? (e.__h = [], P.__h = [], e.__.forEach(function(n) {
413
413
  n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
414
- })) : (e.__h.forEach(Ye), e.__h.forEach(vt), e.__h = [], Ue = 0)), dt = P;
414
+ })) : (e.__h.forEach(Ye), e.__h.forEach(vt), e.__h = [], Me = 0)), dt = P;
415
415
  }, F.diffed = function(t) {
416
416
  Zt && Zt(t);
417
417
  var e = t.__c;
@@ -425,8 +425,8 @@ F.__b = function(t) {
425
425
  return !o.__ || vt(o);
426
426
  });
427
427
  } catch (o) {
428
- e.some(function(u) {
429
- u.__h && (u.__h = []);
428
+ e.some(function(c) {
429
+ c.__h && (c.__h = []);
430
430
  }), e = [], F.__e(o, n.__v);
431
431
  }
432
432
  }), Qt && Qt(t, e);
@@ -436,8 +436,8 @@ F.__b = function(t) {
436
436
  n && n.__H && (n.__H.__.forEach(function(o) {
437
437
  try {
438
438
  Ye(o);
439
- } catch (u) {
440
- e = u;
439
+ } catch (c) {
440
+ e = c;
441
441
  }
442
442
  }), n.__H = void 0, e && F.__e(e, n.__v));
443
443
  };
@@ -473,10 +473,10 @@ function st() {
473
473
  var n = ke;
474
474
  for (ke = void 0, yt++; n !== void 0; ) {
475
475
  var o = n.o;
476
- if (n.o = void 0, n.f &= -3, !(8 & n.f) && Ui(n)) try {
476
+ if (n.o = void 0, n.f &= -3, !(8 & n.f) && Mi(n)) try {
477
477
  n.c();
478
- } catch (u) {
479
- e || (t = u, e = !0);
478
+ } catch (c) {
479
+ e || (t = c, e = !0);
480
480
  }
481
481
  n = o;
482
482
  }
@@ -493,82 +493,82 @@ function bn(t) {
493
493
  st();
494
494
  }
495
495
  }
496
- var k = void 0;
496
+ var O = void 0;
497
497
  function Di(t) {
498
- var e = k;
499
- k = void 0;
498
+ var e = O;
499
+ O = void 0;
500
500
  try {
501
501
  return t();
502
502
  } finally {
503
- k = e;
503
+ O = e;
504
504
  }
505
505
  }
506
506
  var ke = void 0, pe = 0, yt = 0, Qe = 0;
507
- function Mi(t) {
508
- if (k !== void 0) {
507
+ function Ui(t) {
508
+ if (O !== void 0) {
509
509
  var e = t.n;
510
- if (e === void 0 || e.t !== k)
511
- return e = { i: 0, S: t, p: k.s, n: void 0, t: k, e: void 0, x: void 0, r: e }, k.s !== void 0 && (k.s.n = e), k.s = e, t.n = e, 32 & k.f && t.S(e), e;
510
+ if (e === void 0 || e.t !== O)
511
+ return e = { i: 0, S: t, p: O.s, n: void 0, t: O, e: void 0, x: void 0, r: e }, O.s !== void 0 && (O.s.n = e), O.s = e, t.n = e, 32 & O.f && t.S(e), e;
512
512
  if (e.i === -1)
513
- return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = k.s, e.n = void 0, k.s.n = e, k.s = e), e;
513
+ return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = O.s, e.n = void 0, O.s.n = e, O.s = e), e;
514
514
  }
515
515
  }
516
- function H(t, e) {
516
+ function j(t, e) {
517
517
  this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
518
518
  }
519
- H.prototype.brand = In;
520
- H.prototype.h = function() {
519
+ j.prototype.brand = In;
520
+ j.prototype.h = function() {
521
521
  return !0;
522
522
  };
523
- H.prototype.S = function(t) {
523
+ j.prototype.S = function(t) {
524
524
  var e = this, n = this.t;
525
525
  n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : Di(function() {
526
526
  var o;
527
527
  (o = e.W) == null || o.call(e);
528
528
  }));
529
529
  };
530
- H.prototype.U = function(t) {
530
+ j.prototype.U = function(t) {
531
531
  var e = this;
532
532
  if (this.t !== void 0) {
533
533
  var n = t.e, o = t.x;
534
534
  n !== void 0 && (n.x = o, t.e = void 0), o !== void 0 && (o.e = n, t.x = void 0), t === this.t && (this.t = o, o === void 0 && Di(function() {
535
- var u;
536
- (u = e.Z) == null || u.call(e);
535
+ var c;
536
+ (c = e.Z) == null || c.call(e);
537
537
  }));
538
538
  }
539
539
  };
540
- H.prototype.subscribe = function(t) {
540
+ j.prototype.subscribe = function(t) {
541
541
  var e = this;
542
542
  return $e(function() {
543
- var n = e.value, o = k;
544
- k = void 0;
543
+ var n = e.value, o = O;
544
+ O = void 0;
545
545
  try {
546
546
  t(n);
547
547
  } finally {
548
- k = o;
548
+ O = o;
549
549
  }
550
550
  }, { name: "sub" });
551
551
  };
552
- H.prototype.valueOf = function() {
552
+ j.prototype.valueOf = function() {
553
553
  return this.value;
554
554
  };
555
- H.prototype.toString = function() {
555
+ j.prototype.toString = function() {
556
556
  return this.value + "";
557
557
  };
558
- H.prototype.toJSON = function() {
558
+ j.prototype.toJSON = function() {
559
559
  return this.value;
560
560
  };
561
- H.prototype.peek = function() {
562
- var t = k;
563
- k = void 0;
561
+ j.prototype.peek = function() {
562
+ var t = O;
563
+ O = void 0;
564
564
  try {
565
565
  return this.value;
566
566
  } finally {
567
- k = t;
567
+ O = t;
568
568
  }
569
569
  };
570
- Object.defineProperty(H.prototype, "value", { get: function() {
571
- var t = Mi(this);
570
+ Object.defineProperty(j.prototype, "value", { get: function() {
571
+ var t = Ui(this);
572
572
  return t !== void 0 && (t.i = this.i), this.v;
573
573
  }, set: function(t) {
574
574
  if (t !== this.v) {
@@ -581,10 +581,10 @@ Object.defineProperty(H.prototype, "value", { get: function() {
581
581
  }
582
582
  }
583
583
  } });
584
- function K(t, e) {
585
- return new H(t, e);
584
+ function Y(t, e) {
585
+ return new j(t, e);
586
586
  }
587
- function Ui(t) {
587
+ function Mi(t) {
588
588
  for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
589
589
  return !1;
590
590
  }
@@ -604,65 +604,65 @@ function Li(t) {
604
604
  }
605
605
  t.s = n;
606
606
  }
607
- function ve(t, e) {
608
- H.call(this, void 0), this.x = t, this.s = void 0, this.g = Qe - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
607
+ function ge(t, e) {
608
+ j.call(this, void 0), this.x = t, this.s = void 0, this.g = Qe - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
609
609
  }
610
- ve.prototype = new H();
611
- ve.prototype.h = function() {
610
+ ge.prototype = new j();
611
+ ge.prototype.h = function() {
612
612
  if (this.f &= -3, 1 & this.f) return !1;
613
613
  if ((36 & this.f) == 32 || (this.f &= -5, this.g === Qe)) return !0;
614
- if (this.g = Qe, this.f |= 1, this.i > 0 && !Ui(this))
614
+ if (this.g = Qe, this.f |= 1, this.i > 0 && !Mi(this))
615
615
  return this.f &= -2, !0;
616
- var t = k;
616
+ var t = O;
617
617
  try {
618
- Bi(this), k = this;
618
+ Bi(this), O = this;
619
619
  var e = this.x();
620
620
  (16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
621
621
  } catch (n) {
622
622
  this.v = n, this.f |= 16, this.i++;
623
623
  }
624
- return k = t, Li(this), this.f &= -2, !0;
624
+ return O = t, Li(this), this.f &= -2, !0;
625
625
  };
626
- ve.prototype.S = function(t) {
626
+ ge.prototype.S = function(t) {
627
627
  if (this.t === void 0) {
628
628
  this.f |= 36;
629
629
  for (var e = this.s; e !== void 0; e = e.n) e.S.S(e);
630
630
  }
631
- H.prototype.S.call(this, t);
631
+ j.prototype.S.call(this, t);
632
632
  };
633
- ve.prototype.U = function(t) {
634
- if (this.t !== void 0 && (H.prototype.U.call(this, t), this.t === void 0)) {
633
+ ge.prototype.U = function(t) {
634
+ if (this.t !== void 0 && (j.prototype.U.call(this, t), this.t === void 0)) {
635
635
  this.f &= -33;
636
636
  for (var e = this.s; e !== void 0; e = e.n) e.S.U(e);
637
637
  }
638
638
  };
639
- ve.prototype.N = function() {
639
+ ge.prototype.N = function() {
640
640
  if (!(2 & this.f)) {
641
641
  this.f |= 6;
642
642
  for (var t = this.t; t !== void 0; t = t.x) t.t.N();
643
643
  }
644
644
  };
645
- Object.defineProperty(ve.prototype, "value", { get: function() {
645
+ Object.defineProperty(ge.prototype, "value", { get: function() {
646
646
  if (1 & this.f) throw new Error("Cycle detected");
647
- var t = Mi(this);
647
+ var t = Ui(this);
648
648
  if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
649
649
  return this.v;
650
650
  } });
651
651
  function ni(t, e) {
652
- return new ve(t, e);
652
+ return new ge(t, e);
653
653
  }
654
654
  function Pi(t) {
655
655
  var e = t.u;
656
656
  if (t.u = void 0, typeof e == "function") {
657
657
  pe++;
658
- var n = k;
659
- k = void 0;
658
+ var n = O;
659
+ O = void 0;
660
660
  try {
661
661
  e();
662
662
  } catch (o) {
663
663
  throw t.f &= -2, t.f |= 8, Nt(t), o;
664
664
  } finally {
665
- k = n, st();
665
+ O = n, st();
666
666
  }
667
667
  }
668
668
  }
@@ -671,8 +671,8 @@ function Nt(t) {
671
671
  t.x = void 0, t.s = void 0, Pi(t);
672
672
  }
673
673
  function An(t) {
674
- if (k !== this) throw new Error("Out-of-order effect");
675
- Li(this), k = t, this.f &= -2, 8 & this.f && Nt(this), st();
674
+ if (O !== this) throw new Error("Out-of-order effect");
675
+ Li(this), O = t, this.f &= -2, 8 & this.f && Nt(this), st();
676
676
  }
677
677
  function Ae(t, e) {
678
678
  this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
@@ -690,8 +690,8 @@ Ae.prototype.c = function() {
690
690
  Ae.prototype.S = function() {
691
691
  if (1 & this.f) throw new Error("Cycle detected");
692
692
  this.f |= 1, this.f &= -9, Pi(this), Bi(this), pe++;
693
- var t = k;
694
- return k = this, An.bind(this, t);
693
+ var t = O;
694
+ return O = this, An.bind(this, t);
695
695
  };
696
696
  Ae.prototype.N = function() {
697
697
  2 & this.f || (this.f |= 2, this.o = ke, ke = this);
@@ -706,8 +706,8 @@ function $e(t, e) {
706
706
  var n = new Ae(t, e);
707
707
  try {
708
708
  n.c();
709
- } catch (u) {
710
- throw n.d(), u;
709
+ } catch (c) {
710
+ throw n.d(), c;
711
711
  }
712
712
  var o = n.d.bind(n);
713
713
  return o[Symbol.dispose] = o, o;
@@ -717,7 +717,7 @@ $e(function() {
717
717
  Fi = this.N;
718
718
  })();
719
719
  function Te(t, e) {
720
- D[t] = e.bind(null, D[t] || function() {
720
+ k[t] = e.bind(null, k[t] || function() {
721
721
  });
722
722
  }
723
723
  function et(t) {
@@ -726,7 +726,7 @@ function et(t) {
726
726
  function Gi(t) {
727
727
  var e = this, n = t.data, o = Vi(n);
728
728
  o.value = n;
729
- var u = me(function() {
729
+ var c = Ie(function() {
730
730
  for (var l = e, m = e.__v; m = m.__; ) if (m.__c) {
731
731
  m.__c.__$f |= 4;
732
732
  break;
@@ -741,23 +741,23 @@ function Gi(t) {
741
741
  var g = p.value;
742
742
  l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = g);
743
743
  }
744
- }), S = e.__$u.d;
744
+ }), y = e.__$u.d;
745
745
  return e.__$u.d = function() {
746
- d(), S.call(this);
746
+ d(), y.call(this);
747
747
  }, [_, p];
748
- }, []), a = u[0], c = u[1];
749
- return a.value ? c.peek() : c.value;
748
+ }, []), a = c[0], u = c[1];
749
+ return a.value ? u.peek() : u.value;
750
750
  }
751
751
  Gi.displayName = "ReactiveTextNode";
752
- Object.defineProperties(H.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Gi }, props: { configurable: !0, get: function() {
752
+ Object.defineProperties(j.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Gi }, props: { configurable: !0, get: function() {
753
753
  return { data: this };
754
754
  } }, __b: { configurable: !0, value: 1 } });
755
755
  Te("__b", function(t, e) {
756
756
  if (typeof e.type == "string") {
757
757
  var n, o = e.props;
758
- for (var u in o) if (u !== "children") {
759
- var a = o[u];
760
- a instanceof H && (n || (e.__np = n = {}), n[u] = a, o[u] = a.peek());
758
+ for (var c in o) if (c !== "children") {
759
+ var a = o[c];
760
+ a instanceof j && (n || (e.__np = n = {}), n[c] = a, o[c] = a.peek());
761
761
  }
762
762
  }
763
763
  t(e);
@@ -766,14 +766,14 @@ Te("__r", function(t, e) {
766
766
  if (e.type !== oe) {
767
767
  et();
768
768
  var n, o = e.__c;
769
- o && (o.__$f &= -2, (n = o.__$u) === void 0 && (o.__$u = n = (function(u, a) {
770
- var c;
769
+ o && (o.__$f &= -2, (n = o.__$u) === void 0 && (o.__$u = n = (function(c, a) {
770
+ var u;
771
771
  return $e(function() {
772
- c = this;
773
- }, { name: a }), c.c = u, c;
772
+ u = this;
773
+ }, { name: a }), u.c = c, u;
774
774
  })(function() {
775
- var u;
776
- Tn && ((u = n.y) == null || u.call(n)), o.__$f |= 1, o.setState({});
775
+ var c;
776
+ Tn && ((c = n.y) == null || c.call(n)), o.__$f |= 1, o.setState({});
777
777
  }, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), et(n);
778
778
  }
779
779
  t(e);
@@ -785,31 +785,31 @@ Te("diffed", function(t, e) {
785
785
  et();
786
786
  var n;
787
787
  if (typeof e.type == "string" && (n = e.__e)) {
788
- var o = e.__np, u = e.props;
788
+ var o = e.__np, c = e.props;
789
789
  if (o) {
790
790
  var a = n.U;
791
- if (a) for (var c in a) {
792
- var l = a[c];
793
- l !== void 0 && !(c in o) && (l.d(), a[c] = void 0);
791
+ if (a) for (var u in a) {
792
+ var l = a[u];
793
+ l !== void 0 && !(u in o) && (l.d(), a[u] = void 0);
794
794
  }
795
795
  else
796
796
  a = {}, n.U = a;
797
797
  for (var m in o) {
798
798
  var p = a[m], _ = o[m];
799
- p === void 0 ? (p = Rn(n, m, _, u), a[m] = p) : p.o(_, u);
799
+ p === void 0 ? (p = Rn(n, m, _, c), a[m] = p) : p.o(_, c);
800
800
  }
801
801
  }
802
802
  }
803
803
  t(e);
804
804
  });
805
805
  function Rn(t, e, n, o) {
806
- var u = e in t && t.ownerSVGElement === void 0, a = K(n);
807
- return { o: function(c, l) {
808
- a.value = c, o = l;
806
+ var c = e in t && t.ownerSVGElement === void 0, a = Y(n);
807
+ return { o: function(u, l) {
808
+ a.value = u, o = l;
809
809
  }, d: $e(function() {
810
810
  this.N = ji;
811
- var c = a.value.value;
812
- o[e] !== c && (o[e] = c, u ? t[e] = c : c != null && (c !== !1 || e[4] === "-") ? t.setAttribute(e, c) : t.removeAttribute(e));
811
+ var u = a.value.value;
812
+ o[e] !== u && (o[e] = u, c ? t[e] = u : u != null && (u !== !1 || e[4] === "-") ? t.setAttribute(e, u) : t.removeAttribute(e));
813
813
  }) };
814
814
  }
815
815
  Te("unmount", function(t, e) {
@@ -819,17 +819,17 @@ Te("unmount", function(t, e) {
819
819
  var o = n.U;
820
820
  if (o) {
821
821
  n.U = void 0;
822
- for (var u in o) {
823
- var a = o[u];
822
+ for (var c in o) {
823
+ var a = o[c];
824
824
  a && a.d();
825
825
  }
826
826
  }
827
827
  }
828
828
  } else {
829
- var c = e.__c;
830
- if (c) {
831
- var l = c.__$u;
832
- l && (c.__$u = void 0, l.d());
829
+ var u = e.__c;
830
+ if (u) {
831
+ var l = u.__$u;
832
+ l && (u.__$u = void 0, l.d());
833
833
  }
834
834
  }
835
835
  t(e);
@@ -840,18 +840,18 @@ Te("__h", function(t, e, n, o) {
840
840
  Oe.prototype.shouldComponentUpdate = function(t, e) {
841
841
  if (this.__R) return !0;
842
842
  var n = this.__$u, o = n && n.s !== void 0;
843
- for (var u in e) return !0;
843
+ for (var c in e) return !0;
844
844
  if (this.__f || typeof this.u == "boolean" && this.u === !0) {
845
845
  var a = 2 & this.__$f;
846
846
  if (!(o || a || 4 & this.__$f) || 1 & this.__$f) return !0;
847
847
  } else if (!(o || 4 & this.__$f) || 3 & this.__$f) return !0;
848
- for (var c in t) if (c !== "__source" && t[c] !== this.props[c]) return !0;
848
+ for (var u in t) if (u !== "__source" && t[u] !== this.props[u]) return !0;
849
849
  for (var l in this.props) if (!(l in t)) return !0;
850
850
  return !1;
851
851
  };
852
852
  function Vi(t, e) {
853
853
  return qe(function() {
854
- return K(t, e);
854
+ return Y(t, e);
855
855
  })[0];
856
856
  }
857
857
  var Nn = function(t) {
@@ -865,143 +865,117 @@ function xn() {
865
865
  });
866
866
  }
867
867
  function ji() {
868
- $i.push(this) === 1 && (D.requestAnimationFrame || Nn)(xn);
868
+ $i.push(this) === 1 && (k.requestAnimationFrame || Nn)(xn);
869
869
  }
870
870
  const ri = {
871
871
  inline: !1,
872
872
  layout: "expanded",
873
873
  position: "bottom-right",
874
- styles: {
875
- backgroundColor: "#ffffff",
876
- textColor: "#1f2937"
877
- },
878
874
  showCaptions: !1,
879
875
  showTextInput: !1,
880
876
  showMuteButton: !0,
881
- interactionMode: "both",
882
- startExpanded: !1,
883
- textContents: {
884
- callToAction: "Talk to our assistant",
885
- connecting: "Connecting...",
886
- listening: "Listening...",
887
- speaking: "Speaking...",
888
- endCall: "End",
889
- sendMessage: "Send",
890
- placeholder: "Type a message..."
891
- }
892
- };
893
- function On(t) {
894
- if (!t) return {};
895
- const e = { ...t };
896
- if ("mode" in e && !("layout" in e))
897
- e.layout = e.mode, delete e.mode;
898
- else if ("layout" in e) {
899
- const n = e.layout;
900
- (n === "inline" || n === "fixed") && (e.inline = n === "inline", "mode" in e ? (e.layout = e.mode, delete e.mode) : delete e.layout);
901
- }
902
- return "showTranscript" in e && !("showCaptions" in e) && (e.showCaptions = e.showTranscript, delete e.showTranscript), e;
903
- }
904
- const He = {
877
+ callToAction: "Talk to our assistant"
878
+ }, He = {
905
879
  "bottom-right": { bottom: "24px", right: "24px" },
906
880
  "bottom-left": { bottom: "24px", left: "24px" },
907
881
  "top-right": { top: "24px", right: "24px" },
908
882
  "top-left": { top: "24px", left: "24px" }
909
883
  };
910
- function kn(t) {
884
+ function On(t) {
911
885
  if (He[t])
912
886
  return He[t];
913
887
  const e = t.match(/^\[(.+)\]$/);
914
888
  if (!e) return He["bottom-right"];
915
889
  const n = {};
916
890
  for (const o of e[1].split(",")) {
917
- const u = o.trim(), a = u.lastIndexOf("-");
891
+ const c = o.trim(), a = c.lastIndexOf("-");
918
892
  if (a <= 0) continue;
919
- const c = u.slice(0, a), l = u.slice(a + 1);
920
- n[c] = /^\d+$/.test(l) ? `${l}px` : l;
893
+ const u = c.slice(0, a), l = c.slice(a + 1);
894
+ n[u] = /^\d+$/.test(l) ? `${l}px` : l;
921
895
  }
922
896
  return Object.keys(n).length > 0 ? n : He["bottom-right"];
923
897
  }
924
898
  var ft = {}, Ne = {}, oi;
925
- function Dn() {
899
+ function kn() {
926
900
  if (oi) return Ne;
927
- oi = 1, Ne.byteLength = l, Ne.toByteArray = p, Ne.fromByteArray = S;
928
- for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", u = 0, a = o.length; u < a; ++u)
929
- t[u] = o[u], e[o.charCodeAt(u)] = u;
901
+ oi = 1, Ne.byteLength = l, Ne.toByteArray = p, Ne.fromByteArray = y;
902
+ for (var t = [], e = [], n = typeof Uint8Array < "u" ? Uint8Array : Array, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = 0, a = o.length; c < a; ++c)
903
+ t[c] = o[c], e[o.charCodeAt(c)] = c;
930
904
  e[45] = 62, e[95] = 63;
931
- function c(g) {
932
- var y = g.length;
933
- if (y % 4 > 0)
905
+ function u(g) {
906
+ var S = g.length;
907
+ if (S % 4 > 0)
934
908
  throw new Error("Invalid string. Length must be a multiple of 4");
935
- var b = g.indexOf("=");
936
- b === -1 && (b = y);
937
- var A = b === y ? 0 : 4 - b % 4;
938
- return [b, A];
909
+ var C = g.indexOf("=");
910
+ C === -1 && (C = S);
911
+ var A = C === S ? 0 : 4 - C % 4;
912
+ return [C, A];
939
913
  }
940
914
  function l(g) {
941
- var y = c(g), b = y[0], A = y[1];
942
- return (b + A) * 3 / 4 - A;
915
+ var S = u(g), C = S[0], A = S[1];
916
+ return (C + A) * 3 / 4 - A;
943
917
  }
944
- function m(g, y, b) {
945
- return (y + b) * 3 / 4 - b;
918
+ function m(g, S, C) {
919
+ return (S + C) * 3 / 4 - C;
946
920
  }
947
921
  function p(g) {
948
- var y, b = c(g), A = b[0], C = b[1], I = new n(m(g, A, C)), x = 0, O = C > 0 ? A - 4 : A, R;
949
- for (R = 0; R < O; R += 4)
950
- y = e[g.charCodeAt(R)] << 18 | e[g.charCodeAt(R + 1)] << 12 | e[g.charCodeAt(R + 2)] << 6 | e[g.charCodeAt(R + 3)], I[x++] = y >> 16 & 255, I[x++] = y >> 8 & 255, I[x++] = y & 255;
951
- return C === 2 && (y = e[g.charCodeAt(R)] << 2 | e[g.charCodeAt(R + 1)] >> 4, I[x++] = y & 255), C === 1 && (y = e[g.charCodeAt(R)] << 10 | e[g.charCodeAt(R + 1)] << 4 | e[g.charCodeAt(R + 2)] >> 2, I[x++] = y >> 8 & 255, I[x++] = y & 255), I;
922
+ var S, C = u(g), A = C[0], I = C[1], b = new n(m(g, A, I)), T = 0, D = I > 0 ? A - 4 : A, x;
923
+ for (x = 0; x < D; x += 4)
924
+ S = e[g.charCodeAt(x)] << 18 | e[g.charCodeAt(x + 1)] << 12 | e[g.charCodeAt(x + 2)] << 6 | e[g.charCodeAt(x + 3)], b[T++] = S >> 16 & 255, b[T++] = S >> 8 & 255, b[T++] = S & 255;
925
+ return I === 2 && (S = e[g.charCodeAt(x)] << 2 | e[g.charCodeAt(x + 1)] >> 4, b[T++] = S & 255), I === 1 && (S = e[g.charCodeAt(x)] << 10 | e[g.charCodeAt(x + 1)] << 4 | e[g.charCodeAt(x + 2)] >> 2, b[T++] = S >> 8 & 255, b[T++] = S & 255), b;
952
926
  }
953
927
  function _(g) {
954
928
  return t[g >> 18 & 63] + t[g >> 12 & 63] + t[g >> 6 & 63] + t[g & 63];
955
929
  }
956
- function d(g, y, b) {
957
- for (var A, C = [], I = y; I < b; I += 3)
958
- A = (g[I] << 16 & 16711680) + (g[I + 1] << 8 & 65280) + (g[I + 2] & 255), C.push(_(A));
959
- return C.join("");
930
+ function d(g, S, C) {
931
+ for (var A, I = [], b = S; b < C; b += 3)
932
+ A = (g[b] << 16 & 16711680) + (g[b + 1] << 8 & 65280) + (g[b + 2] & 255), I.push(_(A));
933
+ return I.join("");
960
934
  }
961
- function S(g) {
962
- for (var y, b = g.length, A = b % 3, C = [], I = 16383, x = 0, O = b - A; x < O; x += I)
963
- C.push(d(g, x, x + I > O ? O : x + I));
964
- return A === 1 ? (y = g[b - 1], C.push(
965
- t[y >> 2] + t[y << 4 & 63] + "=="
966
- )) : A === 2 && (y = (g[b - 2] << 8) + g[b - 1], C.push(
967
- t[y >> 10] + t[y >> 4 & 63] + t[y << 2 & 63] + "="
968
- )), C.join("");
935
+ function y(g) {
936
+ for (var S, C = g.length, A = C % 3, I = [], b = 16383, T = 0, D = C - A; T < D; T += b)
937
+ I.push(d(g, T, T + b > D ? D : T + b));
938
+ return A === 1 ? (S = g[C - 1], I.push(
939
+ t[S >> 2] + t[S << 4 & 63] + "=="
940
+ )) : A === 2 && (S = (g[C - 2] << 8) + g[C - 1], I.push(
941
+ t[S >> 10] + t[S >> 4 & 63] + t[S << 2 & 63] + "="
942
+ )), I.join("");
969
943
  }
970
944
  return Ne;
971
945
  }
972
946
  var We = {};
973
947
  var si;
974
- function Mn() {
975
- return si || (si = 1, We.read = function(t, e, n, o, u) {
976
- var a, c, l = u * 8 - o - 1, m = (1 << l) - 1, p = m >> 1, _ = -7, d = n ? u - 1 : 0, S = n ? -1 : 1, g = t[e + d];
977
- for (d += S, a = g & (1 << -_) - 1, g >>= -_, _ += l; _ > 0; a = a * 256 + t[e + d], d += S, _ -= 8)
948
+ function Dn() {
949
+ return si || (si = 1, We.read = function(t, e, n, o, c) {
950
+ var a, u, l = c * 8 - o - 1, m = (1 << l) - 1, p = m >> 1, _ = -7, d = n ? c - 1 : 0, y = n ? -1 : 1, g = t[e + d];
951
+ for (d += y, a = g & (1 << -_) - 1, g >>= -_, _ += l; _ > 0; a = a * 256 + t[e + d], d += y, _ -= 8)
978
952
  ;
979
- for (c = a & (1 << -_) - 1, a >>= -_, _ += o; _ > 0; c = c * 256 + t[e + d], d += S, _ -= 8)
953
+ for (u = a & (1 << -_) - 1, a >>= -_, _ += o; _ > 0; u = u * 256 + t[e + d], d += y, _ -= 8)
980
954
  ;
981
955
  if (a === 0)
982
956
  a = 1 - p;
983
957
  else {
984
958
  if (a === m)
985
- return c ? NaN : (g ? -1 : 1) * (1 / 0);
986
- c = c + Math.pow(2, o), a = a - p;
959
+ return u ? NaN : (g ? -1 : 1) * (1 / 0);
960
+ u = u + Math.pow(2, o), a = a - p;
987
961
  }
988
- return (g ? -1 : 1) * c * Math.pow(2, a - o);
989
- }, We.write = function(t, e, n, o, u, a) {
990
- var c, l, m, p = a * 8 - u - 1, _ = (1 << p) - 1, d = _ >> 1, S = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : a - 1, y = o ? 1 : -1, b = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
991
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0, c = _) : (c = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -c)) < 1 && (c--, m *= 2), c + d >= 1 ? e += S / m : e += S * Math.pow(2, 1 - d), e * m >= 2 && (c++, m /= 2), c + d >= _ ? (l = 0, c = _) : c + d >= 1 ? (l = (e * m - 1) * Math.pow(2, u), c = c + d) : (l = e * Math.pow(2, d - 1) * Math.pow(2, u), c = 0)); u >= 8; t[n + g] = l & 255, g += y, l /= 256, u -= 8)
962
+ return (g ? -1 : 1) * u * Math.pow(2, a - o);
963
+ }, We.write = function(t, e, n, o, c, a) {
964
+ var u, l, m, p = a * 8 - c - 1, _ = (1 << p) - 1, d = _ >> 1, y = c === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = o ? 0 : a - 1, S = o ? 1 : -1, C = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
965
+ for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0, u = _) : (u = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -u)) < 1 && (u--, m *= 2), u + d >= 1 ? e += y / m : e += y * Math.pow(2, 1 - d), e * m >= 2 && (u++, m /= 2), u + d >= _ ? (l = 0, u = _) : u + d >= 1 ? (l = (e * m - 1) * Math.pow(2, c), u = u + d) : (l = e * Math.pow(2, d - 1) * Math.pow(2, c), u = 0)); c >= 8; t[n + g] = l & 255, g += S, l /= 256, c -= 8)
992
966
  ;
993
- for (c = c << u | l, p += u; p > 0; t[n + g] = c & 255, g += y, c /= 256, p -= 8)
967
+ for (u = u << c | l, p += c; p > 0; t[n + g] = u & 255, g += S, u /= 256, p -= 8)
994
968
  ;
995
- t[n + g - y] |= b * 128;
969
+ t[n + g - S] |= C * 128;
996
970
  }), We;
997
971
  }
998
972
  var ai;
999
973
  function Un() {
1000
974
  return ai || (ai = 1, (function(t) {
1001
- const e = Dn(), n = Mn(), o = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
1002
- t.Buffer = l, t.SlowBuffer = I, t.INSPECT_MAX_BYTES = 50;
1003
- const u = 2147483647;
1004
- t.kMaxLength = u, l.TYPED_ARRAY_SUPPORT = a(), !l.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
975
+ const e = kn(), n = Dn(), o = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
976
+ t.Buffer = l, t.SlowBuffer = b, t.INSPECT_MAX_BYTES = 50;
977
+ const c = 2147483647;
978
+ t.kMaxLength = c, l.TYPED_ARRAY_SUPPORT = a(), !l.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
1005
979
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
1006
980
  );
1007
981
  function a() {
@@ -1027,8 +1001,8 @@ function Un() {
1027
1001
  return this.byteOffset;
1028
1002
  }
1029
1003
  });
1030
- function c(s) {
1031
- if (s > u)
1004
+ function u(s) {
1005
+ if (s > c)
1032
1006
  throw new RangeError('The value "' + s + '" is invalid for option "size"');
1033
1007
  const i = new Uint8Array(s);
1034
1008
  return Object.setPrototypeOf(i, l.prototype), i;
@@ -1046,15 +1020,15 @@ function Un() {
1046
1020
  l.poolSize = 8192;
1047
1021
  function m(s, i, r) {
1048
1022
  if (typeof s == "string")
1049
- return S(s, i);
1023
+ return y(s, i);
1050
1024
  if (ArrayBuffer.isView(s))
1051
- return y(s);
1025
+ return S(s);
1052
1026
  if (s == null)
1053
1027
  throw new TypeError(
1054
1028
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
1055
1029
  );
1056
1030
  if (ee(s, ArrayBuffer) || s && ee(s.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (ee(s, SharedArrayBuffer) || s && ee(s.buffer, SharedArrayBuffer)))
1057
- return b(s, i, r);
1031
+ return C(s, i, r);
1058
1032
  if (typeof s == "number")
1059
1033
  throw new TypeError(
1060
1034
  'The "value" argument must not be of type number. Received type number'
@@ -1080,41 +1054,41 @@ function Un() {
1080
1054
  throw new RangeError('The value "' + s + '" is invalid for option "size"');
1081
1055
  }
1082
1056
  function _(s, i, r) {
1083
- return p(s), s <= 0 ? c(s) : i !== void 0 ? typeof r == "string" ? c(s).fill(i, r) : c(s).fill(i) : c(s);
1057
+ return p(s), s <= 0 ? u(s) : i !== void 0 ? typeof r == "string" ? u(s).fill(i, r) : u(s).fill(i) : u(s);
1084
1058
  }
1085
1059
  l.alloc = function(s, i, r) {
1086
1060
  return _(s, i, r);
1087
1061
  };
1088
1062
  function d(s) {
1089
- return p(s), c(s < 0 ? 0 : C(s) | 0);
1063
+ return p(s), u(s < 0 ? 0 : I(s) | 0);
1090
1064
  }
1091
1065
  l.allocUnsafe = function(s) {
1092
1066
  return d(s);
1093
1067
  }, l.allocUnsafeSlow = function(s) {
1094
1068
  return d(s);
1095
1069
  };
1096
- function S(s, i) {
1070
+ function y(s, i) {
1097
1071
  if ((typeof i != "string" || i === "") && (i = "utf8"), !l.isEncoding(i))
1098
1072
  throw new TypeError("Unknown encoding: " + i);
1099
- const r = x(s, i) | 0;
1100
- let h = c(r);
1073
+ const r = T(s, i) | 0;
1074
+ let h = u(r);
1101
1075
  const f = h.write(s, i);
1102
1076
  return f !== r && (h = h.slice(0, f)), h;
1103
1077
  }
1104
1078
  function g(s) {
1105
- const i = s.length < 0 ? 0 : C(s.length) | 0, r = c(i);
1079
+ const i = s.length < 0 ? 0 : I(s.length) | 0, r = u(i);
1106
1080
  for (let h = 0; h < i; h += 1)
1107
1081
  r[h] = s[h] & 255;
1108
1082
  return r;
1109
1083
  }
1110
- function y(s) {
1084
+ function S(s) {
1111
1085
  if (ee(s, Uint8Array)) {
1112
1086
  const i = new Uint8Array(s);
1113
- return b(i.buffer, i.byteOffset, i.byteLength);
1087
+ return C(i.buffer, i.byteOffset, i.byteLength);
1114
1088
  }
1115
1089
  return g(s);
1116
1090
  }
1117
- function b(s, i, r) {
1091
+ function C(s, i, r) {
1118
1092
  if (i < 0 || s.byteLength < i)
1119
1093
  throw new RangeError('"offset" is outside of buffer bounds');
1120
1094
  if (s.byteLength < i + (r || 0))
@@ -1124,20 +1098,20 @@ function Un() {
1124
1098
  }
1125
1099
  function A(s) {
1126
1100
  if (l.isBuffer(s)) {
1127
- const i = C(s.length) | 0, r = c(i);
1101
+ const i = I(s.length) | 0, r = u(i);
1128
1102
  return r.length === 0 || s.copy(r, 0, 0, i), r;
1129
1103
  }
1130
1104
  if (s.length !== void 0)
1131
- return typeof s.length != "number" || ut(s.length) ? c(0) : g(s);
1105
+ return typeof s.length != "number" || ut(s.length) ? u(0) : g(s);
1132
1106
  if (s.type === "Buffer" && Array.isArray(s.data))
1133
1107
  return g(s.data);
1134
1108
  }
1135
- function C(s) {
1136
- if (s >= u)
1137
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
1109
+ function I(s) {
1110
+ if (s >= c)
1111
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + c.toString(16) + " bytes");
1138
1112
  return s | 0;
1139
1113
  }
1140
- function I(s) {
1114
+ function b(s) {
1141
1115
  return +s != s && (s = 0), l.alloc(+s);
1142
1116
  }
1143
1117
  l.isBuffer = function(i) {
@@ -1199,7 +1173,7 @@ function Un() {
1199
1173
  }
1200
1174
  return f;
1201
1175
  };
1202
- function x(s, i) {
1176
+ function T(s, i) {
1203
1177
  if (l.isBuffer(s))
1204
1178
  return s.length;
1205
1179
  if (ArrayBuffer.isView(s) || ee(s, ArrayBuffer))
@@ -1235,8 +1209,8 @@ function Un() {
1235
1209
  i = ("" + i).toLowerCase(), f = !0;
1236
1210
  }
1237
1211
  }
1238
- l.byteLength = x;
1239
- function O(s, i, r) {
1212
+ l.byteLength = T;
1213
+ function D(s, i, r) {
1240
1214
  let h = !1;
1241
1215
  if ((i === void 0 || i < 0) && (i = 0), i > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, i >>>= 0, r <= i))
1242
1216
  return "";
@@ -1246,7 +1220,7 @@ function Un() {
1246
1220
  return Zi(this, i, r);
1247
1221
  case "utf8":
1248
1222
  case "utf-8":
1249
- return Mt(this, i, r);
1223
+ return Ut(this, i, r);
1250
1224
  case "ascii":
1251
1225
  return Ji(this, i, r);
1252
1226
  case "latin1":
@@ -1265,7 +1239,7 @@ function Un() {
1265
1239
  }
1266
1240
  }
1267
1241
  l.prototype._isBuffer = !0;
1268
- function R(s, i, r) {
1242
+ function x(s, i, r) {
1269
1243
  const h = s[i];
1270
1244
  s[i] = s[r], s[r] = h;
1271
1245
  }
@@ -1274,25 +1248,25 @@ function Un() {
1274
1248
  if (i % 2 !== 0)
1275
1249
  throw new RangeError("Buffer size must be a multiple of 16-bits");
1276
1250
  for (let r = 0; r < i; r += 2)
1277
- R(this, r, r + 1);
1251
+ x(this, r, r + 1);
1278
1252
  return this;
1279
1253
  }, l.prototype.swap32 = function() {
1280
1254
  const i = this.length;
1281
1255
  if (i % 4 !== 0)
1282
1256
  throw new RangeError("Buffer size must be a multiple of 32-bits");
1283
1257
  for (let r = 0; r < i; r += 4)
1284
- R(this, r, r + 3), R(this, r + 1, r + 2);
1258
+ x(this, r, r + 3), x(this, r + 1, r + 2);
1285
1259
  return this;
1286
1260
  }, l.prototype.swap64 = function() {
1287
1261
  const i = this.length;
1288
1262
  if (i % 8 !== 0)
1289
1263
  throw new RangeError("Buffer size must be a multiple of 64-bits");
1290
1264
  for (let r = 0; r < i; r += 8)
1291
- R(this, r, r + 7), R(this, r + 1, r + 6), R(this, r + 2, r + 5), R(this, r + 3, r + 4);
1265
+ x(this, r, r + 7), x(this, r + 1, r + 6), x(this, r + 2, r + 5), x(this, r + 3, r + 4);
1292
1266
  return this;
1293
1267
  }, l.prototype.toString = function() {
1294
1268
  const i = this.length;
1295
- return i === 0 ? "" : arguments.length === 0 ? Mt(this, 0, i) : O.apply(this, arguments);
1269
+ return i === 0 ? "" : arguments.length === 0 ? Ut(this, 0, i) : D.apply(this, arguments);
1296
1270
  }, l.prototype.toLocaleString = l.prototype.toString, l.prototype.equals = function(i) {
1297
1271
  if (!l.isBuffer(i)) throw new TypeError("Argument must be a Buffer");
1298
1272
  return this === i ? !0 : l.compare(this, i) === 0;
@@ -1314,16 +1288,16 @@ function Un() {
1314
1288
  if (r >= h)
1315
1289
  return 1;
1316
1290
  if (r >>>= 0, h >>>= 0, f >>>= 0, E >>>= 0, this === i) return 0;
1317
- let v = E - f, T = h - r;
1318
- const B = Math.min(v, T), U = this.slice(f, E), L = i.slice(r, h);
1319
- for (let M = 0; M < B; ++M)
1320
- if (U[M] !== L[M]) {
1321
- v = U[M], T = L[M];
1291
+ let v = E - f, R = h - r;
1292
+ const B = Math.min(v, R), M = this.slice(f, E), L = i.slice(r, h);
1293
+ for (let U = 0; U < B; ++U)
1294
+ if (M[U] !== L[U]) {
1295
+ v = M[U], R = L[U];
1322
1296
  break;
1323
1297
  }
1324
- return v < T ? -1 : T < v ? 1 : 0;
1298
+ return v < R ? -1 : R < v ? 1 : 0;
1325
1299
  };
1326
- function G(s, i, r, h, f) {
1300
+ function Z(s, i, r, h, f) {
1327
1301
  if (s.length === 0) return -1;
1328
1302
  if (typeof r == "string" ? (h = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, ut(r) && (r = f ? 0 : s.length - 1), r < 0 && (r = s.length + r), r >= s.length) {
1329
1303
  if (f) return -1;
@@ -1332,47 +1306,47 @@ function Un() {
1332
1306
  if (f) r = 0;
1333
1307
  else return -1;
1334
1308
  if (typeof i == "string" && (i = l.from(i, h)), l.isBuffer(i))
1335
- return i.length === 0 ? -1 : W(s, i, r, h, f);
1309
+ return i.length === 0 ? -1 : H(s, i, r, h, f);
1336
1310
  if (typeof i == "number")
1337
- return i = i & 255, typeof Uint8Array.prototype.indexOf == "function" ? f ? Uint8Array.prototype.indexOf.call(s, i, r) : Uint8Array.prototype.lastIndexOf.call(s, i, r) : W(s, [i], r, h, f);
1311
+ return i = i & 255, typeof Uint8Array.prototype.indexOf == "function" ? f ? Uint8Array.prototype.indexOf.call(s, i, r) : Uint8Array.prototype.lastIndexOf.call(s, i, r) : H(s, [i], r, h, f);
1338
1312
  throw new TypeError("val must be string, number or Buffer");
1339
1313
  }
1340
- function W(s, i, r, h, f) {
1341
- let E = 1, v = s.length, T = i.length;
1314
+ function H(s, i, r, h, f) {
1315
+ let E = 1, v = s.length, R = i.length;
1342
1316
  if (h !== void 0 && (h = String(h).toLowerCase(), h === "ucs2" || h === "ucs-2" || h === "utf16le" || h === "utf-16le")) {
1343
1317
  if (s.length < 2 || i.length < 2)
1344
1318
  return -1;
1345
- E = 2, v /= 2, T /= 2, r /= 2;
1319
+ E = 2, v /= 2, R /= 2, r /= 2;
1346
1320
  }
1347
- function B(L, M) {
1348
- return E === 1 ? L[M] : L.readUInt16BE(M * E);
1321
+ function B(L, U) {
1322
+ return E === 1 ? L[U] : L.readUInt16BE(U * E);
1349
1323
  }
1350
- let U;
1324
+ let M;
1351
1325
  if (f) {
1352
1326
  let L = -1;
1353
- for (U = r; U < v; U++)
1354
- if (B(s, U) === B(i, L === -1 ? 0 : U - L)) {
1355
- if (L === -1 && (L = U), U - L + 1 === T) return L * E;
1327
+ for (M = r; M < v; M++)
1328
+ if (B(s, M) === B(i, L === -1 ? 0 : M - L)) {
1329
+ if (L === -1 && (L = M), M - L + 1 === R) return L * E;
1356
1330
  } else
1357
- L !== -1 && (U -= U - L), L = -1;
1331
+ L !== -1 && (M -= M - L), L = -1;
1358
1332
  } else
1359
- for (r + T > v && (r = v - T), U = r; U >= 0; U--) {
1333
+ for (r + R > v && (r = v - R), M = r; M >= 0; M--) {
1360
1334
  let L = !0;
1361
- for (let M = 0; M < T; M++)
1362
- if (B(s, U + M) !== B(i, M)) {
1335
+ for (let U = 0; U < R; U++)
1336
+ if (B(s, M + U) !== B(i, U)) {
1363
1337
  L = !1;
1364
1338
  break;
1365
1339
  }
1366
- if (L) return U;
1340
+ if (L) return M;
1367
1341
  }
1368
1342
  return -1;
1369
1343
  }
1370
1344
  l.prototype.includes = function(i, r, h) {
1371
1345
  return this.indexOf(i, r, h) !== -1;
1372
1346
  }, l.prototype.indexOf = function(i, r, h) {
1373
- return G(this, i, r, h, !0);
1347
+ return Z(this, i, r, h, !0);
1374
1348
  }, l.prototype.lastIndexOf = function(i, r, h) {
1375
- return G(this, i, r, h, !1);
1349
+ return Z(this, i, r, h, !1);
1376
1350
  };
1377
1351
  function ae(s, i, r, h) {
1378
1352
  r = Number(r) || 0;
@@ -1382,9 +1356,9 @@ function Un() {
1382
1356
  h > E / 2 && (h = E / 2);
1383
1357
  let v;
1384
1358
  for (v = 0; v < h; ++v) {
1385
- const T = parseInt(i.substr(v * 2, 2), 16);
1386
- if (ut(T)) return v;
1387
- s[r + v] = T;
1359
+ const R = parseInt(i.substr(v * 2, 2), 16);
1360
+ if (ut(R)) return v;
1361
+ s[r + v] = R;
1388
1362
  }
1389
1363
  return v;
1390
1364
  }
@@ -1447,43 +1421,43 @@ function Un() {
1447
1421
  function Yi(s, i, r) {
1448
1422
  return i === 0 && r === s.length ? e.fromByteArray(s) : e.fromByteArray(s.slice(i, r));
1449
1423
  }
1450
- function Mt(s, i, r) {
1424
+ function Ut(s, i, r) {
1451
1425
  r = Math.min(s.length, r);
1452
1426
  const h = [];
1453
1427
  let f = i;
1454
1428
  for (; f < r; ) {
1455
1429
  const E = s[f];
1456
- let v = null, T = E > 239 ? 4 : E > 223 ? 3 : E > 191 ? 2 : 1;
1457
- if (f + T <= r) {
1458
- let B, U, L, M;
1459
- switch (T) {
1430
+ let v = null, R = E > 239 ? 4 : E > 223 ? 3 : E > 191 ? 2 : 1;
1431
+ if (f + R <= r) {
1432
+ let B, M, L, U;
1433
+ switch (R) {
1460
1434
  case 1:
1461
1435
  E < 128 && (v = E);
1462
1436
  break;
1463
1437
  case 2:
1464
- B = s[f + 1], (B & 192) === 128 && (M = (E & 31) << 6 | B & 63, M > 127 && (v = M));
1438
+ B = s[f + 1], (B & 192) === 128 && (U = (E & 31) << 6 | B & 63, U > 127 && (v = U));
1465
1439
  break;
1466
1440
  case 3:
1467
- B = s[f + 1], U = s[f + 2], (B & 192) === 128 && (U & 192) === 128 && (M = (E & 15) << 12 | (B & 63) << 6 | U & 63, M > 2047 && (M < 55296 || M > 57343) && (v = M));
1441
+ B = s[f + 1], M = s[f + 2], (B & 192) === 128 && (M & 192) === 128 && (U = (E & 15) << 12 | (B & 63) << 6 | M & 63, U > 2047 && (U < 55296 || U > 57343) && (v = U));
1468
1442
  break;
1469
1443
  case 4:
1470
- B = s[f + 1], U = s[f + 2], L = s[f + 3], (B & 192) === 128 && (U & 192) === 128 && (L & 192) === 128 && (M = (E & 15) << 18 | (B & 63) << 12 | (U & 63) << 6 | L & 63, M > 65535 && M < 1114112 && (v = M));
1444
+ B = s[f + 1], M = s[f + 2], L = s[f + 3], (B & 192) === 128 && (M & 192) === 128 && (L & 192) === 128 && (U = (E & 15) << 18 | (B & 63) << 12 | (M & 63) << 6 | L & 63, U > 65535 && U < 1114112 && (v = U));
1471
1445
  }
1472
1446
  }
1473
- v === null ? (v = 65533, T = 1) : v > 65535 && (v -= 65536, h.push(v >>> 10 & 1023 | 55296), v = 56320 | v & 1023), h.push(v), f += T;
1447
+ v === null ? (v = 65533, R = 1) : v > 65535 && (v -= 65536, h.push(v >>> 10 & 1023 | 55296), v = 56320 | v & 1023), h.push(v), f += R;
1474
1448
  }
1475
1449
  return Ki(h);
1476
1450
  }
1477
- const Ut = 4096;
1451
+ const Mt = 4096;
1478
1452
  function Ki(s) {
1479
1453
  const i = s.length;
1480
- if (i <= Ut)
1454
+ if (i <= Mt)
1481
1455
  return String.fromCharCode.apply(String, s);
1482
1456
  let r = "", h = 0;
1483
1457
  for (; h < i; )
1484
1458
  r += String.fromCharCode.apply(
1485
1459
  String,
1486
- s.slice(h, h += Ut)
1460
+ s.slice(h, h += Mt)
1487
1461
  );
1488
1462
  return r;
1489
1463
  }
@@ -1522,101 +1496,101 @@ function Un() {
1522
1496
  const f = this.subarray(i, r);
1523
1497
  return Object.setPrototypeOf(f, l.prototype), f;
1524
1498
  };
1525
- function V(s, i, r) {
1499
+ function G(s, i, r) {
1526
1500
  if (s % 1 !== 0 || s < 0) throw new RangeError("offset is not uint");
1527
1501
  if (s + i > r) throw new RangeError("Trying to access beyond buffer length");
1528
1502
  }
1529
1503
  l.prototype.readUintLE = l.prototype.readUIntLE = function(i, r, h) {
1530
- i = i >>> 0, r = r >>> 0, h || V(i, r, this.length);
1504
+ i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
1531
1505
  let f = this[i], E = 1, v = 0;
1532
1506
  for (; ++v < r && (E *= 256); )
1533
1507
  f += this[i + v] * E;
1534
1508
  return f;
1535
1509
  }, l.prototype.readUintBE = l.prototype.readUIntBE = function(i, r, h) {
1536
- i = i >>> 0, r = r >>> 0, h || V(i, r, this.length);
1510
+ i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
1537
1511
  let f = this[i + --r], E = 1;
1538
1512
  for (; r > 0 && (E *= 256); )
1539
1513
  f += this[i + --r] * E;
1540
1514
  return f;
1541
1515
  }, l.prototype.readUint8 = l.prototype.readUInt8 = function(i, r) {
1542
- return i = i >>> 0, r || V(i, 1, this.length), this[i];
1516
+ return i = i >>> 0, r || G(i, 1, this.length), this[i];
1543
1517
  }, l.prototype.readUint16LE = l.prototype.readUInt16LE = function(i, r) {
1544
- return i = i >>> 0, r || V(i, 2, this.length), this[i] | this[i + 1] << 8;
1518
+ return i = i >>> 0, r || G(i, 2, this.length), this[i] | this[i + 1] << 8;
1545
1519
  }, l.prototype.readUint16BE = l.prototype.readUInt16BE = function(i, r) {
1546
- return i = i >>> 0, r || V(i, 2, this.length), this[i] << 8 | this[i + 1];
1520
+ return i = i >>> 0, r || G(i, 2, this.length), this[i] << 8 | this[i + 1];
1547
1521
  }, l.prototype.readUint32LE = l.prototype.readUInt32LE = function(i, r) {
1548
- return i = i >>> 0, r || V(i, 4, this.length), (this[i] | this[i + 1] << 8 | this[i + 2] << 16) + this[i + 3] * 16777216;
1522
+ return i = i >>> 0, r || G(i, 4, this.length), (this[i] | this[i + 1] << 8 | this[i + 2] << 16) + this[i + 3] * 16777216;
1549
1523
  }, l.prototype.readUint32BE = l.prototype.readUInt32BE = function(i, r) {
1550
- return i = i >>> 0, r || V(i, 4, this.length), this[i] * 16777216 + (this[i + 1] << 16 | this[i + 2] << 8 | this[i + 3]);
1524
+ return i = i >>> 0, r || G(i, 4, this.length), this[i] * 16777216 + (this[i + 1] << 16 | this[i + 2] << 8 | this[i + 3]);
1551
1525
  }, l.prototype.readBigUInt64LE = ce(function(i) {
1552
- i = i >>> 0, Se(i, "offset");
1526
+ i = i >>> 0, ye(i, "offset");
1553
1527
  const r = this[i], h = this[i + 7];
1554
1528
  (r === void 0 || h === void 0) && Re(i, this.length - 8);
1555
1529
  const f = r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24, E = this[++i] + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + h * 2 ** 24;
1556
1530
  return BigInt(f) + (BigInt(E) << BigInt(32));
1557
1531
  }), l.prototype.readBigUInt64BE = ce(function(i) {
1558
- i = i >>> 0, Se(i, "offset");
1532
+ i = i >>> 0, ye(i, "offset");
1559
1533
  const r = this[i], h = this[i + 7];
1560
1534
  (r === void 0 || h === void 0) && Re(i, this.length - 8);
1561
1535
  const f = r * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + this[++i], E = this[++i] * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + h;
1562
1536
  return (BigInt(f) << BigInt(32)) + BigInt(E);
1563
1537
  }), l.prototype.readIntLE = function(i, r, h) {
1564
- i = i >>> 0, r = r >>> 0, h || V(i, r, this.length);
1538
+ i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
1565
1539
  let f = this[i], E = 1, v = 0;
1566
1540
  for (; ++v < r && (E *= 256); )
1567
1541
  f += this[i + v] * E;
1568
1542
  return E *= 128, f >= E && (f -= Math.pow(2, 8 * r)), f;
1569
1543
  }, l.prototype.readIntBE = function(i, r, h) {
1570
- i = i >>> 0, r = r >>> 0, h || V(i, r, this.length);
1544
+ i = i >>> 0, r = r >>> 0, h || G(i, r, this.length);
1571
1545
  let f = r, E = 1, v = this[i + --f];
1572
1546
  for (; f > 0 && (E *= 256); )
1573
1547
  v += this[i + --f] * E;
1574
1548
  return E *= 128, v >= E && (v -= Math.pow(2, 8 * r)), v;
1575
1549
  }, l.prototype.readInt8 = function(i, r) {
1576
- return i = i >>> 0, r || V(i, 1, this.length), this[i] & 128 ? (255 - this[i] + 1) * -1 : this[i];
1550
+ return i = i >>> 0, r || G(i, 1, this.length), this[i] & 128 ? (255 - this[i] + 1) * -1 : this[i];
1577
1551
  }, l.prototype.readInt16LE = function(i, r) {
1578
- i = i >>> 0, r || V(i, 2, this.length);
1552
+ i = i >>> 0, r || G(i, 2, this.length);
1579
1553
  const h = this[i] | this[i + 1] << 8;
1580
1554
  return h & 32768 ? h | 4294901760 : h;
1581
1555
  }, l.prototype.readInt16BE = function(i, r) {
1582
- i = i >>> 0, r || V(i, 2, this.length);
1556
+ i = i >>> 0, r || G(i, 2, this.length);
1583
1557
  const h = this[i + 1] | this[i] << 8;
1584
1558
  return h & 32768 ? h | 4294901760 : h;
1585
1559
  }, l.prototype.readInt32LE = function(i, r) {
1586
- return i = i >>> 0, r || V(i, 4, this.length), this[i] | this[i + 1] << 8 | this[i + 2] << 16 | this[i + 3] << 24;
1560
+ return i = i >>> 0, r || G(i, 4, this.length), this[i] | this[i + 1] << 8 | this[i + 2] << 16 | this[i + 3] << 24;
1587
1561
  }, l.prototype.readInt32BE = function(i, r) {
1588
- return i = i >>> 0, r || V(i, 4, this.length), this[i] << 24 | this[i + 1] << 16 | this[i + 2] << 8 | this[i + 3];
1562
+ return i = i >>> 0, r || G(i, 4, this.length), this[i] << 24 | this[i + 1] << 16 | this[i + 2] << 8 | this[i + 3];
1589
1563
  }, l.prototype.readBigInt64LE = ce(function(i) {
1590
- i = i >>> 0, Se(i, "offset");
1564
+ i = i >>> 0, ye(i, "offset");
1591
1565
  const r = this[i], h = this[i + 7];
1592
1566
  (r === void 0 || h === void 0) && Re(i, this.length - 8);
1593
1567
  const f = this[i + 4] + this[i + 5] * 2 ** 8 + this[i + 6] * 2 ** 16 + (h << 24);
1594
1568
  return (BigInt(f) << BigInt(32)) + BigInt(r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24);
1595
1569
  }), l.prototype.readBigInt64BE = ce(function(i) {
1596
- i = i >>> 0, Se(i, "offset");
1570
+ i = i >>> 0, ye(i, "offset");
1597
1571
  const r = this[i], h = this[i + 7];
1598
1572
  (r === void 0 || h === void 0) && Re(i, this.length - 8);
1599
1573
  const f = (r << 24) + // Overflow
1600
1574
  this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + this[++i];
1601
1575
  return (BigInt(f) << BigInt(32)) + BigInt(this[++i] * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + h);
1602
1576
  }), l.prototype.readFloatLE = function(i, r) {
1603
- return i = i >>> 0, r || V(i, 4, this.length), n.read(this, i, !0, 23, 4);
1577
+ return i = i >>> 0, r || G(i, 4, this.length), n.read(this, i, !0, 23, 4);
1604
1578
  }, l.prototype.readFloatBE = function(i, r) {
1605
- return i = i >>> 0, r || V(i, 4, this.length), n.read(this, i, !1, 23, 4);
1579
+ return i = i >>> 0, r || G(i, 4, this.length), n.read(this, i, !1, 23, 4);
1606
1580
  }, l.prototype.readDoubleLE = function(i, r) {
1607
- return i = i >>> 0, r || V(i, 8, this.length), n.read(this, i, !0, 52, 8);
1581
+ return i = i >>> 0, r || G(i, 8, this.length), n.read(this, i, !0, 52, 8);
1608
1582
  }, l.prototype.readDoubleBE = function(i, r) {
1609
- return i = i >>> 0, r || V(i, 8, this.length), n.read(this, i, !1, 52, 8);
1583
+ return i = i >>> 0, r || G(i, 8, this.length), n.read(this, i, !1, 52, 8);
1610
1584
  };
1611
- function Y(s, i, r, h, f, E) {
1585
+ function q(s, i, r, h, f, E) {
1612
1586
  if (!l.isBuffer(s)) throw new TypeError('"buffer" argument must be a Buffer instance');
1613
1587
  if (i > f || i < E) throw new RangeError('"value" argument is out of bounds');
1614
1588
  if (r + h > s.length) throw new RangeError("Index out of range");
1615
1589
  }
1616
1590
  l.prototype.writeUintLE = l.prototype.writeUIntLE = function(i, r, h, f) {
1617
1591
  if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
1618
- const T = Math.pow(2, 8 * h) - 1;
1619
- Y(this, i, r, h, T, 0);
1592
+ const R = Math.pow(2, 8 * h) - 1;
1593
+ q(this, i, r, h, R, 0);
1620
1594
  }
1621
1595
  let E = 1, v = 0;
1622
1596
  for (this[r] = i & 255; ++v < h && (E *= 256); )
@@ -1624,23 +1598,23 @@ function Un() {
1624
1598
  return r + h;
1625
1599
  }, l.prototype.writeUintBE = l.prototype.writeUIntBE = function(i, r, h, f) {
1626
1600
  if (i = +i, r = r >>> 0, h = h >>> 0, !f) {
1627
- const T = Math.pow(2, 8 * h) - 1;
1628
- Y(this, i, r, h, T, 0);
1601
+ const R = Math.pow(2, 8 * h) - 1;
1602
+ q(this, i, r, h, R, 0);
1629
1603
  }
1630
1604
  let E = h - 1, v = 1;
1631
1605
  for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
1632
1606
  this[r + E] = i / v & 255;
1633
1607
  return r + h;
1634
1608
  }, l.prototype.writeUint8 = l.prototype.writeUInt8 = function(i, r, h) {
1635
- return i = +i, r = r >>> 0, h || Y(this, i, r, 1, 255, 0), this[r] = i & 255, r + 1;
1609
+ return i = +i, r = r >>> 0, h || q(this, i, r, 1, 255, 0), this[r] = i & 255, r + 1;
1636
1610
  }, l.prototype.writeUint16LE = l.prototype.writeUInt16LE = function(i, r, h) {
1637
- return i = +i, r = r >>> 0, h || Y(this, i, r, 2, 65535, 0), this[r] = i & 255, this[r + 1] = i >>> 8, r + 2;
1611
+ return i = +i, r = r >>> 0, h || q(this, i, r, 2, 65535, 0), this[r] = i & 255, this[r + 1] = i >>> 8, r + 2;
1638
1612
  }, l.prototype.writeUint16BE = l.prototype.writeUInt16BE = function(i, r, h) {
1639
- return i = +i, r = r >>> 0, h || Y(this, i, r, 2, 65535, 0), this[r] = i >>> 8, this[r + 1] = i & 255, r + 2;
1613
+ return i = +i, r = r >>> 0, h || q(this, i, r, 2, 65535, 0), this[r] = i >>> 8, this[r + 1] = i & 255, r + 2;
1640
1614
  }, l.prototype.writeUint32LE = l.prototype.writeUInt32LE = function(i, r, h) {
1641
- return i = +i, r = r >>> 0, h || Y(this, i, r, 4, 4294967295, 0), this[r + 3] = i >>> 24, this[r + 2] = i >>> 16, this[r + 1] = i >>> 8, this[r] = i & 255, r + 4;
1615
+ return i = +i, r = r >>> 0, h || q(this, i, r, 4, 4294967295, 0), this[r + 3] = i >>> 24, this[r + 2] = i >>> 16, this[r + 1] = i >>> 8, this[r] = i & 255, r + 4;
1642
1616
  }, l.prototype.writeUint32BE = l.prototype.writeUInt32BE = function(i, r, h) {
1643
- return i = +i, r = r >>> 0, h || Y(this, i, r, 4, 4294967295, 0), this[r] = i >>> 24, this[r + 1] = i >>> 16, this[r + 2] = i >>> 8, this[r + 3] = i & 255, r + 4;
1617
+ return i = +i, r = r >>> 0, h || q(this, i, r, 4, 4294967295, 0), this[r] = i >>> 24, this[r + 1] = i >>> 16, this[r + 2] = i >>> 8, this[r + 3] = i & 255, r + 4;
1644
1618
  };
1645
1619
  function Bt(s, i, r, h, f) {
1646
1620
  Vt(i, h, f, s, r, 7);
@@ -1663,31 +1637,31 @@ function Un() {
1663
1637
  }), l.prototype.writeIntLE = function(i, r, h, f) {
1664
1638
  if (i = +i, r = r >>> 0, !f) {
1665
1639
  const B = Math.pow(2, 8 * h - 1);
1666
- Y(this, i, r, h, B - 1, -B);
1640
+ q(this, i, r, h, B - 1, -B);
1667
1641
  }
1668
- let E = 0, v = 1, T = 0;
1642
+ let E = 0, v = 1, R = 0;
1669
1643
  for (this[r] = i & 255; ++E < h && (v *= 256); )
1670
- i < 0 && T === 0 && this[r + E - 1] !== 0 && (T = 1), this[r + E] = (i / v >> 0) - T & 255;
1644
+ i < 0 && R === 0 && this[r + E - 1] !== 0 && (R = 1), this[r + E] = (i / v >> 0) - R & 255;
1671
1645
  return r + h;
1672
1646
  }, l.prototype.writeIntBE = function(i, r, h, f) {
1673
1647
  if (i = +i, r = r >>> 0, !f) {
1674
1648
  const B = Math.pow(2, 8 * h - 1);
1675
- Y(this, i, r, h, B - 1, -B);
1649
+ q(this, i, r, h, B - 1, -B);
1676
1650
  }
1677
- let E = h - 1, v = 1, T = 0;
1651
+ let E = h - 1, v = 1, R = 0;
1678
1652
  for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
1679
- i < 0 && T === 0 && this[r + E + 1] !== 0 && (T = 1), this[r + E] = (i / v >> 0) - T & 255;
1653
+ i < 0 && R === 0 && this[r + E + 1] !== 0 && (R = 1), this[r + E] = (i / v >> 0) - R & 255;
1680
1654
  return r + h;
1681
1655
  }, l.prototype.writeInt8 = function(i, r, h) {
1682
- return i = +i, r = r >>> 0, h || Y(this, i, r, 1, 127, -128), i < 0 && (i = 255 + i + 1), this[r] = i & 255, r + 1;
1656
+ return i = +i, r = r >>> 0, h || q(this, i, r, 1, 127, -128), i < 0 && (i = 255 + i + 1), this[r] = i & 255, r + 1;
1683
1657
  }, l.prototype.writeInt16LE = function(i, r, h) {
1684
- return i = +i, r = r >>> 0, h || Y(this, i, r, 2, 32767, -32768), this[r] = i & 255, this[r + 1] = i >>> 8, r + 2;
1658
+ return i = +i, r = r >>> 0, h || q(this, i, r, 2, 32767, -32768), this[r] = i & 255, this[r + 1] = i >>> 8, r + 2;
1685
1659
  }, l.prototype.writeInt16BE = function(i, r, h) {
1686
- return i = +i, r = r >>> 0, h || Y(this, i, r, 2, 32767, -32768), this[r] = i >>> 8, this[r + 1] = i & 255, r + 2;
1660
+ return i = +i, r = r >>> 0, h || q(this, i, r, 2, 32767, -32768), this[r] = i >>> 8, this[r + 1] = i & 255, r + 2;
1687
1661
  }, l.prototype.writeInt32LE = function(i, r, h) {
1688
- return i = +i, r = r >>> 0, h || Y(this, i, r, 4, 2147483647, -2147483648), this[r] = i & 255, this[r + 1] = i >>> 8, this[r + 2] = i >>> 16, this[r + 3] = i >>> 24, r + 4;
1662
+ return i = +i, r = r >>> 0, h || q(this, i, r, 4, 2147483647, -2147483648), this[r] = i & 255, this[r + 1] = i >>> 8, this[r + 2] = i >>> 16, this[r + 3] = i >>> 24, r + 4;
1689
1663
  }, l.prototype.writeInt32BE = function(i, r, h) {
1690
- return i = +i, r = r >>> 0, h || Y(this, i, r, 4, 2147483647, -2147483648), i < 0 && (i = 4294967295 + i + 1), this[r] = i >>> 24, this[r + 1] = i >>> 16, this[r + 2] = i >>> 8, this[r + 3] = i & 255, r + 4;
1664
+ return i = +i, r = r >>> 0, h || q(this, i, r, 4, 2147483647, -2147483648), i < 0 && (i = 4294967295 + i + 1), this[r] = i >>> 24, this[r + 1] = i >>> 16, this[r + 2] = i >>> 8, this[r + 3] = i & 255, r + 4;
1691
1665
  }, l.prototype.writeBigInt64LE = ce(function(i, r = 0) {
1692
1666
  return Bt(this, i, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
1693
1667
  }), l.prototype.writeBigInt64BE = ce(function(i, r = 0) {
@@ -1747,17 +1721,17 @@ function Un() {
1747
1721
  for (E = r; E < h; ++E)
1748
1722
  this[E] = i;
1749
1723
  else {
1750
- const v = l.isBuffer(i) ? i : l.from(i, f), T = v.length;
1751
- if (T === 0)
1724
+ const v = l.isBuffer(i) ? i : l.from(i, f), R = v.length;
1725
+ if (R === 0)
1752
1726
  throw new TypeError('The value "' + i + '" is invalid for argument "value"');
1753
1727
  for (E = 0; E < h - r; ++E)
1754
- this[E + r] = v[E % T];
1728
+ this[E + r] = v[E % R];
1755
1729
  }
1756
1730
  return this;
1757
1731
  };
1758
- const ye = {};
1732
+ const ve = {};
1759
1733
  function lt(s, i, r) {
1760
- ye[s] = class extends r {
1734
+ ve[s] = class extends r {
1761
1735
  constructor() {
1762
1736
  super(), Object.defineProperty(this, "message", {
1763
1737
  value: i.apply(this, arguments),
@@ -1809,22 +1783,22 @@ function Un() {
1809
1783
  return `${s.slice(0, r)}${i}`;
1810
1784
  }
1811
1785
  function en(s, i, r) {
1812
- Se(i, "offset"), (s[i] === void 0 || s[i + r] === void 0) && Re(i, s.length - (r + 1));
1786
+ ye(i, "offset"), (s[i] === void 0 || s[i + r] === void 0) && Re(i, s.length - (r + 1));
1813
1787
  }
1814
1788
  function Vt(s, i, r, h, f, E) {
1815
1789
  if (s > r || s < i) {
1816
1790
  const v = typeof i == "bigint" ? "n" : "";
1817
- let T;
1818
- throw i === 0 || i === BigInt(0) ? T = `>= 0${v} and < 2${v} ** ${(E + 1) * 8}${v}` : T = `>= -(2${v} ** ${(E + 1) * 8 - 1}${v}) and < 2 ** ${(E + 1) * 8 - 1}${v}`, new ye.ERR_OUT_OF_RANGE("value", T, s);
1791
+ let R;
1792
+ throw i === 0 || i === BigInt(0) ? R = `>= 0${v} and < 2${v} ** ${(E + 1) * 8}${v}` : R = `>= -(2${v} ** ${(E + 1) * 8 - 1}${v}) and < 2 ** ${(E + 1) * 8 - 1}${v}`, new ve.ERR_OUT_OF_RANGE("value", R, s);
1819
1793
  }
1820
1794
  en(h, f, E);
1821
1795
  }
1822
- function Se(s, i) {
1796
+ function ye(s, i) {
1823
1797
  if (typeof s != "number")
1824
- throw new ye.ERR_INVALID_ARG_TYPE(i, "number", s);
1798
+ throw new ve.ERR_INVALID_ARG_TYPE(i, "number", s);
1825
1799
  }
1826
1800
  function Re(s, i, r) {
1827
- throw Math.floor(s) !== s ? (Se(s, r), new ye.ERR_OUT_OF_RANGE("offset", "an integer", s)) : i < 0 ? new ye.ERR_BUFFER_OUT_OF_BOUNDS() : new ye.ERR_OUT_OF_RANGE(
1801
+ throw Math.floor(s) !== s ? (ye(s, r), new ve.ERR_OUT_OF_RANGE("offset", "an integer", s)) : i < 0 ? new ve.ERR_BUFFER_OUT_OF_BOUNDS() : new ve.ERR_OUT_OF_RANGE(
1828
1802
  "offset",
1829
1803
  `>= 0 and <= ${i}`,
1830
1804
  s
@@ -1936,34 +1910,34 @@ function Un() {
1936
1910
  }
1937
1911
  })(ft)), ft;
1938
1912
  }
1939
- var Bn = Un();
1940
- const Ln = "https://api.anam.ai", Pn = "/v1", Hi = {
1913
+ var Mn = Un();
1914
+ const Bn = "https://api.anam.ai", Ln = "/v1", Hi = {
1941
1915
  client: "js-sdk",
1942
1916
  version: "4.8.0"
1943
1917
  };
1944
- var Fn = function(t, e, n, o) {
1945
- function u(a) {
1946
- return a instanceof n ? a : new n(function(c) {
1947
- c(a);
1918
+ var Pn = function(t, e, n, o) {
1919
+ function c(a) {
1920
+ return a instanceof n ? a : new n(function(u) {
1921
+ u(a);
1948
1922
  });
1949
1923
  }
1950
- return new (n || (n = Promise))(function(a, c) {
1924
+ return new (n || (n = Promise))(function(a, u) {
1951
1925
  function l(_) {
1952
1926
  try {
1953
1927
  p(o.next(_));
1954
1928
  } catch (d) {
1955
- c(d);
1929
+ u(d);
1956
1930
  }
1957
1931
  }
1958
1932
  function m(_) {
1959
1933
  try {
1960
1934
  p(o.throw(_));
1961
1935
  } catch (d) {
1962
- c(d);
1936
+ u(d);
1963
1937
  }
1964
1938
  }
1965
1939
  function p(_) {
1966
- _.done ? a(_.value) : u(_.value).then(l, m);
1940
+ _.done ? a(_.value) : c(_.value).then(l, m);
1967
1941
  }
1968
1942
  p((o = o.apply(t, e || [])).next());
1969
1943
  });
@@ -1974,11 +1948,11 @@ var se;
1974
1948
  t.CLIENT_METRIC_MEASUREMENT_ERROR = "client_error", t.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED = "client_connection_closed", t.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED = "client_connection_established", t.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT = "client_session_attempt", t.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS = "client_session_success";
1975
1949
  })(se || (se = {}));
1976
1950
  let St = Wi, zi = xt, de, qi = !1;
1977
- const $n = (t, e = xt) => {
1951
+ const Fn = (t, e = xt) => {
1978
1952
  St = t, zi = e;
1979
- }, Gn = (t) => {
1953
+ }, $n = (t) => {
1980
1954
  de = t;
1981
- }, Vn = (t) => {
1955
+ }, Gn = (t) => {
1982
1956
  qi = t;
1983
1957
  };
1984
1958
  let he = {
@@ -1986,20 +1960,20 @@ let he = {
1986
1960
  organizationId: null,
1987
1961
  attemptCorrelationId: null
1988
1962
  };
1989
- const we = (t) => {
1963
+ const Se = (t) => {
1990
1964
  he = Object.assign(Object.assign({}, he), t);
1991
- }, ge = (t, e, n) => Fn(void 0, void 0, void 0, function* () {
1965
+ }, me = (t, e, n) => Pn(void 0, void 0, void 0, function* () {
1992
1966
  if (!qi)
1993
1967
  try {
1994
1968
  const o = Object.assign(Object.assign({}, Hi), n);
1995
1969
  he.sessionId && (o.sessionId = he.sessionId), he.organizationId && (o.organizationId = he.organizationId), he.attemptCorrelationId && (o.attemptCorrelationId = he.attemptCorrelationId);
1996
- const u = `${zi}/metrics/client`;
1997
- let a, c = {
1970
+ const c = `${zi}/metrics/client`;
1971
+ let a, u = {
1998
1972
  "Content-Type": "application/json"
1999
1973
  };
2000
- de?.enabled && de?.baseUrl ? (a = `${de.baseUrl}${u}`, c["X-Anam-Target-Url"] = `${St}${u}`) : a = `${St}${u}`, yield fetch(a, {
1974
+ de?.enabled && de?.baseUrl ? (a = `${de.baseUrl}${c}`, u["X-Anam-Target-Url"] = `${St}${c}`) : a = `${St}${c}`, yield fetch(a, {
2001
1975
  method: "POST",
2002
- headers: c,
1976
+ headers: u,
2003
1977
  body: JSON.stringify({
2004
1978
  name: t,
2005
1979
  value: e,
@@ -2009,94 +1983,94 @@ const we = (t) => {
2009
1983
  } catch (o) {
2010
1984
  console.error("Failed to send error metric:", o);
2011
1985
  }
2012
- }), jn = (t, e = "console") => {
2013
- var n, o, u;
1986
+ }), Vn = (t, e = "console") => {
1987
+ var n, o, c;
2014
1988
  const a = {};
2015
1989
  t.forEach((d) => {
2016
1990
  a[d.type] || (a[d.type] = []), a[d.type].push(d);
2017
1991
  });
2018
- const c = {
1992
+ const u = {
2019
1993
  issues: []
2020
1994
  }, l = ((n = a["inbound-rtp"]) === null || n === void 0 ? void 0 : n.filter((d) => d.kind === "video")) || [];
2021
- l.length > 0 && (c.personaVideoStream = [], l.forEach((d) => {
2022
- var S, g, y, b, A;
2023
- const C = {
2024
- framesReceived: (S = d.framesReceived) !== null && S !== void 0 ? S : "unknown",
1995
+ l.length > 0 && (u.personaVideoStream = [], l.forEach((d) => {
1996
+ var y, g, S, C, A;
1997
+ const I = {
1998
+ framesReceived: (y = d.framesReceived) !== null && y !== void 0 ? y : "unknown",
2025
1999
  framesDropped: (g = d.framesDropped) !== null && g !== void 0 ? g : "unknown",
2026
- framesPerSecond: (y = d.framesPerSecond) !== null && y !== void 0 ? y : "unknown",
2027
- packetsReceived: (b = d.packetsReceived) !== null && b !== void 0 ? b : "unknown",
2000
+ framesPerSecond: (S = d.framesPerSecond) !== null && S !== void 0 ? S : "unknown",
2001
+ packetsReceived: (C = d.packetsReceived) !== null && C !== void 0 ? C : "unknown",
2028
2002
  packetsLost: (A = d.packetsLost) !== null && A !== void 0 ? A : "unknown",
2029
2003
  resolution: d.frameWidth && d.frameHeight ? `${d.frameWidth}x${d.frameHeight}` : void 0,
2030
2004
  jitter: d.jitter !== void 0 ? d.jitter : void 0
2031
2005
  };
2032
- c.personaVideoStream.push(C);
2006
+ u.personaVideoStream.push(I);
2033
2007
  }));
2034
2008
  const m = ((o = a["inbound-rtp"]) === null || o === void 0 ? void 0 : o.filter((d) => d.kind === "audio")) || [];
2035
- m.length > 0 && (c.personaAudioStream = [], m.forEach((d) => {
2036
- var S, g, y;
2037
- const b = {
2038
- packetsReceived: (S = d.packetsReceived) !== null && S !== void 0 ? S : "unknown",
2009
+ m.length > 0 && (u.personaAudioStream = [], m.forEach((d) => {
2010
+ var y, g, S;
2011
+ const C = {
2012
+ packetsReceived: (y = d.packetsReceived) !== null && y !== void 0 ? y : "unknown",
2039
2013
  packetsLost: (g = d.packetsLost) !== null && g !== void 0 ? g : "unknown",
2040
- audioLevel: (y = d.audioLevel) !== null && y !== void 0 ? y : "unknown",
2014
+ audioLevel: (S = d.audioLevel) !== null && S !== void 0 ? S : "unknown",
2041
2015
  jitter: d.jitter !== void 0 ? d.jitter : void 0,
2042
2016
  totalAudioEnergy: d.totalAudioEnergy !== void 0 ? d.totalAudioEnergy : void 0
2043
2017
  };
2044
- c.personaAudioStream.push(b);
2018
+ u.personaAudioStream.push(C);
2045
2019
  }));
2046
- const p = ((u = a["outbound-rtp"]) === null || u === void 0 ? void 0 : u.filter((d) => d.kind === "audio")) || [];
2047
- p.length > 0 && (c.userAudioInput = [], p.forEach((d) => {
2048
- var S, g;
2049
- const y = {
2050
- packetsSent: (S = d.packetsSent) !== null && S !== void 0 ? S : "unknown",
2020
+ const p = ((c = a["outbound-rtp"]) === null || c === void 0 ? void 0 : c.filter((d) => d.kind === "audio")) || [];
2021
+ p.length > 0 && (u.userAudioInput = [], p.forEach((d) => {
2022
+ var y, g;
2023
+ const S = {
2024
+ packetsSent: (y = d.packetsSent) !== null && y !== void 0 ? y : "unknown",
2051
2025
  retransmittedPackets: (g = d.retransmittedPacketsSent) !== null && g !== void 0 ? g : void 0,
2052
2026
  avgPacketSendDelay: d.totalPacketSendDelay !== void 0 ? d.totalPacketSendDelay / (d.packetsSent || 1) * 1e3 : void 0
2053
2027
  };
2054
- c.userAudioInput.push(y);
2055
- })), a.codec && (c.codecs = [], a.codec.forEach((d) => {
2056
- const S = {
2028
+ u.userAudioInput.push(S);
2029
+ })), a.codec && (u.codecs = [], a.codec.forEach((d) => {
2030
+ const y = {
2057
2031
  status: d.payloadType ? "Active" : "Available",
2058
2032
  mimeType: d.mimeType || "Unknown",
2059
2033
  payloadType: d.payloadType || "N/A",
2060
2034
  clockRate: d.clockRate || void 0,
2061
2035
  channels: d.channels || void 0
2062
2036
  };
2063
- c.codecs.push(S);
2064
- })), a.transport && (c.transportLayer = [], a.transport.forEach((d) => {
2065
- const S = {
2037
+ u.codecs.push(y);
2038
+ })), a.transport && (u.transportLayer = [], a.transport.forEach((d) => {
2039
+ const y = {
2066
2040
  dtlsState: d.dtlsState || "unknown",
2067
2041
  iceState: d.iceState || "unknown",
2068
2042
  bytesSent: d.bytesSent || void 0,
2069
2043
  bytesReceived: d.bytesReceived || void 0
2070
2044
  };
2071
- c.transportLayer.push(S);
2045
+ u.transportLayer.push(y);
2072
2046
  }));
2073
2047
  const _ = [];
2074
2048
  if (l.forEach((d) => {
2075
2049
  typeof d.framesDropped == "number" && d.framesDropped > 0 && _.push(`Video: ${d.framesDropped} frames dropped`), typeof d.packetsLost == "number" && d.packetsLost > 0 && _.push(`Video: ${d.packetsLost} packets lost`), typeof d.framesPerSecond == "number" && d.framesPerSecond < 23 && _.push(`Video: Low frame rate (${d.framesPerSecond} fps)`);
2076
2050
  }), m.forEach((d) => {
2077
2051
  typeof d.packetsLost == "number" && d.packetsLost > 0 && _.push(`Audio: ${d.packetsLost} packets lost`), typeof d.jitter == "number" && d.jitter > 0.1 && _.push(`Audio: High jitter (${(d.jitter * 1e3).toFixed(1)}ms)`);
2078
- }), c.issues = _, e === "json")
2079
- return c;
2080
- console.group("📊 WebRTC Session Statistics Report"), c.personaVideoStream && c.personaVideoStream.length > 0 && (console.group("📹 Persona Video Stream (Inbound)"), c.personaVideoStream.forEach((d) => {
2052
+ }), u.issues = _, e === "json")
2053
+ return u;
2054
+ console.group("📊 WebRTC Session Statistics Report"), u.personaVideoStream && u.personaVideoStream.length > 0 && (console.group("📹 Persona Video Stream (Inbound)"), u.personaVideoStream.forEach((d) => {
2081
2055
  console.log(`Frames Received: ${d.framesReceived}`), console.log(`Frames Dropped: ${d.framesDropped}`), console.log(`Frames Per Second: ${d.framesPerSecond}`), console.log(`Packets Received: ${typeof d.packetsReceived == "number" ? d.packetsReceived.toLocaleString() : d.packetsReceived}`), console.log(`Packets Lost: ${d.packetsLost}`), d.resolution && console.log(`Resolution: ${d.resolution}`), d.jitter !== void 0 && console.log(`Jitter: ${d.jitter.toFixed(5)}ms`);
2082
- }), console.groupEnd()), c.personaAudioStream && c.personaAudioStream.length > 0 && (console.group("🔊 Persona Audio Stream (Inbound)"), c.personaAudioStream.forEach((d) => {
2056
+ }), console.groupEnd()), u.personaAudioStream && u.personaAudioStream.length > 0 && (console.group("🔊 Persona Audio Stream (Inbound)"), u.personaAudioStream.forEach((d) => {
2083
2057
  console.log(`Packets Received: ${typeof d.packetsReceived == "number" ? d.packetsReceived.toLocaleString() : d.packetsReceived}`), console.log(`Packets Lost: ${d.packetsLost}`), console.log(`Audio Level: ${d.audioLevel}`), d.jitter !== void 0 && console.log(`Jitter: ${d.jitter.toFixed(5)}ms`), d.totalAudioEnergy !== void 0 && console.log(`Total Audio Energy: ${d.totalAudioEnergy.toFixed(6)}`);
2084
- }), console.groupEnd()), c.userAudioInput && c.userAudioInput.length > 0 && (console.group("🎤 User Audio Input (Outbound)"), c.userAudioInput.forEach((d) => {
2058
+ }), console.groupEnd()), u.userAudioInput && u.userAudioInput.length > 0 && (console.group("🎤 User Audio Input (Outbound)"), u.userAudioInput.forEach((d) => {
2085
2059
  console.log(`Packets Sent: ${typeof d.packetsSent == "number" ? d.packetsSent.toLocaleString() : d.packetsSent}`), d.retransmittedPackets && console.log(`Retransmitted Packets: ${d.retransmittedPackets}`), d.avgPacketSendDelay !== void 0 && console.log(`Avg Packet Send Delay: ${d.avgPacketSendDelay.toFixed(5)}ms`);
2086
- }), console.groupEnd()), c.codecs && c.codecs.length > 0 && (console.group("🔧 Codecs Used"), c.codecs.forEach((d) => {
2060
+ }), console.groupEnd()), u.codecs && u.codecs.length > 0 && (console.group("🔧 Codecs Used"), u.codecs.forEach((d) => {
2087
2061
  console.log(`${d.status} ${d.mimeType} - Payload Type: ${d.payloadType}`), d.clockRate && console.log(` Clock Rate: ${d.clockRate}Hz`), d.channels && console.log(` Channels: ${d.channels}`);
2088
- }), console.groupEnd()), c.transportLayer && c.transportLayer.length > 0 && (console.group("🚚 Transport Layer"), c.transportLayer.forEach((d) => {
2062
+ }), console.groupEnd()), u.transportLayer && u.transportLayer.length > 0 && (console.group("🚚 Transport Layer"), u.transportLayer.forEach((d) => {
2089
2063
  console.log(`DTLS State: ${d.dtlsState}`), console.log(`ICE State: ${d.iceState}`), (d.bytesReceived || d.bytesSent) && console.log(`Data Transfer (bytes) - Sent: ${(d.bytesSent || 0).toLocaleString()}, Received: ${(d.bytesReceived || 0).toLocaleString()}`);
2090
- }), console.groupEnd()), c.issues.length > 0 ? (console.group("⚠️ Potential Issues Detected"), c.issues.forEach((d) => console.warn(d)), console.groupEnd()) : console.log("✅ No significant issues detected"), console.groupEnd();
2064
+ }), console.groupEnd()), u.issues.length > 0 ? (console.group("⚠️ Potential Issues Detected"), u.issues.forEach((d) => console.warn(d)), console.groupEnd()) : console.log("✅ No significant issues detected"), console.groupEnd();
2091
2065
  };
2092
- var j;
2066
+ var V;
2093
2067
  (function(t) {
2094
2068
  t.CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED = "CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED", t.CLIENT_ERROR_CODE_SPEND_CAP_REACHED = "CLIENT_ERROR_CODE_SPEND_CAP_REACHED", t.CLIENT_ERROR_CODE_VALIDATION_ERROR = "CLIENT_ERROR_CODE_VALIDATION_ERROR", t.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR = "CLIENT_ERROR_CODE_AUTHENTICATION_ERROR", t.CLIENT_ERROR_CODE_SERVER_ERROR = "CLIENT_ERROR_CODE_SERVER_ERROR", t.CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED = "CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED", t.CLIENT_ERROR_CODE_SERVICE_BUSY = "CLIENT_ERROR_CODE_SERVICE_BUSY", t.CLIENT_ERROR_CODE_NO_PLAN_FOUND = "CLIENT_ERROR_CODE_NO_PLAN_FOUND", t.CLIENT_ERROR_CODE_UNKNOWN_ERROR = "CLIENT_ERROR_CODE_UNKNOWN_ERROR", t.CLIENT_ERROR_CODE_CONFIGURATION_ERROR = "CLIENT_ERROR_CODE_CONFIGURATION_ERROR";
2095
- })(j || (j = {}));
2069
+ })(V || (V = {}));
2096
2070
  class $ extends Error {
2097
- constructor(e, n, o = 500, u) {
2098
- super(e), this.name = "ClientError", this.code = n, this.statusCode = o, this.details = u, Object.setPrototypeOf(this, $.prototype), ge(se.CLIENT_METRIC_MEASUREMENT_ERROR, n, {
2099
- details: u,
2071
+ constructor(e, n, o = 500, c) {
2072
+ super(e), this.name = "ClientError", this.code = n, this.statusCode = o, this.details = c, Object.setPrototypeOf(this, $.prototype), me(se.CLIENT_METRIC_MEASUREMENT_ERROR, n, {
2073
+ details: c,
2100
2074
  statusCode: o
2101
2075
  });
2102
2076
  }
@@ -2104,7 +2078,7 @@ class $ extends Error {
2104
2078
  function li() {
2105
2079
  return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : Date.now().toString(36) + Math.random().toString(36).substr(2, 9);
2106
2080
  }
2107
- function Hn(t) {
2081
+ function jn(t) {
2108
2082
  if (!(!t || !t.enabled)) {
2109
2083
  if (!t.baseUrl)
2110
2084
  return "API Gateway baseUrl is required when enabled";
@@ -2119,10 +2093,10 @@ function Hn(t) {
2119
2093
  return "API Gateway wsPath must start with /";
2120
2094
  }
2121
2095
  }
2122
- var z;
2096
+ var W;
2123
2097
  (function(t) {
2124
2098
  t.OFFER = "offer", t.ANSWER = "answer", t.ICE_CANDIDATE = "icecandidate", t.END_SESSION = "endsession", t.HEARTBEAT = "heartbeat", t.WARNING = "warning", t.TALK_STREAM_INTERRUPTED = "talkinputstreaminterrupted", t.TALK_STREAM_INPUT = "talkstream", t.SESSION_READY = "sessionready", t.AGENT_AUDIO_INPUT = "agentaudioinput", t.AGENT_AUDIO_INPUT_END = "agentaudioinputend";
2125
- })(z || (z = {}));
2099
+ })(W || (W = {}));
2126
2100
  var De;
2127
2101
  (function(t) {
2128
2102
  t.SPEECH_TEXT = "speechText", t.CLIENT_TOOL_EVENT = "clientToolEvent", t.REASONING_TEXT = "reasoningText";
@@ -2139,15 +2113,15 @@ var N;
2139
2113
  (function(t) {
2140
2114
  t.MESSAGE_HISTORY_UPDATED = "MESSAGE_HISTORY_UPDATED", t.MESSAGE_STREAM_EVENT_RECEIVED = "MESSAGE_STREAM_EVENT_RECEIVED", t.CONNECTION_ESTABLISHED = "CONNECTION_ESTABLISHED", t.CONNECTION_CLOSED = "CONNECTION_CLOSED", t.INPUT_AUDIO_STREAM_STARTED = "INPUT_AUDIO_STREAM_STARTED", t.VIDEO_STREAM_STARTED = "VIDEO_STREAM_STARTED", t.VIDEO_PLAY_STARTED = "VIDEO_PLAY_STARTED", t.AUDIO_STREAM_STARTED = "AUDIO_STREAM_STARTED", t.TALK_STREAM_INTERRUPTED = "TALK_STREAM_INTERRUPTED", t.SESSION_READY = "SESSION_READY", t.SERVER_WARNING = "SERVER_WARNING", t.MIC_PERMISSION_PENDING = "MIC_PERMISSION_PENDING", t.MIC_PERMISSION_GRANTED = "MIC_PERMISSION_GRANTED", t.MIC_PERMISSION_DENIED = "MIC_PERMISSION_DENIED", t.INPUT_AUDIO_DEVICE_CHANGED = "INPUT_AUDIO_DEVICE_CHANGED", t.CLIENT_TOOL_EVENT_RECEIVED = "CLIENT_TOOL_EVENT_RECEIVED", t.REASONING_HISTORY_UPDATED = "REASONING_HISTORY_UPDATED", t.REASONING_STREAM_EVENT_RECEIVED = "REASONING_STREAM_EVENT_RECEIVED";
2141
2115
  })(N || (N = {}));
2142
- var X;
2116
+ var J;
2143
2117
  (function(t) {
2144
2118
  t.WEB_SOCKET_OPEN = "WEB_SOCKET_OPEN", t.SIGNAL_MESSAGE_RECEIVED = "SIGNAL_MESSAGE_RECEIVED", t.WEBRTC_CHAT_MESSAGE_RECEIVED = "WEBRTC_CHAT_MESSAGE_RECEIVED", t.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED = "WEBRTC_CLIENT_TOOL_EVENT_RECEIVED", t.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED = "WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED";
2145
- })(X || (X = {}));
2119
+ })(J || (J = {}));
2146
2120
  var _e;
2147
2121
  (function(t) {
2148
2122
  t.NORMAL = "CONNECTION_CLOSED_CODE_NORMAL", t.MICROPHONE_PERMISSION_DENIED = "CONNECTION_CLOSED_CODE_MICROPHONE_PERMISSION_DENIED", t.SIGNALLING_CLIENT_CONNECTION_FAILURE = "CONNECTION_CLOSED_CODE_SIGNALLING_CLIENT_CONNECTION_FAILURE", t.WEBRTC_FAILURE = "CONNECTION_CLOSED_CODE_WEBRTC_FAILURE", t.SERVER_CLOSED_CONNECTION = "CONNECTION_CLOSED_CODE_SERVER_CLOSED_CONNECTION";
2149
2123
  })(_e || (_e = {}));
2150
- class Wn {
2124
+ class Hn {
2151
2125
  constructor(e, n) {
2152
2126
  this.sequenceNumber = 0, this.config = e, this.signallingClient = n;
2153
2127
  }
@@ -2185,55 +2159,55 @@ class Wn {
2185
2159
  return this.config;
2186
2160
  }
2187
2161
  arrayBufferToBase64(e) {
2188
- const n = e instanceof Uint8Array ? e : new Uint8Array(e), o = Array.from(n, (u) => String.fromCharCode(u)).join("");
2162
+ const n = e instanceof Uint8Array ? e : new Uint8Array(e), o = Array.from(n, (c) => String.fromCharCode(c)).join("");
2189
2163
  return btoa(o);
2190
2164
  }
2191
2165
  }
2192
- var Ce = function(t, e, n, o) {
2193
- function u(a) {
2194
- return a instanceof n ? a : new n(function(c) {
2195
- c(a);
2166
+ var we = function(t, e, n, o) {
2167
+ function c(a) {
2168
+ return a instanceof n ? a : new n(function(u) {
2169
+ u(a);
2196
2170
  });
2197
2171
  }
2198
- return new (n || (n = Promise))(function(a, c) {
2172
+ return new (n || (n = Promise))(function(a, u) {
2199
2173
  function l(_) {
2200
2174
  try {
2201
2175
  p(o.next(_));
2202
2176
  } catch (d) {
2203
- c(d);
2177
+ u(d);
2204
2178
  }
2205
2179
  }
2206
2180
  function m(_) {
2207
2181
  try {
2208
2182
  p(o.throw(_));
2209
2183
  } catch (d) {
2210
- c(d);
2184
+ u(d);
2211
2185
  }
2212
2186
  }
2213
2187
  function p(_) {
2214
- _.done ? a(_.value) : u(_.value).then(l, m);
2188
+ _.done ? a(_.value) : c(_.value).then(l, m);
2215
2189
  }
2216
2190
  p((o = o.apply(t, e || [])).next());
2217
2191
  });
2218
2192
  };
2219
- const zn = 5, qn = 5;
2220
- class Yn {
2221
- constructor(e, n, o, u, a) {
2222
- var c, l, m, p, _;
2223
- if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter = u, this.apiGatewayConfig = a, !e)
2193
+ const Wn = 5, zn = 5;
2194
+ class qn {
2195
+ constructor(e, n, o, c, a) {
2196
+ var u, l, m, p, _;
2197
+ if (this.stopSignal = !1, this.sendingBuffer = [], this.wsConnectionAttempts = 0, this.socket = null, this.heartBeatIntervalRef = null, this.publicEventEmitter = o, this.internalEventEmitter = c, this.apiGatewayConfig = a, !e)
2224
2198
  throw new Error("Signalling Client: sessionId is required");
2225
2199
  this.sessionId = e;
2226
- const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts: S, url: g } = n;
2227
- if (this.heartbeatIntervalSeconds = d || zn, this.maxWsReconnectionAttempts = S || qn, !g.baseUrl)
2200
+ const { heartbeatIntervalSeconds: d, maxWsReconnectionAttempts: y, url: g } = n;
2201
+ if (this.heartbeatIntervalSeconds = d || Wn, this.maxWsReconnectionAttempts = y || zn, !g.baseUrl)
2228
2202
  throw new Error("Signalling Client: baseUrl is required");
2229
- if (!((c = this.apiGatewayConfig) === null || c === void 0) && c.enabled && (!((l = this.apiGatewayConfig) === null || l === void 0) && l.baseUrl)) {
2230
- const y = new URL(this.apiGatewayConfig.baseUrl), b = (m = this.apiGatewayConfig.wsPath) !== null && m !== void 0 ? m : "/ws";
2231
- y.protocol = y.protocol.replace("http", "ws"), y.pathname = b, this.url = y;
2232
- const A = g.protocol || "https", C = A === "http" ? "ws" : "wss", I = `${A}://${g.baseUrl}`, x = (p = g.signallingPath) !== null && p !== void 0 ? p : "/ws", O = new URL(I);
2233
- O.protocol = C === "ws" ? "ws:" : "wss:", g.port && (O.port = g.port), O.pathname = x, O.searchParams.append("session_id", e), this.url.searchParams.append("target_url", O.href);
2203
+ if (!((u = this.apiGatewayConfig) === null || u === void 0) && u.enabled && (!((l = this.apiGatewayConfig) === null || l === void 0) && l.baseUrl)) {
2204
+ const S = new URL(this.apiGatewayConfig.baseUrl), C = (m = this.apiGatewayConfig.wsPath) !== null && m !== void 0 ? m : "/ws";
2205
+ S.protocol = S.protocol.replace("http", "ws"), S.pathname = C, this.url = S;
2206
+ const A = g.protocol || "https", I = A === "http" ? "ws" : "wss", b = `${A}://${g.baseUrl}`, T = (p = g.signallingPath) !== null && p !== void 0 ? p : "/ws", D = new URL(b);
2207
+ D.protocol = I === "ws" ? "ws:" : "wss:", g.port && (D.port = g.port), D.pathname = T, D.searchParams.append("session_id", e), this.url.searchParams.append("target_url", D.href);
2234
2208
  } else {
2235
- const b = `${g.protocol || "https"}://${g.baseUrl}`;
2236
- this.url = new URL(b), this.url.protocol = g.protocol === "http" ? "ws:" : "wss:", g.port && (this.url.port = g.port), this.url.pathname = (_ = g.signallingPath) !== null && _ !== void 0 ? _ : "/ws", this.url.searchParams.append("session_id", e);
2209
+ const C = `${g.protocol || "https"}://${g.baseUrl}`;
2210
+ this.url = new URL(C), this.url.protocol = g.protocol === "http" ? "ws:" : "wss:", g.port && (this.url.port = g.port), this.url.pathname = (_ = g.signallingPath) !== null && _ !== void 0 ? _ : "/ws", this.url.searchParams.append("session_id", e);
2237
2211
  }
2238
2212
  }
2239
2213
  stop() {
@@ -2243,13 +2217,13 @@ class Yn {
2243
2217
  return this.socket = new WebSocket(this.url.href), this.socket.onopen = this.onOpen.bind(this), this.socket.onclose = this.onClose.bind(this), this.socket.onerror = this.onError.bind(this), this.socket;
2244
2218
  }
2245
2219
  sendOffer(e) {
2246
- return Ce(this, void 0, void 0, function* () {
2220
+ return we(this, void 0, void 0, function* () {
2247
2221
  const n = {
2248
2222
  connectionDescription: e,
2249
2223
  userUid: this.sessionId
2250
2224
  // TODO: this should be renamed to session Id on the server
2251
2225
  }, o = {
2252
- actionType: z.OFFER,
2226
+ actionType: W.OFFER,
2253
2227
  sessionId: this.sessionId,
2254
2228
  payload: n
2255
2229
  };
@@ -2257,9 +2231,9 @@ class Yn {
2257
2231
  });
2258
2232
  }
2259
2233
  sendIceCandidate(e) {
2260
- return Ce(this, void 0, void 0, function* () {
2234
+ return we(this, void 0, void 0, function* () {
2261
2235
  const n = {
2262
- actionType: z.ICE_CANDIDATE,
2236
+ actionType: W.ICE_CANDIDATE,
2263
2237
  sessionId: this.sessionId,
2264
2238
  payload: e.toJSON()
2265
2239
  };
@@ -2278,9 +2252,9 @@ class Yn {
2278
2252
  this.sendingBuffer.push(e);
2279
2253
  }
2280
2254
  sendTalkMessage(e) {
2281
- return Ce(this, void 0, void 0, function* () {
2255
+ return we(this, void 0, void 0, function* () {
2282
2256
  const n = {
2283
- actionType: z.TALK_STREAM_INPUT,
2257
+ actionType: W.TALK_STREAM_INPUT,
2284
2258
  sessionId: this.sessionId,
2285
2259
  payload: e
2286
2260
  };
@@ -2289,7 +2263,7 @@ class Yn {
2289
2263
  }
2290
2264
  sendAgentAudioInput(e) {
2291
2265
  const n = {
2292
- actionType: z.AGENT_AUDIO_INPUT,
2266
+ actionType: W.AGENT_AUDIO_INPUT,
2293
2267
  sessionId: this.sessionId,
2294
2268
  payload: e
2295
2269
  };
@@ -2297,7 +2271,7 @@ class Yn {
2297
2271
  }
2298
2272
  sendAgentAudioInputEnd() {
2299
2273
  const e = {
2300
- actionType: z.AGENT_AUDIO_INPUT_END,
2274
+ actionType: W.AGENT_AUDIO_INPUT_END,
2301
2275
  sessionId: this.sessionId,
2302
2276
  payload: {}
2303
2277
  };
@@ -2307,18 +2281,18 @@ class Yn {
2307
2281
  this.socket && (this.socket.close(), this.socket = null), this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null);
2308
2282
  }
2309
2283
  onOpen() {
2310
- return Ce(this, void 0, void 0, function* () {
2284
+ return we(this, void 0, void 0, function* () {
2311
2285
  if (!this.socket)
2312
2286
  throw new Error("SignallingClient - onOpen: socket is null");
2313
2287
  try {
2314
- this.wsConnectionAttempts = 0, this.flushSendingBuffer(), this.socket.onmessage = this.onMessage.bind(this), this.startSendingHeartBeats(), this.internalEventEmitter.emit(X.WEB_SOCKET_OPEN);
2288
+ this.wsConnectionAttempts = 0, this.flushSendingBuffer(), this.socket.onmessage = this.onMessage.bind(this), this.startSendingHeartBeats(), this.internalEventEmitter.emit(J.WEB_SOCKET_OPEN);
2315
2289
  } catch (e) {
2316
2290
  console.error("SignallingClient - onOpen: error in onOpen", e), this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SIGNALLING_CLIENT_CONNECTION_FAILURE);
2317
2291
  }
2318
2292
  });
2319
2293
  }
2320
2294
  onClose() {
2321
- return Ce(this, void 0, void 0, function* () {
2295
+ return we(this, void 0, void 0, function* () {
2322
2296
  this.wsConnectionAttempts += 1, !this.stopSignal && (this.wsConnectionAttempts <= this.maxWsReconnectionAttempts ? (this.socket = null, setTimeout(() => {
2323
2297
  this.connect();
2324
2298
  }, 100 * this.wsConnectionAttempts)) : (this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null), this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SIGNALLING_CLIENT_CONNECTION_FAILURE)));
@@ -2335,9 +2309,9 @@ class Yn {
2335
2309
  }), this.sendingBuffer = e;
2336
2310
  }
2337
2311
  onMessage(e) {
2338
- return Ce(this, void 0, void 0, function* () {
2312
+ return we(this, void 0, void 0, function* () {
2339
2313
  const n = JSON.parse(e.data);
2340
- this.internalEventEmitter.emit(X.SIGNAL_MESSAGE_RECEIVED, n);
2314
+ this.internalEventEmitter.emit(J.SIGNAL_MESSAGE_RECEIVED, n);
2341
2315
  });
2342
2316
  }
2343
2317
  startSendingHeartBeats() {
@@ -2345,59 +2319,59 @@ class Yn {
2345
2319
  throw new Error("SignallingClient - startSendingHeartBeats: socket is null");
2346
2320
  this.heartBeatIntervalRef && console.warn("SignallingClient - startSendingHeartBeats: heartbeat interval already set");
2347
2321
  const e = this.heartbeatIntervalSeconds * 1e3, n = {
2348
- actionType: z.HEARTBEAT,
2322
+ actionType: W.HEARTBEAT,
2349
2323
  sessionId: this.sessionId,
2350
2324
  payload: ""
2351
2325
  }, o = JSON.stringify(n);
2352
2326
  this.heartBeatIntervalRef = setInterval(() => {
2353
- var u;
2354
- this.stopSignal || ((u = this.socket) === null || u === void 0 ? void 0 : u.readyState) === WebSocket.OPEN && this.socket.send(o);
2327
+ var c;
2328
+ this.stopSignal || ((c = this.socket) === null || c === void 0 ? void 0 : c.readyState) === WebSocket.OPEN && this.socket.send(o);
2355
2329
  }, e);
2356
2330
  }
2357
2331
  }
2358
- function Kn(t) {
2332
+ function Yn(t) {
2359
2333
  return "brainType" in t || "llmId" in t;
2360
2334
  }
2361
2335
  var ci = function(t, e, n, o) {
2362
- function u(a) {
2363
- return a instanceof n ? a : new n(function(c) {
2364
- c(a);
2336
+ function c(a) {
2337
+ return a instanceof n ? a : new n(function(u) {
2338
+ u(a);
2365
2339
  });
2366
2340
  }
2367
- return new (n || (n = Promise))(function(a, c) {
2341
+ return new (n || (n = Promise))(function(a, u) {
2368
2342
  function l(_) {
2369
2343
  try {
2370
2344
  p(o.next(_));
2371
2345
  } catch (d) {
2372
- c(d);
2346
+ u(d);
2373
2347
  }
2374
2348
  }
2375
2349
  function m(_) {
2376
2350
  try {
2377
2351
  p(o.throw(_));
2378
2352
  } catch (d) {
2379
- c(d);
2353
+ u(d);
2380
2354
  }
2381
2355
  }
2382
2356
  function p(_) {
2383
- _.done ? a(_.value) : u(_.value).then(l, m);
2357
+ _.done ? a(_.value) : c(_.value).then(l, m);
2384
2358
  }
2385
2359
  p((o = o.apply(t, e || [])).next());
2386
2360
  });
2387
2361
  };
2388
- class Jn {
2362
+ class Kn {
2389
2363
  constructor(e, n, o) {
2390
2364
  if (!e && !n)
2391
2365
  throw new Error("Either sessionToken or apiKey must be provided");
2392
- this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl || Ln, this.apiVersion = o?.apiVersion || Pn, this.apiGatewayConfig = o?.apiGateway || void 0;
2366
+ this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl || Bn, this.apiVersion = o?.apiVersion || Ln, this.apiGatewayConfig = o?.apiGateway || void 0;
2393
2367
  }
2394
2368
  /**
2395
2369
  * Builds URL and headers for a request, applying API Gateway configuration if enabled
2396
2370
  */
2397
2371
  buildGatewayUrlAndHeaders(e, n) {
2398
- var o, u;
2399
- if (!((o = this.apiGatewayConfig) === null || o === void 0) && o.enabled && (!((u = this.apiGatewayConfig) === null || u === void 0) && u.baseUrl)) {
2400
- const a = `${this.apiGatewayConfig.baseUrl}${e}`, c = new URL(`${this.baseUrl}${e}`), l = Object.assign(Object.assign({}, n), { "X-Anam-Target-Url": c.href });
2372
+ var o, c;
2373
+ if (!((o = this.apiGatewayConfig) === null || o === void 0) && o.enabled && (!((c = this.apiGatewayConfig) === null || c === void 0) && c.baseUrl)) {
2374
+ const a = `${this.apiGatewayConfig.baseUrl}${e}`, u = new URL(`${this.baseUrl}${e}`), l = Object.assign(Object.assign({}, n), { "X-Anam-Target-Url": u.href });
2401
2375
  return { url: a, headers: l };
2402
2376
  } else
2403
2377
  return {
@@ -2409,15 +2383,15 @@ class Jn {
2409
2383
  return ci(this, void 0, void 0, function* () {
2410
2384
  if (!this.sessionToken) {
2411
2385
  if (!e)
2412
- throw new $("Persona configuration must be provided when using apiKey", j.CLIENT_ERROR_CODE_VALIDATION_ERROR, 400);
2386
+ throw new $("Persona configuration must be provided when using apiKey", V.CLIENT_ERROR_CODE_VALIDATION_ERROR, 400);
2413
2387
  this.sessionToken = yield this.unsafe_getSessionToken(e);
2414
2388
  }
2415
2389
  e && "brainType" in e && console.warn("Warning: brainType is deprecated and will be removed in a future version. Please use llmId instead.");
2416
2390
  try {
2417
- const o = `${this.apiVersion}/engine/session`, { url: u, headers: a } = this.buildGatewayUrlAndHeaders(o, {
2391
+ const o = `${this.apiVersion}/engine/session`, { url: c, headers: a } = this.buildGatewayUrlAndHeaders(o, {
2418
2392
  "Content-Type": "application/json",
2419
2393
  Authorization: `Bearer ${this.sessionToken}`
2420
- }), c = yield fetch(u, {
2394
+ }), u = yield fetch(c, {
2421
2395
  method: "POST",
2422
2396
  headers: a,
2423
2397
  body: JSON.stringify({
@@ -2425,28 +2399,28 @@ class Jn {
2425
2399
  sessionOptions: n,
2426
2400
  clientMetadata: Hi
2427
2401
  })
2428
- }), l = yield c.json(), m = l.error;
2429
- switch (c.status) {
2402
+ }), l = yield u.json(), m = l.error;
2403
+ switch (u.status) {
2430
2404
  case 200:
2431
2405
  case 201:
2432
2406
  return l;
2433
2407
  case 400:
2434
- throw new $("Invalid request to start session", j.CLIENT_ERROR_CODE_VALIDATION_ERROR, 400, { cause: l.message });
2408
+ throw new $("Invalid request to start session", V.CLIENT_ERROR_CODE_VALIDATION_ERROR, 400, { cause: l.message });
2435
2409
  case 401:
2436
- throw new $("Authentication failed when starting session", j.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 401, { cause: l.message });
2410
+ throw new $("Authentication failed when starting session", V.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 401, { cause: l.message });
2437
2411
  case 402:
2438
- throw new $("Please sign up for a plan to start a session", j.CLIENT_ERROR_CODE_NO_PLAN_FOUND, 402, { cause: l.message });
2412
+ throw new $("Please sign up for a plan to start a session", V.CLIENT_ERROR_CODE_NO_PLAN_FOUND, 402, { cause: l.message });
2439
2413
  case 403:
2440
- throw new $("Authentication failed when starting session", j.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 403, { cause: l.message });
2414
+ throw new $("Authentication failed when starting session", V.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 403, { cause: l.message });
2441
2415
  case 429:
2442
- throw m === "Concurrent session limit reached" ? new $("Concurrency limit reached, please upgrade your plan", j.CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED, 429, { cause: l.message }) : m === "Spend cap reached" ? new $("Spend cap reached, please upgrade your plan", j.CLIENT_ERROR_CODE_SPEND_CAP_REACHED, 429, { cause: l.message }) : new $("Usage limit reached, please upgrade your plan", j.CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED, 429, { cause: l.message });
2416
+ throw m === "Concurrent session limit reached" ? new $("Concurrency limit reached, please upgrade your plan", V.CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED, 429, { cause: l.message }) : m === "Spend cap reached" ? new $("Spend cap reached, please upgrade your plan", V.CLIENT_ERROR_CODE_SPEND_CAP_REACHED, 429, { cause: l.message }) : new $("Usage limit reached, please upgrade your plan", V.CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED, 429, { cause: l.message });
2443
2417
  case 503:
2444
- throw new $("There are no available personas, please try again later", j.CLIENT_ERROR_CODE_SERVICE_BUSY, 503, { cause: l.message });
2418
+ throw new $("There are no available personas, please try again later", V.CLIENT_ERROR_CODE_SERVICE_BUSY, 503, { cause: l.message });
2445
2419
  default:
2446
- throw new $("Unknown error when starting session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, { cause: l.message });
2420
+ throw new $("Unknown error when starting session", V.CLIENT_ERROR_CODE_SERVER_ERROR, 500, { cause: l.message });
2447
2421
  }
2448
2422
  } catch (o) {
2449
- throw o instanceof $ ? o : new $("Failed to start session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, { cause: o instanceof Error ? o.message : String(o) });
2423
+ throw o instanceof $ ? o : new $("Failed to start session", V.CLIENT_ERROR_CODE_SERVER_ERROR, 500, { cause: o instanceof Error ? o.message : String(o) });
2450
2424
  }
2451
2425
  });
2452
2426
  }
@@ -2458,13 +2432,13 @@ class Jn {
2458
2432
  let n = {
2459
2433
  clientLabel: "js-sdk-api-key"
2460
2434
  };
2461
- Kn(e) && (n = Object.assign(Object.assign({}, n), { personaConfig: e }));
2435
+ Yn(e) && (n = Object.assign(Object.assign({}, n), { personaConfig: e }));
2462
2436
  try {
2463
- const o = `${this.apiVersion}/auth/session-token`, { url: u, headers: a } = this.buildGatewayUrlAndHeaders(o, {
2437
+ const o = `${this.apiVersion}/auth/session-token`, { url: c, headers: a } = this.buildGatewayUrlAndHeaders(o, {
2464
2438
  "Content-Type": "application/json",
2465
2439
  Authorization: `Bearer ${this.apiKey}`
2466
2440
  });
2467
- return (yield (yield fetch(u, {
2441
+ return (yield (yield fetch(c, {
2468
2442
  method: "POST",
2469
2443
  headers: a,
2470
2444
  body: JSON.stringify(n)
@@ -2478,52 +2452,52 @@ class Jn {
2478
2452
  return `${this.baseUrl}${this.apiVersion}`;
2479
2453
  }
2480
2454
  }
2481
- var Xn = function(t, e, n, o) {
2482
- function u(a) {
2483
- return a instanceof n ? a : new n(function(c) {
2484
- c(a);
2455
+ var Jn = function(t, e, n, o) {
2456
+ function c(a) {
2457
+ return a instanceof n ? a : new n(function(u) {
2458
+ u(a);
2485
2459
  });
2486
2460
  }
2487
- return new (n || (n = Promise))(function(a, c) {
2461
+ return new (n || (n = Promise))(function(a, u) {
2488
2462
  function l(_) {
2489
2463
  try {
2490
2464
  p(o.next(_));
2491
2465
  } catch (d) {
2492
- c(d);
2466
+ u(d);
2493
2467
  }
2494
2468
  }
2495
2469
  function m(_) {
2496
2470
  try {
2497
2471
  p(o.throw(_));
2498
2472
  } catch (d) {
2499
- c(d);
2473
+ u(d);
2500
2474
  }
2501
2475
  }
2502
2476
  function p(_) {
2503
- _.done ? a(_.value) : u(_.value).then(l, m);
2477
+ _.done ? a(_.value) : c(_.value).then(l, m);
2504
2478
  }
2505
2479
  p((o = o.apply(t, e || [])).next());
2506
2480
  });
2507
2481
  };
2508
- class Zn {
2482
+ class Xn {
2509
2483
  constructor(e, n, o) {
2510
2484
  this.baseUrl = e, this.sessionId = n, this.apiGatewayConfig = o;
2511
2485
  }
2512
2486
  sendTalkCommand(e) {
2513
- return Xn(this, void 0, void 0, function* () {
2487
+ return Jn(this, void 0, void 0, function* () {
2514
2488
  var n, o;
2515
2489
  try {
2516
- let u, a = {
2490
+ let c, a = {
2517
2491
  "Content-Type": "application/json"
2518
2492
  };
2519
- const c = "/talk", l = `?session_id=${this.sessionId}`;
2493
+ const u = "/talk", l = `?session_id=${this.sessionId}`;
2520
2494
  if (!((n = this.apiGatewayConfig) === null || n === void 0) && n.enabled && (!((o = this.apiGatewayConfig) === null || o === void 0) && o.baseUrl)) {
2521
- u = `${this.apiGatewayConfig.baseUrl}${c}${l}`;
2522
- const p = new URL(`${this.baseUrl}${c}${l}`);
2495
+ c = `${this.apiGatewayConfig.baseUrl}${u}${l}`;
2496
+ const p = new URL(`${this.baseUrl}${u}${l}`);
2523
2497
  a["X-Anam-Target-Url"] = p.href;
2524
2498
  } else
2525
- u = `${this.baseUrl}${c}${l}`;
2526
- const m = yield fetch(u, {
2499
+ c = `${this.baseUrl}${u}${l}`;
2500
+ const m = yield fetch(c, {
2527
2501
  method: "POST",
2528
2502
  headers: a,
2529
2503
  body: JSON.stringify({
@@ -2532,13 +2506,13 @@ class Zn {
2532
2506
  });
2533
2507
  if (!m.ok)
2534
2508
  throw new Error(`Failed to send talk command: ${m.status} ${m.statusText}`);
2535
- } catch (u) {
2536
- throw console.error(u), new Error("EngineApiRestClient - sendTalkCommand: Failed to send talk command");
2509
+ } catch (c) {
2510
+ throw console.error(c), new Error("EngineApiRestClient - sendTalkCommand: Failed to send talk command");
2537
2511
  }
2538
2512
  });
2539
2513
  }
2540
2514
  }
2541
- class Qn {
2515
+ class Zn {
2542
2516
  constructor() {
2543
2517
  this.listeners = {};
2544
2518
  }
@@ -2554,9 +2528,9 @@ class Qn {
2554
2528
  });
2555
2529
  }
2556
2530
  }
2557
- class er {
2531
+ class Qn {
2558
2532
  constructor(e, n) {
2559
- this.messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(X.WEBRTC_CHAT_MESSAGE_RECEIVED, this.processWebRtcTextMessageEvent.bind(this));
2533
+ this.messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(J.WEBRTC_CHAT_MESSAGE_RECEIVED, this.processWebRtcTextMessageEvent.bind(this));
2560
2534
  }
2561
2535
  webRtcTextMessageEventToMessageStreamEvent(e) {
2562
2536
  return {
@@ -2582,10 +2556,10 @@ class er {
2582
2556
  content: e.content,
2583
2557
  role: e.role,
2584
2558
  interrupted: e.interrupted
2585
- }, o = this.messages.findIndex((u) => u.id === n.id);
2559
+ }, o = this.messages.findIndex((c) => c.id === n.id);
2586
2560
  if (o !== -1) {
2587
- const u = this.messages[o];
2588
- this.messages[o] = Object.assign(Object.assign({}, u), { content: u.content + n.content, interrupted: u.interrupted || n.interrupted });
2561
+ const c = this.messages[o];
2562
+ this.messages[o] = Object.assign(Object.assign({}, c), { content: c.content + n.content, interrupted: c.interrupted || n.interrupted });
2589
2563
  } else
2590
2564
  this.messages.push(n);
2591
2565
  }
@@ -2602,7 +2576,7 @@ class er {
2602
2576
  n.endOfSpeech && this.publicEventEmitter.emit(N.MESSAGE_HISTORY_UPDATED, this.messages);
2603
2577
  }
2604
2578
  }
2605
- class tr {
2579
+ class er {
2606
2580
  constructor() {
2607
2581
  this.listeners = {};
2608
2582
  }
@@ -2613,65 +2587,65 @@ class tr {
2613
2587
  this.listeners[e] && this.listeners[e].delete(n);
2614
2588
  }
2615
2589
  emit(e, ...n) {
2616
- if (e === N.CONNECTION_ESTABLISHED && ge(se.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED, "1"), e === N.CONNECTION_CLOSED) {
2617
- const [o, u] = n;
2618
- ge(se.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED, o, u ? { details: u } : void 0);
2590
+ if (e === N.CONNECTION_ESTABLISHED && me(se.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED, "1"), e === N.CONNECTION_CLOSED) {
2591
+ const [o, c] = n;
2592
+ me(se.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED, o, c ? { details: c } : void 0);
2619
2593
  }
2620
2594
  this.listeners[e] && this.listeners[e].forEach((o) => {
2621
2595
  o(...n);
2622
2596
  });
2623
2597
  }
2624
2598
  }
2625
- var q;
2599
+ var z;
2626
2600
  (function(t) {
2627
2601
  t[t.UNSTARTED = 0] = "UNSTARTED", t[t.STREAMING = 1] = "STREAMING", t[t.INTERRUPTED = 2] = "INTERRUPTED", t[t.ENDED = 3] = "ENDED";
2628
- })(q || (q = {}));
2602
+ })(z || (z = {}));
2629
2603
  var pt = function(t, e, n, o) {
2630
- function u(a) {
2631
- return a instanceof n ? a : new n(function(c) {
2632
- c(a);
2604
+ function c(a) {
2605
+ return a instanceof n ? a : new n(function(u) {
2606
+ u(a);
2633
2607
  });
2634
2608
  }
2635
- return new (n || (n = Promise))(function(a, c) {
2609
+ return new (n || (n = Promise))(function(a, u) {
2636
2610
  function l(_) {
2637
2611
  try {
2638
2612
  p(o.next(_));
2639
2613
  } catch (d) {
2640
- c(d);
2614
+ u(d);
2641
2615
  }
2642
2616
  }
2643
2617
  function m(_) {
2644
2618
  try {
2645
2619
  p(o.throw(_));
2646
2620
  } catch (d) {
2647
- c(d);
2621
+ u(d);
2648
2622
  }
2649
2623
  }
2650
2624
  function p(_) {
2651
- _.done ? a(_.value) : u(_.value).then(l, m);
2625
+ _.done ? a(_.value) : c(_.value).then(l, m);
2652
2626
  }
2653
2627
  p((o = o.apply(t, e || [])).next());
2654
2628
  });
2655
2629
  };
2656
- class ir {
2630
+ class tr {
2657
2631
  constructor(e, n, o) {
2658
- this.state = q.UNSTARTED, this.correlationId = e, this.internalEventEmitter = n, this.signallingClient = o, this.internalEventEmitter.addListener(X.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
2632
+ this.state = z.UNSTARTED, this.correlationId = e, this.internalEventEmitter = n, this.signallingClient = o, this.internalEventEmitter.addListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
2659
2633
  }
2660
2634
  onDeactivate() {
2661
- this.internalEventEmitter.removeListener(X.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
2635
+ this.internalEventEmitter.removeListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this));
2662
2636
  }
2663
2637
  onSignalMessage(e) {
2664
2638
  return pt(this, void 0, void 0, function* () {
2665
- e.actionType === z.TALK_STREAM_INTERRUPTED && e.payload.correlationId === this.correlationId && (this.state = q.INTERRUPTED, this.onDeactivate());
2639
+ e.actionType === W.TALK_STREAM_INTERRUPTED && e.payload.correlationId === this.correlationId && (this.state = z.INTERRUPTED, this.onDeactivate());
2666
2640
  });
2667
2641
  }
2668
2642
  endMessage() {
2669
2643
  return pt(this, void 0, void 0, function* () {
2670
- if (this.state === q.ENDED) {
2644
+ if (this.state === z.ENDED) {
2671
2645
  console.warn("Talk stream is already ended via end of speech. No need to call endMessage.");
2672
2646
  return;
2673
2647
  }
2674
- if (this.state !== q.STREAMING) {
2648
+ if (this.state !== z.STREAMING) {
2675
2649
  console.warn("Talk stream is not active state: " + this.state);
2676
2650
  return;
2677
2651
  }
@@ -2681,69 +2655,69 @@ class ir {
2681
2655
  endOfSpeech: !0,
2682
2656
  correlationId: this.correlationId
2683
2657
  };
2684
- yield this.signallingClient.sendTalkMessage(e), this.state = q.ENDED, this.onDeactivate();
2658
+ yield this.signallingClient.sendTalkMessage(e), this.state = z.ENDED, this.onDeactivate();
2685
2659
  });
2686
2660
  }
2687
2661
  streamMessageChunk(e, n) {
2688
2662
  return pt(this, void 0, void 0, function* () {
2689
- if (this.state !== q.STREAMING && this.state !== q.UNSTARTED)
2663
+ if (this.state !== z.STREAMING && this.state !== z.UNSTARTED)
2690
2664
  throw new Error("Talk stream is not in an active state: " + this.state);
2691
2665
  const o = {
2692
2666
  content: e,
2693
- startOfSpeech: this.state === q.UNSTARTED,
2667
+ startOfSpeech: this.state === z.UNSTARTED,
2694
2668
  endOfSpeech: n,
2695
2669
  correlationId: this.correlationId
2696
2670
  };
2697
- this.state = n ? q.ENDED : q.STREAMING, this.state === q.ENDED && this.onDeactivate(), yield this.signallingClient.sendTalkMessage(o);
2671
+ this.state = n ? z.ENDED : z.STREAMING, this.state === z.ENDED && this.onDeactivate(), yield this.signallingClient.sendTalkMessage(o);
2698
2672
  });
2699
2673
  }
2700
2674
  getCorrelationId() {
2701
2675
  return this.correlationId;
2702
2676
  }
2703
2677
  isActive() {
2704
- return this.state === q.STREAMING || this.state === q.UNSTARTED;
2678
+ return this.state === z.STREAMING || this.state === z.UNSTARTED;
2705
2679
  }
2706
2680
  getState() {
2707
2681
  return this.state;
2708
2682
  }
2709
2683
  }
2710
- var J = function(t, e, n, o) {
2711
- function u(a) {
2712
- return a instanceof n ? a : new n(function(c) {
2713
- c(a);
2684
+ var K = function(t, e, n, o) {
2685
+ function c(a) {
2686
+ return a instanceof n ? a : new n(function(u) {
2687
+ u(a);
2714
2688
  });
2715
2689
  }
2716
- return new (n || (n = Promise))(function(a, c) {
2690
+ return new (n || (n = Promise))(function(a, u) {
2717
2691
  function l(_) {
2718
2692
  try {
2719
2693
  p(o.next(_));
2720
2694
  } catch (d) {
2721
- c(d);
2695
+ u(d);
2722
2696
  }
2723
2697
  }
2724
2698
  function m(_) {
2725
2699
  try {
2726
2700
  p(o.throw(_));
2727
2701
  } catch (d) {
2728
- c(d);
2702
+ u(d);
2729
2703
  }
2730
2704
  }
2731
2705
  function p(_) {
2732
- _.done ? a(_.value) : u(_.value).then(l, m);
2706
+ _.done ? a(_.value) : c(_.value).then(l, m);
2733
2707
  }
2734
2708
  p((o = o.apply(t, e || [])).next());
2735
2709
  });
2736
2710
  };
2737
- const nr = 15e3, rr = 5e3, or = 2;
2738
- class sr {
2739
- constructor(e, n, o, u) {
2740
- var a, c, l, m;
2711
+ const ir = 15e3, nr = 5e3, rr = 2;
2712
+ class or {
2713
+ constructor(e, n, o, c) {
2714
+ var a, u, l, m;
2741
2715
  this.peerConnection = null, this.connectionReceivedAnswer = !1, this.remoteIceCandidateBuffer = [], this.inputAudioStream = null, this.dataChannel = null, this.videoElement = null, this.videoStream = null, this.audioStream = null, this.inputAudioState = {
2742
2716
  isMuted: !1,
2743
2717
  permissionState: fe.NOT_REQUESTED
2744
- }, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter = u, this.apiGatewayConfig = n.apiGateway;
2718
+ }, this.successMetricPoller = null, this.successMetricFired = !1, this.showPeerConnectionStatsReport = !1, this.peerConnectionStatsReportOutputFormat = "console", this.statsCollectionInterval = null, this.agentAudioInputStream = null, this.publicEventEmitter = o, this.internalEventEmitter = c, this.apiGatewayConfig = n.apiGateway;
2745
2719
  const { inputAudio: p } = n;
2746
- this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(X.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(X.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new Yn(e, n.signalling, this.publicEventEmitter, this.internalEventEmitter, this.apiGatewayConfig), this.engineApiRestClient = new Zn(n.engine.baseUrl, e, this.apiGatewayConfig), this.audioDeviceId = n.inputAudio.audioDeviceId, this.showPeerConnectionStatsReport = (c = (a = n.metrics) === null || a === void 0 ? void 0 : a.showPeerConnectionStatsReport) !== null && c !== void 0 ? c : !1, this.peerConnectionStatsReportOutputFormat = (m = (l = n.metrics) === null || l === void 0 ? void 0 : l.peerConnectionStatsReportOutputFormat) !== null && m !== void 0 ? m : "console";
2720
+ this.inputAudioState = p.inputAudioState, n.inputAudio.userProvidedMediaStream && (this.inputAudioStream = n.inputAudio.userProvidedMediaStream), this.disableInputAudio = n.inputAudio.disableInputAudio === !0, this.internalEventEmitter.addListener(J.WEB_SOCKET_OPEN, this.onSignallingClientConnected.bind(this)), this.internalEventEmitter.addListener(J.SIGNAL_MESSAGE_RECEIVED, this.onSignalMessage.bind(this)), this.iceServers = n.iceServers, this.signallingClient = new qn(e, n.signalling, this.publicEventEmitter, this.internalEventEmitter, this.apiGatewayConfig), this.engineApiRestClient = new Xn(n.engine.baseUrl, e, this.apiGatewayConfig), this.audioDeviceId = n.inputAudio.audioDeviceId, this.showPeerConnectionStatsReport = (u = (a = n.metrics) === null || a === void 0 ? void 0 : a.showPeerConnectionStatsReport) !== null && u !== void 0 ? u : !1, this.peerConnectionStatsReportOutputFormat = (m = (l = n.metrics) === null || l === void 0 ? void 0 : l.peerConnectionStatsReportOutputFormat) !== null && m !== void 0 ? m : "console";
2747
2721
  }
2748
2722
  onInputAudioStateChange(e, n) {
2749
2723
  e.isMuted !== n.isMuted && (n.isMuted ? this.muteAllAudioTracks() : this.unmuteAllAudioTracks());
@@ -2761,7 +2735,7 @@ class sr {
2761
2735
  });
2762
2736
  }
2763
2737
  startStatsCollection() {
2764
- this.statsCollectionInterval || (this.statsCollectionInterval = setInterval(() => J(this, void 0, void 0, function* () {
2738
+ this.statsCollectionInterval || (this.statsCollectionInterval = setInterval(() => K(this, void 0, void 0, function* () {
2765
2739
  if (!(!this.peerConnection || !this.dataChannel || this.dataChannel.readyState !== "open"))
2766
2740
  try {
2767
2741
  const e = yield this.peerConnection.getStats();
@@ -2769,7 +2743,7 @@ class sr {
2769
2743
  } catch (e) {
2770
2744
  console.error("Failed to collect and send stats:", e);
2771
2745
  }
2772
- }), rr));
2746
+ }), nr));
2773
2747
  }
2774
2748
  sendClientSideMetrics(e) {
2775
2749
  e.forEach((n) => {
@@ -2787,19 +2761,19 @@ class sr {
2787
2761
  return;
2788
2762
  const e = setTimeout(() => {
2789
2763
  this.successMetricPoller && (console.warn("No video frames received, there is a problem with the connection."), clearInterval(this.successMetricPoller), this.successMetricPoller = null);
2790
- }, nr);
2791
- this.successMetricPoller = setInterval(() => J(this, void 0, void 0, function* () {
2764
+ }, ir);
2765
+ this.successMetricPoller = setInterval(() => K(this, void 0, void 0, function* () {
2792
2766
  if (!this.peerConnection || this.successMetricFired) {
2793
2767
  this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e);
2794
2768
  return;
2795
2769
  }
2796
2770
  try {
2797
2771
  const n = yield this.peerConnection.getStats();
2798
- let o = !1, u = null;
2772
+ let o = !1, c = null;
2799
2773
  n.forEach((a) => {
2800
- a.type === "inbound-rtp" && a.kind === "video" && (a.framesDecoded !== void 0 && a.framesDecoded > 0 ? (o = !0, u = "framesDecoded") : a.framesReceived !== void 0 && a.framesReceived > 0 ? (o = !0, u = "framesReceived") : a.bytesReceived > 0 && a.packetsReceived > 0 && // Additional check: ensure we've received enough data for actual video
2801
- a.bytesReceived > 1e5 && (o = !0, u = "bytesReceived"));
2802
- }), o && !this.successMetricFired && (this.successMetricFired = !0, ge(se.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", u ? { detectionMethod: u } : void 0), this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e), this.successMetricPoller = null);
2774
+ a.type === "inbound-rtp" && a.kind === "video" && (a.framesDecoded !== void 0 && a.framesDecoded > 0 ? (o = !0, c = "framesDecoded") : a.framesReceived !== void 0 && a.framesReceived > 0 ? (o = !0, c = "framesReceived") : a.bytesReceived > 0 && a.packetsReceived > 0 && // Additional check: ensure we've received enough data for actual video
2775
+ a.bytesReceived > 1e5 && (o = !0, c = "bytesReceived"));
2776
+ }), o && !this.successMetricFired && (this.successMetricFired = !0, me(se.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", c ? { detectionMethod: c } : void 0), this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e), this.successMetricPoller = null);
2803
2777
  } catch {
2804
2778
  }
2805
2779
  }), 500);
@@ -2819,15 +2793,15 @@ class sr {
2819
2793
  return this.peerConnection;
2820
2794
  }
2821
2795
  changeAudioInputDevice(e) {
2822
- return J(this, void 0, void 0, function* () {
2796
+ return K(this, void 0, void 0, function* () {
2823
2797
  if (!this.peerConnection)
2824
2798
  throw new Error("StreamingClient - changeAudioInputDevice: peer connection is not initialized. Start streaming first.");
2825
2799
  if (e == null)
2826
2800
  throw new Error("StreamingClient - changeAudioInputDevice: deviceId is required");
2827
2801
  const n = this.inputAudioState.isMuted;
2828
2802
  try {
2829
- this.inputAudioStream && this.inputAudioStream.getAudioTracks().forEach((u) => {
2830
- u.stop();
2803
+ this.inputAudioStream && this.inputAudioStream.getAudioTracks().forEach((c) => {
2804
+ c.stop();
2831
2805
  });
2832
2806
  const o = {
2833
2807
  echoCancellation: !0,
@@ -2875,68 +2849,68 @@ class sr {
2875
2849
  }
2876
2850
  }
2877
2851
  stopConnection() {
2878
- return J(this, void 0, void 0, function* () {
2852
+ return K(this, void 0, void 0, function* () {
2879
2853
  yield this.shutdown();
2880
2854
  });
2881
2855
  }
2882
2856
  sendTalkCommand(e) {
2883
- return J(this, void 0, void 0, function* () {
2857
+ return K(this, void 0, void 0, function* () {
2884
2858
  if (!this.peerConnection)
2885
2859
  throw new Error("StreamingClient - sendTalkCommand: peer connection is null");
2886
2860
  yield this.engineApiRestClient.sendTalkCommand(e);
2887
2861
  });
2888
2862
  }
2889
2863
  startTalkMessageStream(e) {
2890
- return e || (e = Math.random().toString(36).substring(2, 15)), new ir(e, this.internalEventEmitter, this.signallingClient);
2864
+ return e || (e = Math.random().toString(36).substring(2, 15)), new tr(e, this.internalEventEmitter, this.signallingClient);
2891
2865
  }
2892
2866
  createAgentAudioInputStream(e) {
2893
- return this.agentAudioInputStream = new Wn(e, this.signallingClient), this.agentAudioInputStream;
2867
+ return this.agentAudioInputStream = new Hn(e, this.signallingClient), this.agentAudioInputStream;
2894
2868
  }
2895
2869
  getAgentAudioInputStream() {
2896
2870
  return this.agentAudioInputStream;
2897
2871
  }
2898
2872
  initPeerConnection() {
2899
- return J(this, void 0, void 0, function* () {
2873
+ return K(this, void 0, void 0, function* () {
2900
2874
  this.peerConnection = new RTCPeerConnection({
2901
2875
  iceServers: this.iceServers,
2902
- iceCandidatePoolSize: or
2876
+ iceCandidatePoolSize: rr
2903
2877
  }), this.peerConnection.onicecandidate = this.onIceCandidate.bind(this), this.peerConnection.oniceconnectionstatechange = this.onIceConnectionStateChange.bind(this), this.peerConnection.onconnectionstatechange = this.onConnectionStateChange.bind(this), this.peerConnection.addEventListener("track", this.onTrackEventHandler.bind(this)), yield this.setupDataChannels(), this.peerConnection.addTransceiver("video", { direction: "recvonly" }), this.disableInputAudio ? this.peerConnection.addTransceiver("audio", { direction: "recvonly" }) : (this.peerConnection.addTransceiver("audio", { direction: "sendrecv" }), this.inputAudioStream ? yield this.setupAudioTrack() : this.requestMicrophonePermissionAsync().catch((e) => {
2904
2878
  console.error("Async microphone permission request failed:", e);
2905
2879
  }));
2906
2880
  });
2907
2881
  }
2908
2882
  onSignalMessage(e) {
2909
- return J(this, void 0, void 0, function* () {
2883
+ return K(this, void 0, void 0, function* () {
2910
2884
  if (!this.peerConnection) {
2911
2885
  console.error("StreamingClient - onSignalMessage: peerConnection is not initialized");
2912
2886
  return;
2913
2887
  }
2914
2888
  switch (e.actionType) {
2915
- case z.ANSWER:
2889
+ case W.ANSWER:
2916
2890
  const n = e.payload;
2917
2891
  yield this.peerConnection.setRemoteDescription(n), this.connectionReceivedAnswer = !0, this.flushRemoteIceCandidateBuffer();
2918
2892
  break;
2919
- case z.ICE_CANDIDATE:
2920
- const o = e.payload, u = new RTCIceCandidate(o);
2921
- this.connectionReceivedAnswer ? yield this.peerConnection.addIceCandidate(u) : this.remoteIceCandidateBuffer.push(u);
2893
+ case W.ICE_CANDIDATE:
2894
+ const o = e.payload, c = new RTCIceCandidate(o);
2895
+ this.connectionReceivedAnswer ? yield this.peerConnection.addIceCandidate(c) : this.remoteIceCandidateBuffer.push(c);
2922
2896
  break;
2923
- case z.END_SESSION:
2897
+ case W.END_SESSION:
2924
2898
  const a = e.payload;
2925
2899
  this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.SERVER_CLOSED_CONNECTION, a), this.shutdown();
2926
2900
  break;
2927
- case z.WARNING:
2928
- const c = e.payload;
2929
- console.warn("Warning received from server: " + c), this.publicEventEmitter.emit(N.SERVER_WARNING, c);
2901
+ case W.WARNING:
2902
+ const u = e.payload;
2903
+ console.warn("Warning received from server: " + u), this.publicEventEmitter.emit(N.SERVER_WARNING, u);
2930
2904
  break;
2931
- case z.TALK_STREAM_INTERRUPTED:
2905
+ case W.TALK_STREAM_INTERRUPTED:
2932
2906
  const l = e.payload;
2933
2907
  this.publicEventEmitter.emit(N.TALK_STREAM_INTERRUPTED, l.correlationId);
2934
2908
  break;
2935
- case z.SESSION_READY:
2909
+ case W.SESSION_READY:
2936
2910
  const m = e.sessionId;
2937
2911
  this.publicEventEmitter.emit(N.SESSION_READY, m);
2938
2912
  break;
2939
- case z.HEARTBEAT:
2913
+ case W.HEARTBEAT:
2940
2914
  break;
2941
2915
  default:
2942
2916
  console.warn("StreamingClient - onSignalMessage: unknown signal message action type. Is your anam-sdk version up to date?", e);
@@ -2944,7 +2918,7 @@ class sr {
2944
2918
  });
2945
2919
  }
2946
2920
  onSignallingClientConnected() {
2947
- return J(this, void 0, void 0, function* () {
2921
+ return K(this, void 0, void 0, function* () {
2948
2922
  if (!this.peerConnection)
2949
2923
  try {
2950
2924
  yield this.initPeerConnectionAndSendOffer();
@@ -2989,7 +2963,7 @@ class sr {
2989
2963
  this.videoElement.srcObject = this.videoStream;
2990
2964
  const n = this.videoElement.requestVideoFrameCallback(() => {
2991
2965
  var o;
2992
- (o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(N.VIDEO_PLAY_STARTED), this.successMetricFired || (this.successMetricFired = !0, ge(se.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", { detectionMethod: "videoElement" }));
2966
+ (o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(N.VIDEO_PLAY_STARTED), this.successMetricFired || (this.successMetricFired = !0, me(se.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", { detectionMethod: "videoElement" }));
2993
2967
  });
2994
2968
  }
2995
2969
  } else e.track.kind === "audio" && (this.audioStream = e.streams[0], this.publicEventEmitter.emit(N.AUDIO_STREAM_STARTED, this.audioStream));
@@ -2998,7 +2972,7 @@ class sr {
2998
2972
  * Set up the data channels for sending and receiving messages
2999
2973
  */
3000
2974
  setupDataChannels() {
3001
- return J(this, void 0, void 0, function* () {
2975
+ return K(this, void 0, void 0, function* () {
3002
2976
  if (!this.peerConnection) {
3003
2977
  console.error("StreamingClient - setupDataChannels: peer connection is not initialized");
3004
2978
  return;
@@ -3016,16 +2990,16 @@ class sr {
3016
2990
  const o = JSON.parse(n.data);
3017
2991
  switch (o.messageType) {
3018
2992
  case De.SPEECH_TEXT:
3019
- this.internalEventEmitter.emit(X.WEBRTC_CHAT_MESSAGE_RECEIVED, o.data);
2993
+ this.internalEventEmitter.emit(J.WEBRTC_CHAT_MESSAGE_RECEIVED, o.data);
3020
2994
  break;
3021
2995
  case De.CLIENT_TOOL_EVENT:
3022
- const u = o.data;
3023
- this.internalEventEmitter.emit(X.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED, u);
3024
- const a = ar.WebRTCClientToolEventToClientToolEvent(u);
2996
+ const c = o.data;
2997
+ this.internalEventEmitter.emit(J.WEBRTC_CLIENT_TOOL_EVENT_RECEIVED, c);
2998
+ const a = sr.WebRTCClientToolEventToClientToolEvent(c);
3025
2999
  this.publicEventEmitter.emit(N.CLIENT_TOOL_EVENT_RECEIVED, a);
3026
3000
  break;
3027
3001
  case De.REASONING_TEXT:
3028
- this.internalEventEmitter.emit(X.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, o.data);
3002
+ this.internalEventEmitter.emit(J.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, o.data);
3029
3003
  break;
3030
3004
  // Unknown message types are silently ignored to maintain forward compatibility
3031
3005
  default:
@@ -3041,7 +3015,7 @@ class sr {
3041
3015
  * Request microphone permission asynchronously without blocking connection
3042
3016
  */
3043
3017
  requestMicrophonePermissionAsync() {
3044
- return J(this, void 0, void 0, function* () {
3018
+ return K(this, void 0, void 0, function* () {
3045
3019
  if (this.inputAudioState.permissionState !== fe.PENDING) {
3046
3020
  this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: fe.PENDING }), this.publicEventEmitter.emit(N.MIC_PERMISSION_PENDING);
3047
3021
  try {
@@ -3065,7 +3039,7 @@ class sr {
3065
3039
  * Set up audio track and add it to the peer connection using replaceTrack
3066
3040
  */
3067
3041
  setupAudioTrack() {
3068
- return J(this, void 0, void 0, function* () {
3042
+ return K(this, void 0, void 0, function* () {
3069
3043
  if (!this.peerConnection || !this.inputAudioStream)
3070
3044
  return;
3071
3045
  if (!this.inputAudioStream.getAudioTracks().length) {
@@ -3073,15 +3047,15 @@ class sr {
3073
3047
  return;
3074
3048
  }
3075
3049
  this.inputAudioState.isMuted && this.muteAllAudioTracks();
3076
- const e = this.inputAudioStream.getAudioTracks()[0], o = this.peerConnection.getSenders().find((u) => {
3050
+ const e = this.inputAudioStream.getAudioTracks()[0], o = this.peerConnection.getSenders().find((c) => {
3077
3051
  var a;
3078
- return ((a = u.track) === null || a === void 0 ? void 0 : a.kind) === "audio" || u.track === null && u.dtmf !== null;
3052
+ return ((a = c.track) === null || a === void 0 ? void 0 : a.kind) === "audio" || c.track === null && c.dtmf !== null;
3079
3053
  });
3080
3054
  if (o)
3081
3055
  try {
3082
3056
  yield o.replaceTrack(e);
3083
- } catch (u) {
3084
- console.error("Failed to replace audio track:", u), this.peerConnection.addTrack(e, this.inputAudioStream);
3057
+ } catch (c) {
3058
+ console.error("Failed to replace audio track:", c), this.peerConnection.addTrack(e, this.inputAudioStream);
3085
3059
  }
3086
3060
  else
3087
3061
  this.peerConnection.addTrack(e, this.inputAudioStream);
@@ -3089,7 +3063,7 @@ class sr {
3089
3063
  });
3090
3064
  }
3091
3065
  initPeerConnectionAndSendOffer() {
3092
- return J(this, void 0, void 0, function* () {
3066
+ return K(this, void 0, void 0, function* () {
3093
3067
  if (yield this.initPeerConnection(), !this.peerConnection) {
3094
3068
  console.error("StreamingClient - initPeerConnectionAndSendOffer: peer connection is not initialized");
3095
3069
  return;
@@ -3106,12 +3080,12 @@ class sr {
3106
3080
  });
3107
3081
  }
3108
3082
  shutdown() {
3109
- return J(this, void 0, void 0, function* () {
3083
+ return K(this, void 0, void 0, function* () {
3110
3084
  var e;
3111
3085
  if (this.showPeerConnectionStatsReport) {
3112
3086
  const n = yield (e = this.peerConnection) === null || e === void 0 ? void 0 : e.getStats();
3113
3087
  if (n) {
3114
- const o = jn(n, this.peerConnectionStatsReportOutputFormat);
3088
+ const o = Vn(n, this.peerConnectionStatsReportOutputFormat);
3115
3089
  o && console.log(o, void 0, 2);
3116
3090
  }
3117
3091
  }
@@ -3136,7 +3110,7 @@ class sr {
3136
3110
  });
3137
3111
  }
3138
3112
  }
3139
- class ar {
3113
+ class sr {
3140
3114
  /**
3141
3115
  * Converts a WebRtcClientToolEvent to a ClientToolEvent
3142
3116
  */
@@ -3152,9 +3126,9 @@ class ar {
3152
3126
  };
3153
3127
  }
3154
3128
  }
3155
- class lr {
3129
+ class ar {
3156
3130
  constructor(e, n) {
3157
- this.reasoning_messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(X.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, this.processWebRtcReasoningTextMessageEvent.bind(this));
3131
+ this.reasoning_messages = [], this.publicEventEmitter = e, this.internalEventEmitter = n, this.internalEventEmitter.addListener(J.WEBRTC_REASONING_TEXT_MESSAGE_RECEIVED, this.processWebRtcReasoningTextMessageEvent.bind(this));
3158
3132
  }
3159
3133
  webRtcTextMessageEventToReasoningStreamEvent(e) {
3160
3134
  return {
@@ -3171,74 +3145,74 @@ class lr {
3171
3145
  id: n.id,
3172
3146
  content: n.content,
3173
3147
  role: n.role
3174
- }, u = this.reasoning_messages.findIndex((a) => a.id === o.id);
3175
- if (u !== -1) {
3176
- const a = this.reasoning_messages[u];
3177
- a.content += o.content, this.reasoning_messages[u] = a;
3148
+ }, c = this.reasoning_messages.findIndex((a) => a.id === o.id);
3149
+ if (c !== -1) {
3150
+ const a = this.reasoning_messages[c];
3151
+ a.content += o.content, this.reasoning_messages[c] = a;
3178
3152
  } else
3179
3153
  this.reasoning_messages.push(o);
3180
3154
  n.endOfThought && this.publicEventEmitter.emit(N.REASONING_HISTORY_UPDATED, this.reasoning_messages);
3181
3155
  }
3182
3156
  }
3183
3157
  var ue = function(t, e, n, o) {
3184
- function u(a) {
3185
- return a instanceof n ? a : new n(function(c) {
3186
- c(a);
3158
+ function c(a) {
3159
+ return a instanceof n ? a : new n(function(u) {
3160
+ u(a);
3187
3161
  });
3188
3162
  }
3189
- return new (n || (n = Promise))(function(a, c) {
3163
+ return new (n || (n = Promise))(function(a, u) {
3190
3164
  function l(_) {
3191
3165
  try {
3192
3166
  p(o.next(_));
3193
3167
  } catch (d) {
3194
- c(d);
3168
+ u(d);
3195
3169
  }
3196
3170
  }
3197
3171
  function m(_) {
3198
3172
  try {
3199
3173
  p(o.throw(_));
3200
3174
  } catch (d) {
3201
- c(d);
3175
+ u(d);
3202
3176
  }
3203
3177
  }
3204
3178
  function p(_) {
3205
- _.done ? a(_.value) : u(_.value).then(l, m);
3179
+ _.done ? a(_.value) : c(_.value).then(l, m);
3206
3180
  }
3207
3181
  p((o = o.apply(t, e || [])).next());
3208
3182
  });
3209
3183
  };
3210
- class cr {
3184
+ class lr {
3211
3185
  constructor(e, n, o) {
3212
- var u, a, c, l, m;
3186
+ var c, a, u, l, m;
3213
3187
  this.inputAudioState = {
3214
3188
  isMuted: !1,
3215
3189
  permissionState: fe.NOT_REQUESTED
3216
3190
  }, this.sessionId = null, this.organizationId = null, this.streamingClient = null, this._isStreaming = !1;
3217
3191
  const p = this.validateClientConfig(e, n, o);
3218
3192
  if (p)
3219
- throw new $(p, j.CLIENT_ERROR_CODE_CONFIGURATION_ERROR, 400);
3220
- this.personaConfig = n, this.clientOptions = o, (!((u = o?.api) === null || u === void 0) && u.baseUrl || !((a = o?.api) === null || a === void 0) && a.apiVersion) && $n(o.api.baseUrl || Wi, o.api.apiVersion || xt), !((l = (c = o?.api) === null || c === void 0 ? void 0 : c.apiGateway) === null || l === void 0) && l.enabled && Gn(o.api.apiGateway), !((m = o?.metrics) === null || m === void 0) && m.disableClientMetrics && Vn(!0), this.publicEventEmitter = new tr(), this.internalEventEmitter = new Qn(), this.apiClient = new Jn(e, o?.apiKey, o?.api), this.messageHistoryClient = new er(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new lr(this.publicEventEmitter, this.internalEventEmitter);
3193
+ throw new $(p, V.CLIENT_ERROR_CODE_CONFIGURATION_ERROR, 400);
3194
+ this.personaConfig = n, this.clientOptions = o, (!((c = o?.api) === null || c === void 0) && c.baseUrl || !((a = o?.api) === null || a === void 0) && a.apiVersion) && Fn(o.api.baseUrl || Wi, o.api.apiVersion || xt), !((l = (u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway) === null || l === void 0) && l.enabled && $n(o.api.apiGateway), !((m = o?.metrics) === null || m === void 0) && m.disableClientMetrics && Gn(!0), this.publicEventEmitter = new er(), this.internalEventEmitter = new Zn(), this.apiClient = new Kn(e, o?.apiKey, o?.api), this.messageHistoryClient = new Qn(this.publicEventEmitter, this.internalEventEmitter), this.reasoningHistoryClient = new ar(this.publicEventEmitter, this.internalEventEmitter);
3221
3195
  }
3222
3196
  decodeJwt(e) {
3223
3197
  try {
3224
- const n = e.split(".")[1], o = Bn.Buffer.from(n, "base64").toString("utf8");
3198
+ const n = e.split(".")[1], o = Mn.Buffer.from(n, "base64").toString("utf8");
3225
3199
  return JSON.parse(o);
3226
3200
  } catch {
3227
3201
  throw new Error("Invalid session token format");
3228
3202
  }
3229
3203
  }
3230
3204
  validateClientConfig(e, n, o) {
3231
- var u, a;
3205
+ var c, a;
3232
3206
  if (!e && !o?.apiKey)
3233
3207
  return "Either sessionToken or apiKey must be provided";
3234
3208
  if (o?.apiKey && e)
3235
3209
  return "Only one of sessionToken or apiKey should be used";
3236
- const c = Hn((u = o?.api) === null || u === void 0 ? void 0 : u.apiGateway);
3237
- if (c)
3238
- return c;
3210
+ const u = jn((c = o?.api) === null || c === void 0 ? void 0 : c.apiGateway);
3211
+ if (u)
3212
+ return u;
3239
3213
  if (e) {
3240
3214
  const l = this.decodeJwt(e);
3241
- this.organizationId = l.accountId, we({
3215
+ this.organizationId = l.accountId, Se({
3242
3216
  organizationId: this.organizationId
3243
3217
  });
3244
3218
  const m = (a = l.type) === null || a === void 0 ? void 0 : a.toLowerCase();
@@ -3267,54 +3241,54 @@ class cr {
3267
3241
  }
3268
3242
  startSession(e) {
3269
3243
  return ue(this, void 0, void 0, function* () {
3270
- var n, o, u, a, c, l, m, p, _, d, S, g;
3271
- const y = this.personaConfig, b = this.buildStartSessionOptionsForClient(), A = yield this.apiClient.startSession(y, b), { sessionId: C, clientConfig: I, engineHost: x, engineProtocol: O, signallingEndpoint: R } = A, { heartbeatIntervalSeconds: G, maxWsReconnectionAttempts: W, iceServers: ae } = I;
3272
- this.sessionId = C, we({
3244
+ var n, o, c, a, u, l, m, p, _, d, y, g;
3245
+ const S = this.personaConfig, C = this.buildStartSessionOptionsForClient(), A = yield this.apiClient.startSession(S, C), { sessionId: I, clientConfig: b, engineHost: T, engineProtocol: D, signallingEndpoint: x } = A, { heartbeatIntervalSeconds: Z, maxWsReconnectionAttempts: H, iceServers: ae } = b;
3246
+ this.sessionId = I, Se({
3273
3247
  sessionId: this.sessionId
3274
3248
  });
3275
3249
  const ne = !((n = this.clientOptions) === null || n === void 0) && n.iceServers ? this.clientOptions.iceServers : ae;
3276
3250
  try {
3277
- this.streamingClient = new sr(C, {
3251
+ this.streamingClient = new or(I, {
3278
3252
  engine: {
3279
- baseUrl: `${O}://${x}`
3253
+ baseUrl: `${D}://${T}`
3280
3254
  },
3281
3255
  signalling: {
3282
- heartbeatIntervalSeconds: G,
3283
- maxWsReconnectionAttempts: W,
3256
+ heartbeatIntervalSeconds: Z,
3257
+ maxWsReconnectionAttempts: H,
3284
3258
  url: {
3285
- baseUrl: x,
3286
- protocol: O,
3287
- signallingPath: R
3259
+ baseUrl: T,
3260
+ protocol: D,
3261
+ signallingPath: x
3288
3262
  }
3289
3263
  },
3290
3264
  iceServers: ne,
3291
3265
  inputAudio: {
3292
3266
  inputAudioState: this.inputAudioState,
3293
3267
  userProvidedMediaStream: !((o = this.clientOptions) === null || o === void 0) && o.disableInputAudio ? void 0 : e,
3294
- audioDeviceId: (u = this.clientOptions) === null || u === void 0 ? void 0 : u.audioDeviceId,
3268
+ audioDeviceId: (c = this.clientOptions) === null || c === void 0 ? void 0 : c.audioDeviceId,
3295
3269
  disableInputAudio: (a = this.clientOptions) === null || a === void 0 ? void 0 : a.disableInputAudio
3296
3270
  },
3297
- apiGateway: (l = (c = this.clientOptions) === null || c === void 0 ? void 0 : c.api) === null || l === void 0 ? void 0 : l.apiGateway,
3271
+ apiGateway: (l = (u = this.clientOptions) === null || u === void 0 ? void 0 : u.api) === null || l === void 0 ? void 0 : l.apiGateway,
3298
3272
  metrics: {
3299
3273
  showPeerConnectionStatsReport: (_ = (p = (m = this.clientOptions) === null || m === void 0 ? void 0 : m.metrics) === null || p === void 0 ? void 0 : p.showPeerConnectionStatsReport) !== null && _ !== void 0 ? _ : !1,
3300
- peerConnectionStatsReportOutputFormat: (g = (S = (d = this.clientOptions) === null || d === void 0 ? void 0 : d.metrics) === null || S === void 0 ? void 0 : S.peerConnectionStatsReportOutputFormat) !== null && g !== void 0 ? g : "console"
3274
+ peerConnectionStatsReportOutputFormat: (g = (y = (d = this.clientOptions) === null || d === void 0 ? void 0 : d.metrics) === null || y === void 0 ? void 0 : y.peerConnectionStatsReportOutputFormat) !== null && g !== void 0 ? g : "console"
3301
3275
  }
3302
3276
  }, this.publicEventEmitter, this.internalEventEmitter);
3303
3277
  } catch (re) {
3304
- throw we({
3278
+ throw Se({
3305
3279
  sessionId: null
3306
- }), new $("Failed to initialize streaming client", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
3280
+ }), new $("Failed to initialize streaming client", V.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
3307
3281
  cause: re instanceof Error ? re.message : String(re),
3308
- sessionId: C
3282
+ sessionId: I
3309
3283
  });
3310
3284
  }
3311
- return C;
3285
+ return I;
3312
3286
  });
3313
3287
  }
3314
3288
  startSessionIfNeeded(e) {
3315
3289
  return ue(this, void 0, void 0, function* () {
3316
3290
  if ((!this.sessionId || !this.streamingClient) && (yield this.startSession(e), !this.sessionId || !this.streamingClient))
3317
- throw new $("Session ID or streaming client is not available after starting session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
3291
+ throw new $("Session ID or streaming client is not available after starting session", V.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
3318
3292
  cause: "Failed to initialize session properly"
3319
3293
  });
3320
3294
  });
@@ -3325,18 +3299,18 @@ class cr {
3325
3299
  if (this._isStreaming)
3326
3300
  throw new Error("Already streaming");
3327
3301
  const o = li();
3328
- return we({
3302
+ return Se({
3329
3303
  attemptCorrelationId: o,
3330
3304
  sessionId: null
3331
3305
  // reset sessionId
3332
- }), ge(se.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT, "1"), !((n = this.clientOptions) === null || n === void 0) && n.disableInputAudio && e && console.warn("AnamClient:Input audio is disabled. User provided audio stream will be ignored."), yield this.startSessionIfNeeded(e), this._isStreaming = !0, new Promise((u) => {
3306
+ }), me(se.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT, "1"), !((n = this.clientOptions) === null || n === void 0) && n.disableInputAudio && e && console.warn("AnamClient:Input audio is disabled. User provided audio stream will be ignored."), yield this.startSessionIfNeeded(e), this._isStreaming = !0, new Promise((c) => {
3333
3307
  var a;
3334
- const c = [];
3308
+ const u = [];
3335
3309
  let l = !1, m = !1;
3336
3310
  this.publicEventEmitter.addListener(N.VIDEO_STREAM_STARTED, (p) => {
3337
- c.push(p), l = !0, m && u(c);
3311
+ u.push(p), l = !0, m && c(u);
3338
3312
  }), this.publicEventEmitter.addListener(N.AUDIO_STREAM_STARTED, (p) => {
3339
- c.push(p), m = !0, l && u(c);
3313
+ u.push(p), m = !0, l && c(u);
3340
3314
  }), (a = this.streamingClient) === null || a === void 0 || a.startConnection();
3341
3315
  });
3342
3316
  });
@@ -3352,16 +3326,16 @@ class cr {
3352
3326
  streamToVideoElement(e, n) {
3353
3327
  return ue(this, void 0, void 0, function* () {
3354
3328
  var o;
3355
- const u = li();
3356
- we({
3357
- attemptCorrelationId: u,
3329
+ const c = li();
3330
+ Se({
3331
+ attemptCorrelationId: c,
3358
3332
  sessionId: null
3359
3333
  // reset sessionId
3360
- }), ge(se.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT, "1"), !((o = this.clientOptions) === null || o === void 0) && o.disableInputAudio && n && console.warn("AnamClient:Input audio is disabled. User provided audio stream will be ignored.");
3334
+ }), me(se.CLIENT_METRIC_MEASUREMENT_SESSION_ATTEMPT, "1"), !((o = this.clientOptions) === null || o === void 0) && o.disableInputAudio && n && console.warn("AnamClient:Input audio is disabled. User provided audio stream will be ignored.");
3361
3335
  try {
3362
3336
  yield this.startSessionIfNeeded(n);
3363
3337
  } catch (a) {
3364
- throw a instanceof $ ? a : new $("Failed to start session", j.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
3338
+ throw a instanceof $ ? a : new $("Failed to start session", V.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
3365
3339
  cause: a instanceof Error ? a.message : String(a),
3366
3340
  sessionId: this.sessionId
3367
3341
  });
@@ -3409,13 +3383,13 @@ class cr {
3409
3383
  const n = this.getActiveSessionId();
3410
3384
  if (!n)
3411
3385
  throw new Error("Failed to send user message: no active session");
3412
- const o = (/* @__PURE__ */ new Date()).toISOString().replace("Z", ""), u = JSON.stringify({
3386
+ const o = (/* @__PURE__ */ new Date()).toISOString().replace("Z", ""), c = JSON.stringify({
3413
3387
  content: e,
3414
3388
  timestamp: o,
3415
3389
  session_id: n,
3416
3390
  message_type: "speech"
3417
3391
  });
3418
- this.sendDataMessage(u);
3392
+ this.sendDataMessage(c);
3419
3393
  }
3420
3394
  interruptPersona() {
3421
3395
  if (!this._isStreaming)
@@ -3433,7 +3407,7 @@ class cr {
3433
3407
  }
3434
3408
  stopStreaming() {
3435
3409
  return ue(this, void 0, void 0, function* () {
3436
- this.streamingClient && (this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.NORMAL), yield this.streamingClient.stopConnection(), this.streamingClient = null, this.sessionId = null, we({
3410
+ this.streamingClient && (this.publicEventEmitter.emit(N.CONNECTION_CLOSED, _e.NORMAL), yield this.streamingClient.stopConnection(), this.streamingClient = null, this.sessionId = null, Se({
3437
3411
  attemptCorrelationId: null,
3438
3412
  sessionId: null,
3439
3413
  organizationId: this.organizationId
@@ -3498,8 +3472,8 @@ class cr {
3498
3472
  return this.sessionId;
3499
3473
  }
3500
3474
  }
3501
- const ur = (t, e) => new cr(t, void 0, e), dr = "https://api.anam.ai";
3502
- function hr(t) {
3475
+ const cr = (t, e) => new lr(t, void 0, e), ur = "https://api.anam.ai";
3476
+ function dr(t) {
3503
3477
  try {
3504
3478
  const e = t.split(".")[1];
3505
3479
  return JSON.parse(atob(e));
@@ -3507,11 +3481,11 @@ function hr(t) {
3507
3481
  return {};
3508
3482
  }
3509
3483
  }
3510
- const Z = K(null), te = K("idle"), Le = K(!1), Ke = K(!1), at = K([]), Pe = K(null), it = K(null), Ot = K(null), kt = K(null), Dt = K(null), ui = K(!1), nt = K(!1);
3511
- function fr(t, e) {
3484
+ const X = Y(null), te = Y("idle"), Le = Y(!1), Ke = Y(!1), at = Y([]), Pe = Y(null), it = Y(null), Ot = Y(null), kt = Y(null), Dt = Y(null), ui = Y(!1), nt = Y(!1);
3485
+ function hr(t, e) {
3512
3486
  return e === 401 || e === 403 ? "This agent is not authorized. Check your agent ID." : e === 404 ? "Agent not found. Check your agent ID." : e === 429 ? "Too many requests. Please wait a moment." : e && e >= 500 ? "Server error. Please try again later." : t instanceof TypeError && t.message === "Failed to fetch" ? "Unable to connect. Check your network connection." : t instanceof Error && t.message.length < 80 ? t.message : "Something went wrong. Please try again.";
3513
3487
  }
3514
- async function pr(t, e) {
3488
+ async function fr(t, e) {
3515
3489
  nt.value = !1;
3516
3490
  try {
3517
3491
  const n = await fetch(`${e}/v1/personas/${t}/widget`);
@@ -3523,11 +3497,11 @@ async function pr(t, e) {
3523
3497
  nt.value = !0;
3524
3498
  }
3525
3499
  }
3526
- async function _r(t, e, n, o) {
3500
+ async function pr(t, e, n, o) {
3527
3501
  if (te.value === "connecting" || te.value === "connected")
3528
3502
  return;
3529
3503
  te.value = "connecting", Pe.value = null;
3530
- let u;
3504
+ let c;
3531
3505
  try {
3532
3506
  let a;
3533
3507
  if (o)
@@ -3539,7 +3513,7 @@ async function _r(t, e, n, o) {
3539
3513
  headers: { "Content-Type": "application/json" },
3540
3514
  body: JSON.stringify({ agentId: t })
3541
3515
  });
3542
- if (u = m.status, !m.ok) {
3516
+ if (c = m.status, !m.ok) {
3543
3517
  const _ = await m.json().catch(() => ({}));
3544
3518
  throw new Error(_.error || `HTTP ${m.status}`);
3545
3519
  }
@@ -3548,54 +3522,54 @@ async function _r(t, e, n, o) {
3548
3522
  hasToken: !!p.sessionToken
3549
3523
  }), a = p.sessionToken;
3550
3524
  }
3551
- const c = ur(a, {
3525
+ const u = cr(a, {
3552
3526
  api: e ? { baseUrl: e } : void 0,
3553
3527
  metrics: { disableClientMetrics: !0 }
3554
3528
  });
3555
- c.addListener(N.CONNECTION_ESTABLISHED, () => {
3529
+ u.addListener(N.CONNECTION_ESTABLISHED, () => {
3556
3530
  console.log("[AnamWidget] Connection established"), te.value = "connected";
3557
- }), c.addListener(N.VIDEO_STREAM_STARTED, () => {
3531
+ }), u.addListener(N.VIDEO_STREAM_STARTED, () => {
3558
3532
  console.log("[AnamWidget] Video stream started"), Le.value = !0;
3559
- }), c.addListener(N.AUDIO_STREAM_STARTED, () => {
3533
+ }), u.addListener(N.AUDIO_STREAM_STARTED, () => {
3560
3534
  console.log("[AnamWidget] Audio stream started");
3561
- }), c.addListener(N.MESSAGE_HISTORY_UPDATED, (m) => {
3535
+ }), u.addListener(N.MESSAGE_HISTORY_UPDATED, (m) => {
3562
3536
  at.value = [...m];
3563
- }), c.addListener(N.CONNECTION_CLOSED, (m, p) => {
3537
+ }), u.addListener(N.CONNECTION_CLOSED, (m, p) => {
3564
3538
  console.log("[AnamWidget] Connection closed:", m, p), te.value = "idle", Le.value = !1, it.value = null;
3565
- }), c.addListener(N.SESSION_READY, (m) => {
3539
+ }), u.addListener(N.SESSION_READY, (m) => {
3566
3540
  console.log("[AnamWidget] Session ready:", m), it.value = m;
3567
- }), Z.value = c;
3568
- const l = await c.stream();
3541
+ }), X.value = u;
3542
+ const l = await u.stream();
3569
3543
  if (n && l.length > 0) {
3570
3544
  const m = l.find((p) => p.getVideoTracks().length > 0);
3571
3545
  m && (n.srcObject = m);
3572
3546
  }
3573
3547
  } catch (a) {
3574
- console.error("[AnamWidget] Failed to start session:", a), Pe.value = fr(a, u), te.value = "error", Z.value = null;
3548
+ console.error("[AnamWidget] Failed to start session:", a), Pe.value = hr(a, c), te.value = "error", X.value = null;
3575
3549
  }
3576
3550
  }
3577
- async function Er() {
3578
- if (Z.value)
3551
+ async function _r() {
3552
+ if (X.value)
3579
3553
  try {
3580
- await Z.value.stopStreaming();
3554
+ await X.value.stopStreaming();
3581
3555
  } catch (t) {
3582
3556
  console.error("[AnamWidget] Failed to stop session:", t);
3583
3557
  }
3584
- Z.value = null, te.value = "idle", Le.value = !1, at.value = [];
3558
+ X.value = null, te.value = "idle", Le.value = !1, at.value = [];
3585
3559
  }
3586
- function mr(t) {
3587
- !Z.value || te.value !== "connected" || Z.value.sendUserMessage(t);
3560
+ function Er(t) {
3561
+ !X.value || te.value !== "connected" || X.value.sendUserMessage(t);
3588
3562
  }
3589
- function gr() {
3590
- Z.value && (Ke.value ? (Z.value.unmuteInputAudio(), Ke.value = !1) : (Z.value.muteInputAudio(), Ke.value = !0));
3563
+ function mr() {
3564
+ X.value && (Ke.value ? (X.value.unmuteInputAudio(), Ke.value = !1) : (X.value.muteInputAudio(), Ke.value = !0));
3591
3565
  }
3592
- function vr() {
3593
- Z.value?.isStreaming() && Z.value.stopStreaming(), Z.value = null, te.value = "idle", Le.value = !1, at.value = [], Pe.value = null, it.value = null, Ot.value = null, kt.value = null, Dt.value = null;
3566
+ function gr() {
3567
+ X.value?.isStreaming() && X.value.stopStreaming(), X.value = null, te.value = "idle", Le.value = !1, at.value = [], Pe.value = null, it.value = null, Ot.value = null, kt.value = null, Dt.value = null;
3594
3568
  }
3595
- function yr(t, e, n) {
3596
- const o = t || (n ? hr(n).personaId : void 0);
3569
+ function vr(t, e, n) {
3570
+ const o = t || (n ? dr(n).personaId : void 0);
3597
3571
  ui.value = !!o || !!n;
3598
- const u = e || dr;
3572
+ const c = e || ur;
3599
3573
  return {
3600
3574
  connectionStatus: te,
3601
3575
  isStreaming: Le,
@@ -3613,21 +3587,21 @@ function yr(t, e, n) {
3613
3587
  nt.value = !0;
3614
3588
  return;
3615
3589
  }
3616
- pr(o, u);
3590
+ fr(o, c);
3617
3591
  },
3618
- startSession: (l) => !o && !n ? (Pe.value = "No agent ID or session token configured", Promise.resolve()) : _r(o || "", u, l, n),
3619
- stopSession: Er,
3620
- sendMessage: mr,
3621
- toggleMute: gr,
3622
- cleanup: vr
3592
+ startSession: (l) => !o && !n ? (Pe.value = "No agent ID or session token configured", Promise.resolve()) : pr(o || "", c, l, n),
3593
+ stopSession: _r,
3594
+ sendMessage: Er,
3595
+ toggleMute: mr,
3596
+ cleanup: gr
3623
3597
  };
3624
3598
  }
3625
- const di = '@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.block{display:block}.flex{display:flex}.inline{display:inline}.flex-shrink{flex-shrink:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.border{border-style:var(--tw-border-style);border-width:1px}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}:host{--anam-background:#fff;--anam-text:#18181b;--anam-trigger-size:80px;--anam-sheet-width:400px;--anam-sheet-height:640px;all:initial;color:var(--anam-text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:DM Sans,system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.5}@media(max-width:640px){:host{--anam-trigger-size:72px;--anam-sheet-width: calc(100vw - 24px) ;--anam-sheet-height: calc(100dvh - 100px) }}.anam-widget{z-index:9999;font-family:inherit}.anam-widget[data-inline=false]{position:fixed}.anam-widget[data-inline=true]{position:relative}.anam-trigger{width:var(--anam-trigger-size);height:var(--anam-trigger-size);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:all .25s cubic-bezier(.4,0,.2,1);display:flex;overflow:hidden;box-shadow:0 2px 8px #00000014,0 8px 24px -4px #0000002e}.anam-trigger:hover{transform:scale(1.06);box-shadow:0 4px 12px #0000001a,0 12px 32px -4px #00000040}.anam-trigger:active{transform:scale(.97)}.anam-trigger img{object-fit:cover;width:100%;height:100%;display:block}.anam-sheet{width:var(--anam-sheet-width);aspect-ratio:16/10;max-height:var(--anam-sheet-height);border-radius:8px;animation:.25s cubic-bezier(.16,1,.3,1) sheetIn;position:relative;overflow:hidden;box-shadow:0 32px 64px -16px #00000040,0 0 0 1px #00000014}.anam-widget[data-inline=true][data-layout=expanded] .anam-sheet{aspect-ratio:3/2;border-radius:8px;width:100%;max-height:none;animation:none}@keyframes sheetIn{0%{opacity:0;transform:translateY(8px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}.anam-video{object-fit:cover;background:#000;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-video[data-hidden=true]{visibility:hidden}.anam-overlay-idle{z-index:2;position:absolute;inset:0}.anam-overlay-idle img{object-fit:cover;width:100%;height:100%;display:block}.anam-cta-pill{-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;cursor:pointer;white-space:nowrap;background:#00000080;border:1px solid #ffffff1a;border-radius:999px;align-items:center;gap:10px;padding:12px 28px;font-family:inherit;font-size:15px;font-weight:500;transition:all .2s;display:flex;position:absolute;bottom:40px;left:50%;transform:translate(-50%)}.anam-cta-pill:hover{background:#000000a6;transform:translate(-50%)scale(1.03)}.anam-cta-pill:active{transform:translate(-50%)scale(.98)}.anam-cta-pill svg{flex-shrink:0}.anam-overlay-unconfigured{z-index:2;background:#111;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-unconfigured span{color:#ffffff59;letter-spacing:-.01em;font-size:14px;font-weight:400}.anam-overlay-loading{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex;position:absolute;inset:0}.anam-overlay-loading span{color:#fffc;letter-spacing:-.01em;font-size:15px;font-weight:400}.anam-overlay-error{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-error-text{color:#fff9;text-align:center;max-width:260px;font-size:14px;line-height:1.5}.anam-overlay-error .anam-retry-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff1f;border:1px solid #ffffff1a;border-radius:999px;padding:10px 24px;font-family:inherit;font-size:14px;font-weight:500;transition:background .15s}.anam-overlay-error .anam-retry-btn:hover{background:#fff3}.anam-spinner{border:2.5px solid #ffffff1f;border-top-color:#fff;border-radius:50%;width:32px;height:32px;animation:.75s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.anam-close-btn{z-index:10;-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#00000073;border:1px solid #ffffff14;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;padding:0;transition:background .15s;display:flex;position:absolute;top:12px;right:12px}.anam-close-btn:hover{background:#0009}.anam-toast{z-index:10;-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;background:#0009;border:1px solid #ffffff0f;border-radius:999px;max-width:85%;padding:10px 22px;font-size:14px;font-weight:400;animation:.25s cubic-bezier(.16,1,.3,1) toastIn;position:absolute;bottom:80px;left:50%;overflow:hidden;transform:translate(-50%)}.anam-toast-out{animation:.4s forwards toastOut}@keyframes toastIn{0%{opacity:0;transform:translate(-50%)translateY(6px)}to{opacity:1;transform:translate(-50%)translateY(0)}}@keyframes toastOut{0%{opacity:1}to{opacity:0}}.anam-control-bar{z-index:10;background:linear-gradient(#0000,#00000040 40%,#0000008c);align-items:center;gap:8px;padding:48px 16px 16px;display:flex;position:absolute;bottom:0;left:0;right:0}.anam-ctl-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff0f;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:background .15s;display:flex}.anam-ctl-btn:hover{background:#ffffff38}.anam-ctl-btn:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-btn-muted{background:#dc26268c;border-color:#dc262633}.anam-ctl-btn-muted:hover{background:#dc2626b3}.anam-ctl-end{background:#dc262699;border-color:#dc262626}.anam-ctl-end:hover{background:#dc2626cc}.anam-ctl-input{-webkit-backdrop-filter:blur(8px);color:#fff;background:#ffffff1a;border:1px solid #ffffff14;border-radius:999px;outline:none;flex:1;min-width:0;padding:11px 18px;font-family:inherit;font-size:14px;transition:background .15s,border-color .15s}.anam-ctl-input::placeholder{color:#fff6}.anam-ctl-input:focus{background:#ffffff26;border-color:#ffffff2e}.anam-ctl-input:disabled{opacity:.35;cursor:not-allowed}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}';
3599
+ const di = '@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.block{display:block}.flex{display:flex}.inline{display:inline}.flex-shrink{flex-shrink:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.border{border-style:var(--tw-border-style);border-width:1px}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}:host{--anam-trigger-size:80px;--anam-sheet-width:400px;--anam-sheet-height:640px;all:initial;color:#18181b;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:DM Sans,system-ui,-apple-system,sans-serif;font-size:15px;line-height:1.5}@media(max-width:640px){:host{--anam-trigger-size:72px;--anam-sheet-width: calc(100vw - 24px) ;--anam-sheet-height: calc(100dvh - 100px) }}.anam-widget{z-index:9999;font-family:inherit}.anam-widget[data-inline=false]{position:fixed}.anam-widget[data-inline=true]{position:relative}.anam-trigger{width:var(--anam-trigger-size);height:var(--anam-trigger-size);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:all .25s cubic-bezier(.4,0,.2,1);display:flex;overflow:hidden;box-shadow:0 2px 8px #00000014,0 8px 24px -4px #0000002e}.anam-trigger:hover{transform:scale(1.06);box-shadow:0 4px 12px #0000001a,0 12px 32px -4px #00000040}.anam-trigger:active{transform:scale(.97)}.anam-trigger img{object-fit:cover;width:100%;height:100%;display:block}.anam-sheet{width:var(--anam-sheet-width);aspect-ratio:16/10;max-height:var(--anam-sheet-height);border-radius:8px;animation:.25s cubic-bezier(.16,1,.3,1) sheetIn;position:relative;overflow:hidden;box-shadow:0 32px 64px -16px #00000040,0 0 0 1px #00000014}.anam-widget[data-inline=true][data-layout=expanded] .anam-sheet{aspect-ratio:3/2;border-radius:8px;width:100%;max-height:none;animation:none}@keyframes sheetIn{0%{opacity:0;transform:translateY(8px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}.anam-video{object-fit:cover;background:#000;width:100%;height:100%;display:block;position:absolute;inset:0}.anam-video[data-hidden=true]{visibility:hidden}.anam-overlay-idle{z-index:2;position:absolute;inset:0}.anam-overlay-idle img{object-fit:cover;width:100%;height:100%;display:block}.anam-cta-pill{-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;cursor:pointer;white-space:nowrap;background:#00000080;border:1px solid #ffffff1a;border-radius:999px;align-items:center;gap:10px;padding:12px 28px;font-family:inherit;font-size:15px;font-weight:500;transition:all .2s;display:flex;position:absolute;bottom:40px;left:50%;transform:translate(-50%)}.anam-cta-pill:hover{background:#000000a6;transform:translate(-50%)scale(1.03)}.anam-cta-pill:active{transform:translate(-50%)scale(.98)}.anam-cta-pill svg{flex-shrink:0}.anam-overlay-unconfigured{z-index:2;background:#111;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-unconfigured span{color:#ffffff59;letter-spacing:-.01em;font-size:14px;font-weight:400}.anam-overlay-loading{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:20px;display:flex;position:absolute;inset:0}.anam-overlay-loading span{color:#fffc;letter-spacing:-.01em;font-size:15px;font-weight:400}.anam-overlay-error{z-index:3;background:#000;flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex;position:absolute;inset:0}.anam-overlay-error-text{color:#fff9;text-align:center;max-width:260px;font-size:14px;line-height:1.5}.anam-overlay-error .anam-retry-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff1f;border:1px solid #ffffff1a;border-radius:999px;padding:10px 24px;font-family:inherit;font-size:14px;font-weight:500;transition:background .15s}.anam-overlay-error .anam-retry-btn:hover{background:#fff3}.anam-spinner{border:2.5px solid #ffffff1f;border-top-color:#fff;border-radius:50%;width:32px;height:32px;animation:.75s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.anam-close-btn{z-index:10;-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#00000073;border:1px solid #ffffff14;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;padding:0;transition:background .15s;display:flex;position:absolute;top:12px;right:12px}.anam-close-btn:hover{background:#0009}.anam-toast{z-index:10;-webkit-backdrop-filter:blur(16px);color:#fff;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;background:#0009;border:1px solid #ffffff0f;border-radius:999px;max-width:85%;padding:10px 22px;font-size:14px;font-weight:400;animation:.25s cubic-bezier(.16,1,.3,1) toastIn;position:absolute;bottom:80px;left:50%;overflow:hidden;transform:translate(-50%)}.anam-toast-out{animation:.4s forwards toastOut}@keyframes toastIn{0%{opacity:0;transform:translate(-50%)translateY(6px)}to{opacity:1;transform:translate(-50%)translateY(0)}}@keyframes toastOut{0%{opacity:1}to{opacity:0}}.anam-control-bar{z-index:10;background:linear-gradient(#0000,#00000040 40%,#0000008c);align-items:center;gap:8px;padding:48px 16px 16px;display:flex;position:absolute;bottom:0;left:0;right:0}.anam-ctl-btn{-webkit-backdrop-filter:blur(8px);color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff0f;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:background .15s;display:flex}.anam-ctl-btn:hover{background:#ffffff38}.anam-ctl-btn:disabled{opacity:.35;cursor:not-allowed}.anam-ctl-btn-muted{background:#dc26268c;border-color:#dc262633}.anam-ctl-btn-muted:hover{background:#dc2626b3}.anam-ctl-end{background:#dc262699;border-color:#dc262626}.anam-ctl-end:hover{background:#dc2626cc}.anam-ctl-input{-webkit-backdrop-filter:blur(8px);color:#fff;background:#ffffff1a;border:1px solid #ffffff14;border-radius:999px;outline:none;flex:1;min-width:0;padding:11px 18px;font-family:inherit;font-size:14px;transition:background .15s,border-color .15s}.anam-ctl-input::placeholder{color:#fff6}.anam-ctl-input:focus{background:#ffffff26;border-color:#ffffff2e}.anam-ctl-input:disabled{opacity:.35;cursor:not-allowed}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}';
3626
3600
  function wt(t, e) {
3627
3601
  const n = { ...t };
3628
3602
  for (const o of Object.keys(e)) {
3629
- const u = e[o];
3630
- u !== void 0 && (u !== null && typeof u == "object" && !Array.isArray(u) && typeof n[o] == "object" && n[o] !== null && !Array.isArray(n[o]) ? n[o] = wt(n[o], u) : n[o] = u);
3603
+ const c = e[o];
3604
+ c !== void 0 && (c !== null && typeof c == "object" && !Array.isArray(c) && typeof n[o] == "object" && n[o] !== null && !Array.isArray(n[o]) ? n[o] = wt(n[o], c) : n[o] = c);
3631
3605
  }
3632
3606
  return n;
3633
3607
  }
@@ -3635,58 +3609,58 @@ function ze(t) {
3635
3609
  if (t !== void 0)
3636
3610
  return t === "true";
3637
3611
  }
3638
- function Sr(t) {
3612
+ function yr(t) {
3639
3613
  const e = {}, n = ze(t.inline);
3640
3614
  n !== void 0 && (e.inline = n), t.layout && (e.layout = t.layout), t.position && (e.position = t.position);
3641
3615
  const o = ze(t["ui-mute-button"]);
3642
3616
  o !== void 0 && (e.showMuteButton = o);
3643
- const u = ze(t["ui-text-input"]);
3644
- u !== void 0 && (e.showTextInput = u);
3617
+ const c = ze(t["ui-text-input"]);
3618
+ c !== void 0 && (e.showTextInput = c);
3645
3619
  const a = ze(t["ui-captions"]);
3646
3620
  return a !== void 0 && (e.showCaptions = a), e;
3647
3621
  }
3648
- const wr = () => /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2.5", "stroke-linecap": "round", children: /* @__PURE__ */ w("path", { d: "M18 6L6 18M6 6l12 12" }) }), Cr = () => /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ w("path", { d: "M8 5.14v13.72a1 1 0 0 0 1.5.86l11.04-6.86a1 1 0 0 0 0-1.72L9.5 4.28A1 1 0 0 0 8 5.14Z" }) }), Ir = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3622
+ const Sr = () => /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2.5", "stroke-linecap": "round", children: /* @__PURE__ */ w("path", { d: "M18 6L6 18M6 6l12 12" }) }), wr = () => /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ w("path", { d: "M8 5.14v13.72a1 1 0 0 0 1.5.86l11.04-6.86a1 1 0 0 0 0-1.72L9.5 4.28A1 1 0 0 0 8 5.14Z" }) }), Cr = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3649
3623
  /* @__PURE__ */ w("path", { d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" }),
3650
3624
  /* @__PURE__ */ w("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
3651
3625
  /* @__PURE__ */ w("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
3652
- ] }), br = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3626
+ ] }), Ir = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3653
3627
  /* @__PURE__ */ w("line", { x1: "1", y1: "1", x2: "23", y2: "23" }),
3654
3628
  /* @__PURE__ */ w("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V5a3 3 0 0 0-5.94-.6" }),
3655
3629
  /* @__PURE__ */ w("path", { d: "M17 16.95A7 7 0 0 1 5 12v-2m14 0v2c0 .87-.16 1.71-.46 2.49" }),
3656
3630
  /* @__PURE__ */ w("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
3657
- ] }), Ar = () => /* @__PURE__ */ w("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3631
+ ] }), br = () => /* @__PURE__ */ w("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3658
3632
  /* @__PURE__ */ w("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
3659
3633
  /* @__PURE__ */ w("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
3660
- ] }), Tr = () => /* @__PURE__ */ w("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3634
+ ] }), Ar = () => /* @__PURE__ */ w("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", children: [
3661
3635
  /* @__PURE__ */ w("path", { d: "M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 2.59 3.4z" }),
3662
3636
  /* @__PURE__ */ w("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
3663
3637
  ] }), Ct = () => /* @__PURE__ */ w("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", style: { opacity: 0.3 }, children: [
3664
3638
  /* @__PURE__ */ w("circle", { cx: "24", cy: "18", r: "8", stroke: "white", "stroke-width": "2", fill: "none" }),
3665
3639
  /* @__PURE__ */ w("path", { d: "M8 42c0-8.837 7.163-16 16-16s16 7.163 16 16", stroke: "white", "stroke-width": "2", fill: "none" })
3666
3640
  ] });
3667
- function Rr({
3641
+ function Tr({
3668
3642
  config: t,
3669
3643
  session: e,
3670
3644
  videoRef: n,
3671
3645
  avatarSrc: o,
3672
- displayCta: u,
3646
+ displayCta: c,
3673
3647
  onCollapse: a
3674
3648
  }) {
3675
- const c = Ze(null), [l, m] = qe(""), [p, _] = qe(null), [d, S] = qe(!1), g = Ze(null), y = e.connectionStatus.value === "connected", b = e.connectionStatus.value === "connecting", A = e.connectionStatus.value === "error", C = e.isStreaming.value, I = !b && !y && !A, x = je(async () => {
3649
+ const u = Ze(null), [l, m] = qe(""), [p, _] = qe(null), [d, y] = qe(!1), g = Ze(null), S = e.connectionStatus.value === "connected", C = e.connectionStatus.value === "connecting", A = e.connectionStatus.value === "error", I = e.isStreaming.value, b = !C && !S && !A, T = je(async () => {
3676
3650
  n.current && await e.startSession(n.current);
3677
- }, [e.startSession]), O = je(async () => {
3651
+ }, [e.startSession]), D = je(async () => {
3678
3652
  await e.stopSession();
3679
- }, [e.stopSession]), R = je(() => {
3653
+ }, [e.stopSession]), x = je(() => {
3680
3654
  if (!l.trim()) return;
3681
- const W = l.trim();
3682
- e.sendMessage(W), m(""), c.current?.focus(), g.current && clearTimeout(g.current), S(!1), _(W), g.current = window.setTimeout(() => {
3683
- S(!0), g.current = window.setTimeout(() => {
3684
- _(null), S(!1);
3655
+ const H = l.trim();
3656
+ e.sendMessage(H), m(""), u.current?.focus(), g.current && clearTimeout(g.current), y(!1), _(H), g.current = window.setTimeout(() => {
3657
+ y(!0), g.current = window.setTimeout(() => {
3658
+ _(null), y(!1);
3685
3659
  }, 400);
3686
3660
  }, 2600);
3687
- }, [l]), G = je((W) => {
3688
- W.key === "Enter" && !W.shiftKey && (W.preventDefault(), R());
3689
- }, [R]);
3661
+ }, [l]), Z = je((H) => {
3662
+ H.key === "Enter" && !H.shiftKey && (H.preventDefault(), x());
3663
+ }, [x]);
3690
3664
  return gt(() => () => {
3691
3665
  g.current && clearTimeout(g.current);
3692
3666
  }, []), /* @__PURE__ */ w("div", { class: "anam-sheet", children: [
@@ -3697,16 +3671,16 @@ function Rr({
3697
3671
  class: "anam-video",
3698
3672
  autoplay: !0,
3699
3673
  playsinline: !0,
3700
- "data-hidden": C ? void 0 : "true"
3674
+ "data-hidden": I ? void 0 : "true"
3701
3675
  }
3702
3676
  ),
3703
- I && (e.isConfigured.value ? (
3677
+ b && (e.isConfigured.value ? (
3704
3678
  /* Has agent-id: show avatar or placeholder + CTA pill */
3705
3679
  /* @__PURE__ */ w("div", { class: "anam-overlay-idle", children: [
3706
3680
  o ? /* @__PURE__ */ w("img", { src: o, alt: "Avatar" }) : /* @__PURE__ */ w(Ct, {}),
3707
- /* @__PURE__ */ w("button", { class: "anam-cta-pill", onClick: x, children: [
3708
- /* @__PURE__ */ w(Cr, {}),
3709
- u
3681
+ /* @__PURE__ */ w("button", { class: "anam-cta-pill", onClick: T, children: [
3682
+ /* @__PURE__ */ w(wr, {}),
3683
+ c
3710
3684
  ] })
3711
3685
  ] })
3712
3686
  ) : (
@@ -3716,16 +3690,16 @@ function Rr({
3716
3690
  /* @__PURE__ */ w("span", { children: "Agent not configured" })
3717
3691
  ] })
3718
3692
  )),
3719
- b && /* @__PURE__ */ w("div", { class: "anam-overlay-loading", children: [
3693
+ C && /* @__PURE__ */ w("div", { class: "anam-overlay-loading", children: [
3720
3694
  /* @__PURE__ */ w("span", { class: "anam-spinner" }),
3721
3695
  /* @__PURE__ */ w("span", { children: "Starting your conversation..." })
3722
3696
  ] }),
3723
3697
  A && /* @__PURE__ */ w("div", { class: "anam-overlay-error", children: [
3724
3698
  /* @__PURE__ */ w("div", { class: "anam-overlay-error-text", children: e.error.value || "Something went wrong" }),
3725
- /* @__PURE__ */ w("button", { class: "anam-retry-btn", onClick: x, children: "Try Again" })
3699
+ /* @__PURE__ */ w("button", { class: "anam-retry-btn", onClick: T, children: "Try Again" })
3726
3700
  ] }),
3727
- (y || C) && /* @__PURE__ */ w(oe, { children: [
3728
- a && /* @__PURE__ */ w("button", { class: "anam-close-btn", onClick: a, "aria-label": "Close", children: /* @__PURE__ */ w(wr, {}) }),
3701
+ (S || I) && /* @__PURE__ */ w(oe, { children: [
3702
+ a && /* @__PURE__ */ w("button", { class: "anam-close-btn", onClick: a, "aria-label": "Close", children: /* @__PURE__ */ w(Sr, {}) }),
3729
3703
  p && /* @__PURE__ */ w("div", { class: `anam-toast ${d ? "anam-toast-out" : ""}`, children: p }),
3730
3704
  /* @__PURE__ */ w("div", { class: "anam-control-bar", children: [
3731
3705
  t.showMuteButton && /* @__PURE__ */ w(
@@ -3734,31 +3708,31 @@ function Rr({
3734
3708
  class: `anam-ctl-btn ${e.isMuted.value ? "anam-ctl-btn-muted" : ""}`,
3735
3709
  onClick: () => e.toggleMute(),
3736
3710
  "aria-label": e.isMuted.value ? "Unmute" : "Mute",
3737
- children: e.isMuted.value ? /* @__PURE__ */ w(br, {}) : /* @__PURE__ */ w(Ir, {})
3711
+ children: e.isMuted.value ? /* @__PURE__ */ w(Ir, {}) : /* @__PURE__ */ w(Cr, {})
3738
3712
  }
3739
3713
  ),
3740
3714
  t.showTextInput && /* @__PURE__ */ w(oe, { children: [
3741
3715
  /* @__PURE__ */ w(
3742
3716
  "input",
3743
3717
  {
3744
- ref: c,
3718
+ ref: u,
3745
3719
  type: "text",
3746
3720
  class: "anam-ctl-input",
3747
- placeholder: t.textContents.placeholder,
3721
+ placeholder: "Type a message...",
3748
3722
  value: l,
3749
- onInput: (W) => m(W.target.value),
3750
- onKeyDown: G,
3751
- disabled: !y
3723
+ onInput: (H) => m(H.target.value),
3724
+ onKeyDown: Z,
3725
+ disabled: !S
3752
3726
  }
3753
3727
  ),
3754
3728
  /* @__PURE__ */ w(
3755
3729
  "button",
3756
3730
  {
3757
3731
  class: "anam-ctl-btn",
3758
- onClick: R,
3759
- disabled: !y || !l.trim(),
3732
+ onClick: x,
3733
+ disabled: !S || !l.trim(),
3760
3734
  "aria-label": "Send message",
3761
- children: /* @__PURE__ */ w(Ar, {})
3735
+ children: /* @__PURE__ */ w(br, {})
3762
3736
  }
3763
3737
  )
3764
3738
  ] }),
@@ -3766,74 +3740,71 @@ function Rr({
3766
3740
  "button",
3767
3741
  {
3768
3742
  class: "anam-ctl-btn anam-ctl-end",
3769
- onClick: O,
3743
+ onClick: D,
3770
3744
  "aria-label": "End call",
3771
- children: /* @__PURE__ */ w(Tr, {})
3745
+ children: /* @__PURE__ */ w(Ar, {})
3772
3746
  }
3773
3747
  )
3774
3748
  ] })
3775
3749
  ] })
3776
3750
  ] });
3777
3751
  }
3778
- function Nr(t) {
3752
+ function Rr(t) {
3779
3753
  const e = Ze(null), n = Vi(!1);
3780
3754
  t["agent-id"] && t["session-token"] && console.warn("[AnamWidget] Both agent-id and session-token are set. Use one or the other. Ignoring agent-id.");
3781
- const o = t["session-token"] ? void 0 : t["agent-id"], u = yr(o, t["api-base-url"], t["session-token"]), a = me(
3782
- () => Sr(t),
3755
+ const o = t["session-token"] ? void 0 : t["agent-id"], c = vr(o, t["api-base-url"], t["session-token"]), a = Ie(
3756
+ () => yr(t),
3783
3757
  [t.inline, t.layout, t.position, t["ui-mute-button"], t["ui-text-input"], t["ui-captions"]]
3784
- ), c = me(() => {
3785
- const O = u.serverConfig.value, R = On(O), G = wt(wt({ ...ri }, R), a);
3786
- return G.layout === "orb" && (G.inline = !1), G;
3787
- }, [u.serverConfig.value, a]);
3758
+ ), u = Ie(() => {
3759
+ const b = c.serverConfig.value, T = wt(wt({ ...ri }, b ?? {}), a);
3760
+ return T.layout === "orb" && (T.inline = !1), T;
3761
+ }, [c.serverConfig.value, a]);
3788
3762
  gt(() => {
3789
- u.fetchWidgetConfig();
3763
+ c.fetchWidgetConfig();
3790
3764
  }, [o, t["api-base-url"], t["session-token"]]);
3791
- const l = t["avatar-url"] || u.avatarThumbnailUrl.value || null, p = t["agent-name"] || u.personaName.value, _ = c.textContents.callToAction === ri.textContents.callToAction && p ? `Talk to ${p}` : c.textContents.callToAction, d = me(
3792
- () => `--anam-background: ${c.styles.backgroundColor}; --anam-text: ${c.styles.textColor};`,
3793
- [c.styles.backgroundColor, c.styles.textColor]
3794
- ), S = me(() => {
3795
- if (c.inline) return "";
3796
- const O = kn(c.position);
3797
- return Object.entries(O).map(([R, G]) => `${R}: ${G}`).join("; ");
3798
- }, [c.inline, c.position]), g = [d, S].filter(Boolean).join("; "), y = Ze(!1), b = () => {
3765
+ const l = t["avatar-url"] || c.avatarThumbnailUrl.value || null, p = t["agent-name"] || c.personaName.value, _ = u.callToAction === ri.callToAction && p ? `Talk to ${p}` : u.callToAction, d = Ie(() => {
3766
+ if (u.inline) return "";
3767
+ const b = On(u.position);
3768
+ return Object.entries(b).map(([T, D]) => `${T}: ${D}`).join("; ");
3769
+ }, [u.inline, u.position]), y = Ze(!1), g = () => {
3799
3770
  n.value = !0, y.current = !1, setTimeout(() => {
3800
- e.current && u.startSession(e.current);
3771
+ e.current && c.startSession(e.current);
3801
3772
  }, 50);
3802
- }, A = async () => {
3803
- u.connectionStatus.value !== "idle" && await u.stopSession(), y.current = !1, n.value = !1;
3804
- }, C = c.layout === "orb", I = u.connectionStatus.value;
3805
- (I === "connecting" || I === "connected") && (y.current = !0), gt(() => {
3806
- C && n.value && I === "idle" && y.current && (y.current = !1, n.value = !1);
3807
- }, [I]);
3808
- const x = C ? n.value : !0;
3809
- return u.isReady.value ? /* @__PURE__ */ w(oe, { children: [
3773
+ }, S = async () => {
3774
+ c.connectionStatus.value !== "idle" && await c.stopSession(), y.current = !1, n.value = !1;
3775
+ }, C = u.layout === "orb", A = c.connectionStatus.value;
3776
+ (A === "connecting" || A === "connected") && (y.current = !0), gt(() => {
3777
+ C && n.value && A === "idle" && y.current && (y.current = !1, n.value = !1);
3778
+ }, [A]);
3779
+ const I = C ? n.value : !0;
3780
+ return c.isReady.value ? /* @__PURE__ */ w(oe, { children: [
3810
3781
  /* @__PURE__ */ w("style", { children: di }),
3811
3782
  /* @__PURE__ */ w(
3812
3783
  "div",
3813
3784
  {
3814
3785
  class: "anam-widget",
3815
- "data-inline": c.inline ? "true" : "false",
3816
- "data-layout": c.layout,
3817
- style: g,
3786
+ "data-inline": u.inline ? "true" : "false",
3787
+ "data-layout": u.layout,
3788
+ style: d,
3818
3789
  children: [
3819
3790
  C && !n.value && /* @__PURE__ */ w(
3820
3791
  "button",
3821
3792
  {
3822
3793
  class: "anam-trigger",
3823
- onClick: b,
3794
+ onClick: g,
3824
3795
  "aria-label": _,
3825
3796
  children: l ? /* @__PURE__ */ w("img", { src: l, alt: "Avatar" }) : /* @__PURE__ */ w(Ct, {})
3826
3797
  }
3827
3798
  ),
3828
- x && /* @__PURE__ */ w(
3829
- Rr,
3799
+ I && /* @__PURE__ */ w(
3800
+ Tr,
3830
3801
  {
3831
- config: c,
3832
- session: u,
3802
+ config: u,
3803
+ session: c,
3833
3804
  videoRef: e,
3834
3805
  avatarSrc: l,
3835
3806
  displayCta: _,
3836
- onCollapse: C ? A : null
3807
+ onCollapse: C ? S : null
3837
3808
  }
3838
3809
  )
3839
3810
  ]
@@ -3841,7 +3812,7 @@ function Nr(t) {
3841
3812
  )
3842
3813
  ] }) : /* @__PURE__ */ w("style", { children: di });
3843
3814
  }
3844
- const xr = [
3815
+ const Nr = [
3845
3816
  "agent-id",
3846
3817
  // Persona ID -- required for session streaming + server config fetch
3847
3818
  "api-base-url",
@@ -3864,7 +3835,7 @@ const xr = [
3864
3835
  // Override avatar thumbnail (Lab preview)
3865
3836
  "agent-name"
3866
3837
  // Override persona name for CTA (Lab preview)
3867
- ], kr = {
3838
+ ], Or = {
3868
3839
  SESSION_STARTED: "anam-agent:session-started",
3869
3840
  SESSION_ENDED: "anam-agent:session-ended",
3870
3841
  MESSAGE_RECEIVED: "anam-agent:message-received",
@@ -3876,14 +3847,13 @@ const xr = [
3876
3847
  MIC_UNMUTED: "anam-agent:mic-unmuted"
3877
3848
  };
3878
3849
  function hi(t = "anam-agent") {
3879
- _n(Nr, t, [...xr], {
3850
+ _n(Rr, t, [...Nr], {
3880
3851
  shadow: !0
3881
3852
  });
3882
3853
  }
3883
3854
  typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => hi()) : hi());
3884
3855
  export {
3885
3856
  ri as DefaultConfig,
3886
- kr as WidgetEventNames,
3887
- On as normalizeConfig,
3857
+ Or as WidgetEventNames,
3888
3858
  hi as registerWidget
3889
3859
  };