@opexa/portal-components 0.0.675 → 0.0.678

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 (240) 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/DigitainLauncher/Loading.js +1 -1
  25. package/dist/components/Disclaimer/ResponsibleGaming.d.ts +10 -0
  26. package/dist/components/Disclaimer/ResponsibleGaming.js +13 -0
  27. package/dist/components/Disclaimer/TermsOfUse.d.ts +11 -0
  28. package/dist/components/Disclaimer/TermsOfUse.js +13 -0
  29. package/dist/components/FeatureFlag/FeatureFlag.d.ts +1 -0
  30. package/dist/components/FeatureFlag/FeatureFlag.js +29 -0
  31. package/dist/components/FeatureFlag/index.d.ts +1 -0
  32. package/dist/components/FeatureFlag/index.js +1 -0
  33. package/dist/components/Jackpots/Jackpots.module.css +184 -184
  34. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  35. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  36. package/dist/components/KYC/AutoOpen.d.ts +1 -0
  37. package/dist/components/KYC/AutoOpen.js +40 -0
  38. package/dist/components/KYC/BasicInformation.js +1 -1
  39. package/dist/components/KYC/CaptureIdDocument.d.ts +1 -0
  40. package/dist/components/KYC/CaptureIdDocument.js +219 -0
  41. package/dist/components/KYC/CaptureSelfie.d.ts +1 -0
  42. package/dist/components/KYC/CaptureSelfie.js +285 -0
  43. package/dist/components/KYC/DisplayImage.d.ts +5 -0
  44. package/dist/components/KYC/DisplayImage.js +8 -0
  45. package/dist/components/KYC/FileUpload.d.ts +10 -0
  46. package/dist/components/KYC/FileUpload.js +72 -0
  47. package/dist/components/KYC/IdentityVerification.js +1 -1
  48. package/dist/components/KYC/KYC.lazy.js +1 -1
  49. package/dist/components/KYC/KYCDefault/IdentityVerification.js +3 -3
  50. package/dist/components/KYC/KYCDefault/KYCVerificationStatus.lazy.js +2 -2
  51. package/dist/components/KYC/KYCVerificationStatus.lazy.js +13 -7
  52. package/dist/components/KYC/NoCameraError.d.ts +7 -0
  53. package/dist/components/KYC/NoCameraError.js +6 -0
  54. package/dist/components/KYC/PersonOverlayDesktop.d.ts +7 -0
  55. package/dist/components/KYC/PersonOverlayDesktop.js +9 -0
  56. package/dist/components/KYC/PersonalInformation.js +1 -1
  57. package/dist/components/KYC/backup/Header.d.ts +1 -0
  58. package/dist/components/KYC/backup/Header.js +8 -0
  59. package/dist/components/KYC/backup/Indicator.d.ts +1 -0
  60. package/dist/components/KYC/backup/Indicator.js +9 -0
  61. package/dist/components/KYC/backup/KYC.d.ts +1 -0
  62. package/dist/components/KYC/backup/KYC.js +14 -0
  63. package/dist/components/KYC/backup/KYC.lazy.d.ts +1 -0
  64. package/dist/components/KYC/backup/KYC.lazy.js +26 -0
  65. package/dist/components/KYC/backup/KYCContext.d.ts +6 -0
  66. package/dist/components/KYC/backup/KYCContext.js +2 -0
  67. package/dist/components/KYC/backup/Step1.d.ts +1 -0
  68. package/dist/components/KYC/backup/Step1.js +13 -0
  69. package/dist/components/KYC/backup/Step2.d.ts +1 -0
  70. package/dist/components/KYC/backup/Step2.js +13 -0
  71. package/dist/components/KYC/backup/Step3.d.ts +1 -0
  72. package/dist/components/KYC/backup/Step3.js +13 -0
  73. package/dist/components/KYC/backup/Step4.d.ts +1 -0
  74. package/dist/components/KYC/backup/Step4.js +7 -0
  75. package/dist/components/KYC/backup/useKYC.d.ts +10 -0
  76. package/dist/components/KYC/backup/useKYC.js +8 -0
  77. package/dist/components/KYC/loadModels.d.ts +1 -0
  78. package/dist/components/KYC/loadModels.js +9 -0
  79. package/dist/components/KYC/utils.d.ts +9 -0
  80. package/dist/components/KYC/utils.js +79 -0
  81. package/dist/components/Messages/Message.d.ts +1 -0
  82. package/dist/components/Messages/Message.js +35 -0
  83. package/dist/components/Messages/MessageContext.d.ts +6 -0
  84. package/dist/components/Messages/MessageContext.js +2 -0
  85. package/dist/components/Messages/MessagePopup.d.ts +1 -0
  86. package/dist/components/Messages/MessagePopup.js +20 -0
  87. package/dist/components/Messages/MessageTrigger.d.ts +8 -0
  88. package/dist/components/Messages/MessageTrigger.js +19 -0
  89. package/dist/components/Quests/CountdownTimer.d.ts +15 -0
  90. package/dist/components/Quests/CountdownTimer.js +33 -0
  91. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +4 -0
  92. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +78 -0
  93. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +8 -0
  94. package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +9 -0
  95. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +4 -0
  96. package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +4 -0
  97. package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +4 -0
  98. package/dist/components/Quests/WageringQuest/WageringQuest.js +20 -0
  99. package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +9 -0
  100. package/dist/components/Quests/WageringQuest/WageringQuestModal.js +9 -0
  101. package/dist/components/SignIn/utils.d.ts +8 -0
  102. package/dist/components/SignIn/utils.js +26 -0
  103. package/dist/components/SignUp/SignUp.lazy.d.ts +12 -0
  104. package/dist/components/SignUp/SignUp.lazy.js +18 -0
  105. package/dist/components/SignUp/SignUpContext.d.ts +6 -0
  106. package/dist/components/SignUp/SignUpContext.js +2 -0
  107. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.d.ts +17 -0
  108. package/dist/components/SignUp/SignUpDefault/SignUp.lazy.js +18 -0
  109. package/dist/components/SignUp/SignUpDefault/SignUpContext.d.ts +6 -0
  110. package/dist/components/SignUp/SignUpDefault/SignUpContext.js +2 -0
  111. package/dist/components/SignUp/SignUpDefault/SignUpForm.d.ts +1 -0
  112. package/dist/components/SignUp/SignUpDefault/SignUpForm.js +310 -0
  113. package/dist/components/SignUp/SignUpForm.d.ts +1 -0
  114. package/dist/components/SignUp/SignUpForm.js +284 -0
  115. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.d.ts +1 -0
  116. package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +198 -0
  117. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.d.ts +1 -0
  118. package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +251 -0
  119. package/dist/components/SignUp/SignUpKYC/ImageUploader.d.ts +10 -0
  120. package/dist/components/SignUp/SignUpKYC/ImageUploader.js +42 -0
  121. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
  122. package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
  123. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.d.ts +1 -0
  124. package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +464 -0
  125. package/dist/components/SignUp/SignUpKYC/useImageUploader.d.ts +11 -0
  126. package/dist/components/SignUp/SignUpKYC/useImageUploader.js +20 -0
  127. package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
  128. package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
  129. package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +1 -0
  130. package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +198 -0
  131. package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +1 -0
  132. package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +251 -0
  133. package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +10 -0
  134. package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +41 -0
  135. package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +1 -0
  136. package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +429 -0
  137. package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +13 -0
  138. package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +26 -0
  139. package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +7 -0
  140. package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +2 -0
  141. package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +11 -0
  142. package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +20 -0
  143. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  144. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  145. package/dist/components/shared/IdDocumentField.client.d.ts +25 -0
  146. package/dist/components/shared/IdDocumentField.client.js +204 -0
  147. package/dist/components/shared/IdDocumentField.d.ts +2 -0
  148. package/dist/components/shared/IdDocumentField.js +11 -0
  149. package/dist/components/shared/SelfieField.client.d.ts +20 -0
  150. package/dist/components/shared/SelfieField.client.js +327 -0
  151. package/dist/components/shared/SelfieField.d.ts +2 -0
  152. package/dist/components/shared/SelfieField.js +11 -0
  153. package/dist/constants/BranchCode.d.ts +4 -0
  154. package/dist/constants/BranchCode.js +42 -0
  155. package/dist/constants/Branches.d.ts +2 -0
  156. package/dist/constants/Branches.js +42 -0
  157. package/dist/handlers/index.d.ts +2 -2
  158. package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
  159. package/dist/handlers/postTransformIdFrontImage.js +67 -0
  160. package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
  161. package/dist/handlers/postTransformSelfieImage.js +71 -0
  162. package/dist/handlers.d.ts +43 -0
  163. package/dist/handlers.js +297 -0
  164. package/dist/icons/BellRingIcon.d.ts +2 -0
  165. package/dist/icons/BellRingIcon.js +4 -0
  166. package/dist/images/grabpay.png +0 -0
  167. package/dist/images/palawanpay.png +0 -0
  168. package/dist/images/wallet.png +0 -0
  169. package/dist/services/queries.d.ts +6 -2
  170. package/dist/services/queries.js +2979 -2803
  171. package/dist/services/wallet.d.ts +52 -0
  172. package/dist/services/wallet.js +41 -1
  173. package/dist/styles/theme.css +773 -773
  174. package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +4 -0
  175. package/dist/third-parties/FacebookPixel/FacebookPixel.js +4 -0
  176. package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
  177. package/dist/third-parties/FacebookPixel/api.js +1 -0
  178. package/dist/third-parties/FacebookPixel/index.d.ts +1 -0
  179. package/dist/third-parties/FacebookPixel/index.js +1 -0
  180. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +4 -0
  181. package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +4 -0
  182. package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
  183. package/dist/third-parties/GoogleRecaptcha/api.js +1 -0
  184. package/dist/third-parties/GoogleRecaptcha/index.d.ts +1 -0
  185. package/dist/third-parties/GoogleRecaptcha/index.js +1 -0
  186. package/dist/third-parties/index.d.ts +2 -0
  187. package/dist/third-parties/index.js +2 -0
  188. package/dist/types/index.d.ts +4 -0
  189. package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
  190. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  191. package/dist/ui/Carousel/Carousel.d.ts +45 -45
  192. package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
  193. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  194. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  195. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  196. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  197. package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
  198. package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
  199. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  200. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  201. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  202. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  203. package/dist/ui/Dialog/Dialog.d.ts +33 -33
  204. package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
  205. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  206. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  207. package/dist/ui/Menu/Menu.d.ts +198 -198
  208. package/dist/ui/Menu/menu.recipe.d.ts +11 -11
  209. package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
  210. package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
  211. package/dist/ui/Popover/Popover.d.ts +88 -88
  212. package/dist/ui/Popover/popover.recipe.d.ts +8 -8
  213. package/dist/ui/Progress/Progress.d.ts +27 -27
  214. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  215. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  216. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  217. package/dist/ui/Select/Select.d.ts +45 -45
  218. package/dist/ui/Select/select.recipe.d.ts +3 -3
  219. package/dist/ui/Table/Table.d.ts +21 -21
  220. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  221. package/dist/ui/Table/table.recipe.d.ts +3 -3
  222. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  223. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  224. package/dist/utils/dataUrlToBlob.d.ts +1 -0
  225. package/dist/utils/dataUrlToBlob.js +11 -0
  226. package/dist/utils/gamesAvailable3pmTo3am.d.ts +1 -0
  227. package/dist/utils/gamesAvailable3pmTo3am.js +1 -0
  228. package/dist/utils/getGameName.d.ts +1 -0
  229. package/dist/utils/getGameName.js +6 -0
  230. package/dist/utils/isBetween3amAnd3pm.d.ts +1 -0
  231. package/dist/utils/isBetween3amAnd3pm.js +5 -0
  232. package/dist/utils/mutationKeys.d.ts +4 -0
  233. package/dist/utils/mutationKeys.js +16 -0
  234. package/dist/utils/resizeImageSize.d.ts +2 -0
  235. package/dist/utils/resizeImageSize.js +11 -0
  236. package/package.json +175 -175
  237. package/dist/components/AccountInfo/GoogleDisconnect.d.ts +0 -7
  238. package/dist/components/AccountInfo/GoogleDisconnect.js +0 -11
  239. package/dist/icons/LinkBrokenIcon.d.ts +0 -2
  240. package/dist/icons/LinkBrokenIcon.js +0 -4
@@ -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;