@pisell/private-materials 6.3.30 → 6.3.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +9 -1
  6. package/build/lowcode/preview.js +146 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/Sales/Summary/utils.d.ts +1 -1
  12. package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -2
  13. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +267 -76
  14. package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  15. package/es/components/appointmentBooking/hooks.js +30 -30
  16. package/es/components/appointmentBooking/locales.js +9 -6
  17. package/es/components/booking/addons/model.d.ts +10 -1
  18. package/es/components/booking/components/TabProduct/index.d.ts +1 -0
  19. package/es/components/booking/components/footer/index.d.ts +1 -0
  20. package/es/components/booking/components/footer/index.js +4 -1
  21. package/es/components/booking/components/footer/utils.js +62 -46
  22. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  23. package/es/components/booking/forms/model.d.ts +10 -1
  24. package/es/components/booking/forms/table/index.d.ts +1 -0
  25. package/es/components/booking/info/clientVariant/hooks/useClientFn.js +2 -2
  26. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  27. package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
  28. package/es/components/booking/info/main.js +3 -2
  29. package/es/components/booking/info/model.js +5 -0
  30. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  31. package/es/components/booking/info/service/like/index.d.ts +1 -0
  32. package/es/components/booking/info/service2/utils.d.ts +1 -1
  33. package/es/components/booking/info2/index.js +3 -2
  34. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  35. package/es/components/booking/info2/service/contactInfoMode/index.js +93 -0
  36. package/es/components/booking/locales.js +9 -3
  37. package/es/components/booking/model.js +3 -0
  38. package/es/components/booking/notes/model.d.ts +10 -1
  39. package/es/components/booking/payments/model.d.ts +10 -1
  40. package/es/components/booking/utils.d.ts +2 -2
  41. package/es/components/eftpos/deviceList/index.d.ts +1 -0
  42. package/es/components/eftpos/form/index.d.ts +1 -0
  43. package/es/components/eftpos/group/index.d.ts +1 -0
  44. package/es/components/eftpos/hooks.d.ts +1 -0
  45. package/es/components/eftpos/icon/apiKey.d.ts +1 -0
  46. package/es/components/eftpos/icon/device.d.ts +1 -0
  47. package/es/components/eftpos/receipt/index.d.ts +1 -0
  48. package/es/components/eftposPay/amount.d.ts +1 -1
  49. package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
  50. package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
  51. package/es/components/eftposPay/component/step/index.d.ts +1 -0
  52. package/es/components/eftposPay/component/step/step.d.ts +1 -0
  53. package/es/components/eftposPay/device.d.ts +1 -1
  54. package/es/components/eftposPay/hooks.d.ts +2 -2
  55. package/es/components/eftposPay/store/index.d.ts +4 -4
  56. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  57. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  58. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  59. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  60. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  61. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  62. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  63. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  64. package/es/components/pay/toC/model.d.ts +9 -1
  65. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  66. package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
  67. package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
  68. package/es/components/schedules/model.d.ts +9 -1
  69. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  70. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  71. package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
  72. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  73. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  74. package/es/components/wallet/Detail/model.d.ts +13 -1
  75. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  76. package/es/components/wallet/PointCard/model.d.ts +13 -1
  77. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  78. package/es/components/wallet/Voucher/model.d.ts +13 -1
  79. package/es/components/wallet/model.d.ts +9 -1
  80. package/es/index.d.ts +3 -0
  81. package/es/index.js +4 -1
  82. package/es/plus/clientName/index.js +18 -0
  83. package/es/plus/clientName/index.less +10 -0
  84. package/es/plus/clientName/type.js +1 -0
  85. package/es/plus/clientName/utils.js +18 -0
  86. package/es/plus/contactInfo/components/Avatar/index.js +30 -0
  87. package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
  88. package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
  89. package/es/plus/contactInfo/index.js +198 -0
  90. package/es/plus/contactInfo/index.less +621 -0
  91. package/es/plus/contactInfo/locales.js +14 -0
  92. package/es/plus/contactInfo/types.js +1 -0
  93. package/es/plus/contactInfo/utils.js +50 -0
  94. package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
  95. package/es/plus/contactInfoModal/index.js +154 -0
  96. package/es/plus/contactInfoModal/index.less +19 -0
  97. package/es/plus/contactInfoModal/locales.js +65 -0
  98. package/es/pro/Login2.0/AuthModal.d.ts +143 -0
  99. package/es/pro/Login2.0/AuthModal.js +624 -0
  100. package/es/pro/Login2.0/Login2.d.ts +61 -0
  101. package/es/pro/Login2.0/Login2.js +2157 -0
  102. package/es/pro/Login2.0/Register2.d.ts +65 -0
  103. package/es/pro/Login2.0/Register2.js +1501 -0
  104. package/es/pro/Login2.0/components/ForgotPasswordFlow.js +330 -0
  105. package/es/pro/Login2.0/components/LegalTerms.d.ts +8 -0
  106. package/es/pro/Login2.0/components/LegalTerms.js +51 -0
  107. package/es/pro/Login2.0/components/LegalTerms.less +74 -0
  108. package/es/pro/Login2.0/components/LoginCodeInput.js +207 -0
  109. package/es/pro/Login2.0/components/OAuthButtonGroup.js +55 -0
  110. package/es/pro/Login2.0/components/PhoneInput.js +414 -0
  111. package/es/pro/Login2.0/components/PhoneInput.less +148 -0
  112. package/es/pro/Login2.0/components/phoneValidation.js +228 -0
  113. package/es/pro/Login2.0/hooks/index.d.ts +2 -0
  114. package/es/pro/Login2.0/hooks/index.js +1 -0
  115. package/es/pro/Login2.0/hooks/usePasswordValidationRules.js +87 -0
  116. package/es/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
  117. package/es/pro/Login2.0/hooks/useRegisterFlow.js +158 -0
  118. package/es/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
  119. package/es/pro/Login2.0/hooks/useRegistrationMethods.js +31 -0
  120. package/es/pro/Login2.0/index.js +8 -0
  121. package/es/pro/Login2.0/index.less +993 -0
  122. package/es/pro/Login2.0/locales.js +622 -0
  123. package/es/pro/Login2.0/shared/Header.d.ts +11 -0
  124. package/es/pro/Login2.0/shared/Header.js +42 -0
  125. package/es/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
  126. package/es/pro/Login2.0/shared/OAuthButtons.js +59 -0
  127. package/es/pro/Login2.0/shared/registerFlow.js +171 -0
  128. package/es/pro/Login2.0/shared/types.d.ts +232 -0
  129. package/es/pro/Login2.0/shared/types.js +1 -0
  130. package/es/pro/Login2.0/steps/CodeInput.js +209 -0
  131. package/es/pro/Login2.0/steps/EmailAlreadyRegistered.js +35 -0
  132. package/es/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +25 -0
  133. package/es/pro/Login2.0/steps/EmailLinkExpired.js +33 -0
  134. package/es/pro/Login2.0/steps/SetPassword.js +148 -0
  135. package/es/pro/Login2.0/steps/VerificationSuccess.js +35 -0
  136. package/es/pro/Login2.0/steps/VerifyingEmailLink.js +17 -0
  137. package/es/pro/Login2.0/steps/WaitEmailLink.js +54 -0
  138. package/es/pro/Login2.0/steps/index.js +11 -0
  139. package/es/pro/Login2.0/steps/steps.less +423 -0
  140. package/es/pro/Login2.0/types.js +1 -0
  141. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  142. package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -3
  143. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +151 -13
  144. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  145. package/lib/components/appointmentBooking/hooks.js +73 -35
  146. package/lib/components/appointmentBooking/locales.js +6 -3
  147. package/lib/components/booking/addons/model.d.ts +10 -1
  148. package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
  149. package/lib/components/booking/components/footer/index.d.ts +1 -0
  150. package/lib/components/booking/components/footer/index.js +4 -1
  151. package/lib/components/booking/components/footer/utils.js +70 -38
  152. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
  153. package/lib/components/booking/forms/model.d.ts +10 -1
  154. package/lib/components/booking/forms/table/index.d.ts +1 -0
  155. package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +1 -1
  156. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  157. package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
  158. package/lib/components/booking/info/main.js +5 -4
  159. package/lib/components/booking/info/model.js +5 -0
  160. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  161. package/lib/components/booking/info/service/like/index.d.ts +1 -0
  162. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  163. package/lib/components/booking/info2/index.js +5 -4
  164. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  165. package/lib/components/booking/info2/service/contactInfoMode/index.js +104 -0
  166. package/lib/components/booking/locales.js +9 -3
  167. package/lib/components/booking/model.js +3 -0
  168. package/lib/components/booking/notes/model.d.ts +10 -1
  169. package/lib/components/booking/payments/model.d.ts +10 -1
  170. package/lib/components/booking/utils.d.ts +2 -2
  171. package/lib/components/eftpos/deviceList/index.d.ts +1 -0
  172. package/lib/components/eftpos/form/index.d.ts +1 -0
  173. package/lib/components/eftpos/group/index.d.ts +1 -0
  174. package/lib/components/eftpos/hooks.d.ts +1 -0
  175. package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
  176. package/lib/components/eftpos/icon/device.d.ts +1 -0
  177. package/lib/components/eftpos/receipt/index.d.ts +1 -0
  178. package/lib/components/eftposPay/amount.d.ts +1 -1
  179. package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
  180. package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
  181. package/lib/components/eftposPay/component/step/index.d.ts +1 -0
  182. package/lib/components/eftposPay/component/step/step.d.ts +1 -0
  183. package/lib/components/eftposPay/device.d.ts +1 -1
  184. package/lib/components/eftposPay/hooks.d.ts +2 -2
  185. package/lib/components/eftposPay/store/index.d.ts +4 -4
  186. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  187. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
  188. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  189. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  190. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  191. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  192. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  193. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  194. package/lib/components/pay/toC/model.d.ts +9 -1
  195. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  196. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  197. package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
  198. package/lib/components/schedules/model.d.ts +9 -1
  199. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
  200. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
  201. package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
  202. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  203. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  204. package/lib/components/wallet/Detail/model.d.ts +13 -1
  205. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  206. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  207. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  208. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  209. package/lib/components/wallet/model.d.ts +9 -1
  210. package/lib/index.d.ts +3 -0
  211. package/lib/index.js +13 -0
  212. package/lib/plus/clientName/index.js +53 -0
  213. package/lib/plus/clientName/index.less +10 -0
  214. package/lib/plus/clientName/type.js +17 -0
  215. package/lib/plus/clientName/utils.js +43 -0
  216. package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
  217. package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
  218. package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
  219. package/lib/plus/contactInfo/index.js +226 -0
  220. package/lib/plus/contactInfo/index.less +621 -0
  221. package/lib/plus/contactInfo/locales.js +38 -0
  222. package/lib/plus/contactInfo/types.js +17 -0
  223. package/lib/plus/contactInfo/utils.js +64 -0
  224. package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
  225. package/lib/plus/contactInfoModal/index.js +138 -0
  226. package/lib/plus/contactInfoModal/index.less +19 -0
  227. package/lib/plus/contactInfoModal/locales.js +89 -0
  228. package/lib/pro/Login2.0/AuthModal.d.ts +143 -0
  229. package/lib/pro/Login2.0/AuthModal.js +498 -0
  230. package/lib/pro/Login2.0/Login2.d.ts +61 -0
  231. package/lib/pro/Login2.0/Login2.js +1468 -0
  232. package/lib/pro/Login2.0/Register2.d.ts +65 -0
  233. package/lib/pro/Login2.0/Register2.js +1062 -0
  234. package/lib/pro/Login2.0/components/ForgotPasswordFlow.js +213 -0
  235. package/lib/pro/Login2.0/components/LegalTerms.d.ts +8 -0
  236. package/lib/pro/Login2.0/components/LegalTerms.js +76 -0
  237. package/lib/pro/Login2.0/components/LegalTerms.less +74 -0
  238. package/lib/pro/Login2.0/components/LoginCodeInput.js +161 -0
  239. package/lib/pro/Login2.0/components/OAuthButtonGroup.js +87 -0
  240. package/lib/pro/Login2.0/components/PhoneInput.js +263 -0
  241. package/lib/pro/Login2.0/components/PhoneInput.less +148 -0
  242. package/lib/pro/Login2.0/components/phoneValidation.js +153 -0
  243. package/lib/pro/Login2.0/hooks/index.d.ts +2 -0
  244. package/lib/pro/Login2.0/hooks/index.js +29 -0
  245. package/lib/pro/Login2.0/hooks/usePasswordValidationRules.js +140 -0
  246. package/lib/pro/Login2.0/hooks/useRegisterFlow.d.ts +39 -0
  247. package/lib/pro/Login2.0/hooks/useRegisterFlow.js +149 -0
  248. package/lib/pro/Login2.0/hooks/useRegistrationMethods.d.ts +9 -0
  249. package/lib/pro/Login2.0/hooks/useRegistrationMethods.js +51 -0
  250. package/lib/pro/Login2.0/index.js +45 -0
  251. package/lib/pro/Login2.0/index.less +993 -0
  252. package/lib/pro/Login2.0/locales.js +646 -0
  253. package/lib/pro/Login2.0/shared/Header.d.ts +11 -0
  254. package/lib/pro/Login2.0/shared/Header.js +81 -0
  255. package/lib/pro/Login2.0/shared/OAuthButtons.d.ts +11 -0
  256. package/lib/pro/Login2.0/shared/OAuthButtons.js +78 -0
  257. package/lib/pro/Login2.0/shared/registerFlow.js +235 -0
  258. package/lib/pro/Login2.0/shared/types.d.ts +232 -0
  259. package/lib/pro/Login2.0/shared/types.js +17 -0
  260. package/lib/pro/Login2.0/steps/CodeInput.js +160 -0
  261. package/lib/pro/Login2.0/steps/EmailAlreadyRegistered.js +46 -0
  262. package/lib/pro/Login2.0/steps/EmailLinkAlreadyUsed.js +51 -0
  263. package/lib/pro/Login2.0/steps/EmailLinkExpired.js +51 -0
  264. package/lib/pro/Login2.0/steps/SetPassword.js +131 -0
  265. package/lib/pro/Login2.0/steps/VerificationSuccess.js +49 -0
  266. package/lib/pro/Login2.0/steps/VerifyingEmailLink.js +41 -0
  267. package/lib/pro/Login2.0/steps/WaitEmailLink.js +67 -0
  268. package/lib/pro/Login2.0/steps/index.js +60 -0
  269. package/lib/pro/Login2.0/steps/steps.less +423 -0
  270. package/lib/pro/Login2.0/types.js +17 -0
  271. package/lowcode/authmodal/meta.ts +395 -0
  272. package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
  273. package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
  274. package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
  275. package/lowcode/contact-info/fragments/textStyle.ts +33 -0
  276. package/lowcode/contact-info/meta.ts +199 -0
  277. package/lowcode/contact-info-modal/meta.ts +98 -0
  278. package/lowcode/login2/CONFIG.md +447 -0
  279. package/lowcode/login2/TEST_CONFIG.md +324 -0
  280. package/lowcode/login2/VERIFICATION_METHODS.md +364 -0
  281. package/lowcode/login2/meta.ts +560 -0
  282. package/lowcode/login2/snippets.ts +124 -0
  283. package/lowcode/register2/meta.ts +562 -0
  284. package/lowcode/register2/snippets.ts +257 -0
  285. package/package.json +5 -3
  286. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -3
  287. package/es/components/appointmentBooking/components/ConfirmInformation/index.d.ts +0 -4
  288. package/es/components/appointmentBooking/components/Services/index.d.ts +0 -4
  289. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  290. package/es/components/appointmentBooking/hooks.d.ts +0 -106
  291. package/es/components/appointmentBooking/locales.d.ts +0 -360
  292. package/es/components/booking/components/footer/utils.d.ts +0 -41
  293. package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -8
  294. package/es/components/booking/components/voucher/index.d.ts +0 -3
  295. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -43
  296. package/es/components/booking/info/clientVariant/vertical/index.d.ts +0 -8
  297. package/es/components/booking/info/main.d.ts +0 -12
  298. package/es/components/booking/info/model.d.ts +0 -5
  299. package/es/components/booking/info/service/editService/constants.d.ts +0 -1
  300. package/es/components/booking/info/service/editService/index.d.ts +0 -7
  301. package/es/components/booking/info2/index.d.ts +0 -12
  302. package/es/components/booking/info2/service/addService/index.d.ts +0 -11
  303. package/es/components/booking/locales.d.ts +0 -837
  304. package/es/components/booking/model.d.ts +0 -108
  305. package/es/components/eftposPay/component/fail/index.d.ts +0 -3
  306. package/es/components/index.d.ts +0 -22
  307. package/es/components/pay/toC/PaymentMethods/ApplePay/index.d.ts +0 -10
  308. package/es/components/pay/toC/PaymentMethods/GooglePay/index.d.ts +0 -9
  309. package/es/components/pay/toC/PaymentMethods/index.d.ts +0 -9
  310. package/es/components/ruleSetting/locales.d.ts +0 -48
  311. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -9
  312. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -4
  313. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -12
  314. package/es/components/ticketBooking/index.d.ts +0 -7
  315. package/es/plus/productSelect/ProductCard/index.d.ts +0 -47
  316. package/es/plus/productSelect/index.d.ts +0 -32
  317. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -3
  318. package/lib/components/appointmentBooking/components/ConfirmInformation/index.d.ts +0 -4
  319. package/lib/components/appointmentBooking/components/Services/index.d.ts +0 -4
  320. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -3
  321. package/lib/components/appointmentBooking/hooks.d.ts +0 -106
  322. package/lib/components/appointmentBooking/locales.d.ts +0 -360
  323. package/lib/components/booking/components/footer/utils.d.ts +0 -41
  324. package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -8
  325. package/lib/components/booking/components/voucher/index.d.ts +0 -3
  326. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -43
  327. package/lib/components/booking/info/clientVariant/vertical/index.d.ts +0 -8
  328. package/lib/components/booking/info/main.d.ts +0 -12
  329. package/lib/components/booking/info/model.d.ts +0 -5
  330. package/lib/components/booking/info/service/editService/constants.d.ts +0 -1
  331. package/lib/components/booking/info/service/editService/index.d.ts +0 -7
  332. package/lib/components/booking/info2/index.d.ts +0 -12
  333. package/lib/components/booking/info2/service/addService/index.d.ts +0 -11
  334. package/lib/components/booking/locales.d.ts +0 -837
  335. package/lib/components/booking/model.d.ts +0 -108
  336. package/lib/components/eftposPay/component/fail/index.d.ts +0 -3
  337. package/lib/components/index.d.ts +0 -22
  338. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.d.ts +0 -10
  339. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.d.ts +0 -9
  340. package/lib/components/pay/toC/PaymentMethods/index.d.ts +0 -9
  341. package/lib/components/ruleSetting/locales.d.ts +0 -48
  342. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -9
  343. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -4
  344. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -12
  345. package/lib/components/ticketBooking/index.d.ts +0 -7
  346. package/lib/plus/productSelect/ProductCard/index.d.ts +0 -47
  347. package/lib/plus/productSelect/index.d.ts +0 -32
@@ -0,0 +1,1062 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/pro/Login2.0/Register2.tsx
30
+ var Register2_exports = {};
31
+ __export(Register2_exports, {
32
+ default: () => Register2_default
33
+ });
34
+ module.exports = __toCommonJS(Register2_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_materials = require("@pisell/materials");
38
+ var import_ahooks = require("ahooks");
39
+ var import_classnames = __toESM(require("classnames"));
40
+ var import_utils = require("@pisell/utils");
41
+ var import_locales = __toESM(require("./locales"));
42
+ var import_Header = __toESM(require("./shared/Header"));
43
+ var import_PhoneInput = __toESM(require("./components/PhoneInput"));
44
+ var import_phoneValidation = require("./components/phoneValidation");
45
+ var import_LegalTerms = __toESM(require("./components/LegalTerms"));
46
+ var import_index = require("./index.less");
47
+ var import_useEngineContext = require("../../hooks/useEngineContext");
48
+ var import_useEngineContext2 = __toESM(require("../../hooks/useEngineContext"));
49
+ var import_useRegisterFlow = require("./hooks/useRegisterFlow");
50
+ var import_useRegistrationMethods = require("./hooks/useRegistrationMethods");
51
+ var import_registerFlow = require("./shared/registerFlow");
52
+ var import_steps = require("./steps");
53
+ var import_steps2 = require("./steps/steps.less");
54
+ var import_materials2 = require("@pisell/materials");
55
+ var import_usePasswordValidationRules = __toESM(require("./hooks/usePasswordValidationRules"));
56
+ var import_OAuthButtonGroup = __toESM(require("./components/OAuthButtonGroup"));
57
+ var Register2 = ({
58
+ config,
59
+ visible = true,
60
+ onClose,
61
+ className,
62
+ style,
63
+ onRegister,
64
+ onOAuthLogin,
65
+ onSendVerificationCode,
66
+ onEmailLinkExpired,
67
+ onGoToLogin,
68
+ onError
69
+ }) => {
70
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
71
+ const [form] = import_antd.Form.useForm();
72
+ const [loading, setLoading] = (0, import_react.useState)(false);
73
+ const [countdown, setCountdown] = (0, import_react.useState)(0);
74
+ const [countries, setCountries] = (0, import_react.useState)([]);
75
+ const [codeError, setCodeError] = (0, import_react.useState)("");
76
+ const pisellOS = (0, import_useEngineContext.usePisellOS)();
77
+ const registerAndLogin = pisellOS == null ? void 0 : pisellOS.getModule("registerAndLogin");
78
+ const context = (0, import_useEngineContext2.default)();
79
+ const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
80
+ const shopId = ((_g = (_f = (_e = (_d = (_c = (_b = utils.getStore) == null ? void 0 : _b.call(utils)) == null ? void 0 : _c.getState) == null ? void 0 : _d.call(_c)) == null ? void 0 : _e.global) == null ? void 0 : _f.shop) == null ? void 0 : _g.id) || 9;
81
+ const [emailLinkVerifyStatus, setEmailLinkVerifyStatus] = (0, import_react.useState)(null);
82
+ const [verifiedEmail, setVerifiedEmail] = (0, import_react.useState)("");
83
+ const normalizedRegistrationMethods = (0, import_react.useMemo)(() => {
84
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2;
85
+ if (config.registrationMethods && config.registrationMethods.length > 0) {
86
+ return config.registrationMethods;
87
+ }
88
+ const methods = [];
89
+ if ((_a2 = config.email) == null ? void 0 : _a2.enable_email) {
90
+ methods.push({
91
+ type: "email",
92
+ verificationMethod: config.email.registration_verification ? config.email.registration_verification : "verification_code"
93
+ });
94
+ }
95
+ if ((_b2 = config.phone) == null ? void 0 : _b2.enable_phone_number) {
96
+ methods.push({
97
+ type: "phone",
98
+ verificationMethod: "verification_code"
99
+ // 手机号仅支持验证码
100
+ });
101
+ }
102
+ if (((_d2 = (_c2 = config.oauth) == null ? void 0 : _c2.google) == null ? void 0 : _d2.enabled) && ((_f2 = (_e2 = config.oauth) == null ? void 0 : _e2.google) == null ? void 0 : _f2.client_id)) {
103
+ methods.push({
104
+ type: "google",
105
+ clientId: config.oauth.google.client_id
106
+ });
107
+ }
108
+ if (((_h2 = (_g2 = config.oauth) == null ? void 0 : _g2.facebook) == null ? void 0 : _h2.enabled) && ((_j2 = (_i2 = config.oauth) == null ? void 0 : _i2.facebook) == null ? void 0 : _j2.app_id)) {
109
+ methods.push({
110
+ type: "facebook",
111
+ appId: config.oauth.facebook.app_id
112
+ });
113
+ }
114
+ if (((_l2 = (_k2 = config.oauth) == null ? void 0 : _k2.apple) == null ? void 0 : _l2.enabled) && ((_n2 = (_m2 = config.oauth) == null ? void 0 : _m2.apple) == null ? void 0 : _n2.client_id)) {
115
+ methods.push({
116
+ type: "apple",
117
+ clientId: config.oauth.apple.client_id
118
+ });
119
+ }
120
+ return methods;
121
+ }, [config.registrationMethods, config.email, config.phone, config.oauth]);
122
+ const getDefaultAuthMethod = () => {
123
+ var _a2, _b2, _c2, _d2;
124
+ if (normalizedRegistrationMethods.length > 0) {
125
+ if (config.defaultAuthMethod) {
126
+ const method = normalizedRegistrationMethods.find(
127
+ (m) => m.type === config.defaultAuthMethod
128
+ );
129
+ if (method) {
130
+ return config.defaultAuthMethod;
131
+ }
132
+ }
133
+ return normalizedRegistrationMethods[0].type;
134
+ }
135
+ if (config.defaultAuthMethod) {
136
+ return config.defaultAuthMethod;
137
+ }
138
+ if (((_a2 = config.phone) == null ? void 0 : _a2.enable_phone_number) && !((_b2 = config.email) == null ? void 0 : _b2.enable_email)) {
139
+ return "phone";
140
+ }
141
+ if (((_c2 = config.email) == null ? void 0 : _c2.enable_email) && !((_d2 = config.phone) == null ? void 0 : _d2.enable_phone_number)) {
142
+ return "email";
143
+ }
144
+ return "email";
145
+ };
146
+ const [currentAuthMethod, setCurrentAuthMethod] = (0, import_react.useState)(
147
+ () => getDefaultAuthMethod()
148
+ );
149
+ const getRegistrationMethodConfig = (0, import_react.useCallback)(
150
+ (type) => {
151
+ return normalizedRegistrationMethods.find(
152
+ (method) => method.type === type
153
+ );
154
+ },
155
+ [normalizedRegistrationMethods]
156
+ );
157
+ const getCurrentVerificationMethod = (0, import_react.useCallback)(() => {
158
+ var _a2;
159
+ const methodConfig = getRegistrationMethodConfig(currentAuthMethod);
160
+ if (methodConfig && "verificationMethod" in methodConfig) {
161
+ return methodConfig.verificationMethod;
162
+ }
163
+ if (currentAuthMethod === "email") {
164
+ return ((_a2 = config.email) == null ? void 0 : _a2.registration_verification) || "verification_code";
165
+ } else if (currentAuthMethod === "phone") {
166
+ return "verification_code";
167
+ }
168
+ return "verification_code";
169
+ }, [
170
+ currentAuthMethod,
171
+ getRegistrationMethodConfig,
172
+ config.email,
173
+ config.phone
174
+ ]);
175
+ const passwordValidationRules = (0, import_usePasswordValidationRules.default)(
176
+ (_h = config.ui) == null ? void 0 : _h.passwordRules,
177
+ {
178
+ translate: import_utils.locales.getText,
179
+ fallbackMinLength: 6,
180
+ messageKeys: {
181
+ required: "pisell-register2-password-required",
182
+ minLength: "pisell-register2-password-min-length",
183
+ requireUppercase: "pisell-set-password-require-uppercase",
184
+ requireLowercase: "pisell-set-password-require-lowercase",
185
+ requireNumber: "pisell-set-password-require-number",
186
+ requireSpecialCharacters: "pisell-set-password-require-special",
187
+ summary: "pisell-set-password-must-contain"
188
+ }
189
+ }
190
+ );
191
+ const isRegistrationMethodEnabled = (0, import_react.useCallback)(
192
+ (type) => {
193
+ return normalizedRegistrationMethods.some(
194
+ (method) => method.type === type
195
+ );
196
+ },
197
+ [normalizedRegistrationMethods]
198
+ );
199
+ const { shouldShowDivider, hasEmailAndPhone } = (0, import_useRegistrationMethods.useRegistrationMethods)(isRegistrationMethodEnabled);
200
+ const handleStepChange = (0, import_react.useCallback)(() => {
201
+ }, []);
202
+ const handleComplete = (0, import_react.useCallback)(
203
+ (data) => {
204
+ var _a2;
205
+ const apiResponse = (_a2 = data.extraData) == null ? void 0 : _a2.apiResponse;
206
+ onRegister == null ? void 0 : onRegister(
207
+ apiResponse || (data == null ? void 0 : data.data),
208
+ data.accountType,
209
+ {
210
+ account: data.account,
211
+ password: data.password || ""
212
+ },
213
+ config.channel
214
+ );
215
+ },
216
+ [onRegister, config.channel]
217
+ );
218
+ const {
219
+ flowData,
220
+ currentStepDef,
221
+ goToStep,
222
+ updateFlowData,
223
+ resetFlow,
224
+ handleError
225
+ } = (0, import_useRegisterFlow.useRegisterFlow)({
226
+ accountType: currentAuthMethod,
227
+ emailConfig: config.email,
228
+ phoneConfig: config.phone,
229
+ initialAccount: "",
230
+ onStepChange: handleStepChange,
231
+ onComplete: handleComplete
232
+ });
233
+ (0, import_react.useEffect)(() => {
234
+ const fetchCountries = async () => {
235
+ try {
236
+ if (registerAndLogin == null ? void 0 : registerAndLogin.getCountries) {
237
+ const countriesList = await registerAndLogin.getCountries();
238
+ setCountries(countriesList || []);
239
+ }
240
+ } catch (error) {
241
+ console.error("Failed to fetch countries:", error);
242
+ }
243
+ };
244
+ fetchCountries();
245
+ }, [registerAndLogin]);
246
+ (0, import_react.useEffect)(() => {
247
+ const verifyEmailLink = async () => {
248
+ var _a2, _b2;
249
+ if (!((_a2 = config.emailLinkVerification) == null ? void 0 : _a2.enabled) || !((_b2 = config.emailLinkVerification) == null ? void 0 : _b2.code)) {
250
+ return;
251
+ }
252
+ setEmailLinkVerifyStatus("verifying");
253
+ try {
254
+ const result = await registerAndLogin.checkEmailLinkCode({
255
+ code: config.emailLinkVerification.code
256
+ });
257
+ if (result.code === 200 && result.data.valid) {
258
+ updateFlowData({
259
+ emailLinkCode: config.emailLinkVerification.code,
260
+ account: result.data.email || "",
261
+ accountType: "email",
262
+ verificationMethod: import_registerFlow.VerificationMethod.EMAIL_LINK
263
+ });
264
+ setVerifiedEmail(result.data.email);
265
+ setEmailLinkVerifyStatus("success");
266
+ goToStep(import_registerFlow.RegisterStep.SET_PASSWORD);
267
+ } else if (result.code === 50011) {
268
+ setEmailLinkVerifyStatus("expired");
269
+ } else if (!result.data.valid) {
270
+ setEmailLinkVerifyStatus("already_used");
271
+ } else {
272
+ setEmailLinkVerifyStatus(null);
273
+ import_antd.message.error(result.message || "验证失败,请稍后重试");
274
+ }
275
+ } catch (error) {
276
+ console.error("Email link verification failed:", error);
277
+ import_antd.message.error("验证失败,请稍后重试");
278
+ setEmailLinkVerifyStatus(null);
279
+ }
280
+ };
281
+ verifyEmailLink();
282
+ }, [config.emailLinkVerification, registerAndLogin]);
283
+ (0, import_react.useEffect)(() => {
284
+ if (!visible) {
285
+ form.setFieldsValue({ password: "" });
286
+ form.setFieldsValue({ confirmPassword: "" });
287
+ }
288
+ }, [visible, form]);
289
+ (0, import_react.useEffect)(() => {
290
+ const newAuthMethod = getDefaultAuthMethod();
291
+ if (newAuthMethod !== currentAuthMethod) {
292
+ setCurrentAuthMethod(newAuthMethod);
293
+ form.resetFields(["account"]);
294
+ }
295
+ }, [normalizedRegistrationMethods, config.defaultAuthMethod]);
296
+ (0, import_react.useEffect)(() => {
297
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
298
+ import_utils.locales.init(
299
+ import_locales.default,
300
+ ((_e2 = (_d2 = (_c2 = (_b2 = (_a2 = context.appHelper.utils) == null ? void 0 : _a2.getApp) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c2.locales) == null ? void 0 : _d2.getLocale) == null ? void 0 : _e2.call(_d2)) || ((_g2 = (_f2 = context.appHelper.utils) == null ? void 0 : _f2.storage) == null ? void 0 : _g2.get("umi_locale")) || "en"
301
+ );
302
+ }, []);
303
+ (0, import_react.useEffect)(() => {
304
+ if (countdown > 0) {
305
+ const timer = setTimeout(() => {
306
+ setCountdown(countdown - 1);
307
+ }, 1e3);
308
+ return () => clearTimeout(timer);
309
+ }
310
+ }, [countdown]);
311
+ const handleSendCode = async () => {
312
+ try {
313
+ const values = await form.validateFields(["account"]);
314
+ const account = values.account;
315
+ setLoading(true);
316
+ const type = currentAuthMethod === "email" ? "email" : "phone";
317
+ let res;
318
+ if (currentAuthMethod === "email") {
319
+ const emailVerificationMethod = getCurrentVerificationMethod();
320
+ if (emailVerificationMethod === "verification_link") {
321
+ res = await registerAndLogin.sendEmailRegisterLink(account);
322
+ } else {
323
+ res = await registerAndLogin.sendEmailVerificationCode({
324
+ type: "email",
325
+ target: account,
326
+ purpose: "register"
327
+ });
328
+ }
329
+ } else {
330
+ res = await registerAndLogin.sendSmsRegisterCode(account);
331
+ }
332
+ const accountForCallback = currentAuthMethod === "phone" && typeof account === "object" ? `+${account.country_calling_code}${account.phone}` : account;
333
+ await (onSendVerificationCode == null ? void 0 : onSendVerificationCode(accountForCallback, type, config.channel));
334
+ if (res.code === 200) {
335
+ updateFlowData({ account, accountType: currentAuthMethod });
336
+ const verificationMethod = getCurrentVerificationMethod();
337
+ if (verificationMethod === "verification_link") {
338
+ goToStep(import_registerFlow.RegisterStep.WAIT_EMAIL_LINK, {
339
+ account,
340
+ accountType: currentAuthMethod,
341
+ verificationMethod: import_registerFlow.VerificationMethod.EMAIL_LINK
342
+ // 同时更新验证方式
343
+ });
344
+ setCountdown(60);
345
+ } else if (verificationMethod === "verification_code") {
346
+ goToStep(import_registerFlow.RegisterStep.INPUT_VERIFICATION_CODE, {
347
+ account,
348
+ accountType: currentAuthMethod
349
+ });
350
+ setCountdown(60);
351
+ import_antd.message.success(import_utils.locales.getText("pisell-login2-code-sent"));
352
+ }
353
+ } else if (res.code === 5002) {
354
+ goToStep(import_registerFlow.RegisterStep.EMAIL_ALREADY_REGISTERED, {
355
+ account,
356
+ accountType: currentAuthMethod
357
+ });
358
+ } else {
359
+ import_antd.message.error(res.message);
360
+ }
361
+ } catch (error) {
362
+ if (error.errorFields) {
363
+ return;
364
+ }
365
+ handleError(
366
+ "SEND_CODE_FAILED",
367
+ error.message || "Failed to send verification code"
368
+ );
369
+ import_antd.message.error(error == null ? void 0 : error.message);
370
+ } finally {
371
+ setLoading(false);
372
+ }
373
+ };
374
+ const handleRegister = async () => {
375
+ try {
376
+ setLoading(true);
377
+ const values = await form.validateFields();
378
+ const registerData = {
379
+ account: values.account,
380
+ password: values.password
381
+ };
382
+ await (onRegister == null ? void 0 : onRegister(registerData, currentAuthMethod, config.channel));
383
+ import_antd.message.success(import_utils.locales.getText("pisell-register2-register-success"));
384
+ } catch (error) {
385
+ if (error.errorFields) {
386
+ return;
387
+ }
388
+ import_antd.message.error((error == null ? void 0 : error.message) || "Registration failed");
389
+ } finally {
390
+ setLoading(false);
391
+ }
392
+ };
393
+ const handleFormSubmit = (e) => {
394
+ e == null ? void 0 : e.preventDefault();
395
+ if (isEmailNoVerification) {
396
+ handleRegister();
397
+ } else if (needsVerification) {
398
+ handleSendCode();
399
+ } else {
400
+ handleRegister();
401
+ }
402
+ };
403
+ const handleOAuthClickInternal = async (provider) => {
404
+ var _a2, _b2, _c2;
405
+ try {
406
+ setLoading(true);
407
+ if (provider === "facebook") {
408
+ const fbConfig = (_a2 = config == null ? void 0 : config.registrationMethods) == null ? void 0 : _a2.find((n) => n.type === "facebook");
409
+ const token = fbConfig == null ? void 0 : fbConfig.appId;
410
+ if (!token) {
411
+ throw new Error("Facebook app_id not configured");
412
+ }
413
+ const res = await registerAndLogin.loginWithFacebook(token);
414
+ if (res.data) {
415
+ await (onRegister == null ? void 0 : onRegister(
416
+ res.data,
417
+ "facebook",
418
+ { account: "", password: "" },
419
+ config.channel
420
+ ));
421
+ }
422
+ } else if (provider === "apple") {
423
+ const appleConfig = (_b2 = config == null ? void 0 : config.registrationMethods) == null ? void 0 : _b2.find((n) => n.type === "apple");
424
+ const token = appleConfig == null ? void 0 : appleConfig.clientId;
425
+ if (token) {
426
+ const res = await registerAndLogin.loginWithApple(token);
427
+ if (res.data) {
428
+ await (onRegister == null ? void 0 : onRegister(
429
+ res.data,
430
+ "apple",
431
+ { account: "", password: "" },
432
+ config.channel
433
+ ));
434
+ }
435
+ } else {
436
+ throw new Error("Apple client_id not configured");
437
+ }
438
+ } else if (provider === "google") {
439
+ const googleConfig = (_c2 = config == null ? void 0 : config.registrationMethods) == null ? void 0 : _c2.find((n) => n.type === "google");
440
+ const token = googleConfig == null ? void 0 : googleConfig.clientId;
441
+ if (token) {
442
+ const res = await registerAndLogin.loginWithGoogle(token);
443
+ if (res.data) {
444
+ await (onRegister == null ? void 0 : onRegister(
445
+ res.data,
446
+ "google",
447
+ { account: "", password: "" },
448
+ config.channel
449
+ ));
450
+ }
451
+ } else {
452
+ throw new Error("Google client_id not configured");
453
+ }
454
+ }
455
+ await (onOAuthLogin == null ? void 0 : onOAuthLogin(provider, config.channel));
456
+ } catch (error) {
457
+ if (error.messager === "facebook_login_cancel") {
458
+ return import_antd.message.error(import_utils.locales.getText("pisell-register2-facebook-login-canceled"));
459
+ }
460
+ console.error(`${provider} login error:`, error);
461
+ import_antd.message.error((error == null ? void 0 : error.message) || `${provider} login failed`);
462
+ onError == null ? void 0 : onError(error, provider);
463
+ } finally {
464
+ setLoading(false);
465
+ }
466
+ };
467
+ const { run: handleOAuthClick } = (0, import_ahooks.useDebounceFn)(handleOAuthClickInternal, {
468
+ wait: 200,
469
+ leading: true,
470
+ trailing: false
471
+ });
472
+ const oauthProviders = (0, import_react.useMemo)(() => {
473
+ const providers = [];
474
+ if (isRegistrationMethodEnabled("google")) {
475
+ providers.push({
476
+ key: "google",
477
+ label: import_utils.locales.getText("pisell-register2-continue-with-google"),
478
+ icon: /* @__PURE__ */ import_react.default.createElement("span", { className: "oauth-icon" }, "G"),
479
+ onClick: () => handleOAuthClick("google"),
480
+ className: "oauth-button google"
481
+ });
482
+ }
483
+ if (isRegistrationMethodEnabled("facebook")) {
484
+ providers.push({
485
+ key: "facebook",
486
+ label: import_utils.locales.getText("pisell-register2-continue-with-facebook"),
487
+ icon: /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-facebook", className: "oauth-icon" }),
488
+ onClick: () => handleOAuthClick("facebook"),
489
+ className: "oauth-button facebook"
490
+ });
491
+ }
492
+ if (isRegistrationMethodEnabled("apple")) {
493
+ providers.push({
494
+ key: "apple",
495
+ label: import_utils.locales.getText("pisell-register2-continue-with-apple"),
496
+ icon: /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-apple", className: "oauth-icon" }),
497
+ onClick: () => handleOAuthClick("apple"),
498
+ className: "oauth-button apple"
499
+ });
500
+ }
501
+ return providers;
502
+ }, [handleOAuthClick, isRegistrationMethodEnabled]);
503
+ const handleResendCode = async () => {
504
+ if (countdown > 0) return;
505
+ try {
506
+ setLoading(true);
507
+ const type = currentAuthMethod === "email" ? "email" : "phone";
508
+ const verificationMethod = getCurrentVerificationMethod();
509
+ let res;
510
+ if (currentAuthMethod === "email") {
511
+ if (verificationMethod === "verification_link") {
512
+ res = await registerAndLogin.resendEmailRegisterLink();
513
+ } else {
514
+ res = await registerAndLogin.sendEmailVerificationCode({
515
+ type: "email",
516
+ target: flowData.account,
517
+ purpose: "register"
518
+ });
519
+ }
520
+ } else {
521
+ res = await registerAndLogin.sendSmsRegisterCode(flowData.account);
522
+ }
523
+ if (res.code === 200) {
524
+ setCountdown(60);
525
+ let successMessage = "";
526
+ if (currentAuthMethod === "email") {
527
+ if (verificationMethod === "verification_link") {
528
+ successMessage = import_utils.locales.getText("pisell-register2-email-link-resent");
529
+ } else {
530
+ successMessage = import_utils.locales.getText("pisell-register2-email-code-resent");
531
+ }
532
+ } else {
533
+ successMessage = import_utils.locales.getText("pisell-register2-phone-code-resent");
534
+ }
535
+ import_antd.message.success(successMessage);
536
+ } else {
537
+ let errorMessage = "";
538
+ if (currentAuthMethod === "email") {
539
+ if (verificationMethod === "verification_link") {
540
+ errorMessage = import_utils.locales.getText("pisell-register2-email-link-resend-failed");
541
+ } else {
542
+ errorMessage = import_utils.locales.getText("pisell-register2-email-code-resend-failed");
543
+ }
544
+ } else {
545
+ errorMessage = import_utils.locales.getText("pisell-register2-phone-code-resend-failed");
546
+ }
547
+ import_antd.message.error(res.message || errorMessage);
548
+ }
549
+ } catch (error) {
550
+ let errorMessage = "";
551
+ const verificationMethod = getCurrentVerificationMethod();
552
+ if (currentAuthMethod === "email") {
553
+ if (verificationMethod === "verification_link") {
554
+ errorMessage = import_utils.locales.getText("pisell-register2-email-link-resend-failed");
555
+ } else {
556
+ errorMessage = import_utils.locales.getText("pisell-register2-email-code-resend-failed");
557
+ }
558
+ } else {
559
+ errorMessage = import_utils.locales.getText("pisell-register2-phone-code-resend-failed");
560
+ }
561
+ import_antd.message.error(errorMessage);
562
+ } finally {
563
+ setLoading(false);
564
+ }
565
+ };
566
+ const handleVerifyCode = async (code) => {
567
+ try {
568
+ setLoading(true);
569
+ setCodeError("");
570
+ const type = currentAuthMethod === "email" ? "email" : "phone";
571
+ let res;
572
+ if (type === "email") {
573
+ res = await registerAndLogin.checkEmailCode({
574
+ email: flowData.account,
575
+ shop_id: shopId,
576
+ code,
577
+ action: "customer_registration_code"
578
+ });
579
+ } else {
580
+ const phoneData = flowData.account;
581
+ res = await registerAndLogin.checkMobileCode({
582
+ phone: phoneData.phone,
583
+ country_calling_code: phoneData.country_calling_code,
584
+ code
585
+ });
586
+ }
587
+ if (res.code === 200 && res.data.valid) {
588
+ updateFlowData({ verificationCode: code });
589
+ goToStep(import_registerFlow.RegisterStep.VERIFICATION_SUCCESS);
590
+ } else {
591
+ const errorMessage = (res == null ? void 0 : res.message) || import_utils.locales.getText("pisell-register2-invalid-verification-code");
592
+ setCodeError(errorMessage);
593
+ }
594
+ } catch (error) {
595
+ console.error(error);
596
+ setCodeError((error == null ? void 0 : error.message) || import_utils.locales.getText("pisell-register2-verification-failed"));
597
+ } finally {
598
+ setLoading(false);
599
+ }
600
+ };
601
+ const handleSetPassword = async (password, confirmPassword) => {
602
+ try {
603
+ setLoading(true);
604
+ let res;
605
+ if (flowData.emailLinkCode) {
606
+ res = await registerAndLogin.verifyEmailRegistrationLink({
607
+ code: flowData.emailLinkCode,
608
+ password
609
+ });
610
+ } else if (currentAuthMethod === "email") {
611
+ res = await registerAndLogin.emailCodeRegister({
612
+ email: flowData.account,
613
+ code: flowData.verificationCode,
614
+ password
615
+ });
616
+ } else {
617
+ const phoneData = flowData.account;
618
+ res = await registerAndLogin.phoneCodeRegister({
619
+ phone: phoneData.phone,
620
+ code: flowData.verificationCode,
621
+ password,
622
+ country_calling_code: phoneData.country_calling_code
623
+ });
624
+ }
625
+ if (res.code === 200) {
626
+ updateFlowData({
627
+ password,
628
+ extraData: {
629
+ ...flowData.extraData,
630
+ apiResponse: res.data
631
+ }
632
+ });
633
+ goToStep(import_registerFlow.RegisterStep.COMPLETE);
634
+ import_antd.message.success(import_utils.locales.getText("pisell-register2-register-success"));
635
+ } else {
636
+ const error = new Error(res.message || "Registration failed");
637
+ onError == null ? void 0 : onError(error, currentAuthMethod);
638
+ import_antd.message.error(res.message || import_utils.locales.getText("pisell-register2-registration-failed"));
639
+ }
640
+ } catch (error) {
641
+ import_antd.message.error(error.message, import_utils.locales.getText("pisell-register2-failed-to-complete"));
642
+ console.error(error);
643
+ } finally {
644
+ setLoading(false);
645
+ }
646
+ };
647
+ const handleBackToInitialForm = (0, import_react.useCallback)(() => {
648
+ setCodeError("");
649
+ goToStep(import_registerFlow.RegisterStep.INITIAL_FORM, {
650
+ verificationMethod: flowData.verificationMethod
651
+ });
652
+ }, [goToStep, flowData]);
653
+ const handleEditAccount = () => {
654
+ if (flowData.account) {
655
+ form.setFieldsValue({ account: flowData.account });
656
+ }
657
+ handleBackToInitialForm();
658
+ };
659
+ const handleGoToLogin = () => {
660
+ if (onGoToLogin) {
661
+ onGoToLogin();
662
+ }
663
+ };
664
+ const handleSwitchAuthMethod = (method) => {
665
+ setCurrentAuthMethod(method);
666
+ form.resetFields(["account"]);
667
+ resetFlow();
668
+ };
669
+ const handleBackToRegistration = () => {
670
+ setEmailLinkVerifyStatus(null);
671
+ setVerifiedEmail("");
672
+ form.resetFields();
673
+ resetFlow();
674
+ onEmailLinkExpired == null ? void 0 : onEmailLinkExpired();
675
+ };
676
+ const renderAccountInput = () => {
677
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
678
+ const placeholder = currentAuthMethod === "email" ? import_utils.locales.getText("pisell-login2-email-placeholder") : "Enter your phone number";
679
+ if (currentAuthMethod === "phone") {
680
+ const phoneLabel = ((_b2 = (_a2 = ui == null ? void 0 : ui.formLabels) == null ? void 0 : _a2.phone) == null ? void 0 : _b2.show) !== false ? ((_d2 = (_c2 = ui == null ? void 0 : ui.formLabels) == null ? void 0 : _c2.phone) == null ? void 0 : _d2.text) || import_utils.locales.getText("pisell-login2-phone-label") : void 0;
681
+ const phoneRules = (0, import_phoneValidation.createPhoneValidationRules)(import_utils.locales.getText, true);
682
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "account", label: phoneLabel, rules: phoneRules, validateTrigger: ["onBlur", "onSubmit"] }, /* @__PURE__ */ import_react.default.createElement(
683
+ import_PhoneInput.default,
684
+ {
685
+ placeholder,
686
+ size: "large",
687
+ countries: (countries == null ? void 0 : countries.length) > 0 ? countries : [],
688
+ valueFormat: "object"
689
+ }
690
+ ));
691
+ }
692
+ const emailRules = [
693
+ {
694
+ required: true,
695
+ message: import_utils.locales.getText("pisell-register2-email-required")
696
+ },
697
+ {
698
+ type: "email",
699
+ message: import_utils.locales.getText("pisell-register2-email-invalid")
700
+ }
701
+ ];
702
+ const emailLabel = ((_f2 = (_e2 = ui == null ? void 0 : ui.formLabels) == null ? void 0 : _e2.email) == null ? void 0 : _f2.show) !== false ? ((_h2 = (_g2 = ui == null ? void 0 : ui.formLabels) == null ? void 0 : _g2.email) == null ? void 0 : _h2.text) || import_utils.locales.getText("pisell-login2-email-label") : void 0;
703
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "account", label: emailLabel, rules: emailRules, validateTrigger: ["onBlur", "onSubmit"] }, /* @__PURE__ */ import_react.default.createElement(
704
+ import_materials.Input,
705
+ {
706
+ size: "large",
707
+ placeholder,
708
+ className: "login2-input"
709
+ }
710
+ ));
711
+ };
712
+ const renderStepPage = () => {
713
+ var _a2;
714
+ switch (flowData.currentStep) {
715
+ case import_registerFlow.RegisterStep.WAIT_EMAIL_LINK:
716
+ return /* @__PURE__ */ import_react.default.createElement(
717
+ import_steps.WaitEmailLink,
718
+ {
719
+ flowData,
720
+ onResend: handleResendCode,
721
+ onBack: handleBackToInitialForm,
722
+ onEditEmail: handleEditAccount,
723
+ countdown,
724
+ verificationMethod: flowData.verificationMethod
725
+ }
726
+ );
727
+ case import_registerFlow.RegisterStep.EMAIL_ALREADY_REGISTERED:
728
+ return /* @__PURE__ */ import_react.default.createElement(
729
+ import_steps.EmailAlreadyRegistered,
730
+ {
731
+ flowData,
732
+ onGoToLogin: handleGoToLogin,
733
+ onBack: handleBackToInitialForm
734
+ }
735
+ );
736
+ case import_registerFlow.RegisterStep.INPUT_VERIFICATION_CODE:
737
+ return /* @__PURE__ */ import_react.default.createElement(
738
+ import_steps.CodeInput,
739
+ {
740
+ flowData,
741
+ codeLength: 4,
742
+ onSubmit: handleVerifyCode,
743
+ onResend: handleResendCode,
744
+ onBack: handleBackToInitialForm,
745
+ countdown,
746
+ loading,
747
+ error: codeError,
748
+ onClearError: () => setCodeError("")
749
+ }
750
+ );
751
+ case import_registerFlow.RegisterStep.VERIFICATION_SUCCESS:
752
+ return /* @__PURE__ */ import_react.default.createElement(import_steps.VerificationSuccess, { flowData });
753
+ case import_registerFlow.RegisterStep.SET_PASSWORD:
754
+ return /* @__PURE__ */ import_react.default.createElement(
755
+ import_steps.SetPassword,
756
+ {
757
+ flowData,
758
+ onSubmit: handleSetPassword,
759
+ onBack: () => goToStep(import_registerFlow.RegisterStep.INPUT_VERIFICATION_CODE),
760
+ loading,
761
+ passwordRules: (_a2 = config.ui) == null ? void 0 : _a2.passwordRules,
762
+ scenario: "create"
763
+ }
764
+ );
765
+ case import_registerFlow.RegisterStep.COMPLETE:
766
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "register-step-container" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "register-step-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "success-icon-wrapper" }, /* @__PURE__ */ import_react.default.createElement("svg", { width: "64", height: "64", viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ import_react.default.createElement(
767
+ "circle",
768
+ {
769
+ cx: "32",
770
+ cy: "32",
771
+ r: "32",
772
+ fill: "#10B981",
773
+ fillOpacity: "0.1"
774
+ }
775
+ ), /* @__PURE__ */ import_react.default.createElement(
776
+ "path",
777
+ {
778
+ d: "M22 32L28 38L42 24",
779
+ stroke: "#10B981",
780
+ strokeWidth: "3",
781
+ strokeLinecap: "round",
782
+ strokeLinejoin: "round"
783
+ }
784
+ ))), /* @__PURE__ */ import_react.default.createElement("h2", { className: "register-step-title" }, import_utils.locales.getText("pisell-register2-complete-title")), /* @__PURE__ */ import_react.default.createElement("p", { className: "register-step-desc" }, import_utils.locales.getText("pisell-register2-redirecting"))));
785
+ default:
786
+ return null;
787
+ }
788
+ };
789
+ const handleSetPasswordSubmit = async (password, confirmPassword) => {
790
+ try {
791
+ setLoading(true);
792
+ const res = await registerAndLogin.verifyEmailRegistrationLink({
793
+ code: config.emailLinkVerification.code,
794
+ password
795
+ });
796
+ if (res.code === 200) {
797
+ import_antd.message.success(import_utils.locales.getText("pisell-register2-register-success"));
798
+ await (onRegister == null ? void 0 : onRegister(
799
+ res.data,
800
+ "email",
801
+ { account: verifiedEmail, password },
802
+ config.channel
803
+ ));
804
+ } else {
805
+ import_antd.message.error(
806
+ res.message || import_utils.locales.getText("pisell-register2-registration-failed")
807
+ );
808
+ }
809
+ } catch (error) {
810
+ import_antd.message.error(
811
+ (error == null ? void 0 : error.message) || import_utils.locales.getText("pisell-register2-failed-to-complete")
812
+ );
813
+ } finally {
814
+ setLoading(false);
815
+ }
816
+ };
817
+ if (!visible) {
818
+ return null;
819
+ }
820
+ const { ui } = config;
821
+ if ((_i = config.emailLinkVerification) == null ? void 0 : _i.enabled) {
822
+ if (emailLinkVerifyStatus === "verifying") {
823
+ return /* @__PURE__ */ import_react.default.createElement(
824
+ "div",
825
+ {
826
+ className: (0, import_classnames.default)(
827
+ "login2-container",
828
+ "register-flow-container",
829
+ className
830
+ ),
831
+ style: {
832
+ ...style,
833
+ "--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
834
+ }
835
+ },
836
+ /* @__PURE__ */ import_react.default.createElement(import_steps.VerifyingEmailLink, null)
837
+ );
838
+ }
839
+ if (emailLinkVerifyStatus === "expired") {
840
+ return /* @__PURE__ */ import_react.default.createElement(
841
+ "div",
842
+ {
843
+ className: (0, import_classnames.default)(
844
+ "login2-container",
845
+ "register-flow-container",
846
+ className
847
+ ),
848
+ style: {
849
+ ...style,
850
+ "--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
851
+ }
852
+ },
853
+ /* @__PURE__ */ import_react.default.createElement(
854
+ import_steps.EmailLinkExpired,
855
+ {
856
+ onBackToRegistration: handleBackToRegistration,
857
+ onGoToLogin
858
+ }
859
+ )
860
+ );
861
+ }
862
+ if (emailLinkVerifyStatus === "already_used") {
863
+ return /* @__PURE__ */ import_react.default.createElement(
864
+ "div",
865
+ {
866
+ className: (0, import_classnames.default)(
867
+ "login2-container",
868
+ "register-flow-container",
869
+ className
870
+ ),
871
+ style: {
872
+ ...style,
873
+ "--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
874
+ }
875
+ },
876
+ /* @__PURE__ */ import_react.default.createElement(import_steps.EmailLinkAlreadyUsed, { onGoToLogin })
877
+ );
878
+ }
879
+ if (emailLinkVerifyStatus === "success") {
880
+ return /* @__PURE__ */ import_react.default.createElement(
881
+ "div",
882
+ {
883
+ className: (0, import_classnames.default)(
884
+ "login2-container",
885
+ "register-flow-container",
886
+ className
887
+ ),
888
+ style: {
889
+ ...style,
890
+ "--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
891
+ }
892
+ },
893
+ /* @__PURE__ */ import_react.default.createElement(
894
+ import_steps.SetPassword,
895
+ {
896
+ flowData: { ...flowData, account: verifiedEmail },
897
+ onSubmit: handleSetPasswordSubmit,
898
+ loading,
899
+ passwordRules: (_j = config.ui) == null ? void 0 : _j.passwordRules,
900
+ scenario: "create"
901
+ }
902
+ )
903
+ );
904
+ }
905
+ }
906
+ const isEmailVerificationLink = currentAuthMethod === "email" && getCurrentVerificationMethod() === "verification_link";
907
+ const isEmailVerificationCode = currentAuthMethod === "email" && getCurrentVerificationMethod() === "verification_code";
908
+ const isEmailNoVerification = currentAuthMethod === "email" && getCurrentVerificationMethod() === "none";
909
+ const isPhoneVerificationCode = currentAuthMethod === "phone" && getCurrentVerificationMethod() === "verification_code";
910
+ const needsVerification = isEmailVerificationLink || isEmailVerificationCode || isPhoneVerificationCode;
911
+ if (flowData.currentStep !== import_registerFlow.RegisterStep.INITIAL_FORM) {
912
+ const showHeader = flowData.currentStep !== import_registerFlow.RegisterStep.INPUT_VERIFICATION_CODE && flowData.currentStep !== import_registerFlow.RegisterStep.WAIT_EMAIL_LINK && flowData.currentStep !== import_registerFlow.RegisterStep.SET_PASSWORD && flowData.currentStep !== import_registerFlow.RegisterStep.EMAIL_ALREADY_REGISTERED;
913
+ return /* @__PURE__ */ import_react.default.createElement(
914
+ "div",
915
+ {
916
+ className: (0, import_classnames.default)(
917
+ "login2-container",
918
+ "register-flow-container",
919
+ className
920
+ ),
921
+ style: {
922
+ ...style,
923
+ "--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
924
+ }
925
+ },
926
+ showHeader && /* @__PURE__ */ import_react.default.createElement(import_Header.default, { ui }),
927
+ renderStepPage()
928
+ );
929
+ }
930
+ return /* @__PURE__ */ import_react.default.createElement(
931
+ "div",
932
+ {
933
+ className: (0, import_classnames.default)("login2-container", "register2-container", className),
934
+ style: {
935
+ ...style,
936
+ "--theme-color": (ui == null ? void 0 : ui.themeColor) || "#7F56D9"
937
+ }
938
+ },
939
+ /* @__PURE__ */ import_react.default.createElement(import_Header.default, { ui }),
940
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-content" }, (isRegistrationMethodEnabled("email") || isRegistrationMethodEnabled("phone")) && /* @__PURE__ */ import_react.default.createElement(
941
+ import_antd.Form,
942
+ {
943
+ form,
944
+ layout: "vertical",
945
+ className: "login2-form",
946
+ size: "large"
947
+ },
948
+ /* @__PURE__ */ import_react.default.createElement(
949
+ import_antd.Form.Item,
950
+ {
951
+ label: currentAuthMethod === "email" ? ((_m = (_l = (_k = config.ui) == null ? void 0 : _k.formLabels) == null ? void 0 : _l.email) == null ? void 0 : _m.show) !== false ? ((_p = (_o = (_n = config.ui) == null ? void 0 : _n.formLabels) == null ? void 0 : _o.email) == null ? void 0 : _p.text) || import_utils.locales.getText("pisell-login2-email-label") : void 0 : ((_s = (_r = (_q = config.ui) == null ? void 0 : _q.formLabels) == null ? void 0 : _r.phone) == null ? void 0 : _s.show) !== false ? ((_v = (_u = (_t = config.ui) == null ? void 0 : _t.formLabels) == null ? void 0 : _u.phone) == null ? void 0 : _v.text) || import_utils.locales.getText("pisell-login2-phone-label") : void 0,
952
+ name: "account",
953
+ rules: currentAuthMethod === "email" ? [
954
+ {
955
+ required: true,
956
+ message: import_utils.locales.getText("pisell-register2-email-required")
957
+ },
958
+ {
959
+ type: "email",
960
+ message: import_utils.locales.getText("pisell-register2-email-invalid")
961
+ }
962
+ ] : (0, import_phoneValidation.createPhoneValidationRules)(import_utils.locales.getText, true),
963
+ validateTrigger: ["onBlur", "onSubmit"],
964
+ className: currentAuthMethod === "phone" ? "phone-input-form-item" : ""
965
+ },
966
+ currentAuthMethod === "phone" ? /* @__PURE__ */ import_react.default.createElement(
967
+ import_PhoneInput.default,
968
+ {
969
+ size: "large",
970
+ placeholder: import_utils.locales.getText("pisell-register2-phone-placeholder"),
971
+ className: "login2-phone-input",
972
+ countries,
973
+ valueFormat: "object",
974
+ onKeyDown: (e) => {
975
+ if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
976
+ e.preventDefault();
977
+ handleFormSubmit(e);
978
+ }
979
+ }
980
+ }
981
+ ) : /* @__PURE__ */ import_react.default.createElement(
982
+ import_materials.Input,
983
+ {
984
+ size: "large",
985
+ placeholder: import_utils.locales.getText("pisell-register2-email-placeholder"),
986
+ className: "login2-email-input",
987
+ autoComplete: "email",
988
+ onKeyDown: (e) => {
989
+ if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
990
+ e.preventDefault();
991
+ handleFormSubmit(e);
992
+ }
993
+ }
994
+ }
995
+ )
996
+ ),
997
+ (!needsVerification || isEmailNoVerification) && /* @__PURE__ */ import_react.default.createElement(
998
+ import_antd.Form.Item,
999
+ {
1000
+ label: ((_y = (_x = (_w = config.ui) == null ? void 0 : _w.formLabels) == null ? void 0 : _x.password) == null ? void 0 : _y.show) !== false ? ((_B = (_A = (_z = config.ui) == null ? void 0 : _z.formLabels) == null ? void 0 : _A.password) == null ? void 0 : _B.text) || import_utils.locales.getText("pisell-register2-password-label") : void 0,
1001
+ name: "password",
1002
+ rules: passwordValidationRules,
1003
+ validateTrigger: ["onBlur", "onSubmit"]
1004
+ },
1005
+ /* @__PURE__ */ import_react.default.createElement(
1006
+ import_materials.Input.Password,
1007
+ {
1008
+ size: "large",
1009
+ placeholder: import_utils.locales.getText("pisell-register2-password-placeholder"),
1010
+ className: "login2-password-input",
1011
+ autoComplete: "new-password",
1012
+ onKeyDown: (e) => {
1013
+ if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
1014
+ e.preventDefault();
1015
+ handleFormSubmit(e);
1016
+ }
1017
+ }
1018
+ }
1019
+ )
1020
+ ),
1021
+ /* @__PURE__ */ import_react.default.createElement(
1022
+ import_materials.Button,
1023
+ {
1024
+ type: "primary",
1025
+ size: "large",
1026
+ block: true,
1027
+ htmlType: "button",
1028
+ loading,
1029
+ onClick: handleFormSubmit,
1030
+ className: "login2-submit-button"
1031
+ },
1032
+ isEmailNoVerification ? import_utils.locales.getText("pisell-common-continue") : needsVerification ? import_utils.locales.getText("pisell-common-continue") : import_utils.locales.getText("pisell-common-sign-up")
1033
+ )
1034
+ ), shouldShowDivider && /* @__PURE__ */ import_react.default.createElement("div", { className: "divider" }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell-common-or"))), /* @__PURE__ */ import_react.default.createElement("div", { className: "oauth-section" }, hasEmailAndPhone && /* @__PURE__ */ import_react.default.createElement(
1035
+ import_materials.Button,
1036
+ {
1037
+ type: "default",
1038
+ size: "large",
1039
+ block: true,
1040
+ onClick: () => handleSwitchAuthMethod(
1041
+ currentAuthMethod === "email" ? "phone" : "email"
1042
+ ),
1043
+ className: "login2-switch-button",
1044
+ icon: currentAuthMethod === "email" ? /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-phone", className: "oauth-icon" }) : /* @__PURE__ */ import_react.default.createElement(import_materials2.Iconfont, { type: "pisell2-mail-01", className: "oauth-icon" }),
1045
+ style: { marginBottom: oauthProviders.length ? 12 : 0 }
1046
+ },
1047
+ currentAuthMethod === "email" ? import_utils.locales.getText("pisell-register2-with-phone") : import_utils.locales.getText("pisell-register2-with-email")
1048
+ ), /* @__PURE__ */ import_react.default.createElement(
1049
+ import_OAuthButtonGroup.default,
1050
+ {
1051
+ providers: oauthProviders,
1052
+ wrapperClassName: "oauth-buttons-container",
1053
+ buttonClassName: "oauth-button",
1054
+ layout: "vertical",
1055
+ gap: 12
1056
+ }
1057
+ ))),
1058
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "login2-footer-text" }, import_utils.locales.getText("pisell-register2-have-account"), " ", /* @__PURE__ */ import_react.default.createElement("a", { className: "login2-link", onClick: onGoToLogin }, import_utils.locales.getText("pisell-register2-login-link"))),
1059
+ /* @__PURE__ */ import_react.default.createElement(import_LegalTerms.default, { config: { ...config.legalTerms, mode: "register" } })
1060
+ );
1061
+ };
1062
+ var Register2_default = Register2;