@anker-in/campaign-ui 0.1.10 → 0.2.0
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/chat/action.js +1 -1
- package/dist/cjs/components/chat/action.js.map +1 -1
- package/dist/cjs/components/chat/button.d.ts +1 -1
- package/dist/cjs/components/chat/button.js +1 -1
- package/dist/cjs/components/chat/button.js.map +1 -1
- package/dist/cjs/components/chat/index.js +1 -1
- package/dist/cjs/components/chat/index.js.map +2 -2
- package/dist/cjs/components/chat/{Messages.d.ts → messages.d.ts} +1 -1
- package/dist/cjs/components/chat/messages.js +1 -1
- package/dist/cjs/components/chat/messages.js.map +2 -2
- package/dist/cjs/components/chat/props.js +1 -1
- package/dist/cjs/components/chat/props.js.map +2 -2
- package/dist/cjs/components/chat/response.js +1 -1
- package/dist/cjs/components/chat/response.js.map +2 -2
- package/dist/cjs/components/chat/suggestions.d.ts +1 -1
- package/dist/cjs/components/chat/suggestions.js.map +1 -1
- package/dist/cjs/components/credits/context/const.d.ts +82 -0
- package/dist/cjs/components/credits/context/const.js +2 -0
- package/dist/cjs/components/credits/context/const.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useActivities.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useClickOutside.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useCopy.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useCountries.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +18 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +9 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +7 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +2 -0
- package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
- package/dist/cjs/components/credits/context/provider.d.ts +49 -0
- package/dist/cjs/components/credits/context/provider.js +2 -0
- package/dist/cjs/components/credits/context/provider.js.map +7 -0
- package/dist/cjs/components/credits/context/response.d.ts +63 -0
- package/dist/cjs/components/credits/context/response.js +2 -0
- package/dist/cjs/components/credits/context/response.js.map +7 -0
- package/dist/cjs/components/credits/context/utils.d.ts +25 -0
- package/dist/cjs/components/credits/context/utils.js +2 -0
- package/dist/cjs/components/credits/context/utils.js.map +7 -0
- package/dist/cjs/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
- package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- 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.d.ts +2 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js +2 -0
- package/dist/cjs/components/credits/creditsBenefits/iconInfo.js.map +7 -0
- package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
- package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +13 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/index.d.ts +11 -0
- package/dist/cjs/components/credits/creditsCash/index.js +2 -0
- package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/cjs/components/credits/creditsCash/type.js +2 -0
- package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
- package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
- package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
- package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +12 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +59 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
- package/dist/cjs/components/credits/index.d.ts +10 -0
- package/dist/cjs/components/credits/index.js +2 -0
- package/dist/cjs/components/credits/index.js.map +7 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.js +2 -0
- package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/cjs/components/credits/modal/activitiesModal.js +2 -0
- package/dist/cjs/components/credits/modal/activitiesModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -0
- package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/cjs/components/credits/modal/loadingDots.js +2 -0
- package/dist/cjs/components/credits/modal/loadingDots.js.map +7 -0
- package/dist/cjs/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/cjs/components/credits/modal/modalContainer.js +2 -0
- package/dist/cjs/components/credits/modal/modalContainer.js.map +7 -0
- package/dist/cjs/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/cjs/components/credits/modal/rulesModal.js +2 -0
- package/dist/cjs/components/credits/modal/rulesModal.js.map +7 -0
- package/dist/cjs/components/credits/modal/tip.d.ts +5 -0
- package/dist/cjs/components/credits/modal/tip.js +2 -0
- package/dist/cjs/components/credits/modal/tip.js.map +7 -0
- package/dist/cjs/components/credits/type.d.ts +55 -0
- package/dist/cjs/components/credits/type.js +2 -0
- package/dist/cjs/components/credits/type.js.map +7 -0
- package/dist/cjs/components/index.d.ts +3 -2
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
- package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
- package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
- package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
- package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
- package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
- package/dist/cjs/components/registration/authCodeActivate/type.d.ts +23 -0
- package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
- package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
- package/dist/cjs/components/registration/index.d.ts +1 -0
- package/dist/cjs/components/registration/index.js +2 -0
- package/dist/cjs/components/registration/index.js.map +7 -0
- package/dist/cjs/components/registration/modalContainer.d.ts +15 -0
- package/dist/cjs/components/registration/modalContainer.js +2 -0
- package/dist/cjs/components/registration/modalContainer.js.map +7 -0
- package/dist/cjs/debug-env.d.ts +7 -0
- package/dist/cjs/debug-env.js +2 -0
- package/dist/cjs/debug-env.js.map +7 -0
- package/dist/cjs/helpers/fetcher.js +1 -1
- package/dist/cjs/helpers/fetcher.js.map +2 -2
- package/dist/cjs/helpers/index.d.ts +2 -2
- package/dist/cjs/helpers/index.js +1 -1
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/cjs/helpers/track.d.ts +19 -0
- package/dist/cjs/helpers/track.js +2 -0
- package/dist/cjs/helpers/track.js.map +7 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/stories/chat.stories.d.ts +1 -1
- package/dist/cjs/stories/chat.stories.js +1 -1
- package/dist/cjs/stories/chat.stories.js.map +3 -3
- package/dist/esm/components/chat/action.js +1 -1
- package/dist/esm/components/chat/action.js.map +1 -1
- package/dist/esm/components/chat/button.d.ts +1 -1
- package/dist/esm/components/chat/button.js +1 -1
- package/dist/esm/components/chat/button.js.map +1 -1
- package/dist/esm/components/chat/index.js +1 -1
- package/dist/esm/components/chat/index.js.map +2 -2
- package/dist/esm/components/chat/{Messages.d.ts → messages.d.ts} +1 -1
- package/dist/esm/components/chat/messages.js +1 -1
- package/dist/esm/components/chat/messages.js.map +2 -2
- package/dist/esm/components/chat/props.js +0 -1
- package/dist/esm/components/chat/props.js.map +3 -3
- package/dist/esm/components/chat/response.js +1 -1
- package/dist/esm/components/chat/response.js.map +2 -2
- package/dist/esm/components/chat/suggestions.d.ts +1 -1
- package/dist/esm/components/chat/suggestions.js.map +1 -1
- package/dist/esm/components/credits/context/const.d.ts +82 -0
- package/dist/esm/components/credits/context/const.js +2 -0
- package/dist/esm/components/credits/context/const.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useActivities.d.ts +12 -0
- package/dist/esm/components/credits/context/hooks/useActivities.js +2 -0
- package/dist/esm/components/credits/context/hooks/useActivities.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.d.ts +34 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js +2 -0
- package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.d.ts +23 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +2 -0
- package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.d.ts +3 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.js +2 -0
- package/dist/esm/components/credits/context/hooks/useClickOutside.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useCopy.d.ts +5 -0
- package/dist/esm/components/credits/context/hooks/useCopy.js +2 -0
- package/dist/esm/components/credits/context/hooks/useCopy.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useCountries.d.ts +8 -0
- package/dist/esm/components/credits/context/hooks/useCountries.js +2 -0
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js +2 -0
- package/dist/esm/components/credits/context/hooks/useFirstPurchaseFinished.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.d.ts +14 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.js +2 -0
- package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.d.ts +2 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js +2 -0
- package/dist/esm/components/credits/context/hooks/useReceiptUploaded.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +9 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +18 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.d.ts +16 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js +2 -0
- package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.d.ts +1 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +9 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js +2 -0
- package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +7 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.d.ts +14 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +2 -0
- package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +7 -0
- package/dist/esm/components/credits/context/provider.d.ts +49 -0
- package/dist/esm/components/credits/context/provider.js +2 -0
- package/dist/esm/components/credits/context/provider.js.map +7 -0
- package/dist/esm/components/credits/context/response.d.ts +63 -0
- package/dist/esm/components/credits/context/response.js +1 -0
- package/dist/esm/components/credits/context/utils.d.ts +25 -0
- package/dist/esm/components/credits/context/utils.js +2 -0
- package/dist/esm/components/credits/context/utils.js.map +7 -0
- package/dist/esm/components/credits/creditsBanner/index.d.ts +23 -0
- package/dist/esm/components/credits/creditsBanner/index.js +2 -0
- package/dist/esm/components/credits/creditsBanner/index.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +19 -0
- 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.d.ts +2 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js +2 -0
- package/dist/esm/components/credits/creditsBenefits/iconInfo.js.map +7 -0
- package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -0
- package/dist/esm/components/credits/creditsBenefits/index.js +4 -0
- package/dist/esm/components/credits/creditsBenefits/index.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +13 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js +2 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/index.d.ts +11 -0
- package/dist/esm/components/credits/creditsCash/index.js +2 -0
- package/dist/esm/components/credits/creditsCash/index.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/type.d.ts +47 -0
- package/dist/esm/components/credits/creditsCash/type.js +1 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.d.ts +13 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
- package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
- package/dist/esm/components/credits/creditsFaq/index.d.ts +16 -0
- package/dist/esm/components/credits/creditsFaq/index.js +2 -0
- package/dist/esm/components/credits/creditsFaq/index.js.map +7 -0
- package/dist/esm/components/credits/creditsInfoCard/index.d.ts +20 -0
- package/dist/esm/components/credits/creditsInfoCard/index.js +2 -0
- package/dist/esm/components/credits/creditsInfoCard/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.d.ts +14 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/FormItem.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/Input.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.d.ts +15 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.d.ts +26 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js +1 -0
- package/dist/esm/components/credits/creditsRedeemList/AddressForm/type.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +20 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +11 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +8 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +13 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +11 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.d.ts +9 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/index.d.ts +12 -0
- package/dist/esm/components/credits/creditsRedeemList/index.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/index.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/type.d.ts +77 -0
- package/dist/esm/components/credits/creditsRedeemList/type.js +1 -0
- package/dist/esm/components/credits/creditsRedeemList/type.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +59 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +96 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
- package/dist/esm/components/credits/index.d.ts +10 -0
- package/dist/esm/components/credits/index.js +2 -0
- package/dist/esm/components/credits/index.js.map +7 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +32 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.js +2 -0
- package/dist/esm/components/credits/modal/MyRewardsModal.js.map +7 -0
- package/dist/esm/components/credits/modal/activitiesModal.d.ts +32 -0
- package/dist/esm/components/credits/modal/activitiesModal.js +2 -0
- package/dist/esm/components/credits/modal/activitiesModal.js.map +7 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.d.ts +24 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -0
- package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +7 -0
- package/dist/esm/components/credits/modal/loadingDots.d.ts +6 -0
- package/dist/esm/components/credits/modal/loadingDots.js +2 -0
- package/dist/esm/components/credits/modal/loadingDots.js.map +7 -0
- package/dist/esm/components/credits/modal/modalContainer.d.ts +15 -0
- package/dist/esm/components/credits/modal/modalContainer.js +2 -0
- package/dist/esm/components/credits/modal/modalContainer.js.map +7 -0
- package/dist/esm/components/credits/modal/rulesModal.d.ts +7 -0
- package/dist/esm/components/credits/modal/rulesModal.js +2 -0
- package/dist/esm/components/credits/modal/rulesModal.js.map +7 -0
- package/dist/esm/components/credits/modal/tip.d.ts +5 -0
- package/dist/esm/components/credits/modal/tip.js +2 -0
- package/dist/esm/components/credits/modal/tip.js.map +7 -0
- package/dist/esm/components/credits/type.d.ts +55 -0
- package/dist/esm/components/credits/type.js +1 -0
- package/dist/esm/components/credits/type.js.map +7 -0
- package/dist/esm/components/index.d.ts +3 -2
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
- package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
- package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
- package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
- package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
- package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
- package/dist/esm/components/registration/authCodeActivate/type.d.ts +23 -0
- package/dist/esm/components/registration/authCodeActivate/type.js +1 -0
- package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
- package/dist/esm/components/registration/index.d.ts +1 -0
- package/dist/esm/components/registration/index.js +2 -0
- package/dist/esm/components/registration/index.js.map +7 -0
- package/dist/esm/components/registration/modalContainer.d.ts +15 -0
- package/dist/esm/components/registration/modalContainer.js +2 -0
- package/dist/esm/components/registration/modalContainer.js.map +7 -0
- package/dist/esm/debug-env.d.ts +7 -0
- package/dist/esm/debug-env.js +2 -0
- package/dist/esm/debug-env.js.map +7 -0
- package/dist/esm/helpers/fetcher.js +1 -1
- package/dist/esm/helpers/fetcher.js.map +2 -2
- package/dist/esm/helpers/index.d.ts +2 -2
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +2 -2
- package/dist/esm/helpers/track.d.ts +19 -0
- package/dist/esm/helpers/track.js +2 -0
- package/dist/esm/helpers/track.js.map +7 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stories/chat.stories.d.ts +1 -1
- package/dist/esm/stories/chat.stories.js +1 -1
- package/dist/esm/stories/chat.stories.js.map +2 -2
- package/package.json +46 -33
- package/src/components/chat/button.tsx +1 -1
- package/src/components/chat/index.tsx +6 -6
- package/src/components/chat/messages.tsx +2 -2
- package/src/components/chat/response.tsx +1 -4
- package/src/components/chat/suggestions.tsx +1 -1
- package/src/components/credits/context/const.ts +104 -0
- package/src/components/credits/context/hooks/useActivities.ts +70 -0
- package/src/components/credits/context/hooks/useAddressValidate.ts +281 -0
- package/src/components/credits/context/hooks/useAlpcFetch.ts +295 -0
- package/src/components/credits/context/hooks/useClickOutside.ts +34 -0
- package/src/components/credits/context/hooks/useCopy.ts +35 -0
- package/src/components/credits/context/hooks/useCountries.ts +55 -0
- package/src/components/credits/context/hooks/useFirstPurchaseFinished.ts +24 -0
- package/src/components/credits/context/hooks/useMyRewards.ts +97 -0
- package/src/components/credits/context/hooks/useReceiptUploaded.ts +24 -0
- package/src/components/credits/context/hooks/useRedeemAndBuy.ts +59 -0
- package/src/components/credits/context/hooks/useRedeemCoupon.ts +34 -0
- package/src/components/credits/context/hooks/useRedeemProduct.ts +34 -0
- package/src/components/credits/context/hooks/useRedeemableList.ts +77 -0
- package/src/components/credits/context/hooks/useSendEmailValidation.ts +20 -0
- package/src/components/credits/context/hooks/useSubscribed.ts +37 -0
- package/src/components/credits/context/hooks/useSubscriptions.ts +29 -0
- package/src/components/credits/context/hooks/useUploadReceipt.tsx +29 -0
- package/src/components/credits/context/provider.tsx +86 -0
- package/src/components/credits/context/response.ts +72 -0
- package/src/components/credits/context/utils.ts +149 -0
- package/src/components/credits/creditsBanner/index.tsx +105 -0
- package/src/components/credits/creditsBenefits/benefitItem.tsx +73 -0
- package/src/components/credits/creditsBenefits/iconInfo.tsx +23 -0
- package/src/components/credits/creditsBenefits/index.tsx +117 -0
- package/src/components/credits/creditsCash/RedeemableItem.tsx +211 -0
- package/src/components/credits/creditsCash/index.tsx +100 -0
- package/src/components/credits/creditsCash/type.ts +46 -0
- package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +95 -0
- package/src/components/credits/creditsFaq/index.tsx +86 -0
- package/src/components/credits/creditsInfoCard/index.tsx +177 -0
- package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +111 -0
- package/src/components/credits/creditsRedeemList/AddressForm/FormItem.tsx +23 -0
- package/src/components/credits/creditsRedeemList/AddressForm/Input.tsx +58 -0
- package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +126 -0
- package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +155 -0
- package/src/components/credits/creditsRedeemList/AddressForm/type.ts +24 -0
- package/src/components/credits/creditsRedeemList/NonProductValue.tsx +38 -0
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +211 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +72 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +14 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +121 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +23 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +72 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +45 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +195 -0
- package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +178 -0
- package/src/components/credits/creditsRedeemList/index.tsx +189 -0
- package/src/components/credits/creditsRedeemList/type.ts +78 -0
- package/src/components/credits/creditsWaysToGetCredits/index.tsx +188 -0
- package/src/components/credits/creditsWaysToGetCredits/type.ts +63 -0
- package/src/components/credits/creditsWaysToGetCredits/useActions.ts +217 -0
- package/src/components/credits/index.ts +11 -0
- package/src/components/credits/modal/MyRewardsModal.tsx +321 -0
- package/src/components/credits/modal/activitiesModal.tsx +258 -0
- package/src/components/credits/modal/creditsUploadReceiptModal.tsx +141 -0
- package/src/components/credits/modal/loadingDots.tsx +19 -0
- package/src/components/credits/modal/modalContainer.tsx +112 -0
- package/src/components/credits/modal/rulesModal.tsx +44 -0
- package/src/components/credits/modal/tip.tsx +92 -0
- package/src/components/credits/type.ts +60 -0
- package/src/components/index.ts +4 -2
- package/src/debug-env.ts +18 -0
- package/src/helpers/fetcher.ts +1 -1
- package/src/helpers/index.ts +2 -2
- package/src/helpers/track.ts +73 -0
- package/src/index.ts +1 -1
- package/src/stories/chat.stories.tsx +1 -1
- package/{dist/esm/styles/chat.css → src/styles/global.css} +1 -0
- package/style.css +1 -0
- package/tailwind.config.ts +82 -0
- package/dist/cjs/components/animation/CodeEditor.d.ts +0 -7
- package/dist/cjs/components/animation/CodeEditor.js +0 -2
- package/dist/cjs/components/animation/CodeEditor.js.map +0 -7
- package/dist/cjs/components/animation/Preview.d.ts +0 -5
- package/dist/cjs/components/animation/Preview.js +0 -2
- package/dist/cjs/components/animation/Preview.js.map +0 -7
- package/dist/cjs/components/animation/bannerAni.d.ts +0 -16
- package/dist/cjs/components/animation/bannerAni.js +0 -59
- package/dist/cjs/components/animation/bannerAni.js.map +0 -7
- package/dist/cjs/components/animation/libs.d.js +0 -2
- package/dist/cjs/components/animation/textAni.d.ts +0 -9
- package/dist/cjs/components/animation/textAni.js +0 -2
- package/dist/cjs/components/animation/textAni.js.map +0 -7
- package/dist/cjs/components/chat/message.d.ts +0 -2
- package/dist/cjs/components/chat/response copy.d.ts +0 -2
- package/dist/cjs/components/chat/rresponse.d.ts +0 -2
- package/dist/cjs/components/theme.d.ts +0 -13
- package/dist/cjs/helpers/component-props.d.ts +0 -7
- package/dist/cjs/helpers/component-props.js +0 -2
- package/dist/cjs/helpers/component-props.js.map +0 -7
- package/dist/cjs/helpers/constants.d.ts +0 -2
- package/dist/cjs/helpers/constants.js +0 -2
- package/dist/cjs/helpers/constants.js.map +0 -7
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/components/animation/CodeEditor.d.ts +0 -7
- package/dist/esm/components/animation/CodeEditor.js +0 -2
- package/dist/esm/components/animation/CodeEditor.js.map +0 -7
- package/dist/esm/components/animation/Preview.d.ts +0 -5
- package/dist/esm/components/animation/Preview.js +0 -2
- package/dist/esm/components/animation/Preview.js.map +0 -7
- package/dist/esm/components/animation/bannerAni.d.ts +0 -16
- package/dist/esm/components/animation/bannerAni.js +0 -59
- package/dist/esm/components/animation/bannerAni.js.map +0 -7
- package/dist/esm/components/animation/libs.d.js +0 -2
- package/dist/esm/components/animation/libs.d.js.map +0 -7
- package/dist/esm/components/animation/textAni.d.ts +0 -9
- package/dist/esm/components/animation/textAni.js +0 -2
- package/dist/esm/components/animation/textAni.js.map +0 -7
- package/dist/esm/components/chat/Markdown.d.ts +0 -5
- package/dist/esm/components/chat/marksdown.d.ts +0 -5
- package/dist/esm/components/chat/message.d.ts +0 -2
- package/dist/esm/components/chat/response copy.d.ts +0 -2
- package/dist/esm/components/chat/rresponse.d.ts +0 -2
- package/dist/esm/components/theme.d.ts +0 -13
- package/dist/esm/helpers/component-props.d.ts +0 -7
- package/dist/esm/helpers/component-props.js +0 -1
- package/dist/esm/helpers/constants.d.ts +0 -2
- package/dist/esm/helpers/constants.js +0 -2
- package/dist/esm/helpers/constants.js.map +0 -7
- package/dist/esm/styles/css/animations.css +0 -35
- package/dist/esm/styles/css/button.css +0 -56
- package/dist/esm/styles/css/colors.css +0 -12
- package/dist/esm/styles/css/console.css +0 -134
- package/dist/esm/styles/css/header.css +0 -43
- package/dist/esm/styles/css/input.css +0 -89
- package/dist/esm/styles/css/markdown.css +0 -131
- package/dist/esm/styles/css/messages.css +0 -73
- package/dist/esm/styles/css/panel.css +0 -23
- package/dist/esm/styles/css/popup.css +0 -44
- package/dist/esm/styles/css/response.css +0 -26
- package/dist/esm/styles/css/sidebar.css +0 -31
- package/dist/esm/styles/css/suggestions.css +0 -35
- package/dist/esm/styles/css/window.css +0 -60
- package/dist/esm/styles/index.css +0 -1
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
- /package/dist/cjs/components/chat/{Markdown.d.ts → markdown.d.ts} +0 -0
- /package/dist/cjs/components/chat/{Response.d.ts → response.d.ts} +0 -0
- /package/dist/{cjs/components/chat/marksdown.d.ts → esm/components/chat/markdown.d.ts} +0 -0
- /package/dist/esm/components/chat/{Response.d.ts → response.d.ts} +0 -0
- /package/dist/{cjs/components/animation/libs.d.js.map → esm/components/credits/context/response.js.map} +0 -0
- /package/dist/esm/{helpers/component-props.js.map → components/credits/creditsCash/type.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport { formatPrice } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { useHeadlessContext } from '@anker-in/lib'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useHeadlessContext()\n\n return (\n <div className=\"flex w-full items-center justify-center md:items-start md:justify-start\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:hidden md:size-[44px] [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"md:flex md:flex-col\">\n <div className=\"md:flex md:items-center\">\n <Picture\n className=\"mr-[16px] size-[100px] shrink-0 md:mr-[12px] md:size-[44px] min-md:hidden [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n source={item.variant.image?.url || item.product?.images[0]?.url}\n alt={item.product.title}\n ></Picture>\n <div className=\"flex-1 text-[16px] font-bold leading-[1.4] min-l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n </div>\n\n <div className=\"mt-[16px] md:mt-[12px]\">\n <div className=\"mb-[12px] line-clamp-1 text-[16px] font-bold l:!hidden\" title={item.product.title}>\n {item.product.title}\n </div>\n <div className=\"flex font-semibold leading-[1.4] md:flex-col\">\n <div className=\"mr-[40px] text-[15px] font-bold text-[#777] md:mr-0 md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.variantLabel}: </span>\n <span className=\"ml-1\">{item.variant.title || ''}</span>\n </div>\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.shippingFeeLabel}: </span>\n <span className=\"ml-1\">\n {formatPrice({\n amount: 0,\n currencyCode: item.product.price?.currencyCode!,\n locale: locale || 'us',\n })}\n </span>\n </div>\n </div>\n <div className=\"text-[15px] font-bold text-[#777] md:text-[12px]\">\n <div className=\"mb-[8px] flex items-center md:mb-[4px]\">\n <span>{copy.redeemModal.product.quantityLabel}: </span>\n <span className=\"ml-1\">1</span>\n </div>\n <div className=\"l:flex l:items-center l:justify-between\">\n <span>{copy.redeemModal.product.totalPriceLabel}: </span>\n <span className=\"ml-1\">\n {item.alpc?.consumeCredits} {copy?.pointUnit}\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAgBM,IAAAI,EAAA,6BAhBNC,EAAwB,iCACxBC,EAA4B,+BAG5BC,EAAmC,yBAO5B,MAAML,EAAc,CAAC,CAAE,KAAAM,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,KAAI,sBAAmB,EAEtC,SACE,QAAC,OAAI,UAAU,0EACb,oBAAC,WACC,UAAU,6HACV,OAAQF,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,KACD,QAAC,OAAI,UAAU,sBACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,UAAU,iIACV,OAAQA,EAAK,QAAQ,OAAO,KAAOA,EAAK,SAAS,OAAO,CAAC,GAAG,IAC5D,IAAKA,EAAK,QAAQ,MACnB,KACD,OAAC,OAAI,UAAU,2DAA2D,MAAOA,EAAK,QAAQ,MAC3F,SAAAA,EAAK,QAAQ,MAChB,GACF,KAEA,QAAC,OAAI,UAAU,yBACb,oBAAC,OAAI,UAAU,yDAAyD,MAAOA,EAAK,QAAQ,MACzF,SAAAA,EAAK,QAAQ,MAChB,KACA,QAAC,OAAI,UAAU,+CACb,qBAAC,OAAI,UAAU,qEACb,qBAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAC,EAAK,YAAY,QAAQ,aAAa,MAAE,KAC/C,OAAC,QAAK,UAAU,OAAQ,SAAAD,EAAK,QAAQ,OAAS,GAAG,GACnD,KACA,QAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAC,EAAK,YAAY,QAAQ,iBAAiB,MAAE,KACnD,OAAC,QAAK,UAAU,OACb,2BAAY,CACX,OAAQ,EACR,aAAcD,EAAK,QAAQ,OAAO,aAClC,OAAQE,GAAU,IACpB,CAAC,EACH,GACF,GACF,KACA,QAAC,OAAI,UAAU,mDACb,qBAAC,OAAI,UAAU,yCACb,qBAAC,QAAM,UAAAD,EAAK,YAAY,QAAQ,cAAc,MAAE,KAChD,OAAC,QAAK,UAAU,OAAO,aAAC,GAC1B,KACA,QAAC,OAAI,UAAU,0CACb,qBAAC,QAAM,UAAAA,EAAK,YAAY,QAAQ,gBAAgB,MAAE,KAClD,QAAC,QAAK,UAAU,OACb,UAAAD,EAAK,MAAM,eAAe,IAAEC,GAAM,WACrC,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["ProductInfo_exports", "__export", "ProductInfo", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_utils", "import_lib", "item", "copy", "locale"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
2
|
+
import { CreditsRedeemListCopy } from '../type';
|
|
3
|
+
type SuccessProps = {
|
|
4
|
+
copy: CreditsRedeemListCopy;
|
|
5
|
+
shippingProduct: string;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
address: Record<string, any> | undefined;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
item: RedeemableItemType;
|
|
11
|
+
};
|
|
12
|
+
export declare const Success: ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var f=Object.create;var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var m in t)a(e,m,{get:t[m],enumerable:!0})},l=(e,t,m,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of y(t))!g.call(e,d)&&d!==m&&a(e,d,{get:()=>t[d],enumerable:!(p=b(t,d))||p.enumerable});return e};var w=(e,t,m)=>(m=e!=null?f(v(e)):{},l(t||!e||!e.__esModule?a(m,"default",{value:e,enumerable:!0}):m,e)),C=e=>l(a({},"__esModule",{value:!0}),e);var T={};N(T,{Success:()=>R});module.exports=C(T);var o=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),r=w(require("classnames")),i=require("./ProductInfo");const R=({copy:e,shippingProduct:t,loading:m,address:p,disabled:d,onClose:x,item:n})=>(0,o.jsx)("div",{className:(0,r.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,o.jsxs)("div",{className:"flex flex-col items-center",children:[(0,o.jsx)("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:e.redeemModal.product.successDesc.map((c,u)=>(0,o.jsx)(s.Text,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:c},u))}),t&&(0,o.jsx)(s.Text,{className:"mb-5 text-[16px] font-bold",html:t}),(0,o.jsx)("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:(0,o.jsx)(i.ProductInfo,{item:n,copy:e})}),(0,o.jsx)(s.Button,{loading:m||!p,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:x,disabled:d,children:e.redeemModal.product.paymentButton})]})});
|
|
2
|
+
//# sourceMappingURL=Success.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\n\ntype SuccessProps = {\n copy: CreditsRedeemListCopy\n shippingProduct: string\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n onClose: () => void\n item: RedeemableItemType\n}\n\nexport const Success = ({ copy, shippingProduct, loading, address, disabled, onClose, item }: SuccessProps) => {\n return (\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div className=\"flex flex-col items-center\">\n <div className=\"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]\">\n {copy.redeemModal.product.successDesc.map((description: string, index: number) => (\n <Text key={index} className=\"text-[18px] font-bold leading-[1.4] md:text-[14px]\" html={description}></Text>\n ))}\n </div>\n\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n <ProductInfo item={item} copy={copy} />\n </div>\n\n <Button\n loading={loading || !address}\n variant=\"primary\"\n className=\"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full\"\n onClick={onClose}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmBM,IAAAI,EAAA,6BAnBNC,EAA6B,iCAC7BC,EAAuB,yBAGvBC,EAA4B,yBAYrB,MAAML,EAAU,CAAC,CAAE,KAAAM,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,OAEvF,OAAC,OAAI,aAAW,EAAAC,SAAW,iFAAiF,EAC1G,oBAAC,OAAI,UAAU,6BACb,oBAAC,OAAI,UAAU,wDACZ,SAAAP,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACQ,EAAqBC,OAC9D,OAAC,QAAiB,UAAU,qDAAqD,KAAMD,GAA5EC,CAAyF,CACrG,EACH,EAECR,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KAExF,OAAC,OAAI,UAAU,gEACb,mBAAC,eAAY,KAAMK,EAAM,KAAMN,EAAM,EACvC,KAEA,OAAC,UACC,QAASE,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAJ,EAAK,YAAY,QAAQ,cAC5B,GACF,EACF",
|
|
6
|
+
"names": ["Success_exports", "__export", "Success", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_ProductInfo", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "classNames", "description", "index"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AlpcErrorCode } from '../../context/const';
|
|
2
|
+
import type { ModalContainerProps } from '../../modal/modalContainer';
|
|
3
|
+
import type { RedeemableItem as RedeemableItemType } from '../../type';
|
|
4
|
+
import { CreditsRedeemListCopy } from '../type';
|
|
5
|
+
type RedeemProductModalProps = ModalContainerProps & {
|
|
6
|
+
item: RedeemableItemType;
|
|
7
|
+
copy: CreditsRedeemListCopy;
|
|
8
|
+
onError: (code: AlpcErrorCode) => void;
|
|
9
|
+
};
|
|
10
|
+
declare function RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default RedeemProductModal;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var W=Object.create;var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var j=(r,e)=>{for(var t in e)g(r,t,{get:e[t],enumerable:!0})},N=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!$.call(r,i)&&i!==t&&g(r,i,{get:()=>e[i],enumerable:!(a=X(e,i))||a.enumerable});return r};var L=(r,e,t)=>(t=r!=null?W(Z(r)):{},N(e||!r||!r.__esModule?g(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>N(g({},"__esModule",{value:!0}),r);var oe={};j(oe,{default:()=>re});module.exports=D(oe);var n=require("react/jsx-runtime"),v=L(require("classnames")),s=require("react"),S=require("../../context/provider"),x=L(require("../../context/hooks/useCountries")),f=require("../../context/const"),y=require("../../context/hooks/useAddressValidate"),U=require("../../context/hooks/useRedeemProduct"),O=require("../../modal/modalContainer"),q=require("@anker-in/lib"),w=require("./Error"),F=require("./Success"),K=require("./Address"),_=require("./Init");function ee({item:r,copy:e,onError:t,...a}){const{fetchCreditInfo:i,profile:b}=(0,S.useCreditsContext)(),{storeDomain:k,locale:T}=(0,q.useHeadlessContext)(),{validatorInfo:B}=e,{shippingAddress:G,shippingProduct:P}=e.redeemModal.product,[m,u]=(0,s.useState)("init"),[l,H]=(0,s.useState)(),[J,p]=(0,s.useState)({code:0,message:"",imageUrl:""}),[C,c]=(0,s.useState)(!1),{countries:R=[],isLoading:de}=(0,x.default)({shopifyStoreDomain:k}),{isMutating:M,trigger:A}=(0,U.useRedeemProduct)({onSuccess(o){if(!o){u("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(o?.code===0)i(b?.user_id),u("success");else{let d,I;o.code===f.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(d=e.redeemModal.redeemLimitError,c(!0)):o.code===f.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(d=e.redeemModal.inventoryNotEnough,c(!0),I=e.redeemModal.inventoryNotEnough):o.code===f.AlpcErrorCode.CodeLpcNotEnoughCredits?(d=e.redeemModal.creditsNotEnough,c(!0),i(b?.user_id)):o.code===f.AlpcErrorCode.CodeCrossSiteError&&(d=e.redeemModal.crossSiteError,c(!0)),u("error"),p({code:o.code,imageUrl:I||e.redeemModal.errorImageUrl||"",message:d||e.redeemModal.commonError||""}),t&&t(o.code)}},onError(o){u("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""})}}),h=(0,s.useMemo)(()=>e?.redeemModal.product.form?.flat().find(d=>d.type==="state")?.key,[e?.redeemModal.product.form]),{validate:E,errors:V}=(0,y.useAddressValidate)({address:l,validatorInfo:B,formData:e?.redeemModal.product.form?.flat()||[],errorLabel:{require:e.redeemModal.product.required,email:e.redeemModal.product.invalidEmail}}),z=(0,s.useCallback)(async()=>{const o=[];if(h&&((R.find(Q=>Q.code===l.country)?.provinces||[]).length||o.push(h)),E({force:!0,ignoreKeys:o}))return;let d={...l};d.name&&delete d.name,d.country==="UK"&&(d.country="GB"),A({address:btoa(JSON.stringify(d)),rule_id:Number(r.alpc?.id)})},[r,A,h,E,l,R]);return(0,s.useEffect)(()=>{a.isOpen||(c(!1),p({code:0,message:"",imageUrl:""}))},[a.isOpen,T]),(0,n.jsxs)(O.CreditsModalContainer,{...a,className:(0,v.default)("w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]",m!=="init"&&"w-[740px] md:w-full"),scrollClassName:"mb-0 min-l:px-0 md:mb-0 px-0",titleClassName:(0,v.default)("h-[56px]",m==="init"&&"bg-[#F5F5F7]"),title:m==="address"?"Order Confirmation":"",children:[m==="error"&&(0,n.jsx)(w.Error,{errorInfo:J}),m==="success"&&(0,n.jsx)(F.Success,{copy:e,shippingProduct:P,loading:M,address:l,disabled:C,onClose:a.onClose,item:r}),m==="address"&&(0,n.jsx)(K.Address,{copy:e,shippingAddress:G,setAddress:H,validateAddress:E,validateErrors:V,shippingProduct:P,loading:M,address:l,disabled:C,handlePayment:z,item:r}),m==="init"&&(0,n.jsx)(_.Init,{item:r,copy:e,loading:M,disabled:C,setStatus:u})]})}var re=ee;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport { useCreditsContext } from '../../context/provider'\nimport useCountries from '../../context/hooks/useCountries'\nimport { AlpcErrorCode } from '../../context/const'\nimport { useAddressValidate } from '../../context/hooks/useAddressValidate'\nimport { useRedeemProduct } from '../../context/hooks/useRedeemProduct'\nimport type { ModalContainerProps } from '../../modal/modalContainer'\nimport { CreditsModalContainer } from '../../modal/modalContainer'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { CreditsRedeemListCopy } from '../type'\nimport { Error } from './Error'\nimport { Success } from './Success'\nimport { Address } from './Address'\nimport { Init } from './Init'\n\ntype RedeemProductModalProps = ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: AlpcErrorCode) => void\n}\n\nfunction RedeemProductModal({ item, copy, onError, ...props }: RedeemProductModalProps) {\n const { fetchCreditInfo, profile } = useCreditsContext()\n const { storeDomain, locale } = useHeadlessContext()\n\n const { validatorInfo } = copy\n const { shippingAddress, shippingProduct } = copy.redeemModal.product\n\n const [status, setStatus] = useState<'init' | 'address' | 'success' | 'error'>('init')\n const [address, setAddress] = useState<any>()\n const [errorInfo, setErrorInfo] = useState({\n code: 0,\n message: '',\n imageUrl: '',\n })\n const [disabled, setDisabled] = useState(false)\n\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n const { isMutating: loading, trigger } = useRedeemProduct({\n onSuccess(responseData) {\n if (!responseData) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n return\n }\n\n if (responseData?.code === 0) {\n fetchCreditInfo(profile?.user_id)\n setStatus('success')\n } else {\n let errorMsg\n let errorImage\n if (responseData.code === AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit) {\n errorMsg = copy.redeemModal.redeemLimitError\n setDisabled(true)\n } else if (responseData.code === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n errorMsg = copy.redeemModal.inventoryNotEnough\n setDisabled(true)\n errorImage = copy.redeemModal.inventoryNotEnough\n } else if (responseData.code === AlpcErrorCode.CodeLpcNotEnoughCredits) {\n errorMsg = copy.redeemModal.creditsNotEnough\n setDisabled(true)\n fetchCreditInfo(profile?.user_id)\n } else if (responseData.code === AlpcErrorCode.CodeCrossSiteError) {\n errorMsg = copy.redeemModal.crossSiteError\n setDisabled(true)\n }\n\n setStatus('error')\n setErrorInfo({\n code: responseData.code,\n imageUrl: errorImage || copy.redeemModal.errorImageUrl || '',\n message: errorMsg || copy.redeemModal.commonError || '',\n })\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setStatus('error')\n setErrorInfo({\n code: 0,\n imageUrl: copy.redeemModal.errorImageUrl || '',\n message: copy.redeemModal.commonError || '',\n })\n },\n })\n\n const stateInputKey = useMemo(() => {\n const stateInput = copy?.redeemModal.product.form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [copy?.redeemModal.product.form])\n\n const { validate: validateAddress, errors: validateErrors } = useAddressValidate({\n address: address,\n validatorInfo: validatorInfo,\n formData: copy?.redeemModal.product.form?.flat() || [],\n errorLabel: {\n require: copy.redeemModal.product.required,\n email: copy.redeemModal.product.invalidEmail,\n },\n })\n\n const handlePayment = useCallback(async () => {\n const ignoreKeys: string[] = []\n\n if (stateInputKey) {\n const provinces = countries.find(item => item.code === address.country)?.provinces || []\n\n if (!provinces.length) {\n ignoreKeys.push(stateInputKey as never)\n }\n }\n\n if (\n validateAddress({\n force: true,\n ignoreKeys,\n })\n ) {\n // \u5730\u5740\u6821\u9A8C\u9519\u8BEF\n return\n }\n let requestAddress = { ...address }\n if (requestAddress.name) {\n delete requestAddress.name\n }\n if (requestAddress.country === 'UK') {\n requestAddress.country = 'GB'\n }\n trigger({\n address: btoa(JSON.stringify(requestAddress)),\n rule_id: Number(item.alpc?.id),\n })\n }, [item, trigger, stateInputKey, validateAddress, address, countries])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo({ code: 0, message: '', imageUrl: '' })\n }\n }, [props.isOpen, locale])\n\n return (\n <CreditsModalContainer\n {...props}\n className={classNames(\n 'w-[540px] md:h-auto min-md:max-h-[calc(100vh-40px)]',\n status !== 'init' && 'w-[740px] md:w-full'\n )}\n scrollClassName=\"mb-0 min-l:px-0 md:mb-0 px-0\"\n titleClassName={classNames('h-[56px]', status === 'init' && 'bg-[#F5F5F7]')}\n title={status === 'address' ? 'Order Confirmation' : ''}\n >\n {status === 'error' && <Error errorInfo={errorInfo} />}\n {status === 'success' && (\n <Success\n copy={copy}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n onClose={props.onClose}\n item={item}\n />\n )}\n {status === 'address' && (\n <Address\n copy={copy}\n shippingAddress={shippingAddress}\n setAddress={setAddress}\n validateAddress={validateAddress}\n validateErrors={validateErrors}\n shippingProduct={shippingProduct}\n loading={loading}\n address={address}\n disabled={disabled}\n handlePayment={handlePayment}\n item={item}\n />\n )}\n {status === 'init' && (\n <Init item={item} copy={copy} loading={loading} disabled={disabled} set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AAUL,EAAU,UAAWL,EAAW,GAE9F,CAEJ,CAEA,IAAO7B,GAAQgB",
|
|
6
|
+
"names": ["RedeemProductModal_exports", "__export", "RedeemProductModal_default", "__toCommonJS", "import_jsx_runtime", "import_classnames", "import_react", "import_provider", "import_useCountries", "import_const", "import_useAddressValidate", "import_useRedeemProduct", "import_modalContainer", "import_lib", "import_Error", "import_Success", "import_Address", "import_Init", "RedeemProductModal", "item", "copy", "onError", "props", "fetchCreditInfo", "profile", "storeDomain", "locale", "validatorInfo", "shippingAddress", "shippingProduct", "status", "setStatus", "address", "setAddress", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "countries", "countriesLoading", "useCountries", "loading", "trigger", "responseData", "errorMsg", "errorImage", "error", "stateInputKey", "validateAddress", "validateErrors", "handlePayment", "ignoreKeys", "requestAddress", "classNames"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RedeemableItem as RedeemableItemType } from '../type';
|
|
2
|
+
import type { CreditsRedeemListCopy } from './type';
|
|
3
|
+
export declare function RedeemableItem({ copy, className, item, onRulesOpen, onRedeem, }: {
|
|
4
|
+
copy: CreditsRedeemListCopy;
|
|
5
|
+
className?: string;
|
|
6
|
+
item: RedeemableItemType;
|
|
7
|
+
onRulesOpen: (rules: string[]) => void;
|
|
8
|
+
onRedeem: (item: RedeemableItemType) => void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var C=Object.create;var m=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var k=(t,a)=>{for(var e in a)m(t,e,{get:a[e],enumerable:!0})},b=(t,a,e,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of T(a))!I.call(t,n)&&n!==e&&m(t,n,{get:()=>a[n],enumerable:!(p=R(a,n))||p.enumerable});return t};var z=(t,a,e)=>(e=t!=null?C(w(t)):{},b(a||!t||!t.__esModule?m(e,"default",{value:t,enumerable:!0}):e,t)),L=t=>b(m({},"__esModule",{value:!0}),t);var S={};k(S,{RedeemableItem:()=>P});module.exports=L(S);var l=require("react/jsx-runtime"),i=require("@anker-in/headless-ui"),d=require("react"),c=z(require("classnames")),_=require("../context/provider"),o=require("../context/const"),h=require("../context/utils"),x=require("../../../helpers/track"),y=require("./NonProductValue");function P({copy:t,className:a,item:e,onRulesOpen:p,onRedeem:n}){const{creditInfo:f,profile:r,gtm:{pageGroup:v}}=(0,_.useCreditsContext)(),s=Object.keys(r||{}).length>0,N=(0,d.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===o.AlpcConsumeType.Product&&!e.variant?.availableForSale||s&&r?.activated&&e.alpc?.consumeCredits>Number(f?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,s,r?.activated,f?.available_credit,e.variant?.availableForSale]),g=(0,d.useMemo)(()=>s?e.alpc?.consumeType===o.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:t?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[s,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,t?.soldOut]);return(0,l.jsxs)("div",{className:(0,c.default)("flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]",a),children:[e.config?.type===o.ConsumeType.Product?(0,l.jsx)("div",{className:(0,c.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,l.jsx)(i.Picture,{className:"h-full w-auto [&_img]:h-full [&_img]:object-contain",source:e.config?.image?.url||e.product.images?.[0]?.url})}):(0,l.jsxs)("div",{className:"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]",children:[(0,l.jsx)(i.Picture,{source:t?.imageMapping[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,l.jsx)(y.NoneProductValue,{item:e,copy:t})]}),(0,l.jsxs)("div",{className:(0,c.default)("mt-[22px] flex w-full flex-1 flex-col justify-between"),children:[(0,l.jsx)(i.Text,{html:e.config?.title||e.alpc?.title,title:e.config?.title||e.alpc?.title,size:2,className:"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]"}),e.config?.rules?.length>0&&(0,l.jsx)("button",{type:"button",onClick:()=>{p(e.config?.rules||[]),(0,x.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:r?.activated?"active":"not active",event_parameters:{page_group:v,position:t.title,button_name:t?.ruleLabel,info:e.alpc?.id?.toString()}})},className:"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0",tabIndex:0,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&u.preventDefault()},children:t?.ruleLabel}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]",children:[(0,l.jsx)(i.Picture,{className:"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783"}),(0,l.jsx)(i.Text,{html:`${(0,h.numberFormat)(e.alpc?.consumeCredits)}`,size:2,as:"p",className:"ml-[4px] text-[28px] font-bold mt-[4px] leading-none md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] "})]}),(0,l.jsx)(i.Button,{disabled:N,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{n(e),(0,x.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:r?.activated?"active":"not active",event_parameters:{page_group:v,position:t.title,button_name:g,info:e.alpc?.id?.toString()}})},children:g})]})]})]})}
|
|
2
|
+
//# sourceMappingURL=RedeemableItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemableItem.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Text, Picture } from '@anker-in/headless-ui'\n\nimport { useMemo } from 'react'\n\nimport classNames from 'classnames'\nimport { useCreditsContext } from '../context/provider'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { AlpcConsumeType, ConsumeType } from '../context/const'\nimport { numberFormat } from '../context/utils'\nimport type { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\nimport { NoneProductValue } from './NonProductValue'\n\nexport function RedeemableItem({\n copy,\n className,\n item,\n onRulesOpen,\n onRedeem,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n item: RedeemableItemType\n onRulesOpen: (rules: string[]) => void\n onRedeem: (item: RedeemableItemType) => void\n}) {\n const {\n creditInfo,\n profile,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const isDisabled = useMemo(() => {\n if (item.alpc?.remainingInventory <= 0 && item.alpc?.isLimited) {\n // \u6709\u5E93\u5B58\u9650\u5236\n return true\n }\n\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n if (!item.variant?.availableForSale) {\n return true\n }\n }\n if (isLogin && profile?.activated && item.alpc?.consumeCredits > Number(creditInfo?.available_credit || 0)) {\n return true\n }\n return false\n }, [\n item.alpc?.remainingInventory,\n item.alpc?.isLimited,\n item.alpc?.consumeType,\n item.alpc?.consumeCredits,\n isLogin,\n profile?.activated,\n creditInfo?.available_credit,\n item.variant?.availableForSale,\n ])\n\n const redeemButtonText = useMemo(() => {\n if (!isLogin) {\n return copy.unlockRewards\n }\n\n // \u7F3A\u8D27\u6587\u6848\n if (item.alpc?.consumeType === AlpcConsumeType.Product) {\n return item.variant?.availableForSale ? copy.btnRedeem : copy?.soldOut || 'Sold Out'\n }\n return copy.btnRedeem\n }, [\n isLogin,\n item.alpc?.consumeType,\n item.variant?.availableForSale,\n copy.btnRedeem,\n copy.unlockRewards,\n copy?.soldOut,\n ])\n\n return (\n <div\n className={classNames(\n 'flex flex-col items-center rounded-[16px] bg-[#EAEAEC] p-[24px] md:rounded-[12px] md:px-[8px] xl:py-[16px] md-xl:px-[16px]',\n className\n )}\n >\n {item.config?.type === ConsumeType.Product ? (\n <div className={classNames('relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]')}>\n <Picture\n className=\"h-full w-auto [&_img]:h-full [&_img]:object-contain\"\n source={item.config?.image?.url || item.product.images?.[0]?.url}\n ></Picture>\n </div>\n ) : (\n <div className=\"relative mx-auto my-[30px] h-[164px] md:my-0 md:h-[66px] l-xxl:h-[138px] md-l:h-[80px]\">\n <Picture\n source={copy?.imageMapping[item.config?.type]?.url}\n className=\"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n\n <NoneProductValue item={item} copy={copy} />\n </div>\n )}\n <div className={classNames('mt-[22px] flex w-full flex-1 flex-col justify-between')}>\n <Text\n html={item.config?.title || item.alpc?.title}\n title={item.config?.title || item.alpc?.title}\n size={2}\n className=\"line-clamp-2 h-[58px] text-[24px] leading-[1.2] l:h-[40px] l:text-[16px] l-xxl:h-[48px] l-xxl:text-[20px]\"\n />\n {item.config?.rules?.length > 0 && (\n <button\n type=\"button\"\n onClick={() => {\n onRulesOpen(item.config?.rules || [])\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: copy?.ruleLabel,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n className=\"mt-[8px] w-fit text-[16px] font-bold underline md:text-[14px] l:mt-0\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copy?.ruleLabel}\n </button>\n )}\n <div>\n <div className=\"mt-[26px] flex items-center l:mt-[12px] l-xl:mt-[16px]\">\n <Picture\n className=\"size-[24px] l-xxl:size-[22px] md-l:size-[18px] md:size-[16px]\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/icon_hire_purchase.png?v=1757496783\"\n />\n <Text\n html={`${numberFormat(item.alpc?.consumeCredits)}`}\n size={2}\n as=\"p\"\n className=\"ml-[4px] text-[28px] font-bold mt-[4px] leading-none md:text-[18px] l-xxl:text-[24px] md-l:text-[20px] \"\n />\n </div>\n\n <Button\n disabled={isDisabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[8px] md:px-[8px] l:w-full\"\n onClick={() => {\n onRedeem(item)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: pageGroup,\n position: copy.title,\n button_name: redeemButtonText,\n info: item.alpc?.id?.toString(),\n },\n })\n }}\n >\n {redeemButtonText}\n </Button>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAuFU,IAAAI,EAAA,6BAvFVC,EAAsC,iCAEtCC,EAAwB,iBAExBC,EAAuB,yBACvBC,EAAkC,+BAElCC,EAA6C,4BAC7CC,EAA6B,4BAE7BC,EAAwB,kCACxBC,EAAiC,6BAE1B,SAASV,EAAe,CAC7B,KAAAW,EACA,UAAAC,EACA,KAAAC,EACA,YAAAC,EACA,SAAAC,CACF,EAMG,CACD,KAAM,CACJ,WAAAC,EACA,QAAAC,EACA,IAAK,CAAE,UAAAC,CAAU,CACnB,KAAI,qBAAkB,EAChBC,EAAU,OAAO,KAAKF,GAAW,CAAC,CAAC,EAAE,OAAS,EAE9CG,KAAa,WAAQ,IACrB,GAAAP,EAAK,MAAM,oBA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,CAAC,CAAC,KACpC,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaA,GAAM,UACnB,KAAME,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EACA,UAAU,uEACV,SAAU,EACV,UAAWU,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAZ,GAAM,UACT,KAEF,QAAC,OACC,qBAAC,OAAI,UAAU,yDACb,oBAAC,WACC,UAAU,gEACV,OAAO,6FACT,KACA,OAAC,QACC,KAAM,MAAG,gBAAaE,EAAK,MAAM,cAAc,CAAC,GAChD,KAAM,EACN,GAAG,IACH,UAAU,0GACZ,GACF,KAEA,OAAC,UACC,SAAUO,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbL,EAASF,CAAI,KACb,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaU,EACb,KAAMR,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAQ,EACH,GACF,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["RedeemableItem_exports", "__export", "RedeemableItem", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_react", "import_classnames", "import_provider", "import_const", "import_utils", "import_track", "import_NonProductValue", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "isLogin", "isDisabled", "redeemButtonText", "classNames", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CreditsRedeemListCopy } from './type';
|
|
2
|
+
export declare function CreditsRedeemList({ copy, className, tabClassName, hideTitle, cardClassName, activate, }: {
|
|
3
|
+
copy: CreditsRedeemListCopy;
|
|
4
|
+
className?: string;
|
|
5
|
+
tabClassName?: string;
|
|
6
|
+
hideTitle?: boolean;
|
|
7
|
+
cardClassName?: string;
|
|
8
|
+
activate: {
|
|
9
|
+
openAuthCodePopup: () => void;
|
|
10
|
+
isSuccess: boolean;
|
|
11
|
+
};
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var J=Object.create;var b=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Y=(e,t)=>{for(var a in t)b(e,a,{get:t[a],enumerable:!0})},E=(e,t,a,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Q(t))!X.call(e,d)&&d!==a&&b(e,d,{get:()=>t[d],enumerable:!(f=K(t,d))||f.enumerable});return e};var g=(e,t,a)=>(a=e!=null?J(W(e)):{},E(t||!e||!e.__esModule?b(a,"default",{value:e,enumerable:!0}):a,e)),Z=e=>E(b({},"__esModule",{value:!0}),e);var ee={};Y(ee,{CreditsRedeemList:()=>$});module.exports=Z(ee);var o=require("react/jsx-runtime"),r=require("@anker-in/headless-ui"),C=g(require("classnames")),i=require("react"),A=g(require("./RedeemCouponModal")),M=g(require("./RedeemProductModal")),S=require("../context/provider"),O=g(require("../context/hooks/useRedeemableList")),u=require("../context/const"),F=require("@anker-in/lib"),z=require("./RedeemableItem"),D=g(require("../modal/rulesModal")),H=require("../../../helpers/track");function $({copy:e,className:t="",tabClassName:a="",hideTitle:f=!1,cardClassName:d,activate:y}){const{profile:L,openSignUpPopup:j,gtm:{pageGroup:w}}=(0,S.useCreditsContext)(),B=Object.keys(L||{}).length>0,[v,G]=(0,i.useState)(e.list[0].label),[l,R]=(0,i.useState)(void 0),[T,N]=(0,i.useState)(),{listLoading:U,redeemableList:k,getRedeemableList:x}=(0,O.default)(),p=(0,i.useMemo)(()=>k.map(s=>({id:s.id.toString(),title:s.name,consumeCredits:s.consume_credits,remainingInventory:s.remaining_inventory,isLimited:!!s.is_limited,consumeType:s.consume_type,handle:s.sku_handle,sku:s.goods_sku,image:s.goods_url})),[e.list,v,k]),V=p.map(s=>s.handle),{data:_}=(0,F.useProductsByHandles)({handles:V}),q=(0,i.useMemo)(()=>e.list.find(n=>n.label===v)?.list.filter(n=>p.some(c=>c.id===n.id)).map(n=>{const c=p.find(m=>m.id===n.id),h=_?.find(m=>m.handle===c?.handle),P=h?.variants.find(m=>m.sku===c?.sku);return c?.consumeType===u.AlpcConsumeType.Product&&(!h||!P)?null:{alpc:p.find(m=>m.id===n.id),config:n,product:h,variant:P}}).filter(n=>n!==null),[p,_]),I=(0,i.useCallback)(s=>{s===u.AlpcErrorCode.CodeLpcRuleInventoryNotEnough&&x()},[x]);return(0,o.jsxs)(r.Container,{className:(0,C.default)("relative bg-[#F5F5F7]",t),children:[!f&&(0,o.jsx)(r.Heading,{as:"h2",size:"4",html:e.title}),(0,o.jsx)(r.Tabs,{shape:"rounded",align:"left",className:(0,C.default)("sticky top-0 z-20 py-[24px] md:justify-center",a),value:v.toString(),onValueChange:s=>{G(s),(0,H.gaTrack)({event:"ga4Event",event_name:"lp_navigation",event_parameters:{navigation:s,page_group:w}})},children:(0,o.jsx)(r.TabsList,{children:e.list.map(s=>(0,o.jsx)(r.TabsTrigger,{value:s.label,children:s.label},s.label))})}),!!p?.length&&!U&&(0,o.jsx)("div",{className:(0,C.default)("relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3"),children:q?.map(s=>(0,o.jsx)(z.RedeemableItem,{copy:e,item:s,onRedeem:n=>{B?!L?.activated&&!y.isSuccess?y.openAuthCodePopup():R(n):j()},onRulesOpen:N,className:d},s?.alpc?.id))}),l?.alpc?.consumeType===u.AlpcConsumeType.Coupon&&e?.redeemModal?.coupon&&l&&(0,o.jsx)(A.default,{isOpen:!!l,item:l,copy:e,onError:I,onClose:()=>{R(void 0)}}),l?.alpc?.consumeType===u.AlpcConsumeType.Product&&e?.redeemModal&&l&&(0,o.jsx)(M.default,{isOpen:!!l,item:l,copy:e,onError:I,onClose:()=>{R(void 0)}}),T&&(0,o.jsx)(D.default,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:T.length>0,onClose:()=>N([]),titleClassName:"border-b-transparent h-[56px]",rules:T,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:e?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})}
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsRedeemList/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport RedeemCouponModal from './RedeemCouponModal'\nimport RedeemProductModal from './RedeemProductModal'\nimport { useCreditsContext } from '../context/provider'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { AlpcConsumeType, AlpcErrorCode } from '../context/const'\nimport { useProductsByHandles } from '@anker-in/lib'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { RedeemableItem } from './RedeemableItem'\nimport RulesModal from '../modal/rulesModal'\nimport { CreditsRedeemListCopy } from './type'\nimport { gaTrack } from '../../../helpers/track'\n\nexport function CreditsRedeemList({\n copy,\n className = '',\n tabClassName = '',\n hideTitle = false,\n cardClassName,\n activate,\n}: {\n copy: CreditsRedeemListCopy\n className?: string\n tabClassName?: string\n hideTitle?: boolean\n cardClassName?: string\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n }\n}) {\n const {\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n } = useCreditsContext()\n const isLogin = Object.keys(profile || {}).length > 0\n\n const [activeTab, setActiveTab] = useState<string>(copy.list[0].label)\n\n const [popRedeemData, setPopRedeemData] = useState<RedeemableItemType | undefined>(undefined)\n\n const [rules, setRules] = useState<string | string[]>()\n\n const { listLoading, redeemableList, getRedeemableList } = useRedeemableList()\n\n const alpcList = useMemo(() => {\n return redeemableList.map(item => {\n return {\n id: item.id.toString(),\n title: item.name,\n consumeCredits: item.consume_credits,\n remainingInventory: item.remaining_inventory,\n isLimited: !!item.is_limited,\n consumeType: item.consume_type,\n handle: item.sku_handle,\n sku: item.goods_sku,\n image: item.goods_url,\n }\n })\n }, [copy.list, activeTab, redeemableList])\n\n const handles = alpcList.map(item => item.handle)\n const { data: products } = useProductsByHandles({ handles })\n\n const list = useMemo(() => {\n const currentList = copy.list.find(item => item.label === activeTab)\n return currentList?.list\n .filter(item => alpcList.some(alpcItem => alpcItem.id === item.id))\n .map(item => {\n const alpcItem = alpcList.find(alpcItem => alpcItem.id === item.id)\n const product = products?.find(product => product.handle === alpcItem?.handle)\n const variant = product?.variants.find(variant => variant.sku === alpcItem?.sku)\n if (alpcItem?.consumeType === AlpcConsumeType.Product && (!product || !variant)) return null\n return {\n alpc: alpcList.find(alpcItem => alpcItem.id === item.id),\n config: item,\n product,\n variant,\n }\n })\n .filter(item => item !== null) as unknown as RedeemableItemType[]\n }, [alpcList, products])\n\n const handleRedeemError = useCallback(\n (errorCode: AlpcErrorCode) => {\n if (errorCode === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n getRedeemableList()\n }\n },\n [getRedeemableList]\n )\n\n return (\n <Container className={classNames('relative bg-[#F5F5F7]', className)}>\n {!hideTitle && <Heading as=\"h2\" size=\"4\" html={copy.title} />}\n\n <Tabs\n shape=\"rounded\"\n align=\"left\"\n className={classNames('sticky top-0 z-20 py-[24px] md:justify-center', tabClassName)}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_navigation',\n event_parameters: {\n navigation: value,\n page_group: pageGroup,\n },\n })\n }}\n >\n <TabsList>\n {copy.list.map(item => (\n <TabsTrigger key={item.label} value={item.label}>\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n {/* PC\u7AEF */}\n {!!alpcList?.length && !listLoading && (\n <div\n className={classNames('relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3')}\n >\n {list?.map(item => (\n <RedeemableItem\n key={item?.alpc?.id}\n copy={copy}\n item={item}\n onRedeem={(item: RedeemableItemType) => {\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !activate.isSuccess) {\n activate.openAuthCodePopup()\n } else {\n setPopRedeemData(item)\n }\n }}\n onRulesOpen={setRules}\n className={cardClassName}\n />\n ))}\n </div>\n )}\n\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Coupon && copy?.redeemModal?.coupon && popRedeemData && (\n <RedeemCouponModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Product && copy?.redeemModal && popRedeemData && (\n <RedeemProductModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={copy?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,uBAAAE,IAAA,eAAAC,EAAAH,IAiGI,IAAAI,EAAA,6BAjGJC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C,KAAMrB,EACN,KAAMqB,EACN,SAAWA,GAA6B,CACjCZ,EAEM,CAACH,GAAS,WAAa,CAACD,EAAS,UAC1CA,EAAS,kBAAkB,EAE3BQ,EAAiBQ,CAAI,EAJrBd,EAAgB,CAMpB,EACA,YAAaQ,EACb,UAAWX,GAbNiB,GAAM,MAAM,EAcnB,CACD,EACH,EAGDT,GAAe,MAAM,cAAgB,kBAAgB,QAAUZ,GAAM,aAAa,QAAUY,MAC3F,OAAC,EAAAoB,QAAA,CACC,OAAQ,CAAC,CAACpB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS4B,EACT,QAAS,IAAM,CACbf,EAAiB,MAAS,CAC5B,EACF,EAEDD,GAAe,MAAM,cAAgB,kBAAgB,SAAWZ,GAAM,aAAeY,MACpF,OAAC,EAAAqB,QAAA,CACC,OAAQ,CAAC,CAACrB,EACV,KAAMA,EACN,KAAMZ,EACN,QAAS4B,EACT,QAAS,IAAM,CACbf,EAAiB,MAAS,CAC5B,EACF,EAEDC,MACC,OAAC,EAAAoB,QAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQpB,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOd,GAAM,UACb,cAAc,2BAChB,GAEJ,CAEJ",
|
|
6
|
+
"names": ["creditsRedeemList_exports", "__export", "CreditsRedeemList", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_react", "import_RedeemCouponModal", "import_RedeemProductModal", "import_provider", "import_useRedeemableList", "import_const", "import_lib", "import_RedeemableItem", "import_rulesModal", "import_track", "copy", "className", "tabClassName", "hideTitle", "cardClassName", "activate", "profile", "openSignUpPopup", "pageGroup", "isLogin", "activeTab", "setActiveTab", "popRedeemData", "setPopRedeemData", "rules", "setRules", "listLoading", "redeemableList", "getRedeemableList", "useRedeemableList", "alpcList", "item", "handles", "products", "list", "alpcItem", "product", "variant", "handleRedeemError", "errorCode", "classNames", "value", "RedeemCouponModal", "RedeemProductModal", "RulesModal"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CreditsPageCommon } from '../type';
|
|
2
|
+
export type CreditsRedeemListCopy = {
|
|
3
|
+
title: string;
|
|
4
|
+
giftCardLabel: string;
|
|
5
|
+
unlockRewards: string;
|
|
6
|
+
btnRedeem: string;
|
|
7
|
+
list: {
|
|
8
|
+
label: string;
|
|
9
|
+
list: {
|
|
10
|
+
id: string;
|
|
11
|
+
type: string;
|
|
12
|
+
value: string;
|
|
13
|
+
rules: string[];
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
16
|
+
validatorInfo: {
|
|
17
|
+
addressInfo: {
|
|
18
|
+
name: string;
|
|
19
|
+
country: string;
|
|
20
|
+
province: string;
|
|
21
|
+
city: string;
|
|
22
|
+
address: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
redeemModal: {
|
|
26
|
+
confirmTitle: string;
|
|
27
|
+
confirmButton: string;
|
|
28
|
+
commonError: string;
|
|
29
|
+
redeemLimitError: string;
|
|
30
|
+
inventoryNotEnough: string;
|
|
31
|
+
creditsNotEnough: string;
|
|
32
|
+
crossSiteError: string;
|
|
33
|
+
errorImageUrl: string;
|
|
34
|
+
coupon: {
|
|
35
|
+
successDesc: string;
|
|
36
|
+
successTitle: string;
|
|
37
|
+
successButton: string;
|
|
38
|
+
successButtonUrl: string;
|
|
39
|
+
};
|
|
40
|
+
product: {
|
|
41
|
+
required: string;
|
|
42
|
+
invalidEmail: string;
|
|
43
|
+
shippingAddress: string;
|
|
44
|
+
shippingProduct: string;
|
|
45
|
+
addressForm: {
|
|
46
|
+
key: string;
|
|
47
|
+
type: string;
|
|
48
|
+
label: string;
|
|
49
|
+
isSelect: boolean;
|
|
50
|
+
required: boolean;
|
|
51
|
+
placeholder: string;
|
|
52
|
+
}[][];
|
|
53
|
+
form: {
|
|
54
|
+
key: string;
|
|
55
|
+
type: string;
|
|
56
|
+
isSelect: boolean;
|
|
57
|
+
required: boolean;
|
|
58
|
+
placeholder: string;
|
|
59
|
+
}[][];
|
|
60
|
+
successDesc: string[];
|
|
61
|
+
rules: string[];
|
|
62
|
+
steps: {
|
|
63
|
+
imageUrl: string;
|
|
64
|
+
title: string;
|
|
65
|
+
}[];
|
|
66
|
+
quantityLabel: string;
|
|
67
|
+
totalPriceLabel: string;
|
|
68
|
+
variantLabel: string;
|
|
69
|
+
shippingFeeLabel: string;
|
|
70
|
+
paymentButton: string;
|
|
71
|
+
stepTitle: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
copied: string;
|
|
75
|
+
off: string;
|
|
76
|
+
copy: string;
|
|
77
|
+
} & CreditsPageCommon;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var a=(t,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of o(r))!l.call(t,s)&&s!==n&&e(t,s,{get:()=>r[s],enumerable:!(i=g(r,s))||i.enumerable});return t};var c=t=>a(e({},"__esModule",{value:!0}),t);var d={};module.exports=c(d);
|
|
2
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsRedeemList/type.ts"],
|
|
4
|
+
"sourcesContent": ["import { CreditsPageCommon } from '../type'\n\nexport type CreditsRedeemListCopy = {\n title: string\n giftCardLabel: string\n unlockRewards: string\n btnRedeem: string\n list: {\n label: string\n list: {\n id: string\n type: string\n value: string\n rules: string[]\n }[]\n }[]\n validatorInfo: {\n addressInfo: {\n name: string\n country: string\n province: string\n city: string\n address: string\n }\n }\n redeemModal: {\n confirmTitle: string\n confirmButton: string\n commonError: string\n redeemLimitError: string\n inventoryNotEnough: string\n creditsNotEnough: string\n crossSiteError: string\n errorImageUrl: string\n coupon: {\n successDesc: string\n successTitle: string\n successButton: string\n successButtonUrl: string\n }\n product: {\n required: string\n invalidEmail: string\n shippingAddress: string\n shippingProduct: string\n addressForm: {\n key: string\n type: string\n label: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n form: {\n key: string\n type: string\n isSelect: boolean\n required: boolean\n placeholder: string\n }[][]\n successDesc: string[]\n rules: string[]\n steps: {\n imageUrl: string\n title: string\n }[]\n quantityLabel: string\n totalPriceLabel: string\n variantLabel: string\n shippingFeeLabel: string\n paymentButton: string\n stepTitle: string\n }\n }\n copied: string\n off: string\n copy: string\n} & CreditsPageCommon\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["type_exports", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var A=(i,l)=>{for(var o in l)g(i,o,{get:l[o],enumerable:!0})},G=(i,l,o,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let n of S(l))!B.call(i,n)&&n!==o&&g(i,n,{get:()=>l[n],enumerable:!(d=D(l,n))||d.enumerable});return i};var M=i=>G(g({},"__esModule",{value:!0}),i);var U={};A(U,{CreditsWaysToGetCredits:()=>P});module.exports=M(U);var e=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),u=require("@heroicons/react/24/outline"),F=require("framer-motion"),f=require("react"),x=require("./type"),y=require("./useActions"),z=require("../context/provider"),k=require("../../../helpers/index");const P=({copy:i,activate:l,subscribe:o,uploadReceipt:d,classNames:n})=>{const[r,C]=(0,f.useState)(!1),{profile:I}=(0,z.useCreditsContext)(),h=!!I,{actions:b}=(0,y.useActions)({copy:i,activate:l,subscribe:o,uploadReceipt:d}),L=(0,f.useMemo)(()=>{const t=i.list.map(a=>{if(!b[a.id])return;const{finished:p,notLogin:N,notFinished:v,completed:T}=b[a.id];let m="",c,w;return h?p?(m=T.buttonLabel,c=void 0):(m=v.buttonLabel,c=v.handleClick,w=v.link):(m=N.buttonLabel,c=N.handleClick),{...a,buttonLabel:m,handleClick:c,finished:p,link:w}}).filter(Boolean);return h?t.sort((a,p)=>a?.finished&&!p?.finished?1:!a?.finished&&p?.finished?-1:0):t},[b,i.list,h]);return(0,e.jsx)(s.Container,{id:"ways-to-get-credits",className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:(0,e.jsxs)("div",{className:"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",children:[(0,e.jsx)(s.Heading,{as:"h2",size:4,html:i?.title,className:"text-center l:pl-[16px] l:text-left"}),(0,e.jsxs)("div",{className:"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]",children:[(0,e.jsxs)("div",{className:"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]",children:[(0,e.jsx)(s.Heading,{size:3,as:"h3",html:i.subtitle,className:n?.subtitle}),(0,e.jsxs)("div",{className:"mt-[8px] flex items-center",children:[i.creditsIcon?.url&&(0,e.jsx)(s.Picture,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:i.creditsIcon.url,alt:i.creditsIcon.alt||"credits"}),(0,e.jsx)(s.Heading,{html:i.equalCredits,size:4,as:"h3",className:(0,k.cn)("mt-2 text-white md:text-[24px]",n?.equalCreditsText)})]})]}),(0,e.jsx)(s.Picture,{className:"w-full laptop:w-[50%]",source:i.mainImage?.url})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)(F.motion.div,{className:(0,k.cn)("relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2"),initial:{height:512},animate:{height:r?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!r&&window.screen.width<768){const t=document.getElementById("ways-to-get-credits");t&&t.scrollIntoView({behavior:"smooth",block:"end"})}},children:[L.map(t=>(0,e.jsxs)("div",{className:"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Heading,{as:"h4",html:t.title,size:2,className:"text-pretty"}),(0,e.jsxs)("div",{className:"mt-[4px] flex items-center",children:[(0,e.jsx)(s.Picture,{className:"size-[24px] xl:size-[18px] [&_path]:size-full",source:"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450"}),(0,e.jsx)(s.Text,{as:"p",html:t.credits,size:2,className:"ml-[4px] mt-[6px] lg-desktop:text-[18px]"})]})]}),t.handleClick&&!(t.id===x.TaskType.UploadReceipt&&d.isSuccess)&&!(t.id===x.TaskType.Activate&&l.isSuccess)&&!(t.id===x.TaskType.Subscribe&&o.isSuccess)?(0,e.jsx)(s.Button,{as:t.link?"a":"button",...t.link&&{href:t.link},...t.handleClick&&{onClick:t.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit",children:t.buttonLabel}):(0,e.jsx)(s.Button,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:t.buttonLabel})]},t.id)),!r&&(0,e.jsx)("div",{className:"absolute inset-0 pointer-events-none min-md:hidden",style:{background:"linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%"}})]}),r?(0,e.jsx)("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{C(!1)},children:(0,e.jsx)(u.ChevronUpIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden",children:(0,e.jsx)("button",{className:"w-fit",onClick:()=>C(!r),children:(0,e.jsx)(u.ChevronDownIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]})})};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Button, Container, Heading, Picture, Text } from '@anker-in/headless-ui'\nimport { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'\nimport { motion } from 'framer-motion'\nimport { useMemo, useState } from 'react'\n\nimport { TaskType, type CreditsWaysToGetCreditsProps } from './type'\nimport { useActions } from './useActions'\nimport { useCreditsContext } from '../context/provider'\nimport { cn } from '../../../helpers/index'\n\nexport const CreditsWaysToGetCredits = ({\n copy,\n activate,\n subscribe,\n uploadReceipt,\n classNames,\n}: CreditsWaysToGetCreditsProps) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const isLogin = !!profile\n\n const { actions } = useActions({ copy, activate, subscribe, uploadReceipt })\n\n const list = useMemo(() => {\n const list = copy.list\n .map(item => {\n if (!actions[item.id as keyof typeof actions]) {\n return undefined\n }\n const { finished, notLogin, notFinished, completed } = actions[item.id as keyof typeof actions]\n let buttonLabel = ''\n let handleClick = undefined\n let link = undefined\n if (!isLogin) {\n buttonLabel = notLogin.buttonLabel\n handleClick = notLogin.handleClick\n } else if (finished) {\n buttonLabel = completed.buttonLabel\n handleClick = undefined\n } else {\n buttonLabel = notFinished.buttonLabel\n handleClick = notFinished.handleClick\n link = (notFinished as { link: string }).link\n }\n return {\n ...item,\n buttonLabel,\n handleClick,\n finished,\n link,\n }\n })\n .filter(Boolean) as {\n title: string\n credits: string\n id: TaskType\n buttonLabel: string\n finished: boolean\n link: string\n handleClick: (() => void) | undefined\n }[]\n\n // \u767B\u5F55\u540E\uFF0C\u4FDD\u7559\u539F\u987A\u5E8F\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u653E\u5728\u6700\u540E\n if (isLogin) {\n return list.sort((a, b) => {\n if (a?.finished && !b?.finished) {\n return 1 // a\u5DF2\u5B8C\u6210\uFF0Cb\u672A\u5B8C\u6210\uFF0Ca\u6392\u5728\u540E\u9762\n }\n if (!a?.finished && b?.finished) {\n return -1 // a\u672A\u5B8C\u6210\uFF0Cb\u5DF2\u5B8C\u6210\uFF0Ca\u6392\u5728\u524D\u9762\n }\n return 0 // \u90FD\u5DF2\u5B8C\u6210\u6216\u90FD\u672A\u5B8C\u6210\uFF0C\u4FDD\u6301\u539F\u987A\u5E8F\n })\n } else {\n return list\n }\n }, [actions, copy.list, isLogin])\n\n return (\n <Container id=\"ways-to-get-credits\" className=\" bg-[#F5F5F7] [&>div]:l:!px-0\">\n <div className=\"rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]\">\n <Heading as=\"h2\" size={4} html={copy?.title} className=\"text-center l:pl-[16px] l:text-left\" />\n <div className=\"mt-[64px] flex items-center justify-between md:mt-[64px] l:mt-[24px] l:flex-col-reverse l:items-start md-l:mt-[32px]\">\n <div className=\"pl-[16px] l:mt-[40px] desktop:pl-[24px] lg-desktop:pl-[32px]\">\n <Heading size={3} as=\"h3\" html={copy.subtitle} className={classNames?.subtitle} />\n <div className=\"mt-[8px] flex items-center\">\n {copy.creditsIcon?.url && (\n <Picture\n className=\"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand\"\n source={copy.creditsIcon.url}\n alt={copy.creditsIcon.alt || 'credits'}\n />\n )}\n <Heading\n html={copy.equalCredits}\n size={4}\n as=\"h3\"\n className={cn('mt-2 text-white md:text-[24px]', classNames?.equalCreditsText)}\n />\n </div>\n </div>\n <Picture className=\"w-full laptop:w-[50%]\" source={copy.mainImage?.url} />\n </div>\n\n <div className=\"relative\">\n <motion.div\n className={cn(\n 'relative mt-[64px] grid grid-cols-3 gap-[16px] overflow-hidden md:mt-[16px] md:grid-cols-1 l:gap-[12px] min-md:!h-auto md-l:mt-[32px] md-l:grid-cols-2'\n )}\n initial={{ height: 512 }}\n animate={{ height: showMore ? 'auto' : 512 }}\n transition={{ duration: 0.3 }}\n onAnimationComplete={() => {\n if (!showMore && window.screen.width < 768) {\n const section = document.getElementById('ways-to-get-credits')\n if (section) {\n section.scrollIntoView({ behavior: 'smooth', block: 'end' })\n }\n }\n }}\n >\n {list.map(item => (\n <div\n key={item.id}\n className=\"flex min-h-[160px] flex-col justify-between rounded-[16px] bg-white p-[16px] text-[#1D1D1F] desktop:min-h-[192px] desktop:p-[24px] lg-desktop:min-h-[240px] lg-desktop:p-[32px]\"\n >\n <div>\n <Heading as=\"h4\" html={item.title} size={2} className=\"text-pretty\" />\n <div className=\"mt-[4px] flex items-center\">\n <Picture\n className=\"size-[24px] xl:size-[18px] [&_path]:size-full\"\n source=\"https://cdn.shopify.com/s/files/1/0511/6346/3874/files/20250902-153351.png?v=1756798450\"\n />\n <Text as=\"p\" html={item.credits} size={2} className=\"ml-[4px] mt-[6px] lg-desktop:text-[18px]\" />\n </div>\n </div>\n\n {item.handleClick &&\n !(item.id === TaskType.UploadReceipt && uploadReceipt.isSuccess) &&\n !(item.id === TaskType.Activate && activate.isSuccess) &&\n !(item.id === TaskType.Subscribe && subscribe.isSuccess) ? (\n <Button\n as={item.link ? 'a' : 'button'}\n {...(item.link && { href: item.link })}\n {...(item.handleClick && { onClick: item.handleClick })}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[24px] w-fit\"\n >\n {item.buttonLabel}\n </Button>\n ) : (\n <Button variant=\"primary\" size=\"lg\" className=\"mt-[24px] w-fit\" disabled>\n {item.buttonLabel}\n </Button>\n )}\n </div>\n ))}\n {!showMore && (\n <div\n className=\"absolute inset-0 pointer-events-none min-md:hidden\"\n style={{ background: 'linear-gradient(180deg, rgba(29, 29, 31, 0) 66.37%, #1D1D1F 100%' }}\n ></div>\n )}\n </motion.div>\n {showMore ? (\n <button\n className=\"mx-auto mt-[12px] block w-fit min-md:hidden\"\n onClick={() => {\n setShowMore(false)\n }}\n >\n <ChevronUpIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronUpIcon>\n </button>\n ) : (\n <>\n <div className=\"absolute bottom-0 flex w-full translate-y-1/2 justify-center min-md:hidden\">\n <button className=\"w-fit\" onClick={() => setShowMore(!showMore)}>\n <ChevronDownIcon className=\"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]\"></ChevronDownIcon>\n </button>\n </div>\n </>\n )}\n </div>\n </div>\n </Container>\n )\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAiFQ,IAAAI,EAAA,6BAjFRC,EAA0D,iCAC1DC,EAA+C,uCAC/CC,EAAuB,yBACvBC,EAAkC,iBAElCC,EAA4D,kBAC5DC,EAA2B,wBAC3BC,EAAkC,+BAClCC,EAAmB,kCAEZ,MAAMV,EAA0B,CAAC,CACtC,KAAAW,EACA,SAAAC,EACA,UAAAC,EACA,cAAAC,EACA,WAAAC,CACF,IAAoC,CAClC,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EACxC,CAAE,QAAAC,CAAQ,KAAI,qBAAkB,EAChCC,EAAU,CAAC,CAACD,EAEZ,CAAE,QAAAE,CAAQ,KAAI,cAAW,CAAE,KAAAT,EAAM,SAAAC,EAAU,UAAAC,EAAW,cAAAC,CAAc,CAAC,EAErEO,KAAO,WAAQ,IAAM,CACzB,MAAMA,EAAOV,EAAK,KACf,IAAIW,GAAQ,CACX,GAAI,CAACF,EAAQE,EAAK,EAA0B,EAC1C,OAEF,KAAM,CAAE,SAAAC,EAAU,S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AC,OAAI,UAAU,6EACb,mBAAC,UAAO,UAAU,QAAQ,QAAS,IAAMA,EAAY,CAACD,CAAQ,EAC5D,mBAAC,mBAAgB,UAAU,kDAAkD,EAC/E,EACF,EACF,GAEJ,GACF,EACF,CAEJ",
|
|
6
|
+
"names": ["creditsWaysToGetCredits_exports", "__export", "CreditsWaysToGetCredits", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_outline", "import_framer_motion", "import_react", "import_type", "import_useActions", "import_provider", "import_helpers", "copy", "activate", "subscribe", "uploadReceipt", "classNames", "showMore", "setShowMore", "profile", "isLogin", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "b", "section"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
|
|
2
|
+
export type BenefitItem = {
|
|
3
|
+
title: string;
|
|
4
|
+
credits: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
export type WaysToGetCreditsCopy = {
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle: string;
|
|
10
|
+
equalCredits: string;
|
|
11
|
+
musicIcon: string;
|
|
12
|
+
list: BenefitItem[];
|
|
13
|
+
mainImage: {
|
|
14
|
+
url: string;
|
|
15
|
+
alt: string;
|
|
16
|
+
};
|
|
17
|
+
joinNow: string;
|
|
18
|
+
activate: string;
|
|
19
|
+
completed: string;
|
|
20
|
+
completeProfile: string;
|
|
21
|
+
makeFirstPurchase: string;
|
|
22
|
+
goShopLink: string;
|
|
23
|
+
uploadReceipt: string;
|
|
24
|
+
shopNow: string;
|
|
25
|
+
subscribe: string;
|
|
26
|
+
sendEmailSuccess: string;
|
|
27
|
+
creditsIcon: {
|
|
28
|
+
url: string;
|
|
29
|
+
alt: string;
|
|
30
|
+
};
|
|
31
|
+
receipt: ReceiptCopy;
|
|
32
|
+
};
|
|
33
|
+
export declare enum TaskType {
|
|
34
|
+
Activate = "activate",
|
|
35
|
+
Subscribe = "subscribe",
|
|
36
|
+
CompleteProfile = "completeProfile",
|
|
37
|
+
FirstPurchase = "firstPurchase",
|
|
38
|
+
UploadReceipt = "uploadReceipt",
|
|
39
|
+
Shop = "shop"
|
|
40
|
+
}
|
|
41
|
+
export type CreditsWaysToGetCreditsProps = {
|
|
42
|
+
copy: WaysToGetCreditsCopy;
|
|
43
|
+
classNames?: {
|
|
44
|
+
equalCreditsText?: string;
|
|
45
|
+
subtitle?: string;
|
|
46
|
+
};
|
|
47
|
+
activate: {
|
|
48
|
+
openAuthCodePopup: () => void;
|
|
49
|
+
isSuccess: boolean;
|
|
50
|
+
};
|
|
51
|
+
subscribe: {
|
|
52
|
+
openSubscribePopup: () => void;
|
|
53
|
+
isSuccess: boolean;
|
|
54
|
+
};
|
|
55
|
+
uploadReceipt: {
|
|
56
|
+
openUploadReceiptPopup: () => void;
|
|
57
|
+
isSuccess: boolean;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var u=(e,t)=>{for(var o in t)r(e,o,{get:t[o],enumerable:!0})},g=(e,t,o,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of l(t))!a.call(e,s)&&s!==o&&r(e,s,{get:()=>t[s],enumerable:!(p=n(t,s))||p.enumerable});return e};var d=e=>g(r({},"__esModule",{value:!0}),e);var m={};u(m,{TaskType:()=>c});module.exports=d(m);var c=(i=>(i.Activate="activate",i.Subscribe="subscribe",i.CompleteProfile="completeProfile",i.FirstPurchase="firstPurchase",i.UploadReceipt="uploadReceipt",i.Shop="shop",i))(c||{});
|
|
2
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/type.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type WaysToGetCreditsCopy = {\n title: string\n subtitle: string\n equalCredits: string\n musicIcon: string\n list: BenefitItem[]\n mainImage: {\n url: string\n alt: string\n }\n joinNow: string\n activate: string\n completed: string\n completeProfile: string\n makeFirstPurchase: string\n goShopLink: string\n uploadReceipt: string\n shopNow: string\n subscribe: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n}\n\nexport enum TaskType {\n Activate = 'activate',\n Subscribe = 'subscribe',\n CompleteProfile = 'completeProfile',\n FirstPurchase = 'firstPurchase',\n UploadReceipt = 'uploadReceipt',\n Shop = 'shop',\n}\n\nexport type CreditsWaysToGetCreditsProps = {\n copy: WaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n activate: {\n openAuthCodePopup: () => void\n isSuccess: boolean\n }\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAmCO,IAAKE,OACVA,EAAA,SAAW,WACXA,EAAA,UAAY,YACZA,EAAA,gBAAkB,kBAClBA,EAAA,cAAgB,gBAChBA,EAAA,cAAgB,gBAChBA,EAAA,KAAO,OANGA,OAAA",
|
|
6
|
+
"names": ["type_exports", "__export", "TaskType", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { CreditsWaysToGetCreditsProps } from './type';
|
|
2
|
+
export declare const useActions: ({ copy, subscribe, uploadReceipt, activate, gaParameters, }: CreditsWaysToGetCreditsProps & {
|
|
3
|
+
gaParameters?: {
|
|
4
|
+
position: string;
|
|
5
|
+
};
|
|
6
|
+
}) => {
|
|
7
|
+
actions: {
|
|
8
|
+
activate: {
|
|
9
|
+
finished: any;
|
|
10
|
+
notLogin: {
|
|
11
|
+
buttonLabel: string;
|
|
12
|
+
handleClick: () => void;
|
|
13
|
+
};
|
|
14
|
+
notFinished: {
|
|
15
|
+
buttonLabel: string;
|
|
16
|
+
handleClick: () => void;
|
|
17
|
+
};
|
|
18
|
+
completed: {
|
|
19
|
+
buttonLabel: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
subscribe: {
|
|
23
|
+
finished: boolean;
|
|
24
|
+
notLogin: {
|
|
25
|
+
buttonLabel: string;
|
|
26
|
+
handleClick: () => void;
|
|
27
|
+
};
|
|
28
|
+
notFinished: {
|
|
29
|
+
buttonLabel: string;
|
|
30
|
+
handleClick: () => void;
|
|
31
|
+
};
|
|
32
|
+
completed: {
|
|
33
|
+
buttonLabel: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
completeProfile: {
|
|
37
|
+
finished: any;
|
|
38
|
+
notLogin: {
|
|
39
|
+
buttonLabel: string;
|
|
40
|
+
handleClick: () => void;
|
|
41
|
+
};
|
|
42
|
+
notFinished: {
|
|
43
|
+
buttonLabel: string;
|
|
44
|
+
link: string;
|
|
45
|
+
handleClick: () => void;
|
|
46
|
+
};
|
|
47
|
+
completed: {
|
|
48
|
+
buttonLabel: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
firstPurchase: {
|
|
52
|
+
finished: boolean;
|
|
53
|
+
notLogin: {
|
|
54
|
+
buttonLabel: string;
|
|
55
|
+
handleClick: () => void;
|
|
56
|
+
};
|
|
57
|
+
notFinished: {
|
|
58
|
+
buttonLabel: string;
|
|
59
|
+
link: string;
|
|
60
|
+
handleClick: () => void;
|
|
61
|
+
};
|
|
62
|
+
completed: {
|
|
63
|
+
buttonLabel: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
uploadReceipt: {
|
|
67
|
+
finished: boolean;
|
|
68
|
+
notLogin: {
|
|
69
|
+
buttonLabel: string;
|
|
70
|
+
handleClick: () => void;
|
|
71
|
+
};
|
|
72
|
+
notFinished: {
|
|
73
|
+
buttonLabel: string;
|
|
74
|
+
handleClick: () => void;
|
|
75
|
+
};
|
|
76
|
+
completed: {
|
|
77
|
+
buttonLabel: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
shop: {
|
|
81
|
+
finished: boolean;
|
|
82
|
+
notLogin: {
|
|
83
|
+
buttonLabel: string;
|
|
84
|
+
handleClick: () => void;
|
|
85
|
+
};
|
|
86
|
+
notFinished: {
|
|
87
|
+
buttonLabel: string;
|
|
88
|
+
link: string;
|
|
89
|
+
handleClick: () => void;
|
|
90
|
+
};
|
|
91
|
+
completed: {
|
|
92
|
+
buttonLabel: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var _=Object.create;var r=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var x=(e,i)=>{for(var a in i)r(e,a,{get:i[a],enumerable:!0})},h=(e,i,a,b)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of U(i))!A.call(e,n)&&n!==a&&r(e,n,{get:()=>i[n],enumerable:!(b=R(i,n))||b.enumerable});return e};var G=(e,i,a)=>(a=e!=null?_(T(e)):{},h(i||!e||!e.__esModule?r(a,"default",{value:e,enumerable:!0}):a,e)),W=e=>h(r({},"__esModule",{value:!0}),e);var E={};x(E,{useActions:()=>$});module.exports=W(E);var t=require("./type"),k=require("../context/provider"),d=require("react"),f=G(require("../context/hooks/useReceiptUploaded")),N=require("../context/hooks/useFirstPurchaseFinished"),L=require("../context/hooks/useSubscribed"),C=require("@anker-in/lib"),P=require("../../../helpers/track");const $=({copy:e,subscribe:i,uploadReceipt:a,activate:b,gaParameters:n})=>{const{openSignUpPopup:s,gtm:g,profile:l}=(0,k.useCreditsContext)(),u=(0,L.useSubscribed)(),c=(0,N.useFirstPurchaseFinished)(),m=(0,f.default)(),{appName:v,passportUrl:F}=(0,C.useHeadlessContext)(),p=(0,d.useMemo)(()=>(l?.first_name||l?.last_name)&&l?.phone_number&&l?.dob,[l]);return(0,d.useMemo)(()=>{const o=({buttonName:w,id:S,callback:j})=>{(0,P.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:g.pageGroup,position:n?.position||e.title,button_name:w,info:S}}),j()};return{actions:{[t.TaskType.Activate]:{finished:l?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>o({buttonName:e?.activate,callback:()=>b.openAuthCodePopup(),id:t.TaskType.Activate})},completed:{buttonLabel:e?.completed}},[t.TaskType.Subscribe]:{finished:u,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Subscribe})},notFinished:{buttonLabel:e?.subscribe,handleClick:()=>o({buttonName:e?.subscribe,callback:()=>i.openSubscribePopup(),id:t.TaskType.Subscribe})},completed:{buttonLabel:e?.completed}},[t.TaskType.CompleteProfile]:{finished:p,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`${F}/account/profile?app=${v}`,handleClick:()=>o({buttonName:e?.completeProfile,callback:()=>{},id:t.TaskType.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.TaskType.FirstPurchase]:{finished:c,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>o({buttonName:e?.makeFirstPurchase,callback:s,id:t.TaskType.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>o({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.TaskType.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.TaskType.UploadReceipt]:{finished:m,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>o({buttonName:e?.uploadReceipt,callback:()=>a.openUploadReceiptPopup(),id:t.TaskType.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.TaskType.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>o({buttonName:e?.joinNow,callback:s,id:t.TaskType.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>o({buttonName:e?.shopNow,callback:()=>{},id:t.TaskType.Shop})},completed:{buttonLabel:e?.completed}}}}},[l?.activated,e?.joinNow,e?.activate,e?.completed,e?.subscribe,e?.completeProfile,e?.makeFirstPurchase,e?.uploadReceipt,e?.shopNow,e.title,e?.goShopLink,u,p,c,m,n?.position,s])};
|
|
2
|
+
//# sourceMappingURL=useActions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/useActions.ts"],
|
|
4
|
+
"sourcesContent": ["import { TaskType } from './type'\nimport { useCreditsContext } from '../context/provider'\nimport { useMemo } from 'react'\nimport useReceiptUploaded from '../context/hooks/useReceiptUploaded'\nimport { useFirstPurchaseFinished } from '../context/hooks/useFirstPurchaseFinished'\nimport { useSubscribed } from '../context/hooks/useSubscribed'\nimport type { CreditsWaysToGetCreditsProps } from './type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { gaTrack } from '../../../helpers/track'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n activate,\n gaParameters,\n}: CreditsWaysToGetCreditsProps & {\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const isSubscribed = useSubscribed()\n const firstPurchaseFinished = useFirstPurchaseFinished()\n const uploadedReceipt = useReceiptUploaded()\n const { appName, passportUrl } = useHeadlessContext()\n\n const profileCompleted = useMemo(() => {\n return (profile?.first_name || profile?.last_name) && profile?.phone_number && profile?.dob\n }, [profile])\n\n return useMemo(() => {\n const handleClickWithTrack = ({\n buttonName,\n id,\n callback,\n }: {\n buttonName: string\n id?: string\n callback: () => void\n }) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n member_active_status: profile?.activated ? 'active' : 'not active',\n event_parameters: {\n page_group: gtm.pageGroup,\n position: gaParameters?.position || copy.title,\n button_name: buttonName,\n info: id,\n },\n })\n callback()\n }\n return {\n actions: {\n [TaskType.Activate]: {\n finished: profile?.activated,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Activate }),\n },\n notFinished: {\n buttonLabel: copy?.activate,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.activate,\n callback: () => activate.openAuthCodePopup(),\n id: TaskType.Activate,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Subscribe]: {\n finished: isSubscribed,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({ buttonName: copy?.joinNow, callback: openSignUpPopup, id: TaskType.Subscribe }),\n },\n notFinished: {\n buttonLabel: copy?.subscribe,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribe,\n callback: () => subscribe.openSubscribePopup(),\n id: TaskType.Subscribe,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.CompleteProfile]: {\n finished: profileCompleted,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.CompleteProfile,\n }),\n },\n notFinished: {\n buttonLabel: copy?.completeProfile,\n link: `${passportUrl}/account/profile?app=${appName}`,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.completeProfile,\n callback: () => {},\n id: TaskType.CompleteProfile,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.FirstPurchase]: {\n finished: firstPurchaseFinished,\n notLogin: {\n buttonLabel: copy?.makeFirstPurchase,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: openSignUpPopup,\n id: TaskType.FirstPurchase,\n }),\n },\n notFinished: {\n buttonLabel: copy?.makeFirstPurchase,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.makeFirstPurchase,\n callback: () => {},\n id: TaskType.FirstPurchase,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.UploadReceipt]: {\n finished: uploadedReceipt,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.UploadReceipt,\n }),\n },\n notFinished: {\n buttonLabel: copy?.uploadReceipt,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.uploadReceipt,\n callback: () => uploadReceipt.openUploadReceiptPopup(),\n id: TaskType.UploadReceipt,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n [TaskType.Shop]: {\n finished: false,\n notLogin: {\n buttonLabel: copy?.joinNow,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.joinNow,\n callback: openSignUpPopup,\n id: TaskType.Shop,\n }),\n },\n notFinished: {\n buttonLabel: copy?.shopNow,\n link: copy?.goShopLink,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.shopNow,\n callback: () => {},\n id: TaskType.Shop,\n }),\n },\n completed: {\n buttonLabel: copy?.completed,\n },\n },\n },\n }\n }, [\n profile?.activated,\n copy?.joinNow,\n copy?.activate,\n copy?.completed,\n copy?.subscribe,\n copy?.completeProfile,\n copy?.makeFirstPurchase,\n copy?.uploadReceipt,\n copy?.shopNow,\n copy.title,\n copy?.goShopLink,\n isSubscribed,\n profileCompleted,\n firstPurchaseFinished,\n uploadedReceipt,\n gaParameters?.position,\n openSignUpPopup,\n ])\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,kBACzBC,EAAkC,+BAClCC,EAAwB,iBACxBC,EAA+B,kDAC/BC,EAAyC,qDACzCC,EAA8B,0CAE9BC,EAAmC,yBACnCC,EAAwB,kCAEjB,MAAMT,EAAa,CAAC,CACzB,KAAAU,EACA,UAAAC,EACA,cAAAC,EACA,SAAAC,EACA,aAAAC,CACF,IAIM,CACJ,KAAM,CAAE,gBAAAC,EAAiB,IAAAC,EAAK,QAAAC,CAAQ,KAAI,qBAAkB,EACtDC,KAAe,iBAAc,EAC7BC,KAAwB,4BAAyB,EACjDC,KAAkB,EAAAC,SAAmB,EACrC,CAAE,QAAAC,EAAS,YAAAC,CAAY,KAAI,sBAAmB,EAE9CC,KAAmB,WAAQ,KACvBP,GAAS,YAAcA,GAAS,YAAcA,GAAS,cAAgBA,GAAS,IACvF,CAACA,CAAO,CAAC,EAEZ,SAAO,WAAQ,IAAM,CACnB,MAAMQ,EAAuB,CAAC,CAC5B,WAAAC,EACA,GAAAC,EACA,SAAAC,CACF,IAIM,IACJ,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBX,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYD,EAAI,UAChB,SAAUF,GAAc,UAAYJ,EAAK,MACzC,YAAagB,EACb,KAAMC,CACR,CACF,CAAC,EACDC,EAAS,CACX,EACA,MAAO,CACL,QAAS,CACP,CAAC,WAAS,QAAQ,EAAG,CACnB,SAAUX,GAAS,UACnB,SAAU,CACR,YAAaP,GAAM,Q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AAqB,CACnB,WAAYf,GAAM,kBAClB,SAAU,IAAM,CAAC,EACjB,GAAI,WAAS,aACf,CAAC,CACL,EACA,UAAW,CACT,YAAaA,GAAM,SACrB,CACF,EACA,CAAC,WAAS,aAAa,EAAG,CACxB,SAAUU,EACV,SAAU,CACR,YAAaV,GAAM,QACnB,YAAa,IACXe,EAAqB,CACnB,WAAYf,GAAM,QAClB,SAAUK,EACV,GAAI,WAAS,aACf,CAAC,CACL,EACA,YAAa,CACX,YAAaL,GAAM,cACnB,YAAa,IACXe,EAAqB,CACnB,WAAYf,GAAM,cAClB,SAAU,IAAME,EAAc,uBAAuB,EACrD,GAAI,WAAS,aACf,CAAC,CACL,EACA,UAAW,CACT,YAAaF,GAAM,SACrB,CACF,EACA,CAAC,WAAS,IAAI,EAAG,CACf,SAAU,GACV,SAAU,CACR,YAAaA,GAAM,QACnB,YAAa,IACXe,EAAqB,CACnB,WAAYf,GAAM,QAClB,SAAUK,EACV,GAAI,WAAS,IACf,CAAC,CACL,EACA,YAAa,CACX,YAAaL,GAAM,QACnB,KAAMA,GAAM,WACZ,YAAa,IACXe,EAAqB,CACnB,WAAYf,GAAM,QAClB,SAAU,IAAM,CAAC,EACjB,GAAI,WAAS,IACf,CAAC,CACL,EACA,UAAW,CACT,YAAaA,GAAM,SACrB,CACF,CACF,CACF,CACF,EAAG,CACDO,GAAS,UACTP,GAAM,QACNA,GAAM,SACNA,GAAM,UACNA,GAAM,UACNA,GAAM,gBACNA,GAAM,kBACNA,GAAM,cACNA,GAAM,QACNA,EAAK,MACLA,GAAM,WACNQ,EACAM,EACAL,EACAC,EACAN,GAAc,SACdC,CACF,CAAC,CACH",
|
|
6
|
+
"names": ["useActions_exports", "__export", "useActions", "__toCommonJS", "import_type", "import_provider", "import_react", "import_useReceiptUploaded", "import_useFirstPurchaseFinished", "import_useSubscribed", "import_lib", "import_track", "copy", "subscribe", "uploadReceipt", "activate", "gaParameters", "openSignUpPopup", "gtm", "profile", "isSubscribed", "firstPurchaseFinished", "uploadedReceipt", "useReceiptUploaded", "appName", "passportUrl", "profileCompleted", "handleClickWithTrack", "buttonName", "id", "callback"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { CreditsProvider, useCreditsContext } from './context/provider';
|
|
2
|
+
export { useUploadReceipt as useCreditsUploadReceipt } from './context/hooks/useUploadReceipt';
|
|
3
|
+
export { CreditsUploadReceiptModal } from './modal/creditsUploadReceiptModal';
|
|
4
|
+
export { CreditsBanner } from './creditsBanner';
|
|
5
|
+
export { CreditsBenefits } from './creditsBenefits';
|
|
6
|
+
export { CreditsInfoCard } from './creditsInfoCard';
|
|
7
|
+
export { CreditsWaysToGetCredits } from './creditsWaysToGetCredits';
|
|
8
|
+
export { CreditsFaq } from './creditsFaq';
|
|
9
|
+
export { CreditsCash } from './creditsCash';
|
|
10
|
+
export { CreditsRedeemList } from './creditsRedeemList';
|