@axos-web-dev/shared-components 2.2.4 → 2.2.6

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 (71) hide show
  1. package/dist/ATMLocator/ATMLocator.js +1 -0
  2. package/dist/Auth/ErrorAlert.js +1 -0
  3. package/dist/Button/Button.js +1 -0
  4. package/dist/Calculators/Calculator.js +2 -1
  5. package/dist/Calculators/MarginTradingCalculator/index.js +1 -0
  6. package/dist/Carousel/index.js +1 -0
  7. package/dist/Chatbot/AudioManager.d.ts +19 -0
  8. package/dist/Chatbot/AudioManager.js +61 -0
  9. package/dist/Chatbot/ChatWindow.css.d.ts +2 -0
  10. package/dist/Chatbot/ChatWindow.css.js +34 -30
  11. package/dist/Chatbot/ChatWindow.js +382 -363
  12. package/dist/Chatbot/Chatbot.d.ts +3 -0
  13. package/dist/Chatbot/Chatbot.js +24 -1
  14. package/dist/Chatbot/ExpandChatToggle.d.ts +8 -0
  15. package/dist/Chatbot/ExpandChatToggle.js +74 -0
  16. package/dist/Chatbot/index.js +5 -2
  17. package/dist/Chatbot/store/chat.d.ts +8 -0
  18. package/dist/Chatbot/store/chat.js +14 -2
  19. package/dist/Chevron/index.js +1 -0
  20. package/dist/Comparison/Comparison.js +1 -0
  21. package/dist/ExecutiveBio/ExecutiveBio.js +1 -0
  22. package/dist/FaqAccordion/index.js +1 -0
  23. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +10 -3
  24. package/dist/Forms/ApplyNow.js +1 -0
  25. package/dist/Forms/ContactUsBusiness.js +1 -0
  26. package/dist/Forms/ContactUsBusinessNameEmail.js +1 -0
  27. package/dist/Forms/ContactUsNMLSId.js +1 -0
  28. package/dist/Forms/ContactUsSchwabAAS.d.ts +11 -0
  29. package/dist/Forms/ContactUsSchwabAAS.js +263 -0
  30. package/dist/Forms/CpraRequest.js +1 -0
  31. package/dist/Forms/CraPublicFile.js +1 -0
  32. package/dist/Forms/EmailOnly.js +1 -0
  33. package/dist/Forms/MortgageRate/MortgageRateForm.js +1 -0
  34. package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -0
  35. package/dist/Forms/MortgageWarehouseLending.js +1 -0
  36. package/dist/Forms/SuccesForm.js +2 -1
  37. package/dist/Forms/index.d.ts +1 -0
  38. package/dist/Forms/index.js +2 -0
  39. package/dist/Hyperlink/index.js +1 -0
  40. package/dist/ImageLink/ImageLink.js +1 -0
  41. package/dist/ImageLink/ImageLinkSet.js +1 -0
  42. package/dist/ImageLink/index.js +1 -0
  43. package/dist/Insight/Featured/CategorySelector.js +1 -0
  44. package/dist/Insight/Featured/Featured.js +1 -0
  45. package/dist/Insight/Featured/Header.js +1 -0
  46. package/dist/Modal/Modal.js +1 -0
  47. package/dist/NavigationMenu/AxosALTS/index.js +1 -0
  48. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +1 -0
  49. package/dist/NavigationMenu/AxosBank/SubNavBar.js +222 -227
  50. package/dist/NavigationMenu/AxosBank/index.js +1 -0
  51. package/dist/NavigationMenu/LaVictoire/index.js +1 -0
  52. package/dist/NavigationMenu/Navbar.js +1 -0
  53. package/dist/NavigationMenu/SignInNavButton.js +1 -0
  54. package/dist/SetContainer/SetContainer.js +1 -0
  55. package/dist/SocialMediaBar/iconsRepository.js +1 -0
  56. package/dist/Typography/Typography.css.d.ts +0 -6
  57. package/dist/VideoTile/VideoTile.js +1 -0
  58. package/dist/VideoWrapper/index.js +1 -0
  59. package/dist/assets/Chatbot/ChatWindow.css +69 -57
  60. package/dist/assets/ImageBillboard/ImageBillboard.css +1 -1
  61. package/dist/assets/Table/Table.css +1 -1
  62. package/dist/assets/notification.mp3.js +4 -0
  63. package/dist/main.js +7 -2
  64. package/dist/utils/useVisibility.d.ts +1 -0
  65. package/dist/utils/useVisibility.js +18 -0
  66. package/dist/vite-env.d.js +1 -0
  67. package/package.json +1 -1
  68. package/dist/Chatbot/Chat.d.ts +0 -1
  69. package/dist/Chatbot/Chat.js +0 -158
  70. package/dist/Chatbot/useHeadlessChat.d.ts +0 -27
  71. package/dist/Chatbot/useHeadlessChat.js +0 -240
@@ -1,3 +1,6 @@
1
+ import { default as AudioManager } from './AudioManager';
2
+
3
+ export declare const audioManager: AudioManager;
1
4
  export type ChatbotProps = {
2
5
  project?: "axos" | "ufb";
3
6
  debug?: boolean;
@@ -1,12 +1,18 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { usePageVisibility } from "../utils/useVisibility.js";
3
4
  import { useRef, useState, useEffect } from "react";
4
5
  import { useMount, useUnmount } from "react-use";
6
+ import notificationSound from "../assets/notification.mp3.js";
7
+ import AudioManager from "./AudioManager.js";
5
8
  import { Bubble } from "./Bubble.js";
6
9
  import { chatbotAXB, chatbotUFB } from "./Chatbot.css.js";
7
10
  import { ChatWindow } from "./ChatWindow.js";
8
11
  import { useOpenChat } from "./store/chat.js";
9
12
  import { useMessages } from "./store/messages.js";
13
+ const audioManager = new AudioManager();
14
+ audioManager.installUjetAudioOverride(notificationSound);
15
+ audioManager.setSoundEnabled(false);
10
16
  const Chatbot = ({
11
17
  project = "axos",
12
18
  projectEnv = "dev",
@@ -14,6 +20,7 @@ const Chatbot = ({
14
20
  config
15
21
  }) => {
16
22
  const {
23
+ isOpen,
17
24
  hasOpenedOnce,
18
25
  toggle,
19
26
  reset,
@@ -23,6 +30,7 @@ const Chatbot = ({
23
30
  unblockInput,
24
31
  blockInput
25
32
  } = useOpenChat();
33
+ const isVisible = usePageVisibility();
26
34
  const { addMessage, addMessages, clearMessages, messages } = useMessages();
27
35
  const clientRef = useRef(null);
28
36
  const menuRef = useRef(null);
@@ -305,6 +313,7 @@ const Chatbot = ({
305
313
  }
306
314
  };
307
315
  const handleClick = async () => {
316
+ audioManager.setSoundEnabled(true);
308
317
  toggle();
309
318
  if (hasStarted) return;
310
319
  if (!hasOpenedOnce) {
@@ -391,6 +400,19 @@ const Chatbot = ({
391
400
  console.error("Error sending preview message:", error);
392
401
  }
393
402
  };
403
+ useEffect(() => {
404
+ if (chatRef.current) {
405
+ if (isVisible && isOpen) {
406
+ audioManager.setSoundEnabled(false);
407
+ }
408
+ if (isVisible && !isOpen) {
409
+ audioManager.setSoundEnabled(true);
410
+ }
411
+ if (!isVisible) {
412
+ audioManager.setSoundEnabled(true);
413
+ }
414
+ }
415
+ }, [isOpen, isVisible]);
394
416
  return menusLoaded && /* @__PURE__ */ jsxs(
395
417
  "div",
396
418
  {
@@ -417,5 +439,6 @@ const Chatbot = ({
417
439
  );
418
440
  };
419
441
  export {
420
- Chatbot
442
+ Chatbot,
443
+ audioManager
421
444
  };
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface ExpandChatToggleProps {
4
+ isExpanded: boolean;
5
+ onToggle: () => void;
6
+ }
7
+ export declare const ExpandChatToggle: React.FC<ExpandChatToggleProps>;
8
+ export {};
@@ -0,0 +1,74 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { vars } from "../themes/axos.css.js";
3
+ import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
4
+ /* empty css */
5
+ /* empty css */
6
+ /* empty css */
7
+ import clsx from "clsx";
8
+ import { button_bar, expandToggleStyle } from "./ChatWindow.css.js";
9
+ const ExpandChatToggle = ({
10
+ isExpanded,
11
+ onToggle
12
+ }) => {
13
+ return /* @__PURE__ */ jsx(
14
+ "button",
15
+ {
16
+ type: "button",
17
+ onClick: onToggle,
18
+ className: clsx(button_bar, expandToggleStyle),
19
+ style: { border: "none", cursor: "pointer", padding: 0, lineHeight: 1 },
20
+ "aria-label": isExpanded ? "Collapse chat window" : "Expand chat window",
21
+ title: isExpanded ? "Collapse" : "Expand",
22
+ children: isExpanded ? (
23
+ // Collapse: inward corners — shown when panel is expanded (shrink toward bottom-right)
24
+ /* @__PURE__ */ jsxs(
25
+ "svg",
26
+ {
27
+ xmlns: "http://www.w3.org/2000/svg",
28
+ width: 16,
29
+ height: 16,
30
+ viewBox: "0 0 24 24",
31
+ fill: "none",
32
+ stroke: vars.chatbot.window.headerText,
33
+ strokeWidth: 2,
34
+ strokeLinecap: "round",
35
+ strokeLinejoin: "round",
36
+ "aria-hidden": true,
37
+ children: [
38
+ /* @__PURE__ */ jsx("polyline", { points: "20 14 14 14 14 20" }),
39
+ /* @__PURE__ */ jsx("polyline", { points: "4 10 10 10 10 4" }),
40
+ /* @__PURE__ */ jsx("line", { x1: "14", y1: "14", x2: "21", y2: "21" }),
41
+ /* @__PURE__ */ jsx("line", { x1: "10", y1: "10", x2: "3", y2: "3" })
42
+ ]
43
+ }
44
+ )
45
+ ) : (
46
+ // Expand: outward corners — shown when panel is compact (grow toward top-left)
47
+ /* @__PURE__ */ jsxs(
48
+ "svg",
49
+ {
50
+ xmlns: "http://www.w3.org/2000/svg",
51
+ width: 16,
52
+ height: 16,
53
+ viewBox: "0 0 24 24",
54
+ fill: "none",
55
+ stroke: vars.chatbot.window.headerText,
56
+ strokeWidth: 2,
57
+ strokeLinecap: "round",
58
+ strokeLinejoin: "round",
59
+ "aria-hidden": true,
60
+ children: [
61
+ /* @__PURE__ */ jsx("polyline", { points: "9 3 3 3 3 9" }),
62
+ /* @__PURE__ */ jsx("polyline", { points: "15 21 21 21 21 15" }),
63
+ /* @__PURE__ */ jsx("line", { x1: "3", y1: "3", x2: "10", y2: "10" }),
64
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "14", y2: "14" })
65
+ ]
66
+ }
67
+ )
68
+ )
69
+ }
70
+ );
71
+ };
72
+ export {
73
+ ExpandChatToggle
74
+ };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { Bubble } from "./Bubble.js";
3
3
  import { borderHoverGradient, bubbleButton, bubbleText, bubbleWrapper, inner, svgFill } from "./Bubble.css.js";
4
- import { Chatbot } from "./Chatbot.js";
4
+ import { Chatbot, audioManager } from "./Chatbot.js";
5
5
  import { chatbotAXB, chatbotUFB } from "./Chatbot.css.js";
6
6
  import { ChatWindow } from "./ChatWindow.js";
7
- import { agent_msg, arrowFill, autoResize, button_bar, button_reset, buttonss_section, chatEndCircle, chatEndDialogOverlay, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, inline_button, inline_button_wrapper, inputStyle, left_bar_section, messageStyle, messagesContainerStyle, noAnswerButton, notificationStyle, sendButtonStyle, shimmerText, thankyou_image, thankyou_message, thankyou_overlay, user_msg, windowBarStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
7
+ import { agent_msg, arrowFill, autoResize, button_bar, button_reset, buttonss_section, chatEndCircle, chatEndDialogOverlay, chatFinishDialog, chatNetworkStatus, chat_title, chatbotMenu, chatbotMenuItem, endChatButtonStyle, expandToggleStyle, inline_button, inline_button_wrapper, inputStyle, left_bar_section, messageStyle, messagesContainerStyle, noAnswerButton, notificationStyle, sendButtonStyle, shimmerText, thankyou_image, thankyou_message, thankyou_overlay, user_msg, windowBarStyle, windowExpandedStyle, windowOpenStyle, windowStyle } from "./ChatWindow.css.js";
8
8
  import { useOpenChat } from "./store/chat.js";
9
9
  import { useMessages } from "./store/messages.js";
10
10
  export {
@@ -13,6 +13,7 @@ export {
13
13
  Chatbot,
14
14
  agent_msg,
15
15
  arrowFill,
16
+ audioManager,
16
17
  autoResize,
17
18
  borderHoverGradient,
18
19
  bubbleButton,
@@ -31,6 +32,7 @@ export {
31
32
  chatbotMenuItem,
32
33
  chatbotUFB,
33
34
  endChatButtonStyle,
35
+ expandToggleStyle,
34
36
  inline_button,
35
37
  inline_button_wrapper,
36
38
  inner,
@@ -50,6 +52,7 @@ export {
50
52
  useOpenChat,
51
53
  user_msg,
52
54
  windowBarStyle,
55
+ windowExpandedStyle,
53
56
  windowOpenStyle,
54
57
  windowStyle
55
58
  };
@@ -7,6 +7,7 @@ interface OpenChatState {
7
7
  reset: () => void;
8
8
  showThankyouMessage: boolean;
9
9
  displayThankyouMessage: () => void;
10
+ hideDisplayThankyouMessage: () => void;
10
11
  toggleThankyouMessage?: () => void;
11
12
  hasEscalated?: boolean;
12
13
  startEscalation?: () => void;
@@ -14,6 +15,13 @@ interface OpenChatState {
14
15
  isBlockedInput?: boolean;
15
16
  blockInput?: () => void;
16
17
  unblockInput?: () => void;
18
+ hasStarted: boolean;
19
+ setChatStarted: () => void;
20
+ resetChatStarted: () => void;
21
+ chatStatus: "idle" | "connected" | "connecting" | "ending" | "ended";
22
+ setChatStatus: (status: "idle" | "connected" | "connecting" | "ending" | "ended") => void;
23
+ isWindowExpanded: boolean;
24
+ toggleWindowExpanded: () => void;
17
25
  }
18
26
  export declare const useOpenChat: import('zustand').UseBoundStore<import('zustand').StoreApi<OpenChatState>>;
19
27
  export {};
@@ -4,6 +4,10 @@ const useOpenChat = create((set, get) => ({
4
4
  hasOpenedOnce: false,
5
5
  showThankyouMessage: false,
6
6
  hasEscalated: false,
7
+ hasStarted: false,
8
+ chatStatus: "idle",
9
+ isWindowExpanded: false,
10
+ toggleWindowExpanded: () => set((state) => ({ isWindowExpanded: !state.isWindowExpanded })),
7
11
  toggle: () => set((state) => ({ isOpen: !state.isOpen, hasOpenedOnce: true })),
8
12
  open: () => {
9
13
  const alreadyOpened = get().hasOpenedOnce;
@@ -18,15 +22,23 @@ const useOpenChat = create((set, get) => ({
18
22
  isOpen: false,
19
23
  showThankyouMessage: false,
20
24
  hasEscalated: false,
21
- isBlockedInput: false
25
+ isBlockedInput: false,
26
+ hasStarted: false,
27
+ isWindowExpanded: false
22
28
  }),
23
29
  displayThankyouMessage: () => set({ showThankyouMessage: true }),
30
+ hideDisplayThankyouMessage: () => set({ showThankyouMessage: false }),
24
31
  toggleThankyouMessage: () => set((state) => ({ showThankyouMessage: !state.showThankyouMessage })),
25
32
  startEscalation: () => set({ hasEscalated: true }),
26
33
  endEscalation: () => set({ hasEscalated: false }),
27
34
  isBlockedInput: false,
28
35
  blockInput: () => set({ isBlockedInput: true }),
29
- unblockInput: () => set({ isBlockedInput: false })
36
+ unblockInput: () => set({ isBlockedInput: false }),
37
+ setChatStarted: () => set({ hasStarted: true }),
38
+ resetChatStarted: () => set({ hasStarted: false }),
39
+ setChatStatus: (status) => set({
40
+ chatStatus: status
41
+ })
30
42
  }));
31
43
  export {
32
44
  useOpenChat
@@ -74,6 +74,7 @@ import "../Carousel/index.js";
74
74
  /* empty css */
75
75
  /* empty css */
76
76
  import "../Chatbot/store/chat.js";
77
+ import "../Chatbot/Chatbot.js";
77
78
  /* empty css */
78
79
  /* empty css */
79
80
  import "../Chatbot/store/messages.js";
@@ -75,6 +75,7 @@ import "../Carousel/index.js";
75
75
  /* empty css */
76
76
  /* empty css */
77
77
  import "../Chatbot/store/chat.js";
78
+ import "../Chatbot/Chatbot.js";
78
79
  /* empty css */
79
80
  /* empty css */
80
81
  import "../Chatbot/store/messages.js";
@@ -76,6 +76,7 @@ import "../Carousel/index.js";
76
76
  /* empty css */
77
77
  /* empty css */
78
78
  import "../Chatbot/store/chat.js";
79
+ import "../Chatbot/Chatbot.js";
79
80
  /* empty css */
80
81
  /* empty css */
81
82
  import "../Chatbot/store/messages.js";
@@ -76,6 +76,7 @@ import "../Carousel/index.js";
76
76
  /* empty css */
77
77
  /* empty css */
78
78
  import "../Chatbot/store/chat.js";
79
+ import "../Chatbot/Chatbot.js";
79
80
  /* empty css */
80
81
  /* empty css */
81
82
  import "../Chatbot/store/messages.js";
@@ -72,6 +72,7 @@ import "../../Carousel/index.js";
72
72
  /* empty css */
73
73
  /* empty css */
74
74
  import "../../Chatbot/store/chat.js";
75
+ import "../../Chatbot/Chatbot.js";
75
76
  /* empty css */
76
77
  /* empty css */
77
78
  import "../../Chatbot/store/messages.js";
@@ -177,7 +178,7 @@ const AxosFooterSiteMap = ({
177
178
  }
178
179
  ) }),
179
180
  /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: resolveUrl("{AXOSBANK}/personal/borrow/auto-loans"), children: "Auto Loans" }) }),
180
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: "https://lavictoirefinance.com/", children: "Marine Loans" }) })
181
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: resolveUrl("{AXOSBANK}/personal/borrow/marine-loans"), children: "Marine Loans" }) })
181
182
  ] }),
182
183
  /* @__PURE__ */ jsxs("ul", { children: [
183
184
  /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
@@ -286,7 +287,7 @@ const AxosFooterSiteMap = ({
286
287
  href: resolveUrl(
287
288
  "{AXOSBANK}/commercial/lending/residential-warehouse-lending"
288
289
  ),
289
- children: "Residential Warehouse Lending"
290
+ children: "Mortgage Warehouse Lending"
290
291
  }
291
292
  ) }),
292
293
  /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
@@ -535,7 +536,13 @@ const AxosFooterSiteMap = ({
535
536
  }
536
537
  ) }),
537
538
  /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: resolveUrl("{AXOSBANK}/personal/borrow/auto-loans"), children: "Auto Loans" }) }),
538
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: "https://lavictoirefinance.com/", children: "Marine Loans" }) })
539
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
540
+ "a",
541
+ {
542
+ href: resolveUrl("{AXOSBANK}/personal/borrow/marine-loans"),
543
+ children: "Marine Loans"
544
+ }
545
+ ) })
539
546
  ] }),
540
547
  /* @__PURE__ */ jsxs("ul", { children: [
541
548
  /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
@@ -77,6 +77,7 @@ import "../Carousel/index.js";
77
77
  /* empty css */
78
78
  /* empty css */
79
79
  import "../Chatbot/store/chat.js";
80
+ import "../Chatbot/Chatbot.js";
80
81
  /* empty css */
81
82
  /* empty css */
82
83
  import "../Chatbot/store/messages.js";
@@ -78,6 +78,7 @@ import "../Carousel/index.js";
78
78
  /* empty css */
79
79
  /* empty css */
80
80
  import "../Chatbot/store/chat.js";
81
+ import "../Chatbot/Chatbot.js";
81
82
  /* empty css */
82
83
  /* empty css */
83
84
  import "../Chatbot/store/messages.js";
@@ -78,6 +78,7 @@ import "../Carousel/index.js";
78
78
  /* empty css */
79
79
  /* empty css */
80
80
  import "../Chatbot/store/chat.js";
81
+ import "../Chatbot/Chatbot.js";
81
82
  /* empty css */
82
83
  /* empty css */
83
84
  import "../Chatbot/store/messages.js";
@@ -78,6 +78,7 @@ import "../Carousel/index.js";
78
78
  /* empty css */
79
79
  /* empty css */
80
80
  import "../Chatbot/store/chat.js";
81
+ import "../Chatbot/Chatbot.js";
81
82
  /* empty css */
82
83
  /* empty css */
83
84
  import "../Chatbot/store/messages.js";
@@ -0,0 +1,11 @@
1
+ import { FormProps } from './FormProps';
2
+
3
+ export type ContactUsSchwabAASInputs = {
4
+ first_name: string;
5
+ last_name: string;
6
+ email: string;
7
+ phone: string;
8
+ company: string;
9
+ Role__c: string;
10
+ };
11
+ export declare const ContactUsSchwabAAS: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, }: FormProps) => import("react").JSX.Element;
@@ -0,0 +1,263 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { zodResolver } from "@hookform/resolvers/zod";
4
+ import { Button } from "../Button/Button.js";
5
+ import "../Button/Button.css.js";
6
+ import "react";
7
+ import "react-use";
8
+ import "../Input/Checkbox.js";
9
+ import "../Input/CurrencyInput.js";
10
+ import { Dropdown } from "../Input/Dropdown.js";
11
+ import "../Input/Dropdown.css.js";
12
+ import { Input } from "../Input/Input.js";
13
+ import "../Input/Input.css.js";
14
+ import "../Input/InputAmount.js";
15
+ import { InputPhone } from "../Input/InputPhone.js";
16
+ import "../Input/InputTextArea.js";
17
+ import "../Input/DownPaymentInput.js";
18
+ import "../Input/RadioButton.js";
19
+ import { LoadingIndicator } from "../LoadingIndicator/index.js";
20
+ import "../icons/ArrowIcon/ArrowIcon.css.js";
21
+ import SvgAxosX from "../icons/AxosX/index.js";
22
+ import SvgComponent from "../icons/AxosX/Blue.js";
23
+ import "../icons/CheckIcon/CheckIcon.css.js";
24
+ import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/DownloadIcon/DownloadIcon.css';import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
25
+ /* empty css */
26
+ /* empty css */
27
+ /* empty css */
28
+ /* empty css */
29
+ /* empty css */
30
+ import { z } from "zod";
31
+ import { getVariant } from "../utils/getVariant.js";
32
+ import { useCachedEmailValidator } from "../utils/useCachedValidators.js";
33
+ import clsx from "clsx";
34
+ import { useForm, FormProvider } from "react-hook-form";
35
+ import { Roles } from "./FormEnums.js";
36
+ import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
37
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
38
+ import { SalesforceSchema } from "./SalesforceFieldsForm.js";
39
+ const ContactUsSchwabAAS = ({
40
+ icon = false,
41
+ children,
42
+ onSubmit = (values) => {
43
+ console.log(values);
44
+ },
45
+ disclosure,
46
+ variant: fullVariant = "primary",
47
+ headline,
48
+ description,
49
+ callToAction,
50
+ validateEmail,
51
+ onValidate,
52
+ id
53
+ }) => {
54
+ const cachedEmailValidator = useCachedEmailValidator(validateEmail);
55
+ const schema = z.object({
56
+ first_name: z.string({ message: "First name is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
57
+ message: "Invalid first name"
58
+ }).trim().min(1, { message: "First Name is required." }),
59
+ last_name: z.string({ message: "Last name is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
60
+ message: "Invalid last name"
61
+ }).trim().min(1, { message: "Last Name is required." }),
62
+ email: z.string({ message: "Email is required." }).email({ message: "Email is required." }).refine(cachedEmailValidator, { message: "Invalid email address." }),
63
+ phone: z.string({ message: "Phone is required." }).regex(/[\d-]{10}/, "Invalid phone number.").min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
64
+ const removeDashes = val.replace(/-/gi, "");
65
+ if (removeDashes.length !== 10) {
66
+ ctx.addIssue({
67
+ code: z.ZodIssueCode.custom,
68
+ message: "Phone must have at least 10 and no more than 10 characters."
69
+ });
70
+ return z.NEVER;
71
+ }
72
+ if (removeDashes.endsWith("00000") || removeDashes.startsWith("999") || removeDashes.length === 10 && /^[01]/.test(removeDashes)) {
73
+ ctx.addIssue({
74
+ code: z.ZodIssueCode.custom,
75
+ message: "Invalid phone number."
76
+ });
77
+ return z.NEVER;
78
+ }
79
+ return removeDashes;
80
+ }),
81
+ company: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
82
+ message: "Invalid company name"
83
+ }).trim().optional().or(z.literal("")),
84
+ Current_Assets_Under_Management__c: z.union([z.string(), z.undefined()]),
85
+ Role__c: z.string().min(1, { message: "Role is required." }).refine((val) => Roles.includes(val), "Role is required"),
86
+ description: z.optional(z.string().trim().max(32e3))
87
+ });
88
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
89
+ if (!isValidHoneyPot(data)) {
90
+ ctx.addIssue({
91
+ code: z.ZodIssueCode.custom,
92
+ message: "fields are not valid."
93
+ });
94
+ }
95
+ });
96
+ const methods = useForm({
97
+ resolver: zodResolver(gen_schema),
98
+ mode: "all",
99
+ shouldUnregister: true,
100
+ defaultValues: {
101
+ email: ""
102
+ }
103
+ });
104
+ const {
105
+ handleSubmit,
106
+ register,
107
+ formState: { errors, isValid, isSubmitting }
108
+ } = methods;
109
+ const submitForm = async (data) => {
110
+ await onSubmit(data);
111
+ };
112
+ const variant = getVariant(fullVariant);
113
+ return /* @__PURE__ */ jsx("section", { id, className: clsx(formContainer({ variant })), children: /* @__PURE__ */ jsx("div", { className: clsx("containment"), children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
114
+ icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
115
+ /* @__PURE__ */ jsxs("div", { className: `${headerContainer} text_center`, children: [
116
+ /* @__PURE__ */ jsx("h2", { className: clsx("header_2", headerForm({ variant })), children: headline }),
117
+ description && /* @__PURE__ */ jsx(
118
+ "div",
119
+ {
120
+ className: `${form} ${descriptionField({ variant })} text_center`,
121
+ children: description
122
+ }
123
+ )
124
+ ] }),
125
+ /* @__PURE__ */ jsxs(
126
+ "form",
127
+ {
128
+ className: form,
129
+ onSubmit: async (e) => {
130
+ onValidate && onValidate(e);
131
+ await handleSubmit(submitForm)(e);
132
+ e.preventDefault();
133
+ },
134
+ children: [
135
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
136
+ /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
137
+ Input,
138
+ {
139
+ id: "first_name",
140
+ ...register("first_name", { required: true }),
141
+ label: "First Name*",
142
+ sizes: "medium",
143
+ placeholder: "",
144
+ required: true,
145
+ error: !!errors.first_name,
146
+ helperText: errors.first_name?.message,
147
+ variant
148
+ }
149
+ ) }),
150
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
151
+ Input,
152
+ {
153
+ id: "last_name",
154
+ ...register("last_name", { required: true }),
155
+ label: "Last Name*",
156
+ sizes: "medium",
157
+ placeholder: "",
158
+ required: true,
159
+ error: !!errors.last_name,
160
+ helperText: errors.last_name?.message,
161
+ variant
162
+ }
163
+ ) }),
164
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
165
+ Input,
166
+ {
167
+ id: "email",
168
+ ...register("email", {
169
+ required: true
170
+ }),
171
+ type: "email",
172
+ label: "Email*",
173
+ sizes: "medium",
174
+ placeholder: "",
175
+ required: true,
176
+ error: !!errors.email,
177
+ helperText: errors.email?.message,
178
+ variant
179
+ }
180
+ ) }),
181
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
182
+ InputPhone,
183
+ {
184
+ id: "phone",
185
+ ...register("phone", {
186
+ required: true,
187
+ maxLength: 12
188
+ }),
189
+ label: "Phone*",
190
+ sizes: "medium",
191
+ placeholder: "",
192
+ type: "tel",
193
+ required: true,
194
+ error: !!errors.phone,
195
+ helperText: errors.phone?.message,
196
+ variant
197
+ }
198
+ ) }),
199
+ /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
200
+ Input,
201
+ {
202
+ id: "company",
203
+ ...register("company"),
204
+ label: "Company",
205
+ sizes: "medium",
206
+ placeholder: "",
207
+ error: !!errors.company,
208
+ helperText: errors.company?.message,
209
+ variant
210
+ }
211
+ ) }),
212
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
213
+ Dropdown,
214
+ {
215
+ id: "Role__c",
216
+ ...register("Role__c", {
217
+ required: true
218
+ }),
219
+ label: "What best describes your role?*",
220
+ sizes: "medium",
221
+ required: true,
222
+ error: !!errors.Role__c,
223
+ helperText: errors.Role__c?.message,
224
+ variant,
225
+ defaultValue: "Select option",
226
+ children: [
227
+ /* @__PURE__ */ jsx("option", { value: "Select option", disabled: true, children: "Select Option" }),
228
+ /* @__PURE__ */ jsx("option", { value: "RIA Principal", children: "RIA Principal" }),
229
+ /* @__PURE__ */ jsx("option", { value: "Advisor (IAR)", children: "Advisor (IAR)" }),
230
+ /* @__PURE__ */ jsx("option", { value: "Broker-Dealer Affiliated Advisor", children: "Broker-Dealer Affiliated Advisor" }),
231
+ /* @__PURE__ */ jsx("option", { value: "I am not a Financial Advisor", children: "I am not a Financial Advisor" }),
232
+ /* @__PURE__ */ jsx("option", { value: "Other", children: "Other" })
233
+ ]
234
+ }
235
+ ) }),
236
+ /* @__PURE__ */ jsx(HoneyPot, { register, variant })
237
+ ] }),
238
+ children,
239
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
240
+ /* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
241
+ LoadingIndicator,
242
+ {
243
+ style: { marginInline: "auto" },
244
+ variant
245
+ }
246
+ ) : /* @__PURE__ */ jsx(
247
+ Button,
248
+ {
249
+ color: getVariant(callToAction?.variant),
250
+ as: "button",
251
+ type: "submit",
252
+ disabled: !isValid || isSubmitting,
253
+ children: callToAction?.displayText
254
+ }
255
+ ) }) })
256
+ ]
257
+ }
258
+ )
259
+ ] }) }) }, id);
260
+ };
261
+ export {
262
+ ContactUsSchwabAAS
263
+ };
@@ -78,6 +78,7 @@ import "../Carousel/index.js";
78
78
  /* empty css */
79
79
  /* empty css */
80
80
  import "../Chatbot/store/chat.js";
81
+ import "../Chatbot/Chatbot.js";
81
82
  /* empty css */
82
83
  /* empty css */
83
84
  import "../Chatbot/store/messages.js";