@opexa/portal-components 0.0.808 → 0.0.809

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 (66) hide show
  1. package/dist/components/DepositWithdrawal/Deposit/AiOGCashDeposit/AiOGCashDeposit.js +54 -10
  2. package/dist/components/DepositWithdrawal/Deposit/AiOGrabPayDeposit/AiOGrabPayDeposit.js +54 -10
  3. package/dist/components/DepositWithdrawal/Deposit/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js +54 -10
  4. package/dist/components/DepositWithdrawal/Deposit/AiOPayMayaDeposit/AiOPayMayaDeposit.js +54 -10
  5. package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +54 -9
  6. package/dist/components/DepositWithdrawal/Deposit/GCashWebpayDeposit/GCashWebpayDeposit.js +54 -9
  7. package/dist/components/DepositWithdrawal/Deposit/LibanganDeposit/LibanganDeposit.js +49 -25
  8. package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +54 -9
  9. package/dist/components/DepositWithdrawal/Deposit/MayaWebpayDeposit/MayaWebpayDeposit.js +54 -9
  10. package/dist/components/DepositWithdrawal/Deposit/PisoPayDeposit/PisoPayDeposit.js +54 -10
  11. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +2 -5
  12. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.d.ts +1 -0
  13. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.js +173 -0
  14. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.d.ts +1 -0
  15. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.js +171 -0
  16. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.d.ts +1 -0
  17. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js +171 -0
  18. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.d.ts +1 -0
  19. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.js +171 -0
  20. package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.d.ts +8 -0
  21. package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.js +33 -0
  22. package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.d.ts +1 -0
  23. package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.js +120 -0
  24. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.d.ts +1 -0
  25. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.js +163 -0
  26. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.d.ts +1 -0
  27. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.js +165 -0
  28. package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.d.ts +1 -0
  29. package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.js +186 -0
  30. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.d.ts +1 -0
  31. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.js +157 -0
  32. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.d.ts +1 -0
  33. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.js +163 -0
  34. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.d.ts +1 -0
  35. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.js +166 -0
  36. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.d.ts +1 -0
  37. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.js +10 -0
  38. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.d.ts +1 -0
  39. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.js +99 -0
  40. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.d.ts +25 -0
  41. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.js +2 -0
  42. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.d.ts +1 -0
  43. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.js +19 -0
  44. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.d.ts +1 -0
  45. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.js +115 -0
  46. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.d.ts +13 -0
  47. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.js +81 -0
  48. package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.d.ts +1 -0
  49. package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.js +180 -0
  50. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.d.ts +1 -0
  51. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.js +10 -0
  52. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.d.ts +1 -0
  53. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.js +99 -0
  54. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts +25 -0
  55. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.js +2 -0
  56. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.d.ts +1 -0
  57. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.js +17 -0
  58. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.d.ts +1 -0
  59. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.js +116 -0
  60. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.d.ts +3 -0
  61. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.js +69 -0
  62. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.d.ts +13 -0
  63. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.js +85 -0
  64. package/dist/components/DepositWithdrawal/HasPendingBonuses.d.ts +2 -2
  65. package/dist/components/DepositWithdrawal/HasPendingBonuses.js +1 -2
  66. package/package.json +1 -1
@@ -4,7 +4,6 @@ import { useEffect } from 'react';
4
4
  import { z } from 'zod';
5
5
  import { useShallow } from 'zustand/shallow';
6
6
  import { useBonusesQuery } from '../../client/hooks/useBonusesQuery.js';
7
- import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
8
7
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
9
8
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
10
9
  import { useWalletQuery } from '../../client/hooks/useWalletQuery.js';
@@ -16,12 +15,10 @@ import { Portal } from '../../ui/Portal/index.js';
16
15
  import { Tabs } from '../../ui/Tabs/index.js';
17
16
  import { formatNumber } from '../../utils/formatNumber.js';
18
17
  import { Deposit } from './Deposit/Deposit.js';
19
- import { Deposit as Deposit__next } from './Deposit__next/Deposit.js';
20
18
  import { DepositWithdrawalPropsProvider } from './DepositWithdrawalContext.js';
21
- import HasPendingBonuses from './HasPendingBonuses.js';
19
+ import { HasPendingBonuses } from './HasPendingBonuses.js';
22
20
  import { Withdrawal } from './Withdrawal/Withdrawal.js';
23
21
  export function DepositWithdrawal(props) {
24
- const featureFlag = useFeatureFlag();
25
22
  const { hasPrivacyPolicyAndTermsOfUse = true, ...restProps } = props;
26
23
  const mergedProps = {
27
24
  ...restProps,
@@ -60,5 +57,5 @@ export function DepositWithdrawal(props) {
60
57
  minDecimalPlaces: 2,
61
58
  }) }), _jsxs(Tabs.Root, { value: globalStore.depositWithdrawal.tab, onValueChange: (details) => {
62
59
  globalStore.depositWithdrawal.setTab(z.enum(['DEPOSIT', 'WITHDRAWAL']).parse(details.value));
63
- }, lazyMount: true, unmountOnExit: true, className: "mt-3xl space-y-4xl", children: [_jsxs(Tabs.List, { className: "w-full", children: [_jsx(Tabs.Trigger, { value: "DEPOSIT", className: "grow", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "WITHDRAWAL", className: "grow", children: "Withdrawal" }), _jsx(Tabs.Indicator, {})] }), _jsx(Tabs.Content, { value: "DEPOSIT", className: "space-y-3xl", children: featureFlag.enabled ? _jsx(Deposit__next, {}) : _jsx(Deposit, {}) }), _jsx(Tabs.Content, { value: "WITHDRAWAL", className: "space-y-3xl", children: _jsx(Withdrawal, {}) })] })] })] }) })] }) }) }), _jsx(HasPendingBonuses, {})] }));
60
+ }, lazyMount: true, unmountOnExit: true, className: "mt-3xl space-y-4xl", children: [_jsxs(Tabs.List, { className: "w-full", children: [_jsx(Tabs.Trigger, { value: "DEPOSIT", className: "grow", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "WITHDRAWAL", className: "grow", children: "Withdrawal" }), _jsx(Tabs.Indicator, {})] }), _jsx(Tabs.Content, { value: "DEPOSIT", className: "space-y-3xl", children: _jsx(Deposit, {}) }), _jsx(Tabs.Content, { value: "WITHDRAWAL", className: "space-y-3xl", children: _jsx(Withdrawal, {}) })] })] })] }) })] }) }) }), _jsx(HasPendingBonuses, {})] }));
64
61
  }
@@ -0,0 +1 @@
1
+ export declare function AiOGCashDeposit(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,173 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { useCreateAiOGCashDepositMutation } from '../../../../client/hooks/useAiOGCashDepositMutation.js';
10
+ import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.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 { getQueryClient } from '../../../../utils/getQueryClient.js';
27
+ import { parseDecimal } from '../../../../utils/parseDecimal.js';
28
+ import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
29
+ import { AmountChoices } from '../../AmountChoices.js';
30
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
31
+ import { explainError } from '../../utils.js';
32
+ import { AvailablePromos } from '../AvailablePromos.js';
33
+ export function AiOGCashDeposit() {
34
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
35
+ const disclosure = useDisclosure();
36
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
37
+ depositWithdrawal: ctx.depositWithdrawal,
38
+ kycVerificationStatus: ctx.kycVerificationStatus,
39
+ })));
40
+ const verificationQuery = useMemberVerificationQuery();
41
+ const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
42
+ const [status, setStatus] = useState('waiting');
43
+ const createDepositMutation = useCreateAiOGCashDepositMutation({
44
+ onMutate() {
45
+ disclosure.setOpen(true);
46
+ setStatus('processing');
47
+ },
48
+ onSuccess(data) {
49
+ const queryClient = getQueryClient();
50
+ invariant(data.checkoutUrl);
51
+ window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
52
+ queryClient.invalidateQueries({
53
+ queryKey: getDepositsCountQueryKey(),
54
+ });
55
+ setStatus('success');
56
+ },
57
+ onError() {
58
+ setStatus('failed');
59
+ },
60
+ });
61
+ const depositsCountQuery = useDepositsCountQuery();
62
+ const depositsCount = depositsCountQuery.data ?? 0;
63
+ const paymentSettingsQuery = usePaymentSettingsQuery();
64
+ const paymentSettings = paymentSettingsQuery.data;
65
+ const gatewaySettings = paymentSettings?.aioGCashDepositGatewaySettings;
66
+ const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
67
+ const minimumAmount = depositsCount <= 0
68
+ ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
69
+ : parseDecimal(gatewaySettings?.minimumAmount, 0);
70
+ const promosQuery = useAvailablePromosQuery();
71
+ const promos = promosQuery.data ?? [];
72
+ const definition = z
73
+ .object({
74
+ amount: z.string().superRefine((val, ctx) => {
75
+ const n = parseDecimal(val, 0);
76
+ if (n < minimumAmount) {
77
+ ctx.addIssue({
78
+ type: 'number',
79
+ code: z.ZodIssueCode.too_small,
80
+ inclusive: true,
81
+ minimum: minimumAmount,
82
+ message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
83
+ });
84
+ }
85
+ if (n > maximumAmount) {
86
+ ctx.addIssue({
87
+ type: 'number',
88
+ code: z.ZodIssueCode.too_big,
89
+ inclusive: true,
90
+ maximum: maximumAmount,
91
+ message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
92
+ });
93
+ }
94
+ }),
95
+ promo: z.string().optional().nullable(),
96
+ })
97
+ .superRefine((value, ctx) => {
98
+ const promo = promos.find((o) => o.id === value.promo);
99
+ const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
100
+ const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
101
+ const amount = parseDecimal(value.amount, 0);
102
+ if (promo && amount < promoMinAmount) {
103
+ ctx.addIssue({
104
+ path: ['amount'],
105
+ code: z.ZodIssueCode.custom,
106
+ message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
107
+ });
108
+ }
109
+ if (promo && amount > promoMaxAmount) {
110
+ ctx.addIssue({
111
+ path: ['amount'],
112
+ code: z.ZodIssueCode.custom,
113
+ message: `Maximum amount for this promo is ${promoMaxAmount}`,
114
+ });
115
+ }
116
+ });
117
+ const form = useForm({
118
+ mode: 'all',
119
+ resolver: zodResolver(definition),
120
+ defaultValues: {
121
+ amount: '0',
122
+ promo: globalStore.depositWithdrawal.promo ?? null,
123
+ },
124
+ });
125
+ useEffect(() => {
126
+ if (minimumAmount) {
127
+ form.reset({
128
+ amount: minimumAmount.toString(),
129
+ promo: form.getValues('promo') ?? null,
130
+ });
131
+ }
132
+ }, [form, minimumAmount]);
133
+ return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
134
+ if (verificationStatus === 'PENDING' ||
135
+ verificationStatus === 'UNVERIFIED' ||
136
+ verificationStatus === 'REJECTED' ||
137
+ verificationStatus === 'CREATED') {
138
+ globalStore.kycVerificationStatus.setOpen(true);
139
+ return;
140
+ }
141
+ else {
142
+ createDepositMutation.reset();
143
+ createDepositMutation.mutate({
144
+ amount: data.amount.toString(),
145
+ promo: data.promo ?? undefined,
146
+ redirectUrl: window.location.origin.includes('localhost')
147
+ ? 'https://uat.powerplay.ph'
148
+ : window.location.origin,
149
+ });
150
+ }
151
+ }), 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) => {
152
+ o.field.onChange(details.value);
153
+ }, 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) => {
154
+ form.setValue('amount', value.toString(), {
155
+ shouldTouch: true,
156
+ shouldDirty: true,
157
+ shouldValidate: true,
158
+ });
159
+ }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
160
+ o.field.onChange(value);
161
+ globalStore.depositWithdrawal.setPromo(null);
162
+ }, 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) => {
163
+ disclosure.setOpen(details.open);
164
+ if (!details.open) {
165
+ setStatus('waiting');
166
+ form.reset();
167
+ }
168
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, 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' &&
169
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
170
+ explainError(createDepositMutation?.error?.name)] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
171
+ api.setOpen(false);
172
+ }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
173
+ }
@@ -0,0 +1 @@
1
+ export declare function AiOGrabPayDeposit(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,171 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { useCreateAiOGrabPayDepositMutation } from '../../../../client/hooks/useAiOGrabPayDepositMutation.js';
10
+ import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.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 { getQueryClient } from '../../../../utils/getQueryClient.js';
27
+ import { parseDecimal } from '../../../../utils/parseDecimal.js';
28
+ import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
29
+ import { AmountChoices } from '../../AmountChoices.js';
30
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
31
+ import { explainError } from '../../utils.js';
32
+ import { AvailablePromos } from '../AvailablePromos.js';
33
+ export function AiOGrabPayDeposit() {
34
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
35
+ const disclosure = useDisclosure();
36
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
37
+ depositWithdrawal: ctx.depositWithdrawal,
38
+ kycVerificationStatus: ctx.kycVerificationStatus,
39
+ })));
40
+ const verificationQuery = useMemberVerificationQuery();
41
+ const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
42
+ const [status, setStatus] = useState('waiting');
43
+ const createDepositMutation = useCreateAiOGrabPayDepositMutation({
44
+ onMutate() {
45
+ disclosure.setOpen(true);
46
+ setStatus('processing');
47
+ },
48
+ onSuccess(data) {
49
+ const queryClient = getQueryClient();
50
+ invariant(data.checkoutUrl);
51
+ window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
52
+ queryClient.invalidateQueries({ queryKey: getDepositsCountQueryKey() });
53
+ setStatus('success');
54
+ },
55
+ onError() {
56
+ setStatus('failed');
57
+ },
58
+ });
59
+ const depositsCountQuery = useDepositsCountQuery();
60
+ const depositsCount = depositsCountQuery.data ?? 0;
61
+ const paymentSettingsQuery = usePaymentSettingsQuery();
62
+ const paymentSettings = paymentSettingsQuery.data;
63
+ const gatewaySettings = paymentSettings?.aioGrabPayDepositGatewaySettings;
64
+ const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
65
+ const minimumAmount = depositsCount <= 0
66
+ ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
67
+ : parseDecimal(gatewaySettings?.minimumAmount, 0);
68
+ const promosQuery = useAvailablePromosQuery();
69
+ const promos = promosQuery.data ?? [];
70
+ const definition = z
71
+ .object({
72
+ amount: z.string().superRefine((val, ctx) => {
73
+ const n = parseDecimal(val, 0);
74
+ if (n < minimumAmount) {
75
+ ctx.addIssue({
76
+ type: 'number',
77
+ code: z.ZodIssueCode.too_small,
78
+ inclusive: true,
79
+ minimum: minimumAmount,
80
+ message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
81
+ });
82
+ }
83
+ if (n > maximumAmount) {
84
+ ctx.addIssue({
85
+ type: 'number',
86
+ code: z.ZodIssueCode.too_big,
87
+ inclusive: true,
88
+ maximum: maximumAmount,
89
+ message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
90
+ });
91
+ }
92
+ }),
93
+ promo: z.string().optional().nullable(),
94
+ })
95
+ .superRefine((value, ctx) => {
96
+ const promo = promos.find((o) => o.id === value.promo);
97
+ const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
98
+ const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
99
+ const amount = parseDecimal(value.amount, 0);
100
+ if (promo && amount < promoMinAmount) {
101
+ ctx.addIssue({
102
+ path: ['amount'],
103
+ code: z.ZodIssueCode.custom,
104
+ message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
105
+ });
106
+ }
107
+ if (promo && amount > promoMaxAmount) {
108
+ ctx.addIssue({
109
+ path: ['amount'],
110
+ code: z.ZodIssueCode.custom,
111
+ message: `Maximum amount for this promo is ${promoMaxAmount}`,
112
+ });
113
+ }
114
+ });
115
+ const form = useForm({
116
+ mode: 'all',
117
+ resolver: zodResolver(definition),
118
+ defaultValues: {
119
+ amount: '0',
120
+ promo: globalStore.depositWithdrawal.promo ?? null,
121
+ },
122
+ });
123
+ useEffect(() => {
124
+ if (minimumAmount) {
125
+ form.reset({
126
+ amount: minimumAmount.toString(),
127
+ promo: form.getValues('promo') ?? null,
128
+ });
129
+ }
130
+ }, [form, minimumAmount]);
131
+ return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
132
+ if (verificationStatus === 'PENDING' ||
133
+ verificationStatus === 'UNVERIFIED' ||
134
+ verificationStatus === 'REJECTED' ||
135
+ verificationStatus === 'CREATED') {
136
+ globalStore.kycVerificationStatus.setOpen(true);
137
+ return;
138
+ }
139
+ else {
140
+ createDepositMutation.reset();
141
+ createDepositMutation.mutate({
142
+ amount: data.amount.toString(),
143
+ promo: data.promo ?? undefined,
144
+ redirectUrl: window.location.origin.includes('localhost')
145
+ ? 'https://uat.powerplay.ph'
146
+ : window.location.origin,
147
+ });
148
+ }
149
+ }), 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) => {
150
+ o.field.onChange(details.value);
151
+ }, 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) => {
152
+ form.setValue('amount', value.toString(), {
153
+ shouldTouch: true,
154
+ shouldDirty: true,
155
+ shouldValidate: true,
156
+ });
157
+ }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
158
+ o.field.onChange(value);
159
+ globalStore.depositWithdrawal.setPromo(null);
160
+ }, 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) => {
161
+ disclosure.setOpen(details.open);
162
+ if (!details.open) {
163
+ setStatus('waiting');
164
+ form.reset();
165
+ }
166
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, 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' &&
167
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
168
+ explainError(createDepositMutation?.error?.name)] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
169
+ api.setOpen(false);
170
+ }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
171
+ }
@@ -0,0 +1 @@
1
+ export declare function AiOPalawanPayDeposit(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,171 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { useCreateAiOPalawanPayDepositMutation } from '../../../../client/hooks/useAiOPalawanPayDepositMutation.js';
10
+ import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.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 { getQueryClient } from '../../../../utils/getQueryClient.js';
27
+ import { parseDecimal } from '../../../../utils/parseDecimal.js';
28
+ import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
29
+ import { AmountChoices } from '../../AmountChoices.js';
30
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
31
+ import { explainError } from '../../utils.js';
32
+ import { AvailablePromos } from '../AvailablePromos.js';
33
+ export function AiOPalawanPayDeposit() {
34
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
35
+ const disclosure = useDisclosure();
36
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
37
+ depositWithdrawal: ctx.depositWithdrawal,
38
+ kycVerificationStatus: ctx.kycVerificationStatus,
39
+ })));
40
+ const verificationQuery = useMemberVerificationQuery();
41
+ const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
42
+ const [status, setStatus] = useState('waiting');
43
+ const createDepositMutation = useCreateAiOPalawanPayDepositMutation({
44
+ onMutate() {
45
+ disclosure.setOpen(true);
46
+ setStatus('processing');
47
+ },
48
+ onSuccess(data) {
49
+ const queryClient = getQueryClient();
50
+ invariant(data.checkoutUrl);
51
+ window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
52
+ queryClient.invalidateQueries({ queryKey: getDepositsCountQueryKey() });
53
+ setStatus('success');
54
+ },
55
+ onError() {
56
+ setStatus('failed');
57
+ },
58
+ });
59
+ const depositsCountQuery = useDepositsCountQuery();
60
+ const depositsCount = depositsCountQuery.data ?? 0;
61
+ const paymentSettingsQuery = usePaymentSettingsQuery();
62
+ const paymentSettings = paymentSettingsQuery.data;
63
+ const gatewaySettings = paymentSettings?.aioPalawanPayDepositGatewaySettings;
64
+ const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
65
+ const minimumAmount = depositsCount <= 0
66
+ ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
67
+ : parseDecimal(gatewaySettings?.minimumAmount, 0);
68
+ const promosQuery = useAvailablePromosQuery();
69
+ const promos = promosQuery.data ?? [];
70
+ const definition = z
71
+ .object({
72
+ amount: z.string().superRefine((val, ctx) => {
73
+ const n = parseDecimal(val, 0);
74
+ if (n < minimumAmount) {
75
+ ctx.addIssue({
76
+ type: 'number',
77
+ code: z.ZodIssueCode.too_small,
78
+ inclusive: true,
79
+ minimum: minimumAmount,
80
+ message: `Minimum amount is ${minimumAmount.toLocaleString()}`,
81
+ });
82
+ }
83
+ if (n > maximumAmount) {
84
+ ctx.addIssue({
85
+ type: 'number',
86
+ code: z.ZodIssueCode.too_big,
87
+ inclusive: true,
88
+ maximum: maximumAmount,
89
+ message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
90
+ });
91
+ }
92
+ }),
93
+ promo: z.string().optional().nullable(),
94
+ })
95
+ .superRefine((value, ctx) => {
96
+ const promo = promos.find((o) => o.id === value.promo);
97
+ const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
98
+ const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
99
+ const amount = parseDecimal(value.amount, 0);
100
+ if (promo && amount < promoMinAmount) {
101
+ ctx.addIssue({
102
+ path: ['amount'],
103
+ code: z.ZodIssueCode.custom,
104
+ message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
105
+ });
106
+ }
107
+ if (promo && amount > promoMaxAmount) {
108
+ ctx.addIssue({
109
+ path: ['amount'],
110
+ code: z.ZodIssueCode.custom,
111
+ message: `Maximum amount for this promo is ${promoMaxAmount}`,
112
+ });
113
+ }
114
+ });
115
+ const form = useForm({
116
+ mode: 'all',
117
+ resolver: zodResolver(definition),
118
+ defaultValues: {
119
+ amount: '0',
120
+ promo: globalStore.depositWithdrawal.promo ?? null,
121
+ },
122
+ });
123
+ useEffect(() => {
124
+ if (minimumAmount) {
125
+ form.reset({
126
+ amount: minimumAmount.toString(),
127
+ promo: form.getValues('promo') ?? null,
128
+ });
129
+ }
130
+ }, [form, minimumAmount]);
131
+ return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
132
+ if (verificationStatus === 'PENDING' ||
133
+ verificationStatus === 'UNVERIFIED' ||
134
+ verificationStatus === 'REJECTED' ||
135
+ verificationStatus === 'CREATED') {
136
+ globalStore.kycVerificationStatus.setOpen(true);
137
+ return;
138
+ }
139
+ else {
140
+ createDepositMutation.reset();
141
+ createDepositMutation.mutate({
142
+ amount: data.amount.toString(),
143
+ promo: data.promo ?? undefined,
144
+ redirectUrl: window.location.origin.includes('localhost')
145
+ ? 'https://uat.powerplay.ph'
146
+ : window.location.origin,
147
+ });
148
+ }
149
+ }), 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) => {
150
+ o.field.onChange(details.value);
151
+ }, 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) => {
152
+ form.setValue('amount', value.toString(), {
153
+ shouldTouch: true,
154
+ shouldDirty: true,
155
+ shouldValidate: true,
156
+ });
157
+ }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
158
+ o.field.onChange(value);
159
+ globalStore.depositWithdrawal.setPromo(null);
160
+ }, 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) => {
161
+ disclosure.setOpen(details.open);
162
+ if (!details.open) {
163
+ setStatus('waiting');
164
+ form.reset();
165
+ }
166
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, 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' &&
167
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' && (_jsxs(_Fragment, { children: ["Your deposit has been successfully processed. ", _jsx("br", {}), " If you are not redirected automatically, click", ' ', !!createDepositMutation.data?.checkoutUrl && (_jsx("a", { href: createDepositMutation.data?.checkoutUrl, target: "_blank", rel: "noopener noreferrer", className: "text-text-brand underline underline-offset-2", children: "here" })), "."] })), status === 'failed' &&
168
+ explainError(createDepositMutation?.error?.name)] })] }), (status === 'failed' || status === 'success') && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
169
+ api.setOpen(false);
170
+ }, children: status === 'failed' ? 'Try Again' : 'Ok' })) }) }))] }) })] }) })] }));
171
+ }
@@ -0,0 +1 @@
1
+ export declare function AiOPayMayaDeposit(): import("react/jsx-runtime").JSX.Element;