@flowengage/react-chatbot 8.0.120 → 8.0.122

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
  }, {
@@ -9872,25 +9880,50 @@ function Uh(e, t) {
9872
9880
  n();
9873
9881
  }
9874
9882
  }
9875
- function Wh(e, { title: t = "Products", side: n = "right", productUrl: r = null } = {}) {
9883
+ function Wh(e, t) {
9884
+ let n = Number(e);
9885
+ if (!Number.isFinite(n)) return null;
9886
+ let r = n.toLocaleString(void 0, {
9887
+ minimumFractionDigits: n % 1 == 0 ? 0 : 2,
9888
+ maximumFractionDigits: 2
9889
+ });
9890
+ return t ? `${t} ${r}` : r;
9891
+ }
9892
+ function Gh(e) {
9893
+ if (!e) return null;
9894
+ let t = new Date(e);
9895
+ return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString(void 0, {
9896
+ day: "numeric",
9897
+ month: "short",
9898
+ year: "numeric"
9899
+ });
9900
+ }
9901
+ function Kh(e, t = {}) {
9902
+ try {
9903
+ qh(e, t);
9904
+ } catch (e) {
9905
+ console.error("[FlowEngage] product panel render failed:", e), Jh();
9906
+ }
9907
+ }
9908
+ function qh(e, { title: t = "Products", side: n = "right", productUrl: r = null } = {}) {
9876
9909
  if (typeof document > "u") return;
9877
9910
  let i = Array.isArray(e) ? e.filter(Boolean) : [];
9878
- if (!i.length) return Gh();
9911
+ if (!i.length) return console.log("[FlowEngage] product panel: nothing to show"), Jh();
9879
9912
  Ah();
9880
9913
  let a = Lh();
9881
9914
  Vh = n === "left" ? "left" : "right", Uh(a, Vh), Hh || (Hh = !0, window.addEventListener("resize", () => {
9882
9915
  Ih?.classList.contains(`${Q}-show`) && Uh(Ih, Vh);
9883
- })), a.innerHTML = "";
9884
- let o = document.createElement("div");
9885
- o.id = `${Q}-panel-head`;
9886
- let s = document.createElement("div");
9887
- s.id = `${Q}-panel-title`, s.textContent = t;
9888
- let c = document.createElement("span");
9889
- c.id = `${Q}-panel-count`, c.textContent = String(i.length);
9890
- let l = document.createElement("button");
9891
- 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);
9892
- let u = document.createElement("div");
9893
- u.id = `${Q}-panel-list`;
9916
+ }));
9917
+ let o = document.createDocumentFragment(), s = document.createElement("div");
9918
+ s.id = `${Q}-panel-head`;
9919
+ let c = document.createElement("div");
9920
+ c.id = `${Q}-panel-title`, c.textContent = t;
9921
+ let l = document.createElement("span");
9922
+ l.id = `${Q}-panel-count`, l.textContent = String(i.length);
9923
+ let u = document.createElement("button");
9924
+ u.id = `${Q}-panel-close`, u.type = "button", u.setAttribute("aria-label", "Close product panel"), u.textContent = "×", u.addEventListener("click", () => Jh()), s.append(c, l, u);
9925
+ let d = document.createElement("div");
9926
+ d.id = `${Q}-panel-list`;
9894
9927
  for (let e of i) {
9895
9928
  let t = typeof r == "function" ? r(e) : null, n = document.createElement(t ? "a" : "div");
9896
9929
  if (n.className = `${Q}-card`, t && (n.href = t, n.rel = "noopener"), e.image) {
@@ -9909,7 +9942,7 @@ function Wh(e, { title: t = "Products", side: n = "right", productUrl: r = null
9909
9942
  a.className = `${Q}-card-title`, a.textContent = e.title || "Item", i.appendChild(a);
9910
9943
  let o = [];
9911
9944
  e.quantity > 1 && o.push(`Qty ${e.quantity}`);
9912
- let s = formatWhen(e.orderedAt);
9945
+ let s = Gh(e.orderedAt);
9913
9946
  if (s && o.push(s), e.fulfillmentStatus && o.push(e.fulfillmentStatus), o.length || e.productType) {
9914
9947
  let t = document.createElement("div");
9915
9948
  if (t.className = `${Q}-card-meta`, e.productType) {
@@ -9918,54 +9951,59 @@ function Wh(e, { title: t = "Products", side: n = "right", productUrl: r = null
9918
9951
  }
9919
9952
  t.appendChild(document.createTextNode(o.join(" · "))), i.appendChild(t);
9920
9953
  }
9921
- let c = formatMoney(e.price, e.currency);
9954
+ let c = Wh(e.price, e.currency);
9922
9955
  if (c) {
9923
9956
  let e = document.createElement("div");
9924
9957
  e.className = `${Q}-card-price`, e.textContent = c, i.appendChild(e);
9925
9958
  }
9926
- n.appendChild(i), u.appendChild(n);
9959
+ n.appendChild(i), d.appendChild(n);
9927
9960
  }
9928
- a.append(o, u), a.classList.remove(`${Q}-show`), a.offsetHeight, a.classList.add(`${Q}-show`);
9961
+ 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", {
9962
+ left: a.style.left,
9963
+ right: a.style.right,
9964
+ bottom: a.style.bottom,
9965
+ rect: a.getBoundingClientRect()
9966
+ });
9929
9967
  }
9930
- function Gh() {
9968
+ function Jh() {
9931
9969
  Ih && Ih.classList.remove(`${Q}-show`);
9932
9970
  }
9933
- var Kh = null, qh = [];
9934
- function Jh() {
9935
- return (!Kh || !Kh.isConnected) && (Kh = document.createElement("div"), Kh.id = `${Q}-bar`, document.body.appendChild(Kh)), Kh;
9971
+ var Yh = null, Xh = [];
9972
+ function Zh() {
9973
+ return (!Yh || !Yh.isConnected) && (Yh = document.createElement("div"), Yh.id = `${Q}-bar`, document.body.appendChild(Yh)), Yh;
9936
9974
  }
9937
- function Yh() {
9975
+ function Qh() {
9938
9976
  if (typeof document > "u") return;
9939
- Ah(), qh.forEach(clearTimeout), qh = [];
9940
- let e = Jh();
9977
+ Ah(), Xh.forEach(clearTimeout), Xh = [];
9978
+ let e = Zh();
9941
9979
  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";
9942
9980
  let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
9943
9981
  for (let [e, r] of t) {
9944
9982
  let t = n, i = e, a = r;
9945
- qh.push(setTimeout(() => {
9946
- Kh && (Kh.style.transition = a, Kh.style.width = `${i}%`);
9983
+ Xh.push(setTimeout(() => {
9984
+ Yh && (Yh.style.transition = a, Yh.style.width = `${i}%`);
9947
9985
  }, t)), n += 800;
9948
9986
  }
9949
9987
  }
9950
- function Xh() {
9951
- Kh && (qh.forEach(clearTimeout), qh = [], Kh.style.transition = "width 0.2s ease", Kh.style.width = "100%", qh.push(setTimeout(() => {
9952
- Kh && (Kh.style.transition = "opacity 0.35s ease", Kh.style.opacity = "0", qh.push(setTimeout(() => {
9953
- Kh && (Kh.style.width = "0%", Kh.classList.remove(`${Q}-bar-active`));
9988
+ function $h() {
9989
+ Yh && (Xh.forEach(clearTimeout), Xh = [], Yh.style.transition = "width 0.2s ease", Yh.style.width = "100%", Xh.push(setTimeout(() => {
9990
+ Yh && (Yh.style.transition = "opacity 0.35s ease", Yh.style.opacity = "0", Xh.push(setTimeout(() => {
9991
+ Yh && (Yh.style.width = "0%", Yh.classList.remove(`${Q}-bar-active`));
9954
9992
  }, 380)));
9955
9993
  }, 220)));
9956
9994
  }
9957
- var Zh = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
9995
+ var eg = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
9958
9996
  <filter id="${Q}-csh">
9959
9997
  <feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
9960
9998
  </filter>
9961
9999
  <path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
9962
10000
  fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
9963
10001
  filter="url(#${Q}-csh)"/>
9964
- </svg>`, Qh = null, $h = !1;
9965
- function eg() {
9966
- return (!Qh || !Qh.isConnected) && (Qh = document.createElement("div"), Qh.id = `${Q}-cursor`, Qh.innerHTML = Zh, document.body.appendChild(Qh), $h = !1), Qh;
10002
+ </svg>`, tg = null, ng = !1;
10003
+ function rg() {
10004
+ return (!tg || !tg.isConnected) && (tg = document.createElement("div"), tg.id = `${Q}-cursor`, tg.innerHTML = eg, document.body.appendChild(tg), ng = !1), tg;
9967
10005
  }
9968
- async function tg(e) {
10006
+ async function ig(e) {
9969
10007
  if (typeof document > "u" || !e) return;
9970
10008
  Ah();
9971
10009
  let t;
@@ -9974,18 +10012,18 @@ async function tg(e) {
9974
10012
  } catch {
9975
10013
  return;
9976
10014
  }
9977
- let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = eg();
9978
- $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);
10015
+ let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = rg();
10016
+ ng ||= (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 cg(360);
9979
10017
  }
9980
- function ng(e = !1) {
9981
- Qh && (e ? (Qh.classList.remove(`${Q}-cursor-visible`), $h = !1) : (Qh.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
9982
- $h = !1;
10018
+ function ag(e = !1) {
10019
+ tg && (e ? (tg.classList.remove(`${Q}-cursor-visible`), ng = !1) : (tg.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
10020
+ ng = !1;
9983
10021
  }, 250)));
9984
10022
  }
9985
- async function rg(e) {
9986
- Qh && (Qh.classList.add(`${Q}-cursor-click`), await ag(280), Qh.classList.remove(`${Q}-cursor-click`));
10023
+ async function og(e) {
10024
+ tg && (tg.classList.add(`${Q}-cursor-click`), await cg(280), tg.classList.remove(`${Q}-cursor-click`));
9987
10025
  }
9988
- function ig(e) {
10026
+ function sg(e) {
9989
10027
  if (!e || typeof document > "u") return;
9990
10028
  Ah();
9991
10029
  let t;
@@ -10013,12 +10051,12 @@ function ig(e) {
10013
10051
  a.remove(), e.style.position = n, e.style.overflow = r;
10014
10052
  }, 650);
10015
10053
  }
10016
- function ag(e) {
10054
+ function cg(e) {
10017
10055
  return new Promise((t) => setTimeout(t, e));
10018
10056
  }
10019
10057
  //#endregion
10020
10058
  //#region src/lib/svgIcons.jsx
10021
- var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10059
+ var lg = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10022
10060
  width: e,
10023
10061
  height: e,
10024
10062
  viewBox: "0 0 24 24",
@@ -10034,7 +10072,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10034
10072
  strokeLinecap: "round",
10035
10073
  strokeLinejoin: "round"
10036
10074
  })]
10037
- }), sg = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
10075
+ }), ug = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
10038
10076
  width: e,
10039
10077
  height: e,
10040
10078
  viewBox: "0 0 24 24",
@@ -10049,7 +10087,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10049
10087
  x2: "1",
10050
10088
  y2: "23"
10051
10089
  })]
10052
- }), cg = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
10090
+ }), dg = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
10053
10091
  width: e,
10054
10092
  height: e,
10055
10093
  viewBox: "0 0 24 24",
@@ -10064,7 +10102,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10064
10102
  x2: "12",
10065
10103
  y2: "5"
10066
10104
  }), /* @__PURE__ */ g("polyline", { points: "5 12 12 5 19 12" })]
10067
- }), lg = () => /* @__PURE__ */ _("svg", {
10105
+ }), fg = () => /* @__PURE__ */ _("svg", {
10068
10106
  width: "14",
10069
10107
  height: "14",
10070
10108
  viewBox: "0 0 24 24",
@@ -10074,7 +10112,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10074
10112
  strokeLinecap: "round",
10075
10113
  strokeLinejoin: "round",
10076
10114
  children: [/* @__PURE__ */ g("polyline", { points: "9 17 4 12 9 7" }), /* @__PURE__ */ g("path", { d: "M20 18v-2a4 4 0 00-4-4H4" })]
10077
- }), ug = () => /* @__PURE__ */ g("svg", {
10115
+ }), pg = () => /* @__PURE__ */ g("svg", {
10078
10116
  width: "18",
10079
10117
  height: "18",
10080
10118
  viewBox: "0 0 24 24",
@@ -10084,7 +10122,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10084
10122
  strokeLinecap: "round",
10085
10123
  strokeLinejoin: "round",
10086
10124
  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" })
10087
- }), dg = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
10125
+ }), mg = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
10088
10126
  className: e,
10089
10127
  width: "14",
10090
10128
  height: "14",
@@ -10113,7 +10151,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10113
10151
  y2: "16"
10114
10152
  })
10115
10153
  ]
10116
- }), fg = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
10154
+ }), hg = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
10117
10155
  width: e,
10118
10156
  height: e,
10119
10157
  viewBox: "0 0 24 24",
@@ -10136,7 +10174,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10136
10174
  /* @__PURE__ */ g("path", { d: "M15 13v2" }),
10137
10175
  /* @__PURE__ */ g("path", { d: "M9 13v2" })
10138
10176
  ]
10139
- }), pg = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
10177
+ }), gg = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
10140
10178
  width: e,
10141
10179
  height: e,
10142
10180
  viewBox: "0 0 24 24",
@@ -10156,7 +10194,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10156
10194
  x2: "19",
10157
10195
  y2: "12"
10158
10196
  })]
10159
- }), mg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10197
+ }), _g = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10160
10198
  width: e,
10161
10199
  height: e,
10162
10200
  viewBox: "0 0 24 24",
@@ -10182,7 +10220,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10182
10220
  fill: t
10183
10221
  })
10184
10222
  ]
10185
- }), hg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10223
+ }), vg = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
10186
10224
  width: "24",
10187
10225
  height: "24",
10188
10226
  viewBox: "0 0 24 24",
@@ -10200,7 +10238,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10200
10238
  "stroke-linecap": "round",
10201
10239
  "stroke-linejoin": "round"
10202
10240
  })]
10203
- }), gg = () => /* @__PURE__ */ g("svg", {
10241
+ }), yg = () => /* @__PURE__ */ g("svg", {
10204
10242
  width: "24",
10205
10243
  height: "24",
10206
10244
  viewBox: "0 0 24 24",
@@ -10212,7 +10250,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10212
10250
  "stroke-width": "1.5",
10213
10251
  "stroke-linejoin": "round"
10214
10252
  })
10215
- }), _g = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
10253
+ }), bg = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
10216
10254
  xmlns: "http://www.w3.org/2000/svg",
10217
10255
  width: e,
10218
10256
  height: e,
@@ -10230,7 +10268,7 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10230
10268
  /* @__PURE__ */ g("path", { d: "m2 2 20 20" }),
10231
10269
  /* @__PURE__ */ g("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
10232
10270
  ]
10233
- }), 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([
10271
+ }), xg = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), Sg = (e = "") => String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), Cg = new Set([
10234
10272
  "p",
10235
10273
  "br",
10236
10274
  "ul",
@@ -10241,30 +10279,30 @@ var og = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg
10241
10279
  "b",
10242
10280
  "i",
10243
10281
  "a"
10244
- ]), xg = /^https?:\/\//i;
10245
- function Sg(e) {
10282
+ ]), wg = /^https?:\/\//i;
10283
+ function Tg(e) {
10246
10284
  let t = Array.from(e.childNodes);
10247
10285
  for (let n of t) if (n.nodeType === Node.ELEMENT_NODE) {
10248
10286
  let t = n.tagName.toLowerCase();
10249
- if (!bg.has(t)) {
10287
+ if (!Cg.has(t)) {
10250
10288
  e.replaceChild(document.createTextNode(n.textContent), n);
10251
10289
  continue;
10252
10290
  }
10253
10291
  let r = {};
10254
10292
  if (t === "a") {
10255
10293
  let e = n.getAttribute("href") || "";
10256
- xg.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
10294
+ wg.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
10257
10295
  }
10258
10296
  for (; n.attributes.length > 0;) n.removeAttribute(n.attributes[0].name);
10259
10297
  for (let [e, t] of Object.entries(r)) n.setAttribute(e, t);
10260
- Sg(n);
10298
+ Tg(n);
10261
10299
  } else n.nodeType !== Node.TEXT_NODE && e.removeChild(n);
10262
10300
  }
10263
- function Cg(e) {
10301
+ function Eg(e) {
10264
10302
  let t = document.createElement("div");
10265
- return t.innerHTML = e, Sg(t), t.innerHTML;
10303
+ return t.innerHTML = e, Tg(t), t.innerHTML;
10266
10304
  }
10267
- function wg(e) {
10305
+ function Dg(e) {
10268
10306
  let t = String(e || "").trim();
10269
10307
  if (!t) return t;
10270
10308
  let n = /^<p>\s*<strong>([\s\S]*?)<\/strong>\s*<\/p>$/i.exec(t);
@@ -10276,33 +10314,33 @@ function wg(e) {
10276
10314
  }
10277
10315
  return e;
10278
10316
  }
10279
- var Tg = (e = "") => {
10317
+ var Og = (e = "") => {
10280
10318
  let t = String(e || "").trim();
10281
10319
  if (!t) return "";
10282
- if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return wg(Cg(t));
10283
- 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>");
10284
- return wg(n.map((e) => {
10320
+ if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return Dg(Eg(t));
10321
+ 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) => Sg(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>");
10322
+ return Dg(n.map((e) => {
10285
10323
  let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = t.filter((e) => /^[-*]\s+/.test(e));
10286
10324
  if (n.length >= 2 && n.length === t.length) return `<ul>${n.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>`;
10287
10325
  let i = e.split(/\s+(?=[-*]\s+\*\*?)/).map((e) => e.trim()).filter(Boolean);
10288
10326
  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>`;
10289
10327
  }).join(""));
10290
- }, Eg = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), Dg = new Set([
10328
+ }, kg = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), Ag = new Set([
10291
10329
  ".pdf",
10292
10330
  ".docx",
10293
10331
  ".png",
10294
10332
  ".jpg",
10295
10333
  ".jpeg"
10296
- ]), Og = "image/png,image/jpeg,.pdf,.docx";
10297
- function kg(e) {
10334
+ ]), jg = "image/png,image/jpeg,.pdf,.docx";
10335
+ function Mg(e) {
10298
10336
  if (!e) return !1;
10299
10337
  let t = typeof e.name == "string" ? e.name.toLowerCase() : "", n = t.includes(".") ? `.${t.split(".").pop()}` : "", r = typeof e.type == "string" ? e.type.toLowerCase() : "";
10300
- return r === "image/png" || r === "image/jpeg" || Eg.has(r) || Dg.has(n);
10338
+ return r === "image/png" || r === "image/jpeg" || kg.has(r) || Ag.has(n);
10301
10339
  }
10302
- function Ag(e) {
10303
- 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.";
10340
+ function Ng(e) {
10341
+ return e ? Mg(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
10304
10342
  }
10305
- function jg(e = 0) {
10343
+ function Pg(e = 0) {
10306
10344
  if (!Number.isFinite(e) || e <= 0) return "";
10307
10345
  let t = [
10308
10346
  "B",
@@ -10314,12 +10352,12 @@ function jg(e = 0) {
10314
10352
  let i = n >= 10 || r === 0 ? 0 : 1;
10315
10353
  return `${n.toFixed(i)} ${t[r]}`;
10316
10354
  }
10317
- function Mg(e) {
10355
+ function Fg(e) {
10318
10356
  return e ? e.name || "Attachment" : "";
10319
10357
  }
10320
10358
  //#endregion
10321
10359
  //#region src/utils/avatarHelpers.js
10322
- function Ng(e) {
10360
+ function Ig(e) {
10323
10361
  if (!e || typeof e != "string") return "?";
10324
10362
  let t = e.trim();
10325
10363
  if (!t) return "?";
@@ -10328,7 +10366,7 @@ function Ng(e) {
10328
10366
  }
10329
10367
  //#endregion
10330
10368
  //#region src/components/AvatarImageOrInitials.jsx
10331
- function Pg({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10369
+ function Lg({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10332
10370
  let [i, a] = m(null), o = typeof e == "string" ? e.trim() : "";
10333
10371
  return c(() => {
10334
10372
  if (!o) {
@@ -10351,12 +10389,12 @@ function Pg({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
10351
10389
  onError: () => a(null)
10352
10390
  }) : /* @__PURE__ */ g("span", {
10353
10391
  style: r,
10354
- children: Ng(t)
10392
+ children: Ig(t)
10355
10393
  });
10356
10394
  }
10357
10395
  //#endregion
10358
10396
  //#region src/components/MessageList.jsx
10359
- function Fg({ siteId: e, onChoose: t }) {
10397
+ function Rg({ siteId: e, onChoose: t }) {
10360
10398
  let [n, r] = m(null), i = (n) => {
10361
10399
  le(e, n), r(n), t?.(n);
10362
10400
  };
@@ -10429,7 +10467,7 @@ function Fg({ siteId: e, onChoose: t }) {
10429
10467
  })
10430
10468
  });
10431
10469
  }
10432
- function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
10470
+ function zg({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
10433
10471
  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) => {
10434
10472
  let t = e.target.closest("a[href]");
10435
10473
  if (!t) return;
@@ -10484,8 +10522,8 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10484
10522
  children: [
10485
10523
  e.map((e) => {
10486
10524
  if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
10487
- if (e.type === "nav_pref_choice") return /* @__PURE__ */ g(Fg, { siteId: d?.siteId }, e.id || e.messageId);
10488
- 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";
10525
+ if (e.type === "nav_pref_choice") return /* @__PURE__ */ g(Rg, { siteId: d?.siteId }, e.id || e.messageId);
10526
+ 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 = xg(e.replyToContent || e.replyContext?.message || ""), S = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
10489
10527
  return t ? /* @__PURE__ */ g("div", {
10490
10528
  style: {
10491
10529
  display: "flex",
@@ -10530,7 +10568,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10530
10568
  fontWeight: 800,
10531
10569
  marginTop: !c && (r || o) ? "22px" : "0px"
10532
10570
  },
10533
- children: r ? u || /* @__PURE__ */ g(fg, { size: 16 }) : /* @__PURE__ */ g(Pg, {
10571
+ children: r ? u || /* @__PURE__ */ g(hg, { size: 16 }) : /* @__PURE__ */ g(Lg, {
10534
10572
  src: m || "",
10535
10573
  name: p,
10536
10574
  imgStyle: {
@@ -10572,7 +10610,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10572
10610
  onMouseLeave: (e) => {
10573
10611
  e.currentTarget.style.color = "#9ca3af";
10574
10612
  },
10575
- children: [/* @__PURE__ */ g(lg, {}), "Reply"]
10613
+ children: [/* @__PURE__ */ g(fg, {}), "Reply"]
10576
10614
  }),
10577
10615
  /* @__PURE__ */ _("div", {
10578
10616
  style: {
@@ -10616,7 +10654,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10616
10654
  children: v
10617
10655
  })]
10618
10656
  }), f ? (() => {
10619
- 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" ? {
10657
+ let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = Pg(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" ? {
10620
10658
  color: "#ef4444",
10621
10659
  label: "PDF"
10622
10660
  } : t.includes("word") || t.includes("docx") ? {
@@ -10797,7 +10835,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10797
10835
  });
10798
10836
  })() : r ? /* @__PURE__ */ g("div", {
10799
10837
  className: "flowengage-message-content fe-bot-message",
10800
- dangerouslySetInnerHTML: { __html: Tg(e.message) },
10838
+ dangerouslySetInnerHTML: { __html: Og(e.message) },
10801
10839
  onClick: T
10802
10840
  }) : /* @__PURE__ */ g("div", {
10803
10841
  style: { whiteSpace: "pre-wrap" },
@@ -10862,7 +10900,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10862
10900
  boxShadow: u ? "none" : "0 8px 20px rgba(59,130,246,0.24)",
10863
10901
  overflow: "hidden"
10864
10902
  },
10865
- children: u || /* @__PURE__ */ g(fg, { size: 16 })
10903
+ children: u || /* @__PURE__ */ g(hg, { size: 16 })
10866
10904
  }), /* @__PURE__ */ _("div", {
10867
10905
  style: {
10868
10906
  display: "flex",
@@ -10904,7 +10942,7 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10904
10942
  borderRadius: "50%",
10905
10943
  overflow: "hidden"
10906
10944
  },
10907
- children: /* @__PURE__ */ g(Pg, {
10945
+ children: /* @__PURE__ */ g(Lg, {
10908
10946
  src: s || "",
10909
10947
  name: l,
10910
10948
  imgStyle: {
@@ -10998,22 +11036,22 @@ function Ig({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
10998
11036
  }
10999
11037
  //#endregion
11000
11038
  //#region src/components/ChatInput.jsx
11001
- var Lg = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
11002
- 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" }) {
11039
+ var Bg = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
11040
+ function Vg({ 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" }) {
11003
11041
  let D = p(null), O = p(null), k = (e) => {
11004
11042
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
11005
11043
  };
11006
11044
  c(() => {
11007
11045
  d || k(O.current);
11008
11046
  }, [e, d]), c(() => {
11009
- d || Lg || e || s || O.current?.focus();
11047
+ d || Bg || e || s || O.current?.focus();
11010
11048
  }, [
11011
11049
  e,
11012
11050
  d,
11013
11051
  s
11014
11052
  ]);
11015
11053
  let A = (e) => {
11016
- e.key === "Enter" && (Lg || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
11054
+ e.key === "Enter" && (Bg || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
11017
11055
  }, 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;
11018
11056
  return /* @__PURE__ */ _("div", {
11019
11057
  style: {
@@ -11108,7 +11146,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11108
11146
  background: "rgba(59,130,246,0.08)",
11109
11147
  color: "var(--flowengage-primary)"
11110
11148
  },
11111
- children: /* @__PURE__ */ g(fg, { size: 13 })
11149
+ children: /* @__PURE__ */ g(hg, { size: 13 })
11112
11150
  }), /* @__PURE__ */ g("span", { children: "Please provide your email address so we can help you." })]
11113
11151
  })
11114
11152
  }),
@@ -11148,7 +11186,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11148
11186
  overflow: "hidden",
11149
11187
  textOverflow: "ellipsis"
11150
11188
  },
11151
- children: Mg(S)
11189
+ children: Fg(S)
11152
11190
  }),
11153
11191
  /* @__PURE__ */ g("div", {
11154
11192
  style: {
@@ -11156,7 +11194,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11156
11194
  color: "#6b7280",
11157
11195
  marginTop: "2px"
11158
11196
  },
11159
- children: jg(S.size)
11197
+ children: Pg(S.size)
11160
11198
  })
11161
11199
  ]
11162
11200
  }), /* @__PURE__ */ g("button", {
@@ -11201,7 +11239,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11201
11239
  j ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
11202
11240
  ref: D,
11203
11241
  type: "file",
11204
- accept: Og,
11242
+ accept: jg,
11205
11243
  style: { display: "none" },
11206
11244
  onChange: (e) => {
11207
11245
  let t = e.target.files?.[0];
@@ -11233,7 +11271,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11233
11271
  onMouseLeave: (e) => {
11234
11272
  e.currentTarget.style.opacity = "1";
11235
11273
  },
11236
- children: /* @__PURE__ */ g(pg, {
11274
+ children: /* @__PURE__ */ g(gg, {
11237
11275
  size: 16,
11238
11276
  color: "currentColor"
11239
11277
  })
@@ -11314,7 +11352,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11314
11352
  onMouseLeave: (e) => {
11315
11353
  e.currentTarget.style.opacity = "1";
11316
11354
  },
11317
- children: /* @__PURE__ */ g(cg, { size: 16 })
11355
+ children: /* @__PURE__ */ g(dg, { size: 16 })
11318
11356
  })
11319
11357
  ]
11320
11358
  }),
@@ -11377,7 +11415,7 @@ function Rg({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
11377
11415
  }
11378
11416
  //#endregion
11379
11417
  //#region src/components/StatusBanners.jsx
11380
- function zg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
11418
+ function Hg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
11381
11419
  return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
11382
11420
  style: {
11383
11421
  margin: "0 20px 10px",
@@ -11390,7 +11428,7 @@ function zg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
11390
11428
  gap: "10px"
11391
11429
  },
11392
11430
  children: [
11393
- /* @__PURE__ */ g(dg, { className: "" }),
11431
+ /* @__PURE__ */ g(mg, { className: "" }),
11394
11432
  /* @__PURE__ */ g("span", {
11395
11433
  style: {
11396
11434
  fontSize: "12px",
@@ -11436,13 +11474,13 @@ function zg({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
11436
11474
  }
11437
11475
  //#endregion
11438
11476
  //#region src/components/AnimatedOrb.jsx
11439
- var Bg = [
11477
+ var Ug = [
11440
11478
  "#135bd8",
11441
11479
  "#ef334b",
11442
11480
  "#ffbd2e"
11443
11481
  ];
11444
- function Vg(e) {
11445
- return !Array.isArray(e) || e.length === 0 ? Bg : e.length === 1 ? [
11482
+ function Wg(e) {
11483
+ return !Array.isArray(e) || e.length === 0 ? Ug : e.length === 1 ? [
11446
11484
  e[0],
11447
11485
  e[0],
11448
11486
  e[0]
@@ -11456,7 +11494,7 @@ function Vg(e) {
11456
11494
  e[2]
11457
11495
  ];
11458
11496
  }
11459
- var Hg = {
11497
+ var Gg = {
11460
11498
  idle: 3,
11461
11499
  listening: .75,
11462
11500
  thinking: 1,
@@ -11464,7 +11502,7 @@ var Hg = {
11464
11502
  muted: .75,
11465
11503
  error: .08
11466
11504
  };
11467
- function Ug(e) {
11505
+ function Kg(e) {
11468
11506
  if (!e || typeof e != "string") return [
11469
11507
  0,
11470
11508
  0,
@@ -11477,14 +11515,14 @@ function Ug(e) {
11477
11515
  parseInt(n.slice(4, 6), 16) / 255
11478
11516
  ];
11479
11517
  }
11480
- function Wg(e, t) {
11518
+ function qg(e, t) {
11481
11519
  if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
11482
11520
  if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
11483
11521
  let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
11484
11522
  return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
11485
11523
  }
11486
- 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";
11487
- function qg(e, t, n) {
11524
+ var Jg = "\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", Yg = "\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";
11525
+ function Xg(e, t, n) {
11488
11526
  let r = (t, n) => {
11489
11527
  let r = e.createShader(t);
11490
11528
  return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
@@ -11493,10 +11531,10 @@ function qg(e, t, n) {
11493
11531
  let o = e.createProgram();
11494
11532
  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);
11495
11533
  }
11496
- function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
11497
- let [s, l, u] = Vg(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(Hg[t] ?? .35);
11534
+ function Zg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
11535
+ let [s, l, u] = Wg(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(Gg[t] ?? .35);
11498
11536
  c(() => {
11499
- h.current = Hg[t] ?? .35;
11537
+ h.current = Gg[t] ?? .35;
11500
11538
  }, [t]), c(() => {
11501
11539
  let t = m.current;
11502
11540
  if (!t) return;
@@ -11513,7 +11551,7 @@ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11513
11551
  console.warn("[AnimatedOrb] WebGL unavailable.");
11514
11552
  return;
11515
11553
  }
11516
- let i = qg(r, Gg, Kg);
11554
+ let i = Xg(r, Jg, Yg);
11517
11555
  if (!i) {
11518
11556
  console.error("[AnimatedOrb] WebGL program failed to compile/link");
11519
11557
  return;
@@ -11543,7 +11581,7 @@ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11543
11581
  c2: r.getUniformLocation(i, "u_c2"),
11544
11582
  c3: r.getUniformLocation(i, "u_c3")
11545
11583
  };
11546
- 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);
11584
+ r.uniform3fv(c.c1, Kg(s)), r.uniform3fv(c.c2, Kg(l)), r.uniform3fv(c.c3, Kg(u)), r.viewport(0, 0, t.width, t.height);
11547
11585
  let d = performance.now(), f, p = (e) => {
11548
11586
  r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
11549
11587
  };
@@ -11574,7 +11612,7 @@ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11574
11612
  position: "absolute",
11575
11613
  inset: -10,
11576
11614
  borderRadius: "50%",
11577
- background: `radial-gradient(circle, ${Wg(s, .18)} 0%, transparent 70%)`,
11615
+ background: `radial-gradient(circle, ${qg(s, .18)} 0%, transparent 70%)`,
11578
11616
  pointerEvents: "none"
11579
11617
  },
11580
11618
  animate: { opacity: [.3, .75] },
@@ -11652,17 +11690,17 @@ function Jg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
11652
11690
  }
11653
11691
  //#endregion
11654
11692
  //#region src/components/CallScreen.jsx
11655
- 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";
11656
- function Xg(e) {
11693
+ var Qg = "\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";
11694
+ function $g(e) {
11657
11695
  let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
11658
11696
  return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
11659
11697
  }
11660
- function Zg(e) {
11698
+ function e_(e) {
11661
11699
  if (!e || typeof e != "string") return "#1a1a1a";
11662
11700
  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;
11663
11701
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
11664
11702
  }
11665
- function Qg(e, t) {
11703
+ function t_(e, t) {
11666
11704
  let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
11667
11705
  return n.length === 1 ? [
11668
11706
  `radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
@@ -11679,8 +11717,8 @@ function Qg(e, t) {
11679
11717
  "#f7f8fa"
11680
11718
  ].join(", ");
11681
11719
  }
11682
- function $g({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
11683
- let i = (t || "A")[0].toUpperCase(), a = Zg(r), o = n > 48 ? {
11720
+ function n_({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
11721
+ let i = (t || "A")[0].toUpperCase(), a = e_(r), o = n > 48 ? {
11684
11722
  boxShadow: `0 0 0 3px ${r}44`,
11685
11723
  border: "3px solid rgba(255,255,255,0.15)"
11686
11724
  } : { border: `1.5px solid ${r}55` };
@@ -11717,7 +11755,7 @@ function $g({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
11717
11755
  children: i
11718
11756
  });
11719
11757
  }
11720
- function e_(e) {
11758
+ function r_(e) {
11721
11759
  let t = p(null), n = o(() => {
11722
11760
  if (!t.current) return;
11723
11761
  let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
@@ -11764,8 +11802,8 @@ function e_(e) {
11764
11802
  n
11765
11803
  ]), c(() => () => n(), [n]), n;
11766
11804
  }
11767
- 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 = [] }) {
11768
- let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = e_(!!e), S = async () => {
11805
+ function i_({ 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 = [] }) {
11806
+ let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = r_(!!e), S = async () => {
11769
11807
  x(), await c();
11770
11808
  }, C = async () => {
11771
11809
  x(), await l();
@@ -11777,14 +11815,14 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11777
11815
  flexDirection: "column",
11778
11816
  borderRadius: "inherit",
11779
11817
  overflow: "hidden",
11780
- background: Qg(h, m),
11818
+ background: t_(h, m),
11781
11819
  animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
11782
11820
  };
11783
11821
  if (b === "incoming") {
11784
11822
  let e = Array.isArray(h) && h.length > 0 ? h : [m];
11785
11823
  return /* @__PURE__ */ _("div", {
11786
11824
  style: E,
11787
- children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
11825
+ children: [/* @__PURE__ */ g("style", { children: Qg }), /* @__PURE__ */ _("div", {
11788
11826
  style: {
11789
11827
  flex: 1,
11790
11828
  display: "flex",
@@ -11815,7 +11853,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11815
11853
  width: "96px",
11816
11854
  height: "96px",
11817
11855
  borderRadius: "50%",
11818
- background: `radial-gradient(circle, rgba(${Xg(e[0])},0.2) 0%, transparent 70%)`,
11856
+ background: `radial-gradient(circle, rgba(${$g(e[0])},0.2) 0%, transparent 70%)`,
11819
11857
  filter: "blur(10px)",
11820
11858
  zIndex: 0
11821
11859
  } }),
@@ -11832,7 +11870,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11832
11870
  animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
11833
11871
  zIndex: 1
11834
11872
  } }, n)),
11835
- /* @__PURE__ */ g($g, {
11873
+ /* @__PURE__ */ g(n_, {
11836
11874
  headshot: o,
11837
11875
  name: y,
11838
11876
  size: 82,
@@ -11912,7 +11950,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11912
11950
  e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(239,68,68,0.5)";
11913
11951
  },
11914
11952
  "aria-label": "Decline call",
11915
- children: /* @__PURE__ */ g(sg, { size: 26 })
11953
+ children: /* @__PURE__ */ g(ug, { size: 26 })
11916
11954
  }), /* @__PURE__ */ g("span", {
11917
11955
  style: {
11918
11956
  fontSize: "12px",
@@ -11953,7 +11991,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11953
11991
  e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(34,197,94,0.5)";
11954
11992
  },
11955
11993
  "aria-label": "Accept call",
11956
- children: /* @__PURE__ */ g(ug, {})
11994
+ children: /* @__PURE__ */ g(pg, {})
11957
11995
  }), /* @__PURE__ */ g("span", {
11958
11996
  style: {
11959
11997
  fontSize: "12px",
@@ -11970,7 +12008,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11970
12008
  }
11971
12009
  return b === "connecting" ? /* @__PURE__ */ _("div", {
11972
12010
  style: E,
11973
- children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
12011
+ children: [/* @__PURE__ */ g("style", { children: Qg }), /* @__PURE__ */ _("div", {
11974
12012
  style: {
11975
12013
  flex: 1,
11976
12014
  display: "flex",
@@ -11980,7 +12018,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
11980
12018
  gap: "24px"
11981
12019
  },
11982
12020
  children: [
11983
- /* @__PURE__ */ g($g, {
12021
+ /* @__PURE__ */ g(n_, {
11984
12022
  headshot: o,
11985
12023
  name: y,
11986
12024
  size: 64,
@@ -12007,7 +12045,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12007
12045
  }) : /* @__PURE__ */ _("div", {
12008
12046
  style: E,
12009
12047
  children: [
12010
- /* @__PURE__ */ g("style", { children: Yg }),
12048
+ /* @__PURE__ */ g("style", { children: Qg }),
12011
12049
  /* @__PURE__ */ _("div", {
12012
12050
  style: {
12013
12051
  display: "flex",
@@ -12053,7 +12091,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12053
12091
  children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
12054
12092
  })
12055
12093
  }),
12056
- /* @__PURE__ */ g(Jg, {
12094
+ /* @__PURE__ */ g(Zg, {
12057
12095
  colors: h,
12058
12096
  size: 36,
12059
12097
  voiceState: w
@@ -12104,7 +12142,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12104
12142
  gap: "16px",
12105
12143
  padding: "0 24px 16px"
12106
12144
  },
12107
- children: [/* @__PURE__ */ g($g, {
12145
+ children: [/* @__PURE__ */ g(n_, {
12108
12146
  headshot: o,
12109
12147
  name: y,
12110
12148
  size: 116,
@@ -12159,7 +12197,7 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12159
12197
  transition: "all 0.2s ease"
12160
12198
  },
12161
12199
  "aria-label": i ? "Unmute" : "Mute",
12162
- children: [g(i ? _g : og, { size: 18 }), i ? "Unmute" : "Mute"]
12200
+ children: [g(i ? bg : lg, { size: 18 }), i ? "Unmute" : "Mute"]
12163
12201
  }), /* @__PURE__ */ _("button", {
12164
12202
  type: "button",
12165
12203
  onClick: u,
@@ -12187,15 +12225,15 @@ function t_({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
12187
12225
  e.currentTarget.style.background = "rgba(239,68,68,0.9)", e.currentTarget.style.transform = "scale(1)";
12188
12226
  },
12189
12227
  "aria-label": "End call",
12190
- children: [/* @__PURE__ */ g(sg, { size: 18 }), "End Call"]
12228
+ children: [/* @__PURE__ */ g(ug, { size: 18 }), "End Call"]
12191
12229
  })]
12192
12230
  })
12193
12231
  ]
12194
12232
  });
12195
12233
  }
12196
- function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
12234
+ function a_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
12197
12235
  let u = e || n || "Agent";
12198
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: Yg }), /* @__PURE__ */ _("div", {
12236
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: Qg }), /* @__PURE__ */ _("div", {
12199
12237
  role: "button",
12200
12238
  tabIndex: 0,
12201
12239
  onClick: c,
@@ -12252,7 +12290,7 @@ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12252
12290
  borderRadius: "50%",
12253
12291
  border: `1.5px solid ${l}55`
12254
12292
  } }),
12255
- /* @__PURE__ */ g($g, {
12293
+ /* @__PURE__ */ g(n_, {
12256
12294
  headshot: t,
12257
12295
  name: u,
12258
12296
  size: 38,
@@ -12336,7 +12374,7 @@ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12336
12374
  boxShadow: i ? `0 0 0 3px ${l}12` : "none"
12337
12375
  },
12338
12376
  "aria-label": i ? "Unmute" : "Mute",
12339
- children: g(i ? _g : og, { size: 15 })
12377
+ children: g(i ? bg : lg, { size: 15 })
12340
12378
  }), /* @__PURE__ */ g("button", {
12341
12379
  type: "button",
12342
12380
  onClick: (e) => {
@@ -12364,7 +12402,7 @@ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12364
12402
  transition: "all 0.18s ease"
12365
12403
  },
12366
12404
  "aria-label": "End call",
12367
- children: /* @__PURE__ */ g(sg, { size: 16 })
12405
+ children: /* @__PURE__ */ g(ug, { size: 16 })
12368
12406
  })]
12369
12407
  })
12370
12408
  ]
@@ -12372,7 +12410,7 @@ function n_({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
12372
12410
  }
12373
12411
  //#endregion
12374
12412
  //#region src/utils/voicePriorContext.js
12375
- function r_(e, t = {}) {
12413
+ function o_(e, t = {}) {
12376
12414
  let n = t.maxChars ?? 4500;
12377
12415
  if (!Array.isArray(e) || e.length === 0) return "";
12378
12416
  let r = [];
@@ -12389,24 +12427,24 @@ function r_(e, t = {}) {
12389
12427
  }
12390
12428
  //#endregion
12391
12429
  //#region src/utils/voiceClientTools.js
12392
- var i_ = /^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i;
12393
- function a_(e) {
12394
- return String(e || "").replace(i_, "").replace(/\/+$/, "").toLowerCase() || "/";
12430
+ var s_ = /^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i;
12431
+ function c_(e) {
12432
+ return String(e || "").replace(s_, "").replace(/\/+$/, "").toLowerCase() || "/";
12395
12433
  }
12396
- function o_(e, t) {
12397
- return a_(e) === a_(t);
12434
+ function l_(e, t) {
12435
+ return c_(e) === c_(t);
12398
12436
  }
12399
12437
  function $(...e) {
12400
12438
  An() && console.log("[FlowEngage:voice-tools]", ...e);
12401
12439
  }
12402
- function s_(e) {
12440
+ function u_(e) {
12403
12441
  try {
12404
12442
  let t = e.ownerDocument?.defaultView;
12405
12443
  if (t) return t.getComputedStyle(e);
12406
12444
  } catch {}
12407
12445
  return window.getComputedStyle(e);
12408
12446
  }
12409
- function c_(e) {
12447
+ function d_(e) {
12410
12448
  let t = /* @__PURE__ */ new Set();
12411
12449
  function n(r) {
12412
12450
  if (!r || t.has(r)) return;
@@ -12419,10 +12457,10 @@ function c_(e) {
12419
12457
  }
12420
12458
  typeof document < "u" && n(document);
12421
12459
  }
12422
- function l_(e) {
12460
+ function f_(e) {
12423
12461
  return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
12424
12462
  }
12425
- function u_(e) {
12463
+ function p_(e) {
12426
12464
  let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
12427
12465
  if (n) {
12428
12466
  let e = n.trim().split(/\s+/).filter(Boolean), r = [];
@@ -12430,40 +12468,40 @@ function u_(e) {
12430
12468
  let e = t.getElementById(n);
12431
12469
  e?.textContent && r.push(e.textContent.trim());
12432
12470
  } catch {}
12433
- if (r.length) return l_(r.join(" "));
12471
+ if (r.length) return f_(r.join(" "));
12434
12472
  }
12435
- if (e.labels && e.labels.length) return l_(e.labels[0].textContent);
12473
+ if (e.labels && e.labels.length) return f_(e.labels[0].textContent);
12436
12474
  let r = e.id;
12437
12475
  if (r) try {
12438
12476
  let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
12439
- if (e) return l_(e.textContent);
12477
+ if (e) return f_(e.textContent);
12440
12478
  } catch {
12441
12479
  let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
12442
- if (e) return l_(e.textContent);
12480
+ if (e) return f_(e.textContent);
12443
12481
  }
12444
12482
  let i = e.previousElementSibling;
12445
12483
  for (let e = 0; e < 6 && i; e += 1) {
12446
- if (i.tagName === "LABEL") return l_(i.textContent);
12484
+ if (i.tagName === "LABEL") return f_(i.textContent);
12447
12485
  let e = (i.className || "").toString().toLowerCase();
12448
12486
  if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
12449
- let e = l_(i.textContent);
12487
+ let e = f_(i.textContent);
12450
12488
  if (e) return e;
12451
12489
  }
12452
12490
  i = i.previousElementSibling;
12453
12491
  }
12454
12492
  let a = e.parentElement;
12455
12493
  for (let e = 0; e < 5 && a; e += 1) {
12456
- if (a.tagName === "LABEL") return l_(a.textContent);
12494
+ if (a.tagName === "LABEL") return f_(a.textContent);
12457
12495
  let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
12458
- if (e?.textContent) return l_(e.textContent);
12496
+ if (e?.textContent) return f_(e.textContent);
12459
12497
  a = a.parentElement;
12460
12498
  }
12461
12499
  let o = e.getAttribute("aria-label");
12462
- return o ? l_(o) : null;
12500
+ return o ? f_(o) : null;
12463
12501
  }
12464
- function d_() {
12502
+ function m_() {
12465
12503
  let e = [];
12466
- return c_((t) => {
12504
+ return d_((t) => {
12467
12505
  e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
12468
12506
  if (In(e)) return !1;
12469
12507
  let t = (e.type || "").toLowerCase();
@@ -12474,15 +12512,15 @@ function d_() {
12474
12512
  "image"
12475
12513
  ].includes(t) || e.disabled || e.readOnly) return !1;
12476
12514
  try {
12477
- let t = s_(e);
12515
+ let t = u_(e);
12478
12516
  if (t.display === "none" || t.visibility === "hidden") return !1;
12479
12517
  } catch {}
12480
12518
  return !0;
12481
12519
  }));
12482
12520
  }), e;
12483
12521
  }
12484
- function f_() {
12485
- return d_().map((e, t) => {
12522
+ function h_() {
12523
+ return m_().map((e, t) => {
12486
12524
  let n = {
12487
12525
  formIndex: 0,
12488
12526
  fieldIndex: t,
@@ -12490,7 +12528,7 @@ function f_() {
12490
12528
  type: e.type || "text",
12491
12529
  name: e.name || null,
12492
12530
  id: e.id || null,
12493
- label: u_(e),
12531
+ label: p_(e),
12494
12532
  placeholder: e.placeholder || null
12495
12533
  };
12496
12534
  return e.tagName === "SELECT" && (n.options = Array.from(e.options).filter((e) => e.value !== "" && !e.disabled).map((e) => ({
@@ -12499,13 +12537,13 @@ function f_() {
12499
12537
  })), n.currentValue = e.value || null), n;
12500
12538
  });
12501
12539
  }
12502
- function p_() {
12540
+ function g_() {
12503
12541
  let e = [];
12504
- return c_((t) => {
12542
+ return d_((t) => {
12505
12543
  e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
12506
12544
  if (In(e) || e.disabled) return !1;
12507
12545
  try {
12508
- let t = s_(e);
12546
+ let t = u_(e);
12509
12547
  if (t.display === "none" || t.visibility === "hidden") return !1;
12510
12548
  } catch {}
12511
12549
  return !0;
@@ -12517,7 +12555,7 @@ function p_() {
12517
12555
  type: e.type || e.tagName
12518
12556
  }));
12519
12557
  }
12520
- function m_(e, t) {
12558
+ function __(e, t) {
12521
12559
  try {
12522
12560
  if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
12523
12561
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
@@ -12532,7 +12570,7 @@ function m_(e, t) {
12532
12570
  return Infinity;
12533
12571
  }
12534
12572
  }
12535
- function h_(e, t) {
12573
+ function v_(e, t) {
12536
12574
  let n = String(t || "").toLowerCase().trim();
12537
12575
  if (!n) return 0;
12538
12576
  let r = (e.innerText || e.textContent || "").replace(/\s+/g, " ").trim(), i = [
@@ -12550,21 +12588,21 @@ function h_(e, t) {
12550
12588
  for (let e of a) i.includes(e) && (o += 1);
12551
12589
  return o / a.length * 92;
12552
12590
  }
12553
- function g_(e, t, n = 6) {
12591
+ function y_(e, t, n = 6) {
12554
12592
  let r = String(t || "").toLowerCase().trim();
12555
12593
  if (!r) return !1;
12556
12594
  let i = e;
12557
12595
  for (let e = 0; e < n && i && (i = i.parentElement, i); e++) if ((i.innerText || i.textContent || "").toLowerCase().includes(r)) return !0;
12558
12596
  return !1;
12559
12597
  }
12560
- function __(e, t, n) {
12598
+ function b_(e, t, n) {
12561
12599
  let r = [];
12562
- c_((e) => {
12600
+ d_((e) => {
12563
12601
  let t = Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"], a[href]"));
12564
12602
  r.push(...t.filter((e) => {
12565
12603
  if (In(e) || e.disabled) return !1;
12566
12604
  try {
12567
- let t = s_(e);
12605
+ let t = u_(e);
12568
12606
  if (t.display === "none" || t.visibility === "hidden" || t.opacity === "0") return !1;
12569
12607
  } catch {}
12570
12608
  return !0;
@@ -12572,14 +12610,14 @@ function __(e, t, n) {
12572
12610
  });
12573
12611
  let i = 0, a = r.map((t) => ({
12574
12612
  el: t,
12575
- s: h_(t, e)
12613
+ s: v_(t, e)
12576
12614
  }));
12577
12615
  for (let { s: e } of a) e > i && (i = e);
12578
12616
  if (i < 28) return null;
12579
12617
  let o = a.filter(({ s: e }) => e === i).map(({ el: e }) => e);
12580
12618
  if (o.length === 1) return o[0];
12581
12619
  if (n) {
12582
- let e = o.filter((e) => g_(e, n));
12620
+ let e = o.filter((e) => y_(e, n));
12583
12621
  if (e.length === 1) return e[0];
12584
12622
  e.length > 1 && (o = e);
12585
12623
  }
@@ -12587,14 +12625,14 @@ function __(e, t, n) {
12587
12625
  if (s.length) {
12588
12626
  let e = o[0], t = Infinity;
12589
12627
  for (let n of o) for (let r of s) {
12590
- let i = m_(n, r);
12628
+ let i = __(n, r);
12591
12629
  i < t && (t = i, e = n);
12592
12630
  }
12593
12631
  return e;
12594
12632
  }
12595
12633
  return o[0];
12596
12634
  }
12597
- function v_(e) {
12635
+ function x_(e) {
12598
12636
  if (e == null) return {};
12599
12637
  if (typeof e == "string") {
12600
12638
  let t = e.trim();
@@ -12607,12 +12645,12 @@ function v_(e) {
12607
12645
  }
12608
12646
  return e;
12609
12647
  }
12610
- function y_(e) {
12648
+ function S_(e) {
12611
12649
  if (!e || typeof e != "object") return null;
12612
12650
  let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
12613
12651
  return t == null ? null : String(t).trim() || null;
12614
12652
  }
12615
- function b_() {
12653
+ function C_() {
12616
12654
  let e = {};
12617
12655
  document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
12618
12656
  if (t.id) return;
@@ -12627,7 +12665,7 @@ function b_() {
12627
12665
  e[r] = !0, t.id = r;
12628
12666
  });
12629
12667
  }
12630
- function x_() {
12668
+ function w_() {
12631
12669
  let e = (e) => {
12632
12670
  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;
12633
12671
  for (; r < t.length;) {
@@ -12682,7 +12720,7 @@ function x_() {
12682
12720
  containerHeadings: o
12683
12721
  };
12684
12722
  }
12685
- function S_(e) {
12723
+ function T_(e) {
12686
12724
  if (!e || typeof document > "u") return "";
12687
12725
  let t = new Set([
12688
12726
  "script",
@@ -12768,11 +12806,11 @@ function S_(e) {
12768
12806
  return d.has(t) ? !1 : (d.add(t), !0);
12769
12807
  }).join("\n").replace(/\n{3,}/g, "\n\n").trim();
12770
12808
  }
12771
- function C_(e) {
12809
+ function E_(e) {
12772
12810
  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 = {
12773
12811
  "fwh-navigate-mvp": async (n) => {
12774
12812
  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.";
12775
- 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 : [];
12813
+ let a = x_(n), o = S_(a), s = a.section_text ?? a.sectionText ?? a.section, c = Array.isArray(a.expected_landmarks) ? a.expected_landmarks : Array.isArray(a.expectedLandmarks) ? a.expectedLandmarks : [];
12776
12814
  if ($("fwh-navigate-mvp · coerced:", {
12777
12815
  url: o,
12778
12816
  sectionText: s,
@@ -12812,14 +12850,14 @@ function C_(e) {
12812
12850
  correctedUrl: u
12813
12851
  }), o = u);
12814
12852
  try {
12815
- Ph(`Navigating to ${o}...`, { spinner: !0 }), Yh(), Pn();
12853
+ Ph(`Navigating to ${o}...`, { spinner: !0 }), Qh(), Pn();
12816
12854
  try {
12817
12855
  i?.();
12818
12856
  } catch {}
12819
12857
  try {
12820
12858
  let e = r ? r() : "";
12821
12859
  if (e && t) {
12822
- let n = r_([{
12860
+ let n = o_([{
12823
12861
  sender: "user",
12824
12862
  message: e
12825
12863
  }]);
@@ -12854,8 +12892,8 @@ function C_(e) {
12854
12892
  typeof window < "u" && window.scrollTo(0, 0);
12855
12893
  } catch {}
12856
12894
  let a = [], s = null, c = "", l = Date.now() + 12e3;
12857
- for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: a, pageTitleHeading: s, introText: c} = x_(), !(a.length >= 1)););
12858
- b_(), $("fwh-navigate-mvp → page headings collected:", a, "titleHeading:", s);
12895
+ for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: a, pageTitleHeading: s, introText: c} = w_(), !(a.length >= 1)););
12896
+ C_(), $("fwh-navigate-mvp → page headings collected:", a, "titleHeading:", s);
12859
12897
  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 = "";
12860
12898
  try {
12861
12899
  if (a.length > 0) {
@@ -12863,7 +12901,7 @@ function C_(e) {
12863
12901
  for (let n of e) {
12864
12902
  let e = mr(null, n);
12865
12903
  if (e) {
12866
- let r = S_(e).substring(0, 800);
12904
+ let r = T_(e).substring(0, 800);
12867
12905
  r && t.push(`[Section: ${n}] ${r}`);
12868
12906
  }
12869
12907
  }
@@ -12872,13 +12910,13 @@ function C_(e) {
12872
12910
  } catch {}
12873
12911
  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.`;
12874
12912
  let m = Date.now() + 4e3, h = typeof window < "u" ? window.location.pathname : r;
12875
- for (; Date.now() < m && !o_(h, e) && o_(h, t);) await new Promise((e) => setTimeout(e, 120)), h = window.location.pathname;
12913
+ for (; Date.now() < m && !l_(h, e) && l_(h, t);) await new Promise((e) => setTimeout(e, 120)), h = window.location.pathname;
12876
12914
  $("fwh-navigate-mvp route settle:", {
12877
12915
  startPath: t,
12878
12916
  targetPath: e,
12879
12917
  settledPath: h
12880
12918
  });
12881
- 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;
12919
+ 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 = l_(h, e), y = !l_(h, t), b = v || y;
12882
12920
  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.`);
12883
12921
  } catch {}
12884
12922
  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.";
@@ -12890,39 +12928,39 @@ function C_(e) {
12890
12928
  duration: 1800
12891
12929
  }), t;
12892
12930
  } finally {
12893
- Xh(), Fh(900);
12931
+ $h(), Fh(900);
12894
12932
  }
12895
12933
  },
12896
12934
  "fwh-highlight-mvp": async (e) => {
12897
12935
  $("fwh-highlight-mvp ▶", e);
12898
- let t = v_(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
12936
+ let t = x_(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
12899
12937
  if (Wn(3e3), typeof window < "u" && window.__fe_user_nav_during_speech) {
12900
12938
  let e = window.__fe_user_nav_during_speech, t = window.location.pathname;
12901
12939
  if (Date.now() - e.ts >= 3e4) window.__fe_user_nav_during_speech = null;
12902
12940
  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.`;
12903
12941
  }
12904
- b_();
12942
+ C_();
12905
12943
  let i = ((e) => e && e.replace(/^\d+\.\s*/, "").replace(/^["']|["']$/g, "").trim())(r), a = mr(n || null, i || null);
12906
12944
  if (!a && i) {
12907
12945
  let e = Date.now() + 600;
12908
- for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), b_(), a = mr(null, i);
12946
+ for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), C_(), a = mr(null, i);
12909
12947
  }
12910
12948
  if (!a) {
12911
12949
  $("fwh-highlight-mvp ✖ no element for:", i || n);
12912
- 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.";
12950
+ let { headings: e } = w_(), 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.";
12913
12951
  return `HIGHLIGHT_NOT_FOUND: "${i || n}" on the current page. ${t}`;
12914
12952
  }
12915
12953
  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.`;
12916
12954
  },
12917
12955
  "fwh-read-content-mvp": async (e) => {
12918
12956
  $("fwh-read-content-mvp ▶", e);
12919
- let t = v_(e), n = t?.section_text || t?.sectionText || "";
12957
+ let t = x_(e), n = t?.section_text || t?.sectionText || "";
12920
12958
  try {
12921
12959
  let e = "";
12922
12960
  if (n) {
12923
12961
  let t = mr(null, n);
12924
12962
  if (!t) return `Could not find section "${n}" on the page.`;
12925
- e = S_(t);
12963
+ e = T_(t);
12926
12964
  } else {
12927
12965
  let t = (document.querySelector("main") || document.querySelector("article") || document.querySelector("[role=\"main\"]") || document.querySelector("#content") || document.querySelector(".content") || document.body).cloneNode(!0);
12928
12966
  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();
@@ -12934,7 +12972,7 @@ function C_(e) {
12934
12972
  },
12935
12973
  "fwh-page-content-mvp": async (e) => {
12936
12974
  $("fwh-page-content-mvp ▶", e);
12937
- let r = v_(e), i = r?.url || r?.page_url || "";
12975
+ let r = x_(e), i = r?.url || r?.page_url || "";
12938
12976
  if ($("fwh-page-content-mvp · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("fwh-page-content-mvp ✖ missing url"), "Missing url parameter.";
12939
12977
  if (!t) return $("fwh-page-content-mvp ✖ no siteId"), "Site is not configured.";
12940
12978
  if (!n) return $("fwh-page-content-mvp ✖ no api base"), "API base URL is missing; cannot fetch page content.";
@@ -12966,7 +13004,7 @@ function C_(e) {
12966
13004
  },
12967
13005
  "fwh-search-mvp": async (e) => {
12968
13006
  $("fwh-search-mvp ▶", e);
12969
- let r = v_(e).query;
13007
+ let r = x_(e).query;
12970
13008
  if (!r) return $("fwh-search-mvp ✖ missing query"), "Missing query parameter.";
12971
13009
  if (!t) return $("fwh-search-mvp ✖ no siteId"), "Search unavailable (no siteId configured).";
12972
13010
  if (!n) return $("fwh-search-mvp ✖ no api base"), "Search unavailable (no API base URL).";
@@ -13004,7 +13042,7 @@ function C_(e) {
13004
13042
  "[class*='menu'] a",
13005
13043
  "[class*='header'] a"
13006
13044
  ];
13007
- if (c_((t) => {
13045
+ if (d_((t) => {
13008
13046
  for (let r of n) try {
13009
13047
  t.querySelectorAll(r).forEach((t) => {
13010
13048
  if (In(t)) return;
@@ -13012,7 +13050,7 @@ function C_(e) {
13012
13050
  if (!r || !n || n === "#" || n.startsWith("javascript:")) return;
13013
13051
  try {
13014
13052
  let e = t.parentElement;
13015
- if (e && s_(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
13053
+ if (e && u_(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
13016
13054
  } catch {}
13017
13055
  let i = r.toLowerCase() + "|" + n;
13018
13056
  e.has(i) || e.set(i, {
@@ -13023,7 +13061,7 @@ function C_(e) {
13023
13061
  } catch {}
13024
13062
  t.querySelectorAll("select").forEach((t) => {
13025
13063
  if (In(t)) return;
13026
- let n = u_(t);
13064
+ let n = p_(t);
13027
13065
  /nav|menu|page|section|go to/i.test(n || t.name || t.id || "") && Array.from(t.options).forEach((r) => {
13028
13066
  if (!r.value || r.disabled) return;
13029
13067
  let i = r.text.trim();
@@ -13047,7 +13085,7 @@ function C_(e) {
13047
13085
  if ($("fwh-get-current-page-mvp ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
13048
13086
  let e = window.location.href, t = window.location.pathname, n = document.title || "";
13049
13087
  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.`;
13050
- let { headings: r, pageTitleHeading: i, introText: a } = x_();
13088
+ let { headings: r, pageTitleHeading: i, introText: a } = w_();
13051
13089
  $("fwh-get-current-page-mvp ✓", {
13052
13090
  url: e,
13053
13091
  path: t,
@@ -13059,7 +13097,7 @@ function C_(e) {
13059
13097
  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. ***`;
13060
13098
  },
13061
13099
  "fwh-list-forms-mvp": async () => {
13062
- let e = f_(), t = p_();
13100
+ let e = h_(), t = g_();
13063
13101
  $("fwh-list-forms-mvp ✓", `${e.length} field(s)`, `${t.length} button(s)`);
13064
13102
  let n = e.map((e) => ({
13065
13103
  ...e,
@@ -13073,9 +13111,9 @@ function C_(e) {
13073
13111
  },
13074
13112
  "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.",
13075
13113
  "fwh-click-button-mvp": async (e) => {
13076
- let t = v_(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
13114
+ let t = x_(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
13077
13115
  if ($("fwh-click-button-mvp ▶", n, r ? `(card_context: ${r})` : ""), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
13078
- let i = __(n, a, r);
13116
+ let i = b_(n, a, r);
13079
13117
  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.`;
13080
13118
  try {
13081
13119
  Ph(`Clicking ${n}...`, { spinner: !0 });
@@ -13087,7 +13125,7 @@ function C_(e) {
13087
13125
  } catch {
13088
13126
  i.scrollIntoView(!0);
13089
13127
  }
13090
- await tg(i), i.focus?.(), await rg(i), ig(i), i.click();
13128
+ await ig(i), i.focus?.(), await og(i), sg(i), i.click();
13091
13129
  let e = (i.textContent || i.value || i.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
13092
13130
  return $("fwh-click-button-mvp ✓", t), Ph(`Clicked ${e}`, {
13093
13131
  spinner: !1,
@@ -13102,7 +13140,7 @@ function C_(e) {
13102
13140
  duration: 1800
13103
13141
  }), t;
13104
13142
  } finally {
13105
- ng(), Fh(700);
13143
+ ag(), Fh(700);
13106
13144
  }
13107
13145
  },
13108
13146
  "fwh-cart-get-mvp": async () => {
@@ -13215,10 +13253,10 @@ function C_(e) {
13215
13253
  clickPageButton: o["fwh-click-button-mvp"]
13216
13254
  };
13217
13255
  }
13218
- 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;
13219
- function T_() {
13256
+ var D_ = /^(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;
13257
+ function O_() {
13220
13258
  try {
13221
- 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()));
13259
+ let { headings: e, pageTitleHeading: t, containerHeadings: n } = w_(), 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) => !D_.test(e.trim())), a = i.filter((e) => !r.has(e.trim()));
13222
13260
  return a.length ? a : i;
13223
13261
  } catch {
13224
13262
  return [];
@@ -13226,7 +13264,7 @@ function T_() {
13226
13264
  }
13227
13265
  //#endregion
13228
13266
  //#region src/utils/wrapVoiceToolsForLogging.js
13229
- function E_(e) {
13267
+ function k_(e) {
13230
13268
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
13231
13269
  let r = An();
13232
13270
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
@@ -13243,11 +13281,11 @@ function E_(e) {
13243
13281
  }
13244
13282
  //#endregion
13245
13283
  //#region src/components/FlowEngageWidget.jsx
13246
- var D_ = "[PAGE_CONTEXT]";
13247
- function O_(e, t, n) {
13248
- 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.`;
13284
+ var A_ = "[PAGE_CONTEXT]";
13285
+ function j_(e, t, n) {
13286
+ return `${A_} 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.`;
13249
13287
  }
13250
- var k_ = {
13288
+ var M_ = {
13251
13289
  blue: "#135bd8",
13252
13290
  red: "#ef334b",
13253
13291
  yellow: "#ffbd2e",
@@ -13255,7 +13293,7 @@ var k_ = {
13255
13293
  highlight: "rgba(255,255,255,0.9)",
13256
13294
  green: "#10b981"
13257
13295
  };
13258
- function A_(e) {
13296
+ function N_(e) {
13259
13297
  if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
13260
13298
  let [t, n, r] = e;
13261
13299
  return e.length >= 3 && r ? [
@@ -13269,12 +13307,12 @@ function A_(e) {
13269
13307
  "#f7f8fa"
13270
13308
  ].join(", ");
13271
13309
  }
13272
- function j_(e) {
13310
+ function P_(e) {
13273
13311
  if (!e || typeof e != "string") return "#1a1a1a";
13274
13312
  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;
13275
13313
  return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
13276
13314
  }
13277
- function M_(t) {
13315
+ function F_(t) {
13278
13316
  let [n, r] = e.useState(null), i = typeof t == "string" ? t.trim() : "";
13279
13317
  return e.useEffect(() => {
13280
13318
  if (!i) {
@@ -13292,8 +13330,8 @@ function M_(t) {
13292
13330
  };
13293
13331
  }, [i]), n;
13294
13332
  }
13295
- function N_({ logo: t, style: n }) {
13296
- let r = M_(typeof t == "string" ? t : null);
13333
+ function I_({ logo: t, style: n }) {
13334
+ let r = F_(typeof t == "string" ? t : null);
13297
13335
  if (!t) return null;
13298
13336
  if (typeof t == "string") return r ? /* @__PURE__ */ g("img", {
13299
13337
  src: r,
@@ -13318,7 +13356,7 @@ function N_({ logo: t, style: n }) {
13318
13356
  children: i
13319
13357
  }) : null;
13320
13358
  }
13321
- function P_({ title: e }) {
13359
+ function L_({ title: e }) {
13322
13360
  return /* @__PURE__ */ g("div", {
13323
13361
  style: {
13324
13362
  width: "100%",
@@ -13336,18 +13374,18 @@ function P_({ title: e }) {
13336
13374
  children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
13337
13375
  });
13338
13376
  }
13339
- function F_(e, t) {
13377
+ function R_(e, t) {
13340
13378
  let n = (t || "").trim();
13341
13379
  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;
13342
13380
  }
13343
- function I_({ orbColors: e, ...t }) {
13344
- return /* @__PURE__ */ g(Jg, {
13381
+ function z_({ orbColors: e, ...t }) {
13382
+ return /* @__PURE__ */ g(Zg, {
13345
13383
  colors: e,
13346
13384
  ...t
13347
13385
  });
13348
13386
  }
13349
- function L_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
13350
- let s = n || k_.green, c = j_(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
13387
+ function B_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
13388
+ let s = n || M_.green, c = P_(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
13351
13389
  style: {
13352
13390
  display: "flex",
13353
13391
  alignItems: a ? "flex-end" : "center",
@@ -13473,7 +13511,7 @@ function L_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
13473
13511
  delay: 0
13474
13512
  },
13475
13513
  style: { flexShrink: 0 },
13476
- children: /* @__PURE__ */ g(I_, {
13514
+ children: /* @__PURE__ */ g(z_, {
13477
13515
  size: l,
13478
13516
  orbColors: t
13479
13517
  })
@@ -13505,8 +13543,8 @@ function L_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
13505
13543
  children: u
13506
13544
  })] });
13507
13545
  }
13508
- function R_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
13509
- let c = n || k_.green, l = j_(c);
13546
+ function V_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
13547
+ let c = n || M_.green, l = P_(c);
13510
13548
  return /* @__PURE__ */ _(oh.div, {
13511
13549
  initial: {
13512
13550
  scale: 50 / 350,
@@ -13577,7 +13615,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
13577
13615
  children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
13578
13616
  })
13579
13617
  }),
13580
- /* @__PURE__ */ g(I_, {
13618
+ /* @__PURE__ */ g(z_, {
13581
13619
  size: 72,
13582
13620
  orbColors: t
13583
13621
  }),
@@ -13657,7 +13695,7 @@ function R_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
13657
13695
  ]
13658
13696
  });
13659
13697
  }
13660
- 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" }) {
13698
+ function H_({ 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" }) {
13661
13699
  c(() => (console.log("[FlowEngage:VoiceDebug] 🔵 VoiceMode MOUNTED"), () => console.log("[FlowEngage:VoiceDebug] 🔴 VoiceMode UNMOUNTED")), []);
13662
13700
  let [D, O] = m("idle"), [k, A] = m(!1), [ee, te] = m(!1), [ne, j] = m(() => ce(i) === "auto"), M = () => {
13663
13701
  let e = ne ? "ask" : "auto";
@@ -13744,7 +13782,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13744
13782
  Pn();
13745
13783
  } catch {}
13746
13784
  try {
13747
- Gh();
13785
+ Jh();
13748
13786
  } catch {}
13749
13787
  if (i) try {
13750
13788
  Le(i);
@@ -13792,7 +13830,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13792
13830
  if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
13793
13831
  l.current = [], Ce.current = "", Oe.current = !1, je.current = !1, Me.current = !1, Ne.current = "minimized", Nr({ onBeforeNavigate: () => {
13794
13832
  if (i && l.current.length > 0) try {
13795
- let e = r_(l.current);
13833
+ let e = o_(l.current);
13796
13834
  e && Te(i, e);
13797
13835
  } catch {}
13798
13836
  if (!$n()) {
@@ -13814,7 +13852,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13814
13852
  }
13815
13853
  ke();
13816
13854
  } });
13817
- let t = E_(C_({
13855
+ let t = k_(E_({
13818
13856
  siteId: i || null,
13819
13857
  apiBaseUrl: a || null,
13820
13858
  chatId: s || null,
@@ -13876,7 +13914,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13876
13914
  e || Ue("minimized");
13877
13915
  },
13878
13916
  onPanel: ({ title: t, items: n }) => {
13879
- e || Wh(n, {
13917
+ e || Kh(n, {
13880
13918
  title: t || "Products",
13881
13919
  side: f === "bottom-left" ? "left" : "right",
13882
13920
  productUrl: (e) => e.handle ? `${window.location.origin}/products/${encodeURIComponent(e.handle)}` : null
@@ -13939,7 +13977,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13939
13977
  onMessage: (t) => {
13940
13978
  if (e || pe.current && t.role !== "user" && !/email/i.test(String(t.message || ""))) return;
13941
13979
  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 || ""));
13942
- 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`);
13980
+ 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 = O_(), 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`);
13943
13981
  else if (!n && t.role === "user" && he.current) {
13944
13982
  let e = String(t.message || "").trim(), n = Ye(e), r = (e) => !!e && (Ke.test(e) || Je.test(e));
13945
13983
  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));
@@ -13956,10 +13994,10 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
13956
13994
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
13957
13995
  debug: t.debug
13958
13996
  }], i) try {
13959
- let e = r_(l.current);
13997
+ let e = o_(l.current);
13960
13998
  e && Te(i, e);
13961
13999
  } catch {}
13962
- if (F_(a, o)) {
14000
+ if (R_(a, o)) {
13963
14001
  ze.current = !0;
13964
14002
  return;
13965
14003
  }
@@ -14019,7 +14057,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14019
14057
  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(" | "));
14020
14058
  } catch {}
14021
14059
  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` : "";
14022
- 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));
14060
+ 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(j_(e, o, a));
14023
14061
  } catch {}
14024
14062
  if (typeof window < "u") {
14025
14063
  let t = window.location.pathname, n = Date.now(), r = (e) => {
@@ -14055,7 +14093,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14055
14093
  } catch {}
14056
14094
  else console.log("[FlowEngage] auto-nav — skipping the arrival acknowledgment turn");
14057
14095
  try {
14058
- R.current?.sendContextualUpdate?.(O_(l, f));
14096
+ R.current?.sendContextualUpdate?.(j_(l, f));
14059
14097
  } catch {}
14060
14098
  return;
14061
14099
  }
@@ -14070,7 +14108,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14070
14108
  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.]`);
14071
14109
  } catch {}
14072
14110
  try {
14073
- R.current?.sendContextualUpdate?.(O_(l, f));
14111
+ R.current?.sendContextualUpdate?.(j_(l, f));
14074
14112
  } catch {}
14075
14113
  };
14076
14114
  c = window.history.pushState.bind(window.history), window.history.pushState = (...e) => {
@@ -14282,7 +14320,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14282
14320
  },
14283
14321
  children: "Muted"
14284
14322
  }),
14285
- /* @__PURE__ */ g(I_, {
14323
+ /* @__PURE__ */ g(z_, {
14286
14324
  size: 72,
14287
14325
  voiceState: D,
14288
14326
  isMuted: k,
@@ -14354,7 +14392,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14354
14392
  y2: "23"
14355
14393
  })
14356
14394
  ]
14357
- }) : /* @__PURE__ */ g(og, {
14395
+ }) : /* @__PURE__ */ g(lg, {
14358
14396
  size: 16,
14359
14397
  color: "currentColor"
14360
14398
  })
@@ -14376,7 +14414,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14376
14414
  padding: 0,
14377
14415
  flexShrink: 0
14378
14416
  },
14379
- children: /* @__PURE__ */ g(mg, {
14417
+ children: /* @__PURE__ */ g(_g, {
14380
14418
  size: 16,
14381
14419
  color: "currentColor"
14382
14420
  })
@@ -14425,7 +14463,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14425
14463
  onMouseLeave: (e) => {
14426
14464
  e.currentTarget.style.background = "none";
14427
14465
  },
14428
- children: [/* @__PURE__ */ g(hg, {}), T]
14466
+ children: [/* @__PURE__ */ g(vg, {}), T]
14429
14467
  }),
14430
14468
  i && /* @__PURE__ */ _("button", {
14431
14469
  onClick: () => M(),
@@ -14529,7 +14567,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14529
14567
  onMouseLeave: (e) => {
14530
14568
  e.currentTarget.style.background = "none";
14531
14569
  },
14532
- children: [/* @__PURE__ */ g(gg, {}), E]
14570
+ children: [/* @__PURE__ */ g(yg, {}), E]
14533
14571
  }),
14534
14572
  /* @__PURE__ */ g("button", {
14535
14573
  onClick: () => te(!1),
@@ -14581,7 +14619,7 @@ function z_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
14581
14619
  ]
14582
14620
  });
14583
14621
  }
14584
- function B_({ orbColors: e }) {
14622
+ function U_({ orbColors: e }) {
14585
14623
  let t = Array.isArray(e) && e.length > 0 ? e : [
14586
14624
  "#135bd8",
14587
14625
  "#ef334b",
@@ -14600,7 +14638,7 @@ function B_({ orbColors: e }) {
14600
14638
  `.replace(/\s+/g, " ").trim()
14601
14639
  } });
14602
14640
  }
14603
- var V_ = () => /* @__PURE__ */ g("div", {
14641
+ var W_ = () => /* @__PURE__ */ g("div", {
14604
14642
  style: {
14605
14643
  display: "flex",
14606
14644
  marginBottom: "12px",
@@ -14630,7 +14668,7 @@ var V_ = () => /* @__PURE__ */ g("div", {
14630
14668
  } }, e))
14631
14669
  })
14632
14670
  });
14633
- 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 }) {
14671
+ function G_({ 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 }) {
14634
14672
  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 = () => {
14635
14673
  let e = Ne ? "ask" : "auto";
14636
14674
  le(Me, e), Pe(e === "auto");
@@ -14773,7 +14811,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
14773
14811
  justifyContent: "center",
14774
14812
  height: "40px"
14775
14813
  },
14776
- children: i ? /* @__PURE__ */ g(N_, {
14814
+ children: i ? /* @__PURE__ */ g(I_, {
14777
14815
  logo: i,
14778
14816
  style: {
14779
14817
  height: "34px",
@@ -14786,7 +14824,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
14786
14824
  height: "40px",
14787
14825
  flexShrink: 0
14788
14826
  },
14789
- children: /* @__PURE__ */ g(P_, { title: e.chatTitle })
14827
+ children: /* @__PURE__ */ g(L_, { title: e.chatTitle })
14790
14828
  })
14791
14829
  }), o && /* @__PURE__ */ g("div", {
14792
14830
  style: {
@@ -15150,7 +15188,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15150
15188
  })
15151
15189
  ]
15152
15190
  }),
15153
- /* @__PURE__ */ g(zg, {
15191
+ /* @__PURE__ */ g(Hg, {
15154
15192
  webRTCError: oe,
15155
15193
  micError: P,
15156
15194
  setMicError: se,
@@ -15158,7 +15196,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15158
15196
  isRateLimited: E,
15159
15197
  rateLimitMessage: D
15160
15198
  }),
15161
- ge && /* @__PURE__ */ g(n_, {
15199
+ ge && /* @__PURE__ */ g(a_, {
15162
15200
  agentName: v,
15163
15201
  agentHeadshot: y,
15164
15202
  fallbackAgentName: b,
@@ -15292,17 +15330,17 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15292
15330
  children: "No previous chats found."
15293
15331
  })
15294
15332
  })]
15295
- }) : null, Ee ? /* @__PURE__ */ g(Ig, {
15333
+ }) : null, Ee ? /* @__PURE__ */ g(zg, {
15296
15334
  chatHistory: l,
15297
15335
  isAiTyping: u,
15298
15336
  isLoading: T,
15299
15337
  isAgentTyping: d,
15300
15338
  setReplyContext: N,
15301
- TypingDots: V_,
15339
+ TypingDots: W_,
15302
15340
  primaryColor: n,
15303
15341
  agentHeadshot: y,
15304
15342
  agentDisplayName: v || b,
15305
- botAvatarNode: /* @__PURE__ */ g(B_, { orbColors: t })
15343
+ botAvatarNode: /* @__PURE__ */ g(U_, { orbColors: t })
15306
15344
  }) : we ? /* @__PURE__ */ _("div", {
15307
15345
  style: {
15308
15346
  flex: 1,
@@ -15343,7 +15381,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15343
15381
  padding: "28px 24px"
15344
15382
  },
15345
15383
  children: [
15346
- /* @__PURE__ */ g(I_, {
15384
+ /* @__PURE__ */ g(z_, {
15347
15385
  size: 94,
15348
15386
  orbColors: t
15349
15387
  }),
@@ -15434,7 +15472,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15434
15472
  zIndex: 1,
15435
15473
  padding: ne ? "6px 0 0" : "12px 0 0"
15436
15474
  },
15437
- children: /* @__PURE__ */ g(Rg, {
15475
+ children: /* @__PURE__ */ g(Vg, {
15438
15476
  input: x,
15439
15477
  setInput: S,
15440
15478
  onSubmit: C,
@@ -15508,7 +15546,7 @@ function H_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
15508
15546
  ]
15509
15547
  });
15510
15548
  }
15511
- function U_() {
15549
+ function K_() {
15512
15550
  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();
15513
15551
  c(() => {
15514
15552
  try {
@@ -15530,7 +15568,7 @@ function U_() {
15530
15568
  small: 50,
15531
15569
  medium: 64,
15532
15570
  large: 80
15533
- }, 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) => ({
15571
+ }, ke = Oe[R.orbSize] || Oe.small, je = R.position || "bottom-right", Me = L.fallbackAgentName || "Agent", Pe = N_(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) => ({
15534
15572
  id: e.key || `qr-${t}`,
15535
15573
  label: e.label,
15536
15574
  message: e.label,
@@ -15621,7 +15659,7 @@ function U_() {
15621
15659
  let kt = o(() => {
15622
15660
  ht(null), _t("");
15623
15661
  }, []), At = o((e) => {
15624
- let t = Ag(e);
15662
+ let t = Ng(e);
15625
15663
  if (t) {
15626
15664
  ht(null), _t(t);
15627
15665
  return;
@@ -15727,7 +15765,7 @@ function U_() {
15727
15765
  if (mt) {
15728
15766
  try {
15729
15767
  yt(!0), _t("");
15730
- let e = await re(mt), n = e?.data || e, r = tt.trim() || `Shared file: ${Mg(mt)}`;
15768
+ let e = await re(mt), n = e?.data || e, r = tt.trim() || `Shared file: ${Fg(mt)}`;
15731
15769
  nt(""), it(null), kt(), await M(r, "", t, {
15732
15770
  type: "file",
15733
15771
  metadata: {
@@ -15820,7 +15858,7 @@ function U_() {
15820
15858
  onWheel: (e) => e.stopPropagation(),
15821
15859
  onTouchMove: (e) => e.stopPropagation(),
15822
15860
  children: [
15823
- W === "entry_prompt" && /* @__PURE__ */ g(L_, {
15861
+ W === "entry_prompt" && /* @__PURE__ */ g(B_, {
15824
15862
  copy: qe,
15825
15863
  orbColors: we,
15826
15864
  primaryColor: Te,
@@ -15903,13 +15941,13 @@ function U_() {
15903
15941
  children: E === "connected" ? `${It(ut)} with ${Ze}` : `Tap to return to ${Ze}`
15904
15942
  })]
15905
15943
  })]
15906
- }), /* @__PURE__ */ g(I_, {
15944
+ }), /* @__PURE__ */ g(z_, {
15907
15945
  size: ke,
15908
15946
  orbColors: we,
15909
15947
  onClick: T ? jt : Ce ? Bt : Ht
15910
15948
  })]
15911
15949
  }),
15912
- W === "connection_modal" && /* @__PURE__ */ g(R_, {
15950
+ W === "connection_modal" && /* @__PURE__ */ g(V_, {
15913
15951
  copy: qe,
15914
15952
  orbColors: we,
15915
15953
  primaryColor: Te,
@@ -15919,7 +15957,7 @@ function U_() {
15919
15957
  isMobile: Dt,
15920
15958
  isClosing: St
15921
15959
  }),
15922
- W === "voice_mode" && /* @__PURE__ */ g(z_, {
15960
+ W === "voice_mode" && /* @__PURE__ */ g(H_, {
15923
15961
  orbColors: we,
15924
15962
  onEnterChat: Ht,
15925
15963
  onEndChat: Ut,
@@ -15942,7 +15980,7 @@ function U_() {
15942
15980
  enterChatModeLabel: L.voiceEnterChatLabel || "Enter Chat Mode",
15943
15981
  endConversationLabel: L.voiceEndConversationLabel || "End Conversation"
15944
15982
  }, "voice"),
15945
- W === "call_screen" && /* @__PURE__ */ g(t_, {
15983
+ W === "call_screen" && /* @__PURE__ */ g(i_, {
15946
15984
  incomingCall: w,
15947
15985
  activeCallId: T,
15948
15986
  callConnectionState: E,
@@ -15961,7 +15999,7 @@ function U_() {
15961
15999
  orbColors: we,
15962
16000
  chatHistory: r
15963
16001
  }),
15964
- W === "text_chat" && /* @__PURE__ */ g(H_, {
16002
+ W === "text_chat" && /* @__PURE__ */ g(G_, {
15965
16003
  isClosing: St,
15966
16004
  copy: qe,
15967
16005
  orbColors: we,
@@ -16027,7 +16065,7 @@ function U_() {
16027
16065
  }
16028
16066
  //#endregion
16029
16067
  //#region src/components/ErrorBoundary.jsx
16030
- var W_ = class extends e.Component {
16068
+ var q_ = class extends e.Component {
16031
16069
  constructor(e) {
16032
16070
  super(e), this.state = { hasError: !1 };
16033
16071
  }
@@ -16042,4 +16080,4 @@ var W_ = class extends e.Component {
16042
16080
  }
16043
16081
  };
16044
16082
  //#endregion
16045
- export { Jg as AnimatedOrb, W_ as ErrorBoundary, yi as FlowEngageProvider, U_ as FlowEngageWidget, kn as useFlowEngage };
16083
+ export { Zg as AnimatedOrb, q_ as ErrorBoundary, yi as FlowEngageProvider, K_ as FlowEngageWidget, kn as useFlowEngage };