@flowengage/react-chatbot 5.0.42 → 5.0.44
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.
|
@@ -26268,7 +26268,43 @@ var _D = class extends HE {
|
|
|
26268
26268
|
static startSession(e) {
|
|
26269
26269
|
return e.textOnly ? aD.startSession(e) : uD.startSession(e);
|
|
26270
26270
|
}
|
|
26271
|
-
}, vD =
|
|
26271
|
+
}, vD = {
|
|
26272
|
+
wordsSoFar: 0,
|
|
26273
|
+
speechStartTime: 0,
|
|
26274
|
+
isSpeaking: !1,
|
|
26275
|
+
items: [],
|
|
26276
|
+
timers: [],
|
|
26277
|
+
lastHighlightId: null,
|
|
26278
|
+
isVoiceMode: !1
|
|
26279
|
+
};
|
|
26280
|
+
function yD() {
|
|
26281
|
+
vD.timers.forEach(clearTimeout), vD.wordsSoFar = 0, vD.speechStartTime = 0, vD.isSpeaking = !1, vD.items = [], vD.timers = [], vD.lastHighlightId = null;
|
|
26282
|
+
}
|
|
26283
|
+
//#endregion
|
|
26284
|
+
//#region src/utils/highlightEngine.js
|
|
26285
|
+
var bD = 80;
|
|
26286
|
+
function xD(e) {
|
|
26287
|
+
requestAnimationFrame(() => {
|
|
26288
|
+
let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r = bD, i = r + (window.innerHeight - r) / 2, a = window.pageYOffset + n - i;
|
|
26289
|
+
window.scrollTo({
|
|
26290
|
+
top: Math.max(0, a),
|
|
26291
|
+
behavior: "smooth"
|
|
26292
|
+
});
|
|
26293
|
+
});
|
|
26294
|
+
}
|
|
26295
|
+
function SD(e) {
|
|
26296
|
+
if (!e || e.hasAttribute("data-fe-highlighted")) return;
|
|
26297
|
+
CD(), e.classList?.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"), xD(e);
|
|
26298
|
+
let t = e.style.cssText;
|
|
26299
|
+
e.setAttribute("data-fe-highlighted", "true"), e.setAttribute("data-fe-orig-style", t), e.style.outline = "3px solid #2563eb", e.style.outlineOffset = "8px", e.style.background = "rgba(37, 99, 235, 0.08)", e.style.borderRadius = "8px", e.style.padding = "12px 16px", e.style.transition = "all 0.4s ease";
|
|
26300
|
+
}
|
|
26301
|
+
function CD() {
|
|
26302
|
+
let e = document.querySelector("[data-fe-highlighted]");
|
|
26303
|
+
e && (e.style.cssText = e.getAttribute("data-fe-orig-style") || "", e.removeAttribute("data-fe-highlighted"), e.removeAttribute("data-fe-orig-style"));
|
|
26304
|
+
}
|
|
26305
|
+
//#endregion
|
|
26306
|
+
//#region src/lib/svgIcons.jsx
|
|
26307
|
+
var wD = ({ size: e = 18, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
26272
26308
|
width: e,
|
|
26273
26309
|
height: e,
|
|
26274
26310
|
viewBox: "0 0 24 24",
|
|
@@ -26284,7 +26320,7 @@ var _D = class extends HE {
|
|
|
26284
26320
|
strokeLinecap: "round",
|
|
26285
26321
|
strokeLinejoin: "round"
|
|
26286
26322
|
})]
|
|
26287
|
-
}),
|
|
26323
|
+
}), TD = ({ size: e = 20 }) => /* @__PURE__ */ _("svg", {
|
|
26288
26324
|
width: e,
|
|
26289
26325
|
height: e,
|
|
26290
26326
|
viewBox: "0 0 24 24",
|
|
@@ -26299,7 +26335,7 @@ var _D = class extends HE {
|
|
|
26299
26335
|
x2: "1",
|
|
26300
26336
|
y2: "23"
|
|
26301
26337
|
})]
|
|
26302
|
-
}),
|
|
26338
|
+
}), ED = ({ size: e = 18 }) => /* @__PURE__ */ _("svg", {
|
|
26303
26339
|
width: e,
|
|
26304
26340
|
height: e,
|
|
26305
26341
|
viewBox: "0 0 24 24",
|
|
@@ -26314,7 +26350,7 @@ var _D = class extends HE {
|
|
|
26314
26350
|
x2: "12",
|
|
26315
26351
|
y2: "5"
|
|
26316
26352
|
}), /* @__PURE__ */ g("polyline", { points: "5 12 12 5 19 12" })]
|
|
26317
|
-
}),
|
|
26353
|
+
}), DD = () => /* @__PURE__ */ _("svg", {
|
|
26318
26354
|
width: "14",
|
|
26319
26355
|
height: "14",
|
|
26320
26356
|
viewBox: "0 0 24 24",
|
|
@@ -26324,7 +26360,7 @@ var _D = class extends HE {
|
|
|
26324
26360
|
strokeLinecap: "round",
|
|
26325
26361
|
strokeLinejoin: "round",
|
|
26326
26362
|
children: [/* @__PURE__ */ g("polyline", { points: "9 17 4 12 9 7" }), /* @__PURE__ */ g("path", { d: "M20 18v-2a4 4 0 00-4-4H4" })]
|
|
26327
|
-
}),
|
|
26363
|
+
}), OD = () => /* @__PURE__ */ g("svg", {
|
|
26328
26364
|
width: "18",
|
|
26329
26365
|
height: "18",
|
|
26330
26366
|
viewBox: "0 0 24 24",
|
|
@@ -26334,7 +26370,7 @@ var _D = class extends HE {
|
|
|
26334
26370
|
strokeLinecap: "round",
|
|
26335
26371
|
strokeLinejoin: "round",
|
|
26336
26372
|
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" })
|
|
26337
|
-
}),
|
|
26373
|
+
}), kD = ({ className: e = "" }) => /* @__PURE__ */ _("svg", {
|
|
26338
26374
|
className: e,
|
|
26339
26375
|
width: "14",
|
|
26340
26376
|
height: "14",
|
|
@@ -26363,7 +26399,7 @@ var _D = class extends HE {
|
|
|
26363
26399
|
y2: "16"
|
|
26364
26400
|
})
|
|
26365
26401
|
]
|
|
26366
|
-
}),
|
|
26402
|
+
}), AD = ({ size: e = 14 }) => /* @__PURE__ */ _("svg", {
|
|
26367
26403
|
width: e,
|
|
26368
26404
|
height: e,
|
|
26369
26405
|
viewBox: "0 0 24 24",
|
|
@@ -26386,7 +26422,7 @@ var _D = class extends HE {
|
|
|
26386
26422
|
/* @__PURE__ */ g("path", { d: "M15 13v2" }),
|
|
26387
26423
|
/* @__PURE__ */ g("path", { d: "M9 13v2" })
|
|
26388
26424
|
]
|
|
26389
|
-
}),
|
|
26425
|
+
}), jD = ({ size: e = 20, strokeWidth: t = 2, color: n = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
26390
26426
|
width: e,
|
|
26391
26427
|
height: e,
|
|
26392
26428
|
viewBox: "0 0 24 24",
|
|
@@ -26406,7 +26442,7 @@ var _D = class extends HE {
|
|
|
26406
26442
|
x2: "19",
|
|
26407
26443
|
y2: "12"
|
|
26408
26444
|
})]
|
|
26409
|
-
}),
|
|
26445
|
+
}), MD = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
26410
26446
|
width: e,
|
|
26411
26447
|
height: e,
|
|
26412
26448
|
viewBox: "0 0 24 24",
|
|
@@ -26432,7 +26468,7 @@ var _D = class extends HE {
|
|
|
26432
26468
|
fill: t
|
|
26433
26469
|
})
|
|
26434
26470
|
]
|
|
26435
|
-
}),
|
|
26471
|
+
}), ND = ({ size: e = 20, color: t = "currentColor" }) => /* @__PURE__ */ _("svg", {
|
|
26436
26472
|
width: "24",
|
|
26437
26473
|
height: "24",
|
|
26438
26474
|
viewBox: "0 0 24 24",
|
|
@@ -26450,7 +26486,7 @@ var _D = class extends HE {
|
|
|
26450
26486
|
"stroke-linecap": "round",
|
|
26451
26487
|
"stroke-linejoin": "round"
|
|
26452
26488
|
})]
|
|
26453
|
-
}),
|
|
26489
|
+
}), PD = () => /* @__PURE__ */ g("svg", {
|
|
26454
26490
|
width: "24",
|
|
26455
26491
|
height: "24",
|
|
26456
26492
|
viewBox: "0 0 24 24",
|
|
@@ -26462,7 +26498,7 @@ var _D = class extends HE {
|
|
|
26462
26498
|
"stroke-width": "1.5",
|
|
26463
26499
|
"stroke-linejoin": "round"
|
|
26464
26500
|
})
|
|
26465
|
-
}),
|
|
26501
|
+
}), FD = ({ size: e = 24 }) => /* @__PURE__ */ _("svg", {
|
|
26466
26502
|
xmlns: "http://www.w3.org/2000/svg",
|
|
26467
26503
|
width: e,
|
|
26468
26504
|
height: e,
|
|
@@ -26480,7 +26516,7 @@ var _D = class extends HE {
|
|
|
26480
26516
|
/* @__PURE__ */ g("path", { d: "m2 2 20 20" }),
|
|
26481
26517
|
/* @__PURE__ */ g("path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12" })
|
|
26482
26518
|
]
|
|
26483
|
-
}),
|
|
26519
|
+
}), ID = (e = "") => String(e).replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim(), LD = (e = "") => String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), RD = new Set([
|
|
26484
26520
|
"p",
|
|
26485
26521
|
"br",
|
|
26486
26522
|
"ul",
|
|
@@ -26491,30 +26527,30 @@ var _D = class extends HE {
|
|
|
26491
26527
|
"b",
|
|
26492
26528
|
"i",
|
|
26493
26529
|
"a"
|
|
26494
|
-
]),
|
|
26495
|
-
function
|
|
26530
|
+
]), zD = /^https?:\/\//i;
|
|
26531
|
+
function BD(e) {
|
|
26496
26532
|
let t = Array.from(e.childNodes);
|
|
26497
26533
|
for (let n of t) if (n.nodeType === Node.ELEMENT_NODE) {
|
|
26498
26534
|
let t = n.tagName.toLowerCase();
|
|
26499
|
-
if (!
|
|
26535
|
+
if (!RD.has(t)) {
|
|
26500
26536
|
e.replaceChild(document.createTextNode(n.textContent), n);
|
|
26501
26537
|
continue;
|
|
26502
26538
|
}
|
|
26503
26539
|
let r = {};
|
|
26504
26540
|
if (t === "a") {
|
|
26505
26541
|
let e = n.getAttribute("href") || "";
|
|
26506
|
-
|
|
26542
|
+
zD.test(e) && (r.href = e), r.target = "_blank", r.rel = "noopener noreferrer";
|
|
26507
26543
|
}
|
|
26508
26544
|
for (; n.attributes.length > 0;) n.removeAttribute(n.attributes[0].name);
|
|
26509
26545
|
for (let [e, t] of Object.entries(r)) n.setAttribute(e, t);
|
|
26510
|
-
|
|
26546
|
+
BD(n);
|
|
26511
26547
|
} else n.nodeType !== Node.TEXT_NODE && e.removeChild(n);
|
|
26512
26548
|
}
|
|
26513
|
-
function
|
|
26549
|
+
function VD(e) {
|
|
26514
26550
|
let t = document.createElement("div");
|
|
26515
|
-
return t.innerHTML = e,
|
|
26551
|
+
return t.innerHTML = e, BD(t), t.innerHTML;
|
|
26516
26552
|
}
|
|
26517
|
-
function
|
|
26553
|
+
function HD(e) {
|
|
26518
26554
|
let t = String(e || "").trim();
|
|
26519
26555
|
if (!t) return t;
|
|
26520
26556
|
let n = /^<p>\s*<strong>([\s\S]*?)<\/strong>\s*<\/p>$/i.exec(t);
|
|
@@ -26526,33 +26562,33 @@ function ID(e) {
|
|
|
26526
26562
|
}
|
|
26527
26563
|
return e;
|
|
26528
26564
|
}
|
|
26529
|
-
var
|
|
26565
|
+
var UD = (e = "") => {
|
|
26530
26566
|
let t = String(e || "").trim();
|
|
26531
26567
|
if (!t) return "";
|
|
26532
|
-
if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return
|
|
26533
|
-
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) =>
|
|
26534
|
-
return
|
|
26568
|
+
if (/<(p|br|ul|ol|li|strong|em|a)\b/i.test(t)) return HD(VD(t));
|
|
26569
|
+
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) => LD(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>");
|
|
26570
|
+
return HD(n.map((e) => {
|
|
26535
26571
|
let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = t.filter((e) => /^[-*]\s+/.test(e));
|
|
26536
26572
|
if (n.length >= 2 && n.length === t.length) return `<ul>${n.map((e) => `<li>${r(e.replace(/^[-*]\s+/, ""))}</li>`).join("")}</ul>`;
|
|
26537
26573
|
let i = e.split(/\s+(?=[-*]\s+\*\*?)/).map((e) => e.trim()).filter(Boolean);
|
|
26538
26574
|
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>`;
|
|
26539
26575
|
}).join(""));
|
|
26540
|
-
},
|
|
26576
|
+
}, WD = new Set(["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"]), GD = new Set([
|
|
26541
26577
|
".pdf",
|
|
26542
26578
|
".docx",
|
|
26543
26579
|
".png",
|
|
26544
26580
|
".jpg",
|
|
26545
26581
|
".jpeg"
|
|
26546
|
-
]),
|
|
26547
|
-
function
|
|
26582
|
+
]), KD = "image/png,image/jpeg,.pdf,.docx";
|
|
26583
|
+
function qD(e) {
|
|
26548
26584
|
if (!e) return !1;
|
|
26549
26585
|
let t = typeof e.name == "string" ? e.name.toLowerCase() : "", n = t.includes(".") ? `.${t.split(".").pop()}` : "", r = typeof e.type == "string" ? e.type.toLowerCase() : "";
|
|
26550
|
-
return r === "image/png" || r === "image/jpeg" ||
|
|
26586
|
+
return r === "image/png" || r === "image/jpeg" || WD.has(r) || GD.has(n);
|
|
26551
26587
|
}
|
|
26552
|
-
function
|
|
26553
|
-
return e ?
|
|
26588
|
+
function JD(e) {
|
|
26589
|
+
return e ? qD(e) ? e.size > 2097152 ? "File must be 2 MB or smaller." : "" : "Only PNG, JPEG, PDF, and DOCX files are allowed." : "No file selected.";
|
|
26554
26590
|
}
|
|
26555
|
-
function
|
|
26591
|
+
function YD(e = 0) {
|
|
26556
26592
|
if (!Number.isFinite(e) || e <= 0) return "";
|
|
26557
26593
|
let t = [
|
|
26558
26594
|
"B",
|
|
@@ -26564,12 +26600,12 @@ function UD(e = 0) {
|
|
|
26564
26600
|
let i = n >= 10 || r === 0 ? 0 : 1;
|
|
26565
26601
|
return `${n.toFixed(i)} ${t[r]}`;
|
|
26566
26602
|
}
|
|
26567
|
-
function
|
|
26603
|
+
function XD(e) {
|
|
26568
26604
|
return e ? e.name || "Attachment" : "";
|
|
26569
26605
|
}
|
|
26570
26606
|
//#endregion
|
|
26571
26607
|
//#region src/utils/avatarHelpers.js
|
|
26572
|
-
function
|
|
26608
|
+
function ZD(e) {
|
|
26573
26609
|
if (!e || typeof e != "string") return "?";
|
|
26574
26610
|
let t = e.trim();
|
|
26575
26611
|
if (!t) return "?";
|
|
@@ -26578,7 +26614,7 @@ function GD(e) {
|
|
|
26578
26614
|
}
|
|
26579
26615
|
//#endregion
|
|
26580
26616
|
//#region src/components/AvatarImageOrInitials.jsx
|
|
26581
|
-
function
|
|
26617
|
+
function QD({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
26582
26618
|
let [i, a] = m(null), o = typeof e == "string" ? e.trim() : "";
|
|
26583
26619
|
return c(() => {
|
|
26584
26620
|
if (!o) {
|
|
@@ -26600,12 +26636,12 @@ function KD({ src: e, name: t, imgStyle: n, initialsSpanStyle: r }) {
|
|
|
26600
26636
|
style: n
|
|
26601
26637
|
}) : /* @__PURE__ */ g("span", {
|
|
26602
26638
|
style: r,
|
|
26603
|
-
children:
|
|
26639
|
+
children: ZD(t)
|
|
26604
26640
|
});
|
|
26605
26641
|
}
|
|
26606
26642
|
//#endregion
|
|
26607
26643
|
//#region src/components/MessageList.jsx
|
|
26608
|
-
function
|
|
26644
|
+
function $D({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, setReplyContext: i, primaryColor: a = "#3B82F6", agentHeadshot: s = null, agentDisplayName: l = "Agent", botAvatarNode: u = null }) {
|
|
26609
26645
|
let { resolvedConfig: d } = Ln(), f = p(null), [v, y] = m(null), [b, x] = m(null), S = p(e.length), C = p(!0), w = p(null), T = o((e) => {
|
|
26610
26646
|
let t = e.target.closest("a[href]");
|
|
26611
26647
|
if (!t) return;
|
|
@@ -26660,7 +26696,7 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26660
26696
|
children: [
|
|
26661
26697
|
e.map((e) => {
|
|
26662
26698
|
if (e.type === "call_recording" || typeof e.message == "string" && e.message.includes("AI chat recording")) return null;
|
|
26663
|
-
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 =
|
|
26699
|
+
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 = ID(e.replyToContent || e.replyContext?.message || ""), v = e.replyToSender === "user" ? "You" : e.replyToSender === "agent" ? "Agent" : e.replyToSender === "ai" || e.replyToSender === "bot" ? "AI Assistant" : "Message";
|
|
26664
26700
|
return t ? /* @__PURE__ */ g("div", {
|
|
26665
26701
|
style: {
|
|
26666
26702
|
display: "flex",
|
|
@@ -26705,7 +26741,7 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26705
26741
|
fontWeight: 800,
|
|
26706
26742
|
marginTop: !c && (r || o) ? "22px" : "0px"
|
|
26707
26743
|
},
|
|
26708
|
-
children: r ? u || /* @__PURE__ */ g(
|
|
26744
|
+
children: r ? u || /* @__PURE__ */ g(AD, { size: 16 }) : /* @__PURE__ */ g(QD, {
|
|
26709
26745
|
src: p || "",
|
|
26710
26746
|
name: f,
|
|
26711
26747
|
imgStyle: {
|
|
@@ -26747,7 +26783,7 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26747
26783
|
onMouseLeave: (e) => {
|
|
26748
26784
|
e.currentTarget.style.color = "#9ca3af";
|
|
26749
26785
|
},
|
|
26750
|
-
children: [/* @__PURE__ */ g(
|
|
26786
|
+
children: [/* @__PURE__ */ g(DD, {}), "Reply"]
|
|
26751
26787
|
}),
|
|
26752
26788
|
/* @__PURE__ */ _("div", {
|
|
26753
26789
|
style: {
|
|
@@ -26791,7 +26827,7 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26791
26827
|
children: m
|
|
26792
26828
|
})]
|
|
26793
26829
|
}), d ? (() => {
|
|
26794
|
-
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i =
|
|
26830
|
+
let t = e.metadata.fileType || "", r = e.metadata.fileName || e.message || "File", i = YD(e.metadata.fileSize), a = t.startsWith("image/"), o = t === "application/pdf" ? {
|
|
26795
26831
|
color: "#ef4444",
|
|
26796
26832
|
label: "PDF"
|
|
26797
26833
|
} : t.includes("word") || t.includes("docx") ? {
|
|
@@ -26963,7 +26999,7 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
26963
26999
|
});
|
|
26964
27000
|
})() : r ? /* @__PURE__ */ g("div", {
|
|
26965
27001
|
className: "flowengage-message-content fe-bot-message",
|
|
26966
|
-
dangerouslySetInnerHTML: { __html:
|
|
27002
|
+
dangerouslySetInnerHTML: { __html: UD(e.message) },
|
|
26967
27003
|
onClick: T
|
|
26968
27004
|
}) : /* @__PURE__ */ g("div", {
|
|
26969
27005
|
style: { whiteSpace: n || o ? "normal" : "pre-wrap" },
|
|
@@ -27028,7 +27064,7 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27028
27064
|
boxShadow: u ? "none" : "0 8px 20px rgba(59,130,246,0.24)",
|
|
27029
27065
|
overflow: "hidden"
|
|
27030
27066
|
},
|
|
27031
|
-
children: u || /* @__PURE__ */ g(
|
|
27067
|
+
children: u || /* @__PURE__ */ g(AD, { size: 16 })
|
|
27032
27068
|
}), /* @__PURE__ */ _("div", {
|
|
27033
27069
|
style: {
|
|
27034
27070
|
display: "flex",
|
|
@@ -27070,7 +27106,7 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27070
27106
|
borderRadius: "50%",
|
|
27071
27107
|
overflow: "hidden"
|
|
27072
27108
|
},
|
|
27073
|
-
children: /* @__PURE__ */ g(
|
|
27109
|
+
children: /* @__PURE__ */ g(QD, {
|
|
27074
27110
|
src: s || "",
|
|
27075
27111
|
name: l,
|
|
27076
27112
|
imgStyle: {
|
|
@@ -27164,7 +27200,7 @@ function qD({ chatHistory: e, isAiTyping: t, isLoading: n, isAgentTyping: r, set
|
|
|
27164
27200
|
}
|
|
27165
27201
|
//#endregion
|
|
27166
27202
|
//#region src/components/ChatInput.jsx
|
|
27167
|
-
function
|
|
27203
|
+
function eO({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUiActive: i, handleToggleVoice: a, activeScreen: o, inputDisabled: s, replyContext: c, clearReplyContext: l, requiresEmail: u, emailInput: d, setEmailInput: f, emailError: m, showVoiceToggle: v = !1, voiceEnabled: y = !0, onFileSelect: b, selectedFile: x = null, onRemoveSelectedFile: S, attachmentError: C = "", isUploadingAttachment: w = !1, inputPlaceholder: T = "Type your message" }) {
|
|
27168
27204
|
let ee = p(null), te = c?.sender === "user" ? "You" : c?.sender === "agent" ? "Agent" : "AI Assistant", ne = u ? !!d?.trim() : !!e?.trim() || !!x, re = s || w || !ne, E = !u && y && v;
|
|
27169
27205
|
return /* @__PURE__ */ _("div", {
|
|
27170
27206
|
style: {
|
|
@@ -27259,7 +27295,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27259
27295
|
background: "rgba(59,130,246,0.08)",
|
|
27260
27296
|
color: "var(--flowengage-primary)"
|
|
27261
27297
|
},
|
|
27262
|
-
children: /* @__PURE__ */ g(
|
|
27298
|
+
children: /* @__PURE__ */ g(AD, { size: 13 })
|
|
27263
27299
|
}), /* @__PURE__ */ g("span", { children: "Please provide your email address so we can help you." })]
|
|
27264
27300
|
})
|
|
27265
27301
|
}),
|
|
@@ -27299,7 +27335,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27299
27335
|
overflow: "hidden",
|
|
27300
27336
|
textOverflow: "ellipsis"
|
|
27301
27337
|
},
|
|
27302
|
-
children:
|
|
27338
|
+
children: XD(x)
|
|
27303
27339
|
}),
|
|
27304
27340
|
/* @__PURE__ */ g("div", {
|
|
27305
27341
|
style: {
|
|
@@ -27307,7 +27343,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27307
27343
|
color: "#6b7280",
|
|
27308
27344
|
marginTop: "2px"
|
|
27309
27345
|
},
|
|
27310
|
-
children:
|
|
27346
|
+
children: YD(x.size)
|
|
27311
27347
|
})
|
|
27312
27348
|
]
|
|
27313
27349
|
}), /* @__PURE__ */ g("button", {
|
|
@@ -27352,7 +27388,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27352
27388
|
E ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("input", {
|
|
27353
27389
|
ref: ee,
|
|
27354
27390
|
type: "file",
|
|
27355
|
-
accept:
|
|
27391
|
+
accept: KD,
|
|
27356
27392
|
style: { display: "none" },
|
|
27357
27393
|
onChange: (e) => {
|
|
27358
27394
|
let t = e.target.files?.[0];
|
|
@@ -27384,7 +27420,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27384
27420
|
onMouseLeave: (e) => {
|
|
27385
27421
|
e.currentTarget.style.opacity = "1";
|
|
27386
27422
|
},
|
|
27387
|
-
children: /* @__PURE__ */ g(
|
|
27423
|
+
children: /* @__PURE__ */ g(jD, {
|
|
27388
27424
|
size: 16,
|
|
27389
27425
|
color: "currentColor"
|
|
27390
27426
|
})
|
|
@@ -27441,7 +27477,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27441
27477
|
onMouseLeave: (e) => {
|
|
27442
27478
|
e.currentTarget.style.opacity = "1";
|
|
27443
27479
|
},
|
|
27444
|
-
children: /* @__PURE__ */ g(
|
|
27480
|
+
children: /* @__PURE__ */ g(ED, { size: 16 })
|
|
27445
27481
|
})
|
|
27446
27482
|
]
|
|
27447
27483
|
}),
|
|
@@ -27504,7 +27540,7 @@ function JD({ input: e, setInput: t, onSubmit: n, isConversationEnded: r, callUi
|
|
|
27504
27540
|
}
|
|
27505
27541
|
//#endregion
|
|
27506
27542
|
//#region src/components/StatusBanners.jsx
|
|
27507
|
-
function
|
|
27543
|
+
function tO({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r, isRateLimited: i, rateLimitMessage: a }) {
|
|
27508
27544
|
return /* @__PURE__ */ _(h, { children: [(e || t) && /* @__PURE__ */ _("div", {
|
|
27509
27545
|
style: {
|
|
27510
27546
|
margin: "0 20px 10px",
|
|
@@ -27517,7 +27553,7 @@ function YD({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
27517
27553
|
gap: "10px"
|
|
27518
27554
|
},
|
|
27519
27555
|
children: [
|
|
27520
|
-
/* @__PURE__ */ g(
|
|
27556
|
+
/* @__PURE__ */ g(kD, { className: "" }),
|
|
27521
27557
|
/* @__PURE__ */ g("span", {
|
|
27522
27558
|
style: {
|
|
27523
27559
|
fontSize: "12px",
|
|
@@ -27563,13 +27599,13 @@ function YD({ webRTCError: e, micError: t, setMicError: n, dismissCallError: r,
|
|
|
27563
27599
|
}
|
|
27564
27600
|
//#endregion
|
|
27565
27601
|
//#region src/components/AnimatedOrb.jsx
|
|
27566
|
-
var
|
|
27602
|
+
var nO = [
|
|
27567
27603
|
"#135bd8",
|
|
27568
27604
|
"#ef334b",
|
|
27569
27605
|
"#ffbd2e"
|
|
27570
27606
|
];
|
|
27571
|
-
function
|
|
27572
|
-
return !Array.isArray(e) || e.length === 0 ?
|
|
27607
|
+
function rO(e) {
|
|
27608
|
+
return !Array.isArray(e) || e.length === 0 ? nO : e.length === 1 ? [
|
|
27573
27609
|
e[0],
|
|
27574
27610
|
e[0],
|
|
27575
27611
|
e[0]
|
|
@@ -27583,7 +27619,7 @@ function ZD(e) {
|
|
|
27583
27619
|
e[2]
|
|
27584
27620
|
];
|
|
27585
27621
|
}
|
|
27586
|
-
var
|
|
27622
|
+
var iO = {
|
|
27587
27623
|
idle: 3,
|
|
27588
27624
|
listening: .75,
|
|
27589
27625
|
thinking: 1,
|
|
@@ -27591,7 +27627,7 @@ var QD = {
|
|
|
27591
27627
|
muted: .75,
|
|
27592
27628
|
error: .08
|
|
27593
27629
|
};
|
|
27594
|
-
function
|
|
27630
|
+
function aO(e) {
|
|
27595
27631
|
if (!e || typeof e != "string") return [
|
|
27596
27632
|
0,
|
|
27597
27633
|
0,
|
|
@@ -27604,14 +27640,14 @@ function $D(e) {
|
|
|
27604
27640
|
parseInt(n.slice(4, 6), 16) / 255
|
|
27605
27641
|
];
|
|
27606
27642
|
}
|
|
27607
|
-
function
|
|
27643
|
+
function oO(e, t) {
|
|
27608
27644
|
if (!e || typeof e != "string") return `rgba(0,0,0,${t})`;
|
|
27609
27645
|
if (e.startsWith("rgb")) return e.replace(/[\d.]+\)$/, `${t})`);
|
|
27610
27646
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
|
|
27611
27647
|
return `rgba(${parseInt(r.slice(0, 2), 16)},${parseInt(r.slice(2, 4), 16)},${parseInt(r.slice(4, 6), 16)},${t})`;
|
|
27612
27648
|
}
|
|
27613
|
-
var
|
|
27614
|
-
function
|
|
27649
|
+
var sO = "\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", cO = "\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";
|
|
27650
|
+
function lO(e, t, n) {
|
|
27615
27651
|
let r = (t, n) => {
|
|
27616
27652
|
let r = e.createShader(t);
|
|
27617
27653
|
return e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (console.error("[AnimatedOrb shader]", e.getShaderInfoLog(r)), null);
|
|
@@ -27620,10 +27656,10 @@ function rO(e, t, n) {
|
|
|
27620
27656
|
let o = e.createProgram();
|
|
27621
27657
|
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);
|
|
27622
27658
|
}
|
|
27623
|
-
function
|
|
27624
|
-
let [s, l, u] =
|
|
27659
|
+
function uO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r, onClick: i, style: a, className: o }) {
|
|
27660
|
+
let [s, l, u] = rO(r), d = t === "speaking", f = e <= 50, m = p(null), h = p(iO[t] ?? .35);
|
|
27625
27661
|
c(() => {
|
|
27626
|
-
h.current =
|
|
27662
|
+
h.current = iO[t] ?? .35;
|
|
27627
27663
|
}, [t]), c(() => {
|
|
27628
27664
|
let t = m.current;
|
|
27629
27665
|
if (!t) return;
|
|
@@ -27640,7 +27676,7 @@ function iO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27640
27676
|
console.warn("[AnimatedOrb] WebGL unavailable.");
|
|
27641
27677
|
return;
|
|
27642
27678
|
}
|
|
27643
|
-
let i =
|
|
27679
|
+
let i = lO(r, sO, cO);
|
|
27644
27680
|
if (!i) {
|
|
27645
27681
|
console.error("[AnimatedOrb] WebGL program failed to compile/link");
|
|
27646
27682
|
return;
|
|
@@ -27670,7 +27706,7 @@ function iO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27670
27706
|
c2: r.getUniformLocation(i, "u_c2"),
|
|
27671
27707
|
c3: r.getUniformLocation(i, "u_c3")
|
|
27672
27708
|
};
|
|
27673
|
-
r.uniform3fv(c.c1,
|
|
27709
|
+
r.uniform3fv(c.c1, aO(s)), r.uniform3fv(c.c2, aO(l)), r.uniform3fv(c.c3, aO(u)), r.viewport(0, 0, t.width, t.height);
|
|
27674
27710
|
let d = performance.now(), f, p = (e) => {
|
|
27675
27711
|
r.uniform1f(c.time, (e - d) / 1e3), r.uniform1f(c.speed, h.current), r.drawArrays(r.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
|
|
27676
27712
|
};
|
|
@@ -27701,7 +27737,7 @@ function iO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27701
27737
|
position: "absolute",
|
|
27702
27738
|
inset: -10,
|
|
27703
27739
|
borderRadius: "50%",
|
|
27704
|
-
background: `radial-gradient(circle, ${
|
|
27740
|
+
background: `radial-gradient(circle, ${oO(s, .18)} 0%, transparent 70%)`,
|
|
27705
27741
|
pointerEvents: "none"
|
|
27706
27742
|
},
|
|
27707
27743
|
animate: { opacity: [.3, .75] },
|
|
@@ -27779,17 +27815,17 @@ function iO({ size: e = 94, voiceState: t = "idle", isMuted: n = !1, colors: r,
|
|
|
27779
27815
|
}
|
|
27780
27816
|
//#endregion
|
|
27781
27817
|
//#region src/components/CallScreen.jsx
|
|
27782
|
-
var
|
|
27783
|
-
function
|
|
27818
|
+
var dO = "\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";
|
|
27819
|
+
function fO(e) {
|
|
27784
27820
|
let t = (e || "").replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
|
|
27785
27821
|
return `${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)}`;
|
|
27786
27822
|
}
|
|
27787
|
-
function
|
|
27823
|
+
function pO(e) {
|
|
27788
27824
|
if (!e || typeof e != "string") return "#1a1a1a";
|
|
27789
27825
|
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;
|
|
27790
27826
|
return .2126 * o(r) + .7152 * o(i) + .0722 * o(a) > .179 ? "#1a1a1a" : "#ffffff";
|
|
27791
27827
|
}
|
|
27792
|
-
function
|
|
27828
|
+
function mO(e, t) {
|
|
27793
27829
|
let n = Array.isArray(e) && e.length > 0 ? e : [t || "#3B82F6"], [r, i, a] = n;
|
|
27794
27830
|
return n.length === 1 ? [
|
|
27795
27831
|
`radial-gradient(ellipse 110% 65% at 50% -5%, ${r}28 0%, transparent 68%)`,
|
|
@@ -27806,8 +27842,8 @@ function cO(e, t) {
|
|
|
27806
27842
|
"#f7f8fa"
|
|
27807
27843
|
].join(", ");
|
|
27808
27844
|
}
|
|
27809
|
-
function
|
|
27810
|
-
let i = (t || "A")[0].toUpperCase(), a =
|
|
27845
|
+
function hO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" }) {
|
|
27846
|
+
let i = (t || "A")[0].toUpperCase(), a = pO(r), o = n > 48 ? {
|
|
27811
27847
|
boxShadow: `0 0 0 3px ${r}44`,
|
|
27812
27848
|
border: "3px solid rgba(255,255,255,0.15)"
|
|
27813
27849
|
} : { border: `1.5px solid ${r}55` };
|
|
@@ -27844,7 +27880,7 @@ function lO({ headshot: e, name: t, size: n = 80, primaryColor: r = "#3B82F6" })
|
|
|
27844
27880
|
children: i
|
|
27845
27881
|
});
|
|
27846
27882
|
}
|
|
27847
|
-
function
|
|
27883
|
+
function gO(e) {
|
|
27848
27884
|
let t = p(null), n = o(() => {
|
|
27849
27885
|
if (!t.current) return;
|
|
27850
27886
|
let { audioContext: e, oscillator: n, interval: r, toneTimeout: i } = t.current;
|
|
@@ -27891,8 +27927,8 @@ function uO(e) {
|
|
|
27891
27927
|
n
|
|
27892
27928
|
]), c(() => () => n(), [n]), n;
|
|
27893
27929
|
}
|
|
27894
|
-
function
|
|
27895
|
-
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x =
|
|
27930
|
+
function _O({ 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 = [] }) {
|
|
27931
|
+
let y = a || s || "Agent", b = e ? "incoming" : n === "connecting" ? "connecting" : "ongoing", x = gO(!!e), S = async () => {
|
|
27896
27932
|
x(), await c();
|
|
27897
27933
|
}, C = async () => {
|
|
27898
27934
|
x(), await l();
|
|
@@ -27904,14 +27940,14 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27904
27940
|
flexDirection: "column",
|
|
27905
27941
|
borderRadius: "inherit",
|
|
27906
27942
|
overflow: "hidden",
|
|
27907
|
-
background:
|
|
27943
|
+
background: mO(h, m),
|
|
27908
27944
|
animation: T ? "fe-call-slide-up 0.36s cubic-bezier(0.16,1,0.3,1)" : "fe-call-fade-in 0.32s ease"
|
|
27909
27945
|
};
|
|
27910
27946
|
if (b === "incoming") {
|
|
27911
27947
|
let e = Array.isArray(h) && h.length > 0 ? h : [m];
|
|
27912
27948
|
return /* @__PURE__ */ _("div", {
|
|
27913
27949
|
style: ee,
|
|
27914
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
27950
|
+
children: [/* @__PURE__ */ g("style", { children: dO }), /* @__PURE__ */ _("div", {
|
|
27915
27951
|
style: {
|
|
27916
27952
|
flex: 1,
|
|
27917
27953
|
display: "flex",
|
|
@@ -27942,7 +27978,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27942
27978
|
width: "96px",
|
|
27943
27979
|
height: "96px",
|
|
27944
27980
|
borderRadius: "50%",
|
|
27945
|
-
background: `radial-gradient(circle, rgba(${
|
|
27981
|
+
background: `radial-gradient(circle, rgba(${fO(e[0])},0.2) 0%, transparent 70%)`,
|
|
27946
27982
|
filter: "blur(10px)",
|
|
27947
27983
|
zIndex: 0
|
|
27948
27984
|
} }),
|
|
@@ -27959,7 +27995,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
27959
27995
|
animation: `fe-call-ring-pulse 2.6s cubic-bezier(0.215,0.61,0.355,1) ${t}s infinite`,
|
|
27960
27996
|
zIndex: 1
|
|
27961
27997
|
} }, n)),
|
|
27962
|
-
/* @__PURE__ */ g(
|
|
27998
|
+
/* @__PURE__ */ g(hO, {
|
|
27963
27999
|
headshot: o,
|
|
27964
28000
|
name: y,
|
|
27965
28001
|
size: 82,
|
|
@@ -28039,7 +28075,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28039
28075
|
e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(239,68,68,0.5)";
|
|
28040
28076
|
},
|
|
28041
28077
|
"aria-label": "Decline call",
|
|
28042
|
-
children: /* @__PURE__ */ g(
|
|
28078
|
+
children: /* @__PURE__ */ g(TD, { size: 26 })
|
|
28043
28079
|
}), /* @__PURE__ */ g("span", {
|
|
28044
28080
|
style: {
|
|
28045
28081
|
fontSize: "12px",
|
|
@@ -28080,7 +28116,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28080
28116
|
e.currentTarget.style.transform = "scale(1)", e.currentTarget.style.boxShadow = "0 6px 24px rgba(34,197,94,0.5)";
|
|
28081
28117
|
},
|
|
28082
28118
|
"aria-label": "Accept call",
|
|
28083
|
-
children: /* @__PURE__ */ g(
|
|
28119
|
+
children: /* @__PURE__ */ g(OD, {})
|
|
28084
28120
|
}), /* @__PURE__ */ g("span", {
|
|
28085
28121
|
style: {
|
|
28086
28122
|
fontSize: "12px",
|
|
@@ -28097,7 +28133,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28097
28133
|
}
|
|
28098
28134
|
return b === "connecting" ? /* @__PURE__ */ _("div", {
|
|
28099
28135
|
style: ee,
|
|
28100
|
-
children: [/* @__PURE__ */ g("style", { children:
|
|
28136
|
+
children: [/* @__PURE__ */ g("style", { children: dO }), /* @__PURE__ */ _("div", {
|
|
28101
28137
|
style: {
|
|
28102
28138
|
flex: 1,
|
|
28103
28139
|
display: "flex",
|
|
@@ -28107,7 +28143,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28107
28143
|
gap: "24px"
|
|
28108
28144
|
},
|
|
28109
28145
|
children: [
|
|
28110
|
-
/* @__PURE__ */ g(
|
|
28146
|
+
/* @__PURE__ */ g(hO, {
|
|
28111
28147
|
headshot: o,
|
|
28112
28148
|
name: y,
|
|
28113
28149
|
size: 64,
|
|
@@ -28134,7 +28170,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28134
28170
|
}) : /* @__PURE__ */ _("div", {
|
|
28135
28171
|
style: ee,
|
|
28136
28172
|
children: [
|
|
28137
|
-
/* @__PURE__ */ g("style", { children:
|
|
28173
|
+
/* @__PURE__ */ g("style", { children: dO }),
|
|
28138
28174
|
/* @__PURE__ */ _("div", {
|
|
28139
28175
|
style: {
|
|
28140
28176
|
display: "flex",
|
|
@@ -28180,7 +28216,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28180
28216
|
children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" })
|
|
28181
28217
|
})
|
|
28182
28218
|
}),
|
|
28183
|
-
/* @__PURE__ */ g(
|
|
28219
|
+
/* @__PURE__ */ g(uO, {
|
|
28184
28220
|
colors: h,
|
|
28185
28221
|
size: 36,
|
|
28186
28222
|
voiceState: w
|
|
@@ -28231,7 +28267,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28231
28267
|
gap: "16px",
|
|
28232
28268
|
padding: "0 24px 16px"
|
|
28233
28269
|
},
|
|
28234
|
-
children: [/* @__PURE__ */ g(
|
|
28270
|
+
children: [/* @__PURE__ */ g(hO, {
|
|
28235
28271
|
headshot: o,
|
|
28236
28272
|
name: y,
|
|
28237
28273
|
size: 116,
|
|
@@ -28286,7 +28322,7 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28286
28322
|
transition: "all 0.2s ease"
|
|
28287
28323
|
},
|
|
28288
28324
|
"aria-label": i ? "Unmute" : "Mute",
|
|
28289
|
-
children: [g(i ?
|
|
28325
|
+
children: [g(i ? FD : wD, { size: 18 }), i ? "Unmute" : "Mute"]
|
|
28290
28326
|
}), /* @__PURE__ */ _("button", {
|
|
28291
28327
|
type: "button",
|
|
28292
28328
|
onClick: u,
|
|
@@ -28314,15 +28350,15 @@ function dO({ incomingCall: e, activeCallId: t, callConnectionState: n, callDura
|
|
|
28314
28350
|
e.currentTarget.style.background = "rgba(239,68,68,0.9)", e.currentTarget.style.transform = "scale(1)";
|
|
28315
28351
|
},
|
|
28316
28352
|
"aria-label": "End call",
|
|
28317
|
-
children: [/* @__PURE__ */ g(
|
|
28353
|
+
children: [/* @__PURE__ */ g(TD, { size: 18 }), "End Call"]
|
|
28318
28354
|
})]
|
|
28319
28355
|
})
|
|
28320
28356
|
]
|
|
28321
28357
|
});
|
|
28322
28358
|
}
|
|
28323
|
-
function
|
|
28359
|
+
function vO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDurationSeconds: r, isCallMuted: i, formatCallDuration: a, toggleCallMute: o, endWebRTCCall: s, onExpand: c, primaryColor: l = "#3B82F6" }) {
|
|
28324
28360
|
let u = e || n || "Agent";
|
|
28325
|
-
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children:
|
|
28361
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: dO }), /* @__PURE__ */ _("div", {
|
|
28326
28362
|
role: "button",
|
|
28327
28363
|
tabIndex: 0,
|
|
28328
28364
|
onClick: c,
|
|
@@ -28379,7 +28415,7 @@ function fO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28379
28415
|
borderRadius: "50%",
|
|
28380
28416
|
border: `1.5px solid ${l}55`
|
|
28381
28417
|
} }),
|
|
28382
|
-
/* @__PURE__ */ g(
|
|
28418
|
+
/* @__PURE__ */ g(hO, {
|
|
28383
28419
|
headshot: t,
|
|
28384
28420
|
name: u,
|
|
28385
28421
|
size: 38,
|
|
@@ -28463,7 +28499,7 @@ function fO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28463
28499
|
boxShadow: i ? `0 0 0 3px ${l}12` : "none"
|
|
28464
28500
|
},
|
|
28465
28501
|
"aria-label": i ? "Unmute" : "Mute",
|
|
28466
|
-
children: g(i ?
|
|
28502
|
+
children: g(i ? FD : wD, { size: 15 })
|
|
28467
28503
|
}), /* @__PURE__ */ g("button", {
|
|
28468
28504
|
type: "button",
|
|
28469
28505
|
onClick: (e) => {
|
|
@@ -28491,7 +28527,7 @@ function fO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28491
28527
|
transition: "all 0.18s ease"
|
|
28492
28528
|
},
|
|
28493
28529
|
"aria-label": "End call",
|
|
28494
|
-
children: /* @__PURE__ */ g(
|
|
28530
|
+
children: /* @__PURE__ */ g(TD, { size: 16 })
|
|
28495
28531
|
})]
|
|
28496
28532
|
})
|
|
28497
28533
|
]
|
|
@@ -28499,7 +28535,7 @@ function fO({ agentName: e, agentHeadshot: t, fallbackAgentName: n, callDuration
|
|
|
28499
28535
|
}
|
|
28500
28536
|
//#endregion
|
|
28501
28537
|
//#region src/utils/voicePriorContext.js
|
|
28502
|
-
function
|
|
28538
|
+
function yO(e, t = {}) {
|
|
28503
28539
|
let n = t.maxChars ?? 4500;
|
|
28504
28540
|
if (!Array.isArray(e) || e.length === 0) return "";
|
|
28505
28541
|
let r = [];
|
|
@@ -28515,42 +28551,6 @@ function pO(e, t = {}) {
|
|
|
28515
28551
|
return i.length > n && (i = "…(earlier messages omitted)\n" + i.slice(-n)), i;
|
|
28516
28552
|
}
|
|
28517
28553
|
//#endregion
|
|
28518
|
-
//#region src/utils/actionQueue.js
|
|
28519
|
-
var mO = {
|
|
28520
|
-
wordsSoFar: 0,
|
|
28521
|
-
speechStartTime: 0,
|
|
28522
|
-
isSpeaking: !1,
|
|
28523
|
-
items: [],
|
|
28524
|
-
timers: [],
|
|
28525
|
-
lastHighlightId: null,
|
|
28526
|
-
isVoiceMode: !1
|
|
28527
|
-
};
|
|
28528
|
-
function hO() {
|
|
28529
|
-
mO.timers.forEach(clearTimeout), mO.wordsSoFar = 0, mO.speechStartTime = 0, mO.isSpeaking = !1, mO.items = [], mO.timers = [], mO.lastHighlightId = null;
|
|
28530
|
-
}
|
|
28531
|
-
//#endregion
|
|
28532
|
-
//#region src/utils/highlightEngine.js
|
|
28533
|
-
var gO = 80;
|
|
28534
|
-
function _O(e) {
|
|
28535
|
-
requestAnimationFrame(() => {
|
|
28536
|
-
let t = e.getBoundingClientRect(), n = t.top + t.height / 2, r = gO, i = r + (window.innerHeight - r) / 2, a = window.pageYOffset + n - i;
|
|
28537
|
-
window.scrollTo({
|
|
28538
|
-
top: Math.max(0, a),
|
|
28539
|
-
behavior: "smooth"
|
|
28540
|
-
});
|
|
28541
|
-
});
|
|
28542
|
-
}
|
|
28543
|
-
function vO(e) {
|
|
28544
|
-
if (!e || e.hasAttribute("data-fe-highlighted")) return;
|
|
28545
|
-
yO(), e.classList?.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"), _O(e);
|
|
28546
|
-
let t = e.style.cssText;
|
|
28547
|
-
e.setAttribute("data-fe-highlighted", "true"), e.setAttribute("data-fe-orig-style", t), e.style.outline = "3px solid #2563eb", e.style.outlineOffset = "8px", e.style.background = "rgba(37, 99, 235, 0.08)", e.style.borderRadius = "8px", e.style.padding = "12px 16px", e.style.transition = "all 0.4s ease";
|
|
28548
|
-
}
|
|
28549
|
-
function yO() {
|
|
28550
|
-
let e = document.querySelector("[data-fe-highlighted]");
|
|
28551
|
-
e && (e.style.cssText = e.getAttribute("data-fe-orig-style") || "", e.removeAttribute("data-fe-highlighted"), e.removeAttribute("data-fe-orig-style"));
|
|
28552
|
-
}
|
|
28553
|
-
//#endregion
|
|
28554
28554
|
//#region src/utils/voiceActionVisuals.js
|
|
28555
28555
|
var Q = "fe-vv";
|
|
28556
28556
|
function bO() {
|
|
@@ -29366,11 +29366,11 @@ function Ck(e) {
|
|
|
29366
29366
|
return $("flowengage_navigate ✖ blocked", e), e;
|
|
29367
29367
|
}
|
|
29368
29368
|
try {
|
|
29369
|
-
wO(`Navigating to ${a}...`, { spinner: !0 }), kO(),
|
|
29369
|
+
wO(`Navigating to ${a}...`, { spinner: !0 }), kO(), yD(), CD();
|
|
29370
29370
|
try {
|
|
29371
29371
|
let e = r ? r() : "";
|
|
29372
29372
|
if (e && t) {
|
|
29373
|
-
let n =
|
|
29373
|
+
let n = yO([{
|
|
29374
29374
|
sender: "user",
|
|
29375
29375
|
message: e
|
|
29376
29376
|
}]);
|
|
@@ -29387,10 +29387,10 @@ function Ck(e) {
|
|
|
29387
29387
|
$("flowengage_navigate → real navigation", a);
|
|
29388
29388
|
let e = typeof window < "u" && !!(window.next?.router || window.__NEXT_ROUTER__ || window.__remixRouter || window.__staticRouterHydrationData || window.___gatsby || window.___navigate || window.__VUE_ROUTER__ || window.__NUXT__ || window.$nuxt || window.ng?.getComponent || typeof document < "u" && document.querySelector("[ng-version]") || window.__sveltekit_data || typeof document < "u" && document.querySelector("[data-sveltekit-hydrate]"));
|
|
29389
29389
|
if (typeof window < "u" && window.__fe_triggerVoiceNavHooks && window.__fe_triggerVoiceNavHooks(), e && qn(3e3), Tr(a, { voiceActive: !0 }).catch(() => {}), e) try {
|
|
29390
|
-
let e = new URL(a, window.location.origin).pathname
|
|
29391
|
-
|
|
29392
|
-
let
|
|
29393
|
-
return $("flowengage_navigate → SPA nav complete. target:", e, "actual:",
|
|
29390
|
+
let e = new URL(a, window.location.origin).pathname;
|
|
29391
|
+
await new Promise((e) => setTimeout(e, 400));
|
|
29392
|
+
let t = typeof window < "u" ? window.location.pathname : e, n = typeof window < "u" ? window.location.href : a, r = t === e, i = (t.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "Home";
|
|
29393
|
+
return $("flowengage_navigate → SPA nav complete. target:", e, "actual:", t), r ? `OK_NAVIGATE_SPA. Navigation confirmed. Visitor is now at: ${n}. Page name: "${i}". Continue with your response about this page — do NOT say "I have navigated you to..." (the page is already changing visually). Just start talking about the content.` : `OK_NAVIGATE_SPA. IMPORTANT: Navigation was interrupted. The visitor is currently at ${n} (page: "${i}"), NOT the page you tried to navigate to. Adjust your response to describe the page the visitor is ACTUALLY on right now.`;
|
|
29394
29394
|
} catch {}
|
|
29395
29395
|
return "OK_NAVIGATE_RELOADING. Navigating to the page now; the voice session will resume automatically on the new page. When the session resumes, immediately introduce the new page and continue guiding the visitor — do not wait for the user to speak first.";
|
|
29396
29396
|
} catch (e) {
|
|
@@ -29409,7 +29409,7 @@ function Ck(e) {
|
|
|
29409
29409
|
let t = hk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
|
|
29410
29410
|
Sk();
|
|
29411
29411
|
let i = hr(n || null, r || null);
|
|
29412
|
-
return !i && r && (await new Promise((e) => setTimeout(e, 500)), Sk(), i = hr(null, r)), i ? (
|
|
29412
|
+
return !i && r && (await new Promise((e) => setTimeout(e, 500)), Sk(), i = hr(null, r)), i ? (SD(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}". WALKTHROUGH: If you are mid-walkthrough and have more sections to cover, continue immediately to the next section — do NOT pause or wait for the visitor to speak between sections.`) : ($("flowengage_highlight ✖ no element for:", r || n), `Could not find "${r || n}" on the current page. Try a shorter phrase matching a visible heading.`);
|
|
29413
29413
|
},
|
|
29414
29414
|
flowengage_read_content: async (e) => {
|
|
29415
29415
|
$("flowengage_read_content ▶", e);
|
|
@@ -29687,7 +29687,7 @@ function Ak(e, t) {
|
|
|
29687
29687
|
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) || /\b(that'?s all|we'?re done)\b/i.test(n) || e === "bot" && (/\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)) || /^(goodbye|bye|that'?s all|we'?re done|hang up|disconnect)\b/i.test(n)) : !1;
|
|
29688
29688
|
}
|
|
29689
29689
|
function jk({ orbColors: e, ...t }) {
|
|
29690
|
-
return /* @__PURE__ */ g(
|
|
29690
|
+
return /* @__PURE__ */ g(uO, {
|
|
29691
29691
|
colors: e,
|
|
29692
29692
|
...t
|
|
29693
29693
|
});
|
|
@@ -29995,7 +29995,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
29995
29995
|
}, [u]), me = o(async (e) => {
|
|
29996
29996
|
re.current = !0;
|
|
29997
29997
|
try {
|
|
29998
|
-
|
|
29998
|
+
CD();
|
|
29999
29999
|
} catch {}
|
|
30000
30000
|
try {
|
|
30001
30001
|
await C.current?.endSession?.();
|
|
@@ -30040,7 +30040,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30040
30040
|
if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
|
|
30041
30041
|
u.current = [], w.current = "", ee.current = !1, ne.current = !1, re.current = !1, E.current = "minimized", Or({ onBeforeNavigate: () => {
|
|
30042
30042
|
if (a && u.current.length > 0) try {
|
|
30043
|
-
let e =
|
|
30043
|
+
let e = yO(u.current);
|
|
30044
30044
|
e && Ae(a, e);
|
|
30045
30045
|
} catch {}
|
|
30046
30046
|
if (!er()) {
|
|
@@ -30099,40 +30099,40 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30099
30099
|
},
|
|
30100
30100
|
onUnhandledClientToolCall: (e) => console.error("[FlowEngage] Unhandled tool:", e?.tool_name),
|
|
30101
30101
|
onModeChange: ({ mode: t }) => {
|
|
30102
|
-
if (e)
|
|
30103
|
-
|
|
30104
|
-
|
|
30105
|
-
|
|
30106
|
-
|
|
30107
|
-
|
|
30108
|
-
|
|
30109
|
-
|
|
30110
|
-
|
|
30111
|
-
|
|
30112
|
-
|
|
30113
|
-
|
|
30114
|
-
|
|
30115
|
-
C.current?.sendUserMessage?.("continue with the tour");
|
|
30116
|
-
} catch {}
|
|
30117
|
-
}
|
|
30118
|
-
n === "speaking" && le.current && !te.current && (ce.current = "thinking", v("thinking")), de.current && clearTimeout(de.current), de.current = setTimeout(() => {
|
|
30119
|
-
e || ce.current !== "speaking" && (fe.current || (de.current = null, ce.current = "listening", v("listening"), le.current && !te.current && (ue.current && clearTimeout(ue.current), ue.current = setTimeout(() => {
|
|
30120
|
-
if (!e && ce.current === "listening" && !te.current) try {
|
|
30121
|
-
C.current?.sendContextualUpdate?.("The visitor has been silent for a while. Ask one short, natural question to re-engage — for example: 'Is there anything specific you'd like to know more about?' or 'What else can I help you with today?' Keep it to one sentence.");
|
|
30102
|
+
if (!e) {
|
|
30103
|
+
if (t === "speaking") {
|
|
30104
|
+
de.current &&= (clearTimeout(de.current), null), v("speaking"), ce.current = "speaking", le.current = !0, fe.current = !1, ue.current &&= (clearTimeout(ue.current), null);
|
|
30105
|
+
return;
|
|
30106
|
+
}
|
|
30107
|
+
if (ce.current = "listening", se.current) {
|
|
30108
|
+
se.current = !1, pe();
|
|
30109
|
+
return;
|
|
30110
|
+
}
|
|
30111
|
+
if (oe && !T) {
|
|
30112
|
+
T = !0;
|
|
30113
|
+
try {
|
|
30114
|
+
C.current?.sendUserMessage?.("continue with the tour");
|
|
30122
30115
|
} catch {}
|
|
30123
|
-
}
|
|
30124
|
-
|
|
30116
|
+
}
|
|
30117
|
+
de.current && clearTimeout(de.current), de.current = setTimeout(() => {
|
|
30118
|
+
e || ce.current !== "speaking" && (fe.current || (de.current = null, ce.current = "listening", v("listening"), le.current && !te.current && (ue.current && clearTimeout(ue.current), ue.current = setTimeout(() => {
|
|
30119
|
+
if (!e && ce.current === "listening" && !te.current) try {
|
|
30120
|
+
C.current?.sendContextualUpdate?.("The visitor has been silent for a while. Ask one short, natural question to re-engage — for example: 'Is there anything specific you'd like to know more about?' or 'What else can I help you with today?' Keep it to one sentence.");
|
|
30121
|
+
} catch {}
|
|
30122
|
+
}, 4e3))));
|
|
30123
|
+
}, 1200);
|
|
30124
|
+
}
|
|
30125
30125
|
},
|
|
30126
30126
|
onMessage: (t) => {
|
|
30127
30127
|
if (e) return;
|
|
30128
30128
|
let n = t.role === "user" ? "user" : "bot", r = t.message || t.text || t.content || "";
|
|
30129
30129
|
if (r) {
|
|
30130
|
-
if (n === "user" && (w.current = r, fe.current = !0, de.current &&= (clearTimeout(de.current), null), ce.current = "thinking",
|
|
30130
|
+
if (n === "user" && (w.current = r, fe.current = !0, de.current &&= (clearTimeout(de.current), null), ce.current = "thinking", ue.current &&= (clearTimeout(ue.current), null)), u.current = [...u.current, {
|
|
30131
30131
|
sender: n,
|
|
30132
30132
|
message: r,
|
|
30133
30133
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
30134
30134
|
}], a) try {
|
|
30135
|
-
let e =
|
|
30135
|
+
let e = yO(u.current);
|
|
30136
30136
|
e && Ae(a, e);
|
|
30137
30137
|
} catch {}
|
|
30138
30138
|
if (Ak(n, r)) {
|
|
@@ -30260,22 +30260,6 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30260
30260
|
/* @__PURE__ */ _("div", {
|
|
30261
30261
|
style: { position: "relative" },
|
|
30262
30262
|
children: [
|
|
30263
|
-
h === "thinking" && !y && /* @__PURE__ */ g("span", {
|
|
30264
|
-
style: {
|
|
30265
|
-
position: "absolute",
|
|
30266
|
-
right: "100%",
|
|
30267
|
-
marginRight: "18px",
|
|
30268
|
-
top: "50%",
|
|
30269
|
-
transform: "translateY(-50%)",
|
|
30270
|
-
color: "white",
|
|
30271
|
-
fontSize: "18px",
|
|
30272
|
-
fontWeight: 600,
|
|
30273
|
-
letterSpacing: "0.01em",
|
|
30274
|
-
textShadow: "0 2px 4px rgba(0,0,0,0.4)",
|
|
30275
|
-
whiteSpace: "nowrap"
|
|
30276
|
-
},
|
|
30277
|
-
children: "Thinking..."
|
|
30278
|
-
}),
|
|
30279
30263
|
h === "listening" && !y && /* @__PURE__ */ g("span", {
|
|
30280
30264
|
style: {
|
|
30281
30265
|
position: "absolute",
|
|
@@ -30394,7 +30378,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30394
30378
|
y2: "23"
|
|
30395
30379
|
})
|
|
30396
30380
|
]
|
|
30397
|
-
}) : /* @__PURE__ */ g(
|
|
30381
|
+
}) : /* @__PURE__ */ g(wD, {
|
|
30398
30382
|
size: 16,
|
|
30399
30383
|
color: "currentColor"
|
|
30400
30384
|
})
|
|
@@ -30416,7 +30400,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30416
30400
|
padding: 0,
|
|
30417
30401
|
flexShrink: 0
|
|
30418
30402
|
},
|
|
30419
|
-
children: /* @__PURE__ */ g(
|
|
30403
|
+
children: /* @__PURE__ */ g(MD, {
|
|
30420
30404
|
size: 16,
|
|
30421
30405
|
color: "currentColor"
|
|
30422
30406
|
})
|
|
@@ -30465,7 +30449,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30465
30449
|
onMouseLeave: (e) => {
|
|
30466
30450
|
e.currentTarget.style.background = "none";
|
|
30467
30451
|
},
|
|
30468
|
-
children: [/* @__PURE__ */ g(
|
|
30452
|
+
children: [/* @__PURE__ */ g(ND, {}), "Enter Chat Mode"]
|
|
30469
30453
|
}),
|
|
30470
30454
|
/* @__PURE__ */ _("button", {
|
|
30471
30455
|
onClick: () => {
|
|
@@ -30494,7 +30478,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
|
|
|
30494
30478
|
onMouseLeave: (e) => {
|
|
30495
30479
|
e.currentTarget.style.background = "none";
|
|
30496
30480
|
},
|
|
30497
|
-
children: [/* @__PURE__ */ g(
|
|
30481
|
+
children: [/* @__PURE__ */ g(PD, {}), "End Conversation"]
|
|
30498
30482
|
}),
|
|
30499
30483
|
/* @__PURE__ */ g("button", {
|
|
30500
30484
|
onClick: () => S(!1),
|
|
@@ -31012,7 +30996,7 @@ function Lk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31012
30996
|
})
|
|
31013
30997
|
]
|
|
31014
30998
|
}),
|
|
31015
|
-
/* @__PURE__ */ g(
|
|
30999
|
+
/* @__PURE__ */ g(tO, {
|
|
31016
31000
|
webRTCError: fe,
|
|
31017
31001
|
micError: pe,
|
|
31018
31002
|
setMicError: me,
|
|
@@ -31020,7 +31004,7 @@ function Lk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31020
31004
|
isRateLimited: ee,
|
|
31021
31005
|
rateLimitMessage: te
|
|
31022
31006
|
}),
|
|
31023
|
-
Se && /* @__PURE__ */ g(
|
|
31007
|
+
Se && /* @__PURE__ */ g(vO, {
|
|
31024
31008
|
agentName: v,
|
|
31025
31009
|
agentHeadshot: y,
|
|
31026
31010
|
fallbackAgentName: b,
|
|
@@ -31212,7 +31196,7 @@ function Lk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31212
31196
|
children: "No previous chats found."
|
|
31213
31197
|
})
|
|
31214
31198
|
})]
|
|
31215
|
-
}) : null, Ne ? /* @__PURE__ */ g(
|
|
31199
|
+
}) : null, Ne ? /* @__PURE__ */ g($D, {
|
|
31216
31200
|
chatHistory: l,
|
|
31217
31201
|
isAiTyping: u,
|
|
31218
31202
|
isLoading: T,
|
|
@@ -31354,7 +31338,7 @@ function Lk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
|
|
|
31354
31338
|
zIndex: 1,
|
|
31355
31339
|
padding: oe ? "6px 0 0" : "12px 0 0"
|
|
31356
31340
|
},
|
|
31357
|
-
children: /* @__PURE__ */ g(
|
|
31341
|
+
children: /* @__PURE__ */ g(eO, {
|
|
31358
31342
|
input: x,
|
|
31359
31343
|
setInput: S,
|
|
31360
31344
|
onSubmit: C,
|
|
@@ -31487,7 +31471,7 @@ function Rk() {
|
|
|
31487
31471
|
let Ft = o(() => {
|
|
31488
31472
|
St(null), wt("");
|
|
31489
31473
|
}, []), It = o((e) => {
|
|
31490
|
-
let t =
|
|
31474
|
+
let t = JD(e);
|
|
31491
31475
|
if (t) {
|
|
31492
31476
|
St(null), wt(t);
|
|
31493
31477
|
return;
|
|
@@ -31593,7 +31577,7 @@ function Rk() {
|
|
|
31593
31577
|
if (xt) {
|
|
31594
31578
|
try {
|
|
31595
31579
|
Et(!0), wt("");
|
|
31596
|
-
let e = await se(xt), n = e?.data || e, r = ct.trim() || `Shared file: ${
|
|
31580
|
+
let e = await se(xt), n = e?.data || e, r = ct.trim() || `Shared file: ${XD(xt)}`;
|
|
31597
31581
|
lt(""), dt(null), Ft(), await D(r, "", t, {
|
|
31598
31582
|
type: "file",
|
|
31599
31583
|
metadata: {
|
|
@@ -31798,7 +31782,7 @@ function Rk() {
|
|
|
31798
31782
|
onMessageSync: oe,
|
|
31799
31783
|
voiceEndCounter: Oe
|
|
31800
31784
|
}, "voice"),
|
|
31801
|
-
A === "call_screen" && /* @__PURE__ */ g(
|
|
31785
|
+
A === "call_screen" && /* @__PURE__ */ g(_O, {
|
|
31802
31786
|
incomingCall: w,
|
|
31803
31787
|
activeCallId: T,
|
|
31804
31788
|
callConnectionState: ee,
|
|
@@ -31897,4 +31881,4 @@ var zk = class extends e.Component {
|
|
|
31897
31881
|
}
|
|
31898
31882
|
};
|
|
31899
31883
|
//#endregion
|
|
31900
|
-
export {
|
|
31884
|
+
export { uO as AnimatedOrb, zk as ErrorBoundary, Lr as FlowEngageProvider, Rk as FlowEngageWidget, Ln as useFlowEngage };
|