@anker-in/headless-ui 1.3.56 → 1.3.58
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.
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.d.ts +82 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.d.ts +9 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.d.ts +16 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js.map +2 -2
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +15 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +14 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +56 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +10 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +13 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +34 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +49 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/index.d.ts +16 -0
- package/dist/cjs/biz-components/CartDetail/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/types.d.ts +132 -0
- package/dist/cjs/biz-components/CartDetail/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/MediaShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/MediaShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js.map +2 -2
- package/dist/cjs/biz-components/SceneShelfV2/index.js +1 -1
- package/dist/cjs/biz-components/SceneShelfV2/index.js.map +2 -2
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +6 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/breadcrumb.d.ts +12 -0
- package/dist/cjs/components/breadcrumb.js +2 -0
- package/dist/cjs/components/breadcrumb.js.map +7 -0
- package/dist/cjs/components/index.d.ts +3 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/input-number.d.ts +22 -0
- package/dist/cjs/components/input-number.js +1 -1
- package/dist/cjs/components/input-number.js.map +3 -3
- package/dist/cjs/components/input.d.ts +5 -0
- package/dist/cjs/components/input.js +1 -1
- package/dist/cjs/components/input.js.map +3 -3
- package/dist/cjs/components/popover.d.ts +17 -2
- package/dist/cjs/components/popover.js +1 -1
- package/dist/cjs/components/popover.js.map +3 -3
- package/dist/cjs/components/toast.d.ts +25 -0
- package/dist/cjs/components/toast.js +2 -0
- package/dist/cjs/components/toast.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.d.ts +82 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.d.ts +9 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.d.ts +16 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.js.map +7 -0
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js.map +2 -2
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +15 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +14 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +56 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +10 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +13 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +34 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +49 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/index.d.ts +16 -0
- package/dist/esm/biz-components/CartDetail/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/types.d.ts +132 -0
- package/dist/esm/biz-components/CartDetail/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/types.js.map +7 -0
- package/dist/esm/biz-components/CreditsShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/CreditsShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/MediaShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/MediaShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js.map +2 -2
- package/dist/esm/biz-components/SceneShelfV2/index.js +1 -1
- package/dist/esm/biz-components/SceneShelfV2/index.js.map +2 -2
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js +1 -1
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +6 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/breadcrumb.d.ts +12 -0
- package/dist/esm/components/breadcrumb.js +2 -0
- package/dist/esm/components/breadcrumb.js.map +7 -0
- package/dist/esm/components/index.d.ts +3 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +3 -3
- package/dist/esm/components/input-number.d.ts +22 -0
- package/dist/esm/components/input-number.js +1 -1
- package/dist/esm/components/input-number.js.map +3 -3
- package/dist/esm/components/input.d.ts +5 -0
- package/dist/esm/components/input.js +1 -1
- package/dist/esm/components/input.js.map +3 -3
- package/dist/esm/components/popover.d.ts +17 -2
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/popover.js.map +3 -3
- package/dist/esm/components/toast.d.ts +25 -0
- package/dist/esm/components/toast.js +2 -0
- package/dist/esm/components/toast.js.map +7 -0
- package/package.json +1 -1
- package/style.css +285 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var Z=Object.create;var u=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var V=(e,o)=>{for(var
|
|
1
|
+
"use strict";"use client";var Z=Object.create;var u=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var V=(e,o)=>{for(var i in o)u(e,i,{get:o[i],enumerable:!0})},N=(e,o,i,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of K(o))!U.call(e,c)&&c!==i&&u(e,c,{get:()=>o[c],enumerable:!(m=J(o,c))||m.enumerable});return e};var W=(e,o,i)=>(i=e!=null?Z(Q(e)):{},N(o||!e||!e.__esModule?u(i,"default",{value:e,enumerable:!0}):i,e)),X=e=>N(u({},"__esModule",{value:!0}),e);var ae={};V(ae,{CreditsProductCard:()=>g,default:()=>ee});module.exports=X(ae);var a=require("react/jsx-runtime"),d=W(require("react")),s=require("../../helpers/index.js"),t=require("../../components/index.js"),k=require("./context.js");const Y=()=>(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M8 1L10.163 5.279L15 6.001L11.5 9.409L12.326 14.226L8 11.97L3.674 14.226L4.5 9.409L1 6.001L5.837 5.279L8 1Z",fill:"currentColor"})}),g=d.forwardRef(({product:e,className:o,showTags:i,onLearnMore:m,onShopNow:c,onAddToCart:P,classNames:T,secondaryButtonText:B,secondaryButtonFun:L,primaryButtonText:S,primaryButtonFun:F,showOriginalPrice:z,copy:M,onProductImageClick:D},A)=>{const n=(0,k.useCreditsShelfContext)(),O=i??n?.showTags??!0,$=z??n?.showOriginalPrice??!0,f=M??n?.copy,r=T??n?.classNames,y=B??n?.secondaryButtonText,h=L??n?.secondaryButtonFun,x=S??n?.primaryButtonText,C=F??n?.primaryButtonFun,j=m??n?.onLearnMore,H=c??n?.onShopNow,I=P??n?.onAddToCart,v=D??n?.onProductImageClick,[R,_]=d.useState(!1),[q,E]=d.useState(!1),w=async(l,p)=>{if(!l)return;const b=p==="primary"?_:E;b(!0);try{switch(l){case"buyNow":await H?.(e);break;case"addCart":await I?.(e);break;case"learnMore":await j?.(e);break;default:break}}finally{b(!1)}},G=d.useMemo(()=>e.creditSavingAmount?(f?.creditsSavingLabel??"Save up to {amount} with Credits").replace("{amount}",e.creditSavingAmount):null,[e.creditSavingAmount,f?.creditsSavingLabel]);return(0,a.jsxs)(t.Card,{ref:A,className:(0,s.cn)("bg-container-primary hover:bg-container-secondary-0 box-border flex h-full flex-col overflow-hidden border-none",o,r?.productCard),children:[(0,a.jsxs)(t.CardContent,{className:"lg-desktop:gap-[10px] lg-desktop:px-6 lg-desktop:py-4 relative flex flex-1 flex-col gap-2 p-4",children:[(0,a.jsx)("div",{className:"lg-desktop:h-[28px] flex h-[24px] gap-1",children:O&&e.tags?.map((l,p)=>l.label?(0,a.jsx)(t.Badge,{size:"sm",variant:l.variant||"outline",className:(0,s.cn)(l.variant==="promotional"?"ml-2":""),promotionalType:l.promotionalType,children:l.label},p):(0,a.jsx)(d.Fragment,{children:l},p))}),(0,a.jsx)("div",{className:"product-image-wrapper lg-desktop:size-[196px] mx-auto size-[138px] cursor-pointer overflow-hidden",children:(0,a.jsx)("a",{onClick:()=>v?.(e),...!v&&{href:e?.listingLink},rel:"noreferrer",children:(0,a.jsx)(t.Picture,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"w-full h-full object-contain"})})}),(0,a.jsxs)("div",{className:"lg-desktop:gap-6 flex flex-1 grow flex-col justify-between gap-4",children:[(0,a.jsxs)("div",{className:"lg-desktop:gap-1 flex flex-col gap-0.5",children:[(0,a.jsx)(t.Heading,{as:"h3",size:2,className:(0,s.cn)("text-info-primary line-clamp-2 min-h-[2.4em]",r?.productTitle),html:e.custom_name||e.name}),e?.description&&(0,a.jsx)(t.Text,{size:2,className:(0,s.cn)("text-info-secondary desktop:line-clamp-2 desktop:min-h-[2.4em] line-clamp-2 min-h-[2.4em]",r?.productDescription),html:e.custom_description||e.description})]}),(0,a.jsxs)("div",{className:"lg-desktop:gap-2 flex flex-col gap-1.5",children:[(0,a.jsx)("div",{className:(0,s.cn)(r?.productPrice),children:(0,a.jsx)("div",{className:"flex items-baseline gap-1",children:e.availableForSale?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Heading,{size:2,className:"text-info-primary",as:"h6",children:e.price}),$&&e.originalPrice&&(0,a.jsx)(t.Heading,{size:2,className:(0,s.cn)("text-info-tertiary line-through",r?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,a.jsx)(t.Heading,{size:2,className:"text-info-tertiary",children:f?.outOfStockLabel??"Sold Out"})})}),e?.priceLabel&&(0,a.jsx)(t.Text,{size:4,className:(0,s.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",r?.productPriceLabel),children:e.priceLabel}),(0,a.jsxs)("div",{className:(0,s.cn)("lg-desktop:gap-3 tablet:flex-nowrap flex flex-wrap gap-2",r?.buttonGroup),children:[y&&(0,a.jsx)(t.Button,{variant:"secondary",size:"base",className:(0,s.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",r?.secondaryButton),onClick:()=>w(h,"secondary"),disabled:!e.availableForSale&&h!=="learnMore",loading:q,"data-headless-type-name":"CreditsShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${y}`,"data-headless-sku":e.sku,children:y}),x&&(0,a.jsx)(t.Button,{variant:"primary",size:"base",className:(0,s.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",r?.primaryButton),onClick:()=>w(C,"primary"),disabled:!e.availableForSale&&C!=="learnMore",loading:R,"data-headless-type-name":"CreditsShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${x}`,"data-headless-sku":e.sku,children:x})]})]})]})]}),(0,a.jsxs)("div",{className:(0,s.cn)("bg-container-secondary-0 lg-desktop:px-6 lg-desktop:py-4 flex items-center justify-center gap-1 px-4 py-3",r?.creditTip),children:[(0,a.jsx)("div",{className:"bg-info-primary flex size-6 items-center justify-center rounded-full p-1",children:(0,a.jsx)("span",{className:"text-info-white",children:(0,a.jsx)(Y,{})})}),(0,a.jsx)(t.Text,{size:2,className:"text-info-primary",children:G})]})]})});g.displayName="CreditsShelf.ProductCard";var ee=g;
|
|
2
2
|
//# sourceMappingURL=ProductCard.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/CreditsShelf/ProductCard.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Button, Badge, Card, CardContent, Picture, Text, Heading } from '../../components/index.js'\n\nimport type { ButtonFunctionType, CopyConfig, CreditsShelfSemanticName, CreditsProductCardData } from './types.js'\nimport { useCreditsShelfContext } from './context.js'\n\n/**\n * \u4EA7\u54C1\u5361\u7247\u7EC4\u4EF6 Props\n */\nexport interface CreditsProductCardProps {\n /** \u4EA7\u54C1\u6570\u636E */\n product: CreditsProductCardData\n /** \u6837\u5F0F\u7C7B\u540D */\n className?: string\n /** \u662F\u5426\u5C55\u793A\u6807\u7B7E\u7CFB\u7EDF */\n showTags?: boolean\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (product: CreditsProductCardData) => void\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (product: CreditsProductCardData) => void\n /** \u70B9\u51FB\u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (product: CreditsProductCardData) => void\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<CreditsShelfSemanticName, string>>\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u529F\u80FD */\n secondaryButtonFun?: ButtonFunctionType\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u529F\u80FD */\n primaryButtonFun?: ButtonFunctionType\n /** \u662F\u5426\u5C55\u793A\u539F\u4EF7\uFF08\u5220\u9664\u7EBF\u4EF7\u683C\uFF09 */\n showOriginalPrice?: boolean\n /** \u6587\u6848\u914D\u7F6E */\n copy?: CopyConfig\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: CreditsProductCardData) => void\n}\n\n/**\n * \u661F\u661F\u56FE\u6807\u7EC4\u4EF6\n */\nconst StarIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M8 1L10.163 5.279L15 6.001L11.5 9.409L12.326 14.226L8 11.97L3.674 14.226L4.5 9.409L1 6.001L5.837 5.279L8 1Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\n/**\n * CreditsShelf \u4EA7\u54C1\u5361\u7247\u7EC4\u4EF6\n */\nconst CreditsProductCard = React.forwardRef<HTMLDivElement, CreditsProductCardProps>(\n (\n {\n product,\n className,\n showTags: showTagsProp,\n onLearnMore: onLearnMoreProp,\n onShopNow: onShopNowProp,\n onAddToCart: onAddToCartProp,\n classNames: classNamesProp,\n secondaryButtonText: secondaryButtonTextProp,\n secondaryButtonFun: secondaryButtonFunProp,\n primaryButtonText: primaryButtonTextProp,\n primaryButtonFun: primaryButtonFunProp,\n showOriginalPrice: showOriginalPriceProp,\n copy: copyProp,\n onProductImageClick: onProductImageClickProp,\n },\n ref\n ) => {\n // \u4ECE Context \u8BFB\u53D6\u914D\u7F6E\n const context = useCreditsShelfContext()\n\n // Props \u4F18\u5148\u7EA7\u9AD8\u4E8E Context\n const showTags = showTagsProp ?? context?.showTags ?? true\n const showOriginalPrice = showOriginalPriceProp ?? context?.showOriginalPrice ?? true\n const copy = copyProp ?? context?.copy\n const classNames = classNamesProp ?? context?.classNames\n const secondaryButtonText = secondaryButtonTextProp ?? context?.secondaryButtonText\n const secondaryButtonFun = secondaryButtonFunProp ?? context?.secondaryButtonFun\n const primaryButtonText = primaryButtonTextProp ?? context?.primaryButtonText\n const primaryButtonFun = primaryButtonFunProp ?? context?.primaryButtonFun\n const onLearnMore = onLearnMoreProp ?? context?.onLearnMore\n const onShopNow = onShopNowProp ?? context?.onShopNow\n const onAddToCart = onAddToCartProp ?? context?.onAddToCart\n const onProductImageClick = onProductImageClickProp ?? context?.onProductImageClick\n\n const [primaryLoading, setPrimaryLoading] = React.useState(false)\n const [secondaryLoading, setSecondaryLoading] = React.useState(false)\n\n // \u6839\u636E\u6309\u94AE\u529F\u80FD\u7C7B\u578B\u8C03\u7528\u76F8\u5E94\u7684\u56DE\u8C03\u51FD\u6570\n const handleButtonClick = async (buttonFun?: ButtonFunctionType, buttonType?: 'primary' | 'secondary') => {\n if (!buttonFun) return\n\n const setLoading = buttonType === 'primary' ? setPrimaryLoading : setSecondaryLoading\n setLoading(true)\n\n try {\n switch (buttonFun) {\n case 'buyNow':\n await onShopNow?.(product)\n break\n case 'addCart':\n await onAddToCart?.(product)\n break\n case 'learnMore':\n await onLearnMore?.(product)\n break\n default:\n break\n }\n } finally {\n setLoading(false)\n }\n }\n\n // \u751F\u6210\u79EF\u5206\u62B5\u73B0\u63D0\u793A\u6587\u672C\n const creditTipText = React.useMemo(() => {\n if (!product.creditSavingAmount) return null\n const template = copy?.creditsSavingLabel ?? 'Save up to {amount} with Credits'\n return template.replace('{amount}', product.creditSavingAmount)\n }, [product.creditSavingAmount, copy?.creditsSavingLabel])\n\n return (\n <Card\n ref={ref}\n className={cn(\n 'bg-container-primary hover:bg-container-secondary-0 box-border flex h-full flex-col overflow-hidden border-none',\n className,\n classNames?.productCard\n )}\n >\n {/* \u4E3B\u5185\u5BB9\u533A\u57DF */}\n <CardContent className=\"lg-desktop:gap-[10px] lg-desktop:px-6 lg-desktop:py-4 relative flex flex-1 flex-col gap-2 p-4\">\n {/* \u6807\u7B7E */}\n <div className=\"lg-desktop:h-[28px] flex h-[24px] gap-1\">\n {showTags &&\n product.tags?.map((tag: any, index) =>\n (tag as any).label ? (\n <Badge\n key={index}\n size=\"sm\"\n variant={(tag.variant as any) || 'outline'}\n className={cn(tag.variant === 'promotional' ? 'ml-2' : '')}\n promotionalType={tag.promotionalType}\n >\n {tag.label}\n </Badge>\n ) : (\n <React.Fragment key={index}>{tag}</React.Fragment>\n )\n )}\n </div>\n\n {/* \u4EA7\u54C1\u56FE\u533A\u57DF */}\n <div className=\"product-image-wrapper lg-desktop:size-[196px] mx-auto size-[138px] cursor-pointer overflow-hidden\">\n <a\n onClick={() => onProductImageClick?.(product)}\n {...(!onProductImageClick && {\n href: product?.listingLink,\n })}\n rel=\"noreferrer\"\n >\n <Picture\n source={product.image}\n alt={product.name}\n className=\"aspect-square size-full object-contain\"\n imgClassName=\"w-full h-full object-contain\"\n />\n </a>\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"lg-desktop:gap-6 flex flex-1 grow flex-col justify-between gap-4\">\n {/* \u4EA7\u54C1\u4FE1\u606F */}\n <div className=\"lg-desktop:gap-1 flex flex-col gap-0.5\">\n <Heading\n as=\"h3\"\n size={2}\n className={cn('text-info-primary line-clamp-2 min-h-[2.4em]', classNames?.productTitle)}\n html={product.custom_name || product.name}\n />\n {product?.description && (\n <Text\n size={2}\n className={cn(\n 'text-info-secondary desktop:line-clamp-2 desktop:min-h-[2.4em] line-clamp-2 min-h-[2.4em]',\n classNames?.productDescription\n )}\n html={product.custom_description || product.description}\n />\n )}\n </div>\n\n {/* \u4EF7\u683C\u533A\u57DF */}\n <div className=\"lg-desktop:gap-2 flex flex-col gap-1.5\">\n {/* \u4EF7\u683C */}\n <div className={cn(classNames?.productPrice)}>\n <div className=\"flex items-baseline gap-1\">\n {product.availableForSale ? (\n <>\n <Heading size={2} className=\"text-info-primary\" as=\"h6\">\n {product.price}\n </Heading>\n {showOriginalPrice && product.originalPrice && (\n <Heading\n size={2}\n className={cn('text-info-tertiary line-through', classNames?.originalPrice)}\n as=\"h6\"\n >\n {product.originalPrice}\n </Heading>\n )}\n </>\n ) : (\n <Heading size={2} className=\"text-info-tertiary\">\n {copy?.outOfStockLabel ?? 'Sold Out'}\n </Heading>\n )}\n </div>\n </div>\n\n {product?.priceLabel && (\n <Text\n size={4}\n className={cn(\n 'text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] text-[14px]',\n classNames?.productPriceLabel\n )}\n >\n {product.priceLabel}\n </Text>\n )}\n\n {/* \u6309\u94AE\u533A\u57DF */}\n <div className={cn('lg-desktop:gap-3 flex flex-nowrap gap-2', classNames?.buttonGroup)}>\n {secondaryButtonText && (\n <Button\n variant=\"secondary\"\n size=\"base\"\n className={cn('tablet:w-fit w-full', classNames?.secondaryButton)}\n onClick={() => handleButtonClick(secondaryButtonFun, 'secondary')}\n disabled={!product.availableForSale && secondaryButtonFun !== 'learnMore'}\n loading={secondaryLoading}\n data-headless-type-name=\"CreditsShelf#ProductCard\"\n data-headless-title-desc-button={`${product.custom_name || product.name}#${product.description || ''}#${secondaryButtonText}`}\n data-headless-sku={product.sku}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button\n variant=\"primary\"\n size=\"base\"\n className={cn('tablet:w-fit w-full', classNames?.primaryButton)}\n onClick={() => handleButtonClick(primaryButtonFun, 'primary')}\n disabled={!product.availableForSale && primaryButtonFun !== 'learnMore'}\n loading={primaryLoading}\n data-headless-type-name=\"CreditsShelf#ProductCard\"\n data-headless-title-desc-button={`${product.custom_name || product.name}#${product.description || ''}#${primaryButtonText}`}\n data-headless-sku={product.sku}\n >\n {primaryButtonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </CardContent>\n\n {/* \u5E95\u90E8\u79EF\u5206\u62B5\u73B0\u63D0\u793A\u6761 */}\n <div\n className={cn(\n 'bg-container-secondary-0 lg-desktop:px-6 lg-desktop:py-4 flex items-center justify-center gap-1 px-4 py-3',\n classNames?.creditTip\n )}\n >\n <div className=\"bg-info-primary flex size-6 items-center justify-center rounded-full p-1\">\n <span className=\"text-info-white\">\n <StarIcon />\n </span>\n </div>\n <Text size={2} className=\"text-info-primary\">\n {creditTipText}\n </Text>\n </div>\n </Card>\n )\n }\n)\n\nCreditsProductCard.displayName = 'CreditsShelf.ProductCard'\n\nexport { CreditsProductCard }\nexport default CreditsPro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M,EACN,aAAW,MACT,4FACAmB,GAAY,kBACd,EACA,KAAMnB,EAAQ,oBAAsBA,EAAQ,YAC9C,GAEJ,KAGA,QAAC,OAAI,UAAU,yCAEb,oBAAC,OAAI,aAAW,MAAGmB,GAAY,YAAY,EACzC,mBAAC,OAAI,UAAU,4BACZ,SAAAnB,EAAQ,oBACP,oBACE,oBAAC,WAAQ,KAAM,EAAG,UAAU,oBAAoB,GAAG,KAChD,SAAAA,EAAQ,MACX,EACCiB,GAAqBjB,EAAQ,kBAC5B,OAAC,WACC,KAAM,EACN,aAAW,MAAG,kCAAmCmB,GAAY,aAAa,EAC1E,GAAG,KAEF,SAAAnB,EAAQ,cACX,GAEJ,KAEA,OAAC,WAAQ,KAAM,EAAG,UAAU,qBACzB,SAAAkB,GAAM,iBAAmB,WAC5B,EAEJ,EACF,EAEClB,GAAS,eACR,OAAC,QACC,KAAM,EACN,aAAW,MACT,0EACAmB,GAAY,iBACd,EAEC,SAAAnB,EAAQ,WACX,KAIF,QAAC,OAAI,aAAW,MAAG,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Button, Badge, Card, CardContent, Picture, Text, Heading } from '../../components/index.js'\n\nimport type { ButtonFunctionType, CopyConfig, CreditsShelfSemanticName, CreditsProductCardData } from './types.js'\nimport { useCreditsShelfContext } from './context.js'\n\n/**\n * \u4EA7\u54C1\u5361\u7247\u7EC4\u4EF6 Props\n */\nexport interface CreditsProductCardProps {\n /** \u4EA7\u54C1\u6570\u636E */\n product: CreditsProductCardData\n /** \u6837\u5F0F\u7C7B\u540D */\n className?: string\n /** \u662F\u5426\u5C55\u793A\u6807\u7B7E\u7CFB\u7EDF */\n showTags?: boolean\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (product: CreditsProductCardData) => void\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (product: CreditsProductCardData) => void\n /** \u70B9\u51FB\u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (product: CreditsProductCardData) => void\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<CreditsShelfSemanticName, string>>\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u529F\u80FD */\n secondaryButtonFun?: ButtonFunctionType\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u529F\u80FD */\n primaryButtonFun?: ButtonFunctionType\n /** \u662F\u5426\u5C55\u793A\u539F\u4EF7\uFF08\u5220\u9664\u7EBF\u4EF7\u683C\uFF09 */\n showOriginalPrice?: boolean\n /** \u6587\u6848\u914D\u7F6E */\n copy?: CopyConfig\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: CreditsProductCardData) => void\n}\n\n/**\n * \u661F\u661F\u56FE\u6807\u7EC4\u4EF6\n */\nconst StarIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M8 1L10.163 5.279L15 6.001L11.5 9.409L12.326 14.226L8 11.97L3.674 14.226L4.5 9.409L1 6.001L5.837 5.279L8 1Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\n/**\n * CreditsShelf \u4EA7\u54C1\u5361\u7247\u7EC4\u4EF6\n */\nconst CreditsProductCard = React.forwardRef<HTMLDivElement, CreditsProductCardProps>(\n (\n {\n product,\n className,\n showTags: showTagsProp,\n onLearnMore: onLearnMoreProp,\n onShopNow: onShopNowProp,\n onAddToCart: onAddToCartProp,\n classNames: classNamesProp,\n secondaryButtonText: secondaryButtonTextProp,\n secondaryButtonFun: secondaryButtonFunProp,\n primaryButtonText: primaryButtonTextProp,\n primaryButtonFun: primaryButtonFunProp,\n showOriginalPrice: showOriginalPriceProp,\n copy: copyProp,\n onProductImageClick: onProductImageClickProp,\n },\n ref\n ) => {\n // \u4ECE Context \u8BFB\u53D6\u914D\u7F6E\n const context = useCreditsShelfContext()\n\n // Props \u4F18\u5148\u7EA7\u9AD8\u4E8E Context\n const showTags = showTagsProp ?? context?.showTags ?? true\n const showOriginalPrice = showOriginalPriceProp ?? context?.showOriginalPrice ?? true\n const copy = copyProp ?? context?.copy\n const classNames = classNamesProp ?? context?.classNames\n const secondaryButtonText = secondaryButtonTextProp ?? context?.secondaryButtonText\n const secondaryButtonFun = secondaryButtonFunProp ?? context?.secondaryButtonFun\n const primaryButtonText = primaryButtonTextProp ?? context?.primaryButtonText\n const primaryButtonFun = primaryButtonFunProp ?? context?.primaryButtonFun\n const onLearnMore = onLearnMoreProp ?? context?.onLearnMore\n const onShopNow = onShopNowProp ?? context?.onShopNow\n const onAddToCart = onAddToCartProp ?? context?.onAddToCart\n const onProductImageClick = onProductImageClickProp ?? context?.onProductImageClick\n\n const [primaryLoading, setPrimaryLoading] = React.useState(false)\n const [secondaryLoading, setSecondaryLoading] = React.useState(false)\n\n // \u6839\u636E\u6309\u94AE\u529F\u80FD\u7C7B\u578B\u8C03\u7528\u76F8\u5E94\u7684\u56DE\u8C03\u51FD\u6570\n const handleButtonClick = async (buttonFun?: ButtonFunctionType, buttonType?: 'primary' | 'secondary') => {\n if (!buttonFun) return\n\n const setLoading = buttonType === 'primary' ? setPrimaryLoading : setSecondaryLoading\n setLoading(true)\n\n try {\n switch (buttonFun) {\n case 'buyNow':\n await onShopNow?.(product)\n break\n case 'addCart':\n await onAddToCart?.(product)\n break\n case 'learnMore':\n await onLearnMore?.(product)\n break\n default:\n break\n }\n } finally {\n setLoading(false)\n }\n }\n\n // \u751F\u6210\u79EF\u5206\u62B5\u73B0\u63D0\u793A\u6587\u672C\n const creditTipText = React.useMemo(() => {\n if (!product.creditSavingAmount) return null\n const template = copy?.creditsSavingLabel ?? 'Save up to {amount} with Credits'\n return template.replace('{amount}', product.creditSavingAmount)\n }, [product.creditSavingAmount, copy?.creditsSavingLabel])\n\n return (\n <Card\n ref={ref}\n className={cn(\n 'bg-container-primary hover:bg-container-secondary-0 box-border flex h-full flex-col overflow-hidden border-none',\n className,\n classNames?.productCard\n )}\n >\n {/* \u4E3B\u5185\u5BB9\u533A\u57DF */}\n <CardContent className=\"lg-desktop:gap-[10px] lg-desktop:px-6 lg-desktop:py-4 relative flex flex-1 flex-col gap-2 p-4\">\n {/* \u6807\u7B7E */}\n <div className=\"lg-desktop:h-[28px] flex h-[24px] gap-1\">\n {showTags &&\n product.tags?.map((tag: any, index) =>\n (tag as any).label ? (\n <Badge\n key={index}\n size=\"sm\"\n variant={(tag.variant as any) || 'outline'}\n className={cn(tag.variant === 'promotional' ? 'ml-2' : '')}\n promotionalType={tag.promotionalType}\n >\n {tag.label}\n </Badge>\n ) : (\n <React.Fragment key={index}>{tag}</React.Fragment>\n )\n )}\n </div>\n\n {/* \u4EA7\u54C1\u56FE\u533A\u57DF */}\n <div className=\"product-image-wrapper lg-desktop:size-[196px] mx-auto size-[138px] cursor-pointer overflow-hidden\">\n <a\n onClick={() => onProductImageClick?.(product)}\n {...(!onProductImageClick && {\n href: product?.listingLink,\n })}\n rel=\"noreferrer\"\n >\n <Picture\n source={product.image}\n alt={product.name}\n className=\"aspect-square size-full object-contain\"\n imgClassName=\"w-full h-full object-contain\"\n />\n </a>\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"lg-desktop:gap-6 flex flex-1 grow flex-col justify-between gap-4\">\n {/* \u4EA7\u54C1\u4FE1\u606F */}\n <div className=\"lg-desktop:gap-1 flex flex-col gap-0.5\">\n <Heading\n as=\"h3\"\n size={2}\n className={cn('text-info-primary line-clamp-2 min-h-[2.4em]', classNames?.productTitle)}\n html={product.custom_name || product.name}\n />\n {product?.description && (\n <Text\n size={2}\n className={cn(\n 'text-info-secondary desktop:line-clamp-2 desktop:min-h-[2.4em] line-clamp-2 min-h-[2.4em]',\n classNames?.productDescription\n )}\n html={product.custom_description || product.description}\n />\n )}\n </div>\n\n {/* \u4EF7\u683C\u533A\u57DF */}\n <div className=\"lg-desktop:gap-2 flex flex-col gap-1.5\">\n {/* \u4EF7\u683C */}\n <div className={cn(classNames?.productPrice)}>\n <div className=\"flex items-baseline gap-1\">\n {product.availableForSale ? (\n <>\n <Heading size={2} className=\"text-info-primary\" as=\"h6\">\n {product.price}\n </Heading>\n {showOriginalPrice && product.originalPrice && (\n <Heading\n size={2}\n className={cn('text-info-tertiary line-through', classNames?.originalPrice)}\n as=\"h6\"\n >\n {product.originalPrice}\n </Heading>\n )}\n </>\n ) : (\n <Heading size={2} className=\"text-info-tertiary\">\n {copy?.outOfStockLabel ?? 'Sold Out'}\n </Heading>\n )}\n </div>\n </div>\n\n {product?.priceLabel && (\n <Text\n size={4}\n className={cn(\n 'text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] text-[14px]',\n classNames?.productPriceLabel\n )}\n >\n {product.priceLabel}\n </Text>\n )}\n\n {/* \u6309\u94AE\u533A\u57DF */}\n <div className={cn('lg-desktop:gap-3 tablet:flex-nowrap flex flex-wrap gap-2', classNames?.buttonGroup)}>\n {secondaryButtonText && (\n <Button\n variant=\"secondary\"\n size=\"base\"\n className={cn(\n 'tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap',\n classNames?.secondaryButton\n )}\n onClick={() => handleButtonClick(secondaryButtonFun, 'secondary')}\n disabled={!product.availableForSale && secondaryButtonFun !== 'learnMore'}\n loading={secondaryLoading}\n data-headless-type-name=\"CreditsShelf#ProductCard\"\n data-headless-title-desc-button={`${product.custom_name || product.name}#${product.description || ''}#${secondaryButtonText}`}\n data-headless-sku={product.sku}\n >\n {secondaryButtonText}\n </Button>\n )}\n {primaryButtonText && (\n <Button\n variant=\"primary\"\n size=\"base\"\n className={cn(\n 'tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap',\n classNames?.primaryButton\n )}\n onClick={() => handleButtonClick(primaryButtonFun, 'primary')}\n disabled={!product.availableForSale && primaryButtonFun !== 'learnMore'}\n loading={primaryLoading}\n data-headless-type-name=\"CreditsShelf#ProductCard\"\n data-headless-title-desc-button={`${product.custom_name || product.name}#${product.description || ''}#${primaryButtonText}`}\n data-headless-sku={product.sku}\n >\n {primaryButtonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </CardContent>\n\n {/* \u5E95\u90E8\u79EF\u5206\u62B5\u73B0\u63D0\u793A\u6761 */}\n <div\n className={cn(\n 'bg-container-secondary-0 lg-desktop:px-6 lg-desktop:py-4 flex items-center justify-center gap-1 px-4 py-3',\n classNames?.creditTip\n )}\n >\n <div className=\"bg-info-primary flex size-6 items-center justify-center rounded-full p-1\">\n <span className=\"text-info-white\">\n <StarIcon />\n </span>\n </div>\n <Text size={2} className=\"text-info-primary\">\n {creditTipText}\n </Text>\n </div>\n </Card>\n )\n }\n)\n\nCreditsProductCard.displayName = 'CreditsShelf.ProductCard'\n\nexport { CreditsProductCard }\nexport default CreditsProductCard\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,wBAAAE,EAAA,YAAAC,KAAA,eAAAC,EAAAJ,IAgDI,IAAAK,EAAA,6BA9CJC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAyE,qCAGzEC,EAAuC,wBAuCvC,MAAMC,EAAW,OACf,OAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,mBAAC,QACC,EAAE,8GACF,KAAK,eACP,EACF,EAMIR,EAAqBI,EAAM,WAC/B,CACE,CACE,QAAAK,EACA,UAAAC,EACA,SAAUC,EACV,YAAaC,EACb,UAAWC,EACX,YAAaC,EACb,WAAYC,EACZ,oBAAqBC,E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AAkB,GAAM,iBAAmB,WAC5B,EAEJ,EACF,EAEClB,GAAS,eACR,OAAC,QACC,KAAM,EACN,aAAW,MACT,0EACAmB,GAAY,iBACd,EAEC,SAAAnB,EAAQ,WACX,KAIF,QAAC,OAAI,aAAW,MAAG,2DAA4DmB,GAAY,WAAW,EACnG,UAAAC,MACC,OAAC,UACC,QAAQ,YACR,KAAK,OACL,aAAW,MACT,mGACAD,GAAY,eACd,EACA,QAAS,IAAMa,EAAkBX,EAAoB,WAAW,EAChE,SAAU,CAACrB,EAAQ,kBAAoBqB,IAAuB,YAC9D,QAASS,EACT,0BAAwB,2BACxB,kCAAiC,GAAG9B,EAAQ,aAAeA,EAAQ,IAAI,IAAIA,EAAQ,aAAe,EAAE,IAAIoB,CAAmB,GAC3H,oBAAmBpB,EAAQ,IAE1B,SAAAoB,EACH,EAEDE,MACC,OAAC,UACC,QAAQ,UACR,KAAK,OACL,aAAW,MACT,mGACAH,GAAY,aACd,EACA,QAAS,IAAMa,EAAkBT,EAAkB,SAAS,EAC5D,SAAU,CAACvB,EAAQ,kBAAoBuB,IAAqB,YAC5D,QAASK,EACT,0BAAwB,2BACxB,kCAAiC,GAAG5B,EAAQ,aAAeA,EAAQ,IAAI,IAAIA,EAAQ,aAAe,EAAE,IAAIsB,CAAiB,GACzH,oBAAmBtB,EAAQ,IAE1B,SAAAsB,EACH,GAEJ,GACF,GACF,GACF,KAGA,QAAC,OACC,aAAW,MACT,4GACAH,GAAY,SACd,EAEA,oBAAC,OAAI,UAAU,2EACb,mBAAC,QAAK,UAAU,kBACd,mBAACpB,EAAA,EAAS,EACZ,EACF,KACA,OAAC,QAAK,KAAM,EAAG,UAAU,oBACtB,SAAAqC,EACH,GACF,GACF,CAEJ,CACF,EAEA7C,EAAmB,YAAc,2BAGjC,IAAOC,GAAQD",
|
|
6
6
|
"names": ["ProductCard_exports", "__export", "CreditsProductCard", "ProductCard_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_context", "StarIcon", "product", "className", "showTagsProp", "onLearnMoreProp", "onShopNowProp", "onAddToCartProp", "classNamesProp", "secondaryButtonTextProp", "secondaryButtonFunProp", "primaryButtonTextProp", "primaryButtonFunProp", "showOriginalPriceProp", "copyProp", "onProductImageClickProp", "ref", "context", "showTags", "showOriginalPrice", "copy", "classNames", "secondaryButtonText", "secondaryButtonFun", "primaryButtonText", "primaryButtonFun", "onLearnMore", "onShopNow", "onAddToCart", "onProductImageClick", "primaryLoading", "setPrimaryLoading", "secondaryLoading", "setSecondaryLoading", "handleButtonClick", "buttonFun", "buttonType", "setLoading", "creditTipText", "tag", "index"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var Me=Object.create;var Z=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)Z(n,i,{get:r[i],enumerable:!0})},le=(n,r,i,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of Pe(r))!Ee.call(n,u)&&u!==i&&Z(n,u,{get:()=>r[u],enumerable:!(c=Se(r,u))||c.enumerable});return n};var ee=(n,r,i)=>(i=n!=null?Me(De(n)):{},le(r||!n||!n.__esModule?Z(i,"default",{value:n,enumerable:!0}):i,n)),He=n=>le(Z({},"__esModule",{value:!0}),n);var Ie={};Te(Ie,{default:()=>Be});module.exports=He(Ie);var e=require("react/jsx-runtime"),t=require("react"),l=require("../../components/index.js"),pe=require("../../shared/Styles.js"),k=require("../../helpers/utils.js"),F=ee(require("./NavProvider.js")),o=require("./types.js"),fe=ee(require("jump.js")),te=require("@gsap/react"),X=require("gsap"),C=require("./withCategory.js"),S=require("./icons/index.js"),be=ee(require("../NavigationSearch/index.js")),ve=require("./ResourceSidebarDropdown.js"),ge=require("./MobileResourceSidebarMenu.js"),he=require("./SidebarDropdown.js"),ae=require("./useScrollLock.js"),ye=require("./MulticolDropdown.js"),Ne=require("./SupportsDropdown.js"),ke=require("./MobileSidebarMenu.js"),we=require("./MobileSupportMenu.js"),xe=require("./MobileMulticolMenu.js"),ne=require("./MobileMenuComponents.js"),oe=require("../AiuiProvider/index.js"),ie=ee(require("../../shared/throttle.js"));const se=(0,t.forwardRef)((n,r)=>{const{data:{header:i}={},buildProps:c,event:u,profile:P,theme:s="light",isTop:m=!1,searchResult:x,onSearch:v,isSearching:p,keywords:_,onPrimaryNavClick:w,onSeriesProductClick:h,onSidebarNavClick:D,onMobileMenuToggle:U,headerId:E,cartCount:L,menuData:z,render:R,componentOverrides:G,...J}=n,[B,f]=(0,t.useState)(!1),[W,I]=(0,t.useState)(!1),[A,H]=(0,t.useState)(!1),[Y,g]=(0,t.useState)(!1),O=(0,t.useRef)(null),M=(0,t.useRef)(null),q=()=>{const y=document?.querySelector("body")?.offsetWidth||0;g(y<=1440)};(0,t.useEffect)(()=>(q(),window.addEventListener("resize",q),()=>{window.removeEventListener("resize",q)}),[]),(0,t.useImperativeHandle)(r,()=>M.current),(0,t.useEffect)(()=>{M.current&&m&&(0,fe.default)(M.current,{duration:0,offset:M.current?.getBoundingClientRect()?.bottom||0})},[m]),(0,t.useEffect)(()=>{if(m){I(!1),H(!1);return}let y=0,a=0,d=0;const b=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,N=b();y=N,I(N>300),H(N>30);const $=(0,ie.default)(()=>{const T=b(),K=T-y;H(T>30),K>0?(a=0,d+=K,d>=300&&T>300&&I(!0)):K<0&&(d=0,a+=Math.abs(K),a>=300&&(I(!1),a=0)),y=T},100);return window.addEventListener("scroll",$,{passive:!0}),()=>window.removeEventListener("scroll",$)},[m]),(0,t.useEffect)(()=>{u&&(u.search=()=>f(!0))},[u]),(0,te.useGSAP)(()=>{O?.current&&B&&X.gsap.fromTo(O.current,{height:0},{height:"auto",duration:.3})},[B]),(0,ae.useScrollLock)(B);const Q=(0,t.useMemo)(()=>i?.bar?.actions?.find(y=>y?.blockType===o.HeaderNavigationActionBlockType.Search)?.searchBar?.[0]||{},[i]),j=R?.mobileHeaderNavigation;return(0,e.jsx)(F.default,{buildProps:c,profile:P,isMobile:Y,event:u,payloadData:i,onSidebarNavClick:D,onSeriesProductClick:h,cartCount:L,componentOverrides:G,children:(0,e.jsx)("header",{...J,id:E||"header","data-ui-component-id":"HeaderNavigation",className:m?"relative z-[100] bg-white":(0,k.cn)("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":W}),ref:M,children:(0,e.jsxs)("div",{className:(0,k.cn)("hover:bg-white hover:text-black",s==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!m&&A},{"hover:!text-black":s==="dark","!text-black":!m&&A}),onClick:()=>!m&&H(!0),children:[(0,e.jsx)(ce,{data:i,className:"desktop:block hidden !bg-white",theme:s,onNavItemClick:()=>!m&&H(!0),onPrimaryNavClick:w}),j?(0,e.jsx)(j,{className:"desktop:hidden block !bg-white",menuData:z,data:i,onPrimaryNavClick:w}):(0,e.jsx)(ue,{menuData:z,data:i,className:"desktop:hidden block !bg-white",onPrimaryNavClick:w,onMobileMenuToggle:U}),B&&(0,e.jsxs)("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${M?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[(0,e.jsx)("div",{ref:O,className:(0,k.cn)("overflow-y-auto",{}),children:(0,e.jsx)(be.default,{data:Q,keywords:_,isSearching:p,searchResult:x,onSearch:y=>{v?.(y)},onClose:()=>{v?.(),f(!1)}})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>f(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:y=>{(y.key==="Enter"||y.key===" "||y.key==="Escape")&&(y.preventDefault(),f(!1))}})]})]})})})}),ce=(0,t.forwardRef)((n,r)=>{const{data:i,onNavItemClick:c,className:u,theme:P,onPrimaryNavClick:s}=n,{event:m,profile:x}=(0,F.useNavContext)(),[v,p]=(0,t.useState)(!1),{locale:_="us"}=(0,oe.useAiuiContext)(),w=(0,t.useMemo)(()=>(0,C.WithGroupCategory)(i?.categories?.filter(a=>a?.pcShow)),[i]),[h,D]=(0,t.useState)(null),[U,E]=(0,t.useState)([]),L=(0,t.useRef)(null),[z,R]=(0,t.useState)(!1),G=(0,t.useRef)(null),J=(0,t.useRef)(null),B=(0,t.useRef)(w.map(a=>Array(a?.length||0).fill(null)));(0,t.useEffect)(()=>{w?.length&&E(w?.map((a,d)=>a?.map((b,N)=>({groupIndex:d,index:N,open:!1}))))},[w]);const f=(0,t.useMemo)(()=>{let a=null;for(const d of U){for(const b of d)if(b.open){a=b;break}if(a)break}return a},[U]);(0,ae.useScrollLock)(!!f?.open||z);const W=(a,d,b)=>{R(!1);const N=w[d][b];if(N?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links)N?.components?.[0]?.url&&window.open(N?.components?.[0]?.url,N?.components?.[0]?.target??"_blank");else{const $=w?.flat()||[],T=$?.findIndex(K=>K?.id===w[d][b]?.id);a.stopPropagation(),c?.(),s?.($[T],T),D(N),E(K=>K.map(Ce=>Ce.map(V=>V.groupIndex===d&&V.index===b?{...V,open:!V.open}:{...V,open:!1})))}},I=(a,d,b)=>{a.key==="Enter"||a.key===" "?(a.preventDefault(),W(a,d,b)):a.key==="Escape"&&f?.groupIndex===d&&f?.index===b&&(a.preventDefault(),A())},A=()=>{E(a=>a.map(d=>d.map(b=>({...b,open:!1}))))},H=(0,t.useMemo)(()=>{if(h)return h?.components?.[0]?.blockType},[h]),Y=(0,C.WithSidebar)(he.SidebarDropdown,h),g=(0,C.WithResource)(ve.ResourceSidebarDropdown,h),O=(0,C.WithMulticol)(ye.MulticolDropdown,h),M=(0,C.WithSupports)(Ne.SupportsDropdown,{categoriesItem:h,currentNavItemRef:B.current?.[f?.groupIndex||0]?.[f?.index||0]}),q=(0,t.useMemo)(()=>{switch(H){case o.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(Y,{});case o.HeaderNavigationBlockType.Resource:return(0,e.jsx)(g,{});case o.HeaderNavigationBlockType.Supports:return(0,e.jsx)(M,{});case o.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(O,{});default:return null}},[H,h]),Q=(0,t.useMemo)(()=>i?.bar?.actions?.filter(a=>a?.pcShow),[i]),j=(0,t.useMemo)(()=>Q?.find(a=>a?.blockType===o.HeaderNavigationActionBlockType.Profile),[Q]),y=(0,t.useCallback)(()=>{R(a=>!a)},[]);return(0,t.useEffect)(()=>{if(L?.current){const a=L.current;return a.addEventListener("click",y),()=>{a.removeEventListener("click",y)}}},[y]),(0,te.useGSAP)(()=>{f?.open&&X.gsap.fromTo(J?.current,{height:0},{height:"auto"})},[f?.open]),(0,e.jsxs)(l.Container,{className:(0,k.cn)("relative h-[96px]",u),children:[(0,e.jsxs)("div",{ref:G,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)(de,{}),(0,e.jsx)(re,{ref:L,actions:Q,activeStatus:z})]}),(0,e.jsx)("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:w?.map((a,d)=>(0,e.jsx)("div",{className:"flex gap-3",children:a?.map((b,N)=>{const $=f?.groupIndex===d&&f?.index===N;return(0,e.jsx)("div",{ref:T=>{B.current[d][N]=T},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:T=>W(T,d,N),onKeyDown:T=>I(T,d,N),"aria-expanded":$,"aria-haspopup":"true","aria-label":b.text,children:[(0,e.jsx)(l.Text,{html:b.text,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)(S.DownArrow,{className:(0,k.cn)("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":f?.groupIndex===d&&f?.index===N,"opacity-100":v&&f?.groupIndex===d&&f?.index===N,invisible:!b?.components?.length||b?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links})})]}),(0,e.jsx)("div",{className:(0,k.cn)("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":$},P==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},b.id)})},`groupCategory-${d}`))})]}),(0,e.jsxs)("div",{role:"menu","aria-hidden":!(f?.open&&h),className:(0,k.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:!(f?.open&&h)}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{height:`calc(100dvh - ${G?.current?.getBoundingClientRect()?.bottom}px)`},children:[(0,e.jsx)("div",{ref:J,className:(0,k.cn)("relative z-50",{"overflow-hidden":H!==o.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())}})]}),z&&(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% - ${L?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:x?.email?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Text,{html:x?.nick_name||j?.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:j?.profiles?.map(a=>(0,e.jsx)(ne.MenuItem,{className:"py-2",label:a?.title,href:(0,k.getLocalizedPath)(a?.url,_)},a.id))})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(S.Polygon,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),(0,e.jsx)(l.Text,{html:j?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:j?.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 shrink-0",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 flex-wrap gap-2",children:[(0,e.jsx)(l.Button,{className:"grow",variant:"secondary",size:"lg",onClick:()=>m?.join?.(),children:(0,e.jsx)(l.Text,{html:j?.primaryButton||"Join Now",className:"font-bold"})}),(0,e.jsx)(l.Button,{className:"grow",variant:"primary",size:"lg",onClick:()=>m?.login?.(),children:(0,e.jsx)(l.Text,{html:j?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>R(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),R(!1))}})]})]})}),ue=(0,t.forwardRef)(({data:n,menuData:r,className:i,onPrimaryNavClick:c,onMobileMenuToggle:u},P)=>{const s=(0,t.useMemo)(()=>(0,C.WithGroupCategory)(n?.categories?.filter(g=>g?.mobileShow)),[n]),{currentMenu:m,setCurrentMenu:x,subSubCategory:v}=(0,F.useNavContext)(),[p,_]=(0,t.useState)(!1),[w,h]=(0,t.useState)(0),[D,U]=(0,t.useState)(null),E=(0,t.useRef)(null),L=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(E?.current&&p){const g=E?.current?.getBoundingClientRect();h(window?.innerHeight-(g?.top||0))}u?.({open:p})},[p,u]),(0,t.useEffect)(()=>{if(!p)return;const g=(0,ie.default)(()=>{if(E?.current){const O=E.current.getBoundingClientRect();L.current=!0,h(window?.innerHeight-(O?.top||0))}},100);return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[p]),(0,te.useGSAP)(()=>{if(L.current){X.gsap.set(E.current,{height:w}),L.current=!1;return}X.gsap.fromTo(E.current,{height:0},{height:w,duration:.3})},[w]),(0,ae.useScrollLock)(p);const z=(0,t.useMemo)(()=>D?.components?.[0]?.blockType,[D]),R=(0,C.WithSupports)(we.MobileSupportMenu,{categoriesItem:D}),G=(0,C.WithSidebar)(ke.MobileSidebarMenu,D),J=(0,C.WithResource)(ge.MobileResourceSidebarMenu,D),B=(0,C.WithMulticol)(xe.MobileMulticolMenu,D),f=(0,t.useMemo)(()=>{switch(z){case o.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(G,{});case o.HeaderNavigationBlockType.Resource:return(0,e.jsx)(J,{});case o.HeaderNavigationBlockType.Supports:return(0,e.jsx)(R,{});case o.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(B,{});default:return null}},[z,D,R]),W=(0,t.useCallback)(()=>{_(!1),h(0),x&&x(o.HeaderNavigationMenu.Primary)},[_,h,x]),I=(0,t.useMemo)(()=>n?.bar?.actions?.filter(g=>g?.mobileShow&&g?.blockType!==o.HeaderNavigationActionBlockType.Profile),[n]),A=(0,t.useMemo)(()=>n?.bar?.actions?.find(g=>g?.mobileShow&&g?.blockType===o.HeaderNavigationActionBlockType.Profile)||{},[n]),H=(0,t.useMemo)(()=>{switch(m){case o.HeaderNavigationMenu.Primary:return(0,e.jsx)(Re,{actions:I,menuOpen:p,onMenuOpenClose:()=>{_(!1),h(0)},onMenuOpenClick:()=>_(!0)});case o.HeaderNavigationMenu.Secondary:return(0,e.jsx)(me,{title:D?.text,onMenuOpenClose:W,onMenuBackClick:()=>x?.(o.HeaderNavigationMenu.Primary)});case o.HeaderNavigationMenu.Third:return(0,e.jsx)(me,{title:v?.label,onMenuOpenClose:W,onMenuBackClick:()=>x?.(o.HeaderNavigationMenu.Secondary)});default:return null}},[p,m,x,D,I,v,W]),Y=(0,t.useCallback)((g,O)=>{const M=Array.isArray(s)?Array.isArray(s[g])?s[g][O]:{}:{};U(M),M?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links?M?.components?.[0]?.url&&window.open(M?.components?.[0]?.url,M?.components?.[0]?.target??"_blank"):x?.(o.HeaderNavigationMenu.Secondary)},[s,x]);return(0,e.jsxs)(l.Container,{className:(0,k.cn)("relative h-[52px]",i),children:[H,p&&(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:w},role:"navigation","aria-label":"Mobile navigation menu",children:[m===o.HeaderNavigationMenu.Primary&&r?(0,e.jsx)("div",{className:"pt-4",children:(0,e.jsx)(l.BrandStrip,{data:r})}):null,m===o.HeaderNavigationMenu.Primary?(0,e.jsx)(Le,{categories:s,onPrimaryMenuClick:Y,onPrimaryNavClick:c,profileAction:A}):f]})]})}),Le=({categories:n,onPrimaryMenuClick:r,profileAction:i,onPrimaryNavClick:c})=>(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((u,P)=>(0,e.jsxs)("div",{className:"",children:[(0,e.jsx)("div",{className:(0,k.cn)("my-2 h-px w-full bg-[#E5E5E7]")}),u?.map((s,m)=>(0,e.jsx)(ne.MenuItem,{label:s.text,onClick:()=>{const v=(n?.flat()||[])?.findIndex(p=>p?.id===n[P][m]?.id);r(P,m),c?.(s,v)},icon:s.components?.[0]?.icon},s.id))]},`groupCategory-${P}`))}),(0,e.jsx)(ze,{profileAction:i})]}),ze=({profileAction:n})=>{const[r,i]=(0,t.useState)(!1),{profile:c,event:u}=(0,F.useNavContext)(),{locale:P="us"}=(0,oe.useAiuiContext)();return(0,e.jsxs)("div",{className:(0,k.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":c?.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)(S.User,{"aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:c?.nick_name||n?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&(0,e.jsx)(S.DownArrow,{"aria-hidden":"true",className:(0,k.cn)("laptop:size-4 size-5",{"rotate-180":r})})]}),c?.email&&(0,e.jsx)("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:n?.profiles?.map(s=>(0,e.jsx)(ne.MenuItem,{label:s?.title,href:(0,k.getLocalizedPath)(s?.url,P)},s.id))}),r&&!c?.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))})]}),!c?.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:()=>u?.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:()=>u?.login?.(),children:(0,e.jsx)(l.Text,{html:n?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Re=({menuOpen:n,onMenuOpenClose:r,onMenuOpenClick:i,actions:c})=>(0,e.jsxs)("div",{className:"flex h-full items-center justify-between gap-4",children:[(0,e.jsx)(de,{}),(0,e.jsxs)("div",{className:"desktop:gap-6 flex items-center gap-4",children:[(0,e.jsx)(re,{actions:c}),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)(S.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)(S.Menu,{className:"size-5","aria-hidden":"true"})})]})]}),de=()=>{const{payloadData:n,isMobile:r}=(0,F.useNavContext)(),{locale:i="us"}=(0,oe.useAiuiContext)();return(0,e.jsx)("a",{href:(0,k.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:c,cartCount:u}=(0,F.useNavContext)(),[P,s]=(0,t.useState)(null),m=v=>{switch(v){case o.HeaderNavigationActionBlockType.Search:return"Search";case o.HeaderNavigationActionBlockType.Cart:return`Shopping cart${u>0?` (${u} items)`:""}`;case o.HeaderNavigationActionBlockType.Profile:return"User profile";case o.HeaderNavigationActionBlockType.Livestream:return"Livestream";default:return"Action"}},x=(0,t.useCallback)((v,p)=>{switch(s(p),v?.blockType){case o.HeaderNavigationActionBlockType.Search:c?.search?.();break;case o.HeaderNavigationActionBlockType.Cart:c?.cart?.();break;case o.HeaderNavigationActionBlockType.Profile:c?.profile?.();break;case o.HeaderNavigationActionBlockType.Livestream:c?.livestream?.();break;default:return()=>{}}},[c]);return(0,e.jsx)("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(n)&&n?.map((v,p)=>(0,e.jsxs)("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:v.blockType===o.HeaderNavigationActionBlockType.Profile?i:null,onClick:()=>x(v,p),"aria-label":m(v.blockType),"aria-pressed":r&&P===p,children:[(0,e.jsx)(l.Text,{html:v.icon,className:(0,k.cn)("size-5",{"text-brand-0":r&&P===p}),"aria-hidden":"true"}),v.blockType===o.HeaderNavigationActionBlockType.Cart&&u>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:u?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},v.id))})}),me=({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)(S.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)(S.Close,{className:"size-5","aria-hidden":"true"})})]});ue.displayName="MobileNavigation",re.displayName="Actions",se.displayName="HeaderNavigation",ce.displayName="DesktopNavigation";var Be=(0,pe.withLayout)(se);
|
|
1
|
+
"use strict";"use client";var Me=Object.create;var Z=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)Z(n,i,{get:r[i],enumerable:!0})},le=(n,r,i,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of Pe(r))!Ee.call(n,u)&&u!==i&&Z(n,u,{get:()=>r[u],enumerable:!(c=Se(r,u))||c.enumerable});return n};var ee=(n,r,i)=>(i=n!=null?Me(De(n)):{},le(r||!n||!n.__esModule?Z(i,"default",{value:n,enumerable:!0}):i,n)),He=n=>le(Z({},"__esModule",{value:!0}),n);var Ie={};Te(Ie,{default:()=>Be});module.exports=He(Ie);var e=require("react/jsx-runtime"),t=require("react"),l=require("../../components/index.js"),pe=require("../../shared/Styles.js"),k=require("../../helpers/utils.js"),F=ee(require("./NavProvider.js")),o=require("./types.js"),fe=ee(require("jump.js")),te=require("@gsap/react"),X=require("gsap"),C=require("./withCategory.js"),S=require("./icons/index.js"),be=ee(require("../NavigationSearch/index.js")),ve=require("./ResourceSidebarDropdown.js"),ge=require("./MobileResourceSidebarMenu.js"),he=require("./SidebarDropdown.js"),ae=require("./useScrollLock.js"),ye=require("./MulticolDropdown.js"),Ne=require("./SupportsDropdown.js"),ke=require("./MobileSidebarMenu.js"),we=require("./MobileSupportMenu.js"),xe=require("./MobileMulticolMenu.js"),ne=require("./MobileMenuComponents.js"),oe=require("../AiuiProvider/index.js"),ie=ee(require("../../shared/throttle.js"));const se=(0,t.forwardRef)((n,r)=>{const{data:{header:i}={},buildProps:c,event:u,profile:P,theme:s="light",isTop:m=!1,searchResult:x,onSearch:b,isSearching:p,keywords:_,onPrimaryNavClick:w,onSeriesProductClick:h,onSidebarNavClick:D,onMobileMenuToggle:U,headerId:E,cartCount:L,menuData:z,render:R,componentOverrides:G,...J}=n,[B,f]=(0,t.useState)(!1),[W,I]=(0,t.useState)(!1),[A,H]=(0,t.useState)(!1),[Y,g]=(0,t.useState)(!1),O=(0,t.useRef)(null),M=(0,t.useRef)(null),q=()=>{const y=document?.querySelector("body")?.offsetWidth||0;g(y<=1440)};(0,t.useEffect)(()=>(q(),window.addEventListener("resize",q),()=>{window.removeEventListener("resize",q)}),[]),(0,t.useImperativeHandle)(r,()=>M.current),(0,t.useEffect)(()=>{M.current&&m&&(0,fe.default)(M.current,{duration:0,offset:M.current?.getBoundingClientRect()?.bottom||0})},[m]),(0,t.useEffect)(()=>{if(m){I(!1),H(!1);return}let y=0,a=0,d=0;const v=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,N=v();y=N,I(N>300),H(N>30);const $=(0,ie.default)(()=>{const T=v(),K=T-y;H(T>30),K>0?(a=0,d+=K,d>=300&&T>300&&I(!0)):K<0&&(d=0,a+=Math.abs(K),a>=300&&(I(!1),a=0)),y=T},100);return window.addEventListener("scroll",$,{passive:!0}),()=>window.removeEventListener("scroll",$)},[m]),(0,t.useEffect)(()=>{u&&(u.search=()=>f(!0))},[u]),(0,te.useGSAP)(()=>{O?.current&&B&&X.gsap.fromTo(O.current,{height:0},{height:"auto",duration:.3})},[B]),(0,ae.useScrollLock)(B);const Q=(0,t.useMemo)(()=>i?.bar?.actions?.find(y=>y?.blockType===o.HeaderNavigationActionBlockType.Search)?.searchBar?.[0]||{},[i]),j=R?.mobileHeaderNavigation;return(0,e.jsx)(F.default,{buildProps:c,profile:P,isMobile:Y,event:u,payloadData:i,onSidebarNavClick:D,onSeriesProductClick:h,cartCount:L,componentOverrides:G,children:(0,e.jsx)("header",{...J,id:E||"header","data-ui-component-id":"HeaderNavigation",className:m?"relative z-[100] bg-white":(0,k.cn)("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":W}),ref:M,children:(0,e.jsxs)("div",{className:(0,k.cn)("hover:bg-white hover:text-black",s==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!m&&A},{"hover:!text-black":s==="dark","!text-black":!m&&A}),onClick:()=>!m&&H(!0),children:[(0,e.jsx)(ce,{data:i,className:"desktop:block hidden !bg-white",theme:s,onNavItemClick:()=>!m&&H(!0),onPrimaryNavClick:w}),j?(0,e.jsx)(j,{className:"desktop:hidden block !bg-white",menuData:z,data:i,onPrimaryNavClick:w}):(0,e.jsx)(ue,{menuData:z,data:i,className:"desktop:hidden block !bg-white",onPrimaryNavClick:w,onMobileMenuToggle:U}),B&&(0,e.jsxs)("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${M?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[(0,e.jsx)("div",{ref:O,className:(0,k.cn)("overflow-y-auto",{}),children:(0,e.jsx)(be.default,{data:Q,keywords:_,isSearching:p,searchResult:x,onSearch:y=>{b?.(y)},onClose:()=>{b?.(),f(!1)}})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>f(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:y=>{(y.key==="Enter"||y.key===" "||y.key==="Escape")&&(y.preventDefault(),f(!1))}})]})]})})})}),ce=(0,t.forwardRef)((n,r)=>{const{data:i,onNavItemClick:c,className:u,theme:P,onPrimaryNavClick:s}=n,{event:m,profile:x}=(0,F.useNavContext)(),[b,p]=(0,t.useState)(!1),{locale:_="us"}=(0,oe.useAiuiContext)(),w=(0,t.useMemo)(()=>(0,C.WithGroupCategory)(i?.categories?.filter(a=>a?.pcShow)),[i]),[h,D]=(0,t.useState)(null),[U,E]=(0,t.useState)([]),L=(0,t.useRef)(null),[z,R]=(0,t.useState)(!1),G=(0,t.useRef)(null),J=(0,t.useRef)(null),B=(0,t.useRef)(w.map(a=>Array(a?.length||0).fill(null)));(0,t.useEffect)(()=>{w?.length&&E(w?.map((a,d)=>a?.map((v,N)=>({groupIndex:d,index:N,open:!1}))))},[w]);const f=(0,t.useMemo)(()=>{let a=null;for(const d of U){for(const v of d)if(v.open){a=v;break}if(a)break}return a},[U]);(0,ae.useScrollLock)(!!f?.open||z);const W=(a,d,v)=>{R(!1);const N=w[d][v];if(N?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links)N?.components?.[0]?.url&&window.open(N?.components?.[0]?.url,N?.components?.[0]?.target??"_blank");else{const $=w?.flat()||[],T=$?.findIndex(K=>K?.id===w[d][v]?.id);a.stopPropagation(),c?.(),s?.($[T],T),D(N),E(K=>K.map(Ce=>Ce.map(V=>V.groupIndex===d&&V.index===v?{...V,open:!V.open}:{...V,open:!1})))}},I=(a,d,v)=>{a.key==="Enter"||a.key===" "?(a.preventDefault(),W(a,d,v)):a.key==="Escape"&&f?.groupIndex===d&&f?.index===v&&(a.preventDefault(),A())},A=()=>{E(a=>a.map(d=>d.map(v=>({...v,open:!1}))))},H=(0,t.useMemo)(()=>{if(h)return h?.components?.[0]?.blockType},[h]),Y=(0,C.WithSidebar)(he.SidebarDropdown,h),g=(0,C.WithResource)(ve.ResourceSidebarDropdown,h),O=(0,C.WithMulticol)(ye.MulticolDropdown,h),M=(0,C.WithSupports)(Ne.SupportsDropdown,{categoriesItem:h,currentNavItemRef:B.current?.[f?.groupIndex||0]?.[f?.index||0]}),q=(0,t.useMemo)(()=>{switch(H){case o.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(Y,{});case o.HeaderNavigationBlockType.Resource:return(0,e.jsx)(g,{});case o.HeaderNavigationBlockType.Supports:return(0,e.jsx)(M,{});case o.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(O,{});default:return null}},[H,h]),Q=(0,t.useMemo)(()=>i?.bar?.actions?.filter(a=>a?.pcShow),[i]),j=(0,t.useMemo)(()=>Q?.find(a=>a?.blockType===o.HeaderNavigationActionBlockType.Profile),[Q]),y=(0,t.useCallback)(()=>{R(a=>!a)},[]);return(0,t.useEffect)(()=>{if(L?.current){const a=L.current;return a.addEventListener("click",y),()=>{a.removeEventListener("click",y)}}},[y]),(0,te.useGSAP)(()=>{f?.open&&X.gsap.fromTo(J?.current,{height:0},{height:"auto"})},[f?.open]),(0,e.jsxs)(l.Container,{className:(0,k.cn)("relative h-[96px]",u),children:[(0,e.jsxs)("div",{ref:G,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)(de,{}),(0,e.jsx)(re,{ref:L,actions:Q,activeStatus:z})]}),(0,e.jsx)("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:w?.map((a,d)=>(0,e.jsx)("div",{className:"flex gap-3",children:a?.map((v,N)=>{const $=f?.groupIndex===d&&f?.index===N;return(0,e.jsx)("div",{ref:T=>{B.current[d][N]=T},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:T=>W(T,d,N),onKeyDown:T=>I(T,d,N),"aria-expanded":$,"aria-haspopup":"true","aria-label":v.text,children:[(0,e.jsx)(l.Text,{html:v.text,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)(S.DownArrow,{className:(0,k.cn)("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":f?.groupIndex===d&&f?.index===N,"opacity-100":b&&f?.groupIndex===d&&f?.index===N,invisible:!v?.components?.length||v?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links})})]}),(0,e.jsx)("div",{className:(0,k.cn)("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":$},P==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},v.id)})},`groupCategory-${d}`))})]}),(0,e.jsxs)("div",{role:"menu","aria-hidden":!(f?.open&&h),className:(0,k.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:!(f?.open&&h)}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{height:`calc(100dvh - ${G?.current?.getBoundingClientRect()?.bottom}px)`},children:[(0,e.jsx)("div",{ref:J,className:(0,k.cn)("relative z-50",{"overflow-hidden":H!==o.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())}})]}),z&&(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% - ${L?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:x?.email?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Text,{html:x?.nick_name||j?.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:j?.profiles?.map(a=>(0,e.jsx)(ne.MenuItem,{className:"py-2",label:a?.title,href:(0,k.getLocalizedPath)(a?.url,_)},a.id))})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(S.Polygon,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),(0,e.jsx)(l.Text,{html:j?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:j?.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 shrink-0",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 flex-wrap gap-2",children:[(0,e.jsx)(l.Button,{className:"grow",variant:"secondary",size:"lg",onClick:()=>m?.join?.(),children:(0,e.jsx)(l.Text,{html:j?.primaryButton||"Join Now",className:"font-bold"})}),(0,e.jsx)(l.Button,{className:"grow",variant:"primary",size:"lg",onClick:()=>m?.login?.(),children:(0,e.jsx)(l.Text,{html:j?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>R(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),R(!1))}})]})]})}),ue=(0,t.forwardRef)(({data:n,menuData:r,className:i,onPrimaryNavClick:c,onMobileMenuToggle:u},P)=>{const s=(0,t.useMemo)(()=>(0,C.WithGroupCategory)(n?.categories?.filter(g=>g?.mobileShow)),[n]),{currentMenu:m,setCurrentMenu:x,subSubCategory:b}=(0,F.useNavContext)(),[p,_]=(0,t.useState)(!1),[w,h]=(0,t.useState)(0),[D,U]=(0,t.useState)(null),E=(0,t.useRef)(null),L=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(E?.current&&p){const g=E?.current?.getBoundingClientRect();h(window?.innerHeight-(g?.top||0))}u?.({open:p})},[p,u]),(0,t.useEffect)(()=>{if(!p)return;const g=(0,ie.default)(()=>{if(E?.current){const O=E.current.getBoundingClientRect();L.current=!0,h(window?.innerHeight-(O?.top||0))}},100);return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[p]),(0,te.useGSAP)(()=>{if(L.current){X.gsap.set(E.current,{height:w}),L.current=!1;return}X.gsap.fromTo(E.current,{height:0},{height:w,duration:.3})},[w]),(0,ae.useScrollLock)(p);const z=(0,t.useMemo)(()=>D?.components?.[0]?.blockType,[D]),R=(0,C.WithSupports)(we.MobileSupportMenu,{categoriesItem:D}),G=(0,C.WithSidebar)(ke.MobileSidebarMenu,D),J=(0,C.WithResource)(ge.MobileResourceSidebarMenu,D),B=(0,C.WithMulticol)(xe.MobileMulticolMenu,D),f=(0,t.useMemo)(()=>{switch(z){case o.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(G,{});case o.HeaderNavigationBlockType.Resource:return(0,e.jsx)(J,{});case o.HeaderNavigationBlockType.Supports:return(0,e.jsx)(R,{});case o.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(B,{});default:return null}},[z,D,R]),W=(0,t.useCallback)(()=>{_(!1),h(0),x&&x(o.HeaderNavigationMenu.Primary)},[_,h,x]),I=(0,t.useMemo)(()=>n?.bar?.actions?.filter(g=>g?.mobileShow&&g?.blockType!==o.HeaderNavigationActionBlockType.Profile),[n]),A=(0,t.useMemo)(()=>n?.bar?.actions?.find(g=>g?.mobileShow&&g?.blockType===o.HeaderNavigationActionBlockType.Profile)||{},[n]),H=(0,t.useMemo)(()=>{switch(m){case o.HeaderNavigationMenu.Primary:return(0,e.jsx)(Re,{actions:I,menuOpen:p,onMenuOpenClose:()=>{_(!1),h(0)},onMenuOpenClick:()=>_(!0)});case o.HeaderNavigationMenu.Secondary:return(0,e.jsx)(me,{title:D?.text,onMenuOpenClose:W,onMenuBackClick:()=>x?.(o.HeaderNavigationMenu.Primary)});case o.HeaderNavigationMenu.Third:return(0,e.jsx)(me,{title:b?.label,onMenuOpenClose:W,onMenuBackClick:()=>x?.(o.HeaderNavigationMenu.Secondary)});default:return null}},[p,m,x,D,I,b,W]),Y=(0,t.useCallback)((g,O)=>{const M=Array.isArray(s)?Array.isArray(s[g])?s[g][O]:{}:{};U(M),M?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links?M?.components?.[0]?.url&&window.open(M?.components?.[0]?.url,M?.components?.[0]?.target??"_blank"):x?.(o.HeaderNavigationMenu.Secondary)},[s,x]);return(0,e.jsxs)(l.Container,{className:(0,k.cn)("relative h-[52px]",i),children:[H,p&&(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:w},role:"navigation","aria-label":"Mobile navigation menu",children:[m===o.HeaderNavigationMenu.Primary&&r?(0,e.jsx)("div",{className:"pt-4",children:(0,e.jsx)(l.BrandStrip,{data:r})}):null,m===o.HeaderNavigationMenu.Primary?(0,e.jsx)(Le,{categories:s,onPrimaryMenuClick:Y,onPrimaryNavClick:c,profileAction:A}):f]})]})}),Le=({categories:n,onPrimaryMenuClick:r,profileAction:i,onPrimaryNavClick:c})=>(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((u,P)=>(0,e.jsxs)("div",{className:"",children:[(0,e.jsx)("div",{className:(0,k.cn)("my-2 h-px w-full bg-[#E5E5E7]")}),u?.map((s,m)=>(0,e.jsx)(ne.MenuItem,{label:s.text,onClick:()=>{const b=(n?.flat()||[])?.findIndex(p=>p?.id===n[P][m]?.id);r(P,m),c?.(s,b)},icon:s.components?.[0]?.icon},s.id))]},`groupCategory-${P}`))}),(0,e.jsx)(ze,{profileAction:i})]}),ze=({profileAction:n})=>{const[r,i]=(0,t.useState)(!1),{profile:c,event:u}=(0,F.useNavContext)(),{locale:P="us"}=(0,oe.useAiuiContext)();return(0,e.jsxs)("div",{className:(0,k.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":c?.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)(S.User,{"aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:c?.nick_name||n?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&(0,e.jsx)(S.DownArrow,{"aria-hidden":"true",className:(0,k.cn)("laptop:size-4 size-5",{"rotate-180":r})})]}),c?.email&&(0,e.jsx)("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:n?.profiles?.map(s=>(0,e.jsx)(ne.MenuItem,{label:s?.title,href:(0,k.getLocalizedPath)(s?.url,P)},s.id))}),r&&!c?.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))})]}),!c?.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:()=>u?.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:()=>u?.login?.(),children:(0,e.jsx)(l.Text,{html:n?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Re=({menuOpen:n,onMenuOpenClose:r,onMenuOpenClick:i,actions:c})=>(0,e.jsxs)("div",{className:"flex h-full items-center justify-between gap-4",children:[(0,e.jsx)(de,{}),(0,e.jsxs)("div",{className:"desktop:gap-6 flex items-center gap-4",children:[(0,e.jsx)(re,{actions:c}),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)(S.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)(S.Menu,{className:"size-5","aria-hidden":"true"})})]})]}),de=()=>{const{payloadData:n,isMobile:r}=(0,F.useNavContext)(),{locale:i="us"}=(0,oe.useAiuiContext)();return(0,e.jsx)("a",{href:(0,k.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:c,cartCount:u}=(0,F.useNavContext)(),[P,s]=(0,t.useState)(null),m=b=>{switch(b){case o.HeaderNavigationActionBlockType.Search:return"Search";case o.HeaderNavigationActionBlockType.Cart:return`Shopping cart${u>0?` (${u} items)`:""}`;case o.HeaderNavigationActionBlockType.Profile:return"User profile";case o.HeaderNavigationActionBlockType.Livestream:return"Livestream";default:return"Action"}},x=(0,t.useCallback)((b,p)=>{switch(s(p),b?.blockType){case o.HeaderNavigationActionBlockType.Search:c?.search?.();break;case o.HeaderNavigationActionBlockType.Cart:c?.cart?.();break;case o.HeaderNavigationActionBlockType.Profile:c?.profile?.();break;case o.HeaderNavigationActionBlockType.Livestream:c?.livestream?.();break;default:return()=>{}}},[c]);return(0,e.jsx)("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(n)&&n?.map((b,p)=>(0,e.jsxs)("button",{className:"relative cursor-pointer border-0 bg-transparent p-0","data-tag":b?.tag||"",ref:b.blockType===o.HeaderNavigationActionBlockType.Profile?i:null,onClick:()=>x(b,p),"aria-label":m(b.blockType),"aria-pressed":r&&P===p,children:[(0,e.jsx)(l.Text,{html:b.icon,className:(0,k.cn)("size-5",{"text-brand-0":r&&P===p}),"aria-hidden":"true"}),b.blockType===o.HeaderNavigationActionBlockType.Cart&&u>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:u?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},b.id))})}),me=({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)(S.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)(S.Close,{className:"size-5","aria-hidden":"true"})})]});ue.displayName="MobileNavigation",re.displayName="Actions",se.displayName="HeaderNavigation",ce.displayName="DesktopNavigation";var Be=(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 onMobileMenuToggle,\n headerId,\n cartCount,\n menuData,\n render,\n componentOverrides,\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 const CustomMobileHeaderNavigation = render?.mobileHeaderNavigation\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 componentOverrides={componentOverrides}\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 {CustomMobileHeaderNavigation ? (\n <CustomMobileHeaderNavigation\n className=\"desktop:hidden block !bg-white\"\n menuData={menuData}\n data={header}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n ) : (\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n onMobileMenuToggle={onMobileMenuToggle}\n />\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 &&\n window.open(\n currentCategoriesItem?.components?.[0]?.url,\n currentCategoriesItem?.components?.[0]?.target ?? '_blank'\n )\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 shrink-0\"\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 flex-wrap gap-2\">\n <Button className=\"grow\" variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button className=\"grow\" 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, onMobileMenuToggle }, 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 // resize \u89E6\u53D1\u7684\u9AD8\u5EA6\u66F4\u65B0\u53EA\u9700\u76F4\u63A5\u540C\u6B65\uFF0C\u4E0D\u9700\u8981\u91CD\u653E\u5C55\u5F00\u52A8\u753B\n const skipOpenAnimationRef = useRef(false)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n\n onMobileMenuToggle?.({ open: mobileMenuOpen })\n }, [mobileMenuOpen, onMobileMenuToggle])\n\n // \u79FB\u52A8\u7AEF\u83DC\u5355\u5C55\u5F00\u65F6\uFF0C\u76D1\u542C\u7A97\u53E3\u5C3A\u5BF8\u53D8\u5316\uFF0C\u9632\u6B62\u7528\u6237\u8C03\u6574\u6D4F\u89C8\u5668\u7A97\u53E3\u5927\u5C0F\u540E\u83DC\u5355\u9AD8\u5EA6\u4E0D\u540C\u6B65\n useEffect(() => {\n if (!mobileMenuOpen) return\n\n const handleResize = throttle(() => {\n if (mobileMenuRef?.current) {\n const rect = mobileMenuRef.current.getBoundingClientRect()\n skipOpenAnimationRef.current = true\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n }, 100)\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n if (skipOpenAnimationRef.current) {\n // resize \u5F15\u8D77\u7684\u9AD8\u5EA6\u53D8\u5316\uFF1A\u76F4\u63A5\u540C\u6B65\u9AD8\u5EA6\uFF0C\u4E0D\u64AD\u653E\u5C55\u5F00\u52A8\u753B\n gsap.set(mobileMenuRef.current, { height: menuInnerHeight })\n skipOpenAnimationRef.current = false\n return\n }\n\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 &&\n window.open(categoriesItem?.components?.[0]?.url, categoriesItem?.components?.[0]?.target ?? '_blank')\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": "ulBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA+NU,IAAAI,EAAA,6BA9NVC,EAA0G,iBAE1GC,EAA6D,qCAE7DC,GAA2B,kCAE3BC,EAAqC,kCASrCC,EAA2C,gCAE3CC,EAAiG,sBAEjGC,GAAiB,uBAEjBN,GAAwB,uBACxBO,EAAqB,gBAErBC,EAAyF,6BAEzFC,EAAiE,4BAEjEC,GAA6B,4CAC7BC,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,wCAErB,MAAMC,MAAmB,cAAkD,CAACC,EAAOC,IAAQ,CACzF,KAAM,C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kI,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,MAAQnH,EAAY,MACxE,OAAC,OACC,UAAU,uIACV,cAAY,OAEZ,mBAAC,QAAK,KAAMA,GAAW,SAAS,EAAG,UAAU,6CAA6C,EAC5F,IAjBGmH,EAAO,EAmBd,CACD,EACL,CAEJ,CACF,EAEMjB,GAAkB,CAAC,CAAE,MAAAkB,EAAO,gBAAAV,EAAiB,gBAAAW,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,IAAMV,EAAgB,EAC/B,aAAW,aAEX,mBAAC,SAAM,UAAU,SAAS,cAAY,OAAO,EAC/C,GACF,EAIJ1E,GAAiB,YAAc,mBAC/B2C,GAAQ,YAAc,UACtB7F,GAAiB,YAAc,mBAC/BiD,GAAkB,YAAc,oBAEhC,IAAO3E,MAAQ,eAAW0B,EAAgB",
|
|
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 onMobileMenuToggle,\n headerId,\n cartCount,\n menuData,\n render,\n componentOverrides,\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 const CustomMobileHeaderNavigation = render?.mobileHeaderNavigation\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 componentOverrides={componentOverrides}\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 {CustomMobileHeaderNavigation ? (\n <CustomMobileHeaderNavigation\n className=\"desktop:hidden block !bg-white\"\n menuData={menuData}\n data={header}\n onPrimaryNavClick={onPrimaryNavClick}\n />\n ) : (\n <MobileNavigation\n menuData={menuData}\n data={header}\n className=\"desktop:hidden block !bg-white\"\n onPrimaryNavClick={onPrimaryNavClick}\n onMobileMenuToggle={onMobileMenuToggle}\n />\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 &&\n window.open(\n currentCategoriesItem?.components?.[0]?.url,\n currentCategoriesItem?.components?.[0]?.target ?? '_blank'\n )\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 shrink-0\"\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 flex-wrap gap-2\">\n <Button className=\"grow\" variant=\"secondary\" size=\"lg\" onClick={() => event?.join?.()}>\n <Text html={profileAction?.primaryButton || 'Join Now'} className=\"font-bold\" />\n </Button>\n <Button className=\"grow\" 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, onMobileMenuToggle }, 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 // resize \u89E6\u53D1\u7684\u9AD8\u5EA6\u66F4\u65B0\u53EA\u9700\u76F4\u63A5\u540C\u6B65\uFF0C\u4E0D\u9700\u8981\u91CD\u653E\u5C55\u5F00\u52A8\u753B\n const skipOpenAnimationRef = useRef(false)\n\n useEffect(() => {\n if (mobileMenuRef?.current && mobileMenuOpen) {\n const rect = mobileMenuRef?.current?.getBoundingClientRect()\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n\n onMobileMenuToggle?.({ open: mobileMenuOpen })\n }, [mobileMenuOpen, onMobileMenuToggle])\n\n // \u79FB\u52A8\u7AEF\u83DC\u5355\u5C55\u5F00\u65F6\uFF0C\u76D1\u542C\u7A97\u53E3\u5C3A\u5BF8\u53D8\u5316\uFF0C\u9632\u6B62\u7528\u6237\u8C03\u6574\u6D4F\u89C8\u5668\u7A97\u53E3\u5927\u5C0F\u540E\u83DC\u5355\u9AD8\u5EA6\u4E0D\u540C\u6B65\n useEffect(() => {\n if (!mobileMenuOpen) return\n\n const handleResize = throttle(() => {\n if (mobileMenuRef?.current) {\n const rect = mobileMenuRef.current.getBoundingClientRect()\n skipOpenAnimationRef.current = true\n setMenuInnerHeight(window?.innerHeight - (rect?.top || 0))\n }\n }, 100)\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [mobileMenuOpen])\n\n useGSAP(() => {\n if (skipOpenAnimationRef.current) {\n // resize \u5F15\u8D77\u7684\u9AD8\u5EA6\u53D8\u5316\uFF1A\u76F4\u63A5\u540C\u6B65\u9AD8\u5EA6\uFF0C\u4E0D\u64AD\u653E\u5C55\u5F00\u52A8\u753B\n gsap.set(mobileMenuRef.current, { height: menuInnerHeight })\n skipOpenAnimationRef.current = false\n return\n }\n\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 &&\n window.open(categoriesItem?.components?.[0]?.url, categoriesItem?.components?.[0]?.target ?? '_blank')\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 data-tag={action?.tag || ''}\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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,QAAK,KAAMD,EAAO,UAAU,uDAAuD,KACpF,OAAC,UACC,UAAU,6CACV,QAAS,IAAMV,EAAgB,EAC/B,aAAW,aAEX,mBAAC,SAAM,UAAU,SAAS,cAAY,OAAO,EAC/C,GACF,EAIJ1E,GAAiB,YAAc,mBAC/B2C,GAAQ,YAAc,UACtB7F,GAAiB,YAAc,mBAC/BiD,GAAkB,YAAc,oBAEhC,IAAO3E,MAAQ,eAAW0B,EAAgB",
|
|
6
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_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", "onMobileMenuToggle", "headerId", "cartCount", "menuData", "render", "componentOverrides", "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", "CustomMobileHeaderNavigation", "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", "skipOpenAnimationRef", "rect", "handleResize", "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"]
|
|
7
7
|
}
|