@axos-web-dev/shared-components 1.0.100-dev.56 → 1.0.100-dev.57

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.
Files changed (183) hide show
  1. package/dist/ATMLocator/ATMLocator.js +2 -4
  2. package/dist/Accordion/Accordion.css.js +1 -2
  3. package/dist/Accordion/Accordion.js +1 -2
  4. package/dist/AlertBanner/index.js +1 -2
  5. package/dist/Article/Article.css.js +1 -2
  6. package/dist/ArticlesSet/ArticlesSet.css.js +1 -2
  7. package/dist/Auth/ErrorAlert.js +2 -4
  8. package/dist/Auth/SignIn.css.js +1 -2
  9. package/dist/AwardsBanner/AwardsBanner.css.js +1 -2
  10. package/dist/Blockquote/Blockquote.module.js +3 -3
  11. package/dist/BulletItem/BulletItem.js +1 -2
  12. package/dist/Button/Button.css.js +1 -2
  13. package/dist/Button/Button.js +2 -4
  14. package/dist/Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js +1 -2
  15. package/dist/Calculators/ApyCalculator/ApyCalculator.css.js +1 -2
  16. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.d.ts +2 -0
  17. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +7 -3
  18. package/dist/Calculators/AxosOneCalculator/index.js +72 -66
  19. package/dist/Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js +1 -2
  20. package/dist/Calculators/BalanceAPYCalculator/index.js +1 -2
  21. package/dist/Calculators/BuyDownCalculator/BuyDownCalculator.css.js +1 -2
  22. package/dist/Calculators/Calculator.js +2 -4
  23. package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +1 -2
  24. package/dist/Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.js +1 -2
  25. package/dist/Calculators/SummitApyCalculator/BalanceAPYCalculator.css.js +1 -2
  26. package/dist/Calculators/SummitApyCalculator/index.js +1 -2
  27. package/dist/Calculators/calculator.css.js +1 -2
  28. package/dist/CallToActionBar/CallToActionBar.css.js +1 -2
  29. package/dist/Carousel/Carousel.css.js +1 -2
  30. package/dist/Carousel/index.js +2 -4
  31. package/dist/Chatbot/Bubble.css.d.ts +0 -4
  32. package/dist/Chatbot/Bubble.css.js +3 -15
  33. package/dist/Chatbot/Bubble.js +19 -26
  34. package/dist/Chatbot/ChatWindow.css.d.ts +0 -17
  35. package/dist/Chatbot/ChatWindow.css.js +17 -46
  36. package/dist/Chatbot/ChatWindow.d.ts +1 -4
  37. package/dist/Chatbot/ChatWindow.js +283 -322
  38. package/dist/Chatbot/Chatbot.css.js +1 -1
  39. package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
  40. package/dist/Chatbot/Chatbot.js +5 -32
  41. package/dist/Chatbot/index.js +2 -18
  42. package/dist/Chatbot/store/chat.d.ts +0 -3
  43. package/dist/Chatbot/store/chat.js +1 -4
  44. package/dist/Chatbot/store/messages.d.ts +1 -1
  45. package/dist/Chatbot/store/messages.js +2 -7
  46. package/dist/Chevron/Chevron.css.js +1 -2
  47. package/dist/Chevron/index.js +2 -4
  48. package/dist/CollectInformationAlert/CollectInformationAlert.css.js +1 -2
  49. package/dist/CollectInformationAlert/index.js +1 -2
  50. package/dist/Comparison/Comparison.css.js +1 -2
  51. package/dist/Comparison/Comparison.js +2 -4
  52. package/dist/ContentBanner/ContentBanner.css.js +1 -2
  53. package/dist/DownloadTile/DownloadTile.css.js +1 -2
  54. package/dist/ExecutiveBio/ExecutiveBio.css.js +1 -2
  55. package/dist/ExecutiveBio/ExecutiveBio.js +2 -4
  56. package/dist/FaqAccordion/FaqAccordion.css.js +1 -2
  57. package/dist/FaqAccordion/index.js +2 -4
  58. package/dist/FooterDisclosure/LVF/LaVictorieFooter.css.js +1 -2
  59. package/dist/FooterDisclosure/LVF/LaVictorieFooter.js +1 -2
  60. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.css.js +1 -2
  61. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +21 -5
  62. package/dist/Forms/ApplicationStart.js +1 -2
  63. package/dist/Forms/ApplyNow.js +2 -4
  64. package/dist/Forms/ClearingForm.js +1 -2
  65. package/dist/Forms/CommercialDeposits.js +1 -2
  66. package/dist/Forms/CommercialDepositsNoLendingOption.js +1 -2
  67. package/dist/Forms/CommercialLending.js +1 -2
  68. package/dist/Forms/CommercialPremiumFinance.js +1 -2
  69. package/dist/Forms/ContactCompany.js +1 -2
  70. package/dist/Forms/ContactCompanyTitle.js +1 -2
  71. package/dist/Forms/ContactUs.js +1 -2
  72. package/dist/Forms/ContactUsAAS.js +1 -2
  73. package/dist/Forms/ContactUsBusiness.js +2 -4
  74. package/dist/Forms/ContactUsBusinessNameEmail.js +2 -4
  75. package/dist/Forms/ContactUsLVF.js +1 -2
  76. package/dist/Forms/ContactUsNMLSId.js +2 -4
  77. package/dist/Forms/CpraRequest.js +1 -2
  78. package/dist/Forms/CraPublicFile.js +2 -4
  79. package/dist/Forms/DealerServices.js +1 -2
  80. package/dist/Forms/EmailOnly.js +2 -4
  81. package/dist/Forms/EmailUs.js +1 -2
  82. package/dist/Forms/Forms.css.js +1 -2
  83. package/dist/Forms/MortgageRate/MortgageRateForm.js +2 -4
  84. package/dist/Forms/MortgageRate/MortgageRateWatch.js +2 -4
  85. package/dist/Forms/MortgageWarehouseLending.js +2 -4
  86. package/dist/Forms/QuickPricer/QuickPricerForm.js +1 -2
  87. package/dist/Forms/QuickPricer/UserInformation.css.js +1 -2
  88. package/dist/Forms/ScheduleCall.js +1 -2
  89. package/dist/Forms/ScheduleCallPremier.js +1 -2
  90. package/dist/Forms/SuccesForm.js +2 -4
  91. package/dist/Forms/WcplSurvey.js +1 -2
  92. package/dist/HeroBanner/HeroBanner.css.js +1 -2
  93. package/dist/HeroBanner/HeroBanner.js +1 -2
  94. package/dist/HeroBanner/LargeBanner.css.js +1 -2
  95. package/dist/HeroBanner/SelectionBanner.css.js +1 -2
  96. package/dist/Hyperlink/Hyperlink.css.js +1 -2
  97. package/dist/Hyperlink/index.js +2 -4
  98. package/dist/IconBillboard/IconBillboard.css.js +1 -2
  99. package/dist/ImageBillboard/ImageBillboard.css.js +1 -2
  100. package/dist/ImageBillboard/ImageBillboard.js +1 -2
  101. package/dist/ImageBillboard/ImageBillboardSet.js +1 -2
  102. package/dist/ImageLink/ImageLink.js +2 -4
  103. package/dist/ImageLink/ImageLinkSet.js +2 -4
  104. package/dist/ImageLink/index.js +2 -4
  105. package/dist/Input/Input.css.js +1 -2
  106. package/dist/Inputs/Input.css.js +1 -2
  107. package/dist/Insight/Featured/CategorySelector.css.js +1 -2
  108. package/dist/Insight/Featured/CategorySelector.js +2 -4
  109. package/dist/Insight/Featured/Featured.js +2 -4
  110. package/dist/Insight/Featured/Header.js +2 -4
  111. package/dist/Interstitial/Interstitial-variants.css.js +1 -2
  112. package/dist/LandingPageHeader/LandingPageHeader.css.js +1 -2
  113. package/dist/LandingPageHeader/LandingPageHeader.js +1 -2
  114. package/dist/MainHTML/index.d.ts +1 -1
  115. package/dist/MainHTML/index.js +1 -3
  116. package/dist/Modal/Modal.css.js +1 -2
  117. package/dist/Modal/Modal.js +2 -4
  118. package/dist/Modal/contextApi/store.js +1 -1
  119. package/dist/NavigationMenu/AxosALTS/NavBar.css.js +1 -2
  120. package/dist/NavigationMenu/AxosALTS/NavData.js +2 -4
  121. package/dist/NavigationMenu/AxosALTS/index.js +2 -4
  122. package/dist/NavigationMenu/AxosAdvisor/NavBar.css.js +1 -2
  123. package/dist/NavigationMenu/AxosAdvisor/SubNavbar.css.js +1 -2
  124. package/dist/NavigationMenu/AxosAdvisorServices/NavBar.css.js +1 -2
  125. package/dist/NavigationMenu/AxosAdvisorServices/SubNavbar.css.js +1 -2
  126. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +2 -4
  127. package/dist/NavigationMenu/AxosBank/NavBar.css.js +1 -2
  128. package/dist/NavigationMenu/AxosBank/NavData.js +2 -4
  129. package/dist/NavigationMenu/AxosBank/SubNavBar.js +2 -4
  130. package/dist/NavigationMenu/AxosBank/SubNavbar.css.js +1 -2
  131. package/dist/NavigationMenu/AxosBank/index.js +2 -4
  132. package/dist/NavigationMenu/LaVictoire/NavData.js +2 -4
  133. package/dist/NavigationMenu/LaVictoire/index.js +2 -4
  134. package/dist/NavigationMenu/NavDataJson.js +2 -4
  135. package/dist/NavigationMenu/Navbar.js +2 -4
  136. package/dist/NavigationMenu/SignInNavButton.js +2 -4
  137. package/dist/PageNavItem/PageNavItem.css.js +1 -2
  138. package/dist/Pagination/Pagination.js +1 -2
  139. package/dist/SecondaryFooter/SecondaryFooter.css.js +1 -2
  140. package/dist/SetContainer/SetContainer.css.js +1 -2
  141. package/dist/SetContainer/SetContainer.js +2 -4
  142. package/dist/SocialMediaBar/iconsRepository.js +2 -4
  143. package/dist/StepItem/StepItem.css.js +1 -2
  144. package/dist/StepItemSet/StepItemSet.css.js +1 -2
  145. package/dist/StepItemSet/StepItemSet.js +1 -2
  146. package/dist/Tab/Tab.css.js +1 -2
  147. package/dist/Table/Table.css.js +1 -2
  148. package/dist/Table/Table.d.ts +1 -1
  149. package/dist/Table/Table.js +1 -2
  150. package/dist/TextBlock/TextBlock.css.js +1 -2
  151. package/dist/VideoTile/VideoTile.css.js +1 -2
  152. package/dist/VideoTile/VideoTile.js +2 -4
  153. package/dist/VideoWrapper/index.js +2 -4
  154. package/dist/assets/Blockquote/Blockquote.css.css +72 -72
  155. package/dist/assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css +40 -2
  156. package/dist/assets/Chatbot/Bubble.css +21 -58
  157. package/dist/assets/Chatbot/ChatWindow.css +83 -208
  158. package/dist/assets/DownloadTile/DownloadTile.css +1 -1
  159. package/dist/assets/Insight/Insight.css +2 -2
  160. package/dist/assets/themes/axos.css +0 -11
  161. package/dist/assets/themes/premier.css +0 -11
  162. package/dist/assets/themes/victorie.css +0 -11
  163. package/dist/icons/ArrowIcon/ArrowIcon.css.js +1 -2
  164. package/dist/icons/CheckIcon/CheckIcon.css.js +1 -2
  165. package/dist/icons/DownloadIcon/DownloadIcon.css.js +1 -2
  166. package/dist/icons/FollowIcon/FollowIcon.css.js +1 -2
  167. package/dist/main.js +2 -20
  168. package/dist/themes/axos.css.d.ts +0 -17
  169. package/dist/themes/axos.css.js +1 -1
  170. package/dist/themes/index.d.ts +0 -1
  171. package/dist/themes/index.js +0 -2
  172. package/package.json +136 -136
  173. package/dist/Chatbot/AnimatedGradientBorder.css.d.ts +0 -3
  174. package/dist/Chatbot/AnimatedGradientBorder.css.js +0 -13
  175. package/dist/Chatbot/ChatbotMessage.d.ts +0 -16
  176. package/dist/Chatbot/ChatbotMessage.js +0 -215
  177. package/dist/Chatbot/ThankYouMessage.d.ts +0 -9
  178. package/dist/Chatbot/ThankYouMessage.js +0 -510
  179. package/dist/assets/Chatbot/AnimatedGradientBorder.css +0 -37
  180. package/dist/assets/Chatbot/Chatbot.css +0 -3
  181. package/dist/assets/themes/ufb.css +0 -51
  182. package/dist/themes/ufb.css.d.ts +0 -1
  183. package/dist/themes/ufb.css.js +0 -6
@@ -1,19 +1,14 @@
1
1
  "use client";
2
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
- import { vars } from "../themes/axos.css.js";
4
- import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
5
- /* empty css */
6
- /* empty css */
7
- /* empty css */
8
3
  import clsx from "clsx";
9
- import React, { useRef, useEffect } from "react";
4
+ import React, { useRef, useEffect, Fragment as Fragment$1 } from "react";
5
+ import ReactMarkdown from "react-markdown";
10
6
  import { useNetworkState, useMount } from "react-use";
11
- import { gradientFocus } from "./AnimatedGradientBorder.css.js";
12
- import { ChatbotMessage } from "./ChatbotMessage.js";
13
- import { windowBarStyle, left_bar_section, chat_title, button_bar, chatbotMenuItem, chatbotMenu, chatEndDialogOverlay, chatFinishDialog, chatEndCircle, endChatButtonStyle, noAnswerButton, arrowFill, button_reset, buttonss_section, chatNetworkStatus, shimmerText, messagesContainerStyle, inputStyle, autoResize, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
7
+ import remarkGfm from "remark-gfm";
8
+ import { windowBarStyle, chat_title, chatbotMenuItem, chatbotMenu, chatFinishDialog, endChatButtonStyle, button_reset, arrowFill, chatNetworkStatus, notificationStyle, messageStyle, inline_button_wrapper, inline_button, messagesContainerStyle, inputStyle, autoResize, sendButtonStyle, windowStyle, windowOpenStyle } from "./ChatWindow.css.js";
9
+ import EllipsisLoader from "./EllipsisAnimation.js";
14
10
  import { EllipsisIcon } from "./EllipsisIcon.js";
15
11
  import { useOpenChat } from "./store/chat.js";
16
- import { ThankYouMessage } from "./ThankYouMessage.js";
17
12
  const ChatWindow = ({
18
13
  messages,
19
14
  status = "connected",
@@ -25,16 +20,8 @@ const ChatWindow = ({
25
20
  },
26
21
  showReconnect = false,
27
22
  virtualAgent,
28
- showAvatar = false,
29
- onNewChat = () => {
30
- console.log("Start chat");
31
- },
32
- showName = false,
33
- onCloseAfterThankYou = () => {
34
- console.log("Close after thank you");
35
- }
23
+ showAvatar = false
36
24
  }) => {
37
- const { showThankyouMessage, displayThankyouMessage, toggleThankyouMessage } = useOpenChat();
38
25
  const [mounted, setMounted] = React.useState(false);
39
26
  const [menuOpen, setMenuOpen] = React.useState(false);
40
27
  const [showEndChatDialog, setShowEndChatDialog] = React.useState(false);
@@ -57,6 +44,10 @@ const ChatWindow = ({
57
44
  useMount(() => {
58
45
  setMounted(true);
59
46
  });
47
+ const project = process.env.CCAI_PROJECT_ID;
48
+ const isAxos = project === "axos";
49
+ const endUserBg = isAxos ? "#14263d" : "#323339";
50
+ const chatbotBg = isAxos ? "#E9F8FF" : "#EAE8E8";
60
51
  const escalationDeflected = messages?.filter(
61
52
  (item) => item.type == "noti" && item.event == "escalationDeflected"
62
53
  ).length > 0;
@@ -72,291 +63,146 @@ const ChatWindow = ({
72
63
  useEffect(() => {
73
64
  autoResizeTextarea();
74
65
  }, [input]);
75
- const displayThankYouScreen = () => {
76
- displayThankyouMessage();
77
- };
78
- const onCancelEndChat = () => {
79
- setShowEndChatDialog(false);
80
- toggleThankyouMessage?.();
81
- onCloseAfterThankYou();
82
- setInput("");
83
- };
84
- const onStartChat = () => {
85
- onNewChat();
86
- setInput("");
87
- toggleThankyouMessage?.();
88
- };
89
66
  return /* @__PURE__ */ jsxs("div", { className: clsx(windowStyle, isOpen && windowOpenStyle), children: [
90
67
  /* @__PURE__ */ jsxs("div", { className: windowBarStyle, children: [
91
- /* @__PURE__ */ jsx("div", { className: clsx(left_bar_section) }),
92
- /* @__PURE__ */ jsxs(
93
- "div",
68
+ /* @__PURE__ */ jsxs("div", { className: "flex middle", style: { paddingBlock: "6px" }, children: [
69
+ /* @__PURE__ */ jsx(
70
+ "img",
71
+ {
72
+ src: "https://www.axos.com/images/2xmVfQm5l0HWOKjgxQO1Iw/axb-assistant.svg",
73
+ style: { marginRight: 12 },
74
+ height: 18,
75
+ width: 18
76
+ }
77
+ ),
78
+ /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Evo Virtual Assistant" })
79
+ ] }),
80
+ /* @__PURE__ */ jsx(
81
+ "button",
94
82
  {
95
- className: "flex middle center",
96
- style: { paddingBlock: "6px", gap: 4 },
97
- children: [
98
- /* @__PURE__ */ jsxs(
99
- "svg",
100
- {
101
- xmlns: "http://www.w3.org/2000/svg",
102
- width: "20",
103
- height: "17",
104
- viewBox: "0 0 20 17",
105
- fill: "none",
106
- children: [
107
- /* @__PURE__ */ jsx(
108
- "path",
109
- {
110
- d: "M10.5277 2.78937C10.8911 2.78937 11.1852 3.08251 11.1853 3.44452C11.1852 3.80654 10.8911 4.10056 10.5277 4.10056H5.26386C4.5371 4.10064 3.94791 4.68761 3.94789 5.41175V10.6565C3.9479 11.3806 4.5371 11.9676 5.26386 11.9677H6.97488C7.12012 11.9678 7.23818 12.0854 7.23825 12.2301V15.6861L10.8932 12.0445C10.9424 11.9956 11.0092 11.9679 11.0786 11.9677H14.4765C15.2032 11.9676 15.7925 11.3806 15.7925 10.6565V9.27302C15.7925 8.91106 16.0868 8.61721 16.45 8.61697C16.8134 8.61699 17.1084 8.91093 17.1084 9.27302V10.6565C17.1084 12.1048 15.9301 13.2788 14.4765 13.2789H11.5149L8.16901 16.6135C7.33997 17.4393 5.92245 16.8542 5.92229 15.6861V13.2789H5.26386C3.81026 13.2788 2.63193 12.1048 2.63193 10.6565V5.41175C2.63194 3.96341 3.81027 2.78945 5.26386 2.78937H10.5277Z",
111
- fill: "#1E3860"
112
- }
113
- ),
114
- /* @__PURE__ */ jsx(
115
- "path",
116
- {
117
- d: "M9.21265 0.166102C9.57579 0.166381 9.87012 0.460269 9.87018 0.822142C9.87004 1.18394 9.57574 1.47701 9.21265 1.47729H3.29036C2.20017 1.47729 1.31606 2.35831 1.31596 3.44452V6.72294C1.31577 7.08487 1.02083 7.37808 0.657534 7.37808C0.294361 7.37794 0.000196551 7.08478 0 6.72294V3.44452C9.80773e-05 1.63411 1.47333 0.166102 3.29036 0.166102H9.21265Z",
118
- fill: "#1E3860"
119
- }
120
- ),
121
- /* @__PURE__ */ jsx(
122
- "path",
123
- {
124
- d: "M15.7145 0.475824C15.9558 -0.158638 16.8779 -0.158578 17.1192 0.475824L17.6459 1.8611C17.7218 2.06058 17.8835 2.2175 18.0885 2.29132L19.511 2.80454C20.163 3.03936 20.163 3.93626 19.511 4.17107L18.0885 4.6843C17.8835 4.75812 17.7218 4.91504 17.6459 5.11452L17.1192 6.49979C16.8779 7.1342 15.9558 7.13426 15.7145 6.49979L15.1878 5.11452C15.1119 4.91508 14.9502 4.75811 14.7453 4.6843L13.3227 4.17107C12.6708 3.93622 12.6708 3.0394 13.3227 2.80454L14.7453 2.29132C14.9502 2.21751 15.1119 2.06054 15.1878 1.8611L15.7145 0.475824Z",
125
- fill: "#1E3860"
126
- }
127
- )
128
- ]
129
- }
130
- ),
131
- /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask Sam AI" })
132
- ]
83
+ onClick: () => {
84
+ setMenuOpen(!menuOpen);
85
+ },
86
+ style: {
87
+ border: "none",
88
+ background: "transparent",
89
+ marginLeft: "auto",
90
+ cursor: "pointer",
91
+ padding: 0,
92
+ display: "flex",
93
+ alignContent: "center"
94
+ },
95
+ children: /* @__PURE__ */ jsx(EllipsisIcon, { color: "#fff" })
133
96
  }
134
97
  ),
135
- /* @__PURE__ */ jsxs("div", { className: clsx(buttonss_section), children: [
98
+ menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsx(
99
+ "button",
100
+ {
101
+ type: "button",
102
+ onClick: () => {
103
+ setShowEndChatDialog(true);
104
+ setMenuOpen(false);
105
+ },
106
+ style: { width: "100%" },
107
+ children: "Finish chat"
108
+ }
109
+ ) }) }),
110
+ showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
136
111
  /* @__PURE__ */ jsx(
137
- "button",
112
+ "div",
138
113
  {
139
- onClick: () => {
140
- setMenuOpen(!menuOpen);
141
- },
142
- className: clsx(button_bar),
143
114
  style: {
144
- border: menuOpen ? `1px solid ${vars.chatbot.window.headerText}` : "none",
145
- cursor: "pointer",
146
- padding: 0,
147
- display: "flex",
148
- alignContent: "center",
149
- background: menuOpen ? "#0000000f" : void 0
150
- },
151
- children: /* @__PURE__ */ jsx(EllipsisIcon, {})
115
+ background: "#00000080",
116
+ position: "fixed",
117
+ top: 0,
118
+ left: 0,
119
+ right: 0,
120
+ bottom: 0,
121
+ zIndex: 999,
122
+ opacity: 0.75
123
+ }
152
124
  }
153
125
  ),
154
- menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsxs(
155
- "button",
126
+ /* @__PURE__ */ jsx(
127
+ "dialog",
156
128
  {
157
- type: "button",
158
- onClick: () => {
159
- setShowEndChatDialog(true);
160
- setMenuOpen(false);
161
- },
129
+ open: showEndChatDialog,
162
130
  style: {
163
- width: "100%",
164
- display: "flex",
165
- alignItems: "center",
166
- gap: "12px"
131
+ padding: "1rem",
132
+ borderRadius: 8,
133
+ background: "#fff",
134
+ color: "#000",
135
+ border: `1px solid ${endUserBg}`,
136
+ outline: "none",
137
+ maxWidth: "90%",
138
+ top: "25%",
139
+ marginInline: "auto",
140
+ zIndex: 1e3
167
141
  },
168
- children: [
169
- /* @__PURE__ */ jsx("div", { className: clsx(button_bar), children: /* @__PURE__ */ jsxs(
170
- "svg",
142
+ children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
143
+ /* @__PURE__ */ jsx("p", { children: "Are you sure you want to end this chat?" }),
144
+ /* @__PURE__ */ jsxs(
145
+ "div",
171
146
  {
172
- xmlns: "http://www.w3.org/2000/svg",
173
- width: "16",
174
- height: "16",
175
- viewBox: "0 0 16 16",
176
- fill: "none",
147
+ style: { display: "flex", gap: "1rem", marginTop: "1rem" },
177
148
  children: [
178
- /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_92_1389)", children: [
179
- /* @__PURE__ */ jsx(
180
- "path",
181
- {
182
- d: "M11.1236 5.37374L8.60278 7.89457L11.1236 10.4167L10.4166 11.1237L7.89445 8.6029L5.37362 11.1237L4.66658 10.4167L7.18742 7.89457L4.66658 5.37374L5.37362 4.66671L7.89445 7.18754L10.4166 4.66671L11.1236 5.37374Z",
183
- fill: "#1E3860"
184
- }
185
- ),
186
- /* @__PURE__ */ jsx(
187
- "path",
188
- {
189
- fillRule: "evenodd",
190
- clipRule: "evenodd",
191
- d: "M13.3333 0.833374C14.3458 0.833374 15.1666 1.65419 15.1666 2.66671V13.3334C15.1666 14.3459 14.3458 15.1667 13.3333 15.1667H2.66659C1.65406 15.1667 0.833252 14.3459 0.833252 13.3334V2.66671C0.833252 1.65419 1.65406 0.833374 2.66659 0.833374H13.3333ZM2.66659 1.83337C2.20635 1.83337 1.83325 2.20647 1.83325 2.66671V13.3334C1.83325 13.7936 2.20635 14.1667 2.66659 14.1667H13.3333C13.7935 14.1667 14.1666 13.7936 14.1666 13.3334V2.66671C14.1666 2.20647 13.7935 1.83337 13.3333 1.83337H2.66659Z",
192
- fill: "#1E3860"
193
- }
194
- )
195
- ] }),
196
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_92_1389", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
149
+ /* @__PURE__ */ jsx(
150
+ "button",
151
+ {
152
+ className: endChatButtonStyle,
153
+ type: "submit",
154
+ onClick: () => {
155
+ endChat();
156
+ setShowEndChatDialog(false);
157
+ },
158
+ children: "Yes"
159
+ }
160
+ ),
161
+ /* @__PURE__ */ jsx(
162
+ "button",
163
+ {
164
+ className: endChatButtonStyle,
165
+ type: "button",
166
+ onClick: () => {
167
+ setShowEndChatDialog(false);
168
+ },
169
+ children: "No"
170
+ }
171
+ )
197
172
  ]
198
173
  }
199
- ) }),
200
- /* @__PURE__ */ jsx("span", { children: "End Chat" })
201
- ]
174
+ )
175
+ ] })
202
176
  }
203
- ) }) }),
204
- showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
205
- /* @__PURE__ */ jsx(
206
- "div",
177
+ )
178
+ ] }),
179
+ onClose && /* @__PURE__ */ jsx(
180
+ "button",
181
+ {
182
+ onClick: onClose,
183
+ className: button_reset,
184
+ "aria-label": "Close chat",
185
+ title: "Close",
186
+ children: /* @__PURE__ */ jsx(
187
+ "svg",
207
188
  {
208
- style: {
209
- background: "#00000080",
210
- position: "fixed",
211
- top: 0,
212
- left: 0,
213
- right: 0,
214
- bottom: 0,
215
- zIndex: 999
216
- }
217
- }
218
- ),
219
- /* @__PURE__ */ jsx("dialog", { open: showEndChatDialog, className: chatEndDialogOverlay, children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
220
- /* @__PURE__ */ jsx("div", { className: clsx(button_bar, chatEndCircle), children: /* @__PURE__ */ jsxs(
221
- "svg",
222
- {
223
- xmlns: "http://www.w3.org/2000/svg",
224
- width: "24",
225
- height: "24",
226
- viewBox: "0 0 24 24",
227
- fill: "none",
228
- children: [
229
- /* @__PURE__ */ jsx(
230
- "path",
231
- {
232
- d: "M12.7514 7.14531V15.3953H11.2514V7.14531H12.7514Z",
233
- fill: "#D2272F"
234
- }
235
- ),
236
- /* @__PURE__ */ jsx(
237
- "path",
238
- {
239
- d: "M12.0014 16.8953C12.6227 16.8953 13.1264 17.399 13.1264 18.0203C13.1264 18.6416 12.6227 19.1453 12.0014 19.1453C11.3801 19.1453 10.8764 18.6416 10.8764 18.0203C10.8764 17.399 11.3801 16.8953 12.0014 16.8953Z",
240
- fill: "#D2272F"
241
- }
242
- ),
243
- /* @__PURE__ */ jsx(
244
- "path",
245
- {
246
- fillRule: "evenodd",
247
- clipRule: "evenodd",
248
- d: "M9.31805 3.51187L2.17215 17.8037C1.1748 19.7984 2.62529 22.1453 4.85543 22.1453H19.1472C21.3774 22.1453 22.8279 19.7984 21.8305 17.8037L14.6846 3.51188C13.579 1.30073 10.4236 1.30073 9.31805 3.51187ZM3.51379 18.4745L10.6597 4.18269C11.2125 3.07712 12.7902 3.07712 13.343 4.1827L20.4889 18.4745C20.9875 19.4718 20.2623 20.6453 19.1472 20.6453H4.85543C3.74036 20.6453 3.01512 19.4718 3.51379 18.4745Z",
249
- fill: "#D2272F"
250
- }
251
- )
252
- ]
253
- }
254
- ) }),
255
- /* @__PURE__ */ jsxs("p", { children: [
256
- "Are you sure you want to end",
257
- /* @__PURE__ */ jsx("br", {}),
258
- " this chat?"
259
- ] }),
260
- /* @__PURE__ */ jsxs(
261
- "div",
262
- {
263
- style: {
264
- display: "flex",
265
- gap: "1rem",
266
- marginTop: "1rem",
267
- flexDirection: "column",
268
- marginBottom: 24,
269
- width: "100%"
270
- },
271
- children: [
272
- /* @__PURE__ */ jsx(
273
- "button",
274
- {
275
- className: endChatButtonStyle,
276
- type: "submit",
277
- onClick: () => {
278
- endChat();
279
- displayThankYouScreen();
280
- setShowEndChatDialog(false);
281
- },
282
- children: "Yes, End Chat"
283
- }
284
- ),
285
- /* @__PURE__ */ jsx(
286
- "button",
287
- {
288
- className: clsx(endChatButtonStyle, noAnswerButton),
289
- type: "button",
290
- onClick: () => {
291
- setShowEndChatDialog(false);
292
- },
293
- children: "No, Go Back"
294
- }
295
- )
296
- ]
297
- }
298
- ),
299
- " "
300
- ] }) })
301
- ] }),
302
- /* @__PURE__ */ jsx(
303
- ThankYouMessage,
304
- {
305
- showEndChatDialog: showThankyouMessage,
306
- onStart: onStartChat,
307
- onClose: onCancelEndChat
308
- }
309
- ),
310
- onClose && /* @__PURE__ */ jsxs(
311
- "button",
312
- {
313
- onClick: () => {
314
- onClose();
315
- setMenuOpen(false);
316
- },
317
- className: clsx(button_reset, button_bar),
318
- "aria-label": "Close chat window",
319
- title: "Close",
320
- children: [
321
- /* @__PURE__ */ jsx(
322
- "svg",
189
+ xmlns: "http://www.w3.org/2000/svg",
190
+ width: "24",
191
+ height: "24",
192
+ viewBox: "0 0 24 24",
193
+ fill: "none",
194
+ children: /* @__PURE__ */ jsx(
195
+ "path",
323
196
  {
324
- xmlns: "http://www.w3.org/2000/svg",
325
- width: "24",
326
- height: "24",
327
- viewBox: "0 0 24 24",
328
- fill: "none",
329
- children: /* @__PURE__ */ jsx(
330
- "path",
331
- {
332
- className: arrowFill,
333
- d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
334
- color: vars.chatbot.window.headerText
335
- }
336
- )
337
- }
338
- ),
339
- /* @__PURE__ */ jsx(
340
- "svg",
341
- {
342
- width: "15",
343
- height: "15",
344
- viewBox: "0 0 15 15",
345
- fill: "none",
346
- xmlns: "http://www.w3.org/2000/svg",
347
- children: /* @__PURE__ */ jsx(
348
- "path",
349
- {
350
- d: "M13.2187 0L14.0142 0.795495L7.803 7.0065L14.0142 13.2187L13.2187 14.0142L7.0065 7.803L0.795495 14.0142L0 13.2187L6.21112 7.0065L0 0.795495L0.795495 0L7.0065 6.21112L13.2187 0Z",
351
- fill: vars.chatbot.window.headerText
352
- }
353
- )
197
+ className: arrowFill,
198
+ d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
199
+ fill: "#98DDFF"
354
200
  }
355
201
  )
356
- ]
357
- }
358
- )
359
- ] })
202
+ }
203
+ )
204
+ }
205
+ )
360
206
  ] }),
361
207
  mounted && !state.online ? /* @__PURE__ */ jsx("div", { className: clsx(chatNetworkStatus), children: /* @__PURE__ */ jsxs(
362
208
  "div",
@@ -389,6 +235,7 @@ const ChatWindow = ({
389
235
  style: {
390
236
  textAlign: "left",
391
237
  alignSelf: "flex-start",
238
+ background: "#eee",
392
239
  color: "#1e3860",
393
240
  borderRadius: 16,
394
241
  padding: "8px 8px",
@@ -399,28 +246,151 @@ const ChatWindow = ({
399
246
  "div",
400
247
  {
401
248
  style: {
402
- fontSize: 14,
249
+ fontSize: 13,
403
250
  display: "flex",
404
251
  flexDirection: "column",
405
252
  gap: 4
406
253
  },
407
- children: /* @__PURE__ */ jsx("p", { className: shimmerText, children: "AI thinking..." })
254
+ children: /* @__PURE__ */ jsx(EllipsisLoader, {})
408
255
  }
409
256
  )
410
257
  }
411
258
  ),
412
- messages?.map((msg) => /* @__PURE__ */ jsx(
413
- ChatbotMessage,
414
- {
415
- msg,
416
- onSend,
417
- showAvatar,
418
- showName,
419
- virtualAgent,
420
- onCancelEndChat
421
- },
422
- msg?.$index
423
- )),
259
+ messages?.map((msg) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
260
+ msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationStarted" && /* @__PURE__ */ jsx("div", { className: notificationStyle, children: "We are connecting you with a human agent..." }, msg.$index),
261
+ msg.type == "noti" && msg.$userType == "system" && msg.event == "memberLeft" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
262
+ /* @__PURE__ */ jsx("strong", { children: "Virtual Agent" }),
263
+ " just left the conversation."
264
+ ] }, msg.$index),
265
+ msg.type == "noti" && msg.$userType == "system" && msg.event == "escalationAccepted" && /* @__PURE__ */ jsxs("div", { className: notificationStyle, children: [
266
+ "You are now connected with a",
267
+ " ",
268
+ msg.to_agent ? /* @__PURE__ */ jsx("strong", { children: msg?.to_agent?.name }) : "an agent"
269
+ ] }, msg.$index),
270
+ msg.type == "noti" && msg.$userType == "virtual_agent" && msg.event == "escalationDeflected" && /* @__PURE__ */ jsxs(Fragment, { children: [
271
+ /* @__PURE__ */ jsxs(
272
+ "div",
273
+ {
274
+ className: notificationStyle,
275
+ style: { fontSize: 12 },
276
+ children: [
277
+ "Our chat team is available weekdays, 8am-5pm, except federal bank holidays. For immediate assistance you can reach out to us at ",
278
+ /* @__PURE__ */ jsx("a", { href: "tel:1-888-502-2967", children: "1-888-502-2967" }),
279
+ "."
280
+ ]
281
+ },
282
+ msg.$index
283
+ ),
284
+ /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
285
+ ] }),
286
+ ["text", "markdown_template", "markdown"].includes(msg.type) && /* @__PURE__ */ jsx(
287
+ "div",
288
+ {
289
+ className: messageStyle,
290
+ style: {
291
+ textAlign: msg.$userType == "end_user" ? "right" : "left",
292
+ alignSelf: msg.$userType == "end_user" ? "flex-end" : "flex-start",
293
+ background: msg.$userType == "end_user" ? endUserBg : chatbotBg,
294
+ color: msg.$userType == "end_user" ? "#fff" : "#1F1F1F",
295
+ boxShadow: msg.$userType == "end_user" ? "0 1px 4px #b3e0ff55" : void 0
296
+ },
297
+ children: /* @__PURE__ */ jsxs(
298
+ "div",
299
+ {
300
+ style: {
301
+ fontSize: 13,
302
+ display: "flex",
303
+ flexDirection: "column",
304
+ gap: 4
305
+ },
306
+ children: [
307
+ msg.$userType == "virtual_agent" && /* @__PURE__ */ jsxs(
308
+ "div",
309
+ {
310
+ style: {
311
+ display: "flex",
312
+ alignItems: "center",
313
+ gap: "8px"
314
+ },
315
+ children: [
316
+ showAvatar && /* @__PURE__ */ jsx(
317
+ "img",
318
+ {
319
+ width: 24,
320
+ height: 24,
321
+ src: virtualAgent?.avatar_url,
322
+ alt: "agent avatar"
323
+ }
324
+ ),
325
+ /* @__PURE__ */ jsx("strong", { children: virtualAgent?.name })
326
+ ]
327
+ }
328
+ ),
329
+ msg.$userType != "end_user" ? /* @__PURE__ */ jsx(
330
+ ReactMarkdown,
331
+ {
332
+ remarkPlugins: [[remarkGfm, { singleTilde: false }]],
333
+ components: {
334
+ p: ({ ...props }) => /* @__PURE__ */ jsx(
335
+ "p",
336
+ {
337
+ style: { margin: 0, fontSize: "inherit" },
338
+ title: new Date(msg.$timestamp).toLocaleString(),
339
+ ...props
340
+ }
341
+ )
342
+ },
343
+ children: msg.content
344
+ }
345
+ ) : /* @__PURE__ */ jsx("div", { title: new Date(msg.$timestamp).toLocaleString(), children: msg.content })
346
+ ]
347
+ }
348
+ )
349
+ },
350
+ msg.$index
351
+ ),
352
+ msg.type == "inline_button" && Array.isArray(msg.buttons) && msg.buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: inline_button_wrapper, children: msg.buttons.length !== 0 && Array.isArray(msg.buttons) && msg.buttons.map((button, index) => {
353
+ const lastItem = msg.buttons && msg.buttons?.length - 1;
354
+ return /* @__PURE__ */ jsx(
355
+ "button",
356
+ {
357
+ className: inline_button,
358
+ style: {
359
+ borderRadius: "0px",
360
+ borderTopLeftRadius: [0].includes(index) ? 8 : 0,
361
+ borderTopRightRadius: [0].includes(index) ? 8 : 0,
362
+ borderBottomLeftRadius: [lastItem].includes(index) ? 8 : 0,
363
+ borderBottomRightRadius: [lastItem].includes(index) ? 8 : 0
364
+ },
365
+ onClick: () => {
366
+ onSend(button?.title);
367
+ },
368
+ children: button.title
369
+ },
370
+ index
371
+ );
372
+ }) }),
373
+ msg.event == "chatEnded" && /* @__PURE__ */ jsxs(Fragment, { children: [
374
+ /* @__PURE__ */ jsxs(
375
+ "div",
376
+ {
377
+ title: (/* @__PURE__ */ new Date()).toLocaleString(),
378
+ style: {
379
+ fontSize: 12,
380
+ color: "#888",
381
+ marginBottom: 4,
382
+ textAlign: "center"
383
+ },
384
+ children: [
385
+ "Thank you for chatting!",
386
+ /* @__PURE__ */ jsx("br", {}),
387
+ " This conversation has ended."
388
+ ]
389
+ }
390
+ ),
391
+ /* @__PURE__ */ jsx("div", { style: { textAlign: "center", marginBottom: 12 }, children: /* @__PURE__ */ jsx("button", { className: endChatButtonStyle, onClick: endChat, children: "End Chat" }) })
392
+ ] })
393
+ ] }, msg.$index)),
424
394
  showReconnect && /* @__PURE__ */ jsx(
425
395
  "button",
426
396
  {
@@ -432,14 +402,14 @@ const ChatWindow = ({
432
402
  ),
433
403
  /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
434
404
  ] }),
435
- /* @__PURE__ */ jsx("div", { style: { padding: "16px 16px 24px 16px" }, children: /* @__PURE__ */ jsx("form", { onSubmit: handleSend, className: clsx(gradientFocus), children: /* @__PURE__ */ jsxs(
436
- "div",
405
+ /* @__PURE__ */ jsxs(
406
+ "form",
437
407
  {
408
+ onSubmit: handleSend,
438
409
  style: {
439
- display: "flex",
440
- padding: "12px 16px",
441
- background: "#ffffff",
442
- borderRadius: 12
410
+ borderTop: "1px solid #eee",
411
+ display: "flex"
412
+ // gap: 8,
443
413
  },
444
414
  children: [
445
415
  /* @__PURE__ */ jsx(
@@ -458,7 +428,7 @@ const ChatWindow = ({
458
428
  }
459
429
  }
460
430
  },
461
- placeholder: "Ask anything...",
431
+ placeholder: "Ask something...",
462
432
  className: clsx(inputStyle, autoResize),
463
433
  autoFocus: true,
464
434
  disabled: inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
@@ -468,37 +438,28 @@ const ChatWindow = ({
468
438
  /* @__PURE__ */ jsx(
469
439
  "button",
470
440
  {
471
- className: clsx(
472
- sendButtonStyle,
473
- input.trim().length > 0 && "active"
474
- ),
441
+ className: clsx(sendButtonStyle, input.trim().length > 0 && "active"),
475
442
  type: "submit",
476
443
  title: "Send message",
477
444
  disabled: inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
478
- children: /* @__PURE__ */ jsx(
445
+ children: /* @__PURE__ */ jsxs(
479
446
  "svg",
480
447
  {
481
448
  xmlns: "http://www.w3.org/2000/svg",
482
- width: "16",
483
- height: "16",
484
- viewBox: "0 0 16 16",
485
- fill: "none",
486
- children: /* @__PURE__ */ jsx(
487
- "path",
488
- {
489
- fillRule: "evenodd",
490
- clipRule: "evenodd",
491
- d: "M0.0030533 5.42479C0.0273417 5.1795 0.193529 4.9714 0.427369 4.89345L15.0114 0.0320896C15.236 -0.0427712 15.4836 0.0156801 15.651 0.183075C15.8184 0.35047 15.8769 0.598075 15.802 0.822659L10.9407 15.4067C10.8627 15.6406 10.6546 15.8068 10.4093 15.8311C10.164 15.8553 9.92737 15.7332 9.80508 15.5192L6.35411 9.47999L0.314925 6.02903C0.100912 5.90673 -0.0212351 5.67008 0.0030533 5.42479ZM7.59169 9.1263L9.64202 12.7144C9.85645 13.0896 10.4138 13.0344 10.5505 12.6244L13.9046 2.56191C14.0349 2.17103 13.6631 1.79916 13.2722 1.92946L3.20969 5.28362C2.79967 5.4203 2.74448 5.97766 3.11973 6.19209L6.70781 8.24242L9.90579 5.04443C10.1499 4.80036 10.5456 4.80036 10.7897 5.04443C11.0337 5.28851 11.0337 5.68424 10.7897 5.92832L7.59169 9.1263Z",
492
- fill: "#435164"
493
- }
494
- )
449
+ id: "send-icon",
450
+ width: 24,
451
+ height: 24,
452
+ children: [
453
+ /* @__PURE__ */ jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" }),
454
+ /* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0z", fill: "none" })
455
+ ]
495
456
  }
496
457
  )
497
458
  }
498
459
  )
499
460
  ]
500
461
  }
501
- ) }) })
462
+ )
502
463
  ] });
503
464
  };
504
465
  export {