@axos-web-dev/shared-components 2.0.0-dev.3-evo-ui.2 → 2.0.0-dev.30-toasts

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