@opexa/portal-components 0.0.674 → 0.0.677

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 (244) hide show
  1. package/dist/client/hooks/useAiOGCashDepositMutation.d.ts +4 -0
  2. package/dist/client/hooks/useAiOGCashDepositMutation.js +73 -0
  3. package/dist/client/hooks/useAiOGrabPayDepositMutation.d.ts +4 -0
  4. package/dist/client/hooks/useAiOGrabPayDepositMutation.js +73 -0
  5. package/dist/client/hooks/useAiOPalawanPayDepositMutation.d.ts +4 -0
  6. package/dist/client/hooks/useAiOPalawanPayDepositMutation.js +73 -0
  7. package/dist/client/hooks/useAiOPayMayaDepositMutation.d.ts +4 -0
  8. package/dist/client/hooks/useAiOPayMayaDepositMutation.js +73 -0
  9. package/dist/components/DepositWithdrawal/AiOPaymentMethods.d.ts +11 -0
  10. package/dist/components/DepositWithdrawal/AiOPaymentMethods.js +55 -0
  11. package/dist/components/DepositWithdrawal/Deposit/AiOGCashDeposit/AiOGCashDeposit.d.ts +1 -0
  12. package/dist/components/DepositWithdrawal/Deposit/AiOGCashDeposit/AiOGCashDeposit.js +190 -0
  13. package/dist/components/DepositWithdrawal/Deposit/AiOGrabPayDeposit/AiOGrabPayDeposit.d.ts +1 -0
  14. package/dist/components/DepositWithdrawal/Deposit/AiOGrabPayDeposit/AiOGrabPayDeposit.js +190 -0
  15. package/dist/components/DepositWithdrawal/Deposit/AiOPalawanPayDeposit/AiOPalawanPayDeposit.d.ts +1 -0
  16. package/dist/components/DepositWithdrawal/Deposit/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js +190 -0
  17. package/dist/components/DepositWithdrawal/Deposit/AiOPayMayaDeposit/AiOPayMayaDeposit.d.ts +1 -0
  18. package/dist/components/DepositWithdrawal/Deposit/AiOPayMayaDeposit/AiOPayMayaDeposit.js +190 -0
  19. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +55 -2
  20. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +1 -0
  21. package/dist/components/DepositWithdrawal/PaymentMethods.js +10 -4
  22. package/dist/components/DepositWithdrawal/utils.d.ts +3 -1
  23. package/dist/components/DepositWithdrawal/utils.js +7 -0
  24. package/dist/components/Jackpots/Jackpots.module.css +184 -184
  25. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  26. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  27. package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.js +1 -1
  28. package/dist/components/KYC/KYCDefault/KYCVerificationStatus.lazy.js +2 -2
  29. package/dist/components/KYC/KYCVerificationStatus.lazy.js +7 -13
  30. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  31. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  32. package/dist/images/grabpay.png +0 -0
  33. package/dist/images/palawanpay.png +0 -0
  34. package/dist/images/wallet.png +0 -0
  35. package/dist/services/queries.d.ts +6 -2
  36. package/dist/services/queries.js +2979 -2803
  37. package/dist/services/wallet.d.ts +52 -0
  38. package/dist/services/wallet.js +41 -1
  39. package/dist/styles/theme.css +773 -773
  40. package/dist/types/index.d.ts +4 -0
  41. package/dist/ui/AlertDialog/AlertDialog.d.ts +55 -55
  42. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +5 -5
  43. package/dist/ui/Carousel/Carousel.d.ts +72 -72
  44. package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
  45. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  46. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  47. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  48. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  49. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  50. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  51. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  52. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  53. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  54. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  55. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  56. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  57. package/dist/ui/Menu/Menu.d.ts +306 -306
  58. package/dist/ui/Menu/menu.recipe.d.ts +17 -17
  59. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  60. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  61. package/dist/ui/Popover/Popover.d.ts +88 -88
  62. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  63. package/dist/ui/Progress/Progress.d.ts +27 -27
  64. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  65. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  66. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  67. package/dist/ui/Select/Select.d.ts +45 -45
  68. package/dist/ui/Select/select.recipe.d.ts +3 -3
  69. package/dist/ui/Tooltip/Tooltip.d.ts +30 -30
  70. package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
  71. package/dist/utils/mutationKeys.d.ts +4 -0
  72. package/dist/utils/mutationKeys.js +16 -0
  73. package/package.json +175 -175
  74. package/dist/components/DigitainLauncher/Loading.d.ts +0 -1
  75. package/dist/components/DigitainLauncher/Loading.js +0 -5
  76. package/dist/components/Disclaimer/ResponsibleGaming.d.ts +0 -10
  77. package/dist/components/Disclaimer/ResponsibleGaming.js +0 -13
  78. package/dist/components/Disclaimer/TermsOfUse.d.ts +0 -11
  79. package/dist/components/Disclaimer/TermsOfUse.js +0 -13
  80. package/dist/components/FeatureFlag/FeatureFlag.d.ts +0 -1
  81. package/dist/components/FeatureFlag/FeatureFlag.js +0 -29
  82. package/dist/components/FeatureFlag/index.d.ts +0 -1
  83. package/dist/components/FeatureFlag/index.js +0 -1
  84. package/dist/components/KYC/AutoOpen.d.ts +0 -1
  85. package/dist/components/KYC/AutoOpen.js +0 -40
  86. package/dist/components/KYC/BasicInformation.d.ts +0 -1
  87. package/dist/components/KYC/BasicInformation.js +0 -101
  88. package/dist/components/KYC/CaptureIdDocument.d.ts +0 -1
  89. package/dist/components/KYC/CaptureIdDocument.js +0 -219
  90. package/dist/components/KYC/CaptureSelfie.d.ts +0 -1
  91. package/dist/components/KYC/CaptureSelfie.js +0 -285
  92. package/dist/components/KYC/DisplayImage.d.ts +0 -5
  93. package/dist/components/KYC/DisplayImage.js +0 -8
  94. package/dist/components/KYC/FileUpload.d.ts +0 -10
  95. package/dist/components/KYC/FileUpload.js +0 -72
  96. package/dist/components/KYC/IdentityVerification.d.ts +0 -1
  97. package/dist/components/KYC/IdentityVerification.js +0 -120
  98. package/dist/components/KYC/Indicator.d.ts +0 -1
  99. package/dist/components/KYC/Indicator.js +0 -8
  100. package/dist/components/KYC/KYC.lazy.d.ts +0 -6
  101. package/dist/components/KYC/KYC.lazy.js +0 -45
  102. package/dist/components/KYC/KYCContext.d.ts +0 -6
  103. package/dist/components/KYC/KYCContext.js +0 -2
  104. package/dist/components/KYC/NoCameraError.d.ts +0 -7
  105. package/dist/components/KYC/NoCameraError.js +0 -6
  106. package/dist/components/KYC/PersonOverlayDesktop.d.ts +0 -7
  107. package/dist/components/KYC/PersonOverlayDesktop.js +0 -9
  108. package/dist/components/KYC/PersonalInformation.d.ts +0 -1
  109. package/dist/components/KYC/PersonalInformation.js +0 -122
  110. package/dist/components/KYC/backup/Header.d.ts +0 -1
  111. package/dist/components/KYC/backup/Header.js +0 -8
  112. package/dist/components/KYC/backup/Indicator.d.ts +0 -1
  113. package/dist/components/KYC/backup/Indicator.js +0 -9
  114. package/dist/components/KYC/backup/KYC.d.ts +0 -1
  115. package/dist/components/KYC/backup/KYC.js +0 -14
  116. package/dist/components/KYC/backup/KYC.lazy.d.ts +0 -1
  117. package/dist/components/KYC/backup/KYC.lazy.js +0 -26
  118. package/dist/components/KYC/backup/KYCContext.d.ts +0 -6
  119. package/dist/components/KYC/backup/KYCContext.js +0 -2
  120. package/dist/components/KYC/backup/Step1.d.ts +0 -1
  121. package/dist/components/KYC/backup/Step1.js +0 -13
  122. package/dist/components/KYC/backup/Step2.d.ts +0 -1
  123. package/dist/components/KYC/backup/Step2.js +0 -13
  124. package/dist/components/KYC/backup/Step3.d.ts +0 -1
  125. package/dist/components/KYC/backup/Step3.js +0 -13
  126. package/dist/components/KYC/backup/Step4.d.ts +0 -1
  127. package/dist/components/KYC/backup/Step4.js +0 -7
  128. package/dist/components/KYC/backup/useKYC.d.ts +0 -10
  129. package/dist/components/KYC/backup/useKYC.js +0 -8
  130. package/dist/components/KYC/loadModels.d.ts +0 -1
  131. package/dist/components/KYC/loadModels.js +0 -9
  132. package/dist/components/KYC/useKYC.d.ts +0 -25
  133. package/dist/components/KYC/useKYC.js +0 -38
  134. package/dist/components/KYC/utils.d.ts +0 -9
  135. package/dist/components/KYC/utils.js +0 -79
  136. package/dist/components/Messages/Message.d.ts +0 -1
  137. package/dist/components/Messages/Message.js +0 -35
  138. package/dist/components/Messages/MessageContext.d.ts +0 -6
  139. package/dist/components/Messages/MessageContext.js +0 -2
  140. package/dist/components/Messages/MessagePopup.d.ts +0 -1
  141. package/dist/components/Messages/MessagePopup.js +0 -20
  142. package/dist/components/Messages/MessageTrigger.d.ts +0 -8
  143. package/dist/components/Messages/MessageTrigger.js +0 -19
  144. package/dist/components/PortalProvider/CXDTokenObserver.d.ts +0 -1
  145. package/dist/components/PortalProvider/CXDTokenObserver.js +0 -30
  146. package/dist/components/Quests/CountdownTimer.d.ts +0 -15
  147. package/dist/components/Quests/CountdownTimer.js +0 -33
  148. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +0 -4
  149. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +0 -78
  150. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +0 -8
  151. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +0 -9
  152. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +0 -4
  153. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +0 -4
  154. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +0 -4
  155. package/dist/components/Quests/WageringQuest/WageringQuest.js +0 -20
  156. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +0 -9
  157. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +0 -9
  158. package/dist/components/SignIn/utils.d.ts +0 -8
  159. package/dist/components/SignIn/utils.js +0 -26
  160. package/dist/components/SignUp/SignUp.lazy.d.ts +0 -12
  161. package/dist/components/SignUp/SignUp.lazy.js +0 -18
  162. package/dist/components/SignUp/SignUpContext.d.ts +0 -6
  163. package/dist/components/SignUp/SignUpContext.js +0 -2
  164. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +0 -17
  165. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +0 -18
  166. package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +0 -6
  167. package/dist/components/SignUp/SignUpDefault/SignUpContext.js +0 -2
  168. package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +0 -1
  169. package/dist/components/SignUp/SignUpDefault/SignUpForm.js +0 -310
  170. package/dist/components/SignUp/SignUpForm.d.ts +0 -1
  171. package/dist/components/SignUp/SignUpForm.js +0 -284
  172. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +0 -1
  173. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +0 -198
  174. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +0 -1
  175. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +0 -251
  176. package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +0 -10
  177. package/dist/components/SignUp/SignUpKYC/ImageUploader.js +0 -42
  178. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +0 -7
  179. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +0 -9
  180. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +0 -1
  181. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +0 -464
  182. package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +0 -11
  183. package/dist/components/SignUp/SignUpKYC/useImageUploader.js +0 -20
  184. package/dist/components/SignUp/SignUpKYC/utils.d.ts +0 -9
  185. package/dist/components/SignUp/SignUpKYC/utils.js +0 -79
  186. package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +0 -1
  187. package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +0 -198
  188. package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +0 -1
  189. package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +0 -251
  190. package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +0 -10
  191. package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +0 -41
  192. package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +0 -1
  193. package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +0 -429
  194. package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +0 -13
  195. package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +0 -26
  196. package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +0 -7
  197. package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +0 -2
  198. package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +0 -11
  199. package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +0 -20
  200. package/dist/components/shared/IdDocumentField.client.d.ts +0 -25
  201. package/dist/components/shared/IdDocumentField.client.js +0 -204
  202. package/dist/components/shared/IdDocumentField.d.ts +0 -2
  203. package/dist/components/shared/IdDocumentField.js +0 -11
  204. package/dist/components/shared/SelfieField.client.d.ts +0 -20
  205. package/dist/components/shared/SelfieField.client.js +0 -327
  206. package/dist/components/shared/SelfieField.d.ts +0 -2
  207. package/dist/components/shared/SelfieField.js +0 -11
  208. package/dist/constants/BranchCode.d.ts +0 -4
  209. package/dist/constants/BranchCode.js +0 -42
  210. package/dist/constants/Branches.d.ts +0 -2
  211. package/dist/constants/Branches.js +0 -42
  212. package/dist/handlers/postTransformIdFrontImage.d.ts +0 -3
  213. package/dist/handlers/postTransformIdFrontImage.js +0 -67
  214. package/dist/handlers/postTransformSelfieImage.d.ts +0 -3
  215. package/dist/handlers/postTransformSelfieImage.js +0 -71
  216. package/dist/handlers.d.ts +0 -43
  217. package/dist/handlers.js +0 -297
  218. package/dist/icons/BellRingIcon.d.ts +0 -2
  219. package/dist/icons/BellRingIcon.js +0 -4
  220. package/dist/images/responsible-gaming-yellow.png +0 -0
  221. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
  222. package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
  223. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  224. package/dist/third-parties/FacebookPixel/api.js +0 -1
  225. package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
  226. package/dist/third-parties/FacebookPixel/index.js +0 -1
  227. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
  228. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
  229. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  230. package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
  231. package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
  232. package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
  233. package/dist/third-parties/index.d.ts +0 -2
  234. package/dist/third-parties/index.js +0 -2
  235. package/dist/utils/dataUrlToBlob.d.ts +0 -1
  236. package/dist/utils/dataUrlToBlob.js +0 -11
  237. package/dist/utils/gamesAvailable3pmTo3am.d.ts +0 -1
  238. package/dist/utils/gamesAvailable3pmTo3am.js +0 -1
  239. package/dist/utils/getGameName.d.ts +0 -1
  240. package/dist/utils/getGameName.js +0 -6
  241. package/dist/utils/isBetween3amAnd3pm.d.ts +0 -1
  242. package/dist/utils/isBetween3amAnd3pm.js +0 -5
  243. package/dist/utils/resizeImageSize.d.ts +0 -2
  244. package/dist/utils/resizeImageSize.js +0 -11
@@ -0,0 +1,4 @@
1
+ import type { SetOptional } from 'type-fest';
2
+ import { type CreateAiOGCashDepositInput } from '../../services/wallet';
3
+ import type { Deposit, Mutation } from '../../types';
4
+ export declare const useCreateAiOGCashDepositMutation: Mutation<Deposit, SetOptional<CreateAiOGCashDepositInput, 'id'>>;
@@ -0,0 +1,73 @@
1
+ import { ObjectId } from '@opexa/object-id';
2
+ import { useMutation } from '@tanstack/react-query';
3
+ import { clamp } from 'lodash-es';
4
+ import invariant from 'tiny-invariant';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createAiOGCashDeposit, getDeposit } from '../../services/wallet.js';
7
+ import { createPoll } from '../../utils/createPoll.js';
8
+ import { getQueryClient } from '../../utils/getQueryClient.js';
9
+ import { getCreateAiOGCashDepositMutationKey } from '../../utils/mutationKeys.js';
10
+ import { parseDecimal } from '../../utils/parseDecimal.js';
11
+ import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
12
+ import { getSession } from '../services/getSession.js';
13
+ export const useCreateAiOGCashDepositMutation = (config) => {
14
+ const queryClient = getQueryClient();
15
+ const mutation = useMutation({
16
+ ...config,
17
+ mutationKey: getCreateAiOGCashDepositMutationKey(),
18
+ mutationFn: async (input) => {
19
+ const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
20
+ const session = await getSession();
21
+ invariant(session.status === 'authenticated');
22
+ await createAiOGCashDeposit({ ...input, id }, {
23
+ headers: {
24
+ Authorization: `Bearer ${session.token}`,
25
+ ...(session.domain && {
26
+ Domain: session.domain,
27
+ }),
28
+ },
29
+ });
30
+ const poll = createPoll(async () => {
31
+ const session = await getSession();
32
+ invariant(session.status === 'authenticated');
33
+ return await getDeposit(id, {
34
+ headers: {
35
+ Authorization: `Bearer ${session.token}`,
36
+ },
37
+ });
38
+ }, {
39
+ until(res) {
40
+ return !!res?.checkoutUrl;
41
+ },
42
+ interval: 1000,
43
+ maxAttempt: 5,
44
+ });
45
+ const res = await poll();
46
+ if (!res?.checkoutUrl) {
47
+ const error = new Error();
48
+ error.name = 'AiOGCashDepositError';
49
+ error.message = 'Failed to process GCash deposit';
50
+ throw error;
51
+ }
52
+ const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
53
+ if (depositsCount <= 0) {
54
+ queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
55
+ return prev?.map((quest) => {
56
+ const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
57
+ if (quest.type === 'ONBOARDING') {
58
+ return {
59
+ ...quest,
60
+ status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
61
+ progressPercentage: progressPercentage.toFixed(2),
62
+ };
63
+ }
64
+ return quest;
65
+ });
66
+ });
67
+ }
68
+ queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
69
+ return res;
70
+ },
71
+ });
72
+ return mutation;
73
+ };
@@ -0,0 +1,4 @@
1
+ import type { SetOptional } from 'type-fest';
2
+ import { type CreateAiOGrabPayDepositInput } from '../../services/wallet';
3
+ import type { Deposit, Mutation } from '../../types';
4
+ export declare const useCreateAiOGrabPayDepositMutation: Mutation<Deposit, SetOptional<CreateAiOGrabPayDepositInput, 'id'>>;
@@ -0,0 +1,73 @@
1
+ import { ObjectId } from '@opexa/object-id';
2
+ import { useMutation } from '@tanstack/react-query';
3
+ import { clamp } from 'lodash-es';
4
+ import invariant from 'tiny-invariant';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createAiOGrabPayDeposit, getDeposit } from '../../services/wallet.js';
7
+ import { createPoll } from '../../utils/createPoll.js';
8
+ import { getQueryClient } from '../../utils/getQueryClient.js';
9
+ import { getCreateAiOGrabPayDepositMutationKey } from '../../utils/mutationKeys.js';
10
+ import { parseDecimal } from '../../utils/parseDecimal.js';
11
+ import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
12
+ import { getSession } from '../services/getSession.js';
13
+ export const useCreateAiOGrabPayDepositMutation = (config) => {
14
+ const queryClient = getQueryClient();
15
+ const mutation = useMutation({
16
+ ...config,
17
+ mutationKey: getCreateAiOGrabPayDepositMutationKey(),
18
+ mutationFn: async (input) => {
19
+ const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
20
+ const session = await getSession();
21
+ invariant(session.status === 'authenticated');
22
+ await createAiOGrabPayDeposit({ ...input, id }, {
23
+ headers: {
24
+ Authorization: `Bearer ${session.token}`,
25
+ ...(session.domain && {
26
+ Domain: session.domain,
27
+ }),
28
+ },
29
+ });
30
+ const poll = createPoll(async () => {
31
+ const session = await getSession();
32
+ invariant(session.status === 'authenticated');
33
+ return await getDeposit(id, {
34
+ headers: {
35
+ Authorization: `Bearer ${session.token}`,
36
+ },
37
+ });
38
+ }, {
39
+ until(res) {
40
+ return !!res?.checkoutUrl;
41
+ },
42
+ interval: 1000,
43
+ maxAttempt: 5,
44
+ });
45
+ const res = await poll();
46
+ if (!res?.checkoutUrl) {
47
+ const error = new Error();
48
+ error.name = 'AiOGrabPayDepositError';
49
+ error.message = 'Failed to process Grab Pay deposit';
50
+ throw error;
51
+ }
52
+ const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
53
+ if (depositsCount <= 0) {
54
+ queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
55
+ return prev?.map((quest) => {
56
+ const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
57
+ if (quest.type === 'ONBOARDING') {
58
+ return {
59
+ ...quest,
60
+ status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
61
+ progressPercentage: progressPercentage.toFixed(2),
62
+ };
63
+ }
64
+ return quest;
65
+ });
66
+ });
67
+ }
68
+ queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
69
+ return res;
70
+ },
71
+ });
72
+ return mutation;
73
+ };
@@ -0,0 +1,4 @@
1
+ import type { SetOptional } from 'type-fest';
2
+ import { type CreateAiOPalawanPayDepositInput } from '../../services/wallet';
3
+ import type { Deposit, Mutation } from '../../types';
4
+ export declare const useCreateAiOPalawanPayDepositMutation: Mutation<Deposit, SetOptional<CreateAiOPalawanPayDepositInput, 'id'>>;
@@ -0,0 +1,73 @@
1
+ import { ObjectId } from '@opexa/object-id';
2
+ import { useMutation } from '@tanstack/react-query';
3
+ import { clamp } from 'lodash-es';
4
+ import invariant from 'tiny-invariant';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createAiOPalawanPayDeposit, getDeposit } from '../../services/wallet.js';
7
+ import { createPoll } from '../../utils/createPoll.js';
8
+ import { getQueryClient } from '../../utils/getQueryClient.js';
9
+ import { getCreateAiOPalawanPayDepositMutationKey } from '../../utils/mutationKeys.js';
10
+ import { parseDecimal } from '../../utils/parseDecimal.js';
11
+ import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
12
+ import { getSession } from '../services/getSession.js';
13
+ export const useCreateAiOPalawanPayDepositMutation = (config) => {
14
+ const queryClient = getQueryClient();
15
+ const mutation = useMutation({
16
+ ...config,
17
+ mutationKey: getCreateAiOPalawanPayDepositMutationKey(),
18
+ mutationFn: async (input) => {
19
+ const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
20
+ const session = await getSession();
21
+ invariant(session.status === 'authenticated');
22
+ await createAiOPalawanPayDeposit({ ...input, id }, {
23
+ headers: {
24
+ Authorization: `Bearer ${session.token}`,
25
+ ...(session.domain && {
26
+ Domain: session.domain,
27
+ }),
28
+ },
29
+ });
30
+ const poll = createPoll(async () => {
31
+ const session = await getSession();
32
+ invariant(session.status === 'authenticated');
33
+ return await getDeposit(id, {
34
+ headers: {
35
+ Authorization: `Bearer ${session.token}`,
36
+ },
37
+ });
38
+ }, {
39
+ until(res) {
40
+ return !!res?.checkoutUrl;
41
+ },
42
+ interval: 1000,
43
+ maxAttempt: 5,
44
+ });
45
+ const res = await poll();
46
+ if (!res?.checkoutUrl) {
47
+ const error = new Error();
48
+ error.name = 'AiOPalawanPayDepositError';
49
+ error.message = 'Failed to process Palawan Pay deposit';
50
+ throw error;
51
+ }
52
+ const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
53
+ if (depositsCount <= 0) {
54
+ queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
55
+ return prev?.map((quest) => {
56
+ const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
57
+ if (quest.type === 'ONBOARDING') {
58
+ return {
59
+ ...quest,
60
+ status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
61
+ progressPercentage: progressPercentage.toFixed(2),
62
+ };
63
+ }
64
+ return quest;
65
+ });
66
+ });
67
+ }
68
+ queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
69
+ return res;
70
+ },
71
+ });
72
+ return mutation;
73
+ };
@@ -0,0 +1,4 @@
1
+ import type { SetOptional } from 'type-fest';
2
+ import { type CreateAiOPayMayaDepositInput } from '../../services/wallet';
3
+ import type { Deposit, Mutation } from '../../types';
4
+ export declare const useCreateAiOPayMayaDepositMutation: Mutation<Deposit, SetOptional<CreateAiOPayMayaDepositInput, 'id'>>;
@@ -0,0 +1,73 @@
1
+ import { ObjectId } from '@opexa/object-id';
2
+ import { useMutation } from '@tanstack/react-query';
3
+ import { clamp } from 'lodash-es';
4
+ import invariant from 'tiny-invariant';
5
+ import { ObjectType } from '../../services/ObjectType.js';
6
+ import { createAiOPayMayaDeposit, getDeposit } from '../../services/wallet.js';
7
+ import { createPoll } from '../../utils/createPoll.js';
8
+ import { getQueryClient } from '../../utils/getQueryClient.js';
9
+ import { getCreateAiOPayMayaDepositMutationKey } from '../../utils/mutationKeys.js';
10
+ import { parseDecimal } from '../../utils/parseDecimal.js';
11
+ import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
12
+ import { getSession } from '../services/getSession.js';
13
+ export const useCreateAiOPayMayaDepositMutation = (config) => {
14
+ const queryClient = getQueryClient();
15
+ const mutation = useMutation({
16
+ ...config,
17
+ mutationKey: getCreateAiOPayMayaDepositMutationKey(),
18
+ mutationFn: async (input) => {
19
+ const id = input.id ?? ObjectId.generate(ObjectType.Deposit).toString();
20
+ const session = await getSession();
21
+ invariant(session.status === 'authenticated');
22
+ await createAiOPayMayaDeposit({ ...input, id }, {
23
+ headers: {
24
+ Authorization: `Bearer ${session.token}`,
25
+ ...(session.domain && {
26
+ Domain: session.domain,
27
+ }),
28
+ },
29
+ });
30
+ const poll = createPoll(async () => {
31
+ const session = await getSession();
32
+ invariant(session.status === 'authenticated');
33
+ return await getDeposit(id, {
34
+ headers: {
35
+ Authorization: `Bearer ${session.token}`,
36
+ },
37
+ });
38
+ }, {
39
+ until(res) {
40
+ return !!res?.checkoutUrl;
41
+ },
42
+ interval: 1000,
43
+ maxAttempt: 5,
44
+ });
45
+ const res = await poll();
46
+ if (!res?.checkoutUrl) {
47
+ const error = new Error();
48
+ error.name = 'AiOPayMayaDepositError';
49
+ error.message = 'Failed to process Pay Maya deposit';
50
+ throw error;
51
+ }
52
+ const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
53
+ if (depositsCount <= 0) {
54
+ queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
55
+ return prev?.map((quest) => {
56
+ const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
57
+ if (quest.type === 'ONBOARDING') {
58
+ return {
59
+ ...quest,
60
+ status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
61
+ progressPercentage: progressPercentage.toFixed(2),
62
+ };
63
+ }
64
+ return quest;
65
+ });
66
+ });
67
+ }
68
+ queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
69
+ return res;
70
+ },
71
+ });
72
+ return mutation;
73
+ };
@@ -0,0 +1,11 @@
1
+ import { type AiOeWalletPaymentMethod } from './utils';
2
+ interface AiOPaymentMethodsProps {
3
+ value?: AiOeWalletPaymentMethod;
4
+ onChange?: (value: AiOeWalletPaymentMethod) => void;
5
+ defaultValue?: AiOeWalletPaymentMethod;
6
+ options?: AiOeWalletPaymentMethod[];
7
+ className?: string;
8
+ label?: string;
9
+ }
10
+ export declare function AiOPaymentMethods(props: AiOPaymentMethodsProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Image from 'next/image';
3
+ import { twMerge } from 'tailwind-merge';
4
+ import { useControllableState } from '../../client/hooks/useControllableState.js';
5
+ import { CheckIcon } from '../../icons/CheckIcon.js';
6
+ import gcash from '../../images/gcash.png';
7
+ import maya from '../../images/maya.png';
8
+ import grabPay from '../../images/grabpay.png';
9
+ import palawanPay from '../../images/palawanpay.png';
10
+ import { Checkbox } from '../../ui/Checkbox/index.js';
11
+ import { Field } from '../../ui/Field/index.js';
12
+ import { AiOeWalletPaymentMethodDefinition } from './utils.js';
13
+ const AIO_EWALLET_OPTIONS = [
14
+ {
15
+ value: 'AIO_GCASH',
16
+ label: 'GCash',
17
+ image: gcash,
18
+ },
19
+ {
20
+ value: 'AIO_PAY_MAYA',
21
+ label: 'Maya',
22
+ image: maya,
23
+ },
24
+ {
25
+ value: 'AIO_GRAB_PAY',
26
+ label: 'GrabPay',
27
+ image: grabPay,
28
+ },
29
+ {
30
+ value: 'AIO_PALAWAN_PAY',
31
+ label: 'Palawan Pay',
32
+ image: palawanPay,
33
+ },
34
+ ];
35
+ export function AiOPaymentMethods(props) {
36
+ const options = props.options && props.options.length > 0
37
+ ? AIO_EWALLET_OPTIONS.filter((option) => props.options?.includes(option.value))
38
+ : AIO_EWALLET_OPTIONS;
39
+ const [value, setValue] = useControllableState({
40
+ value: props.value,
41
+ defaultValue: props.defaultValue ?? options[0]?.value,
42
+ onChange: props.onChange,
43
+ });
44
+ const parseValue = (val) => {
45
+ return AiOeWalletPaymentMethodDefinition.parse(val);
46
+ };
47
+ return (_jsxs("div", { className: props.className, children: [_jsx(Field.Label, { asChild: true, children: _jsx("div", { children: props.label || 'AIO eWallet payment methods' }) }), _jsx(Checkbox.Group, { value: [value], onValueChange: (newValue) => {
48
+ const lastValue = newValue.at(-1);
49
+ if (!lastValue)
50
+ return;
51
+ setValue(parseValue(lastValue));
52
+ }, className: "grid grid-cols-2 gap-x-4 gap-y-3", children: options.map((option) => (_jsxs(Checkbox.Root, { value: option.value, className: "flex cursor-pointer items-center justify-between rounded-xl border border-border-secondary ui-checked:border-border-brand-solid p-lg", children: [_jsx("div", { className: twMerge('rounded-xs', option.value === 'AIO_GRAB_PAY'
53
+ ? 'bg-transparent py-0 px-0'
54
+ : 'bg-white py-[0.688rem] px-sm', option.value === 'AIO_GCASH' && 'bg-[#017EFF]', option.value === 'AIO_PALAWAN_PAY' && 'bg-[#026308]', option.value === 'AIO_PAY_MAYA' && 'bg-black'), children: _jsx(Image, { src: option.image, alt: "", width: 200, height: 40, className: twMerge('w-auto h-[1.063rem]', option.value === 'AIO_GRAB_PAY' && 'h-[3rem] rounded-[4px]', option.value === 'AIO_PALAWAN_PAY' && 'h-[2rem]'), draggable: false }) }), _jsx(Checkbox.Control, { className: "shrink-0", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.HiddenInput, {})] }, option.value))) })] }));
55
+ }
@@ -0,0 +1 @@
1
+ export declare function AiOGCashDeposit(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,190 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
4
+ import { useEffect, useState } from 'react';
5
+ import { Controller, useForm } from 'react-hook-form';
6
+ import invariant from 'tiny-invariant';
7
+ import { z } from 'zod';
8
+ import { useShallow } from 'zustand/shallow';
9
+ import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
10
+ import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
11
+ import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
12
+ import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
13
+ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
14
+ import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
15
+ import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
16
+ import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
17
+ import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
18
+ import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
19
+ import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
20
+ import { XIcon } from '../../../../icons/XIcon.js';
21
+ import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
22
+ import { Button } from '../../../../ui/Button/index.js';
23
+ import { Field } from '../../../../ui/Field/index.js';
24
+ import { NumberInput } from '../../../../ui/NumberInput/index.js';
25
+ import { Portal } from '../../../../ui/Portal/index.js';
26
+ import { parseDecimal } from '../../../../utils/parseDecimal.js';
27
+ import { AmountChoices } from '../../AmountChoices.js';
28
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
29
+ import { AvailablePromos } from '../AvailablePromos.js';
30
+ import { useCreateAiOGCashDepositMutation } from '../../../../client/hooks/useAiOGCashDepositMutation.js';
31
+ export function AiOGCashDeposit() {
32
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
33
+ const disclosure = useDisclosure();
34
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
35
+ depositWithdrawal: ctx.depositWithdrawal,
36
+ kycVerificationStatus: ctx.kycVerificationStatus,
37
+ })));
38
+ const verificationQuery = useMemberVerificationQuery();
39
+ const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
40
+ const [status, setStatus] = useState('waiting');
41
+ const createDepositMutation = useCreateAiOGCashDepositMutation({
42
+ onMutate() {
43
+ disclosure.setOpen(true);
44
+ setStatus('processing');
45
+ },
46
+ onSuccess(data) {
47
+ invariant(data.checkoutUrl);
48
+ window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
49
+ form.reset();
50
+ disclosure.setOpen(false);
51
+ },
52
+ onError() {
53
+ disclosure.setOpen(true);
54
+ setStatus('failed');
55
+ },
56
+ });
57
+ const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
58
+ enabled: createDepositMutation.data != null,
59
+ refetchInterval(ctx) {
60
+ if (ctx.state.data?.status === 'CANCELLED' ||
61
+ ctx.state.data?.status === 'CONFIRMED') {
62
+ return false;
63
+ }
64
+ else {
65
+ return 2500;
66
+ }
67
+ },
68
+ });
69
+ useEffect(() => {
70
+ if (depositQuery.data?.status === 'CANCELLED') {
71
+ disclosure.setOpen(true);
72
+ setStatus('failed');
73
+ }
74
+ else if (depositQuery.data?.status === 'CONFIRMED') {
75
+ disclosure.setOpen(true);
76
+ setStatus('success');
77
+ }
78
+ }, [depositQuery.data?.status, disclosure]);
79
+ const depositsCountQuery = useDepositsCountQuery();
80
+ const depositsCount = depositsCountQuery.data ?? 0;
81
+ const paymentSettingsQuery = usePaymentSettingsQuery();
82
+ const paymentSettings = paymentSettingsQuery.data;
83
+ const gatewaySettings = paymentSettings?.aioGCashDepositGatewaySettings;
84
+ const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
85
+ const minimumAmount = depositsCount <= 0
86
+ ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
87
+ : parseDecimal(gatewaySettings?.minimumAmount, 0);
88
+ const promosQuery = useAvailablePromosQuery();
89
+ const promos = promosQuery.data ?? [];
90
+ const definition = z
91
+ .object({
92
+ amount: z.string().superRefine((val, ctx) => {
93
+ const n = parseDecimal(val, 0);
94
+ if (n < minimumAmount) {
95
+ ctx.addIssue({
96
+ type: 'number',
97
+ code: z.ZodIssueCode.too_small,
98
+ inclusive: true,
99
+ minimum: minimumAmount,
100
+ message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
101
+ });
102
+ }
103
+ if (n > maximumAmount) {
104
+ ctx.addIssue({
105
+ type: 'number',
106
+ code: z.ZodIssueCode.too_big,
107
+ inclusive: true,
108
+ maximum: maximumAmount,
109
+ message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
110
+ });
111
+ }
112
+ }),
113
+ promo: z.string().optional().nullable(),
114
+ })
115
+ .superRefine((value, ctx) => {
116
+ const promo = promos.find((o) => o.id === value.promo);
117
+ const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
118
+ const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
119
+ const amount = parseDecimal(value.amount, 0);
120
+ if (promo && amount < promoMinAmount) {
121
+ ctx.addIssue({
122
+ path: ['amount'],
123
+ code: z.ZodIssueCode.custom,
124
+ message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
125
+ });
126
+ }
127
+ if (promo && amount > promoMaxAmount) {
128
+ ctx.addIssue({
129
+ path: ['amount'],
130
+ code: z.ZodIssueCode.custom,
131
+ message: `Maximum amount for this promo is ${promoMaxAmount}`,
132
+ });
133
+ }
134
+ });
135
+ const form = useForm({
136
+ mode: 'all',
137
+ resolver: zodResolver(definition),
138
+ defaultValues: {
139
+ amount: '0',
140
+ promo: globalStore.depositWithdrawal.promo ?? null,
141
+ },
142
+ });
143
+ useEffect(() => {
144
+ if (minimumAmount) {
145
+ form.reset({
146
+ amount: minimumAmount.toString(),
147
+ promo: form.getValues('promo') ?? null,
148
+ });
149
+ }
150
+ }, [form, minimumAmount]);
151
+ return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
152
+ //handle new kyc process
153
+ if (verificationStatus === 'PENDING' ||
154
+ verificationStatus === 'UNVERIFIED' ||
155
+ verificationStatus === 'REJECTED' ||
156
+ verificationStatus === 'CREATED') {
157
+ globalStore.kycVerificationStatus.setOpen(true);
158
+ return;
159
+ }
160
+ else {
161
+ createDepositMutation.reset();
162
+ createDepositMutation.mutate({
163
+ amount: data.amount.toString(),
164
+ promo: data.promo ?? undefined,
165
+ redirectUrl: window.location.origin,
166
+ });
167
+ }
168
+ }), noValidate: true, children: [_jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
169
+ o.field.onChange(details.value);
170
+ }, formatOptions: {
171
+ maximumFractionDigits: 2,
172
+ minimumFractionDigits: 0,
173
+ }, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to deposit" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch('amount'), 0), onChange: (value) => {
174
+ form.setValue('amount', value.toString(), {
175
+ shouldTouch: true,
176
+ shouldDirty: true,
177
+ shouldValidate: true,
178
+ });
179
+ }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
180
+ o.field.onChange(value);
181
+ globalStore.depositWithdrawal.setPromo(null);
182
+ }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["By depositing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: disclosure.open, onOpenChange: (details) => {
183
+ disclosure.setOpen(details.open);
184
+ }, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === 'failed' && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === 'processing' && 'Processing Deposit', status === 'success' && 'Deposit Successful', status === 'failed' && 'Deposit Failed'] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
185
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' &&
186
+ 'Your deposit has been successfully processed.', status === 'failed' &&
187
+ 'Something went wrong while processing your deposit. Please try again or contact support.'] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
188
+ api.setOpen(false);
189
+ }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
190
+ }
@@ -0,0 +1 @@
1
+ export declare function AiOGrabPayDeposit(): import("react/jsx-runtime").JSX.Element;