@tavus/widget 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3579,18 +3579,20 @@ var On = /* @__PURE__ */ a(((e) => {
3579
3579
  })), ir = /* @__PURE__ */ a(((e, t) => {
3580
3580
  var { normalizeIPv6: n, removeDotSegments: r, recomposeAuthority: i, normalizePercentEncoding: a, normalizePathEncoding: o, escapePreservingEscapes: s, reescapeHostDelimiters: c, isIPv4: l, nonSimpleDomain: u } = nr(), { SCHEMES: d, getSchemeHandler: f } = rr();
3581
3581
  function p(e, t) {
3582
- return typeof e == "string" ? e = S(e, t) : typeof e == "object" && (e = x(_(e, t), t)), e;
3582
+ return typeof e == "string" ? e = w(e, t) : typeof e == "object" && (e = C(_(e, t), t)), e;
3583
3583
  }
3584
3584
  function m(e, t, n) {
3585
- let r = n ? Object.assign({ scheme: "null" }, n) : { scheme: "null" }, i = h(x(e, r), x(t, r), r, !0);
3586
- return r.skipEscape = !0, _(i, r);
3585
+ let r = n ? Object.assign({ scheme: "null" }, n) : { scheme: "null" }, { parsed: i, malformedAuthorityOrPort: a } = S(e, r), { parsed: o, malformedAuthorityOrPort: s } = S(t, r);
3586
+ if (a || s) throw Error(i.error || o.error || "URI is malformed.");
3587
+ let c = h(i, o, r, !0);
3588
+ return r.skipEscape = !0, _(c, r);
3587
3589
  }
3588
3590
  function h(e, t, n, i) {
3589
3591
  let a = {};
3590
- return i || (e = x(_(e, n), n), t = x(_(t, n), n)), n ||= {}, !n.tolerant && t.scheme ? (a.scheme = t.scheme, a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.userinfo !== void 0 || t.host !== void 0 || t.port !== void 0 ? (a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.path ? (t.path[0] === "/" ? a.path = r(t.path) : ((e.userinfo !== void 0 || e.host !== void 0 || e.port !== void 0) && !e.path ? a.path = "/" + t.path : e.path ? a.path = e.path.slice(0, e.path.lastIndexOf("/") + 1) + t.path : a.path = t.path, a.path = r(a.path)), a.query = t.query) : (a.path = e.path, t.query === void 0 ? a.query = e.query : a.query = t.query), a.userinfo = e.userinfo, a.host = e.host, a.port = e.port), a.scheme = e.scheme), a.fragment = t.fragment, a;
3592
+ return i || (e = C(_(e, n), n), t = C(_(t, n), n)), n ||= {}, !n.tolerant && t.scheme ? (a.scheme = t.scheme, a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.userinfo !== void 0 || t.host !== void 0 || t.port !== void 0 ? (a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.path ? (t.path[0] === "/" ? a.path = r(t.path) : ((e.userinfo !== void 0 || e.host !== void 0 || e.port !== void 0) && !e.path ? a.path = "/" + t.path : e.path ? a.path = e.path.slice(0, e.path.lastIndexOf("/") + 1) + t.path : a.path = t.path, a.path = r(a.path)), a.query = t.query) : (a.path = e.path, t.query === void 0 ? a.query = e.query : a.query = t.query), a.userinfo = e.userinfo, a.host = e.host, a.port = e.port), a.scheme = e.scheme), a.fragment = t.fragment, a;
3591
3593
  }
3592
3594
  function g(e, t, n) {
3593
- let r = w(e, n), i = w(t, n);
3595
+ let r = te(e, n), i = te(t, n);
3594
3596
  return r !== void 0 && i !== void 0 && r.toLowerCase() === i.toLowerCase();
3595
3597
  }
3596
3598
  function _(e, t) {
@@ -3618,12 +3620,12 @@ var On = /* @__PURE__ */ a(((e) => {
3618
3620
  }
3619
3621
  return n.query !== void 0 && c.push("?", n.query), n.fragment !== void 0 && c.push("#", n.fragment), c.join("");
3620
3622
  }
3621
- var v = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3622
- function y(e, t) {
3623
+ var v = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u, y = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/, b = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
3624
+ function x(e, t) {
3623
3625
  if (t[2] !== void 0 && e.path && e.path[0] !== "/") return "URI path must start with \"/\" when authority is present.";
3624
3626
  if (typeof e.port == "number" && (e.port < 0 || e.port > 65535)) return "URI port is malformed.";
3625
3627
  }
3626
- function b(e, t) {
3628
+ function S(e, t) {
3627
3629
  let r = Object.assign({}, t), i = {
3628
3630
  scheme: void 0,
3629
3631
  userinfo: void 0,
@@ -3634,63 +3636,70 @@ var On = /* @__PURE__ */ a(((e) => {
3634
3636
  fragment: void 0
3635
3637
  }, a = !1, s = !1;
3636
3638
  r.reference === "suffix" && (e = r.scheme ? r.scheme + ":" + e : "//" + e);
3637
- let d = e.match(v);
3638
- if (d) {
3639
- i.scheme = d[1], i.userinfo = d[3], i.host = d[4], i.port = parseInt(d[5], 10), i.path = d[6] || "", i.query = d[7], i.fragment = d[8], isNaN(i.port) && (i.port = d[5]);
3640
- let t = y(i, d);
3639
+ let d = e.match(y);
3640
+ d !== null && d[1].indexOf("\\") !== -1 && (i.error = "URI authority must not contain a literal backslash.", a = !0);
3641
+ let p = e.match(b);
3642
+ if (p !== null) {
3643
+ let e = p[1], t = e.replace(/[\t\n\r]/g, "");
3644
+ t.length >= 2 && (t.slice(0, 2) === "//" ? e.length !== t.length && (i.error = i.error || "URI authority introducer must not contain whitespace.", a = !0) : (i.error = i.error || "URI authority must not contain a literal backslash.", a = !0));
3645
+ }
3646
+ let m = e.match(v);
3647
+ if (m) {
3648
+ i.scheme = m[1], i.userinfo = m[3], i.host = m[4], i.port = parseInt(m[5], 10), i.path = m[6] || "", i.query = m[7], i.fragment = m[8], isNaN(i.port) && (i.port = m[5]);
3649
+ let t = x(i, m);
3641
3650
  if (t !== void 0 && (i.error = i.error || t, a = !0), i.host) if (l(i.host) === !1) {
3642
3651
  let e = n(i.host);
3643
3652
  i.host = e.host.toLowerCase(), s = e.isIPV6;
3644
3653
  } else s = !0;
3645
3654
  i.scheme === void 0 && i.userinfo === void 0 && i.host === void 0 && i.port === void 0 && i.query === void 0 && !i.path ? i.reference = "same-document" : i.scheme === void 0 ? i.reference = "relative" : i.fragment === void 0 ? i.reference = "absolute" : i.reference = "uri", r.reference && r.reference !== "suffix" && r.reference !== i.reference && (i.error = i.error || "URI is not a " + r.reference + " reference.");
3646
- let p = f(r.scheme || i.scheme);
3647
- if (!r.unicodeSupport && (!p || !p.unicodeSupport) && i.host && (r.domainHost || p && p.domainHost) && s === !1 && u(i.host)) try {
3655
+ let d = f(r.scheme || i.scheme);
3656
+ if (!r.unicodeSupport && (!d || !d.unicodeSupport) && i.host && (r.domainHost || d && d.domainHost) && s === !1 && u(i.host)) try {
3648
3657
  i.host = new URL("http://" + i.host).hostname;
3649
3658
  } catch (e) {
3650
3659
  i.error = i.error || "Host's domain name can not be converted to ASCII: " + e;
3651
3660
  }
3652
- if ((!p || p && !p.skipNormalize) && (e.indexOf("%") !== -1 && (i.scheme !== void 0 && (i.scheme = unescape(i.scheme)), i.host !== void 0 && (i.host = c(unescape(i.host), s))), i.path &&= o(i.path), i.fragment)) try {
3661
+ if ((!d || d && !d.skipNormalize) && (e.indexOf("%") !== -1 && (i.scheme !== void 0 && (i.scheme = unescape(i.scheme)), i.host !== void 0 && (i.host = c(unescape(i.host), s))), i.path &&= o(i.path), i.fragment)) try {
3653
3662
  i.fragment = encodeURI(decodeURIComponent(i.fragment));
3654
3663
  } catch {
3655
3664
  i.error = i.error || "URI malformed";
3656
3665
  }
3657
- p && p.parse && p.parse(i, r);
3666
+ d && d.parse && d.parse(i, r);
3658
3667
  } else i.error = i.error || "URI can not be parsed.";
3659
3668
  return {
3660
3669
  parsed: i,
3661
3670
  malformedAuthorityOrPort: a
3662
3671
  };
3663
3672
  }
3664
- function x(e, t) {
3665
- return b(e, t).parsed;
3673
+ function C(e, t) {
3674
+ return S(e, t).parsed;
3666
3675
  }
3667
- function S(e, t) {
3668
- return C(e, t).normalized;
3676
+ function w(e, t) {
3677
+ return ee(e, t).normalized;
3669
3678
  }
3670
- function C(e, t) {
3671
- let { parsed: n, malformedAuthorityOrPort: r } = b(e, t);
3679
+ function ee(e, t) {
3680
+ let { parsed: n, malformedAuthorityOrPort: r } = S(e, t);
3672
3681
  return {
3673
3682
  normalized: r ? e : _(n, t),
3674
3683
  malformedAuthorityOrPort: r
3675
3684
  };
3676
3685
  }
3677
- function w(e, t) {
3686
+ function te(e, t) {
3678
3687
  if (typeof e == "string") {
3679
- let { normalized: n, malformedAuthorityOrPort: r } = C(e, t);
3688
+ let { normalized: n, malformedAuthorityOrPort: r } = ee(e, t);
3680
3689
  return r ? void 0 : n;
3681
3690
  }
3682
3691
  if (typeof e == "object") return _(e, t);
3683
3692
  }
3684
- var ee = {
3693
+ var ne = {
3685
3694
  SCHEMES: d,
3686
3695
  normalize: p,
3687
3696
  resolve: m,
3688
3697
  resolveComponent: h,
3689
3698
  equal: g,
3690
3699
  serialize: _,
3691
- parse: x
3700
+ parse: C
3692
3701
  };
3693
- t.exports = ee, t.exports.default = ee, t.exports.fastUri = ee;
3702
+ t.exports = ne, t.exports.default = ne, t.exports.fastUri = ne;
3694
3703
  })), ar = /* @__PURE__ */ a(((e) => {
3695
3704
  Object.defineProperty(e, "__esModule", { value: !0 });
3696
3705
  var t = ir();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tavus/widget",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Tavus conversational video AI <tavus-widget> launcher custom element for the web.",
5
5
  "keywords": [
6
6
  "ai",