@flowengage/react-chatbot 8.0.119 → 8.0.121

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.
@@ -9529,7 +9529,7 @@ async function Oh(e) {
9529
9529
  break;
9530
9530
  case "PromptUpdated": break;
9531
9531
  case "AgentPanel":
9532
- m?.({
9532
+ console.log("[FlowEngage] AgentPanel received:", e.panel, (e.items || []).length, "items"), m?.({
9533
9533
  panel: e.panel || null,
9534
9534
  title: e.title || null,
9535
9535
  items: e.items || []
@@ -9549,9 +9549,17 @@ async function Oh(e) {
9549
9549
  M && le.enqueue(new Int16Array(e.data));
9550
9550
  return;
9551
9551
  }
9552
+ let t;
9552
9553
  try {
9553
- ge(JSON.parse(e.data));
9554
- } catch {}
9554
+ t = JSON.parse(e.data);
9555
+ } catch {
9556
+ return;
9557
+ }
9558
+ try {
9559
+ ge(t);
9560
+ } catch (e) {
9561
+ console.error("[FlowEngage] voice event handler failed:", t?.type, e);
9562
+ }
9555
9563
  }, w.onerror = () => l?.(/* @__PURE__ */ Error("Voice connection failed")), w.onclose = () => {
9556
9564
  pe(), o?.();
9557
9565
  }, {
@@ -9848,53 +9856,56 @@ var Ih = null;
9848
9856
  function Lh() {
9849
9857
  return (!Ih || !Ih.isConnected) && (Ih = document.createElement("div"), Ih.id = `${Q}-panel`, document.body.appendChild(Ih)), Ih;
9850
9858
  }
9851
- var Rh = 12, zh = "right", Bh = !1;
9852
- function Vh(e, t) {
9853
- if (e.style.left = "", e.style.right = "", e.style.bottom = "", window.innerWidth <= 900) return;
9854
- let n = document.getElementById("flowengage-root"), r = (n?.shadowRoot?.querySelector(".flowengage-widget-root") || document.querySelector(".flowengage-widget-root") || n)?.getBoundingClientRect();
9855
- if (!r || !r.width) {
9856
- t === "left" ? e.style.left = "calc(1.5rem + 120px)" : e.style.right = "calc(1.5rem + 120px)";
9857
- return;
9859
+ var Rh = 12, zh = 320, Bh = 130, Vh = "right", Hh = !1;
9860
+ function Uh(e, t) {
9861
+ let n = () => {
9862
+ e.style.left = "", e.style.right = "", e.style.bottom = "1.5rem", t === "left" ? e.style.left = `${Bh}px` : e.style.right = `${Bh}px`;
9863
+ };
9864
+ e.style.left = "", e.style.right = "", e.style.bottom = "";
9865
+ let r = window.innerWidth, i = window.innerHeight;
9866
+ if (!(r <= 900)) try {
9867
+ let a = (document.getElementById("flowengage-root")?.shadowRoot?.querySelector(".flowengage-widget-root") || document.querySelector(".flowengage-widget-root"))?.getBoundingClientRect();
9868
+ if (!(a && a.width > 0 && a.width < r * .55 && a.height > 0)) return n();
9869
+ if (t === "left") {
9870
+ let t = Math.round(a.right + Rh);
9871
+ if (t + zh > r - 12) return n();
9872
+ e.style.left = `${t}px`;
9873
+ } else {
9874
+ let t = Math.round(r - a.left + Rh);
9875
+ if (t + zh > r - 12) return n();
9876
+ e.style.right = `${t}px`;
9877
+ }
9878
+ e.style.bottom = `${Math.min(Math.max(12, Math.round(i - a.bottom)), i - 200)}px`;
9879
+ } catch {
9880
+ n();
9858
9881
  }
9859
- t === "left" ? e.style.left = `${Math.round(r.right + Rh)}px` : e.style.right = `${Math.round(window.innerWidth - r.left + Rh)}px`, e.style.bottom = `${Math.max(12, Math.round(window.innerHeight - r.bottom))}px`;
9860
9882
  }
9861
- function Hh(e, t) {
9862
- let n = Number(e);
9863
- if (!Number.isFinite(n)) return null;
9864
- let r = n.toLocaleString(void 0, {
9865
- minimumFractionDigits: n % 1 == 0 ? 0 : 2,
9866
- maximumFractionDigits: 2
9867
- });
9868
- return t ? `${t} ${r}` : r;
9869
- }
9870
- function Uh(e) {
9871
- if (!e) return null;
9872
- let t = new Date(e);
9873
- return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString(void 0, {
9874
- day: "numeric",
9875
- month: "short",
9876
- year: "numeric"
9877
- });
9883
+ function Wh(e, t = {}) {
9884
+ try {
9885
+ Gh(e, t);
9886
+ } catch (e) {
9887
+ console.error("[FlowEngage] product panel render failed:", e), Kh();
9888
+ }
9878
9889
  }
9879
- function Wh(e, { title: t = "Products", side: n = "right", productUrl: r = null } = {}) {
9890
+ function Gh(e, { title: t = "Products", side: n = "right", productUrl: r = null } = {}) {
9880
9891
  if (typeof document > "u") return;
9881
9892
  let i = Array.isArray(e) ? e.filter(Boolean) : [];
9882
- if (!i.length) return Gh();
9893
+ if (!i.length) return console.log("[FlowEngage] product panel: nothing to show"), Kh();
9883
9894
  Ah();
9884
9895
  let a = Lh();
9885
- zh = n === "left" ? "left" : "right", Vh(a, zh), Bh || (Bh = !0, window.addEventListener("resize", () => {
9886
- Ih?.classList.contains(`${Q}-show`) && Vh(Ih, zh);
9887
- })), a.innerHTML = "";
9888
- let o = document.createElement("div");
9889
- o.id = `${Q}-panel-head`;
9890
- let s = document.createElement("div");
9891
- s.id = `${Q}-panel-title`, s.textContent = t;
9892
- let c = document.createElement("span");
9893
- c.id = `${Q}-panel-count`, c.textContent = String(i.length);
9894
- let l = document.createElement("button");
9895
- l.id = `${Q}-panel-close`, l.type = "button", l.setAttribute("aria-label", "Close product panel"), l.textContent = "×", l.addEventListener("click", () => Gh()), o.append(s, c, l);
9896
- let u = document.createElement("div");
9897
- u.id = `${Q}-panel-list`;
9896
+ Vh = n === "left" ? "left" : "right", Uh(a, Vh), Hh || (Hh = !0, window.addEventListener("resize", () => {
9897
+ Ih?.classList.contains(`${Q}-show`) && Uh(Ih, Vh);
9898
+ }));
9899
+ let o = document.createDocumentFragment(), s = document.createElement("div");
9900
+ s.id = `${Q}-panel-head`;
9901
+ let c = document.createElement("div");
9902
+ c.id = `${Q}-panel-title`, c.textContent = t;
9903
+ let l = document.createElement("span");
9904
+ l.id = `${Q}-panel-count`, l.textContent = String(i.length);
9905
+ let u = document.createElement("button");
9906
+ u.id = `${Q}-panel-close`, u.type = "button", u.setAttribute("aria-label", "Close product panel"), u.textContent = "×", u.addEventListener("click", () => Kh()), s.append(c, l, u);
9907
+ let d = document.createElement("div");
9908
+ d.id = `${Q}-panel-list`;
9898
9909
  for (let e of i) {
9899
9910
  let t = typeof r == "function" ? r(e) : null, n = document.createElement(t ? "a" : "div");
9900
9911
  if (n.className = `${Q}-card`, t && (n.href = t, n.rel = "noopener"), e.image) {
@@ -9913,7 +9924,7 @@ function Wh(e, { title: t = "Products", side: n = "right", productUrl: r = null
9913
9924
  a.className = `${Q}-card-title`, a.textContent = e.title || "Item", i.appendChild(a);
9914
9925
  let o = [];
9915
9926
  e.quantity > 1 && o.push(`Qty ${e.quantity}`);
9916
- let s = Uh(e.orderedAt);
9927
+ let s = formatWhen(e.orderedAt);
9917
9928
  if (s && o.push(s), e.fulfillmentStatus && o.push(e.fulfillmentStatus), o.length || e.productType) {
9918
9929
  let t = document.createElement("div");
9919
9930
  if (t.className = `${Q}-card-meta`, e.productType) {
@@ -9922,54 +9933,59 @@ function Wh(e, { title: t = "Products", side: n = "right", productUrl: r = null
9922
9933
  }
9923
9934
  t.appendChild(document.createTextNode(o.join(" · "))), i.appendChild(t);
9924
9935
  }
9925
- let c = Hh(e.price, e.currency);
9936
+ let c = formatMoney(e.price, e.currency);
9926
9937
  if (c) {
9927
9938
  let e = document.createElement("div");
9928
9939
  e.className = `${Q}-card-price`, e.textContent = c, i.appendChild(e);
9929
9940
  }
9930
- n.appendChild(i), u.appendChild(n);
9941
+ n.appendChild(i), d.appendChild(n);
9931
9942
  }
9932
- a.append(o, u), a.classList.remove(`${Q}-show`), a.offsetHeight, a.classList.add(`${Q}-show`);
9943
+ o.append(s, d), a.innerHTML = "", a.append(o), a.classList.remove(`${Q}-show`), a.offsetHeight, a.classList.add(`${Q}-show`), console.log("[FlowEngage] product panel shown:", i.length, "items", {
9944
+ left: a.style.left,
9945
+ right: a.style.right,
9946
+ bottom: a.style.bottom,
9947
+ rect: a.getBoundingClientRect()
9948
+ });
9933
9949
  }
9934
- function Gh() {
9950
+ function Kh() {
9935
9951
  Ih && Ih.classList.remove(`${Q}-show`);
9936
9952
  }
9937
- var Kh = null, qh = [];
9938
- function Jh() {
9939
- return (!Kh || !Kh.isConnected) && (Kh = document.createElement("div"), Kh.id = `${Q}-bar`, document.body.appendChild(Kh)), Kh;
9940
- }
9953
+ var qh = null, Jh = [];
9941
9954
  function Yh() {
9955
+ return (!qh || !qh.isConnected) && (qh = document.createElement("div"), qh.id = `${Q}-bar`, document.body.appendChild(qh)), qh;
9956
+ }
9957
+ function Xh() {
9942
9958
  if (typeof document > "u") return;
9943
- Ah(), qh.forEach(clearTimeout), qh = [];
9944
- let e = Jh();
9959
+ Ah(), Jh.forEach(clearTimeout), Jh = [];
9960
+ let e = Yh();
9945
9961
  e.style.transition = "none", e.style.width = "0%", e.classList.add(`${Q}-bar-active`), e.offsetHeight, e.style.transition = "width 0.35s ease, opacity 0.25s ease";
9946
9962
  let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
9947
9963
  for (let [e, r] of t) {
9948
9964
  let t = n, i = e, a = r;
9949
- qh.push(setTimeout(() => {
9950
- Kh && (Kh.style.transition = a, Kh.style.width = `${i}%`);
9965
+ Jh.push(setTimeout(() => {
9966
+ qh && (qh.style.transition = a, qh.style.width = `${i}%`);
9951
9967
  }, t)), n += 800;
9952
9968
  }
9953
9969
  }
9954
- function Xh() {
9955
- Kh && (qh.forEach(clearTimeout), qh = [], Kh.style.transition = "width 0.2s ease", Kh.style.width = "100%", qh.push(setTimeout(() => {
9956
- Kh && (Kh.style.transition = "opacity 0.35s ease", Kh.style.opacity = "0", qh.push(setTimeout(() => {
9957
- Kh && (Kh.style.width = "0%", Kh.classList.remove(`${Q}-bar-active`));
9970
+ function Zh() {
9971
+ qh && (Jh.forEach(clearTimeout), Jh = [], qh.style.transition = "width 0.2s ease", qh.style.width = "100%", Jh.push(setTimeout(() => {
9972
+ qh && (qh.style.transition = "opacity 0.35s ease", qh.style.opacity = "0", Jh.push(setTimeout(() => {
9973
+ qh && (qh.style.width = "0%", qh.classList.remove(`${Q}-bar-active`));
9958
9974
  }, 380)));
9959
9975
  }, 220)));
9960
9976
  }
9961
- var Zh = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
9977
+ var Qh = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
9962
9978
  <filter id="${Q}-csh">
9963
9979
  <feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
9964
9980
  </filter>
9965
9981
  <path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
9966
9982
  fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
9967
9983
  filter="url(#${Q}-csh)"/>
9968
- </svg>`, Qh = null, $h = !1;
9969
- function eg() {
9970
- return (!Qh || !Qh.isConnected) && (Qh = document.createElement("div"), Qh.id = `${Q}-cursor`, Qh.innerHTML = Zh, document.body.appendChild(Qh), $h = !1), Qh;
9984
+ </svg>`, $h = null, eg = !1;
9985
+ function tg() {
9986
+ return (!$h || !$h.isConnected) && ($h = document.createElement("div"), $h.id = `${Q}-cursor`, $h.innerHTML = Qh, document.body.appendChild($h), eg = !1), $h;
9971
9987
  }
9972
- async function tg(e) {
9988
+ async function ng(e) {
9973
9989
  if (typeof document > "u" || !e) return;
9974
9990
  Ah();
9975
9991
  let t;
@@ -9978,18 +9994,18 @@ async function tg(e) {
9978
9994
  } catch {
9979
9995
  return;
9980
9996
  }
9981
- let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = eg();
9982
- $h ||= (i.style.transition = "none", i.style.left = `${window.innerWidth / 2}px`, i.style.top = `${window.innerHeight * .4}px`, i.classList.add(`${Q}-cursor-visible`), i.offsetHeight, i.style.transition = "left 0.32s cubic-bezier(0.25,0.46,0.45,0.94), top 0.32s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.2s ease", !0), i.style.left = `${n}px`, i.style.top = `${r}px`, await ag(360);
9997
+ let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = tg();
9998
+ eg ||= (i.style.transition = "none", i.style.left = `${window.innerWidth / 2}px`, i.style.top = `${window.innerHeight * .4}px`, i.classList.add(`${Q}-cursor-visible`), i.offsetHeight, i.style.transition = "left 0.32s cubic-bezier(0.25,0.46,0.45,0.94), top 0.32s cubic-bezier(0.25,0.46,0.45,0.94), opacity 0.2s ease", !0), i.style.left = `${n}px`, i.style.top = `${r}px`, await og(360);
9983
9999
  }
9984
- function ng(e = !1) {
9985
- Qh && (e ? (Qh.classList.remove(`${Q}-cursor-visible`), $h = !1) : (Qh.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
9986
- $h = !1;
10000
+ function rg(e = !1) {
10001
+ $h && (e ? ($h.classList.remove(`${Q}-cursor-visible`), eg = !1) : ($h.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
10002
+ eg = !1;
9987
10003
  }, 250)));
9988
10004
  }
9989
- async function rg(e) {
9990
- Qh && (Qh.classList.add(`${Q}-cursor-click`), await ag(280), Qh.classList.remove(`${Q}-cursor-click`));
10005
+ async function ig(e) {
10006
+ $h && ($h.classList.add(`${Q}-cursor-click`), await og(280), $h.classList.remove(`${Q}-cursor-click`));
9991
10007
  }
9992
- function ig(e) {
10008
+ function ag(e) {
9993
10009
  if (!e || typeof document > "u") return;
9994
10010
  Ah();
9995
10011
  let t;
@@ -10017,12 +10033,12 @@ function ig(e) {
10017
10033
  a.remove(), e.style.position = n, e.style.overflow = r;
10018
10034
  }, 650);
10019
10035
  }
10020
- function ag(e) {
10036
+ function og(e) {
10021
10037
  return new Promise((t) => setTimeout(t, e));
10022
10038
  }
10023
10039
  //#endregion
10024
10040
  //#region src/lib/svgIcons.jsx
10025
- var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10041
+ var sg = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10026
10042
  width: e,
10027
10043
  height: e,
10028
10044
  viewBox: "0 0 24 24",
@@ -10038,7 +10054,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10038
10054
  strokeLinecap: "round",
10039
10055
  strokeLinejoin: "round"
10040
10056
  })]
10041
- }), sg = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
10057
+ }), cg = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
10042
10058
  width: e,
10043
10059
  height: e,
10044
10060
  viewBox: "0 0 24 24",
@@ -10053,7 +10069,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10053
10069
  x2: "1",
10054
10070
  y2: "23"
10055
10071
  })]
10056
- }), cg = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
10072
+ }), lg = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
10057
10073
  width: e,
10058
10074
  height: e,
10059
10075
  viewBox: "0 0 24 24",
@@ -10068,7 +10084,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10068
10084
  x2: "12",
10069
10085
  y2: "5"
10070
10086
  }), /* @__PURE__ */ g("polyline", { points: "5 12 12 5 19 12" })]
10071
- }), lg = () => /* @__PURE__ */ _("svg", {
10087
+ }), ug = () => /* @__PURE__ */ _("svg", {
10072
10088
  width: "14",
10073
10089
  height: "14",
10074
10090
  viewBox: "0 0 24 24",
@@ -10078,7 +10094,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10078
10094
  strokeLinecap: "round",
10079
10095
  strokeLinejoin: "round",
10080
10096
  children: [/* @__PURE__ */ g("polyline", { points: "9 17 4 12 9 7" }), /* @__PURE__ */ g("path", { d: "M20 18v-2a4 4 0 00-4-4H4" })]
10081
- }), ug = () => /* @__PURE__ */ g("svg", {
10097
+ }), dg = () => /* @__PURE__ */ g("svg", {
10082
10098
  width: "18",
10083
10099
  height: "18",
10084
10100
  viewBox: "0 0 24 24",
@@ -10088,7 +10104,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10088
10104
  strokeLinecap: "round",
10089
10105
  strokeLinejoin: "round",
10090
10106
  children: /* @__PURE__ */ g("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.42 19.42 0 01-6.12-6.11A19.79 19.79 0 012 4.11 2 2 0 014.11 2h3a2 2 0 012 1.72c.13.96.37 1.91.71 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.9.34 1.85.58 2.81.71A2 2 0 0122 16.92z" })
10091
- }), dg = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
10107
+ }), fg = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
10092
10108
  className: e,
10093
10109
  width: "14",
10094
10110
  height: "14",
@@ -10117,7 +10133,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10117
10133
  y2: "16"
10118
10134
  })
10119
10135
  ]
10120
- }), fg = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
10136
+ }), pg = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
10121
10137
  width: e,
10122
10138
  height: e,
10123
10139
  viewBox: "0 0 24 24",
@@ -10140,7 +10156,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10140
10156
  /* @__PURE__ */ g("path", { d: "M15 13v2" }),
10141
10157
  /* @__PURE__ */ g("path", { d: "M9 13v2" })
10142
10158
  ]
10143
- }), pg = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
10159
+ }), mg = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
10144
10160
  width: e,
10145
10161
  height: e,
10146
10162
  viewBox: "0 0 24 24",
@@ -10160,7 +10176,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10160
10176
  x2: "19",
10161
10177
  y2: "12"
10162
10178
  })]
10163
- }), mg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10179
+ }), hg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10164
10180
  width: e,
10165
10181
  height: e,
10166
10182
  viewBox: "0 0 24 24",
@@ -10186,7 +10202,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10186
10202
  fill: t
10187
10203
  })
10188
10204
  ]
10189
- }), hg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10205
+ }), gg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10190
10206
  width: "24",
10191
10207
  height: "24",
10192
10208
  viewBox: "0 0 24 24",
@@ -10204,7 +10220,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10204
10220
  "stroke-linecap": "round",
10205
10221
  "stroke-linejoin": "round"
10206
10222
  })]
10207
- }), gg = () => /* @__PURE__ */ g("svg", {
10223
+ }), _g = () => /* @__PURE__ */ g("svg", {
10208
10224
  width: "24",
10209
10225
  height: "24",
10210
10226
  viewBox: "0 0 24 24",
@@ -10216,7 +10232,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10216
10232
  "stroke-width": "1.5",
10217
10233
  "stroke-linejoin": "round"
10218
10234
  })
10219
- }), _g = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
10235
+ }), vg = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
10220
10236
  xmlns: "http://www.w3.org/2000/svg",
10221
10237
  width: e,
10222
10238
  height: e,
@@ -10234,7 +10250,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10234
10250
  /* @__PURE__ */ g("path", { d: "m2 2 20 20" }),
10235
10251
  /* @__PURE__ */ g("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
10236
10252
  ]
10237
- }), vg = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), yg = (e = "") => String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), bg = new Set([
10253
+ }), yg = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), bg = (e = "") => String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), xg = new Set([
10238
10254
  "p",
10239
10255
  "br",
10240
10256
  "ul",
@@ -10245,30 +10261,30 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10245
10261
  "b",
10246
10262
  "i",
10247
10263
  "a"
10248
- ]), xg = /^https?:\/\//i;
10249
- function Sg(e) {
10264
+ ]), Sg = /^https?:\/\//i;
10265
+ function Cg(e) {
10250
10266
  let t = Array.from(e.childNodes);
10251
10267
  for (let n of t) if (n.nodeType === Node.ELEMENT_NODE) {
10252
10268
  let t = n.tagName.toLowerCase();
10253
- if (!bg.has(t)) {
10269
+ if (!xg.has(t)) {
10254
10270
  e.replaceChild(document.createTextNode(n.textContent), n);
10255
10271
  continue;
10256
10272
  }
10257
10273
  let r = {};
10258
10274
  if (t === "a") {
10259
10275
  let e = n.getAttribute("href") || "";
10260
- xg.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
10276
+ Sg.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
10261
10277
  }
10262
10278
  for (; n.attributes.length > 0;) n.removeAttribute(n.attributes[0].name);
10263
10279
  for (let [e, t] of Object.entries(r)) n.setAttribute(e, t);
10264
- Sg(n);
10280
+ Cg(n);
10265
10281
  } else n.nodeType !== Node.TEXT_NODE && e.removeChild(n);
10266
10282
  }
10267
- function Cg(e) {
10283
+ function wg(e) {
10268
10284
  let t = document.createElement("div");
10269
- return t.innerHTML = e, Sg(t), t.innerHTML;
10285
+ return t.innerHTML = e, Cg(t), t.innerHTML;
10270
10286
  }
10271
- function wg(e) {
10287
+ function Tg(e) {
10272
10288
  let t = String(e || "").trim();
10273
10289
  if (!t) return t;
10274
10290
  let n = /^<p>\s*<strong>([\s\S]*?)<\/strong>\s*<\/p>$/i.exec(t);
@@ -10280,33 +10296,33 @@ function wg(e) {
10280
10296
  }
10281
10297
  return e;
10282
10298
  }
10283
- var Tg = (e = "") => {
10299
+ var Eg = (e = "") => {
10284
10300
  let t = String(e || "").trim();
10285
10301
  if (!t) return "";
10286
- if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return wg(Cg(t));
10287
- let n = t.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").split(/\n\s*\n/).map((e) => e.trim()).filter(Boolean), r = (e) => yg(e).replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, "<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>").replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(/\*([^*\n]+)\*/g, "<em>$1</em>");
10288
- return wg(n.map((e) => {
10302
+ if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return Tg(wg(t));
10303
+ let n = t.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").split(/\n\s*\n/).map((e) => e.trim()).filter(Boolean), r = (e) => bg(e).replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g, "<a href=\"$2\" target=\"_blank\" rel=\"noopener noreferrer\">$1</a>").replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(/\*([^*\n]+)\*/g, "<em>$1</em>");
10304
+ return Tg(n.map((e) => {
10289
10305
  let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = t.filter((e) => /^[-*]\s+/.test(e));
10290
10306
  if (n.length >= 2 && n.length === t.length) return `<ul>${n.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>`;
10291
10307
  let i = e.split(/\s+(?=[-*]\s+\*\*?)/).map((e) => e.trim()).filter(Boolean);
10292
10308
  return i.length >= 2 && i.every((e) => /^[-*]\s+/.test(e)) ? `<ul>${i.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>` : `<p>${r(e).replace(/\n/g, "<br />")}</p>`;
10293
10309
  }).join(""));
10294
- }, Eg = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), Dg = new Set([
10310
+ }, Dg = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), Og = new Set([
10295
10311
  ".pdf",
10296
10312
  ".docx",
10297
10313
  ".png",
10298
10314
  ".jpg",
10299
10315
  ".jpeg"
10300
- ]), Og = "image/png,image/jpeg,.pdf,.docx";
10301
- function kg(e) {
10316
+ ]), kg = "image/png,image/jpeg,.pdf,.docx";
10317
+ function Ag(e) {
10302
10318
  if (!e) return !1;
10303
10319
  let t = typeof e.name == "string" ? e.name.toLowerCase() : "", n = t.includes(".") ? `.${t.split(".").pop()}` : "", r = typeof e.type == "string" ? e.type.toLowerCase() : "";
10304
- return r === "image/png" || r === "image/jpeg" || Eg.has(r) || Dg.has(n);
10320
+ return r === "image/png" || r === "image/jpeg" || Dg.has(r) || Og.has(n);
10305
10321
  }
10306
- function Ag(e) {
10307
- return e ? kg(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
10322
+ function jg(e) {
10323
+ return e ? Ag(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
10308
10324
  }
10309
- function jg(e = 0) {
10325
+ function Mg(e = 0) {
10310
10326
  if (!Number.isFinite(e) || e <= 0) return "";
10311
10327
  let t = [
10312
10328
  "B",
@@ -10318,12 +10334,12 @@ function jg(e = 0) {
10318
10334
  let i = n >= 10 || r === 0 ? 0 : 1;
10319
10335
  return `${n.toFixed(i)} ${t[r]}`;
10320
10336
  }
10321
- function Mg(e) {
10337
+ function Ng(e) {
10322
10338
  return e ? e.name || "Attachment" : "";
10323
10339
  }
10324
10340
  //#endregion
10325
10341
  //#region src/utils/avatarHelpers.js
10326
- function Ng(e) {
10342
+ function Pg(e) {
10327
10343
  if (!e || typeof e != "string") return "?";
10328
10344
  let t = e.trim();
10329
10345
  if (!t) return "?";
@@ -10332,7 +10348,7 @@ function Ng(e) {
10332
10348
  }
10333
10349
  //#endregion
10334
10350
  //#region src/components/AvatarImageOrInitials.jsx
10335
- function Pg({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10351
+ function Fg({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10336
10352
  let [i, a] = m(null), o = typeof e == "string" ? e.trim() : "";
10337
10353
  return c(() => {
10338
10354
  if (!o) {
@@ -10355,12 +10371,12 @@ function Pg({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10355
10371
  onError: () => a(null)
10356
10372
  }) : /* @__PURE__ */ g("span", {
10357
10373
  style: r,
10358
- children: Ng(t)
10374
+ children: Pg(t)
10359
10375
  });
10360
10376
  }
10361
10377
  //#endregion
10362
10378
  //#region src/components/MessageList.jsx
10363
- function Fg({ siteId: e, onChoose: t }) {
10379
+ function Ig({ siteId: e, onChoose: t }) {
10364
10380
  let [n, r] = m(null), i = (n) => {
10365
10381
  le(e, n), r(n), t?.(n);
10366
10382
  };
@@ -10433,7 +10449,7 @@ function Fg({ siteId: e, onChoose: t }) {
10433
10449
  })
10434
10450
  });
10435
10451
  }
10436
- function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
10452
+ function Lg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
10437
10453
  let { resolvedConfig: d } = kn(), f = p(null), [v, y] = m(null), [b, x] = m(null), S = p(e.length), C = p(!0), w = p(null), T = o((e) => {
10438
10454
  let t = e.target.closest("a[href]");
10439
10455
  if (!t) return;
@@ -10488,8 +10504,8 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10488
10504
  children: [
10489
10505
  e.map((e) => {
10490
10506
  if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
10491
- if (e.type === "nav_pref_choice") return /* @__PURE__ */ g(Fg, { siteId: d?.siteId }, e.id || e.messageId);
10492
- let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, f = e.type === "file" && e.metadata?.fileUrl, p = e.agent_name || e.agentName || e.metadata?.agentName || l, m = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, v = vg(e.replyToContent || e.replyContext?.message || ""), S = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
10507
+ if (e.type === "nav_pref_choice") return /* @__PURE__ */ g(Ig, { siteId: d?.siteId }, e.id || e.messageId);
10508
+ let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, f = e.type === "file" && e.metadata?.fileUrl, p = e.agent_name || e.agentName || e.metadata?.agentName || l, m = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, v = yg(e.replyToContent || e.replyContext?.message || ""), S = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
10493
10509
  return t ? /* @__PURE__ */ g("div", {
10494
10510
  style: {
10495
10511
  display: "flex",
@@ -10534,7 +10550,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10534
10550
  fontWeight: 800,
10535
10551
  marginTop: !c && (r || o) ? "22px" : "0px"
10536
10552
  },
10537
- children: r ? u || /* @__PURE__ */ g(fg, { size: 16 }) : /* @__PURE__ */ g(Pg, {
10553
+ children: r ? u || /* @__PURE__ */ g(pg, { size: 16 }) : /* @__PURE__ */ g(Fg, {
10538
10554
  src: m || "",
10539
10555
  name: p,
10540
10556
  imgStyle: {
@@ -10576,7 +10592,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10576
10592
  onMouseLeave: (e) => {
10577
10593
  e.currentTarget.style.color = "#9ca3af";
10578
10594
  },
10579
- children: [/* @__PURE__ */ g(lg, {}), "Reply"]
10595
+ children: [/* @__PURE__ */ g(ug, {}), "Reply"]
10580
10596
  }),
10581
10597
  /* @__PURE__ */ _("div", {
10582
10598
  style: {
@@ -10620,7 +10636,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10620
10636
  children: v
10621
10637
  })]
10622
10638
  }), f ? (() => {
10623
- let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = jg(e.metadata.fileSize), a = t.startsWith("image/"), o = `shared file: ${r}`.toLowerCase(), s = (e.message || "").trim(), c = s && s.toLowerCase() !== o && !s.toLowerCase().startsWith("shared file:"), l = t === "application/pdf" ? {
10639
+ let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = Mg(e.metadata.fileSize), a = t.startsWith("image/"), o = `shared file: ${r}`.toLowerCase(), s = (e.message || "").trim(), c = s && s.toLowerCase() !== o && !s.toLowerCase().startsWith("shared file:"), l = t === "application/pdf" ? {
10624
10640
  color: "#ef4444",
10625
10641
  label: "PDF"
10626
10642
  } : t.includes("word") || t.includes("docx") ? {
@@ -10801,7 +10817,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10801
10817
  });
10802
10818
  })() : r ? /* @__PURE__ */ g("div", {
10803
10819
  className: "flowengage-message-content fe-bot-message",
10804
- dangerouslySetInnerHTML: { __html: Tg(e.message) },
10820
+ dangerouslySetInnerHTML: { __html: Eg(e.message) },
10805
10821
  onClick: T
10806
10822
  }) : /* @__PURE__ */ g("div", {
10807
10823
  style: { whiteSpace: "pre-wrap" },
@@ -10866,7 +10882,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10866
10882
  boxShadow: u ? "none" : "0 8px 20px rgba(59,130,246,0.24)",
10867
10883
  overflow: "hidden"
10868
10884
  },
10869
- children: u || /* @__PURE__ */ g(fg, { size: 16 })
10885
+ children: u || /* @__PURE__ */ g(pg, { size: 16 })
10870
10886
  }), /* @__PURE__ */ _("div", {
10871
10887
  style: {
10872
10888
  display: "flex",
@@ -10908,7 +10924,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10908
10924
  borderRadius: "50%",
10909
10925
  overflow: "hidden"
10910
10926
  },
10911
- children: /* @__PURE__ */ g(Pg, {
10927
+ children: /* @__PURE__ */ g(Fg, {
10912
10928
  src: s || "",
10913
10929
  name: l,
10914
10930
  imgStyle: {
@@ -11002,22 +11018,22 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
11002
11018
  }
11003
11019
  //#endregion
11004
11020
  //#region src/components/ChatInput.jsx
11005
- var Lg = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
11006
- function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: l, clearReplyContext: u, requiresEmail: d, emailInput: f, setEmailInput: m, emailError: v, showVoiceToggle: y = !1, voiceEnabled: b = !0, onFileSelect: x, selectedFile: S = null, onRemoveSelectedFile: C, attachmentError: w = "", isUploadingAttachment: T = !1, inputPlaceholder: E = "Type your message" }) {
11021
+ var Rg = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
11022
+ function zg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: l, clearReplyContext: u, requiresEmail: d, emailInput: f, setEmailInput: m, emailError: v, showVoiceToggle: y = !1, voiceEnabled: b = !0, onFileSelect: x, selectedFile: S = null, onRemoveSelectedFile: C, attachmentError: w = "", isUploadingAttachment: T = !1, inputPlaceholder: E = "Type your message" }) {
11007
11023
  let D = p(null), O = p(null), k = (e) => {
11008
11024
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
11009
11025
  };
11010
11026
  c(() => {
11011
11027
  d || k(O.current);
11012
11028
  }, [e, d]), c(() => {
11013
- d || Lg || e || s || O.current?.focus();
11029
+ d || Rg || e || s || O.current?.focus();
11014
11030
  }, [
11015
11031
  e,
11016
11032
  d,
11017
11033
  s
11018
11034
  ]);
11019
11035
  let A = (e) => {
11020
- e.key === "Enter" && (Lg || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
11036
+ e.key === "Enter" && (Rg || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
11021
11037
  }, ee = l?.sender === "user" ? "You" : l?.sender === "agent" ? "Agent" : "AI Assistant", te = d ? !!f?.trim() : !!e?.trim() || !!S, ne = s || T || !te, j = !d && b && y;
11022
11038
  return /* @__PURE__ */ _("div", {
11023
11039
  style: {
@@ -11112,7 +11128,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11112
11128
  background: "rgba(59,130,246,0.08)",
11113
11129
  color: "var(--flowengage-primary)"
11114
11130
  },
11115
- children: /* @__PURE__ */ g(fg, { size: 13 })
11131
+ children: /* @__PURE__ */ g(pg, { size: 13 })
11116
11132
  }), /* @__PURE__ */ g("span", { children: "Please provide your email address so we can help you." })]
11117
11133
  })
11118
11134
  }),
@@ -11152,7 +11168,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11152
11168
  overflow: "hidden",
11153
11169
  textOverflow: "ellipsis"
11154
11170
  },
11155
- children: Mg(S)
11171
+ children: Ng(S)
11156
11172
  }),
11157
11173
  /* @__PURE__ */ g("div", {
11158
11174
  style: {
@@ -11160,7 +11176,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11160
11176
  color: "#6b7280",
11161
11177
  marginTop: "2px"
11162
11178
  },
11163
- children: jg(S.size)
11179
+ children: Mg(S.size)
11164
11180
  })
11165
11181
  ]
11166
11182
  }), /* @__PURE__ */ g("button", {
@@ -11205,7 +11221,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11205
11221
  j ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
11206
11222
  ref: D,
11207
11223
  type: "file",
11208
- accept: Og,
11224
+ accept: kg,
11209
11225
  style: { display: "none" },
11210
11226
  onChange: (e) => {
11211
11227
  let t = e.target.files?.[0];
@@ -11237,7 +11253,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11237
11253
  onMouseLeave: (e) => {
11238
11254
  e.currentTarget.style.opacity = "1";
11239
11255
  },
11240
- children: /* @__PURE__ */ g(pg, {
11256
+ children: /* @__PURE__ */ g(mg, {
11241
11257
  size: 16,
11242
11258
  color: "currentColor"
11243
11259
  })
@@ -11318,7 +11334,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11318
11334
  onMouseLeave: (e) => {
11319
11335
  e.currentTarget.style.opacity = "1";
11320
11336
  },
11321
- children: /* @__PURE__ */ g(cg, { size: 16 })
11337
+ children: /* @__PURE__ */ g(lg, { size: 16 })
11322
11338
  })
11323
11339
  ]
11324
11340
  }),
@@ -11381,7 +11397,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11381
11397
  }
11382
11398
  //#endregion
11383
11399
  //#region src/components/StatusBanners.jsx
11384
- function zg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
11400
+ function Bg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
11385
11401
  return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
11386
11402
  style: {
11387
11403
  margin: "0 20px 10px",
@@ -11394,7 +11410,7 @@ function zg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
11394
11410
  gap: "10px"
11395
11411
  },
11396
11412
  children: [
11397
- /* @__PURE__ */ g(dg, { className: "" }),
11413
+ /* @__PURE__ */ g(fg, { className: "" }),
11398
11414
  /* @__PURE__ */ g("span", {
11399
11415
  style: {
11400
11416
  fontSize: "12px",
@@ -11440,13 +11456,13 @@ function zg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
11440
11456
  }
11441
11457
  //#endregion
11442
11458
  //#region src/components/AnimatedOrb.jsx
11443
- var Bg = [
11459
+ var Vg = [
11444
11460
  "#135bd8",
11445
11461
  "#ef334b",
11446
11462
  "#ffbd2e"
11447
11463
  ];
11448
- function Vg(e) {
11449
- return !Array.isArray(e) || e.length === 0 ? Bg : e.length === 1 ? [
11464
+ function Hg(e) {
11465
+ return !Array.isArray(e) || e.length === 0 ? Vg : e.length === 1 ? [
11450
11466
  e[0],
11451
11467
  e[0],
11452
11468
  e[0]
@@ -11460,7 +11476,7 @@ function Vg(e) {
11460
11476
  e[2]
11461
11477
  ];
11462
11478
  }
11463
- var Hg = {
11479
+ var Ug = {
11464
11480
  idle: 3,
11465
11481
  listening: .75,
11466
11482
  thinking: 1,
@@ -11468,7 +11484,7 @@ var Hg = {
11468
11484
  muted: .75,
11469
11485
  error: .08
11470
11486
  };
11471
- function Ug(e) {
11487
+ function Wg(e) {
11472
11488
  if (!e || typeof e != "string") return [
11473
11489
  0,
11474
11490
  0,
@@ -11481,14 +11497,14 @@ function Ug(e) {
11481
11497
  parseInt(n.slice(4, 6), 16) / 255
11482
11498
  ];
11483
11499
  }
11484
- function Wg(e, t) {
11500
+ function Gg(e, t) {
11485
11501
  if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
11486
11502
  if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
11487
11503
  let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
11488
11504
  return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
11489
11505
  }
11490
- var Gg = "\n attribute vec2 a_pos;\n varying vec2 v_uv;\n void main() {\n v_uv = a_pos * 0.5 + 0.5;\n gl_Position = vec4(a_pos, 0.0, 1.0);\n }\n", Kg = "\n precision highp float;\n\n varying vec2 v_uv;\n uniform float u_time;\n uniform float u_speed;\n uniform vec3 u_c1;\n uniform vec3 u_c2;\n uniform vec3 u_c3;\n\n // ── Gradient noise ─────────────────────────────────────────────────────────\n vec2 hash2(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);\n }\n float gnoise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n vec2 u = f*f*f*(f*(f*6.0-15.0)+10.0);\n return mix(\n mix(dot(hash2(i), f),\n dot(hash2(i+vec2(1,0)), f-vec2(1,0)), u.x),\n mix(dot(hash2(i+vec2(0,1)), f-vec2(0,1)),\n dot(hash2(i+vec2(1,1)), f-vec2(1,1)), u.x),\n u.y\n ) * 0.5 + 0.5;\n }\n\n // ── 3-octave FBM normalised to [0,1] — fewer octaves → larger, softer blobs\n float fbm(vec2 p) {\n float v = 0.0, a = 0.5;\n for (int i = 0; i < 3; i++) {\n v += a * gnoise(p);\n p = p * 2.1 + vec2(100.0);\n a *= 0.5;\n }\n return v / 0.875;\n }\n\n // ── Scalar hash for grain ──────────────────────────────────────────────────\n float hash1(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n }\n\n void main() {\n vec2 uv = v_uv;\n float t = u_time * u_speed + 47.3;\n\n // ── ① Two-level domain warp — deep organic folding and swirling ───────────\n // First pass: large-scale sweep\n vec2 q = vec2(\n fbm(uv * 1.8 + vec2( t * 0.13, t * 0.11)) * 2.0 - 1.0,\n fbm(uv * 1.8 + vec2( t * 0.11 + 3.7, -t * 0.14 + 1.1)) * 2.0 - 1.0\n );\n // Second pass: warp the warp — creates curling, folding sub-currents\n vec2 r = vec2(\n fbm(uv * 1.8 + q * 0.55 + vec2( t * 0.09, t * 0.07)) * 2.0 - 1.0,\n fbm(uv * 1.8 + q * 0.55 + vec2(-t * 0.07 + 5.1, t * 0.10 + 2.3)) * 2.0 - 1.0\n );\n vec2 wp = uv + r * 0.38;\n\n // ── ② Three independent fields — each drifts inward from its source edge ──\n // Asymmetric velocities: dominant axis matches the inflow direction so the\n // noise texture visually streams inward (left→right, right→left, bottom→top).\n float f1 = fbm(wp * 0.85 + vec2(-t * 0.18, t * 0.04)); // LEFT → right\n float f2 = fbm(wp * 0.85 + vec2( t * 0.18 + 5.3, t * 0.04 + 1.7)); // RIGHT → left\n float f3 = fbm(wp * 0.85 + vec2( t * 0.04 - 3.2, -t * 0.18 + 6.4)); // BOTTOM → up\n\n // ── ③ Breathing blobs — sin pulse makes each field expand and contract ────\n float p1 = 0.88 + 0.12 * sin(t * 0.61);\n float p2 = 0.88 + 0.12 * sin(t * 0.47 + 2.09);\n float p3 = 0.88 + 0.12 * sin(t * 0.53 + 4.19);\n\n // Wide smoothstep (0.26 → 0.70) → soft, diffused blob edges that dissolve\n // gradually into each other, like dye spreading through water.\n float b1 = smoothstep(0.26, 0.70, f1 * p1);\n float b2 = smoothstep(0.26, 0.70, f2 * p2);\n float b3 = smoothstep(0.26, 0.70, f3 * p3);\n\n // ── ④ Directional origin gradients.\n // Each color owns its home edge (value = 1.0) and smoothly fades to zero\n // before reaching the opposite side. The transition windows are offset so\n // they overlap only in the center third — that overlap zone is where the\n // three colors meet and blend, while the edges stay uncontaminated.\n float d1 = 1.0 - smoothstep(0.20, 0.74, uv.x); // c1: LEFT → full at x<0.20, zero by x=0.74\n float d2 = 1.0 - smoothstep(0.20, 0.74, 1.0 - uv.x); // c2: RIGHT → full at x>0.80, zero by x=0.26\n float d3 = 1.0 - smoothstep(0.18, 0.68, uv.y); // c3: BOTTOM → full at y<0.18, zero by y=0.68\n\n float w1 = b1 * d1;\n float w2 = b2 * d2;\n float w3 = b3 * d3;\n\n // ── ⑤ Dye-mixing colour blend ──────────────────────────────────────────────\n // dyeColor is the weighted average of all active colours — exactly how dyes\n // mix in water: overlapping streams blend smoothly, no hard edges.\n float total = w1 + w2 + w3;\n vec3 dyeColor = (u_c1 * w1 + u_c2 * w2 + u_c3 * w3) / max(total, 0.001);\n\n // Boost brightness of the dye to make colors pop and seem less dull\n dyeColor *= 1.65;\n\n // Exponential coverage: cores are rich and opaque; edges dissolve into the\n // near-white base. White only shows through where dye concentration is thin.\n float coverage = 1.0 - exp(-total * 5.0);\n vec3 col = mix(vec3(1.0, 1.0, 1.0), dyeColor, coverage);\n col = clamp(col, 0.0, 1.0);\n\n // ── ⑥ Sphere shading — subtle edge vignette only, no specular ─────────────\n vec2 uvc = v_uv * 2.0 - 1.0;\n\n // ── ⑦ Subtle grain — breaks gradient banding, adds filmic texture ──────────\n float grain = hash1(v_uv * 437.3 + fract(t)) * 2.0 - 1.0;\n col += grain * 0.018;\n\n gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);\n }\n";
11491
- function qg(e, t, n) {
11506
+ var Kg = "\n attribute vec2 a_pos;\n varying vec2 v_uv;\n void main() {\n v_uv = a_pos * 0.5 + 0.5;\n gl_Position = vec4(a_pos, 0.0, 1.0);\n }\n", qg = "\n precision highp float;\n\n varying vec2 v_uv;\n uniform float u_time;\n uniform float u_speed;\n uniform vec3 u_c1;\n uniform vec3 u_c2;\n uniform vec3 u_c3;\n\n // ── Gradient noise ─────────────────────────────────────────────────────────\n vec2 hash2(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);\n }\n float gnoise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n vec2 u = f*f*f*(f*(f*6.0-15.0)+10.0);\n return mix(\n mix(dot(hash2(i), f),\n dot(hash2(i+vec2(1,0)), f-vec2(1,0)), u.x),\n mix(dot(hash2(i+vec2(0,1)), f-vec2(0,1)),\n dot(hash2(i+vec2(1,1)), f-vec2(1,1)), u.x),\n u.y\n ) * 0.5 + 0.5;\n }\n\n // ── 3-octave FBM normalised to [0,1] — fewer octaves → larger, softer blobs\n float fbm(vec2 p) {\n float v = 0.0, a = 0.5;\n for (int i = 0; i < 3; i++) {\n v += a * gnoise(p);\n p = p * 2.1 + vec2(100.0);\n a *= 0.5;\n }\n return v / 0.875;\n }\n\n // ── Scalar hash for grain ──────────────────────────────────────────────────\n float hash1(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n }\n\n void main() {\n vec2 uv = v_uv;\n float t = u_time * u_speed + 47.3;\n\n // ── ① Two-level domain warp — deep organic folding and swirling ───────────\n // First pass: large-scale sweep\n vec2 q = vec2(\n fbm(uv * 1.8 + vec2( t * 0.13, t * 0.11)) * 2.0 - 1.0,\n fbm(uv * 1.8 + vec2( t * 0.11 + 3.7, -t * 0.14 + 1.1)) * 2.0 - 1.0\n );\n // Second pass: warp the warp — creates curling, folding sub-currents\n vec2 r = vec2(\n fbm(uv * 1.8 + q * 0.55 + vec2( t * 0.09, t * 0.07)) * 2.0 - 1.0,\n fbm(uv * 1.8 + q * 0.55 + vec2(-t * 0.07 + 5.1, t * 0.10 + 2.3)) * 2.0 - 1.0\n );\n vec2 wp = uv + r * 0.38;\n\n // ── ② Three independent fields — each drifts inward from its source edge ──\n // Asymmetric velocities: dominant axis matches the inflow direction so the\n // noise texture visually streams inward (left→right, right→left, bottom→top).\n float f1 = fbm(wp * 0.85 + vec2(-t * 0.18, t * 0.04)); // LEFT → right\n float f2 = fbm(wp * 0.85 + vec2( t * 0.18 + 5.3, t * 0.04 + 1.7)); // RIGHT → left\n float f3 = fbm(wp * 0.85 + vec2( t * 0.04 - 3.2, -t * 0.18 + 6.4)); // BOTTOM → up\n\n // ── ③ Breathing blobs — sin pulse makes each field expand and contract ────\n float p1 = 0.88 + 0.12 * sin(t * 0.61);\n float p2 = 0.88 + 0.12 * sin(t * 0.47 + 2.09);\n float p3 = 0.88 + 0.12 * sin(t * 0.53 + 4.19);\n\n // Wide smoothstep (0.26 → 0.70) → soft, diffused blob edges that dissolve\n // gradually into each other, like dye spreading through water.\n float b1 = smoothstep(0.26, 0.70, f1 * p1);\n float b2 = smoothstep(0.26, 0.70, f2 * p2);\n float b3 = smoothstep(0.26, 0.70, f3 * p3);\n\n // ── ④ Directional origin gradients.\n // Each color owns its home edge (value = 1.0) and smoothly fades to zero\n // before reaching the opposite side. The transition windows are offset so\n // they overlap only in the center third — that overlap zone is where the\n // three colors meet and blend, while the edges stay uncontaminated.\n float d1 = 1.0 - smoothstep(0.20, 0.74, uv.x); // c1: LEFT → full at x<0.20, zero by x=0.74\n float d2 = 1.0 - smoothstep(0.20, 0.74, 1.0 - uv.x); // c2: RIGHT → full at x>0.80, zero by x=0.26\n float d3 = 1.0 - smoothstep(0.18, 0.68, uv.y); // c3: BOTTOM → full at y<0.18, zero by y=0.68\n\n float w1 = b1 * d1;\n float w2 = b2 * d2;\n float w3 = b3 * d3;\n\n // ── ⑤ Dye-mixing colour blend ──────────────────────────────────────────────\n // dyeColor is the weighted average of all active colours — exactly how dyes\n // mix in water: overlapping streams blend smoothly, no hard edges.\n float total = w1 + w2 + w3;\n vec3 dyeColor = (u_c1 * w1 + u_c2 * w2 + u_c3 * w3) / max(total, 0.001);\n\n // Boost brightness of the dye to make colors pop and seem less dull\n dyeColor *= 1.65;\n\n // Exponential coverage: cores are rich and opaque; edges dissolve into the\n // near-white base. White only shows through where dye concentration is thin.\n float coverage = 1.0 - exp(-total * 5.0);\n vec3 col = mix(vec3(1.0, 1.0, 1.0), dyeColor, coverage);\n col = clamp(col, 0.0, 1.0);\n\n // ── ⑥ Sphere shading — subtle edge vignette only, no specular ─────────────\n vec2 uvc = v_uv * 2.0 - 1.0;\n\n // ── ⑦ Subtle grain — breaks gradient banding, adds filmic texture ──────────\n float grain = hash1(v_uv * 437.3 + fract(t)) * 2.0 - 1.0;\n col += grain * 0.018;\n\n gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);\n }\n";
11507
+ function Jg(e, t, n) {
11492
11508
  let r = (t, n) => {
11493
11509
  let r = e.createShader(t);
11494
11510
  return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
@@ -11497,10 +11513,10 @@ function qg(e, t, n) {
11497
11513
  let o = e.createProgram();
11498
11514
  return e.attachShader(o, i), e.attachShader(o, a), e.linkProgram(o), e.getProgramParameter(o, e.LINK_STATUS) ? o : (console.error("[AnimatedOrb link]", e.getProgramInfoLog(o)), null);
11499
11515
  }
11500
- function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
11501
- let [s, l, u] = Vg(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(Hg[t] ?? .35);
11516
+ function Yg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
11517
+ let [s, l, u] = Hg(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(Ug[t] ?? .35);
11502
11518
  c(() => {
11503
- h.current = Hg[t] ?? .35;
11519
+ h.current = Ug[t] ?? .35;
11504
11520
  }, [t]), c(() => {
11505
11521
  let t = m.current;
11506
11522
  if (!t) return;
@@ -11517,7 +11533,7 @@ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11517
11533
  console.warn("[AnimatedOrb] WebGL unavailable.");
11518
11534
  return;
11519
11535
  }
11520
- let i = qg(r, Gg, Kg);
11536
+ let i = Jg(r, Kg, qg);
11521
11537
  if (!i) {
11522
11538
  console.error("[AnimatedOrb] WebGL program failed to compile/link");
11523
11539
  return;
@@ -11547,7 +11563,7 @@ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11547
11563
  c2: r.getUniformLocation(i, "u_c2"),
11548
11564
  c3: r.getUniformLocation(i, "u_c3")
11549
11565
  };
11550
- r.uniform3fv(c.c1, Ug(s)), r.uniform3fv(c.c2, Ug(l)), r.uniform3fv(c.c3, Ug(u)), r.viewport(0, 0, t.width, t.height);
11566
+ r.uniform3fv(c.c1, Wg(s)), r.uniform3fv(c.c2, Wg(l)), r.uniform3fv(c.c3, Wg(u)), r.viewport(0, 0, t.width, t.height);
11551
11567
  let d = performance.now(), f, p = (e) => {
11552
11568
  r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
11553
11569
  };
@@ -11578,7 +11594,7 @@ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11578
11594
  position: "absolute",
11579
11595
  inset: -10,
11580
11596
  borderRadius: "50%",
11581
- background: `radial-gradient(circle, ${Wg(s, .18)} 0%, transparent 70%)`,
11597
+ background: `radial-gradient(circle, ${Gg(s, .18)} 0%, transparent 70%)`,
11582
11598
  pointerEvents: "none"
11583
11599
  },
11584
11600
  animate: { opacity: [.3, .75] },
@@ -11656,17 +11672,17 @@ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11656
11672
  }
11657
11673
  //#endregion
11658
11674
  //#region src/components/CallScreen.jsx
11659
- var Yg = "\n @keyframes fe-call-ring-pulse {\n 0% { transform: scale(1); opacity: 0.55; }\n 70% { transform: scale(1.85); opacity: 0; }\n 100% { transform: scale(1.85); opacity: 0; }\n }\n @keyframes fe-call-spin {\n to { transform: rotate(360deg); }\n }\n @keyframes fe-call-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes fe-call-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes fe-call-bar-slide-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n @keyframes fe-call-dot-blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.35; }\n }\n @keyframes fe-call-avatar-breathe {\n 0%, 100% { opacity: 0.5; transform: scale(1); }\n 50% { opacity: 0.9; transform: scale(1.12); }\n }\n";
11660
- function Xg(e) {
11675
+ var Xg = "\n @keyframes fe-call-ring-pulse {\n 0% { transform: scale(1); opacity: 0.55; }\n 70% { transform: scale(1.85); opacity: 0; }\n 100% { transform: scale(1.85); opacity: 0; }\n }\n @keyframes fe-call-spin {\n to { transform: rotate(360deg); }\n }\n @keyframes fe-call-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes fe-call-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes fe-call-bar-slide-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n }\n @keyframes fe-call-dot-blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.35; }\n }\n @keyframes fe-call-avatar-breathe {\n 0%, 100% { opacity: 0.5; transform: scale(1); }\n 50% { opacity: 0.9; transform: scale(1.12); }\n }\n";
11676
+ function Zg(e) {
11661
11677
  let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
11662
11678
  return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
11663
11679
  }
11664
- function Zg(e) {
11680
+ function Qg(e) {
11665
11681
  if (!e || typeof e != "string") return "#1a1a1a";
11666
11682
  let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
11667
11683
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
11668
11684
  }
11669
- function Qg(e, t) {
11685
+ function $g(e, t) {
11670
11686
  let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
11671
11687
  return n.length === 1 ? [
11672
11688
  `radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
@@ -11683,8 +11699,8 @@ function Qg(e, t) {
11683
11699
  "#f7f8fa"
11684
11700
  ].join(", ");
11685
11701
  }
11686
- function $g({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
11687
- let i = (t || "A")[0].toUpperCase(), a = Zg(r), o = n > 48 ? {
11702
+ function e_({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
11703
+ let i = (t || "A")[0].toUpperCase(), a = Qg(r), o = n > 48 ? {
11688
11704
  boxShadow: `0 0 0 3px ${r}44`,
11689
11705
  border: "3px solid rgba(255,255,255,0.15)"
11690
11706
  } : { border: `1.5px solid ${r}55` };
@@ -11721,7 +11737,7 @@ function $g({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
11721
11737
  children: i
11722
11738
  });
11723
11739
  }
11724
- function e_(e) {
11740
+ function t_(e) {
11725
11741
  let t = p(null), n = o(() => {
11726
11742
  if (!t.current) return;
11727
11743
  let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
@@ -11768,8 +11784,8 @@ function e_(e) {
11768
11784
  n
11769
11785
  ]), c(() => () => n(), [n]), n;
11770
11786
  }
11771
- function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDurationSeconds: r, isCallMuted: i, agentName: a, agentHeadshot: o, fallbackAgentName: s, acceptCall: c, rejectCall: l, endWebRTCCall: u, toggleCallMute: d, formatCallDuration: f, onMinimize: p, primaryColor: m = "#3B82F6", orbColors: h, chatHistory: v = [] }) {
11772
- let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = e_(!!e), S = async () => {
11787
+ function n_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDurationSeconds: r, isCallMuted: i, agentName: a, agentHeadshot: o, fallbackAgentName: s, acceptCall: c, rejectCall: l, endWebRTCCall: u, toggleCallMute: d, formatCallDuration: f, onMinimize: p, primaryColor: m = "#3B82F6", orbColors: h, chatHistory: v = [] }) {
11788
+ let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = t_(!!e), S = async () => {
11773
11789
  x(), await c();
11774
11790
  }, C = async () => {
11775
11791
  x(), await l();
@@ -11781,14 +11797,14 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11781
11797
  flexDirection: "column",
11782
11798
  borderRadius: "inherit",
11783
11799
  overflow: "hidden",
11784
- background: Qg(h, m),
11800
+ background: $g(h, m),
11785
11801
  animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
11786
11802
  };
11787
11803
  if (b === "incoming") {
11788
11804
  let e = Array.isArray(h) && h.length > 0 ? h : [m];
11789
11805
  return /* @__PURE__ */ _("div", {
11790
11806
  style: E,
11791
- children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
11807
+ children: [/* @__PURE__ */ g("style", { children: Xg }), /* @__PURE__ */ _("div", {
11792
11808
  style: {
11793
11809
  flex: 1,
11794
11810
  display: "flex",
@@ -11819,7 +11835,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11819
11835
  width: "96px",
11820
11836
  height: "96px",
11821
11837
  borderRadius: "50%",
11822
- background: `radial-gradient(circle, rgba(${Xg(e[0])},0.2) 0%, transparent 70%)`,
11838
+ background: `radial-gradient(circle, rgba(${Zg(e[0])},0.2) 0%, transparent 70%)`,
11823
11839
  filter: "blur(10px)",
11824
11840
  zIndex: 0
11825
11841
  } }),
@@ -11836,7 +11852,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11836
11852
  animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
11837
11853
  zIndex: 1
11838
11854
  } }, n)),
11839
- /* @__PURE__ */ g($g, {
11855
+ /* @__PURE__ */ g(e_, {
11840
11856
  headshot: o,
11841
11857
  name: y,
11842
11858
  size: 82,
@@ -11916,7 +11932,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11916
11932
  e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(239,68,68,0.5)";
11917
11933
  },
11918
11934
  "aria-label": "Decline call",
11919
- children: /* @__PURE__ */ g(sg, { size: 26 })
11935
+ children: /* @__PURE__ */ g(cg, { size: 26 })
11920
11936
  }), /* @__PURE__ */ g("span", {
11921
11937
  style: {
11922
11938
  fontSize: "12px",
@@ -11957,7 +11973,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11957
11973
  e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(34,197,94,0.5)";
11958
11974
  },
11959
11975
  "aria-label": "Accept call",
11960
- children: /* @__PURE__ */ g(ug, {})
11976
+ children: /* @__PURE__ */ g(dg, {})
11961
11977
  }), /* @__PURE__ */ g("span", {
11962
11978
  style: {
11963
11979
  fontSize: "12px",
@@ -11974,7 +11990,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11974
11990
  }
11975
11991
  return b === "connecting" ? /* @__PURE__ */ _("div", {
11976
11992
  style: E,
11977
- children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
11993
+ children: [/* @__PURE__ */ g("style", { children: Xg }), /* @__PURE__ */ _("div", {
11978
11994
  style: {
11979
11995
  flex: 1,
11980
11996
  display: "flex",
@@ -11984,7 +12000,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11984
12000
  gap: "24px"
11985
12001
  },
11986
12002
  children: [
11987
- /* @__PURE__ */ g($g, {
12003
+ /* @__PURE__ */ g(e_, {
11988
12004
  headshot: o,
11989
12005
  name: y,
11990
12006
  size: 64,
@@ -12011,7 +12027,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12011
12027
  }) : /* @__PURE__ */ _("div", {
12012
12028
  style: E,
12013
12029
  children: [
12014
- /* @__PURE__ */ g("style", { children: Yg }),
12030
+ /* @__PURE__ */ g("style", { children: Xg }),
12015
12031
  /* @__PURE__ */ _("div", {
12016
12032
  style: {
12017
12033
  display: "flex",
@@ -12057,7 +12073,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12057
12073
  children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
12058
12074
  })
12059
12075
  }),
12060
- /* @__PURE__ */ g(Jg, {
12076
+ /* @__PURE__ */ g(Yg, {
12061
12077
  colors: h,
12062
12078
  size: 36,
12063
12079
  voiceState: w
@@ -12108,7 +12124,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12108
12124
  gap: "16px",
12109
12125
  padding: "0 24px 16px"
12110
12126
  },
12111
- children: [/* @__PURE__ */ g($g, {
12127
+ children: [/* @__PURE__ */ g(e_, {
12112
12128
  headshot: o,
12113
12129
  name: y,
12114
12130
  size: 116,
@@ -12163,7 +12179,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12163
12179
  transition: "all 0.2s ease"
12164
12180
  },
12165
12181
  "aria-label": i ? "Unmute" : "Mute",
12166
- children: [g(i ? _g : og, { size: 18 }), i ? "Unmute" : "Mute"]
12182
+ children: [g(i ? vg : sg, { size: 18 }), i ? "Unmute" : "Mute"]
12167
12183
  }), /* @__PURE__ */ _("button", {
12168
12184
  type: "button",
12169
12185
  onClick: u,
@@ -12191,15 +12207,15 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12191
12207
  e.currentTarget.style.background = "rgba(239,68,68,0.9)", e.currentTarget.style.transform = "scale(1)";
12192
12208
  },
12193
12209
  "aria-label": "End call",
12194
- children: [/* @__PURE__ */ g(sg, { size: 18 }), "End Call"]
12210
+ children: [/* @__PURE__ */ g(cg, { size: 18 }), "End Call"]
12195
12211
  })]
12196
12212
  })
12197
12213
  ]
12198
12214
  });
12199
12215
  }
12200
- function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
12216
+ function r_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
12201
12217
  let u = e || n || "Agent";
12202
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
12218
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: Xg }), /* @__PURE__ */ _("div", {
12203
12219
  role: "button",
12204
12220
  tabIndex: 0,
12205
12221
  onClick: c,
@@ -12256,7 +12272,7 @@ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12256
12272
  borderRadius: "50%",
12257
12273
  border: `1.5px solid ${l}55`
12258
12274
  } }),
12259
- /* @__PURE__ */ g($g, {
12275
+ /* @__PURE__ */ g(e_, {
12260
12276
  headshot: t,
12261
12277
  name: u,
12262
12278
  size: 38,
@@ -12340,7 +12356,7 @@ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12340
12356
  boxShadow: i ? `0 0 0 3px ${l}12` : "none"
12341
12357
  },
12342
12358
  "aria-label": i ? "Unmute" : "Mute",
12343
- children: g(i ? _g : og, { size: 15 })
12359
+ children: g(i ? vg : sg, { size: 15 })
12344
12360
  }), /* @__PURE__ */ g("button", {
12345
12361
  type: "button",
12346
12362
  onClick: (e) => {
@@ -12368,7 +12384,7 @@ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12368
12384
  transition: "all 0.18s ease"
12369
12385
  },
12370
12386
  "aria-label": "End call",
12371
- children: /* @__PURE__ */ g(sg, { size: 16 })
12387
+ children: /* @__PURE__ */ g(cg, { size: 16 })
12372
12388
  })]
12373
12389
  })
12374
12390
  ]
@@ -12376,7 +12392,7 @@ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12376
12392
  }
12377
12393
  //#endregion
12378
12394
  //#region src/utils/voicePriorContext.js
12379
- function r_(e, t = {}) {
12395
+ function i_(e, t = {}) {
12380
12396
  let n = t.maxChars ?? 4500;
12381
12397
  if (!Array.isArray(e) || e.length === 0) return "";
12382
12398
  let r = [];
@@ -12393,24 +12409,24 @@ function r_(e, t = {}) {
12393
12409
  }
12394
12410
  //#endregion
12395
12411
  //#region src/utils/voiceClientTools.js
12396
- var i_ = /^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i;
12397
- function a_(e) {
12398
- return String(e || "").replace(i_, "").replace(/\/+$/, "").toLowerCase() || "/";
12412
+ var a_ = /^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i;
12413
+ function o_(e) {
12414
+ return String(e || "").replace(a_, "").replace(/\/+$/, "").toLowerCase() || "/";
12399
12415
  }
12400
- function o_(e, t) {
12401
- return a_(e) === a_(t);
12416
+ function s_(e, t) {
12417
+ return o_(e) === o_(t);
12402
12418
  }
12403
12419
  function $(...e) {
12404
12420
  An() && console.log("[FlowEngage:voice-tools]", ...e);
12405
12421
  }
12406
- function s_(e) {
12422
+ function c_(e) {
12407
12423
  try {
12408
12424
  let t = e.ownerDocument?.defaultView;
12409
12425
  if (t) return t.getComputedStyle(e);
12410
12426
  } catch {}
12411
12427
  return window.getComputedStyle(e);
12412
12428
  }
12413
- function c_(e) {
12429
+ function l_(e) {
12414
12430
  let t = /* @__PURE__ */ new Set();
12415
12431
  function n(r) {
12416
12432
  if (!r || t.has(r)) return;
@@ -12423,10 +12439,10 @@ function c_(e) {
12423
12439
  }
12424
12440
  typeof document < "u" && n(document);
12425
12441
  }
12426
- function l_(e) {
12442
+ function u_(e) {
12427
12443
  return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
12428
12444
  }
12429
- function u_(e) {
12445
+ function d_(e) {
12430
12446
  let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
12431
12447
  if (n) {
12432
12448
  let e = n.trim().split(/\s+/).filter(Boolean), r = [];
@@ -12434,40 +12450,40 @@ function u_(e) {
12434
12450
  let e = t.getElementById(n);
12435
12451
  e?.textContent && r.push(e.textContent.trim());
12436
12452
  } catch {}
12437
- if (r.length) return l_(r.join(" "));
12453
+ if (r.length) return u_(r.join(" "));
12438
12454
  }
12439
- if (e.labels && e.labels.length) return l_(e.labels[0].textContent);
12455
+ if (e.labels && e.labels.length) return u_(e.labels[0].textContent);
12440
12456
  let r = e.id;
12441
12457
  if (r) try {
12442
12458
  let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
12443
- if (e) return l_(e.textContent);
12459
+ if (e) return u_(e.textContent);
12444
12460
  } catch {
12445
12461
  let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
12446
- if (e) return l_(e.textContent);
12462
+ if (e) return u_(e.textContent);
12447
12463
  }
12448
12464
  let i = e.previousElementSibling;
12449
12465
  for (let e = 0; e < 6 && i; e += 1) {
12450
- if (i.tagName === "LABEL") return l_(i.textContent);
12466
+ if (i.tagName === "LABEL") return u_(i.textContent);
12451
12467
  let e = (i.className || "").toString().toLowerCase();
12452
12468
  if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
12453
- let e = l_(i.textContent);
12469
+ let e = u_(i.textContent);
12454
12470
  if (e) return e;
12455
12471
  }
12456
12472
  i = i.previousElementSibling;
12457
12473
  }
12458
12474
  let a = e.parentElement;
12459
12475
  for (let e = 0; e < 5 && a; e += 1) {
12460
- if (a.tagName === "LABEL") return l_(a.textContent);
12476
+ if (a.tagName === "LABEL") return u_(a.textContent);
12461
12477
  let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
12462
- if (e?.textContent) return l_(e.textContent);
12478
+ if (e?.textContent) return u_(e.textContent);
12463
12479
  a = a.parentElement;
12464
12480
  }
12465
12481
  let o = e.getAttribute("aria-label");
12466
- return o ? l_(o) : null;
12482
+ return o ? u_(o) : null;
12467
12483
  }
12468
- function d_() {
12484
+ function f_() {
12469
12485
  let e = [];
12470
- return c_((t) => {
12486
+ return l_((t) => {
12471
12487
  e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
12472
12488
  if (In(e)) return !1;
12473
12489
  let t = (e.type || "").toLowerCase();
@@ -12478,15 +12494,15 @@ function d_() {
12478
12494
  "image"
12479
12495
  ].includes(t) || e.disabled || e.readOnly) return !1;
12480
12496
  try {
12481
- let t = s_(e);
12497
+ let t = c_(e);
12482
12498
  if (t.display === "none" || t.visibility === "hidden") return !1;
12483
12499
  } catch {}
12484
12500
  return !0;
12485
12501
  }));
12486
12502
  }), e;
12487
12503
  }
12488
- function f_() {
12489
- return d_().map((e, t) => {
12504
+ function p_() {
12505
+ return f_().map((e, t) => {
12490
12506
  let n = {
12491
12507
  formIndex: 0,
12492
12508
  fieldIndex: t,
@@ -12494,7 +12510,7 @@ function f_() {
12494
12510
  type: e.type || "text",
12495
12511
  name: e.name || null,
12496
12512
  id: e.id || null,
12497
- label: u_(e),
12513
+ label: d_(e),
12498
12514
  placeholder: e.placeholder || null
12499
12515
  };
12500
12516
  return e.tagName === "SELECT" && (n.options = Array.from(e.options).filter((e) => e.value !== "" && !e.disabled).map((e) => ({
@@ -12503,13 +12519,13 @@ function f_() {
12503
12519
  })), n.currentValue = e.value || null), n;
12504
12520
  });
12505
12521
  }
12506
- function p_() {
12522
+ function m_() {
12507
12523
  let e = [];
12508
- return c_((t) => {
12524
+ return l_((t) => {
12509
12525
  e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
12510
12526
  if (In(e) || e.disabled) return !1;
12511
12527
  try {
12512
- let t = s_(e);
12528
+ let t = c_(e);
12513
12529
  if (t.display === "none" || t.visibility === "hidden") return !1;
12514
12530
  } catch {}
12515
12531
  return !0;
@@ -12521,7 +12537,7 @@ function p_() {
12521
12537
  type: e.type || e.tagName
12522
12538
  }));
12523
12539
  }
12524
- function m_(e, t) {
12540
+ function h_(e, t) {
12525
12541
  try {
12526
12542
  if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
12527
12543
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
@@ -12536,7 +12552,7 @@ function m_(e, t) {
12536
12552
  return Infinity;
12537
12553
  }
12538
12554
  }
12539
- function h_(e, t) {
12555
+ function g_(e, t) {
12540
12556
  let n = String(t || "").toLowerCase().trim();
12541
12557
  if (!n) return 0;
12542
12558
  let r = (e.innerText || e.textContent || "").replace(/\s+/g, " ").trim(), i = [
@@ -12554,21 +12570,21 @@ function h_(e, t) {
12554
12570
  for (let e of a) i.includes(e) && (o += 1);
12555
12571
  return o / a.length * 92;
12556
12572
  }
12557
- function g_(e, t, n = 6) {
12573
+ function __(e, t, n = 6) {
12558
12574
  let r = String(t || "").toLowerCase().trim();
12559
12575
  if (!r) return !1;
12560
12576
  let i = e;
12561
12577
  for (let e = 0; e < n && i && (i = i.parentElement, i); e++) if ((i.innerText || i.textContent || "").toLowerCase().includes(r)) return !0;
12562
12578
  return !1;
12563
12579
  }
12564
- function __(e, t, n) {
12580
+ function v_(e, t, n) {
12565
12581
  let r = [];
12566
- c_((e) => {
12582
+ l_((e) => {
12567
12583
  let t = Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"], a[href]"));
12568
12584
  r.push(...t.filter((e) => {
12569
12585
  if (In(e) || e.disabled) return !1;
12570
12586
  try {
12571
- let t = s_(e);
12587
+ let t = c_(e);
12572
12588
  if (t.display === "none" || t.visibility === "hidden" || t.opacity === "0") return !1;
12573
12589
  } catch {}
12574
12590
  return !0;
@@ -12576,14 +12592,14 @@ function __(e, t, n) {
12576
12592
  });
12577
12593
  let i = 0, a = r.map((t) => ({
12578
12594
  el: t,
12579
- s: h_(t, e)
12595
+ s: g_(t, e)
12580
12596
  }));
12581
12597
  for (let { s: e } of a) e > i && (i = e);
12582
12598
  if (i < 28) return null;
12583
12599
  let o = a.filter(({ s: e }) => e === i).map(({ el: e }) => e);
12584
12600
  if (o.length === 1) return o[0];
12585
12601
  if (n) {
12586
- let e = o.filter((e) => g_(e, n));
12602
+ let e = o.filter((e) => __(e, n));
12587
12603
  if (e.length === 1) return e[0];
12588
12604
  e.length > 1 && (o = e);
12589
12605
  }
@@ -12591,14 +12607,14 @@ function __(e, t, n) {
12591
12607
  if (s.length) {
12592
12608
  let e = o[0], t = Infinity;
12593
12609
  for (let n of o) for (let r of s) {
12594
- let i = m_(n, r);
12610
+ let i = h_(n, r);
12595
12611
  i < t && (t = i, e = n);
12596
12612
  }
12597
12613
  return e;
12598
12614
  }
12599
12615
  return o[0];
12600
12616
  }
12601
- function v_(e) {
12617
+ function y_(e) {
12602
12618
  if (e == null) return {};
12603
12619
  if (typeof e == "string") {
12604
12620
  let t = e.trim();
@@ -12611,12 +12627,12 @@ function v_(e) {
12611
12627
  }
12612
12628
  return e;
12613
12629
  }
12614
- function y_(e) {
12630
+ function b_(e) {
12615
12631
  if (!e || typeof e != "object") return null;
12616
12632
  let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
12617
12633
  return t == null ? null : String(t).trim() || null;
12618
12634
  }
12619
- function b_() {
12635
+ function x_() {
12620
12636
  let e = {};
12621
12637
  document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
12622
12638
  if (t.id) return;
@@ -12631,7 +12647,7 @@ function b_() {
12631
12647
  e[r] = !0, t.id = r;
12632
12648
  });
12633
12649
  }
12634
- function x_() {
12650
+ function S_() {
12635
12651
  let e = (e) => {
12636
12652
  let t = Array.from(e).filter((e) => !e.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root") && !e.closest("nav, footer, header, aside, .nav, .footer, .header, .sidebar")), n = [], r = 0;
12637
12653
  for (; r < t.length;) {
@@ -12686,7 +12702,7 @@ function x_() {
12686
12702
  containerHeadings: o
12687
12703
  };
12688
12704
  }
12689
- function S_(e) {
12705
+ function C_(e) {
12690
12706
  if (!e || typeof document > "u") return "";
12691
12707
  let t = new Set([
12692
12708
  "script",
@@ -12772,11 +12788,11 @@ function S_(e) {
12772
12788
  return d.has(t) ? !1 : (d.add(t), !0);
12773
12789
  }).join("\n").replace(/\n{3,}/g, "\n\n").trim();
12774
12790
  }
12775
- function C_(e) {
12791
+ function w_(e) {
12776
12792
  let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = typeof e.beaconSyncFullVoiceHistory == "function" ? e.beaconSyncFullVoiceHistory : null, a = [], o = {
12777
12793
  "fwh-navigate-mvp": async (n) => {
12778
12794
  if ($("fwh-navigate-mvp ▶ raw parameters:", n), e?.isWalkthroughActive?.()) return $("fwh-navigate-mvp ✖ blocked — walkthrough in progress"), "NAVIGATION_BLOCKED_DURING_WALKTHROUGH. A walkthrough of the current page is in progress, so navigation is not allowed. Do NOT tell the visitor you navigated or offer to. Describe the requested section using the CURRENT page's own content (fwh-read-content-mvp), then stop.";
12779
- let a = v_(n), o = y_(a), s = a.section_text ?? a.sectionText ?? a.section, c = Array.isArray(a.expected_landmarks) ? a.expected_landmarks : Array.isArray(a.expectedLandmarks) ? a.expectedLandmarks : [];
12795
+ let a = y_(n), o = b_(a), s = a.section_text ?? a.sectionText ?? a.section, c = Array.isArray(a.expected_landmarks) ? a.expected_landmarks : Array.isArray(a.expectedLandmarks) ? a.expectedLandmarks : [];
12780
12796
  if ($("fwh-navigate-mvp · coerced:", {
12781
12797
  url: o,
12782
12798
  sectionText: s,
@@ -12816,14 +12832,14 @@ function C_(e) {
12816
12832
  correctedUrl: u
12817
12833
  }), o = u);
12818
12834
  try {
12819
- Ph(`Navigating to ${o}...`, { spinner: !0 }), Yh(), Pn();
12835
+ Ph(`Navigating to ${o}...`, { spinner: !0 }), Xh(), Pn();
12820
12836
  try {
12821
12837
  i?.();
12822
12838
  } catch {}
12823
12839
  try {
12824
12840
  let e = r ? r() : "";
12825
12841
  if (e && t) {
12826
- let n = r_([{
12842
+ let n = i_([{
12827
12843
  sender: "user",
12828
12844
  message: e
12829
12845
  }]);
@@ -12858,8 +12874,8 @@ function C_(e) {
12858
12874
  typeof window < "u" && window.scrollTo(0, 0);
12859
12875
  } catch {}
12860
12876
  let a = [], s = null, c = "", l = Date.now() + 12e3;
12861
- for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: a, pageTitleHeading: s, introText: c} = x_(), !(a.length >= 1)););
12862
- b_(), $("fwh-navigate-mvp → page headings collected:", a, "titleHeading:", s);
12877
+ for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: a, pageTitleHeading: s, introText: c} = S_(), !(a.length >= 1)););
12878
+ x_(), $("fwh-navigate-mvp → page headings collected:", a, "titleHeading:", s);
12863
12879
  let u = a.length ? a.join(" | ") : "none", d = a.length ? "Use ONLY these exact heading strings for fwh-highlight-mvp — never invent or abbreviate." : "No headings collected yet — call fwh-get-current-page-mvp immediately (no speech) to get the live headings before speaking or highlighting.", f = s ? ` "${s}" is the PAGE TITLE, not a content section — do not fwh-highlight-mvp it separately; if doing a walkthrough, just fold this intro into your opening line: "${c || "(no intro text found)"}"` : c ? ` No separate page-title heading detected, but this intro text precedes the first section — mention it briefly before covering sections: "${c}"` : "", p = "";
12864
12880
  try {
12865
12881
  if (a.length > 0) {
@@ -12867,7 +12883,7 @@ function C_(e) {
12867
12883
  for (let n of e) {
12868
12884
  let e = mr(null, n);
12869
12885
  if (e) {
12870
- let r = S_(e).substring(0, 800);
12886
+ let r = C_(e).substring(0, 800);
12871
12887
  r && t.push(`[Section: ${n}] ${r}`);
12872
12888
  }
12873
12889
  }
@@ -12876,13 +12892,13 @@ function C_(e) {
12876
12892
  } catch {}
12877
12893
  if (Tr()) return Cr(), $("fwh-navigate-mvp ✖ landed on a not-found/404 page:", i), `NAVIGATION_PAGE_NOT_FOUND. The page at ${i} does not exist — it shows a "not found"/404 error, not real content. Do NOT offer a page overview, do NOT describe or highlight any sections, do NOT claim the navigation succeeded. Tell the visitor EXACTLY: "It looks like that page doesn't exist — I couldn't find it. Would you like me to take you somewhere else?" Then STOP and wait for their reply.`;
12878
12894
  let m = Date.now() + 4e3, h = typeof window < "u" ? window.location.pathname : r;
12879
- for (; Date.now() < m && !o_(h, e) && o_(h, t);) await new Promise((e) => setTimeout(e, 120)), h = window.location.pathname;
12895
+ for (; Date.now() < m && !s_(h, e) && s_(h, t);) await new Promise((e) => setTimeout(e, 120)), h = window.location.pathname;
12880
12896
  $("fwh-navigate-mvp route settle:", {
12881
12897
  startPath: t,
12882
12898
  targetPath: e,
12883
12899
  settledPath: h
12884
12900
  });
12885
- let g = typeof window < "u" ? window.location.href : i, _ = (h.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home", v = o_(h, e), y = !o_(h, t), b = v || y;
12901
+ let g = typeof window < "u" ? window.location.href : i, _ = (h.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home", v = s_(h, e), y = !s_(h, t), b = v || y;
12886
12902
  return $("fwh-navigate-mvp settled:", h, "target:", e, "match:", b), b ? (Cr(), `OK_NAVIGATE_SPA. Visitor is now on: ${g} (page: "${_}") | Section headings: ${u}.${f} ${d}${p} Now confirm the arrival in ONE short sentence phrased for what the visitor actually asked for — mention the page by name and what it lets them do (e.g. for a contact request: "I've taken you to the Contact Us page — filling in this form sends your query straight to our team."). Do NOT use a fixed template. Then, in the same breath, offer either a specific section or a full overview. Then STOP — wait for their reply.`) : (Cr(), `NAVIGATION_DID_NOT_HAPPEN. The visitor is STILL on ${g} (page: "${_}") — the navigation did not go through. Do NOT say "I have navigated you". Do NOT claim success. Tell the visitor EXACTLY: "Sorry, I couldn't open that page just now. Would you like me to try again, or is there something else I can help with?" Then STOP and wait for their reply.`);
12887
12903
  } catch {}
12888
12904
  return "OK_NAVIGATE_RELOADING. The page is reloading now and this session is ending. Say NOTHING further — do not confirm the navigation, do not describe the page. The arrival greeting is spoken automatically on the new page; you resume from the visitor's next reply.";
@@ -12894,39 +12910,39 @@ function C_(e) {
12894
12910
  duration: 1800
12895
12911
  }), t;
12896
12912
  } finally {
12897
- Xh(), Fh(900);
12913
+ Zh(), Fh(900);
12898
12914
  }
12899
12915
  },
12900
12916
  "fwh-highlight-mvp": async (e) => {
12901
12917
  $("fwh-highlight-mvp ▶", e);
12902
- let t = v_(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
12918
+ let t = y_(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
12903
12919
  if (Wn(3e3), typeof window < "u" && window.__fe_user_nav_during_speech) {
12904
12920
  let e = window.__fe_user_nav_during_speech, t = window.location.pathname;
12905
12921
  if (Date.now() - e.ts >= 3e4) window.__fe_user_nav_during_speech = null;
12906
12922
  else return $("flowengage_highlight ✖ blocked — user navigated during speech", e), `NAV_CHANGED: The visitor navigated from "${e.fromPageName}" to "${e.toPageName}" (current path: ${t}) while you were speaking. STOP the current walkthrough immediately. DO NOT call fwh-highlight-mvp again. Say out loud: "I see you've navigated to the ${e.toPageName} page — do you want me to continue what I was explaining, or shall I guide you through this page?" Wait for the visitor's answer before doing anything else.`;
12907
12923
  }
12908
- b_();
12924
+ x_();
12909
12925
  let i = ((e) => e && e.replace(/^\d+\.\s*/, "").replace(/^["']|["']$/g, "").trim())(r), a = mr(n || null, i || null);
12910
12926
  if (!a && i) {
12911
12927
  let e = Date.now() + 600;
12912
- for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), b_(), a = mr(null, i);
12928
+ for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), x_(), a = mr(null, i);
12913
12929
  }
12914
12930
  if (!a) {
12915
12931
  $("fwh-highlight-mvp ✖ no element for:", i || n);
12916
- let { headings: e } = x_(), t = e.length ? `Page headings: ${e.map((e) => `"${e}"`).join(" | ")}. Use one of these EXACT strings for section_text — no numbers, no quotes around them.` : "No headings found — skip highlight and continue speaking.";
12932
+ let { headings: e } = S_(), t = e.length ? `Page headings: ${e.map((e) => `"${e}"`).join(" | ")}. Use one of these EXACT strings for section_text — no numbers, no quotes around them.` : "No headings found — skip highlight and continue speaking.";
12917
12933
  return `HIGHLIGHT_NOT_FOUND: "${i || n}" on the current page. ${t}`;
12918
12934
  }
12919
12935
  return Nn(a), $("fwh-highlight-mvp ✓", i || n), `OK_HIGHLIGHT: "${i || n}". Your NEXT response must be speech only (no tool call) describing THIS section — "${i || n}" — using its own content. Do not ask whether to continue.`;
12920
12936
  },
12921
12937
  "fwh-read-content-mvp": async (e) => {
12922
12938
  $("fwh-read-content-mvp ▶", e);
12923
- let t = v_(e), n = t?.section_text || t?.sectionText || "";
12939
+ let t = y_(e), n = t?.section_text || t?.sectionText || "";
12924
12940
  try {
12925
12941
  let e = "";
12926
12942
  if (n) {
12927
12943
  let t = mr(null, n);
12928
12944
  if (!t) return `Could not find section "${n}" on the page.`;
12929
- e = S_(t);
12945
+ e = C_(t);
12930
12946
  } else {
12931
12947
  let t = (document.querySelector("main") || document.querySelector("article") || document.querySelector("[role=\"main\"]") || document.querySelector("#content") || document.querySelector(".content") || document.body).cloneNode(!0);
12932
12948
  t.querySelectorAll("nav, footer, header, aside, script, style, noscript, .nav, .footer, .header, .sidebar, #flowengage-root, .flowengage-shell, .flowengage-widget-root").forEach((e) => e.remove()), e = t.textContent.replace(/\s+/g, " ").trim();
@@ -12938,7 +12954,7 @@ function C_(e) {
12938
12954
  },
12939
12955
  "fwh-page-content-mvp": async (e) => {
12940
12956
  $("fwh-page-content-mvp ▶", e);
12941
- let r = v_(e), i = r?.url || r?.page_url || "";
12957
+ let r = y_(e), i = r?.url || r?.page_url || "";
12942
12958
  if ($("fwh-page-content-mvp · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("fwh-page-content-mvp ✖ missing url"), "Missing url parameter.";
12943
12959
  if (!t) return $("fwh-page-content-mvp ✖ no siteId"), "Site is not configured.";
12944
12960
  if (!n) return $("fwh-page-content-mvp ✖ no api base"), "API base URL is missing; cannot fetch page content.";
@@ -12970,7 +12986,7 @@ function C_(e) {
12970
12986
  },
12971
12987
  "fwh-search-mvp": async (e) => {
12972
12988
  $("fwh-search-mvp ▶", e);
12973
- let r = v_(e).query;
12989
+ let r = y_(e).query;
12974
12990
  if (!r) return $("fwh-search-mvp ✖ missing query"), "Missing query parameter.";
12975
12991
  if (!t) return $("fwh-search-mvp ✖ no siteId"), "Search unavailable (no siteId configured).";
12976
12992
  if (!n) return $("fwh-search-mvp ✖ no api base"), "Search unavailable (no API base URL).";
@@ -13008,7 +13024,7 @@ function C_(e) {
13008
13024
  "[class*='menu'] a",
13009
13025
  "[class*='header'] a"
13010
13026
  ];
13011
- if (c_((t) => {
13027
+ if (l_((t) => {
13012
13028
  for (let r of n) try {
13013
13029
  t.querySelectorAll(r).forEach((t) => {
13014
13030
  if (In(t)) return;
@@ -13016,7 +13032,7 @@ function C_(e) {
13016
13032
  if (!r || !n || n === "#" || n.startsWith("javascript:")) return;
13017
13033
  try {
13018
13034
  let e = t.parentElement;
13019
- if (e && s_(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
13035
+ if (e && c_(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
13020
13036
  } catch {}
13021
13037
  let i = r.toLowerCase() + "|" + n;
13022
13038
  e.has(i) || e.set(i, {
@@ -13027,7 +13043,7 @@ function C_(e) {
13027
13043
  } catch {}
13028
13044
  t.querySelectorAll("select").forEach((t) => {
13029
13045
  if (In(t)) return;
13030
- let n = u_(t);
13046
+ let n = d_(t);
13031
13047
  /nav|menu|page|section|go to/i.test(n || t.name || t.id || "") && Array.from(t.options).forEach((r) => {
13032
13048
  if (!r.value || r.disabled) return;
13033
13049
  let i = r.text.trim();
@@ -13051,7 +13067,7 @@ function C_(e) {
13051
13067
  if ($("fwh-get-current-page-mvp ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
13052
13068
  let e = window.location.href, t = window.location.pathname, n = document.title || "";
13053
13069
  if (Tr()) return $("fwh-get-current-page-mvp ✓ 404 detected", { url: e }), `CURRENT_PAGE_NOT_FOUND. The visitor is currently on a 404 / page-not-found error page (${e}). There is no real content here. Do NOT describe this page, do NOT list sections, do NOT offer a walkthrough, and do NOT describe it from your own knowledge. Tell the visitor plainly that the page they are on doesn't exist, and offer to take them somewhere that does.`;
13054
- let { headings: r, pageTitleHeading: i, introText: a } = x_();
13070
+ let { headings: r, pageTitleHeading: i, introText: a } = S_();
13055
13071
  $("fwh-get-current-page-mvp ✓", {
13056
13072
  url: e,
13057
13073
  path: t,
@@ -13063,7 +13079,7 @@ function C_(e) {
13063
13079
  return `CURRENT_PAGE. URL: ${e} | Title: ${n} | Page sections (${r.length} total): ${s}.${o} *** WALKTHROUGH: do NOT drive it yourself. Do not call fwh-highlight-mvp and do not decide the order — highlighting and section order are handled for you. You will be told which section to describe, one at a time. When told, describe ONLY that section in 3-4 sentences and then stop; never announce another section, never ask whether to continue. ***`;
13064
13080
  },
13065
13081
  "fwh-list-forms-mvp": async () => {
13066
- let e = f_(), t = p_();
13082
+ let e = p_(), t = m_();
13067
13083
  $("fwh-list-forms-mvp ✓", `${e.length} field(s)`, `${t.length} button(s)`);
13068
13084
  let n = e.map((e) => ({
13069
13085
  ...e,
@@ -13077,9 +13093,9 @@ function C_(e) {
13077
13093
  },
13078
13094
  "fwh-fill-form-mvp": async () => "FORM_FILLING_DISABLED: Form filling is not available at this time. Tell the visitor what fields are present (use fwh-list-forms-mvp) and ask them to fill the form themselves.",
13079
13095
  "fwh-click-button-mvp": async (e) => {
13080
- let t = v_(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
13096
+ let t = y_(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
13081
13097
  if ($("fwh-click-button-mvp ▶", n, r ? `(card_context: ${r})` : ""), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
13082
- let i = __(n, a, r);
13098
+ let i = v_(n, a, r);
13083
13099
  if (!i) return $("fwh-click-button-mvp ✖ no match"), `Could not find a button matching "${n}". Call fwh-list-forms-mvp to see button texts.`;
13084
13100
  try {
13085
13101
  Ph(`Clicking ${n}...`, { spinner: !0 });
@@ -13091,7 +13107,7 @@ function C_(e) {
13091
13107
  } catch {
13092
13108
  i.scrollIntoView(!0);
13093
13109
  }
13094
- await tg(i), i.focus?.(), await rg(i), ig(i), i.click();
13110
+ await ng(i), i.focus?.(), await ig(i), ag(i), i.click();
13095
13111
  let e = (i.textContent || i.value || i.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
13096
13112
  return $("fwh-click-button-mvp ✓", t), Ph(`Clicked ${e}`, {
13097
13113
  spinner: !1,
@@ -13106,7 +13122,7 @@ function C_(e) {
13106
13122
  duration: 1800
13107
13123
  }), t;
13108
13124
  } finally {
13109
- ng(), Fh(700);
13125
+ rg(), Fh(700);
13110
13126
  }
13111
13127
  },
13112
13128
  "fwh-cart-get-mvp": async () => {
@@ -13219,10 +13235,10 @@ function C_(e) {
13219
13235
  clickPageButton: o["fwh-click-button-mvp"]
13220
13236
  };
13221
13237
  }
13222
- var w_ = /^(get in touch|contact us|let'?s (talk|connect)|subscribe|newsletter|follow us|quick links|company|solutions|what we do|resources|legal|sitemap|share this)/i;
13223
- function T_() {
13238
+ var T_ = /^(get in touch|contact us|let'?s (talk|connect)|subscribe|newsletter|follow us|quick links|company|solutions|what we do|resources|legal|sitemap|share this)/i;
13239
+ function E_() {
13224
13240
  try {
13225
- let { headings: e, pageTitleHeading: t, containerHeadings: n } = x_(), r = new Set((n || []).map((e) => e.trim())), i = (e || []).map((e) => typeof e == "string" ? e : e?.text || "").filter(Boolean).filter((e) => !t || e.trim() !== t.trim()).filter((e) => !w_.test(e.trim())), a = i.filter((e) => !r.has(e.trim()));
13241
+ let { headings: e, pageTitleHeading: t, containerHeadings: n } = S_(), r = new Set((n || []).map((e) => e.trim())), i = (e || []).map((e) => typeof e == "string" ? e : e?.text || "").filter(Boolean).filter((e) => !t || e.trim() !== t.trim()).filter((e) => !T_.test(e.trim())), a = i.filter((e) => !r.has(e.trim()));
13226
13242
  return a.length ? a : i;
13227
13243
  } catch {
13228
13244
  return [];
@@ -13230,7 +13246,7 @@ function T_() {
13230
13246
  }
13231
13247
  //#endregion
13232
13248
  //#region src/utils/wrapVoiceToolsForLogging.js
13233
- function E_(e) {
13249
+ function D_(e) {
13234
13250
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
13235
13251
  let r = An();
13236
13252
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
@@ -13247,11 +13263,11 @@ function E_(e) {
13247
13263
  }
13248
13264
  //#endregion
13249
13265
  //#region src/components/FlowEngageWidget.jsx
13250
- var D_ = "[PAGE_CONTEXT]";
13251
- function O_(e, t, n) {
13252
- return `${D_} SESSION_CONTEXT (NOT a tool result — do NOT treat as CURRENT_PAGE): Visitor is on: ${e} | Approx headings for awareness only: ${t || ""}. ${n ? `Forms: ${n}. ` : ""}The visitor is ALREADY on this page — do NOT offer to navigate there.`;
13266
+ var O_ = "[PAGE_CONTEXT]";
13267
+ function k_(e, t, n) {
13268
+ return `${O_} SESSION_CONTEXT (NOT a tool result — do NOT treat as CURRENT_PAGE): Visitor is on: ${e} | Approx headings for awareness only: ${t || ""}. ${n ? `Forms: ${n}. ` : ""}The visitor is ALREADY on this page — do NOT offer to navigate there.`;
13253
13269
  }
13254
- var k_ = {
13270
+ var A_ = {
13255
13271
  blue: "#135bd8",
13256
13272
  red: "#ef334b",
13257
13273
  yellow: "#ffbd2e",
@@ -13259,7 +13275,7 @@ var k_ = {
13259
13275
  highlight: "rgba(255,255,255,0.9)",
13260
13276
  green: "#10b981"
13261
13277
  };
13262
- function A_(e) {
13278
+ function j_(e) {
13263
13279
  if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
13264
13280
  let [t, n, r] = e;
13265
13281
  return e.length >= 3 && r ? [
@@ -13273,12 +13289,12 @@ function A_(e) {
13273
13289
  "#f7f8fa"
13274
13290
  ].join(", ");
13275
13291
  }
13276
- function j_(e) {
13292
+ function M_(e) {
13277
13293
  if (!e || typeof e != "string") return "#1a1a1a";
13278
13294
  let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255, o = (e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
13279
13295
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
13280
13296
  }
13281
- function M_(t) {
13297
+ function N_(t) {
13282
13298
  let [n, r] = e.useState(null), i = typeof t == "string" ? t.trim() : "";
13283
13299
  return e.useEffect(() => {
13284
13300
  if (!i) {
@@ -13296,8 +13312,8 @@ function M_(t) {
13296
13312
  };
13297
13313
  }, [i]), n;
13298
13314
  }
13299
- function N_({ logo: t, style: n }) {
13300
- let r = M_(typeof t == "string" ? t : null);
13315
+ function P_({ logo: t, style: n }) {
13316
+ let r = N_(typeof t == "string" ? t : null);
13301
13317
  if (!t) return null;
13302
13318
  if (typeof t == "string") return r ? /* @__PURE__ */ g("img", {
13303
13319
  src: r,
@@ -13322,7 +13338,7 @@ function N_({ logo: t, style: n }) {
13322
13338
  children: i
13323
13339
  }) : null;
13324
13340
  }
13325
- function P_({ title: e }) {
13341
+ function F_({ title: e }) {
13326
13342
  return /* @__PURE__ */ g("div", {
13327
13343
  style: {
13328
13344
  width: "100%",
@@ -13340,18 +13356,18 @@ function P_({ title: e }) {
13340
13356
  children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
13341
13357
  });
13342
13358
  }
13343
- function F_(e, t) {
13359
+ function I_(e, t) {
13344
13360
  let n = (t || "").trim();
13345
13361
  return n ? !!(/\b(let'?s|let us)\s+(end|stop|finish|wrap up|close)\s+(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\bend\s+(this\s+)?(the\s+)?(voice\s+)?(session|call|chat)\b/i.test(n) || /\b(hang\s+up|disconnect)\b/i.test(n) || e === "bot" && (/\b(that'?s all|we'?re done)\b/i.test(n) || /\b(goodbye|bye)\b/i.test(n) || /\b(I'?ll|I will|Let me|I can|I'?m going to)\s+(end|close)\s+(the\s+)?(voice\s+)?(session|call)\b/i.test(n) || /\b(ending|closing)\s+(the\s+)?(voice\s+)?session\b|\bvoice\s+session\s+(is\s+)?(now\s+)?(ended|over|closing)\b/i.test(n) || /\b(session|call)\s+(is\s+)?(now\s+)?(ended|over)\b/i.test(n) || /\bwe\s+can\s+end\s+(the\s+)?(session|call)?\s*(here|now)\b/i.test(n) || /\b(wrapping\s+up|signing\s+off)\b/i.test(n))) : !1;
13346
13362
  }
13347
- function I_({ orbColors: e, ...t }) {
13348
- return /* @__PURE__ */ g(Jg, {
13363
+ function L_({ orbColors: e, ...t }) {
13364
+ return /* @__PURE__ */ g(Yg, {
13349
13365
  colors: e,
13350
13366
  ...t
13351
13367
  });
13352
13368
  }
13353
- function L_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
13354
- let s = n || k_.green, c = j_(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
13369
+ function R_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
13370
+ let s = n || A_.green, c = M_(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
13355
13371
  style: {
13356
13372
  display: "flex",
13357
13373
  alignItems: a ? "flex-end" : "center",
@@ -13477,7 +13493,7 @@ function L_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
13477
13493
  delay: 0
13478
13494
  },
13479
13495
  style: { flexShrink: 0 },
13480
- children: /* @__PURE__ */ g(I_, {
13496
+ children: /* @__PURE__ */ g(L_, {
13481
13497
  size: l,
13482
13498
  orbColors: t
13483
13499
  })
@@ -13509,8 +13525,8 @@ function L_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
13509
13525
  children: u
13510
13526
  })] });
13511
13527
  }
13512
- function R_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
13513
- let c = n || k_.green, l = j_(c);
13528
+ function z_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
13529
+ let c = n || A_.green, l = M_(c);
13514
13530
  return /* @__PURE__ */ _(oh.div, {
13515
13531
  initial: {
13516
13532
  scale: 50 / 350,
@@ -13581,7 +13597,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
13581
13597
  children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
13582
13598
  })
13583
13599
  }),
13584
- /* @__PURE__ */ g(I_, {
13600
+ /* @__PURE__ */ g(L_, {
13585
13601
  size: 72,
13586
13602
  orbColors: t
13587
13603
  }),
@@ -13661,7 +13677,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
13661
13677
  ]
13662
13678
  });
13663
13679
  }
13664
- function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, beaconSyncVoiceTranscript: d, widgetPosition: f = "bottom-right", voiceEndCounter: h, websiteName: v, voiceFirstMessage: y, captureVisitorEmail: b, emailRequired: x, emailCaptureEnabled: S = !0, listeningLabel: C = "Listening...", thinkingLabel: w = "Thinking...", enterChatModeLabel: T = "Enter Chat Mode", endConversationLabel: E = "End Conversation" }) {
13680
+ function B_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, beaconSyncVoiceTranscript: d, widgetPosition: f = "bottom-right", voiceEndCounter: h, websiteName: v, voiceFirstMessage: y, captureVisitorEmail: b, emailRequired: x, emailCaptureEnabled: S = !0, listeningLabel: C = "Listening...", thinkingLabel: w = "Thinking...", enterChatModeLabel: T = "Enter Chat Mode", endConversationLabel: E = "End Conversation" }) {
13665
13681
  c(() => (console.log("[FlowEngage:VoiceDebug] 🔵 VoiceMode MOUNTED"), () => console.log("[FlowEngage:VoiceDebug] 🔴 VoiceMode UNMOUNTED")), []);
13666
13682
  let [D, O] = m("idle"), [k, A] = m(!1), [ee, te] = m(!1), [ne, j] = m(() => ce(i) === "auto"), M = () => {
13667
13683
  let e = ne ? "ask" : "auto";
@@ -13748,7 +13764,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13748
13764
  Pn();
13749
13765
  } catch {}
13750
13766
  try {
13751
- Gh();
13767
+ Kh();
13752
13768
  } catch {}
13753
13769
  if (i) try {
13754
13770
  Le(i);
@@ -13796,7 +13812,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13796
13812
  if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
13797
13813
  l.current = [], Ce.current = "", Oe.current = !1, je.current = !1, Me.current = !1, Ne.current = "minimized", Nr({ onBeforeNavigate: () => {
13798
13814
  if (i && l.current.length > 0) try {
13799
- let e = r_(l.current);
13815
+ let e = i_(l.current);
13800
13816
  e && Te(i, e);
13801
13817
  } catch {}
13802
13818
  if (!$n()) {
@@ -13818,7 +13834,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13818
13834
  }
13819
13835
  ke();
13820
13836
  } });
13821
- let t = E_(C_({
13837
+ let t = D_(w_({
13822
13838
  siteId: i || null,
13823
13839
  apiBaseUrl: a || null,
13824
13840
  chatId: s || null,
@@ -13943,7 +13959,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13943
13959
  onMessage: (t) => {
13944
13960
  if (e || pe.current && t.role !== "user" && !/email/i.test(String(t.message || ""))) return;
13945
13961
  let n = t.role === "user" && /^(Describe the section titled "|\[SYSTEM:|Give the visitor a complete spoken overview|That was the last section)/.test(String(t.message || "").trim()), r = /\b(?:this|that|the)\s+(?:case\s*stud(?:y|ies)|product|article|blog|post|item|service)\b/i.test(String(t.message || ""));
13946
- if (!n && !r && t.role === "user" && We.test(String(t.message || ""))) typeof window < "u" && (window.__fe_user_nav_during_speech = null), I(!0), ge.current = !1, me.current = 0, L.current = -1, ve.current = T_(), ye.current = typeof window < "u" ? window.location.pathname : null, setTimeout(() => xe.current?.(), 400), console.log(`[FlowEngage] walkthrough armed — ${ve.current.length} sections on this page`);
13962
+ if (!n && !r && t.role === "user" && We.test(String(t.message || ""))) typeof window < "u" && (window.__fe_user_nav_during_speech = null), I(!0), ge.current = !1, me.current = 0, L.current = -1, ve.current = E_(), ye.current = typeof window < "u" ? window.location.pathname : null, setTimeout(() => xe.current?.(), 400), console.log(`[FlowEngage] walkthrough armed — ${ve.current.length} sections on this page`);
13947
13963
  else if (!n && t.role === "user" && he.current) {
13948
13964
  let e = String(t.message || "").trim(), n = Ye(e), r = (e) => !!e && (Ke.test(e) || Je.test(e));
13949
13965
  qe.test(be.current || "") ? (console.log("[FlowEngage] walkthrough ended — visitor accepted a navigation offer"), ye.current = null, ve.current = [], I(!1)) : !n || r(e) || r(n) ? ge.current && (ge.current = !1, console.debug("[FlowEngage] walkthrough resumed by visitor"), setTimeout(() => xe.current?.(), 300)) : (console.log("[FlowEngage] walkthrough ended — visitor moved to a new topic"), ye.current = null, ve.current = [], I(!1));
@@ -13960,10 +13976,10 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13960
13976
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13961
13977
  debug: t.debug
13962
13978
  }], i) try {
13963
- let e = r_(l.current);
13979
+ let e = i_(l.current);
13964
13980
  e && Te(i, e);
13965
13981
  } catch {}
13966
- if (F_(a, o)) {
13982
+ if (I_(a, o)) {
13967
13983
  ze.current = !0;
13968
13984
  return;
13969
13985
  }
@@ -14023,7 +14039,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14023
14039
  n.length || (n = Array.from(document.body.querySelectorAll("h1, h2, h3")).filter((t) => !t.closest(e)).map((e) => e.textContent.replace(/\s+/g, " ").trim()).filter((e) => e.length > 2 && e.length < 200)), n.length && (o = [...new Set(n)].slice(0, 15).join(" | "));
14024
14040
  } catch {}
14025
14041
  let s = r && !m ? `RESUMING PRIOR SESSION — DO NOT GREET. The visitor is continuing the same conversation after a page reload. Do not introduce yourself or re-state your capabilities. Wait silently until the visitor speaks; if you must speak first, briefly acknowledge where you left off in one short sentence.\nPrior transcript:\n${n?.transcript || ""}\n\n` : "";
14026
- ue.sendContextualUpdate(`${s}SiteId: ${i || "unknown"}. ${x ? "" : "Visitor's email is already on file from a prior session — do NOT ask for it again. "}WALKTHROUGH RULE: When the visitor asks for a walkthrough or overview of this page, you MUST IMMEDIATELY call fwh-get-current-page-mvp (zero speech — call it silently with NO words before it) to get the exact highlightable headings. Do NOT skip fwh-get-current-page-mvp. Voice: call end_voice_session or say you are ending the session to stop.`), ue.sendContextualUpdate(O_(e, o, a));
14042
+ ue.sendContextualUpdate(`${s}SiteId: ${i || "unknown"}. ${x ? "" : "Visitor's email is already on file from a prior session — do NOT ask for it again. "}WALKTHROUGH RULE: When the visitor asks for a walkthrough or overview of this page, you MUST IMMEDIATELY call fwh-get-current-page-mvp (zero speech — call it silently with NO words before it) to get the exact highlightable headings. Do NOT skip fwh-get-current-page-mvp. Voice: call end_voice_session or say you are ending the session to stop.`), ue.sendContextualUpdate(k_(e, o, a));
14027
14043
  } catch {}
14028
14044
  if (typeof window < "u") {
14029
14045
  let t = window.location.pathname, n = Date.now(), r = (e) => {
@@ -14059,7 +14075,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14059
14075
  } catch {}
14060
14076
  else console.log("[FlowEngage] auto-nav — skipping the arrival acknowledgment turn");
14061
14077
  try {
14062
- R.current?.sendContextualUpdate?.(O_(l, f));
14078
+ R.current?.sendContextualUpdate?.(k_(l, f));
14063
14079
  } catch {}
14064
14080
  return;
14065
14081
  }
@@ -14074,7 +14090,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14074
14090
  R.current?.sendUserMessage?.(`[SYSTEM: I navigated away mid-walkthrough — I am now on the "${h}" page (${l}). Page title: "${u}". Sections: ${JSON.stringify(d)}. STOP everything. Do NOT describe the new page. Say EXACTLY: "I see you've navigated to the ${h} page — would you like me to continue what I was explaining, or shall I walk you through this page?" Then wait for my answer. IF I say continue/yes/carry on: resume speaking verbally from where you left off — do NOT call fwh-navigate-mvp, do NOT call fwh-highlight-mvp, the visitor will navigate themselves if needed. IF I want to hear about this page: call fwh-highlight-mvp for sections of "${h}" only.]`);
14075
14091
  } catch {}
14076
14092
  try {
14077
- R.current?.sendContextualUpdate?.(O_(l, f));
14093
+ R.current?.sendContextualUpdate?.(k_(l, f));
14078
14094
  } catch {}
14079
14095
  };
14080
14096
  c = window.history.pushState.bind(window.history), window.history.pushState = (...e) => {
@@ -14286,7 +14302,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14286
14302
  },
14287
14303
  children: "Muted"
14288
14304
  }),
14289
- /* @__PURE__ */ g(I_, {
14305
+ /* @__PURE__ */ g(L_, {
14290
14306
  size: 72,
14291
14307
  voiceState: D,
14292
14308
  isMuted: k,
@@ -14358,7 +14374,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14358
14374
  y2: "23"
14359
14375
  })
14360
14376
  ]
14361
- }) : /* @__PURE__ */ g(og, {
14377
+ }) : /* @__PURE__ */ g(sg, {
14362
14378
  size: 16,
14363
14379
  color: "currentColor"
14364
14380
  })
@@ -14380,7 +14396,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14380
14396
  padding: 0,
14381
14397
  flexShrink: 0
14382
14398
  },
14383
- children: /* @__PURE__ */ g(mg, {
14399
+ children: /* @__PURE__ */ g(hg, {
14384
14400
  size: 16,
14385
14401
  color: "currentColor"
14386
14402
  })
@@ -14429,7 +14445,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14429
14445
  onMouseLeave: (e) => {
14430
14446
  e.currentTarget.style.background = "none";
14431
14447
  },
14432
- children: [/* @__PURE__ */ g(hg, {}), T]
14448
+ children: [/* @__PURE__ */ g(gg, {}), T]
14433
14449
  }),
14434
14450
  i && /* @__PURE__ */ _("button", {
14435
14451
  onClick: () => M(),
@@ -14533,7 +14549,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14533
14549
  onMouseLeave: (e) => {
14534
14550
  e.currentTarget.style.background = "none";
14535
14551
  },
14536
- children: [/* @__PURE__ */ g(gg, {}), E]
14552
+ children: [/* @__PURE__ */ g(_g, {}), E]
14537
14553
  }),
14538
14554
  /* @__PURE__ */ g("button", {
14539
14555
  onClick: () => te(!1),
@@ -14585,7 +14601,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14585
14601
  ]
14586
14602
  });
14587
14603
  }
14588
- function B_({ orbColors: e }) {
14604
+ function V_({ orbColors: e }) {
14589
14605
  let t = Array.isArray(e) && e.length > 0 ? e : [
14590
14606
  "#135bd8",
14591
14607
  "#ef334b",
@@ -14604,7 +14620,7 @@ function B_({ orbColors: e }) {
14604
14620
  `.replace(/\s+/g, " ").trim()
14605
14621
  } });
14606
14622
  }
14607
- var V_ = () => /* @__PURE__ */ g("div", {
14623
+ var H_ = () => /* @__PURE__ */ g("div", {
14608
14624
  style: {
14609
14625
  display: "flex",
14610
14626
  marginBottom: "12px",
@@ -14634,7 +14650,7 @@ var V_ = () => /* @__PURE__ */ g("div", {
14634
14650
  } }, e))
14635
14651
  })
14636
14652
  });
14637
- function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: E, rateLimitMessage: D, selectedFile: O, onFileSelect: k, onRemoveSelectedFile: A, attachmentError: ee, isUploadingAttachment: te, requiresEmail: ne, emailInput: j, setEmailInput: M, emailError: re, emailCaptureSuccess: ie, replyContext: ae, setReplyContext: N, webRTCError: oe, micError: P, setMicError: se, dismissCallError: F, activeCallId: ue, isCallMuted: de, toggleCallMute: fe, endWebRTCCall: pe, formatCallDuration: me, callDurationSeconds: he, isCallMinimized: ge, onExpand: _e, onCollapse: ve, onStartVoice: ye, voiceEnabled: be, headerBgColor: xe, onNewChat: I, showPoweredBy: L, privacyPolicyUrl: R, getVisitorChatHistory: Se, resumeChat: Ce, isSessionRestoring: we, isClosing: Te }) {
14653
+ function U_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: E, rateLimitMessage: D, selectedFile: O, onFileSelect: k, onRemoveSelectedFile: A, attachmentError: ee, isUploadingAttachment: te, requiresEmail: ne, emailInput: j, setEmailInput: M, emailError: re, emailCaptureSuccess: ie, replyContext: ae, setReplyContext: N, webRTCError: oe, micError: P, setMicError: se, dismissCallError: F, activeCallId: ue, isCallMuted: de, toggleCallMute: fe, endWebRTCCall: pe, formatCallDuration: me, callDurationSeconds: he, isCallMinimized: ge, onExpand: _e, onCollapse: ve, onStartVoice: ye, voiceEnabled: be, headerBgColor: xe, onNewChat: I, showPoweredBy: L, privacyPolicyUrl: R, getVisitorChatHistory: Se, resumeChat: Ce, isSessionRestoring: we, isClosing: Te }) {
14638
14654
  let Ee = l.length > 0, De = T || E || w, Oe = !!ue, [ke, Ae] = m(!1), { resolvedConfig: je } = kn(), Me = je?.siteId || null, [Ne, Pe] = m(() => ce(Me) === "auto"), Fe = () => {
14639
14655
  let e = Ne ? "ask" : "auto";
14640
14656
  le(Me, e), Pe(e === "auto");
@@ -14777,7 +14793,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
14777
14793
  justifyContent: "center",
14778
14794
  height: "40px"
14779
14795
  },
14780
- children: i ? /* @__PURE__ */ g(N_, {
14796
+ children: i ? /* @__PURE__ */ g(P_, {
14781
14797
  logo: i,
14782
14798
  style: {
14783
14799
  height: "34px",
@@ -14790,7 +14806,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
14790
14806
  height: "40px",
14791
14807
  flexShrink: 0
14792
14808
  },
14793
- children: /* @__PURE__ */ g(P_, { title: e.chatTitle })
14809
+ children: /* @__PURE__ */ g(F_, { title: e.chatTitle })
14794
14810
  })
14795
14811
  }), o && /* @__PURE__ */ g("div", {
14796
14812
  style: {
@@ -15154,7 +15170,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15154
15170
  })
15155
15171
  ]
15156
15172
  }),
15157
- /* @__PURE__ */ g(zg, {
15173
+ /* @__PURE__ */ g(Bg, {
15158
15174
  webRTCError: oe,
15159
15175
  micError: P,
15160
15176
  setMicError: se,
@@ -15162,7 +15178,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15162
15178
  isRateLimited: E,
15163
15179
  rateLimitMessage: D
15164
15180
  }),
15165
- ge && /* @__PURE__ */ g(n_, {
15181
+ ge && /* @__PURE__ */ g(r_, {
15166
15182
  agentName: v,
15167
15183
  agentHeadshot: y,
15168
15184
  fallbackAgentName: b,
@@ -15296,17 +15312,17 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15296
15312
  children: "No previous chats found."
15297
15313
  })
15298
15314
  })]
15299
- }) : null, Ee ? /* @__PURE__ */ g(Ig, {
15315
+ }) : null, Ee ? /* @__PURE__ */ g(Lg, {
15300
15316
  chatHistory: l,
15301
15317
  isAiTyping: u,
15302
15318
  isLoading: T,
15303
15319
  isAgentTyping: d,
15304
15320
  setReplyContext: N,
15305
- TypingDots: V_,
15321
+ TypingDots: H_,
15306
15322
  primaryColor: n,
15307
15323
  agentHeadshot: y,
15308
15324
  agentDisplayName: v || b,
15309
- botAvatarNode: /* @__PURE__ */ g(B_, { orbColors: t })
15325
+ botAvatarNode: /* @__PURE__ */ g(V_, { orbColors: t })
15310
15326
  }) : we ? /* @__PURE__ */ _("div", {
15311
15327
  style: {
15312
15328
  flex: 1,
@@ -15347,7 +15363,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15347
15363
  padding: "28px 24px"
15348
15364
  },
15349
15365
  children: [
15350
- /* @__PURE__ */ g(I_, {
15366
+ /* @__PURE__ */ g(L_, {
15351
15367
  size: 94,
15352
15368
  orbColors: t
15353
15369
  }),
@@ -15438,7 +15454,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15438
15454
  zIndex: 1,
15439
15455
  padding: ne ? "6px 0 0" : "12px 0 0"
15440
15456
  },
15441
- children: /* @__PURE__ */ g(Rg, {
15457
+ children: /* @__PURE__ */ g(zg, {
15442
15458
  input: x,
15443
15459
  setInput: S,
15444
15460
  onSubmit: C,
@@ -15512,7 +15528,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15512
15528
  ]
15513
15529
  });
15514
15530
  }
15515
- function U_() {
15531
+ function W_() {
15516
15532
  let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: E, callConnectedAt: D, isCallMuted: O, webRTCError: k, language: A, chatId: ee, historyRef: te, onMessageSync: ne, beaconSyncVoiceTranscript: j, sendMessage: M, uploadChatFile: re, openWidget: ie, captureVisitorEmail: ae, setVoiceMode: N, endConversation: se, startNewChat: F, acceptCall: ce, rejectCall: le, endWebRTCCall: ue, toggleCallMute: de, dismissCallError: fe, startTyping: pe, stopTyping: me, updateTypingDraft: he, getVisitorChatHistory: ge, resumeChat: _e, isSessionRestoring: ve, openToChatCounter: ye, voiceEndCounter: be } = kn();
15517
15533
  c(() => {
15518
15534
  try {
@@ -15534,7 +15550,7 @@ function U_() {
15534
15550
  small: 50,
15535
15551
  medium: 64,
15536
15552
  large: 80
15537
- }, ke = Oe[R.orbSize] || Oe.small, je = R.position || "bottom-right", Me = L.fallbackAgentName || "Agent", Pe = A_(we ?? R.chatBgColors), Fe = L.logo || L.logoUrl || null, Ie = A || "en", Le = xe.recommendations?.[Ie] || [], z = (I.recommendations?.[Ie] ?? Le).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
15553
+ }, ke = Oe[R.orbSize] || Oe.small, je = R.position || "bottom-right", Me = L.fallbackAgentName || "Agent", Pe = j_(we ?? R.chatBgColors), Fe = L.logo || L.logoUrl || null, Ie = A || "en", Le = xe.recommendations?.[Ie] || [], z = (I.recommendations?.[Ie] ?? Le).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
15538
15554
  id: e.key || `qr-${t}`,
15539
15555
  label: e.label,
15540
15556
  message: e.label,
@@ -15625,7 +15641,7 @@ function U_() {
15625
15641
  let kt = o(() => {
15626
15642
  ht(null), _t("");
15627
15643
  }, []), At = o((e) => {
15628
- let t = Ag(e);
15644
+ let t = jg(e);
15629
15645
  if (t) {
15630
15646
  ht(null), _t(t);
15631
15647
  return;
@@ -15731,7 +15747,7 @@ function U_() {
15731
15747
  if (mt) {
15732
15748
  try {
15733
15749
  yt(!0), _t("");
15734
- let e = await re(mt), n = e?.data || e, r = tt.trim() || `Shared file: ${Mg(mt)}`;
15750
+ let e = await re(mt), n = e?.data || e, r = tt.trim() || `Shared file: ${Ng(mt)}`;
15735
15751
  nt(""), it(null), kt(), await M(r, "", t, {
15736
15752
  type: "file",
15737
15753
  metadata: {
@@ -15824,7 +15840,7 @@ function U_() {
15824
15840
  onWheel: (e) => e.stopPropagation(),
15825
15841
  onTouchMove: (e) => e.stopPropagation(),
15826
15842
  children: [
15827
- W === "entry_prompt" && /* @__PURE__ */ g(L_, {
15843
+ W === "entry_prompt" && /* @__PURE__ */ g(R_, {
15828
15844
  copy: qe,
15829
15845
  orbColors: we,
15830
15846
  primaryColor: Te,
@@ -15907,13 +15923,13 @@ function U_() {
15907
15923
  children: E === "connected" ? `${It(ut)} with ${Ze}` : `Tap to return to ${Ze}`
15908
15924
  })]
15909
15925
  })]
15910
- }), /* @__PURE__ */ g(I_, {
15926
+ }), /* @__PURE__ */ g(L_, {
15911
15927
  size: ke,
15912
15928
  orbColors: we,
15913
15929
  onClick: T ? jt : Ce ? Bt : Ht
15914
15930
  })]
15915
15931
  }),
15916
- W === "connection_modal" && /* @__PURE__ */ g(R_, {
15932
+ W === "connection_modal" && /* @__PURE__ */ g(z_, {
15917
15933
  copy: qe,
15918
15934
  orbColors: we,
15919
15935
  primaryColor: Te,
@@ -15923,7 +15939,7 @@ function U_() {
15923
15939
  isMobile: Dt,
15924
15940
  isClosing: St
15925
15941
  }),
15926
- W === "voice_mode" && /* @__PURE__ */ g(z_, {
15942
+ W === "voice_mode" && /* @__PURE__ */ g(B_, {
15927
15943
  orbColors: we,
15928
15944
  onEnterChat: Ht,
15929
15945
  onEndChat: Ut,
@@ -15946,7 +15962,7 @@ function U_() {
15946
15962
  enterChatModeLabel: L.voiceEnterChatLabel || "Enter Chat Mode",
15947
15963
  endConversationLabel: L.voiceEndConversationLabel || "End Conversation"
15948
15964
  }, "voice"),
15949
- W === "call_screen" && /* @__PURE__ */ g(t_, {
15965
+ W === "call_screen" && /* @__PURE__ */ g(n_, {
15950
15966
  incomingCall: w,
15951
15967
  activeCallId: T,
15952
15968
  callConnectionState: E,
@@ -15965,7 +15981,7 @@ function U_() {
15965
15981
  orbColors: we,
15966
15982
  chatHistory: r
15967
15983
  }),
15968
- W === "text_chat" && /* @__PURE__ */ g(H_, {
15984
+ W === "text_chat" && /* @__PURE__ */ g(U_, {
15969
15985
  isClosing: St,
15970
15986
  copy: qe,
15971
15987
  orbColors: we,
@@ -16031,7 +16047,7 @@ function U_() {
16031
16047
  }
16032
16048
  //#endregion
16033
16049
  //#region src/components/ErrorBoundary.jsx
16034
- var W_ = class extends e.Component {
16050
+ var G_ = class extends e.Component {
16035
16051
  constructor(e) {
16036
16052
  super(e), this.state = { hasError: !1 };
16037
16053
  }
@@ -16046,4 +16062,4 @@ var W_ = class extends e.Component {
16046
16062
  }
16047
16063
  };
16048
16064
  //#endregion
16049
- export { Jg as AnimatedOrb, W_ as ErrorBoundary, yi as FlowEngageProvider, U_ as FlowEngageWidget, kn as useFlowEngage };
16065
+ export { Yg as AnimatedOrb, G_ as ErrorBoundary, yi as FlowEngageProvider, W_ as FlowEngageWidget, kn as useFlowEngage };