@anker-in/campaign-ui 0.2.11-beta.3 → 0.2.11-beta.31
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/components/LiveChatWidget/LiveChatWidget.d.ts +63 -0
- package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js +2 -0
- package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/api/chat.d.ts +46 -0
- package/dist/cjs/components/LiveChatWidget/api/chat.js +3 -0
- package/dist/cjs/components/LiveChatWidget/api/chat.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatBubble.d.ts +68 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatBubble.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatBubble.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatHeader.d.ts +57 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatHeader.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatHeader.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatInput.d.ts +70 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatInput.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatInput.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatMessage.d.ts +59 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatMessage.js +5 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatMessage.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatWindow.d.ts +127 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatWindow.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/ChatWindow.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/CartCard.d.ts +54 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/CartCard.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/CartCard.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ErrorBlock.d.ts +33 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ErrorBlock.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ErrorBlock.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/FAQList.d.ts +16 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/FAQList.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/FAQList.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/PolicyBlock.d.ts +45 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/PolicyBlock.js +5 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/PolicyBlock.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductCard.d.ts +41 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductCard.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductCard.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductComparison.d.ts +75 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductComparison.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductComparison.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductList.d.ts +47 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductList.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductList.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/PromotionList.d.ts +81 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/PromotionList.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/PromotionList.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/QuickReplies.d.ts +54 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/QuickReplies.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/QuickReplies.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/TextBlock.d.ts +31 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/TextBlock.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/TextBlock.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ThinkingBlock.d.ts +31 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ThinkingBlock.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/ThinkingBlock.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/index.d.ts +15 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/index.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent/index.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent.d.ts +63 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageContent.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageList.d.ts +74 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageList.js +5 -0
- package/dist/cjs/components/LiveChatWidget/components/MessageList.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/components/ScrollAnchor.d.ts +44 -0
- package/dist/cjs/components/LiveChatWidget/components/ScrollAnchor.js +2 -0
- package/dist/cjs/components/LiveChatWidget/components/ScrollAnchor.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/constants.d.ts +13 -0
- package/dist/cjs/components/LiveChatWidget/constants.js +2 -0
- package/dist/cjs/components/LiveChatWidget/constants.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useChatAPI.d.ts +60 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useChatAPI.js +2 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useChatAPI.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useChatState.d.ts +151 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js +2 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useSession.d.ts +37 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useSession.js +2 -0
- package/dist/cjs/components/LiveChatWidget/hooks/useSession.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/index.d.ts +12 -0
- package/dist/cjs/components/LiveChatWidget/index.js +2 -0
- package/dist/cjs/components/LiveChatWidget/index.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/types.d.ts +767 -0
- package/dist/cjs/components/LiveChatWidget/types.js +2 -0
- package/dist/cjs/components/LiveChatWidget/types.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/utils/cartTransformers.d.ts +25 -0
- package/dist/cjs/components/LiveChatWidget/utils/cartTransformers.js +2 -0
- package/dist/cjs/components/LiveChatWidget/utils/cartTransformers.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/utils/fetcher.d.ts +36 -0
- package/dist/cjs/components/LiveChatWidget/utils/fetcher.js +2 -0
- package/dist/cjs/components/LiveChatWidget/utils/fetcher.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/utils/messageRenderers.d.ts +64 -0
- package/dist/cjs/components/LiveChatWidget/utils/messageRenderers.js +2 -0
- package/dist/cjs/components/LiveChatWidget/utils/messageRenderers.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/utils/productTransformers.d.ts +43 -0
- package/dist/cjs/components/LiveChatWidget/utils/productTransformers.js +2 -0
- package/dist/cjs/components/LiveChatWidget/utils/productTransformers.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/utils/userId.d.ts +18 -0
- package/dist/cjs/components/LiveChatWidget/utils/userId.js +2 -0
- package/dist/cjs/components/LiveChatWidget/utils/userId.js.map +7 -0
- package/dist/cjs/components/LiveChatWidget/utils/validation.d.ts +37 -0
- package/dist/cjs/components/LiveChatWidget/utils/validation.js +2 -0
- package/dist/cjs/components/LiveChatWidget/utils/validation.js.map +7 -0
- package/dist/cjs/components/chat/markdown.js +1 -1
- package/dist/cjs/components/chat/markdown.js.map +2 -2
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +2 -2
- package/dist/cjs/components/credits/context/memberPriceConst.d.ts +0 -5
- package/dist/cjs/components/credits/context/memberPriceConst.js +1 -1
- package/dist/cjs/components/credits/context/memberPriceConst.js.map +3 -3
- package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +1 -22
- package/dist/cjs/components/credits/context/memberPriceTypes.js +1 -1
- package/dist/cjs/components/credits/context/memberPriceTypes.js.map +1 -1
- package/dist/cjs/components/credits/context/provider.d.ts +16 -1
- package/dist/cjs/components/credits/context/provider.js +1 -1
- package/dist/cjs/components/credits/context/provider.js.map +3 -3
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
- package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +3 -3
- package/dist/cjs/components/credits/creditsBanner/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsBanner/index.js +12 -1
- package/dist/cjs/components/credits/creditsBanner/index.js.map +3 -3
- package/dist/cjs/components/credits/creditsBenefits/BenefitItem.js +2 -0
- package/dist/cjs/components/credits/creditsBenefits/BenefitItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/{iconInfo.js → IconInfo.js} +1 -1
- package/dist/cjs/components/credits/creditsBenefits/{iconInfo.js.map → IconInfo.js.map} +1 -1
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js +1 -1
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +3 -3
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +1 -1
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +3 -3
- package/dist/cjs/components/credits/creditsCash/type.d.ts +1 -0
- package/dist/cjs/components/credits/creditsCash/type.js +1 -1
- package/dist/cjs/components/credits/creditsCash/type.js.map +1 -1
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +3 -3
- package/dist/cjs/components/credits/creditsInfoCard/index.js +1 -1
- package/dist/cjs/components/credits/creditsInfoCard/index.js.map +2 -2
- package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
- package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +3 -3
- package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +1 -1
- package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +3 -3
- package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +3 -5
- package/dist/cjs/components/credits/creditsMemberPrice/type.js +1 -1
- package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +1 -1
- package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +1 -1
- package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +3 -3
- package/dist/cjs/components/index.d.ts +3 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/registration/authCodeActivate/index.js +1 -1
- package/dist/cjs/components/registration/authCodeActivate/index.js.map +2 -2
- package/dist/cjs/stories/CartCard.stories.d.ts +33 -0
- package/dist/cjs/stories/CartCard.stories.js +21 -0
- package/dist/cjs/stories/CartCard.stories.js.map +7 -0
- package/dist/cjs/stories/LiveChatWidget.stories.d.ts +108 -0
- package/dist/cjs/stories/LiveChatWidget.stories.js +149 -0
- package/dist/cjs/stories/LiveChatWidget.stories.js.map +7 -0
- package/dist/cjs/templates/{credits.d.ts → Credits.d.ts} +16 -1
- package/dist/cjs/templates/Credits.js +2 -0
- package/dist/cjs/templates/Credits.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/LiveChatWidget.d.ts +63 -0
- package/dist/esm/components/LiveChatWidget/LiveChatWidget.js +2 -0
- package/dist/esm/components/LiveChatWidget/LiveChatWidget.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/api/chat.d.ts +46 -0
- package/dist/esm/components/LiveChatWidget/api/chat.js +3 -0
- package/dist/esm/components/LiveChatWidget/api/chat.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/ChatBubble.d.ts +68 -0
- package/dist/esm/components/LiveChatWidget/components/ChatBubble.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/ChatBubble.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/ChatHeader.d.ts +57 -0
- package/dist/esm/components/LiveChatWidget/components/ChatHeader.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/ChatHeader.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/ChatInput.d.ts +70 -0
- package/dist/esm/components/LiveChatWidget/components/ChatInput.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/ChatInput.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/ChatMessage.d.ts +59 -0
- package/dist/esm/components/LiveChatWidget/components/ChatMessage.js +5 -0
- package/dist/esm/components/LiveChatWidget/components/ChatMessage.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/ChatWindow.d.ts +127 -0
- package/dist/esm/components/LiveChatWidget/components/ChatWindow.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/ChatWindow.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/CartCard.d.ts +54 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/CartCard.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/CartCard.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ErrorBlock.d.ts +33 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ErrorBlock.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ErrorBlock.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/FAQList.d.ts +16 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/FAQList.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/FAQList.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/PolicyBlock.d.ts +45 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/PolicyBlock.js +5 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/PolicyBlock.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductCard.d.ts +41 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductCard.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductCard.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductComparison.d.ts +75 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductComparison.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductComparison.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductList.d.ts +47 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductList.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductList.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/PromotionList.d.ts +81 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/PromotionList.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/PromotionList.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/QuickReplies.d.ts +54 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/QuickReplies.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/QuickReplies.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/TextBlock.d.ts +31 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/TextBlock.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/TextBlock.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ThinkingBlock.d.ts +31 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ThinkingBlock.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/ThinkingBlock.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/index.d.ts +15 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/index.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent/index.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent.d.ts +63 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/MessageContent.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/MessageList.d.ts +74 -0
- package/dist/esm/components/LiveChatWidget/components/MessageList.js +5 -0
- package/dist/esm/components/LiveChatWidget/components/MessageList.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/components/ScrollAnchor.d.ts +44 -0
- package/dist/esm/components/LiveChatWidget/components/ScrollAnchor.js +2 -0
- package/dist/esm/components/LiveChatWidget/components/ScrollAnchor.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/constants.d.ts +13 -0
- package/dist/esm/components/LiveChatWidget/constants.js +2 -0
- package/dist/esm/components/LiveChatWidget/constants.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/hooks/useChatAPI.d.ts +60 -0
- package/dist/esm/components/LiveChatWidget/hooks/useChatAPI.js +2 -0
- package/dist/esm/components/LiveChatWidget/hooks/useChatAPI.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/hooks/useChatState.d.ts +151 -0
- package/dist/esm/components/LiveChatWidget/hooks/useChatState.js +2 -0
- package/dist/esm/components/LiveChatWidget/hooks/useChatState.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/hooks/useSession.d.ts +37 -0
- package/dist/esm/components/LiveChatWidget/hooks/useSession.js +2 -0
- package/dist/esm/components/LiveChatWidget/hooks/useSession.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/index.d.ts +12 -0
- package/dist/esm/components/LiveChatWidget/index.js +2 -0
- package/dist/esm/components/LiveChatWidget/index.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/types.d.ts +767 -0
- package/dist/esm/components/LiveChatWidget/types.js +1 -0
- package/dist/esm/components/LiveChatWidget/types.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/utils/cartTransformers.d.ts +25 -0
- package/dist/esm/components/LiveChatWidget/utils/cartTransformers.js +2 -0
- package/dist/esm/components/LiveChatWidget/utils/cartTransformers.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/utils/fetcher.d.ts +36 -0
- package/dist/esm/components/LiveChatWidget/utils/fetcher.js +2 -0
- package/dist/esm/components/LiveChatWidget/utils/fetcher.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/utils/messageRenderers.d.ts +64 -0
- package/dist/esm/components/LiveChatWidget/utils/messageRenderers.js +2 -0
- package/dist/esm/components/LiveChatWidget/utils/messageRenderers.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/utils/productTransformers.d.ts +43 -0
- package/dist/esm/components/LiveChatWidget/utils/productTransformers.js +2 -0
- package/dist/esm/components/LiveChatWidget/utils/productTransformers.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/utils/userId.d.ts +18 -0
- package/dist/esm/components/LiveChatWidget/utils/userId.js +2 -0
- package/dist/esm/components/LiveChatWidget/utils/userId.js.map +7 -0
- package/dist/esm/components/LiveChatWidget/utils/validation.d.ts +37 -0
- package/dist/esm/components/LiveChatWidget/utils/validation.js +2 -0
- package/dist/esm/components/LiveChatWidget/utils/validation.js.map +7 -0
- package/dist/esm/components/chat/markdown.js +1 -1
- package/dist/esm/components/chat/markdown.js.map +2 -2
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +2 -2
- package/dist/esm/components/credits/context/memberPriceConst.d.ts +0 -5
- package/dist/esm/components/credits/context/memberPriceConst.js +1 -1
- package/dist/esm/components/credits/context/memberPriceConst.js.map +3 -3
- package/dist/esm/components/credits/context/memberPriceTypes.d.ts +1 -22
- package/dist/esm/components/credits/context/provider.d.ts +16 -1
- package/dist/esm/components/credits/context/provider.js +1 -1
- package/dist/esm/components/credits/context/provider.js.map +3 -3
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
- package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +3 -3
- package/dist/esm/components/credits/creditsBanner/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsBanner/index.js +12 -1
- package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
- package/dist/esm/components/credits/creditsBenefits/BenefitItem.js +2 -0
- package/dist/esm/components/credits/creditsBenefits/BenefitItem.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/{iconInfo.js → IconInfo.js} +1 -1
- package/dist/esm/components/credits/creditsBenefits/{iconInfo.js.map → IconInfo.js.map} +1 -1
- package/dist/esm/components/credits/creditsCash/CreditsCash.js +1 -1
- package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +3 -3
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
- package/dist/esm/components/credits/creditsCash/type.d.ts +1 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +3 -3
- package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +2 -2
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
- package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +3 -3
- package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +1 -1
- package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +3 -3
- package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +3 -5
- package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +1 -1
- package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +3 -3
- package/dist/esm/components/index.d.ts +3 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +3 -3
- package/dist/esm/components/registration/authCodeActivate/index.js +1 -1
- package/dist/esm/components/registration/authCodeActivate/index.js.map +2 -2
- package/dist/esm/stories/CartCard.stories.d.ts +33 -0
- package/dist/esm/stories/CartCard.stories.js +21 -0
- package/dist/esm/stories/CartCard.stories.js.map +7 -0
- package/dist/esm/stories/LiveChatWidget.stories.d.ts +108 -0
- package/dist/esm/stories/LiveChatWidget.stories.js +149 -0
- package/dist/esm/stories/LiveChatWidget.stories.js.map +7 -0
- package/dist/esm/templates/{credits.d.ts → Credits.d.ts} +16 -1
- package/dist/esm/templates/Credits.js +2 -0
- package/dist/esm/templates/Credits.js.map +7 -0
- package/dist/index.d.mts +1305 -0
- package/dist/index.d.ts +1305 -0
- package/dist/index.js +26656 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +26641 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +7 -3
- package/src/components/LiveChatWidget/LiveChatWidget.tsx +732 -0
- package/src/components/LiveChatWidget/api/chat.ts +174 -0
- package/src/components/LiveChatWidget/components/ChatBubble.tsx +152 -0
- package/src/components/LiveChatWidget/components/ChatHeader.tsx +150 -0
- package/src/components/LiveChatWidget/components/ChatInput.tsx +241 -0
- package/src/components/LiveChatWidget/components/ChatMessage.tsx +190 -0
- package/src/components/LiveChatWidget/components/ChatWindow.tsx +353 -0
- package/src/components/LiveChatWidget/components/MessageContent/CartCard.tsx +202 -0
- package/src/components/LiveChatWidget/components/MessageContent/ErrorBlock.tsx +75 -0
- package/src/components/LiveChatWidget/components/MessageContent/FAQList.tsx +127 -0
- package/src/components/LiveChatWidget/components/MessageContent/PolicyBlock.tsx +150 -0
- package/src/components/LiveChatWidget/components/MessageContent/ProductCard.tsx +218 -0
- package/src/components/LiveChatWidget/components/MessageContent/ProductComparison.tsx +359 -0
- package/src/components/LiveChatWidget/components/MessageContent/ProductList.tsx +293 -0
- package/src/components/LiveChatWidget/components/MessageContent/PromotionList.tsx +170 -0
- package/src/components/LiveChatWidget/components/MessageContent/QuickReplies.tsx +91 -0
- package/src/components/LiveChatWidget/components/MessageContent/TextBlock.tsx +89 -0
- package/src/components/LiveChatWidget/components/MessageContent/ThinkingBlock.tsx +53 -0
- package/src/components/LiveChatWidget/components/MessageContent/index.ts +16 -0
- package/src/components/LiveChatWidget/components/MessageContent.tsx +113 -0
- package/src/components/LiveChatWidget/components/MessageList.tsx +261 -0
- package/src/components/LiveChatWidget/components/ScrollAnchor.tsx +75 -0
- package/src/components/LiveChatWidget/constants.ts +36 -0
- package/src/components/LiveChatWidget/hooks/useChatAPI.ts +146 -0
- package/src/components/LiveChatWidget/hooks/useChatState.ts +1086 -0
- package/src/components/LiveChatWidget/hooks/useSession.ts +123 -0
- package/src/components/LiveChatWidget/index.tsx +62 -0
- package/src/components/LiveChatWidget/types.ts +949 -0
- package/src/components/LiveChatWidget/utils/cartTransformers.ts +72 -0
- package/src/components/LiveChatWidget/utils/fetcher.ts +126 -0
- package/src/components/LiveChatWidget/utils/messageRenderers.ts +120 -0
- package/src/components/LiveChatWidget/utils/productTransformers.ts +149 -0
- package/src/components/LiveChatWidget/utils/userId.ts +140 -0
- package/src/components/LiveChatWidget/utils/validation.ts +99 -0
- package/src/components/chat/markdown.tsx +1 -1
- package/src/components/credits/context/hooks/useRedeemableList.ts +1 -1
- package/src/components/credits/context/memberPriceConst.ts +0 -7
- package/src/components/credits/context/memberPriceTypes.ts +1 -26
- package/src/components/credits/context/provider.tsx +16 -0
- package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +26 -26
- package/src/components/credits/creditsBanner/index.tsx +31 -3
- package/src/components/credits/creditsBenefits/BenefitItem.tsx +11 -4
- package/src/components/credits/creditsBenefits/IconInfo.tsx +1 -1
- package/src/components/credits/creditsCash/CreditsCash.tsx +6 -3
- package/src/components/credits/creditsCash/RedeemableItem.tsx +23 -10
- package/src/components/credits/creditsCash/type.ts +1 -0
- package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +25 -23
- package/src/components/credits/creditsInfoCard/index.tsx +8 -2
- package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +124 -25
- package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +113 -31
- package/src/components/credits/creditsMemberPrice/type.ts +3 -5
- package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +3 -3
- package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +31 -18
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +6 -4
- package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +19 -6
- package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +20 -17
- package/src/components/index.ts +23 -1
- package/src/components/registration/authCodeActivate/index.tsx +2 -0
- package/src/stories/CartCard.stories.tsx +459 -0
- package/src/stories/LiveChatWidget.stories.tsx +754 -0
- package/src/styles/livechat.css +268 -0
- package/src/templates/Credits.tsx +27 -9
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +0 -7
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -9
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
- package/dist/cjs/components/credits/context/utils/atobID.d.ts +0 -1
- package/dist/cjs/components/credits/context/utils/atobID.js +0 -2
- package/dist/cjs/components/credits/context/utils/atobID.js.map +0 -7
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +0 -5
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +0 -2
- package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +0 -7
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +0 -8
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +0 -2
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +0 -7
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +0 -9
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +0 -2
- package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +0 -7
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +0 -6
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +0 -2
- package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +0 -7
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js +0 -2
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.js.map +0 -7
- package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
- package/dist/cjs/helpers/fetchResponse.js +0 -2
- package/dist/cjs/helpers/fetchResponse.js.map +0 -7
- package/dist/cjs/helpers/fetcher.d.ts +0 -2
- package/dist/cjs/helpers/fetcher.js +0 -2
- package/dist/cjs/helpers/fetcher.js.map +0 -7
- package/dist/cjs/helpers/index.d.ts +0 -2
- package/dist/cjs/helpers/index.js +0 -2
- package/dist/cjs/helpers/index.js.map +0 -7
- package/dist/cjs/helpers/track.d.ts +0 -19
- package/dist/cjs/helpers/track.js +0 -2
- package/dist/cjs/helpers/track.js.map +0 -7
- package/dist/cjs/helpers/utils.d.ts +0 -3
- package/dist/cjs/helpers/utils.js +0 -2
- package/dist/cjs/helpers/utils.js.map +0 -7
- package/dist/cjs/templates/credits.js +0 -2
- package/dist/cjs/templates/credits.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +0 -7
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +0 -2
- package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
- package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -9
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
- package/dist/esm/components/credits/context/utils/atobID.d.ts +0 -1
- package/dist/esm/components/credits/context/utils/atobID.js +0 -2
- package/dist/esm/components/credits/context/utils/atobID.js.map +0 -7
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +0 -5
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +0 -2
- package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +0 -7
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +0 -8
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +0 -2
- package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +0 -7
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +0 -9
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +0 -2
- package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +0 -7
- package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +0 -6
- package/dist/esm/components/credits/context/utils/variantGetCoupon.js +0 -2
- package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +0 -7
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js +0 -2
- package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +0 -7
- package/dist/esm/helpers/fetchResponse.d.ts +0 -14
- package/dist/esm/helpers/fetchResponse.js +0 -2
- package/dist/esm/helpers/fetchResponse.js.map +0 -7
- package/dist/esm/helpers/fetcher.d.ts +0 -2
- package/dist/esm/helpers/fetcher.js +0 -2
- package/dist/esm/helpers/fetcher.js.map +0 -7
- package/dist/esm/helpers/index.d.ts +0 -2
- package/dist/esm/helpers/index.js +0 -2
- package/dist/esm/helpers/index.js.map +0 -7
- package/dist/esm/helpers/track.d.ts +0 -19
- package/dist/esm/helpers/track.js +0 -2
- package/dist/esm/helpers/track.js.map +0 -7
- package/dist/esm/helpers/utils.d.ts +0 -3
- package/dist/esm/helpers/utils.js +0 -2
- package/dist/esm/helpers/utils.js.map +0 -7
- package/dist/esm/templates/credits.js +0 -2
- package/dist/esm/templates/credits.js.map +0 -7
- package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +0 -33
- package/src/components/credits/context/utils/atobID.ts +0 -8
- package/src/components/credits/context/utils/functionDiscountCalculate.ts +0 -57
- package/src/components/credits/context/utils/getFunctionMemberPrice.ts +0 -135
- package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +0 -51
- package/src/components/credits/context/utils/variantGetCoupon.ts +0 -34
- /package/dist/cjs/components/credits/creditsBenefits/{benefitItem.d.ts → BenefitItem.d.ts} +0 -0
- /package/dist/cjs/components/credits/creditsBenefits/{iconInfo.d.ts → IconInfo.d.ts} +0 -0
- /package/dist/esm/components/credits/creditsBenefits/{benefitItem.d.ts → BenefitItem.d.ts} +0 -0
- /package/dist/esm/components/credits/creditsBenefits/{iconInfo.d.ts → IconInfo.d.ts} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var h=Object.create;var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var b=(e,a)=>{for(var n in a)o(e,n,{get:a[n],enumerable:!0})},i=(e,a,n,t)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of u(a))!T.call(e,r)&&r!==n&&o(e,r,{get:()=>a[r],enumerable:!(t=p(a,r))||t.enumerable});return e};var w=(e,a,n)=>(n=e!=null?h(y(e)):{},i(a||!e||!e.__esModule?o(n,"default",{value:e,enumerable:!0}):n,e)),F=e=>i(o({},"__esModule",{value:!0}),e);var m={};b(m,{default:()=>S});module.exports=F(m);var f=w(require("./fetchResponse.js"));const O=async({locale:e="en",url:a,method:n="POST",headers:t={},body:r,type:d,timeout:l=9e4})=>{let s="";d==="uploadFile"?s=r:s=r?JSON.stringify(r):"";const c=new AbortController;l&&setTimeout(()=>c.abort(),l);const g=await fetch(a,{method:n,mode:"cors",headers:{"current-language":e,...t},...l&&{signal:c.signal},...n!=="GET"&&{body:s}});return(0,f.default)(g)};var S=O;
|
|
2
|
-
//# sourceMappingURL=fetcher.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/fetcher.ts"],
|
|
4
|
-
"sourcesContent": ["import handleFetchResponse from './fetchResponse.js'\n\nconst fetcher = async ({ locale = 'en', url, method = 'POST', headers = {}, body, type, timeout = 90000 }: any) => {\n // \u6DFB\u52A0\u8C37\u6B4C\u9A8C\u8BC1\n let bodyData = ''\n if (type === 'uploadFile') {\n bodyData = body\n } else {\n bodyData = body ? JSON.stringify(body) : ''\n }\n\n const controller = new AbortController()\n if (timeout) {\n // \u8D85\u65F6\u62A5\u9519\n setTimeout(() => controller.abort(), timeout)\n }\n\n const data = await fetch(url, {\n method,\n mode: 'cors',\n headers: {\n 'current-language': locale,\n ...headers,\n },\n ...(timeout && { signal: controller.signal }),\n ...(method !== 'GET' && { body: bodyData }),\n })\n return handleFetchResponse(data)\n}\n\nexport default fetcher\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,iCAEhC,MAAMC,EAAU,MAAO,CAAE,OAAAC,EAAS,KAAM,IAAAC,EAAK,OAAAC,EAAS,OAAQ,QAAAC,EAAU,CAAC,EAAG,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAU,GAAM,IAAW,CAEjH,IAAIC,EAAW,GACXF,IAAS,aACXE,EAAWH,EAEXG,EAAWH,EAAO,KAAK,UAAUA,CAAI,EAAI,GAG3C,MAAMI,EAAa,IAAI,gBACnBF,GAEF,WAAW,IAAME,EAAW,MAAM,EAAGF,CAAO,EAG9C,MAAMG,EAAO,MAAM,MAAMR,EAAK,CAC5B,OAAAC,EACA,KAAM,OACN,QAAS,CACP,mBAAoBF,EACpB,GAAGG,CACL,EACA,GAAIG,GAAW,CAAE,OAAQE,EAAW,MAAO,EAC3C,GAAIN,IAAW,OAAS,CAAE,KAAMK,CAAS,CAC3C,CAAC,EACD,SAAO,EAAAG,SAAoBD,CAAI,CACjC,EAEA,IAAOb,EAAQG",
|
|
6
|
-
"names": ["fetcher_exports", "__export", "fetcher_default", "__toCommonJS", "import_fetchResponse", "fetcher", "locale", "url", "method", "headers", "body", "type", "timeout", "bodyData", "controller", "data", "handleFetchResponse"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var b=(r,o)=>{for(var e in o)f(r,e,{get:o[e],enumerable:!0})},d=(r,o,e,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of c(o))!a.call(r,p)&&p!==e&&f(r,p,{get:()=>o[p],enumerable:!(m=x(o,p))||m.enumerable});return r};var g=r=>d(f({},"__esModule",{value:!0}),r);var h={};b(h,{cn:()=>n.cn,noop:()=>t.noop});module.exports=g(h);var n=require("./utils.js"),t=require("./utils.js");
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { cn } from './utils.js'\nexport { noop } from './utils.js'\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8CAAAE,EAAAF,GAAA,IAAAG,EAAmB,sBACnBA,EAAqB",
|
|
6
|
-
"names": ["helpers_exports", "__export", "__toCommonJS", "import_utils"]
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface Window {
|
|
3
|
-
dataLayer?: Array<any>;
|
|
4
|
-
fbq?: (...args: any[]) => void;
|
|
5
|
-
klaviyo?: any;
|
|
6
|
-
gtag?: any;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export declare const gaTrack: (data: any) => "" | undefined;
|
|
10
|
-
export declare function gaNormalClick({ position, label }: {
|
|
11
|
-
position: string;
|
|
12
|
-
label: string;
|
|
13
|
-
}): void;
|
|
14
|
-
export declare const fbq: (...args: any[]) => "" | undefined;
|
|
15
|
-
export declare const gtag: (...args: any[]) => "" | undefined;
|
|
16
|
-
export declare const getGtmGroup: ({ query, asPath }: {
|
|
17
|
-
query: any;
|
|
18
|
-
asPath: string;
|
|
19
|
-
}) => any;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var p=(e,n)=>{for(var t in n)a(e,t,{get:n[t],enumerable:!0})},s=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of g(n))!w.call(e,r)&&r!==t&&a(e,r,{get:()=>n[r],enumerable:!(o=d(n,r))||o.enumerable});return e};var u=e=>s(a({},"__esModule",{value:!0}),e);var m={};p(m,{fbq:()=>f,gaNormalClick:()=>c,gaTrack:()=>i,getGtmGroup:()=>y,gtag:()=>l});module.exports=u(m);const i=e=>{if(typeof window>"u"||(window.dataLayer=window?.dataLayer||[],!Array.isArray(window.dataLayer)))return"";try{window?.dataLayer?.push({event_parameters:null}),window?.dataLayer?.push(e||{})}catch(n){console.log("pageGTMEvent error",n)}};function c({position:e,label:n}){i({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:"soundcoreCredits Rewards Program",position:e,button_name:n}})}const f=(...e)=>{if(typeof window>"u")return"";window.fbq&&window.fbq(...e)},l=(...e)=>{if(typeof window>"u")return"";window.gtag&&window.gtag(...e)},y=({query:e,asPath:n})=>n.includes("collections")?`Product List Page_${e?.handle}`:n.includes("products")?"Product Detail Page_"+e?.handle:n==="/"||n==="/app-home"?"Home Page":"Activity Page_"+e?.handle||e?.paths?.[0]?.replace("storefront-","");
|
|
2
|
-
//# sourceMappingURL=track.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/track.ts"],
|
|
4
|
-
"sourcesContent": ["declare global {\n interface Window {\n dataLayer?: Array<any>\n fbq?: (...args: any[]) => void\n klaviyo?: any\n gtag?: any\n }\n}\n\n// GA \u57CB\u70B9\nexport const gaTrack = (data: any) => {\n if (typeof window === 'undefined') {\n return ''\n }\n window.dataLayer = window?.dataLayer || []\n if (!Array.isArray(window.dataLayer)) {\n return ''\n }\n\n try {\n window?.dataLayer?.push({ event_parameters: null })\n window?.dataLayer?.push(data || {})\n } catch (error) {\n console.log('pageGTMEvent error', error)\n }\n}\n\nexport function gaNormalClick({ position, label }: { position: string; label: string }) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'soundcoreCredits Rewards Program',\n position: position,\n button_name: label,\n },\n })\n}\n\n// facebook \u57CB\u70B9\nexport const fbq = (...args: any[]) => {\n if (typeof window === 'undefined') {\n return ''\n }\n if (window.fbq) {\n window.fbq(...args)\n }\n}\n\nexport const gtag = (...args: any[]) => {\n if (typeof window === 'undefined') {\n return ''\n }\n if (window.gtag) {\n window.gtag(...args)\n }\n}\n\nexport const getGtmGroup = ({ query, asPath }: { query: any; asPath: string }) => {\n if (asPath.includes('collections')) {\n return `Product List Page_${query?.handle}`\n }\n\n if (asPath.includes('products')) {\n return 'Product Detail Page_' + query?.handle\n }\n\n if (asPath === '/' || asPath === '/app-home') {\n return 'Home Page'\n }\n\n return 'Activity Page_' + query?.handle || query?.paths?.[0]?.replace('storefront-', '')\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,SAAAE,EAAA,kBAAAC,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,IAAA,eAAAC,EAAAP,GAUO,MAAMI,EAAWI,GAAc,CAKpC,GAJI,OAAO,OAAW,MAGtB,OAAO,UAAY,QAAQ,WAAa,CAAC,EACrC,CAAC,MAAM,QAAQ,OAAO,SAAS,GACjC,MAAO,GAGT,GAAI,CACF,QAAQ,WAAW,KAAK,CAAE,iBAAkB,IAAK,CAAC,EAClD,QAAQ,WAAW,KAAKA,GAAQ,CAAC,CAAC,CACpC,OAASC,EAAO,CACd,QAAQ,IAAI,qBAAsBA,CAAK,CACzC,CACF,EAEO,SAASN,EAAc,CAAE,SAAAO,EAAU,MAAAC,CAAM,EAAwC,CACtFP,EAAQ,CACN,MAAO,WACP,WAAY,YACZ,iBAAkB,CAChB,WAAY,mCACZ,SAAUM,EACV,YAAaC,CACf,CACF,CAAC,CACH,CAGO,MAAMT,EAAM,IAAIU,IAAgB,CACrC,GAAI,OAAO,OAAW,IACpB,MAAO,GAEL,OAAO,KACT,OAAO,IAAI,GAAGA,CAAI,CAEtB,EAEaN,EAAO,IAAIM,IAAgB,CACtC,GAAI,OAAO,OAAW,IACpB,MAAO,GAEL,OAAO,MACT,OAAO,KAAK,GAAGA,CAAI,CAEvB,EAEaP,EAAc,CAAC,CAAE,MAAAQ,EAAO,OAAAC,CAAO,IACtCA,EAAO,SAAS,aAAa,EACxB,qBAAqBD,GAAO,MAAM,GAGvCC,EAAO,SAAS,UAAU,EACrB,uBAAyBD,GAAO,OAGrCC,IAAW,KAAOA,IAAW,YACxB,YAGF,iBAAmBD,GAAO,QAAUA,GAAO,QAAQ,CAAC,GAAG,QAAQ,cAAe,EAAE",
|
|
6
|
-
"names": ["track_exports", "__export", "fbq", "gaNormalClick", "gaTrack", "getGtmGroup", "gtag", "__toCommonJS", "data", "error", "position", "label", "args", "query", "asPath"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(o,r)=>{for(var e in r)n(o,e,{get:r[e],enumerable:!0})},i=(o,r,e,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!c.call(o,t)&&t!==e&&n(o,t,{get:()=>r[t],enumerable:!(p=s(r,t))||p.enumerable});return o};var m=o=>i(n({},"__esModule",{value:!0}),o);var C={};f(C,{cn:()=>x,noop:()=>y});module.exports=m(C);var a=require("clsx"),l=require("tailwind-merge");function x(...o){return(0,l.twMerge)((0,a.clsx)(o))}function y(){}
|
|
2
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport function noop(): any {}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,QAAAE,EAAA,SAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASJ,KAAMK,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CAEO,SAASJ,GAAY,CAAC",
|
|
6
|
-
"names": ["utils_exports", "__export", "cn", "noop", "__toCommonJS", "import_clsx", "import_tailwind_merge", "inputs"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var C=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var M=(s,i)=>{for(var p in i)C(s,p,{get:i[p],enumerable:!0})},N=(s,i,p,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of K(i))!F.call(s,t)&&t!==p&&C(s,t,{get:()=>i[t],enumerable:!(r=L(i,t))||r.enumerable});return s};var S=s=>N(C({},"__esModule",{value:!0}),s);var D={};M(D,{ComponentKey:()=>I,CreditsTemplate:()=>x});module.exports=S(D);var o=require("react/jsx-runtime"),a=require("@anker-in/lib"),c=require("../components/registration/context/provider"),f=require("../components/credits/context/provider"),l=require("../components/credits/creditsBanner"),y=require("../components/credits/creditsInfoCard"),g=require("../components/credits/creditsBenefits"),P=require("../components/credits/creditsWaysToGetCredits"),T=require("../components/credits/creditsAnkersolixTask"),v=require("../components/credits/creditsRedeemList"),u=require("../components/credits/creditsCash"),b=require("../components/credits/creditsMemberPrice"),h=require("../components/credits/creditsFaq"),B=require("../components/credits/creditsNavigation"),I=(d=>(d.Navigation="creditsNavigation",d.Banner="creditsBanner",d.InfoCard="creditsInfoCard",d.Benefits="creditsBenefits",d.WaysToGetCredits="creditsWaysToGetCredits",d.AnkersolixTask="creditsAnkersolixTask",d.RedeemList="creditsRedeemList",d.SpendCreditsLikeCash="creditsCash",d.MemberPrice="creditsMemberPrice",d.Faqs="creditsFaq",d))(I||{});const x=({headlessConfig:s,siteConfig:i,creditsConfig:p,userContext:r,pageConfig:t,registrationContext:m,gtm:A})=>(console.log("siteConfig",i),(0,o.jsx)(a.HeadlessProvider,{headlessConfig:s,children:(0,o.jsx)(c.RegistrationProvider,{copy:i.registrationsSettings,email:r?.profile?.email,children:(0,o.jsxs)(f.CreditsProvider,{profile:r?.profile,removeProfile:r?.removeProfile,isLoadingProfile:r?.isLoadingProfile,openSignInPopup:m.openSignInPopup,openSignUpPopup:m.openSignUpPopup,creditInfo:r?.creditInfo,taskIdToTypeMapping:i.taskIdToTypeMapping,customer:r?.customer,fetchCreditInfo:r?.fetchCreditInfo,customerLoading:r?.customerLoading,gtm:A,pageCommon:t.common,memberPriceDiscount:i.memberPriceDiscount,alpcBrand:p?.alpcBrand,children:[t.components.creditsNavigation&&(0,o.jsx)(B.CreditsNavigation,{copy:t.components.creditsNavigation}),(0,o.jsx)("div",{className:(0,a.classNames)("bg-[#f5f5f7] leading-[1.2]"),children:t.order.map(e=>{if(e==="creditsNavigation")return null;const n=t.components?.[e];return n?(0,o.jsxs)(o.Fragment,{children:[e==="creditsBanner"&&(0,o.jsx)(l.CreditsBanner,{copy:n,id:e}),e==="creditsInfoCard"&&r?.profile&&(0,o.jsx)(y.CreditsInfoCard,{copy:n,id:e}),e==="creditsBenefits"&&(0,o.jsx)(g.CreditsBenefits,{copy:n,id:e}),e==="creditsWaysToGetCredits"&&(0,o.jsx)(P.CreditsWaysToGetCredits,{copy:n,id:e,classNames:s.brand==="anker"?{subtitle:"text-white",equalCreditsText:"bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent"}:{subtitle:"text-[#D1D1D1]",equalCreditsText:"text-[#F6EAD0]"}}),e==="creditsAnkersolixTask"&&(0,o.jsx)(T.CreditsAnkersolixTask,{copy:n,id:e}),e==="creditsRedeemList"&&(0,o.jsx)(v.CreditsRedeemList,{copy:n,id:e}),e==="creditsCash"&&(0,o.jsx)(u.CreditsCash,{copy:n,id:e}),e==="creditsMemberPrice"&&(0,o.jsx)(b.CreditsMemberPrice,{copy:n,id:e}),e==="creditsFaq"&&(0,o.jsx)(h.CreditsFaq,{copy:n,id:e}),e!=="creditsBanner"&&(0,o.jsx)("div",{className:"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16"})]}):null})})]})})}));
|
|
2
|
-
//# sourceMappingURL=Credits.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/templates/Credits.tsx"],
|
|
4
|
-
"sourcesContent": ["import { classNames, HeadlessConfig, HeadlessProvider } from '@anker-in/lib'\nimport { RegistrationProvider } from '../components/registration/context/provider'\n\nimport { DTC_TASK_TYPE } from '../components/credits/context/const'\nimport { CreditsProvider } from '../components/credits/context/provider'\nimport { CreditsPageCommon } from '../components/credits/type'\nimport { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes'\n\nimport { CreditsBanner, CreditsBannerCopy } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard, CreditsInfoCardCopy } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits, CreditsBenefitsCopy } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits, CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsAnkersolixTask, CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask'\nimport { CreditsRedeemList, CreditsRedeemListCopy } from '../components/credits/creditsRedeemList'\nimport { CreditsCash, CreditsCashCopy } from '../components/credits/creditsCash'\nimport { CreditsMemberPrice, CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice'\nimport { CreditsFaq, CreditsFaqCopy } from '../components/credits/creditsFaq'\nimport { CreditsNavigation, CreditsNavigationCopy } from '../components/credits/creditsNavigation'\nimport { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type'\n\nexport enum ComponentKey {\n Navigation = 'creditsNavigation',\n Banner = 'creditsBanner',\n InfoCard = 'creditsInfoCard',\n Benefits = 'creditsBenefits',\n WaysToGetCredits = 'creditsWaysToGetCredits',\n AnkersolixTask = 'creditsAnkersolixTask',\n RedeemList = 'creditsRedeemList',\n SpendCreditsLikeCash = 'creditsCash',\n MemberPrice = 'creditsMemberPrice',\n Faqs = 'creditsFaq',\n}\nexport type CreditsTemplateProps = {\n headlessConfig: HeadlessConfig\n siteConfig: {\n registrationsSettings: {\n authCodeActivate: AuthCodeActivateCopy\n }\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n }\n creditsConfig?: {\n alpcBrand?: string\n }\n pageConfig: {\n order: ComponentKey[]\n common: CreditsPageCommon\n components: {\n [ComponentKey.Navigation]?: CreditsNavigationCopy\n [ComponentKey.Banner]?: CreditsBannerCopy\n [ComponentKey.InfoCard]?: CreditsInfoCardCopy\n [ComponentKey.Benefits]?: CreditsBenefitsCopy\n [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy\n [ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy\n [ComponentKey.RedeemList]?: CreditsRedeemListCopy\n [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy\n [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy\n [ComponentKey.Faqs]?: CreditsFaqCopy\n }\n }\n userContext: {\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n creditInfo: any\n customer: any\n customerLoading: boolean\n fetchCreditInfo: () => void\n }\n registrationContext: {\n openSignUpPopup: () => void\n openSignInPopup: () => void\n }\n gtm: {\n pageGroup: string\n }\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n creditsConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n}: CreditsTemplateProps) => {\n\n console.log('siteConfig', siteConfig)\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n memberPriceDiscount={siteConfig.memberPriceDiscount}\n alpcBrand={creditsConfig?.alpcBrand}\n >\n {/* \u5BFC\u822A\u7EC4\u4EF6 - \u56FA\u5B9A\u4F4D\u7F6E\uFF0C\u4E0D\u53C2\u4E0E order \u6392\u5E8F */}\n {pageConfig.components[ComponentKey.Navigation] && (\n <CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />\n )}\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n // \u8DF3\u8FC7\u5BFC\u822A\u7EC4\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u5DF2\u7ECF\u56FA\u5B9A\u6E32\u67D3\u5728\u4E0A\u65B9\n if (key === ComponentKey.Navigation) return null\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />\n )}\n {key === ComponentKey.Benefits && <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n id={key}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.AnkersolixTask && (\n <CreditsAnkersolixTask\n copy={componentCopy as CreditsAnkersolixTaskCopy}\n id={key}\n />\n )}\n {key === ComponentKey.RedeemList && <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />}\n {key === ComponentKey.SpendCreditsLikeCash && <CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />}\n {key === ComponentKey.MemberPrice && <CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n </CreditsProvider>\n </RegistrationProvider>\n </HeadlessProvider>\n )\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,oBAAAC,IAAA,eAAAC,EAAAJ,GA8GY,IAAAK,EAAA,6BA9GZC,EAA6D,yBAC7DC,EAAqC,uDAGrCA,EAAgC,kDAIhCC,EAAiD,+CACjDC,EAAqD,iDACrDC,EAAqD,iDACrDC,EAAqE,yDACrEC,EAAiE,uDACjEC,EAAyD,mDACzDC,EAA6C,6CAC7CC,EAA2D,oDAC3DC,EAA2C,4CAC3CC,EAAyD,mDAG7Cf,OACVA,EAAA,WAAa,oBACbA,EAAA,OAAS,gBACTA,EAAA,SAAW,kBACXA,EAAA,SAAW,kBACXA,EAAA,iBAAmB,0BACnBA,EAAA,eAAiB,wBACjBA,EAAA,WAAa,oBACbA,EAAA,qBAAuB,cACvBA,EAAA,YAAc,qBACdA,EAAA,KAAO,aAVGA,OAAA,IA0DL,MAAMC,EAAkB,CAAC,CAC9B,eAAAe,EACA,WAAAC,EACA,cAAAC,EACA,YAAAC,EACA,WAAAC,EACA,oBAAAC,EACA,IAAAC,CACF,KAEE,QAAQ,IAAI,aAAcL,CAAU,KAElC,OAAC,oBAAiB,eAAgBD,EAChC,mBAAC,wBAAqB,KAAMC,EAAW,sBAAuB,MAAOE,GAAa,SAAS,MACzF,oBAAC,mBACC,QAASA,GAAa,QACtB,cAAeA,GAAa,cAC5B,iBAAkBA,GAAa,iBAC/B,gBAAiBE,EAAoB,gBACrC,gBAAiBA,EAAoB,gBACrC,WAAYF,GAAa,WACzB,oBAAqBF,EAAW,oBAChC,SAAUE,GAAa,SACvB,gBAAiBA,GAAa,gBAC9B,gBAAiBA,GAAa,gBAC9B,IAAKG,EACL,WAAYF,EAAW,OACvB,oBAAqBH,EAAW,oBAChC,UAAWC,GAAe,UAGzB,UAAAE,EAAW,WAAW,sBACrB,OAAC,qBAAkB,KAAMA,EAAW,WAAW,kBAA0B,KAE3E,OAAC,OAAI,aAAW,cAAW,4BAA4B,EACpD,SAAAA,EAAW,MAAM,IAAIG,GAAO,CAE3B,GAAIA,IAAQ,oBAAyB,OAAO,KAC5C,MAAMC,EAAgBJ,EAAW,aAAaG,CAAG,EACjD,OAAKC,KAEH,oBACG,UAAAD,IAAQ,oBAAuB,OAAC,iBAAc,KAAMC,EAAoC,GAAID,EAAK,EACjGA,IAAQ,mBAAyBJ,GAAa,YAC7C,OAAC,mBAAgB,KAAMK,EAAsC,GAAID,EAAK,EAEvEA,IAAQ,sBAAyB,OAAC,mBAAgB,KAAMC,EAAsC,GAAID,EAAK,EACvGA,IAAQ,8BACP,OAAC,2BACC,KAAMC,EACN,GAAID,EACJ,WACEP,EAAe,QAAU,QACrB,CACE,SAAU,aACV,iBACE,4EACJ,EACA,CACE,SAAU,iBACV,iBAAkB,gBACpB,EAER,EAEDO,IAAQ,4BACP,OAAC,yBACC,KAAMC,EACN,GAAID,EACN,EAEDA,IAAQ,wBAA2B,OAAC,qBAAkB,KAAMC,EAAwC,GAAID,EAAK,EAC7GA,IAAQ,kBAAqC,OAAC,eAAY,KAAMC,EAAkC,GAAID,EAAK,EAC3GA,IAAQ,yBAA4B,OAAC,sBAAmB,KAAMC,EAAyC,GAAID,EAAK,EAChHA,IAAQ,iBAAqB,OAAC,cAAW,KAAMC,EAAiC,GAAID,EAAK,EACzFA,IAAQ,oBACP,OAAC,OAAI,UAAU,qEAAqE,GAExF,EAvCyB,IAyC7B,CAAC,EACH,GACF,EACF,EACF",
|
|
6
|
-
"names": ["Credits_exports", "__export", "ComponentKey", "CreditsTemplate", "__toCommonJS", "import_jsx_runtime", "import_lib", "import_provider", "import_creditsBanner", "import_creditsInfoCard", "import_creditsBenefits", "import_creditsWaysToGetCredits", "import_creditsAnkersolixTask", "import_creditsRedeemList", "import_creditsCash", "import_creditsMemberPrice", "import_creditsFaq", "import_creditsNavigation", "headlessConfig", "siteConfig", "creditsConfig", "userContext", "pageConfig", "registrationContext", "gtm", "key", "componentCopy"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ProductVariant } from '@anker-in/lib';
|
|
2
|
-
import { FunctionMemberPriceResult } from '../memberPriceTypes';
|
|
3
|
-
export declare const useFunctionMemberPrice: ({ variant }: {
|
|
4
|
-
variant?: ProductVariant;
|
|
5
|
-
}) => FunctionMemberPriceResult | (Partial<FunctionMemberPriceResult> & {
|
|
6
|
-
hasMemberPrice: false;
|
|
7
|
-
});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{getFunctionMemberPrice as c}from"../utils/getFunctionMemberPrice";import{useMemo as i}from"react";import{useCreditsContext as m}from"../provider";import{useHeadlessContext as n}from"@anker-in/lib";const d=({variant:e})=>{const{memberPriceDiscount:r}=m(),{locale:t=""}=n();return i(()=>{const o=c({memberPriceDiscount:r,currencyCode:e?.price.currencyCode,variant:e,locale:t});return o||{hasMemberPrice:!1}},[t,r,e])};export{d as useFunctionMemberPrice};
|
|
2
|
-
//# sourceMappingURL=useFunctionMemberPrice.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/context/hooks/useFunctionMemberPrice.ts"],
|
|
4
|
-
"sourcesContent": ["import { ProductVariant } from '@anker-in/lib'\nimport { FunctionMemberPriceResult } from '../memberPriceTypes'\nimport { getFunctionMemberPrice } from '../utils/getFunctionMemberPrice'\nimport { useMemo } from 'react'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\n// \u8BA1\u7B97\u5355\u4EF6\u5546\u54C1\u7684\u4F1A\u5458\u4EF7\nexport const useFunctionMemberPrice = ({ variant }: { variant?: ProductVariant }) => {\n const { memberPriceDiscount } = useCreditsContext()\n const { locale = '' } = useHeadlessContext()\n\n const memberPrice:\n | FunctionMemberPriceResult\n | (Partial<FunctionMemberPriceResult> & {\n hasMemberPrice: false\n }) = useMemo(() => {\n const result = getFunctionMemberPrice({\n memberPriceDiscount: memberPriceDiscount,\n currencyCode: variant?.price.currencyCode,\n variant,\n locale,\n })\n\n if (result) {\n return result as FunctionMemberPriceResult\n }\n\n return { hasMemberPrice: false }\n }, [locale, memberPriceDiscount, variant])\n\n return memberPrice\n}\n"],
|
|
5
|
-
"mappings": "AAEA,OAAS,0BAAAA,MAA8B,kCACvC,OAAS,WAAAC,MAAe,QACxB,OAAS,qBAAAC,MAAyB,cAClC,OAAS,sBAAAC,MAA0B,gBAG5B,MAAMC,EAAyB,CAAC,CAAE,QAAAC,CAAQ,IAAoC,CACnF,KAAM,CAAE,oBAAAC,CAAoB,EAAIJ,EAAkB,EAC5C,CAAE,OAAAK,EAAS,EAAG,EAAIJ,EAAmB,EAqB3C,OAfSF,EAAQ,IAAM,CACrB,MAAMO,EAASR,EAAuB,CACpC,oBAAqBM,EACrB,aAAcD,GAAS,MAAM,aAC7B,QAAAA,EACA,OAAAE,CACF,CAAC,EAED,OAAIC,GAIG,CAAE,eAAgB,EAAM,CACjC,EAAG,CAACD,EAAQD,EAAqBD,CAAO,CAAC,CAG3C",
|
|
6
|
-
"names": ["getFunctionMemberPrice", "useMemo", "useCreditsContext", "useHeadlessContext", "useFunctionMemberPrice", "variant", "memberPriceDiscount", "locale", "result"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useSendEmailValidation(): import("swr/mutation").SWRMutationResponse<any, any, "send-email-validation", never>;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import a from"../../../../helpers/fetcher";import i from"swr/mutation";import{useCreditsContext as n}from"../provider";import{useHeadlessContext as r}from"@anker-in/lib";function u(){const{profile:e}=n(),{appName:t,locale:o}=r();return i("send-email-validation",()=>a({locale:o,url:"/api/multipass/account/users/send_validation_email",method:"POST",body:{email:e?.email,app:t},needRecaptcha:!0,action:"verifyAccount"}))}export{u as useSendEmailValidation};
|
|
2
|
-
//# sourceMappingURL=useSendEmailValidation.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/context/hooks/useSendEmailValidation.ts"],
|
|
4
|
-
"sourcesContent": ["import fetcher from '../../../../helpers/fetcher'\nimport useSWRMutation from 'swr/mutation'\nimport { useCreditsContext } from '../provider'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport function useSendEmailValidation() {\n const { profile } = useCreditsContext()\n const { appName, locale } = useHeadlessContext()\n\n return useSWRMutation('send-email-validation', () =>\n fetcher({\n locale,\n url: '/api/multipass/account/users/send_validation_email',\n method: 'POST',\n body: { email: profile?.email, app: appName },\n needRecaptcha: true,\n action: 'verifyAccount',\n })\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAa,8BACpB,OAAOC,MAAoB,eAC3B,OAAS,qBAAAC,MAAyB,cAClC,OAAS,sBAAAC,MAA0B,gBAE5B,SAASC,GAAyB,CACvC,KAAM,CAAE,QAAAC,CAAQ,EAAIH,EAAkB,EAChC,CAAE,QAAAI,EAAS,OAAAC,CAAO,EAAIJ,EAAmB,EAE/C,OAAOF,EAAe,wBAAyB,IAC7CD,EAAQ,CACN,OAAAO,EACA,IAAK,qDACL,OAAQ,OACR,KAAM,CAAE,MAAOF,GAAS,MAAO,IAAKC,CAAQ,EAC5C,cAAe,GACf,OAAQ,eACV,CAAC,CACH,CACF",
|
|
6
|
-
"names": ["fetcher", "useSWRMutation", "useCreditsContext", "useHeadlessContext", "useSendEmailValidation", "profile", "appName", "locale"]
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SWRResponse } from 'swr';
|
|
2
|
-
import type { Subscription } from '../../type';
|
|
3
|
-
export type SubscriptionApiResponse = {
|
|
4
|
-
data: Subscription;
|
|
5
|
-
};
|
|
6
|
-
export type FetchSubscriptionResponse = SWRResponse<Subscription>;
|
|
7
|
-
export declare function useSubscriptions({ email }: {
|
|
8
|
-
email?: string;
|
|
9
|
-
}): FetchSubscriptionResponse;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import n from"swr";import r from"../../../../helpers/fetcher";import{useHeadlessContext as c}from"@anker-in/lib";function m({email:s}){const{locale:t}=c(),{data:e,...o}=n(s?["/api/multipass/account/subscriptions",s]:null,async([p,i])=>r({method:"GET",url:p,body:{email:i},action:"login",locale:t,headers:{},type:""}));return{data:e?.data,...o}}export{m as useSubscriptions};
|
|
2
|
-
//# sourceMappingURL=useSubscriptions.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/context/hooks/useSubscriptions.ts"],
|
|
4
|
-
"sourcesContent": ["import useSWR, { SWRResponse } from 'swr'\nimport type { Subscription } from '../../type'\nimport fetcher from '../../../../helpers/fetcher'\nimport { useHeadlessContext } from '@anker-in/lib'\n\nexport type SubscriptionApiResponse = { data: Subscription }\nexport type FetchSubscriptionResponse = SWRResponse<Subscription>\n\nexport function useSubscriptions({ email }: { email?: string }): FetchSubscriptionResponse {\n const { locale } = useHeadlessContext()\n\n const { data, ...rest } = useSWR<SubscriptionApiResponse>(\n email ? ['/api/multipass/account/subscriptions', email] : null,\n async ([url, email]) =>\n fetcher({\n method: 'GET',\n url,\n body: {\n email,\n },\n action: 'login',\n locale,\n headers: {},\n type: '',\n })\n )\n\n return { data: data?.data, ...rest } as unknown as FetchSubscriptionResponse\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAA6B,MAEpC,OAAOC,MAAa,8BACpB,OAAS,sBAAAC,MAA0B,gBAK5B,SAASC,EAAiB,CAAE,MAAAC,CAAM,EAAkD,CACzF,KAAM,CAAE,OAAAC,CAAO,EAAIH,EAAmB,EAEhC,CAAE,KAAAI,EAAM,GAAGC,CAAK,EAAIP,EACxBI,EAAQ,CAAC,uCAAwCA,CAAK,EAAI,KAC1D,MAAO,CAACI,EAAKJ,CAAK,IAChBH,EAAQ,CACN,OAAQ,MACR,IAAAO,EACA,KAAM,CACJ,MAAAJ,CACF,EACA,OAAQ,QACR,OAAAC,EACA,QAAS,CAAC,EACV,KAAM,EACR,CAAC,CACL,EAEA,MAAO,CAAE,KAAMC,GAAM,KAAM,GAAGC,CAAK,CACrC",
|
|
6
|
-
"names": ["useSWR", "fetcher", "useHeadlessContext", "useSubscriptions", "email", "locale", "data", "rest", "url"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function atobID(id: string): string | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/context/utils/atobID.ts"],
|
|
4
|
-
"sourcesContent": ["// \u4ECE Shopify GraphQL ID \u4E2D\u63D0\u53D6\u6570\u5B57 ID\nexport function atobID(id: string) {\n if (id && typeof id === 'string' && id.includes('/')) {\n return id.split('/').pop()?.split('?')?.shift()\n } else {\n return id\n }\n}\n"],
|
|
5
|
-
"mappings": "AACO,SAASA,EAAOC,EAAY,CACjC,OAAIA,GAAM,OAAOA,GAAO,UAAYA,EAAG,SAAS,GAAG,EAC1CA,EAAG,MAAM,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,GAAG,MAAM,EAEvCA,CAEX",
|
|
6
|
-
"names": ["atobID", "id"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{FunctionDiscountType as c,RoundSelected as i}from"../memberPriceConst";import n from"decimal.js";const b=({config:t,price:o})=>{const{apply_price_ending:r,one_decimal_place:a,two_decimal_place:u,round_selected:s}=t.price_ending_conf||{};let e=new n(o);switch(t.discount_type){case c.Percentage:e=e.mul(100-t.discount_value).div(100);break;case c.FixedAmount:e=e.sub(t.discount_value);break;case c.FixedPrice:e=new n(t.discount_value);break;default:break}if(r){switch(s){case i.RoundHighest:e=e.ceil();break;case i.RoundLowest:e=e.floor();break;case i.RoundNearest:e=e.round();break;default:e=new n(e.toFixed(2,n.ROUND_DOWN));break}const d=e.toString().split(".");e=new n(d[0]+"."+a+u)}return e.toNumber()};export{b as functionDiscountCalculate};
|
|
2
|
-
//# sourceMappingURL=functionDiscountCalculate.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/context/utils/functionDiscountCalculate.ts"],
|
|
4
|
-
"sourcesContent": ["import { FunctionDiscountType, RoundSelected } from '../memberPriceConst'\nimport { DiscountConfig } from '../memberPriceTypes'\nimport Decimal from 'decimal.js'\n\n// Function \u8BA1\u7B97\u6298\u540E\u4EF7\nexport const functionDiscountCalculate = ({\n config,\n price,\n}: {\n config: DiscountConfig\n price: number\n}) => {\n const { apply_price_ending, one_decimal_place, two_decimal_place, round_selected } =\n config.price_ending_conf || {}\n\n let salePrice = new Decimal(price)\n\n switch (config.discount_type) {\n // \u767E\u5206\u6BD4\u6298\u6263\n case FunctionDiscountType.Percentage:\n salePrice = salePrice.mul(100 - config.discount_value).div(100)\n break\n // \u56FA\u5B9A\u91D1\u989D\u6298\u6263\n case FunctionDiscountType.FixedAmount:\n salePrice = salePrice.sub(config.discount_value)\n break\n // \u56FA\u5B9A\u4EF7\u683C\u6298\u6263\n case FunctionDiscountType.FixedPrice:\n salePrice = new Decimal(config.discount_value)\n break\n default:\n break\n }\n\n if (apply_price_ending) {\n // \u5C0F\u6570\u4F4D\u53D6\u820D\n switch (round_selected) {\n case RoundSelected.RoundHighest:\n salePrice = salePrice.ceil()\n break\n case RoundSelected.RoundLowest:\n salePrice = salePrice.floor()\n break\n case RoundSelected.RoundNearest:\n salePrice = salePrice.round()\n break\n default:\n salePrice = new Decimal(salePrice.toFixed(2, Decimal.ROUND_DOWN))\n break\n }\n\n const priceEnding = salePrice.toString().split('.')\n salePrice = new Decimal(priceEnding[0] + '.' + one_decimal_place + two_decimal_place)\n }\n\n return salePrice.toNumber()\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,wBAAAA,EAAsB,iBAAAC,MAAqB,sBAEpD,OAAOC,MAAa,aAGb,MAAMC,EAA4B,CAAC,CACxC,OAAAC,EACA,MAAAC,CACF,IAGM,CACJ,KAAM,CAAE,mBAAAC,EAAoB,kBAAAC,EAAmB,kBAAAC,EAAmB,eAAAC,CAAe,EAC/EL,EAAO,mBAAqB,CAAC,EAE/B,IAAIM,EAAY,IAAIR,EAAQG,CAAK,EAEjC,OAAQD,EAAO,cAAe,CAE5B,KAAKJ,EAAqB,WACxBU,EAAYA,EAAU,IAAI,IAAMN,EAAO,cAAc,EAAE,IAAI,GAAG,EAC9D,MAEF,KAAKJ,EAAqB,YACxBU,EAAYA,EAAU,IAAIN,EAAO,cAAc,EAC/C,MAEF,KAAKJ,EAAqB,WACxBU,EAAY,IAAIR,EAAQE,EAAO,cAAc,EAC7C,MACF,QACE,KACJ,CAEA,GAAIE,EAAoB,CAEtB,OAAQG,EAAgB,CACtB,KAAKR,EAAc,aACjBS,EAAYA,EAAU,KAAK,EAC3B,MACF,KAAKT,EAAc,YACjBS,EAAYA,EAAU,MAAM,EAC5B,MACF,KAAKT,EAAc,aACjBS,EAAYA,EAAU,MAAM,EAC5B,MACF,QACEA,EAAY,IAAIR,EAAQQ,EAAU,QAAQ,EAAGR,EAAQ,UAAU,CAAC,EAChE,KACJ,CAEA,MAAMS,EAAcD,EAAU,SAAS,EAAE,MAAM,GAAG,EAClDA,EAAY,IAAIR,EAAQS,EAAY,CAAC,EAAI,IAAMJ,EAAoBC,CAAiB,CACtF,CAEA,OAAOE,EAAU,SAAS,CAC5B",
|
|
6
|
-
"names": ["FunctionDiscountType", "RoundSelected", "Decimal", "functionDiscountCalculate", "config", "price", "apply_price_ending", "one_decimal_place", "two_decimal_place", "round_selected", "salePrice", "priceEnding"]
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionMemberPriceConfig, FunctionMemberPriceResult } from '../memberPriceTypes';
|
|
2
|
-
import { ProductVariant } from '@anker-in/lib';
|
|
3
|
-
export declare const getFunctionMemberPrice: ({ memberPriceDiscount, currencyCode, variant, locale, }: {
|
|
4
|
-
memberPriceDiscount?: FunctionMemberPriceConfig[];
|
|
5
|
-
currencyCode?: string;
|
|
6
|
-
variant?: ProductVariant;
|
|
7
|
-
locale: string;
|
|
8
|
-
}) => false | FunctionMemberPriceResult;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{formatPrice as o}from"../utils";import{functionDiscountCalculate as b}from"./functionDiscountCalculate";import n from"decimal.js";import{getFunctionMemberPriceDiscountConfig as D}from"./getFunctionMemberPriceDiscountConfig";import d from"./variantGetCoupon";const V=({memberPriceDiscount:l,currencyCode:r,variant:e,locale:i})=>{const m=d({variant:e}),{memberPriceDiscountConfig:c,activeMemberPriceConfig:y}=D({config:l,variant:e}),s=!!y?.discount_combinations.other_product_discounts;if(!c)return!1;const u={amount:e?.price.amount||0,priceWithCurrency:o({amount:e?.price.amount||0,currencyCode:r||"USD",locale:i})},t=c?b({config:c,price:e?.price.amount||0}):e?.price.amount||0,a={amount:t,priceWithCurrency:o({amount:t,currencyCode:r||"USD",locale:i})};let p=t;if(m?.variant_price4wscode&&e&&s)if(s){const P=new n(e.price.amount).minus(m.variant_price4wscode);p=new n(t).minus(P).toNumber()}else{const P=new n(e.price.amount).minus(m.variant_price4wscode);if(t>P.toNumber())return!1}const C={amount:p,priceWithCurrency:o({amount:p,currencyCode:r||"USD",locale:i})},h=new n(u.amount).minus(C.amount).toNumber(),f={amount:h,priceWithCurrency:o({amount:h,currencyCode:r||"USD",locale:i,maximumFractionDigits:2})},W=new n(u.amount).minus(a.amount).toNumber(),g={amount:W,priceWithCurrency:o({amount:W,currencyCode:r||"USD",locale:i,maximumFractionDigits:2})};return{hasMemberPrice:!!c,useCoupon:s,originalPrice:u.amount,originalPriceWithCurrency:u.priceWithCurrency,salePrice:C.amount,salePriceWithCurrency:C.priceWithCurrency,salePriceWithoutCoupon:a.amount,salePriceWithoutCouponWithCurrency:a.priceWithCurrency,savePrice:f.amount,savePriceWithCurrency:f.priceWithCurrency,savePriceWithoutCoupon:g.amount,savePriceWithoutCouponWithCurrency:g.priceWithCurrency}};export{V as getFunctionMemberPrice};
|
|
2
|
-
//# sourceMappingURL=getFunctionMemberPrice.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/context/utils/getFunctionMemberPrice.ts"],
|
|
4
|
-
"sourcesContent": ["import { formatPrice } from '../utils'\nimport { FunctionMemberPriceConfig, FunctionMemberPriceResult } from '../memberPriceTypes'\nimport { ProductVariant } from '@anker-in/lib'\nimport { functionDiscountCalculate } from './functionDiscountCalculate'\nimport Decimal from 'decimal.js'\nimport { getFunctionMemberPriceDiscountConfig } from './getFunctionMemberPriceDiscountConfig'\nimport variantGetCoupon from './variantGetCoupon'\n\n// \u8BA1\u7B97\u5355\u4EF6\u5546\u54C1\u7684\u4F1A\u5458\u4EF7\nexport const getFunctionMemberPrice = ({\n memberPriceDiscount,\n currencyCode,\n variant,\n locale,\n}: {\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n currencyCode?: string\n variant?: ProductVariant\n locale: string\n}) => {\n const couponData = variantGetCoupon({ variant })\n\n // variant\u5BF9\u5E94\u7684\u4F1A\u5458\u4EF7\u6298\u6263\u914D\u7F6E\n const { memberPriceDiscountConfig, activeMemberPriceConfig } = getFunctionMemberPriceDiscountConfig({\n config: memberPriceDiscount,\n variant,\n })\n\n const useCoupon = !!activeMemberPriceConfig?.discount_combinations.other_product_discounts\n\n if (!memberPriceDiscountConfig) {\n return false as false\n }\n\n const originalPrice = {\n amount: variant?.price.amount || 0,\n priceWithCurrency: formatPrice({\n amount: variant?.price.amount || 0,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n const salePriceWithoutCouponAmount = memberPriceDiscountConfig\n ? functionDiscountCalculate({\n config: memberPriceDiscountConfig,\n price: variant?.price.amount || 0,\n })\n : variant?.price.amount || 0\n const salePriceWithoutCoupon = {\n amount: salePriceWithoutCouponAmount,\n priceWithCurrency: formatPrice({\n amount: salePriceWithoutCouponAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n // function \u4F1A\u5458\u4EF7\u662F\u5728\u539F\u4EF7\u7684\u57FA\u7840\u4E0A\u8FDB\u884C\u8BA1\u7B97\uFF0C\u6682\u4E0D\u652F\u6301\u6298\u540E\u4EF7\n let salePriceAmount = salePriceWithoutCouponAmount\n\n // \u51CF\u53BBcode\u7684\u4F18\u60E0\n if (couponData?.variant_price4wscode && variant && useCoupon) {\n if (useCoupon) {\n // code\u7684\u4F18\u60E0\u91D1\u989D\n const codeSaveAmountDecimal = new Decimal(variant.price.amount).minus(couponData.variant_price4wscode)\n salePriceAmount = new Decimal(salePriceWithoutCouponAmount).minus(codeSaveAmountDecimal).toNumber()\n } else {\n // \u4E0D\u80FD\u4E0E code \u540C\u65F6\u4F7F\u7528\uFF0C\u9700\u8981\u5224\u65AD\u4F1A\u5458\u4EF7\u662F\u5426\u5C0F\u4E8E code \u7684\u4F18\u60E0\u91D1\u989D\uFF0C\u5982\u679C\u5C0F\u4E8E\u5219\u5F53\u505A\u6CA1\u6709\u4F1A\u5458\u4EF7\n const codeSaveAmountDecimal = new Decimal(variant.price.amount).minus(couponData.variant_price4wscode)\n if (salePriceWithoutCouponAmount > codeSaveAmountDecimal.toNumber()) {\n return false as false\n }\n }\n }\n\n const salePrice = {\n amount: salePriceAmount,\n priceWithCurrency: formatPrice({\n amount: salePriceAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n }),\n }\n\n const savePriceAmount = new Decimal(originalPrice.amount).minus(salePrice.amount).toNumber()\n const savePrice = {\n amount: savePriceAmount,\n priceWithCurrency: formatPrice({\n amount: savePriceAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n }),\n }\n\n const savePriceWithoutCouponAmount = new Decimal(originalPrice.amount)\n .minus(salePriceWithoutCoupon.amount)\n .toNumber()\n const savePriceWithoutCoupon = {\n amount: savePriceWithoutCouponAmount,\n priceWithCurrency: formatPrice({\n amount: savePriceWithoutCouponAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n }),\n }\n\n const result: FunctionMemberPriceResult = {\n // \u662F\u5426\u5B58\u5728\u4F1A\u5458\u4EF7\n hasMemberPrice: !!memberPriceDiscountConfig,\n useCoupon,\n // \u539F\u4EF7\n originalPrice: originalPrice.amount,\n originalPriceWithCurrency: originalPrice.priceWithCurrency as string,\n // \u4F7F\u7528\u5238\u540E\u7684\u6298\u540E\u4EF7\n salePrice: salePrice.amount,\n salePriceWithCurrency: salePrice.priceWithCurrency as string,\n\n // \u4E0D\u4F7F\u7528\u5238\u7684\u6298\u540E\u4EF7\n salePriceWithoutCoupon: salePriceWithoutCoupon.amount,\n salePriceWithoutCouponWithCurrency: salePriceWithoutCoupon.priceWithCurrency as string,\n\n // \u5305\u542B\u4F7F\u7528\u5238\u7684\u8282\u7701\u91D1\u989D\n savePrice: savePrice.amount,\n savePriceWithCurrency: savePrice.priceWithCurrency as string,\n\n // \u4E0D\u4F7F\u7528\u5238\u7684\u8282\u7701\u91D1\u989D\n savePriceWithoutCoupon: savePriceWithoutCoupon.amount,\n savePriceWithoutCouponWithCurrency: savePriceWithoutCoupon.priceWithCurrency as string,\n }\n\n return result\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,eAAAA,MAAmB,WAG5B,OAAS,6BAAAC,MAAiC,8BAC1C,OAAOC,MAAa,aACpB,OAAS,wCAAAC,MAA4C,yCACrD,OAAOC,MAAsB,qBAGtB,MAAMC,EAAyB,CAAC,CACrC,oBAAAC,EACA,aAAAC,EACA,QAAAC,EACA,OAAAC,CACF,IAKM,CACJ,MAAMC,EAAaN,EAAiB,CAAE,QAAAI,CAAQ,CAAC,EAGzC,CAAE,0BAAAG,EAA2B,wBAAAC,CAAwB,EAAIT,EAAqC,CAClG,OAAQG,EACR,QAAAE,CACF,CAAC,EAEKK,EAAY,CAAC,CAACD,GAAyB,sBAAsB,wBAEnE,GAAI,CAACD,EACH,MAAO,GAGT,MAAMG,EAAgB,CACpB,OAAQN,GAAS,MAAM,QAAU,EACjC,kBAAmBR,EAAY,CAC7B,OAAQQ,GAAS,MAAM,QAAU,EACjC,aAAcD,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAEMM,EAA+BJ,EACjCV,EAA0B,CACxB,OAAQU,EACR,MAAOH,GAAS,MAAM,QAAU,CAClC,CAAC,EACDA,GAAS,MAAM,QAAU,EACvBQ,EAAyB,CAC7B,OAAQD,EACR,kBAAmBf,EAAY,CAC7B,OAAQe,EACR,aAAcR,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAGA,IAAIQ,EAAkBF,EAGtB,GAAIL,GAAY,sBAAwBF,GAAWK,EACjD,GAAIA,EAAW,CAEb,MAAMK,EAAwB,IAAIhB,EAAQM,EAAQ,MAAM,MAAM,EAAE,MAAME,EAAW,oBAAoB,EACrGO,EAAkB,IAAIf,EAAQa,CAA4B,EAAE,MAAMG,CAAqB,EAAE,SAAS,CACpG,KAAO,CAEL,MAAMA,EAAwB,IAAIhB,EAAQM,EAAQ,MAAM,MAAM,EAAE,MAAME,EAAW,oBAAoB,EACrG,GAAIK,EAA+BG,EAAsB,SAAS,EAChE,MAAO,EAEX,CAGF,MAAMC,EAAY,CAChB,OAAQF,EACR,kBAAmBjB,EAAY,CAC7B,OAAQiB,EACR,aAAcV,GAAgB,MAC9B,OAAAE,CACF,CAAC,CACH,EAEMW,EAAkB,IAAIlB,EAAQY,EAAc,MAAM,EAAE,MAAMK,EAAU,MAAM,EAAE,SAAS,EACrFE,EAAY,CAChB,OAAQD,EACR,kBAAmBpB,EAAY,CAC7B,OAAQoB,EACR,aAAcb,GAAgB,MAC9B,OAAAE,EACA,sBAAuB,CACzB,CAAC,CACH,EAEMa,EAA+B,IAAIpB,EAAQY,EAAc,MAAM,EAClE,MAAME,EAAuB,MAAM,EACnC,SAAS,EACNO,EAAyB,CAC7B,OAAQD,EACR,kBAAmBtB,EAAY,CAC7B,OAAQsB,EACR,aAAcf,GAAgB,MAC9B,OAAAE,EACA,sBAAuB,CACzB,CAAC,CACH,EA0BA,MAxB0C,CAExC,eAAgB,CAAC,CAACE,EAClB,UAAAE,EAEA,cAAeC,EAAc,OAC7B,0BAA2BA,EAAc,kBAEzC,UAAWK,EAAU,OACrB,sBAAuBA,EAAU,kBAGjC,uBAAwBH,EAAuB,OAC/C,mCAAoCA,EAAuB,kBAG3D,UAAWK,EAAU,OACrB,sBAAuBA,EAAU,kBAGjC,uBAAwBE,EAAuB,OAC/C,mCAAoCA,EAAuB,iBAC7D,CAGF",
|
|
6
|
-
"names": ["formatPrice", "functionDiscountCalculate", "Decimal", "getFunctionMemberPriceDiscountConfig", "variantGetCoupon", "getFunctionMemberPrice", "memberPriceDiscount", "currencyCode", "variant", "locale", "couponData", "memberPriceDiscountConfig", "activeMemberPriceConfig", "useCoupon", "originalPrice", "salePriceWithoutCouponAmount", "salePriceWithoutCoupon", "salePriceAmount", "codeSaveAmountDecimal", "salePrice", "savePriceAmount", "savePrice", "savePriceWithoutCouponAmount", "savePriceWithoutCoupon"]
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DiscountConfig, FunctionMemberPriceConfig } from '../memberPriceTypes';
|
|
2
|
-
import { ProductVariant } from '@anker-in/lib';
|
|
3
|
-
export declare const getFunctionMemberPriceDiscountConfig: ({ config, variant, }: {
|
|
4
|
-
config?: FunctionMemberPriceConfig[];
|
|
5
|
-
variant?: ProductVariant;
|
|
6
|
-
}) => {
|
|
7
|
-
memberPriceDiscountConfig: DiscountConfig | undefined;
|
|
8
|
-
activeMemberPriceConfig: FunctionMemberPriceConfig | undefined;
|
|
9
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{atobID as f}from"./atobID";const b=({config:e,variant:t})=>{let i,r;if(!e||!t)return{memberPriceDiscountConfig:i,activeMemberPriceConfig:r};for(const o of e)if(i=o.result_detail.member_discounts?.find(n=>n.main_products.all_store_variant?n:n.main_products.variants.find(c=>String(c.variant_id)===f(t.id)))?.discount_conf,i){r=o;break}return i?{memberPriceDiscountConfig:i,activeMemberPriceConfig:r}:{memberPriceDiscountConfig:i,activeMemberPriceConfig:r}};export{b as getFunctionMemberPriceDiscountConfig};
|
|
2
|
-
//# sourceMappingURL=getFunctionMemberPriceDiscountConfig.js.map
|
package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts"],
|
|
4
|
-
"sourcesContent": ["import { DiscountConfig, FunctionMemberPriceConfig } from '../memberPriceTypes'\nimport { ProductVariant } from '@anker-in/lib'\nimport { atobID } from './atobID'\n\n// \u83B7\u53D6\u4F1A\u5458\u4EF7\u6298\u6263\u914D\u7F6E\nexport const getFunctionMemberPriceDiscountConfig = ({\n config,\n variant,\n}: {\n config?: FunctionMemberPriceConfig[]\n variant?: ProductVariant\n}) => {\n let memberPriceDiscountConfig: DiscountConfig | undefined\n let activeMemberPriceConfig: FunctionMemberPriceConfig | undefined\n\n if (!config || !variant) {\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n }\n\n for (const configItem of config) {\n memberPriceDiscountConfig = configItem.result_detail.member_discounts?.find(discountItem => {\n if (discountItem.main_products.all_store_variant) {\n return discountItem\n }\n\n return discountItem.main_products.variants.find(\n variantConfig => String(variantConfig.variant_id) === atobID(variant.id as string)\n )\n })?.discount_conf\n\n if (memberPriceDiscountConfig) {\n activeMemberPriceConfig = configItem\n break\n }\n }\n\n if (!memberPriceDiscountConfig) {\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n }\n\n return {\n memberPriceDiscountConfig,\n activeMemberPriceConfig,\n }\n}\n"],
|
|
5
|
-
"mappings": "AAEA,OAAS,UAAAA,MAAc,WAGhB,MAAMC,EAAuC,CAAC,CACnD,OAAAC,EACA,QAAAC,CACF,IAGM,CACJ,IAAIC,EACAC,EAEJ,GAAI,CAACH,GAAU,CAACC,EACd,MAAO,CACL,0BAAAC,EACA,wBAAAC,CACF,EAGF,UAAWC,KAAcJ,EAWvB,GAVAE,EAA4BE,EAAW,cAAc,kBAAkB,KAAKC,GACtEA,EAAa,cAAc,kBACtBA,EAGFA,EAAa,cAAc,SAAS,KACzCC,GAAiB,OAAOA,EAAc,UAAU,IAAMR,EAAOG,EAAQ,EAAY,CACnF,CACD,GAAG,cAEAC,EAA2B,CAC7BC,EAA0BC,EAC1B,KACF,CAGF,OAAKF,EAOE,CACL,0BAAAA,EACA,wBAAAC,CACF,EATS,CACL,0BAAAD,EACA,wBAAAC,CACF,CAOJ",
|
|
6
|
-
"names": ["atobID", "getFunctionMemberPriceDiscountConfig", "config", "variant", "memberPriceDiscountConfig", "activeMemberPriceConfig", "configItem", "discountItem", "variantConfig"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{atobID as a}from"./atobID";const r=({variant:e,channel:i=""})=>{if(!e)return;const s="wsch";return(e?.metafields?.discountCodeApp||[])?.filter(t=>{const n=a(e.id);return(!t?.ends_at||new Date(t?.ends_at).getTime()>new Date().getTime())&&new Date(t?.starts_at).getTime()<=new Date().getTime()&&t.variant_shopify_id===+(n||"")&&(i?t?.title?.toLocaleLowerCase().includes(i):!t?.title?.toLocaleLowerCase().includes(s))})?.[0]};var f=r;export{f as default};
|
|
2
|
-
//# sourceMappingURL=variantGetCoupon.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/components/credits/context/utils/variantGetCoupon.ts"],
|
|
4
|
-
"sourcesContent": ["import { ProductVariant } from '@anker-in/lib'\nimport { atobID } from './atobID'\n\nconst variantGetCoupon = ({\n variant,\n channel = '',\n}: {\n variant?: ProductVariant\n channel?: string\n}) => {\n if (!variant) return undefined\n\n const hideChannel = 'wsch'\n const discountCodeApp = variant?.metafields?.discountCodeApp || []\n\n const results = discountCodeApp?.filter((coupon: any) => {\n const variantId = atobID(variant.id as string)\n const isActive =\n (!coupon?.ends_at || new Date(coupon?.ends_at).getTime() > new Date().getTime()) &&\n new Date(coupon?.starts_at).getTime() <= new Date().getTime() &&\n coupon.variant_shopify_id === +(variantId || '')\n\n return (\n isActive &&\n (channel\n ? coupon?.title?.toLocaleLowerCase().includes(channel)\n : !coupon?.title?.toLocaleLowerCase().includes(hideChannel))\n )\n })\n\n return results?.[0]\n}\n\nexport default variantGetCoupon\n"],
|
|
5
|
-
"mappings": "AACA,OAAS,UAAAA,MAAc,WAEvB,MAAMC,EAAmB,CAAC,CACxB,QAAAC,EACA,QAAAC,EAAU,EACZ,IAGM,CACJ,GAAI,CAACD,EAAS,OAEd,MAAME,EAAc,OAkBpB,OAjBwBF,GAAS,YAAY,iBAAmB,CAAC,IAEhC,OAAQG,GAAgB,CACvD,MAAMC,EAAYN,EAAOE,EAAQ,EAAY,EAM7C,OAJG,CAACG,GAAQ,SAAW,IAAI,KAAKA,GAAQ,OAAO,EAAE,QAAQ,EAAI,IAAI,KAAK,EAAE,QAAQ,IAC9E,IAAI,KAAKA,GAAQ,SAAS,EAAE,QAAQ,GAAK,IAAI,KAAK,EAAE,QAAQ,GAC5DA,EAAO,qBAAuB,EAAEC,GAAa,MAI5CH,EACGE,GAAQ,OAAO,kBAAkB,EAAE,SAASF,CAAO,EACnD,CAACE,GAAQ,OAAO,kBAAkB,EAAE,SAASD,CAAW,EAEhE,CAAC,IAEgB,CAAC,CACpB,EAEA,IAAOG,EAAQN",
|
|
6
|
-
"names": ["atobID", "variantGetCoupon", "variant", "channel", "hideChannel", "coupon", "variantId", "variantGetCoupon_default"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as i}from"react/jsx-runtime";import{Heading as u,Picture as g,Text as r}from"@anker-in/headless-ui";import{classNames as n,useHeadlessContext as v}from"@anker-in/lib";import F from"./IconInfo";import{ROUNDED_BRANDS as N}from"../../../constants";const h=({item:e,handleClick:x,isNoteActive:m,index:p,bigIcon:c,cardBgColor:l,cardBorderColor:d})=>{const{brand:b}=v(),s=N.includes(b),f=c?"mb-[16px] size-[64px] xl-xxl:size-[54px] xl:size-[48px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0":"mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0";console.log("cardBgColor in BenefitItem",l);const o={};return l?o.background=l:o.background="linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)",d&&(o.borderColor=d),t("div",{className:n("relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]",!s&&"rounded-none"),style:o,children:i("div",{className:"flex flex-col",children:[t(g,{className:f,alt:e.icon?.alt,source:e.icon?.url}),i("div",{className:"flex items-center",children:[t(u,{html:e.text,size:"2",className:"break-all md-l:line-clamp-3"}),e.note&&i("div",{role:"button",tabIndex:0,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&a.preventDefault()},className:"relative mb-1 ml-[4px]",onClick:()=>x({item:e,index:p}),children:[t(F,{}),t("div",{className:n("absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]",m?"block":"hidden"),children:i("div",{className:n("relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow",!s&&"rounded-none"),children:[t(r,{as:"p",size:"2",html:e.note,className:"desktop:text-[18px]"}),t("div",{className:n("absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]",!s&&"rounded-none")})]})})]})]}),e.tag&&t(r,{as:"div",html:e.tag,className:"mt-[2px] text-[16px] font-bold text-[#6D6D6F]"})]})})};var z=h;export{z as default};
|
|
2
|
-
//# sourceMappingURL=BenefitItem.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/components/credits/creditsBenefits/BenefitItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport IconInfo from './IconInfo'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport interface BenefitItemCopy {\n icon: {\n alt: string\n url: string\n }\n text: string\n note?: string\n tag?: string\n}\nconst BenefitItem = ({\n item,\n handleClick,\n isNoteActive,\n index,\n bigIcon,\n cardBgColor,\n cardBorderColor,\n}: {\n item: BenefitItemCopy\n handleClick: ({ item, index }: { item: BenefitItemCopy; index: number }) => void\n isNoteActive: boolean\n index: number\n bigIcon?: boolean\n cardBgColor?: string\n cardBorderColor?: string\n}) => {\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n // \u6839\u636E bigIcon \u8BBE\u7F6E\u4E0D\u540C\u5C4F\u5E55\u4E0B\u7684\u56FE\u6807\u5927\u5C0F\n // \u5C3A\u5BF8\uFF1A\u22651921px=64px, 1441-1920px=54px, \u22641440px=48px\n const iconSizeClass = bigIcon\n ? 'mb-[16px] size-[64px] xl-xxl:size-[54px] xl:size-[48px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0'\n : 'mb-[16px] size-[31px] md:absolute md:bottom-[16px] md:right-[16px] md:mb-0'\n\n console.log('cardBgColor in BenefitItem', cardBgColor)\n // \u80CC\u666F\u8272\u548C\u8FB9\u6846\u8272\u5904\u7406\n const cardStyle: React.CSSProperties = {}\n if (cardBgColor) {\n cardStyle.background = cardBgColor\n } else {\n cardStyle.background = 'linear-gradient(119.61deg, #FAFAFA 38.58%, #FFFFFF 63.73%, #F9FCFF 89.37%)'\n }\n if (cardBorderColor) {\n cardStyle.borderColor = cardBorderColor\n }\n\n return (\n <div\n className={cn(\n 'relative flex-1 flex flex-col rounded-[16px] border border-white px-[24px] pb-[26px] pt-[24px] md:min-h-[180px] md:p-[16px]',\n !rounded && 'rounded-none'\n )}\n style={cardStyle}\n >\n <div className=\"flex flex-col\">\n <Picture className={iconSizeClass} alt={item.icon?.alt} source={item.icon?.url} />\n <div className=\"flex items-center\">\n <Heading html={item.text} size=\"2\" className=\"break-all md-l:line-clamp-3\" />\n {item.note && (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n className=\"relative mb-1 ml-[4px]\"\n onClick={() => handleClick({ item, index })}\n >\n <IconInfo />\n <div\n className={cn(\n 'absolute -bottom-[12px] left-[32px] z-10 w-[356px] -translate-x-full translate-y-full md:w-[276px]',\n isNoteActive ? 'block' : 'hidden'\n )}\n >\n <div\n className={cn(\n 'relative rounded-[10px] bg-[#6D6D6F] p-[16px] text-[14px] font-medium text-white shadow',\n !rounded && 'rounded-none'\n )}\n >\n <Text as=\"p\" size=\"2\" html={item.note} className=\"desktop:text-[18px]\" />\n <div\n className={cn(\n 'absolute -top-[10px] right-[9px] mb-2 size-[16px] origin-top-left rotate-45 transform rounded-[2px] bg-[#6D6D6F]',\n !rounded && 'rounded-none'\n )}\n />\n </div>\n </div>\n </div>\n )}\n </div>\n {item.tag && <Text as=\"div\" html={item.tag} className=\"mt-[2px] text-[16px] font-bold text-[#6D6D6F]\" />}\n </div>\n </div>\n )\n}\n\nexport default BenefitItem\n"],
|
|
5
|
-
"mappings": "AA6DQ,cAAAA,EAsBQ,QAAAC,MAtBR,oBA7DR,OAAS,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,wBACvC,OAAS,cAAcC,EAAI,sBAAAC,MAA0B,gBACrD,OAAOC,MAAc,aACrB,OAAS,kBAAAC,MAAsB,qBAW/B,MAAMC,EAAc,CAAC,CACnB,KAAAC,EACA,YAAAC,EACA,aAAAC,EACA,MAAAC,EACA,QAAAC,EACA,YAAAC,EACA,gBAAAC,CACF,IAQM,CACJ,KAAM,CAAE,MAAAC,CAAM,EAAIX,EAAmB,EAC/BY,EAAUV,EAAe,SAASS,CAAK,EAIvCE,EAAgBL,EAClB,+GACA,6EAEJ,QAAQ,IAAI,6BAA8BC,CAAW,EAErD,MAAMK,EAAiC,CAAC,EACxC,OAAIL,EACFK,EAAU,WAAaL,EAEvBK,EAAU,WAAa,6EAErBJ,IACFI,EAAU,YAAcJ,GAIxBhB,EAAC,OACC,UAAWK,EACT,8HACA,CAACa,GAAW,cACd,EACA,MAAOE,EAEP,SAAAnB,EAAC,OAAI,UAAU,gBACb,UAAAD,EAACG,EAAA,CAAQ,UAAWgB,EAAe,IAAKT,EAAK,MAAM,IAAK,OAAQA,EAAK,MAAM,IAAK,EAChFT,EAAC,OAAI,UAAU,oBACb,UAAAD,EAACE,EAAA,CAAQ,KAAMQ,EAAK,KAAM,KAAK,IAAI,UAAU,8BAA8B,EAC1EA,EAAK,MACJT,EAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWoB,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EACA,UAAU,yBACV,QAAS,IAAMV,EAAY,CAAE,KAAAD,EAAM,MAAAG,CAAM,CAAC,EAE1C,UAAAb,EAACO,EAAA,EAAS,EACVP,EAAC,OACC,UAAWK,EACT,qGACAO,EAAe,QAAU,QAC3B,EAEA,SAAAX,EAAC,OACC,UAAWI,EACT,0FACA,CAACa,GAAW,cACd,EAEA,UAAAlB,EAACI,EAAA,CAAK,GAAG,IAAI,KAAK,IAAI,KAAMM,EAAK,KAAM,UAAU,sBAAsB,EACvEV,EAAC,OACC,UAAWK,EACT,mHACA,CAACa,GAAW,cACd,EACF,GACF,EACF,GACF,GAEJ,EACCR,EAAK,KAAOV,EAACI,EAAA,CAAK,GAAG,MAAM,KAAMM,EAAK,IAAK,UAAU,gDAAgD,GACxG,EACF,CAEJ,EAEA,IAAOY,EAAQb",
|
|
6
|
-
"names": ["jsx", "jsxs", "Heading", "Picture", "Text", "cn", "useHeadlessContext", "IconInfo", "ROUNDED_BRANDS", "BenefitItem", "item", "handleClick", "isNoteActive", "index", "bigIcon", "cardBgColor", "cardBorderColor", "brand", "rounded", "iconSizeClass", "cardStyle", "e", "BenefitItem_default"]
|
|
7
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare function getAsyncError(res: {
|
|
2
|
-
json: () => any;
|
|
3
|
-
status: any;
|
|
4
|
-
statusText: any;
|
|
5
|
-
}): Promise<{
|
|
6
|
-
status: any;
|
|
7
|
-
statusText: any;
|
|
8
|
-
errors: any;
|
|
9
|
-
type: any;
|
|
10
|
-
data: any;
|
|
11
|
-
message: any;
|
|
12
|
-
} | undefined>;
|
|
13
|
-
declare const handleFetchResponse: (res: Response) => Promise<any>;
|
|
14
|
-
export default handleFetchResponse;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
async function e(a){try{const t=await a.json();return{status:a.status,statusText:a.statusText,errors:t?.data?.error||t?.data?.code||a.statusText||a.status,type:t?.data?.type,data:t?.data,message:t?.data?.message}}catch(t){console.log(t)}}const o=async a=>{if(a.ok)try{const t=await a.json(),{errors:s}=t;return s&&s.length?{errors:s,status:a.status}:t}catch(t){console.log(t)}return await e(a)};var n=o;export{n as default,e as getAsyncError};
|
|
2
|
-
//# sourceMappingURL=fetchResponse.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/fetchResponse.ts"],
|
|
4
|
-
"sourcesContent": ["export async function getAsyncError(res: { json: () => any; status: any; statusText: any }) {\n try {\n const result = await res.json()\n return {\n status: res.status,\n statusText: res.statusText,\n errors: result?.data?.error || result?.data?.code || res.statusText || res.status,\n type: result?.data?.type,\n data: result?.data,\n message: result?.data?.message,\n }\n } catch (error) {\n console.log(error)\n }\n}\n\nconst handleFetchResponse = async (res: Response) => {\n if (res.ok) {\n try {\n const result = await res.json()\n const { errors } = result\n if (errors && errors.length) {\n return { errors, status: res.status }\n }\n\n return result\n } catch (error) {\n console.log(error)\n }\n }\n\n return await getAsyncError(res)\n}\n\nexport default handleFetchResponse\n"],
|
|
5
|
-
"mappings": "AAAA,eAAsBA,EAAcC,EAAwD,CAC1F,GAAI,CACF,MAAMC,EAAS,MAAMD,EAAI,KAAK,EAC9B,MAAO,CACL,OAAQA,EAAI,OACZ,WAAYA,EAAI,WAChB,OAAQC,GAAQ,MAAM,OAASA,GAAQ,MAAM,MAAQD,EAAI,YAAcA,EAAI,OAC3E,KAAMC,GAAQ,MAAM,KACpB,KAAMA,GAAQ,KACd,QAASA,GAAQ,MAAM,OACzB,CACF,OAASC,EAAO,CACd,QAAQ,IAAIA,CAAK,CACnB,CACF,CAEA,MAAMC,EAAsB,MAAOH,GAAkB,CACnD,GAAIA,EAAI,GACN,GAAI,CACF,MAAMC,EAAS,MAAMD,EAAI,KAAK,EACxB,CAAE,OAAAI,CAAO,EAAIH,EACnB,OAAIG,GAAUA,EAAO,OACZ,CAAE,OAAAA,EAAQ,OAAQJ,EAAI,MAAO,EAG/BC,CACT,OAASC,EAAO,CACd,QAAQ,IAAIA,CAAK,CACnB,CAGF,OAAO,MAAMH,EAAcC,CAAG,CAChC,EAEA,IAAOK,EAAQF",
|
|
6
|
-
"names": ["getAsyncError", "res", "result", "error", "handleFetchResponse", "errors", "fetchResponse_default"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import f from"./fetchResponse.js";const d=async({locale:o="en",url:l,method:r="POST",headers:s={},body:e,type:c,timeout:a=9e4})=>{let n="";c==="uploadFile"?n=e:n=e?JSON.stringify(e):"";const t=new AbortController;a&&setTimeout(()=>t.abort(),a);const i=await fetch(l,{method:r,mode:"cors",headers:{"current-language":o,...s},...a&&{signal:t.signal},...r!=="GET"&&{body:n}});return f(i)};var h=d;export{h as default};
|
|
2
|
-
//# sourceMappingURL=fetcher.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/fetcher.ts"],
|
|
4
|
-
"sourcesContent": ["import handleFetchResponse from './fetchResponse.js'\n\nconst fetcher = async ({ locale = 'en', url, method = 'POST', headers = {}, body, type, timeout = 90000 }: any) => {\n // \u6DFB\u52A0\u8C37\u6B4C\u9A8C\u8BC1\n let bodyData = ''\n if (type === 'uploadFile') {\n bodyData = body\n } else {\n bodyData = body ? JSON.stringify(body) : ''\n }\n\n const controller = new AbortController()\n if (timeout) {\n // \u8D85\u65F6\u62A5\u9519\n setTimeout(() => controller.abort(), timeout)\n }\n\n const data = await fetch(url, {\n method,\n mode: 'cors',\n headers: {\n 'current-language': locale,\n ...headers,\n },\n ...(timeout && { signal: controller.signal }),\n ...(method !== 'GET' && { body: bodyData }),\n })\n return handleFetchResponse(data)\n}\n\nexport default fetcher\n"],
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAyB,qBAEhC,MAAMC,EAAU,MAAO,CAAE,OAAAC,EAAS,KAAM,IAAAC,EAAK,OAAAC,EAAS,OAAQ,QAAAC,EAAU,CAAC,EAAG,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAU,GAAM,IAAW,CAEjH,IAAIC,EAAW,GACXF,IAAS,aACXE,EAAWH,EAEXG,EAAWH,EAAO,KAAK,UAAUA,CAAI,EAAI,GAG3C,MAAMI,EAAa,IAAI,gBACnBF,GAEF,WAAW,IAAME,EAAW,MAAM,EAAGF,CAAO,EAG9C,MAAMG,EAAO,MAAM,MAAMR,EAAK,CAC5B,OAAAC,EACA,KAAM,OACN,QAAS,CACP,mBAAoBF,EACpB,GAAGG,CACL,EACA,GAAIG,GAAW,CAAE,OAAQE,EAAW,MAAO,EAC3C,GAAIN,IAAW,OAAS,CAAE,KAAMK,CAAS,CAC3C,CAAC,EACD,OAAOT,EAAoBW,CAAI,CACjC,EAEA,IAAOC,EAAQX",
|
|
6
|
-
"names": ["handleFetchResponse", "fetcher", "locale", "url", "method", "headers", "body", "type", "timeout", "bodyData", "controller", "data", "fetcher_default"]
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface Window {
|
|
3
|
-
dataLayer?: Array<any>;
|
|
4
|
-
fbq?: (...args: any[]) => void;
|
|
5
|
-
klaviyo?: any;
|
|
6
|
-
gtag?: any;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export declare const gaTrack: (data: any) => "" | undefined;
|
|
10
|
-
export declare function gaNormalClick({ position, label }: {
|
|
11
|
-
position: string;
|
|
12
|
-
label: string;
|
|
13
|
-
}): void;
|
|
14
|
-
export declare const fbq: (...args: any[]) => "" | undefined;
|
|
15
|
-
export declare const gtag: (...args: any[]) => "" | undefined;
|
|
16
|
-
export declare const getGtmGroup: ({ query, asPath }: {
|
|
17
|
-
query: any;
|
|
18
|
-
asPath: string;
|
|
19
|
-
}) => any;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const r=e=>{if(typeof window>"u"||(window.dataLayer=window?.dataLayer||[],!Array.isArray(window.dataLayer)))return"";try{window?.dataLayer?.push({event_parameters:null}),window?.dataLayer?.push(e||{})}catch(n){console.log("pageGTMEvent error",n)}};function t({position:e,label:n}){r({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:"soundcoreCredits Rewards Program",position:e,button_name:n}})}const a=(...e)=>{if(typeof window>"u")return"";window.fbq&&window.fbq(...e)},o=(...e)=>{if(typeof window>"u")return"";window.gtag&&window.gtag(...e)},i=({query:e,asPath:n})=>n.includes("collections")?`Product List Page_${e?.handle}`:n.includes("products")?"Product Detail Page_"+e?.handle:n==="/"||n==="/app-home"?"Home Page":"Activity Page_"+e?.handle||e?.paths?.[0]?.replace("storefront-","");export{a as fbq,t as gaNormalClick,r as gaTrack,i as getGtmGroup,o as gtag};
|
|
2
|
-
//# sourceMappingURL=track.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/track.ts"],
|
|
4
|
-
"sourcesContent": ["declare global {\n interface Window {\n dataLayer?: Array<any>\n fbq?: (...args: any[]) => void\n klaviyo?: any\n gtag?: any\n }\n}\n\n// GA \u57CB\u70B9\nexport const gaTrack = (data: any) => {\n if (typeof window === 'undefined') {\n return ''\n }\n window.dataLayer = window?.dataLayer || []\n if (!Array.isArray(window.dataLayer)) {\n return ''\n }\n\n try {\n window?.dataLayer?.push({ event_parameters: null })\n window?.dataLayer?.push(data || {})\n } catch (error) {\n console.log('pageGTMEvent error', error)\n }\n}\n\nexport function gaNormalClick({ position, label }: { position: string; label: string }) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: 'soundcoreCredits Rewards Program',\n position: position,\n button_name: label,\n },\n })\n}\n\n// facebook \u57CB\u70B9\nexport const fbq = (...args: any[]) => {\n if (typeof window === 'undefined') {\n return ''\n }\n if (window.fbq) {\n window.fbq(...args)\n }\n}\n\nexport const gtag = (...args: any[]) => {\n if (typeof window === 'undefined') {\n return ''\n }\n if (window.gtag) {\n window.gtag(...args)\n }\n}\n\nexport const getGtmGroup = ({ query, asPath }: { query: any; asPath: string }) => {\n if (asPath.includes('collections')) {\n return `Product List Page_${query?.handle}`\n }\n\n if (asPath.includes('products')) {\n return 'Product Detail Page_' + query?.handle\n }\n\n if (asPath === '/' || asPath === '/app-home') {\n return 'Home Page'\n }\n\n return 'Activity Page_' + query?.handle || query?.paths?.[0]?.replace('storefront-', '')\n}\n"],
|
|
5
|
-
"mappings": "AAUO,MAAMA,EAAWC,GAAc,CAKpC,GAJI,OAAO,OAAW,MAGtB,OAAO,UAAY,QAAQ,WAAa,CAAC,EACrC,CAAC,MAAM,QAAQ,OAAO,SAAS,GACjC,MAAO,GAGT,GAAI,CACF,QAAQ,WAAW,KAAK,CAAE,iBAAkB,IAAK,CAAC,EAClD,QAAQ,WAAW,KAAKA,GAAQ,CAAC,CAAC,CACpC,OAASC,EAAO,CACd,QAAQ,IAAI,qBAAsBA,CAAK,CACzC,CACF,EAEO,SAASC,EAAc,CAAE,SAAAC,EAAU,MAAAC,CAAM,EAAwC,CACtFL,EAAQ,CACN,MAAO,WACP,WAAY,YACZ,iBAAkB,CAChB,WAAY,mCACZ,SAAUI,EACV,YAAaC,CACf,CACF,CAAC,CACH,CAGO,MAAMC,EAAM,IAAIC,IAAgB,CACrC,GAAI,OAAO,OAAW,IACpB,MAAO,GAEL,OAAO,KACT,OAAO,IAAI,GAAGA,CAAI,CAEtB,EAEaC,EAAO,IAAID,IAAgB,CACtC,GAAI,OAAO,OAAW,IACpB,MAAO,GAEL,OAAO,MACT,OAAO,KAAK,GAAGA,CAAI,CAEvB,EAEaE,EAAc,CAAC,CAAE,MAAAC,EAAO,OAAAC,CAAO,IACtCA,EAAO,SAAS,aAAa,EACxB,qBAAqBD,GAAO,MAAM,GAGvCC,EAAO,SAAS,UAAU,EACrB,uBAAyBD,GAAO,OAGrCC,IAAW,KAAOA,IAAW,YACxB,YAGF,iBAAmBD,GAAO,QAAUA,GAAO,QAAQ,CAAC,GAAG,QAAQ,cAAe,EAAE",
|
|
6
|
-
"names": ["gaTrack", "data", "error", "gaNormalClick", "position", "label", "fbq", "args", "gtag", "getGtmGroup", "query", "asPath"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport function noop(): any {}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,QAAAA,MAA6B,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CAEO,SAASC,GAAY,CAAC",
|
|
6
|
-
"names": ["clsx", "twMerge", "cn", "inputs", "noop"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Fragment as K,jsx as o,jsxs as a}from"react/jsx-runtime";import{classNames as c,HeadlessProvider as f}from"@anker-in/lib";import{RegistrationProvider as l}from"../components/registration/context/provider";import{CreditsProvider as y}from"../components/credits/context/provider";import{CreditsBanner as g}from"../components/credits/creditsBanner";import{CreditsInfoCard as P}from"../components/credits/creditsInfoCard";import{CreditsBenefits as T}from"../components/credits/creditsBenefits";import{CreditsWaysToGetCredits as v}from"../components/credits/creditsWaysToGetCredits";import{CreditsAnkersolixTask as u}from"../components/credits/creditsAnkersolixTask";import{CreditsRedeemList as b}from"../components/credits/creditsRedeemList";import{CreditsCash as h}from"../components/credits/creditsCash";import{CreditsMemberPrice as B}from"../components/credits/creditsMemberPrice";import{CreditsFaq as I}from"../components/credits/creditsFaq";import{CreditsNavigation as A}from"../components/credits/creditsNavigation";var L=(r=>(r.Navigation="creditsNavigation",r.Banner="creditsBanner",r.InfoCard="creditsInfoCard",r.Benefits="creditsBenefits",r.WaysToGetCredits="creditsWaysToGetCredits",r.AnkersolixTask="creditsAnkersolixTask",r.RedeemList="creditsRedeemList",r.SpendCreditsLikeCash="creditsCash",r.MemberPrice="creditsMemberPrice",r.Faqs="creditsFaq",r))(L||{});const ne=({headlessConfig:d,siteConfig:n,creditsConfig:C,userContext:t,pageConfig:s,registrationContext:p,gtm:m})=>(console.log("siteConfig",n),o(f,{headlessConfig:d,children:o(l,{copy:n.registrationsSettings,email:t?.profile?.email,children:a(y,{profile:t?.profile,removeProfile:t?.removeProfile,isLoadingProfile:t?.isLoadingProfile,openSignInPopup:p.openSignInPopup,openSignUpPopup:p.openSignUpPopup,creditInfo:t?.creditInfo,taskIdToTypeMapping:n.taskIdToTypeMapping,customer:t?.customer,fetchCreditInfo:t?.fetchCreditInfo,customerLoading:t?.customerLoading,gtm:m,pageCommon:s.common,memberPriceDiscount:n.memberPriceDiscount,alpcBrand:C?.alpcBrand,children:[s.components.creditsNavigation&&o(A,{copy:s.components.creditsNavigation}),o("div",{className:c("bg-[#f5f5f7] leading-[1.2]"),children:s.order.map(e=>{if(e==="creditsNavigation")return null;const i=s.components?.[e];return i?a(K,{children:[e==="creditsBanner"&&o(g,{copy:i,id:e}),e==="creditsInfoCard"&&t?.profile&&o(P,{copy:i,id:e}),e==="creditsBenefits"&&o(T,{copy:i,id:e}),e==="creditsWaysToGetCredits"&&o(v,{copy:i,id:e,classNames:d.brand==="anker"?{subtitle:"text-white",equalCreditsText:"bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent"}:{subtitle:"text-[#D1D1D1]",equalCreditsText:"text-[#F6EAD0]"}}),e==="creditsAnkersolixTask"&&o(u,{copy:i,id:e}),e==="creditsRedeemList"&&o(b,{copy:i,id:e}),e==="creditsCash"&&o(h,{copy:i,id:e}),e==="creditsMemberPrice"&&o(B,{copy:i,id:e}),e==="creditsFaq"&&o(I,{copy:i,id:e}),e!=="creditsBanner"&&o("div",{className:"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16"})]}):null})})]})})}));export{L as ComponentKey,ne as CreditsTemplate};
|
|
2
|
-
//# sourceMappingURL=Credits.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/templates/Credits.tsx"],
|
|
4
|
-
"sourcesContent": ["import { classNames, HeadlessConfig, HeadlessProvider } from '@anker-in/lib'\nimport { RegistrationProvider } from '../components/registration/context/provider'\n\nimport { DTC_TASK_TYPE } from '../components/credits/context/const'\nimport { CreditsProvider } from '../components/credits/context/provider'\nimport { CreditsPageCommon } from '../components/credits/type'\nimport { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes'\n\nimport { CreditsBanner, CreditsBannerCopy } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard, CreditsInfoCardCopy } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits, CreditsBenefitsCopy } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits, CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsAnkersolixTask, CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask'\nimport { CreditsRedeemList, CreditsRedeemListCopy } from '../components/credits/creditsRedeemList'\nimport { CreditsCash, CreditsCashCopy } from '../components/credits/creditsCash'\nimport { CreditsMemberPrice, CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice'\nimport { CreditsFaq, CreditsFaqCopy } from '../components/credits/creditsFaq'\nimport { CreditsNavigation, CreditsNavigationCopy } from '../components/credits/creditsNavigation'\nimport { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type'\n\nexport enum ComponentKey {\n Navigation = 'creditsNavigation',\n Banner = 'creditsBanner',\n InfoCard = 'creditsInfoCard',\n Benefits = 'creditsBenefits',\n WaysToGetCredits = 'creditsWaysToGetCredits',\n AnkersolixTask = 'creditsAnkersolixTask',\n RedeemList = 'creditsRedeemList',\n SpendCreditsLikeCash = 'creditsCash',\n MemberPrice = 'creditsMemberPrice',\n Faqs = 'creditsFaq',\n}\nexport type CreditsTemplateProps = {\n headlessConfig: HeadlessConfig\n siteConfig: {\n registrationsSettings: {\n authCodeActivate: AuthCodeActivateCopy\n }\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n }\n creditsConfig?: {\n alpcBrand?: string\n }\n pageConfig: {\n order: ComponentKey[]\n common: CreditsPageCommon\n components: {\n [ComponentKey.Navigation]?: CreditsNavigationCopy\n [ComponentKey.Banner]?: CreditsBannerCopy\n [ComponentKey.InfoCard]?: CreditsInfoCardCopy\n [ComponentKey.Benefits]?: CreditsBenefitsCopy\n [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy\n [ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy\n [ComponentKey.RedeemList]?: CreditsRedeemListCopy\n [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy\n [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy\n [ComponentKey.Faqs]?: CreditsFaqCopy\n }\n }\n userContext: {\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n creditInfo: any\n customer: any\n customerLoading: boolean\n fetchCreditInfo: () => void\n }\n registrationContext: {\n openSignUpPopup: () => void\n openSignInPopup: () => void\n }\n gtm: {\n pageGroup: string\n }\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n creditsConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n}: CreditsTemplateProps) => {\n\n console.log('siteConfig', siteConfig)\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n memberPriceDiscount={siteConfig.memberPriceDiscount}\n alpcBrand={creditsConfig?.alpcBrand}\n >\n {/* \u5BFC\u822A\u7EC4\u4EF6 - \u56FA\u5B9A\u4F4D\u7F6E\uFF0C\u4E0D\u53C2\u4E0E order \u6392\u5E8F */}\n {pageConfig.components[ComponentKey.Navigation] && (\n <CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />\n )}\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n // \u8DF3\u8FC7\u5BFC\u822A\u7EC4\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u5DF2\u7ECF\u56FA\u5B9A\u6E32\u67D3\u5728\u4E0A\u65B9\n if (key === ComponentKey.Navigation) return null\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />\n )}\n {key === ComponentKey.Benefits && <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n id={key}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.AnkersolixTask && (\n <CreditsAnkersolixTask\n copy={componentCopy as CreditsAnkersolixTaskCopy}\n id={key}\n />\n )}\n {key === ComponentKey.RedeemList && <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />}\n {key === ComponentKey.SpendCreditsLikeCash && <CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />}\n {key === ComponentKey.MemberPrice && <CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n </CreditsProvider>\n </RegistrationProvider>\n </HeadlessProvider>\n )\n}\n"],
|
|
5
|
-
"mappings": "AA8GY,OASI,YAAAA,EATJ,OAAAC,EASI,QAAAC,MATJ,oBA9GZ,OAAS,cAAAC,EAA4B,oBAAAC,MAAwB,gBAC7D,OAAS,wBAAAC,MAA4B,8CAGrC,OAAS,mBAAAC,MAAuB,yCAIhC,OAAS,iBAAAC,MAAwC,sCACjD,OAAS,mBAAAC,MAA4C,wCACrD,OAAS,mBAAAC,MAA4C,wCACrD,OAAS,2BAAAC,MAA4D,gDACrE,OAAS,yBAAAC,MAAwD,8CACjE,OAAS,qBAAAC,MAAgD,0CACzD,OAAS,eAAAC,MAAoC,oCAC7C,OAAS,sBAAAC,MAAkD,2CAC3D,OAAS,cAAAC,MAAkC,mCAC3C,OAAS,qBAAAC,MAAgD,0CAGlD,IAAKC,OACVA,EAAA,WAAa,oBACbA,EAAA,OAAS,gBACTA,EAAA,SAAW,kBACXA,EAAA,SAAW,kBACXA,EAAA,iBAAmB,0BACnBA,EAAA,eAAiB,wBACjBA,EAAA,WAAa,oBACbA,EAAA,qBAAuB,cACvBA,EAAA,YAAc,qBACdA,EAAA,KAAO,aAVGA,OAAA,IA0DL,MAAMC,GAAkB,CAAC,CAC9B,eAAAC,EACA,WAAAC,EACA,cAAAC,EACA,YAAAC,EACA,WAAAC,EACA,oBAAAC,EACA,IAAAC,CACF,KAEE,QAAQ,IAAI,aAAcL,CAAU,EAElCnB,EAACG,EAAA,CAAiB,eAAgBe,EAChC,SAAAlB,EAACI,EAAA,CAAqB,KAAMe,EAAW,sBAAuB,MAAOE,GAAa,SAAS,MACzF,SAAApB,EAACI,EAAA,CACC,QAASgB,GAAa,QACtB,cAAeA,GAAa,cAC5B,iBAAkBA,GAAa,iBAC/B,gBAAiBE,EAAoB,gBACrC,gBAAiBA,EAAoB,gBACrC,WAAYF,GAAa,WACzB,oBAAqBF,EAAW,oBAChC,SAAUE,GAAa,SACvB,gBAAiBA,GAAa,gBAC9B,gBAAiBA,GAAa,gBAC9B,IAAKG,EACL,WAAYF,EAAW,OACvB,oBAAqBH,EAAW,oBAChC,UAAWC,GAAe,UAGzB,UAAAE,EAAW,WAAW,mBACrBtB,EAACe,EAAA,CAAkB,KAAMO,EAAW,WAAW,kBAA0B,EAE3EtB,EAAC,OAAI,UAAWE,EAAW,4BAA4B,EACpD,SAAAoB,EAAW,MAAM,IAAIG,GAAO,CAE3B,GAAIA,IAAQ,oBAAyB,OAAO,KAC5C,MAAMC,EAAgBJ,EAAW,aAAaG,CAAG,EACjD,OAAKC,EAEHzB,EAAAF,EAAA,CACG,UAAA0B,IAAQ,iBAAuBzB,EAACM,EAAA,CAAc,KAAMoB,EAAoC,GAAID,EAAK,EACjGA,IAAQ,mBAAyBJ,GAAa,SAC7CrB,EAACO,EAAA,CAAgB,KAAMmB,EAAsC,GAAID,EAAK,EAEvEA,IAAQ,mBAAyBzB,EAACQ,EAAA,CAAgB,KAAMkB,EAAsC,GAAID,EAAK,EACvGA,IAAQ,2BACPzB,EAACS,EAAA,CACC,KAAMiB,EACN,GAAID,EACJ,WACEP,EAAe,QAAU,QACrB,CACE,SAAU,aACV,iBACE,4EACJ,EACA,CACE,SAAU,iBACV,iBAAkB,gBACpB,EAER,EAEDO,IAAQ,yBACPzB,EAACU,EAAA,CACC,KAAMgB,EACN,GAAID,EACN,EAEDA,IAAQ,qBAA2BzB,EAACW,EAAA,CAAkB,KAAMe,EAAwC,GAAID,EAAK,EAC7GA,IAAQ,eAAqCzB,EAACY,EAAA,CAAY,KAAMc,EAAkC,GAAID,EAAK,EAC3GA,IAAQ,sBAA4BzB,EAACa,EAAA,CAAmB,KAAMa,EAAyC,GAAID,EAAK,EAChHA,IAAQ,cAAqBzB,EAACc,EAAA,CAAW,KAAMY,EAAiC,GAAID,EAAK,EACzFA,IAAQ,iBACPzB,EAAC,OAAI,UAAU,qEAAqE,GAExF,EAvCyB,IAyC7B,CAAC,EACH,GACF,EACF,EACF",
|
|
6
|
-
"names": ["Fragment", "jsx", "jsxs", "classNames", "HeadlessProvider", "RegistrationProvider", "CreditsProvider", "CreditsBanner", "CreditsInfoCard", "CreditsBenefits", "CreditsWaysToGetCredits", "CreditsAnkersolixTask", "CreditsRedeemList", "CreditsCash", "CreditsMemberPrice", "CreditsFaq", "CreditsNavigation", "ComponentKey", "CreditsTemplate", "headlessConfig", "siteConfig", "creditsConfig", "userContext", "pageConfig", "registrationContext", "gtm", "key", "componentCopy"]
|
|
7
|
-
}
|