@tavus/widget 0.15.0 → 0.15.1

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
@@ -2962,7 +2962,7 @@ var Sn = class extends Error {
2962
2962
  }
2963
2963
  }, Cn = {
2964
2964
  name: "@tavus/widget",
2965
- version: "0.15.0",
2965
+ version: "0.15.1",
2966
2966
  variant: "widget"
2967
2967
  }, wn = /* @__PURE__ */ new Set([
2968
2968
  "Error",
@@ -28432,32 +28432,27 @@ var FP = {
28432
28432
  stiffness: 2822,
28433
28433
  damping: 84,
28434
28434
  mass: 3.5
28435
- }, zP = .25, BP = 16;
28436
- function VP() {
28437
- if (typeof document > "u" || typeof getComputedStyle != "function") return BP;
28438
- let e = Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
28439
- return Number.isFinite(e) ? e : BP;
28440
- }
28441
- function HP(e, t) {
28435
+ };
28436
+ function zP(e, t) {
28442
28437
  return e === "widget" || t !== void 0 && t > 0 && t < 640 ? "compact" : "regular";
28443
28438
  }
28444
- function UP(e) {
28439
+ function BP(e) {
28445
28440
  if (typeof e == "string") try {
28446
28441
  let t = JSON.parse(e);
28447
- return WP(t) ? t : null;
28442
+ return VP(t) ? t : null;
28448
28443
  } catch {
28449
28444
  return null;
28450
28445
  }
28451
- return WP(e) ? e : null;
28446
+ return VP(e) ? e : null;
28452
28447
  }
28453
- function WP(e) {
28448
+ function VP(e) {
28454
28449
  return typeof e == "object" && !!e && !Array.isArray(e);
28455
28450
  }
28456
- function GP(e) {
28457
- let t = UP(e)?.state;
28451
+ function HP(e) {
28452
+ let t = BP(e)?.state;
28458
28453
  return t === "success" || t === "error";
28459
28454
  }
28460
- function KP(e, t, n) {
28455
+ function UP(e, t, n) {
28461
28456
  let r = `${t + 8}px`;
28462
28457
  if (n === void 0 || !Number.isFinite(n) || n <= 0) return {
28463
28458
  left: "1rem",
@@ -28471,83 +28466,75 @@ function KP(e, t, n) {
28471
28466
  bottom: r
28472
28467
  };
28473
28468
  }
28474
- function qP(e) {
28475
- let t = e?.trim();
28476
- if (!t) return zP * VP();
28477
- let n = Number.parseFloat(t);
28478
- if (!Number.isFinite(n)) return zP * VP();
28479
- if (t.endsWith("rem")) return n * VP();
28480
- if (t.endsWith("px")) return n;
28481
- }
28482
- function JP(e, t) {
28483
- let n = e["--color-neutral"], r = e["--color-neutral-content"], i = qP(e["--radius-field"]);
28469
+ var WP = "rgb(0 0 0 / 50%)", GP = "oklch(98.5% 0 0)", KP = 1.5;
28470
+ function qP(e, t) {
28484
28471
  return {
28485
- ...n ? { "--activity-bg": n } : {},
28486
- ...r ? { "--activity-fg": r } : {},
28472
+ "--activity-bg": WP,
28473
+ "--activity-fg": GP,
28487
28474
  "--activity-border": "transparent",
28488
- ...i === void 0 ? {} : { "--activity-radius": `${i}px` },
28475
+ "--activity-radius": `${KP}px`,
28489
28476
  "--activity-height": `${FP[t.density]}px`,
28490
28477
  "--activity-align": t.align
28491
28478
  };
28492
28479
  }
28493
28480
  //#endregion
28494
28481
  //#region ../core/src/magic-canvas/magic-canvas.tsx
28495
- var YP = 1e3, XP = 5e3, ZP = 1200, QP = [2e3, 6e3];
28496
- async function $P(e, t, n) {
28497
- let r = new AbortController(), i = globalThis.setTimeout(() => r.abort(), XP);
28482
+ var JP = 1e3, YP = 5e3, XP = 1200, ZP = [2e3, 6e3];
28483
+ async function QP(e, t, n) {
28484
+ let r = new AbortController(), i = globalThis.setTimeout(() => r.abort(), YP);
28498
28485
  try {
28499
28486
  await mn(e, t, n, { signal: r.signal });
28500
28487
  } finally {
28501
28488
  globalThis.clearTimeout(i);
28502
28489
  }
28503
28490
  }
28504
- function eF(e) {
28491
+ function $P(e) {
28505
28492
  return e instanceof cn && e.status >= 400 && e.status < 500 && e.status !== 408 && e.status !== 429;
28506
28493
  }
28507
- function tF(e, t) {
28494
+ function eF(e, t) {
28508
28495
  console.error("Magic Canvas interaction POST failed; this interaction may not have been recorded server-side.", e), t({
28509
28496
  lastInteractionPostResult: "error",
28510
- lastError: FF(e).message
28497
+ lastError: PF(e).message
28511
28498
  }, {
28512
28499
  error: e,
28513
28500
  operation: "canvas.bridge"
28514
28501
  });
28515
28502
  }
28516
- function nF(e) {
28503
+ function tF(e) {
28517
28504
  return e.content.some((e) => e.type === "text" && typeof e.text == "string" && e.text.trim() !== "");
28518
28505
  }
28519
- function rF(e, t, n, r) {
28506
+ function nF(e, t, n, r) {
28520
28507
  (async () => {
28521
28508
  let i;
28522
- for (let a of QP) {
28509
+ for (let a of ZP) {
28523
28510
  await new Promise((e) => setTimeout(e, a));
28524
28511
  try {
28525
- await $P(e, t, n), r({
28512
+ await QP(e, t, n), r({
28526
28513
  lastInteractionPostResult: "recovered",
28527
28514
  lastError: void 0
28528
28515
  });
28529
28516
  return;
28530
28517
  } catch (e) {
28531
- if (i = e, eF(e)) break;
28518
+ if (i = e, $P(e)) break;
28532
28519
  }
28533
28520
  }
28534
- tF(i, r);
28521
+ eF(i, r);
28535
28522
  })();
28536
28523
  }
28537
- var iF = 2e3;
28538
- function aF(e) {
28539
- return e.correct_answer === void 0 ? ZP : iF;
28524
+ var rF = 2e3;
28525
+ function iF(e) {
28526
+ return e.correct_answer === void 0 ? XP : rF;
28540
28527
  }
28541
- var oF = 48, sF = 24, cF = "ui-monospace, SFMono-Regular, Menlo, monospace", lF = 160, uF = () => {}, dF = "allow-scripts", fF = {
28528
+ var aF = 48, oF = 24, sF = "ui-monospace, SFMono-Regular, Menlo, monospace", cF = 160, lF = () => {}, uF = "allow-scripts", dF = {
28542
28529
  "canvas.scheduling_embed": "allow-scripts allow-same-origin allow-popups allow-forms",
28543
28530
  "canvas.text": "allow-scripts allow-popups allow-popups-to-escape-sandbox"
28544
28531
  };
28545
- function pF(e, t) {
28532
+ function fF(e, t) {
28546
28533
  if (!t.contentWindow || e.source !== t.contentWindow) return !1;
28547
28534
  let n = e.data;
28548
28535
  return !!n && typeof n == "object" && n?.jsonrpc === "2.0";
28549
28536
  }
28550
- var mF = class {
28537
+ var pF = class {
28551
28538
  onmessage;
28552
28539
  onerror;
28553
28540
  onclose;
@@ -28558,7 +28545,7 @@ var mF = class {
28558
28545
  }
28559
28546
  start() {
28560
28547
  let e = (e) => {
28561
- pF(e, this.#e) && this.onmessage?.(e.data);
28548
+ fF(e, this.#e) && this.onmessage?.(e.data);
28562
28549
  };
28563
28550
  return this.#t = e, globalThis.addEventListener("message", e), Promise.resolve();
28564
28551
  }
@@ -28569,12 +28556,12 @@ var mF = class {
28569
28556
  return this.#t && globalThis.removeEventListener("message", this.#t), this.#t = void 0, this.onclose?.(), Promise.resolve();
28570
28557
  }
28571
28558
  };
28572
- function hF(e) {
28573
- for (let t of Sy) if (e.some((e) => jF(e) === t)) return t;
28559
+ function mF(e) {
28560
+ for (let t of Sy) if (e.some((e) => AF(e) === t)) return t;
28574
28561
  return null;
28575
28562
  }
28576
- function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n = MF(), callPresence: r, callControlsVisible: i, callControlsRect: a, gridConfigEnabled: o, gridStartEnabled: s, onStatusStripChange: c } = {}) {
28577
- let { client: l, telemetry: u } = Zm(), { dataTheme: d, cssVars: f } = vj(), p = Ef(), m = Df(), [h, g] = j([]), [_, v] = j(null), [y, b] = j(!1), x = N(null), S = N(null), C = N(null), [w, T] = DF(), E = I(st)?.surface, D = HP(E, T.width), ee = FP[D], O = y ? null : _, te = O ? ee + 8 : 0, ne = F(() => {
28563
+ function hF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n = jF(), callPresence: r, callControlsVisible: i, callControlsRect: a, gridConfigEnabled: o, gridStartEnabled: s, onStatusStripChange: c } = {}) {
28564
+ let { client: l, telemetry: u } = Zm(), { isDark: d, cssVars: f } = vj(), p = Ef(), m = Df(), [h, g] = j([]), [_, v] = j(null), [y, b] = j(!1), x = N(null), S = N(null), C = N(null), [w, T] = EF(), E = I(st)?.surface, D = zP(E, T.width), ee = FP[D], O = y ? null : _, te = O ? ee + 8 : 0, ne = F(() => {
28578
28565
  S.current !== null && (clearTimeout(S.current), S.current = null);
28579
28566
  }, []), k = F(() => {
28580
28567
  C.current !== null && (clearTimeout(C.current), C.current = null);
@@ -28642,7 +28629,7 @@ function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n
28642
28629
  m,
28643
28630
  se
28644
28631
  ]), le = P(() => ({
28645
- theme: d.value === "dark" ? "dark" : "light",
28632
+ theme: d.value ? "dark" : "light",
28646
28633
  cssVars: f.value
28647
28634
  }), [d.value, f.value]);
28648
28635
  M(() => {
@@ -28669,7 +28656,7 @@ function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n
28669
28656
  let n = By(x.current, t);
28670
28657
  if (n.consumed) {
28671
28658
  if (!n.strip) re();
28672
- else if (GP(n.strip.arguments)) {
28659
+ else if (HP(n.strip.arguments)) {
28673
28660
  let e = x.current;
28674
28661
  e !== null && e.tool_call_id === n.strip.tool_call_id && e.conversation_id === n.strip.conversation_id && ie();
28675
28662
  } else ne(), k(), x.current = n.strip, b(!1), v(n.strip);
@@ -28683,7 +28670,7 @@ function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n
28683
28670
  } catch (e) {
28684
28671
  se({
28685
28672
  iframeLifecycleState: "error",
28686
- lastError: FF(e).message
28673
+ lastError: PF(e).message
28687
28674
  }, {
28688
28675
  error: e,
28689
28676
  operation: "canvas.validate"
@@ -28721,7 +28708,7 @@ function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n
28721
28708
  de.safe_area?.width,
28722
28709
  de.safe_area?.height
28723
28710
  ]);
28724
- let pe = hF(ue.map(({ layout: e }) => e));
28711
+ let pe = mF(ue.map(({ layout: e }) => e));
28725
28712
  M(() => {
28726
28713
  t?.(pe);
28727
28714
  }, [t, pe]);
@@ -28730,7 +28717,7 @@ function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n
28730
28717
  ref: w,
28731
28718
  "data-magic-canvas-root": !0,
28732
28719
  class: "pointer-events-none absolute inset-0 z-30",
28733
- style: `--mc-strip-band: ${te}px; --cvi-status-strip-drop: ${80 - sF}px`,
28720
+ style: `--mc-strip-band: ${te}px; --cvi-status-strip-drop: ${80 - oF}px`,
28734
28721
  children: [
28735
28722
  me && fe && /* @__PURE__ */ L("div", { class: "absolute inset-0 bg-black/45" }),
28736
28723
  me && !fe && oe.sheetBottomPx !== null && /* @__PURE__ */ L("div", {
@@ -28741,15 +28728,15 @@ function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n
28741
28728
  backgroundImage: "linear-gradient(to bottom, rgb(0 0 0 / 0.45) calc(100% - 64px), rgb(0 0 0 / 0))"
28742
28729
  }
28743
28730
  }),
28744
- me && ue.map(({ instance: e, layout: t, gridRect: n }) => /* @__PURE__ */ L(bF, {
28745
- slot: jF(t),
28731
+ me && ue.map(({ instance: e, layout: t, gridRect: n }) => /* @__PURE__ */ L(yF, {
28732
+ slot: AF(t),
28746
28733
  safeAreaTop: de.safe_area?.y,
28747
28734
  frameWidth: T.width,
28748
28735
  ...n ? {
28749
28736
  gridRect: n,
28750
28737
  gridAnimate: oe.animate
28751
28738
  } : {},
28752
- children: (r) => /* @__PURE__ */ L(xF, {
28739
+ children: (r) => /* @__PURE__ */ L(bF, {
28753
28740
  availableHeight: r,
28754
28741
  client: l,
28755
28742
  gridDriven: n !== null,
@@ -28775,7 +28762,7 @@ function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n
28775
28762
  sendAppMessage: ce
28776
28763
  })
28777
28764
  }, e.id)),
28778
- _ && /* @__PURE__ */ L(_F, {
28765
+ _ && /* @__PURE__ */ L(gF, {
28779
28766
  client: l,
28780
28767
  controlsRect: a,
28781
28768
  density: D,
@@ -28795,7 +28782,7 @@ function gF({ onLayoutEffectChange: e, onRenderedSlotChange: t, debugEnabled: n
28795
28782
  ]
28796
28783
  });
28797
28784
  }
28798
- function _F({ client: e, controlsRect: t, density: n, exiting: r, frameWidth: i, hostTheme: a, instance: o, onComplete: s, onDebug: c, sendAppMessage: l }) {
28785
+ function gF({ client: e, controlsRect: t, density: n, exiting: r, frameWidth: i, hostTheme: a, instance: o, onComplete: s, onDebug: c, sendAppMessage: l }) {
28799
28786
  let u = FP[n], d = {
28800
28787
  ...o.layout,
28801
28788
  preferred_slot: "safe-area-bottom",
@@ -28805,7 +28792,7 @@ function _F({ client: e, controlsRect: t, density: n, exiting: r, frameWidth: i,
28805
28792
  ...a,
28806
28793
  cssVars: {
28807
28794
  ...a.cssVars,
28808
- "--font-mono": cF
28795
+ "--font-mono": sF
28809
28796
  },
28810
28797
  activity: {
28811
28798
  density: n,
@@ -28814,13 +28801,13 @@ function _F({ client: e, controlsRect: t, density: n, exiting: r, frameWidth: i,
28814
28801
  }), [n, a]);
28815
28802
  return /* @__PURE__ */ L("div", {
28816
28803
  class: "cvi-status-strip absolute flex justify-center",
28817
- style: KP(t, 72, i),
28804
+ style: UP(t, 72, i),
28818
28805
  "data-canvas-status-strip": !0,
28819
- children: /* @__PURE__ */ L(vF, {
28806
+ children: /* @__PURE__ */ L(_F, {
28820
28807
  exiting: r,
28821
28808
  instanceId: o.id,
28822
- children: /* @__PURE__ */ L(xF, {
28823
- availableHeight: lF,
28809
+ children: /* @__PURE__ */ L(bF, {
28810
+ availableHeight: cF,
28824
28811
  client: e,
28825
28812
  fixedHeightPx: u,
28826
28813
  hostTheme: f,
@@ -28828,15 +28815,15 @@ function _F({ client: e, controlsRect: t, density: n, exiting: r, frameWidth: i,
28828
28815
  layout: d,
28829
28816
  onComplete: s,
28830
28817
  onDebug: c,
28831
- onDisplayModeChange: uF,
28832
- onNaturalHeightChange: uF,
28818
+ onDisplayModeChange: lF,
28819
+ onNaturalHeightChange: lF,
28833
28820
  sendAppMessage: l,
28834
28821
  variant: "strip"
28835
28822
  })
28836
28823
  })
28837
28824
  });
28838
28825
  }
28839
- function vF({ exiting: e, instanceId: t, children: n }) {
28826
+ function _F({ exiting: e, instanceId: t, children: n }) {
28840
28827
  let r = N(null);
28841
28828
  return Xe(() => {
28842
28829
  let t = r.current;
@@ -28872,9 +28859,9 @@ function vF({ exiting: e, instanceId: t, children: n }) {
28872
28859
  children: n
28873
28860
  });
28874
28861
  }
28875
- var yF = 16;
28876
- function bF({ slot: e, safeAreaTop: t, frameWidth: n, gridRect: r, gridAnimate: i = !1, children: a }) {
28877
- let [o, s] = OF(), c = a(r ? r.height : e === "full" ? void 0 : s);
28862
+ var vF = 16;
28863
+ function yF({ slot: e, safeAreaTop: t, frameWidth: n, gridRect: r, gridAnimate: i = !1, children: a }) {
28864
+ let [o, s] = DF(), c = a(r ? r.height : e === "full" ? void 0 : s);
28878
28865
  if (r) return /* @__PURE__ */ L("div", {
28879
28866
  ref: o,
28880
28867
  class: "pointer-events-auto absolute",
@@ -28890,7 +28877,7 @@ function bF({ slot: e, safeAreaTop: t, frameWidth: n, gridRect: r, gridAnimate:
28890
28877
  let r = t == null ? "1rem" : `${t * 100}%`, i = n != null && n > 0 ? Math.max(0, n - 32) : void 0;
28891
28878
  return /* @__PURE__ */ L("div", {
28892
28879
  ref: o,
28893
- class: `cvi-strip-lift ${AF(e)}`,
28880
+ class: `cvi-strip-lift ${kF(e)}`,
28894
28881
  style: {
28895
28882
  top: r,
28896
28883
  bottom: "calc(72px + var(--mc-strip-band, 0px))",
@@ -28905,8 +28892,8 @@ function bF({ slot: e, safeAreaTop: t, frameWidth: n, gridRect: r, gridAnimate:
28905
28892
  }
28906
28893
  return e === "safe-area-bottom" ? /* @__PURE__ */ L("div", {
28907
28894
  ref: o,
28908
- class: AF(e),
28909
- style: { top: `${yF}px` },
28895
+ class: kF(e),
28896
+ style: { top: `${vF}px` },
28910
28897
  "data-canvas-slot": e,
28911
28898
  children: /* @__PURE__ */ L("div", {
28912
28899
  class: "contents",
@@ -28914,7 +28901,7 @@ function bF({ slot: e, safeAreaTop: t, frameWidth: n, gridRect: r, gridAnimate:
28914
28901
  })
28915
28902
  }) : /* @__PURE__ */ L("div", {
28916
28903
  ref: o,
28917
- class: AF(e),
28904
+ class: kF(e),
28918
28905
  "data-canvas-slot": e,
28919
28906
  children: /* @__PURE__ */ L("div", {
28920
28907
  class: "contents",
@@ -28922,7 +28909,7 @@ function bF({ slot: e, safeAreaTop: t, frameWidth: n, gridRect: r, gridAnimate:
28922
28909
  })
28923
28910
  });
28924
28911
  }
28925
- function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard: r = !1, hostTheme: i, instance: a, layout: o, dimmed: s, onDebug: c, onComplete: l, onDisplayModeChange: u, onNaturalHeightChange: d, sendAppMessage: f, variant: p = "card", fixedHeightPx: m }) {
28912
+ function bF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard: r = !1, hostTheme: i, instance: a, layout: o, dimmed: s, onDebug: c, onComplete: l, onDisplayModeChange: u, onNaturalHeightChange: d, sendAppMessage: f, variant: p = "card", fixedHeightPx: m }) {
28926
28913
  let h = p === "strip", g = m ?? 720, _ = N(null), v = N(null), y = N(e), b = N(r), x = N(m ?? 320), S = N({
28927
28914
  fixed: m,
28928
28915
  max: g
@@ -28935,17 +28922,17 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
28935
28922
  }, [m, g]), M(() => {
28936
28923
  w.current = a;
28937
28924
  }, [a]), M(() => {
28938
- x.current = ne, v.current?.setHostContext(TF(w.current, C.current, T.current, y.current, ne, b.current));
28925
+ x.current = ne, v.current?.setHostContext(wF(w.current, C.current, T.current, y.current, ne, b.current));
28939
28926
  }, [ne]), M(() => {
28940
28927
  y.current = e, b.current = r;
28941
- let t = wF(i, _.current);
28942
- C.current = t, v.current?.setHostContext(TF(w.current, t, T.current, e, x.current, r));
28928
+ let t = CF(i, _.current);
28929
+ C.current = t, v.current?.setHostContext(wF(w.current, t, T.current, e, x.current, r));
28943
28930
  }, [
28944
28931
  e,
28945
28932
  i,
28946
28933
  r
28947
28934
  ]), M(() => {
28948
- T.current = o, v.current?.setHostContext(TF(w.current, C.current, o, e, x.current, b.current));
28935
+ T.current = o, v.current?.setHostContext(wF(w.current, C.current, o, e, x.current, b.current));
28949
28936
  }, [e, o]), M(() => {
28950
28937
  D.current = l, ee.current = u, O.current = d, te.current = f;
28951
28938
  }, [
@@ -28959,7 +28946,7 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
28959
28946
  let n = !1, r = null, i = null, o = null, s = null, l = new URL(a.canvas_config.sandbox_url, globalThis.location.href).href, u = (e) => {
28960
28947
  n || c({
28961
28948
  iframeLifecycleState: "error",
28962
- lastError: FF(e).message
28949
+ lastError: PF(e).message
28963
28950
  }, {
28964
28951
  error: e,
28965
28952
  operation: "canvas.bridge"
@@ -28996,18 +28983,18 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
28996
28983
  text: {},
28997
28984
  structuredContent: {}
28998
28985
  }
28999
- }, { hostContext: TF(a, wF(C.current, e), T.current, y.current, x.current, b.current) });
28986
+ }, { hostContext: wF(a, CF(C.current, e), T.current, y.current, x.current, b.current) });
29000
28987
  r = f, v.current = f, f.oninitialized = () => {
29001
28988
  n || (c({ iframeLifecycleState: "ready" }), E.current = w.current.revision, f.sendToolInput({ arguments: w.current.arguments }).catch(u));
29002
28989
  }, f.onsizechange = ({ height: e }) => {
29003
28990
  if (!n && typeof e == "number" && Number.isFinite(e)) {
29004
- let { fixed: t, max: n } = S.current, r = t === void 0 ? Math.min(Math.max(e, oF), n) : e === t ? t : Math.min(e, lF);
28991
+ let { fixed: t, max: n } = S.current, r = t === void 0 ? Math.min(Math.max(e, aF), n) : e === t ? t : Math.min(e, cF);
29005
28992
  k(r), O.current(w.current.id, r);
29006
28993
  }
29007
28994
  }, f.onmessage = async (e) => {
29008
28995
  let r = Vy(e);
29009
28996
  if (!r) {
29010
- if (nF(e)) {
28997
+ if (tF(e)) {
29011
28998
  let e = "Magic Canvas message included text without interaction metadata; no interaction row was recorded.";
29012
28999
  return c({
29013
29000
  lastInteractionPostResult: "error",
@@ -29032,7 +29019,7 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
29032
29019
  }
29033
29020
  })();
29034
29021
  if ("error" in a) {
29035
- let e = FF(a.error).message;
29022
+ let e = PF(a.error).message;
29036
29023
  return c({
29037
29024
  lastInteractionPostResult: "error",
29038
29025
  lastError: e
@@ -29049,19 +29036,19 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
29049
29036
  try {
29050
29037
  u = Wy(e, o);
29051
29038
  } catch (e) {
29052
- c({ lastError: FF(e).message }), o.type === "submit" && console.warn("Magic Canvas dropped the response text of a submitted card.", e);
29039
+ c({ lastError: PF(e).message }), o.type === "submit" && console.warn("Magic Canvas dropped the response text of a submitted card.", e);
29053
29040
  }
29054
29041
  let d = !0;
29055
29042
  try {
29056
- await $P(t, o.conversation_id, l.body);
29043
+ await QP(t, o.conversation_id, l.body);
29057
29044
  } catch (e) {
29058
- d = !1, eF(e) ? tF(e, c) : (console.warn("Magic Canvas interaction POST failed; continuing without it and retrying in the background.", e), c({
29045
+ d = !1, $P(e) ? eF(e, c) : (console.warn("Magic Canvas interaction POST failed; continuing without it and retrying in the background.", e), c({
29059
29046
  lastInteractionPostResult: "failed_open",
29060
- lastError: FF(e).message
29047
+ lastError: PF(e).message
29061
29048
  }, {
29062
29049
  error: e,
29063
29050
  operation: "canvas.bridge"
29064
- }), rF(t, o.conversation_id, l.body, c));
29051
+ }), nF(t, o.conversation_id, l.body, c));
29065
29052
  }
29066
29053
  if (n) return {};
29067
29054
  if (u) try {
@@ -29072,7 +29059,7 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
29072
29059
  properties: { text: u }
29073
29060
  });
29074
29061
  } catch (e) {
29075
- console.error("Magic Canvas respond send failed.", e), c({ lastError: FF(e).message }, {
29062
+ console.error("Magic Canvas respond send failed.", e), c({ lastError: PF(e).message }, {
29076
29063
  error: e,
29077
29064
  operation: "canvas.bridge"
29078
29065
  });
@@ -29082,18 +29069,18 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
29082
29069
  lastError: void 0
29083
29070
  }), Uy(o) && (o.type === "submit" ? (s && clearTimeout(s), s = setTimeout(() => {
29084
29071
  s = null, n || D.current();
29085
- }, aF(i.arguments))) : D.current()), {};
29072
+ }, iF(i.arguments))) : D.current()), {};
29086
29073
  }, f.onupdatemodelcontext = async (e) => (i = e, o ||= setTimeout(() => {
29087
29074
  o = null, d();
29088
- }, YP), {}), f.onrequestdisplaymode = async ({ mode: e }) => {
29075
+ }, JP), {}), f.onrequestdisplaymode = async ({ mode: e }) => {
29089
29076
  if (h) return { mode: "inline" };
29090
29077
  let t = e === "fullscreen" ? "fullscreen" : "inline";
29091
29078
  return ee.current(t), T.current = {
29092
29079
  ...T.current,
29093
29080
  display_mode: t,
29094
29081
  viable_slot: t === "fullscreen" ? "full" : T.current.viable_slot
29095
- }, f.setHostContext(TF(w.current, C.current, T.current, y.current, x.current, b.current)), { mode: t };
29096
- }, f.connect(new mF(e)).then(() => void 0).catch(u);
29082
+ }, f.setHostContext(wF(w.current, C.current, T.current, y.current, x.current, b.current)), { mode: t };
29083
+ }, f.connect(new pF(e)).then(() => void 0).catch(u);
29097
29084
  };
29098
29085
  c({
29099
29086
  iframeLifecycleState: "mounting",
@@ -29115,7 +29102,7 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
29115
29102
  a.revision !== 0 && (a.revision <= E.current || (E.current = a.revision, v.current?.sendToolInput({ arguments: a.arguments }).catch((e) => {
29116
29103
  c({
29117
29104
  iframeLifecycleState: "error",
29118
- lastError: FF(e).message
29105
+ lastError: PF(e).message
29119
29106
  }, {
29120
29107
  error: e,
29121
29108
  operation: "canvas.bridge"
@@ -29126,7 +29113,7 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
29126
29113
  a.revision,
29127
29114
  c
29128
29115
  ]);
29129
- let re = o.viable_slot === "full" || o.display_mode === "fullscreen", ie = re ? null : EF(ne, e, r), ae = ie?.placeholderStyle, A = ie?.cardStyle, oe = re ? { height: "100%" } : ie?.iframeStyle ?? {
29116
+ let re = o.viable_slot === "full" || o.display_mode === "fullscreen", ie = re ? null : TF(ne, e, r), ae = ie?.placeholderStyle, A = ie?.cardStyle, oe = re ? { height: "100%" } : ie?.iframeStyle ?? {
29130
29117
  width: "100%",
29131
29118
  height: `${ne}px`
29132
29119
  }, se = h ? "pointer-events-auto w-full overflow-hidden" : [
@@ -29134,7 +29121,7 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
29134
29121
  r ? "" : "shadow-xl",
29135
29122
  re ? "fixed inset-4 z-10 max-w-none" : n ? "max-w-none" : "max-w-md",
29136
29123
  s ? "scale-[0.98] opacity-40" : ""
29137
- ].filter(Boolean).join(" "), ce = fF[a.canvas_config.component] ?? dF, le = /* @__PURE__ */ L("div", {
29124
+ ].filter(Boolean).join(" "), ce = dF[a.canvas_config.component] ?? uF, le = /* @__PURE__ */ L("div", {
29138
29125
  class: se,
29139
29126
  style: A,
29140
29127
  ...h ? { "data-canvas-strip": o.viable_slot } : { "data-canvas-card": o.viable_slot },
@@ -29153,7 +29140,7 @@ function xF({ availableHeight: e, client: t, gridDriven: n = !1, gridKioskCard:
29153
29140
  children: le
29154
29141
  });
29155
29142
  }
29156
- var SF = [
29143
+ var xF = [
29157
29144
  "--color-base-100",
29158
29145
  "--color-base-200",
29159
29146
  "--color-base-300",
@@ -29163,17 +29150,17 @@ var SF = [
29163
29150
  "--color-neutral",
29164
29151
  "--color-neutral-content"
29165
29152
  ];
29166
- function CF(e) {
29153
+ function SF(e) {
29167
29154
  if (!e || typeof getComputedStyle != "function") return {};
29168
29155
  let t = getComputedStyle(e), n = {};
29169
- for (let e of SF) {
29156
+ for (let e of xF) {
29170
29157
  let r = t.getPropertyValue(e).trim();
29171
29158
  r && (n[e] = r);
29172
29159
  }
29173
29160
  return n;
29174
29161
  }
29175
- function wF(e, t) {
29176
- let n = CF(t);
29162
+ function CF(e, t) {
29163
+ let n = SF(t);
29177
29164
  return Object.keys(n).length === 0 ? e : {
29178
29165
  ...e,
29179
29166
  cssVars: {
@@ -29182,20 +29169,20 @@ function wF(e, t) {
29182
29169
  }
29183
29170
  };
29184
29171
  }
29185
- function TF(e, t, n, r, i, a = !1) {
29186
- let o = wb(t, n), s = n.viable_slot === "full" || n.display_mode === "fullscreen", c = s ? void 0 : NF(r), l = t.activity ? JP(t.cssVars, t.activity) : {}, u = s ? 1 : EF(i ?? 0, r, a)?.displayScale ?? 1;
29172
+ function wF(e, t, n, r, i, a = !1) {
29173
+ let o = wb(t, n), s = n.viable_slot === "full" || n.display_mode === "fullscreen", c = s ? void 0 : MF(r), l = t.activity ? qP(t.cssVars, t.activity) : {}, u = s ? 1 : TF(i ?? 0, r, a)?.displayScale ?? 1;
29187
29174
  return {
29188
29175
  ...e.canvas_config.host_context,
29189
29176
  ...o,
29190
29177
  ...l,
29191
29178
  containerDimensions: {
29192
- ...PF(o.containerDimensions) ? o.containerDimensions : {},
29179
+ ...NF(o.containerDimensions) ? o.containerDimensions : {},
29193
29180
  ...c === void 0 ? {} : { maxHeight: c },
29194
29181
  displayScale: u
29195
29182
  }
29196
29183
  };
29197
29184
  }
29198
- function EF(e, t, n = !1) {
29185
+ function TF(e, t, n = !1) {
29199
29186
  if (t === void 0 || !Number.isFinite(t) || t <= 0) return null;
29200
29187
  let r = Math.min(e, 720);
29201
29188
  if (n) return {
@@ -29235,11 +29222,11 @@ function EF(e, t, n = !1) {
29235
29222
  }
29236
29223
  };
29237
29224
  }
29238
- function DF() {
29239
- let e = N(null), [t, n] = j(() => kF(null));
29225
+ function EF() {
29226
+ let e = N(null), [t, n] = j(() => OF(null));
29240
29227
  return M(() => {
29241
29228
  let t = () => n((t) => {
29242
- let n = kF(e.current);
29229
+ let n = OF(e.current);
29243
29230
  return t.width === n.width && t.height === n.height && t.visualViewportHeight === n.visualViewportHeight ? t : n;
29244
29231
  });
29245
29232
  t(), globalThis.addEventListener("resize", t), globalThis.visualViewport?.addEventListener("resize", t);
@@ -29249,7 +29236,7 @@ function DF() {
29249
29236
  };
29250
29237
  }, []), [e, t];
29251
29238
  }
29252
- function OF() {
29239
+ function DF() {
29253
29240
  let e = N(null), [t, n] = j();
29254
29241
  return M(() => {
29255
29242
  let t = e.current;
@@ -29265,7 +29252,7 @@ function OF() {
29265
29252
  return a.observe(t), () => a.disconnect();
29266
29253
  }, []), [e, t];
29267
29254
  }
29268
- function kF(e) {
29255
+ function OF(e) {
29269
29256
  let t = globalThis.visualViewport?.height, n = e?.getBoundingClientRect();
29270
29257
  if (n && n.width > 0 && n.height > 0) {
29271
29258
  let e = t === void 0 ? void 0 : Math.max(0, (globalThis.innerHeight || 0) - t);
@@ -29281,7 +29268,7 @@ function kF(e) {
29281
29268
  visualViewportHeight: t
29282
29269
  };
29283
29270
  }
29284
- function AF(e) {
29271
+ function kF(e) {
29285
29272
  let t = "absolute flex gap-2";
29286
29273
  switch (e) {
29287
29274
  case "safe-area-left": return `${t} left-4 w-[28rem] flex-col overflow-y-auto [scrollbar-gutter:stable]`;
@@ -29290,24 +29277,24 @@ function AF(e) {
29290
29277
  case "full": return `${t} inset-4 flex-col items-stretch justify-stretch`;
29291
29278
  }
29292
29279
  }
29293
- function jF(e) {
29280
+ function AF(e) {
29294
29281
  return e.display_mode === "fullscreen" && e.preferred_slot !== "full" ? e.preferred_slot : e.viable_slot;
29295
29282
  }
29296
- function MF() {
29283
+ function jF() {
29297
29284
  return !1;
29298
29285
  }
29299
- function NF(e) {
29286
+ function MF(e) {
29300
29287
  return e === void 0 || !Number.isFinite(e) || e <= 0 ? 720 : Math.min(Math.floor(e), 720);
29301
29288
  }
29302
- function PF(e) {
29289
+ function NF(e) {
29303
29290
  return typeof e == "object" && !!e && !Array.isArray(e);
29304
29291
  }
29305
- function FF(e) {
29292
+ function PF(e) {
29306
29293
  return e instanceof Error ? e : Error(String(e));
29307
29294
  }
29308
29295
  //#endregion
29309
29296
  //#region ../core/src/magic-canvas/grid-error-boundary.tsx
29310
- var IF = class extends D {
29297
+ var FF = class extends D {
29311
29298
  state = { errored: !1 };
29312
29299
  componentDidCatch(e) {
29313
29300
  this.props.onError(e), this.setState({ errored: !0 });
@@ -29315,8 +29302,8 @@ var IF = class extends D {
29315
29302
  render() {
29316
29303
  return this.state.errored ? null : this.props.children;
29317
29304
  }
29318
- }, LF = 1e4;
29319
- function RF(e, t = LF) {
29305
+ }, IF = 1e4;
29306
+ function LF(e, t = IF) {
29320
29307
  let [n, r] = j(!1), i = N(!1);
29321
29308
  return M(() => {
29322
29309
  if (!e) {
@@ -29331,7 +29318,7 @@ function RF(e, t = LF) {
29331
29318
  }
29332
29319
  //#endregion
29333
29320
  //#region ../core/src/hooks/use-call-presence.ts
29334
- function zF(e) {
29321
+ function RF(e) {
29335
29322
  let t = Of(), n = Pf(t ?? ""), r = !If(t ?? "").isOff, i = ey(e), a = i.phase === "ready" ? i.replicaId : "", o = If(a), s = !r && (o.state === "playable" || o.state === "loading"), c = i.phase === "ready" && !e && !i.videoState.isOff, l = !e && t !== null && !n.isOff, u = i.phase !== "ready" || i.videoState.isOff;
29336
29323
  return P(() => ({
29337
29324
  presence: i,
@@ -29353,7 +29340,7 @@ function zF(e) {
29353
29340
  }
29354
29341
  //#endregion
29355
29342
  //#region ../core/src/hooks/use-call-controls-visible.ts
29356
- function BF(e, t, n) {
29343
+ function zF(e, t, n) {
29357
29344
  let [r, i] = j(!0);
29358
29345
  return M(() => {
29359
29346
  if (!t) return;
@@ -29383,7 +29370,7 @@ function BF(e, t, n) {
29383
29370
  }
29384
29371
  //#endregion
29385
29372
  //#region ../core/src/hooks/use-call-controls-rect.ts
29386
- function VF(e, t, n, r, i) {
29373
+ function BF(e, t, n, r, i) {
29387
29374
  let [a, o] = j(void 0);
29388
29375
  return M(() => {
29389
29376
  if (!r) return;
@@ -29417,8 +29404,8 @@ function VF(e, t, n, r, i) {
29417
29404
  }
29418
29405
  //#endregion
29419
29406
  //#region ../core/src/hooks/use-replica-join-timeout.ts
29420
- var HF = 1e4;
29421
- function UF({ onTimeout: e, timeoutMs: t = HF, active: n = !0 }) {
29407
+ var VF = 1e4;
29408
+ function HF({ onTimeout: e, timeoutMs: t = VF, active: n = !0 }) {
29422
29409
  let r = $v().length > 0, [i, a] = j(!1), o = N(e);
29423
29410
  return M(() => {
29424
29411
  o.current = e;
@@ -29442,39 +29429,39 @@ function UF({ onTimeout: e, timeoutMs: t = HF, active: n = !0 }) {
29442
29429
  }
29443
29430
  //#endregion
29444
29431
  //#region ../core/src/hooks/use-system-shutdown.ts
29445
- function WF(e) {
29432
+ function UF(e) {
29446
29433
  if (typeof e != "object" || !e) return !1;
29447
29434
  let t = e;
29448
29435
  return t.message_type === "system" && t.event_type === "system.shutdown";
29449
29436
  }
29450
- function GF({ onShutdown: e }) {
29437
+ function WF({ onShutdown: e }) {
29451
29438
  let t = N(e);
29452
29439
  M(() => {
29453
29440
  t.current = e;
29454
29441
  }, [e]), jf({ onAppMessage: F((e) => {
29455
- WF(e?.data) && t.current();
29442
+ UF(e?.data) && t.current();
29456
29443
  }, []) });
29457
29444
  }
29458
29445
  //#endregion
29459
29446
  //#region ../core/src/hooks/use-picture-in-picture.ts
29460
- var KF = tn("PiP"), qF = 360, JF = 280;
29461
- function YF() {
29447
+ var GF = tn("PiP"), KF = 360, qF = 280;
29448
+ function JF() {
29462
29449
  return globalThis.window !== void 0 && "documentPictureInPicture" in globalThis.window;
29463
29450
  }
29464
- function XF(e) {
29465
- let { enabled: t, active: n } = e, [r, i] = j(null), a = YF(), o = I(Th), s = F(() => {
29451
+ function YF(e) {
29452
+ let { enabled: t, active: n } = e, [r, i] = j(null), a = JF(), o = I(Th), s = F(() => {
29466
29453
  i((e) => (e && !e.closed && e.close(), null));
29467
29454
  }, []), c = F(async () => {
29468
29455
  if (a && t && n && (!r || r.closed)) try {
29469
29456
  let e = await globalThis.window.documentPictureInPicture.requestWindow({
29470
- width: qF,
29471
- height: JF
29457
+ width: KF,
29458
+ height: qF
29472
29459
  }), t = Pe.replace(/:host(?=[\s,{])/g, ":host, :root"), n = e.document.createElement("style");
29473
29460
  n.textContent = t, e.document.head.appendChild(n), e.document.body.style.margin = "0", e.document.body.style.width = "100%", e.document.body.style.height = "100vh", e.document.body.style.overflow = "hidden", e.addEventListener("pagehide", () => {
29474
29461
  i((t) => t === e ? null : t);
29475
29462
  }, { once: !0 }), i(e);
29476
29463
  } catch (e) {
29477
- KF.warn("Failed to open PiP window", e);
29464
+ GF.warn("Failed to open PiP window", e);
29478
29465
  }
29479
29466
  }, [
29480
29467
  a,
@@ -29495,13 +29482,13 @@ function XF(e) {
29495
29482
  try {
29496
29483
  e.metadata = new MediaMetadata({ title: "Tavus conversation" }), e.playbackState = "playing", l = !0;
29497
29484
  } catch (e) {
29498
- KF.warn("mediaSession metadata setup failed", e);
29485
+ GF.warn("mediaSession metadata setup failed", e);
29499
29486
  }
29500
29487
  let t = (t, n) => {
29501
29488
  try {
29502
29489
  e.setActionHandler(t, n), r.push(t);
29503
29490
  } catch (e) {
29504
- KF.info(`mediaSession.${t} not supported`, e);
29491
+ GF.info(`mediaSession.${t} not supported`, e);
29505
29492
  }
29506
29493
  };
29507
29494
  t("enterpictureinpicture", () => {
@@ -29555,11 +29542,11 @@ function XF(e) {
29555
29542
  }
29556
29543
  //#endregion
29557
29544
  //#region ../core/src/utils/device-preferences.ts
29558
- var ZF = Dt(null), QF = {
29545
+ var XF = Dt(null), ZF = {
29559
29546
  active: !1,
29560
29547
  video_shift_x: 0,
29561
29548
  backdrop: { type: "snapshot_mirror" }
29562
- }, $F = Hf(({ id: e, showAudioWave: t = !0 }) => {
29549
+ }, QF = Hf(({ id: e, showAudioWave: t = !0 }) => {
29563
29550
  let n = Pf(e).isOff;
29564
29551
  return /* @__PURE__ */ L("div", {
29565
29552
  class: `relative aspect-square w-32 @max-mobile:w-24 rounded-box overflow-hidden bg-black/30 z-10 ${n ? "hidden" : ""}`,
@@ -29574,16 +29561,16 @@ var ZF = Dt(null), QF = {
29574
29561
  children: /* @__PURE__ */ L(Kv, { id: e })
29575
29562
  })]
29576
29563
  });
29577
- }), eI = Hf(() => {
29564
+ }), $F = Hf(() => {
29578
29565
  let e = Of(), { isScreenSharing: t } = av(), n = $v()[0];
29579
- return /* @__PURE__ */ L(E, { children: [t && n && /* @__PURE__ */ L($F, { id: n }), e && /* @__PURE__ */ L($F, {
29566
+ return /* @__PURE__ */ L(E, { children: [t && n && /* @__PURE__ */ L(QF, { id: n }), e && /* @__PURE__ */ L(QF, {
29580
29567
  id: e,
29581
29568
  showAudioWave: !1
29582
29569
  })] });
29583
- }), tI = Hf(() => /* @__PURE__ */ L("div", {
29570
+ }), eI = Hf(() => /* @__PURE__ */ L("div", {
29584
29571
  class: "cvi-strip-lift absolute bottom-4 @max-mobile:bottom-[calc(5rem_+_var(--cvi-status-strip,0px))] left-4 flex flex-col items-end gap-2 z-20",
29585
- children: /* @__PURE__ */ L(eI, {})
29586
- })), nI = Hf(({ personaSessionId: e, localId: t, isScreenSharing: n, avatarOff: r, effect: i, animate: a }) => /* @__PURE__ */ L(E, { children: [
29572
+ children: /* @__PURE__ */ L($F, {})
29573
+ })), tI = Hf(({ personaSessionId: e, localId: t, isScreenSharing: n, avatarOff: r, effect: i, animate: a }) => /* @__PURE__ */ L(E, { children: [
29587
29574
  /* @__PURE__ */ L("div", { class: "absolute inset-0 bg-base-200" }),
29588
29575
  i.content && /* @__PURE__ */ L("div", {
29589
29576
  class: "absolute overflow-hidden rounded-box bg-black",
@@ -29605,7 +29592,7 @@ var ZF = Dt(null), QF = {
29605
29592
  avatarOff: r
29606
29593
  })
29607
29594
  })
29608
- ] })), rI = Hf(() => {
29595
+ ] })), nI = Hf(() => {
29609
29596
  let { effect: e, animate: t } = CP.value, n = Of();
29610
29597
  return n === null || e.selfView === null ? null : /* @__PURE__ */ L("div", {
29611
29598
  class: "absolute z-20 overflow-hidden rounded-box bg-black/30",
@@ -29618,23 +29605,23 @@ var ZF = Dt(null), QF = {
29618
29605
  className: "h-full w-full object-cover"
29619
29606
  })
29620
29607
  });
29621
- }), iI = Hf(({ canvasRenderedSlot: e }) => {
29608
+ }), rI = Hf(({ canvasRenderedSlot: e }) => {
29622
29609
  let t = LM(CP.value.effect);
29623
- return t === "hidden" ? null : t === "engine" ? /* @__PURE__ */ L(IF, {
29610
+ return t === "hidden" ? null : t === "engine" ? /* @__PURE__ */ L(FF, {
29624
29611
  onError: kM,
29625
- children: /* @__PURE__ */ L(rI, {})
29626
- }) : e === "safe-area-bottom" ? null : /* @__PURE__ */ L(tI, {});
29627
- }), aI = Hf(() => {
29612
+ children: /* @__PURE__ */ L(nI, {})
29613
+ }) : e === "safe-area-bottom" ? null : /* @__PURE__ */ L(eI, {});
29614
+ }), iI = Hf(() => {
29628
29615
  let e = $v()[0];
29629
29616
  return e ? /* @__PURE__ */ L(nv, { sessionId: e }) : null;
29630
- }), oI = Hf((e) => /* @__PURE__ */ L(E, { children: [/* @__PURE__ */ L(aI, {}), /* @__PURE__ */ L(sI, { ...e })] })), sI = Hf(({ isAudioOnly: e, presence: t, canvasLayoutEffect: n, canvasRenderedSlot: r }) => {
29617
+ }), aI = Hf((e) => /* @__PURE__ */ L(E, { children: [/* @__PURE__ */ L(iI, {}), /* @__PURE__ */ L(oI, { ...e })] })), oI = Hf(({ isAudioOnly: e, presence: t, canvasLayoutEffect: n, canvasRenderedSlot: r }) => {
29631
29618
  let { presence: i, localId: a, isScreenSharing: o, isPersonaPresenting: s } = t, c = CP.value, l = n.active && !o && (!e || s);
29632
29619
  return i.phase === "left" ? /* @__PURE__ */ L(Wv, {}) : i.phase === "connecting" ? /* @__PURE__ */ L(Uv, {}) : e && !s ? /* @__PURE__ */ L("div", {
29633
29620
  class: "absolute inset-0 flex items-center justify-center",
29634
29621
  children: /* @__PURE__ */ L(Xv, { sessionId: i.replicaId })
29635
- }) : c.effect.driving ? /* @__PURE__ */ L(IF, {
29622
+ }) : c.effect.driving ? /* @__PURE__ */ L(FF, {
29636
29623
  onError: kM,
29637
- children: /* @__PURE__ */ L(nI, {
29624
+ children: /* @__PURE__ */ L(tI, {
29638
29625
  personaSessionId: i.replicaId,
29639
29626
  localId: a,
29640
29627
  isScreenSharing: o,
@@ -29648,7 +29635,7 @@ var ZF = Dt(null), QF = {
29648
29635
  avatarOff: i.videoState.isOff,
29649
29636
  canvasLayoutEffect: n,
29650
29637
  smartSidecarActive: l
29651
- }) : /* @__PURE__ */ L(cI, {
29638
+ }) : /* @__PURE__ */ L(sI, {
29652
29639
  personaSessionId: i.replicaId,
29653
29640
  localId: a,
29654
29641
  isScreenSharing: o,
@@ -29657,11 +29644,11 @@ var ZF = Dt(null), QF = {
29657
29644
  canvasLayoutEffect: n,
29658
29645
  canvasRenderedSlot: r
29659
29646
  });
29660
- }), cI = Hf(({ personaSessionId: e, localId: t, isScreenSharing: n, avatarOff: r, smartSidecarActive: i, canvasLayoutEffect: a, canvasRenderedSlot: o }) => /* @__PURE__ */ L(ex, {
29647
+ }), sI = Hf(({ personaSessionId: e, localId: t, isScreenSharing: n, avatarOff: r, smartSidecarActive: i, canvasLayoutEffect: a, canvasRenderedSlot: o }) => /* @__PURE__ */ L(ex, {
29661
29648
  canvasLayoutEffect: a,
29662
29649
  smartSidecarActive: i,
29663
29650
  isScreenSharing: n,
29664
- captureSnapshot: fI,
29651
+ captureSnapshot: dI,
29665
29652
  personaMode: "auto",
29666
29653
  renderedSlot: o,
29667
29654
  fill: (i) => /* @__PURE__ */ L(iy, {
@@ -29671,7 +29658,7 @@ var ZF = Dt(null), QF = {
29671
29658
  avatarOff: r,
29672
29659
  videoRef: i
29673
29660
  })
29674
- })), lI = Hf(({ items: e }) => {
29661
+ })), cI = Hf(({ items: e }) => {
29675
29662
  let [t, n] = j(!1), r = N(null);
29676
29663
  return M(() => {
29677
29664
  if (!t) return;
@@ -29701,8 +29688,8 @@ var ZF = Dt(null), QF = {
29701
29688
  children: e
29702
29689
  })]
29703
29690
  });
29704
- }), uI = Hf(({ items: e }) => e.length <= 1 ? /* @__PURE__ */ L(E, { children: e }) : /* @__PURE__ */ L(lI, { items: e })), dI = Hf(({ onLeave: e }) => {
29705
- let t = Df(), { config: n } = Zm(), { session: r, end: i } = Av(), a = Of(), o = N(null), s = I(zh)?.frameRef ?? o, [c, l] = j(!1), u = M_() === "full-screen", [d, f] = j(!1), [p, m] = j(QF), [h, g] = j(null), [_, v] = j(null), y = n.value.customization.conversation, b = RF(y.show_fullscreen_hint && h !== null && !c && !u), x = N(null), S = N(null), C = r.value?.conversationUrl, w = r.value?.magicGrid === !0, T = BF(x, CM(y.magic_grid, w), C), E = VF(x, S, 72, !0, C), D = y.modality === "audio", ee = zF(D), O = y.modality === "chat", te = y.modality === "video", ne = y.enable_chat, k = y.enable_closed_captions, re = y.enable_picture_in_picture, { pipWindow: ie } = XF({
29691
+ }), lI = Hf(({ items: e }) => e.length <= 1 ? /* @__PURE__ */ L(E, { children: e }) : /* @__PURE__ */ L(cI, { items: e })), uI = Hf(({ onLeave: e }) => {
29692
+ let t = Df(), { config: n } = Zm(), { session: r, end: i } = Av(), a = Of(), o = N(null), s = I(zh)?.frameRef ?? o, [c, l] = j(!1), u = M_() === "full-screen", [d, f] = j(!1), [p, m] = j(ZF), [h, g] = j(null), [_, v] = j(null), y = n.value.customization.conversation, b = LF(y.show_fullscreen_hint && h !== null && !c && !u), x = N(null), S = N(null), C = r.value?.conversationUrl, w = r.value?.magicGrid === !0, T = zF(x, CM(y.magic_grid, w), C), E = BF(x, S, 72, !0, C), D = y.modality === "audio", ee = RF(D), O = y.modality === "chat", te = y.modality === "video", ne = y.enable_chat, k = y.enable_closed_captions, re = y.enable_picture_in_picture, { pipWindow: ie } = YF({
29706
29693
  enabled: re && !O,
29707
29694
  active: t === "joined-meeting"
29708
29695
  });
@@ -29711,13 +29698,13 @@ var ZF = Dt(null), QF = {
29711
29698
  }, [i]);
29712
29699
  let { camera: ae, requestCamera: A } = dh(), { isCamMuted: oe } = rv(), se = ae.isGranted && !oe;
29713
29700
  M(() => {
29714
- te && t === "joined-meeting" && (ZF.value = se);
29701
+ te && t === "joined-meeting" && (XF.value = se);
29715
29702
  }, [
29716
29703
  te,
29717
29704
  t,
29718
29705
  se
29719
29706
  ]);
29720
- let ce = N(te && !a && ZF.value === !0);
29707
+ let ce = N(te && !a && XF.value === !0);
29721
29708
  M(() => {
29722
29709
  t === "joined-meeting" && ce.current && (ce.current = !1, A());
29723
29710
  }, [t, A]), M(() => {
@@ -29741,10 +29728,10 @@ var ZF = Dt(null), QF = {
29741
29728
  let ue = F(() => {
29742
29729
  i();
29743
29730
  }, [i]);
29744
- if (UF({
29731
+ if (HF({
29745
29732
  active: !O && t === "joined-meeting",
29746
29733
  onTimeout: ue
29747
- }), GF({ onShutdown: ue }), !C) return null;
29734
+ }), WF({ onShutdown: ue }), !C) return null;
29748
29735
  if (O) return /* @__PURE__ */ L(Lv, {
29749
29736
  defaultOpen: !0,
29750
29737
  children: /* @__PURE__ */ L("div", {
@@ -29776,14 +29763,14 @@ var ZF = Dt(null), QF = {
29776
29763
  /* @__PURE__ */ L("div", {
29777
29764
  class: "relative w-full h-full z-[5]",
29778
29765
  children: [
29779
- /* @__PURE__ */ L(oI, {
29766
+ /* @__PURE__ */ L(aI, {
29780
29767
  isAudioOnly: D,
29781
29768
  presence: ee,
29782
29769
  canvasLayoutEffect: p,
29783
29770
  canvasRenderedSlot: h
29784
29771
  }),
29785
- !D && /* @__PURE__ */ L(iI, { canvasRenderedSlot: h }),
29786
- /* @__PURE__ */ L(gF, {
29772
+ !D && /* @__PURE__ */ L(rI, { canvasRenderedSlot: h }),
29773
+ /* @__PURE__ */ L(hF, {
29787
29774
  debugEnabled: d,
29788
29775
  callPresence: ee,
29789
29776
  callControlsVisible: T,
@@ -29821,7 +29808,7 @@ var ZF = Dt(null), QF = {
29821
29808
  /* @__PURE__ */ L(wv, { level: !0 }),
29822
29809
  !D && /* @__PURE__ */ L(Ev, {}),
29823
29810
  k && /* @__PURE__ */ L(Pv, {}),
29824
- /* @__PURE__ */ L(uI, { items: de }),
29811
+ /* @__PURE__ */ L(lI, { items: de }),
29825
29812
  /* @__PURE__ */ L("button", {
29826
29813
  type: "button",
29827
29814
  class: "btn btn-control btn-error",
@@ -29838,7 +29825,7 @@ var ZF = Dt(null), QF = {
29838
29825
  ]
29839
29826
  }), ie && np(/* @__PURE__ */ L(ny, { onLeave: ue }), ie.document.body)] }) }) });
29840
29827
  });
29841
- function fI(e) {
29828
+ function dI(e) {
29842
29829
  if (!e || e.readyState < 2 || !e.videoWidth || !e.videoHeight) return null;
29843
29830
  let t = document.createElement("canvas"), n = Math.round(640 * (e.videoHeight / e.videoWidth));
29844
29831
  t.width = 640, t.height = n;
@@ -29853,7 +29840,7 @@ function fI(e) {
29853
29840
  }
29854
29841
  //#endregion
29855
29842
  //#region ../core/src/components/hair-check/index.tsx
29856
- function pI(e, t, n) {
29843
+ function fI(e, t, n) {
29857
29844
  switch (t) {
29858
29845
  case "granted": return n ? e?.cameraOptional ?? "Camera is optional — turn it on anytime." : e?.ready ?? "You're all set — join whenever you're ready.";
29859
29846
  case "blocked": return e?.denied ?? "Microphone is blocked. Click the mic to see how to allow it.";
@@ -29864,7 +29851,7 @@ function pI(e, t, n) {
29864
29851
  default: return e?.loading ?? "Getting your microphone ready...";
29865
29852
  }
29866
29853
  }
29867
- var mI = Hf(({ text: e, isJoining: t = !1, onJoin: n, onCancel: r }) => {
29854
+ var pI = Hf(({ text: e, isJoining: t = !1, onJoin: n, onCancel: r }) => {
29868
29855
  let i = Ef(), { config: a } = Zm(), { cameraOnStart: o } = I(st), { localSessionId: s, isCamMuted: c } = rv(), { mic: l, camera: u, requestMic: d, requestCamera: f } = dh(), p = a.value.customization.conversation.modality === "video", m = s_(a.value), h = o_(a.value);
29869
29856
  M(() => {
29870
29857
  d();
@@ -29880,7 +29867,7 @@ var mI = Hf(({ text: e, isJoining: t = !1, onJoin: n, onCancel: r }) => {
29880
29867
  u.isBlocked,
29881
29868
  f
29882
29869
  ]);
29883
- let v = p && g && !u.isGranted, y = pI(e, l.status, v);
29870
+ let v = p && g && !u.isGranted, y = fI(e, l.status, v);
29884
29871
  return /* @__PURE__ */ L(fv, { children: /* @__PURE__ */ L("div", {
29885
29872
  class: "absolute inset-0 motion-safe:animate-[tavusFadeUp_280ms_ease-out]",
29886
29873
  children: [u.isGranted && !c ? /* @__PURE__ */ L("div", {
@@ -29931,8 +29918,8 @@ var mI = Hf(({ text: e, isJoining: t = !1, onJoin: n, onCancel: r }) => {
29931
29918
  })]
29932
29919
  })]
29933
29920
  }) });
29934
- }), hI = "Password required", gI = "Enter the password to start this conversation.", _I = "Password", vI = "Continue";
29935
- function yI({ onSubmit: e, text: t, isSubmitting: n = !1, errorMessage: r }) {
29921
+ }), mI = "Password required", hI = "Enter the password to start this conversation.", gI = "Password", _I = "Continue";
29922
+ function vI({ onSubmit: e, text: t, isSubmitting: n = !1, errorMessage: r }) {
29936
29923
  let [i, a] = j(""), o = Ze();
29937
29924
  return /* @__PURE__ */ L("div", {
29938
29925
  class: "absolute inset-0 z-30 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",
@@ -29952,18 +29939,18 @@ function yI({ onSubmit: e, text: t, isSubmitting: n = !1, errorMessage: r }) {
29952
29939
  /* @__PURE__ */ L("h3", {
29953
29940
  id: `${o}-title`,
29954
29941
  class: "card-title text-base-content",
29955
- children: t?.title ?? hI
29942
+ children: t?.title ?? mI
29956
29943
  }),
29957
29944
  /* @__PURE__ */ L("p", {
29958
29945
  class: "text-sm text-base-content/70",
29959
- children: t?.description ?? gI
29946
+ children: t?.description ?? hI
29960
29947
  }),
29961
29948
  /* @__PURE__ */ L("input", {
29962
29949
  id: o,
29963
29950
  type: "password",
29964
29951
  autocomplete: "current-password",
29965
29952
  class: "input input-bordered w-full",
29966
- placeholder: t?.placeholder ?? _I,
29953
+ placeholder: t?.placeholder ?? gI,
29967
29954
  value: i,
29968
29955
  disabled: n,
29969
29956
  onInput: (e) => a(e.target.value),
@@ -29979,7 +29966,7 @@ function yI({ onSubmit: e, text: t, isSubmitting: n = !1, errorMessage: r }) {
29979
29966
  type: "submit",
29980
29967
  disabled: !i.trim(),
29981
29968
  loading: n,
29982
- children: t?.submit ?? vI
29969
+ children: t?.submit ?? _I
29983
29970
  })
29984
29971
  ]
29985
29972
  })
@@ -29988,7 +29975,7 @@ function yI({ onSubmit: e, text: t, isSubmitting: n = !1, errorMessage: r }) {
29988
29975
  }
29989
29976
  //#endregion
29990
29977
  //#region ../core/src/components/welcome/index.tsx
29991
- function bI({ text: e, onStart: t, isStarting: n, permissionRequest: r }) {
29978
+ function yI({ text: e, onStart: t, isStarting: n, permissionRequest: r }) {
29992
29979
  let { config: i, deploymentId: a } = Zm(), o = M_() === "full-screen", s = I(Dm), c = s_(i.value), l = c.btn_title ?? e?.fallback_button ?? "Start the conversation", u = i.value.customization.terms_content?.trim() ?? "", d = i.value.customization.terms_enabled === !0, f = u.length > 0, p = f && d, m = P(() => p && $p(a, u), [
29993
29980
  p,
29994
29981
  a,
@@ -29997,7 +29984,7 @@ function bI({ text: e, onStart: t, isStarting: n, permissionRequest: r }) {
29997
29984
  return /* @__PURE__ */ L(G_, {
29998
29985
  title: c.title,
29999
29986
  description: c.description,
30000
- overlay: v && s ? /* @__PURE__ */ L(yI, { onSubmit: s.setPassword }) : null,
29987
+ overlay: v && s ? /* @__PURE__ */ L(vI, { onSubmit: s.setPassword }) : null,
30001
29988
  children: [/* @__PURE__ */ L("div", {
30002
29989
  class: "relative",
30003
29990
  children: [r && /* @__PURE__ */ L(P_, {
@@ -30035,28 +30022,28 @@ function bI({ text: e, onStart: t, isStarting: n, permissionRequest: r }) {
30035
30022
  }
30036
30023
  //#endregion
30037
30024
  //#region ../core/src/hooks/use-haircheck-text.ts
30038
- function xI(...e) {
30025
+ function bI(...e) {
30039
30026
  for (let t of e) {
30040
30027
  let e = t?.trim();
30041
30028
  if (e) return e;
30042
30029
  }
30043
30030
  }
30044
- function SI() {
30031
+ function xI() {
30045
30032
  let { config: e } = Zm(), { haircheck: t } = e.value.customization;
30046
30033
  return P(() => ({
30047
- prompt: xI(t.permission_request_description, t.permission_request_title),
30048
- ready: xI(t.permission_granted_description, t.permission_granted_title),
30049
- denied: xI(t.permission_denied_description, t.permission_denied_title),
30050
- join: xI(t.join_button),
30051
- cancel: xI(t.cancel_btn)
30034
+ prompt: bI(t.permission_request_description, t.permission_request_title),
30035
+ ready: bI(t.permission_granted_description, t.permission_granted_title),
30036
+ denied: bI(t.permission_denied_description, t.permission_denied_title),
30037
+ join: bI(t.join_button),
30038
+ cancel: bI(t.cancel_btn)
30052
30039
  }), [t]);
30053
30040
  }
30054
30041
  //#endregion
30055
30042
  //#region ../core/src/shells/flow-state-body.tsx
30056
- function CI({ flow: e, welcomeText: t, onUnavailableCancel: n }) {
30057
- let r = SI();
30043
+ function SI({ flow: e, welcomeText: t, onUnavailableCancel: n }) {
30044
+ let r = xI();
30058
30045
  switch (e.state) {
30059
- case "idle": return /* @__PURE__ */ L(bI, {
30046
+ case "idle": return /* @__PURE__ */ L(yI, {
30060
30047
  text: t,
30061
30048
  onStart: () => {
30062
30049
  e.start();
@@ -30064,7 +30051,7 @@ function CI({ flow: e, welcomeText: t, onUnavailableCancel: n }) {
30064
30051
  isStarting: e.isStarting,
30065
30052
  permissionRequest: e.permissionRequest
30066
30053
  });
30067
- case "haircheck": return /* @__PURE__ */ L(mI, {
30054
+ case "haircheck": return /* @__PURE__ */ L(pI, {
30068
30055
  text: r,
30069
30056
  onJoin: () => {
30070
30057
  e.join();
@@ -30072,7 +30059,7 @@ function CI({ flow: e, welcomeText: t, onUnavailableCancel: n }) {
30072
30059
  onCancel: () => e.cancel(),
30073
30060
  isJoining: e.isStarting
30074
30061
  });
30075
- case "call": return /* @__PURE__ */ L(dI, { onLeave: () => e.leave() });
30062
+ case "call": return /* @__PURE__ */ L(uI, { onLeave: () => e.leave() });
30076
30063
  case "ended": return /* @__PURE__ */ L($_, {
30077
30064
  isStarting: e.isStarting,
30078
30065
  permissionRequest: e.permissionRequest,
@@ -30097,7 +30084,7 @@ function CI({ flow: e, welcomeText: t, onUnavailableCancel: n }) {
30097
30084
  }
30098
30085
  //#endregion
30099
30086
  //#region ../core/src/providers/widget-ui-provider.tsx
30100
- function wI({ children: e }) {
30087
+ function CI({ children: e }) {
30101
30088
  let { config: t } = I(gr), n = t.peek().customization?.widget, r = n?.expandable ?? "default", i = qt(r === "start-expanded" || r === "always"), a = qt(n?.variant ?? "full"), o = qt(n?.position ?? "bottom-right"), s = qt(r), c = qt(n?.avatar?.type ?? "orb"), l = N(r);
30102
30089
  en(() => {
30103
30090
  let e = t.value.customization?.widget, n = e?.expandable ?? "default";
@@ -30147,14 +30134,14 @@ function wI({ children: e }) {
30147
30134
  }
30148
30135
  //#endregion
30149
30136
  //#region ../core/src/components/powered-by/index.tsx
30150
- function TI() {
30137
+ function wI() {
30151
30138
  let { config: e } = Zm(), t = e.value.customization.branding;
30152
- return e.value.show_tavus_branding !== !1 && !t?.hide_tavus_badge ? /* @__PURE__ */ L(EI, {}) : t?.logo || t?.text ? /* @__PURE__ */ L(DI, {
30139
+ return e.value.show_tavus_branding !== !1 && !t?.hide_tavus_badge ? /* @__PURE__ */ L(TI, {}) : t?.logo || t?.text ? /* @__PURE__ */ L(EI, {
30153
30140
  logo: t.logo,
30154
30141
  text: t.text
30155
30142
  }) : null;
30156
30143
  }
30157
- function EI() {
30144
+ function TI() {
30158
30145
  let { isDark: e } = vj(), t = e.value ? "white" : "#140206";
30159
30146
  return /* @__PURE__ */ L("a", {
30160
30147
  href: "https://tavus.io",
@@ -30181,7 +30168,7 @@ function EI() {
30181
30168
  })] })]
30182
30169
  });
30183
30170
  }
30184
- function DI({ logo: e, text: t }) {
30171
+ function EI({ logo: e, text: t }) {
30185
30172
  return /* @__PURE__ */ L("div", {
30186
30173
  class: "inline-flex items-center gap-1 text-xs text-base-content/50",
30187
30174
  children: [e ? /* @__PURE__ */ L("img", {
@@ -30193,63 +30180,63 @@ function DI({ logo: e, text: t }) {
30193
30180
  }
30194
30181
  //#endregion
30195
30182
  //#region ../core/src/hooks/use-widget-text.ts
30196
- var OI = {
30183
+ var DI = {
30197
30184
  title: "Hi! Want to chat?",
30198
30185
  btn_title: "Start conversation"
30199
30186
  };
30200
- function kI() {
30187
+ function OI() {
30201
30188
  let { config: e } = Zm(), t = e.value.customization.widget?.text;
30202
30189
  return P(() => ({
30203
- title: t?.title || OI.title,
30204
- btn_title: t?.btn_title || OI.btn_title
30190
+ title: t?.title || DI.title,
30191
+ btn_title: t?.btn_title || DI.btn_title
30205
30192
  }), [t]);
30206
30193
  }
30207
30194
  //#endregion
30208
30195
  //#region ../core/src/hooks/use-widget-ui.ts
30209
- function AI() {
30196
+ function kI() {
30210
30197
  let e = I(bh);
30211
30198
  if (!e) throw Error("useWidgetUI must be used within WidgetUIProvider");
30212
30199
  return e;
30213
30200
  }
30214
30201
  //#endregion
30215
30202
  //#region ../core/src/components/widget-launcher/widget-avatar.tsx
30216
- var jI = {
30203
+ var AI = {
30217
30204
  xs: "w-6 h-6",
30218
30205
  sm: "w-8 h-8",
30219
30206
  md: "w-10 h-10",
30220
30207
  lg: "w-16 h-16"
30221
- }, MI = {
30208
+ }, jI = {
30222
30209
  xs: "w-3 h-3",
30223
30210
  sm: "w-4 h-4",
30224
30211
  md: "w-5 h-5",
30225
30212
  lg: "w-8 h-8"
30226
30213
  };
30227
- function NI({ size: e = "md", className: t = "" }) {
30228
- let { avatarType: n } = AI(), { config: r } = Zm(), i = o_(r.value);
30214
+ function MI({ size: e = "md", className: t = "" }) {
30215
+ let { avatarType: n } = kI(), { config: r } = Zm(), i = o_(r.value);
30229
30216
  return (s_(r.value).background.type === "replica" || n.value === "image") && i ? /* @__PURE__ */ L("div", {
30230
- class: `relative ${jI[e]} rounded-box overflow-hidden bg-base-300 ${t}`,
30217
+ class: `relative ${AI[e]} rounded-box overflow-hidden bg-base-300 ${t}`,
30231
30218
  children: /* @__PURE__ */ L(m_, { replica: i })
30232
30219
  }) : /* @__PURE__ */ L("div", {
30233
- class: `relative ${jI[e]} rounded-box bg-primary/15 flex items-center justify-center ${t}`,
30234
- children: /* @__PURE__ */ L("span", { class: `${MI[e]} rounded-full bg-primary animate-pulse` })
30220
+ class: `relative ${AI[e]} rounded-box bg-primary/15 flex items-center justify-center ${t}`,
30221
+ children: /* @__PURE__ */ L("span", { class: `${jI[e]} rounded-full bg-primary animate-pulse` })
30235
30222
  });
30236
30223
  }
30237
30224
  //#endregion
30238
30225
  //#region ../core/src/components/widget-launcher/widget-launcher.tsx
30239
- function PI({ variant: e }) {
30240
- let { toggle: t } = AI(), n = kI();
30226
+ function NI({ variant: e }) {
30227
+ let { toggle: t } = kI(), n = OI();
30241
30228
  return e === "tiny" ? /* @__PURE__ */ L("button", {
30242
30229
  type: "button",
30243
30230
  onClick: t,
30244
30231
  "aria-label": n.btn_title,
30245
30232
  class: "rounded-box overflow-hidden shadow-xl hover:shadow-2xl transition-shadow cursor-pointer",
30246
- children: /* @__PURE__ */ L(NI, { size: "lg" })
30233
+ children: /* @__PURE__ */ L(MI, { size: "lg" })
30247
30234
  }) : e === "compact" ? /* @__PURE__ */ L("button", {
30248
30235
  type: "button",
30249
30236
  onClick: t,
30250
30237
  "aria-label": n.btn_title,
30251
30238
  class: "group flex items-center gap-2.5 py-2.5 pl-2.5 pr-8 rounded-box bg-base-100 text-base-content border border-base-300 shadow-lg hover:shadow-xl transition-shadow cursor-pointer text-left",
30252
- children: [/* @__PURE__ */ L(NI, { size: "md" }), /* @__PURE__ */ L("span", {
30239
+ children: [/* @__PURE__ */ L(MI, { size: "md" }), /* @__PURE__ */ L("span", {
30253
30240
  class: "flex flex-col gap-0.5",
30254
30241
  children: [/* @__PURE__ */ L("span", {
30255
30242
  class: "text-base font-medium leading-tight",
@@ -30266,7 +30253,7 @@ function PI({ variant: e }) {
30266
30253
  class: "flex flex-col gap-3 p-3 w-64 rounded-box bg-base-100 text-base-content border border-base-300 shadow-xl hover:shadow-2xl transition-shadow cursor-pointer text-left",
30267
30254
  children: [/* @__PURE__ */ L("div", {
30268
30255
  class: "flex items-center gap-2.5",
30269
- children: [/* @__PURE__ */ L(NI, { size: "md" }), /* @__PURE__ */ L("span", {
30256
+ children: [/* @__PURE__ */ L(MI, { size: "md" }), /* @__PURE__ */ L("span", {
30270
30257
  class: "text-sm font-medium leading-snug",
30271
30258
  children: n.title
30272
30259
  })]
@@ -30284,13 +30271,13 @@ function PI({ variant: e }) {
30284
30271
  }
30285
30272
  //#endregion
30286
30273
  //#region ../core/src/components/widget-launcher/widget-greeting-bubble.tsx
30287
- var FI = "tavus:widget:greeting-dismissed";
30288
- function II({ anchor: e }) {
30289
- let t = kI(), { variant: n, expand: r } = AI(), [i, a] = j(!1);
30274
+ var PI = "tavus:widget:greeting-dismissed";
30275
+ function FI({ anchor: e }) {
30276
+ let t = OI(), { variant: n, expand: r } = kI(), [i, a] = j(!1);
30290
30277
  M(() => {
30291
30278
  if (n.value === "tiny") {
30292
30279
  try {
30293
- if (sessionStorage.getItem(FI) === "1") return;
30280
+ if (sessionStorage.getItem(PI) === "1") return;
30294
30281
  } catch {}
30295
30282
  a(!0);
30296
30283
  }
@@ -30298,7 +30285,7 @@ function II({ anchor: e }) {
30298
30285
  let o = F((e) => {
30299
30286
  e.stopPropagation();
30300
30287
  try {
30301
- sessionStorage.setItem(FI, "1");
30288
+ sessionStorage.setItem(PI, "1");
30302
30289
  } catch {}
30303
30290
  a(!1);
30304
30291
  }, []);
@@ -30330,18 +30317,18 @@ function II({ anchor: e }) {
30330
30317
  }
30331
30318
  //#endregion
30332
30319
  //#region ../core/src/hooks/use-host-bridge.ts
30333
- function LI() {
30320
+ function II() {
30334
30321
  let e = I(Sh);
30335
30322
  if (!e) throw Error("useHostBridge must be used within HostBridgeProvider");
30336
30323
  return e;
30337
30324
  }
30338
30325
  //#endregion
30339
30326
  //#region ../core/src/shells/widget/widget-popup.tsx
30340
- var RI = "bg-base-100 text-base-content rounded-box border border-base-300 shadow-xl w-[22rem] flex flex-col animate-[tavusPopIn_180ms_ease-out]", zI = "bg-base-100 text-base-content w-[100vw] h-[100dvh] flex flex-col animate-[tavusFadeUp_180ms_ease-out]", BI = "p-1 flex-1 min-h-0", VI = "p-1 flex-1 min-h-0";
30341
- function HI({ variant: e, children: t, onClose: n, fullscreen: r }) {
30342
- let { expandable: i } = AI(), a = i.value !== "always";
30327
+ var LI = "bg-base-100 text-base-content rounded-box border border-base-300 shadow-xl w-[22rem] flex flex-col animate-[tavusPopIn_180ms_ease-out]", RI = "bg-base-100 text-base-content w-[100vw] h-[100dvh] flex flex-col animate-[tavusFadeUp_180ms_ease-out]", zI = "p-1 flex-1 min-h-0", BI = "p-1 flex-1 min-h-0";
30328
+ function VI({ variant: e, children: t, onClose: n, fullscreen: r }) {
30329
+ let { expandable: i } = kI(), a = i.value !== "always";
30343
30330
  return r ? /* @__PURE__ */ L("div", {
30344
- class: zI,
30331
+ class: RI,
30345
30332
  children: [
30346
30333
  /* @__PURE__ */ L("div", {
30347
30334
  class: "flex items-center justify-end gap-2 px-2.5 py-1.5 border-b border-base-300",
@@ -30357,18 +30344,18 @@ function HI({ variant: e, children: t, onClose: n, fullscreen: r }) {
30357
30344
  })
30358
30345
  }),
30359
30346
  /* @__PURE__ */ L("div", {
30360
- class: VI,
30347
+ class: BI,
30361
30348
  children: t
30362
30349
  }),
30363
30350
  /* @__PURE__ */ L("div", {
30364
30351
  class: "flex justify-end px-2.5",
30365
- children: /* @__PURE__ */ L(TI, {})
30352
+ children: /* @__PURE__ */ L(wI, {})
30366
30353
  })
30367
30354
  ]
30368
30355
  }) : /* @__PURE__ */ L("div", {
30369
30356
  class: "flex flex-col h-[min(34rem,calc(100dvh-3rem))]",
30370
30357
  children: [/* @__PURE__ */ L("div", {
30371
- class: `${RI} flex-1 overflow-hidden`,
30358
+ class: `${LI} flex-1 overflow-hidden`,
30372
30359
  children: [/* @__PURE__ */ L("div", {
30373
30360
  class: "flex items-center justify-end gap-2 px-2.5 pt-1.5 shrink-0",
30374
30361
  children: a && /* @__PURE__ */ L("button", {
@@ -30382,77 +30369,77 @@ function HI({ variant: e, children: t, onClose: n, fullscreen: r }) {
30382
30369
  })
30383
30370
  })
30384
30371
  }), /* @__PURE__ */ L("div", {
30385
- class: BI,
30372
+ class: zI,
30386
30373
  children: t
30387
30374
  })]
30388
30375
  }), /* @__PURE__ */ L("div", {
30389
30376
  class: "flex justify-end pr-2 pt-1.5 shrink-0",
30390
- children: /* @__PURE__ */ L(TI, {})
30377
+ children: /* @__PURE__ */ L(wI, {})
30391
30378
  })]
30392
30379
  });
30393
30380
  }
30394
30381
  //#endregion
30395
30382
  //#region ../core/src/shells/widget/widget-shell.tsx
30396
- var UI = tn("Widget"), WI = "1rem", GI = 480;
30397
- function KI(e, t, n) {
30383
+ var HI = tn("Widget"), UI = "1rem", WI = 480;
30384
+ function GI(e, t, n) {
30398
30385
  let r = e.state === "call", i = r || e.state === "haircheck" || e.isStarting;
30399
30386
  e.cancel(), r && e.leave(), i && t(), n();
30400
30387
  }
30401
- function qI() {
30402
- return typeof window > "u" ? !1 : window.innerWidth <= GI;
30388
+ function KI() {
30389
+ return typeof window > "u" ? !1 : window.innerWidth <= WI;
30403
30390
  }
30404
- function JI(e) {
30391
+ function qI(e) {
30405
30392
  switch (e) {
30406
30393
  case "bottom-right": return {
30407
- bottom: WI,
30408
- right: WI
30394
+ bottom: UI,
30395
+ right: UI
30409
30396
  };
30410
30397
  case "bottom-left": return {
30411
- bottom: WI,
30412
- left: WI
30398
+ bottom: UI,
30399
+ left: UI
30413
30400
  };
30414
30401
  case "top-right": return {
30415
- top: WI,
30416
- right: WI
30402
+ top: UI,
30403
+ right: UI
30417
30404
  };
30418
30405
  case "top-left": return {
30419
- top: WI,
30420
- left: WI
30406
+ top: UI,
30407
+ left: UI
30421
30408
  };
30422
30409
  case "top": return {
30423
- top: WI,
30410
+ top: UI,
30424
30411
  left: "50%",
30425
30412
  transform: "translateX(-50%)"
30426
30413
  };
30427
30414
  case "bottom": return {
30428
- bottom: WI,
30415
+ bottom: UI,
30429
30416
  left: "50%",
30430
30417
  transform: "translateX(-50%)"
30431
30418
  };
30432
30419
  }
30433
30420
  }
30434
- var YI = [
30421
+ var JI = [
30435
30422
  "top",
30436
30423
  "bottom",
30437
30424
  "left",
30438
30425
  "right",
30439
30426
  "transform"
30440
30427
  ];
30441
- function XI(e) {
30428
+ function YI(e) {
30442
30429
  return e === "bottom-left" || e === "top-left" ? "left" : "right";
30443
30430
  }
30444
- function ZI() {
30445
- let { config: e, initError: t } = Zm(), n = kI(), { expanded: r, position: i, variant: a, collapse: o } = AI(), { end: s } = Av(), { shadowHost: c } = LI(), l = j_(), u = qt(qI());
30431
+ function XI() {
30432
+ let { config: e, initError: t } = Zm(), n = OI(), { expanded: r, position: i, variant: a, collapse: o } = kI(), { end: s } = Av(), { shadowHost: c } = II(), l = j_(), u = qt(KI());
30446
30433
  M(() => {
30447
30434
  if (typeof window > "u") return;
30448
- u.value = qI();
30435
+ u.value = KI();
30449
30436
  let e = () => {
30450
- u.value = qI();
30437
+ u.value = KI();
30451
30438
  };
30452
30439
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
30453
30440
  }, [u]);
30454
30441
  let d = P(() => ({ fallback_button: n.btn_title }), [n.btn_title]), f = F(() => {
30455
- KI(l, s, o);
30442
+ GI(l, s, o);
30456
30443
  }, [
30457
30444
  l,
30458
30445
  s,
@@ -30463,27 +30450,27 @@ function ZI() {
30463
30450
  if (e) {
30464
30451
  if (a) e.style.top = "0", e.style.right = "0", e.style.bottom = "0", e.style.left = "0", e.style.transform = "";
30465
30452
  else {
30466
- let n = JI(t);
30467
- for (let t of YI) e.style[t] = n[t] ?? "";
30453
+ let n = qI(t);
30454
+ for (let t of JI) e.style[t] = n[t] ?? "";
30468
30455
  }
30469
30456
  e.dataset.tavusWidgetPosition = t, e.dataset.tavusWidgetExpanded = n ? "true" : "false", e.dataset.tavusWidgetFullscreen = a ? "true" : "false", e.dataset.tavusWidgetSmall = u.value ? "true" : "false";
30470
30457
  }
30471
- }), t.value) return UI.error("Widget cannot initialize (init request failed):", t.value), null;
30472
- if (e.value.is_available === !1 && e.value.unavailable_reason === "total_limit") return UI.error("Widget is unavailable (total_limit reached) — not rendering"), null;
30458
+ }), t.value) return HI.error("Widget cannot initialize (init request failed):", t.value), null;
30459
+ if (e.value.is_available === !1 && e.value.unavailable_reason === "total_limit") return HI.error("Widget is unavailable (total_limit reached) — not rendering"), null;
30473
30460
  if (!r.value) {
30474
- let e = XI(i.value), t = e === "right" ? "flex items-end gap-2 justify-end" : "flex items-end gap-2 flex-row-reverse justify-end", n = e === "right" ? "justify-end pr-2" : "justify-start pl-2";
30461
+ let e = YI(i.value), t = e === "right" ? "flex items-end gap-2 justify-end" : "flex items-end gap-2 flex-row-reverse justify-end", n = e === "right" ? "justify-end pr-2" : "justify-start pl-2";
30475
30462
  return /* @__PURE__ */ L("div", {
30476
30463
  class: "flex flex-col",
30477
30464
  children: [/* @__PURE__ */ L("div", {
30478
30465
  class: t,
30479
- children: [/* @__PURE__ */ L(II, { anchor: e }), /* @__PURE__ */ L(PI, { variant: a.value })]
30466
+ children: [/* @__PURE__ */ L(FI, { anchor: e }), /* @__PURE__ */ L(NI, { variant: a.value })]
30480
30467
  }), /* @__PURE__ */ L("div", {
30481
30468
  class: `flex ${n} pt-1.5`,
30482
- children: /* @__PURE__ */ L(TI, {})
30469
+ children: /* @__PURE__ */ L(wI, {})
30483
30470
  })]
30484
30471
  });
30485
30472
  }
30486
- return e.value.is_available === !1 ? /* @__PURE__ */ L(HI, {
30473
+ return e.value.is_available === !1 ? /* @__PURE__ */ L(VI, {
30487
30474
  variant: a.value,
30488
30475
  fullscreen: u.value,
30489
30476
  onClose: f,
@@ -30492,11 +30479,11 @@ function ZI() {
30492
30479
  canRetry: !1,
30493
30480
  onRetry: () => {}
30494
30481
  }) })
30495
- }) : /* @__PURE__ */ L(HI, {
30482
+ }) : /* @__PURE__ */ L(VI, {
30496
30483
  variant: a.value,
30497
30484
  fullscreen: u.value,
30498
30485
  onClose: f,
30499
- children: /* @__PURE__ */ L(Bh, { children: /* @__PURE__ */ L(CI, {
30486
+ children: /* @__PURE__ */ L(Bh, { children: /* @__PURE__ */ L(SI, {
30500
30487
  flow: l,
30501
30488
  welcomeText: d,
30502
30489
  onUnavailableCancel: () => l.restart()
@@ -30505,11 +30492,11 @@ function ZI() {
30505
30492
  }
30506
30493
  //#endregion
30507
30494
  //#region ../core/src/widget/tavus-widget.tsx
30508
- var QI = ":host {\n display: block;\n position: fixed;\n z-index: 50;\n background: transparent;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n}";
30509
- function $I(e) {
30495
+ var ZI = ":host {\n display: block;\n position: fixed;\n z-index: 50;\n background: transparent;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n}";
30496
+ function QI(e) {
30510
30497
  return /* @__PURE__ */ L(E, { children: [
30511
30498
  /* @__PURE__ */ L("style", { dangerouslySetInnerHTML: { __html: Pe } }),
30512
- /* @__PURE__ */ L("style", { dangerouslySetInnerHTML: { __html: QI } }),
30499
+ /* @__PURE__ */ L("style", { dangerouslySetInnerHTML: { __html: ZI } }),
30513
30500
  /* @__PURE__ */ L(lt, {
30514
30501
  surface: "widget",
30515
30502
  "camera-on-start": e["camera-on-start"],
@@ -30520,13 +30507,13 @@ function $I(e) {
30520
30507
  "memory-stores": e["memory-stores"],
30521
30508
  "base-url": e["base-url"],
30522
30509
  token: e.token,
30523
- children: /* @__PURE__ */ L(_r, { children: /* @__PURE__ */ L(yr, { children: /* @__PURE__ */ L(Om, { children: /* @__PURE__ */ L(Xm, { children: /* @__PURE__ */ L(yh, { children: /* @__PURE__ */ L(wI, { children: /* @__PURE__ */ L(wh, { children: /* @__PURE__ */ L(Eh, { children: /* @__PURE__ */ L(ZI, {}) }) }) }) }) }) }) }) })
30510
+ children: /* @__PURE__ */ L(_r, { children: /* @__PURE__ */ L(yr, { children: /* @__PURE__ */ L(Om, { children: /* @__PURE__ */ L(Xm, { children: /* @__PURE__ */ L(yh, { children: /* @__PURE__ */ L(CI, { children: /* @__PURE__ */ L(wh, { children: /* @__PURE__ */ L(Eh, { children: /* @__PURE__ */ L(XI, {}) }) }) }) }) }) }) }) })
30524
30511
  })
30525
30512
  ] });
30526
30513
  }
30527
- var eL;
30528
- function tL() {
30529
- eL ||= Ee($I, "tavus-widget", [
30514
+ var $I;
30515
+ function eL() {
30516
+ $I ||= Ee(QI, "tavus-widget", [
30530
30517
  "camera-on-start",
30531
30518
  "deployment-id",
30532
30519
  "override-config",
@@ -30542,7 +30529,7 @@ function tL() {
30542
30529
  }
30543
30530
  //#endregion
30544
30531
  //#region src/integration.ts
30545
- var nL = [
30532
+ var tL = [
30546
30533
  "tavus:chat-message",
30547
30534
  "tavus:conversation-created",
30548
30535
  "tavus:conversation-ended",
@@ -30554,7 +30541,7 @@ var nL = [
30554
30541
  "tavus:ready",
30555
30542
  "tavus:state-change",
30556
30543
  "tavus:tool-call"
30557
- ], rL = class {
30544
+ ], nL = class {
30558
30545
  element = null;
30559
30546
  tagName;
30560
30547
  constructor(e = "tavus-widget") {
@@ -30605,6 +30592,6 @@ var nL = [
30605
30592
  };
30606
30593
  //#endregion
30607
30594
  //#region src/index.ts
30608
- typeof window < "u" && tL();
30595
+ typeof window < "u" && eL();
30609
30596
  //#endregion
30610
- export { nL as TAVUS_EVENT_NAMES, rL as TavusIntegration };
30597
+ export { tL as TAVUS_EVENT_NAMES, nL as TavusIntegration };