@axos-web-dev/shared-components 2.0.0-dev.2-bwaTest → 2.0.0-dev.2-nav-1

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 (81) hide show
  1. package/dist/ATMLocator/ATMLocator.js +14 -84
  2. package/dist/Auth/ErrorAlert.js +6 -88
  3. package/dist/Button/Button.js +6 -120
  4. package/dist/Calculators/Calculator.d.ts +1 -1
  5. package/dist/Calculators/Calculator.js +18 -89
  6. package/dist/Calculators/MarginTradingCalculator/index.js +2 -112
  7. package/dist/Carousel/index.js +4 -109
  8. package/dist/Chatbot/ChatWindow.css.d.ts +4 -0
  9. package/dist/Chatbot/ChatWindow.css.js +8 -0
  10. package/dist/Chatbot/ChatWindow.js +8 -2
  11. package/dist/Chatbot/Chatbot.js +12 -2
  12. package/dist/Chatbot/ChatbotMessage.d.ts +1 -0
  13. package/dist/Chatbot/ChatbotMessage.js +47 -4
  14. package/dist/Chatbot/index.js +5 -1
  15. package/dist/Chevron/index.js +4 -114
  16. package/dist/Comparison/Comparison.js +5 -121
  17. package/dist/ExecutiveBio/ExecutiveBio.interface.d.ts +3 -2
  18. package/dist/ExecutiveBio/ExecutiveBio.js +4 -126
  19. package/dist/FaqAccordion/index.js +7 -110
  20. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +5 -110
  21. package/dist/Forms/ApplyNow.js +4 -109
  22. package/dist/Forms/ContactCompany.d.ts +1 -1
  23. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  24. package/dist/Forms/ContactUsBusiness.js +7 -104
  25. package/dist/Forms/ContactUsBusinessNameEmail.js +8 -104
  26. package/dist/Forms/ContactUsNMLSId.js +7 -104
  27. package/dist/Forms/CpraRequest.js +2 -96
  28. package/dist/Forms/CraPublicFile.js +7 -104
  29. package/dist/Forms/DealerServices.d.ts +1 -1
  30. package/dist/Forms/EmailOnly.js +7 -104
  31. package/dist/Forms/EmailUs.js +34 -40
  32. package/dist/Forms/Forms.css.d.ts +0 -3
  33. package/dist/Forms/Forms.css.js +39 -39
  34. package/dist/Forms/MortgageRate/MortgageRateForm.js +8 -96
  35. package/dist/Forms/MortgageRate/MortgageRateWatch.js +4 -92
  36. package/dist/Forms/MortgageWarehouseLending.js +7 -104
  37. package/dist/Forms/SuccesForm.js +8 -91
  38. package/dist/Hyperlink/index.js +5 -110
  39. package/dist/ImageLink/ImageLink.js +6 -106
  40. package/dist/ImageLink/ImageLinkSet.js +6 -114
  41. package/dist/ImageLink/index.js +6 -105
  42. package/dist/Insight/Featured/CategorySelector.d.ts +1 -1
  43. package/dist/Insight/Featured/CategorySelector.js +5 -109
  44. package/dist/Insight/Featured/Featured.js +8 -106
  45. package/dist/Insight/Featured/Header.js +4 -109
  46. package/dist/LandingPageHeader/LandingPageHeader.d.ts +1 -1
  47. package/dist/Modal/Modal.js +2 -122
  48. package/dist/NavigationMenu/AxosALTS/index.js +6 -111
  49. package/dist/NavigationMenu/AxosBank/DropwdownButton.d.ts +7 -0
  50. package/dist/NavigationMenu/AxosBank/DropwdownButton.js +125 -0
  51. package/dist/NavigationMenu/AxosBank/Menu.d.ts +37 -0
  52. package/dist/NavigationMenu/AxosBank/Menu.js +150 -0
  53. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +12 -1
  54. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +183 -268
  55. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +37 -268
  56. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +63 -492
  57. package/dist/NavigationMenu/AxosBank/MobileMenu/mobileReducer.d.ts +36 -0
  58. package/dist/NavigationMenu/AxosBank/MobileMenu/mobileReducer.js +105 -0
  59. package/dist/NavigationMenu/AxosBank/NavBar.module.js +42 -39
  60. package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +6 -1
  61. package/dist/NavigationMenu/AxosBank/SubNavBar.js +118 -3187
  62. package/dist/NavigationMenu/AxosBank/SubNavItem.d.ts +1 -0
  63. package/dist/NavigationMenu/AxosBank/SubNavItem.js +206 -0
  64. package/dist/NavigationMenu/AxosBank/index.d.ts +6 -4
  65. package/dist/NavigationMenu/AxosBank/index.js +83 -457
  66. package/dist/NavigationMenu/LaVictoire/index.js +5 -118
  67. package/dist/NavigationMenu/Navbar.d.ts +4 -1
  68. package/dist/NavigationMenu/Navbar.js +11 -114
  69. package/dist/NavigationMenu/SignInNavButton.js +9 -122
  70. package/dist/NavigationMenu/utils.d.ts +465 -0
  71. package/dist/NavigationMenu/utils.js +112 -0
  72. package/dist/SetContainer/SetContainer.js +7 -108
  73. package/dist/SocialMediaBar/iconsRepository.js +0 -124
  74. package/dist/VideoTile/VideoTile.js +2 -106
  75. package/dist/VideoWrapper/index.js +7 -110
  76. package/dist/assets/Chatbot/ChatWindow.css +26 -0
  77. package/dist/assets/Forms/Forms.css +91 -94
  78. package/dist/assets/NavigationMenu/AxosBank/NavBar.css +125 -87
  79. package/dist/assets/incoming.mp3.js +4 -0
  80. package/dist/main.js +5 -1
  81. package/package.json +5 -3
@@ -1,133 +1,30 @@
1
1
  "use client";
2
2
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
- import { useState, useRef, useMemo, useEffect } from "react";
4
- import { AnimatePresence, motion } from "framer-motion";
5
- import { usePathname } from "next/navigation.js";
6
- import Link from "next/link.js";
7
- import { getMenuData, getLoginGroups, getQuickLinks } from "./MobileNavData.js";
8
- import styles from "./MobileMenu.module.js";
9
- import "../../../Chevron/Chevron.css.js";
10
- import "../../../Accordion/Accordion.js";
11
- import "../../../Accordion/Accordion.css.js";
3
+ import "../../../IconBillboard/IconBillboard.css.js";
12
4
  import "../../../icons/ArrowIcon/ArrowIcon.css.js";
13
5
  import "../../../icons/CheckIcon/CheckIcon.css.js";
14
- import '../../../assets/Modal/Modal.css';import '../../../assets/VideoWrapper/VideoWrapper.css';import '../../../assets/TopicalNavSet/TopicalNavSet.css';import '../../../assets/TopicalNavItem/TopicalNavItem.css';import '../../../assets/Topic/Topic.css';import '../../../assets/TextBlock/TextBlock.css';import '../../../assets/SocialMediaBar/SocialMediaBar.css';import '../../../assets/SecondaryFooter/SecondaryFooter.css';import '../../../assets/Pagination/Pagination.css';import '../../../assets/PageNavSet/PageNavigationSet.css';import '../../../assets/NavigationMenu/LaVictoire/NavBar2.css';import '../../../assets/NavigationMenu/AxosALTS/NavBar2.css';import '../../../assets/NavigationMenu/AxosClearing/NavBar2.css';import '../../../assets/NavigationMenu/AxosBank/SubNavbar.css';import '../../../assets/NavigationMenu/AxosBank/NavBar2.css';import '../../../assets/NavigationMenu/AxosAdvisorServices/SubNavbar.css';import '../../../assets/NavigationMenu/AxosAdvisorServices/NavBar2.css';import '../../../assets/NavigationMenu/AxosAdvisor/SubNavbar.css';import '../../../assets/NavigationMenu/AxosAdvisor/NavBar2.css';import '../../../assets/Insight/Featured/Header.css';import '../../../assets/Insight/Featured/CategorySelector.css';import '../../../assets/Insight/Featured/Featured.css';import '../../../assets/ImageLink/ImageLink.css';import '../../../assets/VideoTile/VideoTile.css';import '../../../assets/HelpArticle/HelpArticle.css';import '../../../assets/FooterSiteMap/AxosBank/FooterSiteMap.css';import '../../../assets/FooterDisclosure/LVF/LaVictorieFooter.css';import '../../../assets/DownloadTile/DownloadTile.css';import '../../../assets/CollectInformationAlert/CollectInformationAlert.css';import '../../../assets/Chatbot/ChatWindow.css';import '../../../assets/Chatbot/Chatbot.css';import '../../../assets/Chatbot/Bubble.css';import '../../../assets/Chatbot/AnimatedGradientBorder.css';import '../../../assets/CallToActionBar/CallToActionBar.css';import '../../../assets/Insight/Insight.css';import '../../../assets/AwardsItem/AwardsItem.css';import '../../../assets/AwardsBanner/AwardsBanner.css';import '../../../assets/Auth/SignIn.css';import '../../../assets/Auth/ErrorAlert.css';import '../../../assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css';import '../../../assets/Forms/QuickPricer/UserInformation.css';import '../../../assets/Forms/QuickPricer/QuickPricerResults.css';import '../../../assets/BulletItem/BulletItem.css';import '../../../assets/Typography/Typography.css';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 */
6
+ import '../../../assets/Modal/Modal.css';import '../../../assets/BulletItem/BulletItem.css';import '../../../assets/Typography/Typography.css';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 */
15
7
  /* empty css */
16
8
  /* empty css */
17
9
  /* empty css */
18
10
  /* empty css */
19
11
  /* empty css */
12
+ import { useRef, useReducer, useState, useEffect } from "react";
20
13
  import "clsx";
21
- import "../../../AlertBanner/AlertBanner.css.js";
22
- import "../../../Article/Article.css.js";
23
- import "../../../IconBillboard/IconBillboard.css.js";
24
14
  /* empty css */
25
15
  /* empty css */
16
+ import "../../../Chevron/Chevron.css.js";
26
17
  import "../../../Interstitial/Interstitial-variants.css.js";
27
18
  import "../../../Button/Button.css.js";
28
- import "react-use";
29
- import "../../../ArticlesSet/ArticlesSet.css.js";
30
- import "../../../Calculators/calculator.css.js";
31
- import "../../../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
32
- import { useGlobalContext } from "../../../Modal/contextApi/store.js";
33
- import "../../../Calculators/ApyCalculator/ApyCalculator.css.js";
34
- import "../../../Table/Table.css.js";
35
- import "../../../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
36
- import "../../../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
37
- import "@hookform/resolvers/zod";
38
- import "../../../Input/Checkbox.js";
39
- import "../../../Input/CurrencyInput.js";
40
- import "../../../Input/Dropdown.js";
41
- import "../../../Input/Dropdown.css.js";
42
- import "../../../Input/Input.js";
43
- import "../../../Input/Input.css.js";
44
- import "../../../Input/InputAmount.js";
45
- import "../../../Input/InputPhone.js";
46
- import "../../../Input/InputTextArea.js";
47
- import "../../../Input/DownPaymentInput.js";
48
- import "../../../Input/RadioButton.js";
49
- import "../../../Input/PercentageInput.js";
50
- import "react-hook-form";
51
- import "../../../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
52
- import "../../../Forms/Forms.css.js";
53
- import "../../../Forms/HoneyPot/index.js";
54
- import "../../../Forms/SalesforceFieldsForm.js";
55
- import "../../../Input/RadioButton.css.js";
56
- import "../../../Input/Checkbox.css.js";
57
- import "../../../LoadingIndicator/LoadingIndicator.css.js";
58
- import "../../../Inputs/Input.css.js";
59
- /* empty css */
60
- import "../../../Hyperlink/Hyperlink.css.js";
61
- /* empty css */
62
- import "iframe-resizer";
63
- /* empty css */
64
- import "../../../Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
65
- import "../../../Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.js";
66
- import "../../../Calculators/SummitApyCalculator/BalanceAPYCalculator.css.js";
67
- /* empty css */
68
- import "react-dom";
69
- /* empty css */
70
- import "../../../Auth/SignInPassword.js";
71
- /* empty css */
72
- /* empty css */
73
- /* empty css */
74
- /* empty css */
75
- import "../../../Carousel/index.js";
76
- /* empty css */
77
- /* empty css */
78
- import "../../../Chatbot/store/chat.js";
79
- import "../../../Chatbot/authenticate.js";
80
- /* empty css */
81
- /* empty css */
82
- import "../../../Chatbot/store/messages.js";
83
- /* empty css */
84
- import "../../../Comparison/Comparison.css.js";
85
- import "next/image.js";
86
- import "../../../HeroBanner/HeroBanner.css.js";
87
- import "../../../HeroBanner/LargeBanner.css.js";
88
- import "../../../HeroBanner/SelectionBanner.css.js";
89
- import "../../../SetContainer/SetContainer.css.js";
90
- import "../../../Tab/Tab.css.js";
91
- import "../../../icons/Star/Star.css.js";
92
- import "../../../ContentBanner/ContentBanner.css.js";
93
- /* empty css */
94
- import "../../../ExecutiveBio/ExecutiveBio.css.js";
95
- import "../../../FaqAccordion/index.js";
96
- import "../../../FooterDisclosure/FooterDisclosure.css.js";
97
- /* empty css */
98
- /* empty css */
99
- /* empty css */
100
- import "../../../ImageBillboard/ImageBillboard.css.js";
101
- import "next/script.js";
102
- /* empty css */
103
- /* empty css */
104
- /* empty css */
105
- /* empty css */
106
- /* empty css */
107
- import "../../../LandingPageHeader/LandingPageHeader.css.js";
108
- /* empty css */
109
- /* empty css */
110
- /* empty css */
111
- /* empty css */
112
- /* empty css */
113
- /* empty css */
114
- /* empty css */
115
- /* empty css */
116
- /* empty css */
117
- import "../../../PageNavItem/PageNavItem.css.js";
118
- import "react-slick";
119
- /* empty css */
120
- /* empty css */
121
- /* empty css */
122
- /* empty css */
123
- import "../../../StepItem/StepItem.css.js";
124
- import "../../../StepItemSet/StepItemSet.css.js";
125
- /* empty css */
126
- /* empty css */
127
- /* empty css */
128
- /* empty css */
129
- /* empty css */
19
+ import { useClickAway } from "react-use";
130
20
  /* empty css */
21
+ import { useGlobalContext } from "../../../Modal/contextApi/store.js";
22
+ import { AnimatePresence, motion } from "framer-motion";
23
+ import Link from "next/link.js";
24
+ import { usePathname } from "next/navigation.js";
25
+ import styles from "./MobileMenu.module.js";
26
+ import { mobileData } from "./MobileNavData.js";
27
+ import { MenuActions, reducer } from "./mobileReducer.js";
131
28
  const slideVariants = {
132
29
  enter: (direction) => ({
133
30
  x: direction === "forward" ? "100%" : "-100%",
@@ -146,30 +43,43 @@ const slideVariants = {
146
43
  position: "absolute"
147
44
  })
148
45
  };
149
- const MobileDrawerMenu = () => {
150
- const pathname = usePathname();
46
+ const initialState = {
47
+ direction: "forward",
48
+ isMobileMenuOpen: false,
49
+ hasOpenedOnce: false,
50
+ prevLevel: [],
51
+ currentMenuData: null,
52
+ stack: [],
53
+ loginDrawer: false,
54
+ loginData: {}
55
+ };
56
+ const MobileDrawerMenu = ({ menu }) => {
151
57
  const { resolveUrl } = useGlobalContext();
152
- const menuData = getMenuData(resolveUrl);
153
- const [queryString, setQueryString] = useState("");
154
- const [open, setOpen] = useState(false);
155
- const [stack, setStack] = useState([
156
- { title: "Main Menu", items: menuData }
157
- ]);
158
- const [hasOpenedOnce, setHasOpenedOnce] = useState(false);
159
- const [direction, setDirection] = useState("forward");
160
- const [quickLinks, setQuickLinks] = useState([]);
161
- const [loginDrawerOpen, setLoginDrawerOpen] = useState(false);
58
+ const pathname = usePathname();
162
59
  const drawerRef = useRef(null);
163
- const loginDrawerRef = useRef(null);
164
- const loginGroups = useMemo(() => getLoginGroups(resolveUrl), [resolveUrl]);
165
- const currentLevel = stack[stack.length - 1];
166
- const prevLevel = stack[stack.length - 2];
60
+ const loginRef = useRef(null);
61
+ useClickAway(drawerRef, () => {
62
+ dispatch({ type: MenuActions.SET_MOBILE_MENU_CLOSED, payload: {} });
63
+ });
64
+ useClickAway(loginRef, () => {
65
+ dispatch({ type: MenuActions.SET_LOGIN_MENU_CLOSED, payload: {} });
66
+ });
67
+ const [queryString, setQueryString] = useState("");
68
+ const [stack, dispatch] = useReducer(reducer, initialState);
69
+ useEffect(() => {
70
+ const menuProcessed = mobileData(menu);
71
+ dispatch({
72
+ type: MenuActions.INIT,
73
+ payload: {
74
+ currentMenuData: menuProcessed,
75
+ stack: [{ title: "Menu", items: menuProcessed }],
76
+ quickLinks: menu?.quickLinks
77
+ }
78
+ });
79
+ }, [menu]);
167
80
  useEffect(() => {
168
81
  if (!pathname) return;
169
- const pathnameParts = "/" + pathname.split("/")[1];
170
- const links = getQuickLinks(pathnameParts, resolveUrl);
171
- setQuickLinks(links);
172
- }, [pathname, resolveUrl]);
82
+ }, [pathname]);
173
83
  useEffect(() => {
174
84
  if (typeof window !== "undefined") {
175
85
  const search = window.location.search;
@@ -179,71 +89,33 @@ const MobileDrawerMenu = () => {
179
89
  }
180
90
  }, []);
181
91
  const handleClick = (key) => {
182
- const item = currentLevel.items[key];
183
- if (typeof item === "object") {
184
- setDirection("forward");
185
- setStack((prev) => [...prev, { title: key, items: item }]);
186
- }
92
+ dispatch({ type: MenuActions.ADD_TO_STACK, payload: key });
187
93
  };
188
94
  const handleBack = () => {
189
- if (stack.length > 1) {
190
- setDirection("backward");
191
- setStack((prev) => prev.slice(0, -1));
95
+ if (stack.stack.length > 1) {
96
+ dispatch({ type: MenuActions.REMOVE_FROM_STACK, payload: {} });
192
97
  }
193
98
  };
194
99
  const handleToggle = () => {
195
- setOpen((prev) => {
196
- const isOpening = !prev;
197
- if (isOpening && !hasOpenedOnce) {
198
- setHasOpenedOnce(true);
199
- setStack([{ title: "Menu", items: menuData }]);
200
- }
201
- return isOpening;
202
- });
100
+ dispatch({ type: MenuActions.SET_HAS_OPENED_ONCE, payload: {} });
101
+ dispatch({ type: MenuActions.SET_MOBILE_MENU_OPEN, payload: {} });
203
102
  };
204
- const handleLoginDrawerOpen = () => setLoginDrawerOpen(true);
205
- const handleLoginDrawerClose = () => setLoginDrawerOpen(false);
206
- const handleLoginDrawerOutsideClick = (e) => {
207
- if (loginDrawerRef.current && !loginDrawerRef.current.contains(e.target)) {
208
- setLoginDrawerOpen(false);
209
- }
103
+ const handleLoginDrawerOpen = () => {
104
+ dispatch({ type: MenuActions.SET_LOGIN_MENU_OPEN, payload: {} });
210
105
  };
211
- const handleOutsideClick = (e) => {
212
- if (drawerRef.current && !drawerRef.current.contains(e.target)) {
213
- setOpen(false);
214
- }
106
+ const handleLoginDrawerClose = () => {
107
+ dispatch({ type: MenuActions.SET_LOGIN_MENU_CLOSED, payload: {} });
215
108
  };
216
- useEffect(() => {
217
- if (open) {
218
- document.addEventListener("mousedown", handleOutsideClick);
219
- } else {
220
- document.removeEventListener("mousedown", handleOutsideClick);
221
- }
222
- return () => document.removeEventListener("mousedown", handleOutsideClick);
223
- }, [open]);
224
109
  useEffect(() => {
225
110
  const onEsc = (e) => {
226
- if (e.key === "Escape") setOpen(false);
111
+ if (e.key === "Escape")
112
+ dispatch({ type: MenuActions.SET_MOBILE_MENU_CLOSED, payload: {} });
227
113
  };
228
- if (open) {
114
+ if (stack.isMobileMenuOpen) {
229
115
  document.addEventListener("keydown", onEsc);
230
116
  }
231
117
  return () => document.removeEventListener("keydown", onEsc);
232
- }, [open]);
233
- useEffect(() => {
234
- if (!loginDrawerOpen) return;
235
- document.addEventListener("mousedown", handleLoginDrawerOutsideClick);
236
- return () => document.removeEventListener("mousedown", handleLoginDrawerOutsideClick);
237
- }, [loginDrawerOpen]);
238
- useEffect(() => {
239
- const onEsc = (e) => {
240
- if (e.key === "Escape") setLoginDrawerOpen(false);
241
- };
242
- if (loginDrawerOpen) {
243
- document.addEventListener("keydown", onEsc);
244
- }
245
- return () => document.removeEventListener("keydown", onEsc);
246
- }, [loginDrawerOpen]);
118
+ }, [stack.isMobileMenuOpen]);
247
119
  return /* @__PURE__ */ jsxs(Fragment, { children: [
248
120
  /* @__PURE__ */ jsxs("div", { className: styles.mobileNavRow, children: [
249
121
  /* @__PURE__ */ jsx(
@@ -285,7 +157,7 @@ const MobileDrawerMenu = () => {
285
157
  }
286
158
  )
287
159
  ] }),
288
- /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(
160
+ /* @__PURE__ */ jsx(AnimatePresence, { children: stack.isMobileMenuOpen && /* @__PURE__ */ jsx(
289
161
  motion.div,
290
162
  {
291
163
  className: styles.overlay,
@@ -308,7 +180,7 @@ const MobileDrawerMenu = () => {
308
180
  children: [
309
181
  /* @__PURE__ */ jsx("p", { id: "menu-description", className: styles.sr_only, children: "Use tab to navigate this menu. Press Escape to close." }),
310
182
  /* @__PURE__ */ jsxs("div", { className: styles.header, children: [
311
- stack.length > 1 ? /* @__PURE__ */ jsxs(
183
+ stack.stack?.length > 1 ? /* @__PURE__ */ jsxs(
312
184
  "button",
313
185
  {
314
186
  onClick: handleBack,
@@ -333,7 +205,7 @@ const MobileDrawerMenu = () => {
333
205
  )
334
206
  }
335
207
  ),
336
- /* @__PURE__ */ jsx("span", { className: styles.prevlevel, children: prevLevel.title })
208
+ /* @__PURE__ */ jsx("span", { className: styles.prevlevel, children: stack.prevLevel?.title })
337
209
  ]
338
210
  }
339
211
  ) : /* @__PURE__ */ jsx(
@@ -386,7 +258,7 @@ const MobileDrawerMenu = () => {
386
258
  className: `${styles.level} flex middle`,
387
259
  "aria-label": "current menu level",
388
260
  children: [
389
- /* @__PURE__ */ jsx("h2", { className: styles.levelTitle, id: "menu-level", children: currentLevel.title }),
261
+ /* @__PURE__ */ jsx("h2", { className: styles.levelTitle, id: "menu-level", children: stack.currentMenuData?.title }),
390
262
  /* @__PURE__ */ jsx(
391
263
  "svg",
392
264
  {
@@ -411,75 +283,81 @@ const MobileDrawerMenu = () => {
411
283
  /* @__PURE__ */ jsx("nav", { "aria-label": "main navigation menu", children: /* @__PURE__ */ jsx(
412
284
  AnimatePresence,
413
285
  {
414
- custom: direction,
286
+ custom: stack.direction,
415
287
  mode: "sync",
416
288
  initial: false,
417
- children: /* @__PURE__ */ jsx(
289
+ children: /* @__PURE__ */ jsxs(
418
290
  motion.ul,
419
291
  {
420
292
  className: styles.menu,
421
- custom: direction,
293
+ custom: stack.direction,
422
294
  variants: slideVariants,
423
295
  initial: "enter",
424
296
  animate: "center",
425
297
  exit: "exit",
426
298
  transition: { duration: 0.3, ease: "linear" },
427
- children: Object.entries(
428
- stack.length === 1 ? Object.fromEntries(
429
- Object.entries(currentLevel.items).filter(
430
- ([k]) => k !== "Log in"
431
- )
432
- ) : currentLevel.items
433
- ).map(([key, value]) => {
434
- const hasChildren = typeof value === "object";
435
- return /* @__PURE__ */ jsx("li", { children: hasChildren ? /* @__PURE__ */ jsxs(
436
- "button",
437
- {
438
- className: styles.menuItem,
439
- onClick: () => handleClick(key),
440
- "aria-label": `open submenu for ${key}`,
441
- children: [
442
- /* @__PURE__ */ jsx("span", { children: key }),
443
- /* @__PURE__ */ jsx("span", { className: styles.chevron, children: /* @__PURE__ */ jsx(
444
- "svg",
445
- {
446
- className: styles.chevronIcon,
447
- width: 12,
448
- height: 20,
449
- viewBox: "0 0 12 20",
450
- fill: "none",
451
- xmlns: "http://www.w3.org/2000/svg",
452
- children: /* @__PURE__ */ jsx(
453
- "path",
454
- {
455
- d: "M1.76378 0.46875L11.2941 9.99908L1.76378 19.5294L0.703125 18.4687L9.17295 9.99908L0.703125 1.52941L1.76378 0.46875Z",
456
- fill: "#4A5560"
457
- }
458
- )
459
- }
460
- ) })
461
- ]
462
- }
463
- ) : /* @__PURE__ */ jsx(
299
+ children: [
300
+ stack.stack.length > 1 && !stack.currentMenuData?.dropdown && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
464
301
  Link,
465
302
  {
466
- href: `${value}${queryString && !value.includes("?") ? `?${queryString}` : ""}`,
303
+ href: stack.currentMenuData.url + (queryString && !stack.currentMenuData.url.includes("?") ? `?${queryString}` : ""),
467
304
  className: styles.menuItem,
468
- children: /* @__PURE__ */ jsx("span", { children: key })
305
+ children: /* @__PURE__ */ jsxs("span", { children: [
306
+ stack.currentMenuData.title,
307
+ " Home"
308
+ ] })
469
309
  }
470
- ) }, key);
471
- })
310
+ ) }),
311
+ stack?.currentMenuData?.items?.map((item) => {
312
+ const hasChildren = item.items && item.items.length > 0;
313
+ return hasChildren ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
314
+ "button",
315
+ {
316
+ className: styles.menuItem,
317
+ onClick: () => handleClick(item),
318
+ children: [
319
+ /* @__PURE__ */ jsx("span", { children: item.label }),
320
+ /* @__PURE__ */ jsx("span", { className: styles.chevron, children: /* @__PURE__ */ jsx(
321
+ "svg",
322
+ {
323
+ className: styles.chevronIcon,
324
+ width: 12,
325
+ height: 20,
326
+ viewBox: "0 0 12 20",
327
+ fill: "none",
328
+ xmlns: "http://www.w3.org/2000/svg",
329
+ children: /* @__PURE__ */ jsx(
330
+ "path",
331
+ {
332
+ d: "M1.76378 0.46875L11.2941 9.99908L1.76378 19.5294L0.703125 18.4687L9.17295 9.99908L0.703125 1.52941L1.76378 0.46875Z",
333
+ fill: "#4A5560"
334
+ }
335
+ )
336
+ }
337
+ ) })
338
+ ]
339
+ }
340
+ ) }, item.id + "1") : /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
341
+ Link,
342
+ {
343
+ href: item?.url + (queryString && !item?.url?.includes("?") ? `?${queryString}` : ""),
344
+ className: styles.menuItem,
345
+ children: /* @__PURE__ */ jsx("span", { children: item.label })
346
+ }
347
+ ) }, item.id);
348
+ })
349
+ ]
472
350
  },
473
- currentLevel.title
351
+ stack.currentMenuData?.title
474
352
  )
475
353
  }
476
354
  ) }),
477
- /* @__PURE__ */ jsx("div", { className: `${styles.quickLinks} flex middle between`, children: quickLinks.map((link) => /* @__PURE__ */ jsxs(
355
+ /* @__PURE__ */ jsx("div", { className: `${styles.quickLinks} flex middle between`, children: stack.quickLinks?.map((link) => /* @__PURE__ */ jsxs(
478
356
  "a",
479
357
  {
480
- href: link.url + (queryString && !link.url.includes("?") ? `?${queryString}` : ""),
358
+ href: resolveUrl(link.url) + (queryString && !link.url.includes("?") ? `?${queryString}` : ""),
481
359
  className: `${styles.quickLink} flex_col middle`,
482
- "aria-label": `Visit ${link.title} page`,
360
+ "aria-label": link.ariaLabel,
483
361
  children: [
484
362
  /* @__PURE__ */ jsx(
485
363
  "img",
@@ -491,10 +369,10 @@ const MobileDrawerMenu = () => {
491
369
  loading: "lazy"
492
370
  }
493
371
  ),
494
- /* @__PURE__ */ jsx("span", { children: link.title })
372
+ /* @__PURE__ */ jsx("span", { children: link.label })
495
373
  ]
496
374
  },
497
- link.title
375
+ link.id
498
376
  )) })
499
377
  ] }) })
500
378
  ]
@@ -502,7 +380,7 @@ const MobileDrawerMenu = () => {
502
380
  )
503
381
  }
504
382
  ) }),
505
- /* @__PURE__ */ jsx(AnimatePresence, { children: loginDrawerOpen && /* @__PURE__ */ jsx(
383
+ /* @__PURE__ */ jsx(AnimatePresence, { children: stack.loginDrawer && /* @__PURE__ */ jsx(
506
384
  motion.div,
507
385
  {
508
386
  className: styles.overlay,
@@ -513,7 +391,7 @@ const MobileDrawerMenu = () => {
513
391
  motion.div,
514
392
  {
515
393
  className: `${styles.drawer} flex_col`,
516
- ref: loginDrawerRef,
394
+ ref: loginRef,
517
395
  initial: { x: "100%" },
518
396
  animate: { x: 0 },
519
397
  exit: { x: "100%" },
@@ -568,37 +446,74 @@ const MobileDrawerMenu = () => {
568
446
  }
569
447
  )
570
448
  ] }),
571
- /* @__PURE__ */ jsx("div", { className: styles.loginDrawerContent, children: /* @__PURE__ */ jsx("div", { className: styles.loginAccordion, children: /* @__PURE__ */ jsx(
449
+ /* @__PURE__ */ jsx("div", { className: styles.loginDrawerContent, children: /* @__PURE__ */ jsx("div", { className: styles.loginAccordion, children: /* @__PURE__ */ jsxs(
572
450
  "ul",
573
451
  {
574
452
  className: styles.loginAccordionList,
575
453
  "aria-label": "Login options",
576
- children: loginGroups.map((group) => /* @__PURE__ */ jsxs(
577
- "li",
578
- {
579
- className: styles.loginAccordionGroup,
580
- "aria-label": `${group.heading} login options`,
581
- children: [
582
- /* @__PURE__ */ jsx("span", { className: styles.loginAccordionHeading, children: group.heading }),
583
- /* @__PURE__ */ jsx("ul", { className: styles.loginAccordionGroupList, children: group.items.map((item) => /* @__PURE__ */ jsx(
584
- "li",
585
- {
586
- "aria-label": `access ${item.title}`,
587
- children: /* @__PURE__ */ jsx(
588
- Link,
454
+ children: [
455
+ stack.loginData?.items?.filter((item) => item.items)?.map((group) => {
456
+ return /* @__PURE__ */ jsxs(
457
+ "li",
458
+ {
459
+ className: styles.loginAccordionGroup,
460
+ "aria-label": `${group?.label} login options`,
461
+ children: [
462
+ /* @__PURE__ */ jsx("span", { className: styles.loginAccordionHeading, children: group.label }),
463
+ /* @__PURE__ */ jsx("ul", { className: styles.loginAccordionGroupList, children: group.items?.map((item) => /* @__PURE__ */ jsx(
464
+ "li",
589
465
  {
590
- href: item.url + (queryString && !item.url.includes("?") ? `?${queryString}` : ""),
591
- className: styles.menuItem,
592
- children: /* @__PURE__ */ jsx("span", { children: item.title })
593
- }
594
- )
595
- },
596
- item.title
597
- )) })
598
- ]
599
- },
600
- group.heading
601
- ))
466
+ "aria-label": `access ${item.label}`,
467
+ children: /* @__PURE__ */ jsx(
468
+ "a",
469
+ {
470
+ href: item.url + (queryString && !item.url.includes("?") ? `?${queryString}` : ""),
471
+ className: styles.menuItem,
472
+ children: /* @__PURE__ */ jsx("span", { children: item.label })
473
+ }
474
+ )
475
+ },
476
+ item.id
477
+ )) })
478
+ ]
479
+ },
480
+ group?.id
481
+ );
482
+ }),
483
+ /* @__PURE__ */ jsxs(
484
+ "li",
485
+ {
486
+ className: styles.loginAccordionGroup,
487
+ children: [
488
+ /* @__PURE__ */ jsx("span", { className: styles.loginAccordionHeading }),
489
+ stack.loginData?.items.filter((item) => !item.items).map((group) => {
490
+ return /* @__PURE__ */ jsx(
491
+ "ul",
492
+ {
493
+ className: styles.loginAccordionGroupList,
494
+ children: /* @__PURE__ */ jsx(
495
+ "li",
496
+ {
497
+ "aria-label": `access ${group.label}`,
498
+ children: /* @__PURE__ */ jsx(
499
+ "a",
500
+ {
501
+ href: group.url + (queryString && !group.url.includes("?") ? `?${queryString}` : ""),
502
+ className: styles.menuItem,
503
+ children: /* @__PURE__ */ jsx("span", { children: group.label })
504
+ }
505
+ )
506
+ },
507
+ group.id
508
+ )
509
+ },
510
+ group.id
511
+ );
512
+ })
513
+ ]
514
+ }
515
+ )
516
+ ]
602
517
  }
603
518
  ) }) })
604
519
  ]