@anker-in/headless-ui 1.0.20 → 1.0.22

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 (126) hide show
  1. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  2. package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
  3. package/dist/cjs/biz-components/FooterNavigation/types.d.ts +2 -1
  4. package/dist/cjs/biz-components/FooterNavigation/types.js +1 -1
  5. package/dist/cjs/biz-components/FooterNavigation/types.js.map +2 -2
  6. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +8 -5
  7. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
  8. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
  9. package/dist/cjs/biz-components/HeaderNavigation/icons/Menu.js +1 -1
  10. package/dist/cjs/biz-components/HeaderNavigation/icons/Menu.js.map +2 -2
  11. package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.d.ts +3 -0
  12. package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js +2 -0
  13. package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js.map +7 -0
  14. package/dist/cjs/biz-components/HeaderNavigation/icons/index.d.ts +2 -1
  15. package/dist/cjs/biz-components/HeaderNavigation/icons/index.js +1 -1
  16. package/dist/cjs/biz-components/HeaderNavigation/icons/index.js.map +3 -3
  17. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  18. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  19. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +26 -2
  20. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  21. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
  22. package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
  23. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
  24. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  25. package/dist/cjs/biz-components/NavigationSearch/index.d.ts +4 -0
  26. package/dist/cjs/biz-components/NavigationSearch/index.js +11 -0
  27. package/dist/cjs/biz-components/NavigationSearch/index.js.map +7 -0
  28. package/dist/cjs/biz-components/NavigationSearch/types.d.ts +18 -0
  29. package/dist/cjs/biz-components/NavigationSearch/types.js +2 -0
  30. package/dist/cjs/biz-components/NavigationSearch/types.js.map +7 -0
  31. package/dist/cjs/biz-components/SearchPage/index.d.ts +6 -0
  32. package/dist/cjs/biz-components/SearchPage/index.js +2 -0
  33. package/dist/cjs/biz-components/SearchPage/index.js.map +7 -0
  34. package/dist/cjs/biz-components/SearchPage/types.d.ts +58 -0
  35. package/dist/cjs/biz-components/SearchPage/types.js +2 -0
  36. package/dist/cjs/biz-components/SearchPage/types.js.map +7 -0
  37. package/dist/cjs/biz-components/Subscribe/index.d.ts +7 -1
  38. package/dist/cjs/biz-components/Subscribe/index.js +10 -1
  39. package/dist/cjs/biz-components/Subscribe/index.js.map +3 -3
  40. package/dist/cjs/biz-components/index.d.ts +3 -0
  41. package/dist/cjs/biz-components/index.js +1 -1
  42. package/dist/cjs/biz-components/index.js.map +3 -3
  43. package/dist/cjs/components/container.js +1 -1
  44. package/dist/cjs/components/container.js.map +2 -2
  45. package/dist/cjs/components/dialog.d.ts +3 -1
  46. package/dist/cjs/components/dialog.js +1 -1
  47. package/dist/cjs/components/dialog.js.map +3 -3
  48. package/dist/cjs/components/index.d.ts +1 -0
  49. package/dist/cjs/components/index.js +1 -1
  50. package/dist/cjs/components/index.js.map +3 -3
  51. package/dist/cjs/components/loadingDots.d.ts +6 -0
  52. package/dist/cjs/components/loadingDots.js +42 -0
  53. package/dist/cjs/components/loadingDots.js.map +7 -0
  54. package/dist/cjs/components/picture.d.ts +1 -0
  55. package/dist/cjs/components/picture.js +1 -1
  56. package/dist/cjs/components/picture.js.map +3 -3
  57. package/dist/cjs/helpers/utils.d.ts +1 -0
  58. package/dist/cjs/helpers/utils.js +1 -1
  59. package/dist/cjs/helpers/utils.js.map +3 -3
  60. package/dist/cjs/stories/picture.stories.d.ts +4 -0
  61. package/dist/cjs/stories/picture.stories.js +8 -3
  62. package/dist/cjs/stories/picture.stories.js.map +3 -3
  63. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  64. package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
  65. package/dist/esm/biz-components/FooterNavigation/types.d.ts +2 -1
  66. package/dist/esm/biz-components/FooterNavigation/types.js +1 -1
  67. package/dist/esm/biz-components/FooterNavigation/types.js.map +2 -2
  68. package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +8 -5
  69. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
  70. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
  71. package/dist/esm/biz-components/HeaderNavigation/icons/Menu.js +1 -1
  72. package/dist/esm/biz-components/HeaderNavigation/icons/Menu.js.map +2 -2
  73. package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.d.ts +3 -0
  74. package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js +2 -0
  75. package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js.map +7 -0
  76. package/dist/esm/biz-components/HeaderNavigation/icons/index.d.ts +2 -1
  77. package/dist/esm/biz-components/HeaderNavigation/icons/index.js +1 -1
  78. package/dist/esm/biz-components/HeaderNavigation/icons/index.js.map +3 -3
  79. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  80. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  81. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +26 -2
  82. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  83. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  84. package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
  85. package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
  86. package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  87. package/dist/esm/biz-components/NavigationSearch/index.d.ts +4 -0
  88. package/dist/esm/biz-components/NavigationSearch/index.js +11 -0
  89. package/dist/esm/biz-components/NavigationSearch/index.js.map +7 -0
  90. package/dist/esm/biz-components/NavigationSearch/types.d.ts +18 -0
  91. package/dist/esm/biz-components/NavigationSearch/types.js +2 -0
  92. package/dist/esm/biz-components/NavigationSearch/types.js.map +7 -0
  93. package/dist/esm/biz-components/SearchPage/index.d.ts +6 -0
  94. package/dist/esm/biz-components/SearchPage/index.js +2 -0
  95. package/dist/esm/biz-components/SearchPage/index.js.map +7 -0
  96. package/dist/esm/biz-components/SearchPage/types.d.ts +58 -0
  97. package/dist/esm/biz-components/SearchPage/types.js +2 -0
  98. package/dist/esm/biz-components/SearchPage/types.js.map +7 -0
  99. package/dist/esm/biz-components/Subscribe/index.d.ts +7 -1
  100. package/dist/esm/biz-components/Subscribe/index.js +10 -1
  101. package/dist/esm/biz-components/Subscribe/index.js.map +3 -3
  102. package/dist/esm/biz-components/index.d.ts +3 -0
  103. package/dist/esm/biz-components/index.js +1 -1
  104. package/dist/esm/biz-components/index.js.map +3 -3
  105. package/dist/esm/components/container.js +1 -1
  106. package/dist/esm/components/container.js.map +2 -2
  107. package/dist/esm/components/dialog.d.ts +3 -1
  108. package/dist/esm/components/dialog.js +1 -1
  109. package/dist/esm/components/dialog.js.map +3 -3
  110. package/dist/esm/components/index.d.ts +1 -0
  111. package/dist/esm/components/index.js +1 -1
  112. package/dist/esm/components/index.js.map +2 -2
  113. package/dist/esm/components/loadingDots.d.ts +6 -0
  114. package/dist/esm/components/loadingDots.js +42 -0
  115. package/dist/esm/components/loadingDots.js.map +7 -0
  116. package/dist/esm/components/picture.d.ts +1 -0
  117. package/dist/esm/components/picture.js +1 -1
  118. package/dist/esm/components/picture.js.map +3 -3
  119. package/dist/esm/helpers/utils.d.ts +1 -0
  120. package/dist/esm/helpers/utils.js +1 -1
  121. package/dist/esm/helpers/utils.js.map +3 -3
  122. package/dist/esm/stories/picture.stories.d.ts +4 -0
  123. package/dist/esm/stories/picture.stories.js +8 -3
  124. package/dist/esm/stories/picture.stories.js.map +3 -3
  125. package/package.json +1 -1
  126. package/style.css +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/FooterNavigation/types.ts"],
4
- "sourcesContent": ["export interface FooterNavigationProps {\n data: any\n event?: {\n signup?: () => void\n download?: () => void\n country?: () => void\n }\n}\n\nexport enum FooterNavigationBlockType {\n Signup = 'ipc-footer-signup',\n Main = 'ipc-footer-main',\n Brand = 'ipc-footer-brand',\n}\n"],
5
- "mappings": "AASO,IAAKA,OACVA,EAAA,OAAS,oBACTA,EAAA,KAAO,kBACPA,EAAA,MAAQ,mBAHEA,OAAA",
4
+ "sourcesContent": ["export interface FooterNavigationProps {\n data: any\n currentCountry?: any\n event?: {\n signup?: (params: any) => void\n download?: () => void\n country?: () => void\n }\n}\n\nexport enum FooterNavigationBlockType {\n Signup = 'ipc-footer-signup',\n Main = 'ipc-footer-main',\n Brand = 'ipc-footer-brand',\n}\n"],
5
+ "mappings": "AAUO,IAAKA,OACVA,EAAA,OAAS,oBACTA,EAAA,KAAO,kBACPA,EAAA,MAAQ,mBAHEA,OAAA",
6
6
  "names": ["FooterNavigationBlockType"]
7
7
  }
@@ -4,7 +4,8 @@ import { HeaderNavigationMenu } from './types.js';
4
4
  import type { UserProfile } from './types.js';
5
5
  interface NavContextType {
6
6
  buildProps: {
7
- products: Product[];
7
+ products?: Product[];
8
+ categories?: Record<string, any>;
8
9
  };
9
10
  event?: {
10
11
  search?: () => void;
@@ -19,10 +20,12 @@ interface NavContextType {
19
20
  payloadData: any;
20
21
  currentMenu?: HeaderNavigationMenu;
21
22
  setCurrentMenu?: (menu: HeaderNavigationMenu) => void;
22
- thirdNavTitle?: string;
23
- setThirdNavTitle?: (title: string) => void;
24
- matchSeriesMetadata?: any;
25
- setMatchSeriesMetadata?: (metadata: any) => void;
23
+ currentSeriesMetadata?: any;
24
+ setCurrentSeriesMetadata?: (metadata: any) => void;
25
+ subSubCategory?: any;
26
+ setSubSubCategory?: (category: any) => void;
27
+ onSeriesProductClick?: (seriesProduct: any, position: number, seriesLabel?: string) => void;
28
+ onSidebarNavClick?: (series: any, index: number, subSubindex?: number) => void;
26
29
  }
27
30
  export declare const NavContext: React.Context<NavContextType>;
28
31
  export declare const useNavContext: () => NavContextType;
@@ -1,2 +1,2 @@
1
- import{jsx as C}from"react/jsx-runtime";import{createContext as l,useCallback as n,useContext as v,useMemo as M,useReducer as N}from"react";import{HeaderNavigationMenu as c}from"./types.js";const T={isMobile:!1,payloadData:{},buildProps:{products:[]},currentMenu:c.Primary,setCurrentMenu:()=>{},thirdNavTitle:"",setThirdNavTitle:()=>{},matchSeriesMetadata:{},setMatchSeriesMetadata:()=>{}},o=l(T),h=()=>{if(!v(o))throw new Error("useNavContext must be used in <NavProvider>");return v(o)},E=(e,t)=>{switch(t.type){case"SET_CURRENT_MENU":return{...e,currentMenu:t.value};case"SET_THIRD_NAV_TITLE":return{...e,thirdNavTitle:t.value};case"SET_MATCH_SERIES_METADATA":return{...e,matchSeriesMetadata:t.value}}},y=({children:e,...t})=>{const[i,r]=N(E,{...T,currentMenu:c.Primary,setCurrentMenu:()=>{}}),s=n(a=>r({type:"SET_CURRENT_MENU",value:a}),[r]),u=n(a=>r({type:"SET_THIRD_NAV_TITLE",value:a}),[r]),d=n(a=>r({type:"SET_MATCH_SERIES_METADATA",value:a}),[r]),p=M(()=>({...i,setCurrentMenu:s,setThirdNavTitle:u,setMatchSeriesMetadata:d}),[s,u,d,i]);return C(o.Provider,{value:{...p,...t},children:e})};var A=y;export{o as NavContext,A as default,h as useNavContext};
1
+ import{jsx as M}from"react/jsx-runtime";import{createContext as p,useCallback as o,useContext as d,useMemo as C,useReducer as l}from"react";import{HeaderNavigationMenu as v}from"./types.js";const y={isMobile:!1,payloadData:{},buildProps:{products:[],categories:{}},currentMenu:v.Primary,setCurrentMenu:()=>{},currentSeriesMetadata:{},setCurrentSeriesMetadata:()=>{},onSeriesProductClick:(e,t,n)=>{},onSidebarNavClick:e=>{}},i=p(y),R=()=>{if(!d(i))throw new Error("useNavContext must be used in <NavProvider>");return d(i)},E=(e,t)=>{switch(t.type){case"SET_CURRENT_MENU":return{...e,currentMenu:t.value};case"SET_CURRENT_SERIES_METADATA":return{...e,currentSeriesMetadata:t.value};case"SET_SUB_SUB_CATEGORY":return{...e,subSubCategory:t.value}}},T=({children:e,...t})=>{const[n,r]=l(E,{...y,currentMenu:v.Primary,setCurrentMenu:()=>{}}),u=o(a=>r({type:"SET_CURRENT_MENU",value:a}),[r]),s=o(a=>r({type:"SET_CURRENT_SERIES_METADATA",value:a}),[r]),c=o(a=>r({type:"SET_SUB_SUB_CATEGORY",value:a}),[r]),S=C(()=>({...n,setCurrentMenu:u,setCurrentSeriesMetadata:s,setSubSubCategory:c}),[u,s,c,n]);return M(i.Provider,{value:{...S,...t},children:e})};var m=T;export{i as NavContext,m as default,R as useNavContext};
2
2
  //# sourceMappingURL=NavProvider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/NavProvider.tsx"],
4
- "sourcesContent": ["import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport type { UserProfile } from './types.js'\n\ninterface NavContextType {\n buildProps: {\n products: Product[] // \u4EA7\u54C1\u6570\u636E\n }\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n isMobile?: boolean\n payloadData: any\n currentMenu?: HeaderNavigationMenu // \u5F53\u524D\u83DC\u5355\n setCurrentMenu?: (menu: HeaderNavigationMenu) => void // \u8BBE\u7F6E\u5F53\u524D\u83DC\u5355\n thirdNavTitle?: string // \u7B2C\u4E09\u7EA7\u5BFC\u822A\u6807\u9898\n setThirdNavTitle?: (title: string) => void // \u8BBE\u7F6E\u7B2C\u4E09\u7EA7\u5BFC\u822A\u6807\u9898\n matchSeriesMetadata?: any // \u5339\u914D\u7684\u7CFB\u5217\u5143\u6570\u636E\n setMatchSeriesMetadata?: (metadata: any) => void // \u8BBE\u7F6E\u5339\u914D\u7684\u7CFB\u5217\u5143\u6570\u636E\n}\n\nconst initialState: NavContextType = {\n isMobile: false,\n payloadData: {},\n buildProps: {\n products: [],\n },\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n thirdNavTitle: '',\n setThirdNavTitle: () => {},\n matchSeriesMetadata: {},\n setMatchSeriesMetadata: () => {},\n}\n\ntype Action =\n | {\n type: 'SET_CURRENT_MENU'\n value: HeaderNavigationMenu\n }\n | {\n type: 'SET_THIRD_NAV_TITLE'\n value: string\n }\n | {\n type: 'SET_MATCH_SERIES_METADATA'\n value: any\n }\n\nexport const NavContext = createContext<NavContextType>(initialState)\n\nexport const useNavContext = () => {\n const context = useContext(NavContext)\n if (!context) {\n throw new Error('useNavContext must be used in <NavProvider>')\n }\n return useContext(NavContext)\n}\n\nconst reducer = (state: NavContextType, action: Action) => {\n switch (action.type) {\n case 'SET_CURRENT_MENU': {\n return {\n ...state,\n currentMenu: action.value,\n }\n }\n case 'SET_THIRD_NAV_TITLE': {\n return {\n ...state,\n thirdNavTitle: action.value,\n }\n }\n case 'SET_MATCH_SERIES_METADATA': {\n return {\n ...state,\n matchSeriesMetadata: action.value,\n }\n }\n }\n}\n\nconst NavProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & NavContextType) => {\n const [state, dispatch] = useReducer(reducer, {\n ...initialState,\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n })\n\n const setCurrentMenu = useCallback(\n (value: HeaderNavigationMenu) => {\n return dispatch({ type: 'SET_CURRENT_MENU', value })\n },\n [dispatch]\n )\n\n const setThirdNavTitle = useCallback(\n (value: string) => {\n return dispatch({ type: 'SET_THIRD_NAV_TITLE', value })\n },\n [dispatch]\n )\n\n const setMatchSeriesMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_MATCH_SERIES_METADATA', value })\n },\n [dispatch]\n )\n\n const value = useMemo(\n () => ({\n ...state,\n setCurrentMenu,\n setThirdNavTitle,\n setMatchSeriesMetadata,\n }),\n [setCurrentMenu, setThirdNavTitle, setMatchSeriesMetadata, state]\n )\n\n return <NavContext.Provider value={{ ...value, ...rest }}>{children}</NavContext.Provider>\n}\n\nexport default NavProvider\n"],
5
- "mappings": "AAoIS,cAAAA,MAAA,oBApIT,OAAgB,iBAAAC,EAAe,eAAAC,EAAa,cAAAC,EAAY,WAAAC,EAAS,cAAAC,MAAkB,QAEnF,OAAS,wBAAAC,MAA4B,aA0BrC,MAAMC,EAA+B,CACnC,SAAU,GACV,YAAa,CAAC,EACd,WAAY,CACV,SAAU,CAAC,CACb,EACA,YAAaD,EAAqB,QAClC,eAAgB,IAAM,CAAC,EACvB,cAAe,GACf,iBAAkB,IAAM,CAAC,EACzB,oBAAqB,CAAC,EACtB,uBAAwB,IAAM,CAAC,CACjC,EAgBaE,EAAaP,EAA8BM,CAAY,EAEvDE,EAAgB,IAAM,CAEjC,GAAI,CADYN,EAAWK,CAAU,EAEnC,MAAM,IAAI,MAAM,6CAA6C,EAE/D,OAAOL,EAAWK,CAAU,CAC9B,EAEME,EAAU,CAACC,EAAuBC,IAAmB,CACzD,OAAQA,EAAO,KAAM,CACnB,IAAK,mBACH,MAAO,CACL,GAAGD,EACH,YAAaC,EAAO,KACtB,EAEF,IAAK,sBACH,MAAO,CACL,GAAGD,EACH,cAAeC,EAAO,KACxB,EAEF,IAAK,4BACH,MAAO,CACL,GAAGD,EACH,oBAAqBC,EAAO,KAC9B,CAEJ,CACF,EAEMC,EAAc,CAAC,CACnB,SAAAC,EACA,GAAGC,CACL,IAEuB,CACrB,KAAM,CAACJ,EAAOK,CAAQ,EAAIX,EAAWK,EAAS,CAC5C,GAAGH,EACH,YAAaD,EAAqB,QAClC,eAAgB,IAAM,CAAC,CACzB,CAAC,EAEKW,EAAiBf,EACpBgB,GACQF,EAAS,CAAE,KAAM,mBAAoB,MAAAE,CAAM,CAAC,EAErD,CAACF,CAAQ,CACX,EAEMG,EAAmBjB,EACtBgB,GACQF,EAAS,CAAE,KAAM,sBAAuB,MAAAE,CAAM,CAAC,EAExD,CAACF,CAAQ,CACX,EAEMI,EAAyBlB,EAC5BgB,GACQF,EAAS,CAAE,KAAM,4BAA6B,MAAAE,CAAM,CAAC,EAE9D,CAACF,CAAQ,CACX,EAEME,EAAQd,EACZ,KAAO,CACL,GAAGO,EACH,eAAAM,EACA,iBAAAE,EACA,uBAAAC,CACF,GACA,CAACH,EAAgBE,EAAkBC,EAAwBT,CAAK,CAClE,EAEA,OAAOX,EAACQ,EAAW,SAAX,CAAoB,MAAO,CAAE,GAAGU,EAAO,GAAGH,CAAK,EAAI,SAAAD,EAAS,CACtE,EAEA,IAAOO,EAAQR",
6
- "names": ["jsx", "createContext", "useCallback", "useContext", "useMemo", "useReducer", "HeaderNavigationMenu", "initialState", "NavContext", "useNavContext", "reducer", "state", "action", "NavProvider", "children", "rest", "dispatch", "setCurrentMenu", "value", "setThirdNavTitle", "setMatchSeriesMetadata", "NavProvider_default"]
4
+ "sourcesContent": ["import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport type { UserProfile } from './types.js'\n\ninterface NavContextType {\n buildProps: {\n products?: Product[] // \u4EA7\u54C1\u6570\u636E\n categories?: Record<string, any> // \u5206\u7C7B\u6570\u636E\n }\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n isMobile?: boolean\n payloadData: any\n currentMenu?: HeaderNavigationMenu // \u5F53\u524D\u83DC\u5355\n setCurrentMenu?: (menu: HeaderNavigationMenu) => void // \u8BBE\u7F6E\u5F53\u524D\u83DC\u5355\n currentSeriesMetadata?: any // \u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n setCurrentSeriesMetadata?: (metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n subSubCategory?: any // \u5B50\u5B50\u5206\u7C7B\n setSubSubCategory?: (category: any) => void // \u8BBE\u7F6E\u5B50\u5B50\u5206\u7C7B\n onSeriesProductClick?: (seriesProduct: any, position: number, seriesLabel?: string) => void // \u8BBE\u7F6E\u7CFB\u5217\u4EA7\u54C1\u70B9\u51FB\n onSidebarNavClick?: (series: any, index: number, subSubindex?: number) => void // \u8BBE\u7F6E\u4FA7\u8FB9\u680F\u5BFC\u822A\u70B9\u51FB\n}\n\nconst initialState: NavContextType = {\n isMobile: false,\n payloadData: {},\n buildProps: {\n products: [],\n categories: {},\n },\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n currentSeriesMetadata: {},\n setCurrentSeriesMetadata: () => {},\n onSeriesProductClick: (seriesProduct: any, position: number, seriesLabel?: string) => {},\n onSidebarNavClick: (series: any) => {} ,\n}\n\ntype Action =\n | {\n type: 'SET_CURRENT_MENU'\n value: HeaderNavigationMenu\n }\n | {\n type: 'SET_CURRENT_SERIES_METADATA'\n value: any\n }\n | {\n type: 'SET_SUB_SUB_CATEGORY'\n value: any\n }\nexport const NavContext = createContext<NavContextType>(initialState)\n\nexport const useNavContext = () => {\n const context = useContext(NavContext)\n if (!context) {\n throw new Error('useNavContext must be used in <NavProvider>')\n }\n return useContext(NavContext)\n}\n\nconst reducer = (state: NavContextType, action: Action) => {\n switch (action.type) {\n case 'SET_CURRENT_MENU': {\n return {\n ...state,\n currentMenu: action.value,\n }\n }\n case 'SET_CURRENT_SERIES_METADATA': {\n return {\n ...state,\n currentSeriesMetadata: action.value,\n }\n }\n case 'SET_SUB_SUB_CATEGORY': {\n return {\n ...state,\n subSubCategory: action.value,\n }\n }\n }\n}\n\nconst NavProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & NavContextType) => {\n const [state, dispatch] = useReducer(reducer, {\n ...initialState,\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n })\n\n const setCurrentMenu = useCallback(\n (value: HeaderNavigationMenu) => {\n return dispatch({ type: 'SET_CURRENT_MENU', value })\n },\n [dispatch]\n )\n\n const setCurrentSeriesMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_SERIES_METADATA', value })\n },\n [dispatch]\n )\n\n const setSubSubCategory = useCallback((value: any) => {\n return dispatch({ type: 'SET_SUB_SUB_CATEGORY', value })\n }, [dispatch])\n\n const value = useMemo(\n () => ({\n ...state,\n setCurrentMenu,\n setCurrentSeriesMetadata,\n setSubSubCategory,\n }),\n [setCurrentMenu, setCurrentSeriesMetadata, setSubSubCategory, state]\n )\n\n return <NavContext.Provider value={{ ...value, ...rest }}>{children}</NavContext.Provider>\n}\n\nexport default NavProvider\n"],
5
+ "mappings": "AAoIS,cAAAA,MAAA,oBApIT,OAAgB,iBAAAC,EAAe,eAAAC,EAAa,cAAAC,EAAY,WAAAC,EAAS,cAAAC,MAAkB,QAEnF,OAAS,wBAAAC,MAA4B,aA6BrC,MAAMC,EAA+B,CACnC,SAAU,GACV,YAAa,CAAC,EACd,WAAY,CACV,SAAU,CAAC,EACX,WAAY,CAAC,CACf,EACA,YAAaD,EAAqB,QAClC,eAAgB,IAAM,CAAC,EACvB,sBAAuB,CAAC,EACxB,yBAA0B,IAAM,CAAC,EACjC,qBAAsB,CAACE,EAAoBC,EAAkBC,IAAyB,CAAC,EACvF,kBAAoBC,GAAgB,CAAC,CACvC,EAeaC,EAAaX,EAA8BM,CAAY,EAEvDM,EAAgB,IAAM,CAEjC,GAAI,CADYV,EAAWS,CAAU,EAEnC,MAAM,IAAI,MAAM,6CAA6C,EAE/D,OAAOT,EAAWS,CAAU,CAC9B,EAEME,EAAU,CAACC,EAAuBC,IAAmB,CACzD,OAAQA,EAAO,KAAM,CACnB,IAAK,mBACH,MAAO,CACL,GAAGD,EACH,YAAaC,EAAO,KACtB,EAEF,IAAK,8BACH,MAAO,CACL,GAAGD,EACH,sBAAuBC,EAAO,KAChC,EAEF,IAAK,uBACH,MAAO,CACL,GAAGD,EACH,eAAgBC,EAAO,KACzB,CAEJ,CACF,EAEMC,EAAc,CAAC,CACnB,SAAAC,EACA,GAAGC,CACL,IAEuB,CACrB,KAAM,CAACJ,EAAOK,CAAQ,EAAIf,EAAWS,EAAS,CAC5C,GAAGP,EACH,YAAaD,EAAqB,QAClC,eAAgB,IAAM,CAAC,CACzB,CAAC,EAEKe,EAAiBnB,EACpBoB,GACQF,EAAS,CAAE,KAAM,mBAAoB,MAAAE,CAAM,CAAC,EAErD,CAACF,CAAQ,CACX,EAEMG,EAA2BrB,EAC9BoB,GACQF,EAAS,CAAE,KAAM,8BAA+B,MAAAE,CAAM,CAAC,EAEhE,CAACF,CAAQ,CACX,EAEMI,EAAoBtB,EAAaoB,GAC9BF,EAAS,CAAE,KAAM,uBAAwB,MAAAE,CAAM,CAAC,EACtD,CAACF,CAAQ,CAAC,EAEPE,EAAQlB,EACZ,KAAO,CACL,GAAGW,EACH,eAAAM,EACA,yBAAAE,EACA,kBAAAC,CACF,GACA,CAACH,EAAgBE,EAA0BC,EAAmBT,CAAK,CACrE,EAEA,OAAOf,EAACY,EAAW,SAAX,CAAoB,MAAO,CAAE,GAAGU,EAAO,GAAGH,CAAK,EAAI,SAAAD,EAAS,CACtE,EAEA,IAAOO,EAAQR",
6
+ "names": ["jsx", "createContext", "useCallback", "useContext", "useMemo", "useReducer", "HeaderNavigationMenu", "initialState", "seriesProduct", "position", "seriesLabel", "series", "NavContext", "useNavContext", "reducer", "state", "action", "NavProvider", "children", "rest", "dispatch", "setCurrentMenu", "value", "setCurrentSeriesMetadata", "setSubSubCategory", "NavProvider_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as h}from"react/jsx-runtime";import"react";const r=e=>h("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{x:"2.40002",y:"4.99902",width:"19.2",height:"1.8",rx:"0.9"}),t("rect",{x:"2.40002",y:"11.5991",width:"19.2",height:"1.8",rx:"0.9"}),t("rect",{x:"2.40002",y:"18.1992",width:"19.2",height:"1.8",rx:"0.9"})]});var c=r;export{c as default};
1
+ import{jsx as t,jsxs as l}from"react/jsx-runtime";import"react";const e=r=>l("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{x:"2",y:"4",width:"16",height:"2",rx:"1",fill:"currentColor"}),t("rect",{x:"2",y:"9",width:"16",height:"2",rx:"1",fill:"currentColor"}),t("rect",{x:"2",y:"14",width:"16",height:"2",rx:"1",fill:"currentColor"})]});var i=e;export{i as default};
2
2
  //# sourceMappingURL=Menu.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/biz-components/HeaderNavigation/icons/Menu.tsx"],
4
- "sourcesContent": ["import React from 'react'\n\nconst Menu = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"2.40002\" y=\"4.99902\" width=\"19.2\" height=\"1.8\" rx=\"0.9\"></rect>\n <rect x=\"2.40002\" y=\"11.5991\" width=\"19.2\" height=\"1.8\" rx=\"0.9\"></rect>\n <rect x=\"2.40002\" y=\"18.1992\" width=\"19.2\" height=\"1.8\" rx=\"0.9\"></rect>\n </svg>\n )\n}\n\nexport default Menu\n"],
5
- "mappings": "AAII,OACE,OAAAA,EADF,QAAAC,MAAA,oBAJJ,MAAkB,QAElB,MAAMC,EAAQC,GAEVF,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,MAAM,6BAA8B,GAAGE,EACrF,UAAAH,EAAC,QAAK,EAAE,UAAU,EAAE,UAAU,MAAM,OAAO,OAAO,MAAM,GAAG,MAAM,EACjEA,EAAC,QAAK,EAAE,UAAU,EAAE,UAAU,MAAM,OAAO,OAAO,MAAM,GAAG,MAAM,EACjEA,EAAC,QAAK,EAAE,UAAU,EAAE,UAAU,MAAM,OAAO,OAAO,MAAM,GAAG,MAAM,GACnE,EAIJ,IAAOI,EAAQF",
4
+ "sourcesContent": ["import React from 'react'\n\nconst Menu = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"2\" y=\"4\" width=\"16\" height=\"2\" rx=\"1\" fill=\"currentColor\" />\n <rect x=\"2\" y=\"9\" width=\"16\" height=\"2\" rx=\"1\" fill=\"currentColor\" />\n <rect x=\"2\" y=\"14\" width=\"16\" height=\"2\" rx=\"1\" fill=\"currentColor\" />\n </svg>\n )\n}\n\nexport default Menu\n"],
5
+ "mappings": "AAII,OACE,OAAAA,EADF,QAAAC,MAAA,oBAJJ,MAAkB,QAElB,MAAMC,EAAQC,GAEVF,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGE,EACjG,UAAAH,EAAC,QAAK,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,OAAO,IAAI,GAAG,IAAI,KAAK,eAAe,EACnEA,EAAC,QAAK,EAAE,IAAI,EAAE,IAAI,MAAM,KAAK,OAAO,IAAI,GAAG,IAAI,KAAK,eAAe,EACnEA,EAAC,QAAK,EAAE,IAAI,EAAE,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG,IAAI,KAAK,eAAe,GACtE,EAIJ,IAAOI,EAAQF",
6
6
  "names": ["jsx", "jsxs", "Menu", "props", "Menu_default"]
7
7
  }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Polygon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default Polygon;
@@ -0,0 +1,2 @@
1
+ import{jsx as o}from"react/jsx-runtime";import"react";const e=t=>o("svg",{width:"16",height:"8",viewBox:"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:o("path",{d:"M8 0L16 8H0L8 0Z",fill:"currentColor"})});var n=e;export{n as default};
2
+ //# sourceMappingURL=Polygon.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/HeaderNavigation/icons/Polygon.tsx"],
4
+ "sourcesContent": ["import React from 'react'\n\nconst Polygon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"16\" height=\"8\" viewBox=\"0 0 16 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M8 0L16 8H0L8 0Z\" fill=\"currentColor\" />\n </svg>\n )\n}\n\nexport default Polygon"],
5
+ "mappings": "AAKM,cAAAA,MAAA,oBALN,MAAkB,QAElB,MAAMC,EAAWC,GAEbF,EAAC,OAAI,MAAM,KAAK,OAAO,IAAI,QAAQ,WAAW,KAAK,OAAO,MAAM,6BAA8B,GAAGE,EAC/F,SAAAF,EAAC,QAAK,EAAE,mBAAmB,KAAK,eAAe,EACjD,EAIJ,IAAOG,EAAQF",
6
+ "names": ["jsx", "Polygon", "props", "Polygon_default"]
7
+ }
@@ -8,4 +8,5 @@ import User from './User.js';
8
8
  import RightArrow from './RightArrow.js';
9
9
  import LeftArrow from './LeftArrow.js';
10
10
  import DownArrow from './DownArrow.js';
11
- export { AnkerLogo, Menu, Search, Cart, Close, User, RightArrow, LeftArrow, DownArrow, LogoLine };
11
+ import Polygon from './Polygon.js';
12
+ export { AnkerLogo, Menu, Search, Cart, Close, User, RightArrow, LeftArrow, DownArrow, LogoLine, Polygon };
@@ -1,2 +1,2 @@
1
- import r from"./AnkerLogo.js";import o from"./LogoLine.js";import m from"./Menu.js";import t from"./Search.js";import i from"./Cart.js";import f from"./Close.js";import p from"./User.js";import e from"./RightArrow.js";import n from"./LeftArrow.js";import w from"./DownArrow.js";export{r as AnkerLogo,i as Cart,f as Close,w as DownArrow,n as LeftArrow,o as LogoLine,m as Menu,e as RightArrow,t as Search,p as User};
1
+ import o from"./AnkerLogo.js";import r from"./LogoLine.js";import m from"./Menu.js";import t from"./Search.js";import i from"./Cart.js";import f from"./Close.js";import p from"./User.js";import e from"./RightArrow.js";import n from"./LeftArrow.js";import g from"./DownArrow.js";import w from"./Polygon.js";export{o as AnkerLogo,i as Cart,f as Close,g as DownArrow,n as LeftArrow,r as LogoLine,m as Menu,w as Polygon,e as RightArrow,t as Search,p as User};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/biz-components/HeaderNavigation/icons/index.ts"],
4
- "sourcesContent": ["import AnkerLogo from './AnkerLogo.js'\nimport LogoLine from './LogoLine.js'\nimport Menu from './Menu.js'\nimport Search from './Search.js'\nimport Cart from './Cart.js'\nimport Close from './Close.js'\nimport User from './User.js'\nimport RightArrow from './RightArrow.js'\nimport LeftArrow from './LeftArrow.js'\nimport DownArrow from './DownArrow.js'\n\nexport { AnkerLogo, Menu, Search, Cart, Close, User, RightArrow, LeftArrow, DownArrow, LogoLine }\n"],
5
- "mappings": "AAAA,OAAOA,MAAe,iBACtB,OAAOC,MAAc,gBACrB,OAAOC,MAAU,YACjB,OAAOC,MAAY,cACnB,OAAOC,MAAU,YACjB,OAAOC,MAAW,aAClB,OAAOC,MAAU,YACjB,OAAOC,MAAgB,kBACvB,OAAOC,MAAe,iBACtB,OAAOC,MAAe",
6
- "names": ["AnkerLogo", "LogoLine", "Menu", "Search", "Cart", "Close", "User", "RightArrow", "LeftArrow", "DownArrow"]
4
+ "sourcesContent": ["import AnkerLogo from './AnkerLogo.js'\nimport LogoLine from './LogoLine.js'\nimport Menu from './Menu.js'\nimport Search from './Search.js'\nimport Cart from './Cart.js'\nimport Close from './Close.js'\nimport User from './User.js'\nimport RightArrow from './RightArrow.js'\nimport LeftArrow from './LeftArrow.js'\nimport DownArrow from './DownArrow.js'\nimport Polygon from './Polygon.js'\n\nexport { AnkerLogo, Menu, Search, Cart, Close, User, RightArrow, LeftArrow, DownArrow, LogoLine, Polygon }\n"],
5
+ "mappings": "AAAA,OAAOA,MAAe,iBACtB,OAAOC,MAAc,gBACrB,OAAOC,MAAU,YACjB,OAAOC,MAAY,cACnB,OAAOC,MAAU,YACjB,OAAOC,MAAW,aAClB,OAAOC,MAAU,YACjB,OAAOC,MAAgB,kBACvB,OAAOC,MAAe,iBACtB,OAAOC,MAAe,iBACtB,OAAOC,MAAa",
6
+ "names": ["AnkerLogo", "LogoLine", "Menu", "Search", "Cart", "Close", "User", "RightArrow", "LeftArrow", "DownArrow", "Polygon"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as de,jsx as e,jsxs as l}from"react/jsx-runtime";import{forwardRef as W,useCallback as G,useEffect as C,useImperativeHandle as me,useMemo as h,useRef as $,useState as w}from"react";import{Picture as J,Text as p,Button as S,Container as K,Link as T}from"../../components/index.js";import{withLayout as ue}from"../../shared/Styles.js";import{cn as E,atobID as pe}from"../../helpers/utils.js";import fe,{useNavContext as A}from"./NavProvider.js";import{HeaderNavigationMenu as D,HeaderNavigationBlockType as j,HeaderNavigationActionBlockType as R}from"./types.js";import{useMediaQuery as be}from"react-responsive";import{debounce as ve,throttle as ge}from"es-toolkit";import{useGSAP as Q}from"@gsap/react";import{gsap as V}from"gsap";import{WithSidebar as X,WithSupports as Z,WithMulticol as ee,WithGroupCategory as te}from"./withCategory.js";import{Menu as xe,Close as ae,User as ye,RightArrow as le,LeftArrow as he,DownArrow as ne,LogoLine as Ne}from"./icons/index.js";const ke=W((t,n)=>{const{data:{headerNavigation:a}={},buildProps:i,event:s,profile:o,theme:u="light"}=t,[f,N]=w(!1),[g,r]=w(!1),[c,d]=w(!1),b=$(null),v=be({query:"(max-width: 1440px)"});return C(()=>{N(v)},[v]),me(n,()=>b.current),C(()=>{let H=0,B=0;const I=ge(k=>{const z=B-k;z>0?(H+=z,H>=300&&(r(!1),H=0)):r(k>300),d(k>24),B=k},200),P=()=>{let k=0;document?.documentElement&&document?.documentElement?.scrollTop?k=document?.documentElement.scrollTop:document?.body&&(k=document?.body.scrollTop),I(k)};return window.addEventListener("scroll",P),()=>window.removeEventListener("scroll",P)},[]),e(fe,{buildProps:i,profile:o,isMobile:f,event:s,payloadData:a,children:e("header",{"data-ui-component-id":"HeaderNavigation",className:"sticky top-0 z-50",ref:b,children:l("div",{className:E("border-b border-b-gray-200",u==="light"?"text-black":"text-white",{"translate-y-[-100%] transition-transform duration-500 ease-in-out":g,"!bg-white transition-all duration-500 ease-in-out":c},{"hover:!text-black":u==="dark","!text-black":c}),children:[!f&&e(we,{data:a}),f&&e(Se,{data:a})]})})})}),we=W((t,n)=>{const{data:a}=t,{event:i}=A(),s=h(()=>te(a?.categories),[a]),[o,u]=w(null),[f,N]=w([]),g=$(null),[r,c]=w(!1),d=$(null),b=$(s.map(m=>Array(m?.length||0).fill(null)));C(()=>{s?.length&&N(s?.map((m,y)=>m?.map((M,L)=>({groupIndex:y,index:L,open:!1}))))},[s]);const v=h(()=>{let m=null;for(const y of f){for(const M of y)if(M.open){m=M;break}if(m)break}return m},[f]);C(()=>{},[v]);const H=(m,y,M)=>{m.stopPropagation(),u(s[y][M]),N(L=>L.map(_=>_.map(U=>U.groupIndex===y&&U.index===M?{...U,open:!U.open}:{...U,open:!1})))},B=()=>{N(m=>m.map(y=>y.map(M=>({...M,open:!1}))))},I=h(()=>{if(o)return o?.components?.[0]?.blockType},[o]),P=X(Me,o),k=Z(De,{categoriesItem:o,currentNavItemRef:b.current?.[v?.groupIndex||0]?.[v?.index||0]}),z=ee(Ce,o),Y=h(()=>{switch(I){case j.Sidebar:return e(P,{});case j.Supports:return e(k,{});case j.Multicol:return e(z,{});default:return null}},[I,z,P,k]),F=h(()=>a?.headerBar?.actions?.filter(m=>m?.pcShow),[a]),x=h(()=>F?.find(m=>m?.blockType===R.Profile),[F]),O=G(()=>{c(m=>!m)},[]);return C(()=>{if(g?.current){const m=g.current;return m.addEventListener("click",O),()=>{m.removeEventListener("click",O)}}},[O]),l(K,{childClassName:"bg-white",className:"relative h-[96px]",children:[l("div",{ref:d,onClick:B,className:"flex h-full flex-col justify-end gap-4",children:[l("div",{className:"flex items-center justify-between",children:[e(ie,{}),e(re,{ref:g,actions:F})]}),e("div",{className:"flex justify-between",children:s?.map((m,y)=>e("div",{className:"flex gap-6",children:m?.map((M,L)=>e("div",{ref:_=>{b.current[y][L]=_},className:"hover:text-brand-0 cursor-pointer",children:l("div",{className:"relative",children:[l("div",{className:"flex items-center gap-1 pb-4",onClick:_=>H(_,y,L),children:[e(p,{html:M.text,className:E(" text-sm font-bold leading-[1.4]",{"text-brand-0":v?.groupIndex===y&&v?.index===L})}),e(ne,{className:E({"text-brand-0":v?.groupIndex===y&&v?.index===L})})]}),e("div",{className:E("absolute bottom-0 left-0 h-[2px] w-0 bg-[#1D1D1F] transition-all duration-500",{"w-full":v?.groupIndex===y&&v?.index===L})})]})},M.id))},`groupCategory-${y}`))})]}),v?.open&&o&&l("div",{className:"absolute left-0 top-full z-[999] flex w-full flex-col bg-black/70",style:{height:`calc(100vh - ${d?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{className:"relative z-50",children:Y}),e("div",{className:"flex-1 bg-transparent",onClick:B})]}),r&&l("div",{className:"absolute left-0 z-[999] flex w-full bg-black/70",style:{height:`calc(100vh - ${g?.current?.getBoundingClientRect()?.bottom}px)`,top:`calc(12px + ${g?.current?.getBoundingClientRect()?.top}px)`},children:[l("div",{className:"absolute max-w-[272px] bg-white p-4",style:{right:`calc(100% - ${g?.current?.getBoundingClientRect()?.right}px)`},children:[e(p,{html:x?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-3 flex flex-col gap-1",children:x?.benefits?.map(m=>l("div",{className:"flex items-center gap-[6px]",children:[e(J,{source:m.benefitIcon?.url,className:"size-4",alt:m.benefit,width:16,height:16}),e(p,{html:m.benefit,className:"text-sm font-bold leading-[1.4]"})]},m.id))}),l("div",{className:"mt-4 flex items-center gap-2",children:[e(S,{variant:"secondary",size:"sm",onClick:()=>i?.join?.(),children:e(p,{html:x?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(S,{variant:"primary",size:"sm",onClick:()=>i?.login?.(),children:e(p,{html:x?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]}),e("div",{className:"flex-1 bg-transparent",onClick:()=>c(!1)})]})]})}),Me=({sidebarCategoriesMetadata:t,seriesMetadata:n})=>{const[a,i]=w([]),[s,o]=w(0),u=$(null);Q(()=>{V.fromTo(u?.current,{height:0},{height:548})},[]),C(()=>{t?.subcategories?.length&&i(t?.subcategories?.map((r,c)=>({index:c,open:!1})))},[t]);const f=h(()=>n?.find(r=>t?.subcategories?.[a?.find(c=>c.open)?.index||0]?.subSubCategories?.[s]?.label===r.label)||{},[t,a,s,n]),N=r=>{i(c=>c.map(d=>d.index===r?{...d,open:!d.open}:{...d,open:!1}))},g=r=>{o(r)};return l(K,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[l("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},children:[e("div",{className:"desktop:max-h-[416px] flex flex-col overflow-y-auto",children:t?.subcategories?.map((r,c)=>l("div",{children:[l("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>N(c),children:[e(p,{html:r.label,className:"p-4 text-sm font-bold leading-[1.4]"}),e(ne,{className:E({"rotate-180":a.find(d=>d.index===c)?.open})})]}),a.find(d=>d.index===c)?.open&&e("div",{className:"flex flex-col",children:r.subSubCategories?.map((d,b)=>e(p,{html:d.label,onMouseEnter:()=>g(b),className:E("cursor-pointer px-6 py-4 text-sm font-bold leading-[1.4] text-[#6D6D6F] hover:bg-[#F5F5F7]")},`subSubItem-${c}-${b}`))})]},`subcategoryItem-${c}`))}),e("div",{className:"flex",children:l("div",{className:"flex flex-col gap-4",children:[e(S,{variant:"primary",size:"lg",className:"text-base",children:e("a",{href:t?.primary?.url,children:t?.primary?.label})}),e(S,{variant:"link",size:"lg",className:"justify-start py-0 text-base",children:e("a",{href:t?.secondary?.url,children:t?.secondary?.label})})]})})]}),l("div",{className:"flex-1",children:[Reflect.ownKeys(f).length>0&&l("div",{className:"mb-4 flex items-center justify-between",children:[l("div",{className:"flex items-center gap-2",children:[e(p,{html:f?.label,className:"text-2xl font-bold leading-[1.4]"}),e(S,{variant:"link",size:"lg",className:"justify-start p-0 text-base",children:e(T,{href:f?.primary?.url,className:"text-base font-bold leading-[1.2] no-underline",children:f?.primary?.label})})]}),e(T,{href:f?.guide?.url,className:"text-base leading-[1.2] text-[#6D6D6F]",children:f?.guide?.label})]}),e("div",{className:"flex flex-col gap-4 overflow-y-auto",ref:u,children:f?.series?.map((r,c)=>l("div",{children:[e(p,{html:r.label,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 grid grid-cols-3 gap-4",children:r.products?.map((d,b)=>e(oe,{product:d},`seriesProductItem-${b}`))})]},`seriesItem-${c}`))})]})]})},Ce=({multicolMetadata:t})=>{const n=$(null);return Q(()=>{V.fromTo(n?.current,{height:0},{height:"auto"})},[]),e("div",{ref:n,children:e(K,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:t?.map((a,i)=>e("div",{className:"w-1/4",children:e(se,{item:a})},`multicolItem-${a?.label}-${i}`))})})})},De=({supportsMetadata:t,currentNavItemRef:n})=>{const a=$(null),[i,s]=w(null);Q(()=>{V.fromTo(a?.current,{height:0},{height:"auto"})},[]);const o=ve(()=>{if(n){const u=n.getBoundingClientRect();s(u)}},500);return C(()=>(o(),window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}),[o]),C(()=>{if(n){const u=n.getBoundingClientRect();s(u)}},[n]),e("div",{className:"absolute top-0 h-full bg-white p-4",ref:a,style:{right:`calc(100% - ${i?.right}px)`},children:e("div",{children:t?.map(u=>e("div",{className:"py-2",children:e(T,{href:u.url,className:"text-sm font-bold leading-[1.4] no-underline",children:u.label})},u.id))})})},oe=({product:t})=>{const{buildProps:n}=A(),a=n?.products?.find(o=>o.handle===t.handle),i=a?.variants?.find(o=>o.sku===t.sku),s=h(()=>`/products/${a?.handle}?variant=${pe(i?.id)}`,[a?.handle,i?.id]);return l("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-105",children:[e("div",{className:"shrink-0 basis-[96px]",children:e(J,{source:`${i?.image?.url||t?.images?.[0]?.url}}`,width:96,height:96})}),l("div",{className:"relative",children:[t?.badge&&e(p,{as:"p",html:t?.badge,className:"text-brand-0 mb-1 inline-block h-[24px] rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]"}),e(T,{href:s,className:"no-underline",children:e(p,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:a?.title||t?.name})}),t?.desc&&e(p,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})},se=({item:t})=>l(de,{children:[t?.columns&&l(de,{children:[e(p,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:t.columns?.map(n=>e("div",{className:"py-2",children:e(T,{href:n.url,className:"text-sm font-bold leading-[1.4] no-underline",children:n.label})},n.label))})]}),t?.imageUrl&&l("div",{className:"laptop:h-[280px] laptop:w-[404px] desktop:w-full desktop:h-auto relative h-[240px] w-[358px]",children:[e(J,{source:t.imageUrl,width:404,height:280}),l(T,{href:t.url,className:"absolute inset-0 z-10 flex flex-col justify-end p-4 no-underline",children:[e(p,{html:t.title,className:"desktop:text-2xl text-xl font-bold leading-[1.2] text-white"}),e(p,{html:t.subtitle,className:"text-sm font-bold leading-[1.4] text-white"})]})]})]}),Se=W(({data:t},n)=>{const a=h(()=>te(t?.categories),[t]),{currentMenu:i,setCurrentMenu:s,thirdNavTitle:o}=A(),[u,f]=w(!1),[N,g]=w(0),[r,c]=w(null),d=$(null);C(()=>{if(d?.current&&u){const x=d?.current?.getBoundingClientRect();g(window?.innerHeight-(x?.bottom||0))}},[u]),Q(()=>{V.fromTo(d.current,{height:0},{height:N,duration:.5})},[N]),C(()=>{document.documentElement.style.overflow=u?"hidden":"auto"},[u]);const b=h(()=>r?.components?.[0]?.blockType,[r]),v=X(Le,r),H=Z(Te,{categoriesItem:r}),B=ee(Ee,r),I=h(()=>{switch(b){case j.Sidebar:return e(v,{});case j.Supports:return e(H,{});case j.Multicol:return e(B,{});default:return null}},[b,v,H,B]),P=G(()=>{f(!1),g(0),s&&s(D.Primary)},[f,g,s]),k=h(()=>t?.headerBar?.actions?.filter(x=>x?.mobileShow&&x?.blockType!==R.Profile),[t]),z=h(()=>t?.headerBar?.actions?.find(x=>x?.mobileShow&&x?.blockType===R.Profile)||{},[t]),Y=h(()=>{switch(i){case D.Primary:return e(Be,{actions:k,menuOpen:u,onMenuOpenClose:()=>{f(!1),g(0)},onMenuOpenClick:()=>f(!0)});case D.Secondary:return e(ce,{title:r?.text,onMenuOpenClose:P,onMenuBackClick:()=>s?.(D.Primary)});case D.Third:return e(ce,{title:o,onMenuOpenClose:P,onMenuBackClick:()=>s?.(D.Secondary)});default:return null}},[u,i,s,r,k,o,P]),F=G((x,O)=>{const m=Array.isArray(a)?Array.isArray(a[x])?a[x][O]:{}:{};c(m),s?.(D.Secondary)},[a,s]);return l(K,{childClassName:"bg-white",className:"relative h-[52px]",children:[Y,u&&e("div",{ref:d,className:"absolute left-0 top-[calc(100%+1px)] z-[999] w-full overflow-y-auto bg-white",style:{height:N},children:i===D.Primary?e(Pe,{categories:a,onPrimaryMenuClick:F,profileAction:z}):I})]})}),Pe=({categories:t,onPrimaryMenuClick:n,profileAction:a})=>l("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((i,s)=>l("div",{className:"",children:[i?.map((o,u)=>e(q,{label:o.text,onClick:()=>n(s,u)},o.id)),e("div",{className:E("my-2 h-px w-full bg-[#E5E5E7]",{hidden:s===t.length-1})})]},`groupCategory-${s}`))}),e(He,{profileAction:a})]}),Le=({sidebarCategoriesMetadata:t,seriesMetadata:n})=>{const{currentMenu:a,setCurrentMenu:i,setThirdNavTitle:s,matchSeriesMetadata:o,setMatchSeriesMetadata:u}=A(),[f,N]=w([]);return C(()=>{t?.subcategories?.length&&N(t?.subcategories?.map((r,c)=>({index:c,open:!1})))},[t]),h(()=>{switch(a){case D.Secondary:return l("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col justify-between p-4",children:[l("div",{children:[t?.subcategories?.map((r,c)=>l("div",{children:[e(q,{label:r?.label,active:f.find(d=>d.index===c)?.open,onClick:()=>{N(d=>d.map(b=>b.index===c?{...b,open:!b.open}:{...b,open:!1}))}}),f.find(d=>d.index===c)?.open&&r.subSubCategories?.map((d,b)=>e("div",{className:"px-2 py-4",onClick:()=>{i&&i(D.Third),u?.(n?.find(v=>t?.subcategories?.[c]?.subSubCategories?.[b]?.label===v.label)||{}),s&&s(d.label)},children:e(p,{html:d.label,className:"text-sm font-bold leading-[1.4]"})},`${c}-${b}`))]},`${r.label}-${c}`)),e(T,{href:o?.guide?.url,children:e("div",{className:"mt-4",children:e(p,{html:o?.guide?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]}),l("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[e(S,{variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:e("a",{href:t?.primary?.url,children:t?.primary?.label})}),e(S,{variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:e("a",{href:t?.secondary?.url,children:t?.secondary?.label})})]})]});case D.Third:return l("div",{className:"tablet:px-8 laptop:px-16 desktop:px-0 p-4",children:[Reflect.ownKeys(o).length>0&&l("div",{className:"tablet:pt-0 flex items-center gap-3 py-4",children:[e(p,{html:o?.label,className:"text-xl font-bold leading-[1.4]"}),e(S,{variant:"link",size:"lg",className:"p-0",children:e(T,{href:o?.primary?.url,className:"text-base leading-[1.2]",children:o?.primary?.label})})]}),e("div",{className:"flex flex-col gap-6",children:o?.series?.map((r,c)=>l("div",{children:[e(p,{html:r.label,className:"text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),e("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 mt-2 flex flex-col gap-2",children:r.products?.map((d,b)=>e(oe,{product:d},`seriesProductItem-${c}-${b}`))})]},`seriesItem-${c}`))})]});default:return null}},[a,o,t,s,i,u,n,f])},Te=({supportsMetadata:t})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(n=>e(q,{href:n.url,label:n.label,onClick:()=>{}},n.id))}),Ee=({multicolMetadata:t})=>e("div",{className:"tablet:px-8 tablet:p-4 laptop:px-16 flex flex-col gap-4 px-4",children:t?.map((n,a)=>e("div",{children:e(se,{item:n})},`multicolItem-${n?.label}-${a}`))}),He=({profileAction:t})=>{const[n,a]=w(!1),{profile:i,event:s}=A();return l("div",{className:"tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",children:[l("div",{className:"flex items-center justify-between",onClick:()=>a(!n),children:[l("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] items-center justify-center rounded-full bg-white",children:e(ye,{})}),e(p,{html:i?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),e(le,{className:E({"rotate-90":n})})]}),i?.email&&e("div",{className:"mt-4",children:t?.profiles?.map(o=>e(q,{label:o?.title,href:o?.url},o.id))}),n&&!i?.email&&l("div",{className:"mt-4",children:[e(p,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-3 flex flex-col gap-1",children:t?.benefits?.map(o=>l("div",{className:"flex items-center gap-[6px]",children:[e(J,{source:o.benefitIcon?.url,className:"size-4",alt:o.benefit,width:16,height:16}),e(p,{html:o.benefit,className:"text-sm font-bold leading-[1.4]"})]},o.id))})]}),l("div",{className:"tablet:mt-4 mt-6 flex items-center gap-3",children:[e(S,{className:"tablet:flex-none flex-1",variant:"secondary",size:"sm",onClick:()=>s?.join?.(),children:e(p,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(S,{className:"tablet:flex-none flex-1",variant:"primary",size:"sm",onClick:()=>s?.login?.(),children:e(p,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Be=({menuOpen:t,onMenuOpenClose:n,onMenuOpenClick:a,actions:i})=>l("div",{className:"flex h-full items-center justify-between gap-4",children:[e(ie,{}),l("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(re,{actions:i}),t?e(ae,{onClick:()=>n()}):e(xe,{onClick:()=>a()})]})]}),ie=()=>{const{payloadData:t}=A();return l("div",{className:"desktop:gap-2 flex items-center gap-[6px]",children:[e("div",{dangerouslySetInnerHTML:{__html:t?.headerBar?.logo}}),e(Ne,{}),e(p,{html:t?.headerBar?.slogan,className:"tablet:text-sm text-xs font-bold leading-[1.4]"})]})},re=W(({actions:t},n)=>{const{event:a}=A(),i=G(s=>{switch(s?.blockType){case R.Search:a?.search?.();break;case R.Cart:a?.cart?.();break;case R.Profile:a?.profile?.();break;case R.Livestream:a?.livestream?.();break;default:return()=>{}}},[a]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map(s=>e("div",{ref:s.blockType===R.Profile?n:null,onClick:()=>i(s),children:e(p,{html:s.icon,className:"hover:text-brand-0 cursor-pointer"})},s.id))})}),ce=({title:t,onMenuOpenClose:n,onMenuBackClick:a})=>l("div",{className:"flex h-full items-center gap-3",children:[e(he,{onClick:()=>a()}),e(p,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e(ae,{onClick:()=>n()})]}),q=({label:t,href:n,onClick:a,active:i})=>e("div",{className:"flex cursor-pointer items-center justify-between py-4",onClick:a,children:l(T,{href:n,asChild:!n,className:"flex w-full items-center justify-between no-underline",children:[e(p,{html:t,className:"text-sm font-bold leading-[1.4]"}),e(le,{className:E({"rotate-90":i})})]})});var Ke=ue(ke);export{Ke as default};
1
+ "use client";import{Fragment as q,jsx as e,jsxs as l}from"react/jsx-runtime";import we,{forwardRef as Z,useCallback as G,useEffect as H,useImperativeHandle as Ce,useMemo as L,useRef as F,useState as M}from"react";import{Picture as V,Text as h,Button as $,Container as ee,Link as _,Heading as se}from"../../components/index.js";import{withLayout as Se}from"../../shared/Styles.js";import{cn as N,atobID as De}from"../../helpers/utils.js";import Le,{useNavContext as O}from"./NavProvider.js";import{HeaderNavigationMenu as A,HeaderNavigationBlockType as I,HeaderNavigationActionBlockType as W}from"./types.js";import"react-responsive";import{debounce as Me}from"es-toolkit";import Pe from"jump.js";import{useGSAP as oe}from"@gsap/react";import{gsap as re}from"gsap";import{WithSidebar as ie,WithSupports as ce,WithMulticol as de,WithGroupCategory as ue}from"./withCategory.js";import{Menu as ze,Close as me,User as Ee,RightArrow as He,LeftArrow as Be,DownArrow as te,Polygon as Te}from"./icons/index.js";import $e from"../NavigationSearch/index.js";const Re=Z((t,a)=>{const{data:{headerNavigation:n}={},buildProps:d,event:s,profile:b,theme:u="light",isTop:i=!1,searchResult:m,onSearch:w,isSearching:r,keywords:k,onPrimaryNavClick:x,onSeriesProductClick:f,onSidebarNavClick:v}=t,p=F(null),[c,o]=M(!1),[y,z]=M(!1),[C,P]=M(!1),[D,U]=M(!1),R=F(null),S=()=>{const B=document?.querySelector("body")?.offsetWidth||0;U(B<=1440)};H(()=>(S(),window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}),[]),Ce(a,()=>R.current),H(()=>{R.current&&i&&Pe(R.current,{duration:0,offset:R.current?.getBoundingClientRect()?.bottom||0})},[i]),H(()=>{s&&(s.search=()=>o(!0))},[s]),oe(()=>{p?.current&&c&&re.fromTo(p.current,{height:0},{height:"auto",duration:.3})},[c]),H(()=>{document.documentElement.style.overflow=c?"hidden":"auto"},[c]);const Q=L(()=>n?.headerBar?.actions?.find(B=>B?.blockType===W.Search)?.searchBar?.[0]||{},[n]);return e(Le,{buildProps:d,profile:b,isMobile:D,event:s,payloadData:n,onSidebarNavClick:v,onSeriesProductClick:f,children:e("header",{"data-ui-component-id":"HeaderNavigation",className:"relative z-[100]",ref:R,children:l("div",{className:N("hover:text-black hover:bg-white",u==="light"?"text-black":"text-white",{}),onClick:()=>P(!0),children:[e(Ae,{data:n,className:"hidden desktop:block",theme:u,onNavItemClick:()=>P(!0),onPrimaryNavClick:x}),e(Oe,{data:n,className:"block desktop:hidden",onPrimaryNavClick:x}),c&&l("div",{className:"absolute z-[60] top-0 left-0 w-full bg-black/70 flex flex-col",style:{height:`calc(100dvh - ${R?.current?.getBoundingClientRect()?.top}px)`},children:[e("div",{ref:p,className:N("overflow-y-auto",{}),children:e($e,{data:Q,keywords:k,isSearching:r,searchResult:m,onSearch:B=>{w?.(B)},onClose:()=>{w?.(),o(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>o(!1)})]})]})})})}),Ae=Z((t,a)=>{const{data:n,onNavItemClick:d,className:s,theme:b,onPrimaryNavClick:u}=t,{event:i,profile:m}=O(),[w,r]=M(!1),k=L(()=>ue(n?.categories?.filter(g=>g?.pcShow)),[n]),[x,f]=M(null),[v,p]=M([]),c=F(null),[o,y]=M(!1),z=F(null),C=F(null),P=F(k.map(g=>Array(g?.length||0).fill(null)));H(()=>{k?.length&&p(k?.map((g,E)=>g?.map((T,j)=>({groupIndex:E,index:j,open:!1}))))},[k]);const D=L(()=>{let g=null;for(const E of v){for(const T of E)if(T.open){g=T;break}if(g)break}return g},[v]);H(()=>{document.documentElement.style.overflow=D?.open||o?"hidden":"auto"},[D?.open,o]);const U=(g,E,T)=>{if(y(!1),x?.components?.[0]?.blockType===I.Links)x?.components?.[0]?.url&&window.open(x?.components?.[0]?.url);else{const j=k?.flat()||[],J=j?.findIndex(le=>le?.id===k[E][T]?.id);g.stopPropagation(),d?.(),u?.(j[J],J),f(k[E][T]),p(le=>le.map(ke=>ke.map(X=>X.groupIndex===E&&X.index===T?{...X,open:!X.open}:{...X,open:!1})))}},R=()=>{p(g=>g.map(E=>E.map(T=>({...T,open:!1}))))},S=L(()=>{if(x)return x?.components?.[0]?.blockType},[x]),Q=ie(je,x),B=de(Fe,x),xe=ce(_e,{categoriesItem:x,currentNavItemRef:P.current?.[D?.groupIndex||0]?.[D?.index||0]}),Ne=L(()=>{switch(S){case I.Sidebar:return e(Q,{});case I.Supports:return e(xe,{});case I.Multicol:return e(B,{});default:return null}},[S,x]),ae=L(()=>n?.headerBar?.actions?.filter(g=>g?.pcShow),[n]),K=L(()=>ae?.find(g=>g?.blockType===W.Profile),[ae]),ne=G(()=>{y(g=>!g)},[]);return H(()=>{if(c?.current){const g=c.current;return g.addEventListener("click",ne),()=>{g.removeEventListener("click",ne)}}},[ne]),oe(()=>{D?.open&&re.fromTo(C?.current,{height:0},{height:"auto"})},[D?.open]),l(ee,{className:N("relative h-[96px]",s),children:[l("div",{ref:z,onClick:R,className:"flex h-full flex-col justify-end gap-4",children:[l("div",{className:"flex items-center justify-between",children:[e(ge,{}),e(ye,{ref:c,actions:ae,activeStatus:o})]}),e("div",{className:"flex justify-between",children:k?.map((g,E)=>e("div",{className:"flex gap-3",children:g?.map((T,j)=>e("div",{ref:J=>{P.current[E][j]=J},className:"group cursor-pointer",children:l("div",{className:"relative",children:[l("div",{className:"flex items-center gap-1 pb-4",onClick:J=>U(J,E,j),children:[e(h,{html:T.text,className:"text-sm font-bold leading-[1.4]"}),e(te,{className:N("opacity-0 size-4 group-hover:opacity-100 transition-opacity duration-500",{"rotate-180":D?.groupIndex===E&&D?.index===j,"opacity-100":w&&D?.groupIndex===E&&D?.index===j})})]}),e("div",{className:N("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":D?.groupIndex===E&&D?.index===j},b==="dark"?"bg-white":"bg-[#1D1D1F]")})]})},T.id))},`groupCategory-${E}`))})]}),l("div",{className:N("border-t border-b-[#E4E5E6] text-black absolute left-0 top-full z-[999] flex w-full flex-col bg-black/70 overflow-hidden",{hidden:!(D?.open&&x)}),onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{height:`calc(100dvh - ${z?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:C,className:N("relative z-50",{"overflow-hidden":S!==I.Supports}),children:Ne}),e("div",{className:"flex-1 bg-transparent",onClick:R})]}),o&&l("div",{className:"absolute left-0 z-[999] flex w-full bg-black/70 h-[100dvh] top-full",children:[e("div",{className:"absolute w-[272px] bg-white p-4",style:{right:`calc(100% - ${c?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:m?.email?l(q,{children:[e(h,{html:m?.nick_name||K?.welcome,className:"text-sm font-bold"}),e("div",{className:"h-[1px] mt-2 bg-[#D9D9D9]"}),e("div",{className:"mt-2",children:K?.profiles?.map(g=>e(Y,{className:"py-2",label:g?.title,href:g?.url},g.id))})]}):l(q,{children:[e(Te,{className:"absolute -top-2 text-white right-[46px] z-30"}),e(h,{html:K?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:K?.benefits?.map(g=>l("div",{className:"flex items-center gap-[6px]",children:[e(V,{source:g.benefitIcon?.url,className:"size-4",alt:g.benefit,width:16,height:16}),e(h,{html:g.benefit,className:"text-sm font-bold leading-[1.4]"})]},g.id))}),l("div",{className:"mt-4 flex items-center gap-2",children:[e($,{variant:"secondary",size:"lg",onClick:()=>i?.join?.(),children:e(h,{html:K?.primaryButton||"Join Now",className:"font-bold"})}),e($,{variant:"primary",size:"lg",onClick:()=>i?.login?.(),children:e(h,{html:K?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>y(!1)})]})]})}),je=we.memo(({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{buildProps:n,onSidebarNavClick:d}=O(),[s,b]=M([]),[u,i]=M(-1),m=F(null),w=G(()=>{const f=t?.subcategories;if(!f?.length)return;const v=f.findIndex(o=>!!o?.subSubCategories),p=f.findIndex(o=>!o?.subSubCategories),c=f.map((o,y)=>({index:y,open:v===y||p===y}));b(c)},[t]);H(()=>{w()},[w]);const r=L(()=>{const f=t?.subcategories?.[s?.find(p=>p.open)?.index||0],v=a?.find(p=>p?.label?.toLowerCase()===f?.label?.toLowerCase())||{};if(f?.collections){const p=n?.categories?.[f?.collections]||{};return{label:v?.label,isCollection:!0,banner:v?.banner,primary:v?.primary,series:[{products:p?.products}]}}else if(f?.subSubCategories){const p=f?.subSubCategories?.[u],c=a?.find(o=>o?.label?.toLowerCase()===p?.label?.toLowerCase())||{};if(p?.collections){const o=n?.categories?.[p?.collections]||{};return{label:c?.label,isCollection:!0,banner:c?.banner,primary:c?.primary,series:[{products:o?.products}]}}else return c}else return v},[t,s,u,a]),k=G((f,v)=>{if(v?.subSubCategories?.length>0?i(0):i(-1),v?.subSubCategories?.length>0)b(p=>p.map(c=>c.index===f?{...c,open:!0}:{...c,open:!1}));else{const c=t?.subcategories?.findIndex(o=>!!o?.subSubCategories);b(o=>o.map(y=>({...y,open:y.index===f||y.index===c})))}},[t,w]),x=(f,v)=>{b(p=>p.map(c=>c.index===f?{...c,open:!0}:{...c,open:!1})),i(v)};return l(ee,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[l("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:m,children:[e("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((f,v)=>{const p=Array.isArray(f?.subSubCategories)&&f?.subSubCategories?.length>0;return l("div",{children:[l("div",{className:N("flex cursor-pointer items-center justify-between",{"bg-[#F5F5F7]":!p&&s?.find(c=>c.index===v)?.open}),onClick:()=>{k(v,f),d?.(f,v)},children:[e(h,{html:f.label,className:"p-4 text-sm font-bold leading-[1.4]"}),p&&e(te,{className:N("size-4",{"rotate-180":s?.find(c=>c.index===v)?.open})})]}),s?.find(c=>c.index===v)?.open&&e("div",{className:"flex flex-col",children:f.subSubCategories?.map((c,o)=>e(h,{html:c.label,onClick:()=>{x(v,o),d?.(c,o)},className:N("cursor-pointer hover:bg-[#F5F5F7] px-6 py-4 text-sm font-bold leading-[1.4] text-[#6D6D6F]",{"bg-[#F5F5F7]":u===o})},`subSubItem-${v}-${o}`))})]},`subcategoryItem-${v}`)})}),t&&e("div",{className:"flex",children:l("div",{className:"flex flex-col gap-4",children:[t?.primary&&e($,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"text-sm lg-desktop:text-base",children:t?.primary?.label}),t?.secondary&&e($,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"justify-start !p-0 text-sm lg-desktop:text-base",children:t?.secondary?.label})]})})]}),l("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(r).length>0&&l("div",{className:"mb-4 flex items-center justify-between",children:[l("div",{className:"flex items-center gap-2",children:[e(h,{html:r?.label,className:"text-xl lg-desktop:text-2xl font-bold leading-[1.4]"}),r?.primary&&!r?.primary?.hide&&e($,{as:"a",href:`${r?.primary?.url}?ref=${r?.label}_viewmore`,variant:"link",size:"lg",className:"justify-start !p-0 text-sm lg-desktop:text-base font-bold leading-[1.2] no-underline",children:r?.primary?.label})]}),e(_,{href:r?.guide?.url,className:"text-sm lg-desktop:text-base leading-[1.2] text-[#6D6D6F]",children:r?.guide?.label})]}),e("div",{className:"flex flex-col gap-4 overflow-y-auto h-[426px]",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:r?.series?.map((f,v)=>l("div",{children:[f.label&&e(h,{html:f.label,className:"text-sm mb-2 font-bold leading-[1.4] text-[#6D6D6F]"}),l("div",{className:"grid grid-cols-3 gap-4",children:[!!r?.banner&&e(_,{asChild:!r?.banner?.href,href:r?.banner?.href,children:l("div",{className:"relative [&_img]:hover:scale-105 [&_img]:hover:transition-all [&_img]:hover:duration-300",children:[e(V,{source:r?.banner?.imageUrl,className:"h-[114px] laptop:h-[120px]",imgClassName:"object-cover h-full"}),l("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:[e(se,{size:2,html:r?.banner?.title||"Buy in Guide",className:"font-bold text-white"}),e(h,{html:r?.banner?.desc||"20.000mAh",className:"text-sm text-white font-bold"})]})]})}),f.products?.map((p,c)=>e(pe,{seriesLabel:r?.label,product:p,isCollection:r?.isCollection},`seriesProductItem-${c}`))]})]},`seriesItem-${v}`))})]})]})}),Fe=({multicolMetadata:t})=>{const a=F(null);return e("div",{ref:a,children:e(ee,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:t?.map((n,d)=>e("div",{className:"w-1/4",children:e(be,{item:n})},`multicolItem-${n?.label}-${d}`))})})})},_e=({supportsMetadata:t,currentNavItemRef:a})=>{const n=F(null),[d,s]=M(null),[b,u]=M(0);H(()=>{if(n?.current){const m=n?.current?.getBoundingClientRect();u(m.height)}},[n]);const i=Me(()=>{if(a){const m=a.getBoundingClientRect();s(m)}},500);return H(()=>(i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}),[i]),H(()=>{if(a){const m=a.getBoundingClientRect();s(m)}},[a]),e("div",{className:"absolute top-0 h-full bg-white transition-all duration-500 overflow-hidden",style:{right:`calc(100% - ${d?.right}px)`,height:b},children:e("div",{ref:n,className:"p-4",children:t?.map(m=>e("div",{className:"py-2",children:e(_,{href:m.url,className:"text-sm font-bold leading-[1.4] no-underline",children:m.label})},m.id))})})},pe=({product:t,isCollection:a,position:n,seriesLabel:d})=>{const{buildProps:s,onSeriesProductClick:b}=O();let u=a?t:s?.products?.find(r=>r.handle===t.handle);const i=u?.variants?.find(r=>r.sku===t.sku)||u?.variants?.[0],m=L(()=>`/products/${u?.handle}?variant=${De(i?.id)}`,[u?.handle,i?.id]),w=L(()=>u?.tags?.filter?.(r=>r?.startsWith?.("CLtag"))?.map?.(r=>r?.replace?.("CLtag:",""))?.slice?.(0,2),[u?.tags]);return i?.availableForSale?l("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-105",children:[e("div",{className:"shrink-0",children:e(V,{source:`${i?.image?.url||t?.images?.[0]?.url}}`,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),l("div",{className:"relative",children:[e("div",{className:"flex gap-1",children:Array.isArray(w)&&w?.map(r=>e(h,{as:"p",html:r,className:"text-brand-0 whitespace-nowrap mb-1 inline-block h-[24px] rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"}))}),e(_,{href:m,onClick:r=>{r.preventDefault(),window.open(m),b?.(u,n||0,d)},className:"no-underline hover:text-current",children:e(h,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:u?.title||t?.name})}),t?.desc&&e(h,{as:"p",html:t?.desc,className:"lg-desktop:text-sm line-clamp-1 mt-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]}):null},be=({item:t,allPicture:a})=>l(q,{children:[t?.columns&&l(q,{children:[e(h,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:t.columns?.map(n=>l("div",{className:"py-2 flex items-center gap-1",children:[e(_,{href:`${n.url}?ref=navMenu`,asChild:!n.url,className:"text-sm font-bold leading-[1.4] no-underline",children:n.label}),n?.badge&&e(h,{as:"p",html:n?.badge||"badge",className:"text-sm font-bold !leading-[22px] text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px]"})]},n.label))})]}),t?.imageUrl&&e("div",{className:N("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] h-[240px] max-w-[358px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative overflow-hidden",{"tablet:max-w-none laptop:max-w-none":a}),children:l(_,{href:`${t.url}?ref=navMenu`,asChild:!t.url,children:[e(V,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),l("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[e(h,{html:t.title,className:N("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":t?.theme==="dark"})}),t.subtitle&&e(h,{html:t.subtitle,className:N("text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"})}),t?.primary?.label&&e($,{as:"a",href:t?.primary?.url,variant:"link",size:"lg",className:N("text-sm font-bold mr-auto !p-0 leading-[1.4] text-white",{"text-black":t?.theme==="dark"}),children:t?.primary?.label||"more"})]})]})})]}),Oe=Z(({data:t,className:a,onPrimaryNavClick:n},d)=>{const s=L(()=>ue(t?.categories?.filter(S=>S?.mobileShow)),[t]),{currentMenu:b,setCurrentMenu:u,subSubCategory:i}=O(),[m,w]=M(!1),[r,k]=M(0),[x,f]=M(null),v=F(null);H(()=>{if(v?.current&&m){const S=v?.current?.getBoundingClientRect();k(window?.innerHeight-(S?.bottom||0))}},[m]),oe(()=>{re.fromTo(v.current,{height:0},{height:r,duration:.3})},[r]),H(()=>{document.documentElement.style.overflow=m?"hidden":"auto"},[m]);const p=L(()=>x?.components?.[0]?.blockType,[x]),c=ce(Ue,{categoriesItem:x}),o=ie(We,x),y=de(Ge,x),z=L(()=>{switch(p){case I.Sidebar:return e(o,{});case I.Supports:return e(c,{});case I.Multicol:return e(y,{});default:return null}},[p,x,c]),C=G(()=>{w(!1),k(0),u&&u(A.Primary)},[w,k,u]),P=L(()=>t?.headerBar?.actions?.filter(S=>S?.mobileShow&&S?.blockType!==W.Profile),[t]),D=L(()=>t?.headerBar?.actions?.find(S=>S?.mobileShow&&S?.blockType===W.Profile)||{},[t]),U=L(()=>{switch(b){case A.Primary:return e(Je,{actions:P,menuOpen:m,onMenuOpenClose:()=>{w(!1),k(0)},onMenuOpenClick:()=>w(!0)});case A.Secondary:return e(he,{title:x?.text,onMenuOpenClose:C,onMenuBackClick:()=>u?.(A.Primary)});case A.Third:return e(he,{title:i?.label,onMenuOpenClose:C,onMenuBackClick:()=>u?.(A.Secondary)});default:return null}},[m,b,u,x,P,i,C]),R=G((S,Q)=>{const B=Array.isArray(s)?Array.isArray(s[S])?s[S][Q]:{}:{};f(B),B?.components?.[0]?.blockType===I.Links?B?.components?.[0]?.url&&window.open(B?.components?.[0]?.url):u?.(A.Secondary)},[s,u]);return l(ee,{className:N("relative h-[52px]",a),children:[U,m&&e("div",{ref:v,className:"absolute left-0 top-full text-black border-t border-[#E4E5E6] z-[999] w-full overflow-y-auto bg-white",style:{height:r},children:b===A.Primary?e(Ie,{categories:s,onPrimaryMenuClick:R,onPrimaryNavClick:n,profileAction:D}):z})]})}),Ie=({categories:t,onPrimaryMenuClick:a,profileAction:n,onPrimaryNavClick:d})=>{const{onSidebarNavClick:s}=O();return l("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((b,u)=>l("div",{className:"",children:[b?.map((i,m)=>e(Y,{label:i.text,onClick:()=>{const r=(t?.flat()||[])?.findIndex(k=>k?.id===t[u][m]?.id);a(u,m),d?.(i,r)},icon:i.components?.[0]?.icon},i.id)),e("div",{className:N("my-2 h-px w-full bg-[#E5E5E7]",{hidden:u===t.length-1})})]},`groupCategory-${u}`))}),e(Ke,{profileAction:n})]})},We=({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{currentMenu:n,setCurrentMenu:d,subSubCategory:s,setSubSubCategory:b,setCurrentSeriesMetadata:u,currentSeriesMetadata:i,buildProps:m,onSidebarNavClick:w}=O(),[r,k]=M([]),[x,f]=M([]);H(()=>{t?.subcategories?.length&&k(t?.subcategories?.map((o,y)=>({index:y,open:!1})))},[t]),H(()=>{s?.subSubCategories?.length&&f(s?.subSubCategories?.map((o,y)=>({index:y,open:y===0})))},[s]);const v=G((o,y)=>{d&&d(A.Third),b?.(o);const z=a?.find(C=>y!==void 0?o?.subSubCategories?.[y]?.label?.toLowerCase()===C.label?.toLowerCase():o?.label?.toLowerCase()===C.label?.toLowerCase())||{};if(o?.collections){const C=m?.categories?.[o?.collections]||{};u?.({label:z?.label,isCollection:!0,banner:z?.banner,primary:z?.primary,series:[{products:C?.products}]})}else u?.(z)},[a,t,d,b,u]),p=L(()=>a?.find(o=>!!o?.guide)?.guide,[a,t]);return L(()=>{switch(n){case A.Secondary:return l("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col justify-between tablet:justify-start tablet:gap-16 p-4",children:[e("div",{children:t?.subcategories?.map((o,y)=>e("div",{children:e(Y,{label:o?.label,active:r.find(z=>z.index===y)?.open,onClick:()=>{v(o),w?.(o,y)}})},`${o.label}-${y}`))}),l("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&e($,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&e($,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case A.Third:return l("div",{className:"tablet:px-8 laptop:px-16 p-4",children:[s?.subSubCategories?s?.subSubCategories?.map((o,y)=>{const z=a?.find(P=>P.label.toLowerCase()===o?.label?.toLowerCase())||{};let C={};if(o?.collections){const P=m?.categories?.[o?.collections]||{};C={label:z?.label,isCollection:!0,banner:z?.banner,primary:z?.primary,series:[{products:P?.products}]}}else C=z;return l("div",{children:[Reflect.ownKeys(o).length>0&&e(fe,{matchSeriesMetadata:C,onSubSubCategoryItemClick:()=>{w?.(o,y),f(P=>P.map((D,U)=>({...D,open:U===y})))},expanded:!!x?.find(P=>P.index===y)?.open}),x?.find(P=>P.index===y)?.open&&l(q,{children:[e(ve,{matchSeriesMetadata:C}),C?.primary&&e("div",{className:"text-center my-4",children:e($,{as:"a",href:C?.primary?.url,className:"text-base no-underline leading-[1.2]",variant:"secondary",size:"base",children:C?.primary?.label})})]})]},`${o.label}-${y}`)}):l(q,{children:[Reflect.ownKeys(i).length>0&&e(fe,{matchSeriesMetadata:i}),e(ve,{matchSeriesMetadata:i}),i?.primary&&e("div",{className:"text-center my-4 ",children:e($,{as:"a",href:`${i?.primary?.url}?ref=${i?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base no-underline leading-[1.2]",children:i?.primary?.label})})]}),p&&e(_,{href:p?.url,children:e("div",{className:"mt-4",children:e(h,{html:p?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]});default:return null}},[n,t,d,a,r,x,b,s,u,i])},fe=({matchSeriesMetadata:t,onSubSubCategoryItemClick:a,expanded:n})=>l("div",{className:"tablet:pt-0 py-4 flex items-center justify-between",onClick:a,children:[t?.label&&e(h,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&e(te,{className:N("size-5",{"rotate-180":n})})]}),ve=({matchSeriesMetadata:t})=>e("div",{className:"flex flex-col gap-2 laptop:gap-3",children:!!t?.series?.length&&t?.series?.map((a,n)=>l("div",{children:[a.label&&e(h,{html:a.label,className:"text-sm mb-2 font-bold leading-[1.4] text-[#3D3D3F]"}),l("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&e(_,{asChild:!t?.banner?.href,href:t?.banner?.href,children:l("div",{className:"relative [&_img]:hover:scale-105 [&_img]:hover:transition-all [&_img]:hover:duration-300",children:[e(V,{source:t?.banner?.imageUrl,className:"h-[114px] laptop:h-[120px]",imgClassName:"object-cover h-full"}),l("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:[e(se,{size:2,html:t?.banner?.title||"Buy in Guide",className:N("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),e(h,{html:t?.banner?.desc||"20.000mAh",className:N("text-sm text-white font-bold",{"text-black":t?.banner?.theme==="dark"})})]})]})}),a.products?.map((d,s)=>e(pe,{position:s,product:d,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${n}-${s}`))]})]},`seriesItem-${n}`))}),Ue=({supportsMetadata:t})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(a=>e(Y,{href:a.url,label:a.label,onClick:()=>{}},a.id))}),Ge=({multicolMetadata:t})=>{const a=L(()=>!t?.some(n=>!!n.columns),[t]);return e("div",{className:N("tablet:py-4 tablet:px-8 laptop:px-16 flex flex-col gap-4 tablet:gap-6 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":a}),children:t?.map((n,d)=>e("div",{children:e(be,{item:n,allPicture:a})},`multicolItem-${n?.label}-${d}`))})},Ke=({profileAction:t})=>{const[a,n]=M(!1),{profile:d,event:s}=O();return l("div",{className:N("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":a}),children:[l("div",{className:"flex items-center justify-between",onClick:()=>n(!a),children:[l("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:e(Ee,{})}),e(h,{html:d?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!d?.email&&e(te,{className:N("size-5 laptop:size-4",{"rotate-180":a})})]}),d?.email&&e("div",{className:"mt-4",children:t?.profiles?.map(b=>e(Y,{label:b?.title,href:b?.url},b.id))}),a&&!d?.email&&l("div",{className:"mt-4",children:[e(h,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:t?.benefits?.map(b=>l("div",{className:"flex items-center gap-[6px]",children:[e(V,{source:b.benefitIcon?.url,className:"size-4",alt:b.benefit,width:16,height:16}),e(h,{html:b.benefit,className:"text-sm font-bold leading-[1.4]"})]},b.id))})]}),!d?.email&&l("div",{className:"mt-4 flex items-center gap-3",children:[e($,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>s?.join?.(),children:e(h,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e($,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>s?.login?.(),children:e(h,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Je=({menuOpen:t,onMenuOpenClose:a,onMenuOpenClick:n,actions:d})=>l("div",{className:"flex h-full items-center justify-between gap-4",children:[e(ge,{}),l("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(ye,{actions:d}),t?e(me,{className:"size-5",onClick:()=>a()}):e(ze,{className:"size-5",onClick:()=>n()})]})]}),ge=()=>{const{payloadData:t,isMobile:a}=O();return e("div",{className:"[&>svg]:w-full hover:text-brand-0 cursor-pointer",onClick:()=>{window.location.href="/"},dangerouslySetInnerHTML:{__html:a?t?.headerBar?.mobileLogo:t?.headerBar?.desktopLogo}})},ye=Z(({actions:t,activeStatus:a=!1},n)=>{const{event:d}=O(),[s,b]=M(null),u=G((i,m)=>{switch(b(m),i?.blockType){case W.Search:d?.search?.();break;case W.Cart:d?.cart?.();break;case W.Profile:d?.profile?.();break;case W.Livestream:d?.livestream?.();break;default:return()=>{}}},[d]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map((i,m)=>e("div",{ref:i.blockType===W.Profile?n:null,onClick:()=>u(i,m),children:e(h,{html:i.icon,className:N("cursor-pointer size-5",{"text-brand-0":a&&s===m})})},i.id))})}),he=({title:t,onMenuOpenClose:a,onMenuBackClick:n})=>l("div",{className:"flex h-full items-center gap-3",children:[e(Be,{className:"size-5",onClick:()=>n()}),e(h,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e(me,{className:"size-5",onClick:()=>a()})]}),Y=({label:t,href:a,onClick:n,active:d,icon:s,className:b})=>e("div",{className:N("flex cursor-pointer items-center justify-between py-4",b),onClick:n,children:l(_,{href:a,asChild:!a,className:"flex w-full items-center justify-between no-underline",children:[l("div",{className:"flex items-center gap-4",children:[e(h,{html:t,className:N("text-sm font-bold leading-[1.4]",{underline:s})}),s&&e(h,{html:s})]}),e(He,{className:N("size-5 laptop:size-4",{"rotate-90":d})})]})});var ut=Se(Re);export{ut as default};
2
2
  //# sourceMappingURL=index.js.map