@axos-web-dev/shared-components 2.2.5 → 2.2.7

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 (207) hide show
  1. package/dist/ATMLocator/ATMLocator.d.ts +1 -1
  2. package/dist/ATMLocator/ATMLocator.js +3 -2
  3. package/dist/Accordion/Accordion.d.ts +3 -3
  4. package/dist/Article/Article.d.ts +1 -1
  5. package/dist/Auth/ErrorAlert.d.ts +1 -1
  6. package/dist/Auth/ErrorAlert.js +4 -3
  7. package/dist/Auth/Logout.d.ts +1 -1
  8. package/dist/Auth/SignInPassword.d.ts +1 -1
  9. package/dist/BulletItem/BulletItem.d.ts +1 -1
  10. package/dist/Button/Button.d.ts +1 -1
  11. package/dist/Button/Button.js +3 -2
  12. package/dist/Button/GoBackButton.d.ts +1 -1
  13. package/dist/Calculators/Calculator.d.ts +1 -1
  14. package/dist/Calculators/Calculator.js +4 -3
  15. package/dist/Calculators/MarginTradingCalculator/index.js +3 -2
  16. package/dist/Carousel/index.d.ts +3 -3
  17. package/dist/Carousel/index.js +3 -2
  18. package/dist/Chatbot/AnimatedGradientBorder.css.d.ts +5 -0
  19. package/dist/Chatbot/AnimatedGradientBorder.css.js +13 -3
  20. package/dist/Chatbot/AudioManager.d.ts +19 -0
  21. package/dist/Chatbot/AudioManager.js +61 -0
  22. package/dist/Chatbot/Bubble.css.js +1 -0
  23. package/dist/Chatbot/Bubble.d.ts +1 -1
  24. package/dist/Chatbot/Chat.d.ts +1 -1
  25. package/dist/Chatbot/ChatWindow.css.d.ts +8 -0
  26. package/dist/Chatbot/ChatWindow.css.js +49 -33
  27. package/dist/Chatbot/ChatWindow.js +457 -372
  28. package/dist/Chatbot/Chatbot.css.js +0 -1
  29. package/dist/Chatbot/Chatbot.css.ts.vanilla.css.js +1 -0
  30. package/dist/Chatbot/Chatbot.d.ts +4 -1
  31. package/dist/Chatbot/Chatbot.js +71 -21
  32. package/dist/Chatbot/ChatbotMessage.js +184 -159
  33. package/dist/Chatbot/EllipsisAnimation.d.ts +1 -1
  34. package/dist/Chatbot/EllipsisAnimation.js +0 -6
  35. package/dist/Chatbot/EllipsisIcon.d.ts +1 -1
  36. package/dist/Chatbot/ExpandChatToggle.d.ts +8 -0
  37. package/dist/Chatbot/ExpandChatToggle.js +74 -0
  38. package/dist/Chatbot/index.js +11 -2
  39. package/dist/Chatbot/store/chat.d.ts +8 -0
  40. package/dist/Chatbot/store/chat.js +14 -2
  41. package/dist/Chevron/index.js +3 -2
  42. package/dist/Comparison/Comparison.d.ts +1 -1
  43. package/dist/Comparison/Comparison.js +3 -2
  44. package/dist/Comparison/ComparisonSet.d.ts +1 -1
  45. package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
  46. package/dist/ExecutiveBio/ExecutiveBio.js +3 -2
  47. package/dist/ExecutiveBio/ExecutiveBioSet.d.ts +1 -1
  48. package/dist/ExecutiveBio/Overlay.d.ts +1 -1
  49. package/dist/FaqAccordion/index.d.ts +5 -5
  50. package/dist/FaqAccordion/index.js +3 -2
  51. package/dist/FdicCallout/index.d.ts +1 -1
  52. package/dist/FooterDisclosure/FooterDisclosure.d.ts +4 -4
  53. package/dist/FooterDisclosure/LVF/LaVictorieFooter.d.ts +1 -1
  54. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.d.ts +1 -1
  55. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +3 -2
  56. package/dist/Forms/ApplicationStart.d.ts +1 -1
  57. package/dist/Forms/ApplyNow.d.ts +1 -1
  58. package/dist/Forms/ApplyNow.js +3 -2
  59. package/dist/Forms/BoatMooringLocation.d.ts +1 -1
  60. package/dist/Forms/ClearingForm.d.ts +1 -1
  61. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  62. package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +1 -1
  63. package/dist/Forms/CommercialLending.d.ts +1 -1
  64. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  65. package/dist/Forms/ConstructionLendingDynamic.d.ts +1 -1
  66. package/dist/Forms/ContactCompany.d.ts +1 -1
  67. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  68. package/dist/Forms/ContactUs.d.ts +1 -1
  69. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  70. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  71. package/dist/Forms/ContactUsBusiness.js +3 -2
  72. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  73. package/dist/Forms/ContactUsBusinessNameEmail.js +3 -2
  74. package/dist/Forms/ContactUsLVF.d.ts +1 -1
  75. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  76. package/dist/Forms/ContactUsNMLSId.js +3 -2
  77. package/dist/Forms/ContactUsSchwabAAS.d.ts +1 -1
  78. package/dist/Forms/CpraRequest.d.ts +1 -1
  79. package/dist/Forms/CpraRequest.js +3 -2
  80. package/dist/Forms/CraPublicFile.d.ts +1 -1
  81. package/dist/Forms/CraPublicFile.js +3 -2
  82. package/dist/Forms/DealerServices.d.ts +1 -1
  83. package/dist/Forms/EmailOnly.d.ts +1 -1
  84. package/dist/Forms/EmailOnly.js +3 -2
  85. package/dist/Forms/EmailUs.d.ts +1 -1
  86. package/dist/Forms/HoneyPot/index.d.ts +1 -1
  87. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  88. package/dist/Forms/MortgageRate/MortgageRateForm.js +3 -2
  89. package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.d.ts +1 -1
  90. package/dist/Forms/MortgageRate/MortgageRateWatch.d.ts +1 -1
  91. package/dist/Forms/MortgageRate/MortgageRateWatch.js +3 -2
  92. package/dist/Forms/MortgageWarehouseLending.d.ts +2 -2
  93. package/dist/Forms/MortgageWarehouseLending.js +10 -9
  94. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  95. package/dist/Forms/QuickPricer/UserInformation.d.ts +1 -1
  96. package/dist/Forms/ScheduleCall.d.ts +1 -1
  97. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  98. package/dist/Forms/SuccesForm.d.ts +1 -1
  99. package/dist/Forms/SuccesForm.js +4 -3
  100. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  101. package/dist/Forms/WcplSurvey.d.ts +1 -1
  102. package/dist/HeroBanner/HeroBanner.d.ts +1 -1
  103. package/dist/HeroBanner/HeroVideoPoster.d.ts +1 -1
  104. package/dist/HeroBanner/LargeHeroBanner.d.ts +1 -1
  105. package/dist/Hyperlink/index.js +3 -2
  106. package/dist/IconBillboard/IconBillboard.d.ts +1 -1
  107. package/dist/IconBillboard/IconBillboardSet.d.ts +1 -1
  108. package/dist/IconBillboard/sections/CallToActionSection.d.ts +1 -1
  109. package/dist/IconBillboard/sections/HeaderSection.d.ts +2 -2
  110. package/dist/IconBillboard/sections/IconSection.d.ts +1 -1
  111. package/dist/IconBillboard/sections/ItemsSection.d.ts +1 -1
  112. package/dist/IconBillboard/sections/LayoutSection.d.ts +1 -1
  113. package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +1 -1
  114. package/dist/ImageBillboard/ImageBillboard.d.ts +1 -1
  115. package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
  116. package/dist/ImageLink/ImageLink.d.ts +1 -1
  117. package/dist/ImageLink/ImageLink.js +3 -2
  118. package/dist/ImageLink/ImageLinkSet.d.ts +1 -1
  119. package/dist/ImageLink/ImageLinkSet.js +3 -2
  120. package/dist/ImageLink/index.js +3 -2
  121. package/dist/ImageWrapper/ImageWrapper.d.ts +1 -1
  122. package/dist/Insight/Featured/CategorySelector.d.ts +2 -2
  123. package/dist/Insight/Featured/CategorySelector.js +3 -2
  124. package/dist/Insight/Featured/Featured.d.ts +2 -2
  125. package/dist/Insight/Featured/Featured.js +3 -2
  126. package/dist/Insight/Featured/Header.d.ts +1 -1
  127. package/dist/Insight/Featured/Header.js +3 -2
  128. package/dist/LandingPageHeader/LandingPageHeader.d.ts +1 -1
  129. package/dist/LoadingIndicator/index.d.ts +1 -1
  130. package/dist/MainHTML/index.d.ts +1 -1
  131. package/dist/Modal/Modal.js +3 -2
  132. package/dist/Modal/contextApi/store.d.ts +1 -4
  133. package/dist/Modal/contextApi/store.js +34 -3
  134. package/dist/NavigationMenu/AxosALTS/index.d.ts +1 -1
  135. package/dist/NavigationMenu/AxosALTS/index.js +3 -2
  136. package/dist/NavigationMenu/AxosAdvisor/SubNavBar.d.ts +1 -1
  137. package/dist/NavigationMenu/AxosAdvisor/index.d.ts +1 -1
  138. package/dist/NavigationMenu/AxosAdvisorServices/SubNavBar.d.ts +1 -1
  139. package/dist/NavigationMenu/AxosAdvisorServices/index.d.ts +1 -1
  140. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +1 -1
  141. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +3 -2
  142. package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +1 -1
  143. package/dist/NavigationMenu/AxosBank/SubNavBar.js +3 -2
  144. package/dist/NavigationMenu/AxosBank/index.d.ts +1 -1
  145. package/dist/NavigationMenu/AxosBank/index.js +4 -2
  146. package/dist/NavigationMenu/AxosClearing/SubNavBar.d.ts +1 -1
  147. package/dist/NavigationMenu/AxosClearing/index.d.ts +1 -1
  148. package/dist/NavigationMenu/AxosFiduciary/index.d.ts +1 -1
  149. package/dist/NavigationMenu/LaVictoire/SubNavBar.d.ts +1 -1
  150. package/dist/NavigationMenu/LaVictoire/index.d.ts +1 -1
  151. package/dist/NavigationMenu/LaVictoire/index.js +3 -2
  152. package/dist/NavigationMenu/NavItem/index.d.ts +1 -1
  153. package/dist/NavigationMenu/Navbar.d.ts +1 -1
  154. package/dist/NavigationMenu/Navbar.js +3 -2
  155. package/dist/NavigationMenu/SignInNavButton.d.ts +1 -3
  156. package/dist/NavigationMenu/SignInNavButton.js +4 -2
  157. package/dist/Pagination/Pagination.d.ts +1 -1
  158. package/dist/SecondaryFooter/index.d.ts +1 -1
  159. package/dist/SetContainer/SetContainer.d.ts +1 -1
  160. package/dist/SetContainer/SetContainer.js +3 -2
  161. package/dist/SocialMediaBar/iconsRepository.d.ts +14 -14
  162. package/dist/SocialMediaBar/iconsRepository.js +3 -2
  163. package/dist/SocialMediaBar/index.d.ts +1 -1
  164. package/dist/Tab/Tab.d.ts +1 -1
  165. package/dist/Tab/TabContainer.d.ts +1 -1
  166. package/dist/Table/Table.d.ts +5 -5
  167. package/dist/TextBlock/TextBlock.d.ts +1 -1
  168. package/dist/Topic/Topic.d.ts +4 -4
  169. package/dist/VideoTile/VideoInit.d.ts +1 -1
  170. package/dist/VideoTile/VideoTile.js +3 -2
  171. package/dist/VideoWrapper/index.js +3 -2
  172. package/dist/WalnutIframe/index.d.ts +1 -1
  173. package/dist/assets/Chatbot/AnimatedGradientBorder.css +99 -12
  174. package/dist/assets/Chatbot/Bubble.css +26 -7
  175. package/dist/assets/Chatbot/ChatWindow.css +164 -71
  176. package/dist/assets/globals.css +3 -0
  177. package/dist/assets/notification.mp3.js +4 -0
  178. package/dist/icons/AxosX/Blue.d.ts +1 -1
  179. package/dist/icons/AxosX/index.d.ts +1 -1
  180. package/dist/icons/CheckCircle.d.ts +1 -1
  181. package/dist/icons/CheckCircleLight.d.ts +1 -1
  182. package/dist/icons/CheckIcon/index.d.ts +1 -1
  183. package/dist/icons/ChevronDown.d.ts +1 -1
  184. package/dist/icons/ChevronUp.d.ts +1 -1
  185. package/dist/icons/Clock/index.d.ts +1 -1
  186. package/dist/icons/EqualHousingLender.d.ts +1 -1
  187. package/dist/icons/Logos/AAS.d.ts +1 -1
  188. package/dist/icons/Logos/AFS.d.ts +1 -1
  189. package/dist/icons/Logos/AXA.d.ts +1 -1
  190. package/dist/icons/Logos/AXB.d.ts +1 -1
  191. package/dist/icons/Logos/AXC.d.ts +1 -1
  192. package/dist/icons/Logos/AXI.d.ts +1 -1
  193. package/dist/icons/Logos/AXOS.d.ts +1 -1
  194. package/dist/icons/Logos/GBLVF.d.ts +1 -1
  195. package/dist/icons/Logos/LVF.d.ts +1 -1
  196. package/dist/icons/Logos/LVFText.d.ts +1 -1
  197. package/dist/icons/Logos/SPB.d.ts +1 -1
  198. package/dist/icons/MemberFdicLogo.d.ts +1 -1
  199. package/dist/icons/QuoteIconGrey.d.ts +1 -1
  200. package/dist/icons/QuoteIconWhite.d.ts +1 -1
  201. package/dist/icons/QuoteIconYellow.d.ts +1 -1
  202. package/dist/main.js +11 -2
  203. package/dist/utils/useVisibility.d.ts +1 -0
  204. package/dist/utils/useVisibility.js +18 -0
  205. package/dist/vite-env.d.js +1 -0
  206. package/package.json +147 -147
  207. package/dist/assets/Chatbot/Chatbot.css +0 -3
@@ -1,17 +1,19 @@
1
1
  "use client";
2
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
+ import { LoadingIndicator } from "../LoadingIndicator/index.js";
3
4
  import { vars } from "../themes/axos.css.js";
4
5
  import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
5
6
  /* empty css */
6
7
  /* empty css */
7
8
  /* empty css */
8
9
  import clsx from "clsx";
9
- import React, { useRef, useEffect } from "react";
10
+ import React, { useRef, useState, useEffect } from "react";
10
11
  import { useNetworkState, useMount } from "react-use";
11
- import { gradientFocus } from "./AnimatedGradientBorder.css.js";
12
+ import { focusAnimation, gradientFocus } from "./AnimatedGradientBorder.css.js";
12
13
  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";
14
+ import { windowBarStyle, left_bar_section, chat_title, button_bar, chatbotMenuItem, chatbotMenu, chatEndDialogOverlay, chatFinishDialog, chatEndCircle, endChatButtonStyle, noAnswerButton, arrowFill, button_reset, buttonss_section, chatNetworkStatus, shimmerText, messagesContainerStyle, formTextButton, inputStyle, autoResize, sendButtonStyle, chatAiDisclaimer, windowStyle, windowOpenStyle, windowExpandedStyle } from "./ChatWindow.css.js";
14
15
  import { EllipsisIcon } from "./EllipsisIcon.js";
16
+ import { ExpandChatToggle } from "./ExpandChatToggle.js";
15
17
  import { useOpenChat } from "./store/chat.js";
16
18
  import { ThankYouMessage } from "./ThankYouMessage.js";
17
19
  const ChatWindow = ({
@@ -39,12 +41,15 @@ const ChatWindow = ({
39
41
  }) => {
40
42
  const {
41
43
  showThankyouMessage,
42
- displayThankyouMessage,
43
44
  toggleThankyouMessage,
44
45
  hasEscalated,
45
46
  isBlockedInput,
46
47
  isOpen,
47
- hasOpenedOnce
48
+ hasOpenedOnce,
49
+ chatStatus,
50
+ setChatStatus,
51
+ isWindowExpanded,
52
+ toggleWindowExpanded
48
53
  } = useOpenChat();
49
54
  const [mounted, setMounted] = React.useState(false);
50
55
  const [menuOpen, setMenuOpen] = React.useState(false);
@@ -53,6 +58,7 @@ const ChatWindow = ({
53
58
  const [input, setInput] = React.useState("");
54
59
  const messagesEndRef = useRef(null);
55
60
  const inputRef = useRef(null);
61
+ const [focused, setFocused] = useState(false);
56
62
  useEffect(() => {
57
63
  messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
58
64
  }, [messages]);
@@ -83,9 +89,6 @@ const ChatWindow = ({
83
89
  useEffect(() => {
84
90
  autoResizeTextarea();
85
91
  }, [input]);
86
- const displayThankYouScreen = () => {
87
- displayThankyouMessage();
88
- };
89
92
  const onCancelEndChat = () => {
90
93
  setShowEndChatDialog(false);
91
94
  toggleThankyouMessage?.();
@@ -102,102 +105,176 @@ const ChatWindow = ({
102
105
  inputRef.current.focus();
103
106
  }
104
107
  }, [messages]);
105
- return /* @__PURE__ */ jsxs("div", { className: clsx(windowStyle, isOpen && windowOpenStyle), children: [
106
- /* @__PURE__ */ jsxs("div", { className: windowBarStyle, children: [
107
- /* @__PURE__ */ jsx("div", { className: clsx(left_bar_section) }),
108
- /* @__PURE__ */ jsxs(
109
- "div",
110
- {
111
- className: "flex middle center",
112
- style: { paddingBlock: "6px", gap: 4 },
113
- children: [
114
- /* @__PURE__ */ jsxs(
115
- "svg",
108
+ return /* @__PURE__ */ jsxs(
109
+ "div",
110
+ {
111
+ className: clsx(
112
+ windowStyle,
113
+ isOpen && windowOpenStyle,
114
+ isWindowExpanded && windowExpandedStyle
115
+ ),
116
+ children: [
117
+ /* @__PURE__ */ jsxs("div", { className: windowBarStyle, children: [
118
+ /* @__PURE__ */ jsx("div", { className: clsx(left_bar_section), children: /* @__PURE__ */ jsx(
119
+ ExpandChatToggle,
120
+ {
121
+ isExpanded: isWindowExpanded,
122
+ onToggle: toggleWindowExpanded
123
+ }
124
+ ) }),
125
+ /* @__PURE__ */ jsxs(
126
+ "div",
127
+ {
128
+ className: "flex middle center",
129
+ style: { paddingBlock: "6px", gap: 4 },
130
+ children: [
131
+ /* @__PURE__ */ jsxs(
132
+ "svg",
133
+ {
134
+ xmlns: "http://www.w3.org/2000/svg",
135
+ width: "20",
136
+ height: "17",
137
+ viewBox: "0 0 20 17",
138
+ fill: "none",
139
+ "aria-hidden": "true",
140
+ children: [
141
+ /* @__PURE__ */ jsx(
142
+ "path",
143
+ {
144
+ 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",
145
+ fill: "#1E3860"
146
+ }
147
+ ),
148
+ /* @__PURE__ */ jsx(
149
+ "path",
150
+ {
151
+ 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",
152
+ fill: "#1E3860"
153
+ }
154
+ ),
155
+ /* @__PURE__ */ jsx(
156
+ "path",
157
+ {
158
+ 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",
159
+ fill: "#1E3860"
160
+ }
161
+ )
162
+ ]
163
+ }
164
+ ),
165
+ /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask Evo AI" })
166
+ ]
167
+ }
168
+ ),
169
+ /* @__PURE__ */ jsxs("div", { className: clsx(buttonss_section), children: [
170
+ /* @__PURE__ */ jsx(
171
+ "button",
116
172
  {
117
- xmlns: "http://www.w3.org/2000/svg",
118
- width: "20",
119
- height: "17",
120
- viewBox: "0 0 20 17",
121
- fill: "none",
173
+ disabled: messages.length === 0,
174
+ onClick: () => {
175
+ setMenuOpen(!menuOpen);
176
+ },
177
+ className: clsx(button_bar),
178
+ style: {
179
+ border: menuOpen ? `1px solid ${vars.chatbot.window.headerText}` : "none",
180
+ cursor: "pointer",
181
+ padding: 0,
182
+ display: "flex",
183
+ alignContent: "center",
184
+ background: menuOpen ? "#0000000f" : void 0
185
+ },
186
+ "aria-label": "end chat with evo ai",
187
+ title: "end chat",
188
+ children: /* @__PURE__ */ jsx(EllipsisIcon, { color: vars.chatbot.window.headerText })
189
+ }
190
+ ),
191
+ menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsxs(
192
+ "button",
193
+ {
194
+ type: "button",
195
+ onClick: () => {
196
+ setShowEndChatDialog(true);
197
+ setMenuOpen(false);
198
+ },
199
+ style: {
200
+ width: "100%",
201
+ display: "flex",
202
+ alignItems: "center",
203
+ gap: "12px"
204
+ },
122
205
  children: [
123
- /* @__PURE__ */ jsx(
124
- "path",
206
+ /* @__PURE__ */ jsx("div", { className: clsx(button_bar), children: /* @__PURE__ */ jsxs(
207
+ "svg",
125
208
  {
126
- 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",
127
- fill: "#1E3860"
209
+ xmlns: "http://www.w3.org/2000/svg",
210
+ width: "16",
211
+ height: "16",
212
+ viewBox: "0 0 16 16",
213
+ fill: "none",
214
+ children: [
215
+ /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_92_1389)", children: [
216
+ /* @__PURE__ */ jsx(
217
+ "path",
218
+ {
219
+ 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",
220
+ fill: vars.chatbot.window.headerText
221
+ }
222
+ ),
223
+ /* @__PURE__ */ jsx(
224
+ "path",
225
+ {
226
+ fillRule: "evenodd",
227
+ clipRule: "evenodd",
228
+ 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",
229
+ fill: vars.chatbot.window.headerText
230
+ }
231
+ )
232
+ ] }),
233
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_92_1389", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
234
+ ]
128
235
  }
129
- ),
130
- /* @__PURE__ */ jsx(
131
- "path",
132
- {
133
- 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",
134
- fill: "#1E3860"
135
- }
136
- ),
137
- /* @__PURE__ */ jsx(
138
- "path",
139
- {
140
- 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",
141
- fill: "#1E3860"
142
- }
143
- )
236
+ ) }),
237
+ /* @__PURE__ */ jsx("span", { children: "End Chat" })
144
238
  ]
145
239
  }
146
- ),
147
- /* @__PURE__ */ jsx("h2", { className: chat_title, children: "Ask Evo AI" })
148
- ]
149
- }
150
- ),
151
- /* @__PURE__ */ jsxs("div", { className: clsx(buttonss_section), children: [
152
- /* @__PURE__ */ jsx(
153
- "button",
154
- {
155
- disabled: messages.length === 0,
156
- onClick: () => {
157
- setMenuOpen(!menuOpen);
158
- },
159
- className: clsx(button_bar),
160
- style: {
161
- border: menuOpen ? `1px solid ${vars.chatbot.window.headerText}` : "none",
162
- cursor: "pointer",
163
- padding: 0,
164
- display: "flex",
165
- alignContent: "center",
166
- background: menuOpen ? "#0000000f" : void 0
167
- },
168
- children: /* @__PURE__ */ jsx(EllipsisIcon, {})
169
- }
170
- ),
171
- menuOpen && /* @__PURE__ */ jsx("ul", { className: clsx(chatbotMenu), children: /* @__PURE__ */ jsx("li", { className: chatbotMenuItem, children: /* @__PURE__ */ jsxs(
172
- "button",
173
- {
174
- type: "button",
175
- onClick: () => {
176
- setShowEndChatDialog(true);
177
- setMenuOpen(false);
178
- },
179
- style: {
180
- width: "100%",
181
- display: "flex",
182
- alignItems: "center",
183
- gap: "12px"
184
- },
185
- children: [
186
- /* @__PURE__ */ jsx("div", { className: clsx(button_bar), children: /* @__PURE__ */ jsxs(
187
- "svg",
240
+ ) }) }),
241
+ showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
242
+ /* @__PURE__ */ jsx(
243
+ "div",
188
244
  {
189
- xmlns: "http://www.w3.org/2000/svg",
190
- width: "16",
191
- height: "16",
192
- viewBox: "0 0 16 16",
193
- fill: "none",
194
- children: [
195
- /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_92_1389)", children: [
245
+ style: {
246
+ background: "#00000080",
247
+ position: "fixed",
248
+ top: 0,
249
+ left: 0,
250
+ right: 0,
251
+ bottom: 0,
252
+ zIndex: 999
253
+ }
254
+ }
255
+ ),
256
+ /* @__PURE__ */ jsx("dialog", { open: showEndChatDialog, className: chatEndDialogOverlay, children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
257
+ /* @__PURE__ */ jsx("div", { className: clsx(button_bar, chatEndCircle), children: /* @__PURE__ */ jsxs(
258
+ "svg",
259
+ {
260
+ xmlns: "http://www.w3.org/2000/svg",
261
+ width: "24",
262
+ height: "24",
263
+ viewBox: "0 0 24 24",
264
+ fill: "none",
265
+ children: [
196
266
  /* @__PURE__ */ jsx(
197
267
  "path",
198
268
  {
199
- 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",
200
- fill: "#1E3860"
269
+ d: "M12.7514 7.14531V15.3953H11.2514V7.14531H12.7514Z",
270
+ fill: "#D2272F"
271
+ }
272
+ ),
273
+ /* @__PURE__ */ jsx(
274
+ "path",
275
+ {
276
+ 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",
277
+ fill: "#D2272F"
201
278
  }
202
279
  ),
203
280
  /* @__PURE__ */ jsx(
@@ -205,326 +282,334 @@ const ChatWindow = ({
205
282
  {
206
283
  fillRule: "evenodd",
207
284
  clipRule: "evenodd",
208
- 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",
209
- fill: "#1E3860"
285
+ 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",
286
+ fill: "#D2272F"
210
287
  }
211
288
  )
212
- ] }),
213
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_92_1389", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
214
- ]
289
+ ]
290
+ }
291
+ ) }),
292
+ /* @__PURE__ */ jsxs("p", { children: [
293
+ "Are you sure you want to end",
294
+ /* @__PURE__ */ jsx("br", {}),
295
+ " this chat?"
296
+ ] }),
297
+ /* @__PURE__ */ jsxs(
298
+ "div",
299
+ {
300
+ style: {
301
+ display: "flex",
302
+ gap: "1rem",
303
+ marginTop: "1rem",
304
+ flexDirection: "column",
305
+ marginBottom: 24,
306
+ width: "100%"
307
+ },
308
+ children: [
309
+ /* @__PURE__ */ jsx(
310
+ "button",
311
+ {
312
+ className: endChatButtonStyle,
313
+ type: "submit",
314
+ onClick: () => {
315
+ endChat();
316
+ setChatStatus("ending");
317
+ setShowEndChatDialog(false);
318
+ },
319
+ children: "Yes, End Chat"
320
+ }
321
+ ),
322
+ /* @__PURE__ */ jsx(
323
+ "button",
324
+ {
325
+ className: clsx(endChatButtonStyle, noAnswerButton),
326
+ type: "button",
327
+ onClick: () => {
328
+ setShowEndChatDialog(false);
329
+ },
330
+ children: "No, Go Back"
331
+ }
332
+ )
333
+ ]
334
+ }
335
+ ),
336
+ " "
337
+ ] }) })
338
+ ] }),
339
+ chatStatus == "ending" && /* @__PURE__ */ jsxs("div", { children: [
340
+ /* @__PURE__ */ jsx(
341
+ "div",
342
+ {
343
+ style: {
344
+ background: "#00000080",
345
+ position: "fixed",
346
+ top: 0,
347
+ left: 0,
348
+ right: 0,
349
+ bottom: 0,
350
+ zIndex: 999
351
+ }
215
352
  }
216
- ) }),
217
- /* @__PURE__ */ jsx("span", { children: "End Chat" })
218
- ]
219
- }
220
- ) }) }),
221
- showEndChatDialog && /* @__PURE__ */ jsxs(Fragment, { children: [
222
- /* @__PURE__ */ jsx(
223
- "div",
224
- {
225
- style: {
226
- background: "#00000080",
227
- position: "fixed",
228
- top: 0,
229
- left: 0,
230
- right: 0,
231
- bottom: 0,
232
- zIndex: 999
233
- }
234
- }
235
- ),
236
- /* @__PURE__ */ jsx("dialog", { open: showEndChatDialog, className: chatEndDialogOverlay, children: /* @__PURE__ */ jsxs("form", { method: "dialog", className: chatFinishDialog, children: [
237
- /* @__PURE__ */ jsx("div", { className: clsx(button_bar, chatEndCircle), children: /* @__PURE__ */ jsxs(
238
- "svg",
239
- {
240
- xmlns: "http://www.w3.org/2000/svg",
241
- width: "24",
242
- height: "24",
243
- viewBox: "0 0 24 24",
244
- fill: "none",
245
- children: [
246
- /* @__PURE__ */ jsx(
247
- "path",
248
- {
249
- d: "M12.7514 7.14531V15.3953H11.2514V7.14531H12.7514Z",
250
- fill: "#D2272F"
251
- }
252
- ),
253
- /* @__PURE__ */ jsx(
254
- "path",
255
- {
256
- 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",
257
- fill: "#D2272F"
258
- }
259
- ),
260
- /* @__PURE__ */ jsx(
261
- "path",
353
+ ),
354
+ /* @__PURE__ */ jsx(
355
+ "div",
356
+ {
357
+ style: {
358
+ position: "fixed",
359
+ top: 0,
360
+ left: 0,
361
+ right: 0,
362
+ bottom: 0,
363
+ zIndex: 1e3,
364
+ display: "flex",
365
+ justifyContent: "center",
366
+ alignItems: "center"
367
+ },
368
+ children: /* @__PURE__ */ jsx(
369
+ LoadingIndicator,
262
370
  {
263
- fillRule: "evenodd",
264
- clipRule: "evenodd",
265
- 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",
266
- fill: "#D2272F"
371
+ variant: "primary",
372
+ style: { borderTopColor: vars.chatbot.bubble.glowShadow }
267
373
  }
268
374
  )
269
- ]
270
- }
271
- ) }),
272
- /* @__PURE__ */ jsxs("p", { children: [
273
- "Are you sure you want to end",
274
- /* @__PURE__ */ jsx("br", {}),
275
- " this chat?"
375
+ }
376
+ )
276
377
  ] }),
277
- /* @__PURE__ */ jsxs(
278
- "div",
378
+ /* @__PURE__ */ jsx(
379
+ ThankYouMessage,
279
380
  {
280
- style: {
281
- display: "flex",
282
- gap: "1rem",
283
- marginTop: "1rem",
284
- flexDirection: "column",
285
- marginBottom: 24,
286
- width: "100%"
381
+ showEndChatDialog: showThankyouMessage,
382
+ onStart: onStartChat,
383
+ onClose: onCancelEndChat
384
+ }
385
+ ),
386
+ onClose && /* @__PURE__ */ jsxs(
387
+ "button",
388
+ {
389
+ onClick: () => {
390
+ onClose();
391
+ setMenuOpen(false);
287
392
  },
393
+ className: clsx(button_reset, button_bar),
394
+ "aria-label": "Close chat window",
395
+ title: "Close",
288
396
  children: [
289
397
  /* @__PURE__ */ jsx(
290
- "button",
398
+ "svg",
291
399
  {
292
- className: endChatButtonStyle,
293
- type: "submit",
294
- onClick: () => {
295
- endChat();
296
- displayThankYouScreen();
297
- setShowEndChatDialog(false);
298
- },
299
- children: "Yes, End Chat"
400
+ xmlns: "http://www.w3.org/2000/svg",
401
+ width: "24",
402
+ height: "24",
403
+ viewBox: "0 0 24 24",
404
+ fill: "none",
405
+ children: /* @__PURE__ */ jsx(
406
+ "path",
407
+ {
408
+ className: arrowFill,
409
+ d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
410
+ color: vars.chatbot.window.headerText
411
+ }
412
+ )
300
413
  }
301
414
  ),
302
415
  /* @__PURE__ */ jsx(
303
- "button",
416
+ "svg",
304
417
  {
305
- className: clsx(endChatButtonStyle, noAnswerButton),
306
- type: "button",
307
- onClick: () => {
308
- setShowEndChatDialog(false);
309
- },
310
- children: "No, Go Back"
418
+ width: "15",
419
+ height: "15",
420
+ viewBox: "0 0 15 15",
421
+ fill: "none",
422
+ xmlns: "http://www.w3.org/2000/svg",
423
+ children: /* @__PURE__ */ jsx(
424
+ "path",
425
+ {
426
+ 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",
427
+ fill: vars.chatbot.window.headerText
428
+ }
429
+ )
311
430
  }
312
431
  )
313
432
  ]
314
433
  }
315
- ),
316
- " "
317
- ] }) })
434
+ )
435
+ ] })
318
436
  ] }),
319
- /* @__PURE__ */ jsx(
320
- ThankYouMessage,
321
- {
322
- showEndChatDialog: showThankyouMessage,
323
- onStart: onStartChat,
324
- onClose: onCancelEndChat
325
- }
326
- ),
327
- onClose && /* @__PURE__ */ jsxs(
328
- "button",
437
+ mounted && !state.online ? /* @__PURE__ */ jsx("div", { className: clsx(chatNetworkStatus), children: /* @__PURE__ */ jsxs(
438
+ "div",
329
439
  {
330
- onClick: () => {
331
- onClose();
332
- setMenuOpen(false);
440
+ style: {
441
+ color: "#d32f2f",
442
+ textAlign: "center",
443
+ padding: "8px 0",
444
+ fontWeight: 500
333
445
  },
334
- className: clsx(button_reset, button_bar),
335
- "aria-label": "Close chat window",
336
- title: "Close",
337
446
  children: [
338
447
  /* @__PURE__ */ jsx(
339
- "svg",
448
+ "span",
340
449
  {
341
- xmlns: "http://www.w3.org/2000/svg",
342
- width: "24",
343
- height: "24",
344
- viewBox: "0 0 24 24",
345
- fill: "none",
346
- children: /* @__PURE__ */ jsx(
347
- "path",
348
- {
349
- className: arrowFill,
350
- d: "M2.46875 7.76574L11.9991 17.2961L21.5294 7.76574L20.4687 6.70508L11.9991 15.1749L3.52941 6.70508L2.46875 7.76574Z",
351
- color: vars.chatbot.window.headerText
352
- }
353
- )
450
+ role: "img",
451
+ "aria-label": "disconnected",
452
+ style: { marginRight: 6 },
453
+ children: "⚠️"
354
454
  }
355
455
  ),
356
- /* @__PURE__ */ jsx(
357
- "svg",
358
- {
359
- width: "15",
360
- height: "15",
361
- viewBox: "0 0 15 15",
362
- fill: "none",
363
- xmlns: "http://www.w3.org/2000/svg",
364
- children: /* @__PURE__ */ jsx(
365
- "path",
366
- {
367
- 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",
368
- fill: vars.chatbot.window.headerText
369
- }
370
- )
371
- }
372
- )
456
+ "You are currently disconnected. Please check your connection."
373
457
  ]
374
458
  }
375
- )
376
- ] })
377
- ] }),
378
- mounted && !state.online ? /* @__PURE__ */ jsx("div", { className: clsx(chatNetworkStatus), children: /* @__PURE__ */ jsxs(
379
- "div",
380
- {
381
- style: {
382
- color: "#d32f2f",
383
- textAlign: "center",
384
- padding: "8px 0",
385
- fontWeight: 500
386
- },
387
- children: [
388
- /* @__PURE__ */ jsx(
389
- "span",
390
- {
391
- role: "img",
392
- "aria-label": "disconnected",
393
- style: { marginRight: 6 },
394
- children: "⚠️"
395
- }
396
- ),
397
- "You are currently disconnected. Please check your connection."
398
- ]
399
- }
400
- ) }) : null,
401
- /* @__PURE__ */ jsxs("div", { className: clsx(messagesContainerStyle), children: [
402
- (status === "idle" && messages.length == 0 || messages.length == 0) && /* @__PURE__ */ jsx(
403
- "div",
404
- {
405
- className: clsx(),
406
- style: {
407
- textAlign: "left",
408
- alignSelf: "flex-start",
409
- color: "#1e3860",
410
- borderRadius: 16,
411
- padding: "8px 8px",
412
- maxWidth: "80%",
413
- marginBottom: 2
414
- },
415
- children: /* @__PURE__ */ jsx(
459
+ ) }) : null,
460
+ /* @__PURE__ */ jsxs("div", { className: clsx(messagesContainerStyle), children: [
461
+ (status === "idle" && messages.length == 0 || messages.length == 0) && /* @__PURE__ */ jsx(
416
462
  "div",
417
463
  {
464
+ className: clsx(),
418
465
  style: {
419
- fontSize: 14,
420
- display: "flex",
421
- flexDirection: "column",
422
- gap: 4
466
+ textAlign: "left",
467
+ alignSelf: "flex-start",
468
+ color: "#1e3860",
469
+ borderRadius: 16,
470
+ padding: "8px 8px",
471
+ maxWidth: "80%",
472
+ marginBottom: 2
423
473
  },
424
- children: /* @__PURE__ */ jsx("p", { className: shimmerText, children: "Chat connecting..." })
425
- }
426
- )
427
- }
428
- ),
429
- messages?.map((msg) => {
430
- if (!hasOpenedOnce) {
431
- return null;
432
- }
433
- return /* @__PURE__ */ jsx(
434
- ChatbotMessage,
435
- {
436
- msg,
437
- onSend,
438
- showAvatar,
439
- showName,
440
- virtualAgent,
441
- onCancelEndChat,
442
- onEndChat: () => {
443
- endChat();
444
- onCloseAfterThankYou();
445
- },
446
- inputRef
447
- },
448
- msg?.$index
449
- );
450
- }),
451
- showReconnect && /* @__PURE__ */ jsx(
452
- "button",
453
- {
454
- style: { margin: "12px auto", display: "block" },
455
- onClick: () => {
456
- },
457
- children: "Reconnect Chat"
458
- }
459
- ),
460
- /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
461
- ] }),
462
- /* @__PURE__ */ jsx("div", { style: { padding: "16px 16px 24px 16px" }, children: /* @__PURE__ */ jsx("form", { onSubmit: handleSend, className: clsx(gradientFocus), children: /* @__PURE__ */ jsxs(
463
- "div",
464
- {
465
- style: {
466
- display: "flex",
467
- padding: "12px 16px",
468
- background: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected ? "light-dark(rgba(239, 239, 239, 0.3), rgba(59, 59, 59, 0.3))" : "#ffffff",
469
- borderRadius: 12
470
- },
471
- children: [
472
- /* @__PURE__ */ jsx(
473
- "textarea",
474
- {
475
- ref: inputRef,
476
- value: input,
477
- onChange: (e) => setInput(e.target.value),
478
- onKeyDown: (e) => {
479
- if (hasEscalated) {
480
- previewTyping(e.target?.value);
481
- }
482
- if (e.key === "Enter" && !e.shiftKey) {
483
- handleSend(e);
474
+ children: /* @__PURE__ */ jsx(
475
+ "div",
476
+ {
477
+ style: {
478
+ fontSize: 14,
479
+ display: "flex",
480
+ flexDirection: "column",
481
+ gap: 16
482
+ },
483
+ children: /* @__PURE__ */ jsx("p", { className: shimmerText, children: "Chat connecting..." })
484
484
  }
485
- },
486
- placeholder: "Ask anything...",
487
- className: clsx(inputStyle, autoResize),
488
- autoFocus: true,
489
- disabled: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
490
- rows: 1
485
+ )
491
486
  }
492
487
  ),
493
- /* @__PURE__ */ jsx(
488
+ messages?.map((msg) => {
489
+ if (!hasOpenedOnce) {
490
+ return null;
491
+ }
492
+ return /* @__PURE__ */ jsx(
493
+ ChatbotMessage,
494
+ {
495
+ msg,
496
+ onSend,
497
+ showAvatar,
498
+ showName,
499
+ virtualAgent,
500
+ onCancelEndChat,
501
+ onEndChat: () => {
502
+ endChat();
503
+ onCloseAfterThankYou();
504
+ },
505
+ inputRef
506
+ },
507
+ msg?.$index
508
+ );
509
+ }),
510
+ showReconnect && /* @__PURE__ */ jsx(
494
511
  "button",
495
512
  {
496
- className: clsx(
497
- sendButtonStyle,
498
- input.trim().length > 0 && "active"
499
- ),
500
- type: "submit",
501
- title: "Send message",
502
- disabled: isBlockedInput || inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
503
- children: /* @__PURE__ */ jsx(
504
- "svg",
505
- {
506
- xmlns: "http://www.w3.org/2000/svg",
507
- width: "16",
508
- height: "16",
509
- viewBox: "0 0 16 16",
510
- fill: "none",
511
- children: /* @__PURE__ */ jsx(
512
- "path",
513
+ style: { margin: "12px auto", display: "block" },
514
+ onClick: () => {
515
+ },
516
+ children: "Reconnect Chat"
517
+ }
518
+ ),
519
+ /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
520
+ ] }),
521
+ /* @__PURE__ */ jsxs("div", { style: { padding: "16px 16px 24px 16px" }, children: [
522
+ /* @__PURE__ */ jsxs("form", { onSubmit: handleSend, className: clsx(gradientFocus), children: [
523
+ /* @__PURE__ */ jsx(
524
+ "div",
525
+ {
526
+ className: clsx(
527
+ focused && !inputDisabled && !isBlockedInput ? focusAnimation : ""
528
+ ),
529
+ style: {
530
+ position: "absolute",
531
+ left: "10%",
532
+ width: "80%",
533
+ height: "40px",
534
+ zIndex: "-1"
535
+ }
536
+ }
537
+ ),
538
+ /* @__PURE__ */ jsxs(
539
+ "div",
540
+ {
541
+ className: formTextButton,
542
+ style: {
543
+ display: "flex",
544
+ padding: "12px 16px",
545
+ background: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected ? "light-dark(rgba(239, 239, 239, 0.3), rgba(59, 59, 59, 0.3))" : "#ffffff",
546
+ borderRadius: 12
547
+ },
548
+ children: [
549
+ /* @__PURE__ */ jsx(
550
+ "textarea",
513
551
  {
514
- fillRule: "evenodd",
515
- clipRule: "evenodd",
516
- 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",
517
- fill: "#435164"
552
+ ref: inputRef,
553
+ value: input,
554
+ onChange: (e) => setInput(e.target.value),
555
+ onKeyDown: (e) => {
556
+ if (hasEscalated) {
557
+ previewTyping(e.target?.value);
558
+ }
559
+ if (e.key === "Enter" && !e.shiftKey) {
560
+ handleSend(e);
561
+ }
562
+ },
563
+ onFocus: () => setFocused(() => true),
564
+ onBlur: () => setFocused(() => false),
565
+ placeholder: "Ask anything...",
566
+ "aria-label": "Ask anything...",
567
+ className: clsx(inputStyle, autoResize),
568
+ autoFocus: true,
569
+ disabled: isBlockedInput || inputDisabled || status !== "connected" || messages.length == 0 || escalationDeflected,
570
+ rows: 1
571
+ }
572
+ ),
573
+ /* @__PURE__ */ jsx(
574
+ "button",
575
+ {
576
+ className: clsx(
577
+ sendButtonStyle,
578
+ input.trim().length > 0 && "active"
579
+ ),
580
+ type: "submit",
581
+ title: "Send message",
582
+ disabled: isBlockedInput || inputDisabled || status !== "connected" || !input.trim() || messages.length == 0 || escalationDeflected,
583
+ children: /* @__PURE__ */ jsx(
584
+ "svg",
585
+ {
586
+ xmlns: "http://www.w3.org/2000/svg",
587
+ width: "20",
588
+ height: "20",
589
+ viewBox: "0 0 16 16",
590
+ fill: "none",
591
+ children: /* @__PURE__ */ jsx(
592
+ "path",
593
+ {
594
+ fillRule: "evenodd",
595
+ clipRule: "evenodd",
596
+ 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",
597
+ fill: "#435164"
598
+ }
599
+ )
600
+ }
601
+ )
518
602
  }
519
603
  )
520
- }
521
- )
522
- }
523
- )
524
- ]
525
- }
526
- ) }) })
527
- ] });
604
+ ]
605
+ }
606
+ )
607
+ ] }),
608
+ /* @__PURE__ */ jsx("p", { className: chatAiDisclaimer, children: "Evo is AI and can make mistakes. Verify important details." })
609
+ ] })
610
+ ]
611
+ }
612
+ );
528
613
  };
529
614
  export {
530
615
  ChatWindow