@anker-in/headless-ui 1.0.26-alpha.1762163448499 → 1.0.26-alpha.1762243303200
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/AiuiProvider/index.d.ts +4 -0
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/cjs/biz-components/HeroBanner/Countdown.d.ts +9 -0
- package/dist/cjs/biz-components/HeroBanner/Countdown.js +2 -0
- package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +7 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/types.d.ts +6 -0
- package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +118 -0
- package/dist/cjs/biz-components/Listing/BizProductProvider.js +2 -0
- package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +12 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +37 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +40 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +37 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +4 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +10 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/components/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/const.d.ts +29 -0
- package/dist/cjs/biz-components/Listing/const.js +2 -0
- package/dist/cjs/biz-components/Listing/const.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/cjs/biz-components/Listing/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/index.js +2 -0
- package/dist/cjs/biz-components/Listing/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/graphql.d.ts +7473 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js +2 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/product.d.ts +141 -0
- package/dist/cjs/biz-components/Listing/types/product.js +2 -0
- package/dist/cjs/biz-components/Listing/types/product.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js +2 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types.d.ts +28 -0
- package/dist/cjs/biz-components/Listing/types.js +2 -0
- package/dist/cjs/biz-components/Listing/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/helper.d.ts +36 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/index.d.ts +37 -0
- package/dist/cjs/biz-components/Listing/utils/index.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.d.ts +73 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.js.map +7 -0
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.js +1 -1
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.js.map +2 -2
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +17 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/checkbox.d.ts +1 -0
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +3 -3
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +4 -0
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/esm/biz-components/HeroBanner/Countdown.d.ts +9 -0
- package/dist/esm/biz-components/HeroBanner/Countdown.js +2 -0
- package/dist/esm/biz-components/HeroBanner/Countdown.js.map +7 -0
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/types.d.ts +6 -0
- package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +118 -0
- package/dist/esm/biz-components/Listing/BizProductProvider.js +2 -0
- package/dist/esm/biz-components/Listing/BizProductProvider.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +12 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +37 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +40 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +37 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +4 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +10 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/components/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/const.d.ts +29 -0
- package/dist/esm/biz-components/Listing/const.js +2 -0
- package/dist/esm/biz-components/Listing/const.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.d.ts +3 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.d.ts +5 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.d.ts +5 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/esm/biz-components/Listing/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/index.js +2 -0
- package/dist/esm/biz-components/Listing/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/graphql.d.ts +7473 -0
- package/dist/esm/biz-components/Listing/types/graphql.js +2 -0
- package/dist/esm/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/product.d.ts +141 -0
- package/dist/esm/biz-components/Listing/types/product.js +2 -0
- package/dist/esm/biz-components/Listing/types/product.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/type-helper.d.ts +5 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js +1 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/types.d.ts +28 -0
- package/dist/esm/biz-components/Listing/types.js +1 -0
- package/dist/esm/biz-components/Listing/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/helper.d.ts +36 -0
- package/dist/esm/biz-components/Listing/utils/helper.js +2 -0
- package/dist/esm/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/index.d.ts +37 -0
- package/dist/esm/biz-components/Listing/utils/index.js +2 -0
- package/dist/esm/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.d.ts +73 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.js +2 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.js.map +7 -0
- package/dist/esm/biz-components/TabWithImage/TabWithImage.js +1 -1
- package/dist/esm/biz-components/TabWithImage/TabWithImage.js.map +2 -2
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +17 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +2 -2
- package/dist/esm/components/checkbox.d.ts +1 -0
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +3 -3
- package/dist/tokens/base.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React, { type Dispatch, type SetStateAction, type PropsWithChildren } from 'react';
|
|
2
|
+
import type { Product, ProductPrice, ProductVariant, VariantCoupon, Options, FreeGift, BundleListItem, Bundle } from './types/product';
|
|
3
|
+
import type { CompareData, DiscountData } from './types.js';
|
|
4
|
+
type Country = {
|
|
5
|
+
id?: number;
|
|
6
|
+
name?: string;
|
|
7
|
+
code?: string;
|
|
8
|
+
};
|
|
9
|
+
export type UserProfile = {
|
|
10
|
+
user_id: string;
|
|
11
|
+
email: string;
|
|
12
|
+
nick_name?: string;
|
|
13
|
+
full_name?: string;
|
|
14
|
+
first_name?: string;
|
|
15
|
+
last_name?: string;
|
|
16
|
+
dob?: string;
|
|
17
|
+
gender?: string;
|
|
18
|
+
phone_number?: string;
|
|
19
|
+
phone_account?: string;
|
|
20
|
+
country?: Country;
|
|
21
|
+
is_subscribe?: boolean;
|
|
22
|
+
avatar?: string;
|
|
23
|
+
can_change_password?: boolean;
|
|
24
|
+
invitation_code?: string;
|
|
25
|
+
phone_carrier?: string;
|
|
26
|
+
dob_programmed?: boolean;
|
|
27
|
+
activated?: boolean;
|
|
28
|
+
registed_at?: number;
|
|
29
|
+
activated_at?: number;
|
|
30
|
+
token?: string;
|
|
31
|
+
};
|
|
32
|
+
export type SavingDetail = {
|
|
33
|
+
coupon: number;
|
|
34
|
+
bundle: number;
|
|
35
|
+
member: number;
|
|
36
|
+
freeGift: number;
|
|
37
|
+
compare: number;
|
|
38
|
+
exchangePurchase: number;
|
|
39
|
+
};
|
|
40
|
+
type variantWithFinalPrice = ProductVariant & {
|
|
41
|
+
finalPrice?: ProductPrice;
|
|
42
|
+
};
|
|
43
|
+
export type FunctionMemberPriceResult = {
|
|
44
|
+
hasMemberPrice: boolean;
|
|
45
|
+
originalPrice: number;
|
|
46
|
+
withCouponMemberTotalSave: number;
|
|
47
|
+
withoutCouponMaxMemberTotalSave?: number;
|
|
48
|
+
labels: {
|
|
49
|
+
key: string;
|
|
50
|
+
value: string;
|
|
51
|
+
desc: string;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
export type ModalData = {
|
|
55
|
+
needClickAway?: boolean;
|
|
56
|
+
className?: string;
|
|
57
|
+
title?: string;
|
|
58
|
+
content?: string;
|
|
59
|
+
domContent?: React.ReactNode;
|
|
60
|
+
};
|
|
61
|
+
export interface ProductContextType {
|
|
62
|
+
isLogin?: boolean;
|
|
63
|
+
isMobile?: boolean;
|
|
64
|
+
isDesktop?: boolean;
|
|
65
|
+
product: Product;
|
|
66
|
+
profile?: UserProfile;
|
|
67
|
+
variant: ProductVariant;
|
|
68
|
+
selectedVariants: Array<variantWithFinalPrice>;
|
|
69
|
+
renderRating?: React.ReactNode;
|
|
70
|
+
coupon?: VariantCoupon;
|
|
71
|
+
savingDetail: SavingDetail;
|
|
72
|
+
setSavingDetail: Dispatch<SetStateAction<SavingDetail>>;
|
|
73
|
+
finalPrice: number;
|
|
74
|
+
comparePrice: number;
|
|
75
|
+
totalSavings: number;
|
|
76
|
+
selectedOptions: Options;
|
|
77
|
+
setSelectedOptions: Dispatch<SetStateAction<Options>>;
|
|
78
|
+
freeGift?: FreeGift;
|
|
79
|
+
checkedGift?: ProductVariant;
|
|
80
|
+
setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>;
|
|
81
|
+
exchangePurchase?: FreeGift;
|
|
82
|
+
checkedExchangePurchase?: ProductVariant;
|
|
83
|
+
setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>;
|
|
84
|
+
checkedBundle?: BundleListItem;
|
|
85
|
+
setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>;
|
|
86
|
+
joinedRecommendBuyProducts: {
|
|
87
|
+
bundle?: BundleListItem;
|
|
88
|
+
gift?: ProductVariant;
|
|
89
|
+
exchange?: ProductVariant;
|
|
90
|
+
};
|
|
91
|
+
setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<{
|
|
92
|
+
bundle?: BundleListItem;
|
|
93
|
+
gift?: ProductVariant;
|
|
94
|
+
exchange?: ProductVariant;
|
|
95
|
+
}>>;
|
|
96
|
+
checkedCareBundle?: ProductVariant;
|
|
97
|
+
setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>;
|
|
98
|
+
bundle?: Bundle;
|
|
99
|
+
compareData?: CompareData['data'];
|
|
100
|
+
onAddToCart?: () => void;
|
|
101
|
+
onBuyNow?: () => void;
|
|
102
|
+
creditsRedemptionAmount?: number;
|
|
103
|
+
memberFunctionResult?: FunctionMemberPriceResult;
|
|
104
|
+
openModal: ({ title, content, domContent }: ModalData) => void;
|
|
105
|
+
openSignInPopup?: () => void;
|
|
106
|
+
openAuthCodePopup?: () => void;
|
|
107
|
+
openSignUpPopup?: () => void;
|
|
108
|
+
renderAffirm?: React.ReactNode;
|
|
109
|
+
renderKlarna?: React.ReactNode;
|
|
110
|
+
renderPaypal?: React.ReactNode;
|
|
111
|
+
onUseCouponChange?: (couponSaving: number) => void;
|
|
112
|
+
onUseMemberDiscountChange?: (memberSaving: number) => void;
|
|
113
|
+
discount?: DiscountData;
|
|
114
|
+
}
|
|
115
|
+
export declare const BizProductContext: React.Context<ProductContextType>;
|
|
116
|
+
export declare const useBizProductContext: () => ProductContextType;
|
|
117
|
+
declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemptionAmount, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderAffirm, renderKlarna, renderPaypal, onUseCouponChange, onUseMemberDiscountChange, discount, }: PropsWithChildren<Omit<ProductContextType, "joinedRecommendBuyProducts" | "setJoinedRecommendBuyProducts">>) => import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
export default ProductProvider;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as H}from"react/jsx-runtime";import{createContext as J,useContext as n,useState as K}from"react";const e=J({}),Z=()=>{if(!n(e))throw new Error("useProductContext must be used in <ProductProvider>");return n(e)},q=({product:t,isLogin:o,profile:r,isMobile:i,isDesktop:a,children:c,renderRating:d,freeGift:u,exchangePurchase:s,bundle:p,checkedBundle:m,checkedGift:l,setCheckedBundle:P,setCheckedGift:b,checkedExchangePurchase:g,setCheckedExchangePurchase:h,variant:C,selectedOptions:f,setSelectedOptions:v,compareData:y,coupon:S,finalPrice:x,comparePrice:D,totalSavings:B,savingDetail:R,setSavingDetail:V,selectedVariants:_,onAddToCart:k,onBuyNow:A,creditsRedemptionAmount:M,memberFunctionResult:F,openModal:w,openSignInPopup:G,openAuthCodePopup:I,openSignUpPopup:L,renderAffirm:N,renderKlarna:T,renderPaypal:O,onUseCouponChange:U,onUseMemberDiscountChange:W,discount:j})=>{const[z,E]=K({bundle:void 0,gift:void 0});return H(e.Provider,{value:{product:t,variant:C,isMobile:i,isDesktop:a,isLogin:o,profile:r,coupon:S,renderRating:d,finalPrice:x,comparePrice:D,savingDetail:R,setSavingDetail:V,totalSavings:B,selectedOptions:f,setSelectedOptions:v,freeGift:u,exchangePurchase:s,checkedGift:l,setCheckedGift:b,checkedBundle:m,setCheckedBundle:P,bundle:p,compareData:y,selectedVariants:_,onAddToCart:k,onBuyNow:A,joinedRecommendBuyProducts:z,setJoinedRecommendBuyProducts:E,checkedExchangePurchase:g,setCheckedExchangePurchase:h,creditsRedemptionAmount:M,memberFunctionResult:F,openModal:w,openSignInPopup:G,openAuthCodePopup:I,openSignUpPopup:L,renderAffirm:N,renderKlarna:T,renderPaypal:O,onUseCouponChange:U,onUseMemberDiscountChange:W,discount:j},children:c})};var $=q;export{e as BizProductContext,$ as default,Z as useBizProductContext};
|
|
2
|
+
//# sourceMappingURL=BizProductProvider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/Listing/BizProductProvider.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = { coupon: number; bundle: number; member: number; freeGift: number; compare: number; exchangePurchase: number }\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: { bundle?: BundleListItem; gift?: ProductVariant; exchange?: ProductVariant }\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<{ bundle?: BundleListItem; gift?: ProductVariant, exchange?: ProductVariant }>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemptionAmount?: number\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderAffirm?: React.ReactNode\n renderKlarna?: React.ReactNode\n renderPaypal?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n}: PropsWithChildren<\n Omit<\n ProductContextType,\n | 'joinedRecommendBuyProducts'\n | 'setJoinedRecommendBuyProducts'\n >\n>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n }>({\n bundle: undefined,\n gift: undefined,\n })\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
|
|
5
|
+
"mappings": "AAiNI,cAAAA,MAAA,oBAjNJ,OACE,iBAAAC,EAEA,cAAAC,EAIA,YAAAC,MACK,QAqIA,MAAMC,EAAoBH,EAAkC,CAAC,CAAuB,EAE9EI,EAAuB,IAAM,CAExC,GAAI,CADYH,EAAWE,CAAiB,EAE1C,MAAM,IAAI,MAAM,qDAAqD,EAEvE,OAAOF,EAAWE,CAAiB,CACrC,EAEME,EAAkB,CAAC,CACvB,QAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,wBAAAC,EACA,2BAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,wBAAAC,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,CACF,IAMM,CACJ,KAAM,CAACC,EAA4BC,CAA6B,EAAI9C,EAGjE,CACD,OAAQ,OACR,KAAM,MACR,CAAC,EAED,OACEH,EAACI,EAAkB,SAAlB,CACC,MAAO,CACL,QAAAG,EACA,QAAAgB,EACA,SAAAb,EACA,UAAAC,EACA,QAAAH,EACA,QAAAC,EACA,OAAAkB,EACA,aAAAd,EACA,WAAAe,EACA,aAAAC,EACA,aAAAE,EACA,gBAAAC,EACA,aAAAF,EACA,gBAAAN,EACA,mBAAAC,EACA,SAAAX,EACA,iBAAAC,EACA,YAAAG,EACA,eAAAE,EACA,cAAAH,EACA,iBAAAE,EACA,OAAAH,EACA,YAAAU,EACA,iBAAAO,EACA,YAAAC,EACA,SAAAC,EACA,2BAAAa,EACA,8BAAAC,EACA,wBAAA5B,EACA,2BAAAC,EACA,wBAAAc,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,CACF,EAEC,SAAAnC,EACH,CAEJ,EAEA,IAAOsC,EAAQ5C",
|
|
6
|
+
"names": ["jsx", "createContext", "useContext", "useState", "BizProductContext", "useBizProductContext", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemptionAmount", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderAffirm", "renderKlarna", "renderPaypal", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "BizProductProvider_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Button as p,Text as l}from"../../../../components/index.js";import{useAiuiContext as x}from"../../../AiuiProvider/index.js";import{cn as d}from"../../../../helpers/index.js";const c=i=>{const{className:n,setOpenShippingPolicyModal:o,metafields:s}=i,{trackingData:r}=x(),a=r?.common?.copywriting;return t("div",{tabIndex:-1,className:d("from-4.29% to-101.05% relative items-start gap-[16px] overflow-hidden rounded-xl laptop:rounded-2xl bg-gradient-to-r from-[rgba(215,245,254,0.24)] to-[rgba(215,245,254,0.80)] p-4 laptop:py-3 text-[#1F2021] md:py-[16px]","flex flex-col",n),children:[t("div",{className:"flex w-full items-start justify-between",children:[t("div",{className:"flex flex-col gap-3 laptop:gap-2 lg-desktop:gap-4",children:[e(l,{size:2,className:"text-[14px] laptop:text-[16px] lg-desktop:text-[18px]",children:"Learn about Express Shipping Policy"}),e(l,{size:1,as:"p",className:"text-[12px] text-[#6D6D6F] laptop:text-[14px]",children:s?.loginBeforeCheckoutNote})]}),e(p,{variant:"link",className:"hidden !p-0 whitespace-nowrap laptop:inline-flex",onClick:()=>{o(!0)},children:a?.learnMore})]}),e(p,{variant:"link",className:"inline-flex p-0 laptop:hidden",onClick:()=>{o(!0)},children:a?.learnMore})]})};var u=c;export{u as default};
|
|
2
|
+
//# sourceMappingURL=LearnMore.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/LearnMore.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Text } from '../../../../components/index.js'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { cn } from '../../../../helpers/index.js'\n\nconst LearnMore = (props: any) => {\n const { className, setOpenShippingPolicyModal, metafields } = props\n const { trackingData } = useAiuiContext()\n const shopCommon = trackingData?.common?.copywriting\n\n return (\n <div\n tabIndex={-1}\n className={cn(\n 'from-4.29% to-101.05% relative items-start gap-[16px] overflow-hidden rounded-xl laptop:rounded-2xl bg-gradient-to-r from-[rgba(215,245,254,0.24)] to-[rgba(215,245,254,0.80)] p-4 laptop:py-3 text-[#1F2021] md:py-[16px]',\n 'flex flex-col',\n className\n )}\n >\n <div className=\"flex w-full items-start justify-between\">\n <div className=\"flex flex-col gap-3 laptop:gap-2 lg-desktop:gap-4\">\n <Text size={2} className=\"text-[14px] laptop:text-[16px] lg-desktop:text-[18px]\">\n Learn about Express Shipping Policy\n </Text>\n <Text size={1} as=\"p\" className=\"text-[12px] text-[#6D6D6F] laptop:text-[14px]\">\n {metafields?.loginBeforeCheckoutNote}\n </Text>\n </div>\n <Button\n variant=\"link\"\n className=\"hidden !p-0 whitespace-nowrap laptop:inline-flex\"\n onClick={() => {\n setOpenShippingPolicyModal(true)\n }}\n >\n {shopCommon?.learnMore}\n </Button>\n </div>\n\n <Button\n variant=\"link\"\n className=\"inline-flex p-0 laptop:hidden\"\n onClick={() => {\n setOpenShippingPolicyModal(true)\n }}\n >\n {shopCommon?.learnMore}\n </Button>\n </div>\n )\n}\n\nexport default LearnMore\n"],
|
|
5
|
+
"mappings": "AAmBQ,OACE,OAAAA,EADF,QAAAC,MAAA,oBAnBR,OAAS,UAAAC,EAAQ,QAAAC,MAAY,kCAC7B,OAAS,kBAAAC,MAAsB,iCAC/B,OAAS,MAAAC,MAAU,+BAEnB,MAAMC,EAAaC,GAAe,CAChC,KAAM,CAAE,UAAAC,EAAW,2BAAAC,EAA4B,WAAAC,CAAW,EAAIH,EACxD,CAAE,aAAAI,CAAa,EAAIP,EAAe,EAClCQ,EAAaD,GAAc,QAAQ,YAEzC,OACEV,EAAC,OACC,SAAU,GACV,UAAWI,EACT,6NACA,gBACAG,CACF,EAEA,UAAAP,EAAC,OAAI,UAAU,0CACb,UAAAA,EAAC,OAAI,UAAU,oDACb,UAAAD,EAACG,EAAA,CAAK,KAAM,EAAG,UAAU,wDAAwD,+CAEjF,EACAH,EAACG,EAAA,CAAK,KAAM,EAAG,GAAG,IAAI,UAAU,gDAC7B,SAAAO,GAAY,wBACf,GACF,EACAV,EAACE,EAAA,CACC,QAAQ,OACR,UAAU,mDACV,QAAS,IAAM,CACbO,EAA2B,EAAI,CACjC,EAEC,SAAAG,GAAY,UACf,GACF,EAEAZ,EAACE,EAAA,CACC,QAAQ,OACR,UAAU,gCACV,QAAS,IAAM,CACbO,EAA2B,EAAI,CACjC,EAEC,SAAAG,GAAY,UACf,GACF,CAEJ,EAEA,IAAOC,EAAQP",
|
|
6
|
+
"names": ["jsx", "jsxs", "Button", "Text", "useAiuiContext", "cn", "LearnMore", "props", "className", "setOpenShippingPolicyModal", "metafields", "trackingData", "shopCommon", "LearnMore_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const ShippingMethod: ({ item, index, active, toggleShipping, currencyCode, metafields, className, }: {
|
|
2
|
+
item: any;
|
|
3
|
+
index: number;
|
|
4
|
+
active: boolean;
|
|
5
|
+
toggleShipping: (item: any, index: number) => void;
|
|
6
|
+
currencyCode: string;
|
|
7
|
+
metafields: any;
|
|
8
|
+
className?: string;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default ShippingMethod;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o,jsxs as l}from"react/jsx-runtime";import{formatPrice as u}from"../../utils/index.js";import{useAiuiContext as f}from"../../../AiuiProvider/index.js";import{Text as r}from"../../../../components/index.js";import{cn as t}from"../../../../helpers/index.js";import{ShippingMethodMode as g}from"./type.js";const v=({item:e,index:p,active:d,toggleShipping:a,currencyCode:i,metafields:x,className:s=""})=>{const{trackingData:m,locale:c="us"}=f(),b=m?.common?.copywriting;return l("div",{role:"button",tabIndex:0,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&a(e,p)},className:t("relative flex cursor-pointer items-center gap-[16px] overflow-hidden rounded-xl laptop:rounded-2xl border-[2px] border-[#E8E8E8] p-4 laptop:py-3 text-[#1F2021]",{"cursor-not-allowed opacity-60":e.disabled,"border-brand":d},s),onClick:()=>a(e,p),children:[l("div",{className:"relative",children:[o(r,{className:t("text-[14px] font-bold leading-[1.4] laptop:text-[16px] lg-desktop:text-[18px]",{}),as:"p",html:e.title}),o(r,{className:t("mt-[8px] text-[12px] font-bold leading-[1.4] text-[#6D6D6F] laptop:text-[14px]",{}),as:"p",html:e.subtitle})]}),o(r,{className:t("relative text-xl font-bold",{}),as:"p",html:e.price?u({amount:e.price,currencyCode:i,locale:c,removeTrailingZeros:!0}):b?.free}),e.mode!==g.FREE&&o("div",{className:t("absolute -right-[1px] -top-[1px] rounded-bl-[8px] rounded-tr-[8px] bg-brand px-[8px] py-[3px] text-[12px] font-bold leading-[1.4] text-white"),children:x?.memberOnly})]})};var w=v;export{w as default};
|
|
2
|
+
//# sourceMappingURL=ShippingMethod.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/ShippingMethod.tsx"],
|
|
4
|
+
"sourcesContent": ["import { formatPrice } from '../../utils/index.js'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { Text } from '../../../../components/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ShippingMethodMode } from './type.js'\n\nconst ShippingMethod = ({\n item,\n index,\n active,\n toggleShipping,\n currencyCode,\n metafields,\n className = '',\n}: {\n item: any\n index: number\n active: boolean\n toggleShipping: (item: any, index: number) => void\n currencyCode: string\n metafields: any\n className?: string\n}) => {\n const { trackingData, locale = 'us' } = useAiuiContext()\n const shopCommon = trackingData?.common?.copywriting\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n toggleShipping(item, index)\n }\n }}\n className={cn(\n 'relative flex cursor-pointer items-center gap-[16px] overflow-hidden rounded-xl laptop:rounded-2xl border-[2px] border-[#E8E8E8] p-4 laptop:py-3 text-[#1F2021]',\n {\n 'cursor-not-allowed opacity-60': item.disabled,\n 'border-brand': active,\n },\n className\n )}\n onClick={() => toggleShipping(item, index)}\n >\n <div className=\"relative\">\n <Text\n className={cn('text-[14px] font-bold leading-[1.4] laptop:text-[16px] lg-desktop:text-[18px]', {})}\n as=\"p\"\n html={item.title}\n />\n <Text\n className={cn('mt-[8px] text-[12px] font-bold leading-[1.4] text-[#6D6D6F] laptop:text-[14px]', {})}\n as=\"p\"\n html={item.subtitle}\n />\n </div>\n\n <Text\n className={cn('relative text-xl font-bold', {})}\n as=\"p\"\n html={\n item.price\n ? formatPrice({\n amount: item.price,\n currencyCode,\n locale,\n removeTrailingZeros: true,\n })\n : shopCommon?.free\n }\n />\n {item.mode !== ShippingMethodMode.FREE && (\n <div\n className={cn(\n 'absolute -right-[1px] -top-[1px] rounded-bl-[8px] rounded-tr-[8px] bg-brand px-[8px] py-[3px] text-[12px] font-bold leading-[1.4] text-white'\n )}\n >\n {metafields?.memberOnly}\n </div>\n )}\n </div>\n )\n}\n\nexport default ShippingMethod"],
|
|
5
|
+
"mappings": "AA6CM,OACE,OAAAA,EADF,QAAAC,MAAA,oBA7CN,OAAS,eAAAC,MAAmB,uBAC5B,OAAS,kBAAAC,MAAsB,iCAC/B,OAAS,QAAAC,MAAY,kCACrB,OAAS,MAAAC,MAAU,+BACnB,OAAS,sBAAAC,MAA0B,YAEnC,MAAMC,EAAiB,CAAC,CACtB,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,eAAAC,EACA,aAAAC,EACA,WAAAC,EACA,UAAAC,EAAY,EACd,IAQM,CACJ,KAAM,CAAE,aAAAC,EAAc,OAAAC,EAAS,IAAK,EAAIb,EAAe,EACjDc,EAAaF,GAAc,QAAQ,YAEzC,OACEd,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWiB,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCP,EAAeH,EAAMC,CAAK,CAE9B,EACA,UAAWJ,EACT,kKACA,CACE,gCAAiCG,EAAK,SACtC,eAAgBE,CAClB,EACAI,CACF,EACA,QAAS,IAAMH,EAAeH,EAAMC,CAAK,EAEzC,UAAAR,EAAC,OAAI,UAAU,WACb,UAAAD,EAACI,EAAA,CACC,UAAWC,EAAG,gFAAiF,CAAC,CAAC,EACjG,GAAG,IACH,KAAMG,EAAK,MACb,EACAR,EAACI,EAAA,CACC,UAAWC,EAAG,iFAAkF,CAAC,CAAC,EAClG,GAAG,IACH,KAAMG,EAAK,SACb,GACF,EAEAR,EAACI,EAAA,CACC,UAAWC,EAAG,6BAA8B,CAAC,CAAC,EAC9C,GAAG,IACH,KACEG,EAAK,MACDN,EAAY,CACV,OAAQM,EAAK,MACb,aAAAI,EACA,OAAAI,EACA,oBAAqB,EACvB,CAAC,EACDC,GAAY,KAEpB,EACCT,EAAK,OAASF,EAAmB,MAChCN,EAAC,OACC,UAAWK,EACT,8IACF,EAEC,SAAAQ,GAAY,WACf,GAEJ,CAEJ,EAEA,IAAOM,EAAQZ",
|
|
6
|
+
"names": ["jsx", "jsxs", "formatPrice", "useAiuiContext", "Text", "cn", "ShippingMethodMode", "ShippingMethod", "item", "index", "active", "toggleShipping", "currencyCode", "metafields", "className", "trackingData", "locale", "shopCommon", "e", "ShippingMethod_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface Terms {
|
|
2
|
+
text: string;
|
|
3
|
+
url: string;
|
|
4
|
+
}
|
|
5
|
+
interface List {
|
|
6
|
+
title: string;
|
|
7
|
+
list: string[];
|
|
8
|
+
}
|
|
9
|
+
interface ShippingService {
|
|
10
|
+
title: string;
|
|
11
|
+
list: List[];
|
|
12
|
+
}
|
|
13
|
+
interface Data {
|
|
14
|
+
title: string;
|
|
15
|
+
shippingCoupon: List;
|
|
16
|
+
shippingService: ShippingService;
|
|
17
|
+
terms: Terms;
|
|
18
|
+
}
|
|
19
|
+
interface Props {
|
|
20
|
+
data: Data;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
open: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const ShippingPolicyModal: ({ data, onClose, open }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Text as l,Link as x}from"../../../../components/index.js";import{Dialog as d,DialogContent as c}from"../../../../components/dialog";import{useRouter as f}from"next/router";import{useMemo as v}from"react";const S=({data:t,onClose:a,open:n})=>{const{asPath:o}=f(),r=v(()=>o?.split("?")?.[0]?.substring(1)?.replace(/\//g,"_"),[o]);return e(d,{open:n,onOpenChange:a,children:i(c,{overlayClassName:"z-[70]",className:"tablet:max-w-[729px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden",children:[e(l,{className:"text-[32px] font-bold leading-[1.2] md:text-[20px]",html:t?.title}),i("div",{className:"mt-[16px]",children:[e(l,{className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:t?.shippingCoupon?.title}),e("ul",{className:"mt-3 grid grid-flow-row gap-[4px] font-semibold leading-[1.4]",children:t?.shippingCoupon?.list.map((s,p)=>i("li",{className:"text-[16px]",children:[i("span",{children:[p+1,"."]}),e("span",{className:"ml-[4px]",children:s})]},p))}),i("div",{className:"mt-[24px] md:mt-[16px]",children:[e(l,{className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:t?.shippingService?.title}),e("div",{className:"mt-[12px] grid w-full grid-cols-2 gap-[12px] md:grid-cols-1",children:t?.shippingService?.list.map((s,p)=>i("div",{className:"rounded-[12px] bg-[#F5F5F7] p-[16px] md:p-[12px]",children:[e(l,{as:"p",className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:s.title}),e("div",{className:"mt-[12px] grid grid-flow-row gap-[4px]",children:s.list.map((m,g)=>e(l,{as:"p",className:"text-[16px] font-semibold leading-[1.2]",children:m},g))})]},p))})]}),e(x,{className:"mt-[16px] block text-[16px] font-semibold leading-[1.2] underline",href:`${t?.terms?.url}?ref=${r}`,children:t?.terms?.text})]})]})})};export{S as ShippingPolicyModal};
|
|
2
|
+
//# sourceMappingURL=ShippingPolicyModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, Link } from '../../../../components/index.js'\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '../../../../components/dialog'\nimport { useRouter } from 'next/router'\nimport { useMemo } from 'react'\n\ninterface Terms {\n text: string\n url: string\n}\n\ninterface List {\n title: string\n list: string[]\n}\n\ninterface ShippingService {\n title: string\n list: List[]\n}\n\ninterface Data {\n title: string\n shippingCoupon: List\n shippingService: ShippingService\n terms: Terms\n}\n\ninterface Props {\n data: Data\n onClose: () => void\n open: boolean\n}\n\nexport const ShippingPolicyModal = ({ data, onClose, open }: Props) => {\n const { asPath } = useRouter()\n const ref = useMemo(() => {\n return asPath?.split('?')?.[0]?.substring(1)?.replace(/\\//g, '_')\n }, [asPath])\n return (\n <Dialog open={open} onOpenChange={onClose}>\n <DialogContent overlayClassName=\"z-[70]\" className=\"tablet:max-w-[729px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden\">\n <Text className=\"text-[32px] font-bold leading-[1.2] md:text-[20px]\" html={data?.title} />\n <div className=\"mt-[16px]\">\n <Text className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={data?.shippingCoupon?.title} />\n <ul className=\"mt-3 grid grid-flow-row gap-[4px] font-semibold leading-[1.4]\">\n {data?.shippingCoupon?.list.map((item, index) => (\n <li className=\"text-[16px]\" key={index}>\n <span>{index + 1}.</span>\n <span className=\"ml-[4px]\">{item}</span>\n </li>\n ))}\n </ul>\n <div className=\"mt-[24px] md:mt-[16px]\">\n <Text className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={data?.shippingService?.title} />\n <div className=\"mt-[12px] grid w-full grid-cols-2 gap-[12px] md:grid-cols-1\">\n {data?.shippingService?.list.map((item, index) => (\n <div className=\"rounded-[12px] bg-[#F5F5F7] p-[16px] md:p-[12px]\" key={index}>\n <Text as=\"p\" className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={item.title} />\n <div className=\"mt-[12px] grid grid-flow-row gap-[4px]\">\n {item.list.map((subItem, subIndex) => (\n <Text as=\"p\" className=\"text-[16px] font-semibold leading-[1.2]\" key={subIndex}>\n {subItem}\n </Text>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n\n <Link\n className=\"mt-[16px] block text-[16px] font-semibold leading-[1.2] underline\"\n href={`${data?.terms?.url}?ref=${ref}`}\n >\n {data?.terms?.text}\n </Link>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAyCQ,cAAAA,EAMQ,QAAAC,MANR,oBAzCR,OAAS,QAAAC,EAAM,QAAAC,MAAY,kCAC3B,OAAS,UAAAC,EAAQ,iBAAAC,MAA+D,gCAChF,OAAS,aAAAC,MAAiB,cAC1B,OAAS,WAAAC,MAAe,QA8BjB,MAAM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,GAAGM,GAAM,OAAO,GAAG,QAAQI,CAAG,GAEnC,SAAAJ,GAAM,OAAO,KAChB,GACF,GACF,EACF,CAEJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "Link", "Dialog", "DialogContent", "useRouter", "useMemo", "ShippingPolicyModal", "data", "onClose", "open", "asPath", "ref", "item", "index", "subItem", "subIndex"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Product, ProductVariant } from '../../types/product';
|
|
2
|
+
import type { DeliveryCustom } from './type';
|
|
3
|
+
declare const PaidShipping: ({ metafields, productList, onShippingInfoChange, variant, className, }: {
|
|
4
|
+
metafields: any;
|
|
5
|
+
productList: Array<Product & {
|
|
6
|
+
variant: ProductVariant;
|
|
7
|
+
}>;
|
|
8
|
+
variant: ProductVariant;
|
|
9
|
+
onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default PaidShipping;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o,jsxs as T}from"react/jsx-runtime";import{Text as c}from"../../../../components/index.js";import{useCallback as h,useEffect as O,useMemo as b,useState as g}from"react";import{cn as z}from"../../../../helpers";import D from"./ShippingMethod";import{ShippingPolicyModal as E}from"./ShippingPolicyModal";import{isWeightAvailable as v}from"./utils";import I from"./LearnMore";import{useBizProductContext as L}from"../../BizProductProvider.js";const V=({metafields:i,productList:m,onShippingInfoChange:u,variant:y,className:P})=>{const{isLogin:_,openSignInPopup:w}=L(),[C,x]=g(!1),[M,k]=g(!1),[N,S]=g(null),f=b(()=>m.reduce((e,p)=>e+(p?.variant?.weight||0),0),[m]),r=h((e,p,n)=>({id:`${e.__code}__${e.price}`,code:e.__code,mode:e.__mode,title:e.title,disabled:!v(p,e),price:e.price,subtitle:e.subtitle,tag:n!==0?i?.memberOnly:"",error:v(p,e)?"":i.overWeightError}),[i?.memberOnly,i.overWeightError]),l=b(()=>{const e=i?.list?.map((p,n)=>r(p,f,n));return e?.reduce((p,n)=>{const d=e.filter(t=>t.code==n.code);let s;return d.every(t=>t.disabled)?s=d[d.length-1]:s=d.find(t=>!t.disabled),p.find(t=>s.id===t.id)?p:[...p,s]},[])},[r,i?.list,f]),a=h(e=>{u({selected_delivery_code:e.code,selected_delivery_mode:e.mode})},[u]);O(()=>{if(i?.list?.length>0&&!M){const e=r(i?.list[0],0,0);S(e),a(e),k(!0)}},[r,i?.list,a,M]);const A=h(e=>{e.disabled||(S(e),a(e))},[_,l,y.sku,a,w]);return T("div",{id:"ipc-product-paid-shipping",className:z(" mt-8 desktop:mt-16 px-4 tablet:px-0 tablet:px-8 laptop:px-16 desktop:px-0",P),children:[o("div",{className:"flex flex-wrap justify-between space-x-2 md:space-x-1",children:o(c,{className:"text-[20px] font-bold leading-[1.4] text-[#1F2021] md:text-[16px]",html:i?.title})}),T("div",{className:"mt-[16px] flex flex-wrap gap-[12px] overflow-hidden md:mt-[12px] desktop:flex-nowrap",children:[l.map((e,p)=>o(D,{index:p,item:e,active:N?.code===e.code,toggleShipping:()=>A(e),currencyCode:y.price.currencyCode,metafields:i,className:"w-full laptop:w-[calc(50%-6px)] desktop:flex-1"},p)),o(I,{setOpenShippingPolicyModal:x,metafields:i,className:"w-full laptop:w-[calc(50%-6px)] desktop:w-[calc(33.33%-16px)] lg-desktop:w-[calc(33.33%-24px)]"})]}),l.find(e=>e?.error)&&o(c,{className:"mt-[16px] font-bold leading-[1.4] text-[#D41435] md:mt-[12px]",html:l.find(e=>e.error)?.error,as:"p"}),i?.seeAvailableArea&&o(c,{as:"div",className:"mt-[16px] font-bold leading-[1.4] text-[#1F2021] [&_a]:text-[#595959] [&_a]:underline",html:i?.seeAvailableArea}),i?.shippingPolicy&&o(E,{data:i?.shippingPolicy,onClose:()=>x(!1),open:C})]})};var Q=V;export{Q as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Container, Text } from '../../../../components/index.js'\nimport type { Product, ProductVariant } from '../../types/product'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { cn } from '../../../../helpers'\n\nimport ShippingMethod from './ShippingMethod'\nimport { ShippingPolicyModal } from './ShippingPolicyModal'\nimport type { DeliveryCustom, shippingMetafields, ShippingMethodType } from './type'\nimport { isWeightAvailable } from './utils'\nimport LearnMore from './LearnMore'\nimport { useBizProductContext } from '../../BizProductProvider.js'\n\nconst PaidShipping = ({\n metafields,\n productList,\n onShippingInfoChange,\n variant,\n className,\n}: {\n metafields: any\n productList: Array<Product & { variant: ProductVariant }>\n variant: ProductVariant\n onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void\n className?: string\n}) => {\n const { isLogin, openSignInPopup } = useBizProductContext()\n const [openShippingPolicyModal, setOpenShippingPolicyModal] = useState(false)\n const [init, setInit] = useState(false)\n\n const [selectedMethod, setSelectedMethod] = useState<ShippingMethodType | null>(null)\n\n const weight = useMemo(() => {\n return productList.reduce((acc, product) => acc + (product?.variant?.weight || 0), 0)\n }, [productList])\n\n const normalizedMethod = useCallback(\n (method: shippingMetafields, weight: number, index: number) => {\n return {\n id: `${method.__code}__${method.price}`,\n code: method.__code,\n mode: method.__mode,\n title: method.title,\n disabled: !isWeightAvailable(weight, method),\n price: method.price,\n subtitle: method.subtitle,\n tag: index !== 0 ? metafields?.memberOnly : '',\n error: !isWeightAvailable(weight, method) ? metafields.overWeightError : '',\n }\n },\n [metafields?.memberOnly, metafields.overWeightError],\n )\n\n const list = useMemo(() => {\n const normalizedList: ShippingMethodType[] = metafields?.list?.map((method: shippingMetafields, index: number) => normalizedMethod(method, weight, index))\n\n return normalizedList?.reduce((prev: ShippingMethodType[], method: ShippingMethodType) => {\n // \u5982\u679C\u8D85\u91CD\uFF0C\u540C\u4E00\u4E2A\u7269\u6D41\u9009\u9879\u7C7B\u578B\u4E0B\uFF0C\u5C55\u793A\u5176\u4E2D\u4E00\u4E2A\u4E14\u4E0D\u53EF\u9009\n const sameTypeMethod = normalizedList.filter((m: ShippingMethodType) => m.code == method.code)\n let availableMethod: ShippingMethodType\n // \u6240\u6709\u7269\u6D41\u9009\u9879\u90FD\u4E0D\u53EF\u9009\n if (sameTypeMethod.every((m: ShippingMethodType) => m.disabled)) {\n availableMethod = sameTypeMethod[sameTypeMethod.length - 1]\n } else {\n // \u53EF\u9009\u7269\u6D41\u9009\u9879\n availableMethod = sameTypeMethod.find((m: ShippingMethodType) => !m.disabled)!\n }\n // \u5F53\u524D\u7269\u6D41\u9009\u9879\u5DF2\u5B58\u5728\n const hasSameMethod = prev.find((m: ShippingMethodType) => availableMethod.id === m.id)\n if (!hasSameMethod) {\n return [...prev, availableMethod]\n } else {\n return prev\n }\n }, [] as ShippingMethodType[])\n }, [normalizedMethod, metafields?.list, weight])\n\n const handleChangeShippingInfo = useCallback(\n (selectedMethod: ShippingMethodType) => {\n onShippingInfoChange({\n selected_delivery_code: selectedMethod.code,\n selected_delivery_mode: selectedMethod.mode,\n })\n },\n [onShippingInfoChange],\n )\n\n useEffect(() => {\n // \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u7269\u6D41\u9009\u9879\n if (metafields?.list?.length > 0 && !init) {\n const standardShippingMethod = normalizedMethod(metafields?.list[0], 0, 0)\n setSelectedMethod(standardShippingMethod)\n handleChangeShippingInfo(standardShippingMethod)\n setInit(true)\n }\n }, [normalizedMethod, metafields?.list, handleChangeShippingInfo, init])\n\n const toggleShipping = useCallback(\n (method: ShippingMethodType) => {\n if (method.disabled) {\n return\n }\n setSelectedMethod(method)\n handleChangeShippingInfo(method)\n // gaTrack({\n // event: 'ga4Event',\n // event_name: 'lp_button',\n // member_active_status: isLogin ? 'active' : 'not active', //\u7528\u4E8E\u8F93\u5165code\u6FC0\u6D3B\u4F1A\u5458\u5F39'\u7A97\u7684\u6309\u94AE\uFF0C\u533A\u5206\u4F1A\u5458\u6FC0\u6D3B\u72B6\u6001\uFF0C\u4F20active\u6216not active\n // event_parameters: {\n // page_group: 'Product Detail Page' + variant.sku, //\u5982\u679C\u662F\u9996\u9875\uFF0C\u5219\u4F20\"Home Page\";\u5982\u679C\u662Flisting\u7684\u9996\u5C4F\u6309\u94AE\uFF0C\u4F20Product Detail Page+$SKU\n // position: 'masterbanner1', //\u4F4D\u7F6E\u6807\u8BB0\u3002\u9996\u9875\u9996\u5C4F\u8F6E\u64AD\u4F4D\u7F6E\u4F20masterbanner1\u3001masterbanner2\u3001masterbanner3\uFF0C\u7B2C\u4E8C\u5C4F\u4F202nd_banner\uFF0C\u7B2C\u4E09\u5C4F\u4F203rd_banner\uFF0C\u6216\u8005\u53D6\u8BE5\u6A21\u5757\u5C0F\u6807\u9898\uFF0C\u6216\u80FD\u8BC6\u522B\u51FA\u662F\u54EA\u4E2A\u6A21\u5757\u4F4D\u7F6E\u7684\u6587\u6848\uFF0C\u5F39\u7A97\u4F20pop;\u5982\u679C\u662F\u8D2D\u7269\u8F66\u4FA7\u8FB9\u680F\uFF0C\u5219\u4F20\"Cart Pop Up\"\n // button_name: method.title, //\u53D6\u6309\u94AE\u6587\u6848\uFF0C\u6216\u80FD\u8BC6\u522B\u51FA\u662F\u54EA\u4E2A\u6309\u94AE\u7684\u6587\u6848,\u6BD4\u5982\u53F3\u4E0A\u89D2\u5173\u95ED\u4F20close,\u793E\u5A92\u5206\u4EAB\u56FE\u6807\u4F20\u5BF9\u5E94\u5E73\u53F0\u540D\u5B57\u5982Facebook,\u56FE\u7247\u5207\u6362\u5219\u4F20\u5BF9\u5E94\u5C55\u793A\u56FE\u7247\u7684\u540D\u5B57\n // info: '', //\u9ED8\u8BA4\u7A7A\u503C\uFF0C\u4E00\u822C\u4F20\u590D\u9009\u6846\u7684\u6587\u6848\u5185\u5BB9\uFF0C\u7279\u6B8A\u60C5\u51B5\u53EF\u6307\u5B9Ainfo\u503C\n // },\n // })\n },\n\n [isLogin, list, variant.sku, handleChangeShippingInfo, openSignInPopup],\n )\n\n return (\n <div\n id=\"ipc-product-paid-shipping\"\n className={cn(' mt-8 desktop:mt-16 px-4 tablet:px-0 tablet:px-8 laptop:px-16 desktop:px-0', className)}\n >\n <div className=\"flex flex-wrap justify-between space-x-2 md:space-x-1\">\n <Text\n className=\"text-[20px] font-bold leading-[1.4] text-[#1F2021] md:text-[16px]\"\n html={metafields?.title}\n ></Text>\n {/* <button\n onClick={() => {\n setOpenShippingPolicyModal(true)\n }}\n className='text-brand-color text-[16px] font-semibold text-[#595959] underline md:text-[14px]'\n >\n {metafields?.policy}\n </button> */}\n </div>\n <div className=\"mt-[16px] flex flex-wrap gap-[12px] overflow-hidden md:mt-[12px] desktop:flex-nowrap\">\n {list.map((method: ShippingMethodType, index: number) => (\n <ShippingMethod\n key={index}\n index={index}\n item={method}\n active={selectedMethod?.code === method.code}\n toggleShipping={() => toggleShipping(method)}\n currencyCode={variant.price.currencyCode}\n metafields={metafields}\n className=\"w-full laptop:w-[calc(50%-6px)] desktop:flex-1\"\n />\n ))}\n {/* learn more \u5361\u7247 */}\n <LearnMore\n setOpenShippingPolicyModal={setOpenShippingPolicyModal}\n metafields={metafields}\n className=\"w-full laptop:w-[calc(50%-6px)] desktop:w-[calc(33.33%-16px)] lg-desktop:w-[calc(33.33%-24px)]\"\n />\n </div>\n {list.find((method: ShippingMethodType) => method?.error) && (\n <Text\n className=\"mt-[16px] font-bold leading-[1.4] text-[#D41435] md:mt-[12px]\"\n html={list.find((method: ShippingMethodType) => method.error)?.error as string}\n as=\"p\"\n />\n )}\n\n {metafields?.seeAvailableArea && (\n <Text\n as=\"div\"\n className=\"mt-[16px] font-bold leading-[1.4] text-[#1F2021] [&_a]:text-[#595959] [&_a]:underline\"\n html={metafields?.seeAvailableArea}\n />\n )}\n {metafields?.shippingPolicy && (\n <ShippingPolicyModal\n data={metafields?.shippingPolicy}\n onClose={() => setOpenShippingPolicyModal(false)}\n open={openShippingPolicyModal}\n />\n )}\n </div>\n )\n}\n\nexport default PaidShipping"],
|
|
5
|
+
"mappings": "AA6HQ,cAAAA,EAaF,QAAAC,MAbE,oBA7HR,OAAoB,QAAAC,MAAY,kCAEhC,OAAS,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC1D,OAAS,MAAAC,MAAU,sBAEnB,OAAOC,MAAoB,mBAC3B,OAAS,uBAAAC,MAA2B,wBAEpC,OAAS,qBAAAC,MAAyB,UAClC,OAAOC,MAAe,cACtB,OAAS,wBAAAC,MAA4B,8BAErC,MAAMC,EAAe,CAAC,CACpB,WAAAC,EACA,YAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,UAAAC,CACF,IAMM,CACJ,KAAM,CAAE,QAAAC,EAAS,gBAAAC,CAAgB,EAAIR,EAAqB,EACpD,CAACS,EAAyBC,CAA0B,EAAIhB,EAAS,EAAK,EACtE,CAACiB,EAAMC,CAAO,EAAIlB,EAAS,EAAK,EAEhC,CAACmB,EAAgBC,CAAiB,EAAIpB,EAAoC,IAAI,EAE9EqB,EAAStB,EAAQ,IACdU,EAAY,OAAO,CAACa,EAAKC,IAAYD,GAAOC,GAAS,SAAS,QAAU,GAAI,CAAC,EACnF,CAACd,CAAW,CAAC,EAEVe,EAAmB3B,EACvB,CAAC4B,EAA4BJ,EAAgBK,KACpC,CACL,GAAI,GAAGD,EAAO,MAAM,KAAKA,EAAO,KAAK,GACrC,KAAMA,EAAO,OACb,KAAMA,EAAO,OACb,MAAOA,EAAO,MACd,SAAU,CAACrB,EAAkBiB,EAAQI,CAAM,EAC3C,MAAOA,EAAO,MACd,SAAUA,EAAO,SACjB,IAAKC,IAAU,EAAIlB,GAAY,WAAa,GAC5C,MAAQJ,EAAkBiB,EAAQI,CAAM,EAAiC,GAA7BjB,EAAW,eACzD,GAEF,CAACA,GAAY,WAAYA,EAAW,eAAe,CAC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,CAAS,EAErG,UAAAlB,EAAC,OAAI,UAAU,wDACb,SAAAA,EAACE,EAAA,CACC,UAAU,oEACV,KAAMY,GAAY,MACnB,EASH,EACAb,EAAC,OAAI,UAAU,uFACZ,UAAAgC,EAAK,IAAI,CAACF,EAA4BC,IACrChC,EAACQ,EAAA,CAEC,MAAOwB,EACP,KAAMD,EACN,OAAQN,GAAgB,OAASM,EAAO,KACxC,eAAgB,IAAMU,EAAeV,CAAM,EAC3C,aAAcd,EAAQ,MAAM,aAC5B,WAAYH,EACZ,UAAU,kDAPLkB,CAQP,CACD,EAEDhC,EAACW,EAAA,CACC,2BAA4BW,EAC5B,WAAYR,EACZ,UAAU,iGACZ,GACF,EACCmB,EAAK,KAAMF,GAA+BA,GAAQ,KAAK,GACtD/B,EAACE,EAAA,CACC,UAAU,gEACV,KAAM+B,EAAK,KAAMF,GAA+BA,EAAO,KAAK,GAAG,MAC/D,GAAG,IACL,EAGDjB,GAAY,kBACXd,EAACE,EAAA,CACC,GAAG,MACH,UAAU,wFACV,KAAMY,GAAY,iBACpB,EAEDA,GAAY,gBACXd,EAACS,EAAA,CACC,KAAMK,GAAY,eAClB,QAAS,IAAMQ,EAA2B,EAAK,EAC/C,KAAMD,EACR,GAEJ,CAEJ,EAEA,IAAOqB,EAAQ7B",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "useCallback", "useEffect", "useMemo", "useState", "cn", "ShippingMethod", "ShippingPolicyModal", "isWeightAvailable", "LearnMore", "useBizProductContext", "PaidShipping", "metafields", "productList", "onShippingInfoChange", "variant", "className", "isLogin", "openSignInPopup", "openShippingPolicyModal", "setOpenShippingPolicyModal", "init", "setInit", "selectedMethod", "setSelectedMethod", "weight", "acc", "product", "normalizedMethod", "method", "index", "list", "normalizedList", "prev", "sameTypeMethod", "m", "availableMethod", "handleChangeShippingInfo", "standardShippingMethod", "toggleShipping", "PaidShipping_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum ShippingMethodMode {
|
|
2
|
+
FREE = "free",
|
|
3
|
+
TDD = "tdd",
|
|
4
|
+
NDD = "ndd"
|
|
5
|
+
}
|
|
6
|
+
export type shippingMetafields = {
|
|
7
|
+
__mode: ShippingMethodMode;
|
|
8
|
+
__code: string;
|
|
9
|
+
title: string;
|
|
10
|
+
subtitle: string;
|
|
11
|
+
price: number;
|
|
12
|
+
weight_low?: number | null;
|
|
13
|
+
weight_high?: number | null;
|
|
14
|
+
__plus?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type ShippingMethodType = {
|
|
17
|
+
error: unknown;
|
|
18
|
+
code: string;
|
|
19
|
+
mode: ShippingMethodMode;
|
|
20
|
+
title: string;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
tag: string;
|
|
23
|
+
price: number;
|
|
24
|
+
subtitle: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
export type DeliveryCustom = {
|
|
28
|
+
selected_delivery_code?: string;
|
|
29
|
+
selected_delivery_mode?: ShippingMethodMode;
|
|
30
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/type.ts"],
|
|
4
|
+
"sourcesContent": ["export enum ShippingMethodMode {\n FREE = 'free',\n TDD = 'tdd',\n NDD = 'ndd',\n}\n\nexport type shippingMetafields = {\n __mode: ShippingMethodMode\n __code: string\n title: string\n subtitle: string\n price: number\n weight_low?: number | null\n weight_high?: number | null\n __plus?: boolean\n}\n\nexport type ShippingMethodType = {\n error: unknown\n code: string\n mode: ShippingMethodMode\n title: string\n disabled: boolean\n tag: string\n price: number\n subtitle: string\n id: string\n}\n\nexport type DeliveryCustom = {\n selected_delivery_code?: string\n selected_delivery_mode?: ShippingMethodMode\n}\n"],
|
|
5
|
+
"mappings": "AAAO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,IAAM,MAHIA,OAAA",
|
|
6
|
+
"names": ["ShippingMethodMode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/utils.ts"],
|
|
4
|
+
"sourcesContent": ["import type { shippingMetafields } from './type.js'\n\nexport const isWeightAvailable = (weight: number, method: shippingMetafields) => {\n if (method.weight_high && method.weight_low) {\n return weight >= method.weight_low && weight <= method.weight_high\n } else if (method.weight_high && !method.weight_low) {\n return weight <= method.weight_high\n } else if (method.weight_low && !method.weight_high) {\n return weight >= method.weight_low\n } else {\n return true\n }\n}\n"],
|
|
5
|
+
"mappings": "AAEO,MAAMA,EAAoB,CAACC,EAAgBC,IAC5CA,EAAO,aAAeA,EAAO,WACxBD,GAAUC,EAAO,YAAcD,GAAUC,EAAO,YAC9CA,EAAO,aAAe,CAACA,EAAO,WAChCD,GAAUC,EAAO,YACfA,EAAO,YAAc,CAACA,EAAO,YAC/BD,GAAUC,EAAO,WAEjB",
|
|
6
|
+
"names": ["isWeightAvailable", "weight", "method"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BenefitsTabTextConfig {
|
|
3
|
+
couponCode?: string;
|
|
4
|
+
copyCode?: string;
|
|
5
|
+
copied?: string;
|
|
6
|
+
expired?: string;
|
|
7
|
+
offCoupon?: string;
|
|
8
|
+
offMemberOnly?: string;
|
|
9
|
+
loginNow?: string;
|
|
10
|
+
selectFreeGift?: string;
|
|
11
|
+
bundleSaveUpTo?: string;
|
|
12
|
+
bundleOffer?: string;
|
|
13
|
+
creditsTitle?: string;
|
|
14
|
+
creditsDesc?: string;
|
|
15
|
+
yourBenefits?: string;
|
|
16
|
+
off?: string;
|
|
17
|
+
memberBenefits?: string;
|
|
18
|
+
memberBenefitsNotLogin?: string;
|
|
19
|
+
installment?: string;
|
|
20
|
+
forNewMember?: string;
|
|
21
|
+
expressShipping?: string;
|
|
22
|
+
creditsAfterActivation?: string;
|
|
23
|
+
active?: string;
|
|
24
|
+
flexibleInstallment?: string;
|
|
25
|
+
}
|
|
26
|
+
export type ModalData = {
|
|
27
|
+
needClickAway?: boolean;
|
|
28
|
+
className?: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
content?: string;
|
|
31
|
+
domContent?: React.ReactNode;
|
|
32
|
+
};
|
|
33
|
+
interface BenefitsTabProps {
|
|
34
|
+
textConfig?: BenefitsTabTextConfig;
|
|
35
|
+
}
|
|
36
|
+
declare const BenefitsTab: ({ textConfig }: BenefitsTabProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
37
|
+
export default BenefitsTab;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{Fragment as y,jsx as e,jsxs as i}from"react/jsx-runtime";import{Button as Q,Checkbox as X,Text as p,Picture as H,Heading as ee}from"../../../../../components/index.js";import c from"./ProductBenefitsTabs/index.js";import{useBizProductContext as R}from"../../../BizProductProvider.js";import{useBenefits as te}from"../../../hooks/useBenefits";import{formatPrice as g}from"../../../utils/index.js";import{replaceTemplate as A}from"../../../utils/textFormat";import $ from"classnames";import{useRef as oe,useState as ne}from"react";import{useAiuiContext as V}from"../../../../AiuiProvider/index.js";import ie from"../../../../../hooks/useCountDown.js";import se from"../../../hooks/useCopy";import{cn as I}from"../../../../../helpers/index.js";const re={couponCode:"Code",copyCode:"Copy Code",copied:"Copied",expired:"Expired",offCoupon:"{discount} off coupon",offMemberOnly:"{amount} off Member Only",loginNow:"Login now",selectFreeGift:"You can select the free gift below.",bundleSaveUpTo:"Bundle purchases save extra up to",bundleOffer:"We offer {count} bundle for you",creditsTitle:"Soundcore credits for cash",creditsDesc:"100 Soundcore credits=$1",yourBenefits:"Your Benefits",off:" off",memberBenefits:"Member Benefits",memberBenefitsNotLogin:"You will enjoy a {amount} member discount after logging in.",installment:"Installment",forNewMember:"{amount} for New Member",expressShipping:"Express Shipping Method",creditsAfterActivation:"You will get soundcoreCredits after activation. ",active:"Active",flexibleInstallment:"Flexible installment payment "},le=({item:t,textConfig:s})=>{const{trackingData:m}=V(),{copied:r,copy:b}=se(),l=m?.common?.coupon,{days:C,hours:N,minutes:T,seconds:w}=ie({endTime:t?.ends_at||""}),{openModal:B,isLogin:_}=R();return i(y,{children:[e("style",{jsx:!0,children:`
|
|
2
|
+
.coupon-card {
|
|
3
|
+
/* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */
|
|
4
|
+
mask:
|
|
5
|
+
radial-gradient(circle at 0 0, transparent 12px, white 12px),
|
|
6
|
+
radial-gradient(circle at 100% 0, transparent 12px, white 12px),
|
|
7
|
+
radial-gradient(circle at 100% 100%, transparent 12px, white 12px),
|
|
8
|
+
radial-gradient(circle at 0 100%, transparent 12px, white 12px);
|
|
9
|
+
mask-size: 50% 50%;
|
|
10
|
+
mask-position:
|
|
11
|
+
top left,
|
|
12
|
+
top right,
|
|
13
|
+
bottom right,
|
|
14
|
+
bottom left;
|
|
15
|
+
mask-repeat: no-repeat;
|
|
16
|
+
}
|
|
17
|
+
`}),i("div",{style:{background:t.couponBgColor||"white"},className:$("relative h-[100px] overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]",t.borderStyle==="inset"?"coupon-card ":"rounded-[8px]"),children:[t?.bgImage?.url&&e(H,{source:t.bgImage.url,alt:t.bgImage.alt,className:"absolute bottom-0 right-0 w-auto",imgClassName:"object-contain"}),i("div",{className:"relative z-1 p-3",children:[i("div",{className:"flex items-center justify-start",children:[t.useAble&&e(X,{size:"lg",className:"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary",checked:t?.isAutoUse,onCheckedChange:x=>{t?.onUseChange?.(x)}}),e(p,{html:t.title,className:"text-[16px] font-bold laptop:text-[20px] lg-desktop:text-[24px]"})]}),e(p,{...typeof t.description=="string"?{html:t.description}:{},as:"p",className:"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]",children:t.description}),t.code&&i("div",{className:"last:mt-2 flex items-center gap-2",children:[e(p,{html:`${s.couponCode}: ${t.code}`,className:"text-base font-bold text-[#3D3D3F]"}),e("button",{className:"text-base font-bold underline",onClick:()=>b(t.code??""),children:r?l?.copied||s.copied:l?.copy||s.copyCode})]}),t.ends_at&&e("button",{onClick:()=>{l?.modal&&B(l?.modal)},className:"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden",children:Number(C)<Number(l?.hurry?.daysLeft)?i(y,{children:[e("span",{children:l?.ends}),e("span",{className:"font-bold",children:` ${C} ${l?.days} ${N.toString().padStart(2,"0")}:${T.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}`})]}):l?.hurry?.label||s.expired})]})]})]})},ae=({coupons:t,className:s,textConfig:m})=>e("div",{className:$("flex flex-col gap-3 laptop:grid laptop:grid-cols-2 desktop:grid-cols-1",s),children:t?.map((r,b)=>e(le,{item:r,textConfig:m},b))}),ce=({textConfig:t})=>{const{isLogin:s,profile:m,variant:r,renderAffirm:b,renderKlarna:l,renderPaypal:C,onUseCouponChange:N,onUseMemberDiscountChange:T,discount:w,savingDetail:B,openModal:_,openSignInPopup:x,openAuthCodePopup:E,openSignUpPopup:z}=R(),O=te({variant:r}),[k,G]=ne("coupon"),{trackingData:U,locale:f="us",copyWriting:j}=V(),L=oe(null),o={...re,...t},{activated:W=!1}=m||{},{memberDiscount:d,commonCoupon:u,creditsRedemption:h,freeGift:Z,bundle:D,paidShipping:Y,fullGift:M,levelDiscount:S}=O,q=U?.product?.support??{},{thirdParty:pe={}}=U?.common||{},v=[u?.enable?{...u.config,isAutoUse:B?.coupon>0,useAble:!0,borderStyle:"rounded",code:u?.config?.title??"",description:u?.config?.desc??"",onUseChange:n=>{const a=n?w?.codeSavings??0:0;N?.(a)},title:A(o.offCoupon,{discount:u?.config?.value_type=="percentage"?Math.abs(Number(u?.config?.value||0))+"%":g({amount:Math.abs(Number(u?.config?.fixed_value||0)),currencyCode:r.price.currencyCode,locale:f})})}:null,d.enable?{useAble:!0,isAutoUse:s,title:A(o.offMemberOnly,{amount:g({amount:d?.config?.amount??0,currencyCode:r.price.currencyCode,locale:f})}),description:i(y,{children:[s?d?.config?.description??"":o.memberBenefitsNotLogin.replace("{amount}",g({amount:d?.config?.amount??0,currencyCode:r.price.currencyCode,locale:f}))??""," ",s?"":e("span",{role:"button",tabIndex:0,onClick:()=>x?.(),className:"underline",children:o.loginNow})]}),borderStyle:"rounded",onUseChange:n=>{if(s){const a=n?d?.config?.amount??0:0;T?.(a)}else x?.()}}:null,S.enable?{title:S?.config?.title??"",description:S?.config?.tag??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385"}}:null,Z.enable?{title:Z?.config?.title??"",description:o.selectFreeGift,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,D.enable?{title:`${o.bundleSaveUpTo} ${g({amount:Math.max(...D?.config?.bundleList?.map(n=>n.savings??0)??[]),currencyCode:r.price.currencyCode,locale:f})}`,borderStyle:"inset",description:o.bundleOffer.replace("{count}",D?.config?.bundleList?.length?.toString()??""),bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,M.enable?{title:M?.config?.title??"",description:M?.config?.desc??"",borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null,h.enable?{title:o.creditsTitle,description:o.creditsDesc,borderStyle:"inset",bgImage:{url:"https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534"},couponBgColor:"linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF"}:null].filter(Boolean),K=()=>{E?.()};if(!c)return null;const F=n=>{if(L.current){const a=L.current,P=n.currentTarget;console.log("button",P.offsetLeft);const J=P.offsetLeft-a.offsetWidth/2+P.offsetWidth/2;a.scrollTo({left:J,behavior:"smooth"})}};return i(c,{onValueChange:n=>G(n),defaultValue:v?.length?"coupon":"membership",children:[i(c.List,{ref:L,children:[v?.length?e(c.Trigger,{className:I(k==="coupon"&&"text-[#1D1D1F]"),value:"coupon",onClick:F,children:o.yourBenefits}):null,e(c.Trigger,{className:I(k==="membership"&&"text-[#1D1D1F]"),value:"membership",onClick:F,children:o.memberBenefits}),e(c.Trigger,{className:I(k==="installment"&&"text-[#1D1D1F]"),value:"installment",onClick:F,children:o.installment})]}),e("style",{global:!0,jsx:!0,children:`
|
|
18
|
+
.coupon-container::-webkit-scrollbar {
|
|
19
|
+
width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */
|
|
20
|
+
height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.coupon-container::-webkit-scrollbar-track {
|
|
24
|
+
background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.coupon-container::-webkit-scrollbar-thumb {
|
|
28
|
+
background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */
|
|
29
|
+
border-radius: 9999px; /* \u5706\u89D2 */
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.coupon-container::-webkit-scrollbar-thumb:hover {
|
|
33
|
+
background-color: rgba(100, 100, 100, 0.6);
|
|
34
|
+
}
|
|
35
|
+
`}),v?.length?e(c.Content,{value:"coupon",className:"",children:e("div",{className:"coupon-container h-[240px] overflow-y-auto p-3 lg-desktop:p-4",children:e(ae,{coupons:v,className:"",textConfig:o})})}):null,i(c.Content,{value:"membership",className:"",children:[e("h3",{className:"mx-4 mb-2 text-left text-lg font-bold",children:o.memberBenefits}),e("div",{className:`overflow-y-auto rounded-[16px] px-4 ${s?"max-h-[240px]":"max-h-[160px]"}`,children:i("ul",{className:`list-none [&_li:first-child]:rounded-t-[16px]
|
|
36
|
+
[&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2
|
|
37
|
+
[&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4
|
|
38
|
+
[&_li]:py-4
|
|
39
|
+
[&_li]:text-left`,children:[d.enable&&i("li",{children:[e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z",fill:"#1D1D1F"})}),e(p,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:A(o.forNewMember,{amount:g({amount:d?.config?.amount??0,currencyCode:r.price.currencyCode,locale:f})})})]}),q.items?.map((n,a)=>n.modalText?e("li",{children:i("button",{onClick:()=>_?.({title:n.text,content:n.modalText}),className:"flex",children:[e(H,{source:n.icon,alt:n.text,className:"mr-[8px] size-[20px] shrink-0"}),e(p,{className:"text-left text-[16px] font-medium x:text-[14px]",children:n.text})]},a)},a):i("li",{className:"flex",children:[e(H,{source:n.icon,alt:n.text,className:"mr-[8px] size-[20px] shrink-0"}),e(p,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:n.text})]},a)),Y.enable?i("li",{children:[e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M19 3C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H10V16H21C21.5523 16 22 16.4477 22 17C22 17.5523 21.5523 18 21 18H19.9961C19.9961 19.6559 18.6547 21 16.998 21C15.3414 21 14 19.6559 14 18H10C10 19.6568 8.65684 21 7 21C5.34317 21 4 19.6568 4 18H2C1.44772 18 1 17.5523 1 17V10.6738L1.00488 10.5771C1.02632 10.3554 1.12145 10.146 1.27637 9.9834L4.77637 6.31055L4.84961 6.24023C5.02993 6.08586 5.26042 6 5.5 6H8V5C8 3.89544 8.89541 3 10 3H19ZM6.00488 18.1025C6.05622 18.6067 6.48234 19 7 19C7.51766 19 7.94378 18.6067 7.99512 18.1025L8 18H6L6.00488 18.1025ZM16.0049 18.1025C16.0561 18.6074 16.4823 19 16.998 19C17.5138 19 17.94 18.6074 17.9912 18.1025L17.9961 18H16L16.0049 18.1025ZM3 11.0723V16H8V8H5.92773L3 11.0723ZM21.6621 6.8252C22.0348 6.41765 22.6676 6.38902 23.0752 6.76172C23.4827 7.13443 23.5104 7.76725 23.1377 8.1748L18.0518 13.7363C17.6625 14.162 17.003 14.1954 16.5732 13.8105L13.333 10.9092C12.9216 10.5408 12.8865 9.90853 13.2549 9.49707C13.6232 9.08565 14.2555 9.05066 14.667 9.41895L17.208 11.6943L21.6621 6.8252Z",fill:"#1D1D1F"})}),e(p,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:o.expressShipping})]}):null,h.enable?i("li",{children:[e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z",fill:"#1D1D1F"})}),e(p,{as:"p",className:"text-left text-[16px] font-medium x:text-[14px]",children:W?h?.config?.label?.replace("{{amount}}",g({amount:h?.config?.amount??0,currencyCode:r.price.currencyCode,locale:f})):i(y,{children:[o.creditsAfterActivation,e("span",{role:"button",tabIndex:0,onClick:()=>K(),className:"underline",children:o.active})]})})]}):null]})}),!s&&e("div",{className:"px-4 pt-4",children:e(Q,{variant:"primary",className:"w-full",onClick:()=>z?.(),children:j?.signUp})})]}),i(c.Content,{value:"installment",className:"px-4",children:[e(ee,{size:2,className:"mb-2 text-left text-lg font-bold",children:o.flexibleInstallment}),i("div",{className:"overflow-hidden rounded-[16px] bg-white",children:[b,l,C&&e("div",{className:"border-b border-[#D9D9D9] bg-white px-4 py-4 last:border-b-0",children:C})]})]})]})};var we=ce;export{we as default};
|
|
40
|
+
//# sourceMappingURL=BenefitsTab.js.map
|
package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.tsx"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport { Button, Checkbox, Text, Picture, Heading } from '../../../../../components/index.js'\nimport ProductBenefitsTabs from './ProductBenefitsTabs/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useBenefits } from '../../../hooks/useBenefits'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\nimport classNames from 'classnames'\nimport React, { useRef, useState } from 'react'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../hooks/useCountDown.js'\nimport useCopy from '../../../hooks/useCopy'\nimport { cn } from '../../../../../helpers/index.js'\n// \u6587\u6848\u914D\u7F6E\u63A5\u53E3\ninterface BenefitsTabTextConfig {\n // Coupon \u76F8\u5173\n couponCode?: string // \"Code\"\n copyCode?: string // \"Copy Code\"\n copied?: string // \"Copied\"\n expired?: string // \"Expired\"\n offCoupon?: string // \"off coupon\"\n offMemberOnly?: string // \"{amount} off Member Only\"\n loginNow?: string // \"login now\"\n selectFreeGift?: string // \"You can select the free gift below.\"\n bundleSaveUpTo?: string // \"Bundle purchases save extra up to\"\n bundleOffer?: string // \"We offer {count} bundle for you\"\n creditsTitle?: string // \"Soundcore credits for cash\"\n creditsDesc?: string // \"100 Soundcore credits=$1\"\n\n // Tab \u6807\u7B7E\n yourBenefits?: string // \"Your Benefits\"\n off?: string // \"off\"\n memberBenefits?: string // \"Member Benefits\"\n memberBenefitsNotLogin?: string // \"Member Benefits\"\n installment?: string // \"Installment\"\n\n // Member Benefits \u90E8\u5206\n forNewMember?: string // \"for New Member\"\n expressShipping?: string // \"Express Shipping Method\"\n creditsAfterActivation?: string // \"You will get soundcoreCredits after activation.\"\n active?: string // \"Active\"\n\n // Installment \u90E8\u5206\n flexibleInstallment?: string // \"Flexible installment payment\"\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\ninterface BenefitsTabProps {\n textConfig?: BenefitsTabTextConfig\n}\n\n// \u9ED8\u8BA4\u6587\u6848\u914D\u7F6E\nconst defaultTextConfig: Required<BenefitsTabTextConfig> = {\n couponCode: 'Code',\n copyCode: 'Copy Code',\n copied: 'Copied',\n expired: 'Expired',\n offCoupon: '{discount} off coupon',\n offMemberOnly: '{amount} off Member Only',\n loginNow: 'Login now',\n selectFreeGift: 'You can select the free gift below.',\n bundleSaveUpTo: 'Bundle purchases save extra up to',\n bundleOffer: 'We offer {count} bundle for you',\n creditsTitle: 'Soundcore credits for cash',\n creditsDesc: '100 Soundcore credits=$1',\n yourBenefits: 'Your Benefits',\n off: ' off',\n memberBenefits: 'Member Benefits',\n memberBenefitsNotLogin: 'You will enjoy a {amount} member discount after logging in.',\n installment: 'Installment',\n forNewMember: '{amount} for New Member',\n expressShipping: 'Express Shipping Method',\n creditsAfterActivation: 'You will get soundcoreCredits after activation. ',\n active: 'Active',\n flexibleInstallment: 'Flexible installment payment ',\n}\n\n// Coupon content component (commonly used)\ninterface CouponContentProps {\n coupons?: Array<{\n borderStyle: 'inset' | 'rounded' // \u8FD9\u4E24\u79CD\u6837\u5F0F\u4E0D\u4E00\u6837\uFF0C inset \u56DB\u89D2\u662F\u5185\u5207\u5706\u89D2\uFF0C rounded \u56DB\u89D2\u662F\u666E\u901A\u5706\u89D2\n useAble?: boolean\n isAutoUse?: boolean\n onUseChange?: (useAble: boolean) => void\n code?: string\n title: string\n description: string | React.ReactNode\n discount?: number\n couponBgColor?: string\n bgImage?: { url: string; alt?: string }\n ends_at?: string\n }>\n className?: string\n}\n\nconst CouponItem = ({\n item,\n textConfig,\n}: {\n item: NonNullable<CouponContentProps['coupons']>[number]\n textConfig: Required<BenefitsTabTextConfig>\n}) => {\n const { trackingData } = useAiuiContext()\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n const couponCopy = trackingData?.common?.coupon\n const { days, hours, minutes, seconds } = useCountDown({ endTime: item?.ends_at || '' })\n const { openModal, isLogin } = useBizProductContext()\n return (\n <>\n <style jsx>{`\n .coupon-card {\n /* \u4F7F\u7528mask\u521B\u5EFA\u5185\u5207\u5706\u89D2 */\n mask:\n radial-gradient(circle at 0 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 0, transparent 12px, white 12px),\n radial-gradient(circle at 100% 100%, transparent 12px, white 12px),\n radial-gradient(circle at 0 100%, transparent 12px, white 12px);\n mask-size: 50% 50%;\n mask-position:\n top left,\n top right,\n bottom right,\n bottom left;\n mask-repeat: no-repeat;\n }\n `}</style>\n <div\n style={{\n background: item.couponBgColor || 'white',\n }}\n className={classNames(\n 'relative h-[100px] overflow-hidden laptop:h-[112px] lg-desktop:h-[130px]',\n item.borderStyle === 'inset' ? 'coupon-card ' : 'rounded-[8px]'\n )}\n >\n {item?.bgImage?.url && (\n <Picture\n source={item.bgImage.url}\n alt={item.bgImage.alt}\n className=\"absolute bottom-0 right-0 w-auto\"\n imgClassName=\"object-contain\"\n />\n )}\n <div className=\"relative z-1 p-3\">\n <div className=\"flex items-center justify-start\">\n {item.useAble && (\n <Checkbox\n size=\"lg\"\n className=\"mr-2 rounded-full border-[#D1D1D1] border-[1.6px] data-[state=checked]:border-primary\"\n checked={item?.isAutoUse}\n onCheckedChange={(e: boolean) => {\n item?.onUseChange?.(e)\n }}\n />\n )}\n <Text html={item.title} className=\"text-[16px] font-bold laptop:text-[20px] lg-desktop:text-[24px]\" />\n </div>\n <Text\n {...(typeof item.description === 'string' ? { html: item.description } : {})}\n as=\"p\"\n className=\"mt-2 pr-8 text-[14px] font-bold text-[#3D3D3F] lg-desktop:text-[16px]\"\n >\n {item.description}\n </Text>\n {item.code && (\n <div className=\"last:mt-2 flex items-center gap-2\">\n <Text html={`${textConfig.couponCode}: ${item.code}`} className=\"text-base font-bold text-[#3D3D3F]\" />\n <button className=\"text-base font-bold underline\" onClick={() => copyToClipboard(item.code ?? '')}>\n {isCopied ? couponCopy?.copied || textConfig.copied : couponCopy?.copy || textConfig.copyCode}\n </button>\n </div>\n )}\n {item.ends_at && (\n <button\n onClick={() => {\n if (couponCopy?.modal) {\n openModal(couponCopy?.modal!)\n }\n }}\n className=\"mt-[4px] text-left text-[14px] font-semibold text-[#1F2021] x:text-[12px] md-l:hidden\"\n >\n {Number(days) < Number(couponCopy?.hurry?.daysLeft) ? (\n <>\n <span>{couponCopy?.ends}</span>\n <span className=\"font-bold\">\n {` ${days} ${couponCopy?.days} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`}\n </span>\n </>\n ) : (\n couponCopy?.hurry?.label || textConfig.expired\n )}\n </button>\n )}\n </div>\n </div>\n </>\n )\n}\n\nconst CouponContent = ({\n coupons,\n className,\n textConfig,\n}: CouponContentProps & { textConfig: Required<BenefitsTabTextConfig> }) => {\n return (\n <div className={classNames('flex flex-col gap-3 laptop:grid laptop:grid-cols-2 desktop:grid-cols-1', className)}>\n {coupons?.map((item, index) => <CouponItem key={index} item={item} textConfig={textConfig} />)}\n </div>\n )\n}\n\nconst BenefitsTab = ({ textConfig }: BenefitsTabProps) => {\n const {\n isLogin,\n profile,\n variant,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n savingDetail,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n } = useBizProductContext()\n const benefits = useBenefits({ variant })\n const [productBenefitsTabsValue, setProductBenefitsTabsValue] = useState<'coupon' | 'membership' | 'installment'>(\n 'coupon'\n )\n const { trackingData, locale = 'us', copyWriting } = useAiuiContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n\n // \u5408\u5E76\u9ED8\u8BA4\u914D\u7F6E\u548C\u4F20\u5165\u7684\u914D\u7F6E\n const mergedTextConfig = { ...defaultTextConfig, ...textConfig }\n\n const { activated = false } = profile || {} // \u7528\u6237\u662F\u5426\u6FC0\u6D3B\n const { memberDiscount, commonCoupon, creditsRedemption, freeGift, bundle, paidShipping, fullGift, levelDiscount } =\n benefits\n\n const productsBenefits = trackingData?.product?.support ?? {}\n const { thirdParty = {} } = trackingData?.common || {}\n\n const coupons = [\n commonCoupon?.enable\n ? {\n ...commonCoupon.config,\n isAutoUse: savingDetail?.coupon > 0,\n useAble: true,\n borderStyle: 'rounded',\n code: commonCoupon?.config?.title ?? '',\n description: commonCoupon?.config?.desc ?? '',\n onUseChange: (value: boolean) => {\n const couponSaving = value ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n },\n title: replaceTemplate(mergedTextConfig.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n }\n : null,\n memberDiscount.enable\n ? {\n useAble: true,\n isAutoUse: isLogin,\n title: replaceTemplate(mergedTextConfig.offMemberOnly, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n }),\n description: (\n <>\n {isLogin\n ? (memberDiscount?.config?.description ?? '')\n : (mergedTextConfig.memberBenefitsNotLogin.replace(\n '{amount}',\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n ) ?? '')}{' '}\n {isLogin ? (\n ''\n ) : (\n <span role=\"button\" tabIndex={0} onClick={() => openSignInPopup?.()} className=\"underline\">\n {mergedTextConfig.loginNow}\n </span>\n )}\n </>\n ),\n borderStyle: 'rounded',\n onUseChange: (value: boolean) => {\n if (isLogin) {\n const memberSaving = value ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n // setSavingDetail(prev => ({\n // ...prev,\n // member: value ? (memberDiscount?.config?.amount ?? 0) : 0,\n // }))\n } else {\n openSignInPopup?.()\n }\n },\n }\n : null,\n levelDiscount.enable\n ? {\n title: levelDiscount?.config?.title ?? '',\n description: levelDiscount?.config?.tag ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/levelDiscount.png?v=1760437385',\n },\n }\n : null,\n freeGift.enable\n ? {\n title: freeGift?.config?.title ?? '',\n description: mergedTextConfig.selectFreeGift,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/gift.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n bundle.enable\n ? {\n title: `${mergedTextConfig.bundleSaveUpTo} ${formatPrice({\n amount: Math.max(...(bundle?.config?.bundleList?.map((item: any) => item.savings ?? 0) ?? [])),\n currencyCode: variant.price.currencyCode,\n locale,\n })}`,\n borderStyle: 'inset',\n description: mergedTextConfig.bundleOffer.replace(\n '{count}',\n bundle?.config?.bundleList?.length?.toString() ?? ''\n ),\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/bundle.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n fullGift.enable\n ? {\n title: fullGift?.config?.title ?? '',\n description: fullGift?.config?.desc ?? '',\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/fullGift.png?v=1759141790',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n creditsRedemption.enable\n ? {\n title: mergedTextConfig.creditsTitle,\n description: mergedTextConfig.creditsDesc,\n borderStyle: 'inset',\n bgImage: {\n url: 'https://cdn.shopify.com/s/files/1/0516/3761/6830/files/cash.png?v=1759113534',\n },\n couponBgColor:\n 'linear-gradient(94deg, rgba(215, 245, 254, 0.24) 4.2%, rgba(215, 245, 254, 0.80) 99.11%), #FFF',\n }\n : null,\n ].filter(Boolean)\n\n const handleActivate = () => {\n openAuthCodePopup?.()\n }\n\n if (!ProductBenefitsTabs) return null\n\n const handleProductBenefitsTabListClick = (el: React.MouseEvent<HTMLButtonElement>) => {\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = el.currentTarget\n console.log('button', button.offsetLeft)\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n\n return (\n <ProductBenefitsTabs\n onValueChange={value => setProductBenefitsTabsValue(value as 'coupon' | 'membership' | 'installment')}\n defaultValue={coupons?.length ? 'coupon' : 'membership'}\n >\n <ProductBenefitsTabs.List ref={scrollContainerRef}>\n {coupons?.length ? (\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'coupon' && 'text-[#1D1D1F]')}\n value=\"coupon\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.yourBenefits}\n {/* {(savingDetail.coupon || 0) > 0 && (\n <ProductBenefitsTabs.Badge>\n {commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n {mergedTextConfig.off}\n </ProductBenefitsTabs.Badge>\n )} */}\n </ProductBenefitsTabs.Trigger>\n ) : null}\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'membership' && 'text-[#1D1D1F]')}\n value=\"membership\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.memberBenefits}\n </ProductBenefitsTabs.Trigger>\n <ProductBenefitsTabs.Trigger\n className={cn(productBenefitsTabsValue === 'installment' && 'text-[#1D1D1F]')}\n value=\"installment\"\n onClick={handleProductBenefitsTabListClick}\n >\n {mergedTextConfig.installment}\n </ProductBenefitsTabs.Trigger>\n </ProductBenefitsTabs.List>\n <style global jsx>\n {`\n .coupon-container::-webkit-scrollbar {\n width: 4px; /* \u6EDA\u52A8\u6761\u5BBD\u5EA6 */\n height: 64px; /* \u6A2A\u5411\u6EDA\u52A8\u6761\u9AD8\u5EA6 */\n }\n\n .coupon-container::-webkit-scrollbar-track {\n background: transparent; /* \u6EDA\u52A8\u6761\u8F68\u9053\u80CC\u666F */\n }\n\n .coupon-container::-webkit-scrollbar-thumb {\n background-color: #d1d1d1; /* \u6EDA\u52A8\u6761\u989C\u8272 */\n border-radius: 9999px; /* \u5706\u89D2 */\n }\n\n .coupon-container::-webkit-scrollbar-thumb:hover {\n background-color: rgba(100, 100, 100, 0.6);\n }\n `}\n </style>\n\n {/* \u4F7F\u7528\u5185\u7F6E\u7684 CouponContent \u5B50\u7EC4\u4EF6 */}\n {coupons?.length ? (\n <ProductBenefitsTabs.Content value=\"coupon\" className=\"\">\n <div className=\"coupon-container h-[240px] overflow-y-auto p-3 lg-desktop:p-4\">\n <CouponContent\n coupons={coupons as NonNullable<CouponContentProps['coupons']>}\n className=\"\"\n textConfig={mergedTextConfig}\n />\n </div>\n </ProductBenefitsTabs.Content>\n ) : null}\n\n <ProductBenefitsTabs.Content value=\"membership\" className=\"\">\n <h3 className=\"mx-4 mb-2 text-left text-lg font-bold\">{mergedTextConfig.memberBenefits}</h3>\n <div className={`overflow-y-auto rounded-[16px] px-4 ${isLogin ? 'max-h-[240px]' : 'max-h-[160px]'}`}>\n <ul\n className={`list-none [&_li:first-child]:rounded-t-[16px] \n [&_li:last-child]:rounded-b-[16px] [&_li:last-child]:last:border-b-0 [&_li]:flex [&_li]:items-center [&_li]:gap-2\n [&_li]:border-b [&_li]:border-b-[#E4E5E6] [&_li]:bg-white [&_li]:px-4\n [&_li]:py-4 \n [&_li]:text-left`}\n >\n {memberDiscount.enable && (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-medium x:text-[14px]\">\n {replaceTemplate(mergedTextConfig.forNewMember, {\n amount: formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }),\n })}\n </Text>\n </li>\n )}\n {productsBenefits.items?.map((item: any, index: number) =>\n item.modalText ? (\n <li key={index}>\n <button\n onClick={() => openModal?.({ title: item.text, content: item.modalText })}\n key={index}\n className=\"flex\"\n >\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text className=\"text-left text-[16px] font-medium x:text-[14px]\">{item.text}</Text>\n </button>\n </li>\n ) : (\n <li key={index} className=\"flex\">\n <Picture source={item.icon} alt={item.text} className=\"mr-[8px] size-[20px] shrink-0\" />\n <Text as=\"p\" className=\"text-left text-[16px] font-medium x:text-[14px]\">\n {item.text}\n </Text>\n </li>\n )\n )}\n {/* \u9AD8\u6807\u7269\u6D41 */}\n {paidShipping.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M19 3C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H10V16H21C21.5523 16 22 16.4477 22 17C22 17.5523 21.5523 18 21 18H19.9961C19.9961 19.6559 18.6547 21 16.998 21C15.3414 21 14 19.6559 14 18H10C10 19.6568 8.65684 21 7 21C5.34317 21 4 19.6568 4 18H2C1.44772 18 1 17.5523 1 17V10.6738L1.00488 10.5771C1.02632 10.3554 1.12145 10.146 1.27637 9.9834L4.77637 6.31055L4.84961 6.24023C5.02993 6.08586 5.26042 6 5.5 6H8V5C8 3.89544 8.89541 3 10 3H19ZM6.00488 18.1025C6.05622 18.6067 6.48234 19 7 19C7.51766 19 7.94378 18.6067 7.99512 18.1025L8 18H6L6.00488 18.1025ZM16.0049 18.1025C16.0561 18.6074 16.4823 19 16.998 19C17.5138 19 17.94 18.6074 17.9912 18.1025L17.9961 18H16L16.0049 18.1025ZM3 11.0723V16H8V8H5.92773L3 11.0723ZM21.6621 6.8252C22.0348 6.41765 22.6676 6.38902 23.0752 6.76172C23.4827 7.13443 23.5104 7.76725 23.1377 8.1748L18.0518 13.7363C17.6625 14.162 17.003 14.1954 16.5732 13.8105L13.333 10.9092C12.9216 10.5408 12.8865 9.90853 13.2549 9.49707C13.6232 9.08565 14.2555 9.05066 14.667 9.41895L17.208 11.6943L21.6621 6.8252Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-medium x:text-[14px]\">\n {mergedTextConfig.expressShipping}\n </Text>\n </li>\n ) : null}\n {/* \u79EF\u5206\u62B5\u73B0 */}\n {creditsRedemption.enable ? (\n <li>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3ZM17 13C17.5523 13 18 13.4477 18 14C18 14.5523 17.5523 15 17 15H9.41406L9.70703 15.293C10.0976 15.6835 10.0976 16.3165 9.70703 16.707C9.31651 17.0976 8.68349 17.0976 8.29297 16.707L6.29297 14.707C6.00697 14.421 5.92139 13.9909 6.07617 13.6172C6.23098 13.2436 6.59558 13 7 13H17ZM14.293 7.29297C14.6835 6.90244 15.3165 6.90244 15.707 7.29297L17.707 9.29297C17.993 9.57897 18.0786 10.0091 17.9238 10.3828C17.769 10.7564 17.4044 11 17 11H7C6.44772 11 6 10.5523 6 10C6 9.44771 6.44772 9 7 9H14.5859L14.293 8.70703C13.9024 8.31651 13.9024 7.68349 14.293 7.29297Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n <Text as=\"p\" className=\"text-left text-[16px] font-medium x:text-[14px]\">\n {activated ? (\n creditsRedemption?.config?.label?.replace(\n '{{amount}}',\n formatPrice({\n amount: creditsRedemption?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n })\n )\n ) : (\n <>\n {mergedTextConfig.creditsAfterActivation}\n <span role=\"button\" tabIndex={0} onClick={() => handleActivate()} className=\"underline\">\n {mergedTextConfig.active}\n </span>\n </>\n )}\n </Text>\n </li>\n ) : null}\n </ul>\n </div>\n {!isLogin && (\n <div className=\"px-4 pt-4\">\n <Button variant=\"primary\" className=\"w-full\" onClick={() => openSignUpPopup?.()}>\n {copyWriting?.signUp}\n </Button>\n </div>\n )}\n </ProductBenefitsTabs.Content>\n {/* \u81EA\u5B9A\u4E49\u5185\u5BB9 */}\n <ProductBenefitsTabs.Content value=\"installment\" className=\"px-4\">\n <Heading size={2} className=\"mb-2 text-left text-lg font-bold\">\n {mergedTextConfig.flexibleInstallment}\n </Heading>\n <div className=\"overflow-hidden rounded-[16px] bg-white\">\n {renderAffirm}\n {renderKlarna}\n {renderPaypal && (\n <div className=\"border-b border-[#D9D9D9] bg-white px-4 py-4 last:border-b-0\">{renderPaypal}</div>\n )}\n </div>\n </ProductBenefitsTabs.Content>\n </ProductBenefitsTabs>\n )\n}\n\nexport default BenefitsTab\n"],
|
|
5
|
+
"mappings": "AAoHM,OAyEU,YAAAA,EAzEV,OAAAC,EAmCI,QAAAC,MAnCJ,oBAnHN,OAAS,UAAAC,EAAQ,YAAAC,EAAU,QAAAC,EAAM,WAAAC,EAAS,WAAAC,OAAe,qCACzD,OAAOC,MAAyB,iCAChC,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,eAAAC,OAAmB,6BAC5B,OAAS,eAAAC,MAAmB,0BAC5B,OAAS,mBAAAC,MAAuB,4BAChC,OAAOC,MAAgB,aACvB,OAAgB,UAAAC,GAAQ,YAAAC,OAAgB,QACxC,OAAS,kBAAAC,MAAsB,oCAC/B,OAAOC,OAAkB,uCACzB,OAAOC,OAAa,yBACpB,OAAS,MAAAC,MAAU,kCA+CnB,MAAMC,GAAq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E,MACN,EACF,EACC,CAACzB,GACAhC,EAAC,OAAI,UAAU,YACb,SAAAA,EAACE,EAAA,CAAO,QAAQ,UAAU,UAAU,SAAS,QAAS,IAAMgD,IAAkB,EAC3E,SAAAK,GAAa,OAChB,EACF,GAEJ,EAEAtD,EAACM,EAAoB,QAApB,CAA4B,MAAM,cAAc,UAAU,OACzD,UAAAP,EAACM,GAAA,CAAQ,KAAM,EAAG,UAAU,mCACzB,SAAAmD,EAAiB,oBACpB,EACAxD,EAAC,OAAI,UAAU,0CACZ,UAAAwC,EACAC,EACAC,GACC3C,EAAC,OAAI,UAAU,+DAAgE,SAAA2C,EAAa,GAEhG,GACF,GACF,CAEJ,EAEA,IAAOmC,GAAQxC",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "Button", "Checkbox", "Text", "Picture", "Heading", "ProductBenefitsTabs", "useBizProductContext", "useBenefits", "formatPrice", "replaceTemplate", "classNames", "useRef", "useState", "useAiuiContext", "useCountDown", "useCopy", "cn", "defaultTextConfig", "CouponItem", "item", "textConfig", "trackingData", "isCopied", "copyToClipboard", "couponCopy", "days", "hours", "minutes", "seconds", "openModal", "isLogin", "e", "CouponContent", "coupons", "className", "index", "BenefitsTab", "profile", "variant", "renderAffirm", "renderKlarna", "renderPaypal", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "savingDetail", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "benefits", "productBenefitsTabsValue", "setProductBenefitsTabsValue", "locale", "copyWriting", "scrollContainerRef", "mergedTextConfig", "activated", "memberDiscount", "commonCoupon", "creditsRedemption", "freeGift", "bundle", "paidShipping", "fullGift", "levelDiscount", "productsBenefits", "thirdParty", "value", "couponSaving", "memberSaving", "handleActivate", "handleProductBenefitsTabListClick", "el", "container", "button", "scrollLeft", "BenefitsTab_default"]
|
|
7
|
+
}
|