@anker-in/campaign-ui 0.1.10 → 0.2.0-beta.2
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 +3 -3
- 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/const.d.ts +1 -0
- package/dist/cjs/components/credits/const.js +2 -0
- package/dist/cjs/components/credits/const.js.map +7 -0
- 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/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/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 +24 -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 +11 -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/CreditsCash.d.ts +4 -0
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
- package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
- package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +9 -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 +2 -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 +16 -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/CreditsRedeemList.d.ts +4 -0
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
- package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
- package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -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 +2 -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 +63 -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/CreditsWaysToGetCredits.d.ts +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
- package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.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 +49 -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 +105 -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/subscribeModal.d.ts +15 -0
- package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
- package/dist/cjs/components/credits/modal/subscribeModal.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 +72 -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 +4 -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/context/index.d.ts +1 -0
- package/dist/cjs/components/registration/context/index.js +2 -0
- package/dist/cjs/components/registration/context/index.js.map +7 -0
- package/dist/cjs/components/registration/context/provider.d.ts +25 -0
- package/dist/cjs/components/registration/context/provider.js +2 -0
- package/dist/cjs/components/registration/context/provider.js.map +7 -0
- package/dist/cjs/components/registration/index.d.ts +2 -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/index.d.ts +2 -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/cjs/templates/credits.d.ts +58 -0
- package/dist/cjs/templates/credits.js +2 -0
- package/dist/cjs/templates/credits.js.map +7 -0
- package/dist/cjs/templates/index.d.ts +1 -0
- package/dist/cjs/templates/index.js +2 -0
- package/dist/cjs/templates/index.js.map +7 -0
- 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/const.d.ts +1 -0
- package/dist/esm/components/credits/const.js +2 -0
- package/dist/esm/components/credits/const.js.map +7 -0
- 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/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/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 +24 -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 +11 -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/CreditsCash.d.ts +4 -0
- package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
- package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
- package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +9 -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 +2 -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 +16 -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/CreditsRedeemList.d.ts +4 -0
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
- package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
- package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -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 +2 -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 +63 -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/CreditsWaysToGetCredits.d.ts +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
- package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.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 +49 -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 +105 -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/subscribeModal.d.ts +15 -0
- package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
- package/dist/esm/components/credits/modal/subscribeModal.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 +72 -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 +4 -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/context/index.d.ts +1 -0
- package/dist/esm/components/registration/context/index.js +2 -0
- package/dist/esm/components/registration/context/index.js.map +7 -0
- package/dist/esm/components/registration/context/provider.d.ts +25 -0
- package/dist/esm/components/registration/context/provider.js +2 -0
- package/dist/esm/components/registration/context/provider.js.map +7 -0
- package/dist/esm/components/registration/index.d.ts +2 -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/index.d.ts +2 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- 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/dist/esm/templates/credits.d.ts +58 -0
- package/dist/esm/templates/credits.js +2 -0
- package/dist/esm/templates/credits.js.map +7 -0
- package/dist/esm/templates/index.d.ts +1 -0
- package/dist/esm/templates/index.js +2 -0
- package/dist/esm/templates/index.js.map +7 -0
- package/package.json +47 -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/const.ts +1 -0
- 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 +57 -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/useSubscribed.ts +36 -0
- package/src/components/credits/context/hooks/useUploadReceipt.tsx +29 -0
- package/src/components/credits/context/provider.tsx +85 -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 +103 -0
- package/src/components/credits/creditsBenefits/benefitItem.tsx +91 -0
- package/src/components/credits/creditsBenefits/iconInfo.tsx +23 -0
- package/src/components/credits/creditsBenefits/index.tsx +116 -0
- package/src/components/credits/creditsCash/CreditsCash.tsx +85 -0
- package/src/components/credits/creditsCash/RedeemableItem.tsx +207 -0
- package/src/components/credits/creditsCash/index.ts +2 -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 +89 -0
- package/src/components/credits/creditsInfoCard/index.tsx +184 -0
- package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +116 -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 +131 -0
- package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +157 -0
- package/src/components/credits/creditsRedeemList/AddressForm/type.ts +24 -0
- package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +178 -0
- package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
- package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +211 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +74 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +14 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +123 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +74 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +49 -0
- package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +195 -0
- package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +183 -0
- package/src/components/credits/creditsRedeemList/index.ts +2 -0
- package/src/components/credits/creditsRedeemList/type.ts +63 -0
- package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +235 -0
- package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
- package/src/components/credits/creditsWaysToGetCredits/type.ts +53 -0
- package/src/components/credits/creditsWaysToGetCredits/useActions.ts +228 -0
- package/src/components/credits/index.ts +11 -0
- package/src/components/credits/modal/MyRewardsModal.tsx +330 -0
- package/src/components/credits/modal/activitiesModal.tsx +264 -0
- package/src/components/credits/modal/creditsUploadReceiptModal.tsx +150 -0
- package/src/components/credits/modal/loadingDots.tsx +19 -0
- package/src/components/credits/modal/modalContainer.tsx +117 -0
- package/src/components/credits/modal/rulesModal.tsx +44 -0
- package/src/components/credits/modal/subscribeModal.tsx +224 -0
- package/src/components/credits/modal/tip.tsx +102 -0
- package/src/components/credits/type.ts +77 -0
- package/src/components/index.ts +6 -4
- package/src/components/registration/authCodeActivate/Message.tsx +43 -0
- package/src/components/registration/authCodeActivate/index.tsx +298 -0
- package/src/components/registration/authCodeActivate/type.ts +24 -0
- package/src/components/registration/context/index.tsx +1 -0
- package/src/components/registration/context/provider.tsx +77 -0
- package/src/components/registration/index.ts +2 -0
- package/src/components/registration/modalContainer.tsx +112 -0
- package/src/debug-env.ts +18 -0
- package/src/index.ts +2 -1
- package/src/stories/chat.stories.tsx +1 -1
- package/{dist/esm/styles/chat.css → src/styles/global.css} +1 -0
- package/src/templates/credits.tsx +124 -0
- package/src/templates/index.ts +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/helpers/fetchResponse.d.ts +0 -14
- package/dist/cjs/helpers/fetchResponse.js +0 -2
- package/dist/cjs/helpers/fetchResponse.js.map +0 -7
- package/dist/cjs/helpers/fetcher.d.ts +0 -2
- package/dist/cjs/helpers/fetcher.js +0 -2
- package/dist/cjs/helpers/fetcher.js.map +0 -7
- package/dist/cjs/helpers/index.d.ts +0 -2
- package/dist/cjs/helpers/index.js +0 -2
- package/dist/cjs/helpers/index.js.map +0 -7
- package/dist/cjs/helpers/utils.d.ts +0 -3
- package/dist/cjs/helpers/utils.js +0 -2
- package/dist/cjs/helpers/utils.js.map +0 -7
- package/dist/cjs/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/helpers/fetchResponse.d.ts +0 -14
- package/dist/esm/helpers/fetchResponse.js +0 -2
- package/dist/esm/helpers/fetchResponse.js.map +0 -7
- package/dist/esm/helpers/fetcher.d.ts +0 -2
- package/dist/esm/helpers/fetcher.js +0 -2
- package/dist/esm/helpers/fetcher.js.map +0 -7
- package/dist/esm/helpers/index.d.ts +0 -2
- package/dist/esm/helpers/index.js +0 -2
- package/dist/esm/helpers/index.js.map +0 -7
- package/dist/esm/helpers/utils.d.ts +0 -3
- package/dist/esm/helpers/utils.js +0 -2
- package/dist/esm/helpers/utils.js.map +0 -7
- package/dist/esm/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/src/helpers/fetchResponse.ts +0 -35
- package/src/helpers/fetcher.ts +0 -44
- package/src/helpers/index.ts +0 -2
- package/src/helpers/utils.ts +0 -8
- /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'\nimport { useCreditsContext } from '../../context/provider'\n\ntype ProductInfoProps = {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n}\n\nexport const ProductInfo = ({ item, copy }: ProductInfoProps) => {\n const { locale } = useHeadlessContext()\n const { pageCommon } = useCreditsContext()\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} {pageCommon?.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,GAkBM,IAAAI,EAAA,6BAlBNC,EAAwB,iCACxBC,EAA4B,+BAG5BC,EAAmC,yBACnCC,EAAkC,kCAO3B,MAAMN,EAAc,CAAC,CAAE,KAAAO,EAAM,KAAAC,CAAK,IAAwB,CAC/D,KAAM,CAAE,OAAAC,CAAO,KAAI,sBAAmB,EAChC,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EAEzC,SACE,QAAC,OAAI,UAAU,0EACb,oBAAC,WACC,UAAU,6HACV,OAAQH,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,IAAEG,GAAY,WAC3C,GACF,GACF,GACF,GACF,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["ProductInfo_exports", "__export", "ProductInfo", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_utils", "import_lib", "import_provider", "item", "copy", "locale", "pageCommon"]
|
|
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 g=Object.create;var a=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},i=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of C(t))!R.call(e,m)&&m!==o&&a(e,m,{get:()=>t[m],enumerable:!(r=N(t,m))||r.enumerable});return e};var h=(e,t,o)=>(o=e!=null?g(w(e)):{},i(t||!e||!e.__esModule?a(o,"default",{value:e,enumerable:!0}):o,e)),B=e=>i(a({},"__esModule",{value:!0}),e);var F={};T(F,{Success:()=>I});module.exports=B(F);var d=require("react/jsx-runtime"),s=require("@anker-in/headless-ui"),p=h(require("classnames")),l=require("./ProductInfo"),n=require("@anker-in/lib"),x=require("../../const");const I=({copy:e,shippingProduct:t,loading:o,address:r,disabled:m,onClose:c,item:u})=>{const{brand:f}=(0,n.useHeadlessContext)(),b=x.roundedBrands.includes(f);return(0,d.jsx)("div",{className:(0,p.default)("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:(0,d.jsxs)("div",{className:"flex flex-col items-center",children:[(0,d.jsx)("div",{className:"mb-[16px] grid grid-flow-row gap-y-[4px] md:mb-[12px]",children:e.redeemModal.product.successDesc.map((y,v)=>(0,d.jsx)(s.Text,{className:"text-[18px] font-bold leading-[1.4] md:text-[14px]",html:y},v))}),t&&(0,d.jsx)(s.Text,{className:"mb-5 text-[16px] font-bold",html:t}),(0,d.jsx)("div",{className:(0,p.default)("flex w-full items-center bg-[#F5F5F7] p-[16px]",!b&&"rounded-none"),children:(0,d.jsx)(l.ProductInfo,{item:u,copy:e})}),(0,d.jsx)(s.Button,{loading:o||!r,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:c,disabled:m,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'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { roundedBrands } from '../../const'\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 const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\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={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\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,GAuBM,IAAAI,EAAA,6BAvBNC,EAA6B,iCAC7BC,EAAuB,yBAGvBC,EAA4B,yBAC5BC,EAAmC,yBACnCC,EAA8B,uBAYvB,MAAMP,EAAU,CAAC,CAAE,KAAAQ,EAAM,gBAAAC,EAAiB,QAAAC,EAAS,QAAAC,EAAS,SAAAC,EAAU,QAAAC,EAAS,KAAAC,CAAK,IAAoB,CAC7G,KAAM,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,gBAAc,SAASD,CAAK,EAC5C,SACE,OAAC,OAAI,aAAW,EAAAE,SAAW,iFAAiF,EAC1G,oBAAC,OAAI,UAAU,6BACb,oBAAC,OAAI,UAAU,wDACZ,SAAAT,EAAK,YAAY,QAAQ,YAAY,IAAI,CAACU,EAAqBC,OAC9D,OAAC,QAAiB,UAAU,qDAAqD,KAAMD,GAA5EC,CAAyF,CACrG,EACH,EAECV,MAAmB,OAAC,QAAK,UAAU,6BAA6B,KAAMA,EAAiB,KAExF,OAAC,OAAI,aAAW,EAAAQ,SAAW,iDAAkD,CAACD,GAAW,cAAc,EACrG,mBAAC,eAAY,KAAMF,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,CAEJ",
|
|
6
|
+
"names": ["Success_exports", "__export", "Success", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_ProductInfo", "import_lib", "import_const", "copy", "shippingProduct", "loading", "address", "disabled", "onClose", "item", "brand", "rounded", "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})},y=(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)):{},y(e||!r||!r.__esModule?g(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>y(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"),b=require("../../context/provider"),S=L(require("../../context/hooks/useCountries")),f=require("../../context/const"),x=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:P}=(0,b.useCreditsContext)(),{storeDomain:k,locale:T}=(0,q.useHeadlessContext)(),{pageCommon:B}=(0,b.useCreditsContext)(),{shippingAddress:G,shippingProduct:R}=e.redeemModal.product,[m,c]=(0,s.useState)("init"),[l,H]=(0,s.useState)(),[J,p]=(0,s.useState)({code:0,message:"",imageUrl:""}),[C,u]=(0,s.useState)(!1),{countries:A=[],isLoading:de}=(0,S.default)({shopifyStoreDomain:k}),{isMutating:M,trigger:N}=(0,U.useRedeemProduct)({onSuccess(o){if(!o){c("error"),p({code:0,imageUrl:e.redeemModal.errorImageUrl||"",message:e.redeemModal.commonError||""});return}if(o?.code===0)i(P?.user_id),c("success");else{let d,I;o.code===f.AlpcErrorCode.CodeLpcShopifyCouponRuleRedeemLimit?(d=e.redeemModal.redeemLimitError,u(!0)):o.code===f.AlpcErrorCode.CodeLpcRuleInventoryNotEnough?(d=e.redeemModal.inventoryNotEnough,u(!0),I=e.redeemModal.inventoryNotEnough):o.code===f.AlpcErrorCode.CodeLpcNotEnoughCredits?(d=e.redeemModal.creditsNotEnough,u(!0),i(P?.user_id)):o.code===f.AlpcErrorCode.CodeCrossSiteError&&(d=e.redeemModal.crossSiteError,u(!0)),c("error"),p({code:o.code,imageUrl:I||e.redeemModal.errorImageUrl||"",message:d||e.redeemModal.commonError||""}),t&&t(o.code)}},onError(o){c("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,x.useAddressValidate)({address:l,validatorInfo:B?.validatorInfo,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&&((A.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"),N({address:btoa(JSON.stringify(d)),rule_id:Number(r.alpc?.id)})},[r,N,h,E,l,A]);return(0,s.useEffect)(()=>{a.isOpen||(u(!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:R,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:R,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:c})]})}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 { pageCommon } = useCreditsContext()\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: pageCommon?.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} setStatus={setStatus} />\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemProductModal\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IAsJI,IAAAI,EAAA,6BAtJJC,EAAuB,yBACvBC,EAA0D,iBAC1DC,EAAkC,kCAClCC,EAAyB,+CACzBC,EAA8B,+BAC9BC,EAAmC,kDACnCC,EAAiC,gDAEjCC,EAAsC,sCAEtCC,EAAmC,yBAEnCC,EAAsB,mBACtBC,EAAwB,qBACxBC,EAAwB,qBACxBC,EAAqB,kBAQrB,SAASC,GAAmB,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,GAAGC,CAAM,EAA4B,CACtF,KAAM,CAAE,gBAAAC,EAAiB,QAAAC,CAAQ,KAAI,qBAAkB,EACjD,CAAE,YAAAC,EAAa,OAAAC,CAAO,KAAI,sBAAmB,EAE7C,CAAE,WAAAC,CAAW,KAAI,qBAAkB,EACnC,CAAE,gBAAAC,EAAiB,gBAAAC,CAAgB,EAAIT,EAAK,YAAY,QAExD,CAACU,EAAQC,CAAS,KAAI,YAAmD,MAAM,EAC/E,CAACC,EAASC,CAAU,KAAI,YAAc,EACtC,CAACC,EAAWC,CAAY,KAAI,YAAS,CACzC,KAAM,EACN,QAAS,GACT,SAAU,EACZ,CAAC,EACK,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK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V,OAAC,WACC,KAAMV,EACN,gBAAiBS,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,QAASd,EAAM,QACf,KAAMH,EACR,EAEDW,IAAW,cACV,OAAC,WACC,KAAMV,EACN,gBAAiBQ,EACjB,WAAYK,EACZ,gBAAiBe,EACjB,eAAgBC,EAChB,gBAAiBpB,EACjB,QAASY,EACT,QAAST,EACT,SAAUI,EACV,cAAec,EACf,KAAM/B,EACR,EAEDW,IAAW,WACV,OAAC,QAAK,KAAMX,EAAM,KAAMC,EAAM,QAASqB,EAAS,SAAUL,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", "pageCommon", "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 I=Object.create;var c=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var S=(t,a)=>{for(var e in a)c(t,e,{get:a[e],enumerable:!0})},y=(t,a,e,m)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of z(a))!P.call(t,o)&&o!==e&&c(t,o,{get:()=>a[o],enumerable:!(m=k(a,o))||m.enumerable});return t};var E=(t,a,e)=>(e=t!=null?I(L(t)):{},y(a||!t||!t.__esModule?c(e,"default",{value:t,enumerable:!0}):e,t)),F=t=>y(c({},"__esModule",{value:!0}),t);var B={};S(B,{RedeemableItem:()=>O});module.exports=F(B);var l=require("react/jsx-runtime"),n=require("@anker-in/headless-ui"),f=require("react"),u=E(require("classnames")),_=require("../context/provider"),p=require("../context/const"),h=require("../context/utils"),s=require("@anker-in/lib"),C=require("./NonProductValue"),N=require("../const");function O({copy:t,className:a,item:e,onRulesOpen:m,onRedeem:o}){const{creditInfo:v,profile:i,gtm:{pageGroup:g},pageCommon:r}=(0,_.useCreditsContext)(),{brand:R}=(0,s.useHeadlessContext)(),d=Object.keys(i||{}).length>0,T=N.roundedBrands.includes(R),w=(0,f.useMemo)(()=>!!(e.alpc?.remainingInventory<=0&&e.alpc?.isLimited||e.alpc?.consumeType===p.AlpcConsumeType.Product&&!e.variant?.availableForSale||d&&i?.activated&&e.alpc?.consumeCredits>Number(v?.available_credit||0)),[e.alpc?.remainingInventory,e.alpc?.isLimited,e.alpc?.consumeType,e.alpc?.consumeCredits,d,i?.activated,v?.available_credit,e.variant?.availableForSale]),b=(0,f.useMemo)(()=>d?e.alpc?.consumeType===p.AlpcConsumeType.Product?e.variant?.availableForSale?t.btnRedeem:r?.soldOut||"Sold Out":t.btnRedeem:t.unlockRewards,[d,e.alpc?.consumeType,e.variant?.availableForSale,t.btnRedeem,t.unlockRewards,r?.soldOut]);return(0,l.jsxs)("div",{className:(0,u.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]",!T&&"rounded-none md:rounded-none",a),children:[e.config?.type===p.ConsumeType.Product?(0,l.jsx)("div",{className:(0,u.default)("relative mx-auto h-[224px] w-fit md:my-[10px] l:h-[120px] l-xxl:h-[138px]"),children:(0,l.jsx)(n.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)(n.Picture,{source:r?.imageMapping?.[e.config?.type]?.url,className:"h-full [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),(0,l.jsx)(C.NoneProductValue,{item:e})]}),(0,l.jsxs)("div",{className:(0,u.default)("mt-[22px] flex w-full flex-1 flex-col justify-between"),children:[(0,l.jsx)(n.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:()=>{m(e.config?.rules||[]),(0,s.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:g,position:t.title,button_name:r?.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:x=>{(x.key==="Enter"||x.key===" ")&&x.preventDefault()},children:r?.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)(n.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)(n.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)(n.Button,{disabled:w,variant:"primary",size:"lg",className:"mt-[8px] md:px-[8px] l:w-full",onClick:()=>{o(e),(0,s.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:i?.activated?"active":"not active",event_parameters:{page_group:g,position:t.title,button_name:b,info:e.alpc?.id?.toString()}})},children:b})]})]})]})}
|
|
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, useHeadlessContext } from '@anker-in/lib'\nimport { NoneProductValue } from './NonProductValue'\nimport { roundedBrands } from '../const'\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 pageCommon,\n } = useCreditsContext()\n const { brand } = useHeadlessContext()\n const isLogin = Object.keys(profile || {}).length > 0\n const rounded = roundedBrands.includes(brand)\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 : pageCommon?.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 pageCommon?.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 !rounded && 'rounded-none md:rounded-none',\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={pageCommon?.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} />\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: pageCommon?.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 {pageCommon?.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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R,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbR,EAASF,CAAI,KACb,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,qBAAsBI,GAAS,UAAY,SAAW,aACtD,iBAAkB,CAChB,WAAYC,EACZ,SAAUP,EAAK,MACf,YAAaa,EACb,KAAMX,EAAK,MAAM,IAAI,SAAS,CAChC,CACF,CAAC,CACH,EAEC,SAAAW,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_lib", "import_NonProductValue", "copy", "className", "item", "onRulesOpen", "onRedeem", "creditInfo", "profile", "pageGroup", "pageCommon", "brand", "isLogin", "rounded", "isDisabled", "redeemButtonText", "classNames", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(r,o,p,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of c(o))!d.call(r,m)&&m!==p&&a(r,m,{get:()=>o[m],enumerable:!(x=b(o,m))||x.enumerable});return r},f=(r,o,p)=>(t(r,o,"default"),p&&t(p,o,"default"));var g=r=>t(a({},"__esModule",{value:!0}),r);var e={};module.exports=g(e);f(e,require("./type"),module.exports);f(e,require("./CreditsRedeemList"),module.exports);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsRedeemList/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './type'\nexport * from './CreditsRedeemList'\n"],
|
|
5
|
+
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,kBAAd,gBACAE,EAAAF,EAAc,+BADd",
|
|
6
|
+
"names": ["creditsRedeemList_exports", "__toCommonJS", "__reExport"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export type CreditsRedeemListCopy = {
|
|
2
|
+
title: string;
|
|
3
|
+
unlockRewards: string;
|
|
4
|
+
btnRedeem: string;
|
|
5
|
+
list: {
|
|
6
|
+
label: string;
|
|
7
|
+
list: {
|
|
8
|
+
id: string;
|
|
9
|
+
type: string;
|
|
10
|
+
value: string;
|
|
11
|
+
rules: string[];
|
|
12
|
+
}[];
|
|
13
|
+
}[];
|
|
14
|
+
redeemModal: {
|
|
15
|
+
confirmTitle: string;
|
|
16
|
+
confirmButton: string;
|
|
17
|
+
commonError: string;
|
|
18
|
+
redeemLimitError: string;
|
|
19
|
+
inventoryNotEnough: string;
|
|
20
|
+
creditsNotEnough: string;
|
|
21
|
+
crossSiteError: string;
|
|
22
|
+
errorImageUrl: string;
|
|
23
|
+
coupon: {
|
|
24
|
+
successDesc: string;
|
|
25
|
+
successTitle: string;
|
|
26
|
+
successButton: string;
|
|
27
|
+
successButtonUrl: string;
|
|
28
|
+
};
|
|
29
|
+
product: {
|
|
30
|
+
required: string;
|
|
31
|
+
invalidEmail: string;
|
|
32
|
+
shippingAddress: string;
|
|
33
|
+
shippingProduct: string;
|
|
34
|
+
addressForm: {
|
|
35
|
+
key: string;
|
|
36
|
+
type: string;
|
|
37
|
+
label: string;
|
|
38
|
+
isSelect: boolean;
|
|
39
|
+
required: boolean;
|
|
40
|
+
placeholder: string;
|
|
41
|
+
}[][];
|
|
42
|
+
form: {
|
|
43
|
+
key: string;
|
|
44
|
+
type: string;
|
|
45
|
+
isSelect: boolean;
|
|
46
|
+
required: boolean;
|
|
47
|
+
placeholder: string;
|
|
48
|
+
}[][];
|
|
49
|
+
successDesc: string[];
|
|
50
|
+
rules: string[];
|
|
51
|
+
steps: {
|
|
52
|
+
imageUrl: string;
|
|
53
|
+
title: string;
|
|
54
|
+
}[];
|
|
55
|
+
quantityLabel: string;
|
|
56
|
+
totalPriceLabel: string;
|
|
57
|
+
variantLabel: string;
|
|
58
|
+
shippingFeeLabel: string;
|
|
59
|
+
paymentButton: string;
|
|
60
|
+
stepTitle: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -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 c=(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 a=t=>c(e({},"__esModule",{value:!0}),t);var u={};module.exports=a(u);
|
|
2
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsRedeemList/type.ts"],
|
|
4
|
+
"sourcesContent": ["export type CreditsRedeemListCopy = {\n title: 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 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}\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 q=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var E=(t,n)=>{for(var o in n)g(t,o,{get:n[o],enumerable:!0})},V=(t,n,o,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of H(n))!_.call(t,a)&&a!==o&&g(t,a,{get:()=>n[a],enumerable:!(p=q(n,a))||p.enumerable});return t};var J=t=>V(g({},"__esModule",{value:!0}),t);var Q={};E(Q,{CreditsWaysToGetCredits:()=>K});module.exports=J(Q);var e=require("react/jsx-runtime"),i=require("@anker-in/headless-ui"),f=require("@heroicons/react/24/outline"),I=require("framer-motion"),l=require("react"),x=require("./type"),y=require("./useActions"),L=require("../context/provider"),d=require("@anker-in/lib"),M=require("../../registration"),R=require("../modal/creditsUploadReceiptModal"),T=require("../modal/subscribeModal"),U=require("../const");const K=({copy:t,classNames:n})=>{const[o,p]=(0,l.useState)(!1),{profile:a}=(0,L.useCreditsContext)(),{authCodeActivate:D}=(0,M.useRegistration)(),{brand:B}=(0,d.useHeadlessContext)(),k=U.roundedBrands.includes(B),b=!!a,[O,C]=(0,l.useState)(!1),[A,N]=(0,l.useState)(!1),[w,P]=(0,l.useState)(!1),[F,G]=(0,l.useState)(!1),{actions:h}=(0,y.useActions)({copy:t,subscribe:{openSubscribePopup:()=>N(!0),isSuccess:w},uploadReceipt:{openUploadReceiptPopup:()=>C(!0),isSuccess:F}}),W=(0,l.useMemo)(()=>{const s=t.list.map(r=>{if(!h[r.id])return;const{finished:c,notLogin:S,notFinished:v,completed:j}=h[r.id];let m="",u,z;return b?c?(m=j.buttonLabel,u=void 0):(m=v.buttonLabel,u=v.handleClick,z=v.link):(m=S.buttonLabel,u=S.handleClick),{...r,buttonLabel:m,handleClick:u,finished:c,link:z}}).filter(Boolean);return b?s.sort((r,c)=>r?.finished&&!c?.finished?1:!r?.finished&&c?.finished?-1:0):s},[h,t.list,b]);return(0,e.jsxs)(i.Container,{id:"ways-to-get-credits",className:" bg-[#F5F5F7] [&>div]:l:!px-0",children:[(0,e.jsxs)("div",{className:(0,d.classNames)("rounded-[16px] bg-[#1D1D1F] py-[64px] px-[140px] text-white md:px-[16px] l:rounded-none md-l:px-[32px] l-xl:px-[77px]",!k&&"rounded-none"),children:[(0,e.jsx)(i.Heading,{as:"h2",size:4,html:t?.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)(i.Heading,{size:3,as:"h3",html:t.subtitle,className:n?.subtitle}),(0,e.jsxs)("div",{className:"mt-[8px] flex items-center",children:[t.creditsIcon?.url&&(0,e.jsx)(i.Picture,{className:"size-[48px] mr-[8px] stroke-brand xl:size-[30px] [&_path]:stroke-brand",source:t.creditsIcon.url,alt:t.creditsIcon.alt||"credits"}),(0,e.jsx)(i.Heading,{html:t.equalCredits,size:4,as:"h3",className:(0,d.classNames)("mt-2 text-white md:text-[24px]",n?.equalCreditsText)})]})]}),(0,e.jsx)(i.Picture,{className:"w-full laptop:w-[50%]",source:t.mainImage?.url})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)(I.motion.div,{className:(0,d.classNames)("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:o?"auto":512},transition:{duration:.3},onAnimationComplete:()=>{if(!o&&window.screen.width<768){const s=document.getElementById("ways-to-get-credits");s&&s.scrollIntoView({behavior:"smooth",block:"end"})}},children:[W.map(s=>(0,e.jsxs)("div",{className:(0,d.classNames)("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]",!k&&"rounded-none"),children:[(0,e.jsxs)("div",{children:[(0,e.jsx)(i.Heading,{as:"h4",html:s.title,size:2,className:"text-pretty"}),(0,e.jsxs)("div",{className:"mt-[4px] flex items-center",children:[(0,e.jsx)(i.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)(i.Text,{as:"p",html:s.credits,size:2,className:"ml-[4px] mt-[6px] lg-desktop:text-[18px]"})]})]}),s.handleClick&&!(s.id===x.TaskType.UploadReceipt&&F)&&!(s.id===x.TaskType.Activate&&D.isActivateSuccess)&&!(s.id===x.TaskType.Subscribe&&w)?(0,e.jsx)(i.Button,{as:s.link?"a":"button",...s.link&&{href:s.link},...s.handleClick&&{onClick:s.handleClick},variant:"primary",size:"lg",className:"mt-[24px] w-fit",children:s.buttonLabel}):(0,e.jsx)(i.Button,{variant:"primary",size:"lg",className:"mt-[24px] w-fit",disabled:!0,children:s.buttonLabel})]},s.id)),!o&&(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%)"}})]}),o?(0,e.jsx)("button",{className:"mx-auto mt-[12px] block w-fit min-md:hidden",onClick:()=>{p(!1)},children:(0,e.jsx)(f.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:()=>p(!o),children:(0,e.jsx)(f.ChevronDownIcon,{className:"size-[40px] rounded-full bg-[#FFFFFF33] p-[8px]"})})})})]})]}),t.receipt&&(0,e.jsx)(R.CreditsUploadReceiptModal,{isOpen:O,onClose:()=>{C(!1)},copy:t.receipt,onSuccess:()=>{G(!0)}}),t.subscribe&&(0,e.jsx)(T.CreditsSubscribeModal,{copy:t.subscribe,onSuccess:()=>{P(!0)},isOpen:A,onClose:()=>{N(!1)}})]})};
|
|
2
|
+
//# sourceMappingURL=CreditsWaysToGetCredits.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.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 { classNames as cn, useHeadlessContext } from '@anker-in/lib'\nimport { useRegistration } from '../../registration'\nimport { CreditsUploadReceiptModal } from '../modal/creditsUploadReceiptModal'\nimport { CreditsSubscribeModal } from '../modal/subscribeModal'\nimport { roundedBrands } from '../const'\n\nexport const CreditsWaysToGetCredits = ({ copy, classNames }: CreditsWaysToGetCreditsProps) => {\n const [showMore, setShowMore] = useState(false)\n const { profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const { brand } = useHeadlessContext()\n const rounded = roundedBrands.includes(brand)\n const isLogin = !!profile\n\n const [isUploadReceiptModalOpen, setIsUploadReceiptModalOpen] = useState(false)\n const [isSubscribeModalOpen, setIsSubscribeModalOpen] = useState(false)\n const [isSubscribeSuccess, setIsSubscribeSuccess] = useState(false)\n const [isUploadReceiptSuccess, setIsUploadReceiptSuccess] = useState(false)\n\n const { actions } = useActions({\n copy,\n subscribe: {\n openSubscribePopup: () => setIsSubscribeModalOpen(true),\n isSuccess: isSubscribeSuccess,\n },\n uploadReceipt: {\n openUploadReceiptPopup: () => setIsUploadReceiptModalOpen(true),\n isSuccess: isUploadReceiptSuccess,\n },\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\n className={cn(\n '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 !rounded && 'rounded-none'\n )}\n >\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={cn(\n '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 !rounded && 'rounded-none'\n )}\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 && isUploadReceiptSuccess) &&\n !(item.id === TaskType.Activate && authCodeActivate.isActivateSuccess) &&\n !(item.id === TaskType.Subscribe && isSubscribeSuccess) ? (\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 {copy.receipt && (\n <CreditsUploadReceiptModal\n isOpen={isUploadReceiptModalOpen}\n onClose={() => {\n setIsUploadReceiptModalOpen(false)\n }}\n copy={copy.receipt}\n onSuccess={() => {\n setIsUploadReceiptSuccess(true)\n }}\n />\n )}\n {copy.subscribe && (\n <CreditsSubscribeModal\n copy={copy.subscribe}\n onSuccess={() => {\n setIsSubscribeSuccess(true)\n }}\n isOpen={isSubscribeModalOpen}\n onClose={() => {\n setIsSubscribeModalOpen(false)\n }}\n />\n )}\n </Container>\n )\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAqGQ,IAAAI,EAAA,6BArGRC,EAA0D,iCAC1DC,EAA+C,uCAC/CC,EAAuB,yBACvBC,EAAkC,iBAElCC,EAA4D,kBAC5DC,EAA2B,wBAC3BC,EAAkC,+BAClCC,EAAqD,yBACrDC,EAAgC,8BAChCC,EAA0C,8CAC1CC,EAAsC,mCACtCC,EAA8B,oBAEvB,MAAMd,EAA0B,CAAC,CAAE,KAAAe,EAAM,WAAAC,CAAW,IAAoC,CAC7F,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAK,EACxC,CAAE,QAAAC,CAAQ,KAAI,qBAAkB,EAChC,CAAE,iBAAAC,CAAiB,KAAI,mBAAgB,EACvC,CAAE,MAAAC,CAAM,KAAI,sBAAmB,EAC/BC,EAAU,gBAAc,SAASD,CAAK,EACtCE,EAAU,CAAC,CAACJ,EAEZ,CAACK,EAA0BC,CAA2B,KAAI,YAAS,EAAK,EACxE,CAACC,EAAsBC,CAAuB,KAAI,YAAS,EAAK,EAChE,CAACC,EAAoBC,CAAqB,KAAI,YAAS,EAAK,EAC5D,CAACC,EAAwBC,CAAyB,KAAI,YAAS,EAAK,EAEpE,CAAE,QAAAC,CAAQ,KAAI,cAAW,CAC7B,KAAAjB,EACA,UAAW,CACT,mBAAoB,IAAMY,EAAwB,EAAI,EACtD,UAAWC,CACb,EACA,cAAe,CACb,uBAAwB,IAAMH,EAA4B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BAAkB,SAAQ,GACrE,SAAAA,EAAK,YACR,IAlCGA,EAAK,EAoCZ,CACD,EACA,CAACjB,MACA,OAAC,OACC,UAAU,qDACV,MAAO,CAAE,WAAY,mEAAoE,EAC1F,GAEL,EACCA,KACC,OAAC,UACC,UAAU,8CACV,QAAS,IAAM,CACbC,EAAY,EAAK,CACnB,EAEA,mBAAC,iBAAc,UAAU,kDAAkD,EAC7E,KAEA,mBACE,mBAAC,OAAI,UAAU,6EACb,mBAAC,UAAO,UAAU,QAAQ,QAAS,IAAMA,EAAY,CAACD,CAAQ,EAC5D,mBAAC,mBAAgB,UAAU,kDAAkD,EAC/E,EACF,EACF,GAEJ,GACF,EACCF,EAAK,YACJ,OAAC,6BACC,OAAQS,EACR,QAAS,IAAM,CACbC,EAA4B,EAAK,CACnC,EACA,KAAMV,EAAK,QACX,UAAW,IAAM,CACfgB,EAA0B,EAAI,CAChC,EACF,EAEDhB,EAAK,cACJ,OAAC,yBACC,KAAMA,EAAK,UACX,UAAW,IAAM,CACfc,EAAsB,EAAI,CAC5B,EACA,OAAQH,EACR,QAAS,IAAM,CACbC,EAAwB,EAAK,CAC/B,EACF,GAEJ,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_lib", "import_registration", "import_creditsUploadReceiptModal", "import_subscribeModal", "import_const", "copy", "classNames", "showMore", "setShowMore", "profile", "authCodeActivate", "brand", "rounded", "isLogin", "isUploadReceiptModalOpen", "setIsUploadReceiptModalOpen", "isSubscribeModalOpen", "setIsSubscribeModalOpen", "isSubscribeSuccess", "setIsSubscribeSuccess", "isUploadReceiptSuccess", "setIsUploadReceiptSuccess", "actions", "list", "item", "finished", "notLogin", "notFinished", "completed", "buttonLabel", "handleClick", "link", "a", "b", "cn", "section"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(r,o,p,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of c(o))!d.call(r,m)&&m!==p&&a(r,m,{get:()=>o[m],enumerable:!(x=b(o,m))||x.enumerable});return r},f=(r,o,p)=>(t(r,o,"default"),p&&t(p,o,"default"));var g=r=>t(a({},"__esModule",{value:!0}),r);var e={};module.exports=g(e);f(e,require("./type"),module.exports);f(e,require("./CreditsWaysToGetCredits"),module.exports);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './type'\nexport * from './CreditsWaysToGetCredits'\n"],
|
|
5
|
+
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,kBAAd,gBACAE,EAAAF,EAAc,qCADd",
|
|
6
|
+
"names": ["creditsWaysToGetCredits_exports", "__toCommonJS", "__reExport"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ReceiptCopy } from '../modal/creditsUploadReceiptModal';
|
|
2
|
+
import type { CreditsSubscribeModalCopy } from '../modal/subscribeModal';
|
|
3
|
+
export type BenefitItem = {
|
|
4
|
+
title: string;
|
|
5
|
+
credits: string;
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
export type CreditsWaysToGetCreditsCopy = {
|
|
9
|
+
title: string;
|
|
10
|
+
subtitle: string;
|
|
11
|
+
equalCredits: string;
|
|
12
|
+
musicIcon: string;
|
|
13
|
+
list: BenefitItem[];
|
|
14
|
+
mainImage: {
|
|
15
|
+
url: string;
|
|
16
|
+
alt: string;
|
|
17
|
+
};
|
|
18
|
+
joinNow: string;
|
|
19
|
+
activate: string;
|
|
20
|
+
completed: string;
|
|
21
|
+
completeProfile: string;
|
|
22
|
+
makeFirstPurchase: string;
|
|
23
|
+
goShopLink: string;
|
|
24
|
+
uploadReceipt: string;
|
|
25
|
+
shopNow: string;
|
|
26
|
+
subscribeLabel: string;
|
|
27
|
+
sendEmailSuccess: string;
|
|
28
|
+
creditsIcon: {
|
|
29
|
+
url: string;
|
|
30
|
+
alt: string;
|
|
31
|
+
};
|
|
32
|
+
receipt: ReceiptCopy;
|
|
33
|
+
subscribe: CreditsSubscribeModalCopy;
|
|
34
|
+
};
|
|
35
|
+
export declare enum TaskType {
|
|
36
|
+
Activate = "activate",
|
|
37
|
+
Subscribe = "subscribe",
|
|
38
|
+
CompleteProfile = "completeProfile",
|
|
39
|
+
FirstPurchase = "firstPurchase",
|
|
40
|
+
UploadReceipt = "uploadReceipt",
|
|
41
|
+
Shop = "shop"
|
|
42
|
+
}
|
|
43
|
+
export type CreditsWaysToGetCreditsProps = {
|
|
44
|
+
copy: CreditsWaysToGetCreditsCopy;
|
|
45
|
+
classNames?: {
|
|
46
|
+
equalCreditsText?: string;
|
|
47
|
+
subtitle?: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)o(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of l(t))!a.call(e,r)&&r!==s&&o(e,r,{get:()=>t[r],enumerable:!(c=p(t,r))||c.enumerable});return e};var u=e=>g(o({},"__esModule",{value:!0}),e);var m={};d(m,{TaskType:()=>n});module.exports=u(m);var n=(i=>(i.Activate="activate",i.Subscribe="subscribe",i.CompleteProfile="completeProfile",i.FirstPurchase="firstPurchase",i.UploadReceipt="uploadReceipt",i.Shop="shop",i))(n||{});
|
|
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'\nimport type { CreditsSubscribeModalCopy } from '../modal/subscribeModal'\n\nexport type BenefitItem = {\n title: string\n credits: string\n id: string\n}\n\nexport type CreditsWaysToGetCreditsCopy = {\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 subscribeLabel: string\n sendEmailSuccess: string\n creditsIcon: {\n url: string\n alt: string\n }\n receipt: ReceiptCopy\n subscribe: CreditsSubscribeModalCopy\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: CreditsWaysToGetCreditsCopy\n classNames?: {\n equalCreditsText?: string\n subtitle?: string\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAqCO,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,105 @@
|
|
|
1
|
+
import type { CreditsWaysToGetCreditsCopy } from './type';
|
|
2
|
+
export declare const useActions: ({ copy, subscribe, uploadReceipt, gaParameters, }: {
|
|
3
|
+
copy: CreditsWaysToGetCreditsCopy;
|
|
4
|
+
subscribe: {
|
|
5
|
+
openSubscribePopup: () => void;
|
|
6
|
+
isSuccess: boolean;
|
|
7
|
+
};
|
|
8
|
+
uploadReceipt: {
|
|
9
|
+
openUploadReceiptPopup: () => void;
|
|
10
|
+
isSuccess: boolean;
|
|
11
|
+
};
|
|
12
|
+
gaParameters?: {
|
|
13
|
+
position: string;
|
|
14
|
+
};
|
|
15
|
+
}) => {
|
|
16
|
+
actions: {
|
|
17
|
+
activate: {
|
|
18
|
+
finished: any;
|
|
19
|
+
notLogin: {
|
|
20
|
+
buttonLabel: string;
|
|
21
|
+
handleClick: () => void;
|
|
22
|
+
};
|
|
23
|
+
notFinished: {
|
|
24
|
+
buttonLabel: string;
|
|
25
|
+
handleClick: () => void;
|
|
26
|
+
};
|
|
27
|
+
completed: {
|
|
28
|
+
buttonLabel: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
subscribe: {
|
|
32
|
+
finished: boolean;
|
|
33
|
+
notLogin: {
|
|
34
|
+
buttonLabel: string;
|
|
35
|
+
handleClick: () => void;
|
|
36
|
+
};
|
|
37
|
+
notFinished: {
|
|
38
|
+
buttonLabel: string;
|
|
39
|
+
handleClick: () => void;
|
|
40
|
+
};
|
|
41
|
+
completed: {
|
|
42
|
+
buttonLabel: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
completeProfile: {
|
|
46
|
+
finished: any;
|
|
47
|
+
notLogin: {
|
|
48
|
+
buttonLabel: string;
|
|
49
|
+
handleClick: () => void;
|
|
50
|
+
};
|
|
51
|
+
notFinished: {
|
|
52
|
+
buttonLabel: string;
|
|
53
|
+
link: string;
|
|
54
|
+
handleClick: () => void;
|
|
55
|
+
};
|
|
56
|
+
completed: {
|
|
57
|
+
buttonLabel: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
firstPurchase: {
|
|
61
|
+
finished: boolean;
|
|
62
|
+
notLogin: {
|
|
63
|
+
buttonLabel: string;
|
|
64
|
+
handleClick: () => void;
|
|
65
|
+
};
|
|
66
|
+
notFinished: {
|
|
67
|
+
buttonLabel: string;
|
|
68
|
+
link: string;
|
|
69
|
+
handleClick: () => void;
|
|
70
|
+
};
|
|
71
|
+
completed: {
|
|
72
|
+
buttonLabel: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
uploadReceipt: {
|
|
76
|
+
finished: boolean;
|
|
77
|
+
notLogin: {
|
|
78
|
+
buttonLabel: string;
|
|
79
|
+
handleClick: () => void;
|
|
80
|
+
};
|
|
81
|
+
notFinished: {
|
|
82
|
+
buttonLabel: string;
|
|
83
|
+
handleClick: () => void;
|
|
84
|
+
};
|
|
85
|
+
completed: {
|
|
86
|
+
buttonLabel: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
shop: {
|
|
90
|
+
finished: boolean;
|
|
91
|
+
notLogin: {
|
|
92
|
+
buttonLabel: string;
|
|
93
|
+
handleClick: () => void;
|
|
94
|
+
};
|
|
95
|
+
notFinished: {
|
|
96
|
+
buttonLabel: string;
|
|
97
|
+
link: string;
|
|
98
|
+
handleClick: () => void;
|
|
99
|
+
};
|
|
100
|
+
completed: {
|
|
101
|
+
buttonLabel: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var j=Object.create;var b=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var x=(e,i)=>{for(var n in i)b(e,n,{get:i[n],enumerable:!0})},h=(e,i,n,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of U(i))!A.call(e,o)&&o!==n&&b(e,o,{get:()=>i[o],enumerable:!(s=_(i,o))||s.enumerable});return e};var G=(e,i,n)=>(n=e!=null?j(T(e)):{},h(i||!e||!e.__esModule?b(n,"default",{value:e,enumerable:!0}):n,e)),W=e=>h(b({},"__esModule",{value:!0}),e);var E={};x(E,{useActions:()=>$});module.exports=W(E);var r=require("@anker-in/lib"),t=require("./type"),k=require("../context/provider"),d=require("react"),L=G(require("../context/hooks/useReceiptUploaded")),f=require("../context/hooks/useFirstPurchaseFinished"),N=require("../context/hooks/useSubscribed"),C=require("../../registration");const $=({copy:e,subscribe:i,uploadReceipt:n,gaParameters:s})=>{const{openSignUpPopup:o,gtm:P,profile:l}=(0,k.useCreditsContext)(),{authCodeActivate:g}=(0,C.useRegistration)(),u=(0,N.useSubscribed)(),c=(0,f.useFirstPurchaseFinished)(),m=(0,L.default)(),{appName:v,passportUrl:F}=(0,r.useHeadlessContext)(),p=(0,d.useMemo)(()=>(l?.first_name||l?.last_name)&&l?.phone_number&&l?.dob,[l]);return(0,d.useMemo)(()=>{const a=({buttonName:S,id:w,callback:R})=>{(0,r.gaTrack)({event:"ga4Event",event_name:"lp_button",member_active_status:l?.activated?"active":"not active",event_parameters:{page_group:P.pageGroup,position:s?.position||e.title,button_name:S,info:w}}),R()};return{actions:{[t.TaskType.Activate]:{finished:l?.activated,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.Activate})},notFinished:{buttonLabel:e?.activate,handleClick:()=>a({buttonName:e?.activate,callback:()=>g.open(),id:t.TaskType.Activate})},completed:{buttonLabel:e?.completed}},[t.TaskType.Subscribe]:{finished:u,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.Subscribe})},notFinished:{buttonLabel:e?.subscribeLabel,handleClick:()=>a({buttonName:e?.subscribeLabel,callback:()=>i.openSubscribePopup(),id:t.TaskType.Subscribe})},completed:{buttonLabel:e?.completed}},[t.TaskType.CompleteProfile]:{finished:p,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.CompleteProfile})},notFinished:{buttonLabel:e?.completeProfile,link:`${F}/account/profile?app=${v}`,handleClick:()=>a({buttonName:e?.completeProfile,callback:()=>{},id:t.TaskType.CompleteProfile})},completed:{buttonLabel:e?.completed}},[t.TaskType.FirstPurchase]:{finished:c,notLogin:{buttonLabel:e?.makeFirstPurchase,handleClick:()=>a({buttonName:e?.makeFirstPurchase,callback:o,id:t.TaskType.FirstPurchase})},notFinished:{buttonLabel:e?.makeFirstPurchase,link:e?.goShopLink,handleClick:()=>a({buttonName:e?.makeFirstPurchase,callback:()=>{},id:t.TaskType.FirstPurchase})},completed:{buttonLabel:e?.completed}},[t.TaskType.UploadReceipt]:{finished:m,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.UploadReceipt})},notFinished:{buttonLabel:e?.uploadReceipt,handleClick:()=>a({buttonName:e?.uploadReceipt,callback:()=>n.openUploadReceiptPopup(),id:t.TaskType.UploadReceipt})},completed:{buttonLabel:e?.completed}},[t.TaskType.Shop]:{finished:!1,notLogin:{buttonLabel:e?.joinNow,handleClick:()=>a({buttonName:e?.joinNow,callback:o,id:t.TaskType.Shop})},notFinished:{buttonLabel:e?.shopNow,link:e?.goShopLink,handleClick:()=>a({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,s?.position,o])};
|
|
2
|
+
//# sourceMappingURL=useActions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/components/credits/creditsWaysToGetCredits/useActions.ts"],
|
|
4
|
+
"sourcesContent": ["import { useHeadlessContext, gaTrack } from '@anker-in/lib'\n\nimport { 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 { CreditsWaysToGetCreditsCopy } from './type'\n\nimport { useRegistration } from '../../registration'\n\nexport const useActions = ({\n copy,\n subscribe,\n uploadReceipt,\n gaParameters,\n}: {\n copy: CreditsWaysToGetCreditsCopy\n subscribe: {\n openSubscribePopup: () => void\n isSuccess: boolean\n }\n uploadReceipt: {\n openUploadReceiptPopup: () => void\n isSuccess: boolean\n }\n gaParameters?: {\n position: string\n }\n}) => {\n const { openSignUpPopup, gtm, profile } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\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: () => authCodeActivate.open(),\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?.subscribeLabel,\n handleClick: () =>\n handleClickWithTrack({\n buttonName: copy?.subscribeLabel,\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,EAA4C,yBAE5CC,EAAyB,kBACzBC,EAAkC,+BAClCC,EAAwB,iBACxBC,EAA+B,kDAC/BC,EAAyC,qDACzCC,EAA8B,0CAG9BC,EAAgC,8BAEzB,MAAMT,EAAa,CAAC,CACzB,KAAAU,EACA,UAAAC,EACA,cAAAC,EACA,aAAAC,CACF,IAaM,CACJ,KAAM,CAAE,gBAAAC,EAAiB,IAAAC,EAAK,QAAAC,CAAQ,KAAI,qBAAkB,EACtD,CAAE,iBAAAC,CAAiB,KAAI,mBAAgB,EACvCC,KAAe,iBAAc,EAC7BC,KAAwB,4BAAyB,EACjDC,KAAkB,EAAAC,SAAmB,EACrC,CAAE,QAAAC,EAAS,YAAAC,CAAY,KAAI,sBAAmB,EAE9CC,KAAmB,WAAQ,KACvBR,G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IACf,CAAC,CACL,EACA,UAAW,CACT,YAAaA,GAAM,SACrB,CACF,CACF,CACF,CACF,EAAG,CACDM,GAAS,UACTN,GAAM,QACNA,GAAM,SACNA,GAAM,UACNA,GAAM,UACNA,GAAM,gBACNA,GAAM,kBACNA,GAAM,cACNA,GAAM,QACNA,EAAK,MACLA,GAAM,WACNQ,EACAM,EACAL,EACAC,EACAP,GAAc,SACdC,CACF,CAAC,CACH",
|
|
6
|
+
"names": ["useActions_exports", "__export", "useActions", "__toCommonJS", "import_lib", "import_type", "import_provider", "import_react", "import_useReceiptUploaded", "import_useFirstPurchaseFinished", "import_useSubscribed", "import_registration", "copy", "subscribe", "uploadReceipt", "gaParameters", "openSignUpPopup", "gtm", "profile", "authCodeActivate", "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';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var B=(r,e)=>{for(var o in e)d(r,o,{get:e[o],enumerable:!0})},h=(r,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!U.call(r,t)&&t!==o&&d(r,t,{get:()=>e[t],enumerable:!(i=c(e,t))||i.enumerable});return r};var q=r=>h(d({},"__esModule",{value:!0}),r);var v={};B(v,{CreditsBanner:()=>f.CreditsBanner,CreditsBenefits:()=>m.CreditsBenefits,CreditsCash:()=>l.CreditsCash,CreditsFaq:()=>n.CreditsFaq,CreditsInfoCard:()=>x.CreditsInfoCard,CreditsProvider:()=>s.CreditsProvider,CreditsRedeemList:()=>R.CreditsRedeemList,CreditsUploadReceiptModal:()=>C.CreditsUploadReceiptModal,CreditsWaysToGetCredits:()=>a.CreditsWaysToGetCredits,useCreditsContext:()=>s.useCreditsContext,useCreditsUploadReceipt:()=>p.useUploadReceipt});module.exports=q(v);var s=require("./context/provider"),p=require("./context/hooks/useUploadReceipt"),C=require("./modal/creditsUploadReceiptModal"),f=require("./creditsBanner"),m=require("./creditsBenefits"),x=require("./creditsInfoCard"),a=require("./creditsWaysToGetCredits"),n=require("./creditsFaq"),l=require("./creditsCash"),R=require("./creditsRedeemList");
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/credits/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { CreditsProvider, useCreditsContext } from './context/provider'\n\nexport { useUploadReceipt as useCreditsUploadReceipt } from './context/hooks/useUploadReceipt'\nexport { CreditsUploadReceiptModal } from './modal/creditsUploadReceiptModal'\nexport { CreditsBanner } from './creditsBanner'\nexport { CreditsBenefits } from './creditsBenefits'\nexport { CreditsInfoCard } from './creditsInfoCard'\nexport { CreditsWaysToGetCredits } from './creditsWaysToGetCredits'\nexport { CreditsFaq } from './creditsFaq'\nexport { CreditsCash } from './creditsCash'\nexport { CreditsRedeemList } from './creditsRedeemList'\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mdAAAE,EAAAF,GAAA,IAAAG,EAAmD,8BAEnDC,EAA4D,4CAC5DC,EAA0C,6CAC1CC,EAA8B,2BAC9BC,EAAgC,6BAChCC,EAAgC,6BAChCC,EAAwC,qCACxCC,EAA2B,wBAC3BC,EAA4B,yBAC5BC,EAAkC",
|
|
6
|
+
"names": ["credits_exports", "__export", "__toCommonJS", "import_provider", "import_useUploadReceipt", "import_creditsUploadReceiptModal", "import_creditsBanner", "import_creditsBenefits", "import_creditsInfoCard", "import_creditsWaysToGetCredits", "import_creditsFaq", "import_creditsCash", "import_creditsRedeemList"]
|
|
7
|
+
}
|