@anker-in/headless-ui 1.2.2 → 1.2.3-alpha.1778583232121

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 (323) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js.map +3 -3
  3. package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
  4. package/dist/cjs/biz-components/ActivityMechanism/index.js.map +3 -3
  5. package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
  6. package/dist/cjs/biz-components/ActivitySchedule/index.js.map +3 -3
  7. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  8. package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
  9. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  10. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
  11. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  12. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
  13. package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
  14. package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
  15. package/dist/cjs/biz-components/Category/index.js +1 -1
  16. package/dist/cjs/biz-components/Category/index.js.map +3 -3
  17. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  18. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  19. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  20. package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
  21. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  22. package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
  23. package/dist/cjs/biz-components/Faq/types.d.ts +0 -1
  24. package/dist/cjs/biz-components/Faq/types.js +1 -1
  25. package/dist/cjs/biz-components/Faq/types.js.map +1 -1
  26. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
  27. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +3 -3
  28. package/dist/cjs/biz-components/GiftBox/index.js +1 -1
  29. package/dist/cjs/biz-components/GiftBox/index.js.map +2 -2
  30. package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
  31. package/dist/cjs/biz-components/GiftShelf/index.js.map +3 -3
  32. package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
  33. package/dist/cjs/biz-components/GiftTierShelf/index.js.map +3 -3
  34. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  35. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  36. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  37. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  38. package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +12 -0
  39. package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js +2 -0
  40. package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +7 -0
  41. package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +10 -0
  42. package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js +2 -0
  43. package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js.map +7 -0
  44. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  45. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  46. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +8 -1
  47. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  48. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
  49. package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
  50. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
  51. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  52. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  53. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  54. package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  55. package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js.map +3 -3
  56. package/dist/cjs/biz-components/HeroBanner/types.d.ts +5 -0
  57. package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
  58. package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
  59. package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
  60. package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
  61. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  62. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  63. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  64. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  65. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  66. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  67. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  68. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  69. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.d.ts +2 -0
  70. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +1 -1
  71. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +1 -1
  72. package/dist/cjs/biz-components/LotteryShared/ErrorModal.d.ts +4 -0
  73. package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +2 -2
  74. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +13 -13
  75. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js +1 -1
  76. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
  77. package/dist/cjs/biz-components/LotteryShared/types.d.ts +9 -0
  78. package/dist/cjs/biz-components/LotteryShared/types.js.map +2 -2
  79. package/dist/cjs/biz-components/Marquee/Marquee.d.ts +11 -4
  80. package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
  81. package/dist/cjs/biz-components/Marquee/Marquee.js.map +3 -3
  82. package/dist/cjs/biz-components/Marquee/index.d.ts +1 -1
  83. package/dist/cjs/biz-components/Marquee/index.js +1 -1
  84. package/dist/cjs/biz-components/Marquee/index.js.map +2 -2
  85. package/dist/cjs/biz-components/Marquee/type.d.ts +22 -4
  86. package/dist/cjs/biz-components/Marquee/type.js +1 -1
  87. package/dist/cjs/biz-components/Marquee/type.js.map +1 -1
  88. package/dist/cjs/biz-components/Media/index.js +1 -1
  89. package/dist/cjs/biz-components/Media/index.js.map +2 -2
  90. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  91. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
  92. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  93. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +3 -3
  94. package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.d.ts +9 -0
  95. package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.js +2 -0
  96. package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.js.map +7 -0
  97. package/dist/cjs/biz-components/MediaTextOverlay/index.d.ts +2 -0
  98. package/dist/cjs/biz-components/MediaTextOverlay/index.js +2 -0
  99. package/dist/cjs/biz-components/MediaTextOverlay/index.js.map +7 -0
  100. package/dist/cjs/biz-components/MediaTextOverlay/types.d.ts +24 -0
  101. package/dist/cjs/biz-components/MediaTextOverlay/types.js +2 -0
  102. package/dist/cjs/biz-components/MediaTextOverlay/types.js.map +7 -0
  103. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  104. package/dist/cjs/biz-components/MemberEquity/index.js.map +3 -3
  105. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  106. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  107. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  108. package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
  109. package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
  110. package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +3 -3
  111. package/dist/cjs/biz-components/ProductLottery/types.d.ts +62 -5
  112. package/dist/cjs/biz-components/ProductLottery/types.js +1 -1
  113. package/dist/cjs/biz-components/ProductLottery/types.js.map +2 -2
  114. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  115. package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
  116. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  117. package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
  118. package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.d.ts +1 -0
  119. package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.js +1 -1
  120. package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.js.map +3 -3
  121. package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +9 -0
  122. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  123. package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
  124. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  125. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +2 -2
  126. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.d.ts +1 -0
  127. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  128. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +1 -1
  129. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  130. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  131. package/dist/cjs/biz-components/Subscribe/index.js +1 -1
  132. package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
  133. package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
  134. package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
  135. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  136. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
  137. package/dist/cjs/biz-components/Title/index.js +1 -1
  138. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  139. package/dist/cjs/biz-components/WebPushPopup/index.d.ts +44 -0
  140. package/dist/cjs/biz-components/WebPushPopup/index.js +2 -0
  141. package/dist/cjs/biz-components/WebPushPopup/index.js.map +7 -0
  142. package/dist/cjs/biz-components/WheelLottery/index.js +1 -1
  143. package/dist/cjs/biz-components/WheelLottery/index.js.map +3 -3
  144. package/dist/cjs/biz-components/index.d.ts +6 -0
  145. package/dist/cjs/biz-components/index.js +1 -1
  146. package/dist/cjs/biz-components/index.js.map +3 -3
  147. package/dist/cjs/components/Countdown.js +1 -1
  148. package/dist/cjs/components/Countdown.js.map +3 -3
  149. package/dist/cjs/components/button.d.ts +4 -0
  150. package/dist/cjs/components/button.js +1 -1
  151. package/dist/cjs/components/button.js.map +3 -3
  152. package/dist/cjs/components/link.js +1 -1
  153. package/dist/cjs/components/link.js.map +2 -2
  154. package/dist/cjs/helpers/index.d.ts +1 -1
  155. package/dist/cjs/helpers/index.js +1 -1
  156. package/dist/cjs/helpers/index.js.map +2 -2
  157. package/dist/cjs/helpers/isLexicalEmpty.d.ts +5 -0
  158. package/dist/cjs/helpers/isLexicalEmpty.js +1 -1
  159. package/dist/cjs/helpers/isLexicalEmpty.js.map +3 -3
  160. package/dist/cjs/hooks/useEmarsysWebPush.d.ts +111 -0
  161. package/dist/cjs/hooks/useEmarsysWebPush.js +2 -0
  162. package/dist/cjs/hooks/useEmarsysWebPush.js.map +7 -0
  163. package/dist/cjs/hooks/useProductListTrack.d.ts +43 -0
  164. package/dist/cjs/hooks/useProductListTrack.js +2 -0
  165. package/dist/cjs/hooks/useProductListTrack.js.map +7 -0
  166. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  167. package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
  168. package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
  169. package/dist/esm/biz-components/ActivityMechanism/index.js.map +3 -3
  170. package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
  171. package/dist/esm/biz-components/ActivitySchedule/index.js.map +3 -3
  172. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  173. package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
  174. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  175. package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
  176. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  177. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
  178. package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
  179. package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
  180. package/dist/esm/biz-components/Category/index.js +1 -1
  181. package/dist/esm/biz-components/Category/index.js.map +3 -3
  182. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  183. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  184. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  185. package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
  186. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  187. package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
  188. package/dist/esm/biz-components/Faq/types.d.ts +0 -1
  189. package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
  190. package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +3 -3
  191. package/dist/esm/biz-components/GiftBox/index.js +1 -1
  192. package/dist/esm/biz-components/GiftBox/index.js.map +2 -2
  193. package/dist/esm/biz-components/GiftShelf/index.js +1 -1
  194. package/dist/esm/biz-components/GiftShelf/index.js.map +3 -3
  195. package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
  196. package/dist/esm/biz-components/GiftTierShelf/index.js.map +3 -3
  197. package/dist/esm/biz-components/Graphic/index.js +1 -1
  198. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  199. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  200. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  201. package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +12 -0
  202. package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js +2 -0
  203. package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +7 -0
  204. package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +10 -0
  205. package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js +2 -0
  206. package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js.map +7 -0
  207. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  208. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  209. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +8 -1
  210. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  211. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  212. package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
  213. package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
  214. package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  215. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  216. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  217. package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  218. package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js.map +3 -3
  219. package/dist/esm/biz-components/HeroBanner/types.d.ts +5 -0
  220. package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
  221. package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
  222. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  223. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  224. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  225. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  226. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  227. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  228. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  229. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  230. package/dist/esm/biz-components/Listing/components/PurchaseBar/types.d.ts +2 -0
  231. package/dist/esm/biz-components/LotteryShared/ErrorModal.d.ts +4 -0
  232. package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +2 -2
  233. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +13 -13
  234. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js +1 -1
  235. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
  236. package/dist/esm/biz-components/LotteryShared/types.d.ts +9 -0
  237. package/dist/esm/biz-components/LotteryShared/types.js.map +2 -2
  238. package/dist/esm/biz-components/Marquee/Marquee.d.ts +11 -4
  239. package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
  240. package/dist/esm/biz-components/Marquee/Marquee.js.map +3 -3
  241. package/dist/esm/biz-components/Marquee/index.d.ts +1 -1
  242. package/dist/esm/biz-components/Marquee/index.js +1 -1
  243. package/dist/esm/biz-components/Marquee/index.js.map +3 -3
  244. package/dist/esm/biz-components/Marquee/type.d.ts +22 -4
  245. package/dist/esm/biz-components/Media/index.js +1 -1
  246. package/dist/esm/biz-components/Media/index.js.map +2 -2
  247. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  248. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
  249. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  250. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
  251. package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.d.ts +9 -0
  252. package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.js +2 -0
  253. package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.js.map +7 -0
  254. package/dist/esm/biz-components/MediaTextOverlay/index.d.ts +2 -0
  255. package/dist/esm/biz-components/MediaTextOverlay/index.js +2 -0
  256. package/dist/esm/biz-components/MediaTextOverlay/index.js.map +7 -0
  257. package/dist/esm/biz-components/MediaTextOverlay/types.d.ts +24 -0
  258. package/dist/esm/biz-components/MediaTextOverlay/types.js +1 -0
  259. package/dist/esm/biz-components/MediaTextOverlay/types.js.map +7 -0
  260. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  261. package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
  262. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  263. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  264. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  265. package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
  266. package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
  267. package/dist/esm/biz-components/ProductHero/ProductHero.js.map +3 -3
  268. package/dist/esm/biz-components/ProductLottery/types.d.ts +62 -5
  269. package/dist/esm/biz-components/ProductLottery/types.js.map +2 -2
  270. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  271. package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
  272. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  273. package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
  274. package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.d.ts +1 -0
  275. package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.js +1 -1
  276. package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.js.map +3 -3
  277. package/dist/esm/biz-components/SecondaryBanner/index.d.ts +9 -0
  278. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  279. package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
  280. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  281. package/dist/esm/biz-components/ShelfDisplay/index.js.map +2 -2
  282. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.d.ts +1 -0
  283. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +1 -1
  284. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  285. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  286. package/dist/esm/biz-components/Subscribe/index.js +1 -1
  287. package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
  288. package/dist/esm/biz-components/SwiperBox/index.js +1 -1
  289. package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
  290. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  291. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
  292. package/dist/esm/biz-components/Title/index.js +1 -1
  293. package/dist/esm/biz-components/Title/index.js.map +3 -3
  294. package/dist/esm/biz-components/WebPushPopup/index.d.ts +44 -0
  295. package/dist/esm/biz-components/WebPushPopup/index.js +2 -0
  296. package/dist/esm/biz-components/WebPushPopup/index.js.map +7 -0
  297. package/dist/esm/biz-components/WheelLottery/index.js +1 -1
  298. package/dist/esm/biz-components/WheelLottery/index.js.map +2 -2
  299. package/dist/esm/biz-components/index.d.ts +6 -0
  300. package/dist/esm/biz-components/index.js +1 -1
  301. package/dist/esm/biz-components/index.js.map +3 -3
  302. package/dist/esm/components/Countdown.js +1 -1
  303. package/dist/esm/components/Countdown.js.map +3 -3
  304. package/dist/esm/components/button.d.ts +4 -0
  305. package/dist/esm/components/button.js +1 -1
  306. package/dist/esm/components/button.js.map +3 -3
  307. package/dist/esm/components/link.js +1 -1
  308. package/dist/esm/components/link.js.map +2 -2
  309. package/dist/esm/helpers/index.d.ts +1 -1
  310. package/dist/esm/helpers/index.js +1 -1
  311. package/dist/esm/helpers/index.js.map +3 -3
  312. package/dist/esm/helpers/isLexicalEmpty.d.ts +5 -0
  313. package/dist/esm/helpers/isLexicalEmpty.js +1 -1
  314. package/dist/esm/helpers/isLexicalEmpty.js.map +3 -3
  315. package/dist/esm/hooks/useEmarsysWebPush.d.ts +111 -0
  316. package/dist/esm/hooks/useEmarsysWebPush.js +2 -0
  317. package/dist/esm/hooks/useEmarsysWebPush.js.map +7 -0
  318. package/dist/esm/hooks/useProductListTrack.d.ts +43 -0
  319. package/dist/esm/hooks/useProductListTrack.js +2 -0
  320. package/dist/esm/hooks/useProductListTrack.js.map +7 -0
  321. package/package.json +1 -1
  322. package/style.css +143 -11
  323. package/tailwind.config.js +10 -0
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var Me=Object.create;var Q=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var De=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var Te=(n,r)=>{for(var i in r)Q(n,i,{get:r[i],enumerable:!0})},ie=(n,r,i,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of Pe(r))!Ee.call(n,p)&&p!==i&&Q(n,p,{get:()=>r[p],enumerable:!(u=Se(r,p))||u.enumerable});return n};var V=(n,r,i)=>(i=n!=null?Me(De(n)):{},ie(r||!n||!n.__esModule?Q(i,"default",{value:n,enumerable:!0}):i,n)),He=n=>ie(Q({},"__esModule",{value:!0}),n);var Ie={};Te(Ie,{default:()=>Re});module.exports=He(Ie);var e=require("react/jsx-runtime"),t=require("react"),l=require("../../components/index.js"),me=require("../../shared/Styles.js"),y=require("../../helpers/utils.js"),j=V(require("./NavProvider.js")),o=require("./types.js"),pe=V(require("jump.js")),X=require("@gsap/react"),Z=require("gsap"),C=require("./withCategory.js"),w=require("./icons/index.js"),fe=V(require("../NavigationSearch/index.js")),be=require("./ResourceSidebarDropdown.js"),ve=require("./MobileResourceSidebarMenu.js"),ge=require("./SidebarDropdown.js"),ee=require("./useScrollLock.js"),he=require("./MulticolDropdown.js"),ye=require("./SupportsDropdown.js"),Ne=require("./MobileSidebarMenu.js"),ke=require("./MobileSupportMenu.js"),xe=require("./MobileMulticolMenu.js"),te=require("./MobileMenuComponents.js"),ae=require("../AiuiProvider/index.js"),Ce=V(require("../../shared/throttle.js"));const le=(0,t.forwardRef)((n,r)=>{const{data:{header:i}={},buildProps:u,event:p,profile:h,theme:s="light",isTop:c=!1,searchResult:D,onSearch:m,isSearching:N,keywords:W,onPrimaryNavClick:k,onSeriesProductClick:b,onSidebarNavClick:G,headerId:L,cartCount:I,menuData:z,..._}=n,[S,B]=(0,t.useState)(!1),[F,P]=(0,t.useState)(!1),[v,E]=(0,t.useState)(!1),[J,A]=(0,t.useState)(!1),g=(0,t.useRef)(null),T=(0,t.useRef)(null),H=()=>{const x=document?.querySelector("body")?.offsetWidth||0;A(x<=1440)};(0,t.useEffect)(()=>(H(),window.addEventListener("resize",H),()=>{window.removeEventListener("resize",H)}),[]),(0,t.useImperativeHandle)(r,()=>T.current),(0,t.useEffect)(()=>{T.current&&c&&(0,pe.default)(T.current,{duration:0,offset:T.current?.getBoundingClientRect()?.bottom||0})},[c]),(0,t.useEffect)(()=>{if(c){P(!1),E(!1);return}let x=0,U=0,$=0;const R=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,K=R();x=K,P(K>300),E(K>30);const a=(0,Ce.default)(()=>{const d=R(),f=d-x;E(d>30),f>0?(U=0,$+=f,$>=300&&d>300&&P(!0)):f<0&&($=0,U+=Math.abs(f),U>=300&&(P(!1),U=0)),x=d},100);return window.addEventListener("scroll",a,{passive:!0}),()=>window.removeEventListener("scroll",a)},[c]),(0,t.useEffect)(()=>{p&&(p.search=()=>B(!0))},[p]),(0,X.useGSAP)(()=>{g?.current&&S&&Z.gsap.fromTo(g.current,{height:0},{height:"auto",duration:.3})},[S]),(0,ee.useScrollLock)(S);const ne=(0,t.useMemo)(()=>i?.bar?.actions?.find(x=>x?.blockType===o.HeaderNavigationActionBlockType.Search)?.searchBar?.[0]||{},[i]);return(0,e.jsx)(j.default,{buildProps:u,profile:h,isMobile:J,event:p,payloadData:i,onSidebarNavClick:G,onSeriesProductClick:b,cartCount:I,children:(0,e.jsx)("header",{..._,id:L||"header","data-ui-component-id":"HeaderNavigation",className:c?"relative z-[100] bg-white":(0,y.cn)("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":F}),ref:T,children:(0,e.jsxs)("div",{className:(0,y.cn)("hover:bg-white hover:text-black",s==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!c&&v},{"hover:!text-black":s==="dark","!text-black":!c&&v}),onClick:()=>!c&&E(!0),children:[(0,e.jsx)(se,{data:i,className:"desktop:block hidden !bg-white",theme:s,onNavItemClick:()=>!c&&E(!0),onPrimaryNavClick:k}),(0,e.jsx)(ce,{menuData:z,data:i,className:"desktop:hidden block !bg-white",onPrimaryNavClick:k}),S&&(0,e.jsxs)("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${T?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[(0,e.jsx)("div",{ref:g,className:(0,y.cn)("overflow-y-auto",{}),children:(0,e.jsx)(fe.default,{data:ne,keywords:W,isSearching:N,searchResult:D,onSearch:x=>{m?.(x)},onClose:()=>{m?.(),B(!1)}})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>B(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:x=>{(x.key==="Enter"||x.key===" "||x.key==="Escape")&&(x.preventDefault(),B(!1))}})]})]})})})}),se=(0,t.forwardRef)((n,r)=>{const{data:i,onNavItemClick:u,className:p,theme:h,onPrimaryNavClick:s}=n,{event:c,profile:D}=(0,j.useNavContext)(),[m,N]=(0,t.useState)(!1),{locale:W="us"}=(0,ae.useAiuiContext)(),k=(0,t.useMemo)(()=>(0,C.WithGroupCategory)(i?.categories?.filter(a=>a?.pcShow)),[i]),[b,G]=(0,t.useState)(null),[L,I]=(0,t.useState)([]),z=(0,t.useRef)(null),[_,S]=(0,t.useState)(!1),B=(0,t.useRef)(null),F=(0,t.useRef)(null),P=(0,t.useRef)(k.map(a=>Array(a?.length||0).fill(null)));(0,t.useEffect)(()=>{k?.length&&I(k?.map((a,d)=>a?.map((f,M)=>({groupIndex:d,index:M,open:!1}))))},[k]);const v=(0,t.useMemo)(()=>{let a=null;for(const d of L){for(const f of d)if(f.open){a=f;break}if(a)break}return a},[L]);(0,ee.useScrollLock)(!!v?.open||_);const E=(a,d,f)=>{S(!1);const M=k[d][f];if(M?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links)M?.components?.[0]?.url&&window.open(M?.components?.[0]?.url);else{const Y=k?.flat()||[],O=Y?.findIndex(oe=>oe?.id===k[d][f]?.id);a.stopPropagation(),u?.(),s?.(Y[O],O),G(M),I(oe=>oe.map(we=>we.map(q=>q.groupIndex===d&&q.index===f?{...q,open:!q.open}:{...q,open:!1})))}},J=(a,d,f)=>{a.key==="Enter"||a.key===" "?(a.preventDefault(),E(a,d,f)):a.key==="Escape"&&v?.groupIndex===d&&v?.index===f&&(a.preventDefault(),A())},A=()=>{I(a=>a.map(d=>d.map(f=>({...f,open:!1}))))},g=(0,t.useMemo)(()=>{if(b)return b?.components?.[0]?.blockType},[b]),T=(0,C.WithSidebar)(ge.SidebarDropdown,b),H=(0,C.WithResource)(be.ResourceSidebarDropdown,b),ne=(0,C.WithMulticol)(he.MulticolDropdown,b),x=(0,C.WithSupports)(ye.SupportsDropdown,{categoriesItem:b,currentNavItemRef:P.current?.[v?.groupIndex||0]?.[v?.index||0]}),U=(0,t.useMemo)(()=>{switch(g){case o.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(T,{});case o.HeaderNavigationBlockType.Resource:return(0,e.jsx)(H,{});case o.HeaderNavigationBlockType.Supports:return(0,e.jsx)(x,{});case o.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(ne,{});default:return null}},[g,b]),$=(0,t.useMemo)(()=>i?.bar?.actions?.filter(a=>a?.pcShow),[i]),R=(0,t.useMemo)(()=>$?.find(a=>a?.blockType===o.HeaderNavigationActionBlockType.Profile),[$]),K=(0,t.useCallback)(()=>{S(a=>!a)},[]);return(0,t.useEffect)(()=>{if(z?.current){const a=z.current;return a.addEventListener("click",K),()=>{a.removeEventListener("click",K)}}},[K]),(0,X.useGSAP)(()=>{v?.open&&Z.gsap.fromTo(F?.current,{height:0},{height:"auto"})},[v?.open]),(0,e.jsxs)(l.Container,{className:(0,y.cn)("relative h-[96px]",p),children:[(0,e.jsxs)("div",{ref:B,onClick:A,className:"flex h-full flex-col justify-end gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(ue,{}),(0,e.jsx)(re,{ref:z,actions:$,activeStatus:_})]}),(0,e.jsx)("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:k?.map((a,d)=>(0,e.jsx)("div",{className:"flex gap-3",children:a?.map((f,M)=>{const Y=v?.groupIndex===d&&v?.index===M;return(0,e.jsx)("div",{ref:O=>{P.current[d][M]=O},className:"group",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:O=>E(O,d,M),onKeyDown:O=>J(O,d,M),"aria-expanded":Y,"aria-haspopup":"true","aria-label":f.text,children:[(0,e.jsx)(l.Text,{html:f.text,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)(w.DownArrow,{className:(0,y.cn)("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":v?.groupIndex===d&&v?.index===M,"opacity-100":m&&v?.groupIndex===d&&v?.index===M,invisible:!f?.components?.length||f?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links})})]}),(0,e.jsx)("div",{className:(0,y.cn)("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":Y},h==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},f.id)})},`groupCategory-${d}`))})]}),(0,e.jsxs)("div",{role:"menu","aria-hidden":!(v?.open&&b),className:(0,y.cn)("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(v?.open&&b)}),onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),style:{height:`calc(100dvh - ${B?.current?.getBoundingClientRect()?.bottom}px)`},children:[(0,e.jsx)("div",{ref:F,className:(0,y.cn)("relative z-50",{"overflow-hidden":g!==o.HeaderNavigationBlockType.Supports}),children:U}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:A,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),A())}})]}),_&&(0,e.jsxs)("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",role:"dialog","aria-modal":"true","aria-label":"User profile menu",children:[(0,e.jsx)("div",{className:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${z?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:D?.email?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Text,{html:D?.nick_name||R?.welcome,className:"text-sm font-bold"}),(0,e.jsx)("div",{className:"mt-2 h-px bg-[#D9D9D9]","aria-hidden":"true"}),(0,e.jsx)("nav",{className:"mt-2",role:"navigation","aria-label":"Profile navigation",children:R?.profiles?.map(a=>(0,e.jsx)(te.MenuItem,{className:"py-2",label:a?.title,href:(0,y.getLocalizedPath)(a?.url,W)},a.id))})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w.Polygon,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),(0,e.jsx)(l.Text,{html:R?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:R?.benefits?.map(a=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(l.Picture,{source:a.benefitIcon?.url,className:"size-4",alt:a.benefit,width:16,height:16}),(0,e.jsx)(l.Text,{html:a.benefit,className:"text-sm font-bold leading-[1.4]"})]},a.id))}),(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,e.jsx)(l.Button,{variant:"secondary",size:"lg",onClick:()=>c?.join?.(),children:(0,e.jsx)(l.Text,{html:R?.primaryButton||"Join Now",className:"font-bold"})}),(0,e.jsx)(l.Button,{variant:"primary",size:"lg",onClick:()=>c?.login?.(),children:(0,e.jsx)(l.Text,{html:R?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>S(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),S(!1))}})]})]})}),ce=(0,t.forwardRef)(({data:n,menuData:r,className:i,onPrimaryNavClick:u},p)=>{const h=(0,t.useMemo)(()=>(0,C.WithGroupCategory)(n?.categories?.filter(g=>g?.mobileShow)),[n]),{currentMenu:s,setCurrentMenu:c,subSubCategory:D}=(0,j.useNavContext)(),[m,N]=(0,t.useState)(!1),[W,k]=(0,t.useState)(0),[b,G]=(0,t.useState)(null),L=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(L?.current&&m){const g=L?.current?.getBoundingClientRect();k(window?.innerHeight-(g?.bottom||0))}},[m]),(0,X.useGSAP)(()=>{Z.gsap.fromTo(L.current,{height:0},{height:W,duration:.3})},[W]),(0,ee.useScrollLock)(m);const I=(0,t.useMemo)(()=>b?.components?.[0]?.blockType,[b]),z=(0,C.WithSupports)(ke.MobileSupportMenu,{categoriesItem:b}),_=(0,C.WithSidebar)(Ne.MobileSidebarMenu,b),S=(0,C.WithResource)(ve.MobileResourceSidebarMenu,b),B=(0,C.WithMulticol)(xe.MobileMulticolMenu,b),F=(0,t.useMemo)(()=>{switch(I){case o.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(_,{});case o.HeaderNavigationBlockType.Resource:return(0,e.jsx)(S,{});case o.HeaderNavigationBlockType.Supports:return(0,e.jsx)(z,{});case o.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(B,{});default:return null}},[I,b,z]),P=(0,t.useCallback)(()=>{N(!1),k(0),c&&c(o.HeaderNavigationMenu.Primary)},[N,k,c]),v=(0,t.useMemo)(()=>n?.bar?.actions?.filter(g=>g?.mobileShow&&g?.blockType!==o.HeaderNavigationActionBlockType.Profile),[n]),E=(0,t.useMemo)(()=>n?.bar?.actions?.find(g=>g?.mobileShow&&g?.blockType===o.HeaderNavigationActionBlockType.Profile)||{},[n]),J=(0,t.useMemo)(()=>{switch(s){case o.HeaderNavigationMenu.Primary:return(0,e.jsx)(Be,{actions:v,menuOpen:m,onMenuOpenClose:()=>{N(!1),k(0)},onMenuOpenClick:()=>N(!0)});case o.HeaderNavigationMenu.Secondary:return(0,e.jsx)(de,{title:b?.text,onMenuOpenClose:P,onMenuBackClick:()=>c?.(o.HeaderNavigationMenu.Primary)});case o.HeaderNavigationMenu.Third:return(0,e.jsx)(de,{title:D?.label,onMenuOpenClose:P,onMenuBackClick:()=>c?.(o.HeaderNavigationMenu.Secondary)});default:return null}},[m,s,c,b,v,D,P]),A=(0,t.useCallback)((g,T)=>{const H=Array.isArray(h)?Array.isArray(h[g])?h[g][T]:{}:{};G(H),H?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links?H?.components?.[0]?.url&&window.open(H?.components?.[0]?.url):c?.(o.HeaderNavigationMenu.Secondary)},[h,c]);return(0,e.jsxs)(l.Container,{className:(0,y.cn)("relative h-[52px]",i),children:[J,m&&(0,e.jsxs)("nav",{ref:L,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:W},role:"navigation","aria-label":"Mobile navigation menu",children:[s===o.HeaderNavigationMenu.Primary&&r?(0,e.jsx)("div",{className:"pt-4",children:(0,e.jsx)(l.BrandStrip,{data:r})}):null,s===o.HeaderNavigationMenu.Primary?(0,e.jsx)(Le,{categories:h,onPrimaryMenuClick:A,onPrimaryNavClick:u,profileAction:E}):F]})]})}),Le=({categories:n,onPrimaryMenuClick:r,profileAction:i,onPrimaryNavClick:u})=>(0,e.jsxs)("div",{className:"flex h-full flex-col justify-between",children:[(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:n?.map((p,h)=>(0,e.jsxs)("div",{className:"",children:[(0,e.jsx)("div",{className:(0,y.cn)("my-2 h-px w-full bg-[#E5E5E7]")}),p?.map((s,c)=>(0,e.jsx)(te.MenuItem,{label:s.text,onClick:()=>{const m=(n?.flat()||[])?.findIndex(N=>N?.id===n[h][c]?.id);r(h,c),u?.(s,m)},icon:s.components?.[0]?.icon},s.id))]},`groupCategory-${h}`))}),(0,e.jsx)(ze,{profileAction:i})]}),ze=({profileAction:n})=>{const[r,i]=(0,t.useState)(!1),{profile:u,event:p}=(0,j.useNavContext)(),{locale:h="us"}=(0,ae.useAiuiContext)();return(0,e.jsxs)("div",{className:(0,y.cn)("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":r}),children:[(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>i(!r),"aria-expanded":r,"aria-label":u?.nick_name||n?.welcome,children:[(0,e.jsxs)("div",{className:"flex items-center gap-[14px]",children:[(0,e.jsx)("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:(0,e.jsx)(w.User,{"aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:u?.nick_name||n?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!u?.email&&(0,e.jsx)(w.DownArrow,{"aria-hidden":"true",className:(0,y.cn)("laptop:size-4 size-5",{"rotate-180":r})})]}),u?.email&&(0,e.jsx)("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:n?.profiles?.map(s=>(0,e.jsx)(te.MenuItem,{label:s?.title,href:(0,y.getLocalizedPath)(s?.url,h)},s.id))}),r&&!u?.email&&(0,e.jsxs)("div",{className:"mt-4",children:[(0,e.jsx)(l.Text,{html:n?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n?.benefits?.map(s=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(l.Picture,{source:s.benefitIcon?.url,className:"size-4",alt:s.benefit,width:16,height:16}),(0,e.jsx)(l.Text,{html:s.benefit,className:"text-sm font-bold leading-[1.4]"})]},s.id))})]}),!u?.email&&(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-3",children:[(0,e.jsx)(l.Button,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>p?.join?.(),children:(0,e.jsx)(l.Text,{html:n?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),(0,e.jsx)(l.Button,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>p?.login?.(),children:(0,e.jsx)(l.Text,{html:n?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Be=({menuOpen:n,onMenuOpenClose:r,onMenuOpenClick:i,actions:u})=>(0,e.jsxs)("div",{className:"flex h-full items-center justify-between gap-4",children:[(0,e.jsx)(ue,{}),(0,e.jsxs)("div",{className:"desktop:gap-6 flex items-center gap-4",children:[(0,e.jsx)(re,{actions:u}),n?(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Close menu","aria-expanded":"true",children:(0,e.jsx)(w.Close,{className:"size-5","aria-hidden":"true"})}):(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>i(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:(0,e.jsx)(w.Menu,{className:"size-5","aria-hidden":"true"})})]})]}),ue=()=>{const{payloadData:n,isMobile:r}=(0,j.useNavContext)(),{locale:i="us"}=(0,ae.useAiuiContext)();return(0,e.jsx)("a",{href:(0,y.getLocalizedPath)("/",i),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:r?n?.bar?.mobileLogo:n?.bar?.desktopLogo}})},re=(0,t.forwardRef)(({actions:n,activeStatus:r=!1},i)=>{const{event:u,cartCount:p}=(0,j.useNavContext)(),[h,s]=(0,t.useState)(null),c=m=>{switch(m){case o.HeaderNavigationActionBlockType.Search:return"Search";case o.HeaderNavigationActionBlockType.Cart:return`Shopping cart${p>0?` (${p} items)`:""}`;case o.HeaderNavigationActionBlockType.Profile:return"User profile";case o.HeaderNavigationActionBlockType.Livestream:return"Livestream";default:return"Action"}},D=(0,t.useCallback)((m,N)=>{switch(s(N),m?.blockType){case o.HeaderNavigationActionBlockType.Search:u?.search?.();break;case o.HeaderNavigationActionBlockType.Cart:u?.cart?.();break;case o.HeaderNavigationActionBlockType.Profile:u?.profile?.();break;case o.HeaderNavigationActionBlockType.Livestream:u?.livestream?.();break;default:return()=>{}}},[u]);return(0,e.jsx)("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(n)&&n?.map((m,N)=>(0,e.jsxs)("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:m.blockType===o.HeaderNavigationActionBlockType.Profile?i:null,onClick:()=>D(m,N),"aria-label":c(m.blockType),"aria-pressed":r&&h===N,children:[(0,e.jsx)(l.Text,{html:m.icon,className:(0,y.cn)("size-5",{"text-brand-0":r&&h===N}),"aria-hidden":"true"}),m.blockType===o.HeaderNavigationActionBlockType.Cart&&p>0&&(0,e.jsx)("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]","aria-hidden":"true",children:(0,e.jsx)(l.Text,{html:p?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},m.id))})}),de=({title:n,onMenuOpenClose:r,onMenuBackClick:i})=>(0,e.jsxs)("div",{className:"flex h-full items-center gap-3",children:[(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>i(),"aria-label":"Back to previous menu",children:(0,e.jsx)(w.LeftArrow,{className:"size-5","aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:n,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Close menu",children:(0,e.jsx)(w.Close,{className:"size-5","aria-hidden":"true"})})]});ce.displayName="MobileNavigation",re.displayName="Actions",le.displayName="HeaderNavigation",se.displayName="DesktopNavigation";var Re=(0,me.withLayout)(le);
1
+ "use strict";"use client";var De=Object.create;var Z=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Ee=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var ze=(r,o)=>{for(var i in o)Z(r,i,{get:o[i],enumerable:!0})},le=(r,o,i,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let b of Le(o))!He.call(r,b)&&b!==i&&Z(r,b,{get:()=>o[b],enumerable:!(m=Pe(o,b))||m.enumerable});return r};var X=(r,o,i)=>(i=r!=null?De(Ee(r)):{},le(o||!r||!r.__esModule?Z(i,"default",{value:r,enumerable:!0}):i,r)),Re=r=>le(Z({},"__esModule",{value:!0}),r);var je={};ze(je,{default:()=>Oe});module.exports=Re(je);var e=require("react/jsx-runtime"),t=X(require("react")),s=require("../../components/index.js"),pe=require("../../shared/Styles.js"),y=require("../../helpers/utils.js"),W=X(require("./NavProvider.js")),n=require("./types.js"),be=X(require("jump.js")),ee=require("@gsap/react"),te=require("gsap"),x=require("./withCategory.js"),w=require("./icons/index.js"),fe=X(require("../NavigationSearch/index.js")),ve=require("./ResourceSidebarDropdown.js"),he=require("./MobileResourceSidebarMenu.js"),ge=require("./SidebarDropdown.js"),ae=require("./useScrollLock.js"),ye=require("./MulticolDropdown.js"),ke=require("./TextLinksDropdown.js"),Ne=require("./SupportsDropdown.js"),xe=require("./MobileSidebarMenu.js"),Ce=require("./MobileSupportMenu.js"),we=require("./MobileMulticolMenu.js"),Me=require("./MobileTextLinksMenu.js"),re=require("./MobileMenuComponents.js"),ne=require("../AiuiProvider/index.js"),Se=X(require("../../shared/throttle.js"));const se=(0,t.forwardRef)((r,o)=>{const{data:{header:i}={},buildProps:m,event:b,profile:v,theme:u="light",isTop:c=!1,searchResult:S,onSearch:l,isSearching:f,keywords:L,onPrimaryNavClick:k,onSeriesProductClick:d,onSidebarNavClick:J,headerId:E,cartCount:I,menuData:H,..._}=r,[T,z]=(0,t.useState)(!1),[F,R]=(0,t.useState)(!1),[h,D]=(0,t.useState)(!1),[Y,A]=(0,t.useState)(!1),B=(0,t.useRef)(null),g=(0,t.useRef)(null),$=()=>{const C=document?.querySelector("body")?.offsetWidth||0;A(C<=1440)};(0,t.useEffect)(()=>($(),window.addEventListener("resize",$),()=>{window.removeEventListener("resize",$)}),[]),(0,t.useImperativeHandle)(o,()=>g.current),(0,t.useEffect)(()=>{g.current&&c&&(0,be.default)(g.current,{duration:0,offset:g.current?.getBoundingClientRect()?.bottom||0})},[c]),(0,t.useEffect)(()=>{if(c){R(!1),D(!1);return}let C=0,K=0,q=0;const U=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,P=U();C=P,R(P>300),D(P>30);const G=(0,Se.default)(()=>{const a=U(),p=a-C;D(a>30),p>0?(K=0,q+=p,q>=300&&a>300&&R(!0)):p<0&&(q=0,K+=Math.abs(p),K>=300&&(R(!1),K=0)),C=a},100);return window.addEventListener("scroll",G,{passive:!0}),()=>window.removeEventListener("scroll",G)},[c]),(0,t.useEffect)(()=>{b&&(b.search=()=>z(!0))},[b]),(0,ee.useGSAP)(()=>{B?.current&&T&&te.gsap.fromTo(B.current,{height:0},{height:"auto",duration:.3})},[T]),(0,ae.useScrollLock)(T);const O=(0,t.useMemo)(()=>i?.bar?.actions?.find(C=>C?.blockType===n.HeaderNavigationActionBlockType.Search)?.searchBar?.[0]||{},[i]);return(0,e.jsx)(W.default,{buildProps:m,profile:v,isMobile:Y,event:b,payloadData:i,onSidebarNavClick:J,onSeriesProductClick:d,cartCount:I,children:(0,e.jsx)("header",{..._,id:E||"header","data-ui-component-id":"HeaderNavigation",className:c?"relative z-[100] bg-white":(0,y.cn)("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":F}),ref:g,children:(0,e.jsxs)("div",{className:(0,y.cn)("hover:bg-white hover:text-black",u==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!c&&h},{"hover:!text-black":u==="dark","!text-black":!c&&h}),onClick:()=>!c&&D(!0),children:[(0,e.jsx)(ce,{data:i,className:"desktop:block hidden !bg-white",theme:u,onNavItemClick:()=>!c&&D(!0),onPrimaryNavClick:k}),(0,e.jsx)(ue,{menuData:H,data:i,className:"desktop:hidden block !bg-white",onPrimaryNavClick:k}),T&&(0,e.jsxs)("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${g?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[(0,e.jsx)("div",{ref:B,className:(0,y.cn)("overflow-y-auto",{}),children:(0,e.jsx)(fe.default,{data:O,keywords:L,isSearching:f,searchResult:S,onSearch:C=>{l?.(C)},onClose:()=>{l?.(),z(!1)}})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>z(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:C=>{(C.key==="Enter"||C.key===" "||C.key==="Escape")&&(C.preventDefault(),z(!1))}})]})]})})})}),ce=(0,t.forwardRef)((r,o)=>{const{data:i,onNavItemClick:m,className:b,theme:v,onPrimaryNavClick:u}=r,{event:c,profile:S}=(0,W.useNavContext)(),[l,f]=(0,t.useState)(!1),{locale:L="us"}=(0,ne.useAiuiContext)(),k=(0,t.useMemo)(()=>(0,x.WithGroupCategory)(i?.categories?.filter(a=>a?.pcShow)),[i]),[d,J]=(0,t.useState)(null),[E,I]=(0,t.useState)([]),H=(0,t.useRef)(null),[_,T]=(0,t.useState)(!1),z=(0,t.useRef)(null),F=(0,t.useRef)(null),R=(0,t.useRef)(k.map(a=>Array(a?.length||0).fill(null)));(0,t.useEffect)(()=>{k?.length&&I(k?.map((a,p)=>a?.map((N,M)=>({groupIndex:p,index:M,open:!1}))))},[k]);const h=(0,t.useMemo)(()=>{let a=null;for(const p of E){for(const N of p)if(N.open){a=N;break}if(a)break}return a},[E]);(0,ae.useScrollLock)(!!h?.open||_);const D=(a,p,N)=>{T(!1);const M=k[p][N];if(M?.components?.[0]?.blockType===n.HeaderNavigationBlockType.Links)M?.components?.[0]?.url&&window.open(M?.components?.[0]?.url);else{const Q=k?.flat()||[],j=Q?.findIndex(oe=>oe?.id===k[p][N]?.id);a.stopPropagation(),m?.(),u?.(Q[j],j),J(M),I(oe=>oe.map(Te=>Te.map(V=>V.groupIndex===p&&V.index===N?{...V,open:!V.open}:{...V,open:!1})))}},Y=(a,p,N)=>{a.key==="Enter"||a.key===" "?(a.preventDefault(),D(a,p,N)):a.key==="Escape"&&h?.groupIndex===p&&h?.index===N&&(a.preventDefault(),A())},A=()=>{I(a=>a.map(p=>p.map(N=>({...N,open:!1}))))},B=(0,t.useMemo)(()=>{if(d)return d?.components?.[0]?.blockType},[d]),g=(0,x.WithSidebar)(ge.SidebarDropdown,d),$=(0,x.WithResource)(ve.ResourceSidebarDropdown,d),O=(0,x.WithMulticol)(ye.MulticolDropdown,d),C=(0,x.WithTextLinks)(ke.TextLinksDropdown,d),K=(0,x.WithSupports)(Ne.SupportsDropdown,{categoriesItem:d,currentNavItemRef:R.current?.[h?.groupIndex||0]?.[h?.index||0]}),q=(0,t.useMemo)(()=>{switch(B){case n.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(g,{});case n.HeaderNavigationBlockType.Resource:return(0,e.jsx)($,{});case n.HeaderNavigationBlockType.Supports:return(0,e.jsx)(K,{});case n.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(O,{});case n.HeaderNavigationBlockType.TextLinks:return(0,e.jsx)(C,{});default:return null}},[B,d]),U=(0,t.useMemo)(()=>i?.bar?.actions?.filter(a=>a?.pcShow),[i]),P=(0,t.useMemo)(()=>U?.find(a=>a?.blockType===n.HeaderNavigationActionBlockType.Profile),[U]),G=(0,t.useCallback)(()=>{T(a=>!a)},[]);return(0,t.useEffect)(()=>{if(H?.current){const a=H.current;return a.addEventListener("click",G),()=>{a.removeEventListener("click",G)}}},[G]),(0,ee.useGSAP)(()=>{h?.open&&te.gsap.fromTo(F?.current,{height:0},{height:"auto"})},[h?.open]),(0,e.jsxs)(s.Container,{className:(0,y.cn)("relative h-[96px]",b),children:[(0,e.jsxs)("div",{ref:z,onClick:A,className:"flex h-full flex-col justify-end gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(me,{}),(0,e.jsx)(ie,{ref:H,actions:U,activeStatus:_})]}),(0,e.jsx)("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:k?.map((a,p)=>(0,e.jsx)("div",{className:"flex gap-3",children:a?.map((N,M)=>{const Q=h?.groupIndex===p&&h?.index===M;return(0,e.jsx)("div",{ref:j=>{R.current[p][M]=j},className:"group",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:j=>D(j,p,M),onKeyDown:j=>Y(j,p,M),"aria-expanded":Q,"aria-haspopup":"true","aria-label":N.text,children:[(0,e.jsx)(s.Text,{html:N.text,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)(w.DownArrow,{className:(0,y.cn)("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":h?.groupIndex===p&&h?.index===M,"opacity-100":l&&h?.groupIndex===p&&h?.index===M,invisible:!N?.components?.length||N?.components?.[0]?.blockType===n.HeaderNavigationBlockType.Links})})]}),(0,e.jsx)("div",{className:(0,y.cn)("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":Q},v==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},N.id)})},`groupCategory-${p}`))})]}),(0,e.jsxs)("div",{role:"menu","aria-hidden":!(h?.open&&d),className:(0,y.cn)("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(h?.open&&d)}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{height:`calc(100dvh - ${z?.current?.getBoundingClientRect()?.bottom}px)`},children:[(0,e.jsx)("div",{ref:F,className:(0,y.cn)("relative z-50",{"overflow-hidden":B!==n.HeaderNavigationBlockType.Supports}),children:q}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:A,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),A())}})]}),_&&(0,e.jsxs)("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",role:"dialog","aria-modal":"true","aria-label":"User profile menu",children:[(0,e.jsx)("div",{className:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${H?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:S?.email?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(s.Text,{html:S?.nick_name||P?.welcome,className:"text-sm font-bold"}),(0,e.jsx)("div",{className:"mt-2 h-px bg-[#D9D9D9]","aria-hidden":"true"}),(0,e.jsx)("nav",{className:"mt-2",role:"navigation","aria-label":"Profile navigation",children:P?.profiles?.map(a=>(0,e.jsx)(re.MenuItem,{className:"py-2",label:a?.title,href:(0,y.getLocalizedPath)(a?.url,L)},a.id))})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(w.Polygon,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),(0,e.jsx)(s.Text,{html:P?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:P?.benefits?.map(a=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(s.Picture,{source:a.benefitIcon?.url,className:"size-4",alt:a.benefit,width:16,height:16}),(0,e.jsx)(s.Text,{html:a.benefit,className:"text-sm font-bold leading-[1.4]"})]},a.id))}),(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,e.jsx)(s.Button,{variant:"secondary",size:"lg",onClick:()=>c?.join?.(),children:(0,e.jsx)(s.Text,{html:P?.primaryButton||"Join Now",className:"font-bold"})}),(0,e.jsx)(s.Button,{variant:"primary",size:"lg",onClick:()=>c?.login?.(),children:(0,e.jsx)(s.Text,{html:P?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>T(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),T(!1))}})]})]})}),ue=(0,t.forwardRef)(({data:r,menuData:o,className:i,onPrimaryNavClick:m},b)=>{const v=(0,t.useMemo)(()=>(0,x.WithGroupCategory)(r?.categories?.filter(g=>g?.mobileShow)),[r]),{currentMenu:u,setCurrentMenu:c,subSubCategory:S}=(0,W.useNavContext)(),[l,f]=(0,t.useState)(!1),[L,k]=(0,t.useState)(0),[d,J]=(0,t.useState)(null),E=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(E?.current&&l){const g=E?.current?.getBoundingClientRect();k(window?.innerHeight-(g?.bottom||0))}},[l]),(0,ee.useGSAP)(()=>{te.gsap.fromTo(E.current,{height:0},{height:L,duration:.3})},[L]),(0,ae.useScrollLock)(l);const I=(0,t.useMemo)(()=>d?.components?.[0]?.blockType,[d]),H=(0,x.WithSupports)(Ce.MobileSupportMenu,{categoriesItem:d}),_=(0,x.WithSidebar)(xe.MobileSidebarMenu,d),T=(0,x.WithResource)(he.MobileResourceSidebarMenu,d),z=(0,x.WithMulticol)(we.MobileMulticolMenu,d),F=(0,x.WithTextLinks)(Me.MobileTextLinksMenu,d),R=(0,t.useMemo)(()=>{switch(I){case n.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(_,{});case n.HeaderNavigationBlockType.Resource:return(0,e.jsx)(T,{});case n.HeaderNavigationBlockType.Supports:return(0,e.jsx)(H,{});case n.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(z,{});case n.HeaderNavigationBlockType.TextLinks:return(0,e.jsx)(F,{});default:return null}},[I,d,H]),h=(0,t.useCallback)(()=>{f(!1),k(0),c&&c(n.HeaderNavigationMenu.Primary)},[f,k,c]),D=(0,t.useMemo)(()=>r?.bar?.actions?.filter(g=>g?.mobileShow&&g?.blockType!==n.HeaderNavigationActionBlockType.Profile),[r]),Y=(0,t.useMemo)(()=>r?.bar?.actions?.find(g=>g?.mobileShow&&g?.blockType===n.HeaderNavigationActionBlockType.Profile)||{},[r]),A=(0,t.useMemo)(()=>{switch(u){case n.HeaderNavigationMenu.Primary:return(0,e.jsx)(Ae,{actions:D,menuOpen:l,onMenuOpenClose:()=>{f(!1),k(0)},onMenuOpenClick:()=>f(!0)});case n.HeaderNavigationMenu.Secondary:return(0,e.jsx)(de,{title:d?.text,onMenuOpenClose:h,onMenuBackClick:()=>c?.(n.HeaderNavigationMenu.Primary)});case n.HeaderNavigationMenu.Third:return(0,e.jsx)(de,{title:S?.label,onMenuOpenClose:h,onMenuBackClick:()=>c?.(n.HeaderNavigationMenu.Secondary)});default:return null}},[l,u,c,d,D,S,h]),B=(0,t.useCallback)((g,$)=>{const O=Array.isArray(v)?Array.isArray(v[g])?v[g][$]:{}:{};J(O),O?.components?.[0]?.blockType===n.HeaderNavigationBlockType.Links?O?.components?.[0]?.url&&window.open(O?.components?.[0]?.url):c?.(n.HeaderNavigationMenu.Secondary)},[v,c]);return(0,e.jsxs)(s.Container,{className:(0,y.cn)("relative h-[52px]",i),children:[A,l&&(0,e.jsxs)("nav",{ref:E,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:L},role:"navigation","aria-label":"Mobile navigation menu",children:[u===n.HeaderNavigationMenu.Primary&&o?(0,e.jsx)("div",{className:"pt-4",children:(0,e.jsx)(s.BrandStrip,{data:o})}):null,u===n.HeaderNavigationMenu.Primary?(0,e.jsx)(Be,{categories:v,onPrimaryMenuClick:B,onPrimaryNavClick:m,profileAction:Y}):R]})]})}),Be=({categories:r,onPrimaryMenuClick:o,profileAction:i,onPrimaryNavClick:m})=>(0,e.jsxs)("div",{className:"flex h-full flex-col justify-between",children:[(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:r?.map((b,v)=>(0,e.jsxs)("div",{className:"",children:[(0,e.jsx)("div",{className:(0,y.cn)("my-2 h-px w-full bg-[#E5E5E7]")}),b?.map((u,c)=>(0,e.jsx)(re.MenuItem,{label:u.text,onClick:()=>{const l=(r?.flat()||[])?.findIndex(f=>f?.id===r[v][c]?.id);o(v,c),m?.(u,l)},icon:u.components?.[0]?.icon},u.id))]},`groupCategory-${v}`))}),(0,e.jsx)(Ie,{profileAction:i})]}),Ie=({profileAction:r})=>{const[o,i]=(0,t.useState)(!1),{profile:m,event:b}=(0,W.useNavContext)(),{locale:v="us"}=(0,ne.useAiuiContext)();return(0,e.jsxs)("div",{className:(0,y.cn)("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":o}),children:[(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>i(!o),"aria-expanded":o,"aria-label":m?.nick_name||r?.welcome,children:[(0,e.jsxs)("div",{className:"flex items-center gap-[14px]",children:[(0,e.jsx)("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:(0,e.jsx)(w.User,{"aria-hidden":"true"})}),(0,e.jsx)(s.Text,{html:m?.nick_name||r?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!m?.email&&(0,e.jsx)(w.DownArrow,{"aria-hidden":"true",className:(0,y.cn)("laptop:size-4 size-5",{"rotate-180":o})})]}),m?.email&&(0,e.jsx)("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:r?.profiles?.map(u=>(0,e.jsx)(re.MenuItem,{label:u?.title,href:(0,y.getLocalizedPath)(u?.url,v)},u.id))}),o&&!m?.email&&(0,e.jsxs)("div",{className:"mt-4",children:[(0,e.jsx)(s.Text,{html:r?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:r?.benefits?.map(u=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(s.Picture,{source:u.benefitIcon?.url,className:"size-4",alt:u.benefit,width:16,height:16}),(0,e.jsx)(s.Text,{html:u.benefit,className:"text-sm font-bold leading-[1.4]"})]},u.id))})]}),!m?.email&&(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-3",children:[(0,e.jsx)(s.Button,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>b?.join?.(),children:(0,e.jsx)(s.Text,{html:r?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),(0,e.jsx)(s.Button,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>b?.login?.(),children:(0,e.jsx)(s.Text,{html:r?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Ae=({menuOpen:r,onMenuOpenClose:o,onMenuOpenClick:i,actions:m})=>(0,e.jsxs)("div",{className:"flex h-full items-center justify-between gap-4",children:[(0,e.jsx)(me,{}),(0,e.jsxs)("div",{className:"desktop:gap-6 flex items-center gap-4",children:[(0,e.jsx)(ie,{actions:m}),r?(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>o(),"aria-label":"Close menu","aria-expanded":"true",children:(0,e.jsx)(w.Close,{className:"size-5","aria-hidden":"true"})}):(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>i(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:(0,e.jsx)(w.Menu,{className:"size-5","aria-hidden":"true"})})]})]}),me=()=>{const{payloadData:r,isMobile:o}=(0,W.useNavContext)(),{locale:i="us"}=(0,ne.useAiuiContext)();return(0,e.jsx)("a",{href:(0,y.getLocalizedPath)("/",i),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:o?r?.bar?.mobileLogo:r?.bar?.desktopLogo}})},ie=(0,t.forwardRef)(({actions:r,activeStatus:o=!1},i)=>{const{event:m,cartCount:b}=(0,W.useNavContext)(),[v,u]=(0,t.useState)(null),c=l=>{switch(l){case n.HeaderNavigationActionBlockType.Search:return"Search";case n.HeaderNavigationActionBlockType.Cart:return`Shopping cart${b>0?` (${b} items)`:""}`;case n.HeaderNavigationActionBlockType.Profile:return"User profile";case n.HeaderNavigationActionBlockType.Livestream:return"Livestream";default:return"Action"}},S=(0,t.useCallback)((l,f)=>{switch(u(f),l?.blockType){case n.HeaderNavigationActionBlockType.Search:m?.search?.();break;case n.HeaderNavigationActionBlockType.Cart:m?.cart?.();break;case n.HeaderNavigationActionBlockType.Profile:m?.profile?.();break;case n.HeaderNavigationActionBlockType.Livestream:m?.livestream?.();break;default:return()=>{}}},[m]);return(0,e.jsx)("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(r)&&r.map((l,f)=>{const L=l.blockType===n.HeaderNavigationActionBlockType.Search,k=l.searchStyle??"icon";return L&&k==="capsule"?(0,e.jsxs)(t.default.Fragment,{children:[(0,e.jsx)("button",{className:"tablet:flex bg-container-primary hidden h-9 w-[200px] cursor-pointer items-center rounded-full border-0 px-2",onClick:()=>S(l,f),"aria-label":c(l.blockType),"aria-pressed":o&&v===f,children:(0,e.jsx)(s.Text,{html:l.icon,className:(0,y.cn)("size-5 shrink-0",{"text-brand-0":o&&v===f}),"aria-hidden":"true"})}),(0,e.jsx)("button",{className:"tablet:hidden relative cursor-pointer border-0 bg-transparent p-0",onClick:()=>S(l,f),"aria-label":c(l.blockType),"aria-pressed":o&&v===f,children:(0,e.jsx)(s.Text,{html:l.icon,className:(0,y.cn)("size-5",{"text-brand-0":o&&v===f}),"aria-hidden":"true"})})]},l.id):(0,e.jsxs)("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:l.blockType===n.HeaderNavigationActionBlockType.Profile?i:null,onClick:()=>S(l,f),"aria-label":c(l.blockType),"aria-pressed":o&&v===f,children:[(0,e.jsx)(s.Text,{html:l.icon,className:(0,y.cn)("size-5",{"text-brand-0":o&&v===f}),"aria-hidden":"true"}),l.blockType===n.HeaderNavigationActionBlockType.Cart&&b>0&&(0,e.jsx)("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]","aria-hidden":"true",children:(0,e.jsx)(s.Text,{html:b?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},l.id)})})}),de=({title:r,onMenuOpenClose:o,onMenuBackClick:i})=>(0,e.jsxs)("div",{className:"flex h-full items-center gap-3",children:[(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>i(),"aria-label":"Back to previous menu",children:(0,e.jsx)(w.LeftArrow,{className:"size-5","aria-hidden":"true"})}),(0,e.jsx)(s.Text,{html:r,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>o(),"aria-label":"Close menu",children:(0,e.jsx)(w.Close,{className:"size-5","aria-hidden":"true"})})]});ue.displayName="MobileNavigation",ie.displayName="Actions",se.displayName="HeaderNavigation",ce.displayName="DesktopNavigation";var Oe=(0,pe.withLayout)(se);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\n\nimport { Picture, Text, Button, Container, BrandStrip } from '../../components/index.js'\n\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\n\nimport type {\n MobilePrimaryNavigationData,\n MobileSecondaryNavigationData,\n MobileNavigationProps,\n DesktopNavigationProps,\n HeaderNavigationProps,\n} from './types.js'\nimport NavProvider, { useNavContext } from './NavProvider.js'\n\nimport { HeaderNavigationMenu, HeaderNavigationBlockType, HeaderNavigationActionBlockType } from './types.js'\n\nimport jump from 'jump.js'\n\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\n\nimport { WithSidebar, WithSupports, WithMulticol, WithGroupCategory, WithResource } from './withCategory.js'\n\nimport { Menu, Close, User, LeftArrow, DownArrow, Polygon } from './icons/index.js'\n\nimport NavigationSearch from '../NavigationSearch/index.js'\nimport { ResourceSidebarDropdown } from './ResourceSidebarDropdown.js'\nimport { MobileResourceSidebarMenu } from './MobileResourceSidebarMenu.js'\nimport { SidebarDropdown } from './SidebarDropdown.js'\nimport { useScrollLock } from './useScrollLock.js'\nimport { MulticolDropdown } from './MulticolDropdown.js'\nimport { SupportsDropdown } from './SupportsDropdown.js'\nimport { MobileSidebarMenu } from './MobileSidebarMenu.js'\nimport { MobileSupportMenu } from './MobileSupportMenu.js'\nimport { MobileMulticolMenu } from './MobileMulticolMenu.js'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport throttle from '../../shared/throttle.js'\n\nconst HeaderNavigation = forwardRef<HTMLDivElement, HeaderNavigationProps>((props, ref) => {\n const {\n data: { header } = {},\n buildProps,\n event,\n profile,\n theme = 'light',\n isTop = false,\n searchResult,\n onSearch,\n isSearching,\n keywords,\n onPrimaryNavClick,\n onSeriesProductClick,\n onSidebarNavClick,\n headerId,\n cartCount,\n menuData,\n ...rest\n } = props\n\n const [searchOpen, setSearchOpen] = useState(false)\n const [headerHidden, setHeaderHidden] = useState(false)\n const [changeHeaderBackground, setChangeHeaderBackground] = useState(false)\n const [isMobile, setIsMobile] = useState(false)\n const searchRef = useRef<HTMLDivElement>(null)\n\n const headerRef = useRef<HTMLDivElement>(null)\n\n const resizeWindow = () => {\n const offsetWidth = document?.querySelector('body')?.offsetWidth || 0\n setIsMobile(offsetWidth <= 1440)\n }\n\n useEffect(() => {\n resizeWindow()\n window.addEventListener('resize', resizeWindow)\n return () => {\n window.removeEventListener('resize', resizeWindow)\n }\n }, [])\n\n useImperativeHandle(ref, () => headerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (headerRef.current && isTop) {\n jump(headerRef.current, { duration: 0, offset: headerRef.current?.getBoundingClientRect()?.bottom || 0 })\n }\n }, [isTop])\n\n useEffect(() => {\n // \u5982\u679C isTop \u4E3A true\uFF0C\u4E0D\u9700\u8981\u6EDA\u52A8\u76D1\u542C\u548C\u52A8\u6548\n if (isTop) {\n setHeaderHidden(false)\n setChangeHeaderBackground(false)\n return\n }\n\n let lastScrollY = 0\n let upwardDistance = 0\n let downwardDistance = 0\n\n const getScrollTop = () => {\n return document?.documentElement?.scrollTop || document?.body?.scrollTop || 0\n }\n\n // \u521D\u59CB\u5316\u72B6\u6001\n const initialScrollTop = getScrollTop()\n lastScrollY = initialScrollTop\n setHeaderHidden(initialScrollTop > 300)\n setChangeHeaderBackground(initialScrollTop > 30)\n\n const handleScroll = throttle(() => {\n const currentScrollY = getScrollTop()\n const delta = currentScrollY - lastScrollY\n\n // \u66F4\u65B0\u80CC\u666F\u72B6\u6001\n setChangeHeaderBackground(currentScrollY > 30)\n\n if (delta > 0) {\n // \u5411\u4E0B\u6EDA\u52A8\n upwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0A\u7D2F\u8BA1\n downwardDistance += delta\n\n if (downwardDistance >= 300 && currentScrollY > 300) {\n setHeaderHidden(true)\n }\n } else if (delta < 0) {\n // \u5411\u4E0A\u6EDA\u52A8\n downwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0B\u7D2F\u8BA1\n upwardDistance += Math.abs(delta)\n\n if (upwardDistance >= 300) {\n setHeaderHidden(false)\n upwardDistance = 0\n }\n }\n\n lastScrollY = currentScrollY\n }, 100)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => window.removeEventListener('scroll', handleScroll)\n }, [isTop])\n\n useEffect(() => {\n if (event) {\n event.search = () => setSearchOpen(true)\n }\n }, [event])\n\n useGSAP(() => {\n if (searchRef?.current && searchOpen) {\n gsap.fromTo(\n searchRef.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n duration: 0.3,\n }\n )\n }\n }, [searchOpen])\n\n useScrollLock(searchOpen)\n\n const searchPage = useMemo(() => {\n return (\n header?.bar?.actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Search)\n ?.searchBar?.[0] || {}\n )\n }, [header])\n\n return (\n <NavProvider\n buildProps={buildProps}\n profile={profile}\n isMobile={isMobile}\n event={event}\n payloadData={header}\n onSidebarNavClick={onSidebarNavClick}\n onSeriesProductClick={onSeriesProductClick}\n cartCount={cartCount}\n >\n <header\n {...rest}\n id={headerId || 'header'}\n data-ui-component-id=\"HeaderNavigation\"\n className={\n isTop\n ? 'relative z-[100] bg-white'\n : cn('sticky top-0 z-[100] transition-transform duration-500 ease-in-out', {\n ['translate-y-[-100%]']: headerHidden,\n })\n }\n // className=\"relative z-[100] bg-white\"\n ref={headerRef}\n >\n <div\n className={cn(\n 'hover:bg-white hover:text-black',\n theme === 'light' ? 'text-black' : 'text-white',\n {\n ['!bg-white transition-all duration-500 ease-in-out']: !isTop && changeHeaderBackground,\n },\n {\n ['hover:!text-black']: theme === 'dark',\n ['!text-black']: !isTop && changeHeaderBackground,\n }\n )}\n onClick={() => !isTop && setChangeHeaderBackground(true)}\n >\n <DesktopNavigation\n data={header}\n className=\"desktop:block hidden !bg-white\"\n theme={theme}\n onNavItemClick={() => !isTop && setChangeHeaderBackground(true)}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n />\n {searchOpen && (\n <div\n className=\"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70\"\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.top}px)` }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Search\"\n >\n <div ref={searchRef} className={cn('overflow-y-auto', {})}>\n <NavigationSearch\n data={searchPage}\n keywords={keywords}\n isSearching={isSearching}\n searchResult={searchResult}\n onSearch={(value: string) => {\n onSearch?.(value)\n }}\n onClose={() => {\n onSearch?.()\n setSearchOpen(false)\n }}\n />\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setSearchOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close search\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setSearchOpen(false)\n }\n }}\n />\n </div>\n )}\n </div>\n </header>\n </NavProvider>\n )\n})\n\nconst DesktopNavigation = forwardRef<HTMLDivElement, DesktopNavigationProps>((props, ref) => {\n const { data, onNavItemClick, className, theme, onPrimaryNavClick } = props\n const { event, profile } = useNavContext()\n const [downdownHover, setDowndownHover] = useState(false)\n const { locale = 'us' } = useAiuiContext()\n\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.pcShow)) as any[][]\n }, [data])\n\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n const [navStatusArray, setNavStatusArray] = useState<{ index: number; groupIndex: number; open: boolean }[][]>([])\n const profileRef = useRef<HTMLButtonElement>(null)\n const [userProfileOpen, setUserProfileOpen] = useState(false)\n const headerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const navItemRefs = useRef<HTMLDivElement[][]>(\n groupCategories.map((categories: any) => Array(categories?.length || 0).fill(null))\n )\n\n useEffect(() => {\n if (groupCategories?.length) {\n setNavStatusArray(\n groupCategories?.map((groupItem: any, groupIndex: number) => {\n return groupItem?.map((_: any, index: number) => ({ groupIndex, index, open: false }))\n })\n )\n }\n }, [groupCategories])\n\n const currentNavItem = useMemo(() => {\n let currentNavItem: { index: number; groupIndex: number; open: boolean } | null = null\n for (const groupItem of navStatusArray) {\n for (const item of groupItem) {\n if (item.open) {\n currentNavItem = item\n break\n }\n }\n if (currentNavItem) break\n }\n return currentNavItem\n }, [navStatusArray])\n\n useScrollLock(!!currentNavItem?.open || userProfileOpen)\n\n const handleNavItemClick = (e: any, groupIndex: number, index: number) => {\n setUserProfileOpen(false)\n // if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n const currentCategoriesItem = groupCategories[groupIndex][index]\n if (currentCategoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n // categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n currentCategoriesItem?.components?.[0]?.url && window.open(currentCategoriesItem?.components?.[0]?.url)\n } else {\n const categories = groupCategories?.flat() || []\n const position = categories?.findIndex(item => item?.id === groupCategories[groupIndex][index]?.id)\n e.stopPropagation()\n onNavItemClick?.()\n onPrimaryNavClick?.(categories[position], position)\n // setCategoriesItem(groupCategories[groupIndex][index])\n setCategoriesItem(currentCategoriesItem)\n setNavStatusArray(prev =>\n prev.map(groupItem =>\n groupItem.map(item =>\n item.groupIndex === groupIndex && item.index === index\n ? { ...item, open: !item.open }\n : { ...item, open: false }\n )\n )\n )\n }\n }\n\n const handleNavItemKeyDown = (e: React.KeyboardEvent, groupIndex: number, index: number) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleNavItemClick(e, groupIndex, index)\n } else if (e.key === 'Escape' && currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index) {\n e.preventDefault()\n handleNavMenuClose()\n }\n }\n\n const handleNavMenuClose = () => {\n setNavStatusArray(prev => prev.map(groupItem => groupItem.map(item => ({ ...item, open: false }))))\n }\n\n const currentBlockTypeCategories = useMemo(() => {\n if (categoriesItem) return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const SidebarDropdownComp = WithSidebar(SidebarDropdown, categoriesItem)\n const ResourceSidebarDropdownComp = WithResource(ResourceSidebarDropdown, categoriesItem)\n const MulticolDropdownComp = WithMulticol(MulticolDropdown, categoriesItem)\n const SupportsDropdownComp = WithSupports(SupportsDropdown, {\n categoriesItem,\n currentNavItemRef: navItemRefs.current?.[currentNavItem?.groupIndex || 0]?.[currentNavItem?.index || 0],\n })\n\n const DropdownComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <SidebarDropdownComp />\n case HeaderNavigationBlockType.Resource:\n return <ResourceSidebarDropdownComp />\n case HeaderNavigationBlockType.Supports:\n return <SupportsDropdownComp />\n case HeaderNavigationBlockType.Multicol:\n return <MulticolDropdownComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem])\n\n const actions = useMemo(() => {\n return data?.bar?.actions?.filter((item: any) => item?.pcShow)\n }, [data])\n\n const profileAction = useMemo(() => {\n return actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Profile)\n }, [actions])\n\n const handleProfileClick = useCallback(() => {\n setUserProfileOpen(prev => !prev)\n }, [])\n\n useEffect(() => {\n if (profileRef?.current) {\n const profileRefElement = profileRef.current as HTMLButtonElement\n profileRefElement.addEventListener('click', handleProfileClick)\n\n return () => {\n profileRefElement.removeEventListener('click', handleProfileClick)\n }\n }\n }, [handleProfileClick])\n\n useGSAP(() => {\n if (currentNavItem?.open) {\n gsap.fromTo(\n dropdownRef?.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n }\n )\n }\n }, [currentNavItem?.open])\n\n return (\n <Container className={cn('relative h-[96px]', className)}>\n <div ref={headerRef} onClick={handleNavMenuClose} className=\"flex h-full flex-col justify-end gap-4\">\n <div className=\"flex items-center justify-between\">\n <Logo />\n <Actions ref={profileRef} actions={actions} activeStatus={userProfileOpen} />\n </div>\n <nav className=\"flex justify-between\" role=\"navigation\" aria-label=\"Primary navigation\">\n {groupCategories?.map((groupItem: any, groupIndex: number) => {\n return (\n <div key={`groupCategory-${groupIndex}`} className=\"flex gap-3\">\n {groupItem?.map((item: any, index: number) => {\n const isExpanded = currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index\n return (\n <div\n key={item.id}\n ref={(el: HTMLDivElement) => {\n navItemRefs.current[groupIndex][index] = el\n }}\n className=\"group\"\n >\n <div className=\"relative\">\n <button\n className=\"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4\"\n onClick={e => handleNavItemClick(e, groupIndex, index)}\n onKeyDown={e => handleNavItemKeyDown(e, groupIndex, index)}\n aria-expanded={isExpanded}\n aria-haspopup=\"true\"\n aria-label={item.text}\n >\n <Text html={item.text} className=\"text-sm font-bold leading-[1.4]\" />\n {/* <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']: isExpanded,\n ['opacity-100']: downdownHover && isExpanded,\n })}\n /> */}\n <DownArrow\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']:\n currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index,\n ['opacity-100']:\n downdownHover &&\n currentNavItem?.groupIndex === groupIndex &&\n currentNavItem?.index === index,\n ['invisible']:\n !item?.components?.length ||\n item?.components?.[0]?.blockType === HeaderNavigationBlockType.Links,\n })}\n />\n </button>\n <div\n className={cn(\n 'absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500',\n {\n 'w-[calc(100%-20px)]': isExpanded,\n },\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n )\n })}\n </div>\n )\n })}\n </nav>\n </div>\n <div\n role=\"menu\"\n aria-hidden={!(currentNavItem?.open && categoriesItem)}\n className={cn(\n 'absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black',\n {\n hidden: !(currentNavItem?.open && categoriesItem),\n }\n )}\n onMouseEnter={() => setDowndownHover(true)}\n onMouseLeave={() => setDowndownHover(false)}\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.bottom}px)` }}\n >\n <div\n ref={dropdownRef}\n className={cn('relative z-50', {\n 'overflow-hidden': currentBlockTypeCategories !== HeaderNavigationBlockType.Supports,\n })}\n >\n {DropdownComp}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={handleNavMenuClose}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n handleNavMenuClose()\n }\n }}\n />\n </div>\n {userProfileOpen && (\n <div\n className=\"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"User profile menu\"\n // style={{\n // height: `calc(100dvh - ${profileRef?.current?.getBoundingClientRect()?.bottom}px)`,\n // top: `calc(96px)`,\n // }}\n >\n <div\n className=\"rounded-box absolute w-[272px] overflow-hidden bg-white p-4\"\n style={{\n right: `calc(100% - ${profileRef?.current?.getBoundingClientRect()?.right}px)`,\n top: '-36px',\n }}\n >\n {profile?.email ? (\n <>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-sm font-bold\" />\n <div className=\"mt-2 h-px bg-[#D9D9D9]\" aria-hidden=\"true\" />\n <nav className=\"mt-2\" role=\"navigation\" aria-label=\"Profile navigation\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem\n className=\"py-2\"\n key={item.id}\n label={item?.title}\n href={getLocalizedPath(item?.url, locale)}\n />\n ))}\n </nav>\n </>\n ) : (\n <>\n <Polygon className=\"absolute -top-2 right-[46px] z-30 text-white\" aria-hidden=\"true\" />\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture\n source={item.benefitIcon?.url}\n className=\"size-4\"\n alt={item.benefit}\n width={16}\n height={16}\n />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n <div className=\"mt-4 flex items-center gap-2\">\n <Button variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button variant=\"primary\" size=\"lg\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"font-bold\" />\n </Button>\n </div>\n </>\n )}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setUserProfileOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close profile menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setUserProfileOpen(false)\n }\n }}\n />\n </div>\n )}\n </Container>\n )\n})\n\nconst MobileNavigation = forwardRef<HTMLDivElement, MobileNavigationProps>(\n ({ data, menuData, className, onPrimaryNavClick }, ref) => {\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.mobileShow))\n }, [data])\n\n const { currentMenu, setCurrentMenu, subSubCategory } = useNavContext()\n const [mobileMenuOpen, setMobileMenuOpen] = useState(false)\n const [menuInnerHeight, setMenuInnerHeight] = useState(0)\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n\n const mobileMenuRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.bottom || 0))\n }\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n gsap.fromTo(\n mobileMenuRef.current,\n {\n height: 0,\n },\n {\n height: menuInnerHeight,\n duration: 0.3,\n }\n )\n }, [menuInnerHeight])\n\n useScrollLock(mobileMenuOpen)\n\n const currentBlockTypeCategories = useMemo(() => {\n return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const MobileSupportMenuComp = WithSupports(MobileSupportMenu, {\n categoriesItem,\n })\n\n const MobileSidebarMenuComp = WithSidebar(MobileSidebarMenu, categoriesItem)\n const MobileResourceSidebarMenuComp = WithResource(MobileResourceSidebarMenu, categoriesItem)\n const MobileMulticolMenuComp = WithMulticol(MobileMulticolMenu, categoriesItem)\n\n const MobileCategoriesMenuComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <MobileSidebarMenuComp />\n case HeaderNavigationBlockType.Resource:\n return <MobileResourceSidebarMenuComp />\n case HeaderNavigationBlockType.Supports:\n return <MobileSupportMenuComp />\n case HeaderNavigationBlockType.Multicol:\n return <MobileMulticolMenuComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem, MobileSupportMenuComp])\n\n const handleSecondaryMenuClose = useCallback(() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Primary)\n }, [setMobileMenuOpen, setMenuInnerHeight, setCurrentMenu])\n\n const menuActions = useMemo(() => {\n return data?.bar?.actions?.filter(\n (item: any) => item?.mobileShow && item?.blockType !== HeaderNavigationActionBlockType.Profile // \u79FB\u52A8\u7AEF\u4E0D\u663E\u793Aprofile\u6309\u94AE\n )\n }, [data])\n\n const profileAction = useMemo(() => {\n return (\n data?.bar?.actions?.find(\n (item: any) => item?.mobileShow && item?.blockType === HeaderNavigationActionBlockType.Profile\n ) || {}\n )\n }, [data])\n\n const MobileCategoriesHeaderComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Primary:\n return (\n <PrimaryHeader\n actions={menuActions}\n menuOpen={mobileMenuOpen}\n onMenuOpenClose={() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n }}\n onMenuOpenClick={() => setMobileMenuOpen(true)}\n />\n )\n case HeaderNavigationMenu.Secondary:\n return (\n <SecondaryHeader\n title={categoriesItem?.text}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Primary)}\n />\n )\n case HeaderNavigationMenu.Third:\n return (\n <SecondaryHeader\n title={subSubCategory?.label}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Secondary)}\n />\n )\n default:\n return null\n }\n }, [\n mobileMenuOpen,\n currentMenu,\n setCurrentMenu,\n categoriesItem,\n menuActions,\n subSubCategory,\n handleSecondaryMenuClose,\n ])\n\n const handlePrimaryMenuClick = useCallback(\n (groupIndex: number, index: number) => {\n const categoriesItem = Array.isArray(groupCategories)\n ? Array.isArray(groupCategories[groupIndex])\n ? // @ts-ignore\n groupCategories[groupIndex][index]\n : {}\n : {}\n setCategoriesItem(categoriesItem)\n if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n } else {\n setCurrentMenu?.(HeaderNavigationMenu.Secondary)\n }\n },\n [groupCategories, setCurrentMenu]\n )\n\n return (\n <Container className={cn('relative h-[52px]', className)}>\n {/* \u79FB\u52A8\u7AEF\u5206\u7C7B\u83DC\u5355 */}\n {MobileCategoriesHeaderComp}\n {mobileMenuOpen && (\n <nav\n ref={mobileMenuRef}\n className=\"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black\"\n style={{ height: menuInnerHeight }}\n role=\"navigation\"\n aria-label=\"Mobile navigation menu\"\n >\n {currentMenu === HeaderNavigationMenu.Primary && menuData ? (\n <div className=\"pt-4\">\n <BrandStrip data={menuData} />\n </div>\n ) : null}\n {currentMenu === HeaderNavigationMenu.Primary ? (\n <MobilePrimaryMenu\n categories={groupCategories}\n onPrimaryMenuClick={handlePrimaryMenuClick}\n onPrimaryNavClick={onPrimaryNavClick}\n profileAction={profileAction}\n />\n ) : (\n MobileCategoriesMenuComp\n )}\n </nav>\n )}\n </Container>\n )\n }\n)\n\n/**\n * \u79FB\u52A8\u7AEF\u4E00\u7EA7\u83DC\u5355\n * @param categories \u5206\u7C7B\n * @param onPrimaryMenuClick \u4E00\u7EA7\u83DC\u5355\u70B9\u51FB\n */\nconst MobilePrimaryMenu = ({\n categories,\n onPrimaryMenuClick,\n profileAction,\n onPrimaryNavClick,\n}: {\n categories: any\n onPrimaryMenuClick: (groupIndex: number, index: number) => void\n profileAction: any\n onPrimaryNavClick?: (category: any, position: number) => void\n}) => {\n return (\n <div className=\"flex h-full flex-col justify-between\">\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {categories?.map((groupItem: any, groupIndex: number) => (\n <div key={`groupCategory-${groupIndex}`} className=\"\">\n <div className={cn('my-2 h-px w-full bg-[#E5E5E7]')} />\n {groupItem?.map((item: any, index: number) => (\n <MenuItem\n key={item.id}\n label={item.text}\n onClick={() => {\n const flatCategories = categories?.flat() || []\n const position = flatCategories?.findIndex(\n (item: any) => item?.id === categories[groupIndex][index]?.id\n )\n onPrimaryMenuClick(groupIndex, index)\n onPrimaryNavClick?.(item, position)\n }}\n icon={item.components?.[0]?.icon}\n />\n ))}\n </div>\n ))}\n </div>\n <ProfileComp profileAction={profileAction} />\n </div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nconst ProfileComp = ({ profileAction }: { profileAction: any }) => {\n const [profileOpen, setProfileOpen] = useState(false)\n const { profile, event } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <div\n className={cn('tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6', {\n 'p-4': profileOpen,\n })}\n >\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent\"\n onClick={() => setProfileOpen(!profileOpen)}\n aria-expanded={profileOpen}\n aria-label={profile?.nick_name || profileAction?.welcome}\n >\n <div className=\"flex items-center gap-[14px]\">\n <div className=\"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white\">\n <User aria-hidden=\"true\" />\n </div>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-base font-bold leading-[1.4]\" />\n </div>\n {!profile?.email && (\n <DownArrow aria-hidden=\"true\" className={cn('laptop:size-4 size-5', { 'rotate-180': profileOpen })} />\n )}\n </button>\n {profile?.email && (\n <nav className=\"mt-4\" role=\"navigation\" aria-label=\"Profile menu\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem key={item.id} label={item?.title} href={getLocalizedPath(item?.url, locale)} />\n ))}\n </nav>\n )}\n {profileOpen && !profile?.email && (\n <div className=\"mt-4\">\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture source={item.benefitIcon?.url} className=\"size-4\" alt={item.benefit} width={16} height={16} />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )}\n {!profile?.email && (\n <div className=\"mt-4 flex items-center gap-3\">\n <Button className=\"tablet:flex-none flex-1\" variant=\"secondary\" size=\"base\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n <Button className=\"tablet:flex-none flex-1\" variant=\"primary\" size=\"base\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst PrimaryHeader = ({ menuOpen, onMenuOpenClose, onMenuOpenClick, actions }: MobilePrimaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center justify-between gap-4\">\n <Logo />\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n <Actions actions={actions} />\n {menuOpen ? (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n aria-expanded=\"true\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClick()}\n aria-label=\"Open menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n >\n <Menu className=\"size-5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nconst Logo = () => {\n const { payloadData, isMobile } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <a\n href={getLocalizedPath('/', locale)}\n className=\"hover:text-brand-0 [&>svg]:w-full\"\n aria-label=\"Home\"\n dangerouslySetInnerHTML={{\n __html: isMobile ? payloadData?.bar?.mobileLogo : payloadData?.bar?.desktopLogo,\n }}\n />\n )\n}\n\nconst Actions = forwardRef<HTMLButtonElement, { actions: any; activeStatus?: boolean }>(\n ({ actions, activeStatus = false }, ref) => {\n const { event, cartCount } = useNavContext()\n const [activeAction, setActiveAction] = useState<any>(null)\n\n const getActionLabel = (blockType: string) => {\n switch (blockType) {\n case HeaderNavigationActionBlockType.Search:\n return 'Search'\n case HeaderNavigationActionBlockType.Cart:\n return `Shopping cart${cartCount > 0 ? ` (${cartCount} items)` : ''}`\n case HeaderNavigationActionBlockType.Profile:\n return 'User profile'\n case HeaderNavigationActionBlockType.Livestream:\n return 'Livestream'\n default:\n return 'Action'\n }\n }\n\n const handleActionClick = useCallback(\n (action: any, index: number) => {\n setActiveAction(index)\n switch (action?.blockType) {\n case HeaderNavigationActionBlockType.Search:\n event?.search?.()\n break\n case HeaderNavigationActionBlockType.Cart:\n event?.cart?.()\n break\n case HeaderNavigationActionBlockType.Profile:\n event?.profile?.()\n break\n case HeaderNavigationActionBlockType.Livestream:\n event?.livestream?.()\n break\n default:\n return () => {}\n }\n },\n [event]\n )\n\n return (\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n {Array.isArray(actions) &&\n actions?.map((action: any, index: number) => (\n <button\n className=\"relative cursor-pointer border-0 bg-transparent p-0\"\n key={action.id}\n ref={action.blockType === HeaderNavigationActionBlockType.Profile ? ref : null}\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n {action.blockType === HeaderNavigationActionBlockType.Cart && cartCount > 0 && (\n <div\n className=\"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]\"\n aria-hidden=\"true\"\n >\n <Text html={cartCount?.toString()} className=\"text-sm font-bold leading-[1.2] text-white\" />\n </div>\n )}\n </button>\n ))}\n </div>\n )\n }\n)\n\nconst SecondaryHeader = ({ title, onMenuOpenClose, onMenuBackClick }: MobileSecondaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center gap-3\">\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuBackClick()}\n aria-label=\"Back to previous menu\"\n >\n <LeftArrow className=\"size-5\" aria-hidden=\"true\" />\n </button>\n <Text html={title} className=\"flex-1 text-center text-base font-bold leading-[1.4]\" />\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nMobileNavigation.displayName = 'MobileNavigation'\nActions.displayName = 'Actions'\nHeaderNavigation.displayName = 'HeaderNavigation'\nDesktopNavigation.displayName = 'DesktopNavigation'\n\nexport default withLayout(HeaderNavigation)\n"],
5
- "mappings": "slBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAyNU,IAAAI,EAAA,6BAxNVC,EAA0G,iBAE1GC,EAA6D,qCAE7DC,GAA2B,kCAE3BC,EAAqC,kCASrCC,EAA2C,+BAE3CC,EAAiG,sBAEjGC,GAAiB,sBAEjBN,EAAwB,uBACxBO,EAAqB,gBAErBC,EAAyF,6BAEzFC,EAAiE,4BAEjEC,GAA6B,2CAC7BC,GAAwC,wCACxCC,GAA0C,0CAC1CC,GAAgC,gCAChCC,GAA8B,8BAC9BC,GAAiC,iCACjCC,GAAiC,iCACjCC,GAAkC,kCAClCC,GAAkC,kCAClCC,GAAmC,mCACnCC,GAAyB,qCACzBC,GAA+B,oCAC/BC,GAAqB,uCAErB,MAAMC,MAAmB,cAAkD,CAACC,EAAOC,IAAQ,CACzF,KAAM,CACJ,KAAM,CAAE,OAAAC,CAAO,EAAI,CAAC,EACpB,WAAAC,EACA,MAAAC,EACA,QAAAC,EACA,MAAAC,EAAQ,Q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"__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_Styles", "import_utils", "import_NavProvider", "import_types", "import_jump", "import_gsap", "import_withCategory", "import_icons", "import_NavigationSearch", "import_ResourceSidebarDropdown", "import_MobileResourceSidebarMenu", "import_SidebarDropdown", "import_useScrollLock", "import_MulticolDropdown", "import_SupportsDropdown", "import_MobileSidebarMenu", "import_MobileSupportMenu", "import_MobileMulticolMenu", "import_MobileMenuComponents", "import_AiuiProvider", "import_throttle", "HeaderNavigation", "props", "ref", "header", "buildProps", "event", "profile", "theme", "isTop", "searchResult", "onSearch", "isSearching", "keywords", "onPrimaryNavClick", "onSeriesProductClick", "onSidebarNavClick", "headerId", "cartCount", "menuData", "rest", "searchOpen", "setSearchOpen", "headerHidden", "setHeaderHidden", "changeHeaderBackground", "setChangeHeaderBackground", "isMobile", "setIsMobile", "searchRef", "headerRef", "resizeWindow", "offsetWidth", "jump", "lastScrollY", "upwardDistance", "downwardDistance", "getScrollTop", "initialScrollTop", "handleScroll", "throttle", "currentScrollY", "delta", "searchPage", "item", "NavProvider", "DesktopNavigation", "MobileNavigation", "NavigationSearch", "value", "e", "data", "onNavItemClick", "className", "downdownHover", "setDowndownHover", "locale", "groupCategories", "categoriesItem", "setCategoriesItem", "navStatusArray", "setNavStatusArray", "profileRef", "userProfileOpen", "setUserProfileOpen", "dropdownRef", "navItemRefs", "categories", "groupItem", "groupIndex", "_", "index", "currentNavItem", "handleNavItemClick", "currentCategoriesItem", "position", "prev", "handleNavItemKeyDown", "handleNavMenuClose", "currentBlockTypeCategories", "SidebarDropdownComp", "ResourceSidebarDropdownComp", "MulticolDropdownComp", "SupportsDropdownComp", "DropdownComp", "actions", "profileAction", "handleProfileClick", "profileRefElement", "Logo", "Actions", "isExpanded", "el", "currentMenu", "setCurrentMenu", "subSubCategory", "mobileMenuOpen", "setMobileMenuOpen", "menuInnerHeight", "setMenuInnerHeight", "mobileMenuRef", "rect", "MobileSupportMenuComp", "MobileSidebarMenuComp", "MobileResourceSidebarMenuComp", "MobileMulticolMenuComp", "MobileCategoriesMenuComp", "handleSecondaryMenuClose", "menuActions", "MobileCategoriesHeaderComp", "PrimaryHeader", "SecondaryHeader", "handlePrimaryMenuClick", "MobilePrimaryMenu", "onPrimaryMenuClick", "ProfileComp", "profileOpen", "setProfileOpen", "menuOpen", "onMenuOpenClose", "onMenuOpenClick", "payloadData", "activeStatus", "activeAction", "setActiveAction", "getActionLabel", "blockType", "handleActionClick", "action", "title", "onMenuBackClick"]
4
+ "sourcesContent": ["'use client'\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\n\nimport { Picture, Text, Button, Container, BrandStrip } from '../../components/index.js'\n\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\n\nimport type {\n MobilePrimaryNavigationData,\n MobileSecondaryNavigationData,\n MobileNavigationProps,\n DesktopNavigationProps,\n HeaderNavigationProps,\n} from './types.js'\nimport NavProvider, { useNavContext } from './NavProvider.js'\n\nimport { HeaderNavigationMenu, HeaderNavigationBlockType, HeaderNavigationActionBlockType } from './types.js'\nimport type { HeaderNavigationSearchStyle } from './types.js'\n\nimport jump from 'jump.js'\n\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\n\nimport {\n WithSidebar,\n WithSupports,\n WithMulticol,\n WithGroupCategory,\n WithResource,\n WithTextLinks,\n} from './withCategory.js'\n\nimport { Menu, Close, User, LeftArrow, DownArrow, Polygon } from './icons/index.js'\n\nimport NavigationSearch from '../NavigationSearch/index.js'\nimport { ResourceSidebarDropdown } from './ResourceSidebarDropdown.js'\nimport { MobileResourceSidebarMenu } from './MobileResourceSidebarMenu.js'\nimport { SidebarDropdown } from './SidebarDropdown.js'\nimport { useScrollLock } from './useScrollLock.js'\nimport { MulticolDropdown } from './MulticolDropdown.js'\nimport { TextLinksDropdown } from './TextLinksDropdown.js'\nimport { SupportsDropdown } from './SupportsDropdown.js'\nimport { MobileSidebarMenu } from './MobileSidebarMenu.js'\nimport { MobileSupportMenu } from './MobileSupportMenu.js'\nimport { MobileMulticolMenu } from './MobileMulticolMenu.js'\nimport { MobileTextLinksMenu } from './MobileTextLinksMenu.js'\nimport { MenuItem } from './MobileMenuComponents.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport throttle from '../../shared/throttle.js'\n\nconst HeaderNavigation = forwardRef<HTMLDivElement, HeaderNavigationProps>((props, ref) => {\n const {\n data: { header } = {},\n buildProps,\n event,\n profile,\n theme = 'light',\n isTop = false,\n searchResult,\n onSearch,\n isSearching,\n keywords,\n onPrimaryNavClick,\n onSeriesProductClick,\n onSidebarNavClick,\n headerId,\n cartCount,\n menuData,\n ...rest\n } = props\n\n const [searchOpen, setSearchOpen] = useState(false)\n const [headerHidden, setHeaderHidden] = useState(false)\n const [changeHeaderBackground, setChangeHeaderBackground] = useState(false)\n const [isMobile, setIsMobile] = useState(false)\n const searchRef = useRef<HTMLDivElement>(null)\n\n const headerRef = useRef<HTMLDivElement>(null)\n\n const resizeWindow = () => {\n const offsetWidth = document?.querySelector('body')?.offsetWidth || 0\n setIsMobile(offsetWidth <= 1440)\n }\n\n useEffect(() => {\n resizeWindow()\n window.addEventListener('resize', resizeWindow)\n return () => {\n window.removeEventListener('resize', resizeWindow)\n }\n }, [])\n\n useImperativeHandle(ref, () => headerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (headerRef.current && isTop) {\n jump(headerRef.current, { duration: 0, offset: headerRef.current?.getBoundingClientRect()?.bottom || 0 })\n }\n }, [isTop])\n\n useEffect(() => {\n // \u5982\u679C isTop \u4E3A true\uFF0C\u4E0D\u9700\u8981\u6EDA\u52A8\u76D1\u542C\u548C\u52A8\u6548\n if (isTop) {\n setHeaderHidden(false)\n setChangeHeaderBackground(false)\n return\n }\n\n let lastScrollY = 0\n let upwardDistance = 0\n let downwardDistance = 0\n\n const getScrollTop = () => {\n return document?.documentElement?.scrollTop || document?.body?.scrollTop || 0\n }\n\n // \u521D\u59CB\u5316\u72B6\u6001\n const initialScrollTop = getScrollTop()\n lastScrollY = initialScrollTop\n setHeaderHidden(initialScrollTop > 300)\n setChangeHeaderBackground(initialScrollTop > 30)\n\n const handleScroll = throttle(() => {\n const currentScrollY = getScrollTop()\n const delta = currentScrollY - lastScrollY\n\n // \u66F4\u65B0\u80CC\u666F\u72B6\u6001\n setChangeHeaderBackground(currentScrollY > 30)\n\n if (delta > 0) {\n // \u5411\u4E0B\u6EDA\u52A8\n upwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0A\u7D2F\u8BA1\n downwardDistance += delta\n\n if (downwardDistance >= 300 && currentScrollY > 300) {\n setHeaderHidden(true)\n }\n } else if (delta < 0) {\n // \u5411\u4E0A\u6EDA\u52A8\n downwardDistance = 0 // \u91CD\u7F6E\u5411\u4E0B\u7D2F\u8BA1\n upwardDistance += Math.abs(delta)\n\n if (upwardDistance >= 300) {\n setHeaderHidden(false)\n upwardDistance = 0\n }\n }\n\n lastScrollY = currentScrollY\n }, 100)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => window.removeEventListener('scroll', handleScroll)\n }, [isTop])\n\n useEffect(() => {\n if (event) {\n event.search = () => setSearchOpen(true)\n }\n }, [event])\n\n useGSAP(() => {\n if (searchRef?.current && searchOpen) {\n gsap.fromTo(\n searchRef.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n duration: 0.3,\n }\n )\n }\n }, [searchOpen])\n\n useScrollLock(searchOpen)\n\n const searchPage = useMemo(() => {\n return (\n header?.bar?.actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Search)\n ?.searchBar?.[0] || {}\n )\n }, [header])\n\n return (\n <NavProvider\n buildProps={buildProps}\n profile={profile}\n isMobile={isMobile}\n event={event}\n payloadData={header}\n onSidebarNavClick={onSidebarNavClick}\n onSeriesProductClick={onSeriesProductClick}\n cartCount={cartCount}\n >\n <header\n {...rest}\n id={headerId || 'header'}\n data-ui-component-id=\"HeaderNavigation\"\n className={\n isTop\n ? 'relative z-[100] bg-white'\n : cn('sticky top-0 z-[100] transition-transform duration-500 ease-in-out', {\n ['translate-y-[-100%]']: headerHidden,\n })\n }\n // className=\"relative z-[100] bg-white\"\n ref={headerRef}\n >\n <div\n className={cn(\n 'hover:bg-white hover:text-black',\n theme === 'light' ? 'text-black' : 'text-white',\n {\n ['!bg-white transition-all duration-500 ease-in-out']: !isTop && changeHeaderBackground,\n },\n {\n ['hover:!text-black']: theme === 'dark',\n ['!text-black']: !isTop && changeHeaderBackground,\n }\n )}\n onClick={() => !isTop && setChangeHeaderBackground(true)}\n >\n <DesktopNavigation\n data={header}\n className=\"desktop:block hidden !bg-white\"\n theme={theme}\n onNavItemClick={() => !isTop && setChangeHeaderBackground(true)}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n />\n {searchOpen && (\n <div\n className=\"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70\"\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.top}px)` }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Search\"\n >\n <div ref={searchRef} className={cn('overflow-y-auto', {})}>\n <NavigationSearch\n data={searchPage}\n keywords={keywords}\n isSearching={isSearching}\n searchResult={searchResult}\n onSearch={(value: string) => {\n onSearch?.(value)\n }}\n onClose={() => {\n onSearch?.()\n setSearchOpen(false)\n }}\n />\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setSearchOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close search\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setSearchOpen(false)\n }\n }}\n />\n </div>\n )}\n </div>\n </header>\n </NavProvider>\n )\n})\n\nconst DesktopNavigation = forwardRef<HTMLDivElement, DesktopNavigationProps>((props, ref) => {\n const { data, onNavItemClick, className, theme, onPrimaryNavClick } = props\n const { event, profile } = useNavContext()\n const [downdownHover, setDowndownHover] = useState(false)\n const { locale = 'us' } = useAiuiContext()\n\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.pcShow)) as any[][]\n }, [data])\n\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n const [navStatusArray, setNavStatusArray] = useState<{ index: number; groupIndex: number; open: boolean }[][]>([])\n const profileRef = useRef<HTMLButtonElement>(null)\n const [userProfileOpen, setUserProfileOpen] = useState(false)\n const headerRef = useRef<HTMLDivElement>(null)\n const dropdownRef = useRef<HTMLDivElement>(null)\n const navItemRefs = useRef<HTMLDivElement[][]>(\n groupCategories.map((categories: any) => Array(categories?.length || 0).fill(null))\n )\n\n useEffect(() => {\n if (groupCategories?.length) {\n setNavStatusArray(\n groupCategories?.map((groupItem: any, groupIndex: number) => {\n return groupItem?.map((_: any, index: number) => ({ groupIndex, index, open: false }))\n })\n )\n }\n }, [groupCategories])\n\n const currentNavItem = useMemo(() => {\n let currentNavItem: { index: number; groupIndex: number; open: boolean } | null = null\n for (const groupItem of navStatusArray) {\n for (const item of groupItem) {\n if (item.open) {\n currentNavItem = item\n break\n }\n }\n if (currentNavItem) break\n }\n return currentNavItem\n }, [navStatusArray])\n\n useScrollLock(!!currentNavItem?.open || userProfileOpen)\n\n const handleNavItemClick = (e: any, groupIndex: number, index: number) => {\n setUserProfileOpen(false)\n // if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n const currentCategoriesItem = groupCategories[groupIndex][index]\n if (currentCategoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n // categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n currentCategoriesItem?.components?.[0]?.url && window.open(currentCategoriesItem?.components?.[0]?.url)\n } else {\n const categories = groupCategories?.flat() || []\n const position = categories?.findIndex(item => item?.id === groupCategories[groupIndex][index]?.id)\n e.stopPropagation()\n onNavItemClick?.()\n onPrimaryNavClick?.(categories[position], position)\n // setCategoriesItem(groupCategories[groupIndex][index])\n setCategoriesItem(currentCategoriesItem)\n setNavStatusArray(prev =>\n prev.map(groupItem =>\n groupItem.map(item =>\n item.groupIndex === groupIndex && item.index === index\n ? { ...item, open: !item.open }\n : { ...item, open: false }\n )\n )\n )\n }\n }\n\n const handleNavItemKeyDown = (e: React.KeyboardEvent, groupIndex: number, index: number) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleNavItemClick(e, groupIndex, index)\n } else if (e.key === 'Escape' && currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index) {\n e.preventDefault()\n handleNavMenuClose()\n }\n }\n\n const handleNavMenuClose = () => {\n setNavStatusArray(prev => prev.map(groupItem => groupItem.map(item => ({ ...item, open: false }))))\n }\n\n const currentBlockTypeCategories = useMemo(() => {\n if (categoriesItem) return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const SidebarDropdownComp = WithSidebar(SidebarDropdown, categoriesItem)\n const ResourceSidebarDropdownComp = WithResource(ResourceSidebarDropdown, categoriesItem)\n const MulticolDropdownComp = WithMulticol(MulticolDropdown, categoriesItem)\n const TextLinksDropdownComp = WithTextLinks(TextLinksDropdown, categoriesItem)\n const SupportsDropdownComp = WithSupports(SupportsDropdown, {\n categoriesItem,\n currentNavItemRef: navItemRefs.current?.[currentNavItem?.groupIndex || 0]?.[currentNavItem?.index || 0],\n })\n\n const DropdownComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <SidebarDropdownComp />\n case HeaderNavigationBlockType.Resource:\n return <ResourceSidebarDropdownComp />\n case HeaderNavigationBlockType.Supports:\n return <SupportsDropdownComp />\n case HeaderNavigationBlockType.Multicol:\n return <MulticolDropdownComp />\n case HeaderNavigationBlockType.TextLinks:\n return <TextLinksDropdownComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem])\n\n const actions = useMemo(() => {\n return data?.bar?.actions?.filter((item: any) => item?.pcShow)\n }, [data])\n\n const profileAction = useMemo(() => {\n return actions?.find((item: any) => item?.blockType === HeaderNavigationActionBlockType.Profile)\n }, [actions])\n\n const handleProfileClick = useCallback(() => {\n setUserProfileOpen(prev => !prev)\n }, [])\n\n useEffect(() => {\n if (profileRef?.current) {\n const profileRefElement = profileRef.current as HTMLButtonElement\n profileRefElement.addEventListener('click', handleProfileClick)\n\n return () => {\n profileRefElement.removeEventListener('click', handleProfileClick)\n }\n }\n }, [handleProfileClick])\n\n useGSAP(() => {\n if (currentNavItem?.open) {\n gsap.fromTo(\n dropdownRef?.current,\n {\n height: 0,\n },\n {\n height: 'auto',\n }\n )\n }\n }, [currentNavItem?.open])\n\n return (\n <Container className={cn('relative h-[96px]', className)}>\n <div ref={headerRef} onClick={handleNavMenuClose} className=\"flex h-full flex-col justify-end gap-4\">\n <div className=\"flex items-center justify-between\">\n <Logo />\n <Actions ref={profileRef} actions={actions} activeStatus={userProfileOpen} />\n </div>\n <nav className=\"flex justify-between\" role=\"navigation\" aria-label=\"Primary navigation\">\n {groupCategories?.map((groupItem: any, groupIndex: number) => {\n return (\n <div key={`groupCategory-${groupIndex}`} className=\"flex gap-3\">\n {groupItem?.map((item: any, index: number) => {\n const isExpanded = currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index\n return (\n <div\n key={item.id}\n ref={(el: HTMLDivElement) => {\n navItemRefs.current[groupIndex][index] = el\n }}\n className=\"group\"\n >\n <div className=\"relative\">\n <button\n className=\"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4\"\n onClick={e => handleNavItemClick(e, groupIndex, index)}\n onKeyDown={e => handleNavItemKeyDown(e, groupIndex, index)}\n aria-expanded={isExpanded}\n aria-haspopup=\"true\"\n aria-label={item.text}\n >\n <Text html={item.text} className=\"text-sm font-bold leading-[1.4]\" />\n {/* <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']: isExpanded,\n ['opacity-100']: downdownHover && isExpanded,\n })}\n /> */}\n <DownArrow\n className={cn('size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100', {\n ['rotate-180']:\n currentNavItem?.groupIndex === groupIndex && currentNavItem?.index === index,\n ['opacity-100']:\n downdownHover &&\n currentNavItem?.groupIndex === groupIndex &&\n currentNavItem?.index === index,\n ['invisible']:\n !item?.components?.length ||\n item?.components?.[0]?.blockType === HeaderNavigationBlockType.Links,\n })}\n />\n </button>\n <div\n className={cn(\n 'absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500',\n {\n 'w-[calc(100%-20px)]': isExpanded,\n },\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n aria-hidden=\"true\"\n />\n </div>\n </div>\n )\n })}\n </div>\n )\n })}\n </nav>\n </div>\n <div\n role=\"menu\"\n aria-hidden={!(currentNavItem?.open && categoriesItem)}\n className={cn(\n 'absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black',\n {\n hidden: !(currentNavItem?.open && categoriesItem),\n }\n )}\n onMouseEnter={() => setDowndownHover(true)}\n onMouseLeave={() => setDowndownHover(false)}\n style={{ height: `calc(100dvh - ${headerRef?.current?.getBoundingClientRect()?.bottom}px)` }}\n >\n <div\n ref={dropdownRef}\n className={cn('relative z-50', {\n 'overflow-hidden': currentBlockTypeCategories !== HeaderNavigationBlockType.Supports,\n })}\n >\n {DropdownComp}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={handleNavMenuClose}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n handleNavMenuClose()\n }\n }}\n />\n </div>\n {userProfileOpen && (\n <div\n className=\"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"User profile menu\"\n // style={{\n // height: `calc(100dvh - ${profileRef?.current?.getBoundingClientRect()?.bottom}px)`,\n // top: `calc(96px)`,\n // }}\n >\n <div\n className=\"rounded-box absolute w-[272px] overflow-hidden bg-white p-4\"\n style={{\n right: `calc(100% - ${profileRef?.current?.getBoundingClientRect()?.right}px)`,\n top: '-36px',\n }}\n >\n {profile?.email ? (\n <>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-sm font-bold\" />\n <div className=\"mt-2 h-px bg-[#D9D9D9]\" aria-hidden=\"true\" />\n <nav className=\"mt-2\" role=\"navigation\" aria-label=\"Profile navigation\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem\n className=\"py-2\"\n key={item.id}\n label={item?.title}\n href={getLocalizedPath(item?.url, locale)}\n />\n ))}\n </nav>\n </>\n ) : (\n <>\n <Polygon className=\"absolute -top-2 right-[46px] z-30 text-white\" aria-hidden=\"true\" />\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture\n source={item.benefitIcon?.url}\n className=\"size-4\"\n alt={item.benefit}\n width={16}\n height={16}\n />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n <div className=\"mt-4 flex items-center gap-2\">\n <Button variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button variant=\"primary\" size=\"lg\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"font-bold\" />\n </Button>\n </div>\n </>\n )}\n </div>\n <div\n className=\"flex-1 bg-transparent\"\n onClick={() => setUserProfileOpen(false)}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Close profile menu\"\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ' || e.key === 'Escape') {\n e.preventDefault()\n setUserProfileOpen(false)\n }\n }}\n />\n </div>\n )}\n </Container>\n )\n})\n\nconst MobileNavigation = forwardRef<HTMLDivElement, MobileNavigationProps>(\n ({ data, menuData, className, onPrimaryNavClick }, ref) => {\n const groupCategories = useMemo(() => {\n return WithGroupCategory(data?.categories?.filter((item: any) => item?.mobileShow))\n }, [data])\n\n const { currentMenu, setCurrentMenu, subSubCategory } = useNavContext()\n const [mobileMenuOpen, setMobileMenuOpen] = useState(false)\n const [menuInnerHeight, setMenuInnerHeight] = useState(0)\n const [categoriesItem, setCategoriesItem] = useState<any>(null)\n\n const mobileMenuRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.bottom || 0))\n }\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n gsap.fromTo(\n mobileMenuRef.current,\n {\n height: 0,\n },\n {\n height: menuInnerHeight,\n duration: 0.3,\n }\n )\n }, [menuInnerHeight])\n\n useScrollLock(mobileMenuOpen)\n\n const currentBlockTypeCategories = useMemo(() => {\n return categoriesItem?.components?.[0]?.blockType\n }, [categoriesItem])\n\n const MobileSupportMenuComp = WithSupports(MobileSupportMenu, {\n categoriesItem,\n })\n\n const MobileSidebarMenuComp = WithSidebar(MobileSidebarMenu, categoriesItem)\n const MobileResourceSidebarMenuComp = WithResource(MobileResourceSidebarMenu, categoriesItem)\n const MobileMulticolMenuComp = WithMulticol(MobileMulticolMenu, categoriesItem)\n const MobileTextLinksMenuComp = WithTextLinks(MobileTextLinksMenu, categoriesItem)\n const MobileCategoriesMenuComp = useMemo(() => {\n switch (currentBlockTypeCategories) {\n case HeaderNavigationBlockType.Sidebar:\n return <MobileSidebarMenuComp />\n case HeaderNavigationBlockType.Resource:\n return <MobileResourceSidebarMenuComp />\n case HeaderNavigationBlockType.Supports:\n return <MobileSupportMenuComp />\n case HeaderNavigationBlockType.Multicol:\n return <MobileMulticolMenuComp />\n case HeaderNavigationBlockType.TextLinks:\n return <MobileTextLinksMenuComp />\n default:\n return null\n }\n }, [currentBlockTypeCategories, categoriesItem, MobileSupportMenuComp])\n\n const handleSecondaryMenuClose = useCallback(() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Primary)\n }, [setMobileMenuOpen, setMenuInnerHeight, setCurrentMenu])\n\n const menuActions = useMemo(() => {\n return data?.bar?.actions?.filter(\n (item: any) => item?.mobileShow && item?.blockType !== HeaderNavigationActionBlockType.Profile // \u79FB\u52A8\u7AEF\u4E0D\u663E\u793Aprofile\u6309\u94AE\n )\n }, [data])\n\n const profileAction = useMemo(() => {\n return (\n data?.bar?.actions?.find(\n (item: any) => item?.mobileShow && item?.blockType === HeaderNavigationActionBlockType.Profile\n ) || {}\n )\n }, [data])\n\n const MobileCategoriesHeaderComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Primary:\n return (\n <PrimaryHeader\n actions={menuActions}\n menuOpen={mobileMenuOpen}\n onMenuOpenClose={() => {\n setMobileMenuOpen(false)\n setMenuInnerHeight(0)\n }}\n onMenuOpenClick={() => setMobileMenuOpen(true)}\n />\n )\n case HeaderNavigationMenu.Secondary:\n return (\n <SecondaryHeader\n title={categoriesItem?.text}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Primary)}\n />\n )\n case HeaderNavigationMenu.Third:\n return (\n <SecondaryHeader\n title={subSubCategory?.label}\n onMenuOpenClose={handleSecondaryMenuClose}\n onMenuBackClick={() => setCurrentMenu?.(HeaderNavigationMenu.Secondary)}\n />\n )\n default:\n return null\n }\n }, [\n mobileMenuOpen,\n currentMenu,\n setCurrentMenu,\n categoriesItem,\n menuActions,\n subSubCategory,\n handleSecondaryMenuClose,\n ])\n\n const handlePrimaryMenuClick = useCallback(\n (groupIndex: number, index: number) => {\n const categoriesItem = Array.isArray(groupCategories)\n ? Array.isArray(groupCategories[groupIndex])\n ? // @ts-ignore\n groupCategories[groupIndex][index]\n : {}\n : {}\n setCategoriesItem(categoriesItem)\n if (categoriesItem?.components?.[0]?.blockType === HeaderNavigationBlockType.Links) {\n // link\u6A21\u5757\u7279\u6B8A\u5904\u7406\n categoriesItem?.components?.[0]?.url && window.open(categoriesItem?.components?.[0]?.url)\n } else {\n setCurrentMenu?.(HeaderNavigationMenu.Secondary)\n }\n },\n [groupCategories, setCurrentMenu]\n )\n\n return (\n <Container className={cn('relative h-[52px]', className)}>\n {/* \u79FB\u52A8\u7AEF\u5206\u7C7B\u83DC\u5355 */}\n {MobileCategoriesHeaderComp}\n {mobileMenuOpen && (\n <nav\n ref={mobileMenuRef}\n className=\"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black\"\n style={{ height: menuInnerHeight }}\n role=\"navigation\"\n aria-label=\"Mobile navigation menu\"\n >\n {currentMenu === HeaderNavigationMenu.Primary && menuData ? (\n <div className=\"pt-4\">\n <BrandStrip data={menuData} />\n </div>\n ) : null}\n {currentMenu === HeaderNavigationMenu.Primary ? (\n <MobilePrimaryMenu\n categories={groupCategories}\n onPrimaryMenuClick={handlePrimaryMenuClick}\n onPrimaryNavClick={onPrimaryNavClick}\n profileAction={profileAction}\n />\n ) : (\n MobileCategoriesMenuComp\n )}\n </nav>\n )}\n </Container>\n )\n }\n)\n\n/**\n * \u79FB\u52A8\u7AEF\u4E00\u7EA7\u83DC\u5355\n * @param categories \u5206\u7C7B\n * @param onPrimaryMenuClick \u4E00\u7EA7\u83DC\u5355\u70B9\u51FB\n */\nconst MobilePrimaryMenu = ({\n categories,\n onPrimaryMenuClick,\n profileAction,\n onPrimaryNavClick,\n}: {\n categories: any\n onPrimaryMenuClick: (groupIndex: number, index: number) => void\n profileAction: any\n onPrimaryNavClick?: (category: any, position: number) => void\n}) => {\n return (\n <div className=\"flex h-full flex-col justify-between\">\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {categories?.map((groupItem: any, groupIndex: number) => (\n <div key={`groupCategory-${groupIndex}`} className=\"\">\n <div className={cn('my-2 h-px w-full bg-[#E5E5E7]')} />\n {groupItem?.map((item: any, index: number) => (\n <MenuItem\n key={item.id}\n label={item.text}\n onClick={() => {\n const flatCategories = categories?.flat() || []\n const position = flatCategories?.findIndex(\n (item: any) => item?.id === categories[groupIndex][index]?.id\n )\n onPrimaryMenuClick(groupIndex, index)\n onPrimaryNavClick?.(item, position)\n }}\n icon={item.components?.[0]?.icon}\n />\n ))}\n </div>\n ))}\n </div>\n <ProfileComp profileAction={profileAction} />\n </div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nconst ProfileComp = ({ profileAction }: { profileAction: any }) => {\n const [profileOpen, setProfileOpen] = useState(false)\n const { profile, event } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <div\n className={cn('tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6', {\n 'p-4': profileOpen,\n })}\n >\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent\"\n onClick={() => setProfileOpen(!profileOpen)}\n aria-expanded={profileOpen}\n aria-label={profile?.nick_name || profileAction?.welcome}\n >\n <div className=\"flex items-center gap-[14px]\">\n <div className=\"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white\">\n <User aria-hidden=\"true\" />\n </div>\n <Text html={profile?.nick_name || profileAction?.welcome} className=\"text-base font-bold leading-[1.4]\" />\n </div>\n {!profile?.email && (\n <DownArrow aria-hidden=\"true\" className={cn('laptop:size-4 size-5', { 'rotate-180': profileOpen })} />\n )}\n </button>\n {profile?.email && (\n <nav className=\"mt-4\" role=\"navigation\" aria-label=\"Profile menu\">\n {profileAction?.profiles?.map((item: any) => (\n <MenuItem key={item.id} label={item?.title} href={getLocalizedPath(item?.url, locale)} />\n ))}\n </nav>\n )}\n {profileOpen && !profile?.email && (\n <div className=\"mt-4\">\n <Text html={profileAction?.benefits_title} className=\"text-sm font-bold leading-[1.4]\" />\n <div className=\"mt-2 flex flex-col gap-1\">\n {profileAction?.benefits?.map((item: any) => (\n <div key={item.id} className=\"flex items-center gap-[6px]\">\n <Picture source={item.benefitIcon?.url} className=\"size-4\" alt={item.benefit} width={16} height={16} />\n <Text html={item.benefit} className=\"text-sm font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )}\n {!profile?.email && (\n <div className=\"mt-4 flex items-center gap-3\">\n <Button className=\"tablet:flex-none flex-1\" variant=\"secondary\" size=\"base\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n <Button className=\"tablet:flex-none flex-1\" variant=\"primary\" size=\"base\" onClick={() => event?.login?.()}>\n <Text html={profileAction?.secondaryButton || 'Log In'} className=\"text-sm font-bold leading-[1.4]\" />\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst PrimaryHeader = ({ menuOpen, onMenuOpenClose, onMenuOpenClick, actions }: MobilePrimaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center justify-between gap-4\">\n <Logo />\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n <Actions actions={actions} />\n {menuOpen ? (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n aria-expanded=\"true\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClick()}\n aria-label=\"Open menu\"\n aria-expanded=\"false\"\n aria-haspopup=\"true\"\n >\n <Menu className=\"size-5\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nconst Logo = () => {\n const { payloadData, isMobile } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n return (\n <a\n href={getLocalizedPath('/', locale)}\n className=\"hover:text-brand-0 [&>svg]:w-full\"\n aria-label=\"Home\"\n dangerouslySetInnerHTML={{\n __html: isMobile ? payloadData?.bar?.mobileLogo : payloadData?.bar?.desktopLogo,\n }}\n />\n )\n}\n\nconst Actions = forwardRef<HTMLButtonElement, { actions: any; activeStatus?: boolean }>(\n ({ actions, activeStatus = false }, ref) => {\n const { event, cartCount } = useNavContext()\n const [activeAction, setActiveAction] = useState<any>(null)\n\n const getActionLabel = (blockType: string) => {\n switch (blockType) {\n case HeaderNavigationActionBlockType.Search:\n return 'Search'\n case HeaderNavigationActionBlockType.Cart:\n return `Shopping cart${cartCount > 0 ? ` (${cartCount} items)` : ''}`\n case HeaderNavigationActionBlockType.Profile:\n return 'User profile'\n case HeaderNavigationActionBlockType.Livestream:\n return 'Livestream'\n default:\n return 'Action'\n }\n }\n\n const handleActionClick = useCallback(\n (action: any, index: number) => {\n setActiveAction(index)\n switch (action?.blockType) {\n case HeaderNavigationActionBlockType.Search:\n event?.search?.()\n break\n case HeaderNavigationActionBlockType.Cart:\n event?.cart?.()\n break\n case HeaderNavigationActionBlockType.Profile:\n event?.profile?.()\n break\n case HeaderNavigationActionBlockType.Livestream:\n event?.livestream?.()\n break\n default:\n return () => {}\n }\n },\n [event]\n )\n\n return (\n <div className=\"desktop:gap-6 flex items-center gap-4\">\n {Array.isArray(actions) &&\n actions.map((action: any, index: number) => {\n const isSearch = action.blockType === HeaderNavigationActionBlockType.Search\n const searchStyle: HeaderNavigationSearchStyle = action.searchStyle ?? 'icon'\n const isCapsule = isSearch && searchStyle === 'capsule'\n\n if (isCapsule) {\n // \u80F6\u56CA\u6A21\u5F0F\uFF1A\u540C\u65F6\u6E32\u67D3\u4E24\u79CD\u5F62\u6001\uFF0CCSS \u63A7\u5236\u54CD\u5E94\u5F0F\u663E\u9690\n return (\n <React.Fragment key={action.id}>\n {/* \u80F6\u56CA\u5F62\u641C\u7D22\u6846 \u2014 tablet(\u2265768px) \u663E\u793A */}\n <button\n className=\"tablet:flex bg-container-primary hidden h-9 w-[200px] cursor-pointer items-center rounded-full border-0 px-2\"\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5 shrink-0', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n </button>\n {/* \u88F8\u56FE\u6807 \u2014 \u79FB\u52A8\u7AEF(<768px) \u663E\u793A */}\n <button\n className=\"tablet:hidden relative cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n </button>\n </React.Fragment>\n )\n }\n\n // \u9ED8\u8BA4\u6837\u5F0F\uFF1A\u88F8\u56FE\u6807\uFF08\u539F\u65B9\u6848\uFF09\n return (\n <button\n className=\"relative cursor-pointer border-0 bg-transparent p-0\"\n key={action.id}\n ref={action.blockType === HeaderNavigationActionBlockType.Profile ? ref : null}\n onClick={() => handleActionClick(action, index)}\n aria-label={getActionLabel(action.blockType)}\n aria-pressed={activeStatus && activeAction === index}\n >\n <Text\n html={action.icon}\n className={cn('size-5', { 'text-brand-0': activeStatus && activeAction === index })}\n aria-hidden=\"true\"\n />\n {action.blockType === HeaderNavigationActionBlockType.Cart && cartCount > 0 && (\n <div\n className=\"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]\"\n aria-hidden=\"true\"\n >\n <Text html={cartCount?.toString()} className=\"text-sm font-bold leading-[1.2] text-white\" />\n </div>\n )}\n </button>\n )\n })}\n </div>\n )\n }\n)\n\nconst SecondaryHeader = ({ title, onMenuOpenClose, onMenuBackClick }: MobileSecondaryNavigationData) => {\n return (\n <div className=\"flex h-full items-center gap-3\">\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuBackClick()}\n aria-label=\"Back to previous menu\"\n >\n <LeftArrow className=\"size-5\" aria-hidden=\"true\" />\n </button>\n <Text html={title} className=\"flex-1 text-center text-base font-bold leading-[1.4]\" />\n <button\n className=\"cursor-pointer border-0 bg-transparent p-0\"\n onClick={() => onMenuOpenClose()}\n aria-label=\"Close menu\"\n >\n <Close className=\"size-5\" aria-hidden=\"true\" />\n </button>\n </div>\n )\n}\n\nMobileNavigation.displayName = 'MobileNavigation'\nActions.displayName = 'Actions'\nHeaderNavigation.displayName = 'HeaderNavigation'\nDesktopNavigation.displayName = 'DesktopNavigation'\n\nexport default withLayout(HeaderNavigation)\n"],
5
+ "mappings": "slBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAmOU,IAAAI,EAAA,6BAlOVC,EAA0G,oBAE1GC,EAA6D,qCAE7DC,GAA2B,kCAE3BC,EAAqC,kCASrCC,EAA2C,+BAE3CC,EAAiG,sBAGjGC,GAAiB,sBAEjBN,GAAwB,uBACxBO,GAAqB,gBAErBC,EAOO,6BAEPC,EAAiE,4BAEjEC,GAA6B,2CAC7BC,GAAwC,wCACxCC,GAA0C,0CAC1CC,GAAgC,gCAChCC,GAA8B,8BAC9BC,GAAiC,iCACjCC,GAAkC,kCAClCC,GAAiC,iCACjCC,GAAkC,kCAClCC,GAAkC,kCAClCC,GAAmC,mCACnCC,GAAoC,oCACpCC,GAAyB,qCACzBC,GAA+B,oCAC/BC,GAAqB,uCAErB,MAAMC,MAAmB,cAAkD,CAACC,EAAOC,IAAQ,CACzF,KAAM,CACJ,KAAM,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AS,IAAM8H,EAAkBC,EAAQ3D,CAAK,EAC9C,aAAYwD,EAAeG,EAAO,SAAS,EAC3C,eAAcN,GAAgBC,IAAiBtD,EAE/C,oBAAC,QACC,KAAM2D,EAAO,KACb,aAAW,MAAG,SAAU,CAAE,eAAgBN,GAAgBC,IAAiBtD,CAAM,CAAC,EAClF,cAAY,OACd,EACC2D,EAAO,YAAc,kCAAgC,MAAQhH,EAAY,MACxE,OAAC,OACC,UAAU,uIACV,cAAY,OAEZ,mBAAC,QAAK,KAAMA,GAAW,SAAS,EAAG,UAAU,6CAA6C,EAC5F,IAjBGgH,EAAO,EAmBd,CAEJ,CAAC,EACL,CAEJ,CACF,EAEMjB,GAAkB,CAAC,CAAE,MAAAqB,EAAO,gBAAAb,EAAiB,gBAAAc,CAAgB,OAE/D,QAAC,OAAI,UAAU,iCACb,oBAAC,UACC,UAAU,6CACV,QAAS,IAAMA,EAAgB,EAC/B,aAAW,wBAEX,mBAAC,aAAU,UAAU,SAAS,cAAY,OAAO,EACnD,KACA,OAAC,QAAK,KAAMD,EAAO,UAAU,uDAAuD,KACpF,OAAC,UACC,UAAU,6CACV,QAAS,IAAMb,EAAgB,EAC/B,aAAW,aAEX,mBAAC,SAAM,UAAU,SAAS,cAAY,OAAO,EAC/C,GACF,EAIJ1E,GAAiB,YAAc,mBAC/B4C,GAAQ,YAAc,UACtB1F,GAAiB,YAAc,mBAC/B6C,GAAkB,YAAc,oBAEhC,IAAOzE,MAAQ,eAAW4B,EAAgB",
6
+ "names": ["HeaderNavigation_exports", "__export", "HeaderNavigation_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_Styles", "import_utils", "import_NavProvider", "import_types", "import_jump", "import_gsap", "import_withCategory", "import_icons", "import_NavigationSearch", "import_ResourceSidebarDropdown", "import_MobileResourceSidebarMenu", "import_SidebarDropdown", "import_useScrollLock", "import_MulticolDropdown", "import_TextLinksDropdown", "import_SupportsDropdown", "import_MobileSidebarMenu", "import_MobileSupportMenu", "import_MobileMulticolMenu", "import_MobileTextLinksMenu", "import_MobileMenuComponents", "import_AiuiProvider", "import_throttle", "HeaderNavigation", "props", "ref", "header", "buildProps", "event", "profile", "theme", "isTop", "searchResult", "onSearch", "isSearching", "keywords", "onPrimaryNavClick", "onSeriesProductClick", "onSidebarNavClick", "headerId", "cartCount", "menuData", "rest", "searchOpen", "setSearchOpen", "headerHidden", "setHeaderHidden", "changeHeaderBackground", "setChangeHeaderBackground", "isMobile", "setIsMobile", "searchRef", "headerRef", "resizeWindow", "offsetWidth", "jump", "lastScrollY", "upwardDistance", "downwardDistance", "getScrollTop", "initialScrollTop", "handleScroll", "throttle", "currentScrollY", "delta", "searchPage", "item", "NavProvider", "DesktopNavigation", "MobileNavigation", "NavigationSearch", "value", "e", "data", "onNavItemClick", "className", "downdownHover", "setDowndownHover", "locale", "groupCategories", "categoriesItem", "setCategoriesItem", "navStatusArray", "setNavStatusArray", "profileRef", "userProfileOpen", "setUserProfileOpen", "dropdownRef", "navItemRefs", "categories", "groupItem", "groupIndex", "_", "index", "currentNavItem", "handleNavItemClick", "currentCategoriesItem", "position", "prev", "handleNavItemKeyDown", "handleNavMenuClose", "currentBlockTypeCategories", "SidebarDropdownComp", "ResourceSidebarDropdownComp", "MulticolDropdownComp", "TextLinksDropdownComp", "SupportsDropdownComp", "DropdownComp", "actions", "profileAction", "handleProfileClick", "profileRefElement", "Logo", "Actions", "isExpanded", "el", "currentMenu", "setCurrentMenu", "subSubCategory", "mobileMenuOpen", "setMobileMenuOpen", "menuInnerHeight", "setMenuInnerHeight", "mobileMenuRef", "rect", "MobileSupportMenuComp", "MobileSidebarMenuComp", "MobileResourceSidebarMenuComp", "MobileMulticolMenuComp", "MobileTextLinksMenuComp", "MobileCategoriesMenuComp", "handleSecondaryMenuClose", "menuActions", "MobileCategoriesHeaderComp", "PrimaryHeader", "SecondaryHeader", "handlePrimaryMenuClick", "MobilePrimaryMenu", "onPrimaryMenuClick", "ProfileComp", "profileOpen", "setProfileOpen", "menuOpen", "onMenuOpenClose", "onMenuOpenClick", "payloadData", "activeStatus", "activeAction", "setActiveAction", "getActionLabel", "blockType", "handleActionClick", "action", "isSearch", "searchStyle", "React", "title", "onMenuBackClick"]
7
7
  }
@@ -54,7 +54,8 @@ export declare enum HeaderNavigationBlockType {
54
54
  Supports = "ipc-navigation-supports",
55
55
  Multicol = "ipc-navigation-multicol",
56
56
  Links = "ipc-navigation-links",
57
- Resource = "ipc-navigation-resource"
57
+ Resource = "ipc-navigation-resource",
58
+ TextLinks = "ipc-navigation-textlinks"
58
59
  }
59
60
  export declare enum HeaderNavigationActionBlockType {
60
61
  Search = "ipc-navigation-action-search",
@@ -62,6 +63,12 @@ export declare enum HeaderNavigationActionBlockType {
62
63
  Profile = "ipc-navigation-action-profile",
63
64
  Livestream = "ipc-navigation-action-livestream"
64
65
  }
66
+ /**
67
+ * Search action 的样式模式
68
+ * - 'icon' (默认)裸图标,与其他 action 外观一致
69
+ * - 'capsule' 胶囊搜索框,带背景色和固定宽度
70
+ */
71
+ export type HeaderNavigationSearchStyle = 'icon' | 'capsule';
65
72
  export interface MobileNavigationProps {
66
73
  data: any;
67
74
  menuData: any;
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var g=(r,i)=>{for(var o in i)a(r,o,{get:i[o],enumerable:!0})},l=(r,i,o,e)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of p(i))!u.call(r,n)&&n!==o&&a(r,n,{get:()=>i[n],enumerable:!(e=d(i,n))||e.enumerable});return r};var b=r=>l(a({},"__esModule",{value:!0}),r);var v={};g(v,{HeaderNavigationActionBlockType:()=>m,HeaderNavigationBlockType:()=>c,HeaderNavigationMenu:()=>s});module.exports=b(v);var s=(e=>(e.Primary="primary",e.Secondary="secondary",e.Third="third",e))(s||{}),c=(t=>(t.Sidebar="ipc-navigation-sidebar",t.Supports="ipc-navigation-supports",t.Multicol="ipc-navigation-multicol",t.Links="ipc-navigation-links",t.Resource="ipc-navigation-resource",t))(c||{}),m=(n=>(n.Search="ipc-navigation-action-search",n.Cart="ipc-navigation-action-cart",n.Profile="ipc-navigation-action-profile",n.Livestream="ipc-navigation-action-livestream",n))(m||{});
1
+ "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var g=(r,n)=>{for(var o in n)a(r,o,{get:n[o],enumerable:!0})},l=(r,n,o,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of d(n))!u.call(r,i)&&i!==o&&a(r,i,{get:()=>n[i],enumerable:!(e=p(n,i))||e.enumerable});return r};var b=r=>l(a({},"__esModule",{value:!0}),r);var v={};g(v,{HeaderNavigationActionBlockType:()=>m,HeaderNavigationBlockType:()=>c,HeaderNavigationMenu:()=>s});module.exports=b(v);var s=(e=>(e.Primary="primary",e.Secondary="secondary",e.Third="third",e))(s||{}),c=(t=>(t.Sidebar="ipc-navigation-sidebar",t.Supports="ipc-navigation-supports",t.Multicol="ipc-navigation-multicol",t.Links="ipc-navigation-links",t.Resource="ipc-navigation-resource",t.TextLinks="ipc-navigation-textlinks",t))(c||{}),m=(i=>(i.Search="ipc-navigation-action-search",i.Cart="ipc-navigation-action-cart",i.Profile="ipc-navigation-action-profile",i.Livestream="ipc-navigation-action-livestream",i))(m||{});
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/types.ts"],
4
- "sourcesContent": ["import type React from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\n\nexport interface HeaderNavigationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'className'> {\n data: any\n menuData: any\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number) => void\n onSeriesProductClick?: (_product: any, _position: number, _seriesLabel?: string) => void\n searchResult?: any\n onSearch?: (_value?: string) => void\n isSearching?: boolean\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n headerId?: string\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n buildProps: {\n products?: Product[]\n categories?: Record<string, any>\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n theme?: string\n isTop?: boolean // \u662F\u5426\u5728\u9876\u90E8\n}\n\nexport interface MobilePrimaryNavigationData {\n actions: any\n menuOpen?: boolean\n onMenuOpenClick: () => void\n onMenuOpenClose: () => void\n}\n\nexport interface MobileSecondaryNavigationData {\n title?: string\n onMenuOpenClose: () => void\n onMenuBackClick: () => void\n}\n\nexport enum HeaderNavigationMenu {\n Primary = 'primary',\n Secondary = 'secondary',\n Third = 'third',\n}\n\nexport enum HeaderNavigationBlockType {\n Sidebar = 'ipc-navigation-sidebar',\n Supports = 'ipc-navigation-supports',\n Multicol = 'ipc-navigation-multicol',\n Links = 'ipc-navigation-links',\n Resource = 'ipc-navigation-resource',\n}\n\nexport enum HeaderNavigationActionBlockType {\n Search = 'ipc-navigation-action-search',\n Cart = 'ipc-navigation-action-cart',\n Profile = 'ipc-navigation-action-profile',\n Livestream = 'ipc-navigation-action-livestream',\n}\n\nexport interface MobileNavigationProps {\n data: any\n menuData: any\n className?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n}\n\nexport interface DesktopNavigationProps {\n data: any\n onNavItemClick?: () => void\n className?: string\n theme?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void\n}\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,8BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAL,GAkDO,IAAKI,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAD,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BACXA,EAAA,MAAQ,uBACRA,EAAA,SAAW,0BALDA,OAAA,IAQAD,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
4
+ "sourcesContent": ["import type React from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\n\nexport interface HeaderNavigationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'className'> {\n data: any\n menuData: any\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number) => void\n onSeriesProductClick?: (_product: any, _position: number, _seriesLabel?: string) => void\n searchResult?: any\n onSearch?: (_value?: string) => void\n isSearching?: boolean\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n headerId?: string\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n buildProps: {\n products?: Product[]\n categories?: Record<string, any>\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n theme?: string\n isTop?: boolean // \u662F\u5426\u5728\u9876\u90E8\n}\n\nexport interface MobilePrimaryNavigationData {\n actions: any\n menuOpen?: boolean\n onMenuOpenClick: () => void\n onMenuOpenClose: () => void\n}\n\nexport interface MobileSecondaryNavigationData {\n title?: string\n onMenuOpenClose: () => void\n onMenuBackClick: () => void\n}\n\nexport enum HeaderNavigationMenu {\n Primary = 'primary',\n Secondary = 'secondary',\n Third = 'third',\n}\n\nexport enum HeaderNavigationBlockType {\n Sidebar = 'ipc-navigation-sidebar',\n Supports = 'ipc-navigation-supports',\n Multicol = 'ipc-navigation-multicol',\n Links = 'ipc-navigation-links',\n Resource = 'ipc-navigation-resource',\n TextLinks = 'ipc-navigation-textlinks',\n}\n\nexport enum HeaderNavigationActionBlockType {\n Search = 'ipc-navigation-action-search',\n Cart = 'ipc-navigation-action-cart',\n Profile = 'ipc-navigation-action-profile',\n Livestream = 'ipc-navigation-action-livestream',\n}\n\n/**\n * Search action \u7684\u6837\u5F0F\u6A21\u5F0F\n * - 'icon' \uFF08\u9ED8\u8BA4\uFF09\u88F8\u56FE\u6807\uFF0C\u4E0E\u5176\u4ED6 action \u5916\u89C2\u4E00\u81F4\n * - 'capsule' \u80F6\u56CA\u641C\u7D22\u6846\uFF0C\u5E26\u80CC\u666F\u8272\u548C\u56FA\u5B9A\u5BBD\u5EA6\n */\nexport type HeaderNavigationSearchStyle = 'icon' | 'capsule'\n\nexport interface MobileNavigationProps {\n data: any\n menuData: any\n className?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n}\n\nexport interface DesktopNavigationProps {\n data: any\n onNavItemClick?: () => void\n className?: string\n theme?: string\n onPrimaryNavClick?: (_category: any, _position: number) => void\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void\n}\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,8BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAL,GAkDO,IAAKI,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAD,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BACXA,EAAA,MAAQ,uBACRA,EAAA,SAAW,0BACXA,EAAA,UAAY,2BANFA,OAAA,IASAD,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
6
6
  "names": ["types_exports", "__export", "HeaderNavigationActionBlockType", "HeaderNavigationBlockType", "HeaderNavigationMenu", "__toCommonJS"]
7
7
  }
@@ -8,3 +8,4 @@ export declare function WithSupports<P extends object>(WrappedComponent: React.C
8
8
  export declare function WithMulticol<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<any>>;
9
9
  export declare function WithResource<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<any>>;
10
10
  export declare function WithGroupCategory(categories: any): unknown[];
11
+ export declare function WithTextLinks<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.create;var d=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var h=(a,e)=>{for(var r in e)d(a,r,{get:e[r],enumerable:!0})},l=(a,e,r,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of M(e))!w.call(a,n)&&n!==r&&d(a,n,{get:()=>e[n],enumerable:!(u=y(e,n))||u.enumerable});return a};var P=(a,e,r)=>(r=a!=null?p(f(a)):{},l(e||!a||!a.__esModule?d(r,"default",{value:a,enumerable:!0}):r,a)),N=a=>l(d({},"__esModule",{value:!0}),a);var g={};h(g,{WithGroupCategory:()=>D,WithMulticol:()=>S,WithResource:()=>b,WithSidebar:()=>m,WithSupports:()=>R});module.exports=N(g);var c=require("react/jsx-runtime"),s=P(require("react"));function m(a,e){const r=(0,s.useMemo)(()=>{let t=null;try{t=JSON.parse(e?.components?.[0]?.sidebar?.categoriesMetadata||"{}")}catch(o){console.log("categoriesMetadata Parse error",o)}return t},[e]),u=(0,s.useMemo)(()=>{let t=null;try{t=JSON.parse(e?.components?.[0]?.sidebar?.seriesMetadata||"[]")}catch(o){console.log("seriesMetadata Parse error",o)}return t},[e]),n=s.default.forwardRef((t,o)=>(0,c.jsx)(a,{...t,ref:o,seriesMetadata:u,sidebarCategoriesMetadata:r}));return n.displayName=a.displayName||a.name||"WithSidebarDropdown",n}function R(a,{categoriesItem:e,currentNavItemRef:r}){const u=(0,s.useMemo)(()=>e?.components?.[0]?.supports,[e]),n=s.default.forwardRef((t,o)=>(0,c.jsx)(a,{...t,supportsMetadata:u,currentNavItemRef:r,ref:o}));return n.displayName=a.displayName||a.name||"WithSupportsDropdown",n}function S(a,e){const r=e?.components?.[0]?.showStatsBanner,u=e?.components?.[0]?.statsBanner?.[0],n=(0,s.useMemo)(()=>{try{return JSON.parse(e?.components?.[0]?.multicol?.multicolMetadata||"{}")}catch(o){console.log("multicolMetadata Parse error",o)}return null},[e]),t=s.default.forwardRef((o,i)=>(0,c.jsx)(a,{...o,ref:i,multicolMetadata:n,showStatsBanner:r,statsBannerData:u}));return t.displayName=a.displayName||a.name||"WithMulticolDropdown",t}function b(a,e){const r=(0,s.useMemo)(()=>{let t=null;try{t=JSON.parse(e?.components?.[0]?.resource?.categoriesMetadata||"{}")}catch(o){console.log("resourceCategoriesMetadata Parse error",o)}return t},[e]),u=(0,s.useMemo)(()=>{let t=null;try{t=JSON.parse(e?.components?.[0]?.resource?.resourceMetadata||"[]")}catch(o){console.log("resourcesMetadata Parse error",o)}return t},[e]),n=s.default.forwardRef((t,o)=>(0,c.jsx)(a,{...t,ref:o,resourcesMetadata:u,resourceCategoriesMetadata:r}));return n.displayName=a.displayName||a.name||"WithResourceDropdown",n}function D(a){return a?Object.values(a?.reduce((e,r)=>(e[r.group]||(e[r.group]=[]),e[r.group].push(r),e),{})):[[]]}
1
+ "use strict";var y=Object.create;var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var r in t)l(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of M(t))!w.call(e,o)&&o!==r&&l(e,o,{get:()=>t[o],enumerable:!(u=p(t,o))||u.enumerable});return e};var P=(e,t,r)=>(r=e!=null?y(f(e)):{},d(t||!e||!e.__esModule?l(r,"default",{value:e,enumerable:!0}):r,e)),x=e=>d(l({},"__esModule",{value:!0}),e);var g={};h(g,{WithGroupCategory:()=>S,WithMulticol:()=>k,WithResource:()=>R,WithSidebar:()=>m,WithSupports:()=>N,WithTextLinks:()=>b});module.exports=x(g);var c=require("react/jsx-runtime"),s=P(require("react"));function m(e,t){const r=(0,s.useMemo)(()=>{let a=null;try{a=JSON.parse(t?.components?.[0]?.sidebar?.categoriesMetadata||"{}")}catch(n){console.log("categoriesMetadata Parse error",n)}return a},[t]),u=(0,s.useMemo)(()=>{let a=null;try{a=JSON.parse(t?.components?.[0]?.sidebar?.seriesMetadata||"[]")}catch(n){console.log("seriesMetadata Parse error",n)}return a},[t]),o=s.default.forwardRef((a,n)=>(0,c.jsx)(e,{...a,ref:n,seriesMetadata:u,sidebarCategoriesMetadata:r}));return o.displayName=e.displayName||e.name||"WithSidebarDropdown",o}function N(e,{categoriesItem:t,currentNavItemRef:r}){const u=(0,s.useMemo)(()=>t?.components?.[0]?.supports,[t]),o=s.default.forwardRef((a,n)=>(0,c.jsx)(e,{...a,supportsMetadata:u,currentNavItemRef:r,ref:n}));return o.displayName=e.displayName||e.name||"WithSupportsDropdown",o}function k(e,t){const r=t?.components?.[0]?.showStatsBanner,u=t?.components?.[0]?.statsBanner?.[0],o=(0,s.useMemo)(()=>{try{return JSON.parse(t?.components?.[0]?.multicol?.multicolMetadata||"{}")}catch(n){console.log("multicolMetadata Parse error",n)}return null},[t]),a=s.default.forwardRef((n,i)=>(0,c.jsx)(e,{...n,ref:i,multicolMetadata:o,showStatsBanner:r,statsBannerData:u}));return a.displayName=e.displayName||e.name||"WithMulticolDropdown",a}function R(e,t){const r=(0,s.useMemo)(()=>{let a=null;try{a=JSON.parse(t?.components?.[0]?.resource?.categoriesMetadata||"{}")}catch(n){console.log("resourceCategoriesMetadata Parse error",n)}return a},[t]),u=(0,s.useMemo)(()=>{let a=null;try{a=JSON.parse(t?.components?.[0]?.resource?.resourceMetadata||"[]")}catch(n){console.log("resourcesMetadata Parse error",n)}return a},[t]),o=s.default.forwardRef((a,n)=>(0,c.jsx)(e,{...a,ref:n,resourcesMetadata:u,resourceCategoriesMetadata:r}));return o.displayName=e.displayName||e.name||"WithResourceDropdown",o}function S(e){return e?Object.values(e?.reduce((t,r)=>(t[r.group]||(t[r.group]=[]),t[r.group].push(r),t),{})):[[]]}function b(e,t){const r=(0,s.useMemo)(()=>{let a=null;try{a=JSON.parse(t?.components?.[0]?.textlinks?.categoriesMetadata||"{}")}catch(n){console.log("textlinksCategoriesMetadata Parse error",n)}return a},[t]),u=(0,s.useMemo)(()=>{let a=null;try{a=JSON.parse(t?.components?.[0]?.textlinks?.columnsMetadata||"[]")}catch(n){console.log("textlinksColumnsMetadata Parse error",n)}return a},[t]),o=s.default.forwardRef((a,n)=>(0,c.jsx)(e,{...a,ref:n,textlinksCategoriesMetadata:r,textlinksColumnsMetadata:u}));return o.displayName=e.displayName||e.name||"WithTextLinksDropdown",o}
2
2
  //# sourceMappingURL=withCategory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/withCategory.tsx"],
4
- "sourcesContent": ["import React, { useMemo } from 'react'\n\nexport function WithSidebar<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n const sidebarCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('categoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n const seriesMetadata = useMemo(() => {\n let seriesMetadata = null\n try {\n seriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.seriesMetadata || '[]')\n } catch (error) {\n console.log('seriesMetadata Parse error', error)\n }\n return seriesMetadata\n }, [categoriesItem])\n\n const withSidebarDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n seriesMetadata={seriesMetadata}\n sidebarCategoriesMetadata={sidebarCategoriesMetadata}\n />\n )\n })\n\n withSidebarDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSidebarDropdown'\n return withSidebarDropdown\n}\n\nexport function WithSupports<P extends object>(\n WrappedComponent: React.ComponentType<any>,\n { categoriesItem, currentNavItemRef }: { categoriesItem: any; currentNavItemRef?: any; onMouseLeave?: () => void }\n) {\n const supportsMetadata = useMemo(() => {\n return categoriesItem?.components?.[0]?.supports\n }, [categoriesItem])\n\n const supportsDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n supportsMetadata={supportsMetadata}\n currentNavItemRef={currentNavItemRef}\n ref={ref}\n />\n )\n })\n\n supportsDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSupportsDropdown'\n return supportsDropdown\n}\n\nexport function WithMulticol<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n const showStatsBanner = categoriesItem?.components?.[0]?.showStatsBanner\n const statsBannerData = categoriesItem?.components?.[0]?.statsBanner?.[0]\n const multicolMetadata = useMemo(() => {\n try {\n return JSON.parse(categoriesItem?.components?.[0]?.multicol?.multicolMetadata || '{}')\n } catch (error) {\n console.log('multicolMetadata Parse error', error)\n }\n return null\n }, [categoriesItem])\n const multicolDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n multicolMetadata={multicolMetadata}\n showStatsBanner={showStatsBanner}\n statsBannerData={statsBannerData}\n />\n )\n })\n\n multicolDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithMulticolDropdown'\n return multicolDropdown\n}\n\nexport function WithResource<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u8D44\u6E90\u4F4D\u5206\u7C7B\u5143\u6570\u636E\n const resourceCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.resource?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('resourceCategoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u8D44\u6E90\u4F4D\u5143\u6570\u636E\n const resourcesMetadata = useMemo(() => {\n let resourcesMetadata = null\n try {\n resourcesMetadata = JSON.parse(categoriesItem?.components?.[0]?.resource?.resourceMetadata || '[]')\n } catch (error) {\n console.log('resourcesMetadata Parse error', error)\n }\n return resourcesMetadata\n }, [categoriesItem])\n\n const withResourceDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n resourcesMetadata={resourcesMetadata}\n resourceCategoriesMetadata={resourceCategoriesMetadata}\n />\n )\n })\n\n withResourceDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithResourceDropdown'\n return withResourceDropdown\n}\n\nexport function WithGroupCategory(categories: any) {\n if (!categories) return [[]]\n return Object.values(\n categories?.reduce((acc: any, item: any) => {\n if (!acc[item.group]) {\n acc[item.group] = []\n }\n acc[item.group].push(item)\n return acc\n }, {})\n )\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,iBAAAC,EAAA,iBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAP,GA2BM,IAAAQ,EAAA,6BA3BNC,EAA+B,oBAExB,SAASJ,EAA8BK,EAA4CC,EAAqB,CAE7G,MAAMC,KAA4B,WAAQ,IAAM,CAC9C,IAAIC,EAAqB,KACzB,GAAI,CACFA,EAAqB,KAAK,MAAMF,GAAgB,aAAa,CAAC,GAAG,SAAS,oBAAsB,IAAI,CACtG,OAASG,EAAO,CACd,QAAQ,IAAI,iCAAkCA,CAAK,CACrD,CACA,OAAOD,CACT,EAAG,CAACF,CAAc,CAAC,EAGbI,KAAiB,WAAQ,IAAM,CACnC,IAAIA,EAAiB,KACrB,GAAI,CACFA,EAAiB,KAAK,MAAMJ,GAAgB,aAAa,CAAC,GAAG,SAAS,gBAAkB,IAAI,CAC9F,OAASG,EAAO,CACd,QAAQ,IAAI,6BAA8BA,CAAK,CACjD,CACA,OAAOC,CACT,EAAG,CAACJ,CAAc,CAAC,EAEbK,EAAsB,EAAAC,QAAM,WAAmB,CAACC,EAAOC,OAEzD,OAACT,EAAA,CACE,GAAIQ,EACL,IAAKC,EACL,eAAgBJ,EAChB,0BAA2BH,EAC7B,CAEH,EAED,OAAAI,EAAoB,YAAcN,EAAiB,aAAeA,EAAiB,MAAQ,sBACpFM,CACT,CAEO,SAASV,EACdI,EACA,CAAE,eAAAC,EAAgB,kBAAAS,CAAkB,EACpC,CACA,MAAMC,KAAmB,WAAQ,IACxBV,GAAgB,aAAa,CAAC,GAAG,SACvC,CAACA,CAAc,CAAC,EAEbW,EA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CACA,OAAOc,CACT,EAAG,CAACjB,CAAc,CAAC,EAEbkB,EAAuB,EAAAZ,QAAM,WAAmB,CAACC,EAAOC,OAE1D,OAACT,EAAA,CACE,GAAIQ,EACL,IAAKC,EACL,kBAAmBS,EACnB,2BAA4BD,EAC9B,CAEH,EAED,OAAAE,EAAqB,YAAcnB,EAAiB,aAAeA,EAAiB,MAAQ,uBACrFmB,CACT,CAEO,SAAS3B,EAAkB4B,EAAiB,CACjD,OAAKA,EACE,OAAO,OACZA,GAAY,OAAO,CAACC,EAAUC,KACvBD,EAAIC,EAAK,KAAK,IACjBD,EAAIC,EAAK,KAAK,EAAI,CAAC,GAErBD,EAAIC,EAAK,KAAK,EAAE,KAAKA,CAAI,EAClBD,GACN,CAAC,CAAC,CACP,EATwB,CAAC,CAAC,CAAC,CAU7B",
6
- "names": ["withCategory_exports", "__export", "WithGroupCategory", "WithMulticol", "WithResource", "WithSidebar", "WithSupports", "__toCommonJS", "import_jsx_runtime", "import_react", "WrappedComponent", "categoriesItem", "sidebarCategoriesMetadata", "categoriesMetadata", "error", "seriesMetadata", "withSidebarDropdown", "React", "props", "ref", "currentNavItemRef", "supportsMetadata", "supportsDropdown", "showStatsBanner", "statsBannerData", "multicolMetadata", "multicolDropdown", "resourceCategoriesMetadata", "resourcesMetadata", "withResourceDropdown", "categories", "acc", "item"]
4
+ "sourcesContent": ["import React, { useMemo } from 'react'\n\nexport function WithSidebar<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n const sidebarCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('categoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n const seriesMetadata = useMemo(() => {\n let seriesMetadata = null\n try {\n seriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.seriesMetadata || '[]')\n } catch (error) {\n console.log('seriesMetadata Parse error', error)\n }\n return seriesMetadata\n }, [categoriesItem])\n\n const withSidebarDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n seriesMetadata={seriesMetadata}\n sidebarCategoriesMetadata={sidebarCategoriesMetadata}\n />\n )\n })\n\n withSidebarDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSidebarDropdown'\n return withSidebarDropdown\n}\n\nexport function WithSupports<P extends object>(\n WrappedComponent: React.ComponentType<any>,\n { categoriesItem, currentNavItemRef }: { categoriesItem: any; currentNavItemRef?: any; onMouseLeave?: () => void }\n) {\n const supportsMetadata = useMemo(() => {\n return categoriesItem?.components?.[0]?.supports\n }, [categoriesItem])\n\n const supportsDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n supportsMetadata={supportsMetadata}\n currentNavItemRef={currentNavItemRef}\n ref={ref}\n />\n )\n })\n\n supportsDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSupportsDropdown'\n return supportsDropdown\n}\n\nexport function WithMulticol<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n const showStatsBanner = categoriesItem?.components?.[0]?.showStatsBanner\n const statsBannerData = categoriesItem?.components?.[0]?.statsBanner?.[0]\n const multicolMetadata = useMemo(() => {\n try {\n return JSON.parse(categoriesItem?.components?.[0]?.multicol?.multicolMetadata || '{}')\n } catch (error) {\n console.log('multicolMetadata Parse error', error)\n }\n return null\n }, [categoriesItem])\n const multicolDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n multicolMetadata={multicolMetadata}\n showStatsBanner={showStatsBanner}\n statsBannerData={statsBannerData}\n />\n )\n })\n\n multicolDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithMulticolDropdown'\n return multicolDropdown\n}\n\nexport function WithResource<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u8D44\u6E90\u4F4D\u5206\u7C7B\u5143\u6570\u636E\n const resourceCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.resource?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('resourceCategoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u8D44\u6E90\u4F4D\u5143\u6570\u636E\n const resourcesMetadata = useMemo(() => {\n let resourcesMetadata = null\n try {\n resourcesMetadata = JSON.parse(categoriesItem?.components?.[0]?.resource?.resourceMetadata || '[]')\n } catch (error) {\n console.log('resourcesMetadata Parse error', error)\n }\n return resourcesMetadata\n }, [categoriesItem])\n\n const withResourceDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n resourcesMetadata={resourcesMetadata}\n resourceCategoriesMetadata={resourceCategoriesMetadata}\n />\n )\n })\n\n withResourceDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithResourceDropdown'\n return withResourceDropdown\n}\n\nexport function WithGroupCategory(categories: any) {\n if (!categories) return [[]]\n return Object.values(\n categories?.reduce((acc: any, item: any) => {\n if (!acc[item.group]) {\n acc[item.group] = []\n }\n acc[item.group].push(item)\n return acc\n }, {})\n )\n}\n\nexport function WithTextLinks<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // textlinks \u5206\u7C7B\u5143\u6570\u636E\uFF08\u5DE6\u4FA7\u6298\u53E0\u5BFC\u822A\uFF09\n const textlinksCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.textlinks?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('textlinksCategoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // textlinks \u5217\u6570\u636E\uFF08\u53F3\u4FA7\u591A\u5217\u6587\u5B57\u94FE\u63A5\uFF09\n const textlinksColumnsMetadata = useMemo(() => {\n let columnsMetadata = null\n try {\n columnsMetadata = JSON.parse(categoriesItem?.components?.[0]?.textlinks?.columnsMetadata || '[]')\n } catch (error) {\n console.log('textlinksColumnsMetadata Parse error', error)\n }\n return columnsMetadata\n }, [categoriesItem])\n\n const withTextLinksDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n textlinksCategoriesMetadata={textlinksCategoriesMetadata}\n textlinksColumnsMetadata={textlinksColumnsMetadata}\n />\n )\n })\n\n withTextLinksDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithTextLinksDropdown'\n return withTextLinksDropdown\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,iBAAAC,EAAA,iBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAR,GA2BM,IAAAS,EAAA,6BA3BNC,EAA+B,oBAExB,SAASL,EAA8BM,EAA4CC,EAAqB,CAE7G,MAAMC,KAA4B,WAAQ,IAAM,CAC9C,IAAIC,EAAqB,KACzB,GAAI,CACFA,EAAqB,KAAK,MAAMF,GAAgB,aAAa,CAAC,GAAG,SAAS,oBAAsB,IAAI,CACtG,OAASG,EAAO,CACd,QAAQ,IAAI,iCAAkCA,CAAK,CACrD,CACA,OAAOD,CACT,EAAG,CAACF,CAAc,CAAC,EAGbI,KAAiB,WAAQ,IAAM,CACnC,IAAIA,EAAiB,KACrB,GAAI,CACFA,EAAiB,KAAK,MAAMJ,GAAgB,aAAa,CAAC,GAAG,SAAS,gBAAkB,IAAI,CAC9F,OAASG,EAAO,CACd,QAAQ,IAAI,6BAA8BA,CAAK,CACjD,CACA,OAAOC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,KACtB,GAAI,CACFA,EAAkB,KAAK,MAAMxB,GAAgB,aAAa,CAAC,GAAG,WAAW,iBAAmB,IAAI,CAClG,OAASG,EAAO,CACd,QAAQ,IAAI,uCAAwCA,CAAK,CAC3D,CACA,OAAOqB,CACT,EAAG,CAACxB,CAAc,CAAC,EAEbyB,EAAwB,EAAAnB,QAAM,WAAmB,CAACC,EAAOC,OAE3D,OAACT,EAAA,CACE,GAAIQ,EACL,IAAKC,EACL,4BAA6Bc,EAC7B,yBAA0BC,EAC5B,CAEH,EAED,OAAAE,EAAsB,YAAc1B,EAAiB,aAAeA,EAAiB,MAAQ,wBACtF0B,CACT",
6
+ "names": ["withCategory_exports", "__export", "WithGroupCategory", "WithMulticol", "WithResource", "WithSidebar", "WithSupports", "WithTextLinks", "__toCommonJS", "import_jsx_runtime", "import_react", "WrappedComponent", "categoriesItem", "sidebarCategoriesMetadata", "categoriesMetadata", "error", "seriesMetadata", "withSidebarDropdown", "React", "props", "ref", "currentNavItemRef", "supportsMetadata", "supportsDropdown", "showStatsBanner", "statsBannerData", "multicolMetadata", "multicolDropdown", "resourceCategoriesMetadata", "resourcesMetadata", "withResourceDropdown", "categories", "acc", "item", "textlinksCategoriesMetadata", "textlinksColumnsMetadata", "columnsMetadata", "withTextLinksDropdown"]
7
7
  }