@flowengage/react-chatbot 8.0.104 → 8.0.105
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.
|
@@ -18,7 +18,7 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
|
|
|
18
18
|
}, T = (e) => x.call(e, "module.exports") ? e["module.exports"] : w(v({}, "__esModule", { value: !0 }), e), E = (e) => {
|
|
19
19
|
if (!e || typeof e != "object") throw Error("FlowEngage config is required");
|
|
20
20
|
if (!e.siteId || typeof e.siteId != "string") throw Error("[FlowEngage] config.siteId is required. Pass it as <FlowEngageProvider siteId=\"your-site-id\" /> or config={{ siteId: 'your-site-id' }}.");
|
|
21
|
-
let t = (e.apiBaseUrl || "
|
|
21
|
+
let t = (e.apiBaseUrl || "http://localhost:5008").replace(/\/+$/, "");
|
|
22
22
|
return {
|
|
23
23
|
siteId: e.siteId.trim(),
|
|
24
24
|
apiBaseUrl: t
|
|
@@ -9247,7 +9247,7 @@ function dh(e) {
|
|
|
9247
9247
|
for (let n = 0; n < e.length; n++) t[n] = e[n] / 32768;
|
|
9248
9248
|
return t;
|
|
9249
9249
|
}
|
|
9250
|
-
var fh = .
|
|
9250
|
+
var fh = .13, ph = ["audio/webm", "audio/mp4"];
|
|
9251
9251
|
function mh() {
|
|
9252
9252
|
return typeof window > "u" || window.MediaRecorder === void 0 ? null : ph.find((e) => window.MediaRecorder.isTypeSupported(e)) || null;
|
|
9253
9253
|
}
|
|
@@ -9261,11 +9261,13 @@ function hh(e, t, n, r, i) {
|
|
|
9261
9261
|
if (!e.ok) throw Error(`HTTP ${e.status}`);
|
|
9262
9262
|
}).catch((e) => console.warn("[FlowEngage] voice recording upload failed:", e.message));
|
|
9263
9263
|
}
|
|
9264
|
-
|
|
9264
|
+
var gh = .02;
|
|
9265
|
+
function _h(e, t, n) {
|
|
9265
9266
|
let r = 0, i = 0, a = [], o = () => {
|
|
9266
|
-
|
|
9267
|
+
let t = e.currentTime;
|
|
9268
|
+
a.forEach(({ source: e, gain: n }) => {
|
|
9267
9269
|
try {
|
|
9268
|
-
e.stop();
|
|
9270
|
+
n.gain.cancelScheduledValues(t), n.gain.setValueAtTime(n.gain.value, t), n.gain.linearRampToValueAtTime(0, t + gh), e.stop(t + gh);
|
|
9269
9271
|
} catch {}
|
|
9270
9272
|
}), a = [], r = 0;
|
|
9271
9273
|
}, s = () => r > e.currentTime;
|
|
@@ -9274,10 +9276,17 @@ function gh(e, t, n) {
|
|
|
9274
9276
|
let c = dh(o), l = e.createBuffer(1, c.length, th);
|
|
9275
9277
|
l.copyToChannel(c, 0);
|
|
9276
9278
|
let u = e.createBufferSource();
|
|
9277
|
-
u.buffer = l
|
|
9278
|
-
let d =
|
|
9279
|
-
|
|
9280
|
-
|
|
9279
|
+
u.buffer = l;
|
|
9280
|
+
let d = e.createGain();
|
|
9281
|
+
u.connect(d), d.connect(e.destination), n && d.connect(n);
|
|
9282
|
+
let f = !s(), p = f ? e.currentTime + fh : r;
|
|
9283
|
+
f && (i = p), u.start(p), r = p + l.duration;
|
|
9284
|
+
let m = {
|
|
9285
|
+
source: u,
|
|
9286
|
+
gain: d
|
|
9287
|
+
};
|
|
9288
|
+
a.push(m), u.onended = () => {
|
|
9289
|
+
a = a.filter((e) => e !== m), !a.length && !s() && t?.();
|
|
9281
9290
|
};
|
|
9282
9291
|
},
|
|
9283
9292
|
stop: o,
|
|
@@ -9285,7 +9294,7 @@ function gh(e, t, n) {
|
|
|
9285
9294
|
playedMs: () => Math.max(0, (e.currentTime - i) * 1e3)
|
|
9286
9295
|
};
|
|
9287
9296
|
}
|
|
9288
|
-
async function
|
|
9297
|
+
async function vh(e, t, n) {
|
|
9289
9298
|
let r = new URLSearchParams({ siteId: t || "" });
|
|
9290
9299
|
n && r.set("chatId", n);
|
|
9291
9300
|
let i = Fr();
|
|
@@ -9303,8 +9312,8 @@ async function _h(e, t, n) {
|
|
|
9303
9312
|
if (!o?.success || !o.wsUrl) throw Error(o?.error || "Voice session was refused.");
|
|
9304
9313
|
return o;
|
|
9305
9314
|
}
|
|
9306
|
-
async function
|
|
9307
|
-
let { apiBaseUrl: t, siteId: n, chatId: r, clientTools: i = {}, onConnect: a, onDisconnect: o, onMessage: s, onModeChange: c, onError: l, onUnhandledClientToolCall: u, onAgentTurnEnd: d, onSessionInfo: f, onSessionEnding: p } = e, m = await
|
|
9315
|
+
async function yh(e) {
|
|
9316
|
+
let { apiBaseUrl: t, siteId: n, chatId: r, clientTools: i = {}, onConnect: a, onDisconnect: o, onMessage: s, onModeChange: c, onError: l, onUnhandledClientToolCall: u, onAgentTurnEnd: d, onSessionInfo: f, onSessionEnding: p } = e, m = await vh(t, n, r);
|
|
9308
9317
|
f?.({ emailOnFile: !!m.emailOnFile });
|
|
9309
9318
|
let h = { type: "Start" };
|
|
9310
9319
|
e.greeting !== void 0 && (h.greeting = e.greeting || null);
|
|
@@ -9361,7 +9370,7 @@ async function vh(e) {
|
|
|
9361
9370
|
}
|
|
9362
9371
|
};
|
|
9363
9372
|
N = setTimeout(e, 150);
|
|
9364
|
-
}, le =
|
|
9373
|
+
}, le = _h(_, () => {
|
|
9365
9374
|
te && (te = !1, c?.({ mode: "listening" }));
|
|
9366
9375
|
}, v);
|
|
9367
9376
|
typeof window < "u" && (window.__fe_agentAudioPlaying = () => le.isPlaying());
|
|
@@ -9536,7 +9545,7 @@ async function vh(e) {
|
|
|
9536
9545
|
}
|
|
9537
9546
|
};
|
|
9538
9547
|
}
|
|
9539
|
-
var
|
|
9548
|
+
var bh = { startSession: yh }, xh = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
9540
9549
|
width: e,
|
|
9541
9550
|
height: e,
|
|
9542
9551
|
viewBox: "0 0 24 24",
|
|
@@ -9552,7 +9561,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9552
9561
|
strokeLinecap: "round",
|
|
9553
9562
|
strokeLinejoin: "round"
|
|
9554
9563
|
})]
|
|
9555
|
-
}),
|
|
9564
|
+
}), Sh = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
|
|
9556
9565
|
width: e,
|
|
9557
9566
|
height: e,
|
|
9558
9567
|
viewBox: "0 0 24 24",
|
|
@@ -9567,7 +9576,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9567
9576
|
x2: "1",
|
|
9568
9577
|
y2: "23"
|
|
9569
9578
|
})]
|
|
9570
|
-
}),
|
|
9579
|
+
}), Ch = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
|
|
9571
9580
|
width: e,
|
|
9572
9581
|
height: e,
|
|
9573
9582
|
viewBox: "0 0 24 24",
|
|
@@ -9582,7 +9591,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9582
9591
|
x2: "12",
|
|
9583
9592
|
y2: "5"
|
|
9584
9593
|
}), /* @__PURE__ */ g("polyline", { points: "5 12 12 5 19 12" })]
|
|
9585
|
-
}),
|
|
9594
|
+
}), wh = () => /* @__PURE__ */ _("svg", {
|
|
9586
9595
|
width: "14",
|
|
9587
9596
|
height: "14",
|
|
9588
9597
|
viewBox: "0 0 24 24",
|
|
@@ -9592,7 +9601,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9592
9601
|
strokeLinecap: "round",
|
|
9593
9602
|
strokeLinejoin: "round",
|
|
9594
9603
|
children: [/* @__PURE__ */ g("polyline", { points: "9 17 4 12 9 7" }), /* @__PURE__ */ g("path", { d: "M20 18v-2a4 4 0 00-4-4H4" })]
|
|
9595
|
-
}),
|
|
9604
|
+
}), Th = () => /* @__PURE__ */ g("svg", {
|
|
9596
9605
|
width: "18",
|
|
9597
9606
|
height: "18",
|
|
9598
9607
|
viewBox: "0 0 24 24",
|
|
@@ -9602,7 +9611,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9602
9611
|
strokeLinecap: "round",
|
|
9603
9612
|
strokeLinejoin: "round",
|
|
9604
9613
|
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" })
|
|
9605
|
-
}),
|
|
9614
|
+
}), Eh = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
|
|
9606
9615
|
className: e,
|
|
9607
9616
|
width: "14",
|
|
9608
9617
|
height: "14",
|
|
@@ -9631,7 +9640,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9631
9640
|
y2: "16"
|
|
9632
9641
|
})
|
|
9633
9642
|
]
|
|
9634
|
-
}),
|
|
9643
|
+
}), Dh = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
|
|
9635
9644
|
width: e,
|
|
9636
9645
|
height: e,
|
|
9637
9646
|
viewBox: "0 0 24 24",
|
|
@@ -9654,7 +9663,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9654
9663
|
/* @__PURE__ */ g("path", { d: "M15 13v2" }),
|
|
9655
9664
|
/* @__PURE__ */ g("path", { d: "M9 13v2" })
|
|
9656
9665
|
]
|
|
9657
|
-
}),
|
|
9666
|
+
}), Oh = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
9658
9667
|
width: e,
|
|
9659
9668
|
height: e,
|
|
9660
9669
|
viewBox: "0 0 24 24",
|
|
@@ -9674,7 +9683,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9674
9683
|
x2: "19",
|
|
9675
9684
|
y2: "12"
|
|
9676
9685
|
})]
|
|
9677
|
-
}),
|
|
9686
|
+
}), kh = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
9678
9687
|
width: e,
|
|
9679
9688
|
height: e,
|
|
9680
9689
|
viewBox: "0 0 24 24",
|
|
@@ -9700,7 +9709,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9700
9709
|
fill: t
|
|
9701
9710
|
})
|
|
9702
9711
|
]
|
|
9703
|
-
}),
|
|
9712
|
+
}), Ah = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
9704
9713
|
width: "24",
|
|
9705
9714
|
height: "24",
|
|
9706
9715
|
viewBox: "0 0 24 24",
|
|
@@ -9718,7 +9727,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9718
9727
|
"stroke-linecap": "round",
|
|
9719
9728
|
"stroke-linejoin": "round"
|
|
9720
9729
|
})]
|
|
9721
|
-
}),
|
|
9730
|
+
}), jh = () => /* @__PURE__ */ g("svg", {
|
|
9722
9731
|
width: "24",
|
|
9723
9732
|
height: "24",
|
|
9724
9733
|
viewBox: "0 0 24 24",
|
|
@@ -9730,7 +9739,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9730
9739
|
"stroke-width": "1.5",
|
|
9731
9740
|
"stroke-linejoin": "round"
|
|
9732
9741
|
})
|
|
9733
|
-
}),
|
|
9742
|
+
}), Mh = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
|
|
9734
9743
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9735
9744
|
width: e,
|
|
9736
9745
|
height: e,
|
|
@@ -9748,7 +9757,7 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9748
9757
|
/* @__PURE__ */ g("path", { d: "m2 2 20 20" }),
|
|
9749
9758
|
/* @__PURE__ */ g("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
|
|
9750
9759
|
]
|
|
9751
|
-
}),
|
|
9760
|
+
}), Nh = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), Ph = (e = "") => String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), Fh = new Set([
|
|
9752
9761
|
"p",
|
|
9753
9762
|
"br",
|
|
9754
9763
|
"ul",
|
|
@@ -9759,30 +9768,30 @@ var yh = { startSession: vh }, bh = ({ size: e = 18, color: t = "currentColor" }
|
|
|
9759
9768
|
"b",
|
|
9760
9769
|
"i",
|
|
9761
9770
|
"a"
|
|
9762
|
-
]),
|
|
9763
|
-
function
|
|
9771
|
+
]), Ih = /^https?:\/\//i;
|
|
9772
|
+
function Lh(e) {
|
|
9764
9773
|
let t = Array.from(e.childNodes);
|
|
9765
9774
|
for (let n of t) if (n.nodeType === Node.ELEMENT_NODE) {
|
|
9766
9775
|
let t = n.tagName.toLowerCase();
|
|
9767
|
-
if (!
|
|
9776
|
+
if (!Fh.has(t)) {
|
|
9768
9777
|
e.replaceChild(document.createTextNode(n.textContent), n);
|
|
9769
9778
|
continue;
|
|
9770
9779
|
}
|
|
9771
9780
|
let r = {};
|
|
9772
9781
|
if (t === "a") {
|
|
9773
9782
|
let e = n.getAttribute("href") || "";
|
|
9774
|
-
|
|
9783
|
+
Ih.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
|
|
9775
9784
|
}
|
|
9776
9785
|
for (; n.attributes.length > 0;) n.removeAttribute(n.attributes[0].name);
|
|
9777
9786
|
for (let [e, t] of Object.entries(r)) n.setAttribute(e, t);
|
|
9778
|
-
|
|
9787
|
+
Lh(n);
|
|
9779
9788
|
} else n.nodeType !== Node.TEXT_NODE && e.removeChild(n);
|
|
9780
9789
|
}
|
|
9781
|
-
function
|
|
9790
|
+
function Rh(e) {
|
|
9782
9791
|
let t = document.createElement("div");
|
|
9783
|
-
return t.innerHTML = e,
|
|
9792
|
+
return t.innerHTML = e, Lh(t), t.innerHTML;
|
|
9784
9793
|
}
|
|
9785
|
-
function
|
|
9794
|
+
function zh(e) {
|
|
9786
9795
|
let t = String(e || "").trim();
|
|
9787
9796
|
if (!t) return t;
|
|
9788
9797
|
let n = /^<p>\s*<strong>([\s\S]*?)<\/strong>\s*<\/p>$/i.exec(t);
|
|
@@ -9794,33 +9803,33 @@ function Rh(e) {
|
|
|
9794
9803
|
}
|
|
9795
9804
|
return e;
|
|
9796
9805
|
}
|
|
9797
|
-
var
|
|
9806
|
+
var Bh = (e = "") => {
|
|
9798
9807
|
let t = String(e || "").trim();
|
|
9799
9808
|
if (!t) return "";
|
|
9800
|
-
if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return Rh(
|
|
9801
|
-
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) =>
|
|
9802
|
-
return
|
|
9809
|
+
if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return zh(Rh(t));
|
|
9810
|
+
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) => Ph(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>");
|
|
9811
|
+
return zh(n.map((e) => {
|
|
9803
9812
|
let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = t.filter((e) => /^[-*]\s+/.test(e));
|
|
9804
9813
|
if (n.length >= 2 && n.length === t.length) return `<ul>${n.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>`;
|
|
9805
9814
|
let i = e.split(/\s+(?=[-*]\s+\*\*?)/).map((e) => e.trim()).filter(Boolean);
|
|
9806
9815
|
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>`;
|
|
9807
9816
|
}).join(""));
|
|
9808
|
-
},
|
|
9817
|
+
}, Vh = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), Hh = new Set([
|
|
9809
9818
|
".pdf",
|
|
9810
9819
|
".docx",
|
|
9811
9820
|
".png",
|
|
9812
9821
|
".jpg",
|
|
9813
9822
|
".jpeg"
|
|
9814
|
-
]),
|
|
9815
|
-
function
|
|
9823
|
+
]), Uh = "image/png,image/jpeg,.pdf,.docx";
|
|
9824
|
+
function Wh(e) {
|
|
9816
9825
|
if (!e) return !1;
|
|
9817
9826
|
let t = typeof e.name == "string" ? e.name.toLowerCase() : "", n = t.includes(".") ? `.${t.split(".").pop()}` : "", r = typeof e.type == "string" ? e.type.toLowerCase() : "";
|
|
9818
|
-
return r === "image/png" || r === "image/jpeg" ||
|
|
9827
|
+
return r === "image/png" || r === "image/jpeg" || Vh.has(r) || Hh.has(n);
|
|
9819
9828
|
}
|
|
9820
|
-
function
|
|
9821
|
-
return e ?
|
|
9829
|
+
function Gh(e) {
|
|
9830
|
+
return e ? Wh(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
|
|
9822
9831
|
}
|
|
9823
|
-
function
|
|
9832
|
+
function Kh(e = 0) {
|
|
9824
9833
|
if (!Number.isFinite(e) || e <= 0) return "";
|
|
9825
9834
|
let t = [
|
|
9826
9835
|
"B",
|
|
@@ -9832,12 +9841,12 @@ function Gh(e = 0) {
|
|
|
9832
9841
|
let i = n >= 10 || r === 0 ? 0 : 1;
|
|
9833
9842
|
return `${n.toFixed(i)} ${t[r]}`;
|
|
9834
9843
|
}
|
|
9835
|
-
function
|
|
9844
|
+
function qh(e) {
|
|
9836
9845
|
return e ? e.name || "Attachment" : "";
|
|
9837
9846
|
}
|
|
9838
9847
|
//#endregion
|
|
9839
9848
|
//#region src/utils/avatarHelpers.js
|
|
9840
|
-
function
|
|
9849
|
+
function Jh(e) {
|
|
9841
9850
|
if (!e || typeof e != "string") return "?";
|
|
9842
9851
|
let t = e.trim();
|
|
9843
9852
|
if (!t) return "?";
|
|
@@ -9846,7 +9855,7 @@ function qh(e) {
|
|
|
9846
9855
|
}
|
|
9847
9856
|
//#endregion
|
|
9848
9857
|
//#region src/components/AvatarImageOrInitials.jsx
|
|
9849
|
-
function
|
|
9858
|
+
function Yh({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
9850
9859
|
let [i, a] = m(null), o = typeof e == "string" ? e.trim() : "";
|
|
9851
9860
|
return c(() => {
|
|
9852
9861
|
if (!o) {
|
|
@@ -9869,12 +9878,12 @@ function Jh({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
|
9869
9878
|
onError: () => a(null)
|
|
9870
9879
|
}) : /* @__PURE__ */ g("span", {
|
|
9871
9880
|
style: r,
|
|
9872
|
-
children:
|
|
9881
|
+
children: Jh(t)
|
|
9873
9882
|
});
|
|
9874
9883
|
}
|
|
9875
9884
|
//#endregion
|
|
9876
9885
|
//#region src/components/MessageList.jsx
|
|
9877
|
-
function
|
|
9886
|
+
function Xh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
|
|
9878
9887
|
let { resolvedConfig: d } = Cn(), f = p(null), [v, y] = m(null), [b, x] = m(null), S = p(e.length), C = p(!0), w = p(null), T = o((e) => {
|
|
9879
9888
|
let t = e.target.closest("a[href]");
|
|
9880
9889
|
if (!t) return;
|
|
@@ -9929,7 +9938,7 @@ function Yh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
9929
9938
|
children: [
|
|
9930
9939
|
e.map((e) => {
|
|
9931
9940
|
if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
|
|
9932
|
-
let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, d = e.type === "file" && e.metadata?.fileUrl, f = e.agent_name || e.agentName || e.metadata?.agentName || l, p = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, m =
|
|
9941
|
+
let t = e.sender === "system", n = e.sender === "user", r = e.sender === "ai" || e.sender === "bot", o = e.sender === "agent", c = e.isPending, d = e.type === "file" && e.metadata?.fileUrl, f = e.agent_name || e.agentName || e.metadata?.agentName || l, p = typeof e.sender_headshot == "string" && e.sender_headshot.trim() || typeof s == "string" && s.trim() || null, m = Nh(e.replyToContent || e.replyContext?.message || ""), v = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
|
|
9933
9942
|
return t ? /* @__PURE__ */ g("div", {
|
|
9934
9943
|
style: {
|
|
9935
9944
|
display: "flex",
|
|
@@ -9974,7 +9983,7 @@ function Yh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
9974
9983
|
fontWeight: 800,
|
|
9975
9984
|
marginTop: !c && (r || o) ? "22px" : "0px"
|
|
9976
9985
|
},
|
|
9977
|
-
children: r ? u || /* @__PURE__ */ g(
|
|
9986
|
+
children: r ? u || /* @__PURE__ */ g(Dh, { size: 16 }) : /* @__PURE__ */ g(Yh, {
|
|
9978
9987
|
src: p || "",
|
|
9979
9988
|
name: f,
|
|
9980
9989
|
imgStyle: {
|
|
@@ -10016,7 +10025,7 @@ function Yh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10016
10025
|
onMouseLeave: (e) => {
|
|
10017
10026
|
e.currentTarget.style.color = "#9ca3af";
|
|
10018
10027
|
},
|
|
10019
|
-
children: [/* @__PURE__ */ g(
|
|
10028
|
+
children: [/* @__PURE__ */ g(wh, {}), "Reply"]
|
|
10020
10029
|
}),
|
|
10021
10030
|
/* @__PURE__ */ _("div", {
|
|
10022
10031
|
style: {
|
|
@@ -10060,7 +10069,7 @@ function Yh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10060
10069
|
children: m
|
|
10061
10070
|
})]
|
|
10062
10071
|
}), d ? (() => {
|
|
10063
|
-
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i =
|
|
10072
|
+
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = Kh(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" ? {
|
|
10064
10073
|
color: "#ef4444",
|
|
10065
10074
|
label: "PDF"
|
|
10066
10075
|
} : t.includes("word") || t.includes("docx") ? {
|
|
@@ -10241,7 +10250,7 @@ function Yh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10241
10250
|
});
|
|
10242
10251
|
})() : r ? /* @__PURE__ */ g("div", {
|
|
10243
10252
|
className: "flowengage-message-content fe-bot-message",
|
|
10244
|
-
dangerouslySetInnerHTML: { __html:
|
|
10253
|
+
dangerouslySetInnerHTML: { __html: Bh(e.message) },
|
|
10245
10254
|
onClick: T
|
|
10246
10255
|
}) : /* @__PURE__ */ g("div", {
|
|
10247
10256
|
style: { whiteSpace: "pre-wrap" },
|
|
@@ -10306,7 +10315,7 @@ function Yh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10306
10315
|
boxShadow: u ? "none" : "0 8px 20px rgba(59,130,246,0.24)",
|
|
10307
10316
|
overflow: "hidden"
|
|
10308
10317
|
},
|
|
10309
|
-
children: u || /* @__PURE__ */ g(
|
|
10318
|
+
children: u || /* @__PURE__ */ g(Dh, { size: 16 })
|
|
10310
10319
|
}), /* @__PURE__ */ _("div", {
|
|
10311
10320
|
style: {
|
|
10312
10321
|
display: "flex",
|
|
@@ -10348,7 +10357,7 @@ function Yh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10348
10357
|
borderRadius: "50%",
|
|
10349
10358
|
overflow: "hidden"
|
|
10350
10359
|
},
|
|
10351
|
-
children: /* @__PURE__ */ g(
|
|
10360
|
+
children: /* @__PURE__ */ g(Yh, {
|
|
10352
10361
|
src: s || "",
|
|
10353
10362
|
name: l,
|
|
10354
10363
|
imgStyle: {
|
|
@@ -10442,22 +10451,22 @@ function Yh({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
10442
10451
|
}
|
|
10443
10452
|
//#endregion
|
|
10444
10453
|
//#region src/components/ChatInput.jsx
|
|
10445
|
-
var
|
|
10446
|
-
function
|
|
10454
|
+
var Zh = typeof window < "u" && (window.matchMedia?.("(pointer: coarse)").matches || navigator.maxTouchPoints > 0);
|
|
10455
|
+
function Qh({ 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" }) {
|
|
10447
10456
|
let D = p(null), O = p(null), k = (e) => {
|
|
10448
10457
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
|
|
10449
10458
|
};
|
|
10450
10459
|
c(() => {
|
|
10451
10460
|
d || k(O.current);
|
|
10452
10461
|
}, [e, d]), c(() => {
|
|
10453
|
-
d ||
|
|
10462
|
+
d || Zh || e || s || O.current?.focus();
|
|
10454
10463
|
}, [
|
|
10455
10464
|
e,
|
|
10456
10465
|
d,
|
|
10457
10466
|
s
|
|
10458
10467
|
]);
|
|
10459
10468
|
let A = (e) => {
|
|
10460
|
-
e.key === "Enter" && (
|
|
10469
|
+
e.key === "Enter" && (Zh || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || (e.preventDefault(), e.currentTarget.form?.requestSubmit()));
|
|
10461
10470
|
}, 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;
|
|
10462
10471
|
return /* @__PURE__ */ _("div", {
|
|
10463
10472
|
style: {
|
|
@@ -10552,7 +10561,7 @@ function Zh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10552
10561
|
background: "rgba(59,130,246,0.08)",
|
|
10553
10562
|
color: "var(--flowengage-primary)"
|
|
10554
10563
|
},
|
|
10555
|
-
children: /* @__PURE__ */ g(
|
|
10564
|
+
children: /* @__PURE__ */ g(Dh, { size: 13 })
|
|
10556
10565
|
}), /* @__PURE__ */ g("span", { children: "Please provide your email address so we can help you." })]
|
|
10557
10566
|
})
|
|
10558
10567
|
}),
|
|
@@ -10592,7 +10601,7 @@ function Zh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10592
10601
|
overflow: "hidden",
|
|
10593
10602
|
textOverflow: "ellipsis"
|
|
10594
10603
|
},
|
|
10595
|
-
children:
|
|
10604
|
+
children: qh(S)
|
|
10596
10605
|
}),
|
|
10597
10606
|
/* @__PURE__ */ g("div", {
|
|
10598
10607
|
style: {
|
|
@@ -10600,7 +10609,7 @@ function Zh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10600
10609
|
color: "#6b7280",
|
|
10601
10610
|
marginTop: "2px"
|
|
10602
10611
|
},
|
|
10603
|
-
children:
|
|
10612
|
+
children: Kh(S.size)
|
|
10604
10613
|
})
|
|
10605
10614
|
]
|
|
10606
10615
|
}), /* @__PURE__ */ g("button", {
|
|
@@ -10645,7 +10654,7 @@ function Zh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10645
10654
|
j ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
|
|
10646
10655
|
ref: D,
|
|
10647
10656
|
type: "file",
|
|
10648
|
-
accept:
|
|
10657
|
+
accept: Uh,
|
|
10649
10658
|
style: { display: "none" },
|
|
10650
10659
|
onChange: (e) => {
|
|
10651
10660
|
let t = e.target.files?.[0];
|
|
@@ -10677,7 +10686,7 @@ function Zh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10677
10686
|
onMouseLeave: (e) => {
|
|
10678
10687
|
e.currentTarget.style.opacity = "1";
|
|
10679
10688
|
},
|
|
10680
|
-
children: /* @__PURE__ */ g(
|
|
10689
|
+
children: /* @__PURE__ */ g(Oh, {
|
|
10681
10690
|
size: 16,
|
|
10682
10691
|
color: "currentColor"
|
|
10683
10692
|
})
|
|
@@ -10758,7 +10767,7 @@ function Zh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10758
10767
|
onMouseLeave: (e) => {
|
|
10759
10768
|
e.currentTarget.style.opacity = "1";
|
|
10760
10769
|
},
|
|
10761
|
-
children: /* @__PURE__ */ g(
|
|
10770
|
+
children: /* @__PURE__ */ g(Ch, { size: 16 })
|
|
10762
10771
|
})
|
|
10763
10772
|
]
|
|
10764
10773
|
}),
|
|
@@ -10821,7 +10830,7 @@ function Zh({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
10821
10830
|
}
|
|
10822
10831
|
//#endregion
|
|
10823
10832
|
//#region src/components/StatusBanners.jsx
|
|
10824
|
-
function
|
|
10833
|
+
function $h({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
|
|
10825
10834
|
return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
|
|
10826
10835
|
style: {
|
|
10827
10836
|
margin: "0 20px 10px",
|
|
@@ -10834,7 +10843,7 @@ function Qh({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
10834
10843
|
gap: "10px"
|
|
10835
10844
|
},
|
|
10836
10845
|
children: [
|
|
10837
|
-
/* @__PURE__ */ g(
|
|
10846
|
+
/* @__PURE__ */ g(Eh, { className: "" }),
|
|
10838
10847
|
/* @__PURE__ */ g("span", {
|
|
10839
10848
|
style: {
|
|
10840
10849
|
fontSize: "12px",
|
|
@@ -10880,13 +10889,13 @@ function Qh({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
10880
10889
|
}
|
|
10881
10890
|
//#endregion
|
|
10882
10891
|
//#region src/components/AnimatedOrb.jsx
|
|
10883
|
-
var
|
|
10892
|
+
var eg = [
|
|
10884
10893
|
"#135bd8",
|
|
10885
10894
|
"#ef334b",
|
|
10886
10895
|
"#ffbd2e"
|
|
10887
10896
|
];
|
|
10888
|
-
function
|
|
10889
|
-
return !Array.isArray(e) || e.length === 0 ?
|
|
10897
|
+
function tg(e) {
|
|
10898
|
+
return !Array.isArray(e) || e.length === 0 ? eg : e.length === 1 ? [
|
|
10890
10899
|
e[0],
|
|
10891
10900
|
e[0],
|
|
10892
10901
|
e[0]
|
|
@@ -10900,7 +10909,7 @@ function eg(e) {
|
|
|
10900
10909
|
e[2]
|
|
10901
10910
|
];
|
|
10902
10911
|
}
|
|
10903
|
-
var
|
|
10912
|
+
var ng = {
|
|
10904
10913
|
idle: 3,
|
|
10905
10914
|
listening: .75,
|
|
10906
10915
|
thinking: 1,
|
|
@@ -10908,7 +10917,7 @@ var tg = {
|
|
|
10908
10917
|
muted: .75,
|
|
10909
10918
|
error: .08
|
|
10910
10919
|
};
|
|
10911
|
-
function
|
|
10920
|
+
function rg(e) {
|
|
10912
10921
|
if (!e || typeof e != "string") return [
|
|
10913
10922
|
0,
|
|
10914
10923
|
0,
|
|
@@ -10921,14 +10930,14 @@ function ng(e) {
|
|
|
10921
10930
|
parseInt(n.slice(4, 6), 16) / 255
|
|
10922
10931
|
];
|
|
10923
10932
|
}
|
|
10924
|
-
function
|
|
10933
|
+
function ig(e, t) {
|
|
10925
10934
|
if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
|
|
10926
10935
|
if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
|
|
10927
10936
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
|
|
10928
10937
|
return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
|
|
10929
10938
|
}
|
|
10930
|
-
var
|
|
10931
|
-
function
|
|
10939
|
+
var ag = "\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", og = "\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";
|
|
10940
|
+
function sg(e, t, n) {
|
|
10932
10941
|
let r = (t, n) => {
|
|
10933
10942
|
let r = e.createShader(t);
|
|
10934
10943
|
return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
|
|
@@ -10937,10 +10946,10 @@ function og(e, t, n) {
|
|
|
10937
10946
|
let o = e.createProgram();
|
|
10938
10947
|
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);
|
|
10939
10948
|
}
|
|
10940
|
-
function
|
|
10941
|
-
let [s, l, u] =
|
|
10949
|
+
function cg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
|
|
10950
|
+
let [s, l, u] = tg(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(ng[t] ?? .35);
|
|
10942
10951
|
c(() => {
|
|
10943
|
-
h.current =
|
|
10952
|
+
h.current = ng[t] ?? .35;
|
|
10944
10953
|
}, [t]), c(() => {
|
|
10945
10954
|
let t = m.current;
|
|
10946
10955
|
if (!t) return;
|
|
@@ -10957,7 +10966,7 @@ function sg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
10957
10966
|
console.warn("[AnimatedOrb] WebGL unavailable.");
|
|
10958
10967
|
return;
|
|
10959
10968
|
}
|
|
10960
|
-
let i =
|
|
10969
|
+
let i = sg(r, ag, og);
|
|
10961
10970
|
if (!i) {
|
|
10962
10971
|
console.error("[AnimatedOrb] WebGL program failed to compile/link");
|
|
10963
10972
|
return;
|
|
@@ -10987,7 +10996,7 @@ function sg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
10987
10996
|
c2: r.getUniformLocation(i, "u_c2"),
|
|
10988
10997
|
c3: r.getUniformLocation(i, "u_c3")
|
|
10989
10998
|
};
|
|
10990
|
-
r.uniform3fv(c.c1,
|
|
10999
|
+
r.uniform3fv(c.c1, rg(s)), r.uniform3fv(c.c2, rg(l)), r.uniform3fv(c.c3, rg(u)), r.viewport(0, 0, t.width, t.height);
|
|
10991
11000
|
let d = performance.now(), f, p = (e) => {
|
|
10992
11001
|
r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
|
|
10993
11002
|
};
|
|
@@ -11018,7 +11027,7 @@ function sg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
11018
11027
|
position: "absolute",
|
|
11019
11028
|
inset: -10,
|
|
11020
11029
|
borderRadius: "50%",
|
|
11021
|
-
background: `radial-gradient(circle, ${
|
|
11030
|
+
background: `radial-gradient(circle, ${ig(s, .18)} 0%, transparent 70%)`,
|
|
11022
11031
|
pointerEvents: "none"
|
|
11023
11032
|
},
|
|
11024
11033
|
animate: { opacity: [.3, .75] },
|
|
@@ -11096,17 +11105,17 @@ function sg({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
11096
11105
|
}
|
|
11097
11106
|
//#endregion
|
|
11098
11107
|
//#region src/components/CallScreen.jsx
|
|
11099
|
-
var
|
|
11100
|
-
function
|
|
11108
|
+
var lg = "\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";
|
|
11109
|
+
function ug(e) {
|
|
11101
11110
|
let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
|
|
11102
11111
|
return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
|
|
11103
11112
|
}
|
|
11104
|
-
function
|
|
11113
|
+
function dg(e) {
|
|
11105
11114
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
11106
11115
|
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;
|
|
11107
11116
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
11108
11117
|
}
|
|
11109
|
-
function
|
|
11118
|
+
function fg(e, t) {
|
|
11110
11119
|
let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
|
|
11111
11120
|
return n.length === 1 ? [
|
|
11112
11121
|
`radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
|
|
@@ -11123,8 +11132,8 @@ function dg(e, t) {
|
|
|
11123
11132
|
"#f7f8fa"
|
|
11124
11133
|
].join(", ");
|
|
11125
11134
|
}
|
|
11126
|
-
function
|
|
11127
|
-
let i = (t || "A")[0].toUpperCase(), a =
|
|
11135
|
+
function pg({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
|
|
11136
|
+
let i = (t || "A")[0].toUpperCase(), a = dg(r), o = n > 48 ? {
|
|
11128
11137
|
boxShadow: `0 0 0 3px ${r}44`,
|
|
11129
11138
|
border: "3px solid rgba(255,255,255,0.15)"
|
|
11130
11139
|
} : { border: `1.5px solid ${r}55` };
|
|
@@ -11161,7 +11170,7 @@ function fg({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
|
|
|
11161
11170
|
children: i
|
|
11162
11171
|
});
|
|
11163
11172
|
}
|
|
11164
|
-
function
|
|
11173
|
+
function mg(e) {
|
|
11165
11174
|
let t = p(null), n = o(() => {
|
|
11166
11175
|
if (!t.current) return;
|
|
11167
11176
|
let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
|
|
@@ -11208,8 +11217,8 @@ function pg(e) {
|
|
|
11208
11217
|
n
|
|
11209
11218
|
]), c(() => () => n(), [n]), n;
|
|
11210
11219
|
}
|
|
11211
|
-
function
|
|
11212
|
-
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x =
|
|
11220
|
+
function hg({ 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 = [] }) {
|
|
11221
|
+
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = mg(!!e), S = async () => {
|
|
11213
11222
|
x(), await c();
|
|
11214
11223
|
}, C = async () => {
|
|
11215
11224
|
x(), await l();
|
|
@@ -11221,14 +11230,14 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11221
11230
|
flexDirection: "column",
|
|
11222
11231
|
borderRadius: "inherit",
|
|
11223
11232
|
overflow: "hidden",
|
|
11224
|
-
background:
|
|
11233
|
+
background: fg(h, m),
|
|
11225
11234
|
animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
|
|
11226
11235
|
};
|
|
11227
11236
|
if (b === "incoming") {
|
|
11228
11237
|
let e = Array.isArray(h) && h.length > 0 ? h : [m];
|
|
11229
11238
|
return /* @__PURE__ */ _("div", {
|
|
11230
11239
|
style: E,
|
|
11231
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
11240
|
+
children: [/* @__PURE__ */ g("style", { children: lg }), /* @__PURE__ */ _("div", {
|
|
11232
11241
|
style: {
|
|
11233
11242
|
flex: 1,
|
|
11234
11243
|
display: "flex",
|
|
@@ -11259,7 +11268,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11259
11268
|
width: "96px",
|
|
11260
11269
|
height: "96px",
|
|
11261
11270
|
borderRadius: "50%",
|
|
11262
|
-
background: `radial-gradient(circle, rgba(${
|
|
11271
|
+
background: `radial-gradient(circle, rgba(${ug(e[0])},0.2) 0%, transparent 70%)`,
|
|
11263
11272
|
filter: "blur(10px)",
|
|
11264
11273
|
zIndex: 0
|
|
11265
11274
|
} }),
|
|
@@ -11276,7 +11285,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11276
11285
|
animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
|
|
11277
11286
|
zIndex: 1
|
|
11278
11287
|
} }, n)),
|
|
11279
|
-
/* @__PURE__ */ g(
|
|
11288
|
+
/* @__PURE__ */ g(pg, {
|
|
11280
11289
|
headshot: o,
|
|
11281
11290
|
name: y,
|
|
11282
11291
|
size: 82,
|
|
@@ -11356,7 +11365,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11356
11365
|
e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(239,68,68,0.5)";
|
|
11357
11366
|
},
|
|
11358
11367
|
"aria-label": "Decline call",
|
|
11359
|
-
children: /* @__PURE__ */ g(
|
|
11368
|
+
children: /* @__PURE__ */ g(Sh, { size: 26 })
|
|
11360
11369
|
}), /* @__PURE__ */ g("span", {
|
|
11361
11370
|
style: {
|
|
11362
11371
|
fontSize: "12px",
|
|
@@ -11397,7 +11406,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11397
11406
|
e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(34,197,94,0.5)";
|
|
11398
11407
|
},
|
|
11399
11408
|
"aria-label": "Accept call",
|
|
11400
|
-
children: /* @__PURE__ */ g(
|
|
11409
|
+
children: /* @__PURE__ */ g(Th, {})
|
|
11401
11410
|
}), /* @__PURE__ */ g("span", {
|
|
11402
11411
|
style: {
|
|
11403
11412
|
fontSize: "12px",
|
|
@@ -11414,7 +11423,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11414
11423
|
}
|
|
11415
11424
|
return b === "connecting" ? /* @__PURE__ */ _("div", {
|
|
11416
11425
|
style: E,
|
|
11417
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
11426
|
+
children: [/* @__PURE__ */ g("style", { children: lg }), /* @__PURE__ */ _("div", {
|
|
11418
11427
|
style: {
|
|
11419
11428
|
flex: 1,
|
|
11420
11429
|
display: "flex",
|
|
@@ -11424,7 +11433,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11424
11433
|
gap: "24px"
|
|
11425
11434
|
},
|
|
11426
11435
|
children: [
|
|
11427
|
-
/* @__PURE__ */ g(
|
|
11436
|
+
/* @__PURE__ */ g(pg, {
|
|
11428
11437
|
headshot: o,
|
|
11429
11438
|
name: y,
|
|
11430
11439
|
size: 64,
|
|
@@ -11451,7 +11460,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11451
11460
|
}) : /* @__PURE__ */ _("div", {
|
|
11452
11461
|
style: E,
|
|
11453
11462
|
children: [
|
|
11454
|
-
/* @__PURE__ */ g("style", { children:
|
|
11463
|
+
/* @__PURE__ */ g("style", { children: lg }),
|
|
11455
11464
|
/* @__PURE__ */ _("div", {
|
|
11456
11465
|
style: {
|
|
11457
11466
|
display: "flex",
|
|
@@ -11497,7 +11506,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11497
11506
|
children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
|
|
11498
11507
|
})
|
|
11499
11508
|
}),
|
|
11500
|
-
/* @__PURE__ */ g(
|
|
11509
|
+
/* @__PURE__ */ g(cg, {
|
|
11501
11510
|
colors: h,
|
|
11502
11511
|
size: 36,
|
|
11503
11512
|
voiceState: w
|
|
@@ -11548,7 +11557,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11548
11557
|
gap: "16px",
|
|
11549
11558
|
padding: "0 24px 16px"
|
|
11550
11559
|
},
|
|
11551
|
-
children: [/* @__PURE__ */ g(
|
|
11560
|
+
children: [/* @__PURE__ */ g(pg, {
|
|
11552
11561
|
headshot: o,
|
|
11553
11562
|
name: y,
|
|
11554
11563
|
size: 116,
|
|
@@ -11603,7 +11612,7 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11603
11612
|
transition: "all 0.2s ease"
|
|
11604
11613
|
},
|
|
11605
11614
|
"aria-label": i ? "Unmute" : "Mute",
|
|
11606
|
-
children: [g(i ?
|
|
11615
|
+
children: [g(i ? Mh : xh, { size: 18 }), i ? "Unmute" : "Mute"]
|
|
11607
11616
|
}), /* @__PURE__ */ _("button", {
|
|
11608
11617
|
type: "button",
|
|
11609
11618
|
onClick: u,
|
|
@@ -11631,15 +11640,15 @@ function mg({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
11631
11640
|
e.currentTarget.style.background = "rgba(239,68,68,0.9)", e.currentTarget.style.transform = "scale(1)";
|
|
11632
11641
|
},
|
|
11633
11642
|
"aria-label": "End call",
|
|
11634
|
-
children: [/* @__PURE__ */ g(
|
|
11643
|
+
children: [/* @__PURE__ */ g(Sh, { size: 18 }), "End Call"]
|
|
11635
11644
|
})]
|
|
11636
11645
|
})
|
|
11637
11646
|
]
|
|
11638
11647
|
});
|
|
11639
11648
|
}
|
|
11640
|
-
function
|
|
11649
|
+
function gg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
|
|
11641
11650
|
let u = e || n || "Agent";
|
|
11642
|
-
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children:
|
|
11651
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: lg }), /* @__PURE__ */ _("div", {
|
|
11643
11652
|
role: "button",
|
|
11644
11653
|
tabIndex: 0,
|
|
11645
11654
|
onClick: c,
|
|
@@ -11696,7 +11705,7 @@ function hg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
11696
11705
|
borderRadius: "50%",
|
|
11697
11706
|
border: `1.5px solid ${l}55`
|
|
11698
11707
|
} }),
|
|
11699
|
-
/* @__PURE__ */ g(
|
|
11708
|
+
/* @__PURE__ */ g(pg, {
|
|
11700
11709
|
headshot: t,
|
|
11701
11710
|
name: u,
|
|
11702
11711
|
size: 38,
|
|
@@ -11780,7 +11789,7 @@ function hg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
11780
11789
|
boxShadow: i ? `0 0 0 3px ${l}12` : "none"
|
|
11781
11790
|
},
|
|
11782
11791
|
"aria-label": i ? "Unmute" : "Mute",
|
|
11783
|
-
children: g(i ?
|
|
11792
|
+
children: g(i ? Mh : xh, { size: 15 })
|
|
11784
11793
|
}), /* @__PURE__ */ g("button", {
|
|
11785
11794
|
type: "button",
|
|
11786
11795
|
onClick: (e) => {
|
|
@@ -11808,7 +11817,7 @@ function hg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
11808
11817
|
transition: "all 0.18s ease"
|
|
11809
11818
|
},
|
|
11810
11819
|
"aria-label": "End call",
|
|
11811
|
-
children: /* @__PURE__ */ g(
|
|
11820
|
+
children: /* @__PURE__ */ g(Sh, { size: 16 })
|
|
11812
11821
|
})]
|
|
11813
11822
|
})
|
|
11814
11823
|
]
|
|
@@ -11816,7 +11825,7 @@ function hg({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
11816
11825
|
}
|
|
11817
11826
|
//#endregion
|
|
11818
11827
|
//#region src/utils/voicePriorContext.js
|
|
11819
|
-
function
|
|
11828
|
+
function _g(e, t = {}) {
|
|
11820
11829
|
let n = t.maxChars ?? 4500;
|
|
11821
11830
|
if (!Array.isArray(e) || e.length === 0) return "";
|
|
11822
11831
|
let r = [];
|
|
@@ -11834,7 +11843,7 @@ function gg(e, t = {}) {
|
|
|
11834
11843
|
//#endregion
|
|
11835
11844
|
//#region src/utils/voiceActionVisuals.js
|
|
11836
11845
|
var Q = "fe-vv";
|
|
11837
|
-
function
|
|
11846
|
+
function vg() {
|
|
11838
11847
|
if (typeof document > "u" || document.getElementById(`${Q}-styles`)) return;
|
|
11839
11848
|
let e = `
|
|
11840
11849
|
/* ── Action toast ───────────────────────────────────────────────────────────── */
|
|
@@ -11979,14 +11988,14 @@ function _g() {
|
|
|
11979
11988
|
`, t = document.createElement("style");
|
|
11980
11989
|
t.id = `${Q}-styles`, t.textContent = e, (document.head || document.documentElement).appendChild(t);
|
|
11981
11990
|
}
|
|
11982
|
-
var
|
|
11983
|
-
function
|
|
11984
|
-
return (!
|
|
11991
|
+
var yg = null, bg = null;
|
|
11992
|
+
function xg() {
|
|
11993
|
+
return (!yg || !yg.isConnected) && (yg = document.createElement("div"), yg.id = `${Q}-toast`, document.body.appendChild(yg)), yg;
|
|
11985
11994
|
}
|
|
11986
|
-
function
|
|
11995
|
+
function Sg(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
|
|
11987
11996
|
if (typeof document > "u") return;
|
|
11988
|
-
|
|
11989
|
-
let i =
|
|
11997
|
+
vg(), bg &&= (clearTimeout(bg), null);
|
|
11998
|
+
let i = xg();
|
|
11990
11999
|
if (i.innerHTML = "", n) {
|
|
11991
12000
|
let e = document.createElement("span");
|
|
11992
12001
|
e.className = `${Q}-icon`, e.textContent = n, i.appendChild(e);
|
|
@@ -11995,71 +12004,71 @@ function xg(e, { spinner: t = !0, icon: n = null, duration: r = 0 } = {}) {
|
|
|
11995
12004
|
e.className = `${Q}-spin`, i.appendChild(e);
|
|
11996
12005
|
}
|
|
11997
12006
|
let a = document.createElement("span");
|
|
11998
|
-
a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (
|
|
12007
|
+
a.textContent = e, i.appendChild(a), i.classList.remove(`${Q}-show`), i.offsetHeight, i.classList.add(`${Q}-show`), r > 0 && (bg = setTimeout(() => Cg(), r));
|
|
11999
12008
|
}
|
|
12000
|
-
function
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
}, e) :
|
|
12004
|
-
}
|
|
12005
|
-
var Cg = null, wg = [];
|
|
12006
|
-
function Tg() {
|
|
12007
|
-
return (!Cg || !Cg.isConnected) && (Cg = document.createElement("div"), Cg.id = `${Q}-bar`, document.body.appendChild(Cg)), Cg;
|
|
12009
|
+
function Cg(e = 0) {
|
|
12010
|
+
yg && (e > 0 ? bg = setTimeout(() => {
|
|
12011
|
+
yg && yg.classList.remove(`${Q}-show`);
|
|
12012
|
+
}, e) : yg && yg.classList.remove(`${Q}-show`));
|
|
12008
12013
|
}
|
|
12014
|
+
var wg = null, Tg = [];
|
|
12009
12015
|
function Eg() {
|
|
12016
|
+
return (!wg || !wg.isConnected) && (wg = document.createElement("div"), wg.id = `${Q}-bar`, document.body.appendChild(wg)), wg;
|
|
12017
|
+
}
|
|
12018
|
+
function Dg() {
|
|
12010
12019
|
if (typeof document > "u") return;
|
|
12011
|
-
|
|
12012
|
-
let e =
|
|
12020
|
+
vg(), Tg.forEach(clearTimeout), Tg = [];
|
|
12021
|
+
let e = Eg();
|
|
12013
12022
|
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";
|
|
12014
12023
|
let t = [[80, "width 0.6s ease"], [92, "width 1.2s ease"]], n = 50;
|
|
12015
12024
|
for (let [e, r] of t) {
|
|
12016
12025
|
let t = n, i = e, a = r;
|
|
12017
|
-
|
|
12018
|
-
|
|
12026
|
+
Tg.push(setTimeout(() => {
|
|
12027
|
+
wg && (wg.style.transition = a, wg.style.width = `${i}%`);
|
|
12019
12028
|
}, t)), n += 800;
|
|
12020
12029
|
}
|
|
12021
12030
|
}
|
|
12022
|
-
function
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12031
|
+
function Og() {
|
|
12032
|
+
wg && (Tg.forEach(clearTimeout), Tg = [], wg.style.transition = "width 0.2s ease", wg.style.width = "100%", Tg.push(setTimeout(() => {
|
|
12033
|
+
wg && (wg.style.transition = "opacity 0.35s ease", wg.style.opacity = "0", Tg.push(setTimeout(() => {
|
|
12034
|
+
wg && (wg.style.width = "0%", wg.classList.remove(`${Q}-bar-active`));
|
|
12026
12035
|
}, 380)));
|
|
12027
12036
|
}, 220)));
|
|
12028
12037
|
}
|
|
12029
|
-
var
|
|
12038
|
+
var kg = `<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22" fill="none">
|
|
12030
12039
|
<filter id="${Q}-csh">
|
|
12031
12040
|
<feDropShadow dx="1" dy="2" stdDeviation="1.5" flood-color="#00000060"/>
|
|
12032
12041
|
</filter>
|
|
12033
12042
|
<path d="M4 2L19 10.5L11 12.8L8 20L4 2Z"
|
|
12034
12043
|
fill="white" stroke="#1e1b4b" stroke-width="1.6" stroke-linejoin="round"
|
|
12035
12044
|
filter="url(#${Q}-csh)"/>
|
|
12036
|
-
</svg>`,
|
|
12037
|
-
function
|
|
12038
|
-
return (!
|
|
12045
|
+
</svg>`, Ag = null, jg = !1;
|
|
12046
|
+
function Mg() {
|
|
12047
|
+
return (!Ag || !Ag.isConnected) && (Ag = document.createElement("div"), Ag.id = `${Q}-cursor`, Ag.innerHTML = kg, document.body.appendChild(Ag), jg = !1), Ag;
|
|
12039
12048
|
}
|
|
12040
|
-
async function
|
|
12049
|
+
async function Ng(e) {
|
|
12041
12050
|
if (typeof document > "u" || !e) return;
|
|
12042
|
-
|
|
12051
|
+
vg();
|
|
12043
12052
|
let t;
|
|
12044
12053
|
try {
|
|
12045
12054
|
t = e.getBoundingClientRect();
|
|
12046
12055
|
} catch {
|
|
12047
12056
|
return;
|
|
12048
12057
|
}
|
|
12049
|
-
let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i =
|
|
12050
|
-
|
|
12058
|
+
let n = t.left + Math.min(16, t.width * .2), r = t.top + Math.min(12, t.height * .25), i = Mg();
|
|
12059
|
+
jg ||= (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 Lg(360);
|
|
12051
12060
|
}
|
|
12052
|
-
function
|
|
12053
|
-
|
|
12054
|
-
|
|
12061
|
+
function Pg(e = !1) {
|
|
12062
|
+
Ag && (e ? (Ag.classList.remove(`${Q}-cursor-visible`), jg = !1) : (Ag.classList.remove(`${Q}-cursor-visible`), setTimeout(() => {
|
|
12063
|
+
jg = !1;
|
|
12055
12064
|
}, 250)));
|
|
12056
12065
|
}
|
|
12057
|
-
async function
|
|
12058
|
-
|
|
12066
|
+
async function Fg(e) {
|
|
12067
|
+
Ag && (Ag.classList.add(`${Q}-cursor-click`), await Lg(280), Ag.classList.remove(`${Q}-cursor-click`));
|
|
12059
12068
|
}
|
|
12060
|
-
function
|
|
12069
|
+
function Ig(e) {
|
|
12061
12070
|
if (!e || typeof document > "u") return;
|
|
12062
|
-
|
|
12071
|
+
vg();
|
|
12063
12072
|
let t;
|
|
12064
12073
|
try {
|
|
12065
12074
|
t = e.getBoundingClientRect();
|
|
@@ -12085,29 +12094,29 @@ function Fg(e) {
|
|
|
12085
12094
|
a.remove(), e.style.position = n, e.style.overflow = r;
|
|
12086
12095
|
}, 650);
|
|
12087
12096
|
}
|
|
12088
|
-
function
|
|
12097
|
+
function Lg(e) {
|
|
12089
12098
|
return new Promise((t) => setTimeout(t, e));
|
|
12090
12099
|
}
|
|
12091
12100
|
//#endregion
|
|
12092
12101
|
//#region src/utils/voiceClientTools.js
|
|
12093
|
-
var
|
|
12094
|
-
function
|
|
12095
|
-
return String(e || "").replace(
|
|
12102
|
+
var Rg = /^\/[a-z]{2}(?:-[a-z]{2})?(?=\/|$)/i;
|
|
12103
|
+
function zg(e) {
|
|
12104
|
+
return String(e || "").replace(Rg, "").replace(/\/+$/, "").toLowerCase() || "/";
|
|
12096
12105
|
}
|
|
12097
|
-
function
|
|
12098
|
-
return
|
|
12106
|
+
function Bg(e, t) {
|
|
12107
|
+
return zg(e) === zg(t);
|
|
12099
12108
|
}
|
|
12100
12109
|
function $(...e) {
|
|
12101
12110
|
wn() && console.log("[FlowEngage:voice-tools]", ...e);
|
|
12102
12111
|
}
|
|
12103
|
-
function
|
|
12112
|
+
function Vg(e) {
|
|
12104
12113
|
try {
|
|
12105
12114
|
let t = e.ownerDocument?.defaultView;
|
|
12106
12115
|
if (t) return t.getComputedStyle(e);
|
|
12107
12116
|
} catch {}
|
|
12108
12117
|
return window.getComputedStyle(e);
|
|
12109
12118
|
}
|
|
12110
|
-
function
|
|
12119
|
+
function Hg(e) {
|
|
12111
12120
|
let t = /* @__PURE__ */ new Set();
|
|
12112
12121
|
function n(r) {
|
|
12113
12122
|
if (!r || t.has(r)) return;
|
|
@@ -12120,10 +12129,10 @@ function Vg(e) {
|
|
|
12120
12129
|
}
|
|
12121
12130
|
typeof document < "u" && n(document);
|
|
12122
12131
|
}
|
|
12123
|
-
function
|
|
12132
|
+
function Ug(e) {
|
|
12124
12133
|
return e == null ? null : String(e).replace(/\u00a0/g, " ").replace(/\s*\*+\s*$/u, "").replace(/\s+/g, " ").trim();
|
|
12125
12134
|
}
|
|
12126
|
-
function
|
|
12135
|
+
function Wg(e) {
|
|
12127
12136
|
let t = e.ownerDocument || document, n = e.getAttribute("aria-labelledby");
|
|
12128
12137
|
if (n) {
|
|
12129
12138
|
let e = n.trim().split(/\s+/).filter(Boolean), r = [];
|
|
@@ -12131,40 +12140,40 @@ function Ug(e) {
|
|
|
12131
12140
|
let e = t.getElementById(n);
|
|
12132
12141
|
e?.textContent && r.push(e.textContent.trim());
|
|
12133
12142
|
} catch {}
|
|
12134
|
-
if (r.length) return
|
|
12143
|
+
if (r.length) return Ug(r.join(" "));
|
|
12135
12144
|
}
|
|
12136
|
-
if (e.labels && e.labels.length) return
|
|
12145
|
+
if (e.labels && e.labels.length) return Ug(e.labels[0].textContent);
|
|
12137
12146
|
let r = e.id;
|
|
12138
12147
|
if (r) try {
|
|
12139
12148
|
let e = t.querySelector(`label[for="${CSS.escape(r)}"]`);
|
|
12140
|
-
if (e) return
|
|
12149
|
+
if (e) return Ug(e.textContent);
|
|
12141
12150
|
} catch {
|
|
12142
12151
|
let e = t.querySelector(`label[for="${r.replace(/"/g, "\\\"")}"]`);
|
|
12143
|
-
if (e) return
|
|
12152
|
+
if (e) return Ug(e.textContent);
|
|
12144
12153
|
}
|
|
12145
12154
|
let i = e.previousElementSibling;
|
|
12146
12155
|
for (let e = 0; e < 6 && i; e += 1) {
|
|
12147
|
-
if (i.tagName === "LABEL") return
|
|
12156
|
+
if (i.tagName === "LABEL") return Ug(i.textContent);
|
|
12148
12157
|
let e = (i.className || "").toString().toLowerCase();
|
|
12149
12158
|
if (/chakra-form__label|formlabel|field-label|form-label|mui-form-label/.test(e)) {
|
|
12150
|
-
let e =
|
|
12159
|
+
let e = Ug(i.textContent);
|
|
12151
12160
|
if (e) return e;
|
|
12152
12161
|
}
|
|
12153
12162
|
i = i.previousElementSibling;
|
|
12154
12163
|
}
|
|
12155
12164
|
let a = e.parentElement;
|
|
12156
12165
|
for (let e = 0; e < 5 && a; e += 1) {
|
|
12157
|
-
if (a.tagName === "LABEL") return
|
|
12166
|
+
if (a.tagName === "LABEL") return Ug(a.textContent);
|
|
12158
12167
|
let e = a.querySelector?.(":scope > label, :scope > [class*='FormLabel'], :scope > [class*='form__label']");
|
|
12159
|
-
if (e?.textContent) return
|
|
12168
|
+
if (e?.textContent) return Ug(e.textContent);
|
|
12160
12169
|
a = a.parentElement;
|
|
12161
12170
|
}
|
|
12162
12171
|
let o = e.getAttribute("aria-label");
|
|
12163
|
-
return o ?
|
|
12172
|
+
return o ? Ug(o) : null;
|
|
12164
12173
|
}
|
|
12165
|
-
function
|
|
12174
|
+
function Gg() {
|
|
12166
12175
|
let e = [];
|
|
12167
|
-
return
|
|
12176
|
+
return Hg((t) => {
|
|
12168
12177
|
e.push(...Array.from(t.querySelectorAll("input, select, textarea")).filter((e) => {
|
|
12169
12178
|
if (An(e)) return !1;
|
|
12170
12179
|
let t = (e.type || "").toLowerCase();
|
|
@@ -12175,15 +12184,15 @@ function Wg() {
|
|
|
12175
12184
|
"image"
|
|
12176
12185
|
].includes(t) || e.disabled || e.readOnly) return !1;
|
|
12177
12186
|
try {
|
|
12178
|
-
let t =
|
|
12187
|
+
let t = Vg(e);
|
|
12179
12188
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
12180
12189
|
} catch {}
|
|
12181
12190
|
return !0;
|
|
12182
12191
|
}));
|
|
12183
12192
|
}), e;
|
|
12184
12193
|
}
|
|
12185
|
-
function
|
|
12186
|
-
return
|
|
12194
|
+
function Kg() {
|
|
12195
|
+
return Gg().map((e, t) => {
|
|
12187
12196
|
let n = {
|
|
12188
12197
|
formIndex: 0,
|
|
12189
12198
|
fieldIndex: t,
|
|
@@ -12191,7 +12200,7 @@ function Gg() {
|
|
|
12191
12200
|
type: e.type || "text",
|
|
12192
12201
|
name: e.name || null,
|
|
12193
12202
|
id: e.id || null,
|
|
12194
|
-
label:
|
|
12203
|
+
label: Wg(e),
|
|
12195
12204
|
placeholder: e.placeholder || null
|
|
12196
12205
|
};
|
|
12197
12206
|
return e.tagName === "SELECT" && (n.options = Array.from(e.options).filter((e) => e.value !== "" && !e.disabled).map((e) => ({
|
|
@@ -12200,13 +12209,13 @@ function Gg() {
|
|
|
12200
12209
|
})), n.currentValue = e.value || null), n;
|
|
12201
12210
|
});
|
|
12202
12211
|
}
|
|
12203
|
-
function
|
|
12212
|
+
function qg() {
|
|
12204
12213
|
let e = [];
|
|
12205
|
-
return
|
|
12214
|
+
return Hg((t) => {
|
|
12206
12215
|
e.push(...Array.from(t.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"]")).filter((e) => {
|
|
12207
12216
|
if (An(e) || e.disabled) return !1;
|
|
12208
12217
|
try {
|
|
12209
|
-
let t =
|
|
12218
|
+
let t = Vg(e);
|
|
12210
12219
|
if (t.display === "none" || t.visibility === "hidden") return !1;
|
|
12211
12220
|
} catch {}
|
|
12212
12221
|
return !0;
|
|
@@ -12218,7 +12227,7 @@ function Kg() {
|
|
|
12218
12227
|
type: e.type || e.tagName
|
|
12219
12228
|
}));
|
|
12220
12229
|
}
|
|
12221
|
-
function
|
|
12230
|
+
function Jg(e, t) {
|
|
12222
12231
|
try {
|
|
12223
12232
|
if (!e?.getBoundingClientRect || !t?.getBoundingClientRect) return Infinity;
|
|
12224
12233
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
@@ -12233,7 +12242,7 @@ function qg(e, t) {
|
|
|
12233
12242
|
return Infinity;
|
|
12234
12243
|
}
|
|
12235
12244
|
}
|
|
12236
|
-
function
|
|
12245
|
+
function Yg(e, t) {
|
|
12237
12246
|
let n = String(t || "").toLowerCase().trim();
|
|
12238
12247
|
if (!n) return 0;
|
|
12239
12248
|
let r = (e.innerText || e.textContent || "").replace(/\s+/g, " ").trim(), i = [
|
|
@@ -12251,21 +12260,21 @@ function Jg(e, t) {
|
|
|
12251
12260
|
for (let e of a) i.includes(e) && (o += 1);
|
|
12252
12261
|
return o / a.length * 92;
|
|
12253
12262
|
}
|
|
12254
|
-
function
|
|
12263
|
+
function Xg(e, t, n = 6) {
|
|
12255
12264
|
let r = String(t || "").toLowerCase().trim();
|
|
12256
12265
|
if (!r) return !1;
|
|
12257
12266
|
let i = e;
|
|
12258
12267
|
for (let e = 0; e < n && i && (i = i.parentElement, i); e++) if ((i.innerText || i.textContent || "").toLowerCase().includes(r)) return !0;
|
|
12259
12268
|
return !1;
|
|
12260
12269
|
}
|
|
12261
|
-
function
|
|
12270
|
+
function Zg(e, t, n) {
|
|
12262
12271
|
let r = [];
|
|
12263
|
-
|
|
12272
|
+
Hg((e) => {
|
|
12264
12273
|
let t = Array.from(e.querySelectorAll("button, [role=\"button\"], input[type=\"submit\"], input[type=\"button\"], a[href]"));
|
|
12265
12274
|
r.push(...t.filter((e) => {
|
|
12266
12275
|
if (An(e) || e.disabled) return !1;
|
|
12267
12276
|
try {
|
|
12268
|
-
let t =
|
|
12277
|
+
let t = Vg(e);
|
|
12269
12278
|
if (t.display === "none" || t.visibility === "hidden" || t.opacity === "0") return !1;
|
|
12270
12279
|
} catch {}
|
|
12271
12280
|
return !0;
|
|
@@ -12273,14 +12282,14 @@ function Xg(e, t, n) {
|
|
|
12273
12282
|
});
|
|
12274
12283
|
let i = 0, a = r.map((t) => ({
|
|
12275
12284
|
el: t,
|
|
12276
|
-
s:
|
|
12285
|
+
s: Yg(t, e)
|
|
12277
12286
|
}));
|
|
12278
12287
|
for (let { s: e } of a) e > i && (i = e);
|
|
12279
12288
|
if (i < 28) return null;
|
|
12280
12289
|
let o = a.filter(({ s: e }) => e === i).map(({ el: e }) => e);
|
|
12281
12290
|
if (o.length === 1) return o[0];
|
|
12282
12291
|
if (n) {
|
|
12283
|
-
let e = o.filter((e) =>
|
|
12292
|
+
let e = o.filter((e) => Xg(e, n));
|
|
12284
12293
|
if (e.length === 1) return e[0];
|
|
12285
12294
|
e.length > 1 && (o = e);
|
|
12286
12295
|
}
|
|
@@ -12288,14 +12297,14 @@ function Xg(e, t, n) {
|
|
|
12288
12297
|
if (s.length) {
|
|
12289
12298
|
let e = o[0], t = Infinity;
|
|
12290
12299
|
for (let n of o) for (let r of s) {
|
|
12291
|
-
let i =
|
|
12300
|
+
let i = Jg(n, r);
|
|
12292
12301
|
i < t && (t = i, e = n);
|
|
12293
12302
|
}
|
|
12294
12303
|
return e;
|
|
12295
12304
|
}
|
|
12296
12305
|
return o[0];
|
|
12297
12306
|
}
|
|
12298
|
-
function
|
|
12307
|
+
function Qg(e) {
|
|
12299
12308
|
if (e == null) return {};
|
|
12300
12309
|
if (typeof e == "string") {
|
|
12301
12310
|
let t = e.trim();
|
|
@@ -12308,12 +12317,12 @@ function Zg(e) {
|
|
|
12308
12317
|
}
|
|
12309
12318
|
return e;
|
|
12310
12319
|
}
|
|
12311
|
-
function
|
|
12320
|
+
function $g(e) {
|
|
12312
12321
|
if (!e || typeof e != "object") return null;
|
|
12313
12322
|
let t = e.url ?? e.target_url ?? e.page_url ?? e.pageUrl ?? e.link ?? e.href ?? e.path;
|
|
12314
12323
|
return t == null ? null : String(t).trim() || null;
|
|
12315
12324
|
}
|
|
12316
|
-
function
|
|
12325
|
+
function e_() {
|
|
12317
12326
|
let e = {};
|
|
12318
12327
|
document.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((t) => {
|
|
12319
12328
|
if (t.id) return;
|
|
@@ -12328,7 +12337,7 @@ function $g() {
|
|
|
12328
12337
|
e[r] = !0, t.id = r;
|
|
12329
12338
|
});
|
|
12330
12339
|
}
|
|
12331
|
-
function
|
|
12340
|
+
function t_() {
|
|
12332
12341
|
let e = (e) => {
|
|
12333
12342
|
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;
|
|
12334
12343
|
for (; r < t.length;) {
|
|
@@ -12371,7 +12380,7 @@ function e_() {
|
|
|
12371
12380
|
introText: o
|
|
12372
12381
|
};
|
|
12373
12382
|
}
|
|
12374
|
-
function
|
|
12383
|
+
function n_(e) {
|
|
12375
12384
|
if (!e || typeof document > "u") return "";
|
|
12376
12385
|
let t = new Set([
|
|
12377
12386
|
"script",
|
|
@@ -12457,11 +12466,11 @@ function t_(e) {
|
|
|
12457
12466
|
return d.has(t) ? !1 : (d.add(t), !0);
|
|
12458
12467
|
}).join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
12459
12468
|
}
|
|
12460
|
-
function
|
|
12469
|
+
function r_(e) {
|
|
12461
12470
|
let t = e.siteId || null, n = (e.apiBaseUrl || "").replace(/\/$/, ""), r = typeof e.getLastUserVoiceText == "function" ? e.getLastUserVoiceText : null, i = [], a = {
|
|
12462
12471
|
"fwh-navigate-mvp": async (n) => {
|
|
12463
12472
|
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.";
|
|
12464
|
-
let i =
|
|
12473
|
+
let i = Qg(n), a = $g(i), o = i.section_text ?? i.sectionText ?? i.section, s = Array.isArray(i.expected_landmarks) ? i.expected_landmarks : Array.isArray(i.expectedLandmarks) ? i.expectedLandmarks : [];
|
|
12465
12474
|
if ($("fwh-navigate-mvp · coerced:", {
|
|
12466
12475
|
url: a,
|
|
12467
12476
|
sectionText: o,
|
|
@@ -12501,11 +12510,11 @@ function n_(e) {
|
|
|
12501
12510
|
correctedUrl: l
|
|
12502
12511
|
}), a = l);
|
|
12503
12512
|
try {
|
|
12504
|
-
|
|
12513
|
+
Sg(`Navigating to ${a}...`, { spinner: !0 }), Dg(), On();
|
|
12505
12514
|
try {
|
|
12506
12515
|
let e = r ? r() : "";
|
|
12507
12516
|
if (e && t) {
|
|
12508
|
-
let n =
|
|
12517
|
+
let n = _g([{
|
|
12509
12518
|
sender: "user",
|
|
12510
12519
|
message: e
|
|
12511
12520
|
}]);
|
|
@@ -12540,8 +12549,8 @@ function n_(e) {
|
|
|
12540
12549
|
typeof window < "u" && window.scrollTo(0, 0);
|
|
12541
12550
|
} catch {}
|
|
12542
12551
|
let o = [], s = null, c = "", l = Date.now() + 12e3;
|
|
12543
|
-
for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: o, pageTitleHeading: s, introText: c} =
|
|
12544
|
-
|
|
12552
|
+
for (; Date.now() < l && (await new Promise((e) => setTimeout(e, 300)), {headings: o, pageTitleHeading: s, introText: c} = t_(), !(o.length >= 1)););
|
|
12553
|
+
e_(), $("fwh-navigate-mvp → page headings collected:", o, "titleHeading:", s);
|
|
12545
12554
|
let u = o.length ? o.join(" | ") : "none", d = o.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 = "";
|
|
12546
12555
|
try {
|
|
12547
12556
|
if (o.length > 0) {
|
|
@@ -12549,7 +12558,7 @@ function n_(e) {
|
|
|
12549
12558
|
for (let n of e) {
|
|
12550
12559
|
let e = cr(null, n);
|
|
12551
12560
|
if (e) {
|
|
12552
|
-
let r =
|
|
12561
|
+
let r = n_(e).substring(0, 800);
|
|
12553
12562
|
r && t.push(`[Section: ${n}] ${r}`);
|
|
12554
12563
|
}
|
|
12555
12564
|
}
|
|
@@ -12558,57 +12567,57 @@ function n_(e) {
|
|
|
12558
12567
|
} catch {}
|
|
12559
12568
|
if (yr()) return _r(), $("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.`;
|
|
12560
12569
|
let m = Date.now() + 4e3, h = typeof window < "u" ? window.location.pathname : r;
|
|
12561
|
-
for (; Date.now() < m && !
|
|
12570
|
+
for (; Date.now() < m && !Bg(h, e) && Bg(h, t);) await new Promise((e) => setTimeout(e, 120)), h = window.location.pathname;
|
|
12562
12571
|
$("fwh-navigate-mvp route settle:", {
|
|
12563
12572
|
startPath: t,
|
|
12564
12573
|
targetPath: e,
|
|
12565
12574
|
settledPath: h
|
|
12566
12575
|
});
|
|
12567
|
-
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 =
|
|
12576
|
+
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 = Bg(h, e), y = !Bg(h, t), b = v || y;
|
|
12568
12577
|
return $("fwh-navigate-mvp settled:", h, "target:", e, "match:", b), b ? (_r(), `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.`) : (_r(), `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.`);
|
|
12569
12578
|
} catch {}
|
|
12570
12579
|
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.";
|
|
12571
12580
|
} catch (e) {
|
|
12572
12581
|
let t = `Navigation error: ${e?.message || String(e)}`;
|
|
12573
|
-
return $("fwh-navigate-mvp ✖", t),
|
|
12582
|
+
return $("fwh-navigate-mvp ✖", t), Sg("Navigation failed", {
|
|
12574
12583
|
spinner: !1,
|
|
12575
12584
|
icon: "⚠️",
|
|
12576
12585
|
duration: 1800
|
|
12577
12586
|
}), t;
|
|
12578
12587
|
} finally {
|
|
12579
|
-
|
|
12588
|
+
Og(), Cg(900);
|
|
12580
12589
|
}
|
|
12581
12590
|
},
|
|
12582
12591
|
"fwh-highlight-mvp": async (e) => {
|
|
12583
12592
|
$("fwh-highlight-mvp ▶", e);
|
|
12584
|
-
let t =
|
|
12593
|
+
let t = Qg(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
|
|
12585
12594
|
if (Rn(3e3), typeof window < "u" && window.__fe_user_nav_during_speech) {
|
|
12586
12595
|
let e = window.__fe_user_nav_during_speech, t = window.location.pathname;
|
|
12587
12596
|
if (Date.now() - e.ts >= 3e4) window.__fe_user_nav_during_speech = null;
|
|
12588
12597
|
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.`;
|
|
12589
12598
|
}
|
|
12590
|
-
|
|
12599
|
+
e_();
|
|
12591
12600
|
let i = ((e) => e && e.replace(/^\d+\.\s*/, "").replace(/^["']|["']$/g, "").trim())(r), a = cr(n || null, i || null);
|
|
12592
12601
|
if (!a && i) {
|
|
12593
12602
|
let e = Date.now() + 600;
|
|
12594
|
-
for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)),
|
|
12603
|
+
for (; !a && Date.now() < e;) await new Promise((e) => setTimeout(e, 50)), e_(), a = cr(null, i);
|
|
12595
12604
|
}
|
|
12596
12605
|
if (!a) {
|
|
12597
12606
|
$("fwh-highlight-mvp ✖ no element for:", i || n);
|
|
12598
|
-
let { headings: e } =
|
|
12607
|
+
let { headings: e } = t_(), 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.";
|
|
12599
12608
|
return `HIGHLIGHT_NOT_FOUND: "${i || n}" on the current page. ${t}`;
|
|
12600
12609
|
}
|
|
12601
12610
|
return Dn(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.`;
|
|
12602
12611
|
},
|
|
12603
12612
|
"fwh-read-content-mvp": async (e) => {
|
|
12604
12613
|
$("fwh-read-content-mvp ▶", e);
|
|
12605
|
-
let t =
|
|
12614
|
+
let t = Qg(e), n = t?.section_text || t?.sectionText || "";
|
|
12606
12615
|
try {
|
|
12607
12616
|
let e = "";
|
|
12608
12617
|
if (n) {
|
|
12609
12618
|
let t = cr(null, n);
|
|
12610
12619
|
if (!t) return `Could not find section "${n}" on the page.`;
|
|
12611
|
-
e =
|
|
12620
|
+
e = n_(t);
|
|
12612
12621
|
} else {
|
|
12613
12622
|
let t = (document.querySelector("main") || document.querySelector("article") || document.querySelector("[role=\"main\"]") || document.querySelector("#content") || document.querySelector(".content") || document.body).cloneNode(!0);
|
|
12614
12623
|
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();
|
|
@@ -12620,7 +12629,7 @@ function n_(e) {
|
|
|
12620
12629
|
},
|
|
12621
12630
|
"fwh-page-content-mvp": async (e) => {
|
|
12622
12631
|
$("fwh-page-content-mvp ▶", e);
|
|
12623
|
-
let r =
|
|
12632
|
+
let r = Qg(e), i = r?.url || r?.page_url || "";
|
|
12624
12633
|
if ($("fwh-page-content-mvp · url:", i, "siteId:", t, "apiBase:", n || "(empty)"), !i) return $("fwh-page-content-mvp ✖ missing url"), "Missing url parameter.";
|
|
12625
12634
|
if (!t) return $("fwh-page-content-mvp ✖ no siteId"), "Site is not configured.";
|
|
12626
12635
|
if (!n) return $("fwh-page-content-mvp ✖ no api base"), "API base URL is missing; cannot fetch page content.";
|
|
@@ -12652,7 +12661,7 @@ function n_(e) {
|
|
|
12652
12661
|
},
|
|
12653
12662
|
"fwh-search-mvp": async (e) => {
|
|
12654
12663
|
$("fwh-search-mvp ▶", e);
|
|
12655
|
-
let r =
|
|
12664
|
+
let r = Qg(e).query;
|
|
12656
12665
|
if (!r) return $("fwh-search-mvp ✖ missing query"), "Missing query parameter.";
|
|
12657
12666
|
if (!t) return $("fwh-search-mvp ✖ no siteId"), "Search unavailable (no siteId configured).";
|
|
12658
12667
|
if (!n) return $("fwh-search-mvp ✖ no api base"), "Search unavailable (no API base URL).";
|
|
@@ -12690,7 +12699,7 @@ function n_(e) {
|
|
|
12690
12699
|
"[class*='menu'] a",
|
|
12691
12700
|
"[class*='header'] a"
|
|
12692
12701
|
];
|
|
12693
|
-
if (
|
|
12702
|
+
if (Hg((t) => {
|
|
12694
12703
|
for (let r of n) try {
|
|
12695
12704
|
t.querySelectorAll(r).forEach((t) => {
|
|
12696
12705
|
if (An(t)) return;
|
|
@@ -12698,7 +12707,7 @@ function n_(e) {
|
|
|
12698
12707
|
if (!r || !n || n === "#" || n.startsWith("javascript:")) return;
|
|
12699
12708
|
try {
|
|
12700
12709
|
let e = t.parentElement;
|
|
12701
|
-
if (e &&
|
|
12710
|
+
if (e && Vg(e).display === "none" && !e.closest("nav, [role='navigation'], header, [class*='nav'], [class*='menu']")) return;
|
|
12702
12711
|
} catch {}
|
|
12703
12712
|
let i = r.toLowerCase() + "|" + n;
|
|
12704
12713
|
e.has(i) || e.set(i, {
|
|
@@ -12709,7 +12718,7 @@ function n_(e) {
|
|
|
12709
12718
|
} catch {}
|
|
12710
12719
|
t.querySelectorAll("select").forEach((t) => {
|
|
12711
12720
|
if (An(t)) return;
|
|
12712
|
-
let n =
|
|
12721
|
+
let n = Wg(t);
|
|
12713
12722
|
/nav|menu|page|section|go to/i.test(n || t.name || t.id || "") && Array.from(t.options).forEach((r) => {
|
|
12714
12723
|
if (!r.value || r.disabled) return;
|
|
12715
12724
|
let i = r.text.trim();
|
|
@@ -12733,7 +12742,7 @@ function n_(e) {
|
|
|
12733
12742
|
if ($("fwh-get-current-page-mvp ▶"), typeof window > "u") return "Cannot determine current page (no browser context).";
|
|
12734
12743
|
let e = window.location.href, t = window.location.pathname, n = document.title || "";
|
|
12735
12744
|
if (yr()) 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.`;
|
|
12736
|
-
let { headings: r, pageTitleHeading: i, introText: a } =
|
|
12745
|
+
let { headings: r, pageTitleHeading: i, introText: a } = t_();
|
|
12737
12746
|
$("fwh-get-current-page-mvp ✓", {
|
|
12738
12747
|
url: e,
|
|
12739
12748
|
path: t,
|
|
@@ -12745,7 +12754,7 @@ function n_(e) {
|
|
|
12745
12754
|
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. ***`;
|
|
12746
12755
|
},
|
|
12747
12756
|
"fwh-list-forms-mvp": async () => {
|
|
12748
|
-
let e =
|
|
12757
|
+
let e = Kg(), t = qg();
|
|
12749
12758
|
$("fwh-list-forms-mvp ✓", `${e.length} field(s)`, `${t.length} button(s)`);
|
|
12750
12759
|
let n = e.map((e) => ({
|
|
12751
12760
|
...e,
|
|
@@ -12759,12 +12768,12 @@ function n_(e) {
|
|
|
12759
12768
|
},
|
|
12760
12769
|
"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.",
|
|
12761
12770
|
"fwh-click-button-mvp": async (e) => {
|
|
12762
|
-
let t =
|
|
12771
|
+
let t = Qg(e), n = (t.button_text ?? t.buttonText ?? t.text ?? "").trim(), r = (t.card_context ?? t.cardContext ?? "").trim();
|
|
12763
12772
|
if ($("fwh-click-button-mvp ▶", n, r ? `(card_context: ${r})` : ""), !n) return "Missing button_text: pass the visible label, e.g. Conduct Audit.";
|
|
12764
|
-
let a =
|
|
12773
|
+
let a = Zg(n, i, r);
|
|
12765
12774
|
if (!a) return $("fwh-click-button-mvp ✖ no match"), `Could not find a button matching "${n}". Call fwh-list-forms-mvp to see button texts.`;
|
|
12766
12775
|
try {
|
|
12767
|
-
|
|
12776
|
+
Sg(`Clicking ${n}...`, { spinner: !0 });
|
|
12768
12777
|
try {
|
|
12769
12778
|
a.scrollIntoView({
|
|
12770
12779
|
block: "center",
|
|
@@ -12773,22 +12782,22 @@ function n_(e) {
|
|
|
12773
12782
|
} catch {
|
|
12774
12783
|
a.scrollIntoView(!0);
|
|
12775
12784
|
}
|
|
12776
|
-
await
|
|
12785
|
+
await Ng(a), a.focus?.(), await Fg(a), Ig(a), a.click();
|
|
12777
12786
|
let e = (a.textContent || a.value || a.getAttribute("aria-label") || "").trim().slice(0, 80) || "button", t = `OK_CLICK ${e}`;
|
|
12778
|
-
return $("fwh-click-button-mvp ✓", t),
|
|
12787
|
+
return $("fwh-click-button-mvp ✓", t), Sg(`Clicked ${e}`, {
|
|
12779
12788
|
spinner: !1,
|
|
12780
12789
|
icon: "✅",
|
|
12781
12790
|
duration: 1200
|
|
12782
12791
|
}), t;
|
|
12783
12792
|
} catch (e) {
|
|
12784
12793
|
let t = `Click failed: ${e?.message || String(e)}`;
|
|
12785
|
-
return $("fwh-click-button-mvp ✖", t),
|
|
12794
|
+
return $("fwh-click-button-mvp ✖", t), Sg("Click failed", {
|
|
12786
12795
|
spinner: !1,
|
|
12787
12796
|
icon: "⚠️",
|
|
12788
12797
|
duration: 1800
|
|
12789
12798
|
}), t;
|
|
12790
12799
|
} finally {
|
|
12791
|
-
|
|
12800
|
+
Pg(), Cg(700);
|
|
12792
12801
|
}
|
|
12793
12802
|
},
|
|
12794
12803
|
"fwh-cart-get-mvp": async () => {
|
|
@@ -12901,18 +12910,18 @@ function n_(e) {
|
|
|
12901
12910
|
clickPageButton: a["fwh-click-button-mvp"]
|
|
12902
12911
|
};
|
|
12903
12912
|
}
|
|
12904
|
-
var
|
|
12905
|
-
function
|
|
12913
|
+
var i_ = /^(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;
|
|
12914
|
+
function a_() {
|
|
12906
12915
|
try {
|
|
12907
|
-
let { headings: e, pageTitleHeading: t } =
|
|
12908
|
-
return (e || []).map((e) => typeof e == "string" ? e : e?.text || "").filter(Boolean).filter((e) => !t || e.trim() !== t.trim()).filter((e) => !
|
|
12916
|
+
let { headings: e, pageTitleHeading: t } = t_();
|
|
12917
|
+
return (e || []).map((e) => typeof e == "string" ? e : e?.text || "").filter(Boolean).filter((e) => !t || e.trim() !== t.trim()).filter((e) => !i_.test(e.trim()));
|
|
12909
12918
|
} catch {
|
|
12910
12919
|
return [];
|
|
12911
12920
|
}
|
|
12912
12921
|
}
|
|
12913
12922
|
//#endregion
|
|
12914
12923
|
//#region src/utils/wrapVoiceToolsForLogging.js
|
|
12915
|
-
function
|
|
12924
|
+
function o_(e) {
|
|
12916
12925
|
return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
|
|
12917
12926
|
let r = wn();
|
|
12918
12927
|
r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
|
|
@@ -12929,7 +12938,7 @@ function a_(e) {
|
|
|
12929
12938
|
}
|
|
12930
12939
|
//#endregion
|
|
12931
12940
|
//#region src/components/FlowEngageWidget.jsx
|
|
12932
|
-
var
|
|
12941
|
+
var s_ = {
|
|
12933
12942
|
blue: "#135bd8",
|
|
12934
12943
|
red: "#ef334b",
|
|
12935
12944
|
yellow: "#ffbd2e",
|
|
@@ -12937,7 +12946,7 @@ var o_ = {
|
|
|
12937
12946
|
highlight: "rgba(255,255,255,0.9)",
|
|
12938
12947
|
green: "#10b981"
|
|
12939
12948
|
};
|
|
12940
|
-
function
|
|
12949
|
+
function c_(e) {
|
|
12941
12950
|
if (!Array.isArray(e) || e.length < 2) return "linear-gradient(145deg, #dce8f022 0%, #e8dff522 45%, #f5e0e022 100%), #f7f8fa";
|
|
12942
12951
|
let [t, n, r] = e;
|
|
12943
12952
|
return e.length >= 3 && r ? [
|
|
@@ -12951,12 +12960,12 @@ function s_(e) {
|
|
|
12951
12960
|
"#f7f8fa"
|
|
12952
12961
|
].join(", ");
|
|
12953
12962
|
}
|
|
12954
|
-
function
|
|
12963
|
+
function l_(e) {
|
|
12955
12964
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
12956
12965
|
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;
|
|
12957
12966
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
12958
12967
|
}
|
|
12959
|
-
function
|
|
12968
|
+
function u_(t) {
|
|
12960
12969
|
let [n, r] = e.useState(null), i = typeof t == "string" ? t.trim() : "";
|
|
12961
12970
|
return e.useEffect(() => {
|
|
12962
12971
|
if (!i) {
|
|
@@ -12974,8 +12983,8 @@ function l_(t) {
|
|
|
12974
12983
|
};
|
|
12975
12984
|
}, [i]), n;
|
|
12976
12985
|
}
|
|
12977
|
-
function
|
|
12978
|
-
let r =
|
|
12986
|
+
function d_({ logo: t, style: n }) {
|
|
12987
|
+
let r = u_(typeof t == "string" ? t : null);
|
|
12979
12988
|
if (!t) return null;
|
|
12980
12989
|
if (typeof t == "string") return r ? /* @__PURE__ */ g("img", {
|
|
12981
12990
|
src: r,
|
|
@@ -13000,7 +13009,7 @@ function u_({ logo: t, style: n }) {
|
|
|
13000
13009
|
children: i
|
|
13001
13010
|
}) : null;
|
|
13002
13011
|
}
|
|
13003
|
-
function
|
|
13012
|
+
function f_({ title: e }) {
|
|
13004
13013
|
return /* @__PURE__ */ g("div", {
|
|
13005
13014
|
style: {
|
|
13006
13015
|
width: "100%",
|
|
@@ -13018,18 +13027,18 @@ function d_({ title: e }) {
|
|
|
13018
13027
|
children: String(e || "FE").split(/\s+/).filter(Boolean).slice(0, 2).map((e) => e[0]?.toUpperCase() || "").join("") || "FE"
|
|
13019
13028
|
});
|
|
13020
13029
|
}
|
|
13021
|
-
function
|
|
13030
|
+
function p_(e, t) {
|
|
13022
13031
|
let n = (t || "").trim();
|
|
13023
13032
|
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;
|
|
13024
13033
|
}
|
|
13025
|
-
function
|
|
13026
|
-
return /* @__PURE__ */ g(
|
|
13034
|
+
function m_({ orbColors: e, ...t }) {
|
|
13035
|
+
return /* @__PURE__ */ g(cg, {
|
|
13027
13036
|
colors: e,
|
|
13028
13037
|
...t
|
|
13029
13038
|
});
|
|
13030
13039
|
}
|
|
13031
|
-
function
|
|
13032
|
-
let s = n ||
|
|
13040
|
+
function h_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMobile: a, isClosing: o }) {
|
|
13041
|
+
let s = n || s_.green, c = l_(s), l = a ? 72 : 94, u = /* @__PURE__ */ _("div", {
|
|
13033
13042
|
style: {
|
|
13034
13043
|
display: "flex",
|
|
13035
13044
|
alignItems: a ? "flex-end" : "center",
|
|
@@ -13155,7 +13164,7 @@ function m_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
13155
13164
|
delay: 0
|
|
13156
13165
|
},
|
|
13157
13166
|
style: { flexShrink: 0 },
|
|
13158
|
-
children: /* @__PURE__ */ g(
|
|
13167
|
+
children: /* @__PURE__ */ g(m_, {
|
|
13159
13168
|
size: l,
|
|
13160
13169
|
orbColors: t
|
|
13161
13170
|
})
|
|
@@ -13187,8 +13196,8 @@ function m_({ copy: e, orbColors: t, primaryColor: n, onYes: r, onLater: i, isMo
|
|
|
13187
13196
|
children: u
|
|
13188
13197
|
})] });
|
|
13189
13198
|
}
|
|
13190
|
-
function
|
|
13191
|
-
let c = n ||
|
|
13199
|
+
function g_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onClose: a, isMobile: o, isClosing: s }) {
|
|
13200
|
+
let c = n || s_.green, l = l_(c);
|
|
13192
13201
|
return /* @__PURE__ */ _(eh.div, {
|
|
13193
13202
|
initial: {
|
|
13194
13203
|
scale: 50 / 350,
|
|
@@ -13259,7 +13268,7 @@ function h_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
13259
13268
|
children: /* @__PURE__ */ g("polyline", { points: "6 9 12 15 18 9" })
|
|
13260
13269
|
})
|
|
13261
13270
|
}),
|
|
13262
|
-
/* @__PURE__ */ g(
|
|
13271
|
+
/* @__PURE__ */ g(m_, {
|
|
13263
13272
|
size: 72,
|
|
13264
13273
|
orbColors: t
|
|
13265
13274
|
}),
|
|
@@ -13339,7 +13348,7 @@ function h_({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
|
|
|
13339
13348
|
]
|
|
13340
13349
|
});
|
|
13341
13350
|
}
|
|
13342
|
-
function
|
|
13351
|
+
function __({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, voiceEndCounter: d, websiteName: f, voiceFirstMessage: h, captureVisitorEmail: v, emailRequired: y, emailCaptureEnabled: b = !0, listeningLabel: x = "Listening...", thinkingLabel: S = "Thinking...", enterChatModeLabel: C = "Enter Chat Mode", endConversationLabel: w = "End Conversation" }) {
|
|
13343
13352
|
c(() => (console.log("[FlowEngage:VoiceDebug] 🔵 VoiceMode MOUNTED"), () => console.log("[FlowEngage:VoiceDebug] 🔴 VoiceMode UNMOUNTED")), []);
|
|
13344
13353
|
let [T, E] = m("idle"), [D, O] = m(!1), [k, A] = m(!1), [ee, te] = m(!1), [ne, j] = m(""), [M, re] = m(""), ie = p(!1), ae = p(!1), N = p(null), oe = p(0), se = p(""), ce = p(!1), le = p(0), ue = p(!1), de = p(!1), fe = p(!1), pe = p([]), me = p(null), he = (e) => {
|
|
13345
13354
|
ue.current = e, e || (de.current = !1), P.current?.setWalkthroughActive?.(e);
|
|
@@ -13463,7 +13472,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13463
13472
|
if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
|
|
13464
13473
|
l.current = [], ve.current = "", be.current = !1, xe.current = !1, L.current = !1, Te.current = "minimized", Dr({ onBeforeNavigate: () => {
|
|
13465
13474
|
if (i && l.current.length > 0) try {
|
|
13466
|
-
let e =
|
|
13475
|
+
let e = _g(l.current);
|
|
13467
13476
|
e && I(i, e);
|
|
13468
13477
|
} catch {}
|
|
13469
13478
|
if (!qn()) {
|
|
@@ -13485,7 +13494,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13485
13494
|
}
|
|
13486
13495
|
we();
|
|
13487
13496
|
} });
|
|
13488
|
-
let t =
|
|
13497
|
+
let t = o_(r_({
|
|
13489
13498
|
siteId: i || null,
|
|
13490
13499
|
apiBaseUrl: a || null,
|
|
13491
13500
|
chatId: s || null,
|
|
@@ -13530,7 +13539,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13530
13539
|
let e = f || "";
|
|
13531
13540
|
x.greeting = h || (v ? e ? `Hi, welcome to ${e}! How may I help you?` : "Hi, welcome! How may I help you?" : `Welcome to ${T}! How may I help you?`), v || console.log(`[FlowEngage] 🏠 Page-context greeting: "${w}" for ${m}`);
|
|
13532
13541
|
}
|
|
13533
|
-
let A = !1, ee = p ? `NAVIGATION COMPLETE — The exact phrase "I have navigated you to the [page] page. Do you want to know about any specific section or want a complete overview?" has already been spoken as your firstMessage. DO NOT repeat it. PRIOR CONVERSATION CONTEXT:\n${n?.transcript ? `Prior transcript:\n${n.transcript}\n` : "(no prior transcript)"}\nNow STOP — wait silently for the visitor's reply. Do NOT speak, do NOT call any tool until the visitor responds. When they reply: if they name a specific section → call fwh-get-current-page-mvp then answer immediately; if they say "overview" or anything non-specific → call fwh-get-current-page-mvp (zero speech) then do a full highlighted walkthrough.` : null, ne = !1, j = !p && !r ? "Your greeting has been spoken. Wait for the visitor to ask a question or tell you what they need. Do NOT auto-start a walkthrough or highlight any sections — let the visitor lead." : null, M = r && !p, re = !1, N = M ? `The question "Would you like me to continue what I was explaining before, or would you like to know about this page instead?" has already been spoken as your firstMessage. DO NOT repeat it. PRIOR CONVERSATION CONTEXT:\n${n?.transcript ? `Prior transcript:\n${n.transcript}\n` : "(no prior transcript, or the visitor navigated before saying much)"}\nNow STOP — wait silently for the visitor's reply. Do NOT speak, do NOT call any tool until they respond. When they reply: if they want you to CONTINUE the previous topic → resume verbally from the prior transcript above, do NOT call fwh-get-current-page-mvp or describe the new page unless they ask. If they want to know about THIS page → call fwh-get-current-page-mvp (zero speech) then proceed as a normal fresh-page walkthrough/description. If their reply is ambiguous, ask them to clarify which they'd prefer rather than guessing.` : null, ye = !1, Ce = !1, Oe = b && !!y && !fe.current, ze = await
|
|
13542
|
+
let A = !1, ee = p ? `NAVIGATION COMPLETE — The exact phrase "I have navigated you to the [page] page. Do you want to know about any specific section or want a complete overview?" has already been spoken as your firstMessage. DO NOT repeat it. PRIOR CONVERSATION CONTEXT:\n${n?.transcript ? `Prior transcript:\n${n.transcript}\n` : "(no prior transcript)"}\nNow STOP — wait silently for the visitor's reply. Do NOT speak, do NOT call any tool until the visitor responds. When they reply: if they name a specific section → call fwh-get-current-page-mvp then answer immediately; if they say "overview" or anything non-specific → call fwh-get-current-page-mvp (zero speech) then do a full highlighted walkthrough.` : null, ne = !1, j = !p && !r ? "Your greeting has been spoken. Wait for the visitor to ask a question or tell you what they need. Do NOT auto-start a walkthrough or highlight any sections — let the visitor lead." : null, M = r && !p, re = !1, N = M ? `The question "Would you like me to continue what I was explaining before, or would you like to know about this page instead?" has already been spoken as your firstMessage. DO NOT repeat it. PRIOR CONVERSATION CONTEXT:\n${n?.transcript ? `Prior transcript:\n${n.transcript}\n` : "(no prior transcript, or the visitor navigated before saying much)"}\nNow STOP — wait silently for the visitor's reply. Do NOT speak, do NOT call any tool until they respond. When they reply: if they want you to CONTINUE the previous topic → resume verbally from the prior transcript above, do NOT call fwh-get-current-page-mvp or describe the new page unless they ask. If they want to know about THIS page → call fwh-get-current-page-mvp (zero speech) then proceed as a normal fresh-page walkthrough/description. If their reply is ambiguous, ask them to clarify which they'd prefer rather than guessing.` : null, ye = !1, Ce = !1, Oe = b && !!y && !fe.current, ze = await bh.startSession({
|
|
13534
13543
|
...x,
|
|
13535
13544
|
onConnect: ({ conversationId: e }) => {
|
|
13536
13545
|
Ee.current = e, De.current = Date.now(), console.log("[FlowEngage] 🎙️ AI chat session connected:", e);
|
|
@@ -13602,7 +13611,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13602
13611
|
onMessage: (t) => {
|
|
13603
13612
|
if (e || ce.current && t.role !== "user" && !/email/i.test(String(t.message || ""))) return;
|
|
13604
13613
|
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 || ""));
|
|
13605
|
-
if (!n && !r && t.role === "user" && V.test(String(t.message || ""))) typeof window < "u" && (window.__fe_user_nav_during_speech = null), he(!0), de.current = !1, le.current = 0, ge.current = -1, pe.current =
|
|
13614
|
+
if (!n && !r && t.role === "user" && V.test(String(t.message || ""))) typeof window < "u" && (window.__fe_user_nav_during_speech = null), he(!0), de.current = !1, le.current = 0, ge.current = -1, pe.current = a_(), setTimeout(() => me.current?.(), 400), console.log(`[FlowEngage] walkthrough armed — ${pe.current.length} sections on this page`);
|
|
13606
13615
|
else if (!n && t.role === "user" && ue.current) {
|
|
13607
13616
|
let e = String(t.message || "").trim();
|
|
13608
13617
|
Le.test(e) ? de.current && (de.current = !1, console.debug("[FlowEngage] walkthrough resumed by visitor"), setTimeout(() => me.current?.(), 300)) : (de.current = !0, console.debug("[FlowEngage] walkthrough paused — visitor interjected"));
|
|
@@ -13619,10 +13628,10 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13619
13628
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
13620
13629
|
debug: t.debug
|
|
13621
13630
|
}], i) try {
|
|
13622
|
-
let e =
|
|
13631
|
+
let e = _g(l.current);
|
|
13623
13632
|
e && I(i, e);
|
|
13624
13633
|
} catch {}
|
|
13625
|
-
if (
|
|
13634
|
+
if (p_(a, o)) {
|
|
13626
13635
|
je.current = !0;
|
|
13627
13636
|
return;
|
|
13628
13637
|
}
|
|
@@ -13939,7 +13948,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
13939
13948
|
},
|
|
13940
13949
|
children: "Muted"
|
|
13941
13950
|
}),
|
|
13942
|
-
/* @__PURE__ */ g(
|
|
13951
|
+
/* @__PURE__ */ g(m_, {
|
|
13943
13952
|
size: 72,
|
|
13944
13953
|
voiceState: T,
|
|
13945
13954
|
isMuted: D,
|
|
@@ -14011,7 +14020,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14011
14020
|
y2: "23"
|
|
14012
14021
|
})
|
|
14013
14022
|
]
|
|
14014
|
-
}) : /* @__PURE__ */ g(
|
|
14023
|
+
}) : /* @__PURE__ */ g(xh, {
|
|
14015
14024
|
size: 16,
|
|
14016
14025
|
color: "currentColor"
|
|
14017
14026
|
})
|
|
@@ -14033,7 +14042,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14033
14042
|
padding: 0,
|
|
14034
14043
|
flexShrink: 0
|
|
14035
14044
|
},
|
|
14036
|
-
children: /* @__PURE__ */ g(
|
|
14045
|
+
children: /* @__PURE__ */ g(kh, {
|
|
14037
14046
|
size: 16,
|
|
14038
14047
|
color: "currentColor"
|
|
14039
14048
|
})
|
|
@@ -14082,7 +14091,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14082
14091
|
onMouseLeave: (e) => {
|
|
14083
14092
|
e.currentTarget.style.background = "none";
|
|
14084
14093
|
},
|
|
14085
|
-
children: [/* @__PURE__ */ g(
|
|
14094
|
+
children: [/* @__PURE__ */ g(Ah, {}), C]
|
|
14086
14095
|
}),
|
|
14087
14096
|
/* @__PURE__ */ _("button", {
|
|
14088
14097
|
onClick: () => {
|
|
@@ -14111,7 +14120,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14111
14120
|
onMouseLeave: (e) => {
|
|
14112
14121
|
e.currentTarget.style.background = "none";
|
|
14113
14122
|
},
|
|
14114
|
-
children: [/* @__PURE__ */ g(
|
|
14123
|
+
children: [/* @__PURE__ */ g(jh, {}), w]
|
|
14115
14124
|
}),
|
|
14116
14125
|
/* @__PURE__ */ g("button", {
|
|
14117
14126
|
onClick: () => A(!1),
|
|
@@ -14163,7 +14172,7 @@ function g_({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
|
|
|
14163
14172
|
]
|
|
14164
14173
|
});
|
|
14165
14174
|
}
|
|
14166
|
-
function
|
|
14175
|
+
function v_({ orbColors: e }) {
|
|
14167
14176
|
let t = Array.isArray(e) && e.length > 0 ? e : [
|
|
14168
14177
|
"#135bd8",
|
|
14169
14178
|
"#ef334b",
|
|
@@ -14182,7 +14191,7 @@ function __({ orbColors: e }) {
|
|
|
14182
14191
|
`.replace(/\s+/g, " ").trim()
|
|
14183
14192
|
} });
|
|
14184
14193
|
}
|
|
14185
|
-
var
|
|
14194
|
+
var y_ = () => /* @__PURE__ */ g("div", {
|
|
14186
14195
|
style: {
|
|
14187
14196
|
display: "flex",
|
|
14188
14197
|
marginBottom: "12px",
|
|
@@ -14212,7 +14221,7 @@ var v_ = () => /* @__PURE__ */ g("div", {
|
|
|
14212
14221
|
} }, e))
|
|
14213
14222
|
})
|
|
14214
14223
|
});
|
|
14215
|
-
function
|
|
14224
|
+
function b_({ 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: se, setMicError: ce, dismissCallError: le, activeCallId: ue, isCallMuted: de, toggleCallMute: fe, endWebRTCCall: pe, formatCallDuration: me, callDurationSeconds: he, isCallMinimized: ge, onExpand: P, onCollapse: _e, onStartVoice: ve, voiceEnabled: ye, headerBgColor: be, onNewChat: F, showPoweredBy: xe, privacyPolicyUrl: I, getVisitorChatHistory: Se, resumeChat: Ce, isSessionRestoring: L, isClosing: we }) {
|
|
14216
14225
|
let Te = l.length > 0, Ee = T || E || w, De = !!ue, [Oe, ke] = m(!1), [Ae, je] = m(!1), [Me, R] = m([]), [z, Ne] = m(!1), Pe = p(null), [Fe, B] = m(() => typeof window < "u" ? window.visualViewport?.height ?? window.innerHeight : 600), [V, Ie] = m(0);
|
|
14217
14226
|
c(() => {
|
|
14218
14227
|
if (!s) return;
|
|
@@ -14352,7 +14361,7 @@ function y_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14352
14361
|
justifyContent: "center",
|
|
14353
14362
|
height: "40px"
|
|
14354
14363
|
},
|
|
14355
|
-
children: i ? /* @__PURE__ */ g(
|
|
14364
|
+
children: i ? /* @__PURE__ */ g(d_, {
|
|
14356
14365
|
logo: i,
|
|
14357
14366
|
style: {
|
|
14358
14367
|
height: "34px",
|
|
@@ -14365,7 +14374,7 @@ function y_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14365
14374
|
height: "40px",
|
|
14366
14375
|
flexShrink: 0
|
|
14367
14376
|
},
|
|
14368
|
-
children: /* @__PURE__ */ g(
|
|
14377
|
+
children: /* @__PURE__ */ g(f_, { title: e.chatTitle })
|
|
14369
14378
|
})
|
|
14370
14379
|
}), o && /* @__PURE__ */ g("div", {
|
|
14371
14380
|
style: {
|
|
@@ -14648,7 +14657,7 @@ function y_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14648
14657
|
})
|
|
14649
14658
|
]
|
|
14650
14659
|
}),
|
|
14651
|
-
/* @__PURE__ */ g(
|
|
14660
|
+
/* @__PURE__ */ g($h, {
|
|
14652
14661
|
webRTCError: oe,
|
|
14653
14662
|
micError: se,
|
|
14654
14663
|
setMicError: ce,
|
|
@@ -14656,7 +14665,7 @@ function y_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14656
14665
|
isRateLimited: E,
|
|
14657
14666
|
rateLimitMessage: D
|
|
14658
14667
|
}),
|
|
14659
|
-
ge && /* @__PURE__ */ g(
|
|
14668
|
+
ge && /* @__PURE__ */ g(gg, {
|
|
14660
14669
|
agentName: v,
|
|
14661
14670
|
agentHeadshot: y,
|
|
14662
14671
|
fallbackAgentName: b,
|
|
@@ -14790,17 +14799,17 @@ function y_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14790
14799
|
children: "No previous chats found."
|
|
14791
14800
|
})
|
|
14792
14801
|
})]
|
|
14793
|
-
}) : null, Te ? /* @__PURE__ */ g(
|
|
14802
|
+
}) : null, Te ? /* @__PURE__ */ g(Xh, {
|
|
14794
14803
|
chatHistory: l,
|
|
14795
14804
|
isAiTyping: u,
|
|
14796
14805
|
isLoading: T,
|
|
14797
14806
|
isAgentTyping: d,
|
|
14798
14807
|
setReplyContext: N,
|
|
14799
|
-
TypingDots:
|
|
14808
|
+
TypingDots: y_,
|
|
14800
14809
|
primaryColor: n,
|
|
14801
14810
|
agentHeadshot: y,
|
|
14802
14811
|
agentDisplayName: v || b,
|
|
14803
|
-
botAvatarNode: /* @__PURE__ */ g(
|
|
14812
|
+
botAvatarNode: /* @__PURE__ */ g(v_, { orbColors: t })
|
|
14804
14813
|
}) : L ? /* @__PURE__ */ _("div", {
|
|
14805
14814
|
style: {
|
|
14806
14815
|
flex: 1,
|
|
@@ -14841,7 +14850,7 @@ function y_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14841
14850
|
padding: "28px 24px"
|
|
14842
14851
|
},
|
|
14843
14852
|
children: [
|
|
14844
|
-
/* @__PURE__ */ g(
|
|
14853
|
+
/* @__PURE__ */ g(m_, {
|
|
14845
14854
|
size: 94,
|
|
14846
14855
|
orbColors: t
|
|
14847
14856
|
}),
|
|
@@ -14932,7 +14941,7 @@ function y_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
14932
14941
|
zIndex: 1,
|
|
14933
14942
|
padding: ne ? "6px 0 0" : "12px 0 0"
|
|
14934
14943
|
},
|
|
14935
|
-
children: /* @__PURE__ */ g(
|
|
14944
|
+
children: /* @__PURE__ */ g(Qh, {
|
|
14936
14945
|
input: x,
|
|
14937
14946
|
setInput: S,
|
|
14938
14947
|
onSubmit: C,
|
|
@@ -15006,7 +15015,7 @@ function y_({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
15006
15015
|
]
|
|
15007
15016
|
});
|
|
15008
15017
|
}
|
|
15009
|
-
function
|
|
15018
|
+
function x_() {
|
|
15010
15019
|
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, sendMessage: j, uploadChatFile: M, openWidget: re, captureVisitorEmail: ie, setVoiceMode: ae, endConversation: N, startNewChat: ce, acceptCall: le, rejectCall: ue, endWebRTCCall: de, toggleCallMute: fe, dismissCallError: pe, startTyping: me, stopTyping: he, updateTypingDraft: ge, getVisitorChatHistory: P, resumeChat: _e, isSessionRestoring: ve, openToChatCounter: ye, voiceEndCounter: be } = Cn();
|
|
15011
15020
|
c(() => {
|
|
15012
15021
|
try {
|
|
@@ -15028,7 +15037,7 @@ function b_() {
|
|
|
15028
15037
|
small: 50,
|
|
15029
15038
|
medium: 64,
|
|
15030
15039
|
large: 80
|
|
15031
|
-
}, je = Ae[L.orbSize] || Ae.small, Me = L.position || "bottom-right", R = I.fallbackAgentName || "Agent", z =
|
|
15040
|
+
}, je = Ae[L.orbSize] || Ae.small, Me = L.position || "bottom-right", R = I.fallbackAgentName || "Agent", z = c_(De ?? L.chatBgColors), Ne = I.logo || I.logoUrl || null, Pe = A || "en", Fe = F.recommendations?.[Pe] || [], B = (xe.recommendations?.[Pe] ?? Fe).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
|
|
15032
15041
|
id: e.key || `qr-${t}`,
|
|
15033
15042
|
label: e.label,
|
|
15034
15043
|
message: e.label,
|
|
@@ -15119,7 +15128,7 @@ function b_() {
|
|
|
15119
15128
|
let Ot = o(() => {
|
|
15120
15129
|
mt(null), gt("");
|
|
15121
15130
|
}, []), kt = o((e) => {
|
|
15122
|
-
let t =
|
|
15131
|
+
let t = Gh(e);
|
|
15123
15132
|
if (t) {
|
|
15124
15133
|
mt(null), gt(t);
|
|
15125
15134
|
return;
|
|
@@ -15225,7 +15234,7 @@ function b_() {
|
|
|
15225
15234
|
if (pt) {
|
|
15226
15235
|
try {
|
|
15227
15236
|
vt(!0), gt("");
|
|
15228
|
-
let e = await M(pt), n = e?.data || e, r = et.trim() || `Shared file: ${
|
|
15237
|
+
let e = await M(pt), n = e?.data || e, r = et.trim() || `Shared file: ${qh(pt)}`;
|
|
15229
15238
|
tt(""), G(null), Ot(), await j(r, "", t, {
|
|
15230
15239
|
type: "file",
|
|
15231
15240
|
metadata: {
|
|
@@ -15318,7 +15327,7 @@ function b_() {
|
|
|
15318
15327
|
onWheel: (e) => e.stopPropagation(),
|
|
15319
15328
|
onTouchMove: (e) => e.stopPropagation(),
|
|
15320
15329
|
children: [
|
|
15321
|
-
W === "entry_prompt" && /* @__PURE__ */ g(
|
|
15330
|
+
W === "entry_prompt" && /* @__PURE__ */ g(h_, {
|
|
15322
15331
|
copy: Ke,
|
|
15323
15332
|
orbColors: De,
|
|
15324
15333
|
primaryColor: ke,
|
|
@@ -15401,13 +15410,13 @@ function b_() {
|
|
|
15401
15410
|
children: E === "connected" ? `${Ft(lt)} with ${U}` : `Tap to return to ${U}`
|
|
15402
15411
|
})]
|
|
15403
15412
|
})]
|
|
15404
|
-
}), /* @__PURE__ */ g(
|
|
15413
|
+
}), /* @__PURE__ */ g(m_, {
|
|
15405
15414
|
size: je,
|
|
15406
15415
|
orbColors: De,
|
|
15407
15416
|
onClick: T ? At : Ee ? zt : Vt
|
|
15408
15417
|
})]
|
|
15409
15418
|
}),
|
|
15410
|
-
W === "connection_modal" && /* @__PURE__ */ g(
|
|
15419
|
+
W === "connection_modal" && /* @__PURE__ */ g(g_, {
|
|
15411
15420
|
copy: Ke,
|
|
15412
15421
|
orbColors: De,
|
|
15413
15422
|
primaryColor: ke,
|
|
@@ -15417,7 +15426,7 @@ function b_() {
|
|
|
15417
15426
|
isMobile: Et,
|
|
15418
15427
|
isClosing: xt
|
|
15419
15428
|
}),
|
|
15420
|
-
W === "voice_mode" && /* @__PURE__ */ g(
|
|
15429
|
+
W === "voice_mode" && /* @__PURE__ */ g(__, {
|
|
15421
15430
|
orbColors: De,
|
|
15422
15431
|
onEnterChat: Vt,
|
|
15423
15432
|
onEndChat: Ht,
|
|
@@ -15438,7 +15447,7 @@ function b_() {
|
|
|
15438
15447
|
enterChatModeLabel: I.voiceEnterChatLabel || "Enter Chat Mode",
|
|
15439
15448
|
endConversationLabel: I.voiceEndConversationLabel || "End Conversation"
|
|
15440
15449
|
}, "voice"),
|
|
15441
|
-
W === "call_screen" && /* @__PURE__ */ g(
|
|
15450
|
+
W === "call_screen" && /* @__PURE__ */ g(hg, {
|
|
15442
15451
|
incomingCall: w,
|
|
15443
15452
|
activeCallId: T,
|
|
15444
15453
|
callConnectionState: E,
|
|
@@ -15457,7 +15466,7 @@ function b_() {
|
|
|
15457
15466
|
orbColors: De,
|
|
15458
15467
|
chatHistory: r
|
|
15459
15468
|
}),
|
|
15460
|
-
W === "text_chat" && /* @__PURE__ */ g(
|
|
15469
|
+
W === "text_chat" && /* @__PURE__ */ g(b_, {
|
|
15461
15470
|
isClosing: xt,
|
|
15462
15471
|
copy: Ke,
|
|
15463
15472
|
orbColors: De,
|
|
@@ -15523,7 +15532,7 @@ function b_() {
|
|
|
15523
15532
|
}
|
|
15524
15533
|
//#endregion
|
|
15525
15534
|
//#region src/components/ErrorBoundary.jsx
|
|
15526
|
-
var
|
|
15535
|
+
var S_ = class extends e.Component {
|
|
15527
15536
|
constructor(e) {
|
|
15528
15537
|
super(e), this.state = { hasError: !1 };
|
|
15529
15538
|
}
|
|
@@ -15538,4 +15547,4 @@ var x_ = class extends e.Component {
|
|
|
15538
15547
|
}
|
|
15539
15548
|
};
|
|
15540
15549
|
//#endregion
|
|
15541
|
-
export {
|
|
15550
|
+
export { cg as AnimatedOrb, S_ as ErrorBoundary, pi as FlowEngageProvider, x_ as FlowEngageWidget, Cn as useFlowEngage };
|