@pagelines/sdk 1.0.822 → 1.0.824
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/AgentWrap.js +136 -96
- package/dist/AgentWrap.js.map +1 -1
- package/dist/agent/voice/provider.d.ts +14 -1
- package/dist/agent/voice/providers/livekit/provider.d.ts +7 -2
- package/dist/agent/voice/voice-session-client.d.ts +12 -6
- package/dist/agent.js +74 -53
- package/dist/agent.js.map +1 -1
- package/dist/contract.js +1 -0
- package/dist/contract.js.map +1 -1
- package/dist/provider.js +4 -1
- package/dist/provider.js.map +1 -1
- package/dist/provider2.js +1 -1
- package/dist/provider3.js +29 -14
- package/dist/provider3.js.map +1 -1
- package/dist/sdk.css +1 -1
- package/package.json +1 -1
package/dist/AgentWrap.js
CHANGED
|
@@ -1376,7 +1376,7 @@ X || (X = function freeze(e) {
|
|
|
1376
1376
|
}), st || (st = function construct(e) {
|
|
1377
1377
|
return new e(...[...arguments].slice(1));
|
|
1378
1378
|
});
|
|
1379
|
-
var ct = unapply(Array.prototype.forEach), lt = unapply(Array.prototype.lastIndexOf), ut = unapply(Array.prototype.pop), dt = unapply(Array.prototype.push), ft = unapply(Array.prototype.splice), pt = Array.isArray, mt = unapply(String.prototype.toLowerCase), ht = unapply(String.prototype.toString), gt = unapply(String.prototype.match), _t = unapply(String.prototype.replace), vt = unapply(String.prototype.indexOf), yt = unapply(String.prototype.trim), bt = unapply(Number.prototype.toString), xt = unapply(Boolean.prototype.toString), St = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), Ct = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString),
|
|
1379
|
+
var ct = unapply(Array.prototype.forEach), lt = unapply(Array.prototype.lastIndexOf), ut = unapply(Array.prototype.pop), dt = unapply(Array.prototype.push), ft = unapply(Array.prototype.splice), pt = Array.isArray, mt = unapply(String.prototype.toLowerCase), ht = unapply(String.prototype.toString), gt = unapply(String.prototype.match), _t = unapply(String.prototype.replace), vt = unapply(String.prototype.indexOf), yt = unapply(String.prototype.trim), bt = unapply(Number.prototype.toString), xt = unapply(Boolean.prototype.toString), St = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), Ct = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), Z = unapply(Object.prototype.hasOwnProperty), Q = unapply(Object.prototype.toString), wt = unapply(RegExp.prototype.test), Tt = unconstruct(TypeError);
|
|
1380
1380
|
function unapply(e) {
|
|
1381
1381
|
return function(t) {
|
|
1382
1382
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1404,7 +1404,7 @@ function addToSet(e, t) {
|
|
|
1404
1404
|
return e;
|
|
1405
1405
|
}
|
|
1406
1406
|
function cleanArray(e) {
|
|
1407
|
-
for (let t = 0; t < e.length; t++)
|
|
1407
|
+
for (let t = 0; t < e.length; t++) Z(e, t) || (e[t] = null);
|
|
1408
1408
|
return e;
|
|
1409
1409
|
}
|
|
1410
1410
|
function clone(e) {
|
|
@@ -1412,7 +1412,7 @@ function clone(e) {
|
|
|
1412
1412
|
for (let r of Qe(e)) {
|
|
1413
1413
|
var n = _slicedToArray(r, 2);
|
|
1414
1414
|
let i = n[0], a = n[1];
|
|
1415
|
-
|
|
1415
|
+
Z(e, i) && (pt(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
|
|
1416
1416
|
}
|
|
1417
1417
|
return t;
|
|
1418
1418
|
}
|
|
@@ -1423,18 +1423,18 @@ function stringifyValue(e) {
|
|
|
1423
1423
|
case "boolean": return xt(e);
|
|
1424
1424
|
case "bigint": return St ? St(e) : "0";
|
|
1425
1425
|
case "symbol": return Ct ? Ct(e) : "Symbol()";
|
|
1426
|
-
case "undefined": return
|
|
1426
|
+
case "undefined": return Q(e);
|
|
1427
1427
|
case "function":
|
|
1428
1428
|
case "object": {
|
|
1429
|
-
if (e === null) return
|
|
1429
|
+
if (e === null) return Q(e);
|
|
1430
1430
|
let t = e, n = lookupGetter(t, "toString");
|
|
1431
1431
|
if (typeof n == "function") {
|
|
1432
1432
|
let e = n(t);
|
|
1433
|
-
return typeof e == "string" ? e :
|
|
1433
|
+
return typeof e == "string" ? e : Q(e);
|
|
1434
1434
|
}
|
|
1435
|
-
return
|
|
1435
|
+
return Q(e);
|
|
1436
1436
|
}
|
|
1437
|
-
default: return
|
|
1437
|
+
default: return Q(e);
|
|
1438
1438
|
}
|
|
1439
1439
|
}
|
|
1440
1440
|
function lookupGetter(e, t) {
|
|
@@ -1453,7 +1453,7 @@ function lookupGetter(e, t) {
|
|
|
1453
1453
|
}
|
|
1454
1454
|
function isRegex(e) {
|
|
1455
1455
|
try {
|
|
1456
|
-
return
|
|
1456
|
+
return wt(e, ""), !0;
|
|
1457
1457
|
} catch {
|
|
1458
1458
|
return !1;
|
|
1459
1459
|
}
|
|
@@ -1574,7 +1574,7 @@ var Et = X(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
1574
1574
|
uponSanitizeShadowNode: []
|
|
1575
1575
|
};
|
|
1576
1576
|
}, tn = function _resolveSetOption(e, t, n, r) {
|
|
1577
|
-
return
|
|
1577
|
+
return Z(e, t) && pt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
|
|
1578
1578
|
};
|
|
1579
1579
|
function createDOMPurify() {
|
|
1580
1580
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Qt(), DOMPurify = (e) => createDOMPurify(e);
|
|
@@ -1689,20 +1689,20 @@ function createDOMPurify() {
|
|
|
1689
1689
|
"font",
|
|
1690
1690
|
"a",
|
|
1691
1691
|
"script"
|
|
1692
|
-
]), St = null, Ct = ["application/xhtml+xml", "text/html"],
|
|
1692
|
+
]), St = null, Ct = ["application/xhtml+xml", "text/html"], Q = null, nn = null, rn = t.createElement("form"), an = function isRegexOrFunction(e) {
|
|
1693
1693
|
return e instanceof RegExp || e instanceof Function;
|
|
1694
1694
|
}, on = function _parseConfig() {
|
|
1695
1695
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1696
1696
|
if (nn && nn === e) return;
|
|
1697
|
-
(!e || typeof e != "object") && (e = {}), e = clone(e), St = Ct.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE,
|
|
1698
|
-
transform:
|
|
1697
|
+
(!e || typeof e != "object") && (e = {}), e = clone(e), St = Ct.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = St === "application/xhtml+xml" ? ht : mt, G = tn(e, "ALLOWED_TAGS", _e, { transform: Q }), K = tn(e, "ALLOWED_ATTR", ve, { transform: Q }), J = tn(e, "ALLOWED_NAMESPACES", tt, { transform: ht }), qe = tn(e, "ADD_URI_SAFE_ATTR", Je, {
|
|
1698
|
+
transform: Q,
|
|
1699
1699
|
base: Je
|
|
1700
1700
|
}), Ge = tn(e, "ADD_DATA_URI_TAGS", Ke, {
|
|
1701
|
-
transform:
|
|
1701
|
+
transform: Q,
|
|
1702
1702
|
base: Ke
|
|
1703
|
-
}), Ue = tn(e, "FORBID_CONTENTS", We, { transform:
|
|
1704
|
-
let t =
|
|
1705
|
-
if (q = rt(null),
|
|
1703
|
+
}), Ue = tn(e, "FORBID_CONTENTS", We, { transform: Q }), ye = tn(e, "FORBID_TAGS", clone({}), { transform: Q }), be = tn(e, "FORBID_ATTR", clone({}), { transform: Q }), He = Z(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, Ce = e.ALLOW_ARIA_ATTR !== !1, we = e.ALLOW_DATA_ATTR !== !1, Te = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ee = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, De = e.SAFE_FOR_TEMPLATES || !1, Oe = e.SAFE_FOR_XML !== !1, ke = e.WHOLE_DOCUMENT || !1, Pe = e.RETURN_DOM || !1, Fe = e.RETURN_DOM_FRAGMENT || !1, Ie = e.RETURN_TRUSTED_TYPE || !1, Ne = e.FORCE_BODY || !1, Le = e.SANITIZE_DOM !== !1, Re = e.SANITIZE_NAMED_PROPS || !1, Be = e.KEEP_CONTENT !== !1, Ve = e.IN_PLACE || !1, he = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Ht, $e = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Ze, at = Z(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, it), bt = Z(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, st);
|
|
1704
|
+
let t = Z(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : rt(null);
|
|
1705
|
+
if (q = rt(null), Z(t, "tagNameCheck") && an(t.tagNameCheck) && (q.tagNameCheck = t.tagNameCheck), Z(t, "attributeNameCheck") && an(t.attributeNameCheck) && (q.attributeNameCheck = t.attributeNameCheck), Z(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (q.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), nt(q), De && (we = !1), Fe && (Pe = !0), He && (G = addToSet({}, Mt), K = rt(null), He.html === !0 && (addToSet(G, Et), addToSet(K, Nt)), He.svg === !0 && (addToSet(G, Dt), addToSet(K, Pt), addToSet(K, It)), He.svgFilters === !0 && (addToSet(G, Ot), addToSet(K, Pt), addToSet(K, It)), He.mathMl === !0 && (addToSet(G, At), addToSet(K, Ft), addToSet(K, It))), Se.tagCheck = null, Se.attributeCheck = null, Z(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Se.tagCheck = e.ADD_TAGS : pt(e.ADD_TAGS) && (G === _e && (G = clone(G)), addToSet(G, e.ADD_TAGS, Q))), Z(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Se.attributeCheck = e.ADD_ATTR : pt(e.ADD_ATTR) && (K === ve && (K = clone(K)), addToSet(K, e.ADD_ATTR, Q))), Z(e, "ADD_URI_SAFE_ATTR") && pt(e.ADD_URI_SAFE_ATTR) && addToSet(qe, e.ADD_URI_SAFE_ATTR, Q), Z(e, "FORBID_CONTENTS") && pt(e.FORBID_CONTENTS) && (Ue === We && (Ue = clone(Ue)), addToSet(Ue, e.FORBID_CONTENTS, Q)), Z(e, "ADD_FORBID_CONTENTS") && pt(e.ADD_FORBID_CONTENTS) && (Ue === We && (Ue = clone(Ue)), addToSet(Ue, e.ADD_FORBID_CONTENTS, Q)), Be && (G["#text"] = !0), ke && addToSet(G, [
|
|
1706
1706
|
"html",
|
|
1707
1707
|
"head",
|
|
1708
1708
|
"body"
|
|
@@ -1785,7 +1785,7 @@ function createDOMPurify() {
|
|
|
1785
1785
|
let t = b(e);
|
|
1786
1786
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
1787
1787
|
let r = t[n], i = r && r.name;
|
|
1788
|
-
if (!(typeof i != "string" || K[
|
|
1788
|
+
if (!(typeof i != "string" || K[Q(i)])) try {
|
|
1789
1789
|
e.removeAttribute(i);
|
|
1790
1790
|
} catch {}
|
|
1791
1791
|
}
|
|
@@ -1802,14 +1802,14 @@ function createDOMPurify() {
|
|
|
1802
1802
|
let t = [e];
|
|
1803
1803
|
for (; t.length > 0;) {
|
|
1804
1804
|
let e = t.pop(), n = x ? x(e) : e.nodeType;
|
|
1805
|
-
if (n === Zt.processingInstruction || n === Zt.comment &&
|
|
1805
|
+
if (n === Zt.processingInstruction || n === Zt.comment && wt(Jt, e.data)) {
|
|
1806
1806
|
try {
|
|
1807
1807
|
m(e);
|
|
1808
1808
|
} catch {}
|
|
1809
1809
|
continue;
|
|
1810
1810
|
}
|
|
1811
1811
|
if (n === Zt.element) {
|
|
1812
|
-
let t = e, n =
|
|
1812
|
+
let t = e, n = Q(S ? S(e) : e.nodeName);
|
|
1813
1813
|
try {
|
|
1814
1814
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
|
|
1815
1815
|
} catch {}
|
|
@@ -1851,7 +1851,7 @@ function createDOMPurify() {
|
|
|
1851
1851
|
});
|
|
1852
1852
|
}, Cn = function _isClobbered(e) {
|
|
1853
1853
|
let t = S ? S(e) : null;
|
|
1854
|
-
return typeof t != "string" ||
|
|
1854
|
+
return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== b(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== x(e) || e.childNodes !== _(e);
|
|
1855
1855
|
}, wn = function _isDocumentFragment(e) {
|
|
1856
1856
|
if (!x || typeof e != "object" || !e) return !1;
|
|
1857
1857
|
try {
|
|
@@ -1873,9 +1873,9 @@ function createDOMPurify() {
|
|
|
1873
1873
|
});
|
|
1874
1874
|
}
|
|
1875
1875
|
let En = function _isUnsafeNode(e, t) {
|
|
1876
|
-
return !!(Oe && e.hasChildNodes() && !Tn(e.firstElementChild) &&
|
|
1876
|
+
return !!(Oe && e.hasChildNodes() && !Tn(e.firstElementChild) && wt(qt, e.textContent) && wt(qt, e.innerHTML) || Oe && e.namespaceURI === Ze && t === "style" && Tn(e.firstElementChild) || e.nodeType === Zt.processingInstruction || Oe && e.nodeType === Zt.comment && wt(Jt, e.data));
|
|
1877
1877
|
}, Dn = function _sanitizeDisallowedNode(e, t) {
|
|
1878
|
-
if (!ye[t] && jn(t) && (q.tagNameCheck instanceof RegExp &&
|
|
1878
|
+
if (!ye[t] && jn(t) && (q.tagNameCheck instanceof RegExp && wt(q.tagNameCheck, t) || q.tagNameCheck instanceof Function && q.tagNameCheck(t))) return !1;
|
|
1879
1879
|
if (Be && !Ue[t]) {
|
|
1880
1880
|
let t = v(e), n = _(e);
|
|
1881
1881
|
if (n && t) {
|
|
@@ -1890,7 +1890,7 @@ function createDOMPurify() {
|
|
|
1890
1890
|
}, On = function _sanitizeElements(e, t) {
|
|
1891
1891
|
if (_executeHooks(H.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
|
|
1892
1892
|
if (Cn(e)) return pn(e), !0;
|
|
1893
|
-
let n =
|
|
1893
|
+
let n = Q(S ? S(e) : e.nodeName);
|
|
1894
1894
|
if (_executeHooks(H.uponSanitizeElement, e, {
|
|
1895
1895
|
tagName: n,
|
|
1896
1896
|
allowedTags: G
|
|
@@ -1900,7 +1900,7 @@ function createDOMPurify() {
|
|
|
1900
1900
|
let t = Dn(e, n);
|
|
1901
1901
|
return t === !1 && _executeHooks(H.afterSanitizeElements, e, null), t;
|
|
1902
1902
|
}
|
|
1903
|
-
if ((x ? x(e) : e.nodeType) === Zt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") &&
|
|
1903
|
+
if ((x ? x(e) : e.nodeType) === Zt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && wt(Yt, e.innerHTML)) return pn(e), !0;
|
|
1904
1904
|
if (De && e.nodeType === Zt.text) {
|
|
1905
1905
|
let t = xn(e.textContent);
|
|
1906
1906
|
e.textContent !== t && (dt(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
|
|
@@ -1909,10 +1909,10 @@ function createDOMPurify() {
|
|
|
1909
1909
|
}, kn = function _isValidAttribute(e, n, r) {
|
|
1910
1910
|
if (be[n] || Oe && n === "patchsrc" || Oe && n === "for" && e !== "label" && e !== "output" || Le && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
|
|
1911
1911
|
let i = K[n] || Se.attributeCheck instanceof Function && Se.attributeCheck(n, e);
|
|
1912
|
-
if (!(we &&
|
|
1912
|
+
if (!(we && wt(ue, n)) && !(Ce && wt(U, n))) {
|
|
1913
1913
|
if (!i) {
|
|
1914
|
-
if (!(jn(e) && (q.tagNameCheck instanceof RegExp &&
|
|
1915
|
-
} else if (!qe[n] && !
|
|
1914
|
+
if (!(jn(e) && (q.tagNameCheck instanceof RegExp && wt(q.tagNameCheck, e) || q.tagNameCheck instanceof Function && q.tagNameCheck(e)) && (q.attributeNameCheck instanceof RegExp && wt(q.attributeNameCheck, n) || q.attributeNameCheck instanceof Function && q.attributeNameCheck(n, e)) || n === "is" && q.allowCustomizedBuiltInElements && (q.tagNameCheck instanceof RegExp && wt(q.tagNameCheck, r) || q.tagNameCheck instanceof Function && q.tagNameCheck(r)))) return !1;
|
|
1915
|
+
} else if (!qe[n] && !wt(he, _t(r, pe, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && vt(r, "data:") === 0 && Ge[e]) && !(Te && !wt(de, _t(r, pe, ""))) && r) return !1;
|
|
1916
1916
|
}
|
|
1917
1917
|
return !0;
|
|
1918
1918
|
}, An = addToSet({}, [
|
|
@@ -1925,7 +1925,7 @@ function createDOMPurify() {
|
|
|
1925
1925
|
"font-face-uri",
|
|
1926
1926
|
"missing-glyph"
|
|
1927
1927
|
]), jn = function _isBasicCustomElement(e) {
|
|
1928
|
-
return !An[mt(e)] &&
|
|
1928
|
+
return !An[mt(e)] && wt(W, e);
|
|
1929
1929
|
}, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
|
|
1930
1930
|
if (C && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
1931
1931
|
case "TrustedHTML": return ne(r);
|
|
@@ -1948,10 +1948,10 @@ function createDOMPurify() {
|
|
|
1948
1948
|
keepAttr: !0,
|
|
1949
1949
|
allowedAttributes: K,
|
|
1950
1950
|
forceKeepAttr: void 0
|
|
1951
|
-
}, r = t.length, i =
|
|
1951
|
+
}, r = t.length, i = Q(e.nodeName);
|
|
1952
1952
|
for (; r--;) {
|
|
1953
|
-
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u =
|
|
1954
|
-
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(H.uponSanitizeAttribute, e, n), p = n.attrValue, Re && (u === "id" || u === "name") && vt(p, ze) !== 0 && (hn(o, e), p = ze + p), Oe &&
|
|
1953
|
+
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Q(o), f = c, p = o === "value" ? f : yt(f);
|
|
1954
|
+
if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(H.uponSanitizeAttribute, e, n), p = n.attrValue, Re && (u === "id" || u === "name") && vt(p, ze) !== 0 && (hn(o, e), p = ze + p), Oe && wt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
|
|
1955
1955
|
hn(o, e);
|
|
1956
1956
|
continue;
|
|
1957
1957
|
}
|
|
@@ -1964,7 +1964,7 @@ function createDOMPurify() {
|
|
|
1964
1964
|
hn(o, e);
|
|
1965
1965
|
continue;
|
|
1966
1966
|
}
|
|
1967
|
-
if (!Ee &&
|
|
1967
|
+
if (!Ee && wt(Xt, p)) {
|
|
1968
1968
|
hn(o, e);
|
|
1969
1969
|
continue;
|
|
1970
1970
|
}
|
|
@@ -2001,7 +2001,7 @@ function createDOMPurify() {
|
|
|
2001
2001
|
});
|
|
2002
2002
|
if (r) {
|
|
2003
2003
|
let e = S ? S(n) : null;
|
|
2004
|
-
if (typeof e == "string" &&
|
|
2004
|
+
if (typeof e == "string" && Q(e) === "template") {
|
|
2005
2005
|
let e = n.content;
|
|
2006
2006
|
wn(e) && t.push({
|
|
2007
2007
|
node: e,
|
|
@@ -2031,7 +2031,7 @@ function createDOMPurify() {
|
|
|
2031
2031
|
vn(e);
|
|
2032
2032
|
let t = S ? S(e) : e.nodeName;
|
|
2033
2033
|
if (typeof t == "string") {
|
|
2034
|
-
let n =
|
|
2034
|
+
let n = Q(t);
|
|
2035
2035
|
if (!G[n] || ye[n]) throw mn(e), Tt("root node is forbidden and cannot be sanitized in-place");
|
|
2036
2036
|
}
|
|
2037
2037
|
if (Cn(e)) throw mn(e), Tt("root node is clobbered and cannot be sanitized in-place");
|
|
@@ -2063,7 +2063,7 @@ function createDOMPurify() {
|
|
|
2063
2063
|
return (K.shadowroot || K.shadowrootmode) && (o = B.call(n, o, !0)), o;
|
|
2064
2064
|
}
|
|
2065
2065
|
let f = ke ? r.outerHTML : r.innerHTML;
|
|
2066
|
-
return ke && G["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name &&
|
|
2066
|
+
return ke && G["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && wt(Gt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), De && (f = xn(f)), C && Ie ? ne(f) : f;
|
|
2067
2067
|
}, DOMPurify.setConfig = function() {
|
|
2068
2068
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2069
2069
|
on(e), Ae = !0, je = G, Me = K;
|
|
@@ -2071,12 +2071,12 @@ function createDOMPurify() {
|
|
|
2071
2071
|
nn = null, Ae = !1, je = null, Me = null, C = k, T = "";
|
|
2072
2072
|
}, DOMPurify.isValidAttribute = function(e, t, n) {
|
|
2073
2073
|
nn || on({});
|
|
2074
|
-
let r =
|
|
2074
|
+
let r = Q(e), i = Q(t);
|
|
2075
2075
|
return kn(r, i, n);
|
|
2076
2076
|
}, DOMPurify.addHook = function(e, t) {
|
|
2077
|
-
typeof t == "function" &&
|
|
2077
|
+
typeof t == "function" && Z(H, e) && dt(H[e], t);
|
|
2078
2078
|
}, DOMPurify.removeHook = function(e, t) {
|
|
2079
|
-
if (
|
|
2079
|
+
if (Z(H, e)) {
|
|
2080
2080
|
if (t !== void 0) {
|
|
2081
2081
|
let n = lt(H[e], t);
|
|
2082
2082
|
return n === -1 ? void 0 : ft(H[e], n, 1)[0];
|
|
@@ -2084,7 +2084,7 @@ function createDOMPurify() {
|
|
|
2084
2084
|
return ut(H[e]);
|
|
2085
2085
|
}
|
|
2086
2086
|
}, DOMPurify.removeHooks = function(e) {
|
|
2087
|
-
|
|
2087
|
+
Z(H, e) && (H[e] = []);
|
|
2088
2088
|
}, DOMPurify.removeAllHooks = function() {
|
|
2089
2089
|
H = en();
|
|
2090
2090
|
}, DOMPurify;
|
|
@@ -4641,71 +4641,111 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
|
|
|
4641
4641
|
},
|
|
4642
4642
|
emits: ["end"],
|
|
4643
4643
|
setup(e, { expose: t, emit: n }) {
|
|
4644
|
-
let r = n, i = F(0), a = F("mic"), o = F("idle"), s = F(!1), c = F(!1), u = F({
|
|
4644
|
+
let r = n, i = F(0), a = F("mic"), o = F("idle"), s = F(!1), c = F(!1), u = F({
|
|
4645
|
+
user: !1,
|
|
4646
|
+
agent: !1
|
|
4647
|
+
}), f = F({ active: !1 }), p = B(!1), m = B(!1), _ = B(), te = se("endButton"), b = se("muteButton"), C = !1, k, A = {
|
|
4648
|
+
connecting: {
|
|
4649
|
+
label: "Connecting",
|
|
4650
|
+
tone: "bg-amber-500",
|
|
4651
|
+
waits: !0,
|
|
4652
|
+
showsText: !1
|
|
4653
|
+
},
|
|
4654
|
+
listening: {
|
|
4655
|
+
label: "Listening",
|
|
4656
|
+
tone: "bg-green-500",
|
|
4657
|
+
waits: !1,
|
|
4658
|
+
showsText: !1
|
|
4659
|
+
},
|
|
4660
|
+
thinking: {
|
|
4661
|
+
label: "Thinking",
|
|
4662
|
+
tone: "bg-amber-500",
|
|
4663
|
+
waits: !0,
|
|
4664
|
+
showsText: !1
|
|
4665
|
+
},
|
|
4666
|
+
working: {
|
|
4667
|
+
label: "Working",
|
|
4668
|
+
tone: "bg-primary-500",
|
|
4669
|
+
waits: !0,
|
|
4670
|
+
showsText: !0
|
|
4671
|
+
},
|
|
4672
|
+
speaking: {
|
|
4673
|
+
label: "Speaking",
|
|
4674
|
+
tone: "bg-primary-500",
|
|
4675
|
+
waits: !1,
|
|
4676
|
+
showsText: !1
|
|
4677
|
+
},
|
|
4678
|
+
error: {
|
|
4679
|
+
label: "Connection problem",
|
|
4680
|
+
tone: "bg-red-500",
|
|
4681
|
+
waits: !1,
|
|
4682
|
+
showsText: !0,
|
|
4683
|
+
visibleText: "Connection lost"
|
|
4684
|
+
}
|
|
4685
|
+
}, ne = v(() => s.value ? "error" : o.value === "live" ? u.value.agent ? "speaking" : u.value.user ? "listening" : f.value.active ? "working" : c.value ? "thinking" : "listening" : "connecting"), ae = v(() => A[ne.value]), R = v(() => ae.value.waits), oe = [
|
|
4645
4686
|
0,
|
|
4646
4687
|
2,
|
|
4647
4688
|
4,
|
|
4648
4689
|
6,
|
|
4649
4690
|
8
|
|
4650
|
-
],
|
|
4691
|
+
], ce = oe.map(() => 0), ue = F(ce), U = F(ce), de = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : void 0, W = typeof window < "u" && typeof window.requestAnimationFrame == "function" ? (e) => window.requestAnimationFrame(e) : (e) => setTimeout(() => e(performance.now()), 16), he = 0, G = 0;
|
|
4651
4692
|
async function end() {
|
|
4652
|
-
|
|
4693
|
+
C = !0, await _.value?.end();
|
|
4653
4694
|
}
|
|
4654
4695
|
t({ end });
|
|
4655
4696
|
function easeFrame(e) {
|
|
4656
|
-
|
|
4657
|
-
let t = Math.min(64, Math.max(0, e -
|
|
4658
|
-
|
|
4697
|
+
he = 0;
|
|
4698
|
+
let t = Math.min(64, Math.max(0, e - G));
|
|
4699
|
+
G = e;
|
|
4659
4700
|
let ease = (e, n) => {
|
|
4660
4701
|
let r = n > e ? Ai : ji;
|
|
4661
4702
|
return e + (n - e) * (1 - Math.exp(-t / r));
|
|
4662
4703
|
};
|
|
4663
|
-
|
|
4704
|
+
U.value = U.value.map((e, t) => ease(e, ue.value[t] ?? 0)), !U.value.every((e, t) => Math.abs((ue.value[t] ?? 0) - e) <= 5e-4) || ue.value.some((e) => e > 0) ? he = W(easeFrame) : U.value = ce;
|
|
4664
4705
|
}
|
|
4665
4706
|
function followLevel(e) {
|
|
4666
|
-
let gate = (e) => Math.max(0, e - ki) / (1 - ki);
|
|
4667
|
-
if (
|
|
4668
|
-
|
|
4707
|
+
let gate = (e) => Math.max(0, e - ki) / (1 - ki), t = p.value && a.value === "mic";
|
|
4708
|
+
if (ue.value = oe.map((n) => t ? 0 : gate(Math.min(1, Math.max(0, e?.[n] ?? i.value)))), de?.matches) {
|
|
4709
|
+
U.value = ue.value;
|
|
4669
4710
|
return;
|
|
4670
4711
|
}
|
|
4671
|
-
|
|
4672
|
-
}
|
|
4673
|
-
let
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
working: "Working",
|
|
4678
|
-
speaking: "Speaking",
|
|
4679
|
-
error: "Connection problem"
|
|
4680
|
-
}, _e = v(() => k.value === "working" ? u.value.description || "Working on it" : G[k.value]), K = v(() => k.value === "working" || k.value === "error" ? _e.value : "");
|
|
4712
|
+
he || (G = performance.now(), he = W(easeFrame));
|
|
4713
|
+
}
|
|
4714
|
+
let _e = v(() => U.value.map((e) => Math.round((Ei + Math.min(1, Math.max(0, e)) ** Oi * Di) * 10) / 10)), K = v(() => p.value && ne.value === "listening" ? "bg-theme-400" : ae.value.tone), ve = v(() => ne.value === "working" ? f.value.description || "Working on it" : ae.value.label), q = v(() => {
|
|
4715
|
+
let e = ae.value;
|
|
4716
|
+
return e.showsText ? ne.value === "working" ? ve.value : e.visibleText ?? e.label : "";
|
|
4717
|
+
});
|
|
4681
4718
|
function emitEnd() {
|
|
4682
|
-
|
|
4719
|
+
C || (C = !0, r("end"));
|
|
4683
4720
|
}
|
|
4684
4721
|
function trapFocus(e) {
|
|
4685
|
-
e.shiftKey && document.activeElement ===
|
|
4722
|
+
e.shiftKey && document.activeElement === te.value ? (e.preventDefault(), b.value?.focus()) : !e.shiftKey && document.activeElement === b.value && (e.preventDefault(), te.value?.focus());
|
|
4686
4723
|
}
|
|
4687
4724
|
async function toggleMute() {
|
|
4688
|
-
let e =
|
|
4689
|
-
if (!e ||
|
|
4690
|
-
|
|
4725
|
+
let e = _.value;
|
|
4726
|
+
if (!e || m.value) return;
|
|
4727
|
+
m.value = !0;
|
|
4691
4728
|
let t = await e.toggleMuted();
|
|
4692
|
-
t !== void 0 && (
|
|
4729
|
+
t !== void 0 && (p.value = t, followLevel(void 0)), m.value = !1;
|
|
4693
4730
|
}
|
|
4694
4731
|
return re(async () => {
|
|
4695
|
-
|
|
4732
|
+
te.value?.focus({ preventScroll: !0 });
|
|
4696
4733
|
let t = e.chatController?.createVoiceClient({
|
|
4697
4734
|
onLevel: (e) => {
|
|
4698
4735
|
a.value = e.source, i.value = e.level, followLevel(e.bands);
|
|
4699
4736
|
},
|
|
4700
4737
|
onStateChange: (e) => {
|
|
4701
|
-
o.value = e, e === "ended" && (s.value ?
|
|
4738
|
+
o.value = e, e === "ended" && (s.value ? k = setTimeout(emitEnd, 1600) : emitEnd());
|
|
4702
4739
|
},
|
|
4703
4740
|
onThinkingChange: (e) => {
|
|
4704
4741
|
c.value = e;
|
|
4705
4742
|
},
|
|
4706
|
-
|
|
4743
|
+
onSpeakingChange: (e) => {
|
|
4707
4744
|
u.value = e;
|
|
4708
4745
|
},
|
|
4746
|
+
onWorkChange: (e) => {
|
|
4747
|
+
f.value = e;
|
|
4748
|
+
},
|
|
4709
4749
|
onError: (t) => {
|
|
4710
4750
|
s.value = !0, e.chatController?.notify?.(voiceErrorMessage(t.code)), e.chatController?.logger?.warn("voice.session.failed", {
|
|
4711
4751
|
code: t.code,
|
|
@@ -4720,13 +4760,13 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
|
|
|
4720
4760
|
emitEnd();
|
|
4721
4761
|
return;
|
|
4722
4762
|
}
|
|
4723
|
-
|
|
4763
|
+
_.value = t, await t.start();
|
|
4724
4764
|
}), ie(() => {
|
|
4725
|
-
|
|
4765
|
+
C = !0, k && clearTimeout(k), he && typeof window < "u" && typeof window.cancelAnimationFrame == "function" && window.cancelAnimationFrame(he), he = 0, _.value?.end();
|
|
4726
4766
|
}), (t, n) => (P(), x("div", {
|
|
4727
4767
|
"data-test": "voice-mode",
|
|
4728
4768
|
"data-voice-state": o.value,
|
|
4729
|
-
"data-voice-activity":
|
|
4769
|
+
"data-voice-activity": ne.value,
|
|
4730
4770
|
class: "relative flex min-h-0 flex-1 flex-col overflow-hidden bg-[#0A1522] text-white",
|
|
4731
4771
|
onKeydown: pe(trapFocus, ["tab"])
|
|
4732
4772
|
}, [
|
|
@@ -4752,21 +4792,21 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
|
|
|
4752
4792
|
"is-light": !1,
|
|
4753
4793
|
class: "size-32"
|
|
4754
4794
|
}, null, 8, ["agent"])]),
|
|
4755
|
-
S("div", xi, [(P(!0), x(h, null, I(
|
|
4795
|
+
S("div", xi, [(P(!0), x(h, null, I(_e.value, (e, t) => (P(), x("span", {
|
|
4756
4796
|
key: t,
|
|
4757
4797
|
"data-test": "voice-histogram-bar",
|
|
4758
|
-
class: j(["w-[5px] rounded-full transition-colors duration-150", [
|
|
4798
|
+
class: j(["w-[5px] rounded-full transition-colors duration-150", [K.value, R.value ? "pl-voice-bar-wave" : ""]]),
|
|
4759
4799
|
style: M({
|
|
4760
4800
|
height: `${e}px`,
|
|
4761
|
-
...
|
|
4801
|
+
...R.value ? { animationDelay: `${t * 90}ms` } : {}
|
|
4762
4802
|
})
|
|
4763
4803
|
}, null, 6))), 128))]),
|
|
4764
|
-
S("div", Si, H(
|
|
4765
|
-
S("p", Ci, H(
|
|
4804
|
+
S("div", Si, H(ve.value), 1),
|
|
4805
|
+
S("p", Ci, H(q.value), 1)
|
|
4766
4806
|
]),
|
|
4767
4807
|
S("div", wi, [S("button", {
|
|
4768
4808
|
ref_key: "endButton",
|
|
4769
|
-
ref:
|
|
4809
|
+
ref: te,
|
|
4770
4810
|
type: "button",
|
|
4771
4811
|
"data-test": "voice-end-btn",
|
|
4772
4812
|
class: "flex size-16 cursor-pointer items-center justify-center rounded-full bg-white/10 text-white ring-1 ring-white/20 transition-colors hover:bg-white/15 active:bg-white/25",
|
|
@@ -4778,17 +4818,17 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
|
|
|
4778
4818
|
"aria-hidden": "true"
|
|
4779
4819
|
}, null, -1)])], 512), S("button", {
|
|
4780
4820
|
ref_key: "muteButton",
|
|
4781
|
-
ref:
|
|
4821
|
+
ref: b,
|
|
4782
4822
|
type: "button",
|
|
4783
4823
|
"data-test": "voice-mute-btn",
|
|
4784
|
-
class: j(["flex size-16 items-center justify-center rounded-full ring-1 transition-colors active:opacity-70", [
|
|
4785
|
-
disabled: o.value !== "live" ||
|
|
4786
|
-
"aria-label":
|
|
4787
|
-
"aria-pressed":
|
|
4788
|
-
title:
|
|
4824
|
+
class: j(["flex size-16 items-center justify-center rounded-full ring-1 transition-colors active:opacity-70", [p.value ? "bg-white text-[#050F19] ring-white" : "bg-white/10 text-white ring-white/20", o.value === "live" && !m.value ? "cursor-pointer" : "cursor-default opacity-50"]]),
|
|
4825
|
+
disabled: o.value !== "live" || m.value,
|
|
4826
|
+
"aria-label": p.value ? "Unmute microphone" : "Mute microphone",
|
|
4827
|
+
"aria-pressed": p.value,
|
|
4828
|
+
title: p.value ? "Unmute microphone" : "Mute microphone",
|
|
4789
4829
|
onClick: toggleMute
|
|
4790
4830
|
}, [S("i", {
|
|
4791
|
-
class: j([
|
|
4831
|
+
class: j([p.value ? "i-tabler-microphone-off" : "i-tabler-microphone", "size-[25px]"]),
|
|
4792
4832
|
"aria-hidden": "true"
|
|
4793
4833
|
}, null, 2)], 10, Ti)])
|
|
4794
4834
|
], 40, gi));
|
|
@@ -4797,7 +4837,7 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
|
|
|
4797
4837
|
let n = e.__vccOpts || e;
|
|
4798
4838
|
for (let [e, r] of t) n[e] = r;
|
|
4799
4839
|
return n;
|
|
4800
|
-
}, "default"), Pi = /*#__PURE__*/ Ni(Mi, [["__scopeId", "data-v-
|
|
4840
|
+
}, "default"), Pi = /*#__PURE__*/ Ni(Mi, [["__scopeId", "data-v-d175f3e2"]]), Fi = {
|
|
4801
4841
|
key: 0,
|
|
4802
4842
|
class: "pb-4"
|
|
4803
4843
|
}, Ii = {
|
|
@@ -5040,16 +5080,16 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
|
|
|
5040
5080
|
function isQueuedMessage(e) {
|
|
5041
5081
|
return Ie.value?.has(e) ?? !1;
|
|
5042
5082
|
}
|
|
5043
|
-
let Re = v(() => Ne.value === "stop" ? "Stop reply" : Fe.value ? "Send — answered after current work" : "Send message"), ze = v(() => Me.value && !Ae.value && !!ke.value?.canUseBrowserRecording), Be = v(() => ke.value?.isActive.value ?? !1), Ve = v(() => ke.value?.elapsedLabel.value ?? "0:00"), Ue = v(() => ke.value?.statusText.value ?? "Release to send"), We = v(() => ke.value?.state.value.phase === "sending" ? "Sending voice message" : Be.value ? "Release to send voice message" : "Hold to record voice message"), Ge = F(!1), Ke = F(), qe = F(), Je = F(), Ye = 0;
|
|
5044
|
-
ue(() => e.agent.avatar.value?.src, (e) => {
|
|
5045
|
-
let
|
|
5046
|
-
if (Je.value = void 0, !e || typeof Image > "u") return;
|
|
5047
|
-
let
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
},
|
|
5083
|
+
let Re = v(() => Ne.value === "stop" ? "Stop reply" : Fe.value ? "Send — answered after current work" : "Send message"), ze = v(() => Me.value && !Ae.value && !!ke.value?.canUseBrowserRecording), Be = v(() => ke.value?.isActive.value ?? !1), Ve = v(() => ke.value?.elapsedLabel.value ?? "0:00"), Ue = v(() => ke.value?.statusText.value ?? "Release to send"), We = v(() => ke.value?.state.value.phase === "sending" ? "Sending voice message" : Be.value ? "Release to send voice message" : "Hold to record voice message"), Ge = F(!1), Ke = F(), qe = F(), Je = F(), Ye = 0, Xe = v(() => e.chatController?.canStartVoice?.value ?? !1);
|
|
5084
|
+
ue([() => e.agent.avatar.value?.src, Xe], ([e, t]) => {
|
|
5085
|
+
let n = ++Ye;
|
|
5086
|
+
if (Je.value = void 0, !t || !e || typeof Image > "u") return;
|
|
5087
|
+
let r = new Image();
|
|
5088
|
+
r.onload = () => {
|
|
5089
|
+
n === Ye && (Je.value = e);
|
|
5090
|
+
}, r.src = e;
|
|
5051
5091
|
}, { immediate: !0 });
|
|
5052
|
-
let
|
|
5092
|
+
let Qe = v(() => Xe.value && !Ge.value && !Be.value && Ne.value === "idle"), $e = v(() => !u.value), et = v(() => $e.value ? `Voice available when ${e.agent.displayName.value || e.agent.name.value || "the assistant"} is awake` : "Start voice conversation");
|
|
5053
5093
|
function startVoiceConversation() {
|
|
5054
5094
|
!Qe.value || $e.value || (qe.value = Je.value, Ge.value = !0);
|
|
5055
5095
|
}
|
|
@@ -5568,7 +5608,7 @@ var gi = ["data-voice-state", "data-voice-activity"], _i = ["src"], vi = {
|
|
|
5568
5608
|
], 64))], !0)], 10, fa)
|
|
5569
5609
|
], 2));
|
|
5570
5610
|
}
|
|
5571
|
-
}), [["__scopeId", "data-v-
|
|
5611
|
+
}), [["__scopeId", "data-v-4b08d62d"]]), La = { class: "agent-wrap" }, Ra = {
|
|
5572
5612
|
key: 0,
|
|
5573
5613
|
class: "flex items-center justify-center h-full"
|
|
5574
5614
|
}, za = {
|