@anam-ai/agent-widget 0.1.0-alpha.12 → 0.1.0-alpha.13
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 +250 -237
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Fe, k, fi, pi, Ee, Ht, _i, Ei, mi, It, _t, Et,
|
|
1
|
+
var Fe, k, 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;
|
|
2
2
|
function ie(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
@@ -16,7 +16,7 @@ function xe(t, e, n, o, c) {
|
|
|
16
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
17
|
return c == null && k.vnode != null && k.vnode(a), a;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function _e(t) {
|
|
20
20
|
return t.children;
|
|
21
21
|
}
|
|
22
22
|
function Oe(t, e) {
|
|
@@ -46,12 +46,12 @@ function Je() {
|
|
|
46
46
|
}
|
|
47
47
|
function yi(t, e, n, o, c, a, u, l, m, p, _) {
|
|
48
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 ?
|
|
49
|
+
for (m = cn(n, e, b, m, T), d = 0; d < T; d++) (g = n.__k[d]) != null && (y = g.__i == -1 ? Me : b[g.__i] || Me, 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
50
|
return n.__e = C, m;
|
|
51
51
|
}
|
|
52
52
|
function cn(t, e, n, o, c) {
|
|
53
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(
|
|
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(_e, { 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
|
}
|
|
@@ -78,7 +78,7 @@ function un(t, e, n, o) {
|
|
|
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
|
|
81
|
+
function Ge(t, e, n, o, c) {
|
|
82
82
|
var a, u;
|
|
83
83
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
84
84
|
else {
|
|
@@ -107,15 +107,15 @@ function qt(t) {
|
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
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,
|
|
110
|
+
var _, d, y, g, S, C, A, I, b, T, D, x, Z, H, se, ne, re, Q = e.type;
|
|
111
111
|
if (e.constructor !== void 0) return null;
|
|
112
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
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
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(
|
|
118
|
-
|
|
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(ae) {
|
|
118
|
+
ae && (ae.__ = e);
|
|
119
119
|
}), x = 0; x < d._sb.length; x++) d.__h.push(d._sb[x]);
|
|
120
120
|
d._sb = [], d.__h.length && u.push(d);
|
|
121
121
|
break e;
|
|
@@ -125,22 +125,22 @@ function At(t, e, n, o, c, a, u, l, m, p) {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
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),
|
|
128
|
+
for (d.state = d.__s, d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), se = 0; se < d._sb.length; se++) d.__h.push(d._sb[se]);
|
|
129
129
|
d._sb = [];
|
|
130
130
|
} else do
|
|
131
131
|
d.__d = !1, Z && Z(e), _ = d.render(d.props, d.state, d.context), d.state = d.__s;
|
|
132
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 ===
|
|
134
|
-
} catch (
|
|
135
|
-
if (e.__v = null, m || a != null) if (
|
|
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 === _e && _.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
|
+
} catch (ae) {
|
|
135
|
+
if (e.__v = null, m || a != null) if (ae.then) {
|
|
136
136
|
for (e.__u |= m ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
137
137
|
a[a.indexOf(l)] = null, e.__e = l;
|
|
138
138
|
} else {
|
|
139
139
|
for (re = a.length; re--; ) bt(a[re]);
|
|
140
140
|
mt(e);
|
|
141
141
|
}
|
|
142
|
-
else e.__e = n.__e, e.__k = n.__k,
|
|
143
|
-
k.__e(
|
|
142
|
+
else e.__e = n.__e, e.__k = n.__k, ae.then || mt(e);
|
|
143
|
+
k.__e(ae, e, n);
|
|
144
144
|
}
|
|
145
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
146
|
return (_ = k.diffed) && _(e), 128 & e.__u ? void 0 : l;
|
|
@@ -164,7 +164,7 @@ 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
166
|
function dn(t, e, n, o, c, a, u, l, m) {
|
|
167
|
-
var p, _, d, y, g, S, C, A = n.props ||
|
|
167
|
+
var p, _, d, y, g, S, C, A = n.props || Me, I = e.props, b = e.type;
|
|
168
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
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;
|
|
@@ -182,13 +182,13 @@ function dn(t, e, n, o, c, a, u, l, m) {
|
|
|
182
182
|
if (p == "dangerouslySetInnerHTML") d = g;
|
|
183
183
|
else if (!(p in I)) {
|
|
184
184
|
if (p == "value" && "defaultValue" in I || p == "checked" && "defaultChecked" in I) continue;
|
|
185
|
-
|
|
185
|
+
Ge(t, p, null, g, c);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
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 ||
|
|
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 || Ge(t, p, g, A[p], c);
|
|
189
189
|
if (_) l || d && (_.__html == d.__html || _.__html == t.innerHTML) || (t.innerHTML = _.__html), e.__k = [];
|
|
190
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]) &&
|
|
191
|
+
l || (p = "value", b == "progress" && S == null ? t.removeAttribute("value") : S != null && (S !== t[p] || b == "progress" && !S || b == "option" && S != A[p]) && Ge(t, p, S, A[p], c), p = "checked", C != null && C != t[p] && Ge(t, p, C, A[p], c));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
@@ -220,7 +220,7 @@ function hn(t, e, n) {
|
|
|
220
220
|
}
|
|
221
221
|
function ot(t, e, n) {
|
|
222
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(
|
|
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(_e, null, [t]), c || Me, Me, 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);
|
|
@@ -244,7 +244,7 @@ Fe = gi.slice, k = { __e: function(t, e, n, o) {
|
|
|
244
244
|
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = ie({}, this.state), typeof t == "function" && (t = t(ie({}, n), this.props)), t && ie(n, t), t != null && this.__v && (e && this._sb.push(e), Wt(this));
|
|
245
245
|
}, Oe.prototype.forceUpdate = function(t) {
|
|
246
246
|
this.__v && (this.__e = !0, t && this.__h.push(t), Wt(this));
|
|
247
|
-
}, Oe.prototype.render =
|
|
247
|
+
}, Oe.prototype.render = _e, Ee = [], _i = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ei = function(t, e) {
|
|
248
248
|
return t.__v.__b - e.__v.__b;
|
|
249
249
|
}, Je.__r = 0, mi = /(PointerCapture)$|Capture$/i, It = 0, _t = qt(!1), Et = qt(!0);
|
|
250
250
|
function Xe() {
|
|
@@ -307,7 +307,7 @@ function vn() {
|
|
|
307
307
|
}
|
|
308
308
|
function Yt(t, e) {
|
|
309
309
|
var n = this, o = t.useFragment, c = Ti(t, pn);
|
|
310
|
-
return Ce(o ?
|
|
310
|
+
return Ce(o ? _e : "slot", Xe({}, c, { ref: function(a) {
|
|
311
311
|
a ? (n.ref = a, n._listener || (n._listener = function(u) {
|
|
312
312
|
u.stopPropagation(), u.detail.context = e;
|
|
313
313
|
}, a.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
|
|
@@ -334,17 +334,17 @@ function w(t, e, n, o, c, a) {
|
|
|
334
334
|
if (typeof t == "function" && (u = t.defaultProps)) for (l in u) m[l] === void 0 && (m[l] = u[l]);
|
|
335
335
|
return k.vnode && k.vnode(p), p;
|
|
336
336
|
}
|
|
337
|
-
var
|
|
337
|
+
var Ue, P, dt, Kt, Le = 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
|
-
F.__h && F.__h(P, t,
|
|
339
|
+
F.__h && F.__h(P, t, Le || e), Le = 0;
|
|
340
340
|
var n = P.__H || (P.__H = { __: [], __h: [] });
|
|
341
341
|
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
342
342
|
}
|
|
343
343
|
function qe(t) {
|
|
344
|
-
return
|
|
344
|
+
return Le = 1, Sn(ki, t);
|
|
345
345
|
}
|
|
346
346
|
function Sn(t, e, n) {
|
|
347
|
-
var o = Rt(
|
|
347
|
+
var o = Rt(Ue++, 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({}));
|
|
@@ -378,20 +378,20 @@ function Sn(t, e, n) {
|
|
|
378
378
|
return o.__N || o.__;
|
|
379
379
|
}
|
|
380
380
|
function gt(t, e) {
|
|
381
|
-
var n = Rt(
|
|
381
|
+
var n = Rt(Ue++, 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
|
|
385
|
+
return Le = 5, Ie(function() {
|
|
386
386
|
return { current: t };
|
|
387
387
|
}, []);
|
|
388
388
|
}
|
|
389
389
|
function Ie(t, e) {
|
|
390
|
-
var n = Rt(
|
|
390
|
+
var n = Rt(Ue++, 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
|
|
394
|
+
return Le = 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),
|
|
410
|
+
Xt && Xt(t), Ue = 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 = [],
|
|
414
|
+
})) : (e.__h.forEach(Ye), e.__h.forEach(vt), e.__h = [], Ue = 0)), dt = P;
|
|
415
415
|
}, F.diffed = function(t) {
|
|
416
416
|
Zt && Zt(t);
|
|
417
417
|
var e = t.__c;
|
|
@@ -466,14 +466,14 @@ function ki(t, e) {
|
|
|
466
466
|
}
|
|
467
467
|
var In = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
468
468
|
function st() {
|
|
469
|
-
if (
|
|
470
|
-
|
|
469
|
+
if (fe > 1)
|
|
470
|
+
fe--;
|
|
471
471
|
else {
|
|
472
472
|
for (var t, e = !1; ke !== void 0; ) {
|
|
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) &&
|
|
476
|
+
if (n.o = void 0, n.f &= -3, !(8 & n.f) && Ui(n)) try {
|
|
477
477
|
n.c();
|
|
478
478
|
} catch (c) {
|
|
479
479
|
e || (t = c, e = !0);
|
|
@@ -481,12 +481,12 @@ function st() {
|
|
|
481
481
|
n = o;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
if (yt = 0,
|
|
484
|
+
if (yt = 0, fe--, e) throw t;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
function bn(t) {
|
|
488
|
-
if (
|
|
489
|
-
|
|
488
|
+
if (fe > 0) return t();
|
|
489
|
+
fe++;
|
|
490
490
|
try {
|
|
491
491
|
return t();
|
|
492
492
|
} finally {
|
|
@@ -503,8 +503,8 @@ function Di(t) {
|
|
|
503
503
|
O = e;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
var ke = void 0,
|
|
507
|
-
function
|
|
506
|
+
var ke = void 0, fe = 0, yt = 0, Qe = 0;
|
|
507
|
+
function Mi(t) {
|
|
508
508
|
if (O !== void 0) {
|
|
509
509
|
var e = t.n;
|
|
510
510
|
if (e === void 0 || e.t !== O)
|
|
@@ -568,12 +568,12 @@ j.prototype.peek = function() {
|
|
|
568
568
|
}
|
|
569
569
|
};
|
|
570
570
|
Object.defineProperty(j.prototype, "value", { get: function() {
|
|
571
|
-
var t =
|
|
571
|
+
var t = Mi(this);
|
|
572
572
|
return t !== void 0 && (t.i = this.i), this.v;
|
|
573
573
|
}, set: function(t) {
|
|
574
574
|
if (t !== this.v) {
|
|
575
575
|
if (yt > 100) throw new Error("Cycle detected");
|
|
576
|
-
this.v = t, this.i++, Qe++,
|
|
576
|
+
this.v = t, this.i++, Qe++, fe++;
|
|
577
577
|
try {
|
|
578
578
|
for (var e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
579
579
|
} finally {
|
|
@@ -584,11 +584,11 @@ Object.defineProperty(j.prototype, "value", { get: function() {
|
|
|
584
584
|
function Y(t, e) {
|
|
585
585
|
return new j(t, e);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Ui(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
|
}
|
|
591
|
-
function
|
|
591
|
+
function Li(t) {
|
|
592
592
|
for (var e = t.s; e !== void 0; e = e.n) {
|
|
593
593
|
var n = e.S.n;
|
|
594
594
|
if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
@@ -597,7 +597,7 @@ function Bi(t) {
|
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function Bi(t) {
|
|
601
601
|
for (var e = t.s, n = void 0; e !== void 0; ) {
|
|
602
602
|
var o = e.p;
|
|
603
603
|
e.i === -1 ? (e.S.U(e), o !== void 0 && (o.n = e.n), e.n !== void 0 && (e.n.p = o)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = o;
|
|
@@ -611,17 +611,17 @@ ge.prototype = new j();
|
|
|
611
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 && !
|
|
614
|
+
if (this.g = Qe, this.f |= 1, this.i > 0 && !Ui(this))
|
|
615
615
|
return this.f &= -2, !0;
|
|
616
616
|
var t = O;
|
|
617
617
|
try {
|
|
618
|
-
|
|
618
|
+
Li(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 O = t,
|
|
624
|
+
return O = t, Bi(this), this.f &= -2, !0;
|
|
625
625
|
};
|
|
626
626
|
ge.prototype.S = function(t) {
|
|
627
627
|
if (this.t === void 0) {
|
|
@@ -644,7 +644,7 @@ ge.prototype.N = function() {
|
|
|
644
644
|
};
|
|
645
645
|
Object.defineProperty(ge.prototype, "value", { get: function() {
|
|
646
646
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
647
|
-
var t =
|
|
647
|
+
var t = Mi(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
|
} });
|
|
@@ -654,7 +654,7 @@ function ni(t, e) {
|
|
|
654
654
|
function Pi(t) {
|
|
655
655
|
var e = t.u;
|
|
656
656
|
if (t.u = void 0, typeof e == "function") {
|
|
657
|
-
|
|
657
|
+
fe++;
|
|
658
658
|
var n = O;
|
|
659
659
|
O = void 0;
|
|
660
660
|
try {
|
|
@@ -672,7 +672,7 @@ function Nt(t) {
|
|
|
672
672
|
}
|
|
673
673
|
function An(t) {
|
|
674
674
|
if (O !== this) throw new Error("Out-of-order effect");
|
|
675
|
-
|
|
675
|
+
Bi(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;
|
|
@@ -689,7 +689,7 @@ Ae.prototype.c = function() {
|
|
|
689
689
|
};
|
|
690
690
|
Ae.prototype.S = function() {
|
|
691
691
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
692
|
-
this.f |= 1, this.f &= -9, Pi(this),
|
|
692
|
+
this.f |= 1, this.f &= -9, Pi(this), Li(this), fe++;
|
|
693
693
|
var t = O;
|
|
694
694
|
return O = this, An.bind(this, t);
|
|
695
695
|
};
|
|
@@ -723,8 +723,8 @@ function Te(t, e) {
|
|
|
723
723
|
function et(t) {
|
|
724
724
|
ht && ht(), ht = t && t.S();
|
|
725
725
|
}
|
|
726
|
-
function
|
|
727
|
-
var e = this, n = t.data, o =
|
|
726
|
+
function Vi(t) {
|
|
727
|
+
var e = this, n = t.data, o = Gi(n);
|
|
728
728
|
o.value = n;
|
|
729
729
|
var c = Ie(function() {
|
|
730
730
|
for (var l = e, m = e.__v; m = m.__; ) if (m.__c) {
|
|
@@ -748,8 +748,8 @@ function Gi(t) {
|
|
|
748
748
|
}, []), a = c[0], u = c[1];
|
|
749
749
|
return a.value ? u.peek() : u.value;
|
|
750
750
|
}
|
|
751
|
-
|
|
752
|
-
Object.defineProperties(j.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value:
|
|
751
|
+
Vi.displayName = "ReactiveTextNode";
|
|
752
|
+
Object.defineProperties(j.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Vi }, props: { configurable: !0, get: function() {
|
|
753
753
|
return { data: this };
|
|
754
754
|
} }, __b: { configurable: !0, value: 1 } });
|
|
755
755
|
Te("__b", function(t, e) {
|
|
@@ -763,7 +763,7 @@ Te("__b", function(t, e) {
|
|
|
763
763
|
t(e);
|
|
764
764
|
});
|
|
765
765
|
Te("__r", function(t, e) {
|
|
766
|
-
if (e.type !==
|
|
766
|
+
if (e.type !== _e) {
|
|
767
767
|
et();
|
|
768
768
|
var n, o = e.__c;
|
|
769
769
|
o && (o.__$f &= -2, (n = o.__$u) === void 0 && (o.__$u = n = (function(c, a) {
|
|
@@ -849,7 +849,7 @@ Oe.prototype.shouldComponentUpdate = function(t, e) {
|
|
|
849
849
|
for (var l in this.props) if (!(l in t)) return !0;
|
|
850
850
|
return !1;
|
|
851
851
|
};
|
|
852
|
-
function
|
|
852
|
+
function Gi(t, e) {
|
|
853
853
|
return qe(function() {
|
|
854
854
|
return Y(t, e);
|
|
855
855
|
})[0];
|
|
@@ -970,7 +970,7 @@ function Dn() {
|
|
|
970
970
|
}), We;
|
|
971
971
|
}
|
|
972
972
|
var ai;
|
|
973
|
-
function
|
|
973
|
+
function Mn() {
|
|
974
974
|
return ai || (ai = 1, (function(t) {
|
|
975
975
|
const e = kn(), n = Dn(), o = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
|
|
976
976
|
t.Buffer = l, t.SlowBuffer = b, t.INSPECT_MAX_BYTES = 50;
|
|
@@ -1220,7 +1220,7 @@ function Un() {
|
|
|
1220
1220
|
return Zi(this, i, r);
|
|
1221
1221
|
case "utf8":
|
|
1222
1222
|
case "utf-8":
|
|
1223
|
-
return
|
|
1223
|
+
return Mt(this, i, r);
|
|
1224
1224
|
case "ascii":
|
|
1225
1225
|
return Ji(this, i, r);
|
|
1226
1226
|
case "latin1":
|
|
@@ -1266,7 +1266,7 @@ function Un() {
|
|
|
1266
1266
|
return this;
|
|
1267
1267
|
}, l.prototype.toString = function() {
|
|
1268
1268
|
const i = this.length;
|
|
1269
|
-
return i === 0 ? "" : arguments.length === 0 ?
|
|
1269
|
+
return i === 0 ? "" : arguments.length === 0 ? Mt(this, 0, i) : D.apply(this, arguments);
|
|
1270
1270
|
}, l.prototype.toLocaleString = l.prototype.toString, l.prototype.equals = function(i) {
|
|
1271
1271
|
if (!l.isBuffer(i)) throw new TypeError("Argument must be a Buffer");
|
|
1272
1272
|
return this === i ? !0 : l.compare(this, i) === 0;
|
|
@@ -1289,10 +1289,10 @@ function Un() {
|
|
|
1289
1289
|
return 1;
|
|
1290
1290
|
if (r >>>= 0, h >>>= 0, f >>>= 0, E >>>= 0, this === i) return 0;
|
|
1291
1291
|
let v = E - f, R = h - r;
|
|
1292
|
-
const
|
|
1293
|
-
for (let
|
|
1294
|
-
if (M
|
|
1295
|
-
v = M
|
|
1292
|
+
const L = Math.min(v, R), U = this.slice(f, E), B = i.slice(r, h);
|
|
1293
|
+
for (let M = 0; M < L; ++M)
|
|
1294
|
+
if (U[M] !== B[M]) {
|
|
1295
|
+
v = U[M], R = B[M];
|
|
1296
1296
|
break;
|
|
1297
1297
|
}
|
|
1298
1298
|
return v < R ? -1 : R < v ? 1 : 0;
|
|
@@ -1318,26 +1318,26 @@ function Un() {
|
|
|
1318
1318
|
return -1;
|
|
1319
1319
|
E = 2, v /= 2, R /= 2, r /= 2;
|
|
1320
1320
|
}
|
|
1321
|
-
function B
|
|
1322
|
-
return E === 1 ?
|
|
1321
|
+
function L(B, M) {
|
|
1322
|
+
return E === 1 ? B[M] : B.readUInt16BE(M * E);
|
|
1323
1323
|
}
|
|
1324
|
-
let
|
|
1324
|
+
let U;
|
|
1325
1325
|
if (f) {
|
|
1326
|
-
let
|
|
1327
|
-
for (
|
|
1328
|
-
if (
|
|
1329
|
-
if (
|
|
1326
|
+
let B = -1;
|
|
1327
|
+
for (U = r; U < v; U++)
|
|
1328
|
+
if (L(s, U) === L(i, B === -1 ? 0 : U - B)) {
|
|
1329
|
+
if (B === -1 && (B = U), U - B + 1 === R) return B * E;
|
|
1330
1330
|
} else
|
|
1331
|
-
|
|
1331
|
+
B !== -1 && (U -= U - B), B = -1;
|
|
1332
1332
|
} else
|
|
1333
|
-
for (r + R > v && (r = v - R),
|
|
1334
|
-
let
|
|
1335
|
-
for (let
|
|
1336
|
-
if (
|
|
1337
|
-
|
|
1333
|
+
for (r + R > v && (r = v - R), U = r; U >= 0; U--) {
|
|
1334
|
+
let B = !0;
|
|
1335
|
+
for (let M = 0; M < R; M++)
|
|
1336
|
+
if (L(s, U + M) !== L(i, M)) {
|
|
1337
|
+
B = !1;
|
|
1338
1338
|
break;
|
|
1339
1339
|
}
|
|
1340
|
-
if (
|
|
1340
|
+
if (B) return U;
|
|
1341
1341
|
}
|
|
1342
1342
|
return -1;
|
|
1343
1343
|
}
|
|
@@ -1348,7 +1348,7 @@ function Un() {
|
|
|
1348
1348
|
}, l.prototype.lastIndexOf = function(i, r, h) {
|
|
1349
1349
|
return Z(this, i, r, h, !1);
|
|
1350
1350
|
};
|
|
1351
|
-
function
|
|
1351
|
+
function se(s, i, r, h) {
|
|
1352
1352
|
r = Number(r) || 0;
|
|
1353
1353
|
const f = s.length - r;
|
|
1354
1354
|
h ? (h = Number(h), h > f && (h = f)) : h = f;
|
|
@@ -1363,16 +1363,16 @@ function Un() {
|
|
|
1363
1363
|
return v;
|
|
1364
1364
|
}
|
|
1365
1365
|
function ne(s, i, r, h) {
|
|
1366
|
-
return
|
|
1366
|
+
return Ve(ct(i, s.length - r), s, r, h);
|
|
1367
1367
|
}
|
|
1368
1368
|
function re(s, i, r, h) {
|
|
1369
|
-
return
|
|
1369
|
+
return Ve(rn(i), s, r, h);
|
|
1370
1370
|
}
|
|
1371
1371
|
function Q(s, i, r, h) {
|
|
1372
|
-
return
|
|
1372
|
+
return Ve(jt(i), s, r, h);
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1375
|
-
return
|
|
1374
|
+
function ae(s, i, r, h) {
|
|
1375
|
+
return Ve(on(i, s.length - r), s, r, h);
|
|
1376
1376
|
}
|
|
1377
1377
|
l.prototype.write = function(i, r, h, f) {
|
|
1378
1378
|
if (r === void 0)
|
|
@@ -1393,7 +1393,7 @@ function Un() {
|
|
|
1393
1393
|
for (; ; )
|
|
1394
1394
|
switch (f) {
|
|
1395
1395
|
case "hex":
|
|
1396
|
-
return
|
|
1396
|
+
return se(this, i, r, h);
|
|
1397
1397
|
case "utf8":
|
|
1398
1398
|
case "utf-8":
|
|
1399
1399
|
return ne(this, i, r, h);
|
|
@@ -1407,7 +1407,7 @@ function Un() {
|
|
|
1407
1407
|
case "ucs-2":
|
|
1408
1408
|
case "utf16le":
|
|
1409
1409
|
case "utf-16le":
|
|
1410
|
-
return
|
|
1410
|
+
return ae(this, i, r, h);
|
|
1411
1411
|
default:
|
|
1412
1412
|
if (v) throw new TypeError("Unknown encoding: " + f);
|
|
1413
1413
|
f = ("" + f).toLowerCase(), v = !0;
|
|
@@ -1421,7 +1421,7 @@ function Un() {
|
|
|
1421
1421
|
function Yi(s, i, r) {
|
|
1422
1422
|
return i === 0 && r === s.length ? e.fromByteArray(s) : e.fromByteArray(s.slice(i, r));
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function Mt(s, i, r) {
|
|
1425
1425
|
r = Math.min(s.length, r);
|
|
1426
1426
|
const h = [];
|
|
1427
1427
|
let f = i;
|
|
@@ -1429,35 +1429,35 @@ function Un() {
|
|
|
1429
1429
|
const E = s[f];
|
|
1430
1430
|
let v = null, R = E > 239 ? 4 : E > 223 ? 3 : E > 191 ? 2 : 1;
|
|
1431
1431
|
if (f + R <= r) {
|
|
1432
|
-
let
|
|
1432
|
+
let L, U, B, M;
|
|
1433
1433
|
switch (R) {
|
|
1434
1434
|
case 1:
|
|
1435
1435
|
E < 128 && (v = E);
|
|
1436
1436
|
break;
|
|
1437
1437
|
case 2:
|
|
1438
|
-
|
|
1438
|
+
L = s[f + 1], (L & 192) === 128 && (M = (E & 31) << 6 | L & 63, M > 127 && (v = M));
|
|
1439
1439
|
break;
|
|
1440
1440
|
case 3:
|
|
1441
|
-
|
|
1441
|
+
L = s[f + 1], U = s[f + 2], (L & 192) === 128 && (U & 192) === 128 && (M = (E & 15) << 12 | (L & 63) << 6 | U & 63, M > 2047 && (M < 55296 || M > 57343) && (v = M));
|
|
1442
1442
|
break;
|
|
1443
1443
|
case 4:
|
|
1444
|
-
|
|
1444
|
+
L = s[f + 1], U = s[f + 2], B = s[f + 3], (L & 192) === 128 && (U & 192) === 128 && (B & 192) === 128 && (M = (E & 15) << 18 | (L & 63) << 12 | (U & 63) << 6 | B & 63, M > 65535 && M < 1114112 && (v = M));
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
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;
|
|
1448
1448
|
}
|
|
1449
1449
|
return Ki(h);
|
|
1450
1450
|
}
|
|
1451
|
-
const
|
|
1451
|
+
const Ut = 4096;
|
|
1452
1452
|
function Ki(s) {
|
|
1453
1453
|
const i = s.length;
|
|
1454
|
-
if (i <=
|
|
1454
|
+
if (i <= Ut)
|
|
1455
1455
|
return String.fromCharCode.apply(String, s);
|
|
1456
1456
|
let r = "", h = 0;
|
|
1457
1457
|
for (; h < i; )
|
|
1458
1458
|
r += String.fromCharCode.apply(
|
|
1459
1459
|
String,
|
|
1460
|
-
s.slice(h, h +=
|
|
1460
|
+
s.slice(h, h += Ut)
|
|
1461
1461
|
);
|
|
1462
1462
|
return r;
|
|
1463
1463
|
}
|
|
@@ -1496,77 +1496,77 @@ function Un() {
|
|
|
1496
1496
|
const f = this.subarray(i, r);
|
|
1497
1497
|
return Object.setPrototypeOf(f, l.prototype), f;
|
|
1498
1498
|
};
|
|
1499
|
-
function
|
|
1499
|
+
function V(s, i, r) {
|
|
1500
1500
|
if (s % 1 !== 0 || s < 0) throw new RangeError("offset is not uint");
|
|
1501
1501
|
if (s + i > r) throw new RangeError("Trying to access beyond buffer length");
|
|
1502
1502
|
}
|
|
1503
1503
|
l.prototype.readUintLE = l.prototype.readUIntLE = function(i, r, h) {
|
|
1504
|
-
i = i >>> 0, r = r >>> 0, h ||
|
|
1504
|
+
i = i >>> 0, r = r >>> 0, h || V(i, r, this.length);
|
|
1505
1505
|
let f = this[i], E = 1, v = 0;
|
|
1506
1506
|
for (; ++v < r && (E *= 256); )
|
|
1507
1507
|
f += this[i + v] * E;
|
|
1508
1508
|
return f;
|
|
1509
1509
|
}, l.prototype.readUintBE = l.prototype.readUIntBE = function(i, r, h) {
|
|
1510
|
-
i = i >>> 0, r = r >>> 0, h ||
|
|
1510
|
+
i = i >>> 0, r = r >>> 0, h || V(i, r, this.length);
|
|
1511
1511
|
let f = this[i + --r], E = 1;
|
|
1512
1512
|
for (; r > 0 && (E *= 256); )
|
|
1513
1513
|
f += this[i + --r] * E;
|
|
1514
1514
|
return f;
|
|
1515
1515
|
}, l.prototype.readUint8 = l.prototype.readUInt8 = function(i, r) {
|
|
1516
|
-
return i = i >>> 0, r ||
|
|
1516
|
+
return i = i >>> 0, r || V(i, 1, this.length), this[i];
|
|
1517
1517
|
}, l.prototype.readUint16LE = l.prototype.readUInt16LE = function(i, r) {
|
|
1518
|
-
return i = i >>> 0, r ||
|
|
1518
|
+
return i = i >>> 0, r || V(i, 2, this.length), this[i] | this[i + 1] << 8;
|
|
1519
1519
|
}, l.prototype.readUint16BE = l.prototype.readUInt16BE = function(i, r) {
|
|
1520
|
-
return i = i >>> 0, r ||
|
|
1520
|
+
return i = i >>> 0, r || V(i, 2, this.length), this[i] << 8 | this[i + 1];
|
|
1521
1521
|
}, l.prototype.readUint32LE = l.prototype.readUInt32LE = function(i, r) {
|
|
1522
|
-
return i = i >>> 0, r ||
|
|
1522
|
+
return i = i >>> 0, r || V(i, 4, this.length), (this[i] | this[i + 1] << 8 | this[i + 2] << 16) + this[i + 3] * 16777216;
|
|
1523
1523
|
}, l.prototype.readUint32BE = l.prototype.readUInt32BE = function(i, r) {
|
|
1524
|
-
return i = i >>> 0, r ||
|
|
1525
|
-
}, l.prototype.readBigUInt64LE =
|
|
1524
|
+
return i = i >>> 0, r || V(i, 4, this.length), this[i] * 16777216 + (this[i + 1] << 16 | this[i + 2] << 8 | this[i + 3]);
|
|
1525
|
+
}, l.prototype.readBigUInt64LE = le(function(i) {
|
|
1526
1526
|
i = i >>> 0, ye(i, "offset");
|
|
1527
1527
|
const r = this[i], h = this[i + 7];
|
|
1528
1528
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1529
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;
|
|
1530
1530
|
return BigInt(f) + (BigInt(E) << BigInt(32));
|
|
1531
|
-
}), l.prototype.readBigUInt64BE =
|
|
1531
|
+
}), l.prototype.readBigUInt64BE = le(function(i) {
|
|
1532
1532
|
i = i >>> 0, ye(i, "offset");
|
|
1533
1533
|
const r = this[i], h = this[i + 7];
|
|
1534
1534
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1535
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;
|
|
1536
1536
|
return (BigInt(f) << BigInt(32)) + BigInt(E);
|
|
1537
1537
|
}), l.prototype.readIntLE = function(i, r, h) {
|
|
1538
|
-
i = i >>> 0, r = r >>> 0, h ||
|
|
1538
|
+
i = i >>> 0, r = r >>> 0, h || V(i, r, this.length);
|
|
1539
1539
|
let f = this[i], E = 1, v = 0;
|
|
1540
1540
|
for (; ++v < r && (E *= 256); )
|
|
1541
1541
|
f += this[i + v] * E;
|
|
1542
1542
|
return E *= 128, f >= E && (f -= Math.pow(2, 8 * r)), f;
|
|
1543
1543
|
}, l.prototype.readIntBE = function(i, r, h) {
|
|
1544
|
-
i = i >>> 0, r = r >>> 0, h ||
|
|
1544
|
+
i = i >>> 0, r = r >>> 0, h || V(i, r, this.length);
|
|
1545
1545
|
let f = r, E = 1, v = this[i + --f];
|
|
1546
1546
|
for (; f > 0 && (E *= 256); )
|
|
1547
1547
|
v += this[i + --f] * E;
|
|
1548
1548
|
return E *= 128, v >= E && (v -= Math.pow(2, 8 * r)), v;
|
|
1549
1549
|
}, l.prototype.readInt8 = function(i, r) {
|
|
1550
|
-
return i = i >>> 0, r ||
|
|
1550
|
+
return i = i >>> 0, r || V(i, 1, this.length), this[i] & 128 ? (255 - this[i] + 1) * -1 : this[i];
|
|
1551
1551
|
}, l.prototype.readInt16LE = function(i, r) {
|
|
1552
|
-
i = i >>> 0, r ||
|
|
1552
|
+
i = i >>> 0, r || V(i, 2, this.length);
|
|
1553
1553
|
const h = this[i] | this[i + 1] << 8;
|
|
1554
1554
|
return h & 32768 ? h | 4294901760 : h;
|
|
1555
1555
|
}, l.prototype.readInt16BE = function(i, r) {
|
|
1556
|
-
i = i >>> 0, r ||
|
|
1556
|
+
i = i >>> 0, r || V(i, 2, this.length);
|
|
1557
1557
|
const h = this[i + 1] | this[i] << 8;
|
|
1558
1558
|
return h & 32768 ? h | 4294901760 : h;
|
|
1559
1559
|
}, l.prototype.readInt32LE = function(i, r) {
|
|
1560
|
-
return i = i >>> 0, r ||
|
|
1560
|
+
return i = i >>> 0, r || V(i, 4, this.length), this[i] | this[i + 1] << 8 | this[i + 2] << 16 | this[i + 3] << 24;
|
|
1561
1561
|
}, l.prototype.readInt32BE = function(i, r) {
|
|
1562
|
-
return i = i >>> 0, r ||
|
|
1563
|
-
}, l.prototype.readBigInt64LE =
|
|
1562
|
+
return i = i >>> 0, r || V(i, 4, this.length), this[i] << 24 | this[i + 1] << 16 | this[i + 2] << 8 | this[i + 3];
|
|
1563
|
+
}, l.prototype.readBigInt64LE = le(function(i) {
|
|
1564
1564
|
i = i >>> 0, ye(i, "offset");
|
|
1565
1565
|
const r = this[i], h = this[i + 7];
|
|
1566
1566
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
1567
1567
|
const f = this[i + 4] + this[i + 5] * 2 ** 8 + this[i + 6] * 2 ** 16 + (h << 24);
|
|
1568
1568
|
return (BigInt(f) << BigInt(32)) + BigInt(r + this[++i] * 2 ** 8 + this[++i] * 2 ** 16 + this[++i] * 2 ** 24);
|
|
1569
|
-
}), l.prototype.readBigInt64BE =
|
|
1569
|
+
}), l.prototype.readBigInt64BE = le(function(i) {
|
|
1570
1570
|
i = i >>> 0, ye(i, "offset");
|
|
1571
1571
|
const r = this[i], h = this[i + 7];
|
|
1572
1572
|
(r === void 0 || h === void 0) && Re(i, this.length - 8);
|
|
@@ -1574,13 +1574,13 @@ function Un() {
|
|
|
1574
1574
|
this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + this[++i];
|
|
1575
1575
|
return (BigInt(f) << BigInt(32)) + BigInt(this[++i] * 2 ** 24 + this[++i] * 2 ** 16 + this[++i] * 2 ** 8 + h);
|
|
1576
1576
|
}), l.prototype.readFloatLE = function(i, r) {
|
|
1577
|
-
return i = i >>> 0, r ||
|
|
1577
|
+
return i = i >>> 0, r || V(i, 4, this.length), n.read(this, i, !0, 23, 4);
|
|
1578
1578
|
}, l.prototype.readFloatBE = function(i, r) {
|
|
1579
|
-
return i = i >>> 0, r ||
|
|
1579
|
+
return i = i >>> 0, r || V(i, 4, this.length), n.read(this, i, !1, 23, 4);
|
|
1580
1580
|
}, l.prototype.readDoubleLE = function(i, r) {
|
|
1581
|
-
return i = i >>> 0, r ||
|
|
1581
|
+
return i = i >>> 0, r || V(i, 8, this.length), n.read(this, i, !0, 52, 8);
|
|
1582
1582
|
}, l.prototype.readDoubleBE = function(i, r) {
|
|
1583
|
-
return i = i >>> 0, r ||
|
|
1583
|
+
return i = i >>> 0, r || V(i, 8, this.length), n.read(this, i, !1, 52, 8);
|
|
1584
1584
|
};
|
|
1585
1585
|
function q(s, i, r, h, f, E) {
|
|
1586
1586
|
if (!l.isBuffer(s)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
@@ -1616,28 +1616,28 @@ function Un() {
|
|
|
1616
1616
|
}, l.prototype.writeUint32BE = l.prototype.writeUInt32BE = function(i, r, h) {
|
|
1617
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;
|
|
1618
1618
|
};
|
|
1619
|
-
function
|
|
1620
|
-
|
|
1619
|
+
function Lt(s, i, r, h, f) {
|
|
1620
|
+
Gt(i, h, f, s, r, 7);
|
|
1621
1621
|
let E = Number(i & BigInt(4294967295));
|
|
1622
1622
|
s[r++] = E, E = E >> 8, s[r++] = E, E = E >> 8, s[r++] = E, E = E >> 8, s[r++] = E;
|
|
1623
1623
|
let v = Number(i >> BigInt(32) & BigInt(4294967295));
|
|
1624
1624
|
return s[r++] = v, v = v >> 8, s[r++] = v, v = v >> 8, s[r++] = v, v = v >> 8, s[r++] = v, r;
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1627
|
-
|
|
1626
|
+
function Bt(s, i, r, h, f) {
|
|
1627
|
+
Gt(i, h, f, s, r, 7);
|
|
1628
1628
|
let E = Number(i & BigInt(4294967295));
|
|
1629
1629
|
s[r + 7] = E, E = E >> 8, s[r + 6] = E, E = E >> 8, s[r + 5] = E, E = E >> 8, s[r + 4] = E;
|
|
1630
1630
|
let v = Number(i >> BigInt(32) & BigInt(4294967295));
|
|
1631
1631
|
return s[r + 3] = v, v = v >> 8, s[r + 2] = v, v = v >> 8, s[r + 1] = v, v = v >> 8, s[r] = v, r + 8;
|
|
1632
1632
|
}
|
|
1633
|
-
l.prototype.writeBigUInt64LE =
|
|
1634
|
-
return Bt(this, i, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1635
|
-
}), l.prototype.writeBigUInt64BE = ce(function(i, r = 0) {
|
|
1633
|
+
l.prototype.writeBigUInt64LE = le(function(i, r = 0) {
|
|
1636
1634
|
return Lt(this, i, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1635
|
+
}), l.prototype.writeBigUInt64BE = le(function(i, r = 0) {
|
|
1636
|
+
return Bt(this, i, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1637
1637
|
}), l.prototype.writeIntLE = function(i, r, h, f) {
|
|
1638
1638
|
if (i = +i, r = r >>> 0, !f) {
|
|
1639
|
-
const
|
|
1640
|
-
q(this, i, r, h,
|
|
1639
|
+
const L = Math.pow(2, 8 * h - 1);
|
|
1640
|
+
q(this, i, r, h, L - 1, -L);
|
|
1641
1641
|
}
|
|
1642
1642
|
let E = 0, v = 1, R = 0;
|
|
1643
1643
|
for (this[r] = i & 255; ++E < h && (v *= 256); )
|
|
@@ -1645,8 +1645,8 @@ function Un() {
|
|
|
1645
1645
|
return r + h;
|
|
1646
1646
|
}, l.prototype.writeIntBE = function(i, r, h, f) {
|
|
1647
1647
|
if (i = +i, r = r >>> 0, !f) {
|
|
1648
|
-
const
|
|
1649
|
-
q(this, i, r, h,
|
|
1648
|
+
const L = Math.pow(2, 8 * h - 1);
|
|
1649
|
+
q(this, i, r, h, L - 1, -L);
|
|
1650
1650
|
}
|
|
1651
1651
|
let E = h - 1, v = 1, R = 0;
|
|
1652
1652
|
for (this[r + E] = i & 255; --E >= 0 && (v *= 256); )
|
|
@@ -1662,10 +1662,10 @@ function Un() {
|
|
|
1662
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;
|
|
1663
1663
|
}, l.prototype.writeInt32BE = function(i, r, h) {
|
|
1664
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;
|
|
1665
|
-
}, l.prototype.writeBigInt64LE =
|
|
1666
|
-
return Bt(this, i, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1667
|
-
}), l.prototype.writeBigInt64BE = ce(function(i, r = 0) {
|
|
1665
|
+
}, l.prototype.writeBigInt64LE = le(function(i, r = 0) {
|
|
1668
1666
|
return Lt(this, i, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1667
|
+
}), l.prototype.writeBigInt64BE = le(function(i, r = 0) {
|
|
1668
|
+
return Bt(this, i, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1669
1669
|
});
|
|
1670
1670
|
function Pt(s, i, r, h, f, E) {
|
|
1671
1671
|
if (r + h > s.length) throw new RangeError("Index out of range");
|
|
@@ -1771,11 +1771,11 @@ function Un() {
|
|
|
1771
1771
|
"ERR_OUT_OF_RANGE",
|
|
1772
1772
|
function(s, i, r) {
|
|
1773
1773
|
let h = `The value of "${s}" is out of range.`, f = r;
|
|
1774
|
-
return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? f =
|
|
1774
|
+
return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? f = Vt(String(r)) : typeof r == "bigint" && (f = String(r), (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) && (f = Vt(f)), f += "n"), h += ` It must be ${i}. Received ${f}`, h;
|
|
1775
1775
|
},
|
|
1776
1776
|
RangeError
|
|
1777
1777
|
);
|
|
1778
|
-
function
|
|
1778
|
+
function Vt(s) {
|
|
1779
1779
|
let i = "", r = s.length;
|
|
1780
1780
|
const h = s[0] === "-" ? 1 : 0;
|
|
1781
1781
|
for (; r >= h + 4; r -= 3)
|
|
@@ -1785,7 +1785,7 @@ function Un() {
|
|
|
1785
1785
|
function en(s, i, r) {
|
|
1786
1786
|
ye(i, "offset"), (s[i] === void 0 || s[i + r] === void 0) && Re(i, s.length - (r + 1));
|
|
1787
1787
|
}
|
|
1788
|
-
function
|
|
1788
|
+
function Gt(s, i, r, h, f, E) {
|
|
1789
1789
|
if (s > r || s < i) {
|
|
1790
1790
|
const v = typeof i == "bigint" ? "n" : "";
|
|
1791
1791
|
let R;
|
|
@@ -1881,7 +1881,7 @@ function Un() {
|
|
|
1881
1881
|
function jt(s) {
|
|
1882
1882
|
return e.toByteArray(nn(s));
|
|
1883
1883
|
}
|
|
1884
|
-
function
|
|
1884
|
+
function Ve(s, i, r, h) {
|
|
1885
1885
|
let f;
|
|
1886
1886
|
for (f = 0; f < h && !(f + r >= i.length || f >= s.length); ++f)
|
|
1887
1887
|
i[f + r] = s[f];
|
|
@@ -1902,7 +1902,7 @@ function Un() {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
return i;
|
|
1904
1904
|
})();
|
|
1905
|
-
function
|
|
1905
|
+
function le(s) {
|
|
1906
1906
|
return typeof BigInt > "u" ? an : s;
|
|
1907
1907
|
}
|
|
1908
1908
|
function an() {
|
|
@@ -1910,8 +1910,8 @@ function Un() {
|
|
|
1910
1910
|
}
|
|
1911
1911
|
})(ft)), ft;
|
|
1912
1912
|
}
|
|
1913
|
-
var
|
|
1914
|
-
const
|
|
1913
|
+
var Un = Mn();
|
|
1914
|
+
const Ln = "https://api.anam.ai", Bn = "/v1", Hi = {
|
|
1915
1915
|
client: "js-sdk",
|
|
1916
1916
|
version: "4.8.0"
|
|
1917
1917
|
};
|
|
@@ -1943,35 +1943,35 @@ var Pn = function(t, e, n, o) {
|
|
|
1943
1943
|
});
|
|
1944
1944
|
};
|
|
1945
1945
|
const Wi = "https://api.anam.ai", xt = "/v1";
|
|
1946
|
-
var
|
|
1946
|
+
var oe;
|
|
1947
1947
|
(function(t) {
|
|
1948
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";
|
|
1949
|
-
})(
|
|
1950
|
-
let St = Wi, zi = xt,
|
|
1949
|
+
})(oe || (oe = {}));
|
|
1950
|
+
let St = Wi, zi = xt, ue, qi = !1;
|
|
1951
1951
|
const Fn = (t, e = xt) => {
|
|
1952
1952
|
St = t, zi = e;
|
|
1953
1953
|
}, $n = (t) => {
|
|
1954
|
-
|
|
1955
|
-
},
|
|
1954
|
+
ue = t;
|
|
1955
|
+
}, Vn = (t) => {
|
|
1956
1956
|
qi = t;
|
|
1957
1957
|
};
|
|
1958
|
-
let
|
|
1958
|
+
let de = {
|
|
1959
1959
|
sessionId: null,
|
|
1960
1960
|
organizationId: null,
|
|
1961
1961
|
attemptCorrelationId: null
|
|
1962
1962
|
};
|
|
1963
1963
|
const Se = (t) => {
|
|
1964
|
-
|
|
1964
|
+
de = Object.assign(Object.assign({}, de), t);
|
|
1965
1965
|
}, me = (t, e, n) => Pn(void 0, void 0, void 0, function* () {
|
|
1966
1966
|
if (!qi)
|
|
1967
1967
|
try {
|
|
1968
1968
|
const o = Object.assign(Object.assign({}, Hi), n);
|
|
1969
|
-
|
|
1969
|
+
de.sessionId && (o.sessionId = de.sessionId), de.organizationId && (o.organizationId = de.organizationId), de.attemptCorrelationId && (o.attemptCorrelationId = de.attemptCorrelationId);
|
|
1970
1970
|
const c = `${zi}/metrics/client`;
|
|
1971
1971
|
let a, u = {
|
|
1972
1972
|
"Content-Type": "application/json"
|
|
1973
1973
|
};
|
|
1974
|
-
|
|
1974
|
+
ue?.enabled && ue?.baseUrl ? (a = `${ue.baseUrl}${c}`, u["X-Anam-Target-Url"] = `${St}${c}`) : a = `${St}${c}`, yield fetch(a, {
|
|
1975
1975
|
method: "POST",
|
|
1976
1976
|
headers: u,
|
|
1977
1977
|
body: JSON.stringify({
|
|
@@ -1983,7 +1983,7 @@ const Se = (t) => {
|
|
|
1983
1983
|
} catch (o) {
|
|
1984
1984
|
console.error("Failed to send error metric:", o);
|
|
1985
1985
|
}
|
|
1986
|
-
}),
|
|
1986
|
+
}), Gn = (t, e = "console") => {
|
|
1987
1987
|
var n, o, c;
|
|
1988
1988
|
const a = {};
|
|
1989
1989
|
t.forEach((d) => {
|
|
@@ -2063,13 +2063,13 @@ const Se = (t) => {
|
|
|
2063
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()}`);
|
|
2064
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();
|
|
2065
2065
|
};
|
|
2066
|
-
var
|
|
2066
|
+
var G;
|
|
2067
2067
|
(function(t) {
|
|
2068
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";
|
|
2069
|
-
})(
|
|
2069
|
+
})(G || (G = {}));
|
|
2070
2070
|
class $ extends Error {
|
|
2071
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(
|
|
2072
|
+
super(e), this.name = "ClientError", this.code = n, this.statusCode = o, this.details = c, Object.setPrototypeOf(this, $.prototype), me(oe.CLIENT_METRIC_MEASUREMENT_ERROR, n, {
|
|
2073
2073
|
details: c,
|
|
2074
2074
|
statusCode: o
|
|
2075
2075
|
});
|
|
@@ -2101,10 +2101,10 @@ var De;
|
|
|
2101
2101
|
(function(t) {
|
|
2102
2102
|
t.SPEECH_TEXT = "speechText", t.CLIENT_TOOL_EVENT = "clientToolEvent", t.REASONING_TEXT = "reasoningText";
|
|
2103
2103
|
})(De || (De = {}));
|
|
2104
|
-
var
|
|
2104
|
+
var he;
|
|
2105
2105
|
(function(t) {
|
|
2106
2106
|
t.PENDING = "pending", t.GRANTED = "granted", t.DENIED = "denied", t.NOT_REQUESTED = "not_requested";
|
|
2107
|
-
})(
|
|
2107
|
+
})(he || (he = {}));
|
|
2108
2108
|
var tt;
|
|
2109
2109
|
(function(t) {
|
|
2110
2110
|
t.USER = "user", t.PERSONA = "persona";
|
|
@@ -2117,10 +2117,10 @@ var J;
|
|
|
2117
2117
|
(function(t) {
|
|
2118
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";
|
|
2119
2119
|
})(J || (J = {}));
|
|
2120
|
-
var
|
|
2120
|
+
var pe;
|
|
2121
2121
|
(function(t) {
|
|
2122
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";
|
|
2123
|
-
})(
|
|
2123
|
+
})(pe || (pe = {}));
|
|
2124
2124
|
class Hn {
|
|
2125
2125
|
constructor(e, n) {
|
|
2126
2126
|
this.sequenceNumber = 0, this.config = e, this.signallingClient = n;
|
|
@@ -2287,7 +2287,7 @@ class qn {
|
|
|
2287
2287
|
try {
|
|
2288
2288
|
this.wsConnectionAttempts = 0, this.flushSendingBuffer(), this.socket.onmessage = this.onMessage.bind(this), this.startSendingHeartBeats(), this.internalEventEmitter.emit(J.WEB_SOCKET_OPEN);
|
|
2289
2289
|
} catch (e) {
|
|
2290
|
-
console.error("SignallingClient - onOpen: error in onOpen", e), this.publicEventEmitter.emit(N.CONNECTION_CLOSED,
|
|
2290
|
+
console.error("SignallingClient - onOpen: error in onOpen", e), this.publicEventEmitter.emit(N.CONNECTION_CLOSED, pe.SIGNALLING_CLIENT_CONNECTION_FAILURE);
|
|
2291
2291
|
}
|
|
2292
2292
|
});
|
|
2293
2293
|
}
|
|
@@ -2295,7 +2295,7 @@ class qn {
|
|
|
2295
2295
|
return we(this, void 0, void 0, function* () {
|
|
2296
2296
|
this.wsConnectionAttempts += 1, !this.stopSignal && (this.wsConnectionAttempts <= this.maxWsReconnectionAttempts ? (this.socket = null, setTimeout(() => {
|
|
2297
2297
|
this.connect();
|
|
2298
|
-
}, 100 * this.wsConnectionAttempts)) : (this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null), this.publicEventEmitter.emit(N.CONNECTION_CLOSED,
|
|
2298
|
+
}, 100 * this.wsConnectionAttempts)) : (this.heartBeatIntervalRef && (clearInterval(this.heartBeatIntervalRef), this.heartBeatIntervalRef = null), this.publicEventEmitter.emit(N.CONNECTION_CLOSED, pe.SIGNALLING_CLIENT_CONNECTION_FAILURE)));
|
|
2299
2299
|
});
|
|
2300
2300
|
}
|
|
2301
2301
|
onError(e) {
|
|
@@ -2363,7 +2363,7 @@ class Kn {
|
|
|
2363
2363
|
constructor(e, n, o) {
|
|
2364
2364
|
if (!e && !n)
|
|
2365
2365
|
throw new Error("Either sessionToken or apiKey must be provided");
|
|
2366
|
-
this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl ||
|
|
2366
|
+
this.sessionToken = e || null, this.apiKey = n || null, this.baseUrl = o?.baseUrl || Ln, this.apiVersion = o?.apiVersion || Bn, this.apiGatewayConfig = o?.apiGateway || void 0;
|
|
2367
2367
|
}
|
|
2368
2368
|
/**
|
|
2369
2369
|
* Builds URL and headers for a request, applying API Gateway configuration if enabled
|
|
@@ -2383,7 +2383,7 @@ class Kn {
|
|
|
2383
2383
|
return ci(this, void 0, void 0, function* () {
|
|
2384
2384
|
if (!this.sessionToken) {
|
|
2385
2385
|
if (!e)
|
|
2386
|
-
throw new $("Persona configuration must be provided when using apiKey",
|
|
2386
|
+
throw new $("Persona configuration must be provided when using apiKey", G.CLIENT_ERROR_CODE_VALIDATION_ERROR, 400);
|
|
2387
2387
|
this.sessionToken = yield this.unsafe_getSessionToken(e);
|
|
2388
2388
|
}
|
|
2389
2389
|
e && "brainType" in e && console.warn("Warning: brainType is deprecated and will be removed in a future version. Please use llmId instead.");
|
|
@@ -2405,22 +2405,22 @@ class Kn {
|
|
|
2405
2405
|
case 201:
|
|
2406
2406
|
return l;
|
|
2407
2407
|
case 400:
|
|
2408
|
-
throw new $("Invalid request to start session",
|
|
2408
|
+
throw new $("Invalid request to start session", G.CLIENT_ERROR_CODE_VALIDATION_ERROR, 400, { cause: l.message });
|
|
2409
2409
|
case 401:
|
|
2410
|
-
throw new $("Authentication failed when starting session",
|
|
2410
|
+
throw new $("Authentication failed when starting session", G.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 401, { cause: l.message });
|
|
2411
2411
|
case 402:
|
|
2412
|
-
throw new $("Please sign up for a plan to start a session",
|
|
2412
|
+
throw new $("Please sign up for a plan to start a session", G.CLIENT_ERROR_CODE_NO_PLAN_FOUND, 402, { cause: l.message });
|
|
2413
2413
|
case 403:
|
|
2414
|
-
throw new $("Authentication failed when starting session",
|
|
2414
|
+
throw new $("Authentication failed when starting session", G.CLIENT_ERROR_CODE_AUTHENTICATION_ERROR, 403, { cause: l.message });
|
|
2415
2415
|
case 429:
|
|
2416
|
-
throw m === "Concurrent session limit reached" ? new $("Concurrency limit reached, please upgrade your plan",
|
|
2416
|
+
throw m === "Concurrent session limit reached" ? new $("Concurrency limit reached, please upgrade your plan", G.CLIENT_ERROR_CODE_MAX_CONCURRENT_SESSIONS_REACHED, 429, { cause: l.message }) : m === "Spend cap reached" ? new $("Spend cap reached, please upgrade your plan", G.CLIENT_ERROR_CODE_SPEND_CAP_REACHED, 429, { cause: l.message }) : new $("Usage limit reached, please upgrade your plan", G.CLIENT_ERROR_CODE_USAGE_LIMIT_REACHED, 429, { cause: l.message });
|
|
2417
2417
|
case 503:
|
|
2418
|
-
throw new $("There are no available personas, please try again later",
|
|
2418
|
+
throw new $("There are no available personas, please try again later", G.CLIENT_ERROR_CODE_SERVICE_BUSY, 503, { cause: l.message });
|
|
2419
2419
|
default:
|
|
2420
|
-
throw new $("Unknown error when starting session",
|
|
2420
|
+
throw new $("Unknown error when starting session", G.CLIENT_ERROR_CODE_SERVER_ERROR, 500, { cause: l.message });
|
|
2421
2421
|
}
|
|
2422
2422
|
} catch (o) {
|
|
2423
|
-
throw o instanceof $ ? o : new $("Failed to start session",
|
|
2423
|
+
throw o instanceof $ ? o : new $("Failed to start session", G.CLIENT_ERROR_CODE_SERVER_ERROR, 500, { cause: o instanceof Error ? o.message : String(o) });
|
|
2424
2424
|
}
|
|
2425
2425
|
});
|
|
2426
2426
|
}
|
|
@@ -2587,9 +2587,9 @@ class er {
|
|
|
2587
2587
|
this.listeners[e] && this.listeners[e].delete(n);
|
|
2588
2588
|
}
|
|
2589
2589
|
emit(e, ...n) {
|
|
2590
|
-
if (e === N.CONNECTION_ESTABLISHED && me(
|
|
2590
|
+
if (e === N.CONNECTION_ESTABLISHED && me(oe.CLIENT_METRIC_MEASUREMENT_CONNECTION_ESTABLISHED, "1"), e === N.CONNECTION_CLOSED) {
|
|
2591
2591
|
const [o, c] = n;
|
|
2592
|
-
me(
|
|
2592
|
+
me(oe.CLIENT_METRIC_MEASUREMENT_CONNECTION_CLOSED, o, c ? { details: c } : void 0);
|
|
2593
2593
|
}
|
|
2594
2594
|
this.listeners[e] && this.listeners[e].forEach((o) => {
|
|
2595
2595
|
o(...n);
|
|
@@ -2714,7 +2714,7 @@ class or {
|
|
|
2714
2714
|
var a, u, l, m;
|
|
2715
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 = {
|
|
2716
2716
|
isMuted: !1,
|
|
2717
|
-
permissionState:
|
|
2717
|
+
permissionState: he.NOT_REQUESTED
|
|
2718
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;
|
|
2719
2719
|
const { inputAudio: p } = n;
|
|
2720
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";
|
|
@@ -2773,7 +2773,7 @@ class or {
|
|
|
2773
2773
|
n.forEach((a) => {
|
|
2774
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
2775
|
a.bytesReceived > 1e5 && (o = !0, c = "bytesReceived"));
|
|
2776
|
-
}), o && !this.successMetricFired && (this.successMetricFired = !0, me(
|
|
2776
|
+
}), o && !this.successMetricFired && (this.successMetricFired = !0, me(oe.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", c ? { detectionMethod: c } : void 0), this.successMetricPoller && clearInterval(this.successMetricPoller), clearTimeout(e), this.successMetricPoller = null);
|
|
2777
2777
|
} catch {
|
|
2778
2778
|
}
|
|
2779
2779
|
}), 500);
|
|
@@ -2896,7 +2896,7 @@ class or {
|
|
|
2896
2896
|
break;
|
|
2897
2897
|
case W.END_SESSION:
|
|
2898
2898
|
const a = e.payload;
|
|
2899
|
-
this.publicEventEmitter.emit(N.CONNECTION_CLOSED,
|
|
2899
|
+
this.publicEventEmitter.emit(N.CONNECTION_CLOSED, pe.SERVER_CLOSED_CONNECTION, a), this.shutdown();
|
|
2900
2900
|
break;
|
|
2901
2901
|
case W.WARNING:
|
|
2902
2902
|
const u = e.payload;
|
|
@@ -2950,7 +2950,7 @@ class or {
|
|
|
2950
2950
|
((e = this.peerConnection) === null || e === void 0 ? void 0 : e.connectionState) === "closed" && (console.error("StreamingClient - onConnectionStateChange: Connection closed"), this.handleWebrtcFailure("The connection to our servers was lost. Please try again."));
|
|
2951
2951
|
}
|
|
2952
2952
|
handleWebrtcFailure(e) {
|
|
2953
|
-
console.error({ message: "StreamingClient - handleWebrtcFailure: ", err: e }), e.name === "NotAllowedError" && e.message === "Permission denied" ? this.publicEventEmitter.emit(N.CONNECTION_CLOSED,
|
|
2953
|
+
console.error({ message: "StreamingClient - handleWebrtcFailure: ", err: e }), e.name === "NotAllowedError" && e.message === "Permission denied" ? this.publicEventEmitter.emit(N.CONNECTION_CLOSED, pe.MICROPHONE_PERMISSION_DENIED) : this.publicEventEmitter.emit(N.CONNECTION_CLOSED, pe.WEBRTC_FAILURE);
|
|
2954
2954
|
try {
|
|
2955
2955
|
this.stopConnection();
|
|
2956
2956
|
} catch (n) {
|
|
@@ -2963,7 +2963,7 @@ class or {
|
|
|
2963
2963
|
this.videoElement.srcObject = this.videoStream;
|
|
2964
2964
|
const n = this.videoElement.requestVideoFrameCallback(() => {
|
|
2965
2965
|
var o;
|
|
2966
|
-
(o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(N.VIDEO_PLAY_STARTED), this.successMetricFired || (this.successMetricFired = !0, me(
|
|
2966
|
+
(o = this.videoElement) === null || o === void 0 || o.cancelVideoFrameCallback(n), this.publicEventEmitter.emit(N.VIDEO_PLAY_STARTED), this.successMetricFired || (this.successMetricFired = !0, me(oe.CLIENT_METRIC_MEASUREMENT_SESSION_SUCCESS, "1", { detectionMethod: "videoElement" }));
|
|
2967
2967
|
});
|
|
2968
2968
|
}
|
|
2969
2969
|
} else e.track.kind === "audio" && (this.audioStream = e.streams[0], this.publicEventEmitter.emit(N.AUDIO_STREAM_STARTED, this.audioStream));
|
|
@@ -3016,8 +3016,8 @@ class or {
|
|
|
3016
3016
|
*/
|
|
3017
3017
|
requestMicrophonePermissionAsync() {
|
|
3018
3018
|
return K(this, void 0, void 0, function* () {
|
|
3019
|
-
if (this.inputAudioState.permissionState !==
|
|
3020
|
-
this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState:
|
|
3019
|
+
if (this.inputAudioState.permissionState !== he.PENDING) {
|
|
3020
|
+
this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: he.PENDING }), this.publicEventEmitter.emit(N.MIC_PERMISSION_PENDING);
|
|
3021
3021
|
try {
|
|
3022
3022
|
const e = {
|
|
3023
3023
|
echoCancellation: !0
|
|
@@ -3026,9 +3026,9 @@ class or {
|
|
|
3026
3026
|
exact: this.audioDeviceId
|
|
3027
3027
|
}), this.inputAudioStream = yield navigator.mediaDevices.getUserMedia({
|
|
3028
3028
|
audio: e
|
|
3029
|
-
}), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState:
|
|
3029
|
+
}), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: he.GRANTED }), this.publicEventEmitter.emit(N.MIC_PERMISSION_GRANTED), yield this.setupAudioTrack();
|
|
3030
3030
|
} catch (e) {
|
|
3031
|
-
console.error("Failed to get microphone permission:", e), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState:
|
|
3031
|
+
console.error("Failed to get microphone permission:", e), this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { permissionState: he.DENIED });
|
|
3032
3032
|
const n = e instanceof Error ? e.message : String(e);
|
|
3033
3033
|
this.publicEventEmitter.emit(N.MIC_PERMISSION_DENIED, n);
|
|
3034
3034
|
}
|
|
@@ -3085,7 +3085,7 @@ class or {
|
|
|
3085
3085
|
if (this.showPeerConnectionStatsReport) {
|
|
3086
3086
|
const n = yield (e = this.peerConnection) === null || e === void 0 ? void 0 : e.getStats();
|
|
3087
3087
|
if (n) {
|
|
3088
|
-
const o =
|
|
3088
|
+
const o = Gn(n, this.peerConnectionStatsReportOutputFormat);
|
|
3089
3089
|
o && console.log(o, void 0, 2);
|
|
3090
3090
|
}
|
|
3091
3091
|
}
|
|
@@ -3154,7 +3154,7 @@ class ar {
|
|
|
3154
3154
|
n.endOfThought && this.publicEventEmitter.emit(N.REASONING_HISTORY_UPDATED, this.reasoning_messages);
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
|
-
var
|
|
3157
|
+
var ce = function(t, e, n, o) {
|
|
3158
3158
|
function c(a) {
|
|
3159
3159
|
return a instanceof n ? a : new n(function(u) {
|
|
3160
3160
|
u(a);
|
|
@@ -3186,16 +3186,16 @@ class lr {
|
|
|
3186
3186
|
var c, a, u, l, m;
|
|
3187
3187
|
this.inputAudioState = {
|
|
3188
3188
|
isMuted: !1,
|
|
3189
|
-
permissionState:
|
|
3189
|
+
permissionState: he.NOT_REQUESTED
|
|
3190
3190
|
}, this.sessionId = null, this.organizationId = null, this.streamingClient = null, this._isStreaming = !1;
|
|
3191
3191
|
const p = this.validateClientConfig(e, n, o);
|
|
3192
3192
|
if (p)
|
|
3193
|
-
throw new $(p,
|
|
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 &&
|
|
3193
|
+
throw new $(p, G.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 && Vn(!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);
|
|
3195
3195
|
}
|
|
3196
3196
|
decodeJwt(e) {
|
|
3197
3197
|
try {
|
|
3198
|
-
const n = e.split(".")[1], o =
|
|
3198
|
+
const n = e.split(".")[1], o = Un.Buffer.from(n, "base64").toString("utf8");
|
|
3199
3199
|
return JSON.parse(o);
|
|
3200
3200
|
} catch {
|
|
3201
3201
|
throw new Error("Invalid session token format");
|
|
@@ -3240,13 +3240,13 @@ class lr {
|
|
|
3240
3240
|
return n;
|
|
3241
3241
|
}
|
|
3242
3242
|
startSession(e) {
|
|
3243
|
-
return
|
|
3243
|
+
return ce(this, void 0, void 0, function* () {
|
|
3244
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:
|
|
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: se } = b;
|
|
3246
3246
|
this.sessionId = I, Se({
|
|
3247
3247
|
sessionId: this.sessionId
|
|
3248
3248
|
});
|
|
3249
|
-
const ne = !((n = this.clientOptions) === null || n === void 0) && n.iceServers ? this.clientOptions.iceServers :
|
|
3249
|
+
const ne = !((n = this.clientOptions) === null || n === void 0) && n.iceServers ? this.clientOptions.iceServers : se;
|
|
3250
3250
|
try {
|
|
3251
3251
|
this.streamingClient = new or(I, {
|
|
3252
3252
|
engine: {
|
|
@@ -3277,7 +3277,7 @@ class lr {
|
|
|
3277
3277
|
} catch (re) {
|
|
3278
3278
|
throw Se({
|
|
3279
3279
|
sessionId: null
|
|
3280
|
-
}), new $("Failed to initialize streaming client",
|
|
3280
|
+
}), new $("Failed to initialize streaming client", G.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
|
|
3281
3281
|
cause: re instanceof Error ? re.message : String(re),
|
|
3282
3282
|
sessionId: I
|
|
3283
3283
|
});
|
|
@@ -3286,15 +3286,15 @@ class lr {
|
|
|
3286
3286
|
});
|
|
3287
3287
|
}
|
|
3288
3288
|
startSessionIfNeeded(e) {
|
|
3289
|
-
return
|
|
3289
|
+
return ce(this, void 0, void 0, function* () {
|
|
3290
3290
|
if ((!this.sessionId || !this.streamingClient) && (yield this.startSession(e), !this.sessionId || !this.streamingClient))
|
|
3291
|
-
throw new $("Session ID or streaming client is not available after starting session",
|
|
3291
|
+
throw new $("Session ID or streaming client is not available after starting session", G.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
|
|
3292
3292
|
cause: "Failed to initialize session properly"
|
|
3293
3293
|
});
|
|
3294
3294
|
});
|
|
3295
3295
|
}
|
|
3296
3296
|
stream(e) {
|
|
3297
|
-
return
|
|
3297
|
+
return ce(this, void 0, void 0, function* () {
|
|
3298
3298
|
var n;
|
|
3299
3299
|
if (this._isStreaming)
|
|
3300
3300
|
throw new Error("Already streaming");
|
|
@@ -3303,7 +3303,7 @@ class lr {
|
|
|
3303
3303
|
attemptCorrelationId: o,
|
|
3304
3304
|
sessionId: null
|
|
3305
3305
|
// reset sessionId
|
|
3306
|
-
}), me(
|
|
3306
|
+
}), me(oe.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) => {
|
|
3307
3307
|
var a;
|
|
3308
3308
|
const u = [];
|
|
3309
3309
|
let l = !1, m = !1;
|
|
@@ -3319,23 +3319,23 @@ class lr {
|
|
|
3319
3319
|
* @deprecated This method is deprecated. Please use streamToVideoElement instead.
|
|
3320
3320
|
*/
|
|
3321
3321
|
streamToVideoAndAudioElements(e, n, o) {
|
|
3322
|
-
return
|
|
3322
|
+
return ce(this, void 0, void 0, function* () {
|
|
3323
3323
|
console.warn("AnamClient: streamToVideoAndAudioElements is deprecated. To avoid possible audio issues, please use streamToVideoElement instead."), yield this.streamToVideoElement(e, o);
|
|
3324
3324
|
});
|
|
3325
3325
|
}
|
|
3326
3326
|
streamToVideoElement(e, n) {
|
|
3327
|
-
return
|
|
3327
|
+
return ce(this, void 0, void 0, function* () {
|
|
3328
3328
|
var o;
|
|
3329
3329
|
const c = li();
|
|
3330
3330
|
Se({
|
|
3331
3331
|
attemptCorrelationId: c,
|
|
3332
3332
|
sessionId: null
|
|
3333
3333
|
// reset sessionId
|
|
3334
|
-
}), me(
|
|
3334
|
+
}), me(oe.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.");
|
|
3335
3335
|
try {
|
|
3336
3336
|
yield this.startSessionIfNeeded(n);
|
|
3337
3337
|
} catch (a) {
|
|
3338
|
-
throw a instanceof $ ? a : new $("Failed to start session",
|
|
3338
|
+
throw a instanceof $ ? a : new $("Failed to start session", G.CLIENT_ERROR_CODE_SERVER_ERROR, 500, {
|
|
3339
3339
|
cause: a instanceof Error ? a.message : String(a),
|
|
3340
3340
|
sessionId: this.sessionId
|
|
3341
3341
|
});
|
|
@@ -3353,7 +3353,7 @@ class lr {
|
|
|
3353
3353
|
* @throws Error if session is not started or not currently streaming
|
|
3354
3354
|
*/
|
|
3355
3355
|
talk(e) {
|
|
3356
|
-
return
|
|
3356
|
+
return ce(this, void 0, void 0, function* () {
|
|
3357
3357
|
if (!this.streamingClient)
|
|
3358
3358
|
throw new Error("Failed to send talk command: session is not started. Have you called startSession?");
|
|
3359
3359
|
if (!this._isStreaming)
|
|
@@ -3406,8 +3406,8 @@ class lr {
|
|
|
3406
3406
|
this.sendDataMessage(n);
|
|
3407
3407
|
}
|
|
3408
3408
|
stopStreaming() {
|
|
3409
|
-
return
|
|
3410
|
-
this.streamingClient && (this.publicEventEmitter.emit(N.CONNECTION_CLOSED,
|
|
3409
|
+
return ce(this, void 0, void 0, function* () {
|
|
3410
|
+
this.streamingClient && (this.publicEventEmitter.emit(N.CONNECTION_CLOSED, pe.NORMAL), yield this.streamingClient.stopConnection(), this.streamingClient = null, this.sessionId = null, Se({
|
|
3411
3411
|
attemptCorrelationId: null,
|
|
3412
3412
|
sessionId: null,
|
|
3413
3413
|
organizationId: this.organizationId
|
|
@@ -3436,7 +3436,7 @@ class lr {
|
|
|
3436
3436
|
return !((e = this.clientOptions) === null || e === void 0) && e.disableInputAudio && console.warn("AnamClient: Input audio is disabled. Unmuting input audio will have no effect."), this.streamingClient && !(!((n = this.clientOptions) === null || n === void 0) && n.disableInputAudio) ? this.inputAudioState = this.streamingClient.unmuteInputAudio() : this.inputAudioState = Object.assign(Object.assign({}, this.inputAudioState), { isMuted: !1 }), this.inputAudioState;
|
|
3437
3437
|
}
|
|
3438
3438
|
changeAudioInputDevice(e) {
|
|
3439
|
-
return
|
|
3439
|
+
return ce(this, void 0, void 0, function* () {
|
|
3440
3440
|
var n;
|
|
3441
3441
|
if (!((n = this.clientOptions) === null || n === void 0) && n.disableInputAudio)
|
|
3442
3442
|
throw new Error("AnamClient: Cannot change audio input device because input audio is disabled.");
|
|
@@ -3481,7 +3481,7 @@ function dr(t) {
|
|
|
3481
3481
|
return {};
|
|
3482
3482
|
}
|
|
3483
3483
|
}
|
|
3484
|
-
const X = Y(null), te = Y("idle"),
|
|
3484
|
+
const X = Y(null), te = Y("idle"), Be = 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
3485
|
function hr(t, e) {
|
|
3486
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.";
|
|
3487
3487
|
}
|
|
@@ -3529,13 +3529,13 @@ async function pr(t, e, n, o) {
|
|
|
3529
3529
|
u.addListener(N.CONNECTION_ESTABLISHED, () => {
|
|
3530
3530
|
console.log("[AnamWidget] Connection established"), te.value = "connected";
|
|
3531
3531
|
}), u.addListener(N.VIDEO_STREAM_STARTED, () => {
|
|
3532
|
-
console.log("[AnamWidget] Video stream started"),
|
|
3532
|
+
console.log("[AnamWidget] Video stream started"), Be.value = !0;
|
|
3533
3533
|
}), u.addListener(N.AUDIO_STREAM_STARTED, () => {
|
|
3534
3534
|
console.log("[AnamWidget] Audio stream started");
|
|
3535
3535
|
}), u.addListener(N.MESSAGE_HISTORY_UPDATED, (m) => {
|
|
3536
3536
|
at.value = [...m];
|
|
3537
3537
|
}), u.addListener(N.CONNECTION_CLOSED, (m, p) => {
|
|
3538
|
-
console.log("[AnamWidget] Connection closed:", m, p), te.value = "idle",
|
|
3538
|
+
console.log("[AnamWidget] Connection closed:", m, p), te.value = "idle", Be.value = !1, it.value = null;
|
|
3539
3539
|
}), u.addListener(N.SESSION_READY, (m) => {
|
|
3540
3540
|
console.log("[AnamWidget] Session ready:", m), it.value = m;
|
|
3541
3541
|
}), X.value = u;
|
|
@@ -3555,7 +3555,7 @@ async function _r() {
|
|
|
3555
3555
|
} catch (t) {
|
|
3556
3556
|
console.error("[AnamWidget] Failed to stop session:", t);
|
|
3557
3557
|
}
|
|
3558
|
-
X.value = null, te.value = "idle",
|
|
3558
|
+
X.value = null, te.value = "idle", Be.value = !1, at.value = [];
|
|
3559
3559
|
}
|
|
3560
3560
|
function Er(t) {
|
|
3561
3561
|
!X.value || te.value !== "connected" || X.value.sendUserMessage(t);
|
|
@@ -3564,7 +3564,7 @@ function mr() {
|
|
|
3564
3564
|
X.value && (Ke.value ? (X.value.unmuteInputAudio(), Ke.value = !1) : (X.value.muteInputAudio(), Ke.value = !0));
|
|
3565
3565
|
}
|
|
3566
3566
|
function gr() {
|
|
3567
|
-
X.value?.isStreaming() && X.value.stopStreaming(), X.value = null, te.value = "idle",
|
|
3567
|
+
X.value?.isStreaming() && X.value.stopStreaming(), X.value = null, te.value = "idle", Be.value = !1, at.value = [], Pe.value = null, it.value = null, Ot.value = null, kt.value = null, Dt.value = null;
|
|
3568
3568
|
}
|
|
3569
3569
|
function vr(t, e, n) {
|
|
3570
3570
|
const o = t || (n ? dr(n).personaId : void 0);
|
|
@@ -3572,7 +3572,7 @@ function vr(t, e, n) {
|
|
|
3572
3572
|
const c = e || ur;
|
|
3573
3573
|
return {
|
|
3574
3574
|
connectionStatus: te,
|
|
3575
|
-
isStreaming:
|
|
3575
|
+
isStreaming: Be,
|
|
3576
3576
|
isMuted: Ke,
|
|
3577
3577
|
messages: at,
|
|
3578
3578
|
error: Pe,
|
|
@@ -3596,7 +3596,7 @@ function vr(t, e, n) {
|
|
|
3596
3596
|
cleanup: gr
|
|
3597
3597
|
};
|
|
3598
3598
|
}
|
|
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}';
|
|
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(8px);color:#fff;letter-spacing:-.01em;cursor:pointer;white-space:nowrap;background:#ffffff24;border:1px solid #ffffff38;border-radius:999px;align-items:center;gap:12px;min-width:200px;padding:12px 26px;font-family:inherit;font-size:16px;font-weight:600;transition:all .2s;display:flex;position:absolute;bottom:20px;left:50%;transform:translate(-50%)}.anam-cta-pill:hover{background:#ffffff38;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 #ffffff38;border-radius:50%;justify-content:center;align-items:center;width:44px;height:44px;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);justify-content:center;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 #ffffff38;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-input-wrap{flex:1;align-items:center;min-width:0;margin-right:56px;display:flex;position:relative}.anam-ctl-input{-webkit-backdrop-filter:blur(8px);color:#fff;background:#ffffff1a;border:1px solid #ffffff38;border-radius:999px;outline:none;width:100%;padding:11px 44px 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}.anam-ctl-send{color:#ffffff80;cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;padding:0;transition:color .15s;display:flex;position:absolute;right:6px}.anam-ctl-send:hover{color:#fff}.anam-ctl-send:disabled{opacity:.35;cursor:not-allowed}.anam-watermark{z-index:11;opacity:.5;line-height:0;text-decoration:none;transition:opacity .15s;position:absolute;top:16px;left:16px}.anam-watermark:hover{opacity:.8}@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}';
|
|
3600
3600
|
function wt(t, e) {
|
|
3601
3601
|
const n = { ...t };
|
|
3602
3602
|
for (const o of Object.keys(e)) {
|
|
@@ -3617,9 +3617,9 @@ function yr(t) {
|
|
|
3617
3617
|
const c = ze(t["ui-text-input"]);
|
|
3618
3618
|
c !== void 0 && (e.showTextInput = c);
|
|
3619
3619
|
const a = ze(t["ui-captions"]);
|
|
3620
|
-
return a !== void 0 && (e.showCaptions = a), e;
|
|
3620
|
+
return a !== void 0 && (e.showCaptions = a), t["call-to-action"] && (e.callToAction = t["call-to-action"]), e;
|
|
3621
3621
|
}
|
|
3622
|
-
const Sr = () => /* @__PURE__ */ w("svg", { width: "
|
|
3622
|
+
const Sr = () => /* @__PURE__ */ w("svg", { width: "20", height: "20", 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: "24", height: "24", 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: [
|
|
3623
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" }),
|
|
3624
3624
|
/* @__PURE__ */ w("path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }),
|
|
3625
3625
|
/* @__PURE__ */ w("line", { x1: "12", y1: "19", x2: "12", y2: "22" })
|
|
@@ -3631,14 +3631,11 @@ const Sr = () => /* @__PURE__ */ w("svg", { width: "16", height: "16", viewBox:
|
|
|
3631
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: [
|
|
3632
3632
|
/* @__PURE__ */ w("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
|
|
3633
3633
|
/* @__PURE__ */ w("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
|
|
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: [
|
|
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" }),
|
|
3636
|
-
/* @__PURE__ */ w("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
3637
3634
|
] }), Ct = () => /* @__PURE__ */ w("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none", style: { opacity: 0.3 }, children: [
|
|
3638
3635
|
/* @__PURE__ */ w("circle", { cx: "24", cy: "18", r: "8", stroke: "white", "stroke-width": "2", fill: "none" }),
|
|
3639
3636
|
/* @__PURE__ */ w("path", { d: "M8 42c0-8.837 7.163-16 16-16s16 7.163 16 16", stroke: "white", "stroke-width": "2", fill: "none" })
|
|
3640
3637
|
] });
|
|
3641
|
-
function
|
|
3638
|
+
function Ar({
|
|
3642
3639
|
config: t,
|
|
3643
3640
|
session: e,
|
|
3644
3641
|
videoRef: n,
|
|
@@ -3698,8 +3695,16 @@ function Tr({
|
|
|
3698
3695
|
/* @__PURE__ */ w("div", { class: "anam-overlay-error-text", children: e.error.value || "Something went wrong" }),
|
|
3699
3696
|
/* @__PURE__ */ w("button", { class: "anam-retry-btn", onClick: T, children: "Try Again" })
|
|
3700
3697
|
] }),
|
|
3701
|
-
(S || I) && /* @__PURE__ */ w(
|
|
3702
|
-
|
|
3698
|
+
(S || I) && /* @__PURE__ */ w(_e, { children: [
|
|
3699
|
+
/* @__PURE__ */ w(
|
|
3700
|
+
"button",
|
|
3701
|
+
{
|
|
3702
|
+
class: "anam-close-btn",
|
|
3703
|
+
onClick: a ?? D,
|
|
3704
|
+
"aria-label": "End call",
|
|
3705
|
+
children: /* @__PURE__ */ w(Sr, {})
|
|
3706
|
+
}
|
|
3707
|
+
),
|
|
3703
3708
|
p && /* @__PURE__ */ w("div", { class: `anam-toast ${d ? "anam-toast-out" : ""}`, children: p }),
|
|
3704
3709
|
/* @__PURE__ */ w("div", { class: "anam-control-bar", children: [
|
|
3705
3710
|
t.showMuteButton && /* @__PURE__ */ w(
|
|
@@ -3711,7 +3716,7 @@ function Tr({
|
|
|
3711
3716
|
children: e.isMuted.value ? /* @__PURE__ */ w(Ir, {}) : /* @__PURE__ */ w(Cr, {})
|
|
3712
3717
|
}
|
|
3713
3718
|
),
|
|
3714
|
-
t.showTextInput && /* @__PURE__ */ w(
|
|
3719
|
+
t.showTextInput && /* @__PURE__ */ w("div", { class: "anam-ctl-input-wrap", children: [
|
|
3715
3720
|
/* @__PURE__ */ w(
|
|
3716
3721
|
"input",
|
|
3717
3722
|
{
|
|
@@ -3728,33 +3733,39 @@ function Tr({
|
|
|
3728
3733
|
/* @__PURE__ */ w(
|
|
3729
3734
|
"button",
|
|
3730
3735
|
{
|
|
3731
|
-
class: "anam-ctl-
|
|
3736
|
+
class: "anam-ctl-send",
|
|
3732
3737
|
onClick: x,
|
|
3733
3738
|
disabled: !S || !l.trim(),
|
|
3734
3739
|
"aria-label": "Send message",
|
|
3735
3740
|
children: /* @__PURE__ */ w(br, {})
|
|
3736
3741
|
}
|
|
3737
3742
|
)
|
|
3738
|
-
] })
|
|
3739
|
-
/* @__PURE__ */ w(
|
|
3740
|
-
"button",
|
|
3741
|
-
{
|
|
3742
|
-
class: "anam-ctl-btn anam-ctl-end",
|
|
3743
|
-
onClick: D,
|
|
3744
|
-
"aria-label": "End call",
|
|
3745
|
-
children: /* @__PURE__ */ w(Ar, {})
|
|
3746
|
-
}
|
|
3747
|
-
)
|
|
3743
|
+
] })
|
|
3748
3744
|
] })
|
|
3749
|
-
] })
|
|
3745
|
+
] }),
|
|
3746
|
+
/* @__PURE__ */ w(
|
|
3747
|
+
"a",
|
|
3748
|
+
{
|
|
3749
|
+
class: "anam-watermark",
|
|
3750
|
+
href: "https://anam.ai",
|
|
3751
|
+
target: "_blank",
|
|
3752
|
+
rel: "noopener noreferrer",
|
|
3753
|
+
children: /* @__PURE__ */ w("svg", { width: "48", height: "16", viewBox: "0 0 86 29", fill: "white", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
3754
|
+
/* @__PURE__ */ w("path", { d: "M18.1491 28.1986L16.2127 21.63L6.3408 21.63L4.40439 28.1986H0L9.03659 -1.79687L13.4789 -1.79687L22.5535 28.1986H18.1491ZM7.47986 17.8331L15.0736 17.8331L11.2767 4.96161L7.47986 17.8331Z" }),
|
|
3755
|
+
/* @__PURE__ */ w("path", { d: "M24.7666 28.1984L24.7666 7.69518L39.5745 7.69518V28.1984L35.3979 28.1984V11.4921L28.9432 11.4921L28.9432 28.1984H24.7666Z" }),
|
|
3756
|
+
/* @__PURE__ */ w("path", { d: "M61.0239 28.1984V7.69518L85.7037 7.69518V28.1984H81.5271V11.4921L75.4521 11.4921V28.1984L71.2755 28.1984V11.4921L65.2005 11.4921V28.1984H61.0239Z" }),
|
|
3757
|
+
/* @__PURE__ */ w("path", { d: "M42.8948 7.69518L57.7026 7.69518V28.1984L53.5261 28.1984V27.1353C52.4629 28.0466 51.0201 28.5781 49.3495 28.5781C45.4007 28.5781 42.8948 25.7305 42.8948 21.2501C42.8948 16.8457 45.4007 14.074 49.3495 14.074C51.0201 14.074 52.4629 14.5676 53.5261 15.4788V11.3022L42.8948 11.3022V7.69518ZM50.4885 24.7812C52.6148 24.7812 53.9437 23.4143 53.9057 21.2501C53.8678 19.0859 52.5389 17.681 50.4885 17.681C48.4003 17.681 47.0713 19.0859 47.0713 21.2501C47.0713 23.4143 48.4003 24.7812 50.4885 24.7812Z" })
|
|
3758
|
+
] })
|
|
3759
|
+
}
|
|
3760
|
+
)
|
|
3750
3761
|
] });
|
|
3751
3762
|
}
|
|
3752
|
-
function
|
|
3753
|
-
const e = Ze(null), n =
|
|
3763
|
+
function Tr(t) {
|
|
3764
|
+
const e = Ze(null), n = Gi(!1);
|
|
3754
3765
|
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.");
|
|
3755
3766
|
const o = t["session-token"] ? void 0 : t["agent-id"], c = vr(o, t["api-base-url"], t["session-token"]), a = Ie(
|
|
3756
3767
|
() => yr(t),
|
|
3757
|
-
[t.inline, t.layout, t.position, t["ui-mute-button"], t["ui-text-input"], t["ui-captions"]]
|
|
3768
|
+
[t.inline, t.layout, t.position, t["ui-mute-button"], t["ui-text-input"], t["ui-captions"], t["call-to-action"]]
|
|
3758
3769
|
), u = Ie(() => {
|
|
3759
3770
|
const b = c.serverConfig.value, T = wt(wt({ ...ri }, b ?? {}), a);
|
|
3760
3771
|
return T.layout === "orb" && (T.inline = !1), T;
|
|
@@ -3777,7 +3788,7 @@ function Rr(t) {
|
|
|
3777
3788
|
C && n.value && A === "idle" && y.current && (y.current = !1, n.value = !1);
|
|
3778
3789
|
}, [A]);
|
|
3779
3790
|
const I = C ? n.value : !0;
|
|
3780
|
-
return c.isReady.value ? /* @__PURE__ */ w(
|
|
3791
|
+
return c.isReady.value ? /* @__PURE__ */ w(_e, { children: [
|
|
3781
3792
|
/* @__PURE__ */ w("style", { children: di }),
|
|
3782
3793
|
/* @__PURE__ */ w(
|
|
3783
3794
|
"div",
|
|
@@ -3797,7 +3808,7 @@ function Rr(t) {
|
|
|
3797
3808
|
}
|
|
3798
3809
|
),
|
|
3799
3810
|
I && /* @__PURE__ */ w(
|
|
3800
|
-
|
|
3811
|
+
Ar,
|
|
3801
3812
|
{
|
|
3802
3813
|
config: u,
|
|
3803
3814
|
session: c,
|
|
@@ -3812,7 +3823,7 @@ function Rr(t) {
|
|
|
3812
3823
|
)
|
|
3813
3824
|
] }) : /* @__PURE__ */ w("style", { children: di });
|
|
3814
3825
|
}
|
|
3815
|
-
const
|
|
3826
|
+
const Rr = [
|
|
3816
3827
|
"agent-id",
|
|
3817
3828
|
// Persona ID -- required for session streaming + server config fetch
|
|
3818
3829
|
"api-base-url",
|
|
@@ -3831,11 +3842,13 @@ const Nr = [
|
|
|
3831
3842
|
// "true" | "false" -- show text input
|
|
3832
3843
|
"ui-captions",
|
|
3833
3844
|
// "true" | "false" -- show captions
|
|
3845
|
+
"call-to-action",
|
|
3846
|
+
// Custom CTA text for the start button
|
|
3834
3847
|
"avatar-url",
|
|
3835
3848
|
// Override avatar thumbnail (Lab preview)
|
|
3836
3849
|
"agent-name"
|
|
3837
3850
|
// Override persona name for CTA (Lab preview)
|
|
3838
|
-
],
|
|
3851
|
+
], xr = {
|
|
3839
3852
|
SESSION_STARTED: "anam-agent:session-started",
|
|
3840
3853
|
SESSION_ENDED: "anam-agent:session-ended",
|
|
3841
3854
|
MESSAGE_RECEIVED: "anam-agent:message-received",
|
|
@@ -3847,13 +3860,13 @@ const Nr = [
|
|
|
3847
3860
|
MIC_UNMUTED: "anam-agent:mic-unmuted"
|
|
3848
3861
|
};
|
|
3849
3862
|
function hi(t = "anam-agent") {
|
|
3850
|
-
_n(
|
|
3863
|
+
_n(Tr, t, [...Rr], {
|
|
3851
3864
|
shadow: !0
|
|
3852
3865
|
});
|
|
3853
3866
|
}
|
|
3854
3867
|
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => hi()) : hi());
|
|
3855
3868
|
export {
|
|
3856
3869
|
ri as DefaultConfig,
|
|
3857
|
-
|
|
3870
|
+
xr as WidgetEventNames,
|
|
3858
3871
|
hi as registerWidget
|
|
3859
3872
|
};
|