@anker-in/campaign-ui 0.3.4 → 0.4.0-beta.1

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 (363) hide show
  1. package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js +1 -1
  2. package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js.map +3 -3
  3. package/dist/cjs/components/LiveChatWidget/components/MessageContent/PromotionList.js.map +2 -2
  4. package/dist/cjs/components/LiveChatWidget/components/MessageList.js +3 -3
  5. package/dist/cjs/components/LiveChatWidget/components/MessageList.js.map +3 -3
  6. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.d.ts +2 -1
  7. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js +1 -1
  8. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js.map +2 -2
  9. package/dist/cjs/components/LiveChatWidget/types.d.ts +2 -1
  10. package/dist/cjs/components/LiveChatWidget/types.js.map +1 -1
  11. package/dist/cjs/components/credits/context/const.d.ts +10 -2
  12. package/dist/cjs/components/credits/context/const.js +1 -1
  13. package/dist/cjs/components/credits/context/const.js.map +2 -2
  14. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  15. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  16. package/dist/cjs/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  17. package/dist/cjs/components/credits/context/hooks/useMyRewards.js +1 -1
  18. package/dist/cjs/components/credits/context/hooks/useMyRewards.js.map +3 -3
  19. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
  20. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js +2 -0
  21. package/dist/cjs/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
  22. package/dist/cjs/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
  23. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js +1 -1
  24. package/dist/cjs/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  25. package/dist/cjs/components/credits/context/provider.d.ts +5 -1
  26. package/dist/cjs/components/credits/context/provider.js +1 -1
  27. package/dist/cjs/components/credits/context/provider.js.map +3 -3
  28. package/dist/cjs/components/credits/context/response.d.ts +1 -0
  29. package/dist/cjs/components/credits/context/response.js.map +1 -1
  30. package/dist/cjs/components/credits/context/utils/atobID.d.ts +1 -0
  31. package/dist/cjs/components/credits/context/utils/atobID.js +2 -0
  32. package/dist/cjs/components/credits/context/utils/atobID.js.map +7 -0
  33. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  34. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  35. package/dist/cjs/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  36. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  37. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  38. package/dist/cjs/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  39. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  40. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  41. package/dist/cjs/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  42. package/dist/cjs/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  43. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js +2 -0
  44. package/dist/cjs/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  45. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
  46. package/dist/cjs/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +2 -2
  47. package/dist/cjs/components/credits/creditsBanner/index.js +2 -2
  48. package/dist/cjs/components/credits/creditsBanner/index.js.map +2 -2
  49. package/dist/cjs/components/credits/creditsCash/CreditsCash.js +1 -1
  50. package/dist/cjs/components/credits/creditsCash/CreditsCash.js.map +2 -2
  51. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
  52. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
  53. package/dist/cjs/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
  54. package/dist/cjs/components/credits/creditsGoGift/index.d.ts +2 -0
  55. package/dist/cjs/components/credits/creditsGoGift/index.js +2 -0
  56. package/dist/cjs/components/credits/creditsGoGift/index.js.map +7 -0
  57. package/dist/cjs/components/credits/creditsGoGift/type.d.ts +22 -0
  58. package/dist/cjs/components/credits/creditsGoGift/type.js +2 -0
  59. package/dist/cjs/components/credits/creditsGoGift/type.js.map +7 -0
  60. package/dist/cjs/components/credits/creditsGofit/CreditsGofit.d.ts +5 -0
  61. package/dist/cjs/components/credits/creditsGofit/CreditsGofit.js +2 -0
  62. package/dist/cjs/components/credits/creditsGofit/CreditsGofit.js.map +7 -0
  63. package/dist/cjs/components/credits/creditsGofit/index.d.ts +2 -0
  64. package/dist/cjs/components/credits/creditsGofit/index.js +2 -0
  65. package/dist/cjs/components/credits/creditsGofit/index.js.map +7 -0
  66. package/dist/cjs/components/credits/creditsGofit/type.d.ts +22 -0
  67. package/dist/cjs/components/credits/creditsGofit/type.js +2 -0
  68. package/dist/cjs/components/credits/creditsGofit/type.js.map +7 -0
  69. package/dist/cjs/components/credits/creditsInfoCard/index.js +1 -1
  70. package/dist/cjs/components/credits/creditsInfoCard/index.js.map +3 -3
  71. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
  72. package/dist/cjs/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +2 -2
  73. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
  74. package/dist/cjs/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
  75. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
  76. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
  77. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
  78. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
  79. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
  80. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
  81. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
  82. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  83. package/dist/cjs/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  84. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
  85. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  86. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
  87. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
  88. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  89. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
  90. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
  91. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
  92. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
  93. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
  94. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  95. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
  96. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
  97. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  98. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
  99. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
  100. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  101. package/dist/cjs/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  102. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
  103. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
  104. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
  105. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
  106. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
  107. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
  108. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
  109. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
  110. package/dist/cjs/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
  111. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  112. package/dist/cjs/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
  113. package/dist/cjs/components/credits/creditsRedeemList/type.d.ts +11 -0
  114. package/dist/cjs/components/credits/creditsRedeemList/type.js +1 -1
  115. package/dist/cjs/components/credits/creditsRedeemList/type.js.map +1 -1
  116. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
  117. package/dist/cjs/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +2 -2
  118. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
  119. package/dist/cjs/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
  120. package/dist/cjs/components/credits/index.d.ts +2 -1
  121. package/dist/cjs/components/credits/index.js +1 -1
  122. package/dist/cjs/components/credits/index.js.map +3 -3
  123. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +16 -0
  124. package/dist/cjs/components/credits/modal/MyRewardsModal.js +1 -1
  125. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +3 -3
  126. package/dist/cjs/components/credits/modal/RewardsModal.d.ts +64 -0
  127. package/dist/cjs/components/credits/modal/RewardsModal.js +2 -0
  128. package/dist/cjs/components/credits/modal/RewardsModal.js.map +7 -0
  129. package/dist/cjs/components/credits/modal/activitiesModal.d.ts +1 -1
  130. package/dist/cjs/components/credits/modal/activitiesModal.js +2 -2
  131. package/dist/cjs/components/credits/modal/activitiesModal.js.map +3 -3
  132. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js +2 -2
  133. package/dist/cjs/components/credits/modal/creditsUploadReceiptModal.js.map +3 -3
  134. package/dist/cjs/components/credits/modal/loadingDots.js +1 -1
  135. package/dist/cjs/components/credits/modal/loadingDots.js.map +2 -2
  136. package/dist/cjs/components/credits/modal/modalContainer.js +2 -2
  137. package/dist/cjs/components/credits/modal/modalContainer.js.map +4 -4
  138. package/dist/cjs/components/credits/modal/rulesModal.d.ts +1 -1
  139. package/dist/cjs/components/credits/modal/rulesModal.js +2 -2
  140. package/dist/cjs/components/credits/modal/rulesModal.js.map +3 -3
  141. package/dist/cjs/components/credits/modal/subscribeModal.d.ts +1 -1
  142. package/dist/cjs/components/credits/modal/subscribeModal.js +2 -2
  143. package/dist/cjs/components/credits/modal/subscribeModal.js.map +3 -3
  144. package/dist/cjs/components/credits/modal/tip.js +1 -1
  145. package/dist/cjs/components/credits/modal/tip.js.map +2 -2
  146. package/dist/cjs/components/credits/type.d.ts +67 -5
  147. package/dist/cjs/components/credits/type.js +1 -1
  148. package/dist/cjs/components/credits/type.js.map +1 -1
  149. package/dist/cjs/stories/LiveChatWidget.stories.js +2 -9
  150. package/dist/cjs/stories/LiveChatWidget.stories.js.map +2 -2
  151. package/dist/cjs/templates/Credits.d.ts +1 -87
  152. package/dist/cjs/templates/Credits.js +1 -1
  153. package/dist/cjs/templates/Credits.js.map +3 -3
  154. package/dist/cjs/templates/Credits.types.d.ts +96 -0
  155. package/dist/cjs/templates/Credits.types.js +2 -0
  156. package/dist/cjs/templates/Credits.types.js.map +7 -0
  157. package/dist/esm/components/LiveChatWidget/LiveChatWidget.js +1 -1
  158. package/dist/esm/components/LiveChatWidget/LiveChatWidget.js.map +3 -3
  159. package/dist/esm/components/LiveChatWidget/components/MessageContent/PromotionList.js.map +2 -2
  160. package/dist/esm/components/LiveChatWidget/components/MessageList.js +3 -3
  161. package/dist/esm/components/LiveChatWidget/components/MessageList.js.map +3 -3
  162. package/dist/esm/components/LiveChatWidget/hooks/useChatState.d.ts +2 -1
  163. package/dist/esm/components/LiveChatWidget/hooks/useChatState.js +1 -1
  164. package/dist/esm/components/LiveChatWidget/hooks/useChatState.js.map +2 -2
  165. package/dist/esm/components/LiveChatWidget/types.d.ts +2 -1
  166. package/dist/esm/components/credits/context/const.d.ts +10 -2
  167. package/dist/esm/components/credits/context/const.js +1 -1
  168. package/dist/esm/components/credits/context/const.js.map +2 -2
  169. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.d.ts +7 -0
  170. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js +2 -0
  171. package/dist/esm/components/credits/context/hooks/useFunctionMemberPrice.js.map +7 -0
  172. package/dist/esm/components/credits/context/hooks/useMyRewards.js +1 -1
  173. package/dist/esm/components/credits/context/hooks/useMyRewards.js.map +3 -3
  174. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.d.ts +17 -0
  175. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js +2 -0
  176. package/dist/esm/components/credits/context/hooks/useRedeemGoGift.js.map +7 -0
  177. package/dist/esm/components/credits/context/hooks/useRedeemableList.d.ts +7 -2
  178. package/dist/esm/components/credits/context/hooks/useRedeemableList.js +1 -1
  179. package/dist/esm/components/credits/context/hooks/useRedeemableList.js.map +3 -3
  180. package/dist/esm/components/credits/context/provider.d.ts +5 -1
  181. package/dist/esm/components/credits/context/provider.js +1 -1
  182. package/dist/esm/components/credits/context/provider.js.map +3 -3
  183. package/dist/esm/components/credits/context/response.d.ts +1 -0
  184. package/dist/esm/components/credits/context/utils/atobID.d.ts +1 -0
  185. package/dist/esm/components/credits/context/utils/atobID.js +2 -0
  186. package/dist/esm/components/credits/context/utils/atobID.js.map +7 -0
  187. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.d.ts +5 -0
  188. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js +2 -0
  189. package/dist/esm/components/credits/context/utils/functionDiscountCalculate.js.map +7 -0
  190. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.d.ts +8 -0
  191. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js +2 -0
  192. package/dist/esm/components/credits/context/utils/getFunctionMemberPrice.js.map +7 -0
  193. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.d.ts +9 -0
  194. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js +2 -0
  195. package/dist/esm/components/credits/context/utils/getFunctionMemberPriceDiscountConfig.js.map +7 -0
  196. package/dist/esm/components/credits/context/utils/variantGetCoupon.d.ts +6 -0
  197. package/dist/esm/components/credits/context/utils/variantGetCoupon.js +2 -0
  198. package/dist/esm/components/credits/context/utils/variantGetCoupon.js.map +7 -0
  199. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js +1 -1
  200. package/dist/esm/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.js.map +1 -1
  201. package/dist/esm/components/credits/creditsBanner/index.js +2 -2
  202. package/dist/esm/components/credits/creditsBanner/index.js.map +2 -2
  203. package/dist/esm/components/credits/creditsCash/CreditsCash.js +1 -1
  204. package/dist/esm/components/credits/creditsCash/CreditsCash.js.map +1 -1
  205. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.d.ts +5 -0
  206. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js +2 -0
  207. package/dist/esm/components/credits/creditsGoGift/CreditsGoGift.js.map +7 -0
  208. package/dist/esm/components/credits/creditsGoGift/index.d.ts +2 -0
  209. package/dist/esm/components/credits/creditsGoGift/index.js +2 -0
  210. package/dist/esm/components/credits/creditsGoGift/index.js.map +7 -0
  211. package/dist/esm/components/credits/creditsGoGift/type.d.ts +22 -0
  212. package/dist/esm/components/credits/creditsGoGift/type.js +1 -0
  213. package/dist/esm/components/credits/creditsGoGift/type.js.map +7 -0
  214. package/dist/esm/components/credits/creditsGofit/CreditsGofit.d.ts +5 -0
  215. package/dist/esm/components/credits/creditsGofit/CreditsGofit.js +2 -0
  216. package/dist/esm/components/credits/creditsGofit/CreditsGofit.js.map +7 -0
  217. package/dist/esm/components/credits/creditsGofit/index.d.ts +2 -0
  218. package/dist/esm/components/credits/creditsGofit/index.js +2 -0
  219. package/dist/esm/components/credits/creditsGofit/index.js.map +7 -0
  220. package/dist/esm/components/credits/creditsGofit/type.d.ts +22 -0
  221. package/dist/esm/components/credits/creditsGofit/type.js +1 -0
  222. package/dist/esm/components/credits/creditsGofit/type.js.map +7 -0
  223. package/dist/esm/components/credits/creditsInfoCard/index.js +1 -1
  224. package/dist/esm/components/credits/creditsInfoCard/index.js.map +3 -3
  225. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js +1 -1
  226. package/dist/esm/components/credits/creditsMemberPrice/CreditsMemberPrice.js.map +1 -1
  227. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js +1 -1
  228. package/dist/esm/components/credits/creditsRedeemList/CreditsRedeemList.js.map +3 -3
  229. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.d.ts +10 -0
  230. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js +2 -0
  231. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.js.map +7 -0
  232. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.d.ts +10 -0
  233. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js +2 -0
  234. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.js.map +7 -0
  235. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.d.ts +4 -5
  236. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js +1 -1
  237. package/dist/esm/components/credits/creditsRedeemList/RedeemCouponModal.js.map +3 -3
  238. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.d.ts +2 -3
  239. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js +1 -1
  240. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Address.js.map +2 -2
  241. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.d.ts +2 -3
  242. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js +1 -1
  243. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Init.js.map +2 -2
  244. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.d.ts +1 -3
  245. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js +1 -1
  246. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.js.map +3 -3
  247. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.d.ts +3 -4
  248. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js +1 -1
  249. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.js.map +2 -2
  250. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.d.ts +2 -3
  251. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js +1 -1
  252. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/Success.js.map +2 -2
  253. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.d.ts +4 -5
  254. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js +1 -1
  255. package/dist/esm/components/credits/creditsRedeemList/RedeemProductModal/index.js.map +3 -3
  256. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.d.ts +10 -0
  257. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js +2 -0
  258. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.js.map +7 -0
  259. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.d.ts +9 -0
  260. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js +2 -0
  261. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.js.map +7 -0
  262. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.d.ts +8 -0
  263. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js +2 -0
  264. package/dist/esm/components/credits/creditsRedeemList/RedeemVirtualProductModal.js.map +7 -0
  265. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js +1 -1
  266. package/dist/esm/components/credits/creditsRedeemList/RedeemableItem.js.map +2 -2
  267. package/dist/esm/components/credits/creditsRedeemList/type.d.ts +11 -0
  268. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js +1 -1
  269. package/dist/esm/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.js.map +1 -1
  270. package/dist/esm/components/credits/creditsWaysToGetCredits/type.d.ts +2 -2
  271. package/dist/esm/components/credits/creditsWaysToGetCredits/type.js.map +1 -1
  272. package/dist/esm/components/credits/index.d.ts +2 -1
  273. package/dist/esm/components/credits/index.js +1 -1
  274. package/dist/esm/components/credits/index.js.map +3 -3
  275. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +16 -0
  276. package/dist/esm/components/credits/modal/MyRewardsModal.js +1 -1
  277. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +3 -3
  278. package/dist/esm/components/credits/modal/RewardsModal.d.ts +64 -0
  279. package/dist/esm/components/credits/modal/RewardsModal.js +2 -0
  280. package/dist/esm/components/credits/modal/RewardsModal.js.map +7 -0
  281. package/dist/esm/components/credits/modal/activitiesModal.d.ts +1 -1
  282. package/dist/esm/components/credits/modal/activitiesModal.js +2 -2
  283. package/dist/esm/components/credits/modal/activitiesModal.js.map +3 -3
  284. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js +2 -2
  285. package/dist/esm/components/credits/modal/creditsUploadReceiptModal.js.map +2 -2
  286. package/dist/esm/components/credits/modal/loadingDots.js +1 -1
  287. package/dist/esm/components/credits/modal/loadingDots.js.map +2 -2
  288. package/dist/esm/components/credits/modal/modalContainer.js +2 -2
  289. package/dist/esm/components/credits/modal/modalContainer.js.map +3 -3
  290. package/dist/esm/components/credits/modal/rulesModal.d.ts +1 -1
  291. package/dist/esm/components/credits/modal/rulesModal.js +2 -2
  292. package/dist/esm/components/credits/modal/rulesModal.js.map +3 -3
  293. package/dist/esm/components/credits/modal/subscribeModal.d.ts +1 -1
  294. package/dist/esm/components/credits/modal/subscribeModal.js +2 -2
  295. package/dist/esm/components/credits/modal/subscribeModal.js.map +2 -2
  296. package/dist/esm/components/credits/modal/tip.js +1 -1
  297. package/dist/esm/components/credits/modal/tip.js.map +2 -2
  298. package/dist/esm/components/credits/type.d.ts +67 -5
  299. package/dist/esm/stories/LiveChatWidget.stories.js +1 -8
  300. package/dist/esm/stories/LiveChatWidget.stories.js.map +2 -2
  301. package/dist/esm/templates/Credits.d.ts +1 -87
  302. package/dist/esm/templates/Credits.js +1 -1
  303. package/dist/esm/templates/Credits.js.map +3 -3
  304. package/dist/esm/templates/Credits.types.d.ts +96 -0
  305. package/dist/esm/templates/Credits.types.js +2 -0
  306. package/dist/esm/templates/Credits.types.js.map +7 -0
  307. package/package.json +2 -2
  308. package/src/components/LiveChatWidget/LiveChatWidget.tsx +20 -0
  309. package/src/components/LiveChatWidget/components/MessageContent/PromotionList.tsx +1 -1
  310. package/src/components/LiveChatWidget/components/MessageList.tsx +39 -44
  311. package/src/components/LiveChatWidget/hooks/useChatState.ts +4 -3
  312. package/src/components/LiveChatWidget/types.ts +2 -1
  313. package/src/components/credits/context/const.ts +8 -0
  314. package/src/components/credits/context/hooks/useMyRewards.ts +7 -31
  315. package/src/components/credits/context/hooks/useRedeemGoGift.ts +36 -0
  316. package/src/components/credits/context/hooks/useRedeemableList.ts +13 -19
  317. package/src/components/credits/context/provider.tsx +17 -2
  318. package/src/components/credits/context/response.ts +1 -0
  319. package/src/components/credits/creditsAnkersolixTask/CreditsAnkersolixTask.tsx +2 -2
  320. package/src/components/credits/creditsBanner/index.tsx +5 -5
  321. package/src/components/credits/creditsCash/CreditsCash.tsx +1 -1
  322. package/src/components/credits/creditsGoGift/CreditsGoGift.tsx +210 -0
  323. package/src/components/credits/creditsGoGift/index.ts +2 -0
  324. package/src/components/credits/creditsGoGift/type.ts +23 -0
  325. package/src/components/credits/creditsInfoCard/index.tsx +5 -28
  326. package/src/components/credits/creditsMemberPrice/CreditsMemberPrice.tsx +1 -1
  327. package/src/components/credits/creditsRedeemList/CreditsRedeemList.tsx +39 -17
  328. package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponInit.tsx +77 -0
  329. package/src/components/credits/creditsRedeemList/RedeemCouponModal/CouponSuccess.tsx +86 -0
  330. package/src/components/credits/creditsRedeemList/RedeemCouponModal.tsx +29 -138
  331. package/src/components/credits/creditsRedeemList/RedeemProductModal/Address.tsx +5 -6
  332. package/src/components/credits/creditsRedeemList/RedeemProductModal/Init.tsx +11 -12
  333. package/src/components/credits/creditsRedeemList/RedeemProductModal/NonProductValue.tsx +23 -14
  334. package/src/components/credits/creditsRedeemList/RedeemProductModal/ProductInfo.tsx +11 -9
  335. package/src/components/credits/creditsRedeemList/RedeemProductModal/Success.tsx +4 -5
  336. package/src/components/credits/creditsRedeemList/RedeemProductModal/index.tsx +29 -28
  337. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductInit.tsx +101 -0
  338. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal/VirtualProductSuccess.tsx +65 -0
  339. package/src/components/credits/creditsRedeemList/RedeemVirtualProductModal.tsx +156 -0
  340. package/src/components/credits/creditsRedeemList/RedeemableItem.tsx +1 -1
  341. package/src/components/credits/creditsRedeemList/type.ts +11 -0
  342. package/src/components/credits/creditsWaysToGetCredits/CreditsWaysToGetCredits.tsx +2 -2
  343. package/src/components/credits/creditsWaysToGetCredits/type.ts +2 -2
  344. package/src/components/credits/index.ts +2 -1
  345. package/src/components/credits/modal/{activitiesModal.tsx → ActivitiesModal.tsx} +2 -2
  346. package/src/components/credits/modal/{creditsUploadReceiptModal.tsx → CreditsUploadReceiptModal.tsx} +1 -1
  347. package/src/components/credits/modal/{modalContainer.tsx → ModalContainer.tsx} +1 -1
  348. package/src/components/credits/modal/{MyRewardsModal.tsx → RewardsModal.tsx} +145 -103
  349. package/src/components/credits/modal/{rulesModal.tsx → RulesModal.tsx} +1 -1
  350. package/src/components/credits/modal/{subscribeModal.tsx → SubscribeModal.tsx} +1 -1
  351. package/src/components/credits/type.ts +68 -5
  352. package/src/stories/LiveChatWidget.stories.tsx +7 -12
  353. package/src/styles/livechat.css +29 -0
  354. package/src/templates/Credits.tsx +110 -142
  355. package/src/templates/Credits.types.ts +110 -0
  356. package/dist/index.d.mts +0 -1305
  357. package/dist/index.d.ts +0 -1305
  358. package/dist/index.js +0 -26656
  359. package/dist/index.js.map +0 -1
  360. package/dist/index.mjs +0 -26641
  361. package/dist/index.mjs.map +0 -1
  362. /package/src/components/credits/modal/{loadingDots.tsx → LoadingDots.tsx} +0 -0
  363. /package/src/components/credits/modal/{tip.tsx → Tip.tsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../src/components/credits/modal/subscribeModal.tsx"],
4
- "sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\nimport { useRouter } from 'next/router'\nimport { Button, Checkbox, Picture, Text } from '@anker-in/headless-ui'\nimport { classNames, fetcher, gaTrack, useHeadlessContext } from '@anker-in/lib'\nimport Cookies from 'js-cookie'\nimport { parse } from 'query-string'\nimport sha256 from 'crypto-js/sha256'\nimport { useCreditsContext } from '../context/provider'\nimport { ROUNDED_BRANDS } from '../../../constants'\nimport { emailValidate } from '../context/utils'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\n\nexport type CreditsSubscribeModalCopy = {\n title: string\n desc?: string\n placeholder: string\n policy?: string\n successTips?: string\n dealsType?: string\n}\n\ninterface CreditsSubscribeModalProps extends ModalContainerProps {\n copy: CreditsSubscribeModalCopy\n onSuccess?: () => void\n}\n\nconst getAdCookie = () => {\n if (typeof window === 'undefined') {\n return { register_source: '' }\n }\n const { search, href } = window.location || {}\n const query = parse(search)\n\n return {\n fbuy_ref_code: Cookies.get('fbuy_ref_code'),\n affiliate: Cookies.get('affiliate'),\n ref: Cookies.get('ref_ads'),\n inviter_code: query.ic || query.inviter_code || Cookies.get('inviter_code'),\n register_source: query.redirect || Cookies.get('reg_source') || href,\n deals_type: Cookies.get('deal'),\n transfer_id: Cookies.get('transfer_id'),\n }\n}\n\nexport function CreditsSubscribeModal({ copy, onSuccess, ...props }: CreditsSubscribeModalProps) {\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const { locale } = useRouter()\n const [policy, setPolicy] = useState(false)\n const [email, setEmail] = useState('')\n const [errorMessage, setErrorMessage] = useState('')\n const [successMessage, setSuccessMessage] = useState('')\n const [loading, setLoading] = useState(false)\n const { profile } = useCreditsContext()\n\n const handleEmailChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setErrorMessage('')\n setEmail(event.target?.value?.trim())\n }, [])\n\n const handleSubmit = useCallback(async () => {\n setErrorMessage('')\n if (!email) {\n return setErrorMessage('Please fill in your email')\n }\n\n if (!emailValidate(email)) {\n return setErrorMessage('Invalid email address')\n }\n\n if (!policy) {\n return setErrorMessage('Please agree to the policy')\n }\n\n setLoading(true)\n const { register_source } = getAdCookie()\n\n const result = await fetcher({\n locale,\n action: 'subscribe',\n url: '/api/multipass/subscribe/subscribe_emails',\n method: 'POST',\n body: {\n email,\n register_source,\n brand,\n deals_type: copy.dealsType || 'vip_subscribe',\n },\n headers: {},\n type: '',\n })\n setLoading(false)\n\n if (!result.errors) {\n setSuccessMessage(copy.successTips || 'Subscribed successfully!')\n if (onSuccess) {\n onSuccess()\n }\n setTimeout(() => {\n setSuccessMessage('')\n }, 3000)\n gaTrack({\n subscribe_hashed_email: email ? sha256(email) : '',\n })\n gaTrack({\n event: 'ga4Event',\n event_name: 'subscribe',\n event_parameters: {\n page_group: copy.dealsType || 'vip_subscribe',\n position: 'pop_up',\n },\n })\n gaTrack({\n event: 'uaEvent',\n eventCategory: 'subscribe',\n eventAction: copy.dealsType || 'vip_subscribe',\n eventLabel: 'pop_up',\n nonInteraction: false,\n })\n } else {\n setErrorMessage(result.errors || result.statusText)\n }\n }, [email, policy, locale, brand, copy.dealsType, copy.successTips, onSuccess])\n\n useEffect(() => {\n if (profile && profile?.email) {\n setEmail(profile?.email)\n }\n }, [profile])\n\n return (\n <CreditsModalContainer\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-[48px] md:mb-[24px]\"\n titleClassName=\"h-[56px]\"\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n {...props}\n >\n <div className=\"flex flex-col gap-[16px] text-center min-l:px-[16px]\">\n <div>\n <Text className={classNames('mb-[24px] text-[22px] font-bold')} html={copy.title}></Text>\n </div>\n {copy.desc && (\n <Text\n className=\"mb-[8px] text-left text-[16px] font-semibold leading-[1.4] text-[#1F2021]\"\n html={copy.desc}\n ></Text>\n )}\n <div\n className={classNames(\n 'relative flex h-[52px] w-full overflow-hidden rounded-[2px] md:grid md:h-auto md:grid-rows-1 md:gap-[16px]',\n !rounded && 'rounded-none'\n )}\n >\n <input\n className={classNames(\n 'h-full flex-1 rounded-l-[2px] border-[1px] border-[#d8d8d8] px-[14px] py-[17px] text-[16px] font-semibold leading-[1] outline-none placeholder:text-[#999] md:h-[52px] md:rounded-[2px]',\n !rounded && 'rounded-none'\n )}\n placeholder={copy.placeholder}\n value={email}\n onChange={handleEmailChange}\n />\n <Button\n variant=\"primary\"\n onClick={handleSubmit}\n loading={loading}\n className={classNames(\n 'legacy-headless-ui-primary-button !h-full !min-w-0 !rounded-l-none !rounded-r-[2px] !px-[40px] !py-[13px]',\n !rounded && 'rounded-none'\n )}\n >\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0512/8568/8505/files/icon_email.png?v=1697527383\"\n className=\"h-[24px] w-[24px]\"\n alt=\"email\"\n />\n </Button>\n </div>\n <div className=\"flex w-full\">\n <Checkbox checked={policy} onCheckedChange={() => setPolicy(!policy)} required className=\"border-[#1d1d1f]\" />\n <label\n className=\"text-left ml-2 text-[14px] font-semibold text-[#777] [&_a]:underline\"\n dangerouslySetInnerHTML={{\n __html: copy?.policy || '',\n }}\n />\n </div>\n <div\n className={classNames(\n 'w-full text-left text-[16px] font-semibold',\n errorMessage && 'text-[#F84D4F]',\n successMessage && 'text-[#52C41A]'\n )}\n >\n <Text html={successMessage || errorMessage || ''} />\n </div>\n </div>\n </CreditsModalContainer>\n )\n}\n"],
3
+ "sources": ["../../../../../src/components/credits/modal/SubscribeModal.tsx"],
4
+ "sourcesContent": ["import { useCallback, useEffect, useState } from 'react'\nimport { useRouter } from 'next/router'\nimport { Button, Checkbox, Picture, Text } from '@anker-in/headless-ui'\nimport { classNames, fetcher, gaTrack, useHeadlessContext } from '@anker-in/lib'\nimport Cookies from 'js-cookie'\nimport { parse } from 'query-string'\nimport sha256 from 'crypto-js/sha256'\nimport { useCreditsContext } from '../context/provider'\nimport { ROUNDED_BRANDS } from '../../../constants'\nimport { emailValidate } from '../context/utils'\nimport { CreditsModalContainer, type ModalContainerProps } from './ModalContainer'\n\nexport type CreditsSubscribeModalCopy = {\n title: string\n desc?: string\n placeholder: string\n policy?: string\n successTips?: string\n dealsType?: string\n}\n\ninterface CreditsSubscribeModalProps extends ModalContainerProps {\n copy: CreditsSubscribeModalCopy\n onSuccess?: () => void\n}\n\nconst getAdCookie = () => {\n if (typeof window === 'undefined') {\n return { register_source: '' }\n }\n const { search, href } = window.location || {}\n const query = parse(search)\n\n return {\n fbuy_ref_code: Cookies.get('fbuy_ref_code'),\n affiliate: Cookies.get('affiliate'),\n ref: Cookies.get('ref_ads'),\n inviter_code: query.ic || query.inviter_code || Cookies.get('inviter_code'),\n register_source: query.redirect || Cookies.get('reg_source') || href,\n deals_type: Cookies.get('deal'),\n transfer_id: Cookies.get('transfer_id'),\n }\n}\n\nexport function CreditsSubscribeModal({ copy, onSuccess, ...props }: CreditsSubscribeModalProps) {\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n const { locale } = useRouter()\n const [policy, setPolicy] = useState(false)\n const [email, setEmail] = useState('')\n const [errorMessage, setErrorMessage] = useState('')\n const [successMessage, setSuccessMessage] = useState('')\n const [loading, setLoading] = useState(false)\n const { profile } = useCreditsContext()\n\n const handleEmailChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setErrorMessage('')\n setEmail(event.target?.value?.trim())\n }, [])\n\n const handleSubmit = useCallback(async () => {\n setErrorMessage('')\n if (!email) {\n return setErrorMessage('Please fill in your email')\n }\n\n if (!emailValidate(email)) {\n return setErrorMessage('Invalid email address')\n }\n\n if (!policy) {\n return setErrorMessage('Please agree to the policy')\n }\n\n setLoading(true)\n const { register_source } = getAdCookie()\n\n const result = await fetcher({\n locale,\n action: 'subscribe',\n url: '/api/multipass/subscribe/subscribe_emails',\n method: 'POST',\n body: {\n email,\n register_source,\n brand,\n deals_type: copy.dealsType || 'vip_subscribe',\n },\n headers: {},\n type: '',\n })\n setLoading(false)\n\n if (!result.errors) {\n setSuccessMessage(copy.successTips || 'Subscribed successfully!')\n if (onSuccess) {\n onSuccess()\n }\n setTimeout(() => {\n setSuccessMessage('')\n }, 3000)\n gaTrack({\n subscribe_hashed_email: email ? sha256(email) : '',\n })\n gaTrack({\n event: 'ga4Event',\n event_name: 'subscribe',\n event_parameters: {\n page_group: copy.dealsType || 'vip_subscribe',\n position: 'pop_up',\n },\n })\n gaTrack({\n event: 'uaEvent',\n eventCategory: 'subscribe',\n eventAction: copy.dealsType || 'vip_subscribe',\n eventLabel: 'pop_up',\n nonInteraction: false,\n })\n } else {\n setErrorMessage(result.errors || result.statusText)\n }\n }, [email, policy, locale, brand, copy.dealsType, copy.successTips, onSuccess])\n\n useEffect(() => {\n if (profile && profile?.email) {\n setEmail(profile?.email)\n }\n }, [profile])\n\n return (\n <CreditsModalContainer\n className=\"w-[540px] md:h-auto\"\n scrollClassName=\"mb-[40px] min-l:px-[48px] md:mb-[24px]\"\n titleClassName=\"h-[56px]\"\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n {...props}\n >\n <div className=\"flex flex-col gap-[16px] text-center min-l:px-[16px]\">\n <div>\n <Text className={classNames('mb-[24px] text-[22px] font-bold')} html={copy.title}></Text>\n </div>\n {copy.desc && (\n <Text\n className=\"mb-[8px] text-left text-[16px] font-semibold leading-[1.4] text-[#1F2021]\"\n html={copy.desc}\n ></Text>\n )}\n <div\n className={classNames(\n 'relative flex h-[52px] w-full overflow-hidden rounded-[2px] md:grid md:h-auto md:grid-rows-1 md:gap-[16px]',\n !rounded && 'rounded-none'\n )}\n >\n <input\n className={classNames(\n 'h-full flex-1 rounded-l-[2px] border-[1px] border-[#d8d8d8] px-[14px] py-[17px] text-[16px] font-semibold leading-[1] outline-none placeholder:text-[#999] md:h-[52px] md:rounded-[2px]',\n !rounded && 'rounded-none'\n )}\n placeholder={copy.placeholder}\n value={email}\n onChange={handleEmailChange}\n />\n <Button\n variant=\"primary\"\n onClick={handleSubmit}\n loading={loading}\n className={classNames(\n 'legacy-headless-ui-primary-button !h-full !min-w-0 !rounded-l-none !rounded-r-[2px] !px-[40px] !py-[13px]',\n !rounded && 'rounded-none'\n )}\n >\n <Picture\n source=\"https://cdn.shopify.com/s/files/1/0512/8568/8505/files/icon_email.png?v=1697527383\"\n className=\"h-[24px] w-[24px]\"\n alt=\"email\"\n />\n </Button>\n </div>\n <div className=\"flex w-full\">\n <Checkbox checked={policy} onCheckedChange={() => setPolicy(!policy)} required className=\"border-[#1d1d1f]\" />\n <label\n className=\"text-left ml-2 text-[14px] font-semibold text-[#777] [&_a]:underline\"\n dangerouslySetInnerHTML={{\n __html: copy?.policy || '',\n }}\n />\n </div>\n <div\n className={classNames(\n 'w-full text-left text-[16px] font-semibold',\n errorMessage && 'text-[#F84D4F]',\n successMessage && 'text-[#52C41A]'\n )}\n >\n <Text html={successMessage || errorMessage || ''} />\n </div>\n </div>\n </CreditsModalContainer>\n )\n}\n"],
5
5
  "mappings": "AA6IU,cAAAA,EAQF,QAAAC,MARE,oBA7IV,OAAS,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QACjD,OAAS,aAAAC,MAAiB,cAC1B,OAAS,UAAAC,EAAQ,YAAAC,EAAU,WAAAC,EAAS,QAAAC,MAAY,wBAChD,OAAS,cAAAC,EAAY,WAAAC,EAAS,WAAAC,EAAS,sBAAAC,MAA0B,gBACjE,OAAOC,MAAa,YACpB,OAAS,SAAAC,MAAa,eACtB,OAAOC,MAAY,mBACnB,OAAS,qBAAAC,MAAyB,sBAClC,OAAS,kBAAAC,MAAsB,qBAC/B,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,yBAAAC,MAAuD,mBAgBhE,MAAMC,EAAc,IAAM,CACxB,GAAI,OAAO,OAAW,IACpB,MAAO,CAAE,gBAAiB,EAAG,EAE/B,KAAM,CAAE,OAAAC,EAAQ,KAAAC,CAAK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,EAAC,SACC,UAAWU,EACT,0LACA,CAACoB,GAAW,cACd,EACA,YAAaJ,EAAK,YAClB,MAAOQ,EACP,SAAUS,EACZ,EACA3C,EAACM,EAAA,CACC,QAAQ,UACR,QAASuC,EACT,QAASL,EACT,UAAW9B,EACT,4GACA,CAACoB,GAAW,cACd,EAEA,SAAA9B,EAACQ,EAAA,CACC,OAAO,qFACP,UAAU,oBACV,IAAI,QACN,EACF,GACF,EACAP,EAAC,OAAI,UAAU,cACb,UAAAD,EAACO,EAAA,CAAS,QAASyB,EAAQ,gBAAiB,IAAMC,EAAU,CAACD,CAAM,EAAG,SAAQ,GAAC,UAAU,mBAAmB,EAC5GhC,EAAC,SACC,UAAU,uEACV,wBAAyB,CACvB,OAAQ0B,GAAM,QAAU,EAC1B,EACF,GACF,EACA1B,EAAC,OACC,UAAWU,EACT,6CACA0B,GAAgB,iBAChBE,GAAkB,gBACpB,EAEA,SAAAtC,EAACS,EAAA,CAAK,KAAM6B,GAAkBF,GAAgB,GAAI,EACpD,GACF,EACF,CAEJ",
6
6
  "names": ["jsx", "jsxs", "useCallback", "useEffect", "useState", "useRouter", "Button", "Checkbox", "Picture", "Text", "classNames", "fetcher", "gaTrack", "useHeadlessContext", "Cookies", "parse", "sha256", "useCreditsContext", "ROUNDED_BRANDS", "emailValidate", "CreditsModalContainer", "getAdCookie", "search", "href", "query", "CreditsSubscribeModal", "copy", "onSuccess", "props", "brand", "rounded", "locale", "policy", "setPolicy", "email", "setEmail", "errorMessage", "setErrorMessage", "successMessage", "setSuccessMessage", "loading", "setLoading", "profile", "handleEmailChange", "event", "handleSubmit", "register_source", "result"]
7
7
  }
@@ -1,2 +1,2 @@
1
1
  import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useHeadlessContext as d}from"@anker-in/lib";import p from"classnames";import{useState as x}from"react";import{ROUNDED_BRANDS as b}from"../../../constants";function f({info:n,index:t}){const[s,o]=x(!1),{brand:a}=d(),i=b.includes(a);return l("div",{className:"relative ml-[6px] cursor-pointer",onClick:()=>{o(!s)},role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&r.preventDefault()},onMouseOver:()=>{o(!0)},onFocus:()=>{o(!0)},onMouseLeave:()=>{o(!1)},onBlur:()=>{o(!1)},children:[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM9.765 10.7118H8.316C8.316 9.71658 8.95624 9.11788 9.5487 8.56386C10.0589 8.08679 10.5336 7.64285 10.5336 7.0074C10.5336 6.2766 9.9918 5.9112 9.1854 5.9112C8.3916 5.9112 7.7994 6.327 7.5474 7.0704L6.3 6.3648C6.7788 5.13 7.938 4.5 9.2232 4.5C10.6218 4.5 11.9826 5.3316 11.9826 6.9192C11.9826 7.95842 11.3297 8.58584 10.7324 9.15979C10.2289 9.64359 9.765 10.0894 9.765 10.7118ZM9.9918 12.69C9.9918 13.2066 9.5634 13.635 9.0468 13.635C8.5176 13.635 8.1018 13.2066 8.1018 12.69C8.1018 12.1608 8.5176 11.745 9.0468 11.745C9.5634 11.745 9.9918 12.1608 9.9918 12.69Z",fill:"#999999"})}),l("div",{className:p("absolute -right-[14px] hidden min-w-[300px] shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]",t===0?"top-[33px]":"bottom-[33px]",s&&"!block"),children:[e("i",{className:"absolute right-[8px] blur-[12px]",style:t===0?{top:"-9px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderBottom:"8px solid rgba(0,0,0,0.12)"}:{bottom:"-9px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderTop:"8px solid rgba(0,0,0,0.12)"}}),e("i",{className:"absolute right-[8px]",style:t===0?{top:"-7px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderBottom:"8px solid #fff "}:{bottom:"-7px",borderRight:"16px solid transparent ",borderLeft:"16px solid transparent ",borderTop:"8px solid #fff "}}),e("p",{className:p("relative block rounded-[4px] bg-white px-[14px] py-[12px]",!i&&"rounded-none"),children:e("span",{className:"block text-left text-[14px] font-semibold leading-[1.4] text-[#333]",children:n})})]})]})}var C=f;export{C as default};
2
- //# sourceMappingURL=tip.js.map
2
+ //# sourceMappingURL=Tip.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../src/components/credits/modal/tip.tsx"],
3
+ "sources": ["../../../../../src/components/credits/modal/Tip.tsx"],
4
4
  "sourcesContent": ["import { useHeadlessContext } from '@anker-in/lib'\nimport classNames from 'classnames'\nimport { useState } from 'react'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nfunction Tip({ info, index }: { info: string; index: number }) {\n const [show, setShow] = useState(false)\n\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n return (\n <div\n className=\"relative ml-[6px] cursor-pointer\"\n onClick={() => {\n setShow(!show)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n onMouseOver={() => {\n setShow(true)\n }}\n onFocus={() => {\n setShow(true)\n }}\n onMouseLeave={() => {\n setShow(false)\n }}\n onBlur={() => {\n setShow(false)\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM9.765 10.7118H8.316C8.316 9.71658 8.95624 9.11788 9.5487 8.56386C10.0589 8.08679 10.5336 7.64285 10.5336 7.0074C10.5336 6.2766 9.9918 5.9112 9.1854 5.9112C8.3916 5.9112 7.7994 6.327 7.5474 7.0704L6.3 6.3648C6.7788 5.13 7.938 4.5 9.2232 4.5C10.6218 4.5 11.9826 5.3316 11.9826 6.9192C11.9826 7.95842 11.3297 8.58584 10.7324 9.15979C10.2289 9.64359 9.765 10.0894 9.765 10.7118ZM9.9918 12.69C9.9918 13.2066 9.5634 13.635 9.0468 13.635C8.5176 13.635 8.1018 13.2066 8.1018 12.69C8.1018 12.1608 8.5176 11.745 9.0468 11.745C9.5634 11.745 9.9918 12.1608 9.9918 12.69Z\"\n fill=\"#999999\"\n />\n </svg>\n <div\n className={classNames(\n 'absolute -right-[14px] hidden min-w-[300px] shadow-[0px_1px_12px_0px_rgba(0,0,0,0.12)]',\n index === 0 ? 'top-[33px]' : 'bottom-[33px]',\n show && '!block'\n )}\n >\n <i\n className=\"absolute right-[8px] blur-[12px]\"\n style={\n index === 0\n ? {\n top: '-9px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderBottom: '8px solid rgba(0,0,0,0.12)',\n }\n : {\n bottom: '-9px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderTop: '8px solid rgba(0,0,0,0.12)',\n }\n }\n ></i>\n <i\n className=\"absolute right-[8px]\"\n style={\n index === 0\n ? {\n top: '-7px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderBottom: '8px solid #fff ',\n }\n : {\n bottom: '-7px',\n borderRight: '16px solid transparent ',\n borderLeft: '16px solid transparent ',\n borderTop: '8px solid #fff ',\n }\n }\n ></i>\n <p\n className={classNames(\n 'relative block rounded-[4px] bg-white px-[14px] py-[12px]',\n !rounded && 'rounded-none'\n )}\n >\n <span className=\"block text-left text-[14px] font-semibold leading-[1.4] text-[#333]\">{info}</span>\n </p>\n </div>\n </div>\n )\n}\n\nexport default Tip\n"],
5
5
  "mappings": "AAsCQ,cAAAA,EAOF,QAAAC,MAPE,oBAtCR,OAAS,sBAAAC,MAA0B,gBACnC,O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A,SAAAZ,EAAC,QAAK,UAAU,sEAAuE,SAAAO,EAAK,EAC9F,GACF,GACF,CAEJ,CAEA,IAAOO,EAAQR",
6
- "names": ["jsx", "jsxs", "useHeadlessContext", "classNames", "useState", "ROUNDED_BRANDS", "Tip", "info", "index", "show", "setShow", "brand", "rounded", "e", "tip_default"]
6
+ "names": ["jsx", "jsxs", "useHeadlessContext", "classNames", "useState", "ROUNDED_BRANDS", "Tip", "info", "index", "show", "setShow", "brand", "rounded", "e", "Tip_default"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import type { Product, ProductVariant } from '@anker-in/lib';
2
2
  import type { AlpcConsumeType, ConsumeType } from './context/const';
3
- import { MyActivitiesMetafields } from './modal/activitiesModal';
4
- import { MyRewardsMetafields } from './modal/MyRewardsModal';
3
+ import { MyActivitiesMetafields } from './modal/ActivitiesModal';
4
+ import { RewardsCopy } from './modal/RewardsModal';
5
5
  export interface Subscription {
6
6
  preference: {
7
7
  subscribe: boolean;
@@ -28,8 +28,8 @@ export type RedeemableItem = {
28
28
  showCredit: boolean;
29
29
  title: string;
30
30
  };
31
- product: Product;
32
- variant: ProductVariant;
31
+ product?: Product;
32
+ variant?: ProductVariant;
33
33
  };
34
34
  export interface ShippingCountry {
35
35
  id: string;
@@ -45,6 +45,66 @@ export interface ShippingZone {
45
45
  name: string;
46
46
  countries: ShippingCountry[];
47
47
  }
48
+ export type RedeemModalCommon = {
49
+ confirmTitle: string;
50
+ confirmButton: string;
51
+ commonError: string;
52
+ redeemLimitError: string;
53
+ inventoryNotEnough: string;
54
+ creditsNotEnough: string;
55
+ crossSiteError: string;
56
+ errorImageUrl: string;
57
+ coupon: {
58
+ successDesc: string;
59
+ successTitle: string;
60
+ successButton: string;
61
+ successButtonUrl: string;
62
+ };
63
+ virtualProduct: {
64
+ successDesc: string;
65
+ successTitle: string;
66
+ successButton: string;
67
+ successButtonUrl: string;
68
+ stepTitle?: string;
69
+ steps?: {
70
+ imageUrl: string;
71
+ title: string;
72
+ }[];
73
+ };
74
+ product: {
75
+ required: string;
76
+ invalidEmail: string;
77
+ shippingAddress: string;
78
+ shippingProduct: string;
79
+ addressForm: {
80
+ key: string;
81
+ type: string;
82
+ label: string;
83
+ isSelect: boolean;
84
+ required: boolean;
85
+ placeholder: string;
86
+ }[][];
87
+ form: {
88
+ key: string;
89
+ type: string;
90
+ isSelect: boolean;
91
+ required: boolean;
92
+ placeholder: string;
93
+ }[][];
94
+ successDesc: string[];
95
+ rules: string[];
96
+ steps: {
97
+ imageUrl: string;
98
+ title: string;
99
+ }[];
100
+ quantityLabel: string;
101
+ totalPriceLabel: string;
102
+ variantLabel: string;
103
+ shippingFeeLabel: string;
104
+ paymentButton: string;
105
+ stepTitle: string;
106
+ };
107
+ };
48
108
  export type CreditsPageCommon = {
49
109
  pointUnit?: string;
50
110
  infoIcon?: string;
@@ -54,13 +114,15 @@ export type CreditsPageCommon = {
54
114
  off?: string;
55
115
  copy?: string;
56
116
  giftCardLabel?: string;
117
+ goGiftLabel?: string;
57
118
  imageMapping?: {
58
119
  [key in ConsumeType]: {
59
120
  url: string;
60
121
  };
61
122
  };
62
123
  activitiesModal?: MyActivitiesMetafields;
63
- rewardsModal?: MyRewardsMetafields;
124
+ rewardsModal?: RewardsCopy;
125
+ redeemModal?: RedeemModalCommon;
64
126
  insufficientCredits?: string;
65
127
  validatorInfo?: {
66
128
  addressInfo: {
@@ -48,12 +48,5 @@ const customRenderers = {
48
48
  customRenderers={customRenderers}
49
49
  />
50
50
  \`\`\`
51
- `}}},tags:["autodocs"],argTypes:{apiBaseUrl:{control:"text",description:"API \u57FA\u7840 URL"},headers:{control:"object",description:"\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\uFF0C\u5C06\u5728\u6240\u6709 API \u8BF7\u6C42\u4E2D\u6DFB\u52A0",table:{defaultValue:{summary:"undefined"}}},recaptchaSitekey:{control:"text",description:"Google reCAPTCHA v3 site key\uFF0C\u63D0\u4F9B\u6B64\u53C2\u6570\u5C06\u81EA\u52A8\u542F\u7528 reCAPTCHA v3 \u9A8C\u8BC1",table:{defaultValue:{summary:"undefined"}}},recaptchaAction:{control:"text",description:"reCAPTCHA action \u540D\u79F0\uFF0C\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u7684\u9A8C\u8BC1\u573A\u666F",table:{defaultValue:{summary:'"activity"'}}},site:{control:"text",description:"Shopify \u5E97\u94FA URL"},channelCode:{control:"text",description:"\u6E20\u9053\u7F16\u7801\uFF0C\u7528\u4E8E\u6807\u8BC6\u6765\u6E90\u6E20\u9053",table:{defaultValue:{summary:"undefined"}}},welcomeMessage:{control:"text",description:"\u6B22\u8FCE\u6D88\u606F",table:{defaultValue:{summary:"\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\uFF0C\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u4F60\u7684\u5417\uFF1F"}}},logoUrl:{control:"text",description:"Logo URL"},position:{control:"object",description:"\u6C14\u6CE1\u6309\u94AE\u4F4D\u7F6E\u5BF9\u8C61",table:{defaultValue:{summary:'{ bottom: "1.5rem", right: "1.5rem" }'}}}},args:{apiBaseUrl:"http://172.16.38.183:3003",site:"www.eufy.com",loginUserId:"test_test",welcomeMessage:"\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\uFF0C\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u4F60\u7684\u5417\uFF1F"}};var g=c;const u={args:{loginUserId:"test_test",apiBaseUrl:"http://172.16.38.183:3003",site:"beta.eufy.com",channelCode:"dtc",title:"eufy AI Assistant",cartId:"gid://shopify/Cart/hWN7wB3Pa12gh78d8hPOAUBI?key=0e73db1d3fb5ac21da19099c45033253",accessToken:"47b1aa2c0797043f9baba39388029d70",position:{bottom:"24px",right:"30px"},welcomeMessage:`Welcome to eufy AI Assistant!
52
-
53
- I can help you with:
54
- - Product recommendations
55
- - Order tracking
56
- - FAQs and support
57
-
58
- How can I assist you today?`,quickReplies:[{id:"1",label:"Product Info",value:"Tell me about your products",icon:"\u{1F4E6}"},{id:"2",label:"Track Order",value:"I want to track my order",icon:"\u{1F69A}"},{id:"3",label:"Support",value:"I need help with my device",icon:"\u{1F527}"},{id:"4",label:"Recommendations",value:"Recommend products for me",icon:"\u2B50"}],complianceConfig:{title:"Hi! I'm your eufy AI assistant.",content:"AI-generated responses can be inaccurate. Please verify important info. Do not input sensitive personal data.",checkboxText:`By starting to use "Live Chat", you agree to Anker's <a href="https://www.anker.com/pages/privacy-policy" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">LIVE CHAT PRIVACY NOTICE</a>.`,agreeButtonText:"Agree"},recaptchaAction:"livechat",showNewSessionButton:!0,commonText:{learnMore:"Learn More",total:"Total"},customRenderers:{video:{render:t=>{const e=t;return r("div",{className:"w-full",children:[o("video",{src:e.url,controls:!0,className:"w-full rounded-lg",poster:e.poster,children:"Your browser does not support video playback"}),e.title&&o("p",{className:"mt-2 text-sm text-gray-600",children:e.title})]})}},image_gallery:{render:t=>{const a=t.images||[];return o("div",{className:"grid grid-cols-2 gap-2",children:a.map((i,n)=>o("div",{className:"relative aspect-square",children:o("img",{src:i.url,alt:i.alt||`Image ${n+1}`,className:"size-full rounded-lg object-cover"})},n))})}}},productCardRender:(t,e)=>{if(!t)return o("div",{style:{padding:"16px",border:"1px dashed #ccc",borderRadius:"8px",textAlign:"center"},children:r("p",{children:["Product loading... (handle: ",e,")"]})});const a=t?.featured_image||"",i=t?.title||"",n=t?.description||"",s=t?.average_rating;return o("div",{style:{border:"2px solid #4CAF50",borderRadius:"16px",padding:"16px",margin:"12px 0",backgroundColor:"#f0f9ff",boxShadow:"0 4px 12px rgba(76, 175, 80, 0.15)"},children:r("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[a&&o("img",{src:a,alt:i,style:{width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}}),r("div",{style:{flex:1},children:[o("h4",{style:{margin:"0 0 4px 0",fontSize:"16px",fontWeight:"bold"},children:i}),n&&r("p",{style:{margin:0,fontSize:"12px",color:"#666",lineHeight:1.4},children:[n.slice(0,80),"..."]}),s&&r("span",{style:{fontSize:"12px",color:"#FFB800"},children:["Rating: ",s.toFixed(1)]})]}),o("button",{style:{padding:"8px 16px",backgroundColor:"#4CAF50",color:"white",borderRadius:"8px",border:"none",cursor:"pointer"},onClick:()=>console.log("View product:",e,t),children:"View"})]})})}},render:t=>o(l,{...t,onOpen:()=>console.log("[LiveChat] Chat opened"),onClose:()=>console.log("[LiveChat] Chat closed"),onMessageSend:e=>console.log("[LiveChat] Message sent:",e),onError:e=>console.error("[LiveChat] Error:",e),onTextMessage:()=>console.log("[LiveChat] AI text message received"),onProductList:()=>console.log("[LiveChat] Product list received"),onPromotionList:()=>console.log("[LiveChat] Promotion list received"),onAddToCart:e=>{console.log("[LiveChat] Add to cart:",e),alert(`Added "${e.title}" to cart!`)},onCart:(e,a)=>{console.log("[LiveChat] Cart clicked:",{cartId:e,checkoutUrl:a}),alert(`Cart ID: ${e}`)}})};export{u as Default,g as default};
51
+ `}}},tags:["autodocs"],argTypes:{apiBaseUrl:{control:"text",description:"API \u57FA\u7840 URL"},headers:{control:"object",description:"\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\uFF0C\u5C06\u5728\u6240\u6709 API \u8BF7\u6C42\u4E2D\u6DFB\u52A0",table:{defaultValue:{summary:"undefined"}}},recaptchaSitekey:{control:"text",description:"Google reCAPTCHA v3 site key\uFF0C\u63D0\u4F9B\u6B64\u53C2\u6570\u5C06\u81EA\u52A8\u542F\u7528 reCAPTCHA v3 \u9A8C\u8BC1",table:{defaultValue:{summary:"undefined"}}},recaptchaAction:{control:"text",description:"reCAPTCHA action \u540D\u79F0\uFF0C\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u7684\u9A8C\u8BC1\u573A\u666F",table:{defaultValue:{summary:'"activity"'}}},site:{control:"text",description:"Shopify \u5E97\u94FA URL"},channelCode:{control:"text",description:"\u6E20\u9053\u7F16\u7801\uFF0C\u7528\u4E8E\u6807\u8BC6\u6765\u6E90\u6E20\u9053",table:{defaultValue:{summary:"undefined"}}},welcomeMessage:{control:"text",description:"\u6B22\u8FCE\u6D88\u606F",table:{defaultValue:{summary:"\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\uFF0C\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u4F60\u7684\u5417\uFF1F"}}},logoUrl:{control:"text",description:"Logo URL"},position:{control:"object",description:"\u6C14\u6CE1\u6309\u94AE\u4F4D\u7F6E\u5BF9\u8C61",table:{defaultValue:{summary:'{ bottom: "1.5rem", right: "1.5rem" }'}}}},args:{apiBaseUrl:"http://172.16.38.183:3003",site:"www.eufy.com",loginUserId:"test_test",welcomeMessage:"\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\uFF0C\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u4F60\u7684\u5417\uFF1F"}};var g=c;const m={args:{loginUserId:"test_test1",apiBaseUrl:"http://172.16.38.183:3003",site:"beta.eufy.com",channelCode:"dtc",title:"eufy AI Assistant",cartId:"gid://shopify/Cart/hWN7wB3Pa12gh78d8hPOAUBI?key=0e73db1d3fb5ac21da19099c45033253",accessToken:"47b1aa2c0797043f9baba39388029d70",position:{bottom:"24px",right:"30px"},welcomeMessage:"",quickReplies:[{id:"1",label:"Product Info",value:"Tell me about your products",icon:"\u{1F4E6}"},{id:"2",label:"Track Order",value:"I want to track my order",icon:"\u{1F69A}"},{id:"3",label:"Support",value:"I need help with my device",icon:"\u{1F527}"},{id:"4",label:"Recommendations",value:"Recommend products for me",icon:"\u2B50"}],complianceConfig:{title:"Hi! I'm your eufy AI assistant.",content:"AI-generated responses can be inaccurate. Please verify important info. Do not input sensitive personal data.",checkboxText:`By starting to use "Live Chat", you agree to Anker's <a href="https://www.anker.com/pages/privacy-policy" target="_blank" rel="noopener noreferrer" style="text-decoration: underline;">LIVE CHAT PRIVACY NOTICE</a>.`,agreeButtonText:"Agree"},recaptchaAction:"livechat",showNewSessionButton:!0,commonText:{learnMore:"Learn More",total:"Total"},customRenderers:{video:{render:t=>{const e=t;return r("div",{className:"w-full",children:[o("video",{src:e.url,controls:!0,className:"w-full rounded-lg",poster:e.poster,children:"Your browser does not support video playback"}),e.title&&o("p",{className:"mt-2 text-sm text-gray-600",children:e.title})]})}},image_gallery:{render:t=>{const a=t.images||[];return o("div",{className:"grid grid-cols-2 gap-2",children:a.map((i,n)=>o("div",{className:"relative aspect-square",children:o("img",{src:i.url,alt:i.alt||`Image ${n+1}`,className:"size-full rounded-lg object-cover"})},n))})}}},productCardRender:(t,e)=>{if(!t)return o("div",{style:{padding:"16px",border:"1px dashed #ccc",borderRadius:"8px",textAlign:"center"},children:r("p",{children:["Product loading... (handle: ",e,")"]})});const a=t?.featured_image||"",i=t?.title||"",n=t?.description||"",s=t?.average_rating;return o("div",{style:{border:"2px solid #4CAF50",borderRadius:"16px",padding:"16px",margin:"12px 0",backgroundColor:"#f0f9ff",boxShadow:"0 4px 12px rgba(76, 175, 80, 0.15)"},children:r("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[a&&o("img",{src:a,alt:i,style:{width:"60px",height:"60px",borderRadius:"8px",objectFit:"cover"}}),r("div",{style:{flex:1},children:[o("h4",{style:{margin:"0 0 4px 0",fontSize:"16px",fontWeight:"bold"},children:i}),n&&r("p",{style:{margin:0,fontSize:"12px",color:"#666",lineHeight:1.4},children:[n.slice(0,80),"..."]}),s&&r("span",{style:{fontSize:"12px",color:"#FFB800"},children:["Rating: ",s.toFixed(1)]})]}),o("button",{style:{padding:"8px 16px",backgroundColor:"#4CAF50",color:"white",borderRadius:"8px",border:"none",cursor:"pointer"},onClick:()=>console.log("View product:",e,t),children:"View"})]})})}},render:t=>o(l,{...t,onOpen:()=>console.log("[LiveChat] Chat opened"),onClose:()=>console.log("[LiveChat] Chat closed"),onMessageSend:e=>console.log("[LiveChat] Message sent:",e),onError:e=>console.error("[LiveChat] Error:",e),onTextMessage:()=>console.log("[LiveChat] AI text message received"),onProductList:()=>console.log("[LiveChat] Product list received"),onPromotionList:()=>console.log("[LiveChat] Promotion list received"),onAddToCart:e=>{console.log("[LiveChat] Add to cart:",e),alert(`Added "${e.title}" to cart!`)},onCart:(e,a)=>{console.log("[LiveChat] Cart clicked:",{cartId:e,checkoutUrl:a}),alert(`Cart ID: ${e}`)}})};export{m as Default,g as default};
59
52
  //# sourceMappingURL=LiveChatWidget.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/stories/LiveChatWidget.stories.tsx"],
4
- "sourcesContent": ["/**\n * LiveChatWidget Storybook Stories\n * \u5C55\u793A LiveChat \u7EC4\u4EF6\u7684\u5404\u79CD\u4F7F\u7528\u573A\u666F\u548C\u914D\u7F6E\n */\n\nimport type { Meta, StoryObj } from '@storybook/react'\nimport { LiveChatWidget } from '../components/LiveChatWidget'\nimport type { MessageRenderer, MessageContent } from '../components/LiveChatWidget'\nimport '../styles/livechat.css'\n\nconst meta: Meta<typeof LiveChatWidget> = {\n title: 'Campaign/LiveChatWidget',\n component: LiveChatWidget,\n parameters: {\n layout: 'fullscreen',\n docs: {\n story: {\n inline: false,\n iframeHeight: 500,\n },\n description: {\n component: `\n# LiveChat \u804A\u5929\u7EC4\u4EF6\n\n\u53EF\u590D\u7528\u7684\u6C14\u6CE1\u5F39\u7A97\u804A\u5929\u7EC4\u4EF6\uFF0C\u652F\u6301 SSE \u6D41\u5F0F\u6D88\u606F\u3001\u81EA\u5B9A\u4E49\u6E32\u67D3\u5668\u548C\u591A\u79CD\u6D88\u606F\u7C7B\u578B\u3002\n\n## \u529F\u80FD\u7279\u6027\n\n- \uD83C\uDF88 **\u6C14\u6CE1\u5F39\u7A97**: \u53EF\u81EA\u5B9A\u4E49\u4F4D\u7F6E\u7684\u60AC\u6D6E\u6C14\u6CE1\u6309\u94AE\n- \uD83D\uDCAC **\u6D41\u5F0F\u6D88\u606F**: \u57FA\u4E8E SSE \u7684\u5B9E\u65F6\u6D41\u5F0F\u54CD\u5E94\n- \uD83D\uDCE6 **\u591A\u79CD\u6D88\u606F\u7C7B\u578B**: \u6587\u672C\u3001\u5546\u54C1\u5361\u7247\u3001\u5546\u54C1\u5217\u8868\u3001\u653F\u7B56\u3001\u5FEB\u6377\u56DE\u590D\u7B49\n- \uD83C\uDFA8 **\u53EF\u5B9A\u5236**: \u652F\u6301\u81EA\u5B9A\u4E49\u54C1\u724C\u989C\u8272\u3001Logo\u3001\u6E32\u67D3\u5668\n- \uD83D\uDCF1 **\u54CD\u5E94\u5F0F**: \u79FB\u52A8\u7AEF\u5168\u5C4F\uFF0C\u684C\u9762\u7AEF\u56FA\u5B9A\u5C3A\u5BF8\n- \uD83D\uDCBE **\u4F1A\u8BDD\u7BA1\u7406**: \u81EA\u52A8\u7BA1\u7406 userId \u548C sessionId\n- \uD83D\uDD12 **\u5B89\u5168\u9632\u62A4**: \u5185\u7F6E XSS \u9632\u62A4\u548C\u8F93\u5165\u9A8C\u8BC1\n\n## \u57FA\u7840\u7528\u6CD5\n\n\\`\\`\\`tsx\nimport { LiveChatWidget } from '@anker-in/campaign-ui'\nimport '@anker-in/campaign-ui/livechat.css'\n\nfunction App() {\n return (\n <LiveChatWidget\n apiBaseUrl=\"https://beta-api-livechat.anker.com\"\n site=\"www.eufy.com\"\n channel_code=\"web_homepage\"\n welcomeMessage=\"\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\"\n />\n )\n}\n\\`\\`\\`\n\n## \u81EA\u5B9A\u4E49\u6E32\u67D3\u5668\n\n\\`\\`\\`tsx\nconst customRenderers = {\n video: {\n render: (content) => (\n <video src={content.url} controls className=\"w-full rounded\" />\n )\n }\n}\n\n<LiveChatWidget\n apiBaseUrl=\"...\"\n site=\"...\"\n customRenderers={customRenderers}\n/>\n\\`\\`\\`\n `,\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n apiBaseUrl: {\n control: 'text',\n description: 'API \u57FA\u7840 URL',\n },\n headers: {\n control: 'object',\n description: '\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\uFF0C\u5C06\u5728\u6240\u6709 API \u8BF7\u6C42\u4E2D\u6DFB\u52A0',\n table: {\n defaultValue: { summary: 'undefined' },\n },\n },\n recaptchaSitekey: {\n control: 'text',\n description: 'Google reCAPTCHA v3 site key\uFF0C\u63D0\u4F9B\u6B64\u53C2\u6570\u5C06\u81EA\u52A8\u542F\u7528 reCAPTCHA v3 \u9A8C\u8BC1',\n table: {\n defaultValue: { summary: 'undefined' },\n },\n },\n recaptchaAction: {\n control: 'text',\n description: 'reCAPTCHA action \u540D\u79F0\uFF0C\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u7684\u9A8C\u8BC1\u573A\u666F',\n table: {\n defaultValue: { summary: '\"activity\"' },\n },\n },\n site: {\n control: 'text',\n description: 'Shopify \u5E97\u94FA URL',\n },\n channelCode: {\n control: 'text',\n description: '\u6E20\u9053\u7F16\u7801\uFF0C\u7528\u4E8E\u6807\u8BC6\u6765\u6E90\u6E20\u9053',\n table: {\n defaultValue: { summary: 'undefined' },\n },\n },\n welcomeMessage: {\n control: 'text',\n description: '\u6B22\u8FCE\u6D88\u606F',\n table: {\n defaultValue: { summary: '\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\uFF0C\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u4F60\u7684\u5417\uFF1F' },\n },\n },\n logoUrl: {\n control: 'text',\n description: 'Logo URL',\n },\n position: {\n control: 'object',\n description: '\u6C14\u6CE1\u6309\u94AE\u4F4D\u7F6E\u5BF9\u8C61',\n table: {\n defaultValue: { summary: '{ bottom: \"1.5rem\", right: \"1.5rem\" }' },\n },\n },\n },\n args: {\n apiBaseUrl: 'http://172.16.38.183:3003',\n site: 'www.eufy.com',\n loginUserId: 'test_test',\n welcomeMessage: '\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\uFF0C\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u4F60\u7684\u5417\uFF1F',\n },\n}\n\nexport default meta\ntype Story = StoryObj<typeof LiveChatWidget>\n\n/**\n * \u9ED8\u8BA4\u914D\u7F6E - \u5C55\u793A\u6240\u6709\u529F\u80FD\n */\nexport const Default: Story = {\n args: {\n // \u57FA\u7840\u914D\u7F6E\n loginUserId: 'test_test',\n apiBaseUrl: 'http://172.16.38.183:3003',\n site: 'beta.eufy.com',\n channelCode: 'dtc',\n title: 'eufy AI Assistant',\n cartId: 'gid://shopify/Cart/hWN7wB3Pa12gh78d8hPOAUBI?key=0e73db1d3fb5ac21da19099c45033253',\n accessToken: '47b1aa2c0797043f9baba39388029d70',\n\n // \u81EA\u5B9A\u4E49\u4F4D\u7F6E\n position: { bottom: '24px', right: '30px' },\n\n // \u6B22\u8FCE\u6D88\u606F\n welcomeMessage: `Welcome to eufy AI Assistant!\n\nI can help you with:\n- Product recommendations\n- Order tracking\n- FAQs and support\n\nHow can I assist you today?`,\n\n // \u5FEB\u6377\u56DE\u590D\n quickReplies: [\n { id: '1', label: 'Product Info', value: 'Tell me about your products', icon: '\uD83D\uDCE6' },\n { id: '2', label: 'Track Order', value: 'I want to track my order', icon: '\uD83D\uDE9A' },\n { id: '3', label: 'Support', value: 'I need help with my device', icon: '\uD83D\uDD27' },\n { id: '4', label: 'Recommendations', value: 'Recommend products for me', icon: '\u2B50' },\n ],\n\n // \u6CD5\u89C4\u534F\u8BAE\u5F39\u7A97\n complianceConfig: {\n title: \"Hi! I'm your eufy AI assistant.\",\n content: \"AI-generated responses can be inaccurate. Please verify important info. Do not input sensitive personal data.\",\n checkboxText: 'By starting to use \"Live Chat\", you agree to Anker\\'s <a href=\"https://www.anker.com/pages/privacy-policy\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"text-decoration: underline;\">LIVE CHAT PRIVACY NOTICE</a>.',\n agreeButtonText: \"Agree\"\n },\n\n // reCAPTCHA \u914D\u7F6E\uFF08\u53D6\u6D88\u6CE8\u91CA\u4EE5\u542F\u7528\uFF09\n // recaptchaSitekey: '6LfS4J4pAAAAACX1e_WrxutmxxzCK7FU4WzVqL14',\n recaptchaAction: 'livechat',\n\n // \u663E\u793A\u65B0\u4F1A\u8BDD\u6309\u94AE\n showNewSessionButton: true,\n\n // \u81EA\u5B9A\u4E49\u6587\u6848\n commonText: {\n learnMore: 'Learn More',\n total: 'Total',\n },\n\n // \u81EA\u5B9A\u4E49\u6D88\u606F\u6E32\u67D3\u5668\n customRenderers: {\n video: {\n render: (content: MessageContent) => {\n const videoContent = content as any\n return (\n <div className=\"w-full\">\n <video src={videoContent.url} controls className=\"w-full rounded-lg\" poster={videoContent.poster}>\n Your browser does not support video playback\n </video>\n {videoContent.title && <p className=\"mt-2 text-sm text-gray-600\">{videoContent.title}</p>}\n </div>\n )\n },\n } as MessageRenderer,\n image_gallery: {\n render: (content: MessageContent) => {\n const galleryContent = content as any\n const images = galleryContent.images || []\n return (\n <div className=\"grid grid-cols-2 gap-2\">\n {images.map((image: any, index: number) => (\n <div key={index} className=\"relative aspect-square\">\n <img\n src={image.url}\n alt={image.alt || `Image ${index + 1}`}\n className=\"size-full rounded-lg object-cover\"\n />\n </div>\n ))}\n </div>\n )\n },\n } as MessageRenderer,\n },\n\n // \u81EA\u5B9A\u4E49\u4EA7\u54C1\u5361\u7247\u6E32\u67D3\n productCardRender: (product, productHandle) => {\n // product \u53EF\u80FD\u4E3A undefined\uFF0C\u6B64\u65F6\u53EF\u7528 productHandle \u67E5\u8BE2\n if (!product) {\n return (\n <div style={{ padding: '16px', border: '1px dashed #ccc', borderRadius: '8px', textAlign: 'center' }}>\n <p>Product loading... (handle: {productHandle})</p>\n </div>\n )\n }\n\n const imageUrl = product?.featured_image || ''\n const title = product?.title || ''\n const description = product?.description || ''\n const averageRating = product?.average_rating\n\n return (\n <div\n style={{\n border: '2px solid #4CAF50',\n borderRadius: '16px',\n padding: '16px',\n margin: '12px 0',\n backgroundColor: '#f0f9ff',\n boxShadow: '0 4px 12px rgba(76, 175, 80, 0.15)',\n }}\n >\n <div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>\n {imageUrl && (\n <img\n src={imageUrl}\n alt={title}\n style={{ width: '60px', height: '60px', borderRadius: '8px', objectFit: 'cover' }}\n />\n )}\n <div style={{ flex: 1 }}>\n <h4 style={{ margin: '0 0 4px 0', fontSize: '16px', fontWeight: 'bold' }}>{title}</h4>\n {description && (\n <p style={{ margin: 0, fontSize: '12px', color: '#666', lineHeight: 1.4 }}>\n {description.slice(0, 80)}...\n </p>\n )}\n {averageRating && (\n <span style={{ fontSize: '12px', color: '#FFB800' }}>Rating: {averageRating.toFixed(1)}</span>\n )}\n </div>\n <button\n style={{\n padding: '8px 16px',\n backgroundColor: '#4CAF50',\n color: 'white',\n borderRadius: '8px',\n border: 'none',\n cursor: 'pointer',\n }}\n onClick={() => console.log('View product:', productHandle, product)}\n >\n View\n </button>\n </div>\n </div>\n )\n },\n },\n\n render: args => (\n <LiveChatWidget\n {...args}\n // \u6240\u6709\u4E8B\u4EF6\u56DE\u8C03\n onOpen={() => console.log('[LiveChat] Chat opened')}\n onClose={() => console.log('[LiveChat] Chat closed')}\n onMessageSend={(message: string) => console.log('[LiveChat] Message sent:', message)}\n onError={(error: Error) => console.error('[LiveChat] Error:', error)}\n onTextMessage={() => console.log('[LiveChat] AI text message received')}\n onProductList={() => console.log('[LiveChat] Product list received')}\n onPromotionList={() => console.log('[LiveChat] Promotion list received')}\n onAddToCart={(product: any) => {\n console.log('[LiveChat] Add to cart:', product)\n alert(`Added \"${product.title}\" to cart!`)\n }}\n onCart={(cartId: string, checkoutUrl?: string) => {\n console.log('[LiveChat] Cart clicked:', { cartId, checkoutUrl })\n alert(`Cart ID: ${cartId}`)\n }}\n />\n ),\n}\n"],
5
- "mappings": "AA6MY,OACE,OAAAA,EADF,QAAAC,MAAA,oBAvMZ,OAAS,kBAAAC,MAAsB,+BAE/B,MAAO,yBAEP,MAAMC,EAAoC,CACxC,MAAO,0BACP,UAA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,IAAI,wBAAwB,EACnD,cAAgBC,GAAoB,QAAQ,IAAI,2BAA4BA,CAAO,EACnF,QAAUC,GAAiB,QAAQ,MAAM,oBAAqBA,CAAK,EACnE,cAAe,IAAM,QAAQ,IAAI,qCAAqC,EACtE,cAAe,IAAM,QAAQ,IAAI,kCAAkC,EACnE,gBAAiB,IAAM,QAAQ,IAAI,oCAAoC,EACvE,YAAcR,GAAiB,CAC7B,QAAQ,IAAI,0BAA2BA,CAAO,EAC9C,MAAM,UAAUA,EAAQ,KAAK,YAAY,CAC3C,EACA,OAAQ,CAACS,EAAgBC,IAAyB,CAChD,QAAQ,IAAI,2BAA4B,CAAE,OAAAD,EAAQ,YAAAC,CAAY,CAAC,EAC/D,MAAM,YAAYD,CAAM,EAAE,CAC5B,EACF,CAEJ",
4
+ "sourcesContent": ["/**\n * LiveChatWidget Storybook Stories\n * \u5C55\u793A LiveChat \u7EC4\u4EF6\u7684\u5404\u79CD\u4F7F\u7528\u573A\u666F\u548C\u914D\u7F6E\n */\n\nimport type { Meta, StoryObj } from '@storybook/react'\nimport { LiveChatWidget } from '../components/LiveChatWidget'\nimport type { MessageRenderer, MessageContent } from '../components/LiveChatWidget'\nimport '../styles/livechat.css'\n\nconst meta: Meta<typeof LiveChatWidget> = {\n title: 'Campaign/LiveChatWidget',\n component: LiveChatWidget,\n parameters: {\n layout: 'fullscreen',\n docs: {\n story: {\n inline: false,\n iframeHeight: 500,\n },\n description: {\n component: `\n# LiveChat \u804A\u5929\u7EC4\u4EF6\n\n\u53EF\u590D\u7528\u7684\u6C14\u6CE1\u5F39\u7A97\u804A\u5929\u7EC4\u4EF6\uFF0C\u652F\u6301 SSE \u6D41\u5F0F\u6D88\u606F\u3001\u81EA\u5B9A\u4E49\u6E32\u67D3\u5668\u548C\u591A\u79CD\u6D88\u606F\u7C7B\u578B\u3002\n\n## \u529F\u80FD\u7279\u6027\n\n- \uD83C\uDF88 **\u6C14\u6CE1\u5F39\u7A97**: \u53EF\u81EA\u5B9A\u4E49\u4F4D\u7F6E\u7684\u60AC\u6D6E\u6C14\u6CE1\u6309\u94AE\n- \uD83D\uDCAC **\u6D41\u5F0F\u6D88\u606F**: \u57FA\u4E8E SSE \u7684\u5B9E\u65F6\u6D41\u5F0F\u54CD\u5E94\n- \uD83D\uDCE6 **\u591A\u79CD\u6D88\u606F\u7C7B\u578B**: \u6587\u672C\u3001\u5546\u54C1\u5361\u7247\u3001\u5546\u54C1\u5217\u8868\u3001\u653F\u7B56\u3001\u5FEB\u6377\u56DE\u590D\u7B49\n- \uD83C\uDFA8 **\u53EF\u5B9A\u5236**: \u652F\u6301\u81EA\u5B9A\u4E49\u54C1\u724C\u989C\u8272\u3001Logo\u3001\u6E32\u67D3\u5668\n- \uD83D\uDCF1 **\u54CD\u5E94\u5F0F**: \u79FB\u52A8\u7AEF\u5168\u5C4F\uFF0C\u684C\u9762\u7AEF\u56FA\u5B9A\u5C3A\u5BF8\n- \uD83D\uDCBE **\u4F1A\u8BDD\u7BA1\u7406**: \u81EA\u52A8\u7BA1\u7406 userId \u548C sessionId\n- \uD83D\uDD12 **\u5B89\u5168\u9632\u62A4**: \u5185\u7F6E XSS \u9632\u62A4\u548C\u8F93\u5165\u9A8C\u8BC1\n\n## \u57FA\u7840\u7528\u6CD5\n\n\\`\\`\\`tsx\nimport { LiveChatWidget } from '@anker-in/campaign-ui'\nimport '@anker-in/campaign-ui/livechat.css'\n\nfunction App() {\n return (\n <LiveChatWidget\n apiBaseUrl=\"https://beta-api-livechat.anker.com\"\n site=\"www.eufy.com\"\n channel_code=\"web_homepage\"\n welcomeMessage=\"\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\"\n />\n )\n}\n\\`\\`\\`\n\n## \u81EA\u5B9A\u4E49\u6E32\u67D3\u5668\n\n\\`\\`\\`tsx\nconst customRenderers = {\n video: {\n render: (content) => (\n <video src={content.url} controls className=\"w-full rounded\" />\n )\n }\n}\n\n<LiveChatWidget\n apiBaseUrl=\"...\"\n site=\"...\"\n customRenderers={customRenderers}\n/>\n\\`\\`\\`\n `,\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n apiBaseUrl: {\n control: 'text',\n description: 'API \u57FA\u7840 URL',\n },\n headers: {\n control: 'object',\n description: '\u81EA\u5B9A\u4E49\u8BF7\u6C42\u5934\uFF0C\u5C06\u5728\u6240\u6709 API \u8BF7\u6C42\u4E2D\u6DFB\u52A0',\n table: {\n defaultValue: { summary: 'undefined' },\n },\n },\n recaptchaSitekey: {\n control: 'text',\n description: 'Google reCAPTCHA v3 site key\uFF0C\u63D0\u4F9B\u6B64\u53C2\u6570\u5C06\u81EA\u52A8\u542F\u7528 reCAPTCHA v3 \u9A8C\u8BC1',\n table: {\n defaultValue: { summary: 'undefined' },\n },\n },\n recaptchaAction: {\n control: 'text',\n description: 'reCAPTCHA action \u540D\u79F0\uFF0C\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u7684\u9A8C\u8BC1\u573A\u666F',\n table: {\n defaultValue: { summary: '\"activity\"' },\n },\n },\n site: {\n control: 'text',\n description: 'Shopify \u5E97\u94FA URL',\n },\n channelCode: {\n control: 'text',\n description: '\u6E20\u9053\u7F16\u7801\uFF0C\u7528\u4E8E\u6807\u8BC6\u6765\u6E90\u6E20\u9053',\n table: {\n defaultValue: { summary: 'undefined' },\n },\n },\n welcomeMessage: {\n control: 'text',\n description: '\u6B22\u8FCE\u6D88\u606F',\n table: {\n defaultValue: { summary: '\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\uFF0C\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u4F60\u7684\u5417\uFF1F' },\n },\n },\n logoUrl: {\n control: 'text',\n description: 'Logo URL',\n },\n position: {\n control: 'object',\n description: '\u6C14\u6CE1\u6309\u94AE\u4F4D\u7F6E\u5BF9\u8C61',\n table: {\n defaultValue: { summary: '{ bottom: \"1.5rem\", right: \"1.5rem\" }' },\n },\n },\n },\n args: {\n apiBaseUrl: 'http://172.16.38.183:3003',\n site: 'www.eufy.com',\n loginUserId: 'test_test',\n welcomeMessage: '\u4F60\u597D\uFF01\u6211\u662F AI \u52A9\u624B\uFF0C\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u52A9\u4F60\u7684\u5417\uFF1F',\n },\n}\n\nexport default meta\ntype Story = StoryObj<typeof LiveChatWidget>\n\n/**\n * \u9ED8\u8BA4\u914D\u7F6E - \u5C55\u793A\u6240\u6709\u529F\u80FD\n */\nexport const Default: Story = {\n args: {\n // \u57FA\u7840\u914D\u7F6E\n loginUserId: 'test_test1',\n apiBaseUrl: 'http://172.16.38.183:3003',\n site: 'beta.eufy.com',\n channelCode: 'dtc',\n title: 'eufy AI Assistant',\n cartId: 'gid://shopify/Cart/hWN7wB3Pa12gh78d8hPOAUBI?key=0e73db1d3fb5ac21da19099c45033253',\n accessToken: '47b1aa2c0797043f9baba39388029d70',\n\n // \u81EA\u5B9A\u4E49\u4F4D\u7F6E\n position: { bottom: '24px', right: '30px' },\n\n // \u6B22\u8FCE\u6D88\u606F\n welcomeMessage: '',\n\n // \u5FEB\u6377\u56DE\u590D\n quickReplies: [\n { id: '1', label: 'Product Info', value: 'Tell me about your products', icon: '\uD83D\uDCE6' },\n { id: '2', label: 'Track Order', value: 'I want to track my order', icon: '\uD83D\uDE9A' },\n { id: '3', label: 'Support', value: 'I need help with my device', icon: '\uD83D\uDD27' },\n { id: '4', label: 'Recommendations', value: 'Recommend products for me', icon: '\u2B50' },\n ],\n\n // \u6CD5\u89C4\u534F\u8BAE\u5F39\u7A97\n complianceConfig: {\n title: \"Hi! I'm your eufy AI assistant.\",\n content:\n 'AI-generated responses can be inaccurate. Please verify important info. Do not input sensitive personal data.',\n checkboxText:\n 'By starting to use \"Live Chat\", you agree to Anker\\'s <a href=\"https://www.anker.com/pages/privacy-policy\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"text-decoration: underline;\">LIVE CHAT PRIVACY NOTICE</a>.',\n agreeButtonText: 'Agree',\n },\n\n // reCAPTCHA \u914D\u7F6E\uFF08\u53D6\u6D88\u6CE8\u91CA\u4EE5\u542F\u7528\uFF09\n // recaptchaSitekey: '6LfS4J4pAAAAACX1e_WrxutmxxzCK7FU4WzVqL14',\n recaptchaAction: 'livechat',\n\n // \u663E\u793A\u65B0\u4F1A\u8BDD\u6309\u94AE\n showNewSessionButton: true,\n\n // \u81EA\u5B9A\u4E49\u6587\u6848\n commonText: {\n learnMore: 'Learn More',\n total: 'Total',\n },\n\n // \u81EA\u5B9A\u4E49\u6D88\u606F\u6E32\u67D3\u5668\n customRenderers: {\n video: {\n render: (content: MessageContent) => {\n const videoContent = content as any\n return (\n <div className=\"w-full\">\n <video src={videoContent.url} controls className=\"w-full rounded-lg\" poster={videoContent.poster}>\n Your browser does not support video playback\n </video>\n {videoContent.title && <p className=\"mt-2 text-sm text-gray-600\">{videoContent.title}</p>}\n </div>\n )\n },\n } as MessageRenderer,\n image_gallery: {\n render: (content: MessageContent) => {\n const galleryContent = content as any\n const images = galleryContent.images || []\n return (\n <div className=\"grid grid-cols-2 gap-2\">\n {images.map((image: any, index: number) => (\n <div key={index} className=\"relative aspect-square\">\n <img\n src={image.url}\n alt={image.alt || `Image ${index + 1}`}\n className=\"size-full rounded-lg object-cover\"\n />\n </div>\n ))}\n </div>\n )\n },\n } as MessageRenderer,\n },\n\n // \u81EA\u5B9A\u4E49\u4EA7\u54C1\u5361\u7247\u6E32\u67D3\n productCardRender: (product, productHandle) => {\n // product \u53EF\u80FD\u4E3A undefined\uFF0C\u6B64\u65F6\u53EF\u7528 productHandle \u67E5\u8BE2\n if (!product) {\n return (\n <div style={{ padding: '16px', border: '1px dashed #ccc', borderRadius: '8px', textAlign: 'center' }}>\n <p>Product loading... (handle: {productHandle})</p>\n </div>\n )\n }\n\n const imageUrl = product?.featured_image || ''\n const title = product?.title || ''\n const description = product?.description || ''\n const averageRating = product?.average_rating\n\n return (\n <div\n style={{\n border: '2px solid #4CAF50',\n borderRadius: '16px',\n padding: '16px',\n margin: '12px 0',\n backgroundColor: '#f0f9ff',\n boxShadow: '0 4px 12px rgba(76, 175, 80, 0.15)',\n }}\n >\n <div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>\n {imageUrl && (\n <img\n src={imageUrl}\n alt={title}\n style={{ width: '60px', height: '60px', borderRadius: '8px', objectFit: 'cover' }}\n />\n )}\n <div style={{ flex: 1 }}>\n <h4 style={{ margin: '0 0 4px 0', fontSize: '16px', fontWeight: 'bold' }}>{title}</h4>\n {description && (\n <p style={{ margin: 0, fontSize: '12px', color: '#666', lineHeight: 1.4 }}>\n {description.slice(0, 80)}...\n </p>\n )}\n {averageRating && (\n <span style={{ fontSize: '12px', color: '#FFB800' }}>Rating: {averageRating.toFixed(1)}</span>\n )}\n </div>\n <button\n style={{\n padding: '8px 16px',\n backgroundColor: '#4CAF50',\n color: 'white',\n borderRadius: '8px',\n border: 'none',\n cursor: 'pointer',\n }}\n onClick={() => console.log('View product:', productHandle, product)}\n >\n View\n </button>\n </div>\n </div>\n )\n },\n },\n\n render: args => (\n <LiveChatWidget\n {...args}\n // \u6240\u6709\u4E8B\u4EF6\u56DE\u8C03\n onOpen={() => console.log('[LiveChat] Chat opened')}\n onClose={() => console.log('[LiveChat] Chat closed')}\n onMessageSend={(message: string) => console.log('[LiveChat] Message sent:', message)}\n onError={(error: Error) => console.error('[LiveChat] Error:', error)}\n onTextMessage={() => console.log('[LiveChat] AI text message received')}\n onProductList={() => console.log('[LiveChat] Product list received')}\n onPromotionList={() => console.log('[LiveChat] Promotion list received')}\n onAddToCart={(product: any) => {\n console.log('[LiveChat] Add to cart:', product)\n alert(`Added \"${product.title}\" to cart!`)\n }}\n onCart={(cartId: string, checkoutUrl?: string) => {\n console.log('[LiveChat] Cart clicked:', { cartId, checkoutUrl })\n alert(`Cart ID: ${cartId}`)\n }}\n />\n ),\n}\n"],
5
+ "mappings": "AAwMY,OACE,OAAAA,EADF,QAAAC,MAAA,oBAlMZ,OAAS,kBAAAC,MAAsB,+BAE/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,QAAQ,IAAI,wBAAwB,EACnD,cAAgBC,GAAoB,QAAQ,IAAI,2BAA4BA,CAAO,EACnF,QAAUC,GAAiB,QAAQ,MAAM,oBAAqBA,CAAK,EACnE,cAAe,IAAM,QAAQ,IAAI,qCAAqC,EACtE,cAAe,IAAM,QAAQ,IAAI,kCAAkC,EACnE,gBAAiB,IAAM,QAAQ,IAAI,oCAAoC,EACvE,YAAcR,GAAiB,CAC7B,QAAQ,IAAI,0BAA2BA,CAAO,EAC9C,MAAM,UAAUA,EAAQ,KAAK,YAAY,CAC3C,EACA,OAAQ,CAACS,EAAgBC,IAAyB,CAChD,QAAQ,IAAI,2BAA4B,CAAE,OAAAD,EAAQ,YAAAC,CAAY,CAAC,EAC/D,MAAM,YAAYD,CAAM,EAAE,CAC5B,EACF,CAEJ",
6
6
  "names": ["jsx", "jsxs", "LiveChatWidget", "meta", "LiveChatWidget_stories_default", "Default", "content", "videoContent", "images", "image", "index", "product", "productHandle", "imageUrl", "title", "description", "averageRating", "args", "message", "error", "cartId", "checkoutUrl"]
7
7
  }
@@ -1,88 +1,2 @@
1
- import { HeadlessConfig } from '@anker-in/lib';
2
- import { DTC_TASK_TYPE } from '../components/credits/context/const';
3
- import { CreditsPageCommon } from '../components/credits/type';
4
- import { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes';
5
- import { CreditsBannerCopy } from '../components/credits/creditsBanner';
6
- import { CreditsInfoCardCopy } from '../components/credits/creditsInfoCard';
7
- import { CreditsBenefitsCopy } from '../components/credits/creditsBenefits';
8
- import { CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits';
9
- import { CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask';
10
- import { CreditsRedeemListCopy } from '../components/credits/creditsRedeemList';
11
- import { CreditsCashCopy } from '../components/credits/creditsCash';
12
- import { CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice';
13
- import { CreditsFaqCopy } from '../components/credits/creditsFaq';
14
- import { CreditsNavigationCopy } from '../components/credits/creditsNavigation';
15
- import { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type';
16
- export declare enum ComponentKey {
17
- Navigation = "creditsNavigation",
18
- Banner = "creditsBanner",
19
- InfoCard = "creditsInfoCard",
20
- Benefits = "creditsBenefits",
21
- WaysToGetCredits = "creditsWaysToGetCredits",
22
- AnkersolixTask = "creditsAnkersolixTask",
23
- RedeemList = "creditsRedeemList",
24
- SpendCreditsLikeCash = "creditsCash",
25
- MemberPrice = "creditsMemberPrice",
26
- Faqs = "creditsFaq"
27
- }
28
- export type CreditsTemplateProps = {
29
- headlessConfig: HeadlessConfig;
30
- siteConfig: {
31
- registrationsSettings: {
32
- authCodeActivate: AuthCodeActivateCopy;
33
- };
34
- taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
35
- memberPriceDiscount?: FunctionMemberPriceConfig[];
36
- };
37
- creditsConfig?: {
38
- alpcBrand?: string;
39
- };
40
- pageConfig: {
41
- order: ComponentKey[];
42
- common: CreditsPageCommon;
43
- components: {
44
- [ComponentKey.Navigation]?: CreditsNavigationCopy;
45
- [ComponentKey.Banner]?: CreditsBannerCopy;
46
- [ComponentKey.InfoCard]?: CreditsInfoCardCopy;
47
- [ComponentKey.Benefits]?: CreditsBenefitsCopy;
48
- [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy;
49
- [ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy;
50
- [ComponentKey.RedeemList]?: CreditsRedeemListCopy;
51
- [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy;
52
- [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy;
53
- [ComponentKey.Faqs]?: CreditsFaqCopy;
54
- };
55
- };
56
- userContext: {
57
- profile: any;
58
- removeProfile: () => void;
59
- isLoadingProfile: boolean;
60
- creditInfo: any;
61
- customer: any;
62
- customerLoading: boolean;
63
- fetchCreditInfo: () => void;
64
- };
65
- registrationContext: {
66
- openSignUpPopup: () => void;
67
- openSignInPopup: () => void;
68
- };
69
- gtm: {
70
- pageGroup: string;
71
- pageHandle?: string;
72
- };
73
- cartConfig?: {
74
- addToCart: (params: {
75
- variantList: Array<{
76
- variant: any;
77
- quantity: number;
78
- attributes?: Array<{
79
- key: string;
80
- value: string;
81
- }>;
82
- }>;
83
- cartAttributes?: Record<string, string>;
84
- discountCodes?: string[];
85
- }) => void | Promise<any>;
86
- };
87
- };
1
+ import type { CreditsTemplateProps } from './Credits.types';
88
2
  export declare const CreditsTemplate: ({ headlessConfig, siteConfig, creditsConfig, userContext, pageConfig, registrationContext, gtm, cartConfig, }: CreditsTemplateProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import{Fragment as F,jsx as o,jsxs as p}from"react/jsx-runtime";import{classNames as f,HeadlessProvider as y}from"@anker-in/lib";import{RegistrationProvider as l}from"../components/registration/context/provider";import{CreditsProvider as g}from"../components/credits/context/provider";import{CreditsBanner as P}from"../components/credits/creditsBanner";import{CreditsInfoCard as T}from"../components/credits/creditsInfoCard";import{CreditsBenefits as v}from"../components/credits/creditsBenefits";import{CreditsWaysToGetCredits as u}from"../components/credits/creditsWaysToGetCredits";import{CreditsAnkersolixTask as b}from"../components/credits/creditsAnkersolixTask";import{CreditsRedeemList as h}from"../components/credits/creditsRedeemList";import{CreditsCash as A}from"../components/credits/creditsCash";import{CreditsMemberPrice as B}from"../components/credits/creditsMemberPrice";import{CreditsFaq as I}from"../components/credits/creditsFaq";import{CreditsNavigation as L}from"../components/credits/creditsNavigation";var K=(r=>(r.Navigation="creditsNavigation",r.Banner="creditsBanner",r.InfoCard="creditsInfoCard",r.Benefits="creditsBenefits",r.WaysToGetCredits="creditsWaysToGetCredits",r.AnkersolixTask="creditsAnkersolixTask",r.RedeemList="creditsRedeemList",r.SpendCreditsLikeCash="creditsCash",r.MemberPrice="creditsMemberPrice",r.Faqs="creditsFaq",r))(K||{});const ae=({headlessConfig:a,siteConfig:n,creditsConfig:C,userContext:t,pageConfig:s,registrationContext:d,gtm:m,cartConfig:c})=>(console.log("siteConfig",n),o(y,{headlessConfig:a,children:o(l,{copy:n.registrationsSettings,email:t?.profile?.email,children:p(g,{profile:t?.profile,removeProfile:t?.removeProfile,isLoadingProfile:t?.isLoadingProfile,openSignInPopup:d.openSignInPopup,openSignUpPopup:d.openSignUpPopup,creditInfo:t?.creditInfo,taskIdToTypeMapping:n.taskIdToTypeMapping,customer:t?.customer,fetchCreditInfo:t?.fetchCreditInfo,customerLoading:t?.customerLoading,gtm:m,pageCommon:s.common,memberPriceDiscount:n.memberPriceDiscount,alpcBrand:C?.alpcBrand,cartConfig:c,children:[s.components.creditsNavigation&&o(L,{copy:s.components.creditsNavigation}),o("div",{className:f("bg-[#f5f5f7] leading-[1.2]"),children:s.order.map(e=>{if(e==="creditsNavigation")return null;const i=s.components?.[e];return i?p(F,{children:[e==="creditsBanner"&&o(P,{copy:i,id:e}),e==="creditsInfoCard"&&t?.profile&&o(T,{copy:i,id:e}),e==="creditsBenefits"&&o(v,{copy:i,id:e}),e==="creditsWaysToGetCredits"&&o(u,{copy:i,id:e,classNames:a.brand==="anker"?{subtitle:"text-white",equalCreditsText:"bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent"}:{subtitle:"text-[#D1D1D1]",equalCreditsText:"text-[#F6EAD0]"}}),e==="creditsAnkersolixTask"&&o(b,{copy:i,id:e}),e==="creditsRedeemList"&&o(h,{copy:i,id:e}),e==="creditsCash"&&o(A,{copy:i,id:e}),e==="creditsMemberPrice"&&o(B,{copy:i,id:e}),e==="creditsFaq"&&o(I,{copy:i,id:e}),e!=="creditsBanner"&&o("div",{className:"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16"})]}):null})})]})})}));export{K as ComponentKey,ae as CreditsTemplate};
1
+ import{Fragment as l,jsx as o,jsxs as c}from"react/jsx-runtime";import{classNames as f,HeadlessProvider as P}from"@anker-in/lib";import{RegistrationProvider as y}from"../components/registration/context/provider";import{CreditsProvider as g,useCreditsContext as v}from"../components/credits/context/provider";import{CreditsBanner as M}from"../components/credits/creditsBanner";import{CreditsInfoCard as T}from"../components/credits/creditsInfoCard";import{CreditsBenefits as u}from"../components/credits/creditsBenefits";import{CreditsWaysToGetCredits as b}from"../components/credits/creditsWaysToGetCredits";import{CreditsAnkersolixTask as h}from"../components/credits/creditsAnkersolixTask";import{CreditsRedeemList as G}from"../components/credits/creditsRedeemList";import{CreditsGoGift as I}from"../components/credits/creditsGoGift";import{CreditsCash as B}from"../components/credits/creditsCash";import{CreditsMemberPrice as A}from"../components/credits/creditsMemberPrice";import{CreditsFaq as L}from"../components/credits/creditsFaq";import{CreditsNavigation as R}from"../components/credits/creditsNavigation";import D from"../components/credits/modal/ActivitiesModal";import N from"../components/credits/modal/RewardsModal";import{ComponentKey as i}from"./Credits.types";const F=({headlessConfig:p,pageConfig:s,userContext:C})=>{const{openMyRewardsModal:r,setOpenMyRewardsModal:a,openActivitiesModal:n,setOpenActivitiesModal:m,pageCommon:d}=v();return c(l,{children:[s.components[i.Navigation]&&o(R,{copy:s.components[i.Navigation]}),o("div",{className:f("bg-[#f5f5f7] leading-[1.2]"),children:s.order.map(e=>{if(e===i.Navigation)return null;const t=s.components?.[e];return t?c(l,{children:[e===i.Banner&&o(M,{copy:t,id:e}),e===i.InfoCard&&C?.profile&&o(T,{copy:t,id:e}),e===i.Benefits&&o(u,{copy:t,id:e}),e===i.WaysToGetCredits&&o(b,{copy:t,id:e,classNames:p.brand==="anker"?{subtitle:"text-white",equalCreditsText:"bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent"}:{subtitle:"text-[#D1D1D1]",equalCreditsText:"text-[#F6EAD0]"}}),e===i.AnkersolixTask&&o(h,{copy:t,id:e}),e===i.RedeemList&&o(G,{copy:t,id:e}),e===i.GoGift&&o(I,{copy:t,id:e}),e===i.SpendCreditsLikeCash&&o(B,{copy:t,id:e}),e===i.MemberPrice&&o(A,{copy:t,id:e}),e===i.Faqs&&o(L,{copy:t,id:e}),e!==i.Banner&&o("div",{className:"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16"})]}):null})}),d?.activitiesModal&&o(D,{isOpen:n,data:d.activitiesModal,onClose:()=>m(!1)}),d?.rewardsModal&&o(N,{isOpen:r,data:d.rewardsModal,onClose:()=>a(!1)})]})},_=({headlessConfig:p,siteConfig:s,creditsConfig:C,userContext:r,pageConfig:a,registrationContext:n,gtm:m,cartConfig:d})=>o(P,{headlessConfig:p,children:o(y,{copy:s.registrationsSettings,email:r?.profile?.email,children:o(g,{profile:r?.profile,removeProfile:r?.removeProfile,isLoadingProfile:r?.isLoadingProfile,openSignInPopup:n.openSignInPopup,openSignUpPopup:n.openSignUpPopup,creditInfo:r?.creditInfo,taskIdToTypeMapping:s.taskIdToTypeMapping,customer:r?.customer,fetchCreditInfo:r?.fetchCreditInfo,customerLoading:r?.customerLoading,gtm:m,pageCommon:a.common,memberPriceDiscount:s.memberPriceDiscount,alpcBrand:C?.alpcBrand,cartConfig:d,children:o(F,{headlessConfig:p,pageConfig:a,userContext:r})})})});export{_ as CreditsTemplate};
2
2
  //# sourceMappingURL=Credits.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/templates/Credits.tsx"],
4
- "sourcesContent": ["import { classNames, HeadlessConfig, HeadlessProvider } from '@anker-in/lib'\nimport { RegistrationProvider } from '../components/registration/context/provider'\n\nimport { DTC_TASK_TYPE } from '../components/credits/context/const'\nimport { CreditsProvider } from '../components/credits/context/provider'\nimport { CreditsPageCommon } from '../components/credits/type'\nimport { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes'\n\nimport { CreditsBanner, CreditsBannerCopy } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard, CreditsInfoCardCopy } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits, CreditsBenefitsCopy } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits, CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsAnkersolixTask, CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask'\nimport { CreditsRedeemList, CreditsRedeemListCopy } from '../components/credits/creditsRedeemList'\nimport { CreditsCash, CreditsCashCopy } from '../components/credits/creditsCash'\nimport { CreditsMemberPrice, CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice'\nimport { CreditsFaq, CreditsFaqCopy } from '../components/credits/creditsFaq'\nimport { CreditsNavigation, CreditsNavigationCopy } from '../components/credits/creditsNavigation'\nimport { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type'\n\nexport enum ComponentKey {\n Navigation = 'creditsNavigation',\n Banner = 'creditsBanner',\n InfoCard = 'creditsInfoCard',\n Benefits = 'creditsBenefits',\n WaysToGetCredits = 'creditsWaysToGetCredits',\n AnkersolixTask = 'creditsAnkersolixTask',\n RedeemList = 'creditsRedeemList',\n SpendCreditsLikeCash = 'creditsCash',\n MemberPrice = 'creditsMemberPrice',\n Faqs = 'creditsFaq',\n}\nexport type CreditsTemplateProps = {\n headlessConfig: HeadlessConfig\n siteConfig: {\n registrationsSettings: {\n authCodeActivate: AuthCodeActivateCopy\n }\n taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>\n memberPriceDiscount?: FunctionMemberPriceConfig[]\n }\n creditsConfig?: {\n alpcBrand?: string\n }\n pageConfig: {\n order: ComponentKey[]\n common: CreditsPageCommon\n components: {\n [ComponentKey.Navigation]?: CreditsNavigationCopy\n [ComponentKey.Banner]?: CreditsBannerCopy\n [ComponentKey.InfoCard]?: CreditsInfoCardCopy\n [ComponentKey.Benefits]?: CreditsBenefitsCopy\n [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy\n [ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy\n [ComponentKey.RedeemList]?: CreditsRedeemListCopy\n [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy\n [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy\n [ComponentKey.Faqs]?: CreditsFaqCopy\n }\n }\n userContext: {\n profile: any\n removeProfile: () => void\n isLoadingProfile: boolean\n creditInfo: any\n customer: any\n customerLoading: boolean\n fetchCreditInfo: () => void\n }\n registrationContext: {\n openSignUpPopup: () => void\n openSignInPopup: () => void\n }\n gtm: {\n pageGroup: string\n pageHandle?: string\n }\n cartConfig?: {\n addToCart: (params: {\n variantList: Array<{\n variant: any\n quantity: number\n attributes?: Array<{ key: string; value: string }>\n }>\n cartAttributes?: Record<string, string>\n discountCodes?: string[]\n }) => void | Promise<any>\n }\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n creditsConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n cartConfig,\n}: CreditsTemplateProps) => {\n console.log('siteConfig', siteConfig)\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n memberPriceDiscount={siteConfig.memberPriceDiscount}\n alpcBrand={creditsConfig?.alpcBrand}\n cartConfig={cartConfig}\n >\n {/* \u5BFC\u822A\u7EC4\u4EF6 - \u56FA\u5B9A\u4F4D\u7F6E\uFF0C\u4E0D\u53C2\u4E0E order \u6392\u5E8F */}\n {pageConfig.components[ComponentKey.Navigation] && (\n <CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />\n )}\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n // \u8DF3\u8FC7\u5BFC\u822A\u7EC4\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u5DF2\u7ECF\u56FA\u5B9A\u6E32\u67D3\u5728\u4E0A\u65B9\n if (key === ComponentKey.Navigation) return null\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />\n )}\n {key === ComponentKey.Benefits && (\n <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />\n )}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n id={key}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.AnkersolixTask && (\n <CreditsAnkersolixTask copy={componentCopy as CreditsAnkersolixTaskCopy} id={key} />\n )}\n {key === ComponentKey.RedeemList && (\n <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />\n )}\n {key === ComponentKey.SpendCreditsLikeCash && (\n <CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />\n )}\n {key === ComponentKey.MemberPrice && (\n <CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />\n )}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n </CreditsProvider>\n </Registration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jsx", "jsxs", "classNames", "HeadlessProvider", "RegistrationProvider", "CreditsProvider", "CreditsBanner", "CreditsInfoCard", "CreditsBenefits", "CreditsWaysToGetCredits", "CreditsAnkersolixTask", "CreditsRedeemList", "CreditsCash", "CreditsMemberPrice", "CreditsFaq", "CreditsNavigation", "ComponentKey", "CreditsTemplate", "headlessConfig", "siteConfig", "creditsConfig", "userContext", "pageConfig", "registrationContext", "gtm", "cartConfig", "key", "componentCopy"]
4
+ "sourcesContent": ["import { classNames, HeadlessProvider } from '@anker-in/lib'\nimport { RegistrationProvider } from '../components/registration/context/provider'\nimport { CreditsProvider, useCreditsContext } from '../components/credits/context/provider'\nimport { CreditsBanner } from '../components/credits/creditsBanner'\nimport { CreditsInfoCard } from '../components/credits/creditsInfoCard'\nimport { CreditsBenefits } from '../components/credits/creditsBenefits'\nimport { CreditsWaysToGetCredits } from '../components/credits/creditsWaysToGetCredits'\nimport { CreditsAnkersolixTask } from '../components/credits/creditsAnkersolixTask'\nimport { CreditsRedeemList } from '../components/credits/creditsRedeemList'\nimport { CreditsGoGift } from '../components/credits/creditsGoGift'\nimport { CreditsCash } from '../components/credits/creditsCash'\nimport { CreditsMemberPrice } from '../components/credits/creditsMemberPrice'\nimport { CreditsFaq } from '../components/credits/creditsFaq'\nimport { CreditsNavigation } from '../components/credits/creditsNavigation'\nimport ActivitiesModal from '../components/credits/modal/ActivitiesModal'\nimport RewardsModal from '../components/credits/modal/RewardsModal'\nimport { ComponentKey } from './Credits.types'\nimport type {\n CreditsTemplateProps,\n CreditsContentProps,\n CreditsBannerCopy,\n CreditsInfoCardCopy,\n CreditsBenefitsCopy,\n CreditsWaysToGetCreditsCopy,\n CreditsAnkersolixTaskCopy,\n CreditsRedeemListCopy,\n CreditsGoGiftCopy,\n CreditsCashCopy,\n CreditsMemberPriceCopy,\n CreditsFaqCopy,\n} from './Credits.types'\n\nconst CreditsContent = ({ headlessConfig, pageConfig, userContext }: CreditsContentProps) => {\n const { openMyRewardsModal, setOpenMyRewardsModal, openActivitiesModal, setOpenActivitiesModal, pageCommon } = useCreditsContext()\n\n return (\n <>\n {/* \u5BFC\u822A\u7EC4\u4EF6 - \u56FA\u5B9A\u4F4D\u7F6E\uFF0C\u4E0D\u53C2\u4E0E order \u6392\u5E8F */}\n {pageConfig.components[ComponentKey.Navigation] && (\n <CreditsNavigation copy={pageConfig.components[ComponentKey.Navigation]} />\n )}\n <div className={classNames('bg-[#f5f5f7] leading-[1.2]')}>\n {pageConfig.order.map(key => {\n // \u8DF3\u8FC7\u5BFC\u822A\u7EC4\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u5DF2\u7ECF\u56FA\u5B9A\u6E32\u67D3\u5728\u4E0A\u65B9\n if (key === ComponentKey.Navigation) return null\n const componentCopy = pageConfig.components?.[key]\n if (!componentCopy) return null\n return (\n <>\n {key === ComponentKey.Banner && <CreditsBanner copy={componentCopy as CreditsBannerCopy} id={key} />}\n {key === ComponentKey.InfoCard && userContext?.profile && (\n <CreditsInfoCard copy={componentCopy as CreditsInfoCardCopy} id={key} />\n )}\n {key === ComponentKey.Benefits && (\n <CreditsBenefits copy={componentCopy as CreditsBenefitsCopy} id={key} />\n )}\n {key === ComponentKey.WaysToGetCredits && (\n <CreditsWaysToGetCredits\n copy={componentCopy as CreditsWaysToGetCreditsCopy}\n id={key}\n classNames={\n headlessConfig.brand === 'anker'\n ? {\n subtitle: 'text-white',\n equalCreditsText:\n 'bg-gradient-to-r from-[#3AD1FF] to-[#008CD6] bg-clip-text text-transparent',\n }\n : {\n subtitle: 'text-[#D1D1D1]',\n equalCreditsText: 'text-[#F6EAD0]',\n }\n }\n />\n )}\n {key === ComponentKey.AnkersolixTask && (\n <CreditsAnkersolixTask copy={componentCopy as CreditsAnkersolixTaskCopy} id={key} />\n )}\n {key === ComponentKey.RedeemList && (\n <CreditsRedeemList copy={componentCopy as CreditsRedeemListCopy} id={key} />\n )}\n {key === ComponentKey.GoGift && <CreditsGoGift copy={componentCopy as CreditsGoGiftCopy} id={key} />}\n {key === ComponentKey.SpendCreditsLikeCash && (\n <CreditsCash copy={componentCopy as CreditsCashCopy} id={key} />\n )}\n {key === ComponentKey.MemberPrice && (\n <CreditsMemberPrice copy={componentCopy as CreditsMemberPriceCopy} id={key} />\n )}\n {key === ComponentKey.Faqs && <CreditsFaq copy={componentCopy as CreditsFaqCopy} id={key} />}\n {key !== ComponentKey.Banner && (\n <div className=\"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16\" />\n )}\n </>\n )\n })}\n </div>\n\n {/* Global Modals */}\n {pageCommon?.activitiesModal && (\n <ActivitiesModal\n isOpen={openActivitiesModal}\n data={pageCommon.activitiesModal}\n onClose={() => setOpenActivitiesModal(false)}\n />\n )}\n {pageCommon?.rewardsModal && (\n <RewardsModal\n isOpen={openMyRewardsModal}\n data={pageCommon.rewardsModal}\n onClose={() => setOpenMyRewardsModal(false)}\n />\n )}\n </>\n )\n}\n\nexport const CreditsTemplate = ({\n headlessConfig,\n siteConfig,\n creditsConfig,\n userContext,\n pageConfig,\n registrationContext,\n gtm,\n cartConfig,\n}: CreditsTemplateProps) => {\n return (\n <HeadlessProvider headlessConfig={headlessConfig}>\n <RegistrationProvider copy={siteConfig.registrationsSettings} email={userContext?.profile?.email}>\n <CreditsProvider\n profile={userContext?.profile}\n removeProfile={userContext?.removeProfile}\n isLoadingProfile={userContext?.isLoadingProfile}\n openSignInPopup={registrationContext.openSignInPopup}\n openSignUpPopup={registrationContext.openSignUpPopup}\n creditInfo={userContext?.creditInfo}\n taskIdToTypeMapping={siteConfig.taskIdToTypeMapping}\n customer={userContext?.customer}\n fetchCreditInfo={userContext?.fetchCreditInfo}\n customerLoading={userContext?.customerLoading}\n gtm={gtm}\n pageCommon={pageConfig.common}\n memberPriceDiscount={siteConfig.memberPriceDiscount}\n alpcBrand={creditsConfig?.alpcBrand}\n cartConfig={cartConfig}\n >\n <CreditsContent headlessConfig={headlessConfig} pageConfig={pageConfig} userContext={userContext} />\n </Cre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CACF,IAEIrC,EAACG,EAAA,CAAiB,eAAgBmB,EAChC,SAAAtB,EAACI,EAAA,CAAqB,KAAM6B,EAAW,sBAAuB,MAAOT,GAAa,SAAS,MACzF,SAAAxB,EAACK,EAAA,CACC,QAASmB,GAAa,QACtB,cAAeA,GAAa,cAC5B,iBAAkBA,GAAa,iBAC/B,gBAAiBW,EAAoB,gBACrC,gBAAiBA,EAAoB,gBACrC,WAAYX,GAAa,WACzB,oBAAqBS,EAAW,oBAChC,SAAUT,GAAa,SACvB,gBAAiBA,GAAa,gBAC9B,gBAAiBA,GAAa,gBAC9B,IAAKY,EACL,WAAYb,EAAW,OACvB,oBAAqBU,EAAW,oBAChC,UAAWC,GAAe,UAC1B,WAAYG,EAEZ,SAAArC,EAACqB,EAAA,CAAe,eAAgBC,EAAgB,WAAYC,EAAY,YAAaC,EAAa,EACpG,EACF,EACF",
6
+ "names": ["Fragment", "jsx", "jsxs", "classNames", "HeadlessProvider", "RegistrationProvider", "CreditsProvider", "useCreditsContext", "CreditsBanner", "CreditsInfoCard", "CreditsBenefits", "CreditsWaysToGetCredits", "CreditsAnkersolixTask", "CreditsRedeemList", "CreditsGoGift", "CreditsCash", "CreditsMemberPrice", "CreditsFaq", "CreditsNavigation", "ActivitiesModal", "RewardsModal", "ComponentKey", "CreditsContent", "headlessConfig", "pageConfig", "userContext", "openMyRewardsModal", "setOpenMyRewardsModal", "openActivitiesModal", "setOpenActivitiesModal", "pageCommon", "key", "componentCopy", "CreditsTemplate", "siteConfig", "creditsConfig", "registrationContext", "gtm", "cartConfig"]
7
7
  }
@@ -0,0 +1,96 @@
1
+ import { HeadlessConfig } from '@anker-in/lib';
2
+ import { DTC_TASK_TYPE } from '../components/credits/context/const';
3
+ import { CreditsPageCommon } from '../components/credits/type';
4
+ import { FunctionMemberPriceConfig } from '../components/credits/context/memberPriceTypes';
5
+ import { AuthCodeActivateCopy } from 'src/components/registration/authCodeActivate/type';
6
+ import type { CreditsBannerCopy } from '../components/credits/creditsBanner';
7
+ import type { CreditsInfoCardCopy } from '../components/credits/creditsInfoCard';
8
+ import type { CreditsBenefitsCopy } from '../components/credits/creditsBenefits';
9
+ import type { CreditsWaysToGetCreditsCopy } from '../components/credits/creditsWaysToGetCredits';
10
+ import type { CreditsAnkersolixTaskCopy } from '../components/credits/creditsAnkersolixTask';
11
+ import type { CreditsRedeemListCopy } from '../components/credits/creditsRedeemList';
12
+ import type { CreditsGoGiftCopy } from '../components/credits/creditsGoGift';
13
+ import type { CreditsCashCopy } from '../components/credits/creditsCash';
14
+ import type { CreditsMemberPriceCopy } from '../components/credits/creditsMemberPrice';
15
+ import type { CreditsFaqCopy } from '../components/credits/creditsFaq';
16
+ import type { CreditsNavigationCopy } from '../components/credits/creditsNavigation';
17
+ export type { CreditsBannerCopy, CreditsInfoCardCopy, CreditsBenefitsCopy, CreditsWaysToGetCreditsCopy, CreditsAnkersolixTaskCopy, CreditsRedeemListCopy, CreditsGoGiftCopy, CreditsCashCopy, CreditsMemberPriceCopy, CreditsFaqCopy, CreditsNavigationCopy, };
18
+ export declare enum ComponentKey {
19
+ Navigation = "creditsNavigation",
20
+ Banner = "creditsBanner",
21
+ InfoCard = "creditsInfoCard",
22
+ Benefits = "creditsBenefits",
23
+ WaysToGetCredits = "creditsWaysToGetCredits",
24
+ AnkersolixTask = "creditsAnkersolixTask",
25
+ RedeemList = "creditsRedeemList",
26
+ GoGift = "creditsGoGift",
27
+ SpendCreditsLikeCash = "creditsCash",
28
+ MemberPrice = "creditsMemberPrice",
29
+ Faqs = "creditsFaq"
30
+ }
31
+ export type CreditsTemplateProps = {
32
+ headlessConfig: HeadlessConfig;
33
+ siteConfig: {
34
+ registrationsSettings: {
35
+ authCodeActivate: AuthCodeActivateCopy;
36
+ };
37
+ taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
38
+ memberPriceDiscount?: FunctionMemberPriceConfig[];
39
+ };
40
+ creditsConfig?: {
41
+ alpcBrand?: string;
42
+ };
43
+ pageConfig: {
44
+ order: ComponentKey[];
45
+ common: CreditsPageCommon;
46
+ components: {
47
+ [ComponentKey.Navigation]?: CreditsNavigationCopy;
48
+ [ComponentKey.Banner]?: CreditsBannerCopy;
49
+ [ComponentKey.InfoCard]?: CreditsInfoCardCopy;
50
+ [ComponentKey.Benefits]?: CreditsBenefitsCopy;
51
+ [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy;
52
+ [ComponentKey.AnkersolixTask]?: CreditsAnkersolixTaskCopy;
53
+ [ComponentKey.RedeemList]?: CreditsRedeemListCopy;
54
+ [ComponentKey.GoGift]?: CreditsGoGiftCopy;
55
+ [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy;
56
+ [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy;
57
+ [ComponentKey.Faqs]?: CreditsFaqCopy;
58
+ };
59
+ };
60
+ userContext: {
61
+ profile: any;
62
+ removeProfile: () => void;
63
+ isLoadingProfile: boolean;
64
+ creditInfo: any;
65
+ customer: any;
66
+ customerLoading: boolean;
67
+ fetchCreditInfo: () => void;
68
+ };
69
+ registrationContext: {
70
+ openSignUpPopup: () => void;
71
+ openSignInPopup: () => void;
72
+ };
73
+ gtm: {
74
+ pageGroup: string;
75
+ pageHandle?: string;
76
+ };
77
+ cartConfig?: {
78
+ addToCart: (params: {
79
+ variantList: Array<{
80
+ variant: any;
81
+ quantity: number;
82
+ attributes?: Array<{
83
+ key: string;
84
+ value: string;
85
+ }>;
86
+ }>;
87
+ cartAttributes?: Record<string, string>;
88
+ discountCodes?: string[];
89
+ }) => void | Promise<any>;
90
+ };
91
+ };
92
+ export type CreditsContentProps = {
93
+ headlessConfig: HeadlessConfig;
94
+ pageConfig: CreditsTemplateProps['pageConfig'];
95
+ userContext: CreditsTemplateProps['userContext'];
96
+ };
@@ -0,0 +1,2 @@
1
+ var t=(e=>(e.Navigation="creditsNavigation",e.Banner="creditsBanner",e.InfoCard="creditsInfoCard",e.Benefits="creditsBenefits",e.WaysToGetCredits="creditsWaysToGetCredits",e.AnkersolixTask="creditsAnkersolixTask",e.RedeemList="creditsRedeemList",e.GoGift="creditsGoGift",e.SpendCreditsLikeCash="creditsCash",e.MemberPrice="creditsMemberPrice",e.Faqs="creditsFaq",e))(t||{});export{t as ComponentKey};
2
+ //# sourceMappingURL=Credits.types.js.map