@anker-in/campaign-ui 0.2.10-beta.9 → 0.2.11-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.
Files changed (915) hide show
  1. package/dist/cjs/components/chat/{chat-context.js → chatContext.js} +1 -1
  2. package/dist/cjs/components/chat/{chat-context.js.map → chatContext.js.map} +2 -2
  3. package/dist/cjs/components/chat/index.js +1 -1
  4. package/dist/cjs/components/chat/index.js.map +3 -3
  5. package/dist/cjs/components/credits/context/const.d.ts +2 -1
  6. package/dist/cjs/components/credits/context/const.js +1 -1
  7. package/dist/cjs/components/credits/context/const.js.map +2 -2
  8. package/dist/cjs/components/credits/context/hooks/useActivities.js +1 -1
  9. package/dist/cjs/components/credits/context/hooks/useActivities.js.map +3 -3
  10. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js +1 -1
  11. package/dist/cjs/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  12. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js +1 -1
  13. package/dist/cjs/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  14. package/dist/cjs/components/credits/context/hooks/useCountries.js +1 -1
  15. package/dist/cjs/components/credits/context/hooks/useCountries.js.map +3 -3
  16. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  17. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  18. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  19. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  20. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  21. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  22. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  23. package/dist/cjs/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  24. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  25. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  26. package/dist/cjs/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  27. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js +1 -1
  28. package/dist/cjs/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  29. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  30. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  31. package/dist/cjs/components/credits/context/hooks/useSubscribed.js +1 -1
  32. package/dist/cjs/components/credits/context/hooks/useSubscribed.js.map +3 -3
  33. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js +1 -1
  34. package/dist/cjs/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  35. package/dist/cjs/components/credits/context/memberPriceConst.d.ts +10 -0
  36. package/dist/cjs/components/credits/context/memberPriceConst.js +2 -0
  37. package/dist/cjs/components/credits/context/memberPriceConst.js.map +7 -0
  38. package/dist/cjs/components/credits/context/memberPriceTypes.d.ts +46 -0
  39. package/dist/cjs/components/credits/context/memberPriceTypes.js +2 -0
  40. package/dist/cjs/components/credits/context/memberPriceTypes.js.map +7 -0
  41. package/dist/cjs/components/credits/context/provider.d.ts +11 -33
  42. package/dist/cjs/components/credits/context/provider.js +1 -1
  43. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  44. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  45. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  46. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  47. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  48. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  49. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  50. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  51. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  52. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  53. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  54. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  55. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  56. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  57. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  58. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  59. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  60. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  61. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  62. package/dist/cjs/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  63. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js +2 -0
  64. package/dist/cjs/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  65. package/dist/cjs/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  66. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js +2 -0
  67. package/dist/cjs/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  68. package/dist/cjs/components/credits/creditsBanner/index.d.ts +17 -16
  69. package/dist/cjs/components/credits/creditsBanner/index.js +2 -0
  70. package/dist/cjs/components/credits/creditsBanner/index.js.map +7 -0
  71. package/dist/{esm/components/credits/credits-benefits/benefitItem.d.ts → cjs/components/credits/creditsBenefits/BenefitItem.d.ts} +4 -1
  72. package/dist/cjs/components/credits/creditsBenefits/BenefitItem.js +2 -0
  73. package/dist/cjs/components/credits/creditsBenefits/BenefitItem.js.map +7 -0
  74. package/dist/cjs/components/credits/{credits-benefits/iconInfo.js → creditsBenefits/IconInfo.js} +1 -1
  75. package/dist/cjs/components/credits/{credits-benefits/iconInfo.js.map → creditsBenefits/IconInfo.js.map} +2 -2
  76. package/dist/cjs/components/credits/creditsBenefits/index.d.ts +12 -9
  77. package/dist/cjs/components/credits/creditsBenefits/index.js +4 -0
  78. package/dist/cjs/components/credits/creditsBenefits/index.js.map +7 -0
  79. package/dist/cjs/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  80. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +2 -0
  81. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +7 -0
  82. package/dist/cjs/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  83. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js +2 -0
  84. package/dist/cjs/components/credits/creditsCash/RedeemableItem.js.map +7 -0
  85. package/dist/cjs/components/credits/creditsCash/index.d.ts +2 -13
  86. package/dist/cjs/components/credits/creditsCash/index.js +2 -0
  87. package/dist/cjs/components/credits/creditsCash/index.js.map +7 -0
  88. package/dist/cjs/components/credits/creditsCash/type.d.ts +2 -4
  89. package/dist/cjs/components/credits/creditsCash/type.js +2 -0
  90. package/dist/cjs/components/credits/creditsCash/type.js.map +7 -0
  91. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js +2 -0
  92. package/dist/cjs/components/credits/creditsFaq/faqItem/FaqItem.js.map +7 -0
  93. package/dist/cjs/components/credits/creditsFaq/index.d.ts +4 -3
  94. package/dist/cjs/components/credits/creditsFaq/index.js +2 -0
  95. package/dist/cjs/components/credits/creditsFaq/index.js.map +7 -0
  96. package/dist/cjs/components/credits/creditsInfoCard/index.d.ts +10 -15
  97. package/dist/cjs/components/credits/creditsInfoCard/index.js +2 -0
  98. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +7 -0
  99. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  100. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  101. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  102. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  103. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  104. package/dist/cjs/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  105. package/dist/cjs/components/credits/creditsMemberPrice/index.d.ts +2 -0
  106. package/dist/cjs/components/credits/creditsMemberPrice/index.js +2 -0
  107. package/dist/cjs/components/credits/creditsMemberPrice/index.js.map +7 -0
  108. package/dist/cjs/components/credits/creditsMemberPrice/type.d.ts +64 -0
  109. package/dist/cjs/components/credits/creditsMemberPrice/type.js +2 -0
  110. package/dist/cjs/components/credits/creditsMemberPrice/type.js.map +7 -0
  111. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  112. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  113. package/dist/cjs/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  114. package/dist/cjs/components/credits/creditsNavigation/index.d.ts +2 -0
  115. package/dist/cjs/components/credits/creditsNavigation/index.js +2 -0
  116. package/dist/cjs/components/credits/creditsNavigation/index.js.map +7 -0
  117. package/dist/cjs/components/credits/creditsNavigation/type.d.ts +7 -0
  118. package/dist/cjs/components/credits/creditsNavigation/type.js +2 -0
  119. package/dist/cjs/components/credits/creditsNavigation/type.js.map +7 -0
  120. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +2 -0
  121. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +7 -0
  122. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js → creditsRedeemList/AddressForm/FormItem.js} +1 -1
  123. package/dist/cjs/components/credits/{credits-redeem-list/address-form/form-item.js.map → creditsRedeemList/AddressForm/FormItem.js.map} +2 -2
  124. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js.map +1 -1
  125. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js +2 -0
  126. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +7 -0
  127. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js +2 -0
  128. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/index.js.map +7 -0
  129. package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js.map +1 -1
  130. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  131. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  132. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  133. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  134. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  135. package/dist/cjs/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  136. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +2 -0
  137. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +7 -0
  138. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +2 -0
  139. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +7 -0
  140. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js +1 -1
  141. package/dist/cjs/components/credits/{credits-redeem-list/redeem-product-modal → creditsRedeemList/RedeemProductModal}/Error.js.map +3 -3
  142. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +2 -0
  143. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +7 -0
  144. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  145. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  146. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  147. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +2 -0
  148. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +7 -0
  149. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +2 -0
  150. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +7 -0
  151. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +2 -0
  152. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +7 -0
  153. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +2 -0
  154. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +7 -0
  155. package/dist/cjs/components/credits/creditsRedeemList/index.d.ts +2 -13
  156. package/dist/cjs/components/credits/creditsRedeemList/index.js +2 -0
  157. package/dist/cjs/components/credits/creditsRedeemList/index.js.map +7 -0
  158. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +2 -15
  159. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +7 -0
  160. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  161. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  162. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  163. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  164. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js +2 -0
  165. package/dist/cjs/components/credits/creditsWaysToGetCredits/index.js.map +7 -0
  166. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  167. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js +2 -0
  168. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +7 -0
  169. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  170. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js +2 -0
  171. package/dist/cjs/components/credits/creditsWaysToGetCredits/useActions.js.map +7 -0
  172. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +4 -1
  173. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  174. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  175. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +4 -1
  176. package/dist/cjs/components/credits/modal/activitiesModal.js +1 -1
  177. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  178. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  179. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  180. package/dist/cjs/components/credits/modal/loadingDots.d.ts +2 -1
  181. package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
  182. package/dist/cjs/components/credits/modal/loadingDots.js.map +3 -3
  183. package/dist/cjs/components/credits/modal/modalContainer.js +1 -1
  184. package/dist/cjs/components/credits/modal/modalContainer.js.map +3 -3
  185. package/dist/cjs/components/credits/modal/rulesModal.js +1 -1
  186. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  187. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +15 -0
  188. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -0
  189. package/dist/cjs/components/credits/modal/subscribeModal.js.map +7 -0
  190. package/dist/cjs/components/credits/modal/tip.js +1 -1
  191. package/dist/cjs/components/credits/modal/tip.js.map +3 -3
  192. package/dist/cjs/components/credits/type.d.ts +24 -5
  193. package/dist/cjs/components/credits/type.js +1 -1
  194. package/dist/cjs/components/credits/type.js.map +1 -1
  195. package/dist/cjs/components/index.d.ts +1 -0
  196. package/dist/cjs/components/index.js +1 -1
  197. package/dist/cjs/components/index.js.map +2 -2
  198. package/dist/cjs/components/registration/authCodeActivate/Message.d.ts +4 -0
  199. package/dist/cjs/components/registration/authCodeActivate/Message.js +2 -0
  200. package/dist/cjs/components/registration/authCodeActivate/Message.js.map +7 -0
  201. package/dist/cjs/components/registration/authCodeActivate/index.d.ts +3 -0
  202. package/dist/cjs/components/registration/authCodeActivate/index.js +2 -0
  203. package/dist/cjs/components/registration/authCodeActivate/index.js.map +7 -0
  204. package/dist/cjs/components/registration/authCodeActivate/type.d.ts +22 -0
  205. package/dist/cjs/components/registration/authCodeActivate/type.js +2 -0
  206. package/dist/cjs/components/registration/authCodeActivate/type.js.map +7 -0
  207. package/dist/cjs/components/registration/context/index.d.ts +1 -0
  208. package/dist/cjs/components/registration/context/index.js +2 -0
  209. package/dist/cjs/components/registration/context/index.js.map +7 -0
  210. package/dist/cjs/components/registration/context/provider.d.ts +27 -0
  211. package/dist/cjs/components/registration/context/provider.js +2 -0
  212. package/dist/cjs/components/registration/context/provider.js.map +7 -0
  213. package/dist/cjs/components/registration/index.d.ts +2 -0
  214. package/dist/cjs/components/registration/index.js +2 -0
  215. package/dist/cjs/components/registration/index.js.map +7 -0
  216. package/dist/cjs/components/registration/modalContainer.d.ts +14 -0
  217. package/dist/cjs/components/registration/modalContainer.js +2 -0
  218. package/dist/cjs/components/registration/modalContainer.js.map +7 -0
  219. package/dist/cjs/debug-env.js +2 -0
  220. package/dist/cjs/debug-env.js.map +7 -0
  221. package/dist/cjs/index.d.ts +2 -2
  222. package/dist/cjs/index.js +1 -726
  223. package/dist/cjs/index.js.map +4 -4
  224. package/dist/cjs/stories/chat.stories.js +2 -0
  225. package/dist/cjs/stories/chat.stories.js.map +7 -0
  226. package/dist/cjs/templates/Credits.d.ts +73 -0
  227. package/dist/cjs/templates/Credits.js +2 -0
  228. package/dist/cjs/templates/Credits.js.map +7 -0
  229. package/dist/cjs/templates/index.d.ts +1 -0
  230. package/dist/cjs/templates/index.js +2 -0
  231. package/dist/cjs/templates/index.js.map +7 -0
  232. package/dist/esm/components/chat/index.js +1 -1
  233. package/dist/esm/components/chat/index.js.map +2 -2
  234. package/dist/esm/components/credits/context/const.d.ts +2 -1
  235. package/dist/esm/components/credits/context/const.js +1 -1
  236. package/dist/esm/components/credits/context/const.js.map +2 -2
  237. package/dist/esm/components/credits/context/hooks/useActivities.js +1 -1
  238. package/dist/esm/components/credits/context/hooks/useActivities.js.map +3 -3
  239. package/dist/esm/components/credits/context/hooks/useAddressValidate.js +1 -1
  240. package/dist/esm/components/credits/context/hooks/useAddressValidate.js.map +3 -3
  241. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js +1 -1
  242. package/dist/esm/components/credits/context/hooks/useAlpcFetch.js.map +3 -3
  243. package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
  244. package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
  245. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  246. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  247. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  248. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  249. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  250. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.d.ts +5 -10
  251. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js +1 -1
  252. package/dist/esm/components/credits/context/hooks/useRedeemAndBuy.js.map +3 -3
  253. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.d.ts +2 -1
  254. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js +1 -1
  255. package/dist/esm/components/credits/context/hooks/useRedeemCoupon.js.map +3 -3
  256. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js +1 -1
  257. package/dist/esm/components/credits/context/hooks/useRedeemProduct.js.map +3 -3
  258. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  259. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  260. package/dist/esm/components/credits/context/hooks/useSubscribed.js +1 -1
  261. package/dist/esm/components/credits/context/hooks/useSubscribed.js.map +3 -3
  262. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js +1 -1
  263. package/dist/esm/components/credits/context/hooks/useUploadReceipt.js.map +2 -2
  264. package/dist/esm/components/credits/context/memberPriceConst.d.ts +10 -0
  265. package/dist/esm/components/credits/context/memberPriceConst.js +2 -0
  266. package/dist/esm/components/credits/context/memberPriceConst.js.map +7 -0
  267. package/dist/esm/components/credits/context/memberPriceTypes.d.ts +46 -0
  268. package/dist/esm/components/credits/context/memberPriceTypes.js +1 -0
  269. package/dist/esm/components/credits/context/provider.d.ts +11 -33
  270. package/dist/esm/components/credits/context/provider.js +1 -1
  271. package/dist/esm/components/credits/context/provider.js.map +3 -3
  272. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  273. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  274. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  275. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  276. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  277. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  278. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  279. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  280. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  281. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  282. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  283. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  284. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  285. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  286. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  287. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.d.ts +4 -0
  288. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +2 -0
  289. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +7 -0
  290. package/dist/esm/components/credits/creditsAnkersolixTask/index.d.ts +2 -0
  291. package/dist/esm/components/credits/creditsAnkersolixTask/index.js +2 -0
  292. package/dist/esm/components/credits/creditsAnkersolixTask/index.js.map +7 -0
  293. package/dist/esm/components/credits/creditsAnkersolixTask/type.d.ts +1 -0
  294. package/dist/esm/components/credits/creditsAnkersolixTask/type.js +2 -0
  295. package/dist/esm/components/credits/creditsAnkersolixTask/type.js.map +7 -0
  296. package/dist/esm/components/credits/creditsBanner/index.d.ts +17 -16
  297. package/dist/esm/components/credits/creditsBanner/index.js +1 -1
  298. package/dist/esm/components/credits/creditsBanner/index.js.map +3 -3
  299. package/dist/{cjs/components/credits/credits-benefits/benefitItem.d.ts → esm/components/credits/creditsBenefits/BenefitItem.d.ts} +4 -1
  300. package/dist/esm/components/credits/creditsBenefits/BenefitItem.js +2 -0
  301. package/dist/esm/components/credits/creditsBenefits/BenefitItem.js.map +7 -0
  302. package/dist/esm/components/credits/{credits-benefits/iconInfo.js → creditsBenefits/IconInfo.js} +1 -1
  303. package/dist/esm/components/credits/creditsBenefits/{iconInfo.js.map → IconInfo.js.map} +2 -2
  304. package/dist/esm/components/credits/creditsBenefits/index.d.ts +12 -9
  305. package/dist/esm/components/credits/creditsBenefits/index.js +3 -3
  306. package/dist/esm/components/credits/creditsBenefits/index.js.map +3 -3
  307. package/dist/esm/components/credits/creditsCash/CreditsCash.d.ts +5 -0
  308. package/dist/esm/components/credits/creditsCash/CreditsCash.js +2 -0
  309. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +7 -0
  310. package/dist/esm/components/credits/creditsCash/RedeemableItem.d.ts +1 -7
  311. package/dist/esm/components/credits/creditsCash/RedeemableItem.js +1 -1
  312. package/dist/esm/components/credits/creditsCash/RedeemableItem.js.map +3 -3
  313. package/dist/esm/components/credits/creditsCash/index.d.ts +2 -13
  314. package/dist/esm/components/credits/creditsCash/index.js +1 -1
  315. package/dist/esm/components/credits/creditsCash/index.js.map +4 -4
  316. package/dist/esm/components/credits/creditsCash/type.d.ts +2 -4
  317. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js +1 -1
  318. package/dist/esm/components/credits/creditsFaq/faqItem/FaqItem.js.map +2 -2
  319. package/dist/esm/components/credits/creditsFaq/index.d.ts +4 -3
  320. package/dist/esm/components/credits/creditsFaq/index.js +1 -1
  321. package/dist/esm/components/credits/creditsFaq/index.js.map +3 -3
  322. package/dist/esm/components/credits/creditsInfoCard/index.d.ts +10 -15
  323. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  324. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  325. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.d.ts +5 -0
  326. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +2 -0
  327. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +7 -0
  328. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.d.ts +7 -0
  329. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js +2 -0
  330. package/dist/esm/components/credits/creditsMemberPrice/MemberPriceItem.js.map +7 -0
  331. package/dist/esm/components/credits/creditsMemberPrice/index.d.ts +2 -0
  332. package/dist/esm/components/credits/creditsMemberPrice/index.js +2 -0
  333. package/dist/esm/components/credits/creditsMemberPrice/index.js.map +7 -0
  334. package/dist/esm/components/credits/creditsMemberPrice/type.d.ts +64 -0
  335. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.d.ts +4 -0
  336. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js +2 -0
  337. package/dist/esm/components/credits/creditsNavigation/CreditsNavigation.js.map +7 -0
  338. package/dist/esm/components/credits/creditsNavigation/index.d.ts +2 -0
  339. package/dist/esm/components/credits/creditsNavigation/index.js +2 -0
  340. package/dist/esm/components/credits/creditsNavigation/index.js.map +7 -0
  341. package/dist/esm/components/credits/creditsNavigation/type.d.ts +7 -0
  342. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js +1 -1
  343. package/dist/esm/components/credits/creditsRedeemList/AddressForm/CountrySelect.js.map +3 -3
  344. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js +1 -1
  345. package/dist/esm/components/credits/creditsRedeemList/AddressForm/StateSelect.js.map +3 -3
  346. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js +1 -1
  347. package/dist/esm/components/credits/creditsRedeemList/AddressForm/index.js.map +3 -3
  348. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.d.ts +5 -0
  349. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +2 -0
  350. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +7 -0
  351. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.d.ts +4 -0
  352. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js +2 -0
  353. package/dist/esm/components/credits/creditsRedeemList/NonProductValue.js.map +7 -0
  354. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  355. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  356. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  357. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +3 -3
  358. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js +1 -1
  359. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Error.js.map +2 -2
  360. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  361. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +3 -3
  362. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +6 -0
  363. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +2 -0
  364. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +7 -0
  365. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  366. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +3 -3
  367. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  368. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +3 -3
  369. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  370. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  371. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  372. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +3 -3
  373. package/dist/esm/components/credits/creditsRedeemList/index.d.ts +2 -13
  374. package/dist/esm/components/credits/creditsRedeemList/index.js +1 -1
  375. package/dist/esm/components/credits/creditsRedeemList/index.js.map +4 -4
  376. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +2 -15
  377. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.d.ts +4 -0
  378. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +2 -0
  379. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +7 -0
  380. package/dist/esm/components/credits/creditsWaysToGetCredits/index.d.ts +2 -2
  381. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js +1 -1
  382. package/dist/esm/components/credits/creditsWaysToGetCredits/index.js.map +4 -4
  383. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +5 -16
  384. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js +1 -1
  385. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +2 -2
  386. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.d.ts +11 -2
  387. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js +1 -1
  388. package/dist/esm/components/credits/creditsWaysToGetCredits/useActions.js.map +3 -3
  389. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +4 -1
  390. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  391. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  392. package/dist/esm/components/credits/modal/activitiesModal.d.ts +4 -1
  393. package/dist/esm/components/credits/modal/activitiesModal.js +1 -1
  394. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  395. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +1 -1
  396. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  397. package/dist/esm/components/credits/modal/loadingDots.d.ts +2 -1
  398. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  399. package/dist/esm/components/credits/modal/loadingDots.js.map +3 -3
  400. package/dist/esm/components/credits/modal/modalContainer.js +1 -1
  401. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  402. package/dist/esm/components/credits/modal/rulesModal.js +1 -1
  403. package/dist/esm/components/credits/modal/rulesModal.js.map +2 -2
  404. package/dist/esm/components/credits/modal/subscribeModal.d.ts +15 -0
  405. package/dist/esm/components/credits/modal/subscribeModal.js +2 -0
  406. package/dist/esm/components/credits/modal/subscribeModal.js.map +7 -0
  407. package/dist/esm/components/credits/modal/tip.js +1 -1
  408. package/dist/esm/components/credits/modal/tip.js.map +3 -3
  409. package/dist/esm/components/credits/type.d.ts +24 -5
  410. package/dist/esm/components/index.d.ts +1 -0
  411. package/dist/esm/components/index.js +1 -1
  412. package/dist/esm/components/index.js.map +2 -2
  413. package/dist/esm/components/registration/authCodeActivate/Message.d.ts +4 -0
  414. package/dist/esm/components/registration/authCodeActivate/Message.js +2 -0
  415. package/dist/esm/components/registration/authCodeActivate/Message.js.map +7 -0
  416. package/dist/esm/components/registration/authCodeActivate/index.d.ts +3 -0
  417. package/dist/esm/components/registration/authCodeActivate/index.js +2 -0
  418. package/dist/esm/components/registration/authCodeActivate/index.js.map +7 -0
  419. package/dist/esm/components/registration/authCodeActivate/type.d.ts +22 -0
  420. package/dist/esm/components/registration/authCodeActivate/type.js.map +7 -0
  421. package/dist/esm/components/registration/context/index.d.ts +1 -0
  422. package/dist/esm/components/registration/context/index.js +2 -0
  423. package/dist/esm/components/registration/context/index.js.map +7 -0
  424. package/dist/esm/components/registration/context/provider.d.ts +27 -0
  425. package/dist/esm/components/registration/context/provider.js +2 -0
  426. package/dist/esm/components/registration/context/provider.js.map +7 -0
  427. package/dist/esm/components/registration/index.d.ts +2 -0
  428. package/dist/esm/components/registration/index.js +2 -0
  429. package/dist/esm/components/registration/index.js.map +7 -0
  430. package/dist/esm/components/registration/modalContainer.d.ts +14 -0
  431. package/dist/esm/components/registration/modalContainer.js +2 -0
  432. package/dist/esm/components/registration/modalContainer.js.map +7 -0
  433. package/dist/esm/index.d.ts +2 -2
  434. package/dist/esm/index.js +1 -1
  435. package/dist/esm/index.js.map +2 -2
  436. package/dist/esm/templates/Credits.d.ts +73 -0
  437. package/dist/esm/templates/Credits.js +2 -0
  438. package/dist/esm/templates/Credits.js.map +7 -0
  439. package/dist/esm/templates/index.d.ts +1 -0
  440. package/dist/esm/templates/index.js +2 -0
  441. package/dist/esm/templates/index.js.map +7 -0
  442. package/package.json +25 -22
  443. package/src/components/chat/index.tsx +1 -1
  444. package/src/components/credits/context/const.ts +1 -0
  445. package/src/components/credits/context/hooks/useActivities.ts +4 -3
  446. package/src/components/credits/context/hooks/useAddressValidate.ts +2 -2
  447. package/src/components/credits/context/hooks/useAlpcFetch.ts +14 -10
  448. package/src/components/credits/context/hooks/useCountries.ts +2 -2
  449. package/src/components/credits/context/hooks/useFunctionMemberPrice.ts +33 -0
  450. package/src/components/credits/context/hooks/useMyRewards.ts +4 -3
  451. package/src/components/credits/context/hooks/useRedeemAndBuy.ts +21 -24
  452. package/src/components/credits/context/hooks/useRedeemCoupon.ts +7 -3
  453. package/src/components/credits/context/hooks/useRedeemProduct.ts +5 -2
  454. package/src/components/credits/context/hooks/useRedeemableList.ts +4 -18
  455. package/src/components/credits/context/hooks/useSubscribed.ts +6 -7
  456. package/src/components/credits/context/hooks/useUploadReceipt.tsx +0 -1
  457. package/src/components/credits/context/memberPriceConst.ts +13 -0
  458. package/src/components/credits/context/memberPriceTypes.ts +54 -0
  459. package/src/components/credits/context/provider.tsx +25 -20
  460. package/src/components/credits/context/utils/atobID.ts +8 -0
  461. package/src/components/credits/context/utils/functionDiscountCalculate.ts +57 -0
  462. package/src/components/credits/context/utils/getFunctionMemberPrice.ts +135 -0
  463. package/src/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.ts +51 -0
  464. package/src/components/credits/context/utils/variantGetCoupon.ts +34 -0
  465. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +270 -0
  466. package/src/components/credits/creditsAnkersolixTask/index.ts +2 -0
  467. package/src/components/credits/creditsAnkersolixTask/type.ts +7 -0
  468. package/src/components/credits/creditsBanner/index.tsx +16 -18
  469. package/src/components/credits/creditsBenefits/BenefitItem.tsx +107 -0
  470. package/src/components/credits/creditsBenefits/index.tsx +20 -15
  471. package/src/components/credits/creditsCash/CreditsCash.tsx +84 -0
  472. package/src/components/credits/creditsCash/RedeemableItem.tsx +60 -43
  473. package/src/components/credits/creditsCash/index.ts +2 -0
  474. package/src/components/credits/creditsCash/type.ts +2 -4
  475. package/src/components/credits/creditsFaq/faqItem/FaqItem.tsx +12 -12
  476. package/src/components/credits/creditsFaq/index.tsx +8 -6
  477. package/src/components/credits/creditsInfoCard/index.tsx +42 -36
  478. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +389 -0
  479. package/src/components/credits/creditsMemberPrice/MemberPriceItem.tsx +158 -0
  480. package/src/components/credits/creditsMemberPrice/index.ts +2 -0
  481. package/src/components/credits/creditsMemberPrice/type.ts +75 -0
  482. package/src/components/credits/creditsNavigation/CreditsNavigation.tsx +123 -0
  483. package/src/components/credits/creditsNavigation/index.ts +2 -0
  484. package/src/components/credits/creditsNavigation/type.ts +10 -0
  485. package/src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx +7 -3
  486. package/src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx +5 -1
  487. package/src/components/credits/creditsRedeemList/AddressForm/index.tsx +5 -5
  488. package/src/components/credits/creditsRedeemList/{index.tsx → CreditsRedeemList.tsx} +30 -35
  489. package/src/components/credits/creditsRedeemList/NonProductValue.tsx +39 -0
  490. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +11 -13
  491. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +14 -11
  492. package/src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx +1 -1
  493. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +6 -12
  494. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +25 -0
  495. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -7
  496. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -1
  497. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +4 -5
  498. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +23 -32
  499. package/src/components/credits/creditsRedeemList/index.ts +2 -0
  500. package/src/components/credits/creditsRedeemList/type.ts +2 -16
  501. package/src/components/credits/creditsWaysToGetCredits/{index.tsx → CreditsWaysToGetCredits.tsx} +66 -18
  502. package/src/components/credits/creditsWaysToGetCredits/index.ts +2 -0
  503. package/src/components/credits/creditsWaysToGetCredits/type.ts +5 -16
  504. package/src/components/credits/creditsWaysToGetCredits/useActions.ts +24 -10
  505. package/src/components/credits/modal/MyRewardsModal.tsx +83 -63
  506. package/src/components/credits/modal/activitiesModal.tsx +61 -46
  507. package/src/components/credits/modal/creditsUploadReceiptModal.tsx +9 -1
  508. package/src/components/credits/modal/loadingDots.tsx +9 -7
  509. package/src/components/credits/modal/modalContainer.tsx +5 -1
  510. package/src/components/credits/modal/rulesModal.tsx +1 -1
  511. package/src/components/credits/modal/subscribeModal.tsx +201 -0
  512. package/src/components/credits/modal/tip.tsx +10 -1
  513. package/src/components/credits/type.ts +24 -5
  514. package/src/components/index.ts +2 -2
  515. package/src/components/registration/authCodeActivate/Message.tsx +43 -0
  516. package/src/components/registration/authCodeActivate/index.tsx +338 -0
  517. package/src/components/registration/authCodeActivate/type.ts +23 -0
  518. package/src/components/registration/context/index.tsx +1 -0
  519. package/src/components/registration/context/provider.tsx +86 -0
  520. package/src/components/registration/index.ts +2 -0
  521. package/src/components/registration/modalContainer.tsx +114 -0
  522. package/src/index.ts +2 -4
  523. package/src/styles/global.css +15 -0
  524. package/src/templates/Credits.tsx +165 -0
  525. package/src/templates/index.ts +1 -0
  526. package/style.css +1 -0
  527. package/tailwind.config.ts +10 -0
  528. package/dist/cjs/components/chat/chat-context.d.ts +0 -101
  529. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  530. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  531. package/dist/cjs/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  532. package/dist/cjs/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  533. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js +0 -2
  534. package/dist/cjs/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  535. package/dist/cjs/components/credits/credits-banner/index.d.ts +0 -23
  536. package/dist/cjs/components/credits/credits-banner/index.js +0 -2
  537. package/dist/cjs/components/credits/credits-banner/index.js.map +0 -7
  538. package/dist/cjs/components/credits/credits-benefits/benefitItem.js +0 -2
  539. package/dist/cjs/components/credits/credits-benefits/benefitItem.js.map +0 -7
  540. package/dist/cjs/components/credits/credits-benefits/index.d.ts +0 -12
  541. package/dist/cjs/components/credits/credits-benefits/index.js +0 -4
  542. package/dist/cjs/components/credits/credits-benefits/index.js.map +0 -7
  543. package/dist/cjs/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  544. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js +0 -2
  545. package/dist/cjs/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  546. package/dist/cjs/components/credits/credits-cash/index.d.ts +0 -13
  547. package/dist/cjs/components/credits/credits-cash/index.js +0 -2
  548. package/dist/cjs/components/credits/credits-cash/index.js.map +0 -7
  549. package/dist/cjs/components/credits/credits-cash/type.d.ts +0 -47
  550. package/dist/cjs/components/credits/credits-cash/type.js +0 -2
  551. package/dist/cjs/components/credits/credits-cash/type.js.map +0 -7
  552. package/dist/cjs/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  553. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  554. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  555. package/dist/cjs/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  556. package/dist/cjs/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  557. package/dist/cjs/components/credits/credits-faq/index.d.ts +0 -16
  558. package/dist/cjs/components/credits/credits-faq/index.js +0 -2
  559. package/dist/cjs/components/credits/credits-faq/index.js.map +0 -7
  560. package/dist/cjs/components/credits/credits-info-card/index.d.ts +0 -20
  561. package/dist/cjs/components/credits/credits-info-card/index.js +0 -2
  562. package/dist/cjs/components/credits/credits-info-card/index.js.map +0 -7
  563. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  564. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  565. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  566. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  567. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  568. package/dist/cjs/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  569. package/dist/cjs/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  570. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  571. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  572. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  573. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  574. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  575. package/dist/cjs/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  576. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  577. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  578. package/dist/cjs/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  579. package/dist/cjs/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  580. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  581. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  582. package/dist/cjs/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  583. package/dist/cjs/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  584. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  585. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js +0 -2
  586. package/dist/cjs/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  587. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  588. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  589. package/dist/cjs/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  590. package/dist/cjs/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  591. package/dist/cjs/components/credits/credits-redeem-list/index.d.ts +0 -13
  592. package/dist/cjs/components/credits/credits-redeem-list/index.js +0 -2
  593. package/dist/cjs/components/credits/credits-redeem-list/index.js.map +0 -7
  594. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  595. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  596. package/dist/cjs/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  597. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  598. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  599. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  600. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  601. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  602. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  603. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  604. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  605. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  606. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  607. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  608. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  609. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  610. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  611. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  612. package/dist/cjs/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  613. package/dist/cjs/components/credits/credits-redeem-list/type.d.ts +0 -77
  614. package/dist/cjs/components/credits/credits-redeem-list/type.js.map +0 -7
  615. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  616. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js +0 -2
  617. package/dist/cjs/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  618. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  619. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js +0 -2
  620. package/dist/cjs/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  621. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  622. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  623. package/dist/cjs/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  624. package/dist/cjs/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
  625. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  626. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  627. package/dist/cjs/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  628. package/dist/cjs/helpers/fetchResponse.d.ts +0 -14
  629. package/dist/cjs/helpers/fetchResponse.js +0 -2
  630. package/dist/cjs/helpers/fetchResponse.js.map +0 -7
  631. package/dist/cjs/helpers/fetcher.d.ts +0 -2
  632. package/dist/cjs/helpers/fetcher.js +0 -2
  633. package/dist/cjs/helpers/fetcher.js.map +0 -7
  634. package/dist/cjs/helpers/index.d.ts +0 -2
  635. package/dist/cjs/helpers/index.js +0 -2
  636. package/dist/cjs/helpers/index.js.map +0 -7
  637. package/dist/cjs/helpers/track.d.ts +0 -15
  638. package/dist/cjs/helpers/track.js +0 -2
  639. package/dist/cjs/helpers/track.js.map +0 -7
  640. package/dist/cjs/helpers/utils.d.ts +0 -3
  641. package/dist/cjs/helpers/utils.js +0 -2
  642. package/dist/cjs/helpers/utils.js.map +0 -7
  643. package/dist/cjs/index.css +0 -2
  644. package/dist/cjs/index.css.map +0 -7
  645. package/dist/cjs/shopify/context/ShopifyProvider.d.ts +0 -10
  646. package/dist/cjs/shopify/context/index.d.ts +0 -1
  647. package/dist/cjs/shopify/context/shopify-provider.d.ts +0 -10
  648. package/dist/cjs/shopify/fetchers/create-cart.d.ts +0 -12
  649. package/dist/cjs/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  650. package/dist/cjs/shopify/fetchers/index.d.ts +0 -2
  651. package/dist/cjs/shopify/fragments/article.d.ts +0 -2
  652. package/dist/cjs/shopify/fragments/blog.d.ts +0 -1
  653. package/dist/cjs/shopify/fragments/cart.d.ts +0 -1
  654. package/dist/cjs/shopify/fragments/collection.d.ts +0 -1
  655. package/dist/cjs/shopify/fragments/image.d.ts +0 -1
  656. package/dist/cjs/shopify/fragments/index.d.ts +0 -11
  657. package/dist/cjs/shopify/fragments/metafields.d.ts +0 -2
  658. package/dist/cjs/shopify/fragments/page-info.d.ts +0 -1
  659. package/dist/cjs/shopify/fragments/page.d.ts +0 -1
  660. package/dist/cjs/shopify/fragments/product.d.ts +0 -1
  661. package/dist/cjs/shopify/fragments/seo.d.ts +0 -1
  662. package/dist/cjs/shopify/fragments/variant.d.ts +0 -1
  663. package/dist/cjs/shopify/gql/fragment-masking.d.ts +0 -15
  664. package/dist/cjs/shopify/gql/gql.d.ts +0 -87
  665. package/dist/cjs/shopify/gql/graphql.d.ts +0 -7669
  666. package/dist/cjs/shopify/gql/index.d.ts +0 -3
  667. package/dist/cjs/shopify/hooks/index.d.ts +0 -2
  668. package/dist/cjs/shopify/hooks/use-create-cart.d.ts +0 -2
  669. package/dist/cjs/shopify/hooks/use-products-by-handles.d.ts +0 -4
  670. package/dist/cjs/shopify/hooks/useCreateCart.d.ts +0 -2
  671. package/dist/cjs/shopify/hooks/useProductsByHandles.d.ts +0 -4
  672. package/dist/cjs/shopify/mutations/create-cart.d.ts +0 -1
  673. package/dist/cjs/shopify/queries/get-product-by-handles.d.ts +0 -1
  674. package/dist/cjs/shopify/queries/index.d.ts +0 -1
  675. package/dist/cjs/shopify/src/index.d.ts +0 -5
  676. package/dist/cjs/shopify/tsup.config.d.ts +0 -2
  677. package/dist/cjs/shopify/types/article.d.ts +0 -48
  678. package/dist/cjs/shopify/types/cart.d.ts +0 -173
  679. package/dist/cjs/shopify/types/checkout.d.ts +0 -42
  680. package/dist/cjs/shopify/types/collection.d.ts +0 -122
  681. package/dist/cjs/shopify/types/common.d.ts +0 -42
  682. package/dist/cjs/shopify/types/config.d.ts +0 -12
  683. package/dist/cjs/shopify/types/customer.d.ts +0 -30
  684. package/dist/cjs/shopify/types/fetcher.d.ts +0 -38
  685. package/dist/cjs/shopify/types/index.d.ts +0 -12
  686. package/dist/cjs/shopify/types/page.d.ts +0 -33
  687. package/dist/cjs/shopify/types/product.d.ts +0 -174
  688. package/dist/cjs/shopify/types/search.d.ts +0 -54
  689. package/dist/cjs/shopify/types/site.d.ts +0 -33
  690. package/dist/cjs/shopify/types/type-helper.d.ts +0 -5
  691. package/dist/cjs/shopify/utils/colors.d.ts +0 -3
  692. package/dist/cjs/shopify/utils/const.d.ts +0 -76
  693. package/dist/cjs/shopify/utils/cookie.d.ts +0 -15
  694. package/dist/cjs/shopify/utils/errors.d.ts +0 -38
  695. package/dist/cjs/shopify/utils/fetch-graphql-api.d.ts +0 -19
  696. package/dist/cjs/shopify/utils/handle-fetch-response.d.ts +0 -5
  697. package/dist/cjs/shopify/utils/helper.d.ts +0 -28
  698. package/dist/cjs/shopify/utils/normalize/cart.d.ts +0 -7
  699. package/dist/cjs/shopify/utils/normalize/customer.d.ts +0 -3
  700. package/dist/cjs/shopify/utils/normalize/index.d.ts +0 -2
  701. package/dist/cjs/shopify/utils/normalize/metafield.d.ts +0 -5
  702. package/dist/cjs/shopify/utils/normalize/product.d.ts +0 -16
  703. package/dist/cjs/shopify/utils/store.d.ts +0 -2
  704. package/dist/cjs/shopify/utils/type-helper.d.ts +0 -5
  705. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  706. package/dist/esm/components/chat/chat-context.d.ts +0 -101
  707. package/dist/esm/components/chat/chat-context.js +0 -2
  708. package/dist/esm/components/chat/chat-context.js.map +0 -7
  709. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.d.ts +0 -1
  710. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js +0 -2
  711. package/dist/esm/components/credits/context/hooks/useSendEmailValidation.js.map +0 -7
  712. package/dist/esm/components/credits/context/hooks/useSubscriptions.d.ts +0 -5
  713. package/dist/esm/components/credits/context/hooks/useSubscriptions.js +0 -2
  714. package/dist/esm/components/credits/context/hooks/useSubscriptions.js.map +0 -7
  715. package/dist/esm/components/credits/credits-banner/index.d.ts +0 -23
  716. package/dist/esm/components/credits/credits-banner/index.js +0 -2
  717. package/dist/esm/components/credits/credits-banner/index.js.map +0 -7
  718. package/dist/esm/components/credits/credits-benefits/benefitItem.js +0 -2
  719. package/dist/esm/components/credits/credits-benefits/benefitItem.js.map +0 -7
  720. package/dist/esm/components/credits/credits-benefits/iconInfo.d.ts +0 -2
  721. package/dist/esm/components/credits/credits-benefits/iconInfo.js.map +0 -7
  722. package/dist/esm/components/credits/credits-benefits/index.d.ts +0 -12
  723. package/dist/esm/components/credits/credits-benefits/index.js +0 -4
  724. package/dist/esm/components/credits/credits-benefits/index.js.map +0 -7
  725. package/dist/esm/components/credits/credits-cash/RedeemableItem.d.ts +0 -15
  726. package/dist/esm/components/credits/credits-cash/RedeemableItem.js +0 -2
  727. package/dist/esm/components/credits/credits-cash/RedeemableItem.js.map +0 -7
  728. package/dist/esm/components/credits/credits-cash/index.d.ts +0 -13
  729. package/dist/esm/components/credits/credits-cash/index.js +0 -2
  730. package/dist/esm/components/credits/credits-cash/index.js.map +0 -7
  731. package/dist/esm/components/credits/credits-cash/type.d.ts +0 -47
  732. package/dist/esm/components/credits/credits-faq/faq-item/FaqItem.d.ts +0 -13
  733. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.d.ts +0 -13
  734. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js +0 -2
  735. package/dist/esm/components/credits/credits-faq/faq-item/faq-item.js.map +0 -7
  736. package/dist/esm/components/credits/credits-faq/faqItem/FaqItem.d.ts +0 -13
  737. package/dist/esm/components/credits/credits-faq/index.d.ts +0 -16
  738. package/dist/esm/components/credits/credits-faq/index.js +0 -2
  739. package/dist/esm/components/credits/credits-faq/index.js.map +0 -7
  740. package/dist/esm/components/credits/credits-info-card/index.d.ts +0 -20
  741. package/dist/esm/components/credits/credits-info-card/index.js +0 -2
  742. package/dist/esm/components/credits/credits-info-card/index.js.map +0 -7
  743. package/dist/esm/components/credits/credits-redeem-list/AddressForm/Input.d.ts +0 -13
  744. package/dist/esm/components/credits/credits-redeem-list/AddressForm/country-select.d.ts +0 -14
  745. package/dist/esm/components/credits/credits-redeem-list/AddressForm/form-item.d.ts +0 -6
  746. package/dist/esm/components/credits/credits-redeem-list/AddressForm/index.d.ts +0 -2
  747. package/dist/esm/components/credits/credits-redeem-list/AddressForm/state-select.d.ts +0 -15
  748. package/dist/esm/components/credits/credits-redeem-list/AddressForm/type.d.ts +0 -26
  749. package/dist/esm/components/credits/credits-redeem-list/RedeemCouponModal.d.ts +0 -9
  750. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Address.d.ts +0 -20
  751. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Error.d.ts +0 -8
  752. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Init.d.ts +0 -11
  753. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/ProductInfo.d.ts +0 -8
  754. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/Success.d.ts +0 -13
  755. package/dist/esm/components/credits/credits-redeem-list/RedeemProductModal/index.d.ts +0 -11
  756. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.d.ts +0 -9
  757. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js +0 -2
  758. package/dist/esm/components/credits/credits-redeem-list/RedeemableItem.js.map +0 -7
  759. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.d.ts +0 -13
  760. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js +0 -2
  761. package/dist/esm/components/credits/credits-redeem-list/address-form/Input.js.map +0 -7
  762. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.d.ts +0 -14
  763. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js +0 -2
  764. package/dist/esm/components/credits/credits-redeem-list/address-form/country-select.js.map +0 -7
  765. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.d.ts +0 -6
  766. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js +0 -2
  767. package/dist/esm/components/credits/credits-redeem-list/address-form/form-item.js.map +0 -7
  768. package/dist/esm/components/credits/credits-redeem-list/address-form/index.d.ts +0 -2
  769. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js +0 -2
  770. package/dist/esm/components/credits/credits-redeem-list/address-form/index.js.map +0 -7
  771. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.d.ts +0 -15
  772. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js +0 -2
  773. package/dist/esm/components/credits/credits-redeem-list/address-form/state-select.js.map +0 -7
  774. package/dist/esm/components/credits/credits-redeem-list/address-form/type.d.ts +0 -26
  775. package/dist/esm/components/credits/credits-redeem-list/index.d.ts +0 -13
  776. package/dist/esm/components/credits/credits-redeem-list/index.js +0 -2
  777. package/dist/esm/components/credits/credits-redeem-list/index.js.map +0 -7
  778. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.d.ts +0 -9
  779. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js +0 -2
  780. package/dist/esm/components/credits/credits-redeem-list/redeem-coupon-modal.js.map +0 -7
  781. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.d.ts +0 -20
  782. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js +0 -2
  783. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Address.js.map +0 -7
  784. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.d.ts +0 -8
  785. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js +0 -2
  786. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Error.js.map +0 -7
  787. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.d.ts +0 -11
  788. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js +0 -2
  789. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Init.js.map +0 -7
  790. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.d.ts +0 -8
  791. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js +0 -2
  792. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/ProductInfo.js.map +0 -7
  793. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.d.ts +0 -13
  794. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js +0 -2
  795. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/Success.js.map +0 -7
  796. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.d.ts +0 -11
  797. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js +0 -2
  798. package/dist/esm/components/credits/credits-redeem-list/redeem-product-modal/index.js.map +0 -7
  799. package/dist/esm/components/credits/credits-redeem-list/type.d.ts +0 -77
  800. package/dist/esm/components/credits/credits-ways-to-get-credits/index.d.ts +0 -2
  801. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js +0 -2
  802. package/dist/esm/components/credits/credits-ways-to-get-credits/index.js.map +0 -7
  803. package/dist/esm/components/credits/credits-ways-to-get-credits/type.d.ts +0 -60
  804. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js +0 -2
  805. package/dist/esm/components/credits/credits-ways-to-get-credits/type.js.map +0 -7
  806. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.d.ts +0 -96
  807. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js +0 -2
  808. package/dist/esm/components/credits/credits-ways-to-get-credits/useActions.js.map +0 -7
  809. package/dist/esm/components/credits/creditsBenefits/benefitItem.d.ts +0 -19
  810. package/dist/esm/components/credits/creditsBenefits/benefitItem.js +0 -2
  811. package/dist/esm/components/credits/creditsBenefits/benefitItem.js.map +0 -7
  812. package/dist/esm/components/credits/creditsBenefits/iconInfo.d.ts +0 -2
  813. package/dist/esm/components/credits/creditsBenefits/iconInfo.js +0 -2
  814. package/dist/esm/components/credits/creditsRedeemList/AddressForm/country-select.d.ts +0 -14
  815. package/dist/esm/components/credits/creditsRedeemList/AddressForm/form-item.d.ts +0 -6
  816. package/dist/esm/components/credits/creditsRedeemList/AddressForm/state-select.d.ts +0 -15
  817. package/dist/esm/helpers/fetchResponse.d.ts +0 -14
  818. package/dist/esm/helpers/fetchResponse.js +0 -2
  819. package/dist/esm/helpers/fetchResponse.js.map +0 -7
  820. package/dist/esm/helpers/fetcher.d.ts +0 -2
  821. package/dist/esm/helpers/fetcher.js +0 -2
  822. package/dist/esm/helpers/fetcher.js.map +0 -7
  823. package/dist/esm/helpers/index.d.ts +0 -2
  824. package/dist/esm/helpers/index.js +0 -2
  825. package/dist/esm/helpers/index.js.map +0 -7
  826. package/dist/esm/helpers/track.d.ts +0 -15
  827. package/dist/esm/helpers/track.js +0 -2
  828. package/dist/esm/helpers/track.js.map +0 -7
  829. package/dist/esm/helpers/utils.d.ts +0 -3
  830. package/dist/esm/helpers/utils.js +0 -2
  831. package/dist/esm/helpers/utils.js.map +0 -7
  832. package/dist/esm/index.css +0 -2
  833. package/dist/esm/index.css.map +0 -7
  834. package/dist/esm/shopify/context/ShopifyProvider.d.ts +0 -10
  835. package/dist/esm/shopify/context/index.d.ts +0 -1
  836. package/dist/esm/shopify/context/shopify-provider.d.ts +0 -10
  837. package/dist/esm/shopify/fetchers/create-cart.d.ts +0 -12
  838. package/dist/esm/shopify/fetchers/get-products-by-handles.d.ts +0 -7
  839. package/dist/esm/shopify/fetchers/index.d.ts +0 -2
  840. package/dist/esm/shopify/fragments/article.d.ts +0 -2
  841. package/dist/esm/shopify/fragments/blog.d.ts +0 -1
  842. package/dist/esm/shopify/fragments/cart.d.ts +0 -1
  843. package/dist/esm/shopify/fragments/collection.d.ts +0 -1
  844. package/dist/esm/shopify/fragments/image.d.ts +0 -1
  845. package/dist/esm/shopify/fragments/index.d.ts +0 -11
  846. package/dist/esm/shopify/fragments/metafields.d.ts +0 -2
  847. package/dist/esm/shopify/fragments/page-info.d.ts +0 -1
  848. package/dist/esm/shopify/fragments/page.d.ts +0 -1
  849. package/dist/esm/shopify/fragments/product.d.ts +0 -1
  850. package/dist/esm/shopify/fragments/seo.d.ts +0 -1
  851. package/dist/esm/shopify/fragments/variant.d.ts +0 -1
  852. package/dist/esm/shopify/gql/fragment-masking.d.ts +0 -15
  853. package/dist/esm/shopify/gql/gql.d.ts +0 -87
  854. package/dist/esm/shopify/gql/graphql.d.ts +0 -7669
  855. package/dist/esm/shopify/gql/index.d.ts +0 -3
  856. package/dist/esm/shopify/hooks/index.d.ts +0 -2
  857. package/dist/esm/shopify/hooks/use-create-cart.d.ts +0 -2
  858. package/dist/esm/shopify/hooks/use-products-by-handles.d.ts +0 -4
  859. package/dist/esm/shopify/hooks/useCreateCart.d.ts +0 -2
  860. package/dist/esm/shopify/hooks/useProductsByHandles.d.ts +0 -4
  861. package/dist/esm/shopify/mutations/create-cart.d.ts +0 -1
  862. package/dist/esm/shopify/queries/get-product-by-handles.d.ts +0 -1
  863. package/dist/esm/shopify/queries/index.d.ts +0 -1
  864. package/dist/esm/shopify/src/index.d.ts +0 -5
  865. package/dist/esm/shopify/tsup.config.d.ts +0 -2
  866. package/dist/esm/shopify/types/article.d.ts +0 -48
  867. package/dist/esm/shopify/types/cart.d.ts +0 -173
  868. package/dist/esm/shopify/types/checkout.d.ts +0 -42
  869. package/dist/esm/shopify/types/collection.d.ts +0 -122
  870. package/dist/esm/shopify/types/common.d.ts +0 -42
  871. package/dist/esm/shopify/types/config.d.ts +0 -12
  872. package/dist/esm/shopify/types/customer.d.ts +0 -30
  873. package/dist/esm/shopify/types/fetcher.d.ts +0 -38
  874. package/dist/esm/shopify/types/index.d.ts +0 -12
  875. package/dist/esm/shopify/types/page.d.ts +0 -33
  876. package/dist/esm/shopify/types/product.d.ts +0 -174
  877. package/dist/esm/shopify/types/search.d.ts +0 -54
  878. package/dist/esm/shopify/types/site.d.ts +0 -33
  879. package/dist/esm/shopify/types/type-helper.d.ts +0 -5
  880. package/dist/esm/shopify/utils/colors.d.ts +0 -3
  881. package/dist/esm/shopify/utils/const.d.ts +0 -76
  882. package/dist/esm/shopify/utils/cookie.d.ts +0 -15
  883. package/dist/esm/shopify/utils/errors.d.ts +0 -38
  884. package/dist/esm/shopify/utils/fetch-graphql-api.d.ts +0 -19
  885. package/dist/esm/shopify/utils/handle-fetch-response.d.ts +0 -5
  886. package/dist/esm/shopify/utils/helper.d.ts +0 -28
  887. package/dist/esm/shopify/utils/normalize/cart.d.ts +0 -7
  888. package/dist/esm/shopify/utils/normalize/customer.d.ts +0 -3
  889. package/dist/esm/shopify/utils/normalize/index.d.ts +0 -2
  890. package/dist/esm/shopify/utils/normalize/metafield.d.ts +0 -5
  891. package/dist/esm/shopify/utils/normalize/product.d.ts +0 -16
  892. package/dist/esm/shopify/utils/store.d.ts +0 -2
  893. package/dist/esm/shopify/utils/type-helper.d.ts +0 -5
  894. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  895. package/src/components/credits/context/hooks/useSendEmailValidation.ts +0 -20
  896. package/src/components/credits/context/hooks/useSubscriptions.ts +0 -54
  897. package/src/components/credits/creditsBenefits/benefitItem.tsx +0 -73
  898. package/src/components/credits/creditsCash/index.tsx +0 -102
  899. package/src/helpers/fetchResponse.ts +0 -35
  900. package/src/helpers/fetcher.ts +0 -44
  901. package/src/helpers/index.ts +0 -2
  902. package/src/helpers/track.ts +0 -55
  903. package/src/helpers/utils.ts +0 -8
  904. /package/dist/cjs/components/credits/{credits-benefits/iconInfo.d.ts → creditsBenefits/IconInfo.d.ts} +0 -0
  905. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/Input.js +0 -0
  906. /package/dist/cjs/components/credits/{credits-redeem-list/address-form → creditsRedeemList/AddressForm}/type.js +0 -0
  907. /package/dist/cjs/components/credits/{credits-redeem-list → creditsRedeemList}/type.js +0 -0
  908. /package/dist/esm/components/credits/{credits-cash/type.js.map → context/memberPriceTypes.js.map} +0 -0
  909. /package/dist/{cjs/components/credits/creditsBenefits/iconInfo.d.ts → esm/components/credits/creditsBenefits/IconInfo.d.ts} +0 -0
  910. /package/dist/esm/components/credits/{credits-cash → creditsMemberPrice}/type.js +0 -0
  911. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsMemberPrice}/type.js.map +0 -0
  912. /package/dist/esm/components/credits/{credits-redeem-list/address-form → creditsNavigation}/type.js +0 -0
  913. /package/dist/esm/components/credits/{credits-redeem-list → creditsNavigation}/type.js.map +0 -0
  914. /package/dist/esm/components/{credits/credits-redeem-list → registration/authCodeActivate}/type.js +0 -0
  915. /package/src/components/credits/creditsBenefits/{iconInfo.tsx → IconInfo.tsx} +0 -0
@@ -0,0 +1,7 @@
1
+ export type NavigationItem = {
2
+ label: string;
3
+ targetId: string;
4
+ };
5
+ export type CreditsNavigationCopy = {
6
+ items: NavigationItem[];
7
+ };
@@ -1,2 +1,2 @@
1
- import{jsx as o,jsxs as c}from"react/jsx-runtime";import{Picture as x}from"@anker-in/headless-ui";import b from"../../context/hooks/useClickOutside";import s from"classnames";import{useEffect as v,useState as p}from"react";function w({countries:t,loading:d,className:r,value:n,onChange:i}){const[u,l]=p(!1),[f,a]=p(""),g=b(()=>{l(!1)});return v(()=>{const e=t.filter(m=>m.code===n);e.length&&a(e[0].name)},[a,t,n]),c("div",{className:"relative",children:[o("select",{className:s("!h-[50px] pr-[45px] min-l:hidden",r),style:{WebkitTextFillColor:"black"},disabled:d,value:n,onChange:e=>{i(e.target.value)},children:t.map(e=>o("option",{value:e.code,children:e.name},e.code))}),o("div",{className:s("absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block",r),onClick:()=>{l(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:f}),o(x,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",imgClassName:"pointer-events-none absolute right-0 top-0 bottom-0 !w-[45px] object-cover",alt:"arrow"}),o("div",{ref:g,className:s("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto rounded-[4px] bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",{"!hidden":!u}),children:o("ul",{className:"py-[6px]",children:t.map(e=>c("li",{value:e.code,className:s("relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]",{"!bg-[#EAEAEC]":e.code===n}),children:[o("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:e.code,onClick:()=>{a(e.name),l(!1),i(e.code)}}),e.name]},e.code))})})]})}export{w as CountrySelect};
1
+ import{jsx as o,jsxs as p}from"react/jsx-runtime";import{Picture as v}from"@anker-in/headless-ui";import y from"../../context/hooks/useClickOutside";import s from"classnames";import{useEffect as h,useState as c}from"react";import{useHeadlessContext as C,ROUNDED_BRANDS as N}from"@anker-in/lib";function A({countries:t,loading:u,className:a,value:n,onChange:i}){const[f,l]=c(!1),[m,r]=c(""),{brand:g}=C(),d=N.includes(g),x=y(()=>{l(!1)});return h(()=>{const e=t.filter(b=>b.code===n);e.length&&r(e[0].name)},[r,t,n]),p("div",{className:"relative",children:[o("select",{className:s("!h-[50px] pr-[45px] min-l:hidden",a),style:{WebkitTextFillColor:"black"},disabled:u,value:n,onChange:e=>{i(e.target.value)},children:t.map(e=>o("option",{value:e.code,children:e.name},e.code))}),o("div",{className:s("absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block",!d&&"rounded-none",a),onClick:()=>{l(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:m}),o(v,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",className:"absolute pointer-events-none right-0 top-0 bottom-0 size-[50px] object-cover",alt:"arrow"}),o("div",{ref:x,className:s("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",!d&&"rounded-none",{"!hidden":!f}),children:o("ul",{className:"py-[6px]",children:t.map(e=>p("li",{value:e.code,className:s("relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]",{"!bg-[#EAEAEC]":e.code===n}),children:[o("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:e.code,onClick:()=>{r(e.name),l(!1),i(e.code)}}),e.name]},e.code))})})]})}export{A as CountrySelect};
2
2
  //# sourceMappingURL=CountrySelect.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/CountrySelect.tsx"],
4
- "sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport useClickOutside from '../../context/hooks/useClickOutside'\nimport classNames from 'classnames'\nimport { useEffect, useState } from 'react'\n\ninterface Country {\n id: string\n code: string\n name: string\n}\n\ninterface CountrySelectProps {\n countries: Country[]\n loading?: boolean\n className?: string\n value?: string\n onChange: (code: string) => void\n}\n\nexport function CountrySelect({ countries, loading, className, value, onChange }: CountrySelectProps) {\n const [show, setShow] = useState(false)\n const [display, setDisplay] = useState<any>('')\n\n const dorpdown = useClickOutside<HTMLDivElement>(() => {\n setShow(false)\n })\n\n useEffect(() => {\n const target = countries.filter(item => item.code === value)\n if (target.length) setDisplay(target[0].name)\n }, [setDisplay, countries, value])\n\n return (\n <div className=\"relative\">\n <select\n className={classNames('!h-[50px] pr-[45px] min-l:hidden', className)}\n style={{\n WebkitTextFillColor: 'black',\n }}\n disabled={loading}\n value={value}\n onChange={event => {\n onChange(event.target.value)\n }}\n >\n {countries.map((item: { id: string; name: string; code: string }) => (\n <option key={item.code} value={item.code}>\n {item.name}\n </option>\n ))}\n </select>\n\n <div\n className={classNames(\n 'absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block',\n className\n )}\n onClick={() => {\n setShow(true)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {display}\n </div>\n\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500\"\n imgClassName=\"pointer-events-none absolute right-0 top-0 bottom-0 !w-[45px] object-cover\"\n alt=\"arrow\"\n />\n\n <div\n ref={dorpdown}\n className={classNames(\n 'absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto rounded-[4px] bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n { '!hidden': !show }\n )}\n >\n <ul className=\"py-[6px]\">\n {countries.map((item: { id: string; name: string; code: string }) => (\n <li\n key={item.code}\n value={item.code}\n className={classNames(\n 'relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]',\n { '!bg-[#EAEAEC]': item.code === value }\n )}\n >\n <button\n className=\"absolute left-0 top-0 z-1 size-full opacity-0\"\n value={item.code}\n onClick={() => {\n setDisplay(item.name)\n setShow(false)\n onChange(item.code)\n }}\n />\n {item.name}\n </li>\n ))}\n </ul>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "AA8CU,cAAAA,EAwCE,QAAAC,MAxCF,oBA9CV,OAAS,WAAAC,MAAe,wBACxB,OAAOC,MAAqB,sCAC5B,OAAOC,MAAgB,aACvB,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QAgB7B,SAASC,EAAc,CAAE,UAAAC,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AOmB,EAAK,KACZ,QAAS,IAAM,CACbH,EAAWG,EAAK,IAAI,EACpBL,EAAQ,EAAK,EACbF,EAASO,EAAK,IAAI,CACpB,EACF,EACCA,EAAK,OAhBDA,EAAK,IAiBZ,CACD,EACH,EACF,GACF,CAEJ",
6
- "names": ["jsx", "jsxs", "Picture", "useClickOutside", "classNames", "useEffect", "useState", "CountrySelect", "countries", "loading", "className", "value", "onChange", "show", "setShow", "display", "setDisplay", "dorpdown", "target", "item", "event"]
4
+ "sourcesContent": ["import { Picture } from '@anker-in/headless-ui'\nimport useClickOutside from '../../context/hooks/useClickOutside'\nimport classNames from 'classnames'\nimport { useEffect, useState } from 'react'\nimport { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\n\ninterface Country {\n id: string\n code: string\n name: string\n}\n\ninterface CountrySelectProps {\n countries: Country[]\n loading?: boolean\n className?: string\n value?: string\n onChange: (code: string) => void\n}\n\nexport function CountrySelect({ countries, loading, className, value, onChange }: CountrySelectProps) {\n const [show, setShow] = useState(false)\n const [display, setDisplay] = useState<any>('')\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const dorpdown = useClickOutside<HTMLDivElement>(() => {\n setShow(false)\n })\n\n useEffect(() => {\n const target = countries.filter(item => item.code === value)\n if (target.length) setDisplay(target[0].name)\n }, [setDisplay, countries, value])\n\n return (\n <div className=\"relative\">\n <select\n className={classNames('!h-[50px] pr-[45px] min-l:hidden', className)}\n style={{\n WebkitTextFillColor: 'black',\n }}\n disabled={loading}\n value={value}\n onChange={event => {\n onChange(event.target.value)\n }}\n >\n {countries.map((item: { id: string; name: string; code: string }) => (\n <option key={item.code} value={item.code}>\n {item.name}\n </option>\n ))}\n </select>\n\n <div\n className={classNames(\n 'absolute left-0 top-0 hidden !h-[50px] rounded-[2px] pr-[45px] text-[16px] font-bold focus:!border-[#6D6D6F] min-l:!block',\n !rounded && 'rounded-none',\n className\n )}\n onClick={() => {\n setShow(true)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {display}\n </div>\n\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500\"\n className=\"absolute pointer-events-none right-0 top-0 bottom-0 size-[50px] object-cover\"\n alt=\"arrow\"\n />\n\n <div\n ref={dorpdown}\n className={classNames(\n 'absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n !rounded && 'rounded-none',\n { '!hidden': !show }\n )}\n >\n <ul className=\"py-[6px]\">\n {countries.map((item: { id: string; name: string; code: string }) => (\n <li\n key={item.code}\n value={item.code}\n className={classNames(\n 'relative px-[14px] py-[17px] text-[16px] font-bold leading-[1] transition hover:bg-[#EAEAEC]',\n { '!bg-[#EAEAEC]': item.code === value }\n )}\n >\n <button\n className=\"absolute left-0 top-0 z-1 size-full opacity-0\"\n value={item.code}\n onClick={() => {\n setDisplay(item.name)\n setShow(false)\n onChange(item.code)\n }}\n />\n {item.name}\n </li>\n ))}\n </ul>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAgDU,cAAAA,EA0CE,QAAAC,MA1CF,oBAhDV,OAAS,WAAAC,MAAe,wBACxB,OAAOC,MAAqB,sCAC5B,OAAOC,MAAgB,aACvB,OAAS,aAAAC,EAAW,YAAAC,MAAgB,QACpC,OAAS,sBAAAC,EAAoB,kBAAAC,MAAsB,gBAgB5C,SAASC,EAAc,CAAE,UAAAC,EAAW,QAAAC,EAAS,UAAAC,EAAW,MAAAC,EAAO,SAAAC,CAAS,EAAuB,CACpG,KAAM,CAACC,EAAMC,CAAO,EAAIV,EAAS,EAAK,EAChC,CAACW,EAASC,CAAU,EAAIZ,EAAc,EAAE,EACxC,CAAE,MAAAa,CAAM,EAAIZ,EAAmB,EAC/Ba,EAAUZ,EAAe,SAASW,CAAK,EACvCE,E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,OAhBDA,EAAK,IAiBZ,CACD,EACH,EACF,GACF,CAEJ",
6
+ "names": ["jsx", "jsxs", "Picture", "useClickOutside", "classNames", "useEffect", "useState", "useHeadlessContext", "ROUNDED_BRANDS", "CountrySelect", "countries", "loading", "className", "value", "onChange", "show", "setShow", "display", "setDisplay", "brand", "rounded", "dorpdown", "target", "item", "event"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as w,jsx as n,jsxs as f}from"react/jsx-runtime";import a from"classnames";import{Picture as h}from"@anker-in/headless-ui";import{useEffect as b,useMemo as y,useState as u}from"react";import k from"../../context/hooks/useClickOutside";function F({states:t,stateName:i="",stateCode:s="",className:r="",onChange:c}){const[g,d]=u(!1),[v,p]=u(""),x=k(()=>{d(!1)}),l=y(()=>{const e=t.find(o=>s?o.code===s:o.name===i);return e?[e?.id,e?.name,e?.code].join(","):""},[t,s,i]);return b(()=>{const e=t.filter(o=>[o.id,o.name,o.code].join(",")===l);e.length&&p(e[0].name)},[p,t,l]),n("div",{className:"relative h-full",children:t.length?f(w,{children:[n("select",{className:a("h-[52px] pr-[45px] min-l:hidden",r),value:l,style:{WebkitTextFillColor:l?"black":"#666"},onChange:e=>{const[,o,m]=e.target.value.split(",");c(m,o)},children:t.map(e=>n("option",{value:[e.id,e.name,e.code].join(","),children:e.name},e.id))}),n("div",{className:a("absolute left-0 top-0 hidden h-[52px] pr-[45px] min-l:!block",r),onClick:()=>{d(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:v}),n(h,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",className:"pointer-events-none absolute right-0 top-1/2 h-[45px] !w-[45px] -translate-y-1/2 object-cover",alt:"arrow"}),n("div",{ref:x,className:a("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto rounded-[4px] bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",{"!hidden":!g}),children:n("ul",{className:"py-[6px]",children:t.map(e=>f("li",{value:[e.id,e.name,e.code].join(","),className:a("relative px-[14px] py-[17px] text-[16px] font-semibold leading-[1] transition hover:bg-[#F7F8F9]",{"!bg-[#e8e8e8]":[e.id,e.name,e.code].join(",")===l}),children:[n("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:[e.id,e.name,e.code].join(","),onClick:()=>{p(e.name),d(!1),c(e.code,e.name)}}),e.name]},e.id))})})]}):n("input",{className:r,value:i,style:{WebkitTextFillColor:"black"},onChange:e=>{c("",e.target.value)}})})}export{F as StateSelect};
1
+ import{Fragment as D,jsx as n,jsxs as f}from"react/jsx-runtime";import a from"classnames";import{Picture as y}from"@anker-in/headless-ui";import{useEffect as k,useMemo as w,useState as u}from"react";import N from"../../context/hooks/useClickOutside";import{useHeadlessContext as S,ROUNDED_BRANDS as C}from"@anker-in/lib";function P({states:t,stateName:s="",stateCode:i="",className:r="",onChange:c}){const[g,d]=u(!1),[v,p]=u(""),{brand:m}=S(),x=C.includes(m),b=N(()=>{d(!1)}),l=w(()=>{const e=t.find(o=>i?o.code===i:o.name===s);return e?[e?.id,e?.name,e?.code].join(","):""},[t,i,s]);return k(()=>{const e=t.filter(o=>[o.id,o.name,o.code].join(",")===l);e.length&&p(e[0].name)},[p,t,l]),n("div",{className:"relative h-full",children:t.length?f(D,{children:[n("select",{className:a("h-[52px] pr-[45px] min-l:hidden",r),value:l,style:{WebkitTextFillColor:l?"black":"#666"},onChange:e=>{const[,o,h]=e.target.value.split(",");c(h,o)},children:t.map(e=>n("option",{value:[e.id,e.name,e.code].join(","),children:e.name},e.id))}),n("div",{className:a("absolute left-0 top-0 hidden h-[52px] pr-[45px] min-l:!block",r),onClick:()=>{d(!0)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:v}),n(y,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500",className:"pointer-events-none absolute right-0 top-1/2 h-[45px] !w-[45px] -translate-y-1/2 object-cover",alt:"arrow"}),n("div",{ref:b,className:a("absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",!x&&"rounded-none",{"!hidden":!g}),children:n("ul",{className:"py-[6px]",children:t.map(e=>f("li",{value:[e.id,e.name,e.code].join(","),className:a("relative px-[14px] py-[17px] text-[16px] font-semibold leading-[1] transition hover:bg-[#F7F8F9]",{"!bg-[#e8e8e8]":[e.id,e.name,e.code].join(",")===l}),children:[n("button",{className:"absolute left-0 top-0 z-1 size-full opacity-0",value:[e.id,e.name,e.code].join(","),onClick:()=>{p(e.name),d(!1),c(e.code,e.name)}}),e.name]},e.id))})})]}):n("input",{className:r,value:s,style:{WebkitTextFillColor:"black"},onChange:e=>{c("",e.target.value)}})})}export{P as StateSelect};
2
2
  //# sourceMappingURL=StateSelect.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/StateSelect.tsx"],
4
- "sourcesContent": ["import classNames from 'classnames'\nimport { Picture } from '@anker-in/headless-ui'\nimport { useEffect, useMemo, useState } from 'react'\nimport useClickOutside from '../../context/hooks/useClickOutside'\n\ninterface StateSelectProps {\n states: { code: string; id: string; name: string }[]\n className?: string\n countryId?: string\n defaultCode?: string\n stateName?: string\n stateCode?: string\n onChange: (code: string, name: string) => void\n}\n\nexport function StateSelect({ states, stateName = '', stateCode = '', className = '', onChange }: StateSelectProps) {\n const [show, setShow] = useState(false)\n const [display, setDisplay] = useState<any>('')\n\n const dropdown = useClickOutside<HTMLDivElement>(() => {\n setShow(false)\n })\n\n const value = useMemo(() => {\n const currentState = states.find(item => (stateCode ? item.code === stateCode : item.name === stateName))\n\n return currentState ? [currentState?.id, currentState?.name, currentState?.code].join(',') : ''\n }, [states, stateCode, stateName])\n\n useEffect(() => {\n const target = states.filter(item => [item.id, item.name, item.code].join(',') === value)\n if (target.length) setDisplay(target[0].name)\n }, [setDisplay, states, value])\n\n return (\n <div className=\"relative h-full\">\n {states.length ? (\n <>\n <select\n className={classNames('h-[52px] pr-[45px] min-l:hidden', className)}\n value={value}\n style={{\n WebkitTextFillColor: value ? 'black' : '#666',\n }}\n onChange={event => {\n const [, name, code] = event.target.value.split(',')\n onChange(code, name)\n }}\n >\n {states.map((item: { id: string; name: string; code: string }) => (\n <option key={item.id} value={[item.id, item.name, item.code].join(',')}>\n {item.name}\n </option>\n ))}\n </select>\n <div\n className={classNames('absolute left-0 top-0 hidden h-[52px] pr-[45px] min-l:!block', className)}\n onClick={() => {\n setShow(true)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {display}\n </div>\n\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500\"\n className=\"pointer-events-none absolute right-0 top-1/2 h-[45px] !w-[45px] -translate-y-1/2 object-cover\"\n alt=\"arrow\"\n />\n\n <div\n ref={dropdown}\n className={classNames(\n 'absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto rounded-[4px] bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n { '!hidden': !show }\n )}\n >\n <ul className=\"py-[6px]\">\n {states.map((item: { id: string; name: string; code: string }) => (\n <li\n key={item.id}\n value={[item.id, item.name, item.code].join(',')}\n className={classNames(\n 'relative px-[14px] py-[17px] text-[16px] font-semibold leading-[1] transition hover:bg-[#F7F8F9]',\n {\n '!bg-[#e8e8e8]': [item.id, item.name, item.code].join(',') === value,\n }\n )}\n >\n <button\n className=\"absolute left-0 top-0 z-1 size-full opacity-0\"\n value={[item.id, item.name, item.code].join(',')}\n onClick={() => {\n setDisplay(item.name)\n setShow(false)\n onChange(item.code, item.name)\n }}\n />\n {item.name}\n </li>\n ))}\n </ul>\n </div>\n </>\n ) : (\n <input\n className={className}\n value={stateName}\n style={{\n WebkitTextFillColor: 'black',\n }}\n onChange={event => {\n onChange('', event.target.value)\n }}\n ></input>\n )}\n </div>\n )\n}\n"],
5
- "mappings": "AAqCQ,mBAAAA,EAaM,OAAAC,EAoCE,QAAAC,MAjDR,oBArCR,OAAOC,MAAgB,aACvB,OAAS,WAAAC,MAAe,wBACxB,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC7C,OAAOC,MAAqB,sCAYrB,SAASC,EAAY,CAAE,OAAAC,EAAQ,UAAAC,EAAY,GAAI,UAAAC,EAAY,GAAI,UAAAC,EAAY,GAAI,SAAAC,CAAS,EAAqB,CAClH,KAAM,CAACC,EAAMC,CAAO,EAAIT,EAAS,EAAK,EAChC,CAACU,EAASC,CAAU,EAAIX,EAAc,EAAE,EAExCY,EAAWX,EAAgC,IAAM,CACrDQ,EAAQ,EAAK,CACf,CAAC,EAEKI,EAAQd,EAAQ,IAAM,CAC1B,MAAMe,EAAeX,EAAO,KAAKY,GAASV,EAAYU,EAAK,OAASV,EAAYU,EAAK,OAASX,CAAU,EAExG,OAAOU,EAAe,CAACA,GAAc,GAAIA,GAAc,KAAMA,GAAc,IAAI,EAAE,KAAK,GAAG,EAAI,EAC/F,EAAG,CAACX,EAAQE,EAAWD,CAAS,CAAC,EAEjC,OAAAN,EAAU,IAAM,CACd,MAAMkB,EAASb,EAAO,OAAOY,GAAQ,CAACA,EAAK,GAAIA,EAAK,KAAMA,EAAK,IAAI,EAAE,KAAK,GAAG,IAAMF,CAAK,EACpFG,EAAO,QAAQL,EAAWK,EAAO,CAAC,EAAE,IAAI,CAC9C,EAAG,CAACL,EAAYR,EAAQU,CAAK,CAAC,EAG5BnB,EAAC,OAAI,UAAU,kBACZ,SAAAS,EAAO,OACNR,EAAAF,EAAA,CACE,UAAAC,EAAC,UACC,UAAWE,EAAW,kCAAmCU,CAAS,EAClE,MAAOO,EACP,MAAO,CACL,oBAAqBA,EAAQ,QAAU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MAAO,CACL,oBAAqB,OACvB,EACA,SAAUa,GAAS,CACjBV,EAAS,GAAIU,EAAM,OAAO,KAAK,CACjC,EACD,EAEL,CAEJ",
6
- "names": ["Fragment", "jsx", "jsxs", "classNames", "Picture", "useEffect", "useMemo", "useState", "useClickOutside", "StateSelect", "states", "stateName", "stateCode", "className", "onChange", "show", "setShow", "display", "setDisplay", "dropdown", "value", "currentState", "item", "target", "event", "name", "code"]
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport { Picture } from '@anker-in/headless-ui'\nimport { useEffect, useMemo, useState } from 'react'\nimport useClickOutside from '../../context/hooks/useClickOutside'\nimport { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\n\ninterface StateSelectProps {\n states: { code: string; id: string; name: string }[]\n className?: string\n countryId?: string\n defaultCode?: string\n stateName?: string\n stateCode?: string\n onChange: (code: string, name: string) => void\n}\n\nexport function StateSelect({ states, stateName = '', stateCode = '', className = '', onChange }: StateSelectProps) {\n const [show, setShow] = useState(false)\n const [display, setDisplay] = useState<any>('')\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const dropdown = useClickOutside<HTMLDivElement>(() => {\n setShow(false)\n })\n\n const value = useMemo(() => {\n const currentState = states.find(item => (stateCode ? item.code === stateCode : item.name === stateName))\n\n return currentState ? [currentState?.id, currentState?.name, currentState?.code].join(',') : ''\n }, [states, stateCode, stateName])\n\n useEffect(() => {\n const target = states.filter(item => [item.id, item.name, item.code].join(',') === value)\n if (target.length) setDisplay(target[0].name)\n }, [setDisplay, states, value])\n\n return (\n <div className=\"relative h-full\">\n {states.length ? (\n <>\n <select\n className={classNames('h-[52px] pr-[45px] min-l:hidden', className)}\n value={value}\n style={{\n WebkitTextFillColor: value ? 'black' : '#666',\n }}\n onChange={event => {\n const [, name, code] = event.target.value.split(',')\n onChange(code, name)\n }}\n >\n {states.map((item: { id: string; name: string; code: string }) => (\n <option key={item.id} value={[item.id, item.name, item.code].join(',')}>\n {item.name}\n </option>\n ))}\n </select>\n <div\n className={classNames('absolute left-0 top-0 hidden h-[52px] pr-[45px] min-l:!block', className)}\n onClick={() => {\n setShow(true)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {display}\n </div>\n\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/country-select.png?v=1692202500\"\n className=\"pointer-events-none absolute right-0 top-1/2 h-[45px] !w-[45px] -translate-y-1/2 object-cover\"\n alt=\"arrow\"\n />\n\n <div\n ref={dropdown}\n className={classNames(\n 'absolute left-0 top-[58px] z-30 max-h-[334px] w-full cursor-pointer overflow-auto bg-white shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n !rounded && 'rounded-none',\n { '!hidden': !show }\n )}\n >\n <ul className=\"py-[6px]\">\n {states.map((item: { id: string; name: string; code: string }) => (\n <li\n key={item.id}\n value={[item.id, item.name, item.code].join(',')}\n className={classNames(\n 'relative px-[14px] py-[17px] text-[16px] font-semibold leading-[1] transition hover:bg-[#F7F8F9]',\n {\n '!bg-[#e8e8e8]': [item.id, item.name, item.code].join(',') === value,\n }\n )}\n >\n <button\n className=\"absolute left-0 top-0 z-1 size-full opacity-0\"\n value={[item.id, item.name, item.code].join(',')}\n onClick={() => {\n setDisplay(item.name)\n setShow(false)\n onChange(item.code, item.name)\n }}\n />\n {item.name}\n </li>\n ))}\n </ul>\n </div>\n </>\n ) : (\n <input\n className={className}\n value={stateName}\n style={{\n WebkitTextFillColor: 'black',\n }}\n onChange={event => {\n onChange('', event.target.value)\n }}\n ></input>\n )}\n </div>\n )\n}\n"],
5
+ "mappings": "AAwCQ,mBAAAA,EAaM,OAAAC,EAqCE,QAAAC,MAlDR,oBAxCR,OAAOC,MAAgB,aACvB,OAAS,WAAAC,MAAe,wBACxB,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC7C,OAAOC,MAAqB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useEffect", "useMemo", "useState", "useClickOutside", "useHeadlessContext", "ROUNDED_BRANDS", "StateSelect", "states", "stateName", "stateCode", "className", "onChange", "show", "setShow", "display", "setDisplay", "brand", "rounded", "dropdown", "value", "currentState", "item", "target", "event", "name", "code"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as o,jsxs as B}from"react/jsx-runtime";import g from"classnames";import{useCallback as F,useEffect as S,useMemo as x,useState as _}from"react";import{CountrySelect as w}from"./CountrySelect";import{FormItem as I}from"./FormItem";import{Input as q}from"./Input";import{StateSelect as P}from"./StateSelect";import{ALPC_COUNTRY_MAP as K}from"../../context/const";import{useCreditsContext as U}from"../../context/provider";import{useShopifyContext as z}from"@anker-in/shopify";const J=({countries:c,countriesLoading:N,form:n,validate:C,errors:h,onChange:l})=>{const{profile:u,customer:r}=U(),{locale:m}=z(),[e,i]=_(),p=x(()=>c.find(a=>a.code===e?.country)?.provinces||[],[e,c]),b=x(()=>n?.flat().find(a=>a.type==="state")?.key,[n]),A=F(()=>{if(r?.defaultAddress)return{name:(r?.defaultAddress.firstName||"")+" "+(r?.defaultAddress.lastName||""),first_name:r?.defaultAddress.firstName,last_name:r?.defaultAddress.lastName,address1:r?.defaultAddress.address1,address2:r?.defaultAddress.address2,city:r?.defaultAddress.city,phone:r?.defaultAddress.phone,country:r?.defaultAddress.countryCodeV2,province:r?.defaultAddress.province,province_code:r?.defaultAddress.provinceCode,email:r?.email||u?.email,zip:r?.defaultAddress.zip};{let s=K.get(m)||m;return s==="UK"&&(s="GB"),s==="EU"&&(s="NL"),{email:u?.email,country:s}}},[r,u?.email,m]);return console.log("customer",r),S(()=>{if(r){const s=A();i(s),l(s)}},[r,A]),e?o("div",{className:"grid gap-[20px]",children:n&&n.map((s,a)=>o("div",{className:"item-center -mx-[6px] flex",children:s.map((t,k)=>{const f=h.find(d=>d.key===t.key)?.message,y=g("h-full w-full appearance-none rounded-[2px] border bg-white px-[14px] py-[17px] leading-[1] outline-none placeholder:text-[#999] autofill:shadow-white focus:border-brand disabled:pointer-events-none disabled:text-[#999] disabled:bg-[#F7F8F9] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",f?"!border-[#F84D4F]":"border-[#d8d8d8]");return t.type==="state"&&!p.length?null:o("div",{className:g("mx-[6px] flex-1"),children:B(I,{error:f,required:t.required,label:t.label,children:[t.type==="country"&&o(w,{className:y,countries:c,loading:N,value:e.country,onChange:d=>{e.country!==d&&(e.province="",e.province_code=""),e.country=d,i({...e}),l(e)}}),t.type==="state"&&o(P,{className:y,states:p,stateCode:e.province_code,stateName:e.province,onChange:(d,v)=>{e.province_code=d,e.province=v,i({...e}),l(e)}}),t.type!=="state"&&t.type!=="country"&&o(q,{placeholder:t.label,className:y,error:f,value:e[t.key],required:t.required,disabled:t.type==="email",onChange:d=>{const v=d.target.value;e[t.key]=v,i({...e}),l(e)},onBlur:()=>{C({ignoreKeys:p.length&&b?[b]:[]})}})]})},k)})},a))}):null};export{J as AddressForm};
1
+ import{jsx as a,jsxs as z}from"react/jsx-runtime";import N from"classnames";import{useCallback as S,useEffect as w,useMemo as x,useState as I}from"react";import{CountrySelect as D}from"./CountrySelect";import{FormItem as q}from"./FormItem";import{Input as P}from"./Input";import{StateSelect as R}from"./StateSelect";import{ALPC_COUNTRY_MAP as U}from"../../context/const";import{useCreditsContext as B}from"../../context/provider";import{useHeadlessContext as E,ROUNDED_BRANDS as K}from"@anker-in/lib";const X=({countries:c,countriesLoading:g,form:n,validate:C,errors:h,onChange:l})=>{const{profile:u,customer:r}=B(),{locale:m,brand:k}=E(),F=K.includes(k),[e,i]=I(),p=x(()=>c.find(o=>o.code===e?.country)?.provinces||[],[e,c]),v=x(()=>n?.flat().find(o=>o.type==="state")?.key,[n]),A=S(()=>{if(r?.defaultAddress)return{name:(r?.defaultAddress.firstName||"")+" "+(r?.defaultAddress.lastName||""),first_name:r?.defaultAddress.firstName,last_name:r?.defaultAddress.lastName,address1:r?.defaultAddress.address1,address2:r?.defaultAddress.address2,city:r?.defaultAddress.city,phone:r?.defaultAddress.phone,country:r?.defaultAddress.countryCodeV2,province:r?.defaultAddress.province,province_code:r?.defaultAddress.provinceCode,email:r?.email||u?.email,zip:r?.defaultAddress.zip};{let s=U.get(m)||m;return s==="UK"&&(s="GB"),s==="EU"&&(s="NL"),{email:u?.email,country:s}}},[r,u?.email,m]);return w(()=>{if(r){const s=A();i(s),l(s)}},[r,A]),e?a("div",{className:"grid gap-[20px]",children:n&&n.map((s,o)=>a("div",{className:"item-center -mx-[6px] flex",children:s.map((t,_)=>{const f=h.find(d=>d.key===t.key)?.message,y=N("h-full w-full appearance-none rounded-[2px] border bg-white px-[14px] py-[17px] leading-[1] outline-none placeholder:text-[#999] autofill:shadow-white focus:border-brand disabled:pointer-events-none disabled:text-[#999] disabled:bg-[#F7F8F9] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",f?"!border-[#F84D4F]":"border-[#d8d8d8]",!F&&"rounded-none");return t.type==="state"&&!p.length?null:a("div",{className:N("mx-[6px] flex-1"),children:z(q,{error:f,required:t.required,label:t.label,children:[t.type==="country"&&a(D,{className:y,countries:c,loading:g,value:e.country,onChange:d=>{e.country!==d&&(e.province="",e.province_code=""),e.country=d,i({...e}),l(e)}}),t.type==="state"&&a(R,{className:y,states:p,stateCode:e.province_code,stateName:e.province,onChange:(d,b)=>{e.province_code=d,e.province=b,i({...e}),l(e)}}),t.type!=="state"&&t.type!=="country"&&a(P,{placeholder:t.label,className:y,error:f,value:e[t.key],required:t.required,disabled:t.type==="email",onChange:d=>{const b=d.target.value;e[t.key]=b,i({...e}),l(e)},onBlur:()=>{C({ignoreKeys:p.length&&v?[v]:[]})}})]})},_)})},o))}):null};export{X as AddressForm};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/AddressForm/index.tsx"],
4
- "sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\n\nimport { CountrySelect } from './CountrySelect'\nimport { FormItem } from './FormItem'\nimport { Input } from './Input'\nimport { StateSelect } from './StateSelect'\nimport { ALPC_COUNTRY_MAP } from '../../context/const'\nimport { useCreditsContext } from '../../context/provider'\nimport { useShopifyContext } from '@anker-in/shopify'\nimport { AddressFormProps } from './type'\n\nexport const AddressForm = ({ countries, countriesLoading, form, validate, errors, onChange }: AddressFormProps) => {\n const { profile, customer } = useCreditsContext()\n const { locale } = useShopifyContext()\n\n const [address, setAddress] = useState<Record<string, any>>()\n\n const states = useMemo(() => {\n const currentCountry = countries.find(item => item.code === address?.country)\n\n return currentCountry?.provinces || []\n }, [address, countries])\n\n const stateInputKey = useMemo(() => {\n const stateInput = form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [form])\n\n const getDefaultAddress = useCallback(() => {\n if (customer?.defaultAddress) {\n return {\n name: (customer?.defaultAddress.firstName || '') + ' ' + (customer?.defaultAddress.lastName || ''),\n first_name: customer?.defaultAddress.firstName,\n last_name: customer?.defaultAddress.lastName,\n address1: customer?.defaultAddress.address1,\n address2: customer?.defaultAddress.address2,\n city: customer?.defaultAddress.city,\n phone: customer?.defaultAddress.phone,\n country: customer?.defaultAddress.countryCodeV2,\n province: customer?.defaultAddress.province,\n province_code: customer?.defaultAddress.provinceCode,\n email: customer?.email || profile?.email,\n zip: customer?.defaultAddress.zip,\n }\n } else {\n let defaultCountry = ALPC_COUNTRY_MAP.get(locale) || locale\n if (defaultCountry === 'UK') {\n defaultCountry = 'GB'\n }\n if (defaultCountry === 'EU') {\n defaultCountry = 'NL'\n }\n return {\n email: profile?.email,\n country: defaultCountry,\n }\n }\n }, [customer, profile?.email, locale])\n\n console.log('customer', customer)\n useEffect(() => {\n if (customer) {\n const defaultAddress = getDefaultAddress()\n setAddress(defaultAddress)\n onChange(defaultAddress)\n }\n }, [customer, getDefaultAddress])\n\n if (!address) {\n return null\n }\n\n return (\n <div className=\"grid gap-[20px]\">\n {form &&\n form.map((row, rowIndex: number) => (\n <div key={rowIndex} className=\"item-center -mx-[6px] flex\">\n {row.map((input, inputIndex: number) => {\n const error = errors.find(item => item.key === input.key)?.message\n const inputClassName = classNames(\n 'h-full w-full appearance-none rounded-[2px] border bg-white px-[14px] py-[17px] leading-[1] outline-none placeholder:text-[#999] autofill:shadow-white focus:border-brand disabled:pointer-events-none disabled:text-[#999] disabled:bg-[#F7F8F9] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',\n error ? '!border-[#F84D4F]' : 'border-[#d8d8d8]'\n )\n\n if (input.type === 'state') {\n if (!states.length) {\n return null\n }\n }\n\n return (\n <div key={inputIndex} className={classNames('mx-[6px] flex-1')}>\n <FormItem error={error} required={input.required} label={input.label}>\n {input.type === 'country' && (\n <CountrySelect\n className={inputClassName}\n countries={countries}\n loading={countriesLoading}\n value={address.country}\n onChange={selectedCountryCode => {\n if (address.country !== selectedCountryCode) {\n address.province = ''\n address.province_code = ''\n }\n address.country = selectedCountryCode\n setAddress({ ...address })\n onChange(address)\n }}\n ></CountrySelect>\n )}\n {input.type === 'state' && (\n <StateSelect\n className={inputClassName}\n states={states}\n stateCode={address.province_code}\n stateName={address.province}\n onChange={(provinceCode, provinceName) => {\n address.province_code = provinceCode\n address.province = provinceName\n setAddress({ ...address })\n onChange(address)\n }}\n ></StateSelect>\n )}\n\n {input.type !== 'state' && input.type !== 'country' && (\n <Input\n placeholder={input.label}\n className={inputClassName}\n error={error}\n value={address[input.key]}\n required={input.required}\n disabled={input.type === 'email'}\n onChange={event => {\n const value = event.target.value\n address[input.key] = value\n setAddress({ ...address })\n onChange(address)\n }}\n onBlur={() => {\n validate({\n ignoreKeys: states.length && stateInputKey ? [stateInputKey] : [],\n })\n }}\n />\n )}\n </FormItem>\n </div>\n )\n })}\n </div>\n ))}\n </div>\n )\n}\n"],
5
- "mappings": "AA6FkB,OAEI,OAAAA,EAFJ,QAAAC,MAA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CAACe,EAAcC,IAAiB,CACxChB,EAAQ,cAAgBe,EACxBf,EAAQ,SAAWgB,EACnBf,EAAW,CAAE,GAAGD,CAAQ,CAAC,EACzBJ,EAASI,CAAO,CAClB,EACD,EAGFU,EAAM,OAAS,SAAWA,EAAM,OAAS,WACxClC,EAACS,EAAA,CACC,YAAayB,EAAM,MACnB,UAAWG,EACX,MAAOD,EACP,MAAOZ,EAAQU,EAAM,GAAG,EACxB,SAAUA,EAAM,SAChB,SAAUA,EAAM,OAAS,QACzB,SAAUO,GAAS,CACjB,MAAMC,EAAQD,EAAM,OAAO,MAC3BjB,EAAQU,EAAM,GAAG,EAAIQ,EACrBjB,EAAW,CAAE,GAAGD,CAAQ,CAAC,EACzBJ,EAASI,CAAO,CAClB,EACA,OAAQ,IAAM,CACZN,EAAS,CACP,WAAYQ,EAAO,QAAUE,EAAgB,CAACA,CAAa,EAAI,CAAC,CAClE,CAAC,CACH,EACF,GAEJ,GAvDQO,CAwDV,CAEJ,CAAC,GAzEOF,CA0EV,CACD,EACL,EAnFO,IAqFX",
6
- "names": ["jsx", "jsxs", "classNames", "useCallback", "useEffect", "useMemo", "useState", "CountrySelect", "FormItem", "Input", "StateSelect", "ALPC_COUNTRY_MAP", "useCreditsContext", "useShopifyContext", "AddressForm", "countries", "countriesLoading", "form", "validate", "errors", "onChange", "profile", "customer", "locale", "address", "setAddress", "states", "item", "stateInputKey", "getDefaultAddress", "defaultCountry", "defaultAddress", "row", "rowIndex", "input", "inputIndex", "error", "inputClassName", "selectedCountryCode", "provinceCode", "provinceName", "event", "value"]
4
+ "sourcesContent": ["import classNames from 'classnames'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\n\nimport { CountrySelect } from './CountrySelect'\nimport { FormItem } from './FormItem'\nimport { Input } from './Input'\nimport { StateSelect } from './StateSelect'\nimport { ALPC_COUNTRY_MAP } from '../../context/const'\nimport { useCreditsContext } from '../../context/provider'\nimport { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\nimport { AddressFormProps } from './type'\n\nexport const AddressForm = ({ countries, countriesLoading, form, validate, errors, onChange }: AddressFormProps) => {\n const { profile, customer } = useCreditsContext()\n const { locale, brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const [address, setAddress] = useState<Record<string, any>>()\n\n const states = useMemo(() => {\n const currentCountry = countries.find(item => item.code === address?.country)\n\n return currentCountry?.provinces || []\n }, [address, countries])\n\n const stateInputKey = useMemo(() => {\n const stateInput = form?.flat().find(item => item.type === 'state')\n return stateInput?.key\n }, [form])\n\n const getDefaultAddress = useCallback(() => {\n if (customer?.defaultAddress) {\n return {\n name: (customer?.defaultAddress.firstName || '') + ' ' + (customer?.defaultAddress.lastName || ''),\n first_name: customer?.defaultAddress.firstName,\n last_name: customer?.defaultAddress.lastName,\n address1: customer?.defaultAddress.address1,\n address2: customer?.defaultAddress.address2,\n city: customer?.defaultAddress.city,\n phone: customer?.defaultAddress.phone,\n country: customer?.defaultAddress.countryCodeV2,\n province: customer?.defaultAddress.province,\n province_code: customer?.defaultAddress.provinceCode,\n email: customer?.email || profile?.email,\n zip: customer?.defaultAddress.zip,\n }\n } else {\n let defaultCountry = ALPC_COUNTRY_MAP.get(locale) || locale\n if (defaultCountry === 'UK') {\n defaultCountry = 'GB'\n }\n if (defaultCountry === 'EU') {\n defaultCountry = 'NL'\n }\n return {\n email: profile?.email,\n country: defaultCountry,\n }\n }\n }, [customer, profile?.email, locale])\n\n useEffect(() => {\n if (customer) {\n const defaultAddress = getDefaultAddress()\n setAddress(defaultAddress)\n onChange(defaultAddress)\n }\n }, [customer, getDefaultAddress])\n\n if (!address) {\n return null\n }\n\n return (\n <div className=\"grid gap-[20px]\">\n {form &&\n form.map((row, rowIndex: number) => (\n <div key={rowIndex} className=\"item-center -mx-[6px] flex\">\n {row.map((input, inputIndex: number) => {\n const error = errors.find(item => item.key === input.key)?.message\n const inputClassName = classNames(\n 'h-full w-full appearance-none rounded-[2px] border bg-white px-[14px] py-[17px] leading-[1] outline-none placeholder:text-[#999] autofill:shadow-white focus:border-brand disabled:pointer-events-none disabled:text-[#999] disabled:bg-[#F7F8F9] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',\n error ? '!border-[#F84D4F]' : 'border-[#d8d8d8]',\n !rounded && 'rounded-none'\n )\n\n if (input.type === 'state') {\n if (!states.length) {\n return null\n }\n }\n\n return (\n <div key={inputIndex} className={classNames('mx-[6px] flex-1')}>\n <FormItem error={error} required={input.required} label={input.label}>\n {input.type === 'country' && (\n <CountrySelect\n className={inputClassName}\n countries={countries}\n loading={countriesLoading}\n value={address.country}\n onChange={selectedCountryCode => {\n if (address.country !== selectedCountryCode) {\n address.province = ''\n address.province_code = ''\n }\n address.country = selectedCountryCode\n setAddress({ ...address })\n onChange(address)\n }}\n ></CountrySelect>\n )}\n {input.type === 'state' && (\n <StateSelect\n className={inputClassName}\n states={states}\n stateCode={address.province_code}\n stateName={address.province}\n onChange={(provinceCode, provinceName) => {\n address.province_code = provinceCode\n address.province = provinceName\n setAddress({ ...address })\n onChange(address)\n }}\n ></StateSelect>\n )}\n\n {input.type !== 'state' && input.type !== 'country' && (\n <Input\n placeholder={input.label}\n className={inputClassName}\n error={error}\n value={address[input.key]}\n required={input.required}\n disabled={input.type === 'email'}\n onChange={event => {\n const value = event.target.value\n address[input.key] = value\n setAddress({ ...address })\n onChange(address)\n }}\n onBlur={() => {\n validate({\n ignoreKeys: states.length && stateInputKey ? [stateInputKey] : [],\n })\n }}\n />\n )}\n </FormItem>\n </div>\n )\n })}\n </div>\n ))}\n </div>\n )\n}\n"],
5
+ "mappings": "AA6FkB,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBA7FlB,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAE1D,OAAS,iBAAAC,MAAqB,kBAC9B,OAAS,YAAAC,MAAgB,aACzB,OAAS,SAAAC,MAAa,UACtB,O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AGFU,EAAM,OAAS,SAAWA,EAAM,OAAS,WACxCrC,EAACS,EAAA,CACC,YAAa4B,EAAM,MACnB,UAAWG,EACX,MAAOD,EACP,MAAOZ,EAAQU,EAAM,GAAG,EACxB,SAAUA,EAAM,SAChB,SAAUA,EAAM,OAAS,QACzB,SAAUO,GAAS,CACjB,MAAMC,EAAQD,EAAM,OAAO,MAC3BjB,EAAQU,EAAM,GAAG,EAAIQ,EACrBjB,EAAW,CAAE,GAAGD,CAAQ,CAAC,EACzBN,EAASM,CAAO,CAClB,EACA,OAAQ,IAAM,CACZR,EAAS,CACP,WAAYU,EAAO,QAAUE,EAAgB,CAACA,CAAa,EAAI,CAAC,CAClE,CAAC,CACH,EACF,GAEJ,GAvDQO,CAwDV,CAEJ,CAAC,GA1EOF,CA2EV,CACD,EACL,EApFO,IAsFX",
6
+ "names": ["jsx", "jsxs", "classNames", "useCallback", "useEffect", "useMemo", "useState", "CountrySelect", "FormItem", "Input", "StateSelect", "ALPC_COUNTRY_MAP", "useCreditsContext", "useHeadlessContext", "ROUNDED_BRANDS", "AddressForm", "countries", "countriesLoading", "form", "validate", "errors", "onChange", "profile", "customer", "locale", "brand", "rounded", "address", "setAddress", "states", "item", "stateInputKey", "getDefaultAddress", "defaultCountry", "defaultAddress", "row", "rowIndex", "input", "inputIndex", "error", "inputClassName", "selectedCountryCode", "provinceCode", "provinceName", "event", "value"]
7
7
  }
@@ -0,0 +1,5 @@
1
+ import { CreditsRedeemListCopy } from './type';
2
+ export declare const CreditsRedeemList: ({ copy, id }: {
3
+ copy: CreditsRedeemListCopy;
4
+ id?: string;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{jsx as n,jsxs as ne}from"react/jsx-runtime";import{Container as H,Heading as z,Tabs as B,TabsList as U,TabsTrigger as j,Text as q}from"@anker-in/headless-ui";import u from"classnames";import{useCallback as w,useMemo as L,useState as g}from"react";import G from"./RedeemCouponModal";import V from"./RedeemProductModal";import{useCreditsContext as $}from"../context/provider";import J from"../context/hooks/useRedeemableList";import{AlpcConsumeType as f,AlpcErrorCode as K}from"../context/const";import{useHeadlessContext as Q,useProductsByHandles as W,gaTrack as X,ROUNDED_BRANDS as Y}from"@anker-in/lib";import{RedeemableItem as Z}from"./RedeemableItem";import ee from"../modal/rulesModal";import{useRegistration as te}from"../../../components/registration";import{numberFormat as se}from"../context/utils";const xe=({copy:t,id:N})=>{const{profile:l,openSignUpPopup:_,gtm:{pageGroup:k},pageCommon:I,creditInfo:A}=$(),{authCodeActivate:b}=te(),{brand:E}=Q(),S=Y.includes(E),C=Object.keys(l||{}).length>0,M=l?.activated,[d,O]=g(t.list[0].label),[o,m]=g(void 0),[p,v]=g(),{listLoading:P,redeemableList:x,getRedeemableList:R}=J(),i=L(()=>x.map(e=>({id:e.id.toString(),title:e.name,consumeCredits:e.consume_credits,remainingInventory:e.remaining_inventory,isLimited:!!e.is_limited,consumeType:e.consume_type,handle:e.sku_handle,sku:e.goods_sku,image:e.goods_url})),[t.list,d,x]),D=i.map(e=>e.handle),{data:y}=W({handles:D}),F=L(()=>t.list.find(s=>s.label===d)?.list.filter(s=>i.some(r=>r.id===s.id)).map(s=>{const r=i.find(a=>a.id===s.id),c=y?.find(a=>a.handle===r?.handle),h=c?.variants.find(a=>a.sku===r?.sku);return r?.isLimited&&(!r?.remainingInventory||r.remainingInventory<=0)||r?.consumeType===f.Product&&(!c||!h)?null:{alpc:i.find(a=>a.id===s.id),config:s,product:c,variant:h}}).filter(s=>s!==null),[i,y]),T=w(e=>{e===K.CodeLpcRuleInventoryNotEnough&&R()},[R]);return ne(H,{id:N,className:u("relative bg-[#F5F5F7]"),children:[n(z,{as:"h2",size:"4",html:t.title}),C&&M&&n(q,{html:t.availableCredits?.replace("$credits",se(A?.available_credit||0).toString()),className:"mt-[12px] text-[20px] l-xxl:text-[18px] l:text-[16px] font-bold text-[#4A4C56]",as:"p"}),n(B,{shape:S?"rounded":"square",align:"left",className:u("sticky top-0 z-20 py-[24px] md:justify-center"),value:d.toString(),onValueChange:e=>{O(e),X({event:"ga4Event",event_name:"lp_navigation",event_parameters:{navigation:e,page_group:k}})},children:n(U,{children:t.list.map(e=>n(j,{value:e.label,children:e.label},e.label))})}),!!i?.length&&!P&&n("div",{className:u("relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3"),children:F?.map(e=>n(Z,{copy:t,item:e,onRedeem:s=>{C?!l?.activated&&!b.isActivateSuccess?b.open():m(s):_()},onRulesOpen:v},e?.alpc?.id))}),o?.alpc?.consumeType===f.Coupon&&t?.redeemModal?.coupon&&o&&n(G,{isOpen:!!o,item:o,copy:t,onError:T,onClose:()=>{m(void 0)}}),o?.alpc?.consumeType===f.Product&&t?.redeemModal&&o&&n(V,{isOpen:!!o,item:o,copy:t,onError:T,onClose:()=>{m(void 0)}}),p&&n(ee,{overlayClassName:"md:px-[16px] md:items-center",className:"md:h-fit md:rounded-b-[16px]",isOpen:p.length>0,onClose:()=>v([]),titleClassName:"border-b-transparent h-[56px]",rules:p,scrollClassName:"md:mt-[8px] md:mb-[24px] md:pt-0",title:I?.ruleLabel,ruleClassName:"text-[#1d1d1f] font-bold"})]})};export{xe as CreditsRedeemList};
2
+ //# sourceMappingURL=CreditsRedeemList.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsRedeemList/CreditsRedeemList.tsx"],
4
+ "sourcesContent": ["import { Container, Heading, Tabs, TabsList, TabsTrigger, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport RedeemCouponModal from './RedeemCouponModal'\nimport RedeemProductModal from './RedeemProductModal'\nimport { useCreditsContext } from '../context/provider'\nimport useRedeemableList from '../context/hooks/useRedeemableList'\nimport { AlpcConsumeType, AlpcErrorCode } from '../context/const'\nimport { useHeadlessContext, useProductsByHandles, gaTrack, ROUNDED_BRANDS } from '@anker-in/lib'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { RedeemableItem } from './RedeemableItem'\nimport RulesModal from '../modal/rulesModal'\nimport { CreditsRedeemListCopy } from './type'\nimport { useRegistration } from '../../../components/registration'\nimport { numberFormat } from '../context/utils'\n\nexport const CreditsRedeemList = ({ copy, id }: { copy: CreditsRedeemListCopy; id?: string }) => {\n const {\n profile,\n openSignUpPopup,\n gtm: { pageGroup },\n pageCommon,\n creditInfo,\n } = useCreditsContext()\n const { authCodeActivate } = useRegistration()\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const isLogin = Object.keys(profile || {}).length > 0\n const isActivated = profile?.activated\n\n const [activeTab, setActiveTab] = useState<string>(copy.list[0].label)\n\n const [popRedeemData, setPopRedeemData] = useState<RedeemableItemType | undefined>(undefined)\n\n const [rules, setRules] = useState<string | string[]>()\n\n const { listLoading, redeemableList, getRedeemableList } = useRedeemableList()\n\n const alpcList = useMemo(() => {\n return redeemableList.map(item => {\n return {\n id: item.id.toString(),\n title: item.name,\n consumeCredits: item.consume_credits,\n remainingInventory: item.remaining_inventory,\n isLimited: !!item.is_limited,\n consumeType: item.consume_type,\n handle: item.sku_handle,\n sku: item.goods_sku,\n image: item.goods_url,\n }\n })\n }, [copy.list, activeTab, redeemableList])\n\n const handles = alpcList.map(item => item.handle)\n const { data: products } = useProductsByHandles({ handles })\n\n const list = useMemo(() => {\n const currentList = copy.list.find(item => item.label === activeTab)\n return currentList?.list\n .filter(item => alpcList.some(alpcItem => alpcItem.id === item.id))\n .map(item => {\n const alpcItem = alpcList.find(alpcItem => alpcItem.id === item.id)\n const product = products?.find(product => product.handle === alpcItem?.handle)\n const variant = product?.variants.find(variant => variant.sku === alpcItem?.sku)\n // \u8FC7\u6EE4\u6389\u5E93\u5B58\u4E0D\u8DB3\u7684\u5546\u54C1\n if (alpcItem?.isLimited && (!alpcItem?.remainingInventory || alpcItem.remainingInventory <= 0)) return null\n if (alpcItem?.consumeType === AlpcConsumeType.Product && (!product || !variant)) return null\n return {\n alpc: alpcList.find(alpcItem => alpcItem.id === item.id),\n config: item,\n product,\n variant,\n }\n })\n .filter(item => item !== null) as unknown as RedeemableItemType[]\n }, [alpcList, products])\n\n const handleRedeemError = useCallback(\n (errorCode: AlpcErrorCode) => {\n if (errorCode === AlpcErrorCode.CodeLpcRuleInventoryNotEnough) {\n getRedeemableList()\n }\n },\n [getRedeemableList]\n )\n\n return (\n <Container id={id} className={classNames('relative bg-[#F5F5F7]')}>\n <Heading as=\"h2\" size=\"4\" html={copy.title} />\n\n {/* \u53EF\u7528\u79EF\u5206\u5C55\u793A */}\n {isLogin && isActivated && (\n <Text\n html={copy.availableCredits?.replace('$credits', numberFormat(creditInfo?.available_credit || 0).toString())}\n className=\"mt-[12px] text-[20px] l-xxl:text-[18px] l:text-[16px] font-bold text-[#4A4C56]\"\n as=\"p\"\n />\n )}\n\n <Tabs\n shape={rounded ? 'rounded' : 'square'}\n align=\"left\"\n className={classNames('sticky top-0 z-20 py-[24px] md:justify-center')}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(value)\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_navigation',\n event_parameters: {\n navigation: value,\n page_group: pageGroup,\n },\n })\n }}\n >\n <TabsList>\n {copy.list.map(item => (\n <TabsTrigger key={item.label} value={item.label}>\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n {/* PC\u7AEF */}\n {!!alpcList?.length && !listLoading && (\n <div\n className={classNames('relative grid grid-cols-4 gap-[16px] md:grid-cols-2 md:gap-[12px] md-xl:grid-cols-3')}\n >\n {list?.map(item => (\n <RedeemableItem\n key={item?.alpc?.id}\n copy={copy}\n item={item}\n onRedeem={(item: RedeemableItemType) => {\n if (!isLogin) {\n openSignUpPopup()\n } else if (!profile?.activated && !authCodeActivate.isActivateSuccess) {\n authCodeActivate.open()\n } else {\n setPopRedeemData(item)\n }\n }}\n onRulesOpen={setRules}\n />\n ))}\n </div>\n )}\n\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Coupon && copy?.redeemModal?.coupon && popRedeemData && (\n <RedeemCouponModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {popRedeemData?.alpc?.consumeType === AlpcConsumeType.Product && copy?.redeemModal && popRedeemData && (\n <RedeemProductModal\n isOpen={!!popRedeemData}\n item={popRedeemData}\n copy={copy}\n onError={handleRedeemError}\n onClose={() => {\n setPopRedeemData(undefined)\n }}\n />\n )}\n {rules && (\n <RulesModal\n overlayClassName=\"md:px-[16px] md:items-center\"\n className=\"md:h-fit md:rounded-b-[16px]\"\n isOpen={rules.length > 0}\n onClose={() => setRules([])}\n titleClassName=\"border-b-transparent h-[56px]\"\n rules={rules}\n scrollClassName=\"md:mt-[8px] md:mb-[24px] md:pt-0\"\n title={pageCommon?.ruleLabel}\n ruleClassName=\"text-[#1d1d1f] font-bold\"\n />\n )}\n </Container>\n )\n}\n"],
5
+ "mappings": "AA0FI,OACE,OAAAA,EADF,QAAAC,OAAA,oBA1FJ,OAAS,aAAAC,EAAW,WAAAC,EAAS,QAAAC,EAAM,YAAAC,EAAU,eAAAC,EAAa,QAAAC,MAAY,wBACtE,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,WAAAC,EAAS,YAAAC,MAAgB,QAE/C,OAAOC,MAAuB,sBAC9B,OAAOC,MAAwB,uBAC/B,OAAS,qBAAAC,MAAyB,sBAClC,OAAOC,MAAuB,qCAC9B,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,mBAC/C,OAAS,sBAAAC,EAAoB,wBAAAC,EAAsB,WAAAC,EAAS,kBAAAC,MAAsB,gBAElF,OAAS,kBAAAC,MAAsB,mBAC/B,OAAOC,OAAgB,sBAEvB,OAAS,mBAAAC,OAAuB,mCAChC,OAAS,gBAAAC,OAAoB,mBAEtB,MAAMC,GAAoB,CAAC,CAAE,KA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,EAAK,OADUA,EAAK,KAEvB,CACD,EACH,EACF,EAEC,CAAC,CAACD,GAAU,QAAU,CAACH,GACtB7C,EAAC,OACC,UAAWQ,EAAW,qFAAqF,EAE1G,SAAA4C,GAAM,IAAIH,GACTjD,EAACsB,EAAA,CAEC,KAAMK,EACN,KAAMsB,EACN,SAAWA,GAA6B,CACjCZ,EAEM,CAACR,GAAS,WAAa,CAACK,EAAiB,kBAClDA,EAAiB,KAAK,EAEtBQ,EAAiBO,CAAI,EAJrBnB,EAAgB,CAMpB,EACA,YAAac,GAZRK,GAAM,MAAM,EAanB,CACD,EACH,EAGDR,GAAe,MAAM,cAAgBzB,EAAgB,QAAUW,GAAM,aAAa,QAAUc,GAC3FzC,EAACY,EAAA,CACC,OAAQ,CAAC,CAAC6B,EACV,KAAMA,EACN,KAAMd,EACN,QAAS6B,EACT,QAAS,IAAM,CACbd,EAAiB,MAAS,CAC5B,EACF,EAEDD,GAAe,MAAM,cAAgBzB,EAAgB,SAAWW,GAAM,aAAec,GACpFzC,EAACa,EAAA,CACC,OAAQ,CAAC,CAAC4B,EACV,KAAMA,EACN,KAAMd,EACN,QAAS6B,EACT,QAAS,IAAM,CACbd,EAAiB,MAAS,CAC5B,EACF,EAEDC,GACC3C,EAACuB,GAAA,CACC,iBAAiB,+BACjB,UAAU,+BACV,OAAQoB,EAAM,OAAS,EACvB,QAAS,IAAMC,EAAS,CAAC,CAAC,EAC1B,eAAe,gCACf,MAAOD,EACP,gBAAgB,mCAChB,MAAOX,GAAY,UACnB,cAAc,2BAChB,GAEJ,CAEJ",
6
+ "names": ["jsx", "jsxs", "Container", "Heading", "Tabs", "TabsList", "TabsTrigger", "Text", "classNames", "useCallback", "useMemo", "useState", "RedeemCouponModal", "RedeemProductModal", "useCreditsContext", "useRedeemableList", "AlpcConsumeType", "AlpcErrorCode", "useHeadlessContext", "useProductsByHandles", "gaTrack", "ROUNDED_BRANDS", "RedeemableItem", "RulesModal", "useRegistration", "numberFormat", "CreditsRedeemList", "copy", "id", "profile", "openSignUpPopup", "pageGroup", "pageCommon", "creditInfo", "authCodeActivate", "brand", "rounded", "isLogin", "isActivated", "activeTab", "setActiveTab", "popRedeemData", "setPopRedeemData", "rules", "setRules", "listLoading", "redeemableList", "getRedeemableList", "alpcList", "item", "handles", "products", "list", "alpcItem", "product", "variant", "handleRedeemError", "errorCode", "value"]
7
+ }
@@ -0,0 +1,4 @@
1
+ import { RedeemableItem } from '../type';
2
+ export declare const NoneProductValue: ({ item }: {
3
+ item: RedeemableItem;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as m}from"react/jsx-runtime";import{Text as l}from"@anker-in/headless-ui";import{ConsumeType as o}from"../context/const";import{useCreditsContext as p}from"../context/provider";const s=({item:t})=>{const{pageCommon:x}=p();return t.config?.type===o.ShippingCoupon?e("div",{className:"absolute left-[16px] l-xxl:left-[12px] bottom-[8px] l:left-[8px] font-extrabold text-white md:bottom-[4px] md:left-[5px]",children:e(l,{className:"text-[32px] font-bold leading-none md:text-[12px] l-xxl:text-[20px] w-[70%] md:w-full md-l:text-[14px]",html:t.config?.value,as:"p"})}):e("div",{className:"absolute left-[16px] l-xxl:left-[12px] l:left-[8px] bottom-[8px] font-extrabold text-white md:bottom-[4px] md:left-[5px]",children:t.config?.value?m("div",{className:"flex items-end",children:[e(l,{className:"text-[64px] font-extrabold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]",html:t.config?.value.toString()}),e(l,{className:"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]",html:t.config?.type===o.GiftCard?x?.giftCardLabel:x?.off})]}):e(l,{className:"text-[24px] w-[70%] font-bold leading-none",html:t.config?.title,as:"p"})})};export{s as NoneProductValue};
2
+ //# sourceMappingURL=NonProductValue.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/components/credits/creditsRedeemList/NonProductValue.tsx"],
4
+ "sourcesContent": ["import { Text } from '@anker-in/headless-ui'\nimport { RedeemableItem } from '../type'\nimport { ConsumeType } from '../context/const'\nimport { useCreditsContext } from '../context/provider'\n\nexport const NoneProductValue = ({ item }: { item: RedeemableItem }) => {\n const { pageCommon } = useCreditsContext()\n // shipping coupon \u4EC5\u5C55\u793A\u6587\u6848\n if (item.config?.type === ConsumeType.ShippingCoupon) {\n return (\n <div className=\"absolute left-[16px] l-xxl:left-[12px] bottom-[8px] l:left-[8px] font-extrabold text-white md:bottom-[4px] md:left-[5px]\">\n <Text\n className=\"text-[32px] font-bold leading-none md:text-[12px] l-xxl:text-[20px] w-[70%] md:w-full md-l:text-[14px]\"\n html={item.config?.value}\n as=\"p\"\n />\n </div>\n )\n } else {\n return (\n <div className=\"absolute left-[16px] l-xxl:left-[12px] l:left-[8px] bottom-[8px] font-extrabold text-white md:bottom-[4px] md:left-[5px]\">\n {item.config?.value ? (\n <div className=\"flex items-end\">\n <Text\n className=\"text-[64px] font-extrabold leading-none md:text-[20px] l-xxl:text-[40px] md-l:text-[22px]\"\n html={item.config?.value.toString()}\n />\n <Text\n className=\"ml-[4px] text-[24px] font-bold leading-[2] md:ml-[2px] l:text-[12px] xxl:leading-[1.4] l-xxl:text-[20px]\"\n html={item.config?.type === ConsumeType.GiftCard ? pageCommon?.giftCardLabel : pageCommon?.off}\n />\n </div>\n ) : (\n <Text className=\"text-[24px] w-[70%] font-bold leading-none\" html={item.config?.title} as=\"p\" />\n )}\n </div>\n )\n }\n}\n"],
5
+ "mappings": "AAWQ,cAAAA,EAWE,QAAAC,MAXF,oBAXR,OAAS,QAAAC,MAAY,wBAErB,OAAS,eAAAC,MAAmB,mBAC5B,OAAS,qBAAAC,MAAyB,sBAE3B,MAAMC,EAAmB,CAAC,CAAE,KAAAC,CAAK,IAAgC,CACtE,KAAM,CAAE,WAAAC,CAAW,EAAIH,EAAkB,EAEzC,OAAIE,EAAK,QAAQ,OAASH,EAAY,eAElCH,EAAC,OAAI,UAAU,2HACb,SAAAA,EAACE,EAAA,CACC,UAAU,yGACV,KAAMI,EAAK,QAAQ,MACnB,GAAG,IACL,EACF,EAIAN,EAAC,OAAI,UAAU,2HACZ,SAAAM,EAAK,QAAQ,MACZL,EAAC,OAAI,UAAU,iBACb,UAAAD,EAACE,EAAA,CACC,UAAU,4FACV,KAAMI,EAAK,QAAQ,MAAM,SAAS,EACpC,EACAN,EAACE,EAAA,CACC,UAAU,2GACV,KAAMI,EAAK,QAAQ,OAASH,EAAY,SAAWI,GAAY,cAAgBA,GAAY,IAC7F,GACF,EAEAP,EAACE,EAAA,CAAK,UAAU,6CAA6C,KAAMI,EAAK,QAAQ,MAAO,GAAG,IAAI,EAElG,CAGN",
6
+ "names": ["jsx", "jsxs", "Text", "ConsumeType", "useCreditsContext", "NoneProductValue", "item", "pageCommon"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{Fragment as E,jsx as t,jsxs as l}from"react/jsx-runtime";import{Button as M,Picture as k,Text as d}from"@anker-in/headless-ui";import c from"classnames";import{useCallback as I,useEffect as L,useState as u}from"react";import S from"../context/hooks/useCopy";import{useCreditsContext as y}from"../context/provider";import{useRedeemCoupon as _}from"../context/hooks/useRedeemCoupon";import{AlpcErrorCode as p}from"../context/const";import{CreditsModalContainer as B}from"../modal/modalContainer";import{numberFormat as z}from"../context/utils";import{useShopifyContext as P}from"@anker-in/shopify";function O({item:i,copy:e,onError:f,...r}){const{locale:w}=P(),[a,F]=u(),[g,s]=u(),[C,n]=u(!1),{copy:R,copied:b}=S(),{profile:x,fetchCreditInfo:v}=y(),{isMutating:N,trigger:h}=_({onSuccess(o){if(!o){s(e.redeemModal.commonError);return}if(o?.data?.success)F(o.data.coupon_code),v(x?.user_id);else{let m;o.code===p.CodeLpcShopifyCouponRuleRedeemLimit?(m=e.redeemModal.redeemLimitError,n(!0)):o.code===p.CodeLpcRuleInventoryNotEnough?(m=e.redeemModal.inventoryNotEnough,n(!0)):o.code===p.CodeLpcNotEnoughCredits?(m=e.redeemModal.creditsNotEnough,n(!0),v(x?.user_id)):o.code===p.CodeCrossSiteError&&(m=e.redeemModal.crossSiteError,n(!0)),s(m||e.redeemModal.commonError||""),f&&f(o.code)}},onError(o){s(o.message||e.redeemModal.commonError)}}),T=I(async()=>{s(""),h({user_id:x?.user_id,rule_id:Number(i.alpc?.id)})},[i,x,h]);return L(()=>{r.isOpen||(n(!1),s(""))},[r.isOpen]),l(B,{...r,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-0 md:mb-[24px] px-0",titleClassName:"h-[56px] bg-[#F5F5F7]",children:[l("div",{className:c("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:[l("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[e?.imageMapping?.coupon?.url&&t(k,{source:e?.imageMapping?.coupon?.url,className:"h-full [&_img]:h-full"}),t("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:i.config.value?l("div",{className:"flex items-end gap-[4px]",children:[t(d,{className:"text-[64px] font-bold leading-none",html:i.config.value.toString()}),t(d,{className:"text-[24px] font-bold leading-[2]",html:e?.off})]}):t(d,{size:3,html:i.alpc?.title})})]}),a?l("div",{className:"mt-[30px] flex items-center justify-center md:mt-[18px]",children:[t("div",{className:"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]",children:a}),t("div",{className:c("cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]",b?"pointer-events-none":"pointer-events-auto"),onClick:()=>{R(a)},role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&o.preventDefault()},children:b?e?.copied:e?.copy})]}):l(d,{as:"p",className:c("mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]"),children:[z(i.alpc?.consumeCredits)," ",e?.pointUnit]}),!a&&i.config?.rules?.length>0&&l("div",{className:"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]",children:[l("div",{className:"mb-[4px]",children:[e?.ruleLabel,":"]}),t("ul",{className:"ml-4 grid grid-flow-row gap-[4px]",children:i.config?.rules?.map((o,m)=>t("li",{className:"list-disc",children:t(d,{html:o})},m))})]})]}),l("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[a&&!N?l(E,{children:[l("div",{className:"flex flex-col",children:[t(d,{className:"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]",html:e.redeemModal.coupon.successTitle}),t(d,{className:"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]",html:e.redeemModal.coupon.successDesc})]}),t(M,{variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:()=>{window.location.href=e.redeemModal.coupon.successButtonUrl||`/${w}`,r.onClose&&r.onClose()},disabled:C,children:e.redeemModal.coupon.successButton})]}):l(E,{children:[t(d,{className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:e.redeemModal.confirmTitle}),t(M,{loading:N,variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:T,disabled:C,children:e.redeemModal.confirmButton})]}),g&&t("div",{className:"mx-auto max-w-full py-[12px] text-center",children:t(d,{className:"text-[14px] font-semibold text-[#1F2021]",html:g})})]})]})}var W=O;export{W as default};
1
+ import{Fragment as E,jsx as t,jsxs as l}from"react/jsx-runtime";import{Button as y,Picture as k,Text as i}from"@anker-in/headless-ui";import u from"classnames";import{useCallback as I,useEffect as L,useState as f}from"react";import _ from"../context/hooks/useCopy";import{useCreditsContext as B}from"../context/provider";import{useRedeemCoupon as S}from"../context/hooks/useRedeemCoupon";import{AlpcErrorCode as x}from"../context/const";import{CreditsModalContainer as P}from"../modal/modalContainer";import{numberFormat as z}from"../context/utils";import{useHeadlessContext as O}from"@anker-in/lib";import{NoneProductValue as U}from"./RedeemProductModal/NonProductValue";function A({item:d,copy:o,onError:g,...a}){const{locale:w}=O(),[s,F]=f(),[C,n]=f(),[b,p]=f(!1),{copy:R,copied:v}=_(),{profile:c,fetchCreditInfo:N,pageCommon:m}=B(),{isMutating:h,trigger:M}=S({onSuccess(e){if(!e){n(o.redeemModal.commonError);return}if(e?.data?.success)F(e.data.coupon_code),N(c?.user_id);else{let r;e.code===x.CodeLpcShopifyCouponRuleRedeemLimit?(r=o.redeemModal.redeemLimitError,p(!0)):e.code===x.CodeLpcRuleInventoryNotEnough?(r=o.redeemModal.inventoryNotEnough,p(!0)):e.code===x.CodeLpcNotEnoughCredits?(r=o.redeemModal.creditsNotEnough,p(!0),N(c?.user_id)):e.code===x.CodeCrossSiteError&&(r=o.redeemModal.crossSiteError,p(!0)),n(r||o.redeemModal.commonError||""),g&&g(e.code)}},onError(e){n(e.message||o.redeemModal.commonError)}}),T=I(async()=>{n(""),M({user_id:c?.user_id,rule_id:Number(d.alpc?.id)})},[d,c,M]);return L(()=>{a.isOpen||(p(!1),n(""))},[a.isOpen]),l(P,{...a,className:"w-[540px] md:h-auto",scrollClassName:"mb-[40px] min-l:px-0 md:mb-[24px] px-0",titleClassName:"h-[56px] bg-[#F5F5F7]",children:[l("div",{className:u("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:[l("div",{className:"relative mx-auto h-[164px] w-[324px]",children:[m?.imageMapping?.[d.config?.type]?.url&&t(k,{source:m.imageMapping[d.config.type].url,className:"h-full [&_img]:h-full"}),t("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:d.config.value?t(U,{item:d,copy:o}):t(i,{size:3,html:d.alpc?.title})})]}),s?l("div",{className:"mt-[30px] flex items-center justify-center md:mt-[18px]",children:[t("div",{className:"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]",children:s}),t("div",{className:u("cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]",v?"pointer-events-none":"pointer-events-auto"),onClick:()=>{R(s)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},children:v?m?.copied:m?.copy})]}):l(i,{as:"p",className:u("mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]"),children:[z(d.alpc?.consumeCredits)," ",m?.pointUnit]}),!s&&d.config?.rules?.length>0&&l("div",{className:"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]",children:[l("div",{className:"mb-[4px]",children:[m?.ruleLabel,":"]}),t("ul",{className:"ml-4 grid grid-flow-row gap-[4px]",children:d.config?.rules?.map((e,r)=>t("li",{className:"list-disc",children:t(i,{html:e})},r))})]})]}),l("div",{className:"bg-white px-[48px] pt-[24px] text-center md:px-[16px]",children:[s&&!h?l(E,{children:[l("div",{className:"flex flex-col",children:[t(i,{className:"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]",html:o.redeemModal.coupon.successTitle}),t(i,{className:"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]",html:o.redeemModal.coupon.successDesc})]}),t(y,{variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:()=>{window.location.href=o.redeemModal.coupon.successButtonUrl||`/${w}`,a.onClose&&a.onClose()},disabled:b,children:o.redeemModal.coupon.successButton})]}):l(E,{children:[t(i,{className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:o.redeemModal.confirmTitle}),t(y,{loading:h,variant:"primary",size:"lg",className:"mt-[16px] w-full",onClick:T,disabled:b,children:o.redeemModal.confirmButton})]}),C&&t("div",{className:"mx-auto max-w-full py-[12px] text-center text-[#FF0000]",children:t(i,{className:"text-[14px] font-semibold text-[#1F2021]",html:C})})]})]})}var Z=A;export{Z as default};
2
2
  //# sourceMappingURL=RedeemCouponModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/components/credits/creditsRedeemList/RedeemCouponModal.tsx"],
4
- "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ModalContainerProps } from '../modal/modalContainer'\nimport useCopy from '../context/hooks/useCopy'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemCoupon } from '../context/hooks/useRedeemCoupon'\nimport { AlpcErrorCode } from '../context/const'\nimport { CreditsModalContainer } from '../modal/modalContainer'\nimport { numberFormat } from '../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { useShopifyContext } from '@anker-in/shopify'\nimport { CreditsRedeemListCopy } from './type'\n\nfunction RedeemCouponModal({\n item,\n copy,\n onError,\n ...props\n}: ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: number) => void\n}) {\n const { locale } = useShopifyContext()\n const [couponCode, setCouponCode] = useState<string>()\n const [errorInfo, setErrorInfo] = useState<string>()\n\n const [disabled, setDisabled] = useState(false)\n const { copy: copyText, copied: copiedStatus } = useCopy()\n\n const { profile, fetchCreditInfo } = useCreditsContext()\n\n const { isMutating: loading, trigger } = useRedeemCoupon({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy.redeemModal.commonError)\n return\n }\n\n if (responseData?.data?.success) {\n setCouponCode(responseData.data.coupon_code)\n fetchCreditInfo(profile?.user_id)\n } else {\n let errorMsg\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 } 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 setErrorInfo(errorMsg || copy.redeemModal.commonError || '')\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setErrorInfo(error.message || copy.redeemModal.commonError)\n },\n })\n\n const handleConfirm = useCallback(async () => {\n setErrorInfo('')\n trigger({\n user_id: profile?.user_id,\n rule_id: Number(item.alpc?.id),\n })\n }, [item, profile, trigger])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo('')\n }\n }, [props.isOpen])\n\n return (\n <CreditsModalContainer\n {...props}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-0 md:mb-[24px] px-0\"\n titleClassName=\"h-[56px] bg-[#F5F5F7]\"\n >\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {copy?.imageMapping?.coupon?.url && (\n <Picture source={copy?.imageMapping?.coupon?.url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-bold leading-none\" html={item.config.value.toString()} />\n <Text className=\"text-[24px] font-bold leading-[2]\" html={copy?.off} />\n </div>\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n {couponCode ? (\n <div className=\"mt-[30px] flex items-center justify-center md:mt-[18px]\">\n <div className=\"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]\">{couponCode}</div>\n <div\n className={classNames(\n 'cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]',\n copiedStatus ? 'pointer-events-none' : 'pointer-events-auto'\n )}\n onClick={() => {\n copyText(couponCode)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copiedStatus ? copy?.copied : copy?.copy}\n </div>\n </div>\n ) : (\n <Text\n as=\"p\"\n className={classNames(\n 'mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {numberFormat(item.alpc?.consumeCredits)} {copy?.pointUnit}\n </Text>\n )}\n {!couponCode && item.config?.rules?.length > 0 && (\n <div className=\"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]\">\n <div className=\"mb-[4px]\">{copy?.ruleLabel}:</div>\n <ul className=\"ml-4 grid grid-flow-row gap-[4px]\">\n {item.config?.rules?.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text html={text} />\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n {couponCode && !loading ? (\n <>\n <div className=\"flex flex-col\">\n <Text\n className=\"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]\"\n html={copy.redeemModal.coupon.successTitle}\n ></Text>\n <Text\n className=\"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]\"\n html={copy.redeemModal.coupon.successDesc}\n ></Text>\n </div>\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={() => {\n window.location.href = copy.redeemModal.coupon.successButtonUrl || `/${locale}`\n if (props.onClose) {\n props.onClose()\n }\n }}\n disabled={disabled}\n >\n {copy.redeemModal.coupon.successButton}\n </Button>\n </>\n ) : (\n <>\n <Text\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={handleConfirm}\n disabled={disabled}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </>\n )}\n {errorInfo && (\n <div className=\"mx-auto max-w-full py-[12px] text-center\">\n <Text className=\"text-[14px] font-semibold text-[#1F2021]\" html={errorInfo} />\n </div>\n )}\n </div>\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemCouponModal\n"],
5
- "mappings": "AAkGY,OA4DF,YAAAA,EA5DE,OAAAC,EAIE,QAAAC,MAJF,oBAlGZ,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAOC,MAAa,2BACpB,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,mBAAAC,MAAuB,mCAChC,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,yBAAAC,MAA6B,0BACtC,OAAS,gBAAAC,MAAoB,mBAE7B,OAAS,qBAAAC,MAAyB,oBAGlC,SAASC,EAAkB,CACzB,KAAAC,EACA,KAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAIG,CACD,KAAM,CAAE,OAAAC,CAAO,EAAIN,EAAkB,EAC/B,CAACO,EAAYC,CAAa,EAAIf,EAAiB,EAC/C,CAACgB,EAAWC,CAAY,EAAIjB,EAAiB,EAE7C,CAACkB,EAAUC,CAAW,EAAInB,EAAS,EAAK,EACxC,CAAE,KAAMoB,EAAU,OAAQC,CAAa,EAAIpB,EAAQ,EAEnD,CAAE,QAAAqB,EAAS,gBAAAC,CAAgB,EAAIrB,EAAkB,EAEjD,CAAE,WAAYsB,EAAS,QAAAC,CAAQ,EAAItB,EAAgB,CACvD,UAAUuB,EAAc,CACtB,GAAI,CAACA,EAAc,CACjBT,EAAaP,EAAK,YAAY,WAAW,EACzC,MACF,CAEA,GAAIgB,GAAc,MAAM,QACtBX,EAAcW,EAAa,KAAK,WAAW,EAC3CH,EAAgBD,GAAS,OAAO,MAC3B,CACL,IAAIK,EACAD,EAAa,OAAStB,EAAc,qCACtCuB,EAAWjB,EAAK,YAAY,iBAC5BS,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B,IAAIG,CAAM,GACzED,EAAM,SACRA,EAAM,QAAQ,CAElB,EACA,SAAUM,EAET,SAAAR,EAAK,YAAY,OAAO,cAC3B,GACF,EAEAjB,EAAAF,EAAA,CACE,UAAAC,EAACI,EAAA,CACC,UAAU,4EACV,KAAMc,EAAK,YAAY,aACxB,EACDlB,EAACE,EAAA,CACC,QAAS8B,EACT,QAAQ,UACR,KAAK,KACL,UAAU,mBACV,QAASK,EACT,SAAUX,EAET,SAAAR,EAAK,YAAY,cACpB,GACF,EAEDM,GACCxB,EAAC,OAAI,UAAU,2CACb,SAAAA,EAACI,EAAA,CAAK,UAAU,2CAA2C,KAAMoB,EAAW,EAC9E,GAEJ,GACF,CAEJ,CAEA,IAAOiB,EAAQzB",
6
- "names": ["Fragment", "jsx", "jsxs", "Button", "Picture", "Text", "classNames", "useCallback", "useEffect", "useState", "useCopy", "useCreditsContext", "useRedeemCoupon", "AlpcErrorCode", "CreditsModalContainer", "numberFormat", "useShopifyContext", "RedeemCouponModal", "item", "copy", "onError", "props", "locale", "couponCode", "setCouponCode", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "copyText", "copiedStatus", "profile", "fetchCreditInfo", "loading", "trigger", "responseData", "errorMsg", "error", "handleConfirm", "e", "text", "index", "RedeemCouponModal_default"]
4
+ "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ModalContainerProps } from '../modal/modalContainer'\nimport useCopy from '../context/hooks/useCopy'\nimport { useCreditsContext } from '../context/provider'\nimport { useRedeemCoupon } from '../context/hooks/useRedeemCoupon'\nimport { AlpcErrorCode } from '../context/const'\nimport { CreditsModalContainer } from '../modal/modalContainer'\nimport { numberFormat } from '../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../type'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { CreditsRedeemListCopy } from './type'\nimport { NoneProductValue } from './RedeemProductModal/NonProductValue'\n\nfunction RedeemCouponModal({\n item,\n copy,\n onError,\n ...props\n}: ModalContainerProps & {\n item: RedeemableItemType\n copy: CreditsRedeemListCopy\n onError: (code: number) => void\n}) {\n const { locale } = useHeadlessContext()\n const [couponCode, setCouponCode] = useState<string>()\n const [errorInfo, setErrorInfo] = useState<string>()\n\n const [disabled, setDisabled] = useState(false)\n const { copy: copyText, copied: copiedStatus } = useCopy()\n\n const { profile, fetchCreditInfo, pageCommon } = useCreditsContext()\n\n const { isMutating: loading, trigger } = useRedeemCoupon({\n onSuccess(responseData) {\n if (!responseData) {\n setErrorInfo(copy.redeemModal.commonError)\n return\n }\n\n if (responseData?.data?.success) {\n setCouponCode(responseData.data.coupon_code)\n fetchCreditInfo(profile?.user_id)\n } else {\n let errorMsg\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 } 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 setErrorInfo(errorMsg || copy.redeemModal.commonError || '')\n onError && onError(responseData.code)\n }\n },\n onError(error) {\n setErrorInfo(error.message || copy.redeemModal.commonError)\n },\n })\n\n const handleConfirm = useCallback(async () => {\n setErrorInfo('')\n trigger({\n user_id: profile?.user_id,\n rule_id: Number(item.alpc?.id),\n })\n }, [item, profile, trigger])\n\n useEffect(() => {\n if (!props.isOpen) {\n setDisabled(false)\n setErrorInfo('')\n }\n }, [props.isOpen])\n\n return (\n <CreditsModalContainer\n {...props}\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-0 md:mb-[24px] px-0\"\n titleClassName=\"h-[56px] bg-[#F5F5F7]\"\n >\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <div className=\"relative mx-auto h-[164px] w-[324px]\">\n {pageCommon?.imageMapping?.[item.config?.type]?.url && (\n <Picture source={pageCommon.imageMapping[item.config.type].url} className=\"h-full [&_img]:h-full\" />\n )}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value ? (\n <NoneProductValue item={item} copy={copy} />\n ) : (\n <Text size={3} html={item.alpc?.title} />\n )}\n </div>\n </div>\n {couponCode ? (\n <div className=\"mt-[30px] flex items-center justify-center md:mt-[18px]\">\n <div className=\"mr-[10px] text-[24px] font-bold leading-[1.4] md:leading-[1.2]\">{couponCode}</div>\n <div\n className={classNames(\n 'cursor-pointer text-[16px] font-bold leading-[1.2] underline md:text-[14px]',\n copiedStatus ? 'pointer-events-none' : 'pointer-events-auto'\n )}\n onClick={() => {\n copyText(couponCode)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copiedStatus ? pageCommon?.copied : pageCommon?.copy}\n </div>\n </div>\n ) : (\n <Text\n as=\"p\"\n className={classNames(\n 'mt-[30px] text-center text-[24px] font-bold leading-[1.2] md:mt-[18px] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}\n </Text>\n )}\n {!couponCode && item.config?.rules?.length > 0 && (\n <div className=\"mt-[18px] w-full text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px] md:text-[14px]\">\n <div className=\"mb-[4px]\">{pageCommon?.ruleLabel}:</div>\n <ul className=\"ml-4 grid grid-flow-row gap-[4px]\">\n {item.config?.rules?.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text html={text} />\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n <div className=\"bg-white px-[48px] pt-[24px] text-center md:px-[16px]\">\n {couponCode && !loading ? (\n <>\n <div className=\"flex flex-col\">\n <Text\n className=\"mb-[4px] text-[24px] font-bold leading-[1.2] md:text-[20px]\"\n html={copy.redeemModal.coupon.successTitle}\n ></Text>\n <Text\n className=\"text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:text-[14px]\"\n html={copy.redeemModal.coupon.successDesc}\n ></Text>\n </div>\n <Button\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={() => {\n window.location.href = copy.redeemModal.coupon.successButtonUrl || `/${locale}`\n if (props.onClose) {\n props.onClose()\n }\n }}\n disabled={disabled}\n >\n {copy.redeemModal.coupon.successButton}\n </Button>\n </>\n ) : (\n <>\n <Text\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full\"\n onClick={handleConfirm}\n disabled={disabled}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </>\n )}\n {errorInfo && (\n <div className=\"mx-auto max-w-full py-[12px] text-center text-[#FF0000]\">\n <Text className=\"text-[14px] font-semibold text-[#1F2021]\" html={errorInfo} />\n </div>\n )}\n </div>\n </CreditsModalContainer>\n )\n}\n\nexport default RedeemCouponModal\n"],
5
+ "mappings": "AAiGQ,OA2DE,YAAAA,EAzDE,OAAAC,EAFJ,QAAAC,MAAA,oBAjGR,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAOC,MAAgB,aACvB,OAAS,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAEjD,OAAOC,MAAa,2BACpB,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,mBAAAC,MAAuB,mCAChC,OAAS,iBAAAC,MAAqB,mBAC9B,OA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picture", "Text", "classNames", "useCallback", "useEffect", "useState", "useCopy", "useCreditsContext", "useRedeemCoupon", "AlpcErrorCode", "CreditsModalContainer", "numberFormat", "useHeadlessContext", "NoneProductValue", "RedeemCouponModal", "item", "copy", "onError", "props", "locale", "couponCode", "setCouponCode", "errorInfo", "setErrorInfo", "disabled", "setDisabled", "copyText", "copiedStatus", "profile", "fetchCreditInfo", "pageCommon", "loading", "trigger", "responseData", "errorMsg", "error", "handleConfirm", "text", "index", "RedeemCouponModal_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Button as v,Text as r}from"@anker-in/headless-ui";import b from"classnames";import{AddressForm as g}from"../AddressForm";import{useShopifyContext as h}from"@anker-in/shopify";import{ProductInfo as C}from"./ProductInfo";import N from"../../context/hooks/useCountries";const k=({copy:t,shippingAddress:s,setAddress:i,validateAddress:m,validateErrors:a,shippingProduct:d,loading:n,address:p,disabled:l,handlePayment:x,item:c})=>{const{storeDomain:f}=h(),{countries:u=[],isLoading:y}=N({shopifyStoreDomain:f});return o("div",{className:"relative",children:[e("div",{className:b("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:o("div",{children:[s&&e(r,{className:"mb-5 text-[16px] font-bold",html:s}),e(g,{onChange:i,validate:m,errors:a,form:t.redeemModal.product.addressForm,countries:u,countriesLoading:y})]})}),o("div",{className:"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]",children:[o("div",{className:"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]",children:[d&&e(r,{className:"mb-5 text-[16px] font-bold",html:d}),e(C,{item:c,copy:t})]}),e(v,{loading:n||!p,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:x,disabled:l,children:t.redeemModal.product.paymentButton})]})]})};export{k as Address};
1
+ import{jsx as e,jsxs as d}from"react/jsx-runtime";import{Button as N,Text as r}from"@anker-in/headless-ui";import a from"classnames";import{AddressForm as R}from"../AddressForm";import{useHeadlessContext as h,ROUNDED_BRANDS as A}from"@anker-in/lib";import{ProductInfo as C}from"./ProductInfo";import F from"../../context/hooks/useCountries";const M=({copy:o,shippingAddress:t,setAddress:m,validateAddress:i,validateErrors:n,shippingProduct:s,loading:p,address:l,disabled:x,handlePayment:c,item:u})=>{const{storeDomain:f,brand:v}=h(),y=A.includes(v),{countries:b=[],isLoading:g}=F({shopifyStoreDomain:f});return d("div",{className:"relative",children:[e("div",{className:a("max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:d("div",{children:[t&&e(r,{className:"mb-5 text-[16px] font-bold",html:t}),o.redeemModal?.product?.addressForm&&e(R,{onChange:m,validate:i,errors:n,form:o.redeemModal.product.addressForm,countries:b,countriesLoading:g})]})}),d("div",{className:"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]",children:[d("div",{className:a("flex w-full items-center bg-[#F5F5F7] p-[16px]",!y&&"rounded-none"),children:[s&&e(r,{className:"mb-5 text-[16px] font-bold",html:s}),e(C,{item:u,copy:o})]}),e(N,{loading:p||!l,variant:"primary",className:"mx-auto mt-[16px] w-[444px] md:mt-[12px] md:w-full",onClick:c,disabled:x,children:o.redeemModal.product.paymentButton})]})]})};export{M as Address};
2
2
  //# sourceMappingURL=Address.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx"],
4
- "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { AddressForm } from '../AddressForm'\nimport { useShopifyContext } from '@anker-in/shopify'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\nimport useCountries from '../../context/hooks/useCountries'\n\ntype AddressProps = {\n copy: CreditsRedeemListCopy\n shippingAddress: string\n setAddress: (address: Record<string, any>) => void\n validateAddress: (address: Record<string, any>) => boolean\n validateErrors: { key: string; message: string }[]\n item: RedeemableItemType\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n handlePayment: () => void\n shippingProduct: string\n}\n\nexport const Address = ({\n copy,\n shippingAddress,\n setAddress,\n validateAddress,\n validateErrors,\n shippingProduct,\n loading,\n address,\n disabled,\n handlePayment,\n item,\n}: AddressProps) => {\n const { storeDomain } = useShopifyContext()\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n return (\n <div className=\"relative\">\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div>\n {shippingAddress && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingAddress}></Text>}\n <AddressForm\n onChange={setAddress}\n validate={validateAddress}\n errors={validateErrors}\n form={copy.redeemModal.product.addressForm}\n countries={countries}\n countriesLoading={countriesLoading}\n ></AddressForm>\n </div>\n </div>\n <div className=\"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]\">\n <div className=\"flex w-full items-center rounded-[16px] bg-[#F5F5F7] p-[16px]\">\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n <ProductInfo item={item} copy={copy} />\n </div>\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={handlePayment}\n disabled={disabled}\n >\n {copy.redeemModal.product.paymentButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "AA0CQ,OACsB,OAAAA,EADtB,QAAAC,MAAA,oBA1CR,OAAS,UAAAC,EAAQ,QAAAC,MAAY,wBAC7B,OAAOC,MAAgB,aACvB,OAAS,eAAAC,MAAmB,iBAC5B,OAAS,qBAAAC,MAAyB,oBAGlC,OAAS,eAAAC,MAAmB,gBAC5B,OAAOC,MAAkB,mCAgBlB,MAAMC,EAAU,CAAC,CACtB,KAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,cAAAC,EACA,KAAAC,CACF,IAAoB,CAClB,KAAM,CAAE,YAAAC,CAAY,EAAIf,EAAkB,EACpC,CAAE,UAAAgB,EAAY,CAAC,EAAG,UAAWC,CAAiB,EAAIf,EAAa,CAAE,mBAAoBa,CAAY,CAAC,EAExG,OACEpB,EAAC,OAAI,UAAU,WACb,UAAAD,EAAC,OAAI,UAAWI,EAAW,iFAAiF,EAC1G,SAAAH,EAAC,OACE,UAAAU,GAAmBX,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMQ,EAAiB,EACxFX,EAACK,EAAA,CACC,SAAUO,EACV,SAAUC,EACV,OAAQC,EACR,KAAMJ,EAAK,YAAY,QAAQ,YAC/B,UAAWY,EACX,iBAAkBC,EACnB,GACH,EACF,EACAtB,EAAC,OAAI,UAAU,qGACb,UAAAA,EAAC,OAAI,UAAU,gEACZ,UAAAc,GAAmBf,EAACG,EAAA,CAAK,UAAU,6BAA6B,KAAMY,EAAiB,EACxFf,EAACO,EAAA,CAAY,KAAMa,EAAM,KAAMV,EAAM,GACvC,EACAV,EAACE,EAAA,CACC,QAASc,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAR,EAAK,YAAY,QAAQ,cAC5B,GACF,GACF,CAEJ",
6
- "names": ["jsx", "jsxs", "Button", "Text", "classNames", "AddressForm", "useShopifyContext", "ProductInfo", "useCountries", "Address", "copy", "shippingAddress", "setAddress", "validateAddress", "validateErrors", "shippingProduct", "loading", "address", "disabled", "handlePayment", "item", "storeDomain", "countries", "countriesLoading"]
4
+ "sourcesContent": ["import { Button, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { AddressForm } from '../AddressForm'\nimport { useHeadlessContext, ROUNDED_BRANDS } from '@anker-in/lib'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ProductInfo } from './ProductInfo'\nimport useCountries from '../../context/hooks/useCountries'\n\ntype AddressProps = {\n copy: CreditsRedeemListCopy\n shippingAddress: string\n setAddress: (address: Record<string, any>) => void\n validateAddress: (address: Record<string, any>) => boolean\n validateErrors: { key: string; message: string }[]\n item: RedeemableItemType\n loading: boolean\n address: Record<string, any> | undefined\n disabled: boolean\n handlePayment: () => void\n shippingProduct: string\n}\n\nexport const Address = ({\n copy,\n shippingAddress,\n setAddress,\n validateAddress,\n validateErrors,\n shippingProduct,\n loading,\n address,\n disabled,\n handlePayment,\n item,\n}: AddressProps) => {\n const { storeDomain, brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const { countries = [], isLoading: countriesLoading } = useCountries({ shopifyStoreDomain: storeDomain })\n\n return (\n <div className=\"relative\">\n <div className={classNames('max-h-[500px] overflow-y-auto px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]')}>\n <div>\n {shippingAddress && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingAddress}></Text>}\n {copy.redeemModal?.product?.addressForm && (\n <AddressForm\n onChange={setAddress}\n validate={validateAddress}\n errors={validateErrors}\n form={copy.redeemModal.product.addressForm}\n countries={countries}\n countriesLoading={countriesLoading}\n ></AddressForm>\n )}\n </div>\n </div>\n <div className=\"sticky bottom-0 flex flex-col items-center justify-center bg-white px-[48px] py-[24px] l:px-[16px]\">\n <div className={classNames('flex w-full items-center bg-[#F5F5F7] p-[16px]', !rounded && 'rounded-none')}>\n {shippingProduct && <Text className=\"mb-5 text-[16px] font-bold\" html={shippingProduct}></Text>}\n <ProductInfo item={item} copy={copy} />\n </div>\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={handlePayment}\n disabled={disabled}\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AA,CACC,QAASe,GAAW,CAACC,EACrB,QAAQ,UACR,UAAU,qDACV,QAASE,EACT,SAAUD,EAET,SAAAR,EAAK,YAAY,QAAQ,cAC5B,GACF,GACF,CAEJ",
6
+ "names": ["jsx", "jsxs", "Button", "Text", "classNames", "AddressForm", "useHeadlessContext", "ROUNDED_BRANDS", "ProductInfo", "useCountries", "Address", "copy", "shippingAddress", "setAddress", "validateAddress", "validateErrors", "shippingProduct", "loading", "address", "disabled", "handlePayment", "item", "storeDomain", "brand", "rounded", "countries", "countriesLoading"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Picture as t,Text as s}from"@anker-in/headless-ui";const x=({errorInfo:r})=>a("div",{className:"mx-auto max-w-[404px] text-[16px] text-black/40",children:[e(t,{className:"mx-auto mb-[12px] h-[140px] w-[220px]",source:r.imageUrl}),e(s,{as:"div",className:"mt-[16px] text-center",html:r.message})]});export{x as Error};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Picture as t,Text as s}from"@anker-in/headless-ui";const x=({errorInfo:r})=>a("div",{className:"mx-auto max-w-[404px] text-[16px] text-black/40 py-[56px]",children:[e(t,{className:"mx-auto mb-[12px] h-[140px] w-[220px]",source:r.imageUrl}),e(s,{as:"div",className:"mt-[16px] text-center",html:r.message})]});export{x as Error};
2
2
  //# sourceMappingURL=Error.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Error.tsx"],
4
- "sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\n\ntype ErrorProps = {\n errorInfo: { imageUrl: string; message: string }\n}\n\nexport const Error = ({ errorInfo }: ErrorProps) => {\n return (\n <div className=\"mx-auto max-w-[404px] text-[16px] text-black/40\">\n <Picture className=\"mx-auto mb-[12px] h-[140px] w-[220px]\" source={errorInfo.imageUrl} />\n <Text as=\"div\" className=\"mt-[16px] text-center\" html={errorInfo.message} />\n </div>\n )\n}\n"],
5
- "mappings": "AAQI,OACE,OAAAA,EADF,QAAAC,MAAA,oBARJ,OAAS,WAAAC,EAAS,QAAAC,MAAY,wBAMvB,MAAMC,EAAQ,CAAC,CAAE,UAAAC,CAAU,IAE9BJ,EAAC,OAAI,UAAU,kDACb,UAAAD,EAACE,EAAA,CAAQ,UAAU,wCAAwC,OAAQG,EAAU,SAAU,EACvFL,EAACG,EAAA,CAAK,GAAG,MAAM,UAAU,wBAAwB,KAAME,EAAU,QAAS,GAC5E",
4
+ "sourcesContent": ["import { Picture, Text } from '@anker-in/headless-ui'\n\ntype ErrorProps = {\n errorInfo: { imageUrl: string; message: string }\n}\n\nexport const Error = ({ errorInfo }: ErrorProps) => {\n return (\n <div className=\"mx-auto max-w-[404px] text-[16px] text-black/40 py-[56px]\">\n <Picture className=\"mx-auto mb-[12px] h-[140px] w-[220px]\" source={errorInfo.imageUrl} />\n <Text as=\"div\" className=\"mt-[16px] text-center\" html={errorInfo.message} />\n </div>\n )\n}\n"],
5
+ "mappings": "AAQI,OACE,OAAAA,EADF,QAAAC,MAAA,oBARJ,OAAS,WAAAC,EAAS,QAAAC,MAAY,wBAMvB,MAAMC,EAAQ,CAAC,CAAE,UAAAC,CAAU,IAE9BJ,EAAC,OAAI,UAAU,4DACb,UAAAD,EAACE,EAAA,CAAQ,UAAU,wCAAwC,OAAQG,EAAU,SAAU,EACvFL,EAACG,EAAA,CAAK,GAAG,MAAM,UAAU,wBAAwB,KAAME,EAAU,QAAS,GAC5E",
6
6
  "names": ["jsx", "jsxs", "Picture", "Text", "Error", "errorInfo"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as b,jsx as e,jsxs as s}from"react/jsx-runtime";import{Button as f,Picture as i,Text as a}from"@anker-in/headless-ui";import m from"classnames";import{Fragment as u,useMemo as g}from"react";import{numberFormat as v}from"../../context/utils";import{ConsumeType as r}from"../../context/const";const F=({copy:l,item:t,loading:x,disabled:n,setStatus:c})=>{const p=g(()=>t.config.rules?.length?t.config.rules:[...t.config.desc?.split("<br>")||[],...l.redeemModal.product.rules||[]],[t.config.rules,t.config.desc,l.redeemModal.product.rules]);return console.log("item",t),s("div",{className:"flex flex-col",children:[e("div",{className:m("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:s(b,{children:[s("div",{className:"relative mx-auto h-[164px] w-fit",children:[e(i,{source:t.config?.type===r.Product?t.product.images[0]?.url:l?.imageMapping[t.config.type]?.url||t.config.image?.url,className:"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),e("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:t.config.value&&s("div",{className:"flex items-end gap-[4px]",children:[e(a,{className:"text-[64px] font-bold leading-none",html:t.config.value.toString()}),e(a,{className:"text-[24px] font-bold leading-[2]",html:t.config.type===r.Coupon?l?.off:l?.giftCardLabel})]})})]}),s("div",{className:"mt-[30px] md:mt-[18px]",children:[t.config.type==="product"&&e("div",{className:m("mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:t.config.title}),s(a,{as:"p",className:m(" text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:[v(t.alpc?.consumeCredits)," ",l?.pointUnit]})]}),s("div",{className:"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]",children:[e("div",{className:"text-[16px] font-bold leading-[1.4]",children:l.redeemModal.product.stepTitle}),e("div",{className:"mt-[4px] flex items-center justify-center",children:l.redeemModal.product.steps?.map((d,o)=>s(u,{children:[s("div",{className:"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]",children:[e(i,{source:d.imageUrl,className:"mb-[4px] h-[58px] w-[58px]"}),e("div",{className:"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]",children:d.title})]}),o!==l.redeemModal.product.steps.length-1&&e(i,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150",className:"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]"})]},o))}),e("div",{className:"overflow-auto",children:p?.length&&e("ul",{className:"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]",children:p.map((d,o)=>e("li",{className:"list-disc",children:e(a,{as:"div",html:d,className:"font-bold"})},o))})})]})]})}),s("div",{className:"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]",children:[e(a,{as:"p",className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:l.redeemModal.confirmTitle}),e(f,{loading:x,disabled:n,variant:"primary",size:"lg",className:"mt-[16px] w-full md:mt-[12px]",onClick:()=>{c("address")},children:l.redeemModal.confirmButton})]})]})};export{F as Init};
1
+ import{Fragment as w,jsx as e,jsxs as o}from"react/jsx-runtime";import{Button as u,Picture as m,Text as i}from"@anker-in/headless-ui";import a from"classnames";import{Fragment as f,useMemo as g}from"react";import{numberFormat as v}from"../../context/utils";import{ConsumeType as b}from"../../context/const";import{NoneProductValue as N}from"./NonProductValue";import{useCreditsContext as h}from"../../context/provider";const B=({copy:s,item:t,loading:x,disabled:n,setStatus:c})=>{const{pageCommon:p}=h(),r=g(()=>t.config.rules?.length?t.config.rules:[...t.config.desc?.split("<br>")||[],...s.redeemModal.product.rules||[]],[t.config.rules,t.config.desc,s.redeemModal.product.rules]);return o("div",{className:"flex flex-col",children:[e("div",{className:a("max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]"),children:o(w,{children:[o("div",{className:"relative mx-auto h-[164px] w-fit",children:[e(m,{source:t.config?.type===b.Product?t.product.images[0]?.url:p?.imageMapping?.[t.config.type]?.url||t.config.image?.url,className:"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain"}),e("div",{className:"absolute bottom-[8px] left-[16px] font-extrabold text-white",children:t.config.value&&e(N,{item:t,copy:s})})]}),o("div",{className:"mt-[30px] md:mt-[18px]",children:[t.config.type==="product"&&e("div",{className:a("mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:t.config.title}),o(i,{as:"p",className:a(" text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]"),children:[v(t.alpc?.consumeCredits)," ",p?.pointUnit]})]}),o("div",{className:"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]",children:[e("div",{className:"text-[16px] font-bold leading-[1.4]",children:s.redeemModal.product.stepTitle}),e("div",{className:"mt-[4px] flex items-center justify-center",children:s.redeemModal.product.steps?.map((d,l)=>o(f,{children:[o("div",{className:"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]",children:[e(m,{source:d.imageUrl,className:"mb-[4px] h-[58px] w-[58px]"}),e("div",{className:"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]",children:d.title})]}),l!==s.redeemModal.product.steps.length-1&&e(m,{source:"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150",className:"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]"})]},l))}),e("div",{className:"overflow-auto",children:r?.length&&e("ul",{className:"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]",children:r.map((d,l)=>e("li",{className:"list-disc",children:e(i,{as:"div",html:d,className:"font-bold"})},l))})})]})]})}),o("div",{className:"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]",children:[e(i,{as:"p",className:"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]",html:s.redeemModal.confirmTitle}),e(u,{loading:x,disabled:n,variant:"primary",size:"lg",className:"mt-[16px] w-full md:mt-[12px]",onClick:()=>{c("address")},children:s.redeemModal.confirmButton})]})]})};export{B as Init};
2
2
  //# sourceMappingURL=Init.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx"],
4
- "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment, useMemo } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ConsumeType } from '../../context/const'\n\ntype InitProps = {\n copy: CreditsRedeemListCopy\n item: RedeemableItemType\n loading: boolean\n disabled: boolean\n setStatus: (status: 'address' | 'init' | 'success' | 'error') => void\n}\n\nexport const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) => {\n const rules = useMemo(() => {\n if (item.config.rules?.length) {\n return item.config.rules\n }\n const descriptions = item.config.desc?.split('<br>') || []\n return [...descriptions, ...(copy.redeemModal.product.rules || [])]\n }, [item.config.rules, item.config.desc, copy.redeemModal.product.rules])\n\n console.log('item', item)\n return (\n <div className=\"flex flex-col\">\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <>\n <div className=\"relative mx-auto h-[164px] w-fit\">\n <Picture\n source={\n item.config?.type === ConsumeType.Product\n ? item.product.images[0]?.url\n : copy?.imageMapping[item.config.type]?.url || item.config.image?.url\n }\n className=\"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n {/* \u793C\u54C1\u5361\u5C55\u793A */}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value && (\n <div className=\"flex items-end gap-[4px]\">\n <Text className=\"text-[64px] font-bold leading-none\" html={item.config.value.toString()} />\n <Text\n className=\"text-[24px] font-bold leading-[2]\"\n html={item.config.type === ConsumeType.Coupon ? copy?.off : copy?.giftCardLabel}\n />\n </div>\n )}\n </div>\n </div>\n <div className=\"mt-[30px] md:mt-[18px]\">\n {item.config.type === 'product' && (\n <div\n className={classNames(\n 'mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {item.config.title}\n </div>\n )}\n <Text\n as=\"p\"\n className={classNames(' text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]')}\n >\n {numberFormat(item.alpc?.consumeCredits)} {copy?.pointUnit}\n </Text>\n </div>\n <div className=\"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{copy.redeemModal.product.stepTitle}</div>\n <div className=\"mt-[4px] flex items-center justify-center\">\n {copy.redeemModal.product.steps?.map((item, index) => (\n <Fragment key={index}>\n <div className=\"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]\">\n <Picture source={item.imageUrl} className=\"mb-[4px] h-[58px] w-[58px]\"></Picture>\n <div className=\"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]\">\n {item.title}\n </div>\n </div>\n {index !== copy.redeemModal.product.steps.length - 1 && (\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150\"\n className=\"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]\"\n ></Picture>\n )}\n </Fragment>\n ))}\n </div>\n <div className=\"overflow-auto\">\n {rules?.length && (\n <ul className=\"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]\">\n {rules.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text as=\"div\" html={text} className=\"font-bold\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n </>\n </div>\n <div className=\"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]\">\n <Text\n as=\"p\"\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n disabled={disabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full md:mt-[12px]\"\n onClick={() => {\n setStatus('address')\n }}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "AAiCQ,mBAAAA,EAEI,OAAAC,EAWI,QAAAC,MAbR,oBAjCR,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAOC,MAAgB,aACvB,OAAS,YAAAN,EAAU,WAAAO,MAAe,QAClC,OAAS,gBAAAC,MAAoB,sBAG7B,OAAS,eAAAC,MAAmB,sBAUrB,MAAMC,EAAO,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,SAAAC,EAAU,UAAAC,CAAU,IAAiB,CAC/E,MAAMC,EAAQT,EAAQ,IAChBK,EAAK,OAAO,OAAO,OACdA,EAAK,OAAO,MAGd,CAAC,GADaA,EAAK,OAAO,MAAM,MAAM,MAAM,GAAK,CAAC,EAChC,GAAID,EAAK,YAAY,QAAQ,OAAS,CAAC,CAAE,EACjE,CAACC,EAAK,OAAO,MAAOA,EAAK,OAAO,KAAMD,EAAK,YAAY,QAAQ,KAAK,CAAC,EAExE,eAAQ,IAAI,OAAQC,CAAI,EAEtBV,EAAC,OAAI,UAAU,gBACb,UAAAD,EAAC,OACC,UAAWK,EACT,8FACF,EAEA,SAAAJ,EAAAF,EAAA,CACE,UAAAE,EAAC,OAAI,UAAU,mCACb,UAAAD,EAACG,EAAA,CACC,OACEQ,EAAK,QAAQ,OAASH,EAAY,QAC9BG,EAAK,QAAQ,OAAO,CAAC,GAAG,IACxBD,GAAM,aAAaC,EAAK,OAAO,IAAI,GAAG,KAAOA,EAAK,OAAO,OAAO,IAEtE,UAAU,qEACX,EAEDX,EAAC,OAAI,UAAU,8DACZ,S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+DACb,UAAAD,EAACI,EAAA,CACC,GAAG,IACH,UAAU,4EACV,KAAMM,EAAK,YAAY,aACxB,EACDV,EAACE,EAAA,CACC,QAASU,EACT,SAAUC,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbC,EAAU,SAAS,CACrB,EAEC,SAAAJ,EAAK,YAAY,cACpB,GACF,GACF,CAEJ",
6
- "names": ["Fragment", "jsx", "jsxs", "Button", "Picture", "Text", "classNames", "useMemo", "numberFormat", "ConsumeType", "Init", "copy", "item", "loading", "disabled", "setStatus", "rules", "index", "text"]
4
+ "sourcesContent": ["import { Button, Picture, Text } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport { Fragment, useMemo } from 'react'\nimport { numberFormat } from '../../context/utils'\nimport type { RedeemableItem as RedeemableItemType } from '../../type'\nimport { CreditsRedeemListCopy } from '../type'\nimport { ConsumeType } from '../../context/const'\nimport { NoneProductValue } from './NonProductValue'\nimport { useCreditsContext } from '../../context/provider'\n\ntype InitProps = {\n copy: CreditsRedeemListCopy\n item: RedeemableItemType\n loading: boolean\n disabled: boolean\n setStatus: (status: 'address' | 'init' | 'success' | 'error') => void\n}\n\nexport const Init = ({ copy, item, loading, disabled, setStatus }: InitProps) => {\n const { pageCommon } = useCreditsContext()\n const rules = useMemo(() => {\n if (item.config.rules?.length) {\n return item.config.rules\n }\n const descriptions = item.config.desc?.split('<br>') || []\n return [...descriptions, ...(copy.redeemModal.product.rules || [])]\n }, [item.config.rules, item.config.desc, copy.redeemModal.product.rules])\n\n return (\n <div className=\"flex flex-col\">\n <div\n className={classNames(\n 'max-h-[500px] overflow-y-auto bg-[#F5F5F7] px-[48px] pb-[24px] md:max-h-[400px] md:px-[16px]'\n )}\n >\n <>\n <div className=\"relative mx-auto h-[164px] w-fit\">\n <Picture\n source={\n item.config?.type === ConsumeType.Product\n ? item.product.images[0]?.url\n : pageCommon?.imageMapping?.[item.config.type]?.url || item.config.image?.url\n }\n className=\"h-full w-auto [&_img]:h-full [&_img]:w-auto [&_img]:object-contain\"\n ></Picture>\n {/* \u793C\u54C1\u5361\u5C55\u793A */}\n <div className=\"absolute bottom-[8px] left-[16px] font-extrabold text-white\">\n {item.config.value && <NoneProductValue item={item} copy={copy} />}\n </div>\n </div>\n <div className=\"mt-[30px] md:mt-[18px]\">\n {item.config.type === 'product' && (\n <div\n className={classNames(\n 'mb-[4px] text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]'\n )}\n >\n {item.config.title}\n </div>\n )}\n <Text\n as=\"p\"\n className={classNames(' text-center text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]')}\n >\n {numberFormat(item.alpc?.consumeCredits)} {pageCommon?.pointUnit}\n </Text>\n </div>\n <div className=\"mt-[16px] w-full text-[14px] font-semibold text-[#777] md:mt-[12px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{copy.redeemModal.product.stepTitle}</div>\n <div className=\"mt-[4px] flex items-center justify-center\">\n {copy.redeemModal.product.steps?.map((item, index) => (\n <Fragment key={index}>\n <div className=\"flex w-[76px] flex-col items-center text-center md:h-[94px] min-l:w-[130px]\">\n <Picture source={item.imageUrl} className=\"mb-[4px] h-[58px] w-[58px]\"></Picture>\n <div className=\"min-h-[34px] text-[14px] font-bold text-[#777] md:min-h-[28px] md:text-[12px]\">\n {item.title}\n </div>\n </div>\n {index !== copy.redeemModal.product.steps.length - 1 && (\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0517/6767/3016/files/step-arrow.png?v=1690458150\"\n className=\"mb-[20px] h-[10px] w-[20px] md:mb-[30px] md:h-[5px] md:w-[12px]\"\n ></Picture>\n )}\n </Fragment>\n ))}\n </div>\n <div className=\"overflow-auto\">\n {rules?.length && (\n <ul className=\"ml-[18px] mt-[16px] grid grid-flow-row gap-[4px] text-[16px] font-bold leading-[1.4] text-[#6D6D6F] md:mt-[12px]\">\n {rules.map((text, index) => (\n <li className=\"list-disc\" key={index}>\n <Text as=\"div\" html={text} className=\"font-bold\" />\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n </>\n </div>\n <div className=\"flex-1 bg-white px-[48px] py-[24px] text-center md:px-[16px]\">\n <Text\n as=\"p\"\n className=\"block text-[24px] font-bold leading-[1.2] md:text-[20px] md:leading-[1.2]\"\n html={copy.redeemModal.confirmTitle}\n ></Text>\n <Button\n loading={loading}\n disabled={disabled}\n variant=\"primary\"\n size=\"lg\"\n className=\"mt-[16px] w-full md:mt-[12px]\"\n onClick={() => {\n setStatus('address')\n }}\n >\n {copy.redeemModal.confirmButton}\n </Button>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AAmCQ,mBAAAA,EAEI,OAAAC,EADF,QAAAC,MADF,oBAnCR,OAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,wBACtC,OAAOC,MAAgB,aACvB,OAAS,YAAAN,EAAU,WAAAO,MAAe,QAClC,OAAS,gBAAAC,MAAoB,sBAG7B,OAAS,eAAAC,MAAmB,sBAC5B,OAAS,oBAAAC,MAAwB,oBACjC,OAAS,qBAAAC,MAAyB,yBAU3B,MAAMC,EAAO,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAM,QAAAC,EAAS,SAAAC,EAAU,UAAAC,CAAU,IAAiB,CAC/E,KAAM,CAAE,WAAAC,CAAW,EAAIP,EAAkB,EACnCQ,EAAQZ,EAAQ,IAChBO,EAAK,OAAO,OAAO,OACdA,EAAK,OAAO,MAGd,CAAC,GADaA,EAAK,OAAO,MAAM,MAAM,MAAM,GAAK,CAAC,EAChC,GAAID,EAAK,YAAY,QAAQ,OAAS,CAAC,CAAE,EACjE,CAACC,EAAK,OAAO,MAAOA,EAAK,OAAO,KAAMD,EAAK,YAAY,QAAQ,KAAK,CAAC,EAExE,OACEX,EAAC,OAAI,UAAU,gBACb,UAAAD,EAAC,OACC,UAAWK,EACT,8FACF,EAEA,SAAAJ,EAAAF,EAAA,CACE,UAAAE,EAAC,OAAI,UAAU,mCACb,UAAAD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D,CAE/B,CACD,EACH,EAEJ,GACF,GACF,EACF,EACAlB,EAAC,OAAI,UAAU,+DACb,UAAAD,EAACI,EAAA,CACC,GAAG,IACH,UAAU,4EACV,KAAMQ,EAAK,YAAY,aACxB,EACDZ,EAACE,EAAA,CACC,QAASY,EACT,SAAUC,EACV,QAAQ,UACR,KAAK,KACL,UAAU,gCACV,QAAS,IAAM,CACbC,EAAU,SAAS,CACrB,EAEC,SAAAJ,EAAK,YAAY,cACpB,GACF,GACF,CAEJ",
6
+ "names": ["Fragment", "jsx", "jsxs", "Button", "Picture", "Text", "classNames", "useMemo", "numberFormat", "ConsumeType", "NoneProductValue", "useCreditsContext", "Init", "copy", "item", "loading", "disabled", "setStatus", "pageCommon", "rules", "index", "text"]
7
7
  }
@@ -0,0 +1,6 @@
1
+ import { RedeemableItem } from '../../type';
2
+ import { CreditsRedeemListCopy } from '../type';
3
+ export declare const NoneProductValue: ({ item, copy }: {
4
+ item: RedeemableItem;
5
+ copy: CreditsRedeemListCopy;
6
+ }) => import("react/jsx-runtime").JSX.Element;