@flowengage/react-chatbot 6.0.33 → 6.0.35

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.
@@ -29400,8 +29400,8 @@ function Sk(e) {
29400
29400
  let s = [], c = Date.now() + 8e3;
29401
29401
  for (; Date.now() < c && (await new Promise((e) => setTimeout(e, 250)), s = xk(), !(s.length >= 1)););
29402
29402
  bk(), $("flowengage_navigate → page headings collected:", s);
29403
- let l = s.length ? s.join(" | ") : "none", u = s.length ? "Use ONLY these exact heading strings for flowengage_highlight." : "No headings were collected from the live DOM use your knowledge base heading strings for this page to call flowengage_highlight. Follow RULE 1: call each highlight BEFORE describing its section (transition → highlight → content).";
29404
- return i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}") | Section headings: ${l}. ${u} MANDATORY: call flowengage_highlight for EVERY section before describing itnever give a plain summary. Do NOT say "I have navigated you" or "I've taken you to" start the highlighted walkthrough immediately.`) : (wr(), `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}") | Section headings: ${l}. ${u} MANDATORY: call flowengage_highlight for EVERY section before describing it never give a plain summary. Describe THIS page only do not mention the page you tried to navigate to.`);
29403
+ let l = s.length ? s.join(" | ") : "none", u = s.length ? "These exact heading strings are available for flowengage_highlight once the visitor approves a walkthrough." : "No DOM headings collected — if the visitor approves a walkthrough, call flowengage_get_current_page first to get fresh headings.";
29404
+ return i ? (wr(), `OK_NAVIGATE_SPA. Visitor is now on: ${r} (page: "${o}") | Section headings: ${l}. ${u} REQUIRED: (1) Speak 2-3 natural sentences introducing the ${o} page what it is and what the visitor will find here. (2) Ask: "Would you like me to walk you through this page in detail?" (3) Wait for their answer. ONLY call flowengage_highlight if they say yes. DO NOT highlight sections before the visitor approves.`) : (wr(), `OK_NAVIGATE_SPA. CURRENT PAGE IS: ${r} (page: "${o}") | Section headings: ${l}. ${u} REQUIRED: (1) Speak 2-3 natural sentences introducing the ${o} page. (2) Ask: "Would you like me to walk you through this page?" (3) Wait for the visitor's answer before calling flowengage_highlight.`);
29405
29405
  } catch {}
29406
29406
  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.";
29407
29407
  } catch (e) {
@@ -29596,19 +29596,21 @@ function Sk(e) {
29596
29596
  }
29597
29597
  //#endregion
29598
29598
  //#region src/utils/wrapVoiceToolsForLogging.js
29599
- function Ck(e) {
29600
- return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
29601
- let r = Rn();
29602
- r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
29603
- let i;
29599
+ function Ck(e, { onToolStart: t, onToolEnd: n } = {}) {
29600
+ return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, r]) => [e, async (i) => {
29601
+ let a = Rn();
29602
+ a ? console.log("[FlowEngage:voice-tool] ▶", e, i) : console.info(`[FlowEngage] voice tool » ${e}`), t?.();
29603
+ let o;
29604
29604
  try {
29605
- i = await t(n);
29605
+ o = await r(i);
29606
29606
  } catch (t) {
29607
29607
  let n = `Tool error: ${t?.message || String(t)}`;
29608
29608
  return console.error(`[FlowEngage] voice tool ${e} threw:`, t), n;
29609
+ } finally {
29610
+ n?.();
29609
29611
  }
29610
- let a = typeof i == "string" ? i.length > 220 ? `${i.slice(0, 220)}…` : i : String(i);
29611
- return r ? console.log("[FlowEngage:voice-tool] ◀", e, a) : console.info(`[FlowEngage] voice tool « ${e}:`, a), i;
29612
+ let s = typeof o == "string" ? o.length > 220 ? `${o.slice(0, 220)}…` : o : String(o);
29613
+ return a ? console.log("[FlowEngage:voice-tool] ◀", e, s) : console.info(`[FlowEngage] voice tool « ${e}:`, s), o;
29612
29614
  }]));
29613
29615
  }
29614
29616
  //#endregion
@@ -30009,14 +30011,14 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, onVoice: r, onText: i, onC
30009
30011
  }
30010
30012
  function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i, apiBaseUrl: a, chatId: s, historyRef: l, onMessageSync: u, voiceEndCounter: d }) {
30011
30013
  c(() => (console.log("[FlowEngage:VoiceDebug] 🔵 VoiceMode MOUNTED"), () => console.log("[FlowEngage:VoiceDebug] 🔴 VoiceMode UNMOUNTED")), []);
30012
- let [f, h] = m("idle"), [v, y] = m(!1), [b, x] = m(!1), S = p(null), C = p(""), w = p(async () => {}), T = p(!1), ee = p(!1), te = p(!1), ne = p(!1), re = p("minimized"), E = p(null), ie = p(null), ae = p(null), oe = p(0), D = p(!1), se = p("idle"), ce = p(!1), le = p(null), ue = p(null), de = p(!1), fe = o((e = "minimized") => {
30014
+ let [f, h] = m("idle"), [v, y] = m(!1), [b, x] = m(!1), S = p(null), C = p(""), w = p(async () => {}), T = p(!1), ee = p(!1), te = p(!1), ne = p(!1), re = p("minimized"), E = p(null), ie = p(null), ae = p(null), oe = p(0), D = p(!1), se = p("idle"), ce = p(!1), le = p(null), ue = p(null), de = p(!1), fe = p(!1), pe = o((e = "minimized") => {
30013
30015
  console.warn("[FlowEngage:VoiceDebug] 🛑 requestSessionShutdown called", {
30014
30016
  destination: e,
30015
30017
  stack: (/* @__PURE__ */ Error()).stack?.split("\n").slice(1, 4).join(" | ")
30016
30018
  }), re.current = e, ne.current = !0, queueMicrotask(() => {
30017
30019
  T.current || (T.current = !0, w.current?.());
30018
30020
  });
30019
- }, [l]), pe = o(async (e) => {
30021
+ }, [l]), me = o(async (e) => {
30020
30022
  ne.current = !0;
30021
30023
  try {
30022
30024
  SD();
@@ -30052,10 +30054,10 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30052
30054
  s,
30053
30055
  a
30054
30056
  ]);
30055
- return w.current = () => pe(re.current === "chat" ? t : n), c(() => {
30057
+ return w.current = () => me(re.current === "chat" ? t : n), c(() => {
30056
30058
  ee.current = v;
30057
30059
  }, [v]), c(() => {
30058
- d && fe("chat");
30060
+ d && pe("chat");
30059
30061
  }, [d]), c(() => {
30060
30062
  let e = !1, o = null, c = null, d = null;
30061
30063
  return (async () => {
@@ -30096,7 +30098,14 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30096
30098
  requestEndSession: () => {
30097
30099
  D.current = !0;
30098
30100
  }
30099
- })), n = i ? je(i) : null, u = !!n?.transcript, f = !!(i && He(i)), p = typeof window < "u" ? window.location.pathname : "/", m = typeof document < "u" ? document.title : "", g = p === "/" || p === "", _ = null;
30101
+ }), {
30102
+ onToolStart: () => {
30103
+ e || (de.current = !0, ue.current &&= (clearTimeout(ue.current), null), se.current = "thinking", h("thinking"));
30104
+ },
30105
+ onToolEnd: () => {
30106
+ e || (de.current = !1, se.current = "listening", h("listening"));
30107
+ }
30108
+ }), n = i ? je(i) : null, u = !!n?.transcript, f = !!(i && He(i)), p = typeof window < "u" ? window.location.pathname : "/", m = typeof document < "u" ? document.title : "", g = p === "/" || p === "", _ = null;
30100
30109
  try {
30101
30110
  let e = await fetch(`${a}/api/voice/signed-url?siteId=${encodeURIComponent(i || "")}`, {
30102
30111
  method: "GET",
@@ -30119,8 +30128,8 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30119
30128
  }, b = (p.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()), x = "";
30120
30129
  m && m.includes("|") && (x = m.split("|").map((e) => e.trim()).filter(Boolean).reduce((e, t) => e.length <= t.length ? e : t));
30121
30130
  let w = x || b || "this page";
30122
- _ ? f ? (v.overrides = { agent: { firstMessage: `I've navigated you to the ${w} page. Let me walk you through what's here.` } }, console.log(`[FlowEngage] 🔄 Agent-nav resume: firstMessage set for "${w}" (${p})`)) : u ? v.overrides = { agent: { firstMessage: "I'm still here. Go ahead!" } } : g || (v.overrides = { agent: { firstMessage: `Hi! I see you are currently on the ${w} page. Are you looking for something specific here?` } }, console.log(`[FlowEngage] 🏠 Page-context override: "${w}" for ${p}`)) : u && (v.overrides = { agent: { firstMessage: "" } });
30123
- let ae = !1, pe = f ? `NAVIGATION RESUME You have just navigated to a new page. Speak 2-3 sentences about this page from your knowledge, then STOP and wait for the visitor to respond. Do NOT auto-highlight or walkthrough. Prior conversation context:\n${(i ? je(i) : null)?.transcript || ""}\n\n` : null, me = await vD.startSession({
30131
+ _ ? f ? (v.overrides = { agent: { firstMessage: `I've navigated you to the ${w} page.` } }, console.log(`[FlowEngage] 🔄 Agent-nav resume: firstMessage set for "${w}" (${p})`)) : u ? v.overrides = { agent: { firstMessage: "I'm still here. Go ahead!" } } : g ? v.overrides = { agent: { firstMessage: "Hi there! Let me give you a quick tour of what's available here." } } : (v.overrides = { agent: { firstMessage: `Welcome! You're on the ${w} page let me walk you through the highlights.` } }, console.log(`[FlowEngage] 🏠 Page-context override: "${w}" for ${p}`)) : u && (v.overrides = { agent: { firstMessage: "" } });
30132
+ let ae = !1, me = f ? `NAVIGATION RESUME: You are on the "${w}" page. Speak 2-3 natural sentences introducing this page what it is and what the visitor will find here. Then ask exactly: "Would you like me to walk you through this page in detail?" Wait for the visitor's response. ONLY if they say yes/sure/go ahead → call flowengage_highlight section by section. If they decline → respond helpfully and let them explore. DO NOT call flowengage_highlight before the visitor explicitly approves. Prior conversation context:\n${n?.transcript || ""}\n\n` : null, he = !1, ge = !f && !u ? "AUTO-START — Your greeting has been spoken. NOW — without waiting for the visitor to say anything — call flowengage_get_current_page, then immediately highlight the top 3 sections and give a one-sentence summary for each. Keep it brisk — no filler, no questions until the walkthrough is done." : null, _e = await vD.startSession({
30124
30133
  ...v,
30125
30134
  onConnect: ({ conversationId: e }) => {
30126
30135
  E.current = e, ie.current = Date.now(), console.log("[FlowEngage] 🎙️ AI chat session connected:", e);
@@ -30129,21 +30138,27 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30129
30138
  onModeChange: ({ mode: t }) => {
30130
30139
  if (!e) {
30131
30140
  if (t === "speaking") {
30132
- ue.current &&= (clearTimeout(ue.current), null), h("speaking"), se.current = "speaking", ce.current = !0, de.current = !1, le.current &&= (clearTimeout(le.current), null);
30141
+ ue.current &&= (clearTimeout(ue.current), null), h("speaking"), se.current = "speaking", ce.current = !0, fe.current = !1, le.current &&= (clearTimeout(le.current), null);
30133
30142
  return;
30134
30143
  }
30135
- if (se.current = "listening", D.current) {
30136
- D.current = !1, fe();
30144
+ if (de.current || (se.current = "listening", h("listening")), D.current) {
30145
+ D.current = !1, pe();
30137
30146
  return;
30138
30147
  }
30139
- if (pe && !ae) {
30148
+ if (me && !ae) {
30140
30149
  ae = !0;
30141
30150
  try {
30142
- S.current?.sendUserMessage?.("continue with the tour");
30151
+ S.current?.sendUserMessage?.(me);
30152
+ } catch {}
30153
+ }
30154
+ if (ge && !he) {
30155
+ he = !0;
30156
+ try {
30157
+ S.current?.sendContextualUpdate?.(ge);
30143
30158
  } catch {}
30144
30159
  }
30145
30160
  ue.current && clearTimeout(ue.current), ue.current = setTimeout(() => {
30146
- e || se.current !== "speaking" && (de.current || (ue.current = null, se.current = "listening", h("listening"), ce.current && !ee.current && (le.current && clearTimeout(le.current), le.current = setTimeout(() => {
30161
+ e || se.current !== "speaking" && se.current !== "thinking" && (de.current || fe.current || (ue.current = null, se.current = "listening", h("listening"), ce.current && !ee.current && (le.current && clearTimeout(le.current), le.current = setTimeout(() => {
30147
30162
  if (!e && se.current === "listening" && !ee.current) try {
30148
30163
  S.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.");
30149
30164
  } catch {}
@@ -30155,7 +30170,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30155
30170
  if (e) return;
30156
30171
  let n = t.role === "user" ? "user" : "bot", r = t.message || t.text || t.content || "";
30157
30172
  if (r) {
30158
- if (n === "user" && (C.current = r, de.current = !0, ue.current &&= (clearTimeout(ue.current), null), le.current &&= (clearTimeout(le.current), null)), l.current = [...l.current, {
30173
+ if (n === "user" && (C.current = r, fe.current = !0, ue.current &&= (clearTimeout(ue.current), null), le.current &&= (clearTimeout(le.current), null)), l.current = [...l.current, {
30159
30174
  sender: n,
30160
30175
  message: r,
30161
30176
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
@@ -30164,13 +30179,13 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30164
30179
  e && Ae(i, e);
30165
30180
  } catch {}
30166
30181
  if (Ak(n, r)) {
30167
- fe("minimized");
30182
+ pe("minimized");
30168
30183
  return;
30169
30184
  }
30170
30185
  if (ee.current && n === "bot" && /are you still there|still there\??|hello\?|anyone there|checking in|you there|are you available|is anyone|did you step away/i.test(r)) if (oe.current += 1, oe.current === 2) try {
30171
30186
  S.current?.sendContextualUpdate?.("IMPORTANT: The visitor is muted and has not responded to your last 2 checks. Make exactly ONE more check. If there is still no response, say: 'I feel like you are not active, so I'm ending this session. You can connect with me anytime.' then immediately call the flowengage_end_session tool to end the voice session. Do NOT ask again after that.");
30172
30187
  } catch {}
30173
- else oe.current >= 5 && fe("minimized");
30188
+ else oe.current >= 5 && pe("minimized");
30174
30189
  }
30175
30190
  },
30176
30191
  onError: (t) => {
@@ -30183,7 +30198,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30183
30198
  try {
30184
30199
  S.current?.setMicMuted?.(!0);
30185
30200
  } catch {}
30186
- y(!0), h("error"), fe("chat");
30201
+ y(!0), h("error"), pe("chat");
30187
30202
  }
30188
30203
  },
30189
30204
  onDisconnect: (t) => {
@@ -30200,21 +30215,21 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30200
30215
  try {
30201
30216
  S.current?.setMicMuted?.(!0);
30202
30217
  } catch {}
30203
- y(!0), fe("chat");
30218
+ y(!0), pe("chat");
30204
30219
  }
30205
30220
  });
30206
30221
  if (e) {
30207
- console.warn("[FlowEngage:VoiceDebug] ❌ cancelled=true after startSession resolved — killing session immediately"), me.endSession().catch(() => {});
30222
+ console.warn("[FlowEngage:VoiceDebug] ❌ cancelled=true after startSession resolved — killing session immediately"), _e.endSession().catch(() => {});
30208
30223
  return;
30209
30224
  }
30210
- o = me, S.current = me, h("listening");
30225
+ o = _e, S.current = _e, h("listening");
30211
30226
  try {
30212
30227
  let e = typeof window < "u" ? window.location.href : "", r = "[]";
30213
30228
  try {
30214
30229
  r = await t.flowengage_list_forms();
30215
30230
  } catch {}
30216
30231
  let a = u && !f ? `RESUMING PRIOR SESSION — DO NOT GREET. The visitor is continuing the same conversation after a page reload. Do not introduce yourself or re-state your capabilities. Wait silently until the visitor speaks; if you must speak first, briefly acknowledge where you left off in one short sentence.\nPrior transcript:\n${n?.transcript || ""}\n\n` : "";
30217
- me.sendContextualUpdate(`${a}Page: ${e}. SiteId: ${i || "unknown"}. Forms: ${r}. Voice: call end_voice_session or say you are ending the session to stop.`);
30232
+ _e.sendContextualUpdate(`${a}Page: ${e}. SiteId: ${i || "unknown"}. Forms: ${r}. Voice: call end_voice_session or say you are ending the session to stop.`);
30218
30233
  } catch {}
30219
30234
  if (typeof window < "u") {
30220
30235
  let t = window.location.pathname, n = () => {
@@ -30267,7 +30282,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30267
30282
  if (i) try {
30268
30283
  He(i);
30269
30284
  } catch {}
30270
- typeof window < "u" && (window.__fe_user_nav_during_speech = null), Ar(), le.current &&= (clearTimeout(le.current), null), ue.current &&= (clearTimeout(ue.current), null), ce.current = !1, de.current = !1, se.current = "idle", c && typeof window < "u" && (window.history.pushState = c), d && typeof window < "u" && window.removeEventListener("popstate", d);
30285
+ typeof window < "u" && (window.__fe_user_nav_during_speech = null), Ar(), le.current &&= (clearTimeout(le.current), null), ue.current &&= (clearTimeout(ue.current), null), ce.current = !1, fe.current = !1, de.current = !1, se.current = "idle", c && typeof window < "u" && (window.history.pushState = c), d && typeof window < "u" && window.removeEventListener("popstate", d);
30271
30286
  let t = o || S.current, n = E.current, f = ie.current;
30272
30287
  if (t?.endSession?.().catch(() => {}), n && s && a) {
30273
30288
  let e = f ? Math.round((Date.now() - f) / 1e3) : 0, t = JSON.stringify({
@@ -30289,7 +30304,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30289
30304
  r,
30290
30305
  i,
30291
30306
  a,
30292
- fe
30307
+ pe
30293
30308
  ]), c(() => {
30294
30309
  if (!b) return;
30295
30310
  let e = (e) => {
@@ -30311,6 +30326,22 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30311
30326
  /* @__PURE__ */ _("div", {
30312
30327
  style: { position: "relative" },
30313
30328
  children: [
30329
+ f === "thinking" && !v && /* @__PURE__ */ g("span", {
30330
+ style: {
30331
+ position: "absolute",
30332
+ right: "100%",
30333
+ marginRight: "18px",
30334
+ top: "50%",
30335
+ transform: "translateY(-50%)",
30336
+ color: "#a78bfa",
30337
+ fontSize: "18px",
30338
+ fontWeight: 600,
30339
+ letterSpacing: "0.01em",
30340
+ textShadow: "0 2px 4px rgba(0,0,0,0.4)",
30341
+ whiteSpace: "nowrap"
30342
+ },
30343
+ children: "Processing..."
30344
+ }),
30314
30345
  f === "listening" && !v && /* @__PURE__ */ g("span", {
30315
30346
  style: {
30316
30347
  position: "absolute",
@@ -30475,7 +30506,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30475
30506
  children: [
30476
30507
  /* @__PURE__ */ _("button", {
30477
30508
  onClick: () => {
30478
- x(!1), re.current = "chat", pe(t);
30509
+ x(!1), re.current = "chat", me(t);
30479
30510
  },
30480
30511
  style: {
30481
30512
  display: "flex",
@@ -30504,7 +30535,7 @@ function Pk({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, siteId: i,
30504
30535
  }),
30505
30536
  /* @__PURE__ */ _("button", {
30506
30537
  onClick: () => {
30507
- x(!1), re.current = "minimized", pe(n);
30538
+ x(!1), re.current = "minimized", me(n);
30508
30539
  },
30509
30540
  style: {
30510
30541
  display: "flex",
@@ -31400,27 +31431,27 @@ function Rk() {
31400
31431
  pr();
31401
31432
  } catch {}
31402
31433
  }, []), c(() => {
31403
- Ee && k !== "voice_mode" && k !== "text_chat" && k !== "call_screen" && (ue?.(!1), A("text_chat"));
31434
+ Ee && A !== "voice_mode" && A !== "text_chat" && A !== "call_screen" && (ue?.(!1), ot("text_chat"));
31404
31435
  }, [Ee]);
31405
31436
  let Oe = t?.widgetSettings || {}, ke = n?.widgetSettings || {}, Ae = {
31406
31437
  ...Oe.branding || {},
31407
31438
  ...ke.branding || {}
31408
- }, je = {
31439
+ }, Ne = {
31409
31440
  ...Oe.theme || {},
31410
31441
  ...ke.theme || {}
31411
- }, Ne = {
31442
+ }, Pe = {
31412
31443
  ...Oe.features || {},
31413
31444
  ...ke.features || {}
31414
- }, Pe = Ne.voice !== !1, Ie = Array.isArray(je.orbColors) && je.orbColors.length > 0 ? je.orbColors : null, Le = je.buttonColor || je.primaryColor || Ie?.[0] || "#3B82F6", ze = {
31445
+ }, Ie = Pe.voice !== !1, Le = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Le?.[0] || "#3B82F6", Be = {
31415
31446
  small: 50,
31416
31447
  medium: 64,
31417
31448
  large: 80
31418
- }, Be = ze[je.orbSize] || ze.small, Ve = je.position || "bottom-right", He = Ae.fallbackAgentName || "Agent", O = Tk(Ie ?? je.chatBgColors), Ue = Ae.logo || Ae.logoUrl || null, We = E || "en", Ge = Oe.recommendations?.[We] || [], Ke = (ke.recommendations?.[We] ?? Ge).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31449
+ }, Ve = Be[Ne.orbSize] || Be.small, He = Ne.position || "bottom-right", O = Ae.fallbackAgentName || "Agent", Ue = Tk(Le ?? Ne.chatBgColors), We = Ae.logo || Ae.logoUrl || null, Ge = E || "en", Ke = Oe.recommendations?.[Ge] || [], qe = (ke.recommendations?.[Ge] ?? Ke).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31419
31450
  id: e.key || `qr-${t}`,
31420
31451
  label: e.label,
31421
31452
  message: e.label,
31422
31453
  text: e.label
31423
- })), qe = Array.isArray(Ae.quickChatOptions) && Ae.quickChatOptions.length > 0 ? Ae.quickChatOptions : Ke, Je = Ae.hideWatermark === !0 ? !1 : Ae.showPoweredBy !== !1, Ye = Ae.chatbotEnabled !== !1 && je.chatbotEnabled !== !1, Xe = Oe.greetings?.[E] || ke.greetings?.[E] || Ae.introGreeting || "Hello, I'm here to help you know more about OpenSense Labs.", Ze = {
31454
+ })), Je = Array.isArray(Ae.quickChatOptions) && Ae.quickChatOptions.length > 0 ? Ae.quickChatOptions : qe, Ye = Ae.hideWatermark === !0 ? !1 : Ae.showPoweredBy !== !1, Xe = Ae.chatbotEnabled !== !1 && Ne.chatbotEnabled !== !1, Ze = Oe.greetings?.[E] || ke.greetings?.[E] || Ae.introGreeting || "Hello, I'm here to help you know more about OpenSense Labs.", Qe = {
31424
31455
  entryPrompt: Ae.entryPrompt || "Do you want to explore in a new way?",
31425
31456
  yesLabel: Ae.yesLabel || "Yes",
31426
31457
  laterLabel: Ae.laterLabel || "Later",
@@ -31428,189 +31459,189 @@ function Rk() {
31428
31459
  voiceLabel: Ae.voiceLabel || "Voice",
31429
31460
  textLabel: Ae.textLabel || "Text",
31430
31461
  chatTitle: Ae.headerName || "Chat with FlowEngage",
31431
- introGreeting: Xe,
31462
+ introGreeting: Ze,
31432
31463
  inputPlaceholder: Ae.inputPlaceholder || "Type your message",
31433
31464
  analysingLabel: Ae.analysingLabel || "analysing..."
31434
- }, Qe = ke.elevenLabsAgentId || t?.elevenLabsAgentId || null, $e = t?.siteId || n?.siteId || null, et = t?.apiBaseUrl || "", tt = f(() => l && String(l).trim() || t?.ownerName && String(t.ownerName).trim() || t?.websiteName && String(t.websiteName).trim() || "Agent", [
31465
+ }, $e = ke.elevenLabsAgentId || t?.elevenLabsAgentId || null, et = t?.siteId || n?.siteId || null, tt = t?.apiBaseUrl || "", nt = f(() => l && String(l).trim() || t?.ownerName && String(t.ownerName).trim() || t?.websiteName && String(t.websiteName).trim() || "Agent", [
31435
31466
  l,
31436
31467
  t?.ownerName,
31437
31468
  t?.websiteName
31438
- ]), nt = u && String(u).trim() || t?.ownerProfileImageUrl && String(t.ownerProfileImageUrl).trim() || null, rt = r.some((e) => e.sender === "user"), it = f(() => {
31469
+ ]), rt = u && String(u).trim() || t?.ownerProfileImageUrl && String(t.ownerProfileImageUrl).trim() || null, it = r.some((e) => e.sender === "user"), at = f(() => {
31439
31470
  let e = r.findIndex((e) => e.sender === "user");
31440
31471
  return e === -1 ? !1 : r.slice(e + 1).some((e) => e.sender === "bot" || e.sender === "ai" || e.sender === "agent");
31441
- }, [r]), at = !!(ke._dashboardLivePreview || Oe._dashboardLivePreview), [k, A] = m(() => at ? "text_chat" : "entry_prompt"), [ot, st] = m(""), [ct, lt] = m(null), [ut, dt] = m(h || ""), [ft, pt] = m(""), [mt, ht] = m(!1), [gt, j] = m(0), [_t, vt] = m(null), [yt, bt] = m(null), [xt, St] = m(""), [Ct, wt] = m(!1), [Tt, Et] = m(!1), [Dt, Ot] = m(!1), kt = p(null), At = p(!1), jt = !h && rt && it && k !== "voice_mode";
31472
+ }, [r]), k = !!(ke._dashboardLivePreview || Oe._dashboardLivePreview), [A, ot] = m(() => k ? "text_chat" : "entry_prompt"), [st, ct] = m(""), [lt, ut] = m(null), [dt, ft] = m(h || ""), [pt, mt] = m(""), [ht, gt] = m(!1), [j, _t] = m(0), [vt, yt] = m(null), [bt, xt] = m(null), [St, Ct] = m(""), [wt, Tt] = m(!1), [Et, Dt] = m(!1), [Ot, kt] = m(!1), At = p(null), jt = p(!1), Mt = !h && it && at && A !== "voice_mode";
31442
31473
  d(() => {
31443
- if (e !== "ready" || At.current) return;
31444
- if (At.current = !0, !Pe) {
31445
- A("minimized_orb");
31474
+ if (e !== "ready" || jt.current) return;
31475
+ if (jt.current = !0, !Ie) {
31476
+ ot("minimized_orb");
31446
31477
  return;
31447
31478
  }
31448
31479
  let t = !1;
31449
31480
  try {
31450
31481
  t = Tr().shouldResumeVoice;
31451
31482
  } catch {}
31452
- let n = Fe();
31483
+ let n = Fe(), r = et ? je(et) : null, i = n || !!r?.transcript;
31453
31484
  if (t) {
31454
- ce?.({ notifyChatInitiated: !0 }), ue?.(!0), A("voice_mode");
31485
+ ce?.({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
31455
31486
  return;
31456
31487
  }
31457
31488
  if (Re()) {
31458
- ce?.({ notifyChatInitiated: !1 }), A("text_chat");
31489
+ ce?.({ notifyChatInitiated: !1 }), ot("text_chat");
31459
31490
  return;
31460
31491
  }
31461
- if (n) {
31462
- ce?.({ notifyChatInitiated: !0 }), ue?.(!0), A("voice_mode");
31492
+ if (i) {
31493
+ ce?.({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
31463
31494
  return;
31464
31495
  }
31465
- if ($e) try {
31466
- Me($e);
31496
+ if (et) try {
31497
+ Me(et);
31467
31498
  } catch {}
31468
- if (fe($e)) {
31469
- A("minimized_orb");
31499
+ if (fe(et)) {
31500
+ ot("minimized_orb");
31470
31501
  return;
31471
31502
  }
31472
31503
  }, [e, r]);
31473
- let [Mt, Nt] = m(() => typeof window < "u" && window.matchMedia("(max-width: 640px)").matches);
31504
+ let [Nt, Pt] = m(() => typeof window < "u" && window.matchMedia("(max-width: 640px)").matches);
31474
31505
  c(() => {
31475
- let e = window.matchMedia("(max-width: 640px)"), t = (e) => Nt(e.matches);
31506
+ let e = window.matchMedia("(max-width: 640px)"), t = (e) => Pt(e.matches);
31476
31507
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
31477
31508
  }, []), c(() => {
31478
- dt(h || ""), h && pt("");
31509
+ ft(h || ""), h && mt("");
31479
31510
  }, [h]);
31480
- let Pt = o(() => {
31481
- bt(null), St("");
31482
- }, []), Ft = o((e) => {
31511
+ let Ft = o(() => {
31512
+ xt(null), Ct("");
31513
+ }, []), It = o((e) => {
31483
31514
  let t = qD(e);
31484
31515
  if (t) {
31485
- bt(null), St(t);
31516
+ xt(null), Ct(t);
31486
31517
  return;
31487
31518
  }
31488
- bt(e), St("");
31519
+ xt(e), Ct("");
31489
31520
  }, []);
31490
31521
  c(() => {
31491
31522
  if (!te || ee !== "connected") {
31492
- j(0);
31523
+ _t(0);
31493
31524
  return;
31494
31525
  }
31495
31526
  let e = () => {
31496
31527
  let e = new Date(te).getTime();
31497
- isNaN(e) || j(Math.max(0, Math.floor((Date.now() - e) / 1e3)));
31528
+ isNaN(e) || _t(Math.max(0, Math.floor((Date.now() - e) / 1e3)));
31498
31529
  };
31499
31530
  e();
31500
31531
  let t = window.setInterval(e, 1e3);
31501
31532
  return () => window.clearInterval(t);
31502
31533
  }, [te, ee]);
31503
- let It = o(() => {
31504
- A("call_screen"), Et(!1);
31505
- }, []), Lt = o(() => {
31506
- A("text_chat"), Et(!0);
31534
+ let Lt = o(() => {
31535
+ ot("call_screen"), Dt(!1);
31536
+ }, []), Rt = o(() => {
31537
+ ot("text_chat"), Dt(!0);
31507
31538
  }, []);
31508
31539
  c(() => {
31509
31540
  let e = w?.callId || T || null;
31510
31541
  if (!e) {
31511
- kt.current = null;
31542
+ At.current = null;
31512
31543
  return;
31513
31544
  }
31514
31545
  if (w?.callId || ee === "connecting" || ee === "connected") {
31515
- if (k === "minimized_orb" && Tt && T && !w?.callId) {
31516
- kt.current = e;
31546
+ if (A === "minimized_orb" && Et && T && !w?.callId) {
31547
+ At.current = e;
31517
31548
  return;
31518
31549
  }
31519
- !(!i || k === "minimized_orb" || k === "voice_mode") && kt.current === e || (console.log("[FlowEngageWidget] forcing call UI to front", {
31550
+ !(!i || A === "minimized_orb" || A === "voice_mode") && At.current === e || (console.log("[FlowEngageWidget] forcing call UI to front", {
31520
31551
  forcedKey: e,
31521
31552
  isOpen: i,
31522
- surface: k,
31553
+ surface: A,
31523
31554
  hasIncomingCall: !!w?.callId,
31524
31555
  activeCallId: T,
31525
31556
  callConnectionState: ee
31526
- }), kt.current = e, k === "voice_mode" && ue?.(!1), ce?.(), It());
31557
+ }), At.current = e, A === "voice_mode" && ue?.(!1), ce?.(), Lt());
31527
31558
  }
31528
31559
  }, [
31529
31560
  T,
31530
31561
  ee,
31531
- It,
31562
+ Lt,
31532
31563
  w?.callId,
31533
31564
  i,
31534
31565
  ce,
31535
31566
  ue,
31536
- k
31567
+ A
31537
31568
  ]), c(() => {
31538
- !w && !T && k === "call_screen" && A("text_chat");
31569
+ !w && !T && A === "call_screen" && ot("text_chat");
31539
31570
  }, [
31540
31571
  w,
31541
31572
  T,
31542
- k
31573
+ A
31543
31574
  ]), c(() => {
31544
- !T && Tt && Et(!1);
31545
- }, [T, Tt]), c(() => {
31575
+ !T && Et && Dt(!1);
31576
+ }, [T, Et]), c(() => {
31546
31577
  if (!s || C) {
31547
31578
  Se?.(""), xe?.();
31548
31579
  return;
31549
31580
  }
31550
- if (!ot.trim() || yt) {
31581
+ if (!st.trim() || bt) {
31551
31582
  Se?.("");
31552
31583
  let e = window.setTimeout(() => xe?.(), 100);
31553
31584
  return () => window.clearTimeout(e);
31554
31585
  }
31555
31586
  be?.();
31556
- let e = window.setTimeout(() => Se?.(ot), 120), t = window.setTimeout(() => xe?.(), 1200);
31587
+ let e = window.setTimeout(() => Se?.(st), 120), t = window.setTimeout(() => xe?.(), 1200);
31557
31588
  return () => {
31558
31589
  window.clearTimeout(e), window.clearTimeout(t);
31559
31590
  };
31560
31591
  }, [
31561
- ot,
31562
- yt,
31592
+ st,
31593
+ bt,
31563
31594
  s,
31564
31595
  C,
31565
31596
  be,
31566
31597
  xe,
31567
31598
  Se
31568
31599
  ]);
31569
- let Rt = (e) => e ? {
31600
+ let zt = (e) => e ? {
31570
31601
  replyTo: e.messageId || e.id || null,
31571
31602
  replyToContent: (e.replyToContent || e.message || "").replace(/<[^>]+>/g, "").trim().slice(0, 200),
31572
31603
  replyToSender: e.sender || null
31573
- } : null, zt = async (e) => {
31604
+ } : null, Bt = async (e) => {
31574
31605
  if (e.preventDefault(), C) return;
31575
- if (jt) {
31576
- let e = ut.trim().toLowerCase();
31606
+ if (Mt) {
31607
+ let e = dt.trim().toLowerCase();
31577
31608
  if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
31578
- pt("Please enter a valid email so we can continue helping you.");
31609
+ mt("Please enter a valid email so we can continue helping you.");
31579
31610
  return;
31580
31611
  }
31581
- await le(e), pt(""), ht(!0), setTimeout(() => ht(!1), 3e3);
31612
+ await le(e), mt(""), gt(!0), setTimeout(() => gt(!1), 3e3);
31582
31613
  return;
31583
31614
  }
31584
- let t = Rt(ct);
31585
- if (!ot.trim() && !yt) return;
31586
- if (yt) {
31615
+ let t = zt(lt);
31616
+ if (!st.trim() && !bt) return;
31617
+ if (bt) {
31587
31618
  try {
31588
- wt(!0), St("");
31589
- let e = await se(yt), n = e?.data || e, r = ot.trim() || `Shared file: ${YD(yt)}`;
31590
- st(""), lt(null), Pt(), await D(r, "", t, {
31619
+ Tt(!0), Ct("");
31620
+ let e = await se(bt), n = e?.data || e, r = st.trim() || `Shared file: ${YD(bt)}`;
31621
+ ct(""), ut(null), Ft(), await D(r, "", t, {
31591
31622
  type: "file",
31592
31623
  metadata: {
31593
31624
  fileUrl: n?.fileUrl,
31594
- fileName: n?.fileName || yt.name,
31595
- fileType: n?.fileType || yt.type,
31596
- fileSize: n?.fileSize || yt.size
31625
+ fileName: n?.fileName || bt.name,
31626
+ fileType: n?.fileType || bt.type,
31627
+ fileSize: n?.fileSize || bt.size
31597
31628
  }
31598
31629
  });
31599
31630
  } catch (e) {
31600
- St(e?.message || "Failed to upload the selected file.");
31631
+ Ct(e?.message || "Failed to upload the selected file.");
31601
31632
  } finally {
31602
- wt(!1);
31633
+ Tt(!1);
31603
31634
  }
31604
31635
  return;
31605
31636
  }
31606
- let n = ot.trim();
31607
- st(""), lt(null), await D(n, "", t);
31608
- }, Bt = o(() => {
31637
+ let n = st.trim();
31638
+ ct(""), ut(null), await D(n, "", t);
31639
+ }, Vt = o(() => {
31609
31640
  r.length !== 0 && me?.();
31610
- }, [r.length, me]), Vt = (e) => {
31641
+ }, [r.length, me]), Ht = (e) => {
31611
31642
  let t = Math.floor(e / 60);
31612
31643
  return `${String(t).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`;
31613
- }, Ht = o(async (e) => {
31644
+ }, Ut = o(async (e) => {
31614
31645
  if (C || b) return;
31615
31646
  let t = e.message || e.label || e.text || "";
31616
31647
  t.trim() && await D(t.trim(), "");
@@ -31618,44 +31649,44 @@ function Rk() {
31618
31649
  C,
31619
31650
  b,
31620
31651
  D
31621
- ]), Ut = Mt && k === "entry_prompt" ? { inset: 0 } : Mt && k === "text_chat" ? {
31652
+ ]), Wt = Nt && A === "entry_prompt" ? { inset: 0 } : Nt && A === "text_chat" ? {
31622
31653
  left: 0,
31623
31654
  right: 0,
31624
31655
  bottom: 0
31625
- } : Mt && k === "call_screen" ? {
31656
+ } : Nt && A === "call_screen" ? {
31626
31657
  left: 0,
31627
31658
  right: 0,
31628
31659
  bottom: 0,
31629
31660
  height: "90dvh",
31630
31661
  overflow: "hidden",
31631
31662
  borderRadius: "16px 16px 0 0"
31632
- } : Mt && k === "connection_modal" ? {
31663
+ } : Nt && A === "connection_modal" ? {
31633
31664
  left: "12px",
31634
31665
  right: "12px",
31635
31666
  bottom: "12px"
31636
- } : k === "call_screen" ? {
31667
+ } : A === "call_screen" ? {
31637
31668
  width: "min(350px, calc(100vw - 40px))",
31638
31669
  height: "min(640px, calc(100vh - 120px))",
31639
31670
  borderRadius: "22px",
31640
31671
  overflow: "hidden",
31641
- ...Ve === "bottom-left" ? {
31672
+ ...He === "bottom-left" ? {
31642
31673
  left: "1.5rem",
31643
31674
  bottom: "1.5rem"
31644
31675
  } : {
31645
31676
  right: "1.5rem",
31646
31677
  bottom: "1.5rem"
31647
31678
  }
31648
- } : Ve === "bottom-left" ? {
31679
+ } : He === "bottom-left" ? {
31649
31680
  left: "1.5rem",
31650
31681
  bottom: "1.5rem"
31651
31682
  } : {
31652
31683
  right: "1.5rem",
31653
31684
  bottom: "1.5rem"
31654
- }, Wt = o(() => {
31655
- k !== "minimized_orb" && (Ot(!0), setTimeout(() => {
31656
- A("minimized_orb"), Ot(!1), T && Et(!0);
31685
+ }, Gt = o(() => {
31686
+ A !== "minimized_orb" && (kt(!0), setTimeout(() => {
31687
+ ot("minimized_orb"), kt(!1), T && Dt(!0);
31657
31688
  }, 280));
31658
- }, [T, k]), Gt = () => A("connection_modal"), Kt = () => {
31689
+ }, [T, A]), Kt = () => ot("connection_modal"), qt = () => {
31659
31690
  try {
31660
31691
  let e = window.AudioContext || window.webkitAudioContext;
31661
31692
  if (e) {
@@ -31663,36 +31694,36 @@ function Rk() {
31663
31694
  t.resume().catch(() => {}), setTimeout(() => t.close().catch(() => {}), 3e3);
31664
31695
  }
31665
31696
  } catch {}
31666
- ce({ notifyChatInitiated: !0 }), ue?.(!0), A("voice_mode");
31667
- }, qt = () => {
31668
- ce({ notifyChatInitiated: !0 }), ue?.(!1), A("text_chat");
31697
+ ce({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
31669
31698
  }, Jt = () => {
31670
- ue?.(!1), Wt();
31699
+ ce({ notifyChatInitiated: !0 }), ue?.(!1), ot("text_chat");
31700
+ }, Yt = () => {
31701
+ ue?.(!1), Gt();
31671
31702
  };
31672
- return e !== "ready" || !Ye || Ne.chat === !1 ? null : /* @__PURE__ */ _("div", {
31703
+ return e !== "ready" || !Xe || Pe.chat === !1 ? null : /* @__PURE__ */ _("div", {
31673
31704
  className: "flowengage-widget-root",
31674
31705
  style: {
31675
31706
  position: "fixed",
31676
31707
  zIndex: 999999,
31677
- ...Ut
31708
+ ...Wt
31678
31709
  },
31679
31710
  onWheel: (e) => e.stopPropagation(),
31680
31711
  onTouchMove: (e) => e.stopPropagation(),
31681
31712
  children: [
31682
- k === "entry_prompt" && /* @__PURE__ */ g(Mk, {
31683
- copy: Ze,
31684
- orbColors: Ie,
31685
- primaryColor: Le,
31713
+ A === "entry_prompt" && /* @__PURE__ */ g(Mk, {
31714
+ copy: Qe,
31715
+ orbColors: Le,
31716
+ primaryColor: ze,
31686
31717
  onYes: () => {
31687
- pe($e), Kt();
31718
+ pe(et), qt();
31688
31719
  },
31689
31720
  onLater: () => {
31690
- pe($e), Wt();
31721
+ pe(et), Gt();
31691
31722
  },
31692
- isMobile: Mt,
31693
- isClosing: Dt
31723
+ isMobile: Nt,
31724
+ isClosing: Ot
31694
31725
  }),
31695
- k === "minimized_orb" && /* @__PURE__ */ _(Dm.div, {
31726
+ A === "minimized_orb" && /* @__PURE__ */ _(Dm.div, {
31696
31727
  layoutId: "fe-main-orb",
31697
31728
  initial: {
31698
31729
  scale: .4,
@@ -31711,14 +31742,14 @@ function Rk() {
31711
31742
  transformOrigin: "bottom right",
31712
31743
  display: "inline-flex",
31713
31744
  flexDirection: "column",
31714
- alignItems: Ve === "bottom-left" ? "flex-start" : "flex-end",
31745
+ alignItems: He === "bottom-left" ? "flex-start" : "flex-end",
31715
31746
  gap: "10px"
31716
31747
  },
31717
31748
  children: [T && /* @__PURE__ */ _("button", {
31718
31749
  type: "button",
31719
- onClick: It,
31750
+ onClick: Lt,
31720
31751
  style: {
31721
- maxWidth: Mt ? "220px" : "240px",
31752
+ maxWidth: Nt ? "220px" : "240px",
31722
31753
  padding: "10px 14px",
31723
31754
  borderRadius: "18px",
31724
31755
  border: "1px solid rgba(255,255,255,0.7)",
@@ -31759,109 +31790,109 @@ function Rk() {
31759
31790
  marginTop: "2px",
31760
31791
  whiteSpace: "nowrap"
31761
31792
  },
31762
- children: ee === "connected" ? `${Vt(gt)} with ${tt}` : `Tap to return to ${tt}`
31793
+ children: ee === "connected" ? `${Ht(j)} with ${nt}` : `Tap to return to ${nt}`
31763
31794
  })]
31764
31795
  })]
31765
31796
  }), /* @__PURE__ */ g(jk, {
31766
- size: Be,
31767
- orbColors: Ie,
31768
- onClick: T ? It : Pe ? Gt : qt
31797
+ size: Ve,
31798
+ orbColors: Le,
31799
+ onClick: T ? Lt : Ie ? Kt : Jt
31769
31800
  })]
31770
31801
  }),
31771
- k === "connection_modal" && /* @__PURE__ */ g(Nk, {
31772
- copy: Ze,
31773
- orbColors: Ie,
31774
- primaryColor: Le,
31775
- onVoice: Kt,
31776
- onText: qt,
31777
- onClose: Wt,
31778
- isMobile: Mt,
31779
- isClosing: Dt
31802
+ A === "connection_modal" && /* @__PURE__ */ g(Nk, {
31803
+ copy: Qe,
31804
+ orbColors: Le,
31805
+ primaryColor: ze,
31806
+ onVoice: qt,
31807
+ onText: Jt,
31808
+ onClose: Gt,
31809
+ isMobile: Nt,
31810
+ isClosing: Ot
31780
31811
  }),
31781
- k === "voice_mode" && /* @__PURE__ */ g(Pk, {
31782
- orbColors: Ie,
31783
- onEnterChat: qt,
31784
- onEndChat: Jt,
31785
- agentId: Qe,
31786
- siteId: $e,
31787
- apiBaseUrl: et,
31812
+ A === "voice_mode" && /* @__PURE__ */ g(Pk, {
31813
+ orbColors: Le,
31814
+ onEnterChat: Jt,
31815
+ onEndChat: Yt,
31816
+ agentId: $e,
31817
+ siteId: et,
31818
+ apiBaseUrl: tt,
31788
31819
  chatId: ie,
31789
31820
  historyRef: ae,
31790
31821
  onMessageSync: oe,
31791
31822
  voiceEndCounter: De
31792
31823
  }, "voice"),
31793
- k === "call_screen" && /* @__PURE__ */ g(gO, {
31824
+ A === "call_screen" && /* @__PURE__ */ g(gO, {
31794
31825
  incomingCall: w,
31795
31826
  activeCallId: T,
31796
31827
  callConnectionState: ee,
31797
- callDurationSeconds: gt,
31828
+ callDurationSeconds: j,
31798
31829
  isCallMuted: ne,
31799
- agentName: tt,
31800
- agentHeadshot: nt,
31801
- fallbackAgentName: He,
31830
+ agentName: nt,
31831
+ agentHeadshot: rt,
31832
+ fallbackAgentName: O,
31802
31833
  acceptCall: he,
31803
31834
  rejectCall: ge,
31804
31835
  endWebRTCCall: _e,
31805
31836
  toggleCallMute: ve,
31806
- formatCallDuration: Vt,
31807
- onMinimize: Lt,
31808
- primaryColor: Le,
31809
- orbColors: Ie,
31837
+ formatCallDuration: Ht,
31838
+ onMinimize: Rt,
31839
+ primaryColor: ze,
31840
+ orbColors: Le,
31810
31841
  chatHistory: r
31811
31842
  }),
31812
- k === "text_chat" && /* @__PURE__ */ g(Lk, {
31813
- isClosing: Dt,
31814
- copy: Ze,
31815
- orbColors: Ie,
31816
- primaryColor: Le,
31817
- chatBgGradient: O,
31818
- logo: Ue,
31819
- quickChatOptions: qe,
31820
- onQuickChatSelect: Ht,
31821
- isMobile: Mt,
31843
+ A === "text_chat" && /* @__PURE__ */ g(Lk, {
31844
+ isClosing: Ot,
31845
+ copy: Qe,
31846
+ orbColors: Le,
31847
+ primaryColor: ze,
31848
+ chatBgGradient: Ue,
31849
+ logo: We,
31850
+ quickChatOptions: Je,
31851
+ onQuickChatSelect: Ut,
31852
+ isMobile: Nt,
31822
31853
  chatHistory: r,
31823
31854
  isAiTyping: y,
31824
31855
  isAgentTyping: v,
31825
31856
  activeScreen: a,
31826
- agentName: tt,
31827
- agentHeadshot: nt,
31828
- fallbackAgentName: He,
31829
- input: ot,
31830
- setInput: st,
31831
- onSubmit: zt,
31857
+ agentName: nt,
31858
+ agentHeadshot: rt,
31859
+ fallbackAgentName: O,
31860
+ input: st,
31861
+ setInput: ct,
31862
+ onSubmit: Bt,
31832
31863
  isConversationEnded: C,
31833
31864
  isLoading: b,
31834
31865
  isRateLimited: x,
31835
31866
  rateLimitMessage: S,
31836
- selectedFile: yt,
31837
- onFileSelect: Ft,
31838
- onRemoveSelectedFile: Pt,
31839
- attachmentError: xt,
31840
- isUploadingAttachment: Ct,
31841
- requiresEmail: jt,
31842
- emailInput: ut,
31843
- setEmailInput: dt,
31844
- emailError: ft,
31845
- emailCaptureSuccess: mt,
31846
- replyContext: ct,
31847
- setReplyContext: lt,
31867
+ selectedFile: bt,
31868
+ onFileSelect: It,
31869
+ onRemoveSelectedFile: Ft,
31870
+ attachmentError: St,
31871
+ isUploadingAttachment: wt,
31872
+ requiresEmail: Mt,
31873
+ emailInput: dt,
31874
+ setEmailInput: ft,
31875
+ emailError: pt,
31876
+ emailCaptureSuccess: ht,
31877
+ replyContext: lt,
31878
+ setReplyContext: ut,
31848
31879
  webRTCError: re,
31849
- micError: _t,
31850
- setMicError: vt,
31880
+ micError: vt,
31881
+ setMicError: yt,
31851
31882
  dismissCallError: ye,
31852
31883
  activeCallId: T,
31853
31884
  isCallMuted: ne,
31854
31885
  toggleCallMute: ve,
31855
31886
  endWebRTCCall: _e,
31856
- formatCallDuration: Vt,
31857
- callDurationSeconds: gt,
31858
- onCollapse: Wt,
31859
- onStartVoice: Kt,
31860
- onNewChat: Bt,
31861
- onMinimize: Lt,
31862
- onExpand: It,
31887
+ formatCallDuration: Ht,
31888
+ callDurationSeconds: j,
31889
+ onCollapse: Gt,
31890
+ onStartVoice: qt,
31891
+ onNewChat: Vt,
31892
+ onMinimize: Rt,
31893
+ onExpand: Lt,
31863
31894
  isCallMinimized: !!T,
31864
- showPoweredBy: Je,
31895
+ showPoweredBy: Ye,
31865
31896
  getVisitorChatHistory: Ce,
31866
31897
  resumeChat: we,
31867
31898
  isSessionRestoring: Te