@opexa/portal-components 0.0.922 → 0.0.924

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 (163) hide show
  1. package/dist/client/hooks/useUpdateMobileNumber.js +1 -1
  2. package/dist/components/AccountInfo/AccountInfo.js +1 -1
  3. package/dist/components/AccountSecurity/AccountSecurity.js +1 -1
  4. package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.d.ts +1 -1
  5. package/dist/components/DepositWithdrawal/Deposit/AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js +5 -3
  6. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js +2 -21
  7. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.d.ts +1 -0
  8. package/dist/components/DepositWithdrawal/Deposit/AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.js +260 -0
  9. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/AurixPayQRPHDepositContext.d.ts +2 -2
  10. package/dist/components/DepositWithdrawal/Deposit/AurixPayQRPHDeposit/useAurixPayQRPHDeposit.d.ts +1 -1
  11. package/dist/components/DepositWithdrawal/Deposit/Deposit.js +2 -2
  12. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  13. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  14. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  15. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  16. package/dist/components/KYC/KYCDefault/KYCDefault.d.ts +1 -0
  17. package/dist/components/KYC/KYCDefault/KYCDefault.js +7 -1
  18. package/dist/components/SingleSignOn/SingleSignOn.d.ts +1 -1
  19. package/dist/components/SingleSignOn/SingleSignOn.js +15 -7
  20. package/dist/components/UpdateMobileNumber/UpdateMobileNumber.js +9 -4
  21. package/dist/ui/Carousel/Carousel.d.ts +99 -99
  22. package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
  23. package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
  24. package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
  25. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  26. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  27. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  28. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  29. package/dist/ui/Menu/Menu.d.ts +90 -90
  30. package/dist/ui/Menu/menu.recipe.d.ts +5 -5
  31. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  32. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  33. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  34. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  35. package/dist/ui/Select/Select.d.ts +45 -45
  36. package/dist/ui/Select/select.recipe.d.ts +3 -3
  37. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  38. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  39. package/package.json +1 -1
  40. package/dist/assets/providers/alize.png +0 -0
  41. package/dist/assets/providers/bigtime-gaming.png +0 -0
  42. package/dist/assets/providers/bng.png +0 -0
  43. package/dist/assets/providers/boongo.png +0 -0
  44. package/dist/assets/providers/btg.png +0 -0
  45. package/dist/assets/providers/cq9.png +0 -0
  46. package/dist/assets/providers/darwin.png +0 -0
  47. package/dist/assets/providers/digitain.png +0 -0
  48. package/dist/assets/providers/evolution.png +0 -0
  49. package/dist/assets/providers/fantasma-games.png +0 -0
  50. package/dist/assets/providers/fc.png +0 -0
  51. package/dist/assets/providers/fp.png +0 -0
  52. package/dist/assets/providers/habanero.png +0 -0
  53. package/dist/assets/providers/hacksaw.png +0 -0
  54. package/dist/assets/providers/jdb.png +0 -0
  55. package/dist/assets/providers/jili.png +0 -0
  56. package/dist/assets/providers/leap.png +0 -0
  57. package/dist/assets/providers/live-22-metaverse.png +0 -0
  58. package/dist/assets/providers/netent.png +0 -0
  59. package/dist/assets/providers/no-limit.png +0 -0
  60. package/dist/assets/providers/pg.png +0 -0
  61. package/dist/assets/providers/pgsoft.png +0 -0
  62. package/dist/assets/providers/pragmatic-play.png +0 -0
  63. package/dist/assets/providers/realtime-gaming.png +0 -0
  64. package/dist/assets/providers/redtiger.png +0 -0
  65. package/dist/assets/providers/rtg.png +0 -0
  66. package/dist/assets/providers/sagaming.png +0 -0
  67. package/dist/client/hooks/useAiOGCashDepositMutation.d.ts +0 -4
  68. package/dist/client/hooks/useAiOGCashDepositMutation.js +0 -90
  69. package/dist/client/hooks/useAiOGrabPayDepositMutation.d.ts +0 -4
  70. package/dist/client/hooks/useAiOGrabPayDepositMutation.js +0 -80
  71. package/dist/client/hooks/useAiOPalawanPayDepositMutation.d.ts +0 -4
  72. package/dist/client/hooks/useAiOPalawanPayDepositMutation.js +0 -80
  73. package/dist/client/hooks/useAiOPayMayaDepositMutation.d.ts +0 -4
  74. package/dist/client/hooks/useAiOPayMayaDepositMutation.js +0 -80
  75. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.d.ts +0 -1
  76. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositAlert.js +0 -99
  77. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.d.ts +0 -1
  78. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositDetails.js +0 -17
  79. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.d.ts +0 -1
  80. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +0 -116
  81. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHQRCode.d.ts +0 -3
  82. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHQRCode.js +0 -69
  83. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDeposit.d.ts +0 -1
  84. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDeposit.js +0 -10
  85. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositAlert.d.ts +0 -1
  86. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositAlert.js +0 -99
  87. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.d.ts +0 -25
  88. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositContext.js +0 -2
  89. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositDetails.d.ts +0 -1
  90. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositDetails.js +0 -17
  91. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositForm.d.ts +0 -1
  92. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHDepositForm.js +0 -116
  93. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHQRCode.d.ts +0 -3
  94. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/QRPHQRCode.js +0 -69
  95. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.d.ts +0 -13
  96. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit__legacy/useQRPHDeposit.js +0 -85
  97. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.d.ts +0 -1
  98. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGCashDeposit/AiOGCashDeposit.js +0 -173
  99. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.d.ts +0 -1
  100. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOGrabPayDeposit/AiOGrabPayDeposit.js +0 -171
  101. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.d.ts +0 -1
  102. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPalawanPayDeposit/AiOPalawanPayDeposit.js +0 -171
  103. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.d.ts +0 -1
  104. package/dist/components/DepositWithdrawal/Deposit__legacy/AiOPayMayaDeposit/AiOPayMayaDeposit.js +0 -171
  105. package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.d.ts +0 -8
  106. package/dist/components/DepositWithdrawal/Deposit__legacy/AvailablePromos.js +0 -33
  107. package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.d.ts +0 -1
  108. package/dist/components/DepositWithdrawal/Deposit__legacy/Deposit.js +0 -120
  109. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.d.ts +0 -1
  110. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashDeposit/GCashDeposit.js +0 -163
  111. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.d.ts +0 -1
  112. package/dist/components/DepositWithdrawal/Deposit__legacy/GCashWebpayDeposit/GCashWebpayDeposit.js +0 -165
  113. package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.d.ts +0 -1
  114. package/dist/components/DepositWithdrawal/Deposit__legacy/LibanganDeposit/LibanganDeposit.js +0 -186
  115. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.d.ts +0 -1
  116. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaAppDeposit/MayaAppDeposit.js +0 -157
  117. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.d.ts +0 -1
  118. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaDeposit/MayaDeposit.js +0 -163
  119. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.d.ts +0 -1
  120. package/dist/components/DepositWithdrawal/Deposit__legacy/MayaWebpayDeposit/MayaWebpayDeposit.js +0 -166
  121. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.d.ts +0 -1
  122. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDeposit.js +0 -10
  123. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.d.ts +0 -1
  124. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositAlert.js +0 -99
  125. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.d.ts +0 -25
  126. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositContext.js +0 -2
  127. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.d.ts +0 -1
  128. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositDetails.js +0 -19
  129. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.d.ts +0 -1
  130. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/OnlineBankDepositForm.js +0 -115
  131. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.d.ts +0 -13
  132. package/dist/components/DepositWithdrawal/Deposit__legacy/OnlineBankDeposit/useOnlineBankDeposit.js +0 -81
  133. package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.d.ts +0 -1
  134. package/dist/components/DepositWithdrawal/Deposit__legacy/PisoPayDeposit/PisoPayDeposit.js +0 -180
  135. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.d.ts +0 -1
  136. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDeposit.js +0 -10
  137. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.d.ts +0 -1
  138. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositAlert.js +0 -99
  139. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.d.ts +0 -25
  140. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositContext.js +0 -2
  141. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.d.ts +0 -1
  142. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositDetails.js +0 -17
  143. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.d.ts +0 -1
  144. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHDepositForm.js +0 -116
  145. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.d.ts +0 -3
  146. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/QRPHQRCode.js +0 -69
  147. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.d.ts +0 -13
  148. package/dist/components/DepositWithdrawal/Deposit__legacy/QRPHDeposit/useQRPHDeposit.js +0 -85
  149. package/dist/components/KYC/KYCDefault/BasicInformation.d.ts +0 -1
  150. package/dist/components/KYC/KYCDefault/BasicInformation.js +0 -101
  151. package/dist/components/KYC/KYCVerificationStatus.d.ts +0 -1
  152. package/dist/components/KYC/KYCVerificationStatus.js +0 -10
  153. package/dist/components/KYC/KYCVerificationStatus.lazy.d.ts +0 -1
  154. package/dist/components/KYC/KYCVerificationStatus.lazy.js +0 -33
  155. package/dist/components/KYCNotRequired/KYCNotRequired.d.ts +0 -0
  156. package/dist/components/KYCNotRequired/KYCNotRequired.js +0 -1
  157. package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
  158. package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
  159. package/dist/components/Quests/MultiWageringQuest.d.ts +0 -1
  160. package/dist/components/Quests/MultiWageringQuest.js +0 -111
  161. package/dist/images/game-providers/ALPHACHINKO.png +0 -0
  162. package/dist/utils/getLocaleInfo.d.ts +0 -79
  163. package/dist/utils/getLocaleInfo.js +0 -175
@@ -10,7 +10,7 @@ export const useUpdateMobileNumber = (config) => {
10
10
  mutationFn: async (input) => {
11
11
  const session = await getSession();
12
12
  invariant(session.status === 'authenticated');
13
- await updateMobileNumber(input.verificationCode, input.mobileNumber, {
13
+ await updateMobileNumber(input.mobileNumber, input.verificationCode, {
14
14
  headers: {
15
15
  Authorization: `Bearer ${session.token}`,
16
16
  },
@@ -316,5 +316,5 @@ function UnlinkGoogleAccount() {
316
316
  }, children: "Disconnect" })] })) })] }) })] })] }));
317
317
  }
318
318
  function AlertWarning({ title, className, }) {
319
- return (_jsxs("div", { className: twMerge('flex items-center gap-2 rounded-xl border border-border-secondary bg-bg-primary-alt p-xl', className), children: [_jsx(Image, { src: AlertCircleIconImage, alt: "Alert", className: "w-10 object-contain", draggable: false }), _jsx("p", { className: "font-semibold text-sm text-text-tertiary-600", children: title })] }));
319
+ return (_jsxs("div", { className: twMerge('flex items-center gap-2 rounded-xl border border-border-secondary bg-bg-primary-alt p-xl', className), children: [_jsx(Image, { src: AlertCircleIconImage, alt: "Alert", className: "w-10 object-contain", draggable: false, width: 40, height: 40 }), _jsx("p", { className: "font-semibold text-sm text-text-tertiary-600", children: title })] }));
320
320
  }
@@ -167,7 +167,7 @@ function TransactionPassword() {
167
167
  }), children: [_jsxs("div", { className: "px-xl py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.confirmPassword, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Confirm Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...form.register('confirmPassword') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.confirmPassword?.message })] })] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
168
168
  }
169
169
  function AlertWarning({ title, className, }) {
170
- return (_jsxs("div", { className: twMerge('flex items-center gap-2 rounded-xl border border-border-secondary bg-bg-primary-alt p-xl', className), children: [_jsx(Image, { src: AlertCircleIconImage, alt: "Alert", className: "w-10 object-contain", draggable: false }), _jsx("p", { className: "font-semibold text-sm text-text-tertiary-600", children: title })] }));
170
+ return (_jsxs("div", { className: twMerge('flex items-center gap-2 rounded-xl border border-border-secondary bg-bg-primary-alt p-xl', className), children: [_jsx(Image, { src: AlertCircleIconImage, alt: "Alert", className: "w-10 object-contain", draggable: false, width: 40, height: 40 }), _jsx("p", { className: "font-semibold text-sm text-text-tertiary-600", children: title })] }));
171
171
  }
172
172
  const secretQuestionCollection = createListCollection({
173
173
  items: SECRET_QUESTIONS,
@@ -1 +1 @@
1
- export declare function AurixPayPayMayaDeposit(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function AurixPayGrabPayDeposit(): import("react/jsx-runtime").JSX.Element;
@@ -9,7 +9,7 @@ import { useBoolean } from 'usehooks-ts';
9
9
  import { z } from 'zod';
10
10
  import { useShallow } from 'zustand/shallow';
11
11
  import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
12
- import { useCreateAurixPayPayMayaDepositMutation } from '../../../../client/hooks/useCreateAurixPayPayMayaDepositMutation.js';
12
+ import { useCreateAurixPayGrabPayDepositMutation } from '../../../../client/hooks/useCreateAurixPayGrabPayDepositMutation.js';
13
13
  import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
14
14
  import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
15
15
  import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
@@ -34,7 +34,7 @@ import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
34
34
  import { AmountChoices } from '../../AmountChoices.js';
35
35
  import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
36
36
  import { AvailablePromos } from '../AvailablePromos.js';
37
- export function AurixPayPayMayaDeposit() {
37
+ export function AurixPayGrabPayDeposit() {
38
38
  const depositWithdrawalProps = useDepositWithdrawalPropsContext();
39
39
  const disclosure = useDisclosure({
40
40
  onOpenChange(open) {
@@ -51,7 +51,7 @@ export function AurixPayPayMayaDeposit() {
51
51
  const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
52
52
  const [status, setStatus] = useState('waiting');
53
53
  const [errorMessage, setErrorMessage] = useState(null);
54
- const createDepositMutation = useCreateAurixPayPayMayaDepositMutation({
54
+ const createDepositMutation = useCreateAurixPayGrabPayDepositMutation({
55
55
  onMutate() {
56
56
  disclosure.setOpen(true);
57
57
  setStatus('processing');
@@ -97,7 +97,9 @@ export function AurixPayPayMayaDeposit() {
97
97
  const depositsCount = depositsCountQuery.data ?? 0;
98
98
  const paymentSettingsQuery = usePaymentSettingsQuery();
99
99
  const paymentSettings = paymentSettingsQuery.data;
100
+ console.log({ paymentSettings });
100
101
  const gatewaySettings = paymentSettings?.aurixPayGrabPayDepositGatewaySettings;
102
+ console.log({ gatewaySettings });
101
103
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
102
104
  const minimumAmount = depositsCount <= 0
103
105
  ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
@@ -97,7 +97,7 @@ export function AurixPayGrabPayDeposit() {
97
97
  const depositsCount = depositsCountQuery.data ?? 0;
98
98
  const paymentSettingsQuery = usePaymentSettingsQuery();
99
99
  const paymentSettings = paymentSettingsQuery.data;
100
- const gatewaySettings = paymentSettings?.aurixPayGrabPayDepositGatewaySettings;
100
+ const gatewaySettings = paymentSettings?.aioGCashDepositGatewaySettings;
101
101
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
102
102
  const minimumAmount = depositsCount <= 0
103
103
  ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
@@ -200,26 +200,7 @@ export function AurixPayGrabPayDeposit() {
200
200
  accountNumber: data.accountNumber,
201
201
  });
202
202
  }
203
- }), noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, children: [_jsx(Field.Label, { children: "Account number" }), _jsx(Field.Input, { ...form.register('accountNumber', {
204
- onChange: (e) => {
205
- // Allow only digits and leading +
206
- let value = e.target.value;
207
- // Remove all non-digit except leading +
208
- value = value.replace(/(?!^)\D/g, '');
209
- if (value.startsWith('+')) {
210
- // keep leading +
211
- value = '+' + value.slice(1).replace(/\D/g, '');
212
- }
213
- else {
214
- // remove all non-digits
215
- value = value.replace(/\D/g, '');
216
- }
217
- e.target.value = value;
218
- form.setValue('accountNumber', value, {
219
- shouldValidate: true,
220
- });
221
- },
222
- }), inputMode: "tel", pattern: "^\\+?[0-9]*$", autoComplete: "tel" }), _jsx(Field.ErrorText, { children: form.formState.errors.accountNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-lg", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
203
+ }), noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, children: [_jsx(Field.Label, { children: "Account number" }), _jsx(Field.Input, { ...form.register('accountNumber') }), _jsx(Field.ErrorText, { children: form.formState.errors.accountNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-lg", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
223
204
  o.field.onChange(details.value);
224
205
  }, 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) => {
225
206
  form.setValue('amount', value.toString(), {
@@ -0,0 +1 @@
1
+ export declare function AurixPayPayMayaDeposit(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,260 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { zodResolver } from '@hookform/resolvers/zod';
3
+ import { ObjectId } from '@opexa/object-id';
4
+ import Link from 'next/link';
5
+ import { useEffect, useState } from 'react';
6
+ import { Controller, useForm } from 'react-hook-form';
7
+ import invariant from 'tiny-invariant';
8
+ import { useBoolean } from 'usehooks-ts';
9
+ import { z } from 'zod';
10
+ import { useShallow } from 'zustand/shallow';
11
+ import { useAvailablePromosQuery } from '../../../../client/hooks/useAvailablePromosQuery.js';
12
+ import { useCreateAurixPayPayMayaDepositMutation } from '../../../../client/hooks/useCreateAurixPayPayMayaDepositMutation.js';
13
+ import { useDepositQuery } from '../../../../client/hooks/useDepositQuery.js';
14
+ import { useDepositsCountQuery } from '../../../../client/hooks/useDepositsCountQuery.js';
15
+ import { useDisclosure } from '../../../../client/hooks/useDisclosure.js';
16
+ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
17
+ import { useMemberVerificationQuery } from '../../../../client/hooks/useMemberVerificationQuery.js';
18
+ import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
19
+ import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
20
+ import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
21
+ import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
22
+ import { RefreshCcw01Icon } from '../../../../icons/RefreshCcw01Icon.js';
23
+ import { SpinnerIcon } from '../../../../icons/SpinnerIcon.js';
24
+ import { XIcon } from '../../../../icons/XIcon.js';
25
+ import { ObjectType } from '../../../../services/ObjectType.js';
26
+ import { AlertDialog } from '../../../../ui/AlertDialog/index.js';
27
+ import { Button } from '../../../../ui/Button/index.js';
28
+ import { Field } from '../../../../ui/Field/index.js';
29
+ import { NumberInput } from '../../../../ui/NumberInput/index.js';
30
+ import { Portal } from '../../../../ui/Portal/index.js';
31
+ import { getQueryClient } from '../../../../utils/getQueryClient.js';
32
+ import { parseDecimal } from '../../../../utils/parseDecimal.js';
33
+ import { getDepositsCountQueryKey } from '../../../../utils/queryKeys.js';
34
+ import { AmountChoices } from '../../AmountChoices.js';
35
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
36
+ import { AvailablePromos } from '../AvailablePromos.js';
37
+ export function AurixPayPayMayaDeposit() {
38
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
39
+ const disclosure = useDisclosure({
40
+ onOpenChange(open) {
41
+ if (!open) {
42
+ form.reset();
43
+ }
44
+ },
45
+ });
46
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
47
+ depositWithdrawal: ctx.depositWithdrawal,
48
+ kycVerificationStatus: ctx.kycVerificationStatus,
49
+ })));
50
+ const verificationQuery = useMemberVerificationQuery();
51
+ const verificationStatus = verificationQuery.data?.status ?? 'UNVERIFIED';
52
+ const [status, setStatus] = useState('waiting');
53
+ const [errorMessage, setErrorMessage] = useState(null);
54
+ const createDepositMutation = useCreateAurixPayPayMayaDepositMutation({
55
+ onMutate() {
56
+ disclosure.setOpen(true);
57
+ setStatus('processing');
58
+ },
59
+ onSuccess(data) {
60
+ const queryClient = getQueryClient();
61
+ invariant(data.checkoutUrl);
62
+ window.open(data.checkoutUrl, '_blank', 'noopener,noreferrer');
63
+ queryClient.invalidateQueries({
64
+ queryKey: getDepositsCountQueryKey(),
65
+ });
66
+ setStatus('success');
67
+ },
68
+ onError(data) {
69
+ setStatus('failed');
70
+ setErrorMessage({
71
+ name: data.name,
72
+ message: data.message,
73
+ });
74
+ },
75
+ });
76
+ const warn = useBoolean();
77
+ const depositQuery = useDepositQuery(createDepositMutation.data?.id, {
78
+ enabled: !warn.value && status === 'success',
79
+ refetchInterval: (ctx) => ctx.state.data?.status === 'CONFIRMED' ||
80
+ ctx.state.data?.status === 'REJECTED' ||
81
+ ctx.state.data?.status === 'CANCELLED'
82
+ ? false
83
+ : 1000,
84
+ });
85
+ useEffect(() => {
86
+ if (depositQuery.data?.status === 'CONFIRMED') {
87
+ setStatus('confirmed');
88
+ return;
89
+ }
90
+ if (depositQuery.data?.status === 'REJECTED' ||
91
+ depositQuery.data?.status === 'CANCELLED') {
92
+ setStatus('failed');
93
+ return;
94
+ }
95
+ }, [depositQuery.data?.status]);
96
+ const depositsCountQuery = useDepositsCountQuery();
97
+ const depositsCount = depositsCountQuery.data ?? 0;
98
+ const paymentSettingsQuery = usePaymentSettingsQuery();
99
+ const paymentSettings = paymentSettingsQuery.data;
100
+ const gatewaySettings = paymentSettings?.aurixPayPayMayaDepositGatewaySettings;
101
+ const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
102
+ const minimumAmount = depositsCount <= 0
103
+ ? parseDecimal(paymentSettingsQuery.data?.minimumFirstDepositAmount, 0)
104
+ : parseDecimal(gatewaySettings?.minimumAmount, 0);
105
+ const promosQuery = useAvailablePromosQuery();
106
+ const promos = promosQuery.data ?? [];
107
+ const definition = z
108
+ .object({
109
+ amount: z.string().superRefine((val, ctx) => {
110
+ const n = parseDecimal(val, 0);
111
+ if (n < minimumAmount) {
112
+ ctx.addIssue({
113
+ type: 'number',
114
+ code: z.ZodIssueCode.too_small,
115
+ inclusive: true,
116
+ minimum: minimumAmount,
117
+ message: `Please enter ${minimumAmount.toLocaleString()} or more to proceed with your deposit.`,
118
+ });
119
+ }
120
+ if (n > maximumAmount) {
121
+ ctx.addIssue({
122
+ type: 'number',
123
+ code: z.ZodIssueCode.too_big,
124
+ inclusive: true,
125
+ maximum: maximumAmount,
126
+ message: `Maximum amount is ${maximumAmount.toLocaleString()}`,
127
+ });
128
+ }
129
+ }),
130
+ promo: z.string().optional().nullable(),
131
+ accountNumber: z
132
+ .string()
133
+ .min(1, 'Account number is required')
134
+ .min(8, 'Account number must be 8 or more characters')
135
+ .max(32, 'Account number must not be more than 32 characters'),
136
+ })
137
+ .superRefine((value, ctx) => {
138
+ const promo = promos.find((o) => o.id === value.promo);
139
+ const promoMinAmount = parseDecimal(promo?.minimumDepositAmount, 0);
140
+ const promoMaxAmount = parseDecimal(promo?.maximumDepositAmount, 0);
141
+ const amount = parseDecimal(value.amount, 0);
142
+ if (promo && amount < promoMinAmount) {
143
+ ctx.addIssue({
144
+ path: ['amount'],
145
+ code: z.ZodIssueCode.custom,
146
+ message: `Minimum amount for this promo is ${promoMinAmount.toLocaleString()}`,
147
+ });
148
+ }
149
+ if (promo && amount > promoMaxAmount) {
150
+ ctx.addIssue({
151
+ path: ['amount'],
152
+ code: z.ZodIssueCode.custom,
153
+ message: `Maximum amount for this promo is ${promoMaxAmount}`,
154
+ });
155
+ }
156
+ });
157
+ const form = useForm({
158
+ mode: 'all',
159
+ resolver: zodResolver(definition),
160
+ defaultValues: {
161
+ amount: '0',
162
+ promo: globalStore.depositWithdrawal.promo ?? null,
163
+ accountNumber: '',
164
+ },
165
+ });
166
+ useEffect(() => {
167
+ if (minimumAmount) {
168
+ form.reset({
169
+ amount: minimumAmount.toString(),
170
+ promo: form.getValues('promo') ?? null,
171
+ accountNumber: form.getValues('accountNumber') ?? '',
172
+ });
173
+ }
174
+ }, [form, minimumAmount]);
175
+ const redirectUrl = (() => {
176
+ const path = depositWithdrawalProps.depositSuccessPageUrl ?? '/deposits/:id/status';
177
+ const origin = window.location.origin.includes('localhost')
178
+ ? 'https://uat.powerplay.ph' +
179
+ depositWithdrawalProps.depositSuccessPageUrl
180
+ : window.location.origin;
181
+ return `${origin}${path}`;
182
+ })();
183
+ return (_jsxs("form", { onSubmit: form.handleSubmit(async (data) => {
184
+ if (!depositWithdrawalProps.bypassDepositKycCheck &&
185
+ (verificationStatus === 'PENDING' ||
186
+ verificationStatus === 'UNVERIFIED' ||
187
+ verificationStatus === 'REJECTED' ||
188
+ verificationStatus === 'CREATED')) {
189
+ globalStore.kycVerificationStatus.setOpen(true);
190
+ return;
191
+ }
192
+ else {
193
+ const id = ObjectId.generate(ObjectType.Deposit).toString();
194
+ createDepositMutation.reset();
195
+ createDepositMutation.mutate({
196
+ id,
197
+ amount: data.amount.toString(),
198
+ promo: data.promo ?? undefined,
199
+ redirectUrl: redirectUrl.replace(':id', id),
200
+ accountNumber: data.accountNumber,
201
+ });
202
+ }
203
+ }), noValidate: true, children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.accountNumber, children: [_jsx(Field.Label, { children: "Account number" }), _jsx(Field.Input, { ...form.register('accountNumber', {
204
+ onChange: (e) => {
205
+ // Allow only digits and leading +
206
+ let value = e.target.value;
207
+ // Remove all non-digit except leading +
208
+ value = value.replace(/(?!^)\D/g, '');
209
+ if (value.startsWith('+')) {
210
+ // keep leading +
211
+ value = '+' + value.slice(1).replace(/\D/g, '');
212
+ }
213
+ else {
214
+ // remove all non-digits
215
+ value = value.replace(/\D/g, '');
216
+ }
217
+ e.target.value = value;
218
+ form.setValue('accountNumber', value, {
219
+ shouldValidate: true,
220
+ });
221
+ },
222
+ }), inputMode: "tel", pattern: "^\\+?[0-9]*$", autoComplete: "tel" }), _jsx(Field.ErrorText, { children: form.formState.errors.accountNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-lg", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
223
+ o.field.onChange(details.value);
224
+ }, 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) => {
225
+ form.setValue('amount', value.toString(), {
226
+ shouldTouch: true,
227
+ shouldDirty: true,
228
+ shouldValidate: true,
229
+ });
230
+ }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
231
+ o.field.onChange(value);
232
+ globalStore.depositWithdrawal.setPromo(null);
233
+ }, 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) => {
234
+ disclosure.setOpen(details.open);
235
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: () => {
236
+ setStatus('waiting');
237
+ setErrorMessage(null);
238
+ form.reset();
239
+ warn.setFalse();
240
+ }, 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.Context, { children: (api) => (_jsx("button", { type: "button", className: "absolute top-2.5 right-2.5 flex icon:size-6 size-11 items-center justify-center text-text-quinary", onClick: () => {
241
+ if (status === 'success' && !warn.value) {
242
+ warn.setTrue();
243
+ }
244
+ else {
245
+ api.setOpen(false);
246
+ }
247
+ }, children: _jsx(XIcon, {}) })) }), _jsxs(AlertDialog.Header, { children: [status === 'processing' && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === 'success' && !warn.value && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary text-text-featured-icon-light-brand", children: _jsx(RefreshCcw01Icon, {}) })), status === 'success' && warn.value && (_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, {}) })), status === 'confirmed' && (_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' &&
248
+ !warn.value &&
249
+ 'Didn’t see the payment window?', status === 'success' && warn.value && (_jsx(_Fragment, { children: "Are you sure you want to close this\u00A0window?" })), status === 'confirmed' && 'Deposit Successful', status === 'failed' && errorMessage?.name] }), _jsxs(AlertDialog.Description, { children: [status === 'processing' &&
250
+ "We're verifying your account and amount. Please hold a moment.", status === 'success' &&
251
+ !warn.value &&
252
+ 'Sometimes the payment pop up doesn’t appear right away. Don’t worry, just click the button below to reopen it and continue your deposit.', status === 'success' &&
253
+ warn.value &&
254
+ 'Closing this window might cancel your current deposit. Do you want to continue?', status === 'confirmed' &&
255
+ 'Your deposit has been successfully processed.', status === 'failed' && errorMessage?.message] })] }), (status === 'failed' ||
256
+ status === 'success' ||
257
+ status === 'confirmed') && (_jsxs(AlertDialog.Footer, { children: [status === 'success' && !warn.value && (_jsx(Button, { asChild: true, children: _jsx("a", { href: createDepositMutation.data?.checkoutUrl ?? '', target: "_blank", rel: "noopener noreferrer", children: "Try Again" }) })), status === 'success' && warn.value && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => {
258
+ warn.setFalse();
259
+ }, children: "Go back" }), _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => api.setOpen(false), children: "Continue" })) })] })), status !== 'success' && (_jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => api.setOpen(false), children: "Ok" })) }))] }))] }) })] }) })] }));
260
+ }
@@ -1,6 +1,6 @@
1
1
  export declare const AurixPayQRPHDepositContext: (props: {
2
2
  value: {
3
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
3
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
4
4
  deposit: import("../../../../types").Deposit | null;
5
5
  errorMessage: {
6
6
  name: string;
@@ -13,7 +13,7 @@ export declare const AurixPayQRPHDepositContext: (props: {
13
13
  } & {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useAurixPayQRPHDepositContext: () => {
16
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
16
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
17
17
  deposit: import("../../../../types").Deposit | null;
18
18
  errorMessage: {
19
19
  name: string;
@@ -5,7 +5,7 @@ export interface GenerateQRCodeInput {
5
5
  promo?: string | null;
6
6
  }
7
7
  export declare function useAurixPayQRPHDeposit(): {
8
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
8
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
9
9
  deposit: Deposit | null;
10
10
  errorMessage: {
11
11
  name: string;
@@ -53,10 +53,10 @@ export function Deposit() {
53
53
  gcash: lazy(() => import('./AurixPayGCashDeposit/AurixPayGCashDeposit.js').then((m) => ({
54
54
  default: m.AurixPayGCashDeposit,
55
55
  }))),
56
- payMaya: lazy(() => import('./AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js').then((m) => ({
56
+ payMaya: lazy(() => import('./AurixPayPayMayaDeposit/AurixPayPayMayaDeposit.js').then((m) => ({
57
57
  default: m.AurixPayPayMayaDeposit,
58
58
  }))),
59
- grabPay: lazy(() => import('./AurixPayPayMayaDeposit/AurixPayGrabPayDeposit.js').then((m) => ({
59
+ grabPay: lazy(() => import('./AurixPayGrabPayDeposit/AurixPayGrabPayDeposit.js').then((m) => ({
60
60
  default: m.AurixPayGrabPayDeposit,
61
61
  }))),
62
62
  qrph: lazy(() => import('./AurixPayQRPHDeposit/AurixPayQRPHDeposit.js').then((m) => ({
@@ -1,7 +1,7 @@
1
1
  export declare const OnlineBankDepositContext: (props: {
2
2
  value: {
3
3
  view: "form" | "vca";
4
- status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
5
  verify: () => void;
6
6
  reset: () => void;
7
7
  deposit: import("../../../../types").Deposit | null;
@@ -14,7 +14,7 @@ export declare const OnlineBankDepositContext: (props: {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useOnlineBankDepositContext: () => {
16
16
  view: "form" | "vca";
17
- status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
17
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
18
18
  verify: () => void;
19
19
  reset: () => void;
20
20
  deposit: import("../../../../types").Deposit | null;
@@ -2,7 +2,7 @@ import type { Deposit } from '../../../../types';
2
2
  export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
3
3
  export declare function useOnlineBankDeposit(): {
4
4
  view: "form" | "vca";
5
- status: "waiting" | "failed" | "processing" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
8
8
  deposit: Deposit | null;
@@ -1,6 +1,6 @@
1
1
  export declare const QRPHDepositContext: (props: {
2
2
  value: {
3
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
3
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
4
4
  deposit: import("../../../../types").Deposit | null;
5
5
  errorMessage: {
6
6
  name: string;
@@ -13,7 +13,7 @@ export declare const QRPHDepositContext: (props: {
13
13
  } & {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useQRPHDepositContext: () => {
16
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
16
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
17
17
  deposit: import("../../../../types").Deposit | null;
18
18
  errorMessage: {
19
19
  name: string;
@@ -5,7 +5,7 @@ export interface GenerateQRCodeInput {
5
5
  promo?: string | null;
6
6
  }
7
7
  export declare function useQRPHDeposit(): {
8
- status: "idle" | "generating-qr-code" | "qr-code-generated" | "failed" | "confirmed";
8
+ status: "idle" | "confirmed" | "failed" | "generating-qr-code" | "qr-code-generated";
9
9
  deposit: Deposit | null;
10
10
  errorMessage: {
11
11
  name: string;
@@ -4,5 +4,6 @@ export interface KYCDefaultProps extends KYCReminderProps {
4
4
  provider?: 'opexa';
5
5
  logo: ImageProps['src'];
6
6
  isSkippable?: boolean;
7
+ requireMobileNumber?: boolean;
7
8
  }
8
9
  export declare function KYCDefault(props: KYCDefaultProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import Image from 'next/image';
3
3
  import { useShallow } from 'zustand/shallow';
4
+ import { useAccountQuery } from '../../../client/hooks/useAccountQuery.js';
4
5
  import { useGlobalStore } from '../../../client/hooks/useGlobalStore.js';
5
6
  import { useSessionQuery } from '../../../client/hooks/useSessionQuery.js';
6
7
  import { Dialog } from '../../../ui/Dialog/index.js';
@@ -19,7 +20,12 @@ export function KYCDefault(props) {
19
20
  })));
20
21
  const kyc = useKYCDefault(props?.isSkippable ?? false);
21
22
  const { isLoading: sessionLoading } = useSessionQuery();
22
- const isDialogOpen = !globalStore.kycReminder.open && globalStore.kyc.open && !sessionLoading;
23
+ const accountQuery = useAccountQuery();
24
+ const account = accountQuery.data;
25
+ const baseCondition = !globalStore.kycReminder.open && globalStore.kyc.open && !sessionLoading;
26
+ const isDialogOpen = props.requireMobileNumber
27
+ ? baseCondition && !!account?.mobileNumber
28
+ : baseCondition;
23
29
  return (_jsxs(_Fragment, { children: [_jsx(KYCDefaultContext, { value: kyc, children: _jsx(Dialog.Root, { open: isDialogOpen, onOpenChange: (details) => {
24
30
  globalStore.kyc.setOpen(details.open);
25
31
  }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "fixed top-[57px] overflow-hidden", children: _jsx(Dialog.Content, { className: "mx-auto h-full w-full overflow-y-auto bg-bg-primary-alt md:max-h-[95vh] lg:w-fit", children: _jsxs("div", { className: "mt-[calc(var(--safe-area-inset-top)*3)] flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit lg:w-[400px]", children: [_jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(IdentityVerification, {}), kyc.step === 2 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props })] }));
@@ -1,4 +1,4 @@
1
- export declare function SingleSignOn(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function SingleSignOn(): import("react/jsx-runtime").JSX.Element | null;
2
2
  export declare function VerifyMobileNumber({ onClose }: {
3
3
  onClose?: () => void;
4
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { zodResolver } from '@hookform/resolvers/zod';
4
4
  import Image from 'next/image';
5
5
  import { useParams, useRouter, useSearchParams } from 'next/navigation';
@@ -45,6 +45,8 @@ export function SingleSignOn() {
45
45
  toaster.error({
46
46
  description: 'Account creation failed',
47
47
  });
48
+ setIsSsoOpen(false);
49
+ router.push('/');
48
50
  },
49
51
  });
50
52
  // biome-ignore lint/correctness/useExhaustiveDependencies: We only want to trigger the mutation when the URL parameters change.
@@ -54,12 +56,18 @@ export function SingleSignOn() {
54
56
  ssoMutation.mutate({ partnerId, token });
55
57
  }
56
58
  }, [partnerId, token]);
57
- return (_jsxs(_Fragment, { children: [_jsx(Dialog.Root, { open: isSsoOpen, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex h-[333px] w-[375px] flex-col items-center space-y-4 bg-[#111827] p-6 text-center justify-between", style: {
58
- backgroundImage: `url(${lightBg.src})`,
59
- }, children: [_jsxs("div", { className: 'flex flex-col items-center', children: [_jsx(Image, { src: inplayLogo, alt: "inplay logo", width: 82, height: 34, className: "h-auto w-[82px] " }), ssoMutation.isError ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-[#CECFD2] text-sm mt-4", children: "Account creation failed. Please try again." }), _jsx(Button, { type: "button", className: 'mt-4', onClick: () => router.push('/'), children: "Back to home page" })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "mb-4 h-7 w-7 animate-spin rounded-full border-4 border-[#101730] border-t-[#F05027]" }), _jsx("div", { className: "text-[#CECFD2] text-sm", children: "We're creating an account for you..." }), _jsx("div", { className: "text-[#CECFD2] text-sm", children: "In the meantime, you can watch your favorite series on CinePop!" })] }))] }), _jsxs("div", { className: "pt-3", children: [_jsx(Image, { src: cinePopLogo, alt: "cine poplogo", width: 151, height: 24, className: "mx-auto mb-2 h-auto w-[151px]" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Image, { src: secretConfessionsLogo, alt: "secret confessions logo", width: 104, height: 53, className: "h-auto w-[104px]" }), _jsx(Image, { src: dearUtolLogo, alt: "dear utol logo", width: 105, height: 53, className: "h-auto w-[105px]" }), _jsx(Image, { src: mariasDiary, alt: "maria's diary logo", width: 104, height: 53, className: "h-auto w-[104px]" })] })] })] }) })] }) }), showVerifyDialog && (_jsx(VerifyMobileNumber, { onClose: () => {
60
- setShowVerifyDialog(false);
61
- router.push('/');
62
- } }))] }));
59
+ if (ssoMutation.isPending) {
60
+ return (_jsx(Dialog.Root, { open: isSsoOpen, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex h-[333px] w-[375px] flex-col items-center space-y-4 bg-[#111827] p-6 text-center", style: {
61
+ backgroundImage: `url(${lightBg.src})`,
62
+ }, children: [_jsx(Image, { src: inplayLogo, alt: "inplay logo", width: 82, height: 34, className: "h-auto w-[82px]" }), _jsx("div", { className: "mb-4 h-7 w-7 animate-spin rounded-full border-4 border-[#101730] border-t-[#F05027]" }), _jsx("div", { className: "text-[#CECFD2] text-sm", children: "We\u2019re creating an account for you..." }), _jsx("div", { className: "text-[#CECFD2] text-sm", children: "In the meantime, you can watch your favorite series on CinePop!" }), _jsxs("div", { className: "pt-3", children: [_jsx(Image, { src: cinePopLogo, alt: "cine poplogo", width: 151, height: 24, className: "mx-auto mb-2 h-auto w-[151px]" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Image, { src: secretConfessionsLogo, alt: "secret confessions logo", width: 104, height: 53, className: "h-auto w-[104px]" }), _jsx(Image, { src: dearUtolLogo, alt: "dear utol logo", width: 105, height: 53, className: "h-auto w-[105px]" }), _jsx(Image, { src: mariasDiary, alt: "maria's diary logo", width: 104, height: 53, className: "h-auto w-[104px]" })] })] })] }) })] }) }));
63
+ }
64
+ if (showVerifyDialog) {
65
+ return (_jsx(VerifyMobileNumber, { onClose: () => {
66
+ setShowVerifyDialog(false);
67
+ router.push('/');
68
+ } }));
69
+ }
70
+ return null;
63
71
  }
64
72
  export function VerifyMobileNumber({ onClose }) {
65
73
  const [step, setStep] = useState(1);
@@ -5,6 +5,7 @@ import Image from 'next/image';
5
5
  import { useRef, useState } from 'react';
6
6
  import { Controller, useForm } from 'react-hook-form';
7
7
  import z from 'zod';
8
+ import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
8
9
  import { useCooldown } from '../../client/hooks/useCooldown.js';
9
10
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
10
11
  import { useMobileNumberParser } from '../../client/hooks/useMobileNumberParser.js';
@@ -20,6 +21,11 @@ import { Field } from '../../ui/Field/index.js';
20
21
  import { PinInput } from '../../ui/PinInput/index.js';
21
22
  import { Portal } from '../../ui/Portal/index.js';
22
23
  export function UpdateMobileNumber({ onClose }) {
24
+ const accountQuery = useAccountQuery();
25
+ const account = accountQuery.data;
26
+ const isAccountLoading = accountQuery.isLoading;
27
+ const hasMobileNumber = !!account?.mobileNumber;
28
+ const isDialogOpen = !isAccountLoading && !!account && !hasMobileNumber;
23
29
  const [step, setStep] = useState(1);
24
30
  const sendVerificationCodeMutation = useSendVerificationCodeMutation({
25
31
  onSuccess: () => {
@@ -45,8 +51,8 @@ export function UpdateMobileNumber({ onClose }) {
45
51
  onClose?.();
46
52
  },
47
53
  onError: (err) => {
48
- const errorMessage = err.name === 'Forbidden'
49
- ? 'Please enter the correct verification code'
54
+ const errorMessage = err.message === 'Internal Server Error'
55
+ ? `mobile number ${mobileNumberParser.format(step1Form.getValues('mobileNumber'))} is not available`
50
56
  : err.message;
51
57
  toaster.error({
52
58
  title: 'Sign In Failed',
@@ -96,13 +102,12 @@ export function UpdateMobileNumber({ onClose }) {
96
102
  duration: 1000 * 60,
97
103
  });
98
104
  const formRef = useRef(null);
99
- return (_jsx(Dialog.Root, { open: true, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex w-[375px] flex-col items-center space-y-4 rounded-xl bg-[#111827] p-6 text-center", style: {
105
+ return (_jsx(Dialog.Root, { open: isDialogOpen, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { className: "flex items-center", children: _jsxs(Dialog.Content, { className: "flex w-[375px] flex-col items-center space-y-4 rounded-xl bg-[#111827] p-6 text-center", style: {
100
106
  backgroundImage: `url(${lightBg.src})`,
101
107
  }, children: [_jsx(Image, { src: inplayLogo, alt: "inplay logo", width: 82, height: 34, className: "h-auto w-[82px]" }), _jsxs("div", { children: [step === 1 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "font-bold text-sm", children: ["Get ", _jsx("span", { className: "text-[#F05127]", children: "\u20B150 Bonus" }), " when you verify your account and play."] }), _jsxs("form", { className: "mt-3xl", onSubmit: step1Form.handleSubmit(async (data) => {
102
108
  sendVerificationCodeMutation.mutateAsync({
103
109
  channel: 'SMS',
104
110
  recipient: mobileNumberParser.format(data.mobileNumber),
105
- strict: true,
106
111
  });
107
112
  }), children: [_jsxs(Field.Root, { invalid: !!step1Form.formState.errors.mobileNumber, className: "text-left", children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx("div", { className: "-translate-y-1/2 absolute top-1/2 left-3.5 flex shrink-0 items-center gap-md", children: _jsx("span", { className: "text-text-placeholder", children: localeInfo.mobileNumber.areaCode }) }), _jsx(Field.Input, { style: {
108
113
  paddingLeft: `calc(1.25rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,